WRAM: Fixed out-of-bounds memory access on register reads
This commit is contained in:
parent
27476a08ab
commit
72c17966b9
1 changed files with 3 additions and 1 deletions
|
@ -27,7 +27,9 @@ public:
|
|||
if(addr >= 0x2140 && addr <= 0x217F) {
|
||||
return _spc->Read(addr & 0x03);
|
||||
} else if(addr == 0x2180) {
|
||||
return _workRam[_wramPosition++];
|
||||
uint8_t value = _workRam[_wramPosition];
|
||||
_wramPosition = (_wramPosition + 1) & 0x1FFFF;
|
||||
return value;
|
||||
} else {
|
||||
return _ppu->Read(addr);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue