changeset 95:517348a7b543

More work on mpExportMachinePRG().
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 06 Jul 2018 02:10:59 +0300
parents 6e74d45ea620
children 2d4b56e4d966
files exporters.pde
diffstat 1 files changed, 18 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/exporters.pde	Fri Jul 06 01:05:31 2018 +0300
+++ b/exporters.pde	Fri Jul 06 02:10:59 2018 +0300
@@ -392,19 +392,21 @@
 {
     // any common text headers
     String src = ";machine=" + str(machine) + " (" + g_name + ")\n";
+    String bsrc = "";
 
     if (machine == C64) { //C64 HIRES
 
         mpLoadTemplate("c64show.prg");
         mpSetDataOffs(0x0227);
-        src += mpExportBitmapData(40, 25);
+        bsrc = mpExportBitmapData(40, 25);
+
         mpSetDataOffs(0x2167);
         mpWriteByte(g_map[0]); //=border
         mpSetDataOffs(0x2168);
         mpWriteByte(g_map[1]); //=background mutta ei tarvita
         mpSetDataOffs(0x2169);
         src += "; The following two first values are border and background\n";
-        mpExportColorData(40, 25, 65536, 0);
+        src += mpExportColorData(40, 25, 65536, 0);
 
         //c64show.prg
         //offsets
@@ -417,7 +419,7 @@
 
         mpLoadTemplate("c64mshow.prg");
         mpSetDataOffs(0x0239);
-        src += mpExportBitmapData(40, 25);
+        bsrc = mpExportBitmapData(40, 25);
 
         // first color information
         mpSetDataOffs(0x2179);
@@ -426,12 +428,12 @@
         mpWriteByte(g_map[1]);
         mpSetDataOffs(0x217B);
         src += "; The following two first values are border and background\n";
-        mpExportColorData(40, 25, 65536, 1);
+        src += mpExportColorData(40, 25, 65536, 1);
 
         // second color information
         mpSetDataOffs(0x2563);
         src += "; The following goes to $D800 onwards\n";
-        mpExportColorData(40, 25, 65536 + 2000, 2);
+        src += mpExportColorData(40, 25, 65536 + 2000, 2);
 
         //c64 multicolor
         //offsets
@@ -452,7 +454,7 @@
         src += "  .global _back2\n";
         src += "_bitmap:\n";
         mpSetDataOffs(0x013e);
-        src += mpExportBitmapData(40, 25);
+        bsrc = mpExportBitmapData(40, 25);
         src += "_border:\n";
         val1 = getpluscolor(int(g_map[0]));
         val2 = getplusluminance(int(g_map[0]));
@@ -476,10 +478,10 @@
         src += "  .byte " + val3 +"\n";
         src += "_color1:\n";
         mpSetDataOffs(0x2081);
-        mpExportColorData(40, 25, 65536, 6);
+        src += mpExportColorData(40, 25, 65536, 6);
         src += "_color2:\n";
         mpSetDataOffs(0x2469);
-        mpExportColorData(40, 25, 65536, 7);
+        src += mpExportColorData(40, 25, 65536, 7);
         //plus4 multic
         //0x013e bitmap (40 x 25 x 8)
         //0x207e border
@@ -497,7 +499,7 @@
         src += "  .global _border\n";
         src += "_bitmap:\n";
         mpSetDataOffs(0x0137);
-        src += mpExportBitmapData(40, 25);
+        bsrc = mpExportBitmapData(40, 25);
         val1 = getpluscolor(int(g_map[0]));
         val2 = getplusluminance(int(g_map[0]));
         val3 = val2 * 16 + val1;
@@ -505,9 +507,9 @@
         mpWriteByte(val3); //border
 
         mpSetDataOffs(0x2078);
-        mpExportColorData(40, 25, 65536, 4); //colors
+        src += mpExportColorData(40, 25, 65536, 4); //colors
         mpSetDataOffs(0x2460);
-        mpExportColorData(40, 25, 65536, 5); //lumis
+        src += mpExportColorData(40, 25, 65536, 5); //lumis
         //plus4 hires
         //0x0137   bitmap (40 x 25 x 8)
         //0x2077   borderi
@@ -521,7 +523,7 @@
         src += "\t.globl _nimi1,_nimi2\n";
         src += "\t.area _CODE\n";
         src += "_nimi1:\n";
-        src += mpExportBitmapData(32, 24);
+        bsrc = mpExportBitmapData(32, 24);
         mpSetDataOffs(0x18f9);
         //mpWriteByte(g_map[1]); //backg
         //src += "; The first following value is background\n";
@@ -618,7 +620,7 @@
         mpLoadTemplate("cpc-mode0.bin");
 
         mpSetDataOffs(69); //bitmap offset
-        src += mpExportBitmapData_CPC(160, 200);
+        bsrc = mpExportBitmapData_CPC(160, 200);
         mpSetDataOffs(16453);
         src += ";palette\n";
         src += ".byte ";
@@ -660,7 +662,7 @@
 
     // any common lead-outs
     if (sorsa)
-        return src;
+        return src +"\n"+ bsrc;
     else
         return g_template;
 }
@@ -938,7 +940,8 @@
         }
         src += "\n";
     }
-    src += "\n";
+
+    return src +"\n";
 }