@@ -30,9 +30,11 @@ static UINT8 DrvJoy4[16];
30
30
static UINT8 DrvDips[2 ] = { 0 , 0 };
31
31
static UINT16 DrvInputs[4 ];
32
32
static UINT8 DrvReset;
33
- static UINT32 MegaCart;
34
- static UINT32 MegaCartBank;
33
+ static UINT32 MegaCart; // MegaCart size
34
+ static UINT32 MegaCartBank; // current Bank
35
+ static UINT32 MegaCartBanks; // total banks
35
36
37
+ static INT32 use_EEPROM = 0 ;
36
38
static INT32 use_SGM = 0 ;
37
39
static INT32 SGM_map_24k;
38
40
static INT32 SGM_map_8k;
@@ -376,19 +378,25 @@ static INT32 DrvDoReset()
376
378
return 0 ;
377
379
}
378
380
379
- #if 0
380
381
static void __fastcall main_write (UINT16 address, UINT8 data)
381
382
{
382
383
// maybe we should support bankswitching on writes too?
383
- //bprintf(0, _T("mw %X,"), address);
384
+
385
+ if (use_EEPROM) { // for boxxle
386
+ switch (address)
387
+ {
388
+ case 0xff90 :
389
+ case 0xffa0 :
390
+ case 0xffb0 :
391
+ MegaCartBank = (address >> 4 ) & 3 ;
392
+ return ;
393
+ }
394
+ }
384
395
}
385
- #endif
386
396
387
397
static UINT8 __fastcall main_read (UINT16 address)
388
398
{
389
399
if (address >= 0xffc0 /* && address <= 0xffff*/ ) {
390
- UINT32 MegaCartBanks = MegaCart / 0x4000 ;
391
-
392
400
MegaCartBank = (0xffff - address) & (MegaCartBanks - 1 );
393
401
394
402
MegaCartBank = (MegaCartBanks - MegaCartBank) - 1 ;
@@ -452,7 +460,7 @@ static INT32 DrvInit()
452
460
} else if ((ri.nType & BRF_PRG) && (i<10 )) { // Load rom thats not in 0x2000 (8k) chunks
453
461
bprintf (0 , _T (" ColecoVision romload (unsegmented) #%d size: %X\n " ), i, ri.nLen );
454
462
BurnLoadRom (DrvCartROM, i, 1 );
455
- if (ri.nLen >= 0x20000 ) MegaCart = ri.nLen ;
463
+ if (ri.nLen >= 0x10000 ) MegaCart = ri.nLen ;
456
464
}
457
465
}
458
466
}
@@ -465,9 +473,17 @@ static INT32 DrvInit()
465
473
ZetMapMemory (DrvZ80RAM, i + 0x0000 , i + 0x03ff , MAP_RAM);
466
474
}
467
475
468
- if (MegaCart) {
476
+ if (use_EEPROM) { // similar to MegaCart but with diff. mapper addresses
477
+ // Boxxle
478
+ MegaCartBanks = MegaCart / 0x4000 ;
479
+ bprintf (0 , _T (" ColecoVision BoxxleCart mapping.\n " ));
480
+ ZetMapMemory (DrvCartROM, 0x8000 , 0xbfff , MAP_ROM);
481
+ ZetSetReadHandler (main_read);
482
+ ZetSetWriteHandler (main_write);
483
+ }
484
+ else if (MegaCart) {
469
485
// MegaCart
470
- UINT32 MegaCartBanks = MegaCart / 0x4000 ;
486
+ MegaCartBanks = MegaCart / 0x4000 ;
471
487
UINT32 lastbank = (MegaCartBanks - 1 ) * 0x4000 ;
472
488
bprintf (0 , _T (" ColecoVision MegaCart: mapping cartrom[%X] to 0x8000 - 0xbfff.\n " ), lastbank);
473
489
ZetMapMemory (DrvCartROM + lastbank, 0x8000 , 0xbfff , MAP_ROM);
@@ -501,6 +517,14 @@ static INT32 DrvInitSGM() // w/SGM
501
517
return DrvInit ();
502
518
}
503
519
520
+ static INT32 DrvInitEEPROM () // w/EEPROM (boxxle)
521
+ {
522
+ // 24cXX e2prom isn't actually supported, but the game works fine (minus highscore saving)
523
+ use_EEPROM = 1 ;
524
+
525
+ return DrvInit ();
526
+ }
527
+
504
528
static INT32 DrvExit ()
505
529
{
506
530
TMS9928AExit ();
@@ -511,6 +535,7 @@ static INT32 DrvExit()
511
535
BurnFree (AllMem);
512
536
513
537
use_SGM = 0 ;
538
+ use_EEPROM = 0 ;
514
539
515
540
return 0 ;
516
541
}
@@ -602,6 +627,9 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
602
627
SCAN_VAR (joy_mode);
603
628
SCAN_VAR (joy_status);
604
629
SCAN_VAR (last_state);
630
+ SCAN_VAR (MegaCartBank);
631
+ SCAN_VAR (SGM_map_24k);
632
+ SCAN_VAR (SGM_map_8k);
605
633
}
606
634
607
635
return 0 ;
@@ -5243,3 +5271,61 @@ struct BurnDriver BurnDrvcv_buckrogsgm = {
5243
5271
DrvInitSGM, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL , TMS9928A_PALETTE_SIZE,
5244
5272
272 , 228 , 4 , 3
5245
5273
};
5274
+
5275
+ // Boxxle
5276
+
5277
+ static struct BurnRomInfo cv_boxxleRomDesc[] = {
5278
+ { " boxxle_colecovision.rom" , 0x10000 , 0x62dacf07 , BRF_PRG | BRF_ESS },
5279
+ };
5280
+
5281
+ STDROMPICKEXT (cv_boxxle, cv_boxxle, cv_coleco)
5282
+ STD_ROM_FN(cv_boxxle)
5283
+
5284
+ struct BurnDriver BurnDrvcv_boxxle = {
5285
+ " cv_boxxle" , NULL , " cv_coleco" , NULL , " 2015" ,
5286
+ " Boxxle\0 " , NULL , " Coleco" , " ColecoVision" ,
5287
+ NULL , NULL , NULL , NULL ,
5288
+ BDF_GAME_WORKING, 2 , HARDWARE_COLECO, GBF_MISC, 0 ,
5289
+ CVGetZipName, cv_boxxleRomInfo, cv_boxxleRomName, NULL , NULL , NULL , NULL , ColecoInputInfo, ColecoDIPInfo,
5290
+ DrvInitEEPROM, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL , TMS9928A_PALETTE_SIZE,
5291
+ 272 , 228 , 4 , 3
5292
+ };
5293
+
5294
+ // Module Man
5295
+
5296
+ static struct BurnRomInfo cv_modulemanRomDesc[] = {
5297
+ { " module-man-2013.rom" , 0x08000 , 0xeb6be8ec , BRF_PRG | BRF_ESS },
5298
+ };
5299
+
5300
+ STDROMPICKEXT (cv_moduleman, cv_moduleman, cv_coleco)
5301
+ STD_ROM_FN(cv_moduleman)
5302
+
5303
+ struct BurnDriver BurnDrvcv_moduleman = {
5304
+ " cv_moduleman" , NULL , " cv_coleco" , NULL , " 2013" ,
5305
+ " Module Man\0 " , NULL , " Coleco" , " ColecoVision" ,
5306
+ NULL , NULL , NULL , NULL ,
5307
+ BDF_GAME_WORKING, 2 , HARDWARE_COLECO, GBF_MISC, 0 ,
5308
+ CVGetZipName, cv_modulemanRomInfo, cv_modulemanRomName, NULL , NULL , NULL , NULL , ColecoInputInfo, ColecoDIPInfo,
5309
+ DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL , TMS9928A_PALETTE_SIZE,
5310
+ 272 , 228 , 4 , 3
5311
+ };
5312
+
5313
+ // Star Fortress
5314
+
5315
+ static struct BurnRomInfo cv_starfortressRomDesc[] = {
5316
+ { " star-fortress.rom" , 0x04000 , 0xf7f18e6f , BRF_PRG | BRF_ESS },
5317
+ };
5318
+
5319
+ STDROMPICKEXT (cv_starfortress, cv_starfortress, cv_coleco)
5320
+ STD_ROM_FN(cv_starfortress)
5321
+
5322
+ struct BurnDriver BurnDrvcv_starfortress = {
5323
+ " cv_starfortress" , NULL , " cv_coleco" , NULL , " 1997" ,
5324
+ " Star Fortress\0 " , NULL , " Coleco" , " ColecoVision" ,
5325
+ NULL , NULL , NULL , NULL ,
5326
+ BDF_GAME_WORKING, 2 , HARDWARE_COLECO, GBF_MISC, 0 ,
5327
+ CVGetZipName, cv_starfortressRomInfo, cv_starfortressRomName, NULL , NULL , NULL , NULL , ColecoInputInfo, ColecoDIPInfo,
5328
+ DrvInit, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL , TMS9928A_PALETTE_SIZE,
5329
+ 272 , 228 , 4 , 3
5330
+ };
5331
+
0 commit comments