mirror of https://github.com/stella-emu/stella.git
small improvement on FC bankswitching
This commit is contained in:
parent
dbfc6ef3a5
commit
7ae5b49633
|
@ -946,12 +946,12 @@ bool CartDetector::isProbablyFA2(const ByteBuffer& image, size_t)
|
|||
bool CartDetector::isProbablyFC(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// FC bankswitching uses consecutive writes to 3 hotspots
|
||||
uInt8 signature[2][6] = {
|
||||
uInt8 signature[3][6] = {
|
||||
{ 0x8d, 0xf8, 0x1f, 0x4a, 0x4a, 0x8d }, // STA $1FF8, LSR, LSR, STA... Power Play Arcade Menus, 3-D Ghost Attack
|
||||
{ 0x8d, 0xf8, 0xff, 0x8d, 0xfc, 0xff }, // STA $FFF8, STA $FFFC Surf's Up (4K)
|
||||
//{ 0x8c, 0xf9, 0xff, 0xad, 0xfc, 0xff } // STY $FFF9, LDA $FFFC 3-D Havoc (patched for F8, ignore!)
|
||||
{ 0x8c, 0xf9, 0xff, 0xad, 0xfc, 0xff } // STY $FFF9, LDA $FFFC 3-D Havoc
|
||||
};
|
||||
for (uInt32 i = 0; i < 2; ++i)
|
||||
for (uInt32 i = 0; i < 3; ++i)
|
||||
if (searchForBytes(image.get(), size, signature[i], 6, 1))
|
||||
return true;
|
||||
|
||||
|
|
|
@ -86,8 +86,14 @@ bool CartridgeFC::poke(uInt16 address, uInt8 value)
|
|||
|
||||
case 0x0FF9:
|
||||
// Set the high bits of target 4k bank
|
||||
if (value << 2 < bankCount())
|
||||
{
|
||||
myTargetBank += value << 2;
|
||||
myTargetBank %= bankCount();
|
||||
}
|
||||
else
|
||||
// special handling when both values are identical (e.g. 4/4 or 5/5)
|
||||
myTargetBank = value % bankCount();
|
||||
break;
|
||||
|
||||
case 0x0FFC:
|
||||
|
|
Loading…
Reference in New Issue