summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Damian R <damian@sudden-desu.net>2021-07-10 10:48:59 +0900
committer Damian R <damian@sudden-desu.net>2021-07-10 10:48:59 +0900
commit730a86b8b4aa9d24d06bbd4b08510350dbe925e9 (patch)
tree4c95d518220e80e1783433e26463e218989a222b
parent24802a701d935248d8d057b679643efef0dfc503 (diff)
Read/write handlers for PRGRAM access from Main side was using u16 for the calculated offset, causing an overflow and constantly pointing to bank 0. Changed to u32, observed expected results
-rw-r--r--src/mame/machine/megacd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mame/machine/megacd.cpp b/src/mame/machine/megacd.cpp
index 669326e95a3..a1b74c69cd7 100644
--- a/src/mame/machine/megacd.cpp
+++ b/src/mame/machine/megacd.cpp
@@ -750,14 +750,14 @@ void sega_segacd_device::segacd_comms_flags_maincpu_w(offs_t offset, uint16_t da
uint16_t sega_segacd_device::scd_4m_prgbank_ram_r(offs_t offset)
{
- uint16_t realoffset = ((segacd_4meg_prgbank * 0x20000)/2) + offset;
+ uint32_t realoffset = ((segacd_4meg_prgbank * 0x20000)/2) + offset;
return m_prgram[realoffset];
}
void sega_segacd_device::scd_4m_prgbank_ram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
- uint16_t realoffset = ((segacd_4meg_prgbank * 0x20000)/2) + offset;
+ uint32_t realoffset = ((segacd_4meg_prgbank * 0x20000)/2) + offset;
// todo:
// check for write protection? (or does that only apply to writes on the SubCPU side?