Skip to content

Commit

Permalink
Implement SA1 I-RAM write protection
Browse files Browse the repository at this point in the history
  • Loading branch information
Morilli committed Sep 21, 2024
1 parent 710d92c commit 7b6fccf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bsnes/sfc/coprocessor/sa1/iram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ auto SA1::IRAM::readCPU(uint address, uint8 data) -> uint8 {

auto SA1::IRAM::writeCPU(uint address, uint8 data) -> void {
cpu.synchronizeCoprocessors();
if(!(sa1.mmio.siwp & 1 << (address >> 8 & 7))) return;
return write(address, data);
}

Expand All @@ -32,5 +33,6 @@ auto SA1::IRAM::readSA1(uint address, uint8 data) -> uint8 {
}

auto SA1::IRAM::writeSA1(uint address, uint8 data) -> void {
if(!(sa1.mmio.ciwp & 1 << (address >> 8 & 7))) return;
return write(address, data);
}

0 comments on commit 7b6fccf

Please sign in to comment.