Mercurial > hg > forks > multipaint-js
comparison exporters.pde @ 222:0e8011589d76
Preliminary work for implementing C64 FLI multicolor import/export (does not work yet)
in FBI FLI Designer v1.1 format.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 05 Sep 2018 12:57:46 +0300 |
parents | 823672f83ae9 |
children | 33a5c7670e66 |
comparison
equal
deleted
inserted
replaced
221:17f635da5180 | 222:0e8011589d76 |
---|---|
351 } | 351 } |
352 g_map[0] = byte(fdata[0x232a] & 0x0f); //bord | 352 g_map[0] = byte(fdata[0x232a] & 0x0f); //bord |
353 g_map[1] = byte(fdata[0x232b] & 0x0f); //baku | 353 g_map[1] = byte(fdata[0x232b] & 0x0f); //baku |
354 } | 354 } |
355 else | 355 else |
356 if (g_machine == C64FLIM) { | |
357 // FBI Crew FLI designer 1.x & 2.0 (unpacked) | |
358 // { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, | |
359 // DEF_SCREEN_RAMS_8(0x0400, 0, 0x400, 0), | |
360 // { DO_COPY , DS_BITMAP_RAM , 0x2400, 0, 0, 0, NULL, NULL }, | |
361 // { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, | |
362 if (fdata.length != 17409) { | |
363 // TODO XXX: Check for load addresses 3c00 and 3ff0 | |
364 return false; | |
365 } | |
366 for (y = 0; y < 25; y++) | |
367 for (x = 0; x < 40; x++) | |
368 for (y2 = 0; y2 < 8; y2++) | |
369 { | |
370 ad = x + y * 40; | |
371 mpCopyByte(fdata, | |
372 1024 + x * 8 + y * (320 * 8) + y2 * 320, | |
373 0x2402 + x * 8 + y * (40 * 8) + y2); | |
374 | |
375 p1 = fdata[0x0402 + ad] & 0x0f; | |
376 p2 = (fdata[0x0402 + ad] >> 4) & 0x0f; | |
377 p3 = fdata[0x0002 + ad] & 0x0f; | |
378 | |
379 g_map[65536 + x + y * 40] = byte(p1); | |
380 g_map[65536 + x + y * 40 + 1000] = byte(p2); | |
381 g_map[65536 + x + y * 40 + 2000] = byte(p3); | |
382 } | |
383 g_map[0] = byte(0); //bord | |
384 g_map[1] = byte(0); //baku | |
385 } | |
386 else | |
356 if (g_machine == MSX) { // sc2 | 387 if (g_machine == MSX) { // sc2 |
357 // 7=bitmap 32*24*8 | 388 // 7=bitmap 32*24*8 |
358 // 7+(32*24*8)=colormap 32*24 | 389 // 7+(32*24*8)=colormap 32*24 |
359 if (fdata.length < 14343) { | 390 if (fdata.length < 14343) { |
360 return false; | 391 return false; |
475 ctx.setOffs(0x232a); | 506 ctx.setOffs(0x232a); |
476 mpExportColorData(ctx, 40, 25, 65536 + 2000, 2); | 507 mpExportColorData(ctx, 40, 25, 65536 + 2000, 2); |
477 | 508 |
478 ctx.writeByteAt(0x2712, g_map[1] & 0x0f); | 509 ctx.writeByteAt(0x2712, g_map[1] & 0x0f); |
479 } | 510 } |
511 } | |
512 else | |
513 if (g_machine == C64FLIM) { | |
514 // FBI Crew FLI designer 1.x & 2.0 (unpacked) | |
515 // { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, | |
516 // DEF_SCREEN_RAMS_8(0x0400, 0, 0x400, 0), | |
517 // { DO_COPY , DS_BITMAP_RAM , 0x2400, 0, 0, 0, NULL, NULL }, | |
518 // { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, | |
519 ctx.loadTemplate("fbifd.fd1"); | |
520 | |
521 ctx.setOffs(2); | |
522 mpExportColorData(ctx, 40, 25, 65536 + 2000, 2); | |
523 | |
524 for (int nbank = 1; nbank <= 8; nbank++) | |
525 { | |
526 ctx.setOffs(2 + nbank * 0x0400); | |
527 mpExportColorData(ctx, 40, 25, 65536, 1); | |
528 } | |
529 | |
530 ctx.setOffs(0x2402); | |
531 mpExportBitmapData(ctx, 40, 25); | |
480 } | 532 } |
481 else | 533 else |
482 if (g_machine == MSX) { | 534 if (g_machine == MSX) { |
483 ctx.loadTemplate("msx-screen2.sc2"); | 535 ctx.loadTemplate("msx-screen2.sc2"); |
484 | 536 |
1948 } | 2000 } |
1949 else | 2001 else |
1950 if (g_machine == C64FLIM) | 2002 if (g_machine == C64FLIM) |
1951 { | 2003 { |
1952 //C64 FLI multicolor | 2004 //C64 FLI multicolor |
1953 g_name = "fli"; | 2005 g_name = "flimc"; |
1954 g_exportext = ""; | 2006 g_exportext = ""; |
1955 g_exportname = "PRG file"; | 2007 g_exportname = "PRG file"; |
1956 g_formatname = ""; | 2008 g_formatname = "FBI FLI Designer 1.0"; |
1957 g_formatext = ""; | 2009 g_formatext = "fd1"; |
1958 | 2010 |
1959 g_hzoomer = 2; | 2011 g_hzoomer = 2; |
1960 g_maxcolors = 16; | 2012 g_maxcolors = 16; |
1961 g_multic = 2; | 2013 g_multic = 2; |
1962 g_attrimode = 0; | 2014 g_attrimode = 0; |