diff exporters.pde @ 225:1c9deae71fb1

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 05 Sep 2018 20:28:23 +0300
parents 33a5c7670e66
children 2d424d096281
line wrap: on
line diff
--- a/exporters.pde	Wed Sep 05 20:08:57 2018 +0300
+++ b/exporters.pde	Wed Sep 05 20:28:23 2018 +0300
@@ -234,14 +234,17 @@
         }
     }
     else
-    if (g_machine == C64) {
+    if (g_machine == C64)
+    {
         //0x0002->bitmap
         //0x1f42->colormap
         //0x232a=border (take the lower nybble)
-        if (fdata.length < 9006) {
+        if (fdata.length < 9006)
+        {
             return false;
         }
-        if (fdata.length >= 0x232a) {
+        if (fdata.length >= 0x232a)
+        {
             g_map[0] = byte(fdata[0x232a] & 0x0f);
         }
         for (y = 0; y < 25; y++)
@@ -259,12 +262,14 @@
         }
     }
     else
-    if (g_machine == PLUS4) { // Botticelli
+    if (g_machine == PLUS4)
+    { // Botticelli
         //g.hires.prg = botticelli
         //2 - luminance 40*25
         //1026 - colors 40*25
         //2050 - bitmappi 40*25*8
-        if (fdata.length < 10050) {
+        if (fdata.length < 10050)
+        {
             return false;
         }
         int l1, l2;
@@ -286,14 +291,16 @@
         }
     }
     else
-    if (g_machine == PLUS4M) { // Multi Botticelli
+    if (g_machine == PLUS4M)
+    { // Multi Botticelli
         //m.multi.prg = multi botticelli
         //2- lumins 40*25
         //1024 - bäkki1
         //1025 - bäkki2
         //1026 - colors 40*25
         //2050 - bitmap 40*25*8
-        if (fdata.length < 10050) {
+        if (fdata.length < 10050)
+        {
             return false;
         }
         int l1, l2;
@@ -323,14 +330,16 @@
         g_map[2] = byte(convertluminance(l1, p1));
     }
     else
-    if (g_machine == C64M) { //advanced art studio
+    if (g_machine == C64M)
+    { //advanced art studio
         //adv. art studio (=multicolor) 10018 bytes
         //0x0002 bitmap (40*25*8)
         //0x1f42 colors1 (40*25)
         //0x232a border
         //0x232b background
         //0x233a colors2 (40*25)
-        if (fdata.length < 10018) {
+        if (fdata.length < 10018)
+        {
             return false;
         }
         for (y = 0; y < 25; y++)
@@ -353,13 +362,15 @@
         g_map[1] = byte(fdata[0x232b] & 0x0f); //baku
     }
     else
-    if (g_machine == C64FLIM) {
+    if (g_machine == C64FLIM)
+    {
         // FBI Crew FLI designer 1.x & 2.0 (unpacked)
         //    { DO_COPY      , DS_COLOR_RAM   , 0x0000, 0,  0,   0, NULL, NULL },
         //    DEF_SCREEN_RAMS_8(0x0400, 0, 0x400, 0),
         //    { DO_COPY      , DS_BITMAP_RAM  , 0x2400, 0,  0,   0, NULL, NULL },
         //    { DO_LAST      , 0              , 0     , 0,  0,   0, NULL, NULL },
-        if (fdata.length != 17409) {
+        if (fdata.length != 17409)
+        {
             // TODO XXX: Check for load addresses 3c00 and 3ff0
             return false;
         }
@@ -384,10 +395,12 @@
         g_map[1] = byte(0); //baku
     }
     else
-    if (g_machine == MSX) { // sc2
+    if (g_machine == MSX)
+    { // sc2
         // 7=bitmap 32*24*8
         // 7+(32*24*8)=colormap 32*24
-        if (fdata.length < 14343) {
+        if (fdata.length < 14343)
+        {
             return false;
         }
         for (y = 0; y < 24; y++)
@@ -410,7 +423,8 @@
         }
     }
     else
-    if (g_machine == CPC) { // a studio?
+    if (g_machine == CPC)
+    { // a studio?
         return false;
     }
 
@@ -426,7 +440,8 @@
     int val1, val2, val3;
     int y, y2, yy, x, yp, xp, ad, valu, valu2, bri;
 
-    if (g_machine == PLUS4) { // botticelli hires
+    if (g_machine == PLUS4)
+    { // botticelli hires
         ctx.loadTemplate("g.hires.prg");
 
         ctx.setOffs(0x02);
@@ -439,7 +454,8 @@
         mpExportBitmapData(ctx, 40, 25);
     }
     else
-    if (g_machine == PLUS4M) { // multi botticelli multicolor
+    if (g_machine == PLUS4M)
+    { // multi botticelli multicolor
         ctx.loadTemplate("m.multi.prg");
 
         val2 = getpluscolor(int(g_map[1]));
@@ -462,7 +478,8 @@
         mpExportBitmapData(ctx, 40, 25);
     }
     else
-    if (g_machine == C64) {
+    if (g_machine == C64)
+    {
         ctx.loadTemplate("hires.art");
 
         ctx.setOffs(2);
@@ -474,7 +491,8 @@
         ctx.writeByteAt(0x232a, g_map[0]);
     }
     else
-    if (g_machine == C64M) {
+    if (g_machine == C64M)
+    {
         if (subformat == 0)
         {
             // Advanced Art Studio
@@ -510,7 +528,8 @@
         }
     }
     else
-    if (g_machine == C64FLIM) {
+    if (g_machine == C64FLIM)
+    {
         // FBI Crew FLI designer 1.x & 2.0 (unpacked)
         //    { DO_COPY      , DS_COLOR_RAM   , 0x0000, 0,  0,   0, NULL, NULL },
         //    DEF_SCREEN_RAMS_8(0x0400, 0, 0x400, 0),
@@ -531,7 +550,8 @@
         mpExportBitmapData(ctx, 40, 25);
     }
     else
-    if (g_machine == MSX) {
+    if (g_machine == MSX)
+    {
         ctx.loadTemplate("msx-screen2.sc2");
 
         ctx.setOffs(7);
@@ -541,7 +561,8 @@
         mpExportColorData(ctx, 32, 24, 65536, 3); //there's an exception for msx-style
     }
     else
-    if (g_machine == SPECTRUM) {
+    if (g_machine == SPECTRUM)
+    {
         ctx.loadTemplate("zx-screen.scr");
 
         ctx.setOffs(0);
@@ -598,7 +619,8 @@
     // any common text headers
     ctx.addComment("g_machine=" + str(g_machine) + " (" + g_name + ")");
 
-    if (g_machine == C64) { //C64 HIRES
+    if (g_machine == C64)
+    { //C64 HIRES
         ctx.loadTemplate("c64show.prg");
 
         ctx.setOffs(0x0227);
@@ -619,7 +641,8 @@
         //0x2169->värikartta (40x25 bytee, nyppelit foreg/backg)
     }
     else
-    if (g_machine == C64M) { //C64 MULTICOLOR
+    if (g_machine == C64M)
+    { //C64 MULTICOLOR
         ctx.loadTemplate("c64mshow.prg");
 
         ctx.setOffs(0x0239);
@@ -648,7 +671,8 @@
         //0x2563->värikartta 2 (40x25 bytee, nyppeli 3-väri nepan osoitteessa $d800-)
     }
     else
-    if (g_machine == PLUS4M) { //PLUS4 MULTICOLOR
+    if (g_machine == PLUS4M)
+    { //PLUS4 MULTICOLOR
         ctx.loadTemplate("showpfourm.prg");
 
         ctx.addLine(".global @@_bitmap");
@@ -700,7 +724,8 @@
         //0x2469 luminance (40 x 25)
     }
     else
-    if (g_machine == PLUS4) { // Plus 4 hires
+    if (g_machine == PLUS4)
+    { // Plus 4 hires
         ctx.loadTemplate("showpfour.prg");
 
         ctx.addLine(".global @@_bitmap");
@@ -732,7 +757,8 @@
         //0x2460   luminance (40 x 25)
     }
     else
-    if (g_machine == MSX) { // MSX
+    if (g_machine == MSX)
+    { // MSX
         ctx.loadTemplate("msxshow.com");
 
         ctx.addLine(".globl @@_bitmap,@@_nimi2");
@@ -755,7 +781,8 @@
         //0x18fa colors (32*24 bytes)
     }
     else
-    if (g_machine == SPECTRUM) { // ZX Spectrum
+    if (g_machine == SPECTRUM)
+    { // ZX Spectrum
 
         //would need some cleaning up
 
@@ -828,7 +855,8 @@
         ctx.writeByteAt(0x1d3e, int(checksum), "_checksum");
     }
     else
-    if (g_machine == CPC) {
+    if (g_machine == CPC)
+    {
         int val1, val2, val3, valu;
         ctx.loadTemplate("cpc-mode0.bin");
 
@@ -1015,7 +1043,8 @@
     else
         xmult = width;
 
-    if (g_machine == MSX) {
+    if (g_machine == MSX)
+    {
         myrpsi = 7;
     }
 
@@ -1108,10 +1137,12 @@
     erkki = 1;
     limitter = 2;
 
-    if (g_britemode == 1) {
+    if (g_britemode == 1)
+    {
         xcolors = 8;
     }
-    if (g_attrimode == 0) {
+    if (g_attrimode == 0)
+    {
         vertti = 1;
         erkki = 8;
     }