summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2010-03-22 17:56:48 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2010-03-22 17:56:48 +0000
commitef6e27822afc242027df6ea32db31ad7f4fe7aa6 (patch)
tree11ed53ebc5eea3bdcabbcee7a7d677b2a4ec1223
parentc8d1935c0297709e8e6674f72d4f890c5e9de6b6 (diff)
not worth mention: dynax.c: fixed a few games which were trying to access rom banks beyond the last one
-rw-r--r--src/mame/drivers/dynax.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index 283597d3b91..d6d58787e79 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -287,8 +287,13 @@ static WRITE8_HANDLER( jantouki_sound_rombank_w )
static WRITE8_HANDLER( hnoridur_rombank_w )
{
dynax_state *state = (dynax_state *)space->machine->driver_data;
+ int bank_n = (memory_region_length(space->machine, "maincpu") - 0x10000) / 0x8000;
+
//logerror("%04x: rom bank = %02x\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank1", data);
+ if (data < bank_n)
+ memory_set_bank(space->machine, "bank1", data);
+ else
+ logerror("rom_bank = %02x (larger than the maximum bank %02x)\n", data, bank_n);
state->hnoridur_bank = data;
}