mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
memory: allow SRAM word writes
Was allowing both low and high byte writes by byte, but not word, which was stupid.
This commit is contained in:
parent
2b15cea82e
commit
1dd0871f20
1 changed files with 6 additions and 3 deletions
|
@ -448,11 +448,14 @@ static void PicoWrite16_sram(u32 a, u32 d)
|
|||
EEPROM_write16(d);
|
||||
}
|
||||
else {
|
||||
// XXX: hardware could easily use MSB too..
|
||||
u8 *pm = (u8 *)(SRam.data - SRam.start + a);
|
||||
if (*pm != (u8)d) {
|
||||
if (pm[0] != (u8)(d >> 8)) {
|
||||
SRam.changed = 1;
|
||||
*pm = (u8)d;
|
||||
pm[0] = (u8)(d >> 8);
|
||||
}
|
||||
if (pm[1] != (u8)d) {
|
||||
SRam.changed = 1;
|
||||
pm[1] = (u8)d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue