mapper 002 - workaround for "Top Gun" issue #621, need test if this isn't broke something other

mapper 012 - added hardware dip for language select
UNIF PEC-586 - fixed render finally, added 512K cartridges suppport, TODO: PEC keyboard
This commit is contained in:
CaH4e3 2013-09-15 10:41:42 +00:00
parent a6c62b4b5f
commit 0220dabeb4
6 changed files with 92 additions and 73 deletions

View File

@ -36,12 +36,15 @@ static SFORMAT StateRegs[] =
}; };
static void Sync(void) { static void Sync(void) {
setprg4(0x5000, 16); // Only YS-612 advanced version setprg4(0x5000, 8 << 1); // Only YS-612 advanced version
setprg8(0x6000, swap?0:2); setprg8(0x6000, swap?0:2);
setprg8(0x8000, 1); setprg8(0x8000, 1);
setprg8(0xa000, 0); setprg8(0xa000, 0);
setprg8(0xc000, reg); setprg8(0xc000, reg);
setprg8(0xe000, swap?8:9); setprg8(0xe000, swap?8:9); // hard dump for mr.Mary is 128K,
// bank 9 is the last 2K ok bank 8 repeated 4 times, then till the end of 128K
// instead used bank A, containing some CHR data, ines rom have unused banks removed,
// and bank A moved to the bank 9 place for compatibility with other crappy dumps
setchr8(0); setchr8(0);
} }

View File

@ -30,7 +30,7 @@ static void (*WSync)(void);
static DECLFW(LatchWrite) { static DECLFW(LatchWrite) {
// FCEU_printf("bs %04x %02x\n",A,V); // FCEU_printf("bs %04x %02x\n",A,V);
if (bus_conflict) if (bus_conflict)
latche = V & CartBR(A); latche = (V == CartBR(A)) ? V : 0;
else else
latche = V; latche = V;
WSync(); WSync();

View File

@ -33,7 +33,7 @@ uint32 WRAMSIZE;
uint8 *CHRRAM; uint8 *CHRRAM;
uint32 CHRRAMSIZE; uint32 CHRRAMSIZE;
uint8 DRegBuf[8]; uint8 DRegBuf[8];
uint8 EXPREGS[8]; /* For bootleg games, mostly. */ uint8 EXPREGS[8]; /* For bootleg games, mostly. */
uint8 A000B, A001B; uint8 A000B, A001B;
uint8 mmc3opts = 0; uint8 mmc3opts = 0;
@ -79,7 +79,7 @@ void FixMMC3PRG(int V) {
} else { } else {
pwrap(0x8000, DRegBuf[6]); pwrap(0x8000, DRegBuf[6]);
pwrap(0xC000, ~1); pwrap(0xC000, ~1);
} }
pwrap(0xA000, DRegBuf[7]); pwrap(0xA000, DRegBuf[7]);
pwrap(0xE000, ~0); pwrap(0xE000, ~0);
} }
@ -216,11 +216,11 @@ void GenMMC3Restore(int version) {
} }
static void GENCWRAP(uint32 A, uint8 V) { static void GENCWRAP(uint32 A, uint8 V) {
setchr1(A, V); // Business Wars NEEDS THIS for 8K CHR-RAM setchr1(A, V); // Business Wars NEEDS THIS for 8K CHR-RAM
} }
static void GENPWRAP(uint32 A, uint8 V) { static void GENPWRAP(uint32 A, uint8 V) {
setprg8(A, V & 0x7F); // [NJ102] Mo Dao Jie (C) has 1024Mb MMC3 BOARD, maybe something other will be broken setprg8(A, V & 0x7F); // [NJ102] Mo Dao Jie (C) has 1024Mb MMC3 BOARD, maybe something other will be broken
} }
static void GENMWRAP(uint8 V) { static void GENMWRAP(uint8 V) {
@ -305,11 +305,11 @@ void GenMMC3_Init(CartInfo *info, int prg, int chr, int wram, int battery) {
info->Reset = MMC3RegReset; info->Reset = MMC3RegReset;
info->Close = GenMMC3Close; info->Close = GenMMC3Close;
if (info->CRC32 == 0x5104833e) // Kick Master if (info->CRC32 == 0x5104833e) // Kick Master
GameHBIRQHook = MMC3_hb_KickMasterHack; GameHBIRQHook = MMC3_hb_KickMasterHack;
else if (info->CRC32 == 0x5a6860f1 || info->CRC32 == 0xae280e20) // Shougi Meikan '92/'93 else if (info->CRC32 == 0x5a6860f1 || info->CRC32 == 0xae280e20)// Shougi Meikan '92/'93
GameHBIRQHook = MMC3_hb_KickMasterHack; GameHBIRQHook = MMC3_hb_KickMasterHack;
else if (info->CRC32 == 0xfcd772eb) // PAL Star Wars, similar problem as Kick Master. else if (info->CRC32 == 0xfcd772eb) // PAL Star Wars, similar problem as Kick Master.
GameHBIRQHook = MMC3_hb_PALStarWarsHack; GameHBIRQHook = MMC3_hb_PALStarWarsHack;
else else
GameHBIRQHook = MMC3_hb; GameHBIRQHook = MMC3_hb;
@ -322,7 +322,7 @@ void GenMMC3_Init(CartInfo *info, int prg, int chr, int wram, int battery) {
// ---------------------------- Mapper 4 -------------------------------- // ---------------------------- Mapper 4 --------------------------------
static int hackm4 = 0; /* For Karnov, maybe others. BLAH. Stupid iNES format.*/ static int hackm4 = 0; /* For Karnov, maybe others. BLAH. Stupid iNES format.*/
static void M4Power(void) { static void M4Power(void) {
GenMMC3Power(); GenMMC3Power();
@ -353,10 +353,22 @@ static DECLFW(M12Write) {
EXPREGS[1] = (V & 0x10) >> 4; EXPREGS[1] = (V & 0x10) >> 4;
} }
static DECLFR(M12Read) {
return EXPREGS[2];
}
static void M12Power(void) { static void M12Power(void) {
EXPREGS[0] = EXPREGS[1] = 0; EXPREGS[0] = EXPREGS[1] = 0;
EXPREGS[2] = 1; // chinese is default
GenMMC3Power(); GenMMC3Power();
SetWriteHandler(0x4100, 0x5FFF, M12Write); SetWriteHandler(0x4100, 0x5FFF, M12Write);
SetReadHandler(0x4100, 0x5FFF, M12Read);
}
static void M12Reset(void) {
EXPREGS[0] = EXPREGS[1] = 0;
EXPREGS[2] ^= 1;
MMC3RegReset();
} }
void Mapper12_Init(CartInfo *info) { void Mapper12_Init(CartInfo *info) {
@ -365,6 +377,7 @@ void Mapper12_Init(CartInfo *info) {
isRevB = 0; isRevB = 0;
info->Power = M12Power; info->Power = M12Power;
info->Reset = M12Reset;
AddExState(EXPREGS, 2, 0, "EXPR"); AddExState(EXPREGS, 2, 0, "EXPR");
} }
@ -461,7 +474,7 @@ static void M45CW(uint32 A, uint8 V) {
NV &= (1 << ((EXPREGS[2] & 7) + 1)) - 1; NV &= (1 << ((EXPREGS[2] & 7) + 1)) - 1;
else else
if (EXPREGS[2]) if (EXPREGS[2])
NV &= 0; // hack ;( don't know exactly how it should be NV &= 0; // hack ;( don't know exactly how it should be
NV |= EXPREGS[0] | ((EXPREGS[2] & 0xF0) << 4); NV |= EXPREGS[0] | ((EXPREGS[2] & 0xF0) << 4);
setchr1(A, NV); setchr1(A, NV);
} }
@ -609,7 +622,7 @@ static void M52PW(uint32 A, uint8 V) {
static void M52CW(uint32 A, uint8 V) { static void M52CW(uint32 A, uint8 V) {
uint32 mask = 0xFF ^ ((EXPREGS[0] & 0x40) << 1); uint32 mask = 0xFF ^ ((EXPREGS[0] & 0x40) << 1);
// uint32 bank = (((EXPREGS[0]>>3)&4)|((EXPREGS[0]>>1)&2)|((EXPREGS[0]>>6)&(EXPREGS[0]>>4)&1))<<7; // uint32 bank = (((EXPREGS[0]>>3)&4)|((EXPREGS[0]>>1)&2)|((EXPREGS[0]>>6)&(EXPREGS[0]>>4)&1))<<7;
uint32 bank = (((EXPREGS[0] >> 4) & 2) | (EXPREGS[0] & 4) | ((EXPREGS[0] >> 6) & (EXPREGS[0] >> 4) & 1)) << 7; // actually 256K CHR banks index bits is inverted! uint32 bank = (((EXPREGS[0] >> 4) & 2) | (EXPREGS[0] & 4) | ((EXPREGS[0] >> 6) & (EXPREGS[0] >> 4) & 1)) << 7; // actually 256K CHR banks index bits is inverted!
setchr1(A, bank | (V & mask)); setchr1(A, bank | (V & mask));
} }
@ -659,7 +672,7 @@ void Mapper76_Init(CartInfo *info) {
// ---------------------------- Mapper 74 ------------------------------- // ---------------------------- Mapper 74 -------------------------------
static void M74CW(uint32 A, uint8 V) { static void M74CW(uint32 A, uint8 V) {
if ((V == 8) || (V == 9)) //Di 4 Ci - Ji Qi Ren Dai Zhan (As).nes, Ji Jia Zhan Shi (As).nes if ((V == 8) || (V == 9)) //Di 4 Ci - Ji Qi Ren Dai Zhan (As).nes, Ji Jia Zhan Shi (As).nes
setchr1r(0x10, A, V); setchr1r(0x10, A, V);
else else
setchr1r(0, A, V); setchr1r(0, A, V);
@ -735,7 +748,7 @@ void Mapper114_Init(CartInfo *info) {
static void M115PW(uint32 A, uint8 V) { static void M115PW(uint32 A, uint8 V) {
if (EXPREGS[0] & 0x80) { if (EXPREGS[0] & 0x80) {
if (EXPREGS[0] & 0x20) if (EXPREGS[0] & 0x20)
setprg32(0x8000, (EXPREGS[0] & 0x0F) >> 1); // real hardware tests, info 100% now lol setprg32(0x8000, (EXPREGS[0] & 0x0F) >> 1); // real hardware tests, info 100% now lol
else { else {
setprg16(0x8000, (EXPREGS[0] & 0x0F)); setprg16(0x8000, (EXPREGS[0] & 0x0F));
setprg16(0xC000, (EXPREGS[0] & 0x0F)); setprg16(0xC000, (EXPREGS[0] & 0x0F));
@ -750,7 +763,7 @@ static void M115CW(uint32 A, uint8 V) {
static DECLFW(M115Write) { static DECLFW(M115Write) {
if (A == 0x5080) if (A == 0x5080)
EXPREGS[2] = V; // Extra prot hardware 2-in-1 mode EXPREGS[2] = V; // Extra prot hardware 2-in-1 mode
else if (A == 0x6000) else if (A == 0x6000)
EXPREGS[0] = V; EXPREGS[0] = V;
else if (A == 0x6001) else if (A == 0x6001)
@ -940,7 +953,7 @@ void Mapper192_Init(CartInfo *info) {
// ---------------------------- Mapper 194 ------------------------------- // ---------------------------- Mapper 194 -------------------------------
static void M194CW(uint32 A, uint8 V) { static void M194CW(uint32 A, uint8 V) {
if (V <= 1) //Dai-2-Ji - Super Robot Taisen (As).nes if (V <= 1) //Dai-2-Ji - Super Robot Taisen (As).nes
setchr1r(0x10, A, V); setchr1r(0x10, A, V);
else else
setchr1r(0, A, V); setchr1r(0, A, V);
@ -957,7 +970,7 @@ void Mapper194_Init(CartInfo *info) {
// ---------------------------- Mapper 195 ------------------------------- // ---------------------------- Mapper 195 -------------------------------
static void M195CW(uint32 A, uint8 V) { static void M195CW(uint32 A, uint8 V) {
if (V <= 3) // Crystalis (c).nes, Captain Tsubasa Vol 2 - Super Striker (C) if (V <= 3) // Crystalis (c).nes, Captain Tsubasa Vol 2 - Super Striker (C)
setchr1r(0x10, A, V); setchr1r(0x10, A, V);
else else
setchr1r(0, A, V); setchr1r(0, A, V);
@ -1028,7 +1041,7 @@ void Mapper196_Init(CartInfo *info) {
// all data bits merged, because it's using one of them as 8000 reg... // all data bits merged, because it's using one of them as 8000 reg...
static void UNLMaliSBPW(uint32 A, uint8 V) { static void UNLMaliSBPW(uint32 A, uint8 V) {
setprg8(A, (V & 3)|((V & 8) >> 1)|((V & 4) << 1)); setprg8(A, (V & 3) | ((V & 8) >> 1) | ((V & 4) << 1));
} }
static void UNLMaliSBCW(uint32 A, uint8 V) { static void UNLMaliSBCW(uint32 A, uint8 V) {
@ -1076,7 +1089,7 @@ void Mapper197_Init(CartInfo *info) {
// ---------------------------- Mapper 198 ------------------------------- // ---------------------------- Mapper 198 -------------------------------
static void M198PW(uint32 A, uint8 V) { static void M198PW(uint32 A, uint8 V) {
if (V >= 0x50) // Tenchi o Kurau II - Shokatsu Koumei Den (J) (C).nes if (V >= 0x50) // Tenchi o Kurau II - Shokatsu Koumei Den (J) (C).nes
setprg8(A, V & 0x4F); setprg8(A, V & 0x4F);
else else
setprg8(A, V); setprg8(A, V);
@ -1128,7 +1141,7 @@ static void M205Reset(void) {
static void M205Power(void) { static void M205Power(void) {
GenMMC3Power(); GenMMC3Power();
SetWriteHandler(0x6000, 0x6fff, M205Write0); SetWriteHandler(0x6000, 0x6fff, M205Write0);
SetWriteHandler(0x7000, 0x7fff, M205Write1); // OK-411 boards, the same logic, but data latched, 2-in-1 frankenstein SetWriteHandler(0x7000, 0x7fff, M205Write1); // OK-411 boards, the same logic, but data latched, 2-in-1 frankenstein
} }
void Mapper205_Init(CartInfo *info) { void Mapper205_Init(CartInfo *info) {
@ -1143,7 +1156,7 @@ void Mapper205_Init(CartInfo *info) {
// ---------------------------- Mapper 245 ------------------------------ // ---------------------------- Mapper 245 ------------------------------
static void M245CW(uint32 A, uint8 V) { static void M245CW(uint32 A, uint8 V) {
if (!UNIFchrrama) // Yong Zhe Dou E Long - Dragon Quest VI (As).nes NEEDS THIS for RAM cart if (!UNIFchrrama) // Yong Zhe Dou E Long - Dragon Quest VI (As).nes NEEDS THIS for RAM cart
setchr1(A, V & 7); setchr1(A, V & 7);
EXPREGS[0] = V; EXPREGS[0] = V;
FixMMC3PRG(MMC3_cmd); FixMMC3PRG(MMC3_cmd);
@ -1172,7 +1185,7 @@ static void M249PW(uint32 A, uint8 V) {
if (EXPREGS[0] & 0x2) { if (EXPREGS[0] & 0x2) {
if (V < 0x20) if (V < 0x20)
V = (V & 1) | ((V >> 3) & 2) | ((V >> 1) & 4) | ((V << 2) & 8) | ((V << 2) & 0x10); V = (V & 1) | ((V >> 3) & 2) | ((V >> 1) & 4) | ((V << 2) & 8) | ((V << 2) & 0x10);
else{ else {
V -= 0x20; V -= 0x20;
V = (V & 3) | ((V >> 1) & 4) | ((V >> 4) & 8) | ((V >> 2) & 0x10) | ((V << 3) & 0x20) | ((V << 2) & 0xC0); V = (V & 3) | ((V >> 1) & 4) | ((V >> 4) & 8) | ((V >> 2) & 0x10) | ((V << 3) & 0x20) | ((V << 2) & 0xC0);
} }

View File

@ -20,7 +20,7 @@
#include "mapinc.h" #include "mapinc.h"
static uint8 reg[7], debug = 1; static uint8 reg[8];
static uint32 lastnt = 0; static uint32 lastnt = 0;
static uint8 *WRAM = NULL; static uint8 *WRAM = NULL;
static uint32 WRAMSIZE; static uint32 WRAMSIZE;
@ -33,14 +33,14 @@ static SFORMAT StateRegs[] =
}; };
static uint8 bs_tbl[128] = { static uint8 bs_tbl[128] = {
0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, // 00
0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, // 10
0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, 0x03, 0x13, 0x23, 0x33, // 20
0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, // 30
0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, // 40
0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, 0x45, 0x67, // 50
0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x00, 0x10, 0x20, 0x30, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x02, 0x12, 0x22, 0x32, 0x00, 0x10, 0x20, 0x30, // 60
0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, 0x47, 0x67, // 70
}; };
static uint8 br_tbl[16] = { static uint8 br_tbl[16] = {
@ -48,21 +48,29 @@ static uint8 br_tbl[16] = {
}; };
static void Sync(void) { static void Sync(void) {
if (reg[0]&0x80) { setchr8(0);
setchr4(0x0000, (lastnt >> 9) ^ 0);
setchr4(0x1000, (lastnt >> 9) ^ 1);
} else {
setchr4(0x0000, 1);
setchr4(0x1000, 0);
}
setprg8r(0x10, 0x6000, 0); setprg8r(0x10, 0x6000, 0);
setprg16(0x8000, bs_tbl[reg[0] & 0x7f] >> 4); if(PRGsize[0] == 512 * 1024) {
setprg16(0xc000, bs_tbl[reg[0] & 0x7f] & 0xf); if(reg[0] & 0x010) {
setmirror(MI_V); setprg32(0x8000, reg[0] & 7);
} else {
if(reg[0] & 0x40)
setprg8(0x8000, (reg[0] & 0x0F) | 0x20 | ((reg[0] & 0x20) >> 1));
}
if((reg[0] & 0x18) == 0x18)
setmirror(MI_H);
else
setmirror(MI_V);
} else {
setprg16(0x8000, bs_tbl[reg[0] & 0x7f] >> 4);
setprg16(0xc000, bs_tbl[reg[0] & 0x7f] & 0xf);
setmirror(MI_V);
}
} }
static DECLFW(UNLPEC586Write) { static DECLFW(UNLPEC586Write) {
reg[(A & 0x700) >> 8] = V; reg[(A & 0x700) >> 8] = V;
PEC586Hack = (reg[0] & 0x80) >> 7;
// FCEU_printf("bs %04x %02x\n", A, V); // FCEU_printf("bs %04x %02x\n", A, V);
Sync(); Sync();
} }
@ -72,34 +80,27 @@ static DECLFR(UNLPEC586Read) {
return (X.DB & 0xD8) | br_tbl[reg[4] >> 4]; return (X.DB & 0xD8) | br_tbl[reg[4] >> 4];
} }
static void UNLPEC586Power(void) { static DECLFR(UNLPEC586ReadHi) {
reg[0] = 0x0E; if((reg[0] & 0x10) || ((reg[0] & 0x40) && (A < 0xA000)))
debug ^= 1; return CartBR(A);
Sync(); else
setchr8(0); return PRGptr[0][((0x0107 | ((A >> 7) & 0x0F8)) << 10) | (A & 0x3FF)];
SetReadHandler(0x6000, 0x7FFF, CartBR);
SetWriteHandler(0x6000, 0x7FFF, CartBW);
SetReadHandler(0x8000, 0xFFFF, CartBR);
SetWriteHandler(0x5000, 0x5fff, UNLPEC586Write);
SetReadHandler(0x5000, 0x5fff, UNLPEC586Read);
} }
static void UNLPEC586PPU(uint32 A) { static void UNLPEC586Power(void) {
if (reg[0]&0x80) if(PRGsize[0] == 512 * 1024)
{ reg[0] = 0x00;
if (((A & 0x3FFF) > 0x2000) && ((A & 0x3FFF) < 0x23C0)) { else
uint32 curnt = A & 0x200; reg[0] = 0x0E;
if (curnt != lastnt) { Sync();
setchr4(0x0000, (curnt >> 9) ^ 0); SetReadHandler(0x6000, 0x7FFF, CartBR);
setchr4(0x1000, (curnt >> 9) ^ 1); SetWriteHandler(0x6000, 0x7FFF, CartBW);
lastnt = curnt; if(PRGsize[0] == 512 * 1024)
} SetReadHandler(0x8000, 0xFFFF, UNLPEC586ReadHi);
} else
} else { SetReadHandler(0x8000, 0xFFFF, CartBR);
lastnt = 0; SetWriteHandler(0x5000, 0x5fff, UNLPEC586Write);
setchr4(0x0000, 1); SetReadHandler(0x5000, 0x5fff, UNLPEC586Read);
setchr4(0x1000, 0);
}
} }
static void UNLPEC586Close(void) { static void UNLPEC586Close(void) {
@ -115,11 +116,8 @@ static void StateRestore(int version) {
void UNLPEC586Init(CartInfo *info) { void UNLPEC586Init(CartInfo *info) {
info->Power = UNLPEC586Power; info->Power = UNLPEC586Power;
info->Close = UNLPEC586Close; info->Close = UNLPEC586Close;
PPU_hook = UNLPEC586PPU;
GameStateRestore = StateRestore; GameStateRestore = StateRestore;
PEC586Hack = 1;
WRAMSIZE = 8192; WRAMSIZE = 8192;
WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE); WRAM = (uint8*)FCEU_gmalloc(WRAMSIZE);
SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1); SetupCartPRGMapping(0x10, WRAM, WRAMSIZE, 1);

View File

@ -1034,7 +1034,10 @@ static void RefreshLine(int lastpixel) {
vofs = 0; vofs = 0;
vofs = ((PPU[0] & 0x10) << 8) | ((RefreshAddr >> 12) & 7); if(PEC586Hack)
vofs = ((RefreshAddr & 0x200) << 3) | ((RefreshAddr >> 12) & 7);
else
vofs = ((PPU[0] & 0x10) << 8) | ((RefreshAddr >> 12) & 7);
if (!ScreenON && !SpriteON) { if (!ScreenON && !SpriteON) {
uint32 tem; uint32 tem;
@ -1894,6 +1897,8 @@ struct BGData {
INLINE void Read() { INLINE void Read() {
RefreshAddr = ppur.get_ntread(); RefreshAddr = ppur.get_ntread();
if (PEC586Hack)
ppur.s = (RefreshAddr & 0x200) >> 9;
pecnt = (RefreshAddr & 1) << 3; pecnt = (RefreshAddr & 1) << 3;
nt = CALL_PPUREAD(RefreshAddr); nt = CALL_PPUREAD(RefreshAddr);
runppu(kFetchTime); runppu(kFetchTime);

View File

@ -10,7 +10,7 @@ extern void (*PPU_hook)(uint32 A);
extern void (*GameHBIRQHook)(void), (*GameHBIRQHook2)(void); extern void (*GameHBIRQHook)(void), (*GameHBIRQHook2)(void);
/* For cart.c and banksw.h, mostly */ /* For cart.c and banksw.h, mostly */
extern uint8 NTARAM[0x800],*vnapage[4]; extern uint8 NTARAM[0x800], *vnapage[4];
extern uint8 PPUNTARAM; extern uint8 PPUNTARAM;
extern uint8 PPUCHRRAM; extern uint8 PPUCHRRAM;