From d26f0bd139a1f1762d064363a89a028c87a98e12 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Wed, 9 Jun 2010 19:35:29 +0000 Subject: [PATCH] Fixed crash regression with spangbl / pangba [Angelo Salese] --- src/mame/drivers/mitchell.c | 2 +- src/mame/includes/mitchell.h | 3 ++- src/mame/video/mitchell.c | 38 ++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c index 4d1e162a80b..8e8465a99de 100644 --- a/src/mame/drivers/mitchell.c +++ b/src/mame/drivers/mitchell.c @@ -352,7 +352,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( spangbl_io_map, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x02) AM_READ(input_r) - AM_RANGE(0x00, 0x00) AM_WRITE(pang_gfxctrl_w) /* Palette bank, layer enable, coin counters, more */ + AM_RANGE(0x00, 0x00) AM_WRITE(pangbl_gfxctrl_w) /* Palette bank, layer enable, coin counters, more */ AM_RANGE(0x02, 0x02) AM_WRITE(pang_bankswitch_w) /* Code bank register */ AM_RANGE(0x03, 0x03) AM_DEVWRITE("ymsnd", ym2413_data_port_w) AM_RANGE(0x04, 0x04) AM_DEVWRITE("ymsnd", ym2413_register_port_w) diff --git a/src/mame/includes/mitchell.h b/src/mame/includes/mitchell.h index 18bf75e1561..d59b471862f 100644 --- a/src/mame/includes/mitchell.h +++ b/src/mame/includes/mitchell.h @@ -11,7 +11,7 @@ class mitchell_state public: static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, mitchell_state(machine)); } - mitchell_state(running_machine &machine) + mitchell_state(running_machine &machine) : audiocpu(machine.device("audiocpu")), oki(machine.device("oki")) { } @@ -58,6 +58,7 @@ READ8_HANDLER( pang_videoram_r ); WRITE8_HANDLER( pang_colorram_w ); READ8_HANDLER( pang_colorram_r ); WRITE8_HANDLER( pang_gfxctrl_w ); +WRITE8_HANDLER( pangbl_gfxctrl_w ); WRITE8_HANDLER( pang_paletteram_w ); READ8_HANDLER( pang_paletteram_r ); diff --git a/src/mame/video/mitchell.c b/src/mame/video/mitchell.c index 2aaf2c8eda7..53a04b69a6f 100644 --- a/src/mame/video/mitchell.c +++ b/src/mame/video/mitchell.c @@ -188,6 +188,44 @@ logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data); /* up marukin - you can see partially built up screens during attract mode. */ } +WRITE8_HANDLER( pangbl_gfxctrl_w ) +{ + mitchell_state *state = (mitchell_state *)space->machine->driver_data; + +logerror("PC %04x: pang_gfxctrl_w %02x\n",cpu_get_pc(space->cpu),data); +{ +#if 0 + char baf[40]; + sprintf(baf,"%02x",data); + popmessage(baf); +#endif +} + + /* bit 0 is unknown (used, maybe back color enable?) */ + + /* bit 1 is coin counter */ + coin_counter_w(space->machine, 0, data & 2); + + /* bit 2 is flip screen */ + if (state->flipscreen != (data & 0x04)) + { + state->flipscreen = data & 0x04; + tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + } + + /* bit 3 is unknown (used, e.g. marukin pulses it on the title screen) */ + + /* bit 4 selects OKI M6295 bank, nop'ed here */ + + /* bit 5 is palette RAM bank selector (doesn't apply to mgakuen) */ + state->paletteram_bank = data & 0x20; + + /* bits 6 and 7 are unknown, used in several places. At first I thought */ + /* they were bg and sprites enable, but this screws up spang (screen flickers */ + /* every time you pop a bubble). However, not using them as enable bits screws */ + /* up marukin - you can see partially built up screens during attract mode. */ +} + WRITE8_HANDLER( mstworld_gfxctrl_w ) { mitchell_state *state = (mitchell_state *)space->machine->driver_data;