Misc mapper updates
- just some misc non-function changing updates
This commit is contained in:
@@ -53,7 +53,7 @@ static void Sync(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static DECLFW(M225Write) {
|
static DECLFW(M225Write) {
|
||||||
uint32 bank = (A >> 14) & 1;
|
uint8 bank = (A >> 14) & 1;
|
||||||
mirr = (A >> 13) & 1;
|
mirr = (A >> 13) & 1;
|
||||||
mode = (A >> 12) & 1;
|
mode = (A >> 12) & 1;
|
||||||
chr = (A & 0x3f) | (bank << 6);
|
chr = (A & 0x3f) | (bank << 6);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ static uint8 *CHRROM;
|
|||||||
static uint32 CHRROMSIZE;
|
static uint32 CHRROMSIZE;
|
||||||
|
|
||||||
static void M269CW(uint32 A, uint8 V) {
|
static void M269CW(uint32 A, uint8 V) {
|
||||||
uint32 NV = V;
|
uint16 NV = V;
|
||||||
if (EXPREGS[2] & 8)
|
if (EXPREGS[2] & 8)
|
||||||
NV &= (1 << ((EXPREGS[2] & 7) + 1)) - 1;
|
NV &= (1 << ((EXPREGS[2] & 7) + 1)) - 1;
|
||||||
NV |= EXPREGS[0] | ((EXPREGS[2] & 0xF0) << 4);
|
NV |= EXPREGS[0] | ((EXPREGS[2] & 0xF0) << 4);
|
||||||
@@ -39,7 +39,7 @@ static void M269CW(uint32 A, uint8 V) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void M269PW(uint32 A, uint8 V) {
|
static void M269PW(uint32 A, uint8 V) {
|
||||||
uint32 MV = V & ((EXPREGS[3] & 0x3F) ^ 0x3F);
|
uint16 MV = V & ((EXPREGS[3] & 0x3F) ^ 0x3F);
|
||||||
MV |= EXPREGS[1];
|
MV |= EXPREGS[1];
|
||||||
MV |= ((EXPREGS[3] & 0x40) << 2);
|
MV |= ((EXPREGS[3] & 0x40) << 2);
|
||||||
setprg8(A, MV);
|
setprg8(A, MV);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ static void M353PPU(uint32 A) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void M353PW(uint32 A, uint8 V) {
|
static void M353PW(uint32 A, uint8 V) {
|
||||||
uint32 bank = V;
|
uint8 bank = V;
|
||||||
|
|
||||||
if (EXPREGS[0] == 2) {
|
if (EXPREGS[0] == 2) {
|
||||||
bank &= 0x0F;
|
bank &= 0x0F;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ static uint32 CHRRAMSIZE = 0;
|
|||||||
|
|
||||||
static void M356CW(uint32 A, uint8 V) {
|
static void M356CW(uint32 A, uint8 V) {
|
||||||
if (EXPREGS[2] & 0x20) {
|
if (EXPREGS[2] & 0x20) {
|
||||||
uint32 NV = V;
|
uint8 NV = V;
|
||||||
if (EXPREGS[2] & 8)
|
if (EXPREGS[2] & 8)
|
||||||
NV &= (1 << ((EXPREGS[2] & 7) + 1)) - 1;
|
NV &= (1 << ((EXPREGS[2] & 7) + 1)) - 1;
|
||||||
else
|
else
|
||||||
@@ -43,7 +43,7 @@ static void M356CW(uint32 A, uint8 V) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void M356PW(uint32 A, uint8 V) {
|
static void M356PW(uint32 A, uint8 V) {
|
||||||
uint32 MV = V & ((EXPREGS[3] & 0x3F) ^ 0x3F);
|
uint8 MV = V & ((EXPREGS[3] & 0x3F) ^ 0x3F);
|
||||||
MV |= EXPREGS[1];
|
MV |= EXPREGS[1];
|
||||||
if (UNIFchrrama)
|
if (UNIFchrrama)
|
||||||
MV |= ((EXPREGS[2] & 0x40) << 2);
|
MV |= ((EXPREGS[2] & 0x40) << 2);
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ static uint8 preg[4];
|
|||||||
static uint8 dipswitch;
|
static uint8 dipswitch;
|
||||||
static uint32 IRQCount, IRQa;
|
static uint32 IRQCount, IRQa;
|
||||||
|
|
||||||
static uint8 banks[8] = { 4, 3, 5, 3, 6, 3, 7, 3 };
|
static const uint8 banks[8] = { 4, 3, 5, 3, 6, 3, 7, 3 };
|
||||||
static uint8 outer_bank[4] = { 0x00, 0x08, 0x10, 0x18 };
|
static const uint8 outer_bank[4] = { 0x00, 0x08, 0x10, 0x18 };
|
||||||
|
|
||||||
static SFORMAT StateRegs[] =
|
static SFORMAT StateRegs[] =
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ static SFORMAT StateRegs[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void Sync(void) {
|
static void Sync(void) {
|
||||||
uint32 prgMask = 0x3F;
|
uint8 prgMask = 0x3F;
|
||||||
uint32 prgOuterBank = (exRegs[0] & 0x38) << 1;
|
uint8 prgOuterBank = (exRegs[0] & 0x38) << 1;
|
||||||
|
|
||||||
switch (exRegs[1] & 3) {
|
switch (exRegs[1] & 3) {
|
||||||
case 0: prgMask = 0x3F; break;
|
case 0: prgMask = 0x3F; break;
|
||||||
@@ -71,9 +71,10 @@ static void Sync(void) {
|
|||||||
if (!UNIFchrrama) {
|
if (!UNIFchrrama) {
|
||||||
switch (mapperNum) {
|
switch (mapperNum) {
|
||||||
case 359: {
|
case 359: {
|
||||||
uint32 chrMask = (exRegs[1] & 0x40) ? 0xFF : 0x7F;
|
uint8 i;
|
||||||
uint32 chrOuterBank = (exRegs[3] << 7);
|
uint8 chrMask = (exRegs[1] & 0x40) ? 0xFF : 0x7F;
|
||||||
uint32 i;
|
uint16 chrOuterBank = (exRegs[3] << 7);
|
||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++)
|
||||||
setchr1(i << 10, (creg[i] & chrMask) | chrOuterBank);
|
setchr1(i << 10, (creg[i] & chrMask) | chrOuterBank);
|
||||||
} break;
|
} break;
|
||||||
@@ -123,19 +124,19 @@ static DECLFW(M359WriteIRQ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static DECLFW(M359WritePRG) {
|
static DECLFW(M359WritePRG) {
|
||||||
uint32 i = A & 3;
|
uint8 i = A & 3;
|
||||||
preg[i] = V;
|
preg[i] = V;
|
||||||
Sync();
|
Sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
static DECLFW(M359WriteCHR) {
|
static DECLFW(M359WriteCHR) {
|
||||||
uint32 i = ((A >> 10) & 4) | (A & 3);
|
uint8 i = ((A >> 10) & 4) | (A & 3);
|
||||||
creg[i] = V;
|
creg[i] = V;
|
||||||
Sync();
|
Sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
static DECLFW(M359WriteEx) {
|
static DECLFW(M359WriteEx) {
|
||||||
uint32 i = A & 3;
|
uint8 i = A & 3;
|
||||||
exRegs[i] = V;
|
exRegs[i] = V;
|
||||||
Sync();
|
Sync();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,6 @@ static uint8 smb2_reg;
|
|||||||
static uint8 smb2j_enabled;
|
static uint8 smb2j_enabled;
|
||||||
static uint16 smb2j_count;
|
static uint16 smb2j_count;
|
||||||
|
|
||||||
static uint32 WRAMSIZE;
|
|
||||||
static uint8 *WRAM;
|
|
||||||
|
|
||||||
static SFORMAT StateRegs[] = {
|
static SFORMAT StateRegs[] = {
|
||||||
{ &mode, 1, "MODE" },
|
{ &mode, 1, "MODE" },
|
||||||
{ &mmc3_reload, 1, "IRQR" },
|
{ &mmc3_reload, 1, "IRQR" },
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ typedef struct {
|
|||||||
|
|
||||||
static TXC txc;
|
static TXC txc;
|
||||||
|
|
||||||
static void (*WSync)(void);
|
static void Dummyfunc(void) { };
|
||||||
|
static void (*WSync)(void) = Dummyfunc;
|
||||||
|
|
||||||
static SFORMAT StateRegs[] =
|
static SFORMAT StateRegs[] =
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user