Skip to content

Commit

Permalink
coprocessor: Implement SA1 I-RAM write protection
Browse files Browse the repository at this point in the history
  • Loading branch information
Morilli authored and orbea committed Sep 22, 2024
1 parent cfdacfd commit d4129ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/coprocessor/sa1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ uint8_t SA1::IRAM::readCPU(unsigned address, uint8_t data) {

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

Expand All @@ -273,6 +274,7 @@ uint8_t SA1::IRAM::readSA1(unsigned address, uint8_t data) {
}

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

Expand Down

0 comments on commit d4129ec

Please sign in to comment.