summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2011-03-21 08:33:36 +0000
committer Aaron Giles <aaron@aarongiles.com>2011-03-21 08:33:36 +0000
commit23c4b887a6049fd0760944731994b6ec1fca8ea1 (patch)
tree7270af351b03e0ca7214306baa3596bf26e3d691
parentc6a063f2a73344f82793e20b8a4de74224af07b6 (diff)
Further decouples some driver files to help driver_device
conversions. [Atari Ace] 1. cclimber and galaxian audio code and seibuspi decryption code get their own includes. 2. galpani2 video declarations are moved from kaneko16.h to their own file. 3. cchance and champbwl subclass from tnzs, xevious/bosco/digdug subclass from galaga and vmetal subclasses from metro. 4. yvg608 is made independent of namcond1 5. ettrivia duplicates the palette code from naughtyb 6. mshuttle decryption code is moved into galaxian. 7. tetrisp2_draw_sprites is split into two versions, one for ms32.c, one for tetrisp2.c.
-rw-r--r--src/mame/audio/cclimber.c2
-rw-r--r--src/mame/audio/galaxian.c3
-rw-r--r--src/mame/drivers/cchance.c32
-rw-r--r--src/mame/drivers/cclimber.c1
-rw-r--r--src/mame/drivers/champbwl.c32
-rw-r--r--src/mame/drivers/dambustr.c2
-rw-r--r--src/mame/drivers/ettrivia.c40
-rw-r--r--src/mame/drivers/feversoc.c2
-rw-r--r--src/mame/drivers/galaga.c77
-rw-r--r--src/mame/drivers/galaxian.c61
-rw-r--r--src/mame/drivers/galaxold.c4
-rw-r--r--src/mame/drivers/galpani2.c3
-rw-r--r--src/mame/drivers/seibuspi.c1
-rw-r--r--src/mame/drivers/vmetal.c108
-rw-r--r--src/mame/includes/cclimber.h15
-rw-r--r--src/mame/includes/galaga.h40
-rw-r--r--src/mame/includes/galaxian.h16
-rw-r--r--src/mame/includes/kaneko16.h22
-rw-r--r--src/mame/includes/metro.h11
-rw-r--r--src/mame/includes/namcond1.h9
-rw-r--r--src/mame/includes/seibuspi.h15
-rw-r--r--src/mame/includes/tetrisp2.h1
-rw-r--r--src/mame/includes/tnzs.h8
-rw-r--r--src/mame/machine/cclimber.c36
-rw-r--r--src/mame/machine/namcond1.c5
-rw-r--r--src/mame/machine/seibuspi.c2
-rw-r--r--src/mame/video/bishi.c1
-rw-r--r--src/mame/video/bosco.c18
-rw-r--r--src/mame/video/digdug.c14
-rw-r--r--src/mame/video/galaga.c16
-rw-r--r--src/mame/video/galpani2.c1
-rw-r--r--src/mame/video/ms32.c69
-rw-r--r--src/mame/video/tetrisp2.c63
-rw-r--r--src/mame/video/xevious.c24
-rw-r--r--src/mame/video/ygv608.c15
-rw-r--r--src/mame/video/ygv608.h4
36 files changed, 415 insertions, 358 deletions
diff --git a/src/mame/audio/cclimber.c b/src/mame/audio/cclimber.c
index 9e2bd74555b..a82f49ee781 100644
--- a/src/mame/audio/cclimber.c
+++ b/src/mame/audio/cclimber.c
@@ -1,7 +1,7 @@
#include "emu.h"
#include "sound/ay8910.h"
#include "sound/samples.h"
-#include "includes/cclimber.h"
+#include "audio/cclimber.h"
/* macro to convert 4-bit unsigned samples to 16-bit signed samples */
diff --git a/src/mame/audio/galaxian.c b/src/mame/audio/galaxian.c
index 015c25dc4b2..951861f711f 100644
--- a/src/mame/audio/galaxian.c
+++ b/src/mame/audio/galaxian.c
@@ -21,7 +21,8 @@ TODO:
***************************************************************************/
#include "emu.h"
-#include "includes/galaxian.h"
+#include "sound/discrete.h"
+#include "audio/galaxian.h"
/*************************************
*
diff --git a/src/mame/drivers/cchance.c b/src/mame/drivers/cchance.c
index 2784a55207b..61aeb77434f 100644
--- a/src/mame/drivers/cchance.c
+++ b/src/mame/drivers/cchance.c
@@ -37,6 +37,18 @@ cha3 $10d8
#include "includes/tnzs.h"
#include "sound/ay8910.h"
+
+class cchance_state : public tnzs_state
+{
+public:
+ cchance_state(running_machine &machine, const driver_device_config_base &config)
+ : tnzs_state(machine, config) { }
+
+ UINT8 hop_io;
+ UINT8 bell_io;
+};
+
+
static WRITE8_HANDLER( output_0_w )
{
@@ -49,13 +61,13 @@ static WRITE8_HANDLER( output_0_w )
static READ8_HANDLER( input_1_r )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ cchance_state *state = space->machine->driver_data<cchance_state>();
return (state->hop_io) | (state->bell_io) | (input_port_read(space->machine, "SP") & 0xff);
}
static WRITE8_HANDLER( output_1_w )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ cchance_state *state = space->machine->driver_data<cchance_state>();
state->hop_io = (data & 0x40)>>4;
state->bell_io = (data & 0x80)>>4;
@@ -64,14 +76,14 @@ static WRITE8_HANDLER( output_1_w )
static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE_MEMBER(tnzs_state, objram)
+ AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE_MEMBER(cchance_state, objram)
AM_RANGE(0xc000, 0xdfff) AM_RAM
- AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_BASE_MEMBER(tnzs_state, vdcram)
- AM_RANGE(0xe200, 0xe2ff) AM_RAM AM_BASE_MEMBER(tnzs_state, scrollram) /* scrolling info */
- AM_RANGE(0xe300, 0xe303) AM_RAM AM_MIRROR(0xfc) AM_BASE_MEMBER(tnzs_state, objctrl) /* control registers (0x80 mirror used by Arkanoid 2) */
- AM_RANGE(0xe800, 0xe800) AM_WRITEONLY AM_BASE_MEMBER(tnzs_state, bg_flag) /* enable / disable background transparency */
+ AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_BASE_MEMBER(cchance_state, vdcram)
+ AM_RANGE(0xe200, 0xe2ff) AM_RAM AM_BASE_MEMBER(cchance_state, scrollram) /* scrolling info */
+ AM_RANGE(0xe300, 0xe303) AM_RAM AM_MIRROR(0xfc) AM_BASE_MEMBER(cchance_state, objctrl) /* control registers (0x80 mirror used by Arkanoid 2) */
+ AM_RANGE(0xe800, 0xe800) AM_WRITEONLY AM_BASE_MEMBER(cchance_state, bg_flag) /* enable / disable background transparency */
AM_RANGE(0xf000, 0xf000) AM_READNOP AM_WRITENOP //???
AM_RANGE(0xf001, 0xf001) AM_READ(input_1_r) AM_WRITE(output_0_w)
@@ -183,7 +195,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( cchance )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ cchance_state *state = machine->driver_data<cchance_state>();
state->mcu = NULL;
state->save_item(NAME(state->screenflip));
@@ -193,7 +205,7 @@ static MACHINE_START( cchance )
static MACHINE_RESET( cchance )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ cchance_state *state = machine->driver_data<cchance_state>();
state->screenflip = 0;
state->mcu_type = -1;
@@ -202,7 +214,7 @@ static MACHINE_RESET( cchance )
}
-static MACHINE_CONFIG_START( cchance, tnzs_state )
+static MACHINE_CONFIG_START( cchance, cchance_state )
MCFG_CPU_ADD("maincpu", Z80,4000000) /* ? MHz */
MCFG_CPU_PROGRAM_MAP(main_map)
diff --git a/src/mame/drivers/cclimber.c b/src/mame/drivers/cclimber.c
index e515a74fcc5..4a4c61a033d 100644
--- a/src/mame/drivers/cclimber.c
+++ b/src/mame/drivers/cclimber.c
@@ -207,6 +207,7 @@ Dip location verified from manual for: cclimber, guzzler, swimmer
#include "machine/segacrpt.h"
#include "sound/ay8910.h"
#include "sound/samples.h"
+#include "audio/cclimber.h"
#include "includes/cclimber.h"
diff --git a/src/mame/drivers/champbwl.c b/src/mame/drivers/champbwl.c
index fea0ee805af..3da0e960fd1 100644
--- a/src/mame/drivers/champbwl.c
+++ b/src/mame/drivers/champbwl.c
@@ -157,9 +157,21 @@ Notes:
#include "includes/tnzs.h"
+class champbwl_state : public tnzs_state
+{
+public:
+ champbwl_state(running_machine &machine, const driver_device_config_base &config)
+ : tnzs_state(machine, config) { }
+
+ UINT8 last_trackball_val[2];
+// UINT8 * nvram; // currently this uses generic_nvram
+};
+
+
+
static READ8_HANDLER( trackball_r )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ champbwl_state *state = space->machine->driver_data<champbwl_state>();
UINT8 ret;
UINT8 port4 = input_port_read(space->machine, "FAKEX");
UINT8 port5 = input_port_read(space->machine, "FAKEY");
@@ -185,7 +197,7 @@ static WRITE8_HANDLER( champbwl_misc_w )
static WRITE8_HANDLER( champbwl_objctrl_w )
{
- tnzs_state *state = space->machine->driver_data<tnzs_state>();
+ champbwl_state *state = space->machine->driver_data<champbwl_state>();
if(offset != 0)
data ^= 0xff;
@@ -196,12 +208,12 @@ static ADDRESS_MAP_START( champbwl_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x3fff) AM_ROM AM_REGION("maincpu", 0x10000)
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("nvram")
- AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE_MEMBER(tnzs_state, objram)
+ AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE_MEMBER(champbwl_state, objram)
AM_RANGE(0xc000, 0xdfff) AM_DEVREADWRITE("x1snd", seta_sound_r, seta_sound_w)
- AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_BASE_MEMBER(tnzs_state, vdcram)
- AM_RANGE(0xe200, 0xe2ff) AM_RAM AM_BASE_MEMBER(tnzs_state, scrollram) /* scrolling info */
- AM_RANGE(0xe300, 0xe303) AM_MIRROR(0xfc) AM_WRITE(champbwl_objctrl_w) AM_BASE_MEMBER(tnzs_state, objctrl) /* control registers (0x80 mirror used by Arkanoid 2) */
- AM_RANGE(0xe800, 0xe800) AM_WRITEONLY AM_BASE_MEMBER(tnzs_state, bg_flag) /* enable / disable background transparency */
+ AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_BASE_MEMBER(champbwl_state, vdcram)
+ AM_RANGE(0xe200, 0xe2ff) AM_RAM AM_BASE_MEMBER(champbwl_state, scrollram) /* scrolling info */
+ AM_RANGE(0xe300, 0xe303) AM_MIRROR(0xfc) AM_WRITE(champbwl_objctrl_w) AM_BASE_MEMBER(champbwl_state, objctrl) /* control registers (0x80 mirror used by Arkanoid 2) */
+ AM_RANGE(0xe800, 0xe800) AM_WRITEONLY AM_BASE_MEMBER(champbwl_state, bg_flag) /* enable / disable background transparency */
AM_RANGE(0xf000, 0xf000) AM_READ(trackball_r)
AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN0")
@@ -333,7 +345,7 @@ static const x1_010_interface champbwl_sound_intf =
static MACHINE_START( champbwl )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ champbwl_state *state = machine->driver_data<champbwl_state>();
UINT8 *ROM = machine->region("maincpu")->base();
state->mcu = NULL;
@@ -346,7 +358,7 @@ static MACHINE_START( champbwl )
static MACHINE_RESET( champbwl )
{
- tnzs_state *state = machine->driver_data<tnzs_state>();
+ champbwl_state *state = machine->driver_data<champbwl_state>();
state->screenflip = 0;
state->mcu_type = -1;
@@ -355,7 +367,7 @@ static MACHINE_RESET( champbwl )
}
-static MACHINE_CONFIG_START( champbwl, tnzs_state )
+static MACHINE_CONFIG_START( champbwl, champbwl_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 16000000/4) /* 4MHz */
diff --git a/src/mame/drivers/dambustr.c b/src/mame/drivers/dambustr.c
index 956dd1be84e..2759b641935 100644
--- a/src/mame/drivers/dambustr.c
+++ b/src/mame/drivers/dambustr.c
@@ -49,7 +49,7 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "includes/galaxian.h"
+#include "audio/galaxian.h"
#include "includes/galaxold.h"
#include "machine/7474.h"
diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c
index 26861a22e60..2cfd3f96bb1 100644
--- a/src/mame/drivers/ettrivia.c
+++ b/src/mame/drivers/ettrivia.c
@@ -28,7 +28,7 @@ Notes:
#include "cpu/z80/z80.h"
#include "sound/ay8910.h"
#include "machine/nvram.h"
-#include "includes/naughtyb.h"
+#include "video/resnet.h"
class ettrivia_state : public driver_device
@@ -211,6 +211,42 @@ static TILE_GET_INFO( get_tile_info_fg )
get_tile_info(machine, tileinfo, tile_index, state->fg_videoram, 1);
}
+static PALETTE_INIT( ettrivia )
+{
+ static const int resistances[2] = { 270, 130 };
+ double weights[2];
+ int i;
+
+ /* compute the color output resistor weights */
+ compute_resistor_weights(0, 255, -1.0,
+ 2, resistances, weights, 0, 0,
+ 2, resistances, weights, 0, 0,
+ 0, 0, 0, 0, 0);
+
+ for (i = 0;i < machine->total_colors(); i++)
+ {
+ int bit0, bit1;
+ int r, g, b;
+
+ /* red component */
+ bit0 = (color_prom[i] >> 0) & 0x01;
+ bit1 = (color_prom[i+0x100] >> 0) & 0x01;
+ r = combine_2_weights(weights, bit0, bit1);
+
+ /* green component */
+ bit0 = (color_prom[i] >> 2) & 0x01;
+ bit1 = (color_prom[i+0x100] >> 2) & 0x01;
+ g = combine_2_weights(weights, bit0, bit1);
+
+ /* blue component */
+ bit0 = (color_prom[i] >> 1) & 0x01;
+ bit1 = (color_prom[i+0x100] >> 1) & 0x01;
+ b = combine_2_weights(weights, bit0, bit1);
+
+ palette_set_color(machine, BITSWAP8(i,5,7,6,2,1,0,4,3), MAKE_RGB(r, g, b));
+ }
+}
+
static VIDEO_START( ettrivia )
{
ettrivia_state *state = machine->driver_data<ettrivia_state>();
@@ -277,7 +313,7 @@ static MACHINE_CONFIG_START( ettrivia, ettrivia_state )
MCFG_GFXDECODE(ettrivia)
MCFG_PALETTE_LENGTH(256)
- MCFG_PALETTE_INIT(naughtyb)
+ MCFG_PALETTE_INIT(ettrivia)
MCFG_VIDEO_START(ettrivia)
/* sound hardware */
diff --git a/src/mame/drivers/feversoc.c b/src/mame/drivers/feversoc.c
index 0f247669874..06f568bda6d 100644
--- a/src/mame/drivers/feversoc.c
+++ b/src/mame/drivers/feversoc.c
@@ -60,7 +60,7 @@ U0564 LH28F800SU OBJ4-1
#include "emu.h"
#include "cpu/sh2/sh2.h"
-#include "includes/seibuspi.h"
+#include "machine/seibuspi.h"
#include "sound/okim6295.h"
diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c
index 730d181cb4f..0ee9afb2e6a 100644
--- a/src/mame/drivers/galaga.c
+++ b/src/mame/drivers/galaga.c
@@ -712,10 +712,6 @@ TODO:
#define MASTER_CLOCK (XTAL_18_432MHz)
-static emu_timer *cpu3_interrupt_timer;
-static UINT8 custom_mod;
-
-
static READ8_HANDLER( bosco_dsw_r )
{
@@ -740,6 +736,7 @@ static WRITE8_HANDLER( bosco_flip_screen_w )
static WRITE8_HANDLER( bosco_latch_w )
{
+ galaga_state *state = space->machine->driver_data<galaga_state>();
int bit = data & 1;
switch (offset)
@@ -769,15 +766,15 @@ static WRITE8_HANDLER( bosco_latch_w )
break;
case 0x05: /* MOD 0 (xevious: n.c.) */
- custom_mod = (custom_mod & ~0x01) | (bit << 0);
+ state->custom_mod = (state->custom_mod & ~0x01) | (bit << 0);
break;
case 0x06: /* MOD 1 (xevious: n.c.) */
- custom_mod = (custom_mod & ~0x02) | (bit << 1);
+ state->custom_mod = (state->custom_mod & ~0x02) | (bit << 1);
break;
case 0x07: /* MOD 2 (xevious: n.c.) */
- custom_mod = (custom_mod & ~0x04) | (bit << 2);
+ state->custom_mod = (state->custom_mod & ~0x04) | (bit << 2);
break;
}
}
@@ -845,8 +842,9 @@ static const namco_52xx_interface namco_52xx_intf =
static READ8_DEVICE_HANDLER( custom_mod_r )
{
+ galaga_state *state = device->machine->driver_data<galaga_state>();
/* MOD0-2 is connected to K1-3; K0 is left unconnected */
- return custom_mod << 1;
+ return state->custom_mod << 1;
}
static const namco_53xx_interface namco_53xx_intf =
@@ -864,6 +862,7 @@ static const namco_53xx_interface namco_53xx_intf =
static TIMER_CALLBACK( cpu3_interrupt_callback )
{
+ galaga_state *state = machine->driver_data<galaga_state>();
int scanline = param;
nmi_line_pulse(machine->device("sub2"));
@@ -873,16 +872,18 @@ static TIMER_CALLBACK( cpu3_interrupt_callback )
scanline = 64;
/* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */
- cpu3_interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->cpu3_interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
}
static MACHINE_START( galaga )
{
+ galaga_state *state = machine->driver_data<galaga_state>();
+
/* create the interrupt timer */
- cpu3_interrupt_timer = machine->scheduler().timer_alloc(FUNC(cpu3_interrupt_callback));
- custom_mod = 0;
- state_save_register_global(machine, custom_mod);
+ state->cpu3_interrupt_timer = machine->scheduler().timer_alloc(FUNC(cpu3_interrupt_callback));
+ state->custom_mod = 0;
+ state_save_register_global(machine, state->custom_mod);
}
static void bosco_latch_reset(running_machine *machine)
@@ -897,10 +898,12 @@ static void bosco_latch_reset(running_machine *machine)
static MACHINE_RESET( galaga )
{
+ galaga_state *state = machine->driver_data<galaga_state>();
+
/* Reset all latches */
bosco_latch_reset(machine);
- cpu3_interrupt_timer->adjust(machine->primary_screen->time_until_pos(64), 64);
+ state->cpu3_interrupt_timer->adjust(machine->primary_screen->time_until_pos(64), 64);
}
static MACHINE_RESET( battles )
@@ -920,16 +923,16 @@ static ADDRESS_MAP_START( bosco_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx_0", namco_06xx_data_r, namco_06xx_data_w)
AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx_0", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
AM_RANGE(0x7800, 0x7fff) AM_RAM AM_SHARE("share1")
- AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE(bosco_videoram_w) AM_BASE_MEMBER(_galaga_state, videoram) AM_SHARE("bvr") /* + sprite registers */
+ AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE(bosco_videoram_w) AM_BASE_MEMBER(bosco_state, videoram) AM_SHARE("bvr") /* + sprite registers */
AM_RANGE(0x9000, 0x90ff) AM_DEVREADWRITE("06xx_1", namco_06xx_data_r, namco_06xx_data_w)
AM_RANGE(0x9100, 0x9100) AM_DEVREADWRITE("06xx_1", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
- AM_RANGE(0x9800, 0x980f) AM_WRITEONLY AM_SHARE("share2") AM_BASE_MEMBER(_galaga_state, bosco_radarattr)
+ AM_RANGE(0x9800, 0x980f) AM_WRITEONLY AM_SHARE("share2") AM_BASE_MEMBER(bosco_state, bosco_radarattr)
AM_RANGE(0x9810, 0x9810) AM_WRITE(bosco_scrollx_w)
AM_RANGE(0x9820, 0x9820) AM_WRITE(bosco_scrolly_w)
- AM_RANGE(0x9830, 0x9830) AM_WRITEONLY AM_BASE_MEMBER(_galaga_state, bosco_starcontrol) AM_SHARE("bsc")
+ AM_RANGE(0x9830, 0x9830) AM_WRITEONLY AM_BASE_MEMBER(bosco_state, bosco_starcontrol) AM_SHARE("bsc")
AM_RANGE(0x9840, 0x9840) AM_WRITE(bosco_starclr_w)
AM_RANGE(0x9870, 0x9870) AM_WRITE(bosco_flip_screen_w)
- AM_RANGE(0x9874, 0x9875) AM_WRITEONLY AM_BASE_MEMBER(_galaga_state, bosco_starblink) AM_SHARE("bsb")
+ AM_RANGE(0x9874, 0x9875) AM_WRITEONLY AM_BASE_MEMBER(bosco_state, bosco_starblink) AM_SHARE("bsb")
ADDRESS_MAP_END
@@ -941,11 +944,11 @@ static ADDRESS_MAP_START( galaga_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w)
AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
- AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(galaga_videoram_w) AM_BASE_MEMBER(_galaga_state, videoram) AM_SHARE("gvr")
- AM_RANGE(0x8800, 0x8bff) AM_RAM AM_SHARE("share1") AM_BASE_MEMBER(_galaga_state, galaga_ram1)
- AM_RANGE(0x9000, 0x93ff) AM_RAM AM_SHARE("share2") AM_BASE_MEMBER(_galaga_state, galaga_ram2)
- AM_RANGE(0x9800, 0x9bff) AM_RAM AM_SHARE("share3") AM_BASE_MEMBER(_galaga_state, galaga_ram3)
- AM_RANGE(0xa000, 0xa005) AM_WRITEONLY AM_BASE_MEMBER(_galaga_state, galaga_starcontrol) AM_SHARE("gsc")
+ AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(galaga_videoram_w) AM_BASE_MEMBER(galaga_state, videoram) AM_SHARE("gvr")
+ AM_RANGE(0x8800, 0x8bff) AM_RAM AM_SHARE("share1") AM_BASE_MEMBER(galaga_state, galaga_ram1)
+ AM_RANGE(0x9000, 0x93ff) AM_RAM AM_SHARE("share2") AM_BASE_MEMBER(galaga_state, galaga_ram2)
+ AM_RANGE(0x9800, 0x9bff) AM_RAM AM_SHARE("share3") AM_BASE_MEMBER(galaga_state, galaga_ram3)
+ AM_RANGE(0xa000, 0xa005) AM_WRITEONLY AM_BASE_MEMBER(galaga_state, galaga_starcontrol) AM_SHARE("gsc")
AM_RANGE(0xa007, 0xa007) AM_WRITE(galaga_flip_screen_w)
ADDRESS_MAP_END
@@ -959,13 +962,13 @@ static ADDRESS_MAP_START( xevious_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w)
AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
AM_RANGE(0x7800, 0x7fff) AM_RAM AM_SHARE("share1") /* work RAM */
- AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("share2") AM_BASE_MEMBER(_galaga_state, xevious_sr1) /* work RAM + sprite registers */
- AM_RANGE(0x9000, 0x97ff) AM_RAM AM_SHARE("share3") AM_BASE_MEMBER(_galaga_state, xevious_sr2) /* work RAM + sprite registers */
- AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_SHARE("share4") AM_BASE_MEMBER(_galaga_state, xevious_sr3) /* work RAM + sprite registers */
- AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE(xevious_fg_colorram_w) AM_BASE_MEMBER(_galaga_state, xevious_fg_colorram) AM_SHARE("fgc")
- AM_RANGE(0xb800, 0xbfff) AM_RAM_WRITE(xevious_bg_colorram_w) AM_BASE_MEMBER(_galaga_state, xevious_bg_colorram) AM_SHARE("bgc")
- AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(xevious_fg_videoram_w) AM_BASE_MEMBER(_galaga_state, xevious_fg_videoram) AM_SHARE("fgv")
- AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(xevious_bg_videoram_w) AM_BASE_MEMBER(_galaga_state, xevious_bg_videoram) AM_SHARE("bgv")
+ AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("share2") AM_BASE_MEMBER(xevious_state, xevious_sr1) /* work RAM + sprite registers */
+ AM_RANGE(0x9000, 0x97ff) AM_RAM AM_SHARE("share3") AM_BASE_MEMBER(xevious_state, xevious_sr2) /* work RAM + sprite registers */
+ AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_SHARE("share4") AM_BASE_MEMBER(xevious_state, xevious_sr3) /* work RAM + sprite registers */
+ AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE(xevious_fg_colorram_w) AM_BASE_MEMBER(xevious_state, xevious_fg_colorram) AM_SHARE("fgc")
+ AM_RANGE(0xb800, 0xbfff) AM_RAM_WRITE(xevious_bg_colorram_w) AM_BASE_MEMBER(xevious_state, xevious_bg_colorram) AM_SHARE("bgc")
+ AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(xevious_fg_videoram_w) AM_BASE_MEMBER(xevious_state, xevious_fg_videoram) AM_SHARE("fgv")
+ AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(xevious_bg_videoram_w) AM_BASE_MEMBER(xevious_state, xevious_bg_videoram) AM_SHARE("bgv")
AM_RANGE(0xd000, 0xd07f) AM_WRITE(xevious_vh_latch_w)
AM_RANGE(0xf000, 0xffff) AM_READWRITE(xevious_bb_r, xevious_bs_w)
ADDRESS_MAP_END
@@ -978,11 +981,11 @@ static ADDRESS_MAP_START( digdug_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w)
AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
- AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(digdug_videoram_w) AM_BASE_MEMBER(_galaga_state, videoram) AM_SHARE("dvr")/* tilemap RAM (bottom half of RAM 0 */
+ AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(digdug_videoram_w) AM_BASE_MEMBER(digdug_state, videoram) AM_SHARE("dvr")/* tilemap RAM (bottom half of RAM 0 */
AM_RANGE(0x8400, 0x87ff) AM_RAM AM_SHARE("share1") /* work RAM (top half for RAM 0 */
- AM_RANGE(0x8800, 0x8bff) AM_RAM AM_SHARE("share2") AM_BASE_MEMBER(_galaga_state, digdug_objram) /* work RAM + sprite registers */
- AM_RANGE(0x9000, 0x93ff) AM_RAM AM_SHARE("share3") AM_BASE_MEMBER(_galaga_state, digdug_posram) /* work RAM + sprite registers */
- AM_RANGE(0x9800, 0x9bff) AM_RAM AM_SHARE("share4") AM_BASE_MEMBER(_galaga_state, digdug_flpram) /* work RAM + sprite registers */
+ AM_RANGE(0x8800, 0x8bff) AM_RAM AM_SHARE("share2") AM_BASE_MEMBER(digdug_state, digdug_objram) /* work RAM + sprite registers */
+ AM_RANGE(0x9000, 0x93ff) AM_RAM AM_SHARE("share3") AM_BASE_MEMBER(digdug_state, digdug_posram) /* work RAM + sprite registers */
+ AM_RANGE(0x9800, 0x9bff) AM_RAM AM_SHARE("share4") AM_BASE_MEMBER(digdug_state, digdug_flpram) /* work RAM + sprite registers */
AM_RANGE(0xa000, 0xa007) AM_READNOP AM_WRITE(digdug_PORT_w) /* video latches (spurious reads when setting latch bits) */
AM_RANGE(0xb800, 0xb83f) AM_DEVREADWRITE("earom", atari_vg_earom_r, atari_vg_earom_w) /* non volatile memory data */
AM_RANGE(0xb840, 0xb840) AM_DEVWRITE("earom", atari_vg_earom_ctrl_w) /* non volatile memory control */
@@ -1581,7 +1584,7 @@ static const samples_interface battles_samples_interface =
-static MACHINE_CONFIG_START( bosco, _galaga_state )
+static MACHINE_CONFIG_START( bosco, bosco_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* 3.072 MHz */
@@ -1637,7 +1640,7 @@ static MACHINE_CONFIG_START( bosco, _galaga_state )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_START( galaga, _galaga_state )
+static MACHINE_CONFIG_START( galaga, galaga_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* 3.072 MHz */
@@ -1706,7 +1709,7 @@ static MACHINE_CONFIG_DERIVED( galagab, galaga )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_START( xevious, _galaga_state )
+static MACHINE_CONFIG_START( xevious, xevious_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* 3.072 MHz */
@@ -1788,7 +1791,7 @@ static MACHINE_CONFIG_DERIVED( battles, xevious )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_START( digdug, _galaga_state )
+static MACHINE_CONFIG_START( digdug, digdug_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* 3.072 MHz */
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index b7c571a303d..21acf11fdf4 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -417,14 +417,15 @@ TO DO :
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/s2650/s2650.h"
-#include "includes/galaxian.h"
#include "machine/8255ppi.h"
#include "sound/ay8910.h"
#include "sound/sn76496.h"
#include "sound/dac.h"
#include "sound/digitalk.h"
-#include "includes/cclimber.h"
#include "sound/discrete.h"
+#include "audio/cclimber.h"
+#include "audio/galaxian.h"
+#include "includes/galaxian.h"
#define KONAMI_SOUND_CLOCK 14318000
@@ -3009,8 +3010,48 @@ static DRIVER_INIT( skybase )
}
+static void mshuttle_decode(running_machine *machine, const UINT8 convtable[8][16])
+{
+ address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
+ UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
+ int A;
+
+ space->set_decrypted_region(0x0000, 0xffff, decrypt);
+
+ for (A = 0x0000;A < 0x10000;A++)
+ {
+ int i,j;
+ UINT8 src = rom[A];
+
+ /* pick the translation table from bit 0 of the address */
+ /* and from bits 1 7 of the source data */
+ i = (A & 1) | (src & 0x02) | ((src & 0x80) >> 5);
+
+ /* pick the offset in the table from bits 0 2 4 6 of the source data */
+ j = (src & 0x01) | ((src & 0x04) >> 1) | ((src & 0x10) >> 2) | ((src & 0x40) >> 3);
+
+ /* decode the opcodes */
+ decrypt[A] = (src & 0xaa) | convtable[i][j];
+ }
+}
+
+
static DRIVER_INIT( mshuttle )
{
+ static const UINT8 convtable[8][16] =
+ {
+ /* -1 marks spots which are unused and therefore unknown */
+ { 0x40,0x41,0x44,0x15,0x05,0x51,0x54,0x55,0x50,0x00,0x01,0x04, -1,0x10,0x11,0x14 },
+ { 0x45,0x51,0x55,0x44,0x40,0x11,0x05,0x41,0x10,0x14,0x54,0x50,0x15,0x04,0x00,0x01 },
+ { 0x11,0x14,0x10,0x00,0x44,0x05, -1,0x04,0x45,0x15,0x55,0x50, -1,0x01,0x54,0x51 },
+ { 0x14,0x01,0x11,0x10,0x50,0x15,0x00,0x40,0x04,0x51,0x45,0x05,0x55,0x54, -1,0x44 },
+ { 0x04,0x10, -1,0x40,0x15,0x41,0x50,0x50,0x11, -1,0x14,0x00,0x51,0x45,0x55,0x01 },
+ { 0x44,0x45,0x00,0x51, -1, -1,0x15,0x11,0x01,0x10,0x04,0x55,0x05,0x40,0x50,0x41 },
+ { 0x51,0x00,0x01,0x05,0x04,0x55,0x54,0x50,0x41, -1,0x11,0x15,0x14,0x10,0x44,0x40 },
+ { 0x05,0x04,0x51,0x01, -1, -1,0x55, -1,0x00,0x50,0x15,0x14,0x44,0x41,0x40,0x54 },
+ };
+
/* video extensions */
common_init(machine, mshuttle_draw_bullet, galaxian_draw_background, mshuttle_extend_tile_info, mshuttle_extend_sprite_info);
@@ -3018,12 +3059,24 @@ static DRIVER_INIT( mshuttle )
irq_line = 0;
/* decrypt the code */
- mshuttle_decode(machine);
+ mshuttle_decode(machine, convtable);
}
static DRIVER_INIT( mshuttlj )
{
+ static const UINT8 convtable[8][16] =
+ {
+ { 0x41,0x54,0x51,0x14,0x05,0x10,0x01,0x55,0x44,0x11,0x00,0x50,0x15,0x40,0x04,0x45 },
+ { 0x50,0x11,0x40,0x55,0x51,0x14,0x45,0x04,0x54,0x15,0x10,0x05,0x44,0x01,0x00,0x41 },
+ { 0x44,0x11,0x00,0x50,0x41,0x54,0x04,0x14,0x15,0x40,0x51,0x55,0x05,0x10,0x01,0x45 },
+ { 0x10,0x50,0x54,0x55,0x01,0x44,0x40,0x04,0x14,0x11,0x00,0x41,0x45,0x15,0x51,0x05 },
+ { 0x14,0x41,0x01,0x44,0x04,0x50,0x51,0x45,0x11,0x40,0x54,0x15,0x10,0x00,0x55,0x05 },
+ { 0x01,0x05,0x41,0x45,0x54,0x50,0x55,0x10,0x11,0x15,0x51,0x14,0x44,0x40,0x04,0x00 },
+ { 0x05,0x55,0x00,0x50,0x11,0x40,0x54,0x14,0x45,0x51,0x10,0x04,0x44,0x01,0x41,0x15 },
+ { 0x55,0x50,0x15,0x10,0x01,0x04,0x41,0x44,0x45,0x40,0x05,0x00,0x11,0x14,0x51,0x54 },
+ };
+
/* video extensions */
common_init(machine, mshuttle_draw_bullet, galaxian_draw_background, mshuttle_extend_tile_info, mshuttle_extend_sprite_info);
@@ -3031,7 +3084,7 @@ static DRIVER_INIT( mshuttlj )
irq_line = 0;
/* decrypt the code */
- cclimberj_decode(machine);
+ mshuttle_decode(machine, convtable);
}
diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c
index 82712bae1ad..aebbb04f0c9 100644
--- a/src/mame/drivers/galaxold.c
+++ b/src/mame/drivers/galaxold.c
@@ -364,13 +364,13 @@ Stephh's notes (based on the games Z80 code and some tests) for other games :
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/s2650/s2650.h"
-#include "includes/galaxold.h"
#include "machine/7474.h"
#include "sound/ay8910.h"
#include "sound/sn76496.h"
#include "sound/dac.h"
#include "sound/flt_rc.h"
-#include "includes/galaxian.h"
+#include "audio/galaxian.h"
+#include "includes/galaxold.h"
/*************************************
diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c
index 68301f78a4e..ea111c751fa 100644
--- a/src/mame/drivers/galpani2.c
+++ b/src/mame/drivers/galpani2.c
@@ -21,10 +21,11 @@ To Do:
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "sound/okim6295.h"
#include "deprecat.h"
#include "machine/eeprom.h"
#include "includes/kaneko16.h"
-#include "sound/okim6295.h"
+#include "includes/galpani2.h"
/***************************************************************************
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index 7cdb410a593..d2adbf630c1 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -736,6 +736,7 @@ Notes:
#include "sound/okim6295.h"
#include "sound/ymf271.h"
#include "sound/ymz280b.h"
+#include "machine/seibuspi.h"
#include "includes/seibuspi.h"
UINT32 *spimainram;
diff --git a/src/mame/drivers/vmetal.c b/src/mame/drivers/vmetal.c
index f8d17005e79..378979ff717 100644
--- a/src/mame/drivers/vmetal.c
+++ b/src/mame/drivers/vmetal.c
@@ -79,16 +79,34 @@ cleanup
#include "sound/es8712.h"
#include "includes/metro.h"
+class vmetal_state : public metro_state
+{
+public:
+ vmetal_state(running_machine &machine, const driver_device_config_base &config)
+ : metro_state(machine, config) { }
+
+ UINT16 *texttileram;
+ UINT16 *mid1tileram;
+ UINT16 *mid2tileram;
+ UINT16 *tlookup;
+ UINT16 *_videoregs;
+
+ tilemap_t *texttilemap;
+ tilemap_t *mid1tilemap;
+ tilemap_t *mid2tilemap;
+};
+
+
static READ16_HANDLER ( varia_crom_read )
{
/* game reads the cgrom, result is 7772, verified to be correct on the real board */
- metro_state *state = space->machine->driver_data<metro_state>();
+ vmetal_state *state = space->machine->driver_data<vmetal_state>();
UINT8 *cgrom = space->machine->region("gfx1")->base();
UINT16 retdat;
offset = offset << 1;
- offset |= (state->vmetal_videoregs[0x0ab / 2] & 0x7f) << 16;
+ offset |= (state->_videoregs[0x0ab / 2] & 0x7f) << 16;
retdat = ((cgrom[offset] << 8) | (cgrom[offset + 1]));
// popmessage("varia romread offset %06x data %04x", offset, retdat);
@@ -98,9 +116,9 @@ static READ16_HANDLER ( varia_crom_read )
static void get_vmetal_tlookup(running_machine *machine, UINT16 data, UINT16 *tileno, UINT16 *color)
{
- metro_state *state = machine->driver_data<metro_state>();
+ vmetal_state *state = machine->driver_data<vmetal_state>();
int idx = ((data & 0x7fff) >> 4) * 2;
- UINT32 lookup = (state->vmetal_tlookup[idx] << 16) | state->vmetal_tlookup[idx + 1];
+ UINT32 lookup = (state->tlookup[idx] << 16) | state->tlookup[idx + 1];
*tileno = (data & 0xf) | ((lookup >> 2) & 0xfff0);
*color = (lookup >> 20) & 0xff;
@@ -109,23 +127,23 @@ static void get_vmetal_tlookup(running_machine *machine, UINT16 data, UINT16 *ti
static WRITE16_HANDLER( vmetal_texttileram_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
- COMBINE_DATA(&state->vmetal_texttileram[offset]);
- tilemap_mark_tile_dirty(state->vmetal_texttilemap, offset);
+ vmetal_state *state = space->machine->driver_data<vmetal_state>();
+ COMBINE_DATA(&state->texttileram[offset]);
+ tilemap_mark_tile_dirty(state->texttilemap, offset);
}
static WRITE16_HANDLER( vmetal_mid1tileram_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
- COMBINE_DATA(&state->vmetal_mid1tileram[offset]);
- tilemap_mark_tile_dirty(state->vmetal_mid1tilemap, offset);
+ vmetal_state *state = space->machine->driver_data<vmetal_state>();
+ COMBINE_DATA(&state->mid1tileram[offset]);
+ tilemap_mark_tile_dirty(state->mid1tilemap, offset);
}
static WRITE16_HANDLER( vmetal_mid2tileram_w )
{
- metro_state *state = space->machine->driver_data<metro_state>();
- COMBINE_DATA(&state->vmetal_mid2tileram[offset]);
- tilemap_mark_tile_dirty(state->vmetal_mid2tilemap, offset);
+ vmetal_state *state = space->machine->driver_data<vmetal_state>();
+ COMBINE_DATA(&state->mid2tileram[offset]);
+ tilemap_mark_tile_dirty(state->mid2tilemap, offset);
}
@@ -200,18 +218,18 @@ static WRITE8_DEVICE_HANDLER( vmetal_es8712_w )
static ADDRESS_MAP_START( varia_program_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
- AM_RANGE(0x100000, 0x11ffff) AM_RAM_WRITE(vmetal_texttileram_w) AM_BASE_MEMBER(metro_state, vmetal_texttileram)
- AM_RANGE(0x120000, 0x13ffff) AM_RAM_WRITE(vmetal_mid1tileram_w) AM_BASE_MEMBER(metro_state, vmetal_mid1tileram)
- AM_RANGE(0x140000, 0x15ffff) AM_RAM_WRITE(vmetal_mid2tileram_w) AM_BASE_MEMBER(metro_state, vmetal_mid2tileram)
+ AM_RANGE(0x100000, 0x11ffff) AM_RAM_WRITE(vmetal_texttileram_w) AM_BASE_MEMBER(vmetal_state, texttileram)
+ AM_RANGE(0x120000, 0x13ffff) AM_RAM_WRITE(vmetal_mid1tileram_w) AM_BASE_MEMBER(vmetal_state, mid1tileram)
+ AM_RANGE(0x140000, 0x15ffff) AM_RAM_WRITE(vmetal_mid2tileram_w) AM_BASE_MEMBER(vmetal_state, mid2tileram)
AM_RANGE(0x160000, 0x16ffff) AM_READ(varia_crom_read) // cgrom read window ..
AM_RANGE(0x170000, 0x173fff) AM_RAM_WRITE(paletteram16_GGGGGRRRRRBBBBBx_word_w) AM_BASE_GENERIC(paletteram) // Palette
- AM_RANGE(0x174000, 0x174fff) AM_RAM AM_BASE_SIZE_MEMBER(metro_state, spriteram, spriteram_size)
+ AM_RANGE(0x174000, 0x174fff) AM_RAM AM_BASE_SIZE_MEMBER(vmetal_state, spriteram, spriteram_size)
AM_RANGE(0x175000, 0x177fff) AM_RAM
- AM_RANGE(0x178000, 0x1787ff) AM_RAM AM_BASE_MEMBER(metro_state, vmetal_tlookup)
- AM_RANGE(0x178800, 0x1796ff) AM_RAM AM_BASE_MEMBER(metro_state, vmetal_videoregs)
- AM_RANGE(0x179700, 0x179713) AM_WRITEONLY AM_BASE_MEMBER(metro_state, videoregs) // Video Registers
+ AM_RANGE(0x178000, 0x1787ff) AM_RAM AM_BASE_MEMBER(vmetal_state, tlookup)
+ AM_RANGE(0x178800, 0x1796ff) AM_RAM AM_BASE_MEMBER(vmetal_state, _videoregs)
+ AM_RANGE(0x179700, 0x179713) AM_WRITEONLY AM_BASE_MEMBER(vmetal_state, videoregs) // Video Registers
AM_RANGE(0x200000, 0x200001) AM_READ_PORT("P1_P2") AM_DEVWRITE8("essnd", vmetal_control_w, 0x00ff)
AM_RANGE(0x200002, 0x200003) AM_READ_PORT("SYSTEM")
@@ -343,11 +361,11 @@ GFXDECODE_END
static TILE_GET_INFO( get_vmetal_texttilemap_tile_info )
{
- metro_state *state = machine->driver_data<metro_state>();
+ vmetal_state *state = machine->driver_data<vmetal_state>();
UINT32 tile;
- UINT16 color, data = state->vmetal_texttileram[tile_index];
+ UINT16 color, data = state->texttileram[tile_index];
int idx = ((data & 0x7fff) >> 4) * 2;
- UINT32 lookup = (state->vmetal_tlookup[idx] << 16) | state->vmetal_tlookup[idx + 1];
+ UINT32 lookup = (state->tlookup[idx] << 16) | state->tlookup[idx + 1];
tile = (data & 0xf) | (lookup & 0x7fff0);
color = ((lookup >> 20) & 0x1f) + 0xe0;
@@ -361,8 +379,8 @@ static TILE_GET_INFO( get_vmetal_texttilemap_tile_info )
static TILE_GET_INFO( get_vmetal_mid1tilemap_tile_info )
{
- metro_state *state = machine->driver_data<metro_state>();
- UINT16 tile, color, data = state->vmetal_mid1tileram[tile_index];
+ vmetal_state *state = machine->driver_data<vmetal_state>();
+ UINT16 tile, color, data = state->mid1tileram[tile_index];
get_vmetal_tlookup(machine, data, &tile, &color);
@@ -374,8 +392,8 @@ static TILE_GET_INFO( get_vmetal_mid1tilemap_tile_info )
static TILE_GET_INFO( get_vmetal_mid2tilemap_tile_info )
{
- metro_state *state = machine->driver_data<metro_state>();
- UINT16 tile, color, data = state->vmetal_mid2tileram[tile_index];
+ vmetal_state *state = machine->driver_data<vmetal_state>();
+ UINT16 tile, color, data = state->mid2tileram[tile_index];
get_vmetal_tlookup(machine, data, &tile, &color);
@@ -387,41 +405,41 @@ static TILE_GET_INFO( get_vmetal_mid2tilemap_tile_info )
static VIDEO_START(varia)
{
- metro_state *state = machine->driver_data<metro_state>();
+ vmetal_state *state = machine->driver_data<vmetal_state>();
- state->vmetal_texttilemap = tilemap_create(machine, get_vmetal_texttilemap_tile_info, tilemap_scan_rows, 8, 8, 256, 256);
- state->vmetal_mid1tilemap = tilemap_create(machine, get_vmetal_mid1tilemap_tile_info, tilemap_scan_rows, 16, 16, 256, 256);
- state->vmetal_mid2tilemap = tilemap_create(machine, get_vmetal_mid2tilemap_tile_info, tilemap_scan_rows, 16, 16, 256, 256);
+ state->texttilemap = tilemap_create(machine, get_vmetal_texttilemap_tile_info, tilemap_scan_rows, 8, 8, 256, 256);
+ state->mid1tilemap = tilemap_create(machine, get_vmetal_mid1tilemap_tile_info, tilemap_scan_rows, 16, 16, 256, 256);
+ state->mid2tilemap = tilemap_create(machine, get_vmetal_mid2tilemap_tile_info, tilemap_scan_rows, 16, 16, 256, 256);
- tilemap_set_transparent_pen(state->vmetal_texttilemap, 15);
- tilemap_set_transparent_pen(state->vmetal_mid1tilemap, 15);
- tilemap_set_transparent_pen(state->vmetal_mid2tilemap, 15);
+ tilemap_set_transparent_pen(state->texttilemap, 15);
+ tilemap_set_transparent_pen(state->mid1tilemap, 15);
+ tilemap_set_transparent_pen(state->mid2tilemap, 15);
}
static SCREEN_UPDATE(varia)
{
- metro_state *state = screen->machine->driver_data<metro_state>();
+ vmetal_state *state = screen->machine->driver_data<vmetal_state>();
bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
- tilemap_set_scrollx(state->vmetal_mid2tilemap, 0, state->vmetal_videoregs[0x06a/2]-64 /*+ state->vmetal_videoregs[0x066/2]*/);
- tilemap_set_scrollx(state->vmetal_mid1tilemap, 0, state->vmetal_videoregs[0x07a/2]-64 /*+ state->vmetal_videoregs[0x076/2]*/);
- tilemap_set_scrollx(state->vmetal_texttilemap, 0, -64 /*+ state->vmetal_videoregs[0x076/2]*/);
+ tilemap_set_scrollx(state->mid2tilemap, 0, state->_videoregs[0x06a/2]-64 /*+ state->_videoregs[0x066/2]*/);
+ tilemap_set_scrollx(state->mid1tilemap, 0, state->_videoregs[0x07a/2]-64 /*+ state->_videoregs[0x076/2]*/);
+ tilemap_set_scrollx(state->texttilemap, 0, -64 /*+ state->_videoregs[0x076/2]*/);
- tilemap_set_scrolly(state->vmetal_mid2tilemap, 0, -64);
- tilemap_set_scrolly(state->vmetal_mid1tilemap, 0, -64);
- tilemap_set_scrolly(state->vmetal_texttilemap, 0, -64);
+ tilemap_set_scrolly(state->mid2tilemap, 0, -64);
+ tilemap_set_scrolly(state->mid1tilemap, 0, -64);
+ tilemap_set_scrolly(state->texttilemap, 0, -64);
- tilemap_draw(bitmap, cliprect, state->vmetal_mid1tilemap, 0, 0);
- tilemap_draw(bitmap, cliprect, state->vmetal_mid2tilemap, 0, 0);
+ tilemap_draw(bitmap, cliprect, state->mid1tilemap, 0, 0);
+ tilemap_draw(bitmap, cliprect, state->mid2tilemap, 0, 0);
metro_draw_sprites(screen->machine, bitmap, cliprect);
- tilemap_draw(bitmap, cliprect, state->vmetal_texttilemap, 0, 0);
+ tilemap_draw(bitmap, cliprect, state->texttilemap, 0, 0);
return 0;
}
-static MACHINE_CONFIG_START( varia, metro_state )
+static MACHINE_CONFIG_START( varia, vmetal_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000)
diff --git a/src/mame/includes/cclimber.h b/src/mame/includes/cclimber.h
index 310ddc2229b..87af075fed7 100644
--- a/src/mame/includes/cclimber.h
+++ b/src/mame/includes/cclimber.h
@@ -1,13 +1,7 @@
/*----------- defined in machine/cclimber.c -----------*/
-#include "sound/samples.h"
-#include "sound/ay8910.h"
-
-
DRIVER_INIT( cclimber );
DRIVER_INIT( cclimberj );
-void cclimberj_decode(running_machine *machine);
-void mshuttle_decode(running_machine *machine);
DRIVER_INIT( cannonb );
DRIVER_INIT( cannonb2 );
DRIVER_INIT( ckongb );
@@ -47,12 +41,3 @@ SCREEN_UPDATE( yamato );
PALETTE_INIT( toprollr );
VIDEO_START( toprollr );
SCREEN_UPDATE( toprollr );
-
-
-/*----------- defined in audio/cclimber.c -----------*/
-
-extern const ay8910_interface cclimber_ay8910_interface;
-extern const samples_interface cclimber_samples_interface;
-WRITE8_HANDLER( cclimber_sample_trigger_w );
-WRITE8_HANDLER( cclimber_sample_rate_w );
-WRITE8_HANDLER( cclimber_sample_volume_w );
diff --git a/src/mame/includes/galaga.h b/src/mame/includes/galaga.h
index 8487203efb5..7abd3d81692 100644
--- a/src/mame/includes/galaga.h
+++ b/src/mame/includes/galaga.h
@@ -1,18 +1,16 @@
#include "sound/discrete.h"
-class _galaga_state : public driver_device
+class galaga_state : public driver_device
{
public:
- _galaga_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config)
- {
- xevious_bs[0] = 0;
- xevious_bs[1] = 0;
- }
+ galaga_state(running_machine &machine, const driver_device_config_base &config)
+ : driver_device(machine, config) { }
/* memory pointers */
UINT8 *galaga_ram1,*galaga_ram2,*galaga_ram3;
UINT8 *galaga_starcontrol; // 6 addresses
+ emu_timer *cpu3_interrupt_timer;
+ UINT8 custom_mod;
/* machine state */
UINT32 stars_scrollx;
@@ -28,8 +26,13 @@ public:
UINT8 *videoram;
tilemap_t *fg_tilemap;
tilemap_t *bg_tilemap;
+};
- /* xevious */
+class xevious_state : public galaga_state
+{
+public:
+ xevious_state(running_machine &machine, const driver_device_config_base &config)
+ : galaga_state(machine, config) { }
UINT8 *xevious_fg_videoram;
UINT8 *xevious_fg_colorram;
@@ -39,34 +42,39 @@ public:
UINT8 *xevious_sr2;
UINT8 *xevious_sr3;
- /* xevious static */
INT32 xevious_bs[2];
+};
- /* bosco */
- UINT8 *bosco_radarattr;
+class bosco_state : public galaga_state
+{
+public:
+ bosco_state(running_machine &machine, const driver_device_config_base &config)
+ : galaga_state(machine, config) { }
- /* bosco static */
+ UINT8 *bosco_radarattr;
UINT8 *bosco_starcontrol;
UINT8 *bosco_starblink;
UINT8 *bosco_radarx;
UINT8 *bosco_radary;
+};
- /* digdug */
+class digdug_state : public galaga_state
+{
+public:
+ digdug_state(running_machine &machine, const driver_device_config_base &config)
+ : galaga_state(machine, config) { }
UINT8 *digdug_objram;
UINT8 *digdug_posram;
UINT8 *digdug_flpram;
- /* digdug static*/
-
UINT8 bg_select;
UINT8 tx_color_mode;
UINT8 bg_disable;
UINT8 bg_color_bank;
-
};
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index af709fe6232..1fbf0d2f2f9 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -4,7 +4,6 @@
***************************************************************************/
-#include "sound/discrete.h"
/* we scale horizontally by 3 to render stars correctly */
#define GALAXIAN_XSCALE 3
@@ -26,8 +25,6 @@
#define GALAXIAN_VBEND (16)
#define GALAXIAN_VBSTART (224+16)
-#define GAL_AUDIO "discrete"
-
class galaxian_state : public driver_device
{
public:
@@ -135,16 +132,3 @@ void jumpbug_extend_sprite_info(const UINT8 *base, UINT8 *sx, UINT8 *sy, UINT8 *
/* Ten Spot extensions */
void tenspot_set_game_bank(running_machine *machine, int bank, int from_game);
-/*----------- defined in audio/galaxian.c -----------*/
-
-MACHINE_CONFIG_EXTERN( mooncrst_audio );
-MACHINE_CONFIG_EXTERN( galaxian_audio );
-
-WRITE8_DEVICE_HANDLER( galaxian_sound_w );
-WRITE8_DEVICE_HANDLER( galaxian_pitch_w );
-WRITE8_DEVICE_HANDLER( galaxian_vol_w );
-WRITE8_DEVICE_HANDLER( galaxian_noise_enable_w );
-WRITE8_DEVICE_HANDLER( galaxian_background_enable_w );
-WRITE8_DEVICE_HANDLER( galaxian_shoot_enable_w );
-WRITE8_DEVICE_HANDLER( galaxian_lfo_freq_w );
-
diff --git a/src/mame/includes/kaneko16.h b/src/mame/includes/kaneko16.h
index e370222998d..292d2394539 100644
--- a/src/mame/includes/kaneko16.h
+++ b/src/mame/includes/kaneko16.h
@@ -127,25 +127,3 @@ SCREEN_UPDATE( galsnew );
extern UINT16* galsnew_bg_pixram;
extern UINT16* galsnew_fg_pixram;
-
-
-/*----------- defined in video/galpani2.c -----------*/
-
-extern UINT16 *galpani2_bg8_0, *galpani2_bg8_1;
-extern UINT16 *galpani2_palette_0, *galpani2_palette_1;
-extern UINT16 *galpani2_bg8_0_scrollx, *galpani2_bg8_1_scrollx;
-extern UINT16 *galpani2_bg8_0_scrolly, *galpani2_bg8_1_scrolly;
-
-extern UINT16 *galpani2_bg15;
-
-PALETTE_INIT( galpani2 );
-VIDEO_START( galpani2 );
-SCREEN_UPDATE( galpani2 );
-
-WRITE16_HANDLER( galpani2_palette_0_w );
-WRITE16_HANDLER( galpani2_palette_1_w );
-
-WRITE16_HANDLER( galpani2_bg8_0_w );
-WRITE16_HANDLER( galpani2_bg8_1_w );
-
-WRITE16_HANDLER( galpani2_bg15_w );
diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h
index 38c93fa9176..9d644647371 100644
--- a/src/mame/includes/metro.h
+++ b/src/mame/includes/metro.h
@@ -68,17 +68,6 @@ public:
/* misc */
int gakusai_oki_bank_lo, gakusai_oki_bank_hi;
- /* used by vmetal.c */
- UINT16 *vmetal_texttileram;
- UINT16 *vmetal_mid1tileram;
- UINT16 *vmetal_mid2tileram;
- UINT16 *vmetal_tlookup;
- UINT16 *vmetal_videoregs;
-
- tilemap_t *vmetal_texttilemap;
- tilemap_t *vmetal_mid1tilemap;
- tilemap_t *vmetal_mid2tilemap;
-
/* devices */
required_device<cpu_device> maincpu;
optional_device<cpu_device> audiocpu;
diff --git a/src/mame/includes/namcond1.h b/src/mame/includes/namcond1.h
index 8fe0142021a..b14127ea8bb 100644
--- a/src/mame/includes/namcond1.h
+++ b/src/mame/includes/namcond1.h
@@ -6,17 +6,8 @@
***************************************************************************/
-#define GFX_8X8_4BIT 0
-#define GFX_16X16_4BIT 1
-#define GFX_32X32_4BIT 2
-#define GFX_64X64_4BIT 3
-#define GFX_8X8_8BIT 4
-#define GFX_16X16_8BIT 5
-
/*----------- defined in machine/namcond1.c -----------*/
-extern UINT8 namcond1_gfxbank;
-
extern UINT8 namcond1_h8_irq5_enabled;
extern UINT16 *namcond1_shared_ram;
diff --git a/src/mame/includes/seibuspi.h b/src/mame/includes/seibuspi.h
index d86ffc72171..310c8f6c8f9 100644
--- a/src/mame/includes/seibuspi.h
+++ b/src/mame/includes/seibuspi.h
@@ -8,21 +8,6 @@ extern UINT32 *spimainram;
void seibuspi_sprite_decrypt(UINT8 *src, int romsize);
-/*----------- defined in machine/seibuspi.c -----------*/
-
-void seibuspi_text_decrypt(UINT8 *rom);
-void seibuspi_bg_decrypt(UINT8 *rom, int size);
-
-void seibuspi_rise10_text_decrypt(UINT8 *rom);
-void seibuspi_rise10_bg_decrypt(UINT8 *rom, int size);
-void seibuspi_rise10_sprite_decrypt(UINT8 *rom, int romsize);
-
-void seibuspi_rise11_text_decrypt(UINT8 *rom);
-void seibuspi_rise11_bg_decrypt(UINT8 *rom, int size);
-void seibuspi_rise11_sprite_decrypt_rfjet(UINT8 *rom, int romsize);
-void seibuspi_rise11_sprite_decrypt_feversoc(UINT8 *rom, int romsize);
-
-
/*----------- defined in video/seibuspi.c -----------*/
extern UINT32 *spi_scrollram;
diff --git a/src/mame/includes/tetrisp2.h b/src/mame/includes/tetrisp2.h
index 14b71b349d0..c6d5394233e 100644
--- a/src/mame/includes/tetrisp2.h
+++ b/src/mame/includes/tetrisp2.h
@@ -43,4 +43,3 @@ VIDEO_START( rocknms );
SCREEN_UPDATE( rocknms );
VIDEO_START( nndmseal );
-void tetrisp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle *cliprect, UINT8* priram, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int reverseorder, int flip, int allowzoom);
diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h
index 035735a5787..240ec2c7139 100644
--- a/src/mame/includes/tnzs.h
+++ b/src/mame/includes/tnzs.h
@@ -48,14 +48,6 @@ public:
int bank1;
int bank2;
- /* game-specific */
- // champbwl
- UINT8 last_trackball_val[2];
-// UINT8 * nvram; // currently this uses generic_nvram
- // cchance
- UINT8 hop_io, bell_io;
-
-
/* devices */
device_t *audiocpu;
device_t *subcpu;
diff --git a/src/mame/machine/cclimber.c b/src/mame/machine/cclimber.c
index f4f5422d3c4..d445beec88b 100644
--- a/src/mame/machine/cclimber.c
+++ b/src/mame/machine/cclimber.c
@@ -16,10 +16,7 @@ static void cclimber_decode(running_machine *machine, const UINT8 convtable[8][1
for (A = 0x0000;A < 0x10000;A++)
{
int i,j;
- UINT8 src;
-
-
- src = rom[A];
+ UINT8 src = rom[A];
/* pick the translation table from bit 0 of the address */
/* and from bits 1 7 of the source data */
@@ -51,7 +48,7 @@ DRIVER_INIT( cclimber )
cclimber_decode(machine, convtable);
}
-void cclimberj_decode(running_machine *machine)
+DRIVER_INIT( cclimberj )
{
static const UINT8 convtable[8][16] =
{
@@ -68,29 +65,6 @@ void cclimberj_decode(running_machine *machine)
cclimber_decode(machine, convtable);
}
-DRIVER_INIT( cclimberj )
-{
- cclimberj_decode(machine);
-}
-
-void mshuttle_decode(running_machine *machine)
-{
- static const UINT8 convtable[8][16] =
- {
- /* -1 marks spots which are unused and therefore unknown */
- { 0x40,0x41,0x44,0x15,0x05,0x51,0x54,0x55,0x50,0x00,0x01,0x04, -1,0x10,0x11,0x14 },
- { 0x45,0x51,0x55,0x44,0x40,0x11,0x05,0x41,0x10,0x14,0x54,0x50,0x15,0x04,0x00,0x01 },
- { 0x11,0x14,0x10,0x00,0x44,0x05, -1,0x04,0x45,0x15,0x55,0x50, -1,0x01,0x54,0x51 },
- { 0x14,0x01,0x11,0x10,0x50,0x15,0x00,0x40,0x04,0x51,0x45,0x05,0x55,0x54, -1,0x44 },
- { 0x04,0x10, -1,0x40,0x15,0x41,0x50,0x50,0x11, -1,0x14,0x00,0x51,0x45,0x55,0x01 },
- { 0x44,0x45,0x00,0x51, -1, -1,0x15,0x11,0x01,0x10,0x04,0x55,0x05,0x40,0x50,0x41 },
- { 0x51,0x00,0x01,0x05,0x04,0x55,0x54,0x50,0x41, -1,0x11,0x15,0x14,0x10,0x44,0x40 },
- { 0x05,0x04,0x51,0x01, -1, -1,0x55, -1,0x00,0x50,0x15,0x14,0x44,0x41,0x40,0x54 },
- };
-
- cclimber_decode(machine, convtable);
-}
-
DRIVER_INIT( ckongb )
{
int A;
@@ -103,7 +77,7 @@ DRIVER_INIT( ckongb )
}
#if CANNONB_HACK
-static void cannonb_patch(void)
+static void cannonb_patch(running_machine *machine)
{
UINT8 *rom = machine->region("maincpu")->base();
@@ -135,14 +109,14 @@ DRIVER_INIT( cannonb )
}
#if CANNONB_HACK
- cannonb_patch();
+ cannonb_patch(machine);
#endif
}
DRIVER_INIT( cannonb2 )
{
#if CANNONB_HACK
- cannonb_patch();
+ cannonb_patch(machine);
#endif
}
diff --git a/src/mame/machine/namcond1.c b/src/mame/machine/namcond1.c
index 09db834a9ef..3050e2c1d91 100644
--- a/src/mame/machine/namcond1.c
+++ b/src/mame/machine/namcond1.c
@@ -11,17 +11,16 @@
#include "emu.h"
#include "cpu/m6809/m6809.h"
+#include "video/ygv608.h"
#include "includes/namcond1.h"
/* Perform basic machine initialisation */
UINT8 namcond1_h8_irq5_enabled;
-UINT8 namcond1_gfxbank;
MACHINE_START( namcond1 )
{
state_save_register_global(machine, namcond1_h8_irq5_enabled);
- state_save_register_global(machine, namcond1_gfxbank);
}
MACHINE_RESET( namcond1 )
@@ -103,7 +102,7 @@ WRITE16_HANDLER( namcond1_cuskey_w )
break;
case (0x0c>>1):
- namcond1_gfxbank = (data & 0x0002) >>1; // i think
+ ygv608_set_gfxbank((data & 0x0002) >> 1); // i think
// should mark tilemaps dirty but i think they already are
break;
diff --git a/src/mame/machine/seibuspi.c b/src/mame/machine/seibuspi.c
index d7f97154cb2..fe8c22b1457 100644
--- a/src/mame/machine/seibuspi.c
+++ b/src/mame/machine/seibuspi.c
@@ -1,5 +1,5 @@
#include "emu.h"
-#include "includes/seibuspi.h"
+#include "machine/seibuspi.h"
diff --git a/src/mame/video/bishi.c b/src/mame/video/bishi.c
index 519463aaad7..ade40aaad00 100644
--- a/src/mame/video/bishi.c
+++ b/src/mame/video/bishi.c
@@ -9,7 +9,6 @@
#include "emu.h"
#include "video/konicdev.h"
-//#include "includes/konamigx.h"
#include "includes/bishi.h"
diff --git a/src/mame/video/bosco.c b/src/mame/video/bosco.c
index 1ac29922f7c..45b872ce23c 100644
--- a/src/mame/video/bosco.c
+++ b/src/mame/video/bosco.c
@@ -93,7 +93,7 @@ static TILEMAP_MAPPER( fg_tilemap_scan )
INLINE void get_tile_info(running_machine *machine,tile_data *tileinfo,int tile_index,int ram_offs)
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ bosco_state *state = machine->driver_data<bosco_state>();
UINT8 attr = state->videoram[ram_offs + tile_index + 0x800];
tileinfo->category = (attr & 0x20) >> 5;
@@ -125,7 +125,7 @@ static TILE_GET_INFO( fg_get_tile_info )
VIDEO_START( bosco )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ bosco_state *state = machine->driver_data<bosco_state>();
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan_rows,8,8,32,32);
state->fg_tilemap = tilemap_create(machine, fg_get_tile_info,fg_tilemap_scan, 8,8, 8,32);
@@ -156,7 +156,7 @@ VIDEO_START( bosco )
WRITE8_HANDLER( bosco_videoram_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ bosco_state *state = space->machine->driver_data<bosco_state>();
state->videoram[offset] = data;
if (offset & 0x400)
@@ -167,14 +167,14 @@ WRITE8_HANDLER( bosco_videoram_w )
WRITE8_HANDLER( bosco_scrollx_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ bosco_state *state = space->machine->driver_data<bosco_state>();
tilemap_set_scrollx(state->bg_tilemap,0,data);
}
WRITE8_HANDLER( bosco_scrolly_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ bosco_state *state = space->machine->driver_data<bosco_state>();
tilemap_set_scrolly(state->bg_tilemap,0,data);
}
@@ -217,7 +217,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ bosco_state *state = machine->driver_data<bosco_state>();
int offs;
for (offs = 4; offs < 0x10;offs++)
@@ -239,7 +239,7 @@ static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const recta
static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int flip)
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ bosco_state *state = machine->driver_data<bosco_state>();
if (1)
{
@@ -275,7 +275,7 @@ static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectang
SCREEN_UPDATE( bosco )
{
- _galaga_state *state = screen->machine->driver_data<_galaga_state>();
+ bosco_state *state = screen->machine->driver_data<bosco_state>();
/* the radar tilemap is just 8x32. We rely on the tilemap code to repeat it across
the screen, and clip it to only the position where it is supposed to be shown */
@@ -312,7 +312,7 @@ SCREEN_UPDATE( bosco )
SCREEN_EOF( bosco )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ bosco_state *state = machine->driver_data<bosco_state>();
static const int speedsx[8] = { -1, -2, -3, 0, 3, 2, 1, 0 };
static const int speedsy[8] = { 0, -1, -2, -3, 0, 3, 2, 1 };
diff --git a/src/mame/video/digdug.c b/src/mame/video/digdug.c
index 75b4fb6761e..a9145044d78 100644
--- a/src/mame/video/digdug.c
+++ b/src/mame/video/digdug.c
@@ -90,7 +90,7 @@ static TILEMAP_MAPPER( tilemap_scan )
static TILE_GET_INFO( bg_get_tile_info )
{
UINT8 *rom = machine->region("gfx4")->base();
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ digdug_state *state = machine->driver_data<digdug_state>();
int code = rom[tile_index | (state->bg_select << 10)];
/* when the background is "disabled", it is actually still drawn, but using
@@ -108,7 +108,7 @@ static TILE_GET_INFO( bg_get_tile_info )
static TILE_GET_INFO( tx_get_tile_info )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ digdug_state *state = machine->driver_data<digdug_state>();
UINT8 code = state->videoram[tile_index];
int color;
@@ -144,7 +144,7 @@ static TILE_GET_INFO( tx_get_tile_info )
VIDEO_START( digdug )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ digdug_state *state = machine->driver_data<digdug_state>();
state->bg_tilemap = tilemap_create(machine, bg_get_tile_info,tilemap_scan, 8,8,36,28);
state->fg_tilemap = tilemap_create(machine, tx_get_tile_info,tilemap_scan,8,8,36,28);
@@ -167,7 +167,7 @@ VIDEO_START( digdug )
WRITE8_HANDLER( digdug_videoram_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ digdug_state *state = space->machine->driver_data<digdug_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset & 0x3ff);
@@ -175,7 +175,7 @@ WRITE8_HANDLER( digdug_videoram_w )
WRITE8_HANDLER( digdug_PORT_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ digdug_state *state = space->machine->driver_data<digdug_state>();
switch (offset)
{
@@ -248,7 +248,7 @@ static const rectangle spritevisiblearea =
static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ digdug_state *state = machine->driver_data<digdug_state>();
UINT8 *spriteram = state->digdug_objram + 0x380;
UINT8 *spriteram_2 = state->digdug_posram + 0x380;
UINT8 *spriteram_3 = state->digdug_flpram + 0x380;
@@ -307,7 +307,7 @@ static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const recta
SCREEN_UPDATE( digdug )
{
- _galaga_state *state = screen->machine->driver_data<_galaga_state>();
+ digdug_state *state = screen->machine->driver_data<digdug_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
diff --git a/src/mame/video/galaga.c b/src/mame/video/galaga.c
index 5354303b591..bbe17f43012 100644
--- a/src/mame/video/galaga.c
+++ b/src/mame/video/galaga.c
@@ -412,7 +412,7 @@ static TILE_GET_INFO( get_tile_info )
timing signals, while x flip is done by selecting the 2nd character set.
We reproduce this here, but since the tilemap system automatically flips
characters when screen is flipped, we have to flip them back. */
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ galaga_state *state = machine->driver_data<galaga_state>();
int color = state->videoram[tile_index + 0x400] & 0x3f;
SET_TILE_INFO(
0,
@@ -432,7 +432,7 @@ static TILE_GET_INFO( get_tile_info )
VIDEO_START( galaga )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ galaga_state *state = machine->driver_data<galaga_state>();
state->fg_tilemap = tilemap_create(machine, get_tile_info,tilemap_scan,8,8,36,28);
colortable_configure_tilemap_groups(machine->colortable, state->fg_tilemap, machine->gfx[0], 0x1f);
@@ -454,7 +454,7 @@ VIDEO_START( galaga )
WRITE8_HANDLER( galaga_videoram_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ galaga_state *state = space->machine->driver_data<galaga_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset & 0x3ff);
@@ -462,7 +462,7 @@ WRITE8_HANDLER( galaga_videoram_w )
WRITE8_HANDLER ( gatsbee_bank_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ galaga_state *state = space->machine->driver_data<galaga_state>();
state->galaga_gfxbank = data & 0x1;
tilemap_mark_all_tiles_dirty(state->fg_tilemap);
@@ -478,7 +478,7 @@ WRITE8_HANDLER ( gatsbee_bank_w )
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ galaga_state *state = machine->driver_data<galaga_state>();
UINT8 *spriteram = state->galaga_ram1 + 0x380;
UINT8 *spriteram_2 = state->galaga_ram2 + 0x380;
@@ -531,7 +531,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ galaga_state *state = machine->driver_data<galaga_state>();
/* draw the stars */
/* $a005 controls the stars ON/OFF */
@@ -568,7 +568,7 @@ static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectang
SCREEN_UPDATE( galaga )
{
- _galaga_state *state = screen->machine->driver_data<_galaga_state>();
+ galaga_state *state = screen->machine->driver_data<galaga_state>();
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
draw_stars(screen->machine,bitmap,cliprect);
@@ -581,7 +581,7 @@ SCREEN_UPDATE( galaga )
SCREEN_EOF( galaga )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ galaga_state *state = machine->driver_data<galaga_state>();
/* this function is called by galaga_interrupt_1() */
int s0,s1,s2;
static const int speeds[8] = { -1, -2, -3, 0, 3, 2, 1, 0 };
diff --git a/src/mame/video/galpani2.c b/src/mame/video/galpani2.c
index 24dd99eb3ef..1b4891ec691 100644
--- a/src/mame/video/galpani2.c
+++ b/src/mame/video/galpani2.c
@@ -9,6 +9,7 @@
#include "emu.h"
#include "includes/kaneko16.h"
+#include "includes/galpani2.h"
/*
304000:0040 0000 0100 0000-0000 0000 0000 0000 (Sprites regs)
diff --git a/src/mame/video/ms32.c b/src/mame/video/ms32.c
index 9669353cbb7..f3c6684fe6f 100644
--- a/src/mame/video/ms32.c
+++ b/src/mame/video/ms32.c
@@ -13,7 +13,6 @@ priority should be given to
#include "emu.h"
-#include "includes/tetrisp2.h"
#include "includes/ms32.h"
@@ -206,10 +205,74 @@ WRITE32_HANDLER( ms32_gfxctrl_w )
/* SPRITES based on tetrisp2 for now, readd priority bits later */
-/* now using function in tetrisp2.c */
+static void draw_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle *cliprect, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int reverseorder)
+{
+ int tx, ty, sx, sy, flipx, flipy;
+ int xsize, ysize;
+ int code, attr, color, size;
+ int pri;
+ int xzoom, yzoom;
+ gfx_element *gfx = machine->gfx[gfxnum];
+
+ UINT16 *source = sprram_top;
+ UINT16 *finish = sprram_top + (sprram_size - 0x10) / 2;
+
+ if (reverseorder == 1)
+ {
+ source = sprram_top + (sprram_size - 0x10) / 2;
+ finish = sprram_top;
+ }
+
+ for (;reverseorder ? (source>=finish) : (source<finish); reverseorder ? (source-=8) : (source+=8))
+ {
+ attr = source[ 0 ];
+ pri = (attr & 0x00f0);
+
+ if ((attr & 0x0004) == 0) continue;
+
+ flipx = attr & 1;
+ flipy = attr & 2;
+ code = source[ 1 ];
+ color = source[ 2 ];
+ tx = (code >> 0) & 0xff;
+ ty = (code >> 8) & 0xff;
+
+ code = (color & 0x0fff);
+ color = (color >> 12) & 0xf;
+ size = source[ 3 ];
+ xsize = ((size >> 0) & 0xff) + 1;
+ ysize = ((size >> 8) & 0xff) + 1;
+ sx = (source[5] & 0x3ff) - (source[5] & 0x400);
+ sy = (source[4] & 0x1ff) - (source[4] & 0x200);
+ xzoom = (source[ 6 ]&0xffff);
+ yzoom = (source[ 7 ]&0xffff);
+
+ {
+ if (!yzoom || !xzoom)
+ continue;
+
+ yzoom = 0x1000000/yzoom;
+ xzoom = 0x1000000/xzoom;
+ }
+
+
+ gfx_element_set_source_clip(gfx, tx, xsize, ty, ysize);
+
+ {
+ // passes the priority as the upper bits of the colour
+ // for post-processing in mixer instead
+ pdrawgfxzoom_transpen_raw(bitmap, cliprect, gfx,
+ code,
+ color<<8 | pri<<8,
+ flipx, flipy,
+ sx,sy,
+ xzoom, yzoom, bitmap_pri,0, 0);
+ }
+ } /* end sprite loop */
+}
static void draw_roz(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect,int priority)
@@ -341,7 +404,7 @@ SCREEN_UPDATE( ms32 )
bitmap_fill(state->temp_bitmap_sprites,cliprect,0);
bitmap_fill(state->temp_bitmap_sprites_pri,cliprect,0);
- tetrisp2_draw_sprites(screen->machine, state->temp_bitmap_sprites, state->temp_bitmap_sprites_pri, cliprect, NULL, state->sprram_16, 0x20000, 0, state->reverse_sprite_order, 0, 1 );
+ draw_sprites(screen->machine, state->temp_bitmap_sprites, state->temp_bitmap_sprites_pri, cliprect, state->sprram_16, 0x20000, 0, state->reverse_sprite_order);
diff --git a/src/mame/video/tetrisp2.c b/src/mame/video/tetrisp2.c
index c787de9cab4..c2ed65a505e 100644
--- a/src/mame/video/tetrisp2.c
+++ b/src/mame/video/tetrisp2.c
@@ -377,7 +377,7 @@ VIDEO_START( rocknms )
/* sprites should be able to create shadows too, how?
-- it appears that sprites which should be shadows are often rendered *UNDER* the tilemaps, maybe related?
*/
-void tetrisp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle *cliprect, UINT8* priram, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int reverseorder, int flip, int allowzoom)
+static void tetrisp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *bitmap_pri, const rectangle *cliprect, UINT8* priority_ram, UINT16 *sprram_top, size_t sprram_size, int gfxnum, int flip)
{
int tx, ty, sx, sy, flipx, flipy;
int xsize, ysize;
@@ -385,22 +385,12 @@ void tetrisp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t
int pri;
int xzoom, yzoom;
UINT32 primask;
- UINT8 *priority_ram;
gfx_element *gfx = machine->gfx[gfxnum];
UINT16 *source = sprram_top;
UINT16 *finish = sprram_top + (sprram_size - 0x10) / 2;
- if (reverseorder == 1)
- {
- source = sprram_top + (sprram_size - 0x10) / 2;
- finish = sprram_top;
- }
-
- priority_ram = priram;
-
-
- for (;reverseorder ? (source>=finish) : (source<finish); reverseorder ? (source-=8) : (source+=8))
+ for (; source<finish; source+=8)
{
attr = source[ 0 ];
@@ -418,53 +408,20 @@ void tetrisp2_draw_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t
ty = (code >> 8) & 0xff;
code = (color & 0x0fff);
-
color = (color >> 12) & 0xf;
-
size = source[ 3 ];
xsize = ((size >> 0) & 0xff) + 1;
ysize = ((size >> 8) & 0xff) + 1;
- sy = source[ 4 ];
- sx = source[ 5 ];
-
- sx = (sx & 0x3ff) - (sx & 0x400);
- sy = (sy & 0x1ff) - (sy & 0x200);
-
- xzoom = (source[ 6 ]&0xffff);
- yzoom = (source[ 7 ]&0xffff);
-
- // tetrisp2 hardware doesn't work with zoom?
- if (allowzoom)
- {
- if (!yzoom || !xzoom)
- continue;
-
- yzoom = 0x1000000/yzoom;
- xzoom = 0x1000000/xzoom;
- }
- else
- {
- xzoom = 0x10000;
- yzoom = 0x10000;
- }
+ sx = (source[5] & 0x3ff) - (source[5] & 0x400);
+ sy = (source[4] & 0x1ff) - (source[4] & 0x200);
+ xzoom = 0x10000;
+ yzoom = 0x10000;
gfx_element_set_source_clip(gfx, tx, xsize, ty, ysize);
- if (priority_ram == NULL)
- {
- // passes the priority as the upper bits of the colour
- // for post-processing in mixer instead
- pdrawgfxzoom_transpen_raw(bitmap, cliprect, gfx,
- code,
- color<<8 | pri<<8,
- flipx, flipy,
- sx,sy,
- xzoom, yzoom, bitmap_pri,0, 0);
- }
- else
{
primask = 0;
if (priority_ram[(pri | 0x0a00 | 0x1500) / 2] & 0x38) primask |= 1 << 0;
@@ -579,7 +536,7 @@ SCREEN_UPDATE( tetrisp2 )
else if (asc_pri == 2)
tilemap_draw(bitmap,cliprect, tilemap_fg, 0, 1 << 2);
- tetrisp2_draw_sprites(screen->machine, bitmap,screen->machine->priority_bitmap, cliprect, tetrisp2_priority, screen->machine->generic.spriteram.u16, screen->machine->generic.spriteram_size, 0, 0, (tetrisp2_systemregs[0x00] & 0x02), 0);
+ tetrisp2_draw_sprites(screen->machine, bitmap, screen->machine->priority_bitmap, cliprect, tetrisp2_priority, screen->machine->generic.spriteram.u16, screen->machine->generic.spriteram_size, 0, (tetrisp2_systemregs[0x00] & 0x02));
return 0;
}
@@ -663,7 +620,7 @@ SCREEN_UPDATE( rockntread )
else if (asc_pri == 2)
tilemap_draw(bitmap,cliprect, tilemap_fg, 0, 1 << 2);
- tetrisp2_draw_sprites(screen->machine, bitmap,screen->machine->priority_bitmap,cliprect, tetrisp2_priority, screen->machine->generic.spriteram.u16, screen->machine->generic.spriteram_size, 0, 0, (tetrisp2_systemregs[0x00] & 0x02), 0);
+ tetrisp2_draw_sprites(screen->machine, bitmap, screen->machine->priority_bitmap,cliprect, tetrisp2_priority, screen->machine->generic.spriteram.u16, screen->machine->generic.spriteram_size, 0, (tetrisp2_systemregs[0x00] & 0x02));
return 0;
}
@@ -730,7 +687,7 @@ SCREEN_UPDATE( rocknms )
else if (asc_pri == 2)
tilemap_draw(bitmap,cliprect, tilemap_sub_fg, 0, 1 << 2);
- tetrisp2_draw_sprites(screen->machine, bitmap,screen->machine->priority_bitmap,cliprect, tetrisp2_priority, screen->machine->generic.spriteram2.u16, screen->machine->generic.spriteram2_size, 4, 0, (tetrisp2_systemregs[0x00] & 0x02), 0);
+ tetrisp2_draw_sprites(screen->machine, bitmap, screen->machine->priority_bitmap,cliprect, tetrisp2_priority, screen->machine->generic.spriteram2.u16, screen->machine->generic.spriteram2_size, 4, (tetrisp2_systemregs[0x00] & 0x02));
}
else if (screen == right_screen) /* game screen */
{
@@ -783,7 +740,7 @@ SCREEN_UPDATE( rocknms )
else if (asc_pri == 2)
tilemap_draw(bitmap,cliprect, tilemap_fg, 0, 1 << 2);
- tetrisp2_draw_sprites(screen->machine, bitmap,screen->machine->priority_bitmap,cliprect, tetrisp2_priority, screen->machine->generic.spriteram.u16, screen->machine->generic.spriteram_size, 0, 0, (tetrisp2_systemregs[0x00] & 0x02), 0);
+ tetrisp2_draw_sprites(screen->machine, bitmap, screen->machine->priority_bitmap,cliprect, tetrisp2_priority, screen->machine->generic.spriteram.u16, screen->machine->generic.spriteram_size, 0, (tetrisp2_systemregs[0x00] & 0x02));
}
return 0;
diff --git a/src/mame/video/xevious.c b/src/mame/video/xevious.c
index 590320a2a92..7324bf2fc45 100644
--- a/src/mame/video/xevious.c
+++ b/src/mame/video/xevious.c
@@ -176,7 +176,7 @@ PALETTE_INIT( battles )
static TILE_GET_INFO( get_fg_tile_info )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ xevious_state *state = machine->driver_data<xevious_state>();
UINT8 attr = state->xevious_fg_colorram[tile_index];
@@ -195,7 +195,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ xevious_state *state = machine->driver_data<xevious_state>();
UINT8 code = state->xevious_bg_videoram[tile_index];
UINT8 attr = state->xevious_bg_colorram[tile_index];
@@ -217,7 +217,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( xevious )
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ xevious_state *state = machine->driver_data<xevious_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows, 8,8,64,32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
@@ -243,7 +243,7 @@ VIDEO_START( xevious )
WRITE8_HANDLER( xevious_fg_videoram_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ xevious_state *state = space->machine->driver_data<xevious_state>();
state->xevious_fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
@@ -251,7 +251,7 @@ WRITE8_HANDLER( xevious_fg_videoram_w )
WRITE8_HANDLER( xevious_fg_colorram_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ xevious_state *state = space->machine->driver_data<xevious_state>();
state->xevious_fg_colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
@@ -259,7 +259,7 @@ WRITE8_HANDLER( xevious_fg_colorram_w )
WRITE8_HANDLER( xevious_bg_videoram_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ xevious_state *state = space->machine->driver_data<xevious_state>();
state->xevious_bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -267,7 +267,7 @@ WRITE8_HANDLER( xevious_bg_videoram_w )
WRITE8_HANDLER( xevious_bg_colorram_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ xevious_state *state = space->machine->driver_data<xevious_state>();
state->xevious_bg_colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
@@ -275,7 +275,7 @@ WRITE8_HANDLER( xevious_bg_colorram_w )
WRITE8_HANDLER( xevious_vh_latch_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ xevious_state *state = space->machine->driver_data<xevious_state>();
int reg;
int scroll = data + ((offset&0x01)<<8); /* A0 -> D8 */
@@ -309,14 +309,14 @@ WRITE8_HANDLER( xevious_vh_latch_w )
/* emulation for schematic 9B */
WRITE8_HANDLER( xevious_bs_w )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ xevious_state *state = space->machine->driver_data<xevious_state>();
state->xevious_bs[offset & 1] = data;
}
READ8_HANDLER( xevious_bb_r )
{
- _galaga_state *state = space->machine->driver_data<_galaga_state>();
+ xevious_state *state = space->machine->driver_data<xevious_state>();
UINT8 *rom2a = space->machine->region("gfx4")->base();
UINT8 *rom2b = rom2a+0x1000;
@@ -416,7 +416,7 @@ ROM 3M,3L color replace table for sprite
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- _galaga_state *state = machine->driver_data<_galaga_state>();
+ xevious_state *state = machine->driver_data<xevious_state>();
UINT8 *spriteram = state->xevious_sr3 + 0x780;
UINT8 *spriteram_2 = state->xevious_sr1 + 0x780;
@@ -499,7 +499,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
SCREEN_UPDATE( xevious )
{
- _galaga_state *state = screen->machine->driver_data<_galaga_state>();
+ xevious_state *state = screen->machine->driver_data<xevious_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
draw_sprites(screen->machine, bitmap,cliprect);
diff --git a/src/mame/video/ygv608.c b/src/mame/video/ygv608.c
index 56197bce09c..4994b83732b 100644
--- a/src/mame/video/ygv608.c
+++ b/src/mame/video/ygv608.c
@@ -30,7 +30,6 @@
*/
#include "emu.h"
-#include "includes/namcond1.h" // only while debugging
#include "video/ygv608.h"
#define _ENABLE_SPRITES
@@ -40,6 +39,14 @@
//#define _ENABLE_ROTATE_ZOOM
//#define _SHOW_VIDEO_DEBUG
+#define GFX_8X8_4BIT 0
+#define GFX_16X16_4BIT 1
+#define GFX_32X32_4BIT 2
+#define GFX_64X64_4BIT 3
+#define GFX_8X8_8BIT 4
+#define GFX_16X16_8BIT 5
+
+static UINT8 namcond1_gfxbank;
static YGV608 ygv608;
static tilemap_t *tilemap_A_cache_8[3];
@@ -59,6 +66,11 @@ static void SetPostShortcuts( running_machine *machine, int reg );
static void ShowYGV608Registers( void );
#endif
+void ygv608_set_gfxbank(UINT8 gfxbank)
+{
+ namcond1_gfxbank = gfxbank;
+}
+
/* interrupt generated every 1ms second */
INTERRUPT_GEN( ygv608_timed_interrupt )
{
@@ -509,6 +521,7 @@ VIDEO_START( ygv608 )
ygv608.screen_resize = 1;
ygv608.tilemap_resize = 1;
namcond1_gfxbank = 0;
+ state_save_register_global(machine, namcond1_gfxbank);
/* create tilemaps of all sizes and combinations */
tilemap_A_cache_8[0] = tilemap_create(machine, get_tile_info_A_8, get_tile_offset, 8,8, 32,32);
diff --git a/src/mame/video/ygv608.h b/src/mame/video/ygv608.h
index 64f47c92e64..f6ed81fb677 100644
--- a/src/mame/video/ygv608.h
+++ b/src/mame/video/ygv608.h
@@ -329,6 +329,8 @@ typedef struct _ygv608 {
} YGV608, *pYGV608;
+void ygv608_set_gfxbank(UINT8 gfxbank);
+
INTERRUPT_GEN( ygv608_timed_interrupt );
VIDEO_START( ygv608 );
SCREEN_UPDATE( ygv608 );
@@ -337,6 +339,6 @@ READ16_HANDLER( ygv608_r );
WRITE16_HANDLER( ygv608_w );
// to be removed
-extern READ16_HANDLER( ygv608_debug_trigger );
+READ16_HANDLER( ygv608_debug_trigger );
#endif