Skip to content
This repository was archived by the owner on Nov 16, 2022. It is now read-only.

Commit 4169481

Browse files
committed
d_coleco: add Boxxle, Star Fortress and Module Man
1 parent 7415ac2 commit 4169481

File tree

1 file changed

+96
-10
lines changed

1 file changed

+96
-10
lines changed

src/burn/drv/coleco/d_coleco.cpp

+96-10
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ static UINT8 DrvJoy4[16];
3030
static UINT8 DrvDips[2] = { 0, 0 };
3131
static UINT16 DrvInputs[4];
3232
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
3536

37+
static INT32 use_EEPROM = 0;
3638
static INT32 use_SGM = 0;
3739
static INT32 SGM_map_24k;
3840
static INT32 SGM_map_8k;
@@ -376,19 +378,25 @@ static INT32 DrvDoReset()
376378
return 0;
377379
}
378380

379-
#if 0
380381
static void __fastcall main_write(UINT16 address, UINT8 data)
381382
{
382383
// 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+
}
384395
}
385-
#endif
386396

387397
static UINT8 __fastcall main_read(UINT16 address)
388398
{
389399
if (address >= 0xffc0/* && address <= 0xffff*/) {
390-
UINT32 MegaCartBanks = MegaCart / 0x4000;
391-
392400
MegaCartBank = (0xffff - address) & (MegaCartBanks - 1);
393401

394402
MegaCartBank = (MegaCartBanks - MegaCartBank) - 1;
@@ -452,7 +460,7 @@ static INT32 DrvInit()
452460
} else if ((ri.nType & BRF_PRG) && (i<10)) { // Load rom thats not in 0x2000 (8k) chunks
453461
bprintf(0, _T("ColecoVision romload (unsegmented) #%d size: %X\n"), i, ri.nLen);
454462
BurnLoadRom(DrvCartROM, i, 1);
455-
if (ri.nLen >= 0x20000) MegaCart = ri.nLen;
463+
if (ri.nLen >= 0x10000) MegaCart = ri.nLen;
456464
}
457465
}
458466
}
@@ -465,9 +473,17 @@ static INT32 DrvInit()
465473
ZetMapMemory(DrvZ80RAM, i + 0x0000, i + 0x03ff, MAP_RAM);
466474
}
467475

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) {
469485
// MegaCart
470-
UINT32 MegaCartBanks = MegaCart / 0x4000;
486+
MegaCartBanks = MegaCart / 0x4000;
471487
UINT32 lastbank = (MegaCartBanks - 1) * 0x4000;
472488
bprintf(0, _T("ColecoVision MegaCart: mapping cartrom[%X] to 0x8000 - 0xbfff.\n"), lastbank);
473489
ZetMapMemory(DrvCartROM + lastbank, 0x8000, 0xbfff, MAP_ROM);
@@ -501,6 +517,14 @@ static INT32 DrvInitSGM() // w/SGM
501517
return DrvInit();
502518
}
503519

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+
504528
static INT32 DrvExit()
505529
{
506530
TMS9928AExit();
@@ -511,6 +535,7 @@ static INT32 DrvExit()
511535
BurnFree (AllMem);
512536

513537
use_SGM = 0;
538+
use_EEPROM = 0;
514539

515540
return 0;
516541
}
@@ -602,6 +627,9 @@ static INT32 DrvScan(INT32 nAction, INT32 *pnMin)
602627
SCAN_VAR(joy_mode);
603628
SCAN_VAR(joy_status);
604629
SCAN_VAR(last_state);
630+
SCAN_VAR(MegaCartBank);
631+
SCAN_VAR(SGM_map_24k);
632+
SCAN_VAR(SGM_map_8k);
605633
}
606634

607635
return 0;
@@ -5243,3 +5271,61 @@ struct BurnDriver BurnDrvcv_buckrogsgm = {
52435271
DrvInitSGM, DrvExit, DrvFrame, TMS9928ADraw, DrvScan, NULL, TMS9928A_PALETTE_SIZE,
52445272
272, 228, 4, 3
52455273
};
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

Comments
 (0)