From 38bb5b1f51ca34fc6ceb452a393d450830a69514 Mon Sep 17 00:00:00 2001 From: "Alex W. Jackson" Date: Tue, 7 May 2024 17:32:15 -0400 Subject: [PATCH] Make X24C02 only enter read/write state if I2C address matches; fixes SD Gundam Gaiden 2 --- src/boards/bandai.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/boards/bandai.cpp b/src/boards/bandai.cpp index e908a3ae..9f0bbe1a 100644 --- a/src/boards/bandai.cpp +++ b/src/boards/bandai.cpp @@ -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++;