diff --git a/src/burn/drv/capcom/cps.h b/src/burn/drv/capcom/cps.h index 20083c884..8001058f2 100644 --- a/src/burn/drv/capcom/cps.h +++ b/src/burn/drv/capcom/cps.h @@ -238,6 +238,7 @@ extern UINT8* CpsEncZRom; INT32 CpsRwInit(); INT32 CpsRwExit(); INT32 CpsRwGetInp(); +void CpsWritePort(const UINT32 ia, UINT8 d); UINT8 __fastcall CpsReadByte(UINT32 a); void __fastcall CpsWriteByte(UINT32 a, UINT8 d); UINT16 __fastcall CpsReadWord(UINT32 a); diff --git a/src/burn/drv/capcom/cps_rw.cpp b/src/burn/drv/capcom/cps_rw.cpp index 168591b5f..fa20879ce 100644 --- a/src/burn/drv/capcom/cps_rw.cpp +++ b/src/burn/drv/capcom/cps_rw.cpp @@ -283,7 +283,7 @@ static UINT8 CpsReadPort(const UINT32 ia) } // Write output port 0x000-0x1ff -static void CpsWritePort(const UINT32 ia, UINT8 d) +void CpsWritePort(const UINT32 ia, UINT8 d) { if ((Cps & 1) && Cps1Qs == 0) { if (!Cps1DisablePSnd) { diff --git a/src/burn/drv/capcom/d_cps1.cpp b/src/burn/drv/capcom/d_cps1.cpp index 8c566976d..db5132fc6 100644 --- a/src/burn/drv/capcom/d_cps1.cpp +++ b/src/burn/drv/capcom/d_cps1.cpp @@ -11980,22 +11980,20 @@ static INT32 Sf2mdtInit() return nRet; } -static void Sf2hfjbCallback() +void __fastcall Sf2hfjbWriteByte(UINT32 a, UINT8 d) { - *((UINT16*)(CpsRom + 0x1d22a)) = 0x0120; // Fix scroll - *((UINT16*)(CpsRom + 0x21bec)) = 0x0083; - *((UINT16*)(CpsRom + 0x21cf8)) = 0x828e; - *((UINT16*)(CpsRom + 0x21cfa)) = 0x829e; - *((UINT16*)(CpsRom + 0x21cfc)) = 0x82ae; - *((UINT16*)(CpsRom + 0x21d06)) = 0x827f; - *((UINT16*)(CpsRom + 0x21d08)) = 0x828f; - *((UINT16*)(CpsRom + 0x21d0a)) = 0x829f; - *((UINT16*)(CpsRom + 0x21d0c)) = 0x82af; - *((UINT16*)(CpsRom + 0x21d16)) = 0x827e; - *((UINT16*)(CpsRom + 0x21d18)) = 0x82a0; - *((UINT16*)(CpsRom + 0x21d1a)) = 0x822c; - *((UINT16*)(CpsRom + 0x21d1c)) = 0x823c; - *((UINT16*)(CpsRom + 0x21d2a)) = 0x822d; + CpsWritePort(a & 0x1ff, d); +} + +void __fastcall Sf2hfjbWriteWord(UINT32 a, UINT16 d) +{ + if (a == 0x800124) { + // row scroll start register moved in this set + *((UINT16*)(CpsReg + 0x20)) = d; + return; + } + + SEK_DEF_WRITE_WORD(1, a, d); } static INT32 Sf2hfjbInit() @@ -12005,9 +12003,15 @@ static INT32 Sf2hfjbInit() CpsLayer3XOffs = -16; CpsDrawSpritesInReverse = 1; - AmendProgRomCallback = Sf2hfjbCallback; + INT32 nRet = Sf2ceInit(); - return Sf2ceInit(); + SekOpen(0); + SekMapHandler(1, 0x800000, 0x807fff, SM_WRITE); + SekSetWriteByteHandler(1, Sf2hfjbWriteByte); + SekSetWriteWordHandler(1, Sf2hfjbWriteWord); + SekClose(); + + return nRet; } static INT32 Sf2m4Init()