update Mapper90

This commit is contained in:
retro-wertz
2017-04-30 17:35:33 +08:00
parent 1203585fa2
commit 48a1de5c52
2 changed files with 43 additions and 46 deletions

View File

@@ -95,51 +95,49 @@ static void mira(void) {
}
}
static void tekprom(void) { // TODO: verify for single, small multi and large multi
static void tekprom(void) {
uint32 bankmode = ((tkcom[3] & 6) << 5);
switch (tkcom[0] & 7) {
case 00:
if (tkcom[0] & 0x80)
setprg8(0x6000, (((prgb[3] << 2) + 3) & 0x3F) | bankmode);
setprg32(0x8000, (prgb[3] & 7) | ((tkcom[3] & 7) << 3));
break;
case 01:
if (tkcom[0] & 0x80)
setprg8(0x6000, (((prgb[3] << 1) + 1) & 0x3F) | bankmode);
setprg16(0x8000, (prgb[1] & 0x0F) | ((tkcom[3] & 7) << 4));
setprg16(0xC000, 0x0F | ((tkcom[3] & 7) << 4));
break;
case 03: // bit reversion
case 02:
if (tkcom[0] & 0x80)
setprg8(0x6000, (prgb[3] & 0x1F) | ((tkcom[3] & 7) << 5)); // 45in1 multy has different bits, seems board was hacked to support big data banks
setprg8(0x8000, (prgb[0] & 0x1F) | ((tkcom[3] & 7) << 5));
setprg8(0xa000, (prgb[1] & 0x1F) | ((tkcom[3] & 7) << 5));
setprg8(0xc000, (prgb[2] & 0x1F) | ((tkcom[3] & 7) << 5));
setprg8(0xe000, 0x1F | ((tkcom[3] & 7) << 5));
// setprg8(0xe000,(prgb[3]&0x0F)|((tkcom[3]&6)<<3));
// setprg32(0x8000,((prgb[0]&0x0F)>>2)|((tkcom[3]&6)<<3));
break;
case 04:
if (tkcom[0] & 0x80)
setprg8(0x6000, (((prgb[3] << 2) + 3) & 0x3F) | bankmode);
setprg32(0x8000, (prgb[3] & 0x0F) | ((tkcom[3] & 6) << 3));
break;
case 05:
if (tkcom[0] & 0x80)
setprg8(0x6000, (((prgb[3] << 1) + 1) & 0x3F) | bankmode);
setprg16(0x8000, (prgb[1] & 0x1F) | ((tkcom[3] & 6) << 4));
setprg16(0xC000, (prgb[3] & 0x1F) | ((tkcom[3] & 6) << 4));
break;
case 07: // bit reversion
case 06:
if (tkcom[0] & 0x80)
setprg8(0x6000, (prgb[3] & 0x3F) | bankmode);
setprg8(0x8000, (prgb[0] & 0x3F) | bankmode);
setprg8(0xa000, (prgb[1] & 0x3F) | bankmode);
setprg8(0xc000, (prgb[2] & 0x3F) | bankmode);
setprg8(0xe000, (prgb[3] & 0x3F) | bankmode);
break;
case 00:
if (tkcom[0] & 0x80)
setprg8(0x6000, (((prgb[3] << 2) + 3) & 0x3F) | bankmode);
setprg32(0x8000, 0x0F | ((tkcom[3] & 6) << 3));
break;
case 01:
if (tkcom[0] & 0x80)
setprg8(0x6000, (((prgb[3] << 1) + 1) & 0x3F) | bankmode);
setprg16(0x8000, (prgb[1] & 0x1F) | ((tkcom[3] & 6) << 4));
setprg16(0xC000, 0x1F | ((tkcom[3] & 6) << 4));
break;
case 03: // bit reversion
case 02:
if (tkcom[0] & 0x80)
setprg8(0x6000, (prgb[3] & 0x3F) | bankmode);
setprg8(0x8000, (prgb[0] & 0x3F) | bankmode);
setprg8(0xa000, (prgb[1] & 0x3F) | bankmode);
setprg8(0xc000, (prgb[2] & 0x3F) | bankmode);
setprg8(0xe000, 0x3F | bankmode);
break;
case 04:
if (tkcom[0] & 0x80)
setprg8(0x6000, (((prgb[3] << 2) + 3) & 0x3F) | bankmode);
setprg32(0x8000, (prgb[3] & 0x0F) | ((tkcom[3] & 6) << 3));
break;
case 05:
if (tkcom[0] & 0x80)
setprg8(0x6000, (((prgb[3] << 1) + 1) & 0x3F) | bankmode);
setprg16(0x8000, (prgb[1] & 0x1F) | ((tkcom[3] & 6) << 4));
setprg16(0xC000, (prgb[3] & 0x1F) | ((tkcom[3] & 6) << 4));
break;
case 07: // bit reversion
case 06:
if (tkcom[0] & 0x80)
setprg8(0x6000, (prgb[3] & 0x3F) | bankmode);
setprg8(0x8000, (prgb[0] & 0x3F) | bankmode);
setprg8(0xa000, (prgb[1] & 0x3F) | bankmode);
setprg8(0xc000, (prgb[2] & 0x3F) | bankmode);
setprg8(0xe000, (prgb[3] & 0x3F) | bankmode);
break;
}
}
@@ -437,7 +435,6 @@ static void M90Power(void) {
tekvrom();
}
void Mapper90_Init(CartInfo *info) {
is211 = 0;
is209 = 0;

View File

@@ -600,9 +600,9 @@ static BMAPPINGLocal bmap[] = {
{(uint8_t*)"NAMCOT 108 Rev. C", 206, Mapper206_Init}, // Deprecated, Used to be "DEIROM" whatever it means, but actually simple version of MMC3
{(uint8_t*)"TAITO X1-005 Rev. B", 207, Mapper207_Init},
{(uint8_t*)"", 208, Mapper208_Init},
{(uint8_t*)"", 209, Mapper209_Init},
{(uint8_t*)"HUMMER/JY BOARD", 209, Mapper209_Init},
{(uint8_t*)"", 210, Mapper210_Init},
{(uint8_t*)"", 211, Mapper211_Init},
{(uint8_t*)"HUMMER/JY BOARD", 211, Mapper211_Init},
{(uint8_t*)"", 212, Mapper212_Init},
{(uint8_t*)"", 213, Mapper213_Init},
{(uint8_t*)"", 214, Mapper214_Init},