Added patch support to 'WD' scheme.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3136 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2015-01-01 16:50:18 +00:00
parent df5f3c1c5a
commit c03bb5dc6b
1 changed files with 10 additions and 1 deletions

View File

@ -259,7 +259,16 @@ uInt16 CartridgeWD::bankCount() const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool CartridgeWD::patch(uInt16 address, uInt8 value)
{
return false; // TODO
address &= 0x0FFF;
uInt16 idx = address >> 10;
myImage[myOffset[idx] + (address & 0x03FF)] = value;
// The upper segment is mirrored, so we need to patch its buffer too
if(idx == 3)
mySegment3[(address & 0x03FF)] = value;
return true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -