Skip to content

Commit

Permalink
Make X24C02 only enter read/write state if I2C address matches; fixes…
Browse files Browse the repository at this point in the history
… SD Gundam Gaiden 2
  • Loading branch information
awjackson committed May 7, 2024
1 parent c4dd4f5 commit 38bb5b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/boards/bandai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,12 @@ static void x24c02_write(uint8 data) {
x24c02_addr <<= 1;
x24c02_addr |= sda;
} else {
if (sda) // READ COMMAND
if ((x24c02_addr & 0x78) != 0x50) { // WRONG DEVICE ADDRESS
x24c02_out = 1;
x24c02_state = X24C0X_STANDBY;
} else if (sda) // READ COMMAND
x24c02_state = X24C0X_READ;
else // WRITE COMMAND
else // WRITE COMMAND
x24c02_state = X24C0X_WORD;
}
x24c02_bitcount++;
Expand Down

0 comments on commit 38bb5b1

Please sign in to comment.