Previous 199869 Revisions Next

r23870 Sunday 23rd June, 2013 at 10:01:06 UTC by Fabio Priuli
(MESS) sns_sa1: fixing a bunch of out-of-bound rom accesses helps t&e soft games + srobotg + jl96drem to get almost ingame...
[src/mess/machine]sns_sa1.c

trunk/src/mess/machine/sns_sa1.c
r23869r23870
170170   }
171171
172172   if ((offset & 0xc08000) == 0x008000)  //$00-3f:8000-ffff
173      return read_l(space, offset);
173      return read_l(space, (offset & 0x7fffff));
174174
175175   if ((offset & 0xc08000) == 0x808000)  //$80-bf:8000-ffff
176      return read_h(space, offset);
176      return read_h(space, (offset & 0x7fffff));
177177
178178   if ((offset & 0xc00000) == 0xc00000)  //$c0-ff:0000-ffff
179      return read_h(space, offset);
179      return read_h(space, (offset & 0x7fffff));
180180
181181   if ((offset & 0x40e000) == 0x006000)  //$00-3f|80-bf:6000-7fff
182182      return read_bwram(offset);
r23869r23870
781781      return m_rom[rom_bank_map[bank] * 0x8000 + (offset & 0x7fff)];
782782   }
783783   else if (offset < 0x500000)
784      return m_rom[rom_bank_map[(m_bank_c_rom * 0x20) + (offset / 0x8000)] * 0x8000 + (offset & 0x7fff)];
784      return m_rom[rom_bank_map[(m_bank_c_rom * 0x20) + ((offset - 0x400000) / 0x8000)] * 0x8000 + (offset & 0x7fff)];
785785   else if (offset < 0x600000)
786      return m_rom[rom_bank_map[(m_bank_d_rom * 0x20) + (offset / 0x8000)] * 0x8000 + (offset & 0x7fff)];
786      return m_rom[rom_bank_map[(m_bank_d_rom * 0x20) + ((offset - 0x500000) / 0x8000)] * 0x8000 + (offset & 0x7fff)];
787787   else if (offset < 0x700000)
788      return m_rom[rom_bank_map[(m_bank_e_rom * 0x20) + (offset / 0x8000)] * 0x8000 + (offset & 0x7fff)];
788      return m_rom[rom_bank_map[(m_bank_e_rom * 0x20) + ((offset - 0x600000) / 0x8000)] * 0x8000 + (offset & 0x7fff)];
789789   else
790      return m_rom[rom_bank_map[(m_bank_f_rom * 0x20) + (offset / 0x8000)] * 0x8000 + (offset & 0x7fff)];
790      return m_rom[rom_bank_map[(m_bank_f_rom * 0x20) + ((offset - 0x700000) / 0x8000)] * 0x8000 + (offset & 0x7fff)];
791791}
792792
793793WRITE8_MEMBER(sns_sa1_device::write_l)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team