summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2013-02-12 13:26:06 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2013-02-12 13:26:06 +0000
commitc53bb58d605f9bb2a7c2f1a5be112850ff5320d8 (patch)
tree0b197bb4e38946021d94ac3b8430737c1de2cd1c /src/mame
parent3c58736cbf9c7f00909cb66f50dcc89bca6daf00 (diff)
Modernization of drivers part 18 (no whatsnew)
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/jclub2.c12
-rw-r--r--src/mame/drivers/segag80r.c22
-rw-r--r--src/mame/drivers/segag80v.c8
-rw-r--r--src/mame/drivers/segas32.c242
-rw-r--r--src/mame/drivers/seibuspi.c131
-rw-r--r--src/mame/drivers/seta.c13
-rw-r--r--src/mame/drivers/seta2.c9
-rw-r--r--src/mame/drivers/sf.c2
-rw-r--r--src/mame/drivers/simpsons.c18
-rw-r--r--src/mame/drivers/skullxbo.c2
-rw-r--r--src/mame/drivers/slapfght.c15
-rw-r--r--src/mame/drivers/snk.c98
-rw-r--r--src/mame/drivers/snk6502.c9
-rw-r--r--src/mame/drivers/snowbros.c25
-rw-r--r--src/mame/drivers/spacefb.c14
-rw-r--r--src/mame/drivers/spdodgeb.c88
-rw-r--r--src/mame/drivers/speedatk.c10
-rw-r--r--src/mame/drivers/splash.c13
-rw-r--r--src/mame/drivers/sprint2.c21
-rw-r--r--src/mame/drivers/sprint8.c9
-rw-r--r--src/mame/drivers/spy.c53
-rw-r--r--src/mame/drivers/srmp2.c10
-rw-r--r--src/mame/drivers/sshangha.c12
-rw-r--r--src/mame/drivers/ssv.c70
-rw-r--r--src/mame/drivers/stactics.c44
-rw-r--r--src/mame/drivers/starwars.c15
-rw-r--r--src/mame/drivers/suna8.c14
-rw-r--r--src/mame/drivers/superqix.c52
-rw-r--r--src/mame/drivers/suprnova.c53
-rw-r--r--src/mame/drivers/suprridr.c2
-rw-r--r--src/mame/drivers/system1.c23
-rw-r--r--src/mame/drivers/system16.c72
-rw-r--r--src/mame/includes/sauro.h2
-rw-r--r--src/mame/includes/sbasketb.h1
-rw-r--r--src/mame/includes/scotrsht.h1
-rw-r--r--src/mame/includes/scramble.h2
-rw-r--r--src/mame/includes/sderby.h1
-rw-r--r--src/mame/includes/segag80r.h10
-rw-r--r--src/mame/includes/segag80v.h4
-rw-r--r--src/mame/includes/segas32.h79
-rw-r--r--src/mame/includes/seibuspi.h13
-rw-r--r--src/mame/includes/seicross.h1
-rw-r--r--src/mame/includes/senjyo.h3
-rw-r--r--src/mame/includes/seta.h11
-rw-r--r--src/mame/includes/seta2.h2
-rw-r--r--src/mame/includes/sf.h3
-rw-r--r--src/mame/includes/shadfrce.h1
-rw-r--r--src/mame/includes/shangkid.h4
-rw-r--r--src/mame/includes/shaolins.h1
-rw-r--r--src/mame/includes/shootout.h1
-rw-r--r--src/mame/includes/sidearms.h3
-rw-r--r--src/mame/includes/sidepckt.h1
-rw-r--r--src/mame/includes/silkroad.h1
-rw-r--r--src/mame/includes/simpsons.h5
-rw-r--r--src/mame/includes/skullxbo.h1
-rw-r--r--src/mame/includes/skydiver.h1
-rw-r--r--src/mame/includes/skyfox.h2
-rw-r--r--src/mame/includes/skykid.h1
-rw-r--r--src/mame/includes/skyraid.h5
-rw-r--r--src/mame/includes/slapfght.h3
-rw-r--r--src/mame/includes/slapshot.h3
-rw-r--r--src/mame/includes/snk.h5
-rw-r--r--src/mame/includes/snk6502.h1
-rw-r--r--src/mame/includes/snk68.h2
-rw-r--r--src/mame/includes/snowbros.h3
-rw-r--r--src/mame/includes/solomon.h1
-rw-r--r--src/mame/includes/sonson.h1
-rw-r--r--src/mame/includes/spacefb.h9
-rw-r--r--src/mame/includes/spdodgeb.h2
-rw-r--r--src/mame/includes/speedatk.h1
-rw-r--r--src/mame/includes/speedbal.h1
-rw-r--r--src/mame/includes/speedspn.h1
-rw-r--r--src/mame/includes/splash.h4
-rw-r--r--src/mame/includes/sprcros2.h1
-rw-r--r--src/mame/includes/sprint2.h5
-rw-r--r--src/mame/includes/sprint8.h3
-rw-r--r--src/mame/includes/spy.h1
-rw-r--r--src/mame/includes/srmp2.h1
-rw-r--r--src/mame/includes/srumbler.h1
-rw-r--r--src/mame/includes/sshangha.h1
-rw-r--r--src/mame/includes/sslam.h1
-rw-r--r--src/mame/includes/ssozumo.h1
-rw-r--r--src/mame/includes/sspeedr.h3
-rw-r--r--src/mame/includes/ssrj.h1
-rw-r--r--src/mame/includes/ssv.h7
-rw-r--r--src/mame/includes/st0016.h3
-rw-r--r--src/mame/includes/stactics.h6
-rw-r--r--src/mame/includes/starcrus.h4
-rw-r--r--src/mame/includes/starfire.h1
-rw-r--r--src/mame/includes/starshp1.h15
-rw-r--r--src/mame/includes/starwars.h4
-rw-r--r--src/mame/includes/stfight.h2
-rw-r--r--src/mame/includes/stlforce.h1
-rw-r--r--src/mame/includes/strnskil.h1
-rw-r--r--src/mame/includes/subs.h2
-rw-r--r--src/mame/includes/suna16.h1
-rw-r--r--src/mame/includes/suna8.h3
-rw-r--r--src/mame/includes/superchs.h1
-rw-r--r--src/mame/includes/superqix.h4
-rw-r--r--src/mame/includes/suprloco.h3
-rw-r--r--src/mame/includes/suprnova.h15
-rw-r--r--src/mame/includes/suprridr.h1
-rw-r--r--src/mame/includes/system1.h9
-rw-r--r--src/mame/includes/system16.h6
-rw-r--r--src/mame/machine/scramble.c15
-rw-r--r--src/mame/machine/segas32.c8
-rw-r--r--src/mame/machine/simpsons.c6
-rw-r--r--src/mame/machine/starwars.c75
-rw-r--r--src/mame/machine/subs.c58
-rw-r--r--src/mame/video/sauro.c28
-rw-r--r--src/mame/video/sbasketb.c15
-rw-r--r--src/mame/video/scotrsht.c17
-rw-r--r--src/mame/video/sderby.c17
-rw-r--r--src/mame/video/segag80r.c116
-rw-r--r--src/mame/video/segag80v.c29
-rw-r--r--src/mame/video/segas32.c623
-rw-r--r--src/mame/video/seibuspi.c110
-rw-r--r--src/mame/video/seicross.c21
-rw-r--r--src/mame/video/senjyo.c41
-rw-r--r--src/mame/video/seta.c237
-rw-r--r--src/mame/video/seta2.c35
-rw-r--r--src/mame/video/sf.c29
-rw-r--r--src/mame/video/shadfrce.c17
-rw-r--r--src/mame/video/shangkid.c38
-rw-r--r--src/mame/video/shaolins.c17
-rw-r--r--src/mame/video/shootout.c25
-rw-r--r--src/mame/video/sidearms.c53
-rw-r--r--src/mame/video/sidepckt.c13
-rw-r--r--src/mame/video/silkroad.c13
-rw-r--r--src/mame/video/simpsons.c15
-rw-r--r--src/mame/video/skullxbo.c17
-rw-r--r--src/mame/video/skydiver.c15
-rw-r--r--src/mame/video/skyfox.c36
-rw-r--r--src/mame/video/skykid.c15
-rw-r--r--src/mame/video/skyraid.c52
-rw-r--r--src/mame/video/slapfght.c30
-rw-r--r--src/mame/video/slapshot.c121
-rw-r--r--src/mame/video/snk.c19
-rw-r--r--src/mame/video/snk68.c32
-rw-r--r--src/mame/video/solomon.c13
-rw-r--r--src/mame/video/sonson.c17
-rw-r--r--src/mame/video/spacefb.c104
-rw-r--r--src/mame/video/spdodgeb.c17
-rw-r--r--src/mame/video/speedbal.c13
-rw-r--r--src/mame/video/speedspn.c9
-rw-r--r--src/mame/video/splash.c61
-rw-r--r--src/mame/video/sprcros2.c25
-rw-r--r--src/mame/video/sprint2.c14
-rw-r--r--src/mame/video/sprint8.c21
-rw-r--r--src/mame/video/srumbler.c15
-rw-r--r--src/mame/video/sslam.c13
-rw-r--r--src/mame/video/ssozumo.c13
-rw-r--r--src/mame/video/sspeedr.c53
-rw-r--r--src/mame/video/ssrj.c15
-rw-r--r--src/mame/video/ssv.c43
-rw-r--r--src/mame/video/st0016.c36
-rw-r--r--src/mame/video/stactics.c94
-rw-r--r--src/mame/video/starcrus.c184
-rw-r--r--src/mame/video/starfire.c7
-rw-r--r--src/mame/video/starshp1.c147
-rw-r--r--src/mame/video/stfight.c30
-rw-r--r--src/mame/video/stlforce.c13
-rw-r--r--src/mame/video/strnskil.c17
-rw-r--r--src/mame/video/suna16.c19
-rw-r--r--src/mame/video/suna8.c46
-rw-r--r--src/mame/video/superchs.c23
-rw-r--r--src/mame/video/superqix.c28
-rw-r--r--src/mame/video/suprloco.c26
-rw-r--r--src/mame/video/suprnova.c92
-rw-r--r--src/mame/video/suprridr.c5
-rw-r--r--src/mame/video/system1.c67
-rw-r--r--src/mame/video/system16.c70
172 files changed, 2446 insertions, 2398 deletions
diff --git a/src/mame/drivers/jclub2.c b/src/mame/drivers/jclub2.c
index fb2172311b2..8b7d5789eb3 100644
--- a/src/mame/drivers/jclub2.c
+++ b/src/mame/drivers/jclub2.c
@@ -147,6 +147,7 @@ public:
UINT32 screen_update_jclub2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(darkhors_irq);
+ void draw_sprites_darkhors(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
@@ -189,11 +190,10 @@ WRITE32_MEMBER(darkhors_state::darkhors_tmapram2_w)
m_tmap2->mark_tile_dirty(offset);
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void darkhors_state::draw_sprites_darkhors(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- darkhors_state *state = machine.driver_data<darkhors_state>();
- UINT32 *s = state->m_spriteram;
- UINT32 *end = state->m_spriteram + 0x02000/4;
+ UINT32 *s = m_spriteram;
+ UINT32 *end = m_spriteram + 0x02000/4;
for ( ; s < end; s += 8/4 )
{
@@ -218,7 +218,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
sy = -sy;
sy += 0xf8;
- drawgfx_transpen( bitmap, cliprect, machine.gfx[0],
+ drawgfx_transpen( bitmap, cliprect, machine().gfx[0],
code/2, color,
flipx, flipy, sx, sy, 0);
}
@@ -258,8 +258,8 @@ UINT32 darkhors_state::screen_update_darkhors(screen_device &screen, bitmap_ind1
m_tmap2->set_scrollx(0, (m_tmapscroll2[0] >> 16) - 5);
m_tmap2->set_scrolly(0, (m_tmapscroll2[0] & 0xffff) - 0xff );
if (layers_ctrl & 2) m_tmap2->draw(bitmap, cliprect, 0, 0);
+ if (layers_ctrl & 4) draw_sprites_darkhors(bitmap,cliprect);
- if (layers_ctrl & 4) draw_sprites(machine(),bitmap,cliprect);
#if DARKHORS_DEBUG
#if 0
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index bb0bf3b1e4e..0deb6c2df91 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -166,17 +166,15 @@ void segag80r_state::machine_start()
*
*************************************/
-static offs_t decrypt_offset(address_space &space, offs_t offset)
+offs_t segag80r_state::decrypt_offset(address_space &space, offs_t offset)
{
- segag80r_state *state = space.machine().driver_data<segag80r_state>();
-
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
offs_t pc = space.device().safe_pcbase();
if ((UINT16)pc == 0xffff || space.read_byte(pc) != 0x32)
return offset;
/* fetch the low byte of the address and munge it */
- return (offset & 0xff00) | (*state->m_decrypt)(pc, space.read_byte(pc + 1));
+ return (offset & 0xff00) | (*m_decrypt)(pc, space.read_byte(pc + 1));
}
WRITE8_MEMBER(segag80r_state::mainram_w)
@@ -198,7 +196,7 @@ WRITE8_MEMBER(segag80r_state::usb_ram_w){ device_t *device = machine().device("u
*
*************************************/
-INLINE UINT8 demangle(UINT8 d7d6, UINT8 d5d4, UINT8 d3d2, UINT8 d1d0)
+inline UINT8 segag80r_state::demangle(UINT8 d7d6, UINT8 d5d4, UINT8 d3d2, UINT8 d1d0)
{
return ((d7d6 << 7) & 0x80) | ((d7d6 << 2) & 0x40) |
((d5d4 << 5) & 0x20) | ((d5d4 << 0) & 0x10) |
@@ -1415,15 +1413,15 @@ ROM_END
*
*************************************/
-static void monsterb_expand_gfx(running_machine &machine, const char *region)
+void segag80r_state::monsterb_expand_gfx(const char *region)
{
UINT8 *temp, *dest;
int i;
/* expand the background ROMs; A11/A12 of each ROM is independently controlled via */
/* banking */
- dest = machine.root_device().memregion(region)->base();
- temp = auto_alloc_array(machine, UINT8, 0x4000);
+ dest = machine().root_device().memregion(region)->base();
+ temp = auto_alloc_array(machine(), UINT8, 0x4000);
memcpy(temp, dest, 0x4000);
/* 16 effective total banks */
@@ -1432,7 +1430,7 @@ static void monsterb_expand_gfx(running_machine &machine, const char *region)
memcpy(&dest[0x0000 + i * 0x800], &temp[0x0000 + (i & 3) * 0x800], 0x800);
memcpy(&dest[0x8000 + i * 0x800], &temp[0x2000 + (i >> 2) * 0x800], 0x800);
}
- auto_free(machine, temp);
+ auto_free(machine(), temp);
}
@@ -1505,7 +1503,7 @@ DRIVER_INIT_MEMBER(segag80r_state,monsterb)
/* configure video */
m_background_pcb = G80_BACKGROUND_MONSTERB;
- monsterb_expand_gfx(machine(), "gfx1");
+ monsterb_expand_gfx("gfx1");
/* install background board handlers */
iospace.install_write_handler(0xb8, 0xbd, write8_delegate(FUNC(segag80r_state::monsterb_back_port_w),this));
@@ -1524,7 +1522,7 @@ DRIVER_INIT_MEMBER(segag80r_state,monster2)
/* configure video */
m_background_pcb = G80_BACKGROUND_PIGNEWT;
- monsterb_expand_gfx(machine(), "gfx1");
+ monsterb_expand_gfx("gfx1");
/* install background board handlers */
iospace.install_write_handler(0xb4, 0xb5, write8_delegate(FUNC(segag80r_state::pignewt_back_color_w),this));
@@ -1544,7 +1542,7 @@ DRIVER_INIT_MEMBER(segag80r_state,pignewt)
/* configure video */
m_background_pcb = G80_BACKGROUND_PIGNEWT;
- monsterb_expand_gfx(machine(), "gfx1");
+ monsterb_expand_gfx("gfx1");
/* install background board handlers */
iospace.install_write_handler(0xb4, 0xb5, write8_delegate(FUNC(segag80r_state::pignewt_back_color_w),this));
diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c
index 01fd63d347e..412fa9546d8 100644
--- a/src/mame/drivers/segag80v.c
+++ b/src/mame/drivers/segag80v.c
@@ -184,17 +184,15 @@ void segag80v_state::machine_start()
*
*************************************/
-static offs_t decrypt_offset(address_space &space, offs_t offset)
+offs_t segag80v_state::decrypt_offset(address_space &space, offs_t offset)
{
- segag80v_state *state = space.machine().driver_data<segag80v_state>();
-
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
offs_t pc = space.device().safe_pcbase();
if ((UINT16)pc == 0xffff || space.read_byte(pc) != 0x32)
return offset;
/* fetch the low byte of the address and munge it */
- return (offset & 0xff00) | (*state->m_decrypt)(pc, space.read_byte(pc + 1));
+ return (offset & 0xff00) | (*m_decrypt)(pc, space.read_byte(pc + 1));
}
WRITE8_MEMBER(segag80v_state::mainram_w)
@@ -216,7 +214,7 @@ WRITE8_MEMBER(segag80v_state::vectorram_w)
*
*************************************/
-INLINE UINT8 demangle(UINT8 d7d6, UINT8 d5d4, UINT8 d3d2, UINT8 d1d0)
+inline UINT8 segag80v_state::demangle(UINT8 d7d6, UINT8 d5d4, UINT8 d3d2, UINT8 d1d0)
{
return ((d7d6 << 7) & 0x80) | ((d7d6 << 2) & 0x40) |
((d5d4 << 5) & 0x20) | ((d5d4 << 0) & 0x10) |
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index 1b65498de67..cd25cd63c12 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -374,7 +374,6 @@ orunners: Interleaved with the dj and << >> buttons is the data the drives the
*
*************************************/
-static void signal_v60_irq(running_machine &machine, int data);
static void signal_sound_irq(running_machine &machine, int which);
@@ -406,10 +405,9 @@ MACHINE_RESET_MEMBER(segas32_state,system32)
*
*************************************/
-static void update_irq_state(running_machine &machine)
+void segas32_state::update_irq_state()
{
- segas32_state *state = machine.driver_data<segas32_state>();
- UINT8 effirq = state->m_v60_irq_control[7] & ~state->m_v60_irq_control[6] & 0x1f;
+ UINT8 effirq = m_v60_irq_control[7] & ~m_v60_irq_control[6] & 0x1f;
int vector;
/* loop over interrupt vectors, finding the highest priority one with */
@@ -417,38 +415,36 @@ static void update_irq_state(running_machine &machine)
for (vector = 0; vector < 5; vector++)
if (effirq & (1 << vector))
{
- machine.device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, vector);
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, vector);
break;
}
/* if we didn't find any, clear the interrupt line */
if (vector == 5)
- machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
}
-static void signal_v60_irq(running_machine &machine, int which)
+void segas32_state::signal_v60_irq(int which)
{
- segas32_state *state = machine.driver_data<segas32_state>();
int i;
/* see if this interrupt input is mapped to any vectors; if so, mark them */
for (i = 0; i < 5; i++)
- if (state->m_v60_irq_control[i] == which)
- state->m_v60_irq_control[7] |= 1 << i;
- update_irq_state(machine);
+ if (m_v60_irq_control[i] == which)
+ m_v60_irq_control[7] |= 1 << i;
+ update_irq_state();
}
TIMER_DEVICE_CALLBACK_MEMBER(segas32_state::signal_v60_irq_callback)
{
- signal_v60_irq(machine(), param);
+ signal_v60_irq(param);
}
-static void int_control_w(address_space &space, int offset, UINT8 data)
+void segas32_state::int_control_w(address_space &space, int offset, UINT8 data)
{
- segas32_state *state = space.machine().driver_data<segas32_state>();
int duration;
// logerror("%06X:int_control_w(%X) = %02X\n", space.device().safe_pc(), offset, data);
@@ -459,42 +455,42 @@ static void int_control_w(address_space &space, int offset, UINT8 data)
case 2:
case 3:
case 4: /* vectors */
- state->m_v60_irq_control[offset] = data;
+ m_v60_irq_control[offset] = data;
break;
case 5: /* unknown */
- state->m_v60_irq_control[offset] = data;
+ m_v60_irq_control[offset] = data;
break;
case 6: /* mask */
- state->m_v60_irq_control[offset] = data;
- update_irq_state(space.machine());
+ m_v60_irq_control[offset] = data;
+ update_irq_state();
break;
case 7: /* acknowledge */
- state->m_v60_irq_control[offset] &= data;
- update_irq_state(space.machine());
+ m_v60_irq_control[offset] &= data;
+ update_irq_state();
break;
case 8:
case 9: /* timer 0 count */
- state->m_v60_irq_control[offset] = data;
- duration = state->m_v60_irq_control[8] + ((state->m_v60_irq_control[9] << 8) & 0xf00);
+ m_v60_irq_control[offset] = data;
+ duration = m_v60_irq_control[8] + ((m_v60_irq_control[9] << 8) & 0xf00);
if (duration)
{
attotime period = attotime::from_hz(TIMER_0_CLOCK) * duration;
- state->m_v60_irq_timer[0]->adjust(period, MAIN_IRQ_TIMER0);
+ m_v60_irq_timer[0]->adjust(period, MAIN_IRQ_TIMER0);
}
break;
case 10:
case 11: /* timer 1 count */
- state->m_v60_irq_control[offset] = data;
- duration = state->m_v60_irq_control[10] + ((state->m_v60_irq_control[11] << 8) & 0xf00);
+ m_v60_irq_control[offset] = data;
+ duration = m_v60_irq_control[10] + ((m_v60_irq_control[11] << 8) & 0xf00);
if (duration)
{
attotime period = attotime::from_hz(TIMER_1_CLOCK) * duration;
- state->m_v60_irq_timer[1]->adjust(period, MAIN_IRQ_TIMER1);
+ m_v60_irq_timer[1]->adjust(period, MAIN_IRQ_TIMER1);
}
break;
@@ -502,7 +498,7 @@ static void int_control_w(address_space &space, int offset, UINT8 data)
case 13:
case 14:
case 15: /* signal IRQ to sound CPU */
- signal_sound_irq(space.machine(), SOUND_IRQ_V60);
+ signal_sound_irq(machine(),SOUND_IRQ_V60);
break;
}
}
@@ -564,15 +560,15 @@ WRITE32_MEMBER(segas32_state::interrupt_control_32_w)
TIMER_CALLBACK_MEMBER(segas32_state::end_of_vblank_int)
{
- signal_v60_irq(machine(), MAIN_IRQ_VBSTOP);
- system32_set_vblank(machine(), 0);
+ signal_v60_irq(MAIN_IRQ_VBSTOP);
+ system32_set_vblank(0);
}
INTERRUPT_GEN_MEMBER(segas32_state::start_of_vblank_int)
{
- signal_v60_irq(machine(), MAIN_IRQ_VBSTART);
- system32_set_vblank(machine(), 1);
+ signal_v60_irq(MAIN_IRQ_VBSTART);
+ system32_set_vblank(1);
machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(segas32_state::end_of_vblank_int),this));
if (m_system32_prot_vblank)
(*m_system32_prot_vblank)(&device);
@@ -586,9 +582,8 @@ INTERRUPT_GEN_MEMBER(segas32_state::start_of_vblank_int)
*
*************************************/
-static UINT16 common_io_chip_r(address_space &space, int which, offs_t offset, UINT16 mem_mask)
+UINT16 segas32_state::common_io_chip_r(address_space &space, int which, offs_t offset, UINT16 mem_mask)
{
- segas32_state *state = space.machine().driver_data<segas32_state>();
static const char *const portnames[2][8] =
{
{ "P1_A", "P2_A", "PORTC_A", "PORTD_A", "SERVICE12_A", "SERVICE34_A", "PORTG_A", "PORTH_A" },
@@ -608,11 +603,11 @@ static UINT16 common_io_chip_r(address_space &space, int which, offs_t offset, U
case 0x0c/2:
case 0x0e/2:
/* if the port is configured as an output, return the last thing written */
- if (state->m_misc_io_data[which][0x1e/2] & (1 << offset))
- return state->m_misc_io_data[which][offset];
+ if (m_misc_io_data[which][0x1e/2] & (1 << offset))
+ return m_misc_io_data[which][offset];
/* otherwise, return an input port */
- return state->ioport(portnames[which][offset])->read_safe(0xffff);
+ return ioport(portnames[which][offset])->read_safe(0xffff);
/* 'SEGA' protection */
case 0x10/2:
@@ -627,20 +622,19 @@ static UINT16 common_io_chip_r(address_space &space, int which, offs_t offset, U
/* CNT register & mirror */
case 0x18/2:
case 0x1c/2:
- return state->m_misc_io_data[which][0x1c/2];
+ return m_misc_io_data[which][0x1c/2];
/* port direction register & mirror */
case 0x1a/2:
case 0x1e/2:
- return state->m_misc_io_data[which][0x1e/2];
+ return m_misc_io_data[which][0x1e/2];
}
return 0xffff;
}
-static void common_io_chip_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
+void segas32_state::common_io_chip_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- segas32_state *state = space.machine().driver_data<segas32_state>();
// UINT8 old;
/* only LSB matters */
@@ -649,8 +643,8 @@ static void common_io_chip_w(address_space &space, int which, offs_t offset, UIN
/* generic implementation */
offset &= 0x1f/2;
-// old = state->m_misc_io_data[which][offset];
- state->m_misc_io_data[which][offset] = data;
+// old = m_misc_io_data[which][offset];
+ m_misc_io_data[which][offset] = data;
switch (offset)
{
@@ -661,14 +655,14 @@ static void common_io_chip_w(address_space &space, int which, offs_t offset, UIN
case 0x08/2:
case 0x0a/2:
case 0x0c/2:
- if (state->m_sw2_output)
- state->m_sw2_output(which, data);
+ if (m_sw2_output)
+ (this->*m_sw2_output)(which, data);
break;
/* miscellaneous output */
case 0x06/2:
- if (state->m_sw1_output)
- state->m_sw1_output(which, data);
+ if (m_sw1_output)
+ (this->*m_sw1_output)(which, data);
if (which == 0)
{
@@ -686,7 +680,7 @@ static void common_io_chip_w(address_space &space, int which, offs_t offset, UIN
/* tile banking */
case 0x0e/2:
if (which == 0)
- state->m_system32_tilebank_external = data;
+ m_system32_tilebank_external = data;
else
{
/* multi-32 EEPROM access */
@@ -699,7 +693,7 @@ static void common_io_chip_w(address_space &space, int which, offs_t offset, UIN
/* CNT register */
case 0x1c/2:
- state->m_system32_displayenable[which] = (data & 0x02);
+ m_system32_displayenable[which] = (data & 0x02);
if (which == 0)
space.machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE);
break;
@@ -801,7 +795,7 @@ WRITE32_MEMBER(segas32_state::io_expansion_0_w)
{
/* harddunk uses bits 4,5 for output lamps */
if (m_sw3_output)
- m_sw3_output(0, data & 0xff);
+ (this->*m_sw3_output)(0, data & 0xff);
if (!m_custom_io_w[0].isnull())
(m_custom_io_w[0])(space, offset*2+0, data, mem_mask);
@@ -1043,10 +1037,9 @@ WRITE32_MEMBER(segas32_state::shared_ram_32_w)
*
*************************************/
-static void update_sound_irq_state(running_machine &machine)
+void segas32_state::update_sound_irq_state()
{
- segas32_state *state = machine.driver_data<segas32_state>();
- UINT8 effirq = state->m_sound_irq_input & ~state->m_sound_irq_control[3] & 0x07;
+ UINT8 effirq = m_sound_irq_input & ~m_sound_irq_control[3] & 0x07;
int vector;
/* loop over interrupt vectors, finding the highest priority one with */
@@ -1054,13 +1047,13 @@ static void update_sound_irq_state(running_machine &machine)
for (vector = 0; vector < 3; vector++)
if (effirq & (1 << vector))
{
- machine.device("soundcpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, 2 * vector);
+ machine().device("soundcpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, 2 * vector);
break;
}
/* if we didn't find any, clear the interrupt line */
if (vector == 3)
- machine.device("soundcpu")->execute().set_input_line(0, CLEAR_LINE);
+ machine().device("soundcpu")->execute().set_input_line(0, CLEAR_LINE);
}
@@ -1073,7 +1066,7 @@ static void signal_sound_irq(running_machine &machine, int which)
for (i = 0; i < 3; i++)
if (state->m_sound_irq_control[i] == which)
state->m_sound_irq_input |= 1 << i;
- update_sound_irq_state(machine);
+ state->update_sound_irq_state();
}
@@ -1084,7 +1077,7 @@ static void clear_sound_irq(running_machine &machine, int which)
for (i = 0; i < 3; i++)
if (state->m_sound_irq_control[i] == which)
state->m_sound_irq_input &= ~(1 << i);
- update_sound_irq_state(machine);
+ state->update_sound_irq_state();
}
@@ -1094,19 +1087,19 @@ WRITE8_MEMBER(segas32_state::sound_int_control_lo_w)
if (offset & 1)
{
m_sound_irq_input &= data;
- update_sound_irq_state(machine());
+ update_sound_irq_state();
}
/* high offsets signal an IRQ to the v60 */
if (offset & 4)
- signal_v60_irq(machine(), MAIN_IRQ_SOUND);
+ signal_v60_irq(MAIN_IRQ_SOUND);
}
WRITE8_MEMBER(segas32_state::sound_int_control_hi_w)
{
m_sound_irq_control[offset] = data;
- update_sound_irq_state(machine());
+ update_sound_irq_state();
}
@@ -4026,16 +4019,15 @@ ROM_END
*
*************************************/
-static void segas32_common_init(running_machine &machine, read16_delegate custom_r, write16_delegate custom_w)
+void segas32_state::segas32_common_init(read16_delegate custom_r, write16_delegate custom_w)
{
- segas32_state *state = machine.driver_data<segas32_state>();
/* reset the custom handlers and other pointers */
- state->m_custom_io_r[0] = custom_r;
- state->m_custom_io_w[0] = custom_w;
- state->m_system32_prot_vblank = NULL;
- state->m_sw1_output = NULL;
- state->m_sw2_output = NULL;
- state->m_sw3_output = NULL;
+ m_custom_io_r[0] = custom_r;
+ m_custom_io_w[0] = custom_w;
+ m_system32_prot_vblank = NULL;
+ m_sw1_output = NULL;
+ m_sw2_output = NULL;
+ m_sw3_output = NULL;
}
@@ -4053,13 +4045,13 @@ static void segas32_common_init(running_machine &machine, read16_delegate custom
* switches we need to fix
*************************************/
-static void radm_sw1_output( int which, UINT16 data )
+void segas32_state::radm_sw1_output( int which, UINT16 data )
{
if (which == 0)
output_set_value("Start_lamp", BIT(data, 2));
}
-static void radm_sw2_output( int which, UINT16 data )
+void segas32_state::radm_sw2_output( int which, UINT16 data )
{
if (which == 0)
{
@@ -4068,7 +4060,7 @@ static void radm_sw2_output( int which, UINT16 data )
}
}
-static void radr_sw2_output( int which, UINT16 data )
+void segas32_state::radr_sw2_output( int which, UINT16 data )
{
if (which == 0)
{
@@ -4077,7 +4069,7 @@ static void radr_sw2_output( int which, UINT16 data )
}
}
-static void alien3_sw1_output( int which, UINT16 data )
+void segas32_state::alien3_sw1_output( int which, UINT16 data )
{
if (which == 0)
{
@@ -4086,7 +4078,7 @@ static void alien3_sw1_output( int which, UINT16 data )
}
}
-static void arescue_sw1_output( int which, UINT16 data )
+void segas32_state::arescue_sw1_output( int which, UINT16 data )
{
if (which == 0)
{
@@ -4095,7 +4087,7 @@ static void arescue_sw1_output( int which, UINT16 data )
}
}
-static void f1lap_sw1_output( int which, UINT16 data )
+void segas32_state::f1lap_sw1_output( int which, UINT16 data )
{
if (which == 0)
{
@@ -4104,7 +4096,7 @@ static void f1lap_sw1_output( int which, UINT16 data )
}
}
-static void jpark_sw1_output( int which, UINT16 data )
+void segas32_state::jpark_sw1_output( int which, UINT16 data )
{
if (which == 0)
{
@@ -4113,7 +4105,7 @@ static void jpark_sw1_output( int which, UINT16 data )
}
}
-static void orunners_sw1_output( int which, UINT16 data )
+void segas32_state::orunners_sw1_output( int which, UINT16 data )
{
/* note ma = monitor A and mb = Monitor B */
if (which == 0)
@@ -4130,7 +4122,7 @@ static void orunners_sw1_output( int which, UINT16 data )
}
}
-static void orunners_sw2_output( int which, UINT16 data )
+void segas32_state::orunners_sw2_output( int which, UINT16 data )
{
/* note ma = monitor A and mb = Monitor B */
/* also note that the remaining bits are for the game's lcd display */
@@ -4147,7 +4139,7 @@ static void orunners_sw2_output( int which, UINT16 data )
}
}
-static void harddunk_sw1_output( int which, UINT16 data )
+void segas32_state::harddunk_sw1_output( int which, UINT16 data )
{
if (which == 0)
{
@@ -4161,7 +4153,7 @@ static void harddunk_sw1_output( int which, UINT16 data )
}
}
-static void harddunk_sw2_output( int which, UINT16 data )
+void segas32_state::harddunk_sw2_output( int which, UINT16 data )
{
if (which == 0)
output_set_value("Left_Winner_lamp", BIT(data, 0));
@@ -4169,13 +4161,13 @@ static void harddunk_sw2_output( int which, UINT16 data )
output_set_value("Right_Winner_lamp", BIT(data, 0));
}
-static void harddunk_sw3_output( int which, UINT16 data )
+void segas32_state::harddunk_sw3_output( int which, UINT16 data )
{
output_set_value("3P_Start_lamp", BIT(data, 4));
output_set_value("6P_Start_lamp", BIT(data, 5));
}
-static void titlef_sw1_output( int which, UINT16 data )
+void segas32_state::titlef_sw1_output( int which, UINT16 data )
{
if (which == 0)
{
@@ -4189,7 +4181,7 @@ static void titlef_sw1_output( int which, UINT16 data )
}
}
-static void titlef_sw2_output( int which, UINT16 data )
+void segas32_state::titlef_sw2_output( int which, UINT16 data )
{
if (which == 0)
output_set_value("Blue_Corner_lamp", BIT(data, 0));
@@ -4197,7 +4189,7 @@ static void titlef_sw2_output( int which, UINT16 data )
output_set_value("Red_Corner_lamp", BIT(data, 0));
}
-static void scross_sw1_output( int which, UINT16 data )
+void segas32_state::scross_sw1_output( int which, UINT16 data )
{
/* note ma = monitor A and mb = Monitor B */
if (which == 0)
@@ -4206,7 +4198,7 @@ static void scross_sw1_output( int which, UINT16 data )
output_set_value("MB_Start_lamp", BIT(data, 2));
}
-static void scross_sw2_output( int which, UINT16 data )
+void segas32_state::scross_sw2_output( int which, UINT16 data )
{
/* Note: I'm not an expert on digits, so I didn't know the right map to use, I just added it manually and it seems to work fine. */
if (which == 0)
@@ -4223,8 +4215,8 @@ static void scross_sw2_output( int which, UINT16 data )
DRIVER_INIT_MEMBER(segas32_state,alien3)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
- m_sw1_output = alien3_sw1_output;
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
+ m_sw1_output = &segas32_state::alien3_sw1_output;
}
READ16_MEMBER(segas32_state::arescue_handshake_r)
@@ -4239,7 +4231,7 @@ READ16_MEMBER(segas32_state::arescue_slavebusy_r)
DRIVER_INIT_MEMBER(segas32_state,arescue)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa00007, read16_delegate(FUNC(segas32_state::arescue_dsp_r),this), write16_delegate(FUNC(segas32_state::arescue_dsp_w),this));
m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2);
@@ -4249,13 +4241,13 @@ DRIVER_INIT_MEMBER(segas32_state,arescue)
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x810000, 0x810001, read16_delegate(FUNC(segas32_state::arescue_handshake_r),this));
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x81000e, 0x81000f, read16_delegate(FUNC(segas32_state::arescue_slavebusy_r),this));
- m_sw1_output = arescue_sw1_output;
+ m_sw1_output = &segas32_state::arescue_sw1_output;
}
DRIVER_INIT_MEMBER(segas32_state,arabfgt)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
+ segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
/* install protection handlers */
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0xa00100, 0xa0011f, read16_delegate(FUNC(segas32_state::arf_wakeup_protection_r),this));
@@ -4265,7 +4257,7 @@ DRIVER_INIT_MEMBER(segas32_state,arabfgt)
DRIVER_INIT_MEMBER(segas32_state,brival)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
+ segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
/* install protection handlers */
m_system32_protram = auto_alloc_array(machine(), UINT16, 0x1000/2);
@@ -4276,7 +4268,7 @@ DRIVER_INIT_MEMBER(segas32_state,brival)
DRIVER_INIT_MEMBER(segas32_state,darkedge)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
+ segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
/* install protection handlers */
machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa7ffff, read16_delegate(FUNC(segas32_state::darkedge_protection_r),this), write16_delegate(FUNC(segas32_state::darkedge_protection_w),this));
@@ -4285,7 +4277,7 @@ DRIVER_INIT_MEMBER(segas32_state,darkedge)
DRIVER_INIT_MEMBER(segas32_state,dbzvrvs)
{
- segas32_common_init(machine(), read16_delegate(), write16_delegate());
+ segas32_common_init(read16_delegate(), write16_delegate());
/* install protection handlers */
machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa7ffff, read16_delegate(FUNC(segas32_state::dbzvrvs_protection_r),this), write16_delegate(FUNC(segas32_state::dbzvrvs_protection_w),this));
@@ -4300,7 +4292,7 @@ WRITE16_MEMBER(segas32_state::f1en_comms_echo_w)
DRIVER_INIT_MEMBER(segas32_state,f1en)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2);
machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this));
@@ -4308,7 +4300,7 @@ DRIVER_INIT_MEMBER(segas32_state,f1en)
machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x810048, 0x810049, write16_delegate(FUNC(segas32_state::f1en_comms_echo_w),this));
- m_sw1_output = radm_sw1_output;
+ m_sw1_output = &segas32_state::radm_sw1_output;
}
@@ -4316,7 +4308,7 @@ DRIVER_INIT_MEMBER(segas32_state,f1en)
DRIVER_INIT_MEMBER(segas32_state,f1lap)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2);
machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x800000, 0x800fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this));
@@ -4325,31 +4317,31 @@ DRIVER_INIT_MEMBER(segas32_state,f1lap)
// machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x800048, 0x800049, write16_delegate(FUNC(segas32_state::f1en_comms_echo_w),this));
m_system32_prot_vblank = f1lap_fd1149_vblank;
- m_sw1_output = f1lap_sw1_output;
+ m_sw1_output = &segas32_state::f1lap_sw1_output;
}
DRIVER_INIT_MEMBER(segas32_state,ga2)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
+ segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
- decrypt_ga2_protrom(machine());
+ decrypt_ga2_protrom();
machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa00fff, read16_delegate(FUNC(segas32_state::ga2_dpram_r),this), write16_delegate(FUNC(segas32_state::ga2_dpram_w),this));
}
DRIVER_INIT_MEMBER(segas32_state,harddunk)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
- m_sw1_output = harddunk_sw1_output;
- m_sw2_output = harddunk_sw2_output;
- m_sw3_output = harddunk_sw3_output;
+ segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
+ m_sw1_output = &segas32_state::harddunk_sw1_output;
+ m_sw2_output = &segas32_state::harddunk_sw2_output;
+ m_sw3_output = &segas32_state::harddunk_sw3_output;
}
DRIVER_INIT_MEMBER(segas32_state,holo)
{
- segas32_common_init(machine(), read16_delegate(), write16_delegate());
+ segas32_common_init(read16_delegate(), write16_delegate());
}
@@ -4358,58 +4350,58 @@ DRIVER_INIT_MEMBER(segas32_state,jpark)
/* Temp. Patch until we emulate the 'Drive Board', thanks to Malice */
UINT16 *pROM = (UINT16 *)memregion("maincpu")->base();
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
pROM[0xC15A8/2] = 0xCD70;
pROM[0xC15AA/2] = 0xD8CD;
- m_sw1_output = jpark_sw1_output;
+ m_sw1_output = &segas32_state::jpark_sw1_output;
}
DRIVER_INIT_MEMBER(segas32_state,orunners)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::orunners_custom_io_w),this));
- m_sw1_output = orunners_sw1_output;
- m_sw2_output = orunners_sw2_output;
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::orunners_custom_io_w),this));
+ m_sw1_output = &segas32_state::orunners_sw1_output;
+ m_sw2_output = &segas32_state::orunners_sw2_output;
}
DRIVER_INIT_MEMBER(segas32_state,radm)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
- m_sw1_output = radm_sw1_output;
- m_sw2_output = radm_sw2_output;
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
+ m_sw1_output = &segas32_state::radm_sw1_output;
+ m_sw2_output = &segas32_state::radm_sw2_output;
}
DRIVER_INIT_MEMBER(segas32_state,radr)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
- m_sw1_output = radm_sw1_output;
- m_sw2_output = radr_sw2_output;
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
+ m_sw1_output = &segas32_state::radm_sw1_output;
+ m_sw2_output = &segas32_state::radr_sw2_output;
}
DRIVER_INIT_MEMBER(segas32_state,scross)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
machine().device("soundcpu")->memory().space(AS_PROGRAM).install_write_handler(0xb0, 0xbf, write8_delegate(FUNC(segas32_state::scross_bank_w),this));
- m_sw1_output = scross_sw1_output;
- m_sw2_output = scross_sw2_output;
+ m_sw1_output = &segas32_state::scross_sw1_output;
+ m_sw2_output = &segas32_state::scross_sw2_output;
}
DRIVER_INIT_MEMBER(segas32_state,slipstrm)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
}
DRIVER_INIT_MEMBER(segas32_state,sonic)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::sonic_custom_io_r),this), write16_delegate(FUNC(segas32_state::sonic_custom_io_w),this));
+ segas32_common_init(read16_delegate(FUNC(segas32_state::sonic_custom_io_r),this), write16_delegate(FUNC(segas32_state::sonic_custom_io_w),this));
/* install protection handlers */
machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x20E5C4, 0x20E5C5, write16_delegate(FUNC(segas32_state::sonic_level_load_protection),this));
@@ -4418,34 +4410,34 @@ DRIVER_INIT_MEMBER(segas32_state,sonic)
DRIVER_INIT_MEMBER(segas32_state,sonicp)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::sonic_custom_io_r),this), write16_delegate(FUNC(segas32_state::sonic_custom_io_w),this));
+ segas32_common_init(read16_delegate(FUNC(segas32_state::sonic_custom_io_r),this), write16_delegate(FUNC(segas32_state::sonic_custom_io_w),this));
}
DRIVER_INIT_MEMBER(segas32_state,spidman)
{
- segas32_common_init(machine(), read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
+ segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
}
DRIVER_INIT_MEMBER(segas32_state,svf)
{
- segas32_common_init(machine(), read16_delegate(), write16_delegate());
+ segas32_common_init(read16_delegate(), write16_delegate());
}
DRIVER_INIT_MEMBER(segas32_state,jleague)
{
- segas32_common_init(machine(), read16_delegate(), write16_delegate());
+ segas32_common_init(read16_delegate(), write16_delegate());
machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x20F700, 0x20F705, write16_delegate(FUNC(segas32_state::jleague_protection_w),this));
}
DRIVER_INIT_MEMBER(segas32_state,titlef)
{
- segas32_common_init(machine(), read16_delegate(), write16_delegate());
- m_sw1_output = titlef_sw1_output;
- m_sw2_output = titlef_sw2_output;
+ segas32_common_init(read16_delegate(), write16_delegate());
+ m_sw1_output = &segas32_state::titlef_sw1_output;
+ m_sw2_output = &segas32_state::titlef_sw2_output;
}
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index 860fb47f338..080f03f9e49 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -741,80 +741,76 @@ Notes:
/********************************************************************/
-static UINT8 z80_fifoout_pop(address_space &space)
+UINT8 seibuspi_state::z80_fifoout_pop(address_space &space)
{
- seibuspi_state *state = space.machine().driver_data<seibuspi_state>();
UINT8 r;
- if (state->m_fifoout_wpos == state->m_fifoout_rpos)
+ if (m_fifoout_wpos == m_fifoout_rpos)
{
logerror("Sound FIFOOUT underflow at %08X\n", space.device().safe_pc());
}
- r = state->m_fifoout_data[state->m_fifoout_rpos++];
- if(state->m_fifoout_rpos == FIFO_SIZE)
+ r = m_fifoout_data[m_fifoout_rpos++];
+ if(m_fifoout_rpos == FIFO_SIZE)
{
- state->m_fifoout_rpos = 0;
+ m_fifoout_rpos = 0;
}
- if (state->m_fifoout_wpos == state->m_fifoout_rpos)
+ if (m_fifoout_wpos == m_fifoout_rpos)
{
- state->m_fifoout_read_request = 0;
+ m_fifoout_read_request = 0;
}
return r;
}
-static void z80_fifoout_push(address_space &space, UINT8 data)
+void seibuspi_state::z80_fifoout_push(address_space &space, UINT8 data)
{
- seibuspi_state *state = space.machine().driver_data<seibuspi_state>();
- state->m_fifoout_data[state->m_fifoout_wpos++] = data;
- if (state->m_fifoout_wpos == FIFO_SIZE)
+ m_fifoout_data[m_fifoout_wpos++] = data;
+ if (m_fifoout_wpos == FIFO_SIZE)
{
- state->m_fifoout_wpos = 0;
+ m_fifoout_wpos = 0;
}
- if(state->m_fifoout_wpos == state->m_fifoout_rpos)
+ if(m_fifoout_wpos == m_fifoout_rpos)
{
fatalerror("Sound FIFOOUT overflow at %08X\n", space.device().safe_pc());
}
- state->m_fifoout_read_request = 1;
+ m_fifoout_read_request = 1;
}
-static UINT8 z80_fifoin_pop(address_space &space)
+UINT8 seibuspi_state::z80_fifoin_pop(address_space &space)
{
- seibuspi_state *state = space.machine().driver_data<seibuspi_state>();
UINT8 r;
- if (state->m_fifoin_wpos == state->m_fifoin_rpos)
+ if (m_fifoin_wpos == m_fifoin_rpos)
{
fatalerror("Sound FIFOIN underflow at %08X\n", space.device().safe_pc());
}
- r = state->m_fifoin_data[state->m_fifoin_rpos++];
- if(state->m_fifoin_rpos == FIFO_SIZE)
+ r = m_fifoin_data[m_fifoin_rpos++];
+ if(m_fifoin_rpos == FIFO_SIZE)
{
- state->m_fifoin_rpos = 0;
+ m_fifoin_rpos = 0;
}
- if (state->m_fifoin_wpos == state->m_fifoin_rpos)
+ if (m_fifoin_wpos == m_fifoin_rpos)
{
- state->m_fifoin_read_request = 0;
+ m_fifoin_read_request = 0;
}
return r;
}
-static void z80_fifoin_push(address_space &space, UINT8 data)
+void seibuspi_state::z80_fifoin_push(address_space &space, UINT8 data)
{
- seibuspi_state *state = space.machine().driver_data<seibuspi_state>();
- state->m_fifoin_data[state->m_fifoin_wpos++] = data;
- if(state->m_fifoin_wpos == FIFO_SIZE)
+ m_fifoin_data[m_fifoin_wpos++] = data;
+ if(m_fifoin_wpos == FIFO_SIZE)
{
- state->m_fifoin_wpos = 0;
+ m_fifoin_wpos = 0;
}
- if(state->m_fifoin_wpos == state->m_fifoin_rpos)
+ if(m_fifoin_wpos == m_fifoin_rpos)
{
fatalerror("Sound FIFOIN overflow at %08X\n", space.device().safe_pc());
}
- state->m_fifoin_read_request = 1;
+ m_fifoin_read_request = 1;
}
READ32_MEMBER(seibuspi_state::sb_coin_r)
@@ -875,7 +871,7 @@ WRITE32_MEMBER(seibuspi_state::eeprom_w)
// tile banks
if( ACCESSING_BITS_16_23 ) {
- rf2_set_layer_banks(machine(), data >> 16);
+ rf2_set_layer_banks(data >> 16);
eeprom_device *eeprom = downcast<eeprom_device *>(device);
eeprom->write_bit((data & 0x800000) ? 1 : 0);
@@ -900,7 +896,7 @@ WRITE32_MEMBER(seibuspi_state::z80_enable_w)
{
// tile banks
if( ACCESSING_BITS_16_23 ) {
- rf2_set_layer_banks(machine(), data >> 16);
+ rf2_set_layer_banks(data >> 16);
}
logerror("z80 data = %08x mask = %08x\n",data,mem_mask);
@@ -2063,43 +2059,42 @@ READ32_MEMBER(seibuspi_state::rfjet_speedup_r)
return m_spimainram[(0x002894c-0x800)/4];
}
-static void init_spi(running_machine &machine)
+void seibuspi_state::init_spi()
{
- seibuspi_state *state = machine.driver_data<seibuspi_state>();
- state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0");
- state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
+ m_flash[0] = machine().device<intel_e28f008sa_device>("flash0");
+ m_flash[1] = machine().device<intel_e28f008sa_device>("flash1");
- seibuspi_text_decrypt(state->memregion("gfx1")->base());
- seibuspi_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes());
- seibuspi_sprite_decrypt(state->memregion("gfx3")->base(), 0x400000);
+ seibuspi_text_decrypt(memregion("gfx1")->base());
+ seibuspi_bg_decrypt(memregion("gfx2")->base(), memregion("gfx2")->bytes());
+ seibuspi_sprite_decrypt(memregion("gfx3")->base(), 0x400000);
}
DRIVER_INIT_MEMBER(seibuspi_state,rdft)
{
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00298d0, 0x00298d3, read32_delegate(FUNC(seibuspi_state::rdft_speedup_r),this));
- init_spi(machine());
+ init_spi();
}
DRIVER_INIT_MEMBER(seibuspi_state,senkyu)
{
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0018cb4, 0x0018cb7, read32_delegate(FUNC(seibuspi_state::senkyu_speedup_r),this));
- init_spi(machine());
+ init_spi();
}
DRIVER_INIT_MEMBER(seibuspi_state,senkyua)
{
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0018c9c, 0x0018c9f, read32_delegate(FUNC(seibuspi_state::senkyua_speedup_r),this));
- init_spi(machine());
+ init_spi();
}
DRIVER_INIT_MEMBER(seibuspi_state,batlball)
{
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0018db4, 0x0018db7, read32_delegate(FUNC(seibuspi_state::batlball_speedup_r),this));
- init_spi(machine());
+ init_spi();
}
DRIVER_INIT_MEMBER(seibuspi_state,ejanhs)
@@ -2107,79 +2102,77 @@ DRIVER_INIT_MEMBER(seibuspi_state,ejanhs)
// idle skip doesn't work properly?
// machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x002d224, 0x002d227, read32_delegate(FUNC(seibuspi_state::ejanhs_speedup_r),this));
- init_spi(machine());
+ init_spi();
}
DRIVER_INIT_MEMBER(seibuspi_state,viprp1)
{
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x001e2e0, 0x001e2e3, read32_delegate(FUNC(seibuspi_state::viprp1_speedup_r),this));
- init_spi(machine());
+ init_spi();
}
DRIVER_INIT_MEMBER(seibuspi_state,viprp1o)
{
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x001d49c, 0x001d49f, read32_delegate(FUNC(seibuspi_state::viprp1o_speedup_r),this));
- init_spi(machine());
+ init_spi();
}
-static void init_rf2_common(running_machine &machine)
+void seibuspi_state::init_rf2_common()
{
- seibuspi_state *state = machine.driver_data<seibuspi_state>();
- state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0");
- state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
+ m_flash[0] = machine().device<intel_e28f008sa_device>("flash0");
+ m_flash[1] = machine().device<intel_e28f008sa_device>("flash1");
- machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0282AC, 0x0282AF, read32_delegate(FUNC(seibuspi_state::rf2_speedup_r),state));
- seibuspi_rise10_text_decrypt(state->memregion("gfx1")->base());
- seibuspi_rise10_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes());
- seibuspi_rise10_sprite_decrypt(state->memregion("gfx3")->base(), 0x600000);
+ machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x0282AC, 0x0282AF, read32_delegate(FUNC(seibuspi_state::rf2_speedup_r),this));
+ seibuspi_rise10_text_decrypt(memregion("gfx1")->base());
+ seibuspi_rise10_bg_decrypt(memregion("gfx2")->base(), memregion("gfx2")->bytes());
+ seibuspi_rise10_sprite_decrypt(memregion("gfx3")->base(), 0x600000);
- machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state));
+ machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),this));
}
DRIVER_INIT_MEMBER(seibuspi_state,rdft2)
{
- init_rf2_common(machine());
+ init_rf2_common();
}
DRIVER_INIT_MEMBER(seibuspi_state,rdft2us)
{
- init_rf2_common(machine());
+ init_rf2_common();
}
-static void init_rfjet_common(running_machine &machine)
+void seibuspi_state::init_rfjet_common()
{
- seibuspi_state *state = machine.driver_data<seibuspi_state>();
- state->m_flash[0] = machine.device<intel_e28f008sa_device>("flash0");
- state->m_flash[1] = machine.device<intel_e28f008sa_device>("flash1");
+ m_flash[0] = machine().device<intel_e28f008sa_device>("flash0");
+ m_flash[1] = machine().device<intel_e28f008sa_device>("flash1");
- machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x002894c, 0x002894f, read32_delegate(FUNC(seibuspi_state::rfjet_speedup_r),state));
- seibuspi_rise11_text_decrypt(state->memregion("gfx1")->base());
- seibuspi_rise11_bg_decrypt(state->memregion("gfx2")->base(), state->memregion("gfx2")->bytes());
- seibuspi_rise11_sprite_decrypt_rfjet(state->memregion("gfx3")->base(), 0x800000);
+ machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x002894c, 0x002894f, read32_delegate(FUNC(seibuspi_state::rfjet_speedup_r),this));
+ seibuspi_rise11_text_decrypt(memregion("gfx1")->base());
+ seibuspi_rise11_bg_decrypt(memregion("gfx2")->base(), memregion("gfx2")->bytes());
+ seibuspi_rise11_sprite_decrypt_rfjet(memregion("gfx3")->base(), 0x800000);
- machine.device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),state));
+ machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x560, 0x563, write32_delegate(FUNC(seibuspi_state::sprite_dma_start_w),this));
}
DRIVER_INIT_MEMBER(seibuspi_state,rfjet)
{
- init_rfjet_common(machine());
+ init_rfjet_common();
}
/* SYS386 */
DRIVER_INIT_MEMBER(seibuspi_state,rdft22kc)
{
- init_rf2_common(machine());
+ init_rf2_common();
}
DRIVER_INIT_MEMBER(seibuspi_state,rfjet2k)
{
- init_rfjet_common(machine());
+ init_rfjet_common();
}
MACHINE_RESET_MEMBER(seibuspi_state,seibu386)
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index ae2bb2d82fe..de54cc6d433 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -1412,10 +1412,9 @@ TIMER_CALLBACK_MEMBER(seta_state::uPD71054_timer_callback)
/*------------------------------
initialize
------------------------------*/
-static void uPD71054_timer_init( running_machine &machine )
+void seta_state::uPD71054_timer_init( )
{
- seta_state *state = machine.driver_data<seta_state>();
- uPD71054_state *uPD71054 = &state->m_uPD71054;
+ uPD71054_state *uPD71054 = &m_uPD71054;
int no;
uPD71054->write_select = 0;
@@ -1424,7 +1423,7 @@ static void uPD71054_timer_init( running_machine &machine )
uPD71054->max[no] = 0xffff;
}
for( no = 0; no < USED_TIMER_NUM; no++ ) {
- uPD71054->timer[no] = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(seta_state::uPD71054_timer_callback),state));
+ uPD71054->timer[no] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(seta_state::uPD71054_timer_callback),this));
}
}
@@ -1787,7 +1786,7 @@ WRITE16_MEMBER(seta_state::usclssic_lockout_w)
machine().tilemap().mark_all_dirty();
m_tiles_offset = tiles_offset;
- seta_coin_lockout_w(machine(), data);
+ seta_coin_lockout_w(data);
}
}
@@ -3073,7 +3072,7 @@ WRITE8_MEMBER(seta_state::sub_bankswitch_w)
WRITE8_MEMBER(seta_state::sub_bankswitch_lockout_w)
{
sub_bankswitch_w(space,offset,data);
- seta_coin_lockout_w(machine(), data);
+ seta_coin_lockout_w(data);
}
@@ -8140,7 +8139,7 @@ INTERRUPT_GEN_MEMBER(seta_state::wrofaero_interrupt)
device.execute().set_input_line(2, HOLD_LINE );
}
-MACHINE_START_MEMBER(seta_state,wrofaero){ uPD71054_timer_init(machine()); }
+MACHINE_START_MEMBER(seta_state,wrofaero){ uPD71054_timer_init(); }
#endif // __uPD71054_TIMER
diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c
index cb89ff278da..df45db64d00 100644
--- a/src/mame/drivers/seta2.c
+++ b/src/mame/drivers/seta2.c
@@ -700,11 +700,10 @@ READ8_MEMBER(seta2_state::funcube_serial_r)
return ret;
}
-static void funcube_debug_outputs(running_machine &machine)
+void seta2_state::funcube_debug_outputs()
{
#ifdef MAME_DEBUG
-// seta2_state *state = machine.driver_data<seta2_state>();
-// popmessage("LED: %02x OUT: %02x", (int)*state->m_funcube_leds, (int)*state->m_funcube_outputs);
+// popmessage("LED: %02x OUT: %02x", (int)*m_funcube_leds, (int)*m_funcube_outputs);
#endif
}
@@ -721,7 +720,7 @@ WRITE8_MEMBER(seta2_state::funcube_leds_w)
set_led_status( machine(), 4, (~data) & 0x40 );
set_led_status( machine(), 5, (~data) & 0x80 );
- funcube_debug_outputs(space.machine());
+ funcube_debug_outputs();
}
READ8_MEMBER(seta2_state::funcube_outputs_r)
@@ -744,7 +743,7 @@ WRITE8_MEMBER(seta2_state::funcube_outputs_w)
// Bit 3: low after coining up, blinks on pay out
set_led_status( machine(), 6, (~data) & 0x08 );
- funcube_debug_outputs(space.machine());
+ funcube_debug_outputs();
}
READ8_MEMBER(seta2_state::funcube_battery_r)
diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c
index 54cff69427c..d065a775b8e 100644
--- a/src/mame/drivers/sf.c
+++ b/src/mame/drivers/sf.c
@@ -52,7 +52,7 @@ WRITE16_MEMBER(sf_state::soundcmd_w)
/* The protection of the Japanese (and alt US) version */
/* I'd love to see someone dump the 68705 / i8751 roms */
-static void write_dword( address_space &space, offs_t offset, UINT32 data )
+void sf_state::write_dword( address_space &space, offs_t offset, UINT32 data )
{
space.write_word(offset, data >> 16);
space.write_word(offset + 2, data);
diff --git a/src/mame/drivers/simpsons.c b/src/mame/drivers/simpsons.c
index 0bb51097cb3..9480286159e 100644
--- a/src/mame/drivers/simpsons.c
+++ b/src/mame/drivers/simpsons.c
@@ -112,11 +112,10 @@ WRITE8_MEMBER(simpsons_state::z80_bankswitch_w)
}
#if 0
-static void sound_nmi_callback( running_machine &machine, int param )
+void simpsons_state::sound_nmi_callback( int param )
{
- simpsons_state *state = machine.driver_data<simpsons_state>();
- state->m_audiocpu->set_input_line(INPUT_LINE_NMI, (state->m_nmi_enabled) ? CLEAR_LINE : ASSERT_LINE );
- state->m_nmi_enabled = 0;
+ m_audiocpu->set_input_line(INPUT_LINE_NMI, (m_nmi_enabled) ? CLEAR_LINE : ASSERT_LINE );
+ m_nmi_enabled = 0;
}
#endif
@@ -225,16 +224,15 @@ INPUT_PORTS_END
***************************************************************************/
-static void simpsons_objdma( running_machine &machine )
+void simpsons_state::simpsons_objdma( )
{
- simpsons_state *state = machine.driver_data<simpsons_state>();
int counter, num_inactive;
UINT16 *src, *dst;
- k053247_get_ram(state->m_k053246, &dst);
- counter = k053247_get_dy(state->m_k053246);
+ k053247_get_ram(m_k053246, &dst);
+ counter = k053247_get_dy(m_k053246);
- src = state->m_spriteram;
+ src = m_spriteram;
num_inactive = counter = 256;
do {
@@ -262,7 +260,7 @@ INTERRUPT_GEN_MEMBER(simpsons_state::simpsons_irq)
{
if (k053246_is_irq_enabled(m_k053246))
{
- simpsons_objdma(machine());
+ simpsons_objdma();
// 32+256us delay at 8MHz dotclock; artificially shortened since actual V-blank length is unknown
machine().scheduler().timer_set(attotime::from_usec(30), timer_expired_delegate(FUNC(simpsons_state::dmaend_callback),this));
}
diff --git a/src/mame/drivers/skullxbo.c b/src/mame/drivers/skullxbo.c
index 6756b23ce36..bc7feec0346 100644
--- a/src/mame/drivers/skullxbo.c
+++ b/src/mame/drivers/skullxbo.c
@@ -59,7 +59,7 @@ void skullxbo_state::scanline_update(screen_device &screen, int scanline)
}
/* update the playfield and motion objects */
- skullxbo_scanline_update(machine(), scanline);
+ skullxbo_scanline_update(scanline);
}
diff --git a/src/mame/drivers/slapfght.c b/src/mame/drivers/slapfght.c
index b06226b607c..1027590b10d 100644
--- a/src/mame/drivers/slapfght.c
+++ b/src/mame/drivers/slapfght.c
@@ -1801,23 +1801,22 @@ READ8_MEMBER(slapfght_state::gtstarb1_port_0_read)
return 0;
}
-static void getstar_init( running_machine &machine )
+void slapfght_state::getstar_init( )
{
- slapfght_state *state = machine.driver_data<slapfght_state>();
- machine.device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xe803, 0xe803, read8_delegate(FUNC(slapfght_state::getstar_e803_r),state), write8_delegate(FUNC(slapfght_state::getstar_e803_w),state));
- machine.device("maincpu")->memory().space(AS_IO).install_read_handler(0x00, 0x00, read8_delegate(FUNC(slapfght_state::slapfight_port_00_r),state));
+ machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0xe803, 0xe803, read8_delegate(FUNC(slapfght_state::getstar_e803_r),this), write8_delegate(FUNC(slapfght_state::getstar_e803_w),this));
+ machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x00, 0x00, read8_delegate(FUNC(slapfght_state::slapfight_port_00_r),this));
}
DRIVER_INIT_MEMBER(slapfght_state,getstar)
{
m_getstar_id = GETSTAR;
- getstar_init(machine());
+ getstar_init();
}
DRIVER_INIT_MEMBER(slapfght_state,getstarj)
{
m_getstar_id = GETSTARJ;
- getstar_init(machine());
+ getstar_init();
}
DRIVER_INIT_MEMBER(slapfght_state,gtstarb1)
@@ -1825,7 +1824,7 @@ DRIVER_INIT_MEMBER(slapfght_state,gtstarb1)
UINT8 *ROM = memregion("maincpu")->base();
m_getstar_id = GTSTARB1;
- getstar_init(machine());
+ getstar_init();
/* specific handlers for this bootleg */
machine().device("maincpu")->memory().space(AS_IO).install_read_handler(0x0, 0x0, read8_delegate(FUNC(slapfght_state::gtstarb1_port_0_read),this));
@@ -1839,7 +1838,7 @@ DRIVER_INIT_MEMBER(slapfght_state,gtstarb1)
DRIVER_INIT_MEMBER(slapfght_state,gtstarb2)
{
m_getstar_id = GTSTARB2;
- getstar_init(machine());
+ getstar_init();
}
DRIVER_INIT_MEMBER(slapfght_state,slapfigh)
diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c
index c5cfe2838b9..b162bb16f59 100644
--- a/src/mame/drivers/snk.c
+++ b/src/mame/drivers/snk.c
@@ -576,15 +576,14 @@ WRITE8_MEMBER(snk_state::hardflags_scroll_msb_w)
// low 6 bits might indicate radius, but it's not clear
}
-static int hardflags_check(running_machine &machine, int num)
+int snk_state::hardflags_check(int num)
{
- snk_state *state = machine.driver_data<snk_state>();
- const UINT8 *sr = &state->m_spriteram[0x800 + 4*num];
+ const UINT8 *sr = &m_spriteram[0x800 + 4*num];
int x = sr[2] + ((sr[3] & 0x80) << 1);
int y = sr[0] + ((sr[3] & 0x10) << 4);
- int dx = (x - state->m_hf_posx) & 0x1ff;
- int dy = (y - state->m_hf_posy) & 0x1ff;
+ int dx = (x - m_hf_posx) & 0x1ff;
+ int dy = (y - m_hf_posy) & 0x1ff;
if (dx > 0x20 && dx <= 0x1e0 && dy > 0x20 && dy <= 0x1e0)
return 0;
@@ -592,33 +591,33 @@ static int hardflags_check(running_machine &machine, int num)
return 1;
}
-static int hardflags_check8(running_machine &machine, int num)
+int snk_state::hardflags_check8(int num)
{
return
- (hardflags_check(machine, num + 0) << 0) |
- (hardflags_check(machine, num + 1) << 1) |
- (hardflags_check(machine, num + 2) << 2) |
- (hardflags_check(machine, num + 3) << 3) |
- (hardflags_check(machine, num + 4) << 4) |
- (hardflags_check(machine, num + 5) << 5) |
- (hardflags_check(machine, num + 6) << 6) |
- (hardflags_check(machine, num + 7) << 7);
+ (hardflags_check(num + 0) << 0) |
+ (hardflags_check(num + 1) << 1) |
+ (hardflags_check(num + 2) << 2) |
+ (hardflags_check(num + 3) << 3) |
+ (hardflags_check(num + 4) << 4) |
+ (hardflags_check(num + 5) << 5) |
+ (hardflags_check(num + 6) << 6) |
+ (hardflags_check(num + 7) << 7);
}
-READ8_MEMBER(snk_state::hardflags1_r){ return hardflags_check8(machine(), 0*8); }
-READ8_MEMBER(snk_state::hardflags2_r){ return hardflags_check8(machine(), 1*8); }
-READ8_MEMBER(snk_state::hardflags3_r){ return hardflags_check8(machine(), 2*8); }
-READ8_MEMBER(snk_state::hardflags4_r){ return hardflags_check8(machine(), 3*8); }
-READ8_MEMBER(snk_state::hardflags5_r){ return hardflags_check8(machine(), 4*8); }
-READ8_MEMBER(snk_state::hardflags6_r){ return hardflags_check8(machine(), 5*8); }
+READ8_MEMBER(snk_state::hardflags1_r){ return hardflags_check8(0*8); }
+READ8_MEMBER(snk_state::hardflags2_r){ return hardflags_check8(1*8); }
+READ8_MEMBER(snk_state::hardflags3_r){ return hardflags_check8(2*8); }
+READ8_MEMBER(snk_state::hardflags4_r){ return hardflags_check8(3*8); }
+READ8_MEMBER(snk_state::hardflags5_r){ return hardflags_check8(4*8); }
+READ8_MEMBER(snk_state::hardflags6_r){ return hardflags_check8(5*8); }
READ8_MEMBER(snk_state::hardflags7_r)
{
// apparently the startup tests use bits 0&1 while the game uses bits 4&5
return
- (hardflags_check(machine(), 6*8 + 0) << 0) |
- (hardflags_check(machine(), 6*8 + 1) << 1) |
- (hardflags_check(machine(), 6*8 + 0) << 4) |
- (hardflags_check(machine(), 6*8 + 1) << 5);
+ (hardflags_check(6*8 + 0) << 0) |
+ (hardflags_check(6*8 + 1) << 1) |
+ (hardflags_check(6*8 + 0) << 4) |
+ (hardflags_check(6*8 + 1) << 5);
}
@@ -669,15 +668,14 @@ WRITE8_MEMBER(snk_state::turbocheck_msb_w)
// low 6 bits might indicate radius, but it's not clear
}
-static int turbofront_check(running_machine &machine, int small, int num)
+int snk_state::turbofront_check(int small, int num)
{
- snk_state *state = machine.driver_data<snk_state>();
- const UINT8 *sr = &state->m_spriteram[0x800*small + 4*num];
+ const UINT8 *sr = &m_spriteram[0x800*small + 4*num];
int x = sr[2] + ((sr[3] & 0x80) << 1);
int y = sr[0] + ((sr[3] & 0x10) << 4);
- int dx = (x - (small ? state->m_tc16_posx : state->m_tc32_posx)) & 0x1ff;
- int dy = (y - (small ? state->m_tc16_posy : state->m_tc32_posy)) & 0x1ff;
+ int dx = (x - (small ? m_tc16_posx : m_tc32_posx)) & 0x1ff;
+ int dy = (y - (small ? m_tc16_posy : m_tc32_posy)) & 0x1ff;
if (dx > 0x20 && dx <= 0x1e0 && dy > 0x20 && dy <= 0x1e0)
return 0;
@@ -685,31 +683,31 @@ static int turbofront_check(running_machine &machine, int small, int num)
return 1;
}
-static int turbofront_check8(running_machine &machine, int small, int num)
+int snk_state::turbofront_check8(int small, int num)
{
return
- (turbofront_check(machine, small, num + 0) << 0) |
- (turbofront_check(machine, small, num + 1) << 1) |
- (turbofront_check(machine, small, num + 2) << 2) |
- (turbofront_check(machine, small, num + 3) << 3) |
- (turbofront_check(machine, small, num + 4) << 4) |
- (turbofront_check(machine, small, num + 5) << 5) |
- (turbofront_check(machine, small, num + 6) << 6) |
- (turbofront_check(machine, small, num + 7) << 7);
+ (turbofront_check(small, num + 0) << 0) |
+ (turbofront_check(small, num + 1) << 1) |
+ (turbofront_check(small, num + 2) << 2) |
+ (turbofront_check(small, num + 3) << 3) |
+ (turbofront_check(small, num + 4) << 4) |
+ (turbofront_check(small, num + 5) << 5) |
+ (turbofront_check(small, num + 6) << 6) |
+ (turbofront_check(small, num + 7) << 7);
}
-READ8_MEMBER(snk_state::turbocheck16_1_r){ return turbofront_check8(machine(), 1, 0*8); }
-READ8_MEMBER(snk_state::turbocheck16_2_r){ return turbofront_check8(machine(), 1, 1*8); }
-READ8_MEMBER(snk_state::turbocheck16_3_r){ return turbofront_check8(machine(), 1, 2*8); }
-READ8_MEMBER(snk_state::turbocheck16_4_r){ return turbofront_check8(machine(), 1, 3*8); }
-READ8_MEMBER(snk_state::turbocheck16_5_r){ return turbofront_check8(machine(), 1, 4*8); }
-READ8_MEMBER(snk_state::turbocheck16_6_r){ return turbofront_check8(machine(), 1, 5*8); }
-READ8_MEMBER(snk_state::turbocheck16_7_r){ return turbofront_check8(machine(), 1, 6*8); }
-READ8_MEMBER(snk_state::turbocheck16_8_r){ return turbofront_check8(machine(), 1, 7*8); }
-READ8_MEMBER(snk_state::turbocheck32_1_r){ return turbofront_check8(machine(), 0, 0*8); }
-READ8_MEMBER(snk_state::turbocheck32_2_r){ return turbofront_check8(machine(), 0, 1*8); }
-READ8_MEMBER(snk_state::turbocheck32_3_r){ return turbofront_check8(machine(), 0, 2*8); }
-READ8_MEMBER(snk_state::turbocheck32_4_r){ return turbofront_check8(machine(), 0, 3*8); }
+READ8_MEMBER(snk_state::turbocheck16_1_r){ return turbofront_check8(1, 0*8); }
+READ8_MEMBER(snk_state::turbocheck16_2_r){ return turbofront_check8(1, 1*8); }
+READ8_MEMBER(snk_state::turbocheck16_3_r){ return turbofront_check8(1, 2*8); }
+READ8_MEMBER(snk_state::turbocheck16_4_r){ return turbofront_check8(1, 3*8); }
+READ8_MEMBER(snk_state::turbocheck16_5_r){ return turbofront_check8(1, 4*8); }
+READ8_MEMBER(snk_state::turbocheck16_6_r){ return turbofront_check8(1, 5*8); }
+READ8_MEMBER(snk_state::turbocheck16_7_r){ return turbofront_check8(1, 6*8); }
+READ8_MEMBER(snk_state::turbocheck16_8_r){ return turbofront_check8(1, 7*8); }
+READ8_MEMBER(snk_state::turbocheck32_1_r){ return turbofront_check8(0, 0*8); }
+READ8_MEMBER(snk_state::turbocheck32_2_r){ return turbofront_check8(0, 1*8); }
+READ8_MEMBER(snk_state::turbocheck32_3_r){ return turbofront_check8(0, 2*8); }
+READ8_MEMBER(snk_state::turbocheck32_4_r){ return turbofront_check8(0, 3*8); }
diff --git a/src/mame/drivers/snk6502.c b/src/mame/drivers/snk6502.c
index 0632cccdefa..8a1bbb56414 100644
--- a/src/mame/drivers/snk6502.c
+++ b/src/mame/drivers/snk6502.c
@@ -303,11 +303,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(snk6502_state::sasuke_update_counter)
m_sasuke_counter += 0x10;
}
-static void sasuke_start_counter(running_machine &machine)
+void snk6502_state::sasuke_start_counter()
{
- snk6502_state *state = machine.driver_data<snk6502_state>();
- state->m_sasuke_counter = 0;
+ m_sasuke_counter = 0;
}
@@ -784,7 +783,7 @@ MACHINE_RESET_MEMBER(snk6502_state,sasuke)
// adjusted (measured through audio recording of pcb)
snk6502_set_music_freq(machine(), 35300);
- sasuke_start_counter(machine());
+ sasuke_start_counter();
}
MACHINE_RESET_MEMBER(snk6502_state,satansat)
@@ -793,7 +792,7 @@ MACHINE_RESET_MEMBER(snk6502_state,satansat)
// NOTE: this was set before sasuke was adjusted to a lower freq, please don't modify until measured/confirmed on pcb
snk6502_set_music_freq(machine(), 38000);
- sasuke_start_counter(machine());
+ sasuke_start_counter();
}
MACHINE_RESET_MEMBER(snk6502_state,vanguard)
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index c545b1199d7..ebb45898fc0 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -405,27 +405,26 @@ READ16_MEMBER(snowbros_state::sb3_sound_r)
return 0x0003;
}
-static void sb3_play_music(running_machine &machine, int data)
+void snowbros_state::sb3_play_music(int data)
{
- snowbros_state *state = machine.driver_data<snowbros_state>();
UINT8 *snd;
/* sample is actually played in interrupt function so it loops */
- state->m_sb3_music = data;
+ m_sb3_music = data;
switch (data)
{
case 0x23:
case 0x26:
- snd = state->memregion("oki")->base();
+ snd = memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x00000, 0x20000);
- state->m_sb3_music_is_playing = 1;
+ m_sb3_music_is_playing = 1;
break;
case 0x24:
- snd = state->memregion("oki")->base();
+ snd = memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x20000, 0x20000);
- state->m_sb3_music_is_playing = 1;
+ m_sb3_music_is_playing = 1;
break;
case 0x25:
@@ -436,18 +435,18 @@ static void sb3_play_music(running_machine &machine, int data)
case 0x2b:
case 0x2c:
case 0x2d:
- snd = state->memregion("oki")->base();
+ snd = memregion("oki")->base();
memcpy(snd+0x20000, snd+0x80000+0x40000, 0x20000);
- state->m_sb3_music_is_playing = 1;
+ m_sb3_music_is_playing = 1;
break;
case 0x2e:
- state->m_sb3_music_is_playing = 0;
+ m_sb3_music_is_playing = 0;
break;
}
}
-static void sb3_play_sound (okim6295_device *oki, int data)
+void snowbros_state::sb3_play_sound (okim6295_device *oki, int data)
{
int status = oki->read_status();
@@ -490,7 +489,7 @@ WRITE16_MEMBER(snowbros_state::sb3_sound_w)
if (data>=0x22 && data<=0x31)
{
- sb3_play_music(machine(), data);
+ sb3_play_music(data);
}
if ((data>=0x30) && (data<=0x51))
@@ -500,7 +499,7 @@ WRITE16_MEMBER(snowbros_state::sb3_sound_w)
if (data>=0x52 && data<=0x5f)
{
- sb3_play_music(machine(), data-0x30);
+ sb3_play_music(data-0x30);
}
}
diff --git a/src/mame/drivers/spacefb.c b/src/mame/drivers/spacefb.c
index 4e011a2f811..afc9efa575b 100644
--- a/src/mame/drivers/spacefb.c
+++ b/src/mame/drivers/spacefb.c
@@ -143,17 +143,15 @@ TIMER_CALLBACK_MEMBER(spacefb_state::interrupt_callback)
}
-static void create_interrupt_timer(running_machine &machine)
+void spacefb_state::create_interrupt_timer()
{
- spacefb_state *state = machine.driver_data<spacefb_state>();
- state->m_interrupt_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(spacefb_state::interrupt_callback),state));
+ m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(spacefb_state::interrupt_callback),this));
}
-static void start_interrupt_timer(running_machine &machine)
+void spacefb_state::start_interrupt_timer()
{
- spacefb_state *state = machine.driver_data<spacefb_state>();
- state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(SPACEFB_INT_TRIGGER_COUNT_1));
+ m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(SPACEFB_INT_TRIGGER_COUNT_1));
}
@@ -166,7 +164,7 @@ static void start_interrupt_timer(running_machine &machine)
void spacefb_state::machine_start()
{
- create_interrupt_timer(machine());
+ create_interrupt_timer();
}
@@ -185,7 +183,7 @@ void spacefb_state::machine_reset()
spacefb_port_1_w(space, 0, 0);
spacefb_port_2_w(space, 0, 0);
- start_interrupt_timer(machine());
+ start_interrupt_timer();
}
diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c
index d2c36af4251..f26cc7ea0d4 100644
--- a/src/mame/drivers/spdodgeb.c
+++ b/src/mame/drivers/spdodgeb.c
@@ -87,9 +87,8 @@ static void spd_adpcm_int(device_t *device)
#if 0 // default - more sensitive (state change and timing measured on real board?)
-static void mcu63705_update_inputs(running_machine &machine)
+void spdodgeb_state::mcu63705_update_inputs()
{
- spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
int buttons[2];
int p,j;
@@ -98,34 +97,34 @@ static void mcu63705_update_inputs(running_machine &machine)
{
int curr[2][2];
- curr[p][0] = state->ioport(p ? "P2" : "P1")->read() & 0x01;
- curr[p][1] = state->ioport(p ? "P2" : "P1")->read() & 0x02;
+ curr[p][0] = ioport(p ? "P2" : "P1")->read() & 0x01;
+ curr[p][1] = ioport(p ? "P2" : "P1")->read() & 0x02;
for (j = 0;j <= 1;j++)
{
if (curr[p][j] == 0)
{
- if (state->m_prev[p][j] != 0)
- state->m_countup[p][j] = 0;
+ if (m_prev[p][j] != 0)
+ m_countup[p][j] = 0;
if (curr[p][j^1])
- state->m_countup[p][j] = 100;
- state->m_countup[p][j]++;
- state->m_running[p] &= ~(1 << j);
+ m_countup[p][j] = 100;
+ m_countup[p][j]++;
+ m_running[p] &= ~(1 << j);
}
else
{
- if (state->m_prev[p][j] == 0)
+ if (m_prev[p][j] == 0)
{
- if (state->m_countup[p][j] < 10 && state->m_countdown[p][j] < 5)
- state->m_running[p] |= 1 << j;
- state->m_countdown[p][j] = 0;
+ if (m_countup[p][j] < 10 && m_countdown[p][j] < 5)
+ m_running[p] |= 1 << j;
+ m_countdown[p][j] = 0;
}
- state->m_countdown[p][j]++;
+ m_countdown[p][j]++;
}
}
- state->m_prev[p][0] = curr[p][0];
- state->m_prev[p][1] = curr[p][1];
+ m_prev[p][0] = curr[p][0];
+ m_prev[p][1] = curr[p][1];
}
/* update jumping and buttons state */
@@ -133,26 +132,25 @@ static void mcu63705_update_inputs(running_machine &machine)
{
int curr[2];
- curr[p] = machine.root_device().ioport(p ? "P2" : "P1")->read() & 0x30;
+ curr[p] = machine().root_device().ioport(p ? "P2" : "P1")->read() & 0x30;
- if (state->m_jumped[p]) buttons[p] = 0; /* jump only momentarily flips the buttons */
+ if (m_jumped[p]) buttons[p] = 0; /* jump only momentarily flips the buttons */
else buttons[p] = curr[p];
- if (buttons[p] == 0x30) state->m_jumped[p] = 1;
- if (curr[p] == 0x00) state->m_jumped[p] = 0;
+ if (buttons[p] == 0x30) m_jumped[p] = 1;
+ if (curr[p] == 0x00) m_jumped[p] = 0;
- state->m_prev[p] = curr[p];
+ m_prev[p] = curr[p];
}
- state->m_inputs[0] = machine.root_device().ioport("P1")->read() & 0xcf;
- state->m_inputs[1] = machine.root_device().ioport("P2")->read() & 0x0f;
- state->m_inputs[2] = state->m_running[0] | buttons[0];
- state->m_inputs[3] = state->m_running[1] | buttons[1];
+ m_inputs[0] = machine().root_device().ioport("P1")->read() & 0xcf;
+ m_inputs[1] = machine().root_device().ioport("P2")->read() & 0x0f;
+ m_inputs[2] = m_running[0] | buttons[0];
+ m_inputs[3] = m_running[1] | buttons[1];
}
#else // alternate - less sensitive
-static void mcu63705_update_inputs(running_machine &machine)
+void spdodgeb_state::mcu63705_update_inputs()
{
- spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
#define DBLTAP_TOLERANCE 5
#define R 0x01
@@ -166,40 +164,40 @@ static void mcu63705_update_inputs(running_machine &machine)
for (p=0; p<=1; p++)
{
- curr_port[p] = state->ioport(p ? "P2" : "P1")->read();
+ curr_port[p] = ioport(p ? "P2" : "P1")->read();
curr_dash[p] = 0;
if (curr_port[p] & R)
{
- if (!(state->m_last_port[p] & R))
+ if (!(m_last_port[p] & R))
{
- if (state->m_tapc[p]) curr_dash[p] |= R; else state->m_tapc[p] = DBLTAP_TOLERANCE;
+ if (m_tapc[p]) curr_dash[p] |= R; else m_tapc[p] = DBLTAP_TOLERANCE;
}
- else if (state->m_last_dash[p] & R) curr_dash[p] |= R;
+ else if (m_last_dash[p] & R) curr_dash[p] |= R;
}
else if (curr_port[p] & L)
{
- if (!(state->m_last_port[p] & L))
+ if (!(m_last_port[p] & L))
{
- if (state->m_tapc[p+2]) curr_dash[p] |= L; else state->m_tapc[p+2] = DBLTAP_TOLERANCE;
+ if (m_tapc[p+2]) curr_dash[p] |= L; else m_tapc[p+2] = DBLTAP_TOLERANCE;
}
- else if (state->m_last_dash[p] & L) curr_dash[p] |= L;
+ else if (m_last_dash[p] & L) curr_dash[p] |= L;
}
- if (curr_port[p] & A && !(state->m_last_port[p] & A)) curr_dash[p] |= A;
- if (curr_port[p] & D && !(state->m_last_port[p] & D)) curr_dash[p] |= D;
+ if (curr_port[p] & A && !(m_last_port[p] & A)) curr_dash[p] |= A;
+ if (curr_port[p] & D && !(m_last_port[p] & D)) curr_dash[p] |= D;
- state->m_last_port[p] = curr_port[p];
- state->m_last_dash[p] = curr_dash[p];
+ m_last_port[p] = curr_port[p];
+ m_last_dash[p] = curr_dash[p];
- if (state->m_tapc[p ]) state->m_tapc[p ]--;
- if (state->m_tapc[p+2]) state->m_tapc[p+2]--;
+ if (m_tapc[p ]) m_tapc[p ]--;
+ if (m_tapc[p+2]) m_tapc[p+2]--;
}
- state->m_inputs[0] = curr_port[0] & 0xcf;
- state->m_inputs[1] = curr_port[1] & 0x0f;
- state->m_inputs[2] = curr_dash[0];
- state->m_inputs[3] = curr_dash[1];
+ m_inputs[0] = curr_port[0] & 0xcf;
+ m_inputs[1] = curr_port[1] & 0x0f;
+ m_inputs[2] = curr_dash[0];
+ m_inputs[3] = curr_dash[1];
#undef DBLTAP_TOLERANCE
#undef R
@@ -229,7 +227,7 @@ WRITE8_MEMBER(spdodgeb_state::mcu63701_w)
{
// logerror("CPU #0 PC %04x: write %02x to 63701 control address 3800\n",space.device().safe_pc(),data);
m_mcu63701_command = data;
- mcu63705_update_inputs(machine());
+ mcu63705_update_inputs();
}
diff --git a/src/mame/drivers/speedatk.c b/src/mame/drivers/speedatk.c
index 65a9dbdb514..7e2215c0ea8 100644
--- a/src/mame/drivers/speedatk.c
+++ b/src/mame/drivers/speedatk.c
@@ -82,7 +82,7 @@ PS / PD : key matrix
#define MASTER_CLOCK XTAL_12MHz
-static UINT8 iox_key_matrix_calc(running_machine &machine, UINT8 p_side)
+UINT8 speedatk_state::iox_key_matrix_calc(UINT8 p_side)
{
static const char *const keynames[] = { "P1_ROW0", "P1_ROW1", "P2_ROW0", "P2_ROW1" };
@@ -94,7 +94,7 @@ static UINT8 iox_key_matrix_calc(running_machine &machine, UINT8 p_side)
for (t = 0 ; t < 8 ; t ++)
{
- if (!(machine.root_device().ioport(keynames[j+p_side])->read() & ( 1 << t )))
+ if (!(machine().root_device().ioport(keynames[j+p_side])->read() & ( 1 << t )))
{
return (i + t) | (p_side ? 0x20 : 0x00);
}
@@ -125,8 +125,8 @@ READ8_MEMBER(speedatk_state::key_matrix_r)
/* both side checks */
if(m_mux_data == 1)
{
- UINT8 p1_side = iox_key_matrix_calc(machine(),0);
- UINT8 p2_side = iox_key_matrix_calc(machine(),2);
+ UINT8 p1_side = iox_key_matrix_calc(0);
+ UINT8 p2_side = iox_key_matrix_calc(2);
if(p1_side != 0)
return p1_side;
@@ -135,7 +135,7 @@ READ8_MEMBER(speedatk_state::key_matrix_r)
}
/* check individual input side */
- return iox_key_matrix_calc(machine(),(m_mux_data == 2) ? 0 : 2);
+ return iox_key_matrix_calc((m_mux_data == 2) ? 0 : 2);
}
WRITE8_MEMBER(speedatk_state::key_matrix_w)
diff --git a/src/mame/drivers/splash.c b/src/mame/drivers/splash.c
index c1fff51554e..2fe180e0b24 100644
--- a/src/mame/drivers/splash.c
+++ b/src/mame/drivers/splash.c
@@ -142,17 +142,16 @@ WRITE8_MEMBER(splash_state::sound_bank_w)
}
-static void roldfrog_update_irq( running_machine &machine )
+void splash_state::roldfrog_update_irq( )
{
- splash_state * state = machine.driver_data<splash_state>();
- int irq = (state->m_sound_irq ? 0x08 : 0) | ((state->m_vblank_irq) ? 0x18 : 0);
- machine.device("audiocpu")->execute().set_input_line_and_vector(0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq);
+ int irq = (m_sound_irq ? 0x08 : 0) | ((m_vblank_irq) ? 0x18 : 0);
+ machine().device("audiocpu")->execute().set_input_line_and_vector(0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq);
}
WRITE8_MEMBER(splash_state::roldfrog_vblank_ack_w)
{
m_vblank_irq = 0;
- roldfrog_update_irq(machine());
+ roldfrog_update_irq();
}
@@ -160,7 +159,7 @@ static void ym_irq(device_t *device, int state)
{
splash_state * driver_state = device->machine().driver_data<splash_state>();
driver_state->m_sound_irq = state;
- roldfrog_update_irq(device->machine());
+ driver_state->roldfrog_update_irq();
}
static ADDRESS_MAP_START( roldfrog_map, AS_PROGRAM, 16, splash_state )
@@ -538,7 +537,7 @@ static const ym2203_interface ym2203_config =
INTERRUPT_GEN_MEMBER(splash_state::roldfrog_interrupt)
{
m_vblank_irq = 1;
- roldfrog_update_irq(machine());
+ roldfrog_update_irq();
}
static MACHINE_CONFIG_START( roldfrog, splash_state )
diff --git a/src/mame/drivers/sprint2.c b/src/mame/drivers/sprint2.c
index 5be7f638aef..1f163167d07 100644
--- a/src/mame/drivers/sprint2.c
+++ b/src/mame/drivers/sprint2.c
@@ -22,13 +22,9 @@
#include "includes/sprint2.h"
#include "sound/discrete.h"
-#define GAME_IS_SPRINT1 (state->m_game == 1)
-#define GAME_IS_SPRINT2 (state->m_game == 2)
-#define GAME_IS_DOMINOS (state->m_game == 3)
-
-
-
-
+#define GAME_IS_SPRINT1 (m_game == 1)
+#define GAME_IS_SPRINT2 (m_game == 2)
+#define GAME_IS_DOMINOS (m_game == 3)
DRIVER_INIT_MEMBER(sprint2_state,sprint1)
{
@@ -43,11 +39,9 @@ DRIVER_INIT_MEMBER(sprint2_state,dominos)
m_game = 3;
}
-
-static int service_mode(running_machine &machine)
+int sprint2_state::service_mode()
{
- sprint2_state *state = machine.driver_data<sprint2_state>();
- UINT8 v = state->ioport("INB")->read();
+ UINT8 v = ioport("INB")->read();
if (GAME_IS_SPRINT1)
{
@@ -68,7 +62,6 @@ static int service_mode(running_machine &machine)
INTERRUPT_GEN_MEMBER(sprint2_state::sprint2)
{
- sprint2_state *state = machine().driver_data<sprint2_state>();
device_t *discrete = machine().device("discrete");
/* handle steering wheels */
@@ -109,9 +102,9 @@ INTERRUPT_GEN_MEMBER(sprint2_state::sprint2)
/* interrupts and watchdog are disabled during service mode */
- machine().watchdog_enable(!service_mode(machine()));
+ machine().watchdog_enable(!service_mode());
- if (!service_mode(machine()))
+ if (!service_mode())
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
diff --git a/src/mame/drivers/sprint8.c b/src/mame/drivers/sprint8.c
index ed1f72edb52..cc5ef87f928 100644
--- a/src/mame/drivers/sprint8.c
+++ b/src/mame/drivers/sprint8.c
@@ -11,14 +11,13 @@ Atari Sprint 8 driver
-void sprint8_set_collision(running_machine &machine, int n)
+void sprint8_state::sprint8_set_collision(int n)
{
- sprint8_state *state = machine.driver_data<sprint8_state>();
- if (state->m_collision_reset == 0)
+ if (m_collision_reset == 0)
{
- machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
- state->m_collision_index = n;
+ m_collision_index = n;
}
}
diff --git a/src/mame/drivers/spy.c b/src/mame/drivers/spy.c
index 6c722fc1b23..96243081cc4 100644
--- a/src/mame/drivers/spy.c
+++ b/src/mame/drivers/spy.c
@@ -160,40 +160,39 @@ WRITE8_MEMBER(spy_state::bankswitch_w)
membank("bank1")->set_entry(bank);
}
-static void spy_collision( running_machine &machine )
+void spy_state::spy_collision( )
{
#define MAX_SPRITES 64
#define DEF_NEAR_PLANE 0x6400
#define NEAR_PLANE_ZOOM 0x0100
#define FAR_PLANE_ZOOM 0x0000
- spy_state *state = machine.driver_data<spy_state>();
int op1, x1, w1, z1, d1, y1, h1;
int op2, x2, w2, z2, d2, y2, h2;
int mode, i, loopend, nearplane;
- mode = state->m_pmcram[0x1];
- op1 = state->m_pmcram[0x2];
+ mode = m_pmcram[0x1];
+ op1 = m_pmcram[0x2];
if (op1 == 1)
{
- x1 = (state->m_pmcram[0x3] << 8) + state->m_pmcram[0x4];
- w1 = (state->m_pmcram[0x5] << 8) + state->m_pmcram[0x6];
- z1 = (state->m_pmcram[0x7] << 8) + state->m_pmcram[0x8];
- d1 = (state->m_pmcram[0x9] << 8) + state->m_pmcram[0xa];
- y1 = (state->m_pmcram[0xb] << 8) + state->m_pmcram[0xc];
- h1 = (state->m_pmcram[0xd] << 8) + state->m_pmcram[0xe];
+ x1 = (m_pmcram[0x3] << 8) + m_pmcram[0x4];
+ w1 = (m_pmcram[0x5] << 8) + m_pmcram[0x6];
+ z1 = (m_pmcram[0x7] << 8) + m_pmcram[0x8];
+ d1 = (m_pmcram[0x9] << 8) + m_pmcram[0xa];
+ y1 = (m_pmcram[0xb] << 8) + m_pmcram[0xc];
+ h1 = (m_pmcram[0xd] << 8) + m_pmcram[0xe];
for (i = 16; i < 14 * MAX_SPRITES + 2; i += 14)
{
- op2 = state->m_pmcram[i];
+ op2 = m_pmcram[i];
if (op2 || mode == 0x0c)
{
- x2 = (state->m_pmcram[i + 0x1] << 8) + state->m_pmcram[i + 0x2];
- w2 = (state->m_pmcram[i + 0x3] << 8) + state->m_pmcram[i + 0x4];
- z2 = (state->m_pmcram[i + 0x5] << 8) + state->m_pmcram[i + 0x6];
- d2 = (state->m_pmcram[i + 0x7] << 8) + state->m_pmcram[i + 0x8];
- y2 = (state->m_pmcram[i + 0x9] << 8) + state->m_pmcram[i + 0xa];
- h2 = (state->m_pmcram[i + 0xb] << 8) + state->m_pmcram[i + 0xc];
+ x2 = (m_pmcram[i + 0x1] << 8) + m_pmcram[i + 0x2];
+ w2 = (m_pmcram[i + 0x3] << 8) + m_pmcram[i + 0x4];
+ z2 = (m_pmcram[i + 0x5] << 8) + m_pmcram[i + 0x6];
+ d2 = (m_pmcram[i + 0x7] << 8) + m_pmcram[i + 0x8];
+ y2 = (m_pmcram[i + 0x9] << 8) + m_pmcram[i + 0xa];
+ h2 = (m_pmcram[i + 0xb] << 8) + m_pmcram[i + 0xc];
/*
The mad scientist's laser truck has both a high sprite center and a small height value.
It has to be measured from the ground to detect correctly.
@@ -204,11 +203,11 @@ static void spy_collision( running_machine &machine )
// what other sprites fall into:
if ((abs(x1 - x2) < w1 + w2) && (abs(z1 - z2) < d1 + d2) && (abs(y1 - y2) < h1 + h2))
{
- state->m_pmcram[0xf] = 0;
- state->m_pmcram[i + 0xd] = 0;
+ m_pmcram[0xf] = 0;
+ m_pmcram[i + 0xd] = 0;
}
else
- state->m_pmcram[i + 0xd] = 1;
+ m_pmcram[i + 0xd] = 1;
}
}
}
@@ -219,8 +218,8 @@ static void spy_collision( running_machine &machine )
the scale factors from the PMCU code. Plugging 0 and 0x100 to the far and near planes seems
to do the trick though.
*/
- loopend = (state->m_pmcram[0] << 8) + state->m_pmcram[1];
- nearplane = (state->m_pmcram[2] << 8) + state->m_pmcram[3];
+ loopend = (m_pmcram[0] << 8) + m_pmcram[1];
+ nearplane = (m_pmcram[2] << 8) + m_pmcram[3];
// fail safe
if (loopend > MAX_SPRITES)
@@ -232,13 +231,13 @@ static void spy_collision( running_machine &machine )
for (i = 4; i < loopend; i += 2)
{
- op2 = (state->m_pmcram[i] << 8) + state->m_pmcram[i + 1];
+ op2 = (m_pmcram[i] << 8) + m_pmcram[i + 1];
op2 = (op2 * (NEAR_PLANE_ZOOM - FAR_PLANE_ZOOM)) / nearplane + FAR_PLANE_ZOOM;
- state->m_pmcram[i] = op2 >> 8;
- state->m_pmcram[i + 1] = op2 & 0xff;
+ m_pmcram[i] = op2 >> 8;
+ m_pmcram[i + 1] = op2 & 0xff;
}
- memset(state->m_pmcram + loopend, 0, 0x800 - loopend); // clean up for next frame
+ memset(m_pmcram + loopend, 0, 0x800 - loopend); // clean up for next frame
}
}
@@ -317,7 +316,7 @@ WRITE8_MEMBER(spy_state::spy_3f90_w)
logerror("\n");
}
}
- spy_collision(machine());
+ spy_collision();
//ZT
m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
}
diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c
index 3edd3cbc509..34e942cc1bc 100644
--- a/src/mame/drivers/srmp2.c
+++ b/src/mame/drivers/srmp2.c
@@ -247,7 +247,7 @@ READ8_MEMBER(srmp2_state::vox_status_r)
}
-static UINT8 iox_key_matrix_calc(running_machine &machine,UINT8 p_side)
+UINT8 srmp2_state::iox_key_matrix_calc(UINT8 p_side)
{
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
int i, j, t;
@@ -258,7 +258,7 @@ static UINT8 iox_key_matrix_calc(running_machine &machine,UINT8 p_side)
for (t = 0 ; t < 8 ; t ++)
{
- if (!(machine.root_device().ioport(keynames[j+p_side])->read() & ( 1 << t )))
+ if (!(machine().root_device().ioport(keynames[j+p_side])->read() & ( 1 << t )))
{
return (i + t) | (p_side ? 0x20 : 0x00);
}
@@ -297,8 +297,8 @@ READ8_MEMBER(srmp2_state::iox_mux_r)
/* both side checks */
if(iox.mux == 1)
{
- UINT8 p1_side = iox_key_matrix_calc(machine(),0);
- UINT8 p2_side = iox_key_matrix_calc(machine(),4);
+ UINT8 p1_side = iox_key_matrix_calc(0);
+ UINT8 p2_side = iox_key_matrix_calc(4);
if(p1_side != 0)
return p1_side;
@@ -307,7 +307,7 @@ READ8_MEMBER(srmp2_state::iox_mux_r)
}
/* check individual input side */
- return iox_key_matrix_calc(machine(),(iox.mux == 2) ? 0 : 4);
+ return iox_key_matrix_calc((iox.mux == 2) ? 0 : 4);
}
return ioport("SERVICE")->read() & 0xff;
diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c
index 0b6ef8a0966..11e9ecd5047 100644
--- a/src/mame/drivers/sshangha.c
+++ b/src/mame/drivers/sshangha.c
@@ -114,16 +114,16 @@ void sshangha_state::machine_reset()
/******************************************************************************/
-INLINE void sshangha_set_color_888(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT32 data)
+inline void sshangha_state::sshangha_set_color_888(pen_t color, int rshift, int gshift, int bshift, UINT32 data)
{
- palette_set_color_rgb(machine, color, (data >> rshift) & 0xff, (data >> gshift) & 0xff, (data >> bshift) & 0xff);
+ palette_set_color_rgb(machine(), color, (data >> rshift) & 0xff, (data >> gshift) & 0xff, (data >> bshift) & 0xff);
}
WRITE16_MEMBER(sshangha_state::paletteram16_xbgr_word_be_sprites2_w)
{
COMBINE_DATA(&m_sprite_paletteram2[offset]);
- sshangha_set_color_888(machine(), (offset/2)+0x100, 0, 8, 16, m_sprite_paletteram2[(offset) | 1] | (m_sprite_paletteram2[(offset) & ~1] << 16) );
+ sshangha_set_color_888((offset/2)+0x100, 0, 8, 16, m_sprite_paletteram2[(offset) | 1] | (m_sprite_paletteram2[(offset) & ~1] << 16) );
}
WRITE16_MEMBER(sshangha_state::paletteram16_xbgr_word_be_sprites_w)
@@ -136,19 +136,19 @@ WRITE16_MEMBER(sshangha_state::paletteram16_xbgr_word_be_sprites_w)
paletteram16_xbgr_word_be_sprites2_w(space,offset,data,mem_mask);
COMBINE_DATA(&m_sprite_paletteram[offset]);
- sshangha_set_color_888(machine(), (offset/2)+0x000, 0, 8, 16, m_sprite_paletteram[(offset) | 1] | (m_sprite_paletteram[(offset) & ~1] << 16) );
+ sshangha_set_color_888((offset/2)+0x000, 0, 8, 16, m_sprite_paletteram[(offset) | 1] | (m_sprite_paletteram[(offset) & ~1] << 16) );
}
WRITE16_MEMBER(sshangha_state::paletteram16_xbgr_word_be_tilelow_w)
{
COMBINE_DATA(&m_tile_paletteram1[offset]);
- sshangha_set_color_888(machine(), (offset/2)+0x200, 0, 8, 16, m_tile_paletteram1[(offset) | 1] | (m_tile_paletteram1[(offset) & ~1] << 16) );
+ sshangha_set_color_888((offset/2)+0x200, 0, 8, 16, m_tile_paletteram1[(offset) | 1] | (m_tile_paletteram1[(offset) & ~1] << 16) );
}
WRITE16_MEMBER(sshangha_state::paletteram16_xbgr_word_be_tilehigh_w)
{
COMBINE_DATA(&m_tile_paletteram2[offset]);
- sshangha_set_color_888(machine(), (offset/2)+0x300, 0, 8, 16, m_tile_paletteram2[(offset) | 1] | (m_tile_paletteram2[(offset) & ~1] << 16) );
+ sshangha_set_color_888((offset/2)+0x300, 0, 8, 16, m_tile_paletteram2[(offset) | 1] | (m_tile_paletteram2[(offset) & ~1] << 16) );
}
static ADDRESS_MAP_START( sshangha_map, AS_PROGRAM, 16, sshangha_state )
diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c
index 63528eb6654..905aa541ead 100644
--- a/src/mame/drivers/ssv.c
+++ b/src/mame/drivers/ssv.c
@@ -295,7 +295,7 @@ WRITE16_MEMBER(ssv_state::ssv_lockout_w)
coin_counter_w(machine(), 1, data & 0x04);
coin_counter_w(machine(), 0, data & 0x08);
// data & 0x40?
- ssv_enable_video( machine(), data & 0x80);
+ ssv_enable_video(data & 0x80);
}
}
@@ -310,7 +310,7 @@ WRITE16_MEMBER(ssv_state::ssv_lockout_inv_w)
coin_counter_w(machine(), 1, data & 0x04);
coin_counter_w(machine(), 0, data & 0x08);
// data & 0x40?
- ssv_enable_video( machine(), data & 0x80);
+ ssv_enable_video(data & 0x80);
}
}
@@ -2508,34 +2508,32 @@ static const es5506_interface es5506_config =
***************************************************************************/
-static void init_ssv(running_machine &machine, int interrupt_ultrax)
+void ssv_state::init_ssv(int interrupt_ultrax)
{
- ssv_state *state = machine.driver_data<ssv_state>();
int i;
for (i = 0; i < 16; i++)
- state->m_tile_code[i] = ( (i & 8) ? (1 << 16) : 0 ) +
+ m_tile_code[i] = ( (i & 8) ? (1 << 16) : 0 ) +
( (i & 4) ? (2 << 16) : 0 ) +
( (i & 2) ? (4 << 16) : 0 ) +
( (i & 1) ? (8 << 16) : 0 ) ;
- ssv_enable_video(machine, 1);
- state->m_interrupt_ultrax = interrupt_ultrax;
+ ssv_enable_video(1);
+ m_interrupt_ultrax = interrupt_ultrax;
}
-static void init_hypreac2_common(running_machine &machine)
+void ssv_state::init_hypreac2_common()
{
- ssv_state *state = machine.driver_data<ssv_state>();
int i;
for (i = 0; i < 16; i++)
- state->m_tile_code[i] = (i << 16);
+ m_tile_code[i] = (i << 16);
}
// massages the data from the BPMicro-compatible dump to runnable form
-static void init_st010(running_machine &machine)
+void ssv_state::init_st010()
{
- UINT8 *dspsrc = (UINT8 *)machine.root_device().memregion("st010")->base();
- UINT32 *dspprg = (UINT32 *)machine.root_device().memregion("dspprg")->base();
- UINT16 *dspdata = (UINT16 *)machine.root_device().memregion("dspdata")->base();
+ UINT8 *dspsrc = (UINT8 *)machine().root_device().memregion("st010")->base();
+ UINT32 *dspprg = (UINT32 *)machine().root_device().memregion("dspprg")->base();
+ UINT16 *dspdata = (UINT16 *)machine().root_device().memregion("dspdata")->base();
// copy DSP program
for (int i = 0; i < 0x10000; i+= 4)
@@ -2551,30 +2549,30 @@ static void init_st010(running_machine &machine)
}
}
-DRIVER_INIT_MEMBER(ssv_state,drifto94) { init_ssv(machine(), 0); init_st010(machine()); }
-DRIVER_INIT_MEMBER(ssv_state,eaglshot) { init_ssv(machine(), 0); init_hypreac2_common(machine()); }
-DRIVER_INIT_MEMBER(ssv_state,gdfs) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,hypreact) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,hypreac2) { init_ssv(machine(), 0); init_hypreac2_common(machine()); }
-DRIVER_INIT_MEMBER(ssv_state,janjans1) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,keithlcy) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,meosism) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,mslider) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,ryorioh) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,srmp4) { init_ssv(machine(), 0);
+DRIVER_INIT_MEMBER(ssv_state,drifto94) { init_ssv(0); init_st010(); }
+DRIVER_INIT_MEMBER(ssv_state,eaglshot) { init_ssv(0); init_hypreac2_common(); }
+DRIVER_INIT_MEMBER(ssv_state,gdfs) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,hypreact) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,hypreac2) { init_ssv(0); init_hypreac2_common(); }
+DRIVER_INIT_MEMBER(ssv_state,janjans1) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,keithlcy) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,meosism) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,mslider) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,ryorioh) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,srmp4) { init_ssv(0);
// ((UINT16 *)machine().root_device().memregion("user1")->base())[0x2b38/2] = 0x037a; /* patch to see gal test mode */
}
-DRIVER_INIT_MEMBER(ssv_state,srmp7) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,stmblade) { init_ssv(machine(), 0); init_st010(machine()); }
-DRIVER_INIT_MEMBER(ssv_state,survarts) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,dynagear) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,sxyreact) { init_ssv(machine(), 0); init_hypreac2_common(machine()); }
-DRIVER_INIT_MEMBER(ssv_state,cairblad) { init_ssv(machine(), 0); init_hypreac2_common(machine()); }
-DRIVER_INIT_MEMBER(ssv_state,sxyreac2) { init_ssv(machine(), 0); init_hypreac2_common(machine()); }
-DRIVER_INIT_MEMBER(ssv_state,twineag2) { init_ssv(machine(), 1); init_st010(machine()); }
-DRIVER_INIT_MEMBER(ssv_state,ultrax) { init_ssv(machine(), 1); }
-DRIVER_INIT_MEMBER(ssv_state,vasara) { init_ssv(machine(), 0); }
-DRIVER_INIT_MEMBER(ssv_state,jsk) { init_ssv(machine(), 0); }
+DRIVER_INIT_MEMBER(ssv_state,srmp7) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,stmblade) { init_ssv(0); init_st010(); }
+DRIVER_INIT_MEMBER(ssv_state,survarts) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,dynagear) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,sxyreact) { init_ssv(0); init_hypreac2_common(); }
+DRIVER_INIT_MEMBER(ssv_state,cairblad) { init_ssv(0); init_hypreac2_common(); }
+DRIVER_INIT_MEMBER(ssv_state,sxyreac2) { init_ssv(0); init_hypreac2_common(); }
+DRIVER_INIT_MEMBER(ssv_state,twineag2) { init_ssv(1); init_st010(); }
+DRIVER_INIT_MEMBER(ssv_state,ultrax) { init_ssv(1); }
+DRIVER_INIT_MEMBER(ssv_state,vasara) { init_ssv(0); }
+DRIVER_INIT_MEMBER(ssv_state,jsk) { init_ssv(0); }
static MACHINE_CONFIG_START( ssv, ssv_state )
diff --git a/src/mame/drivers/stactics.c b/src/mame/drivers/stactics.c
index ab9d37f6630..2e638e1f68a 100644
--- a/src/mame/drivers/stactics.c
+++ b/src/mame/drivers/stactics.c
@@ -73,43 +73,43 @@ READ8_MEMBER(stactics_state::horiz_pos_r)
}
-static void move_motor(running_machine &machine, stactics_state *state)
+void stactics_state::move_motor()
{
/* monitor motor under joystick control */
- if (*state->m_motor_on & 0x01)
+ if (*m_motor_on & 0x01)
{
- int ip3 = machine.root_device().ioport("IN3")->read();
- int ip4 = machine.root_device().ioport("FAKE")->read();
+ int ip3 = machine().root_device().ioport("IN3")->read();
+ int ip4 = machine().root_device().ioport("FAKE")->read();
/* up */
- if (((ip4 & 0x01) == 0) && (state->m_vert_pos > -128))
- state->m_vert_pos--;
+ if (((ip4 & 0x01) == 0) && (m_vert_pos > -128))
+ m_vert_pos--;
/* down */
- if (((ip4 & 0x02) == 0) && (state->m_vert_pos < 127))
- state->m_vert_pos++;
+ if (((ip4 & 0x02) == 0) && (m_vert_pos < 127))
+ m_vert_pos++;
/* left */
- if (((ip3 & 0x20) == 0) && (state->m_horiz_pos < 127))
- state->m_horiz_pos++;
+ if (((ip3 & 0x20) == 0) && (m_horiz_pos < 127))
+ m_horiz_pos++;
/* right */
- if (((ip3 & 0x40) == 0) && (state->m_horiz_pos > -128))
- state->m_horiz_pos--;
+ if (((ip3 & 0x40) == 0) && (m_horiz_pos > -128))
+ m_horiz_pos--;
}
/* monitor motor under self-centering control */
else
{
- if (state->m_horiz_pos > 0)
- state->m_horiz_pos--;
- else if (state->m_horiz_pos < 0)
- state->m_horiz_pos++;
-
- if (state->m_vert_pos > 0)
- state->m_vert_pos--;
- else if (state->m_vert_pos < 0)
- state->m_vert_pos++;
+ if (m_horiz_pos > 0)
+ m_horiz_pos--;
+ else if (m_horiz_pos < 0)
+ m_horiz_pos++;
+
+ if (m_vert_pos > 0)
+ m_vert_pos--;
+ else if (m_vert_pos < 0)
+ m_vert_pos++;
}
}
@@ -150,7 +150,7 @@ WRITE8_MEMBER(stactics_state::stactics_coin_lockout_w)
INTERRUPT_GEN_MEMBER(stactics_state::stactics_interrupt)
{
- move_motor(machine(), this);
+ move_motor();
device.execute().set_input_line(0, HOLD_LINE);
}
diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c
index 1444068c42f..ed10ef63764 100644
--- a/src/mame/drivers/starwars.c
+++ b/src/mame/drivers/starwars.c
@@ -70,7 +70,7 @@ void starwars_state::machine_reset()
}
/* reset the matrix processor */
- starwars_mproc_reset(machine());
+ starwars_mproc_reset();
}
@@ -94,16 +94,15 @@ WRITE8_MEMBER(starwars_state::irq_ack_w)
*
*************************************/
-static void esb_slapstic_tweak(address_space &space, offs_t offset)
+void starwars_state::esb_slapstic_tweak(address_space &space, offs_t offset)
{
- starwars_state *state = space.machine().driver_data<starwars_state>();
int new_bank = slapstic_tweak(space, offset);
/* update for the new bank */
- if (new_bank != state->m_slapstic_current_bank)
+ if (new_bank != m_slapstic_current_bank)
{
- state->m_slapstic_current_bank = new_bank;
- memcpy(state->m_slapstic_base, &state->m_slapstic_source[state->m_slapstic_current_bank * 0x2000], 0x2000);
+ m_slapstic_current_bank = new_bank;
+ memcpy(m_slapstic_base, &m_slapstic_source[m_slapstic_current_bank * 0x2000], 0x2000);
}
}
@@ -506,7 +505,7 @@ DRIVER_INIT_MEMBER(starwars_state,starwars)
{
/* prepare the mathbox */
m_is_esb = 0;
- starwars_mproc_init(machine());
+ starwars_mproc_init();
/* initialize banking */
membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x6000, 0x10000 - 0x6000);
@@ -535,7 +534,7 @@ DRIVER_INIT_MEMBER(starwars_state,esb)
/* prepare the matrix processor */
m_is_esb = 1;
- starwars_mproc_init(machine());
+ starwars_mproc_init();
/* initialize banking */
membank("bank1")->configure_entries(0, 2, rom + 0x6000, 0x10000 - 0x6000);
diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c
index 6201c7d9684..476427fa8d9 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -82,12 +82,12 @@ DRIVER_INIT_MEMBER(suna8_state,hardhedb)
Brick Zone
***************************************************************************/
-static UINT8 *brickzn_decrypt(running_machine &machine)
+UINT8 *suna8_state::brickzn_decrypt()
{
- address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *RAM = machine.root_device().memregion("maincpu")->base();
- size_t size = machine.root_device().memregion("maincpu")->bytes();
- UINT8 *decrypt = auto_alloc_array(machine, UINT8, size);
+ address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *RAM = machine().root_device().memregion("maincpu")->base();
+ size_t size = machine().root_device().memregion("maincpu")->bytes();
+ UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size);
int i;
space.set_decrypted_region(0x0000, 0x7fff, decrypt);
@@ -132,7 +132,7 @@ static UINT8 *brickzn_decrypt(running_machine &machine)
DRIVER_INIT_MEMBER(suna8_state,brickzn)
{
UINT8 *RAM = machine().root_device().memregion("maincpu")->base();
- UINT8 *decrypt = brickzn_decrypt(machine());
+ UINT8 *decrypt = brickzn_decrypt();
int i;
// Opcodes decrypted as data (to do: activated at run-time)
@@ -171,7 +171,7 @@ DRIVER_INIT_MEMBER(suna8_state,brickzn)
DRIVER_INIT_MEMBER(suna8_state,brickznv4)
{
UINT8 *RAM = machine().root_device().memregion("maincpu")->base();
- UINT8 *decrypt = brickzn_decrypt(machine());
+ UINT8 *decrypt = brickzn_decrypt();
int i;
// Opcodes decrypted as data (to do: activated at run-time)
diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c
index 4259a497ff0..3e7d715b1b7 100644
--- a/src/mame/drivers/superqix.c
+++ b/src/mame/drivers/superqix.c
@@ -342,23 +342,22 @@ WRITE8_MEMBER(superqix_state::bootleg_flipscreen_w)
* connected to the 68705 which acts as a counter.
*/
-static int read_dial(running_machine &machine, int player)
+int superqix_state::read_dial(int player)
{
- superqix_state *state = machine.driver_data<superqix_state>();
int newpos;
/* get the new position and adjust the result */
- newpos = state->ioport(player ? "DIAL2" : "DIAL1")->read();
- if (newpos != state->m_oldpos[player])
+ newpos = ioport(player ? "DIAL2" : "DIAL1")->read();
+ if (newpos != m_oldpos[player])
{
- state->m_sign[player] = ((newpos - state->m_oldpos[player]) & 0x80) >> 7;
- state->m_oldpos[player] = newpos;
+ m_sign[player] = ((newpos - m_oldpos[player]) & 0x80) >> 7;
+ m_oldpos[player] = newpos;
}
if (player == 0)
- return ((state->m_oldpos[player] & 1) << 2) | (state->m_sign[player] << 3);
+ return ((m_oldpos[player] & 1) << 2) | (m_sign[player] << 3);
else // player == 1
- return ((state->m_oldpos[player] & 1) << 3) | (state->m_sign[player] << 2);
+ return ((m_oldpos[player] & 1) << 3) | (m_sign[player] << 2);
}
@@ -446,11 +445,11 @@ WRITE8_MEMBER(superqix_state::hotsmash_68705_portC_w)
break;
case 0x6:
- m_portA_in = read_dial(machine(), 0);
+ m_portA_in = read_dial(0);
break;
case 0x7:
- m_portA_in = read_dial(machine(), 1);
+ m_portA_in = read_dial(1);
break;
}
}
@@ -517,24 +516,23 @@ READ8_MEMBER(superqix_state::pbillian_ay_port_a_r)
}
-static void machine_init_common(running_machine &machine)
+void superqix_state::machine_init_common()
{
- superqix_state *state = machine.driver_data<superqix_state>();
- state->save_item(NAME(state->m_invert_coin_lockout));
- state->save_item(NAME(state->m_from_mcu_pending));
- state->save_item(NAME(state->m_from_z80_pending));
- state->save_item(NAME(state->m_port1));
- state->save_item(NAME(state->m_port2));
- state->save_item(NAME(state->m_port3));
- state->save_item(NAME(state->m_port3_latch));
- state->save_item(NAME(state->m_from_mcu));
- state->save_item(NAME(state->m_from_z80));
- state->save_item(NAME(state->m_portb));
+ save_item(NAME(m_invert_coin_lockout));
+ save_item(NAME(m_from_mcu_pending));
+ save_item(NAME(m_from_z80_pending));
+ save_item(NAME(m_port1));
+ save_item(NAME(m_port2));
+ save_item(NAME(m_port3));
+ save_item(NAME(m_port3_latch));
+ save_item(NAME(m_from_mcu));
+ save_item(NAME(m_from_z80));
+ save_item(NAME(m_portb));
// hotsmash ???
- state->save_item(NAME(state->m_portA_in));
- state->save_item(NAME(state->m_portB_out));
- state->save_item(NAME(state->m_portC));
+ save_item(NAME(m_portA_in));
+ save_item(NAME(m_portB_out));
+ save_item(NAME(m_portC));
}
MACHINE_START_MEMBER(superqix_state,superqix)
@@ -542,7 +540,7 @@ MACHINE_START_MEMBER(superqix_state,superqix)
/* configure the banks */
machine().root_device().membank("bank1")->configure_entries(0, 4, machine().root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
- machine_init_common(machine());
+ machine_init_common();
}
MACHINE_START_MEMBER(superqix_state,pbillian)
@@ -550,7 +548,7 @@ MACHINE_START_MEMBER(superqix_state,pbillian)
/* configure the banks */
machine().root_device().membank("bank1")->configure_entries(0, 2, machine().root_device().memregion("maincpu")->base() + 0x10000, 0x4000);
- machine_init_common(machine());
+ machine_init_common();
}
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index c7fac0d7668..92fbb677faf 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -190,10 +190,9 @@ static void hit_calc_axis(UINT16 x1p, UINT16 x1s, UINT16 x2p, UINT16 x2s, UINT16
*x_in = x1r-x2l;
}
-static void hit_recalc(running_machine &machine)
+void skns_state::hit_recalc()
{
- skns_state *state = machine.driver_data<skns_state>();
- hit_t &hit = state->m_hit;
+ hit_t &hit = m_hit;
hit_calc_axis(hit.x1p, hit.x1s, hit.x2p, hit.x2s, hit.org,
&hit.x1_p1, &hit.x1_p2, &hit.x2_p1, &hit.x2_p2,
@@ -287,7 +286,7 @@ WRITE32_MEMBER(skns_state::skns_hit_w)
// log_write("HIT", adr, data, type);
break;
}
- hit_recalc(machine());
+ hit_recalc();
}
WRITE32_MEMBER(skns_state::skns_hit2_w)
@@ -956,36 +955,36 @@ READ32_MEMBER(skns_state::sengekij_speedup_r)// 60006ee 600308e
return m_main_ram[0xb7380/4];
}
-static void init_skns(running_machine &machine)
+void skns_state::init_skns()
{
// init DRC to fastest options
- sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine().device("maincpu"), SH2DRC_FASTEST_OPTIONS);
}
-static void set_drc_pcflush(running_machine &machine, UINT32 addr)
+void skns_state::set_drc_pcflush(UINT32 addr)
{
- sh2drc_add_pcflush(machine.device("maincpu"), addr);
+ sh2drc_add_pcflush(machine().device("maincpu"), addr);
}
-DRIVER_INIT_MEMBER(skns_state,galpani4) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-5,-1); init_skns(machine()); }
-DRIVER_INIT_MEMBER(skns_state,galpanis) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-5,-1); init_skns(machine()); }
-DRIVER_INIT_MEMBER(skns_state,cyvern) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+2); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x604d3c8, 0x604d3cb, read32_delegate(FUNC(skns_state::cyvern_speedup_r),this) ); set_drc_pcflush(machine(), 0x402ebd2); }
-DRIVER_INIT_MEMBER(skns_state,galpans2) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60fb6bc, 0x60fb6bf, read32_delegate(FUNC(skns_state::galpans2_speedup_r),this) ); set_drc_pcflush(machine(), 0x4049ae2); }
-DRIVER_INIT_MEMBER(skns_state,gutsn) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+0); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x600c780, 0x600c783, read32_delegate(FUNC(skns_state::gutsn_speedup_r),this) ); set_drc_pcflush(machine(), 0x402206e); }
-DRIVER_INIT_MEMBER(skns_state,panicstr) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60f19e4, 0x60f19e7, read32_delegate(FUNC(skns_state::panicstr_speedup_r),this) ); set_drc_pcflush(machine(), 0x404e68a); }
-DRIVER_INIT_MEMBER(skns_state,senknow) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+1,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60000dc, 0x60000df, read32_delegate(FUNC(skns_state::senknow_speedup_r),this) ); set_drc_pcflush(machine(), 0x4017dce); }
-DRIVER_INIT_MEMBER(skns_state,puzzloope) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6081d38, 0x6081d3b, read32_delegate(FUNC(skns_state::puzzloope_speedup_r),this) ); set_drc_pcflush(machine(), 0x401da14); }
-DRIVER_INIT_MEMBER(skns_state,puzzloopj) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6086714, 0x6086717, read32_delegate(FUNC(skns_state::puzzloopj_speedup_r),this) ); set_drc_pcflush(machine(), 0x401dca0); }
-DRIVER_INIT_MEMBER(skns_state,puzzloopa) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6085bcc, 0x6085bcf, read32_delegate(FUNC(skns_state::puzzloopa_speedup_r),this) ); set_drc_pcflush(machine(), 0x401d9d4); }
-DRIVER_INIT_MEMBER(skns_state,puzzloopu) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6085cec, 0x6085cef, read32_delegate(FUNC(skns_state::puzzloopu_speedup_r),this) ); set_drc_pcflush(machine(), 0x401dab0); }
-DRIVER_INIT_MEMBER(skns_state,jjparads) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6000994, 0x6000997, read32_delegate(FUNC(skns_state::jjparads_speedup_r),this) ); set_drc_pcflush(machine(), 0x4015e84); }
-DRIVER_INIT_MEMBER(skns_state,jjparad2) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6000984, 0x6000987, read32_delegate(FUNC(skns_state::jjparad2_speedup_r),this) ); set_drc_pcflush(machine(), 0x401620a); }
-DRIVER_INIT_MEMBER(skns_state,ryouran) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6000a14, 0x6000a17, read32_delegate(FUNC(skns_state::ryouran_speedup_r),this) ); set_drc_pcflush(machine(), 0x40182ce); }
-DRIVER_INIT_MEMBER(skns_state,teljan) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6002fb4, 0x6002fb7, read32_delegate(FUNC(skns_state::teljan_speedup_r),this) ); set_drc_pcflush(machine(), 0x401ba32); }
-DRIVER_INIT_MEMBER(skns_state,sengekis) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60b74bc, 0x60b74bf, read32_delegate(FUNC(skns_state::sengekis_speedup_r),this) ); set_drc_pcflush(machine(), 0x60006ec); }
-DRIVER_INIT_MEMBER(skns_state,sengekij) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns(machine());machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60b7380, 0x60b7383, read32_delegate(FUNC(skns_state::sengekij_speedup_r),this) ); set_drc_pcflush(machine(), 0x60006ec); }
-DRIVER_INIT_MEMBER(skns_state,sarukani) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine()); set_drc_pcflush(machine(), 0x4013b42); } // Speedup is in skns_io_w()
-DRIVER_INIT_MEMBER(skns_state,galpans3) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(machine()); }
+DRIVER_INIT_MEMBER(skns_state,galpani4) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-5,-1); init_skns(); }
+DRIVER_INIT_MEMBER(skns_state,galpanis) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-5,-1); init_skns(); }
+DRIVER_INIT_MEMBER(skns_state,cyvern) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+2); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x604d3c8, 0x604d3cb, read32_delegate(FUNC(skns_state::cyvern_speedup_r),this) ); set_drc_pcflush(0x402ebd2); }
+DRIVER_INIT_MEMBER(skns_state,galpans2) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60fb6bc, 0x60fb6bf, read32_delegate(FUNC(skns_state::galpans2_speedup_r),this) ); set_drc_pcflush(0x4049ae2); }
+DRIVER_INIT_MEMBER(skns_state,gutsn) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+0,+0); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x600c780, 0x600c783, read32_delegate(FUNC(skns_state::gutsn_speedup_r),this) ); set_drc_pcflush(0x402206e); }
+DRIVER_INIT_MEMBER(skns_state,panicstr) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60f19e4, 0x60f19e7, read32_delegate(FUNC(skns_state::panicstr_speedup_r),this) ); set_drc_pcflush(0x404e68a); }
+DRIVER_INIT_MEMBER(skns_state,senknow) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+1,+1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60000dc, 0x60000df, read32_delegate(FUNC(skns_state::senknow_speedup_r),this) ); set_drc_pcflush(0x4017dce); }
+DRIVER_INIT_MEMBER(skns_state,puzzloope) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6081d38, 0x6081d3b, read32_delegate(FUNC(skns_state::puzzloope_speedup_r),this) ); set_drc_pcflush(0x401da14); }
+DRIVER_INIT_MEMBER(skns_state,puzzloopj) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6086714, 0x6086717, read32_delegate(FUNC(skns_state::puzzloopj_speedup_r),this) ); set_drc_pcflush(0x401dca0); }
+DRIVER_INIT_MEMBER(skns_state,puzzloopa) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6085bcc, 0x6085bcf, read32_delegate(FUNC(skns_state::puzzloopa_speedup_r),this) ); set_drc_pcflush(0x401d9d4); }
+DRIVER_INIT_MEMBER(skns_state,puzzloopu) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-9,-1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6085cec, 0x6085cef, read32_delegate(FUNC(skns_state::puzzloopu_speedup_r),this) ); set_drc_pcflush(0x401dab0); }
+DRIVER_INIT_MEMBER(skns_state,jjparads) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6000994, 0x6000997, read32_delegate(FUNC(skns_state::jjparads_speedup_r),this) ); set_drc_pcflush(0x4015e84); }
+DRIVER_INIT_MEMBER(skns_state,jjparad2) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6000984, 0x6000987, read32_delegate(FUNC(skns_state::jjparad2_speedup_r),this) ); set_drc_pcflush(0x401620a); }
+DRIVER_INIT_MEMBER(skns_state,ryouran) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6000a14, 0x6000a17, read32_delegate(FUNC(skns_state::ryouran_speedup_r),this) ); set_drc_pcflush(0x40182ce); }
+DRIVER_INIT_MEMBER(skns_state,teljan) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(+5,+1); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x6002fb4, 0x6002fb7, read32_delegate(FUNC(skns_state::teljan_speedup_r),this) ); set_drc_pcflush(0x401ba32); }
+DRIVER_INIT_MEMBER(skns_state,sengekis) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60b74bc, 0x60b74bf, read32_delegate(FUNC(skns_state::sengekis_speedup_r),this) ); set_drc_pcflush(0x60006ec); }
+DRIVER_INIT_MEMBER(skns_state,sengekij) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-192,-272); init_skns();machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x60b7380, 0x60b7383, read32_delegate(FUNC(skns_state::sengekij_speedup_r),this) ); set_drc_pcflush(0x60006ec); }
+DRIVER_INIT_MEMBER(skns_state,sarukani) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(); set_drc_pcflush(0x4013b42); } // Speedup is in skns_io_w()
+DRIVER_INIT_MEMBER(skns_state,galpans3) { machine().device<sknsspr_device>("spritegen")->skns_sprite_kludge(-1,-1); init_skns(); }
diff --git a/src/mame/drivers/suprridr.c b/src/mame/drivers/suprridr.c
index 356ab92f0ef..96ac4a97580 100644
--- a/src/mame/drivers/suprridr.c
+++ b/src/mame/drivers/suprridr.c
@@ -226,7 +226,7 @@ CUSTOM_INPUT_MEMBER(suprridr_state::suprridr_control_r)
UINT32 ret;
/* screen flip multiplexes controls */
- if (suprridr_is_screen_flipped(machine()))
+ if (suprridr_is_screen_flipped())
ret = ioport(SUPRRIDR_P2_CONTROL_PORT_TAG)->read();
else
ret = ioport(SUPRRIDR_P1_CONTROL_PORT_TAG)->read();
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index f8136095425..328764a9f3d 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -394,17 +394,17 @@ void system1_state::machine_reset()
*
*************************************/
-static void bank44_custom_w(running_machine &machine, UINT8 data, UINT8 prevdata)
+void system1_state::bank44_custom_w(UINT8 data, UINT8 prevdata)
{
/* bank bits are bits 6 and 2 */
- machine.root_device().membank("bank1")->set_entry(((data & 0x40) >> 5) | ((data & 0x04) >> 2));
+ machine().root_device().membank("bank1")->set_entry(((data & 0x40) >> 5) | ((data & 0x04) >> 2));
}
-static void bank0c_custom_w(running_machine &machine, UINT8 data, UINT8 prevdata)
+void system1_state::bank0c_custom_w(UINT8 data, UINT8 prevdata)
{
/* bank bits are bits 3 and 2 */
- machine.root_device().membank("bank1")->set_entry((data & 0x0c) >> 2);
+ machine().root_device().membank("bank1")->set_entry((data & 0x0c) >> 2);
}
@@ -418,7 +418,7 @@ WRITE8_MEMBER(system1_state::videomode_w)
/* handle any custom banking or other stuff */
if (m_videomode_custom != NULL)
- (*m_videomode_custom)(machine(), data, m_videomode_prev);
+ (this->*m_videomode_custom)(data, m_videomode_prev);
m_videomode_prev = data;
/* bit 0 is for the coin counters */
@@ -450,15 +450,14 @@ CUSTOM_INPUT_MEMBER(system1_state::dakkochn_mux_status_r)
}
-static void dakkochn_custom_w(running_machine &machine, UINT8 data, UINT8 prevdata)
+void system1_state::dakkochn_custom_w(UINT8 data, UINT8 prevdata)
{
- system1_state *state = machine.driver_data<system1_state>();
/* bit 1 toggling on clocks the mux; we store the previous state in the high bit of dakkochn_mux_data */
if ((data & 0x02) && !(prevdata & 0x02))
- state->m_dakkochn_mux_data = (state->m_dakkochn_mux_data + 1) % 7;
+ m_dakkochn_mux_data = (m_dakkochn_mux_data + 1) % 7;
/* remaining stuff acts like bank0c */
- bank0c_custom_w(machine, data, prevdata);
+ bank0c_custom_w(data, prevdata);
}
@@ -4677,12 +4676,12 @@ DRIVER_INIT_MEMBER(system1_state,bank00)
}
DRIVER_INIT_MEMBER(system1_state,bank44)
{
- m_videomode_custom = bank44_custom_w;
+ m_videomode_custom = &system1_state::bank44_custom_w;
}
DRIVER_INIT_MEMBER(system1_state,bank0c)
{
- m_videomode_custom = bank0c_custom_w;
+ m_videomode_custom = &system1_state::bank0c_custom_w;
}
DRIVER_INIT_MEMBER(system1_state,regulus) { DRIVER_INIT_CALL(bank00); regulus_decode(machine(), "maincpu"); }
@@ -4715,7 +4714,7 @@ DRIVER_INIT_MEMBER(system1_state,wboysys2) { DRIVER_INIT_CALL(bank0c); sega_315
DRIVER_INIT_MEMBER(system1_state,dakkochn)
{
- m_videomode_custom = dakkochn_custom_w;
+ m_videomode_custom = &system1_state::dakkochn_custom_w;
mc8123_decrypt_rom(machine(), "maincpu", "key", "bank1", 4);
diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c
index 6e5201fa25e..3e15e0487d0 100644
--- a/src/mame/drivers/system16.c
+++ b/src/mame/drivers/system16.c
@@ -475,29 +475,26 @@ ADDRESS_MAP_END
/***************************************************************************/
-static void set_tile_bank( running_machine &machine, int data )
+void segas1x_bootleg_state::set_tile_bank( int data )
{
- segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- state->m_tile_bank0 = (data >> 4) & 0x0f;
- state->m_tile_bank1 = data & 0x0f;
+ m_tile_bank0 = (data >> 4) & 0x0f;
+ m_tile_bank1 = data & 0x0f;
}
-static void set_fg_page( running_machine &machine, int data )
+void segas1x_bootleg_state::set_fg_page( int data )
{
- segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- state->m_fg_page[0] = data >> 12;
- state->m_fg_page[1] = (data >> 8) & 0x0f;
- state->m_fg_page[2] = (data >> 4) & 0x0f;
- state->m_fg_page[3] = data & 0x0f;
+ m_fg_page[0] = data >> 12;
+ m_fg_page[1] = (data >> 8) & 0x0f;
+ m_fg_page[2] = (data >> 4) & 0x0f;
+ m_fg_page[3] = data & 0x0f;
}
-static void set_bg_page( running_machine &machine, int data )
+void segas1x_bootleg_state::set_bg_page( int data )
{
- segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- state->m_bg_page[0] = data >> 12;
- state->m_bg_page[1] = (data >> 8) & 0x0f;
- state->m_bg_page[2] = (data >> 4) & 0x0f;
- state->m_bg_page[3] = data & 0x0f;
+ m_bg_page[0] = data >> 12;
+ m_bg_page[1] = (data >> 8) & 0x0f;
+ m_bg_page[2] = (data >> 4) & 0x0f;
+ m_bg_page[3] = data & 0x0f;
}
#ifdef UNUSED_CODE
@@ -536,12 +533,12 @@ ADDRESS_MAP_END
WRITE16_MEMBER(segas1x_bootleg_state::s16bl_bgpage_w)
{
- set_bg_page(machine(), data);
+ set_bg_page(data);
}
WRITE16_MEMBER(segas1x_bootleg_state::s16bl_fgpage_w)
{
- set_fg_page(machine(), data);
+ set_fg_page(data);
}
WRITE16_MEMBER(segas1x_bootleg_state::s16bl_fgscrollx_bank_w)
@@ -550,7 +547,7 @@ WRITE16_MEMBER(segas1x_bootleg_state::s16bl_fgscrollx_bank_w)
int bank = (data & 0xc000) >> 14;
scroll += 0x200;
- set_tile_bank(machine(), bank);
+ set_tile_bank(bank);
scroll += 3; // so that the character portraits in attract mode are properly aligned (alighnment on character select no longer matches original tho?)
m_fg_scrollx = -scroll;
@@ -636,49 +633,48 @@ static ADDRESS_MAP_START( bayrouteb1_map, AS_PROGRAM, 16, segas1x_bootleg_state
AM_RANGE(0x902002, 0x902003) AM_READ_PORT("DSW1")
ADDRESS_MAP_END
-static void datsu_set_pages( running_machine &machine )
+void segas1x_bootleg_state::datsu_set_pages( )
{
- segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
UINT16 page;
- page = ((state->m_datsu_page[0] & 0x00f0) >>0) |
- ((state->m_datsu_page[1] & 0x00f0) >>4) |
- ((state->m_datsu_page[2] & 0x00f0) <<8) |
- ((state->m_datsu_page[3] & 0x00f0) <<4);
+ page = ((m_datsu_page[0] & 0x00f0) >>0) |
+ ((m_datsu_page[1] & 0x00f0) >>4) |
+ ((m_datsu_page[2] & 0x00f0) <<8) |
+ ((m_datsu_page[3] & 0x00f0) <<4);
- set_fg_page(machine, page);
+ set_fg_page(page);
- page = ((state->m_datsu_page[0] & 0x000f) <<4) |
- ((state->m_datsu_page[1] & 0x000f) <<0) |
- ((state->m_datsu_page[2] & 0x000f) <<12) |
- ((state->m_datsu_page[3] & 0x000f) <<8);
+ page = ((m_datsu_page[0] & 0x000f) <<4) |
+ ((m_datsu_page[1] & 0x000f) <<0) |
+ ((m_datsu_page[2] & 0x000f) <<12) |
+ ((m_datsu_page[3] & 0x000f) <<8);
- set_bg_page(machine, page);
+ set_bg_page(page);
}
WRITE16_MEMBER(segas1x_bootleg_state::datsu_page0_w)
{
COMBINE_DATA(&m_datsu_page[0]);
- datsu_set_pages(machine());
+ datsu_set_pages();
}
WRITE16_MEMBER(segas1x_bootleg_state::datsu_page1_w)
{
COMBINE_DATA(&m_datsu_page[1]);
- datsu_set_pages(machine());
+ datsu_set_pages();
}
WRITE16_MEMBER(segas1x_bootleg_state::datsu_page2_w)
{
COMBINE_DATA(&m_datsu_page[2]);
- datsu_set_pages(machine());
+ datsu_set_pages();
}
WRITE16_MEMBER(segas1x_bootleg_state::datsu_page3_w)
{
COMBINE_DATA(&m_datsu_page[3]);
- datsu_set_pages(machine());
+ datsu_set_pages();
}
static ADDRESS_MAP_START( bayrouteb2_map, AS_PROGRAM, 16, segas1x_bootleg_state )
@@ -737,7 +733,7 @@ WRITE16_MEMBER(segas1x_bootleg_state::goldnaxeb2_fgscrollx_w)
int scroll = data & 0x1ff;
int bank = (data & 0xc000) >> 14;
- set_tile_bank(machine(), bank);
+ set_tile_bank(bank);
scroll += 0x1f6;
scroll &= 0x3ff;
m_fg_scrollx = -scroll;
@@ -780,7 +776,7 @@ WRITE16_MEMBER(segas1x_bootleg_state::goldnaxeb2_fgpage_w)
((m_goldnaxeb2_fgpage[3] & 0xf) << 8) |
((m_goldnaxeb2_fgpage[2] & 0xf) << 12);
- set_fg_page(machine(), page ^ 0xffff);
+ set_fg_page(page ^ 0xffff);
}
@@ -795,7 +791,7 @@ WRITE16_MEMBER(segas1x_bootleg_state::goldnaxeb2_bgpage_w)
((m_goldnaxeb2_bgpage[3] & 0xf) << 8) |
((m_goldnaxeb2_bgpage[2] & 0xf) << 12);
- set_bg_page(machine(), page ^ 0xffff);
+ set_bg_page(page ^ 0xffff);
}
static ADDRESS_MAP_START( goldnaxeb2_map, AS_PROGRAM, 16, segas1x_bootleg_state )
diff --git a/src/mame/includes/sauro.h b/src/mame/includes/sauro.h
index 42c6756b1b3..df3699008b3 100644
--- a/src/mame/includes/sauro.h
+++ b/src/mame/includes/sauro.h
@@ -39,4 +39,6 @@ public:
UINT32 screen_update_trckydoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_sauro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(sauro_interrupt);
+ void sauro_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void trckydoc_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/sbasketb.h b/src/mame/includes/sbasketb.h
index 6538c2674d9..e20ec997ea2 100644
--- a/src/mame/includes/sbasketb.h
+++ b/src/mame/includes/sbasketb.h
@@ -44,4 +44,5 @@ public:
virtual void palette_init();
UINT32 screen_update_sbasketb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_irq);
+ void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/scotrsht.h b/src/mame/includes/scotrsht.h
index 6f9412f536c..b4bf4b55df9 100644
--- a/src/mame/includes/scotrsht.h
+++ b/src/mame/includes/scotrsht.h
@@ -27,4 +27,5 @@ public:
virtual void palette_init();
UINT32 screen_update_scotrsht(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(scotrsht_interrupt);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/scramble.h b/src/mame/includes/scramble.h
index ffb0c219116..bcc78641780 100644
--- a/src/mame/includes/scramble.h
+++ b/src/mame/includes/scramble.h
@@ -73,6 +73,8 @@ public:
DECLARE_WRITE8_MEMBER(scramble_protection_w);
DECLARE_READ8_MEMBER(scramble_protection_r);
DECLARE_WRITE_LINE_MEMBER(scramble_sh_7474_q_callback);
+ void cavelon_banksw();
+ inline int bit(int i,int n);
};
diff --git a/src/mame/includes/sderby.h b/src/mame/includes/sderby.h
index 838ca59966e..c581d4aa4f3 100644
--- a/src/mame/includes/sderby.h
+++ b/src/mame/includes/sderby.h
@@ -35,4 +35,5 @@ public:
virtual void video_start();
UINT32 screen_update_sderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_pmroulet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int codeshift);
};
diff --git a/src/mame/includes/segag80r.h b/src/mame/includes/segag80r.h
index 41c87de7cec..4117b8ac752 100644
--- a/src/mame/includes/segag80r.h
+++ b/src/mame/includes/segag80r.h
@@ -110,6 +110,16 @@ public:
DECLARE_WRITE8_MEMBER(n7751_command_w);
DECLARE_WRITE8_MEMBER(n7751_rom_control_w);
DECLARE_WRITE8_MEMBER(n7751_p2_w);
+ void vblank_latch_set();
+ void g80_set_palette_entry(int entry, UINT8 data);
+ void spaceod_bg_init_palette();
+ void draw_videoram(bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *transparent_pens);
+ void draw_background_spaceod(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_background_page_scroll(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_background_full_scroll(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ offs_t decrypt_offset(address_space &space, offs_t offset);
+ inline UINT8 demangle(UINT8 d7d6, UINT8 d5d4, UINT8 d3d2, UINT8 d1d0);
+ void monsterb_expand_gfx(const char *region);
};
diff --git a/src/mame/includes/segag80v.h b/src/mame/includes/segag80v.h
index 3da68151d67..10d606f55f6 100644
--- a/src/mame/includes/segag80v.h
+++ b/src/mame/includes/segag80v.h
@@ -53,4 +53,8 @@ public:
virtual void machine_start();
virtual void video_start();
UINT32 screen_update_segag80v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ inline int adjust_xy(int rawx, int rawy, int *outx, int *outy);
+ void sega_generate_vector_list();
+ offs_t decrypt_offset(address_space &space, offs_t offset);
+ inline UINT8 demangle(UINT8 d7d6, UINT8 d5d4, UINT8 d3d2, UINT8 d1d0);
};
diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h
index 1904c152ac2..f12aec577e1 100644
--- a/src/mame/includes/segas32.h
+++ b/src/mame/includes/segas32.h
@@ -5,12 +5,6 @@
***************************************************************************/
-typedef void (*sys32_output_callback)(int which, UINT16 data);
-struct layer_info
-{
- bitmap_ind16 *bitmap;
- UINT8 *transparent;
-};
class segas32_state : public driver_device
@@ -31,6 +25,29 @@ public:
required_shared_ptr<UINT16> m_system32_videoram;
required_shared_ptr<UINT16> m_system32_spriteram;
+ typedef void (segas32_state::*sys32_output_callback)(int which, UINT16 data);
+
+ struct layer_info
+ {
+ bitmap_ind16 *bitmap;
+ UINT8 *transparent;
+ };
+
+ struct extents_list
+ {
+ UINT8 scan_extent[256];
+ UINT16 extent[32][16];
+ };
+
+
+ struct cache_entry
+ {
+ struct cache_entry * next;
+ tilemap_t * tmap;
+ UINT8 page;
+ UINT8 bank;
+ };
+
UINT8 m_v60_irq_control[0x10];
timer_device *m_v60_irq_timer[2];
UINT8 m_sound_irq_control[4];
@@ -181,6 +198,56 @@ public:
TIMER_CALLBACK_MEMBER(end_of_vblank_int);
TIMER_CALLBACK_MEMBER(update_sprites);
TIMER_DEVICE_CALLBACK_MEMBER(signal_v60_irq_callback);
+ void common_start(int multi32);
+ void system32_set_vblank(int state);
+ inline UINT16 xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(UINT16 value);
+ inline UINT16 xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(UINT16 value);
+ inline void update_color(int offset, UINT16 data);
+ inline UINT16 common_paletteram_r(address_space &space, int which, offs_t offset);
+ void common_paletteram_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask);
+ tilemap_t *find_cache_entry(int page, int bank);
+ inline void get_tilemaps(int bgnum, tilemap_t **tilemaps);
+ UINT8 update_tilemaps(screen_device &screen, const rectangle &cliprect);
+ void sprite_erase_buffer();
+ void sprite_swap_buffers();
+ int draw_one_sprite(UINT16 *data, int xoffs, int yoffs, const rectangle &clipin, const rectangle &clipout);
+ void sprite_render_list();
+ inline UINT8 compute_color_offsets(int which, int layerbit, int layerflag);
+ inline UINT16 compute_sprite_blend(UINT8 encoding);
+ inline UINT16 *get_layer_scanline(int layer, int scanline);
+ void mix_all_layers(int which, int xoffs, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 enablemask);
+ void print_mixer_data(int which);
+ UINT32 multi32_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index);
+ void decrypt_ga2_protrom();
+ void update_irq_state();
+ void signal_v60_irq(int which);
+ void int_control_w(address_space &space, int offset, UINT8 data);
+ UINT16 common_io_chip_r(address_space &space, int which, offs_t offset, UINT16 mem_mask);
+ void common_io_chip_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask);
+ void update_sound_irq_state();
+ void segas32_common_init(read16_delegate custom_r, write16_delegate custom_w);
+ void radm_sw1_output( int which, UINT16 data );
+ void radm_sw2_output( int which, UINT16 data );
+ void radr_sw2_output( int which, UINT16 data );
+ void alien3_sw1_output( int which, UINT16 data );
+ void arescue_sw1_output( int which, UINT16 data );
+ void f1lap_sw1_output( int which, UINT16 data );
+ void jpark_sw1_output( int which, UINT16 data );
+ void orunners_sw1_output( int which, UINT16 data );
+ void orunners_sw2_output( int which, UINT16 data );
+ void harddunk_sw1_output( int which, UINT16 data );
+ void harddunk_sw2_output( int which, UINT16 data );
+ void harddunk_sw3_output( int which, UINT16 data );
+ void titlef_sw1_output( int which, UINT16 data );
+ void titlef_sw2_output( int which, UINT16 data );
+ void scross_sw1_output( int which, UINT16 data );
+ void scross_sw2_output( int which, UINT16 data );
+ int compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle &cliprect, struct extents_list *list);
+ void update_tilemap_zoom(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum);
+ void update_tilemap_rowscroll(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum);
+ void update_tilemap_text(screen_device &screen, struct layer_info *layer, const rectangle &cliprect);
+ void update_bitmap(screen_device &screen, struct layer_info *layer, const rectangle &cliprect);
+ void update_background(struct layer_info *layer, const rectangle &cliprect);
};
/*----------- defined in machine/segas32.c -----------*/
diff --git a/src/mame/includes/seibuspi.h b/src/mame/includes/seibuspi.h
index 2c66390d9ae..e53f95a58d4 100644
--- a/src/mame/includes/seibuspi.h
+++ b/src/mame/includes/seibuspi.h
@@ -117,6 +117,19 @@ public:
UINT32 screen_update_sys386f2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(spi_interrupt);
IRQ_CALLBACK_MEMBER(spi_irq_callback);
+ void rf2_set_layer_banks(int banks);
+ void drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy);
+ void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int pri_mask);
+ void set_rowscroll(tilemap_t *layer, int scroll, INT16* rows);
+ void set_scroll(tilemap_t *layer, int scroll);
+ void combine_tilemap(bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *tile, int x, int y, int opaque, INT16 *rowscroll);
+ UINT8 z80_fifoout_pop(address_space &space);
+ void z80_fifoout_push(address_space &space, UINT8 data);
+ UINT8 z80_fifoin_pop(address_space &space);
+ void z80_fifoin_push(address_space &space, UINT8 data);
+ void init_spi();
+ void init_rf2_common();
+ void init_rfjet_common();
};
/*----------- defined in machine/spisprit.c -----------*/
void seibuspi_sprite_decrypt(UINT8 *src, int romsize);
diff --git a/src/mame/includes/seicross.h b/src/mame/includes/seicross.h
index 808292db910..4e2975affc5 100644
--- a/src/mame/includes/seicross.h
+++ b/src/mame/includes/seicross.h
@@ -31,4 +31,5 @@ public:
virtual void palette_init();
UINT32 screen_update_seicross(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_irq);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/senjyo.h b/src/mame/includes/senjyo.h
index 6f6667100dc..4e521e638d3 100644
--- a/src/mame/includes/senjyo.h
+++ b/src/mame/includes/senjyo.h
@@ -84,6 +84,9 @@ public:
UINT32 screen_update_senjyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(senjyo_interrupt);
DECLARE_READ8_MEMBER(pio_pa_r);
+ void draw_bgbitmap(bitmap_ind16 &bitmap,const rectangle &cliprect);
+ void draw_radar(bitmap_ind16 &bitmap,const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int priority);
};
/*----------- defined in audio/senjyo.c -----------*/
diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h
index 275c41f60c9..2984567c89e 100644
--- a/src/mame/includes/seta.h
+++ b/src/mame/includes/seta.h
@@ -209,7 +209,12 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(setaroul_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(crazyfgt_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(inttoote_interrupt);
+ void seta_coin_lockout_w(int data);
+ inline void twineagl_tile_info( tile_data &tileinfo, int tile_index, int offset );
+ inline void get_tile_info( tile_data &tileinfo, int tile_index, int layer, int offset );
+ void set_pens();
+ void usclssic_set_pens();
+ void draw_tilemap_palette_effect(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen);
+ void seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int sprite_bank_size, int sprite_setac );
+ void uPD71054_timer_init( );
};
-
-/*----------- defined in video/seta.c -----------*/
-void seta_coin_lockout_w(running_machine &machine, int data);
diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h
index b6b94ddd912..964591c2e59 100644
--- a/src/mame/includes/seta2.h
+++ b/src/mame/includes/seta2.h
@@ -75,4 +75,6 @@ public:
INTERRUPT_GEN_MEMBER(samshoot_interrupt);
INTERRUPT_GEN_MEMBER(funcube_sub_timer_irq);
TIMER_DEVICE_CALLBACK_MEMBER(funcube_interrupt);
+ void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
+ void funcube_debug_outputs();
};
diff --git a/src/mame/includes/sf.h b/src/mame/includes/sf.h
index f44f8c4fb7a..bc0827787fb 100644
--- a/src/mame/includes/sf.h
+++ b/src/mame/includes/sf.h
@@ -48,4 +48,7 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_sf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ inline int sf_invert( int nb );
+ void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect );
+ void write_dword( address_space &space, offs_t offset, UINT32 data );
};
diff --git a/src/mame/includes/shadfrce.h b/src/mame/includes/shadfrce.h
index f4bf11a63bf..137320adbd4 100644
--- a/src/mame/includes/shadfrce.h
+++ b/src/mame/includes/shadfrce.h
@@ -45,4 +45,5 @@ public:
UINT32 screen_update_shadfrce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_shadfrce(screen_device &screen, bool state);
TIMER_DEVICE_CALLBACK_MEMBER(shadfrce_scanline);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/shangkid.h b/src/mame/includes/shangkid.h
index 629007c0161..4c0f42f7083 100644
--- a/src/mame/includes/shangkid.h
+++ b/src/mame/includes/shangkid.h
@@ -32,4 +32,8 @@ public:
DECLARE_MACHINE_RESET(shangkid);
UINT32 screen_update_shangkid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_dynamski(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprite(const UINT8 *source, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void shangkid_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void dynamski_draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri );
+ void dynamski_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/shaolins.h b/src/mame/includes/shaolins.h
index a7ac9daac58..54e5366566c 100644
--- a/src/mame/includes/shaolins.h
+++ b/src/mame/includes/shaolins.h
@@ -27,4 +27,5 @@ public:
virtual void palette_init();
UINT32 screen_update_shaolins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(shaolins_interrupt);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/shootout.h b/src/mame/includes/shootout.h
index 260fbb1e211..0232e3811be 100644
--- a/src/mame/includes/shootout.h
+++ b/src/mame/includes/shootout.h
@@ -27,4 +27,5 @@ public:
virtual void palette_init();
UINT32 screen_update_shootout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_shootouj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_bits );
};
diff --git a/src/mame/includes/sidearms.h b/src/mame/includes/sidearms.h
index f4f6b792b3b..7ed47cf64c4 100644
--- a/src/mame/includes/sidearms.h
+++ b/src/mame/includes/sidearms.h
@@ -53,4 +53,7 @@ public:
virtual void video_start();
UINT32 screen_update_sidearms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(irqhandler);
+ void draw_sprites_region(bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset, int end_offset );
+ void sidearms_draw_starfield( bitmap_ind16 &bitmap );
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/sidepckt.h b/src/mame/includes/sidepckt.h
index 6f500873032..6de3e71245c 100644
--- a/src/mame/includes/sidepckt.h
+++ b/src/mame/includes/sidepckt.h
@@ -29,4 +29,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_sidepckt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
};
diff --git a/src/mame/includes/silkroad.h b/src/mame/includes/silkroad.h
index 7d828a3bf28..427da4dc3c3 100644
--- a/src/mame/includes/silkroad.h
+++ b/src/mame/includes/silkroad.h
@@ -29,4 +29,5 @@ public:
TILE_GET_INFO_MEMBER(get_fg3_tile_info);
virtual void video_start();
UINT32 screen_update_silkroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/simpsons.h b/src/mame/includes/simpsons.h
index fbb2abda632..0dbc96a3e22 100644
--- a/src/mame/includes/simpsons.h
+++ b/src/mame/includes/simpsons.h
@@ -45,11 +45,12 @@ public:
TIMER_CALLBACK_MEMBER(dmaend_callback);
DECLARE_READ8_MEMBER(simpsons_sound_r);
void simpsons_postload();
+ void simpsons_video_banking( int bank );
+ void sound_nmi_callback( int param );
+ void simpsons_objdma( );
};
/*----------- defined in video/simpsons.c -----------*/
-void simpsons_video_banking( running_machine &machine, int select );
-
extern void simpsons_tile_callback(running_machine &machine, int layer,int bank,int *code,int *color,int *flags,int *priority);
extern void simpsons_sprite_callback(running_machine &machine, int *code,int *color,int *priority_mask);
diff --git a/src/mame/includes/skullxbo.h b/src/mame/includes/skullxbo.h
index 229f31153a0..887452c57ae 100644
--- a/src/mame/includes/skullxbo.h
+++ b/src/mame/includes/skullxbo.h
@@ -24,6 +24,7 @@ public:
DECLARE_VIDEO_START(skullxbo);
UINT32 screen_update_skullxbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(irq_gen);
+ void skullxbo_scanline_update(int scanline);
};
/*----------- defined in video/skullxbo.c -----------*/
diff --git a/src/mame/includes/skydiver.h b/src/mame/includes/skydiver.h
index a3d34145954..2374e559881 100644
--- a/src/mame/includes/skydiver.h
+++ b/src/mame/includes/skydiver.h
@@ -52,6 +52,7 @@ public:
virtual void palette_init();
UINT32 screen_update_skydiver(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(skydiver_interrupt);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
/*----------- defined in audio/skydiver.c -----------*/
diff --git a/src/mame/includes/skyfox.h b/src/mame/includes/skyfox.h
index 5c50bf75993..9ea72fe9782 100644
--- a/src/mame/includes/skyfox.h
+++ b/src/mame/includes/skyfox.h
@@ -33,4 +33,6 @@ public:
virtual void palette_init();
UINT32 screen_update_skyfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(skyfox_interrupt);
+ void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
+ void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/skykid.h b/src/mame/includes/skykid.h
index dcced65541f..2b7e7e21999 100644
--- a/src/mame/includes/skykid.h
+++ b/src/mame/includes/skykid.h
@@ -43,4 +43,5 @@ public:
UINT32 screen_update_skykid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(main_vblank_irq);
INTERRUPT_GEN_MEMBER(mcu_vblank_irq);
+ void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
};
diff --git a/src/mame/includes/skyraid.h b/src/mame/includes/skyraid.h
index 7266e184b3f..b726d362fad 100644
--- a/src/mame/includes/skyraid.h
+++ b/src/mame/includes/skyraid.h
@@ -28,6 +28,11 @@ public:
virtual void palette_init();
UINT32 screen_update_skyraid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE8_MEMBER(skyraid_sound_w);
+ void draw_text(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_terrain(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_missiles(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_trapezoid(bitmap_ind16& dst, bitmap_ind16& src);
};
/*----------- defined in audio/skyraid.c -----------*/
diff --git a/src/mame/includes/slapfght.h b/src/mame/includes/slapfght.h
index 2605c787e3e..c67a7e4b6a1 100644
--- a/src/mame/includes/slapfght.h
+++ b/src/mame/includes/slapfght.h
@@ -127,6 +127,9 @@ public:
UINT32 screen_update_slapfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_irq);
INTERRUPT_GEN_MEMBER(getstar_interrupt);
+ void slapfght_log_vram();
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_display );
+ void getstar_init( );
};
diff --git a/src/mame/includes/slapshot.h b/src/mame/includes/slapshot.h
index 3ea08a91225..9192d402cad 100644
--- a/src/mame/includes/slapshot.h
+++ b/src/mame/includes/slapshot.h
@@ -69,4 +69,7 @@ public:
INTERRUPT_GEN_MEMBER(slapshot_interrupt);
TIMER_CALLBACK_MEMBER(slapshot_interrupt6);
void reset_sound_region();
+ void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int *primasks, int y_offset );
+ void taito_handle_sprite_buffering( );
+ void taito_update_sprites_active_area( );
};
diff --git a/src/mame/includes/snk.h b/src/mame/includes/snk.h
index ff0dd3bb960..9a49e449e90 100644
--- a/src/mame/includes/snk.h
+++ b/src/mame/includes/snk.h
@@ -172,4 +172,9 @@ public:
TIMER_CALLBACK_MEMBER(sgladiat_sndirq_update_callback);
TIMER_CALLBACK_MEMBER(sndirq_update_callback);
DECLARE_WRITE_LINE_MEMBER(ymirq_callback_2);
+ void tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll);
+ int hardflags_check(int num);
+ int hardflags_check8(int num);
+ int turbofront_check(int small, int num);
+ int turbofront_check8(int small, int num);
};
diff --git a/src/mame/includes/snk6502.h b/src/mame/includes/snk6502.h
index 0ac0a734985..9650359f1f5 100644
--- a/src/mame/includes/snk6502.h
+++ b/src/mame/includes/snk6502.h
@@ -64,6 +64,7 @@ public:
INTERRUPT_GEN_MEMBER(satansat_interrupt);
INTERRUPT_GEN_MEMBER(snk6502_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(sasuke_update_counter);
+ void sasuke_start_counter();
};
diff --git a/src/mame/includes/snk68.h b/src/mame/includes/snk68.h
index aa4a3fe0ec9..da116eaa827 100644
--- a/src/mame/includes/snk68.h
+++ b/src/mame/includes/snk68.h
@@ -44,4 +44,6 @@ public:
virtual void video_start();
DECLARE_VIDEO_START(searchar);
UINT32 screen_update_pow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void common_video_start();
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int group);
};
diff --git a/src/mame/includes/snowbros.h b/src/mame/includes/snowbros.h
index 6bd61e13659..ddd15450df7 100644
--- a/src/mame/includes/snowbros.h
+++ b/src/mame/includes/snowbros.h
@@ -1,4 +1,5 @@
#include "emu.h"
+#include "sound/okim6295.h"
class snowbros_state : public driver_device
{
@@ -51,4 +52,6 @@ public:
void screen_eof_snowbros(screen_device &screen, bool state);
TIMER_DEVICE_CALLBACK_MEMBER(snowbros_irq);
TIMER_DEVICE_CALLBACK_MEMBER(snowbros3_irq);
+ void sb3_play_music(int data);
+ void sb3_play_sound (okim6295_device *oki, int data);
};
diff --git a/src/mame/includes/solomon.h b/src/mame/includes/solomon.h
index 5c5b11d33ec..7dbeb7e4dab 100644
--- a/src/mame/includes/solomon.h
+++ b/src/mame/includes/solomon.h
@@ -32,4 +32,5 @@ public:
virtual void video_start();
UINT32 screen_update_solomon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_irq);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/sonson.h b/src/mame/includes/sonson.h
index de485817537..9dc39344027 100644
--- a/src/mame/includes/sonson.h
+++ b/src/mame/includes/sonson.h
@@ -39,4 +39,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_sonson(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/spacefb.h b/src/mame/includes/spacefb.h
index b90b342c655..26c213d9eeb 100644
--- a/src/mame/includes/spacefb.h
+++ b/src/mame/includes/spacefb.h
@@ -51,6 +51,15 @@ public:
virtual void video_start();
UINT32 screen_update_spacefb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(interrupt_callback);
+ inline void shift_star_generator(spacefb_state *state);
+ void get_starfield_pens(spacefb_state *state, pen_t *pens);
+ void draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ void get_sprite_pens(pen_t *pens);
+ void draw_bullet(offs_t offs, pen_t pen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flip);
+ void draw_sprite(offs_t offs, pen_t *pens, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flip);
+ void draw_objects(bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ void create_interrupt_timer();
+ void start_interrupt_timer();
};
/*----------- defined in audio/spacefb.c -----------*/
diff --git a/src/mame/includes/spdodgeb.h b/src/mame/includes/spdodgeb.h
index 809a782a3d7..65917d36e6a 100644
--- a/src/mame/includes/spdodgeb.h
+++ b/src/mame/includes/spdodgeb.h
@@ -48,4 +48,6 @@ public:
virtual void palette_init();
UINT32 screen_update_spdodgeb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_interrupt);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
+ void mcu63705_update_inputs();
};
diff --git a/src/mame/includes/speedatk.h b/src/mame/includes/speedatk.h
index b2c3cf9eafe..eb16cfb83d0 100644
--- a/src/mame/includes/speedatk.h
+++ b/src/mame/includes/speedatk.h
@@ -27,4 +27,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_speedatk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ UINT8 iox_key_matrix_calc(UINT8 p_side);
};
diff --git a/src/mame/includes/speedbal.h b/src/mame/includes/speedbal.h
index 7f8e3d8d026..676204fd458 100644
--- a/src/mame/includes/speedbal.h
+++ b/src/mame/includes/speedbal.h
@@ -19,4 +19,5 @@ public:
TILE_GET_INFO_MEMBER(get_tile_info_fg);
virtual void video_start();
UINT32 screen_update_speedbal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/speedspn.h b/src/mame/includes/speedspn.h
index deaf34eb9e1..c43035f4226 100644
--- a/src/mame/includes/speedspn.h
+++ b/src/mame/includes/speedspn.h
@@ -22,4 +22,5 @@ public:
TILE_GET_INFO_MEMBER(get_speedspn_tile_info);
virtual void video_start();
UINT32 screen_update_speedspn(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/splash.h b/src/mame/includes/splash.h
index b3d35db4b25..bbabf3b3cc1 100644
--- a/src/mame/includes/splash.h
+++ b/src/mame/includes/splash.h
@@ -65,4 +65,8 @@ public:
UINT32 screen_update_splash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_funystrp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(roldfrog_interrupt);
+ void draw_bitmap(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void splash_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
+ void funystrp_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
+ void roldfrog_update_irq( );
};
diff --git a/src/mame/includes/sprcros2.h b/src/mame/includes/sprcros2.h
index efcd88008cf..d28f485eeed 100644
--- a/src/mame/includes/sprcros2.h
+++ b/src/mame/includes/sprcros2.h
@@ -33,4 +33,5 @@ public:
UINT32 screen_update_sprcros2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(sprcros2_s_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_m_interrupt);
+ void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
};
diff --git a/src/mame/includes/sprint2.h b/src/mame/includes/sprint2.h
index 59d0c2f04c5..fd31a23d7b9 100644
--- a/src/mame/includes/sprint2.h
+++ b/src/mame/includes/sprint2.h
@@ -67,6 +67,11 @@ public:
UINT32 screen_update_sprint2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_sprint2(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(sprint2);
+ UINT8 collision_check(colortable_t *colortable, rectangle& rect);
+ inline int get_sprite_code(UINT8 *video_ram, int n);
+ inline int get_sprite_x(UINT8 *video_ram, int n);
+ inline int get_sprite_y(UINT8 *video_ram, int n);
+ int service_mode();
};
/*----------- defined in audio/sprint2.c -----------*/
diff --git a/src/mame/includes/sprint8.h b/src/mame/includes/sprint8.h
index 32f56e5185b..9c7795ea2b7 100644
--- a/src/mame/includes/sprint8.h
+++ b/src/mame/includes/sprint8.h
@@ -45,6 +45,9 @@ public:
DECLARE_WRITE8_MEMBER(sprint8_screech_w);
DECLARE_WRITE8_MEMBER(sprint8_attract_w);
DECLARE_WRITE8_MEMBER(sprint8_motor_w);
+ void set_pens(sprint8_state *state, colortable_t *colortable);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void sprint8_set_collision(int n);
};
/*----------- defined in drivers/sprint8.c -----------*/
diff --git a/src/mame/includes/spy.h b/src/mame/includes/spy.h
index fe892dfd9bf..56a148dbf0d 100644
--- a/src/mame/includes/spy.h
+++ b/src/mame/includes/spy.h
@@ -46,6 +46,7 @@ public:
virtual void video_start();
UINT32 screen_update_spy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(spy_interrupt);
+ void spy_collision( );
};
/*----------- defined in video/spy.c -----------*/
diff --git a/src/mame/includes/srmp2.h b/src/mame/includes/srmp2.h
index b5a32eaae8b..9263df23a97 100644
--- a/src/mame/includes/srmp2.h
+++ b/src/mame/includes/srmp2.h
@@ -49,4 +49,5 @@ public:
UINT32 screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_mjyuugi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ UINT8 iox_key_matrix_calc(UINT8 p_side);
};
diff --git a/src/mame/includes/srumbler.h b/src/mame/includes/srumbler.h
index 790eb0ae6fc..0faf08e9dc5 100644
--- a/src/mame/includes/srumbler.h
+++ b/src/mame/includes/srumbler.h
@@ -29,4 +29,5 @@ public:
virtual void video_start();
UINT32 screen_update_srumbler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(srumbler_interrupt);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/sshangha.h b/src/mame/includes/sshangha.h
index 8382ebfe92c..29bf2626553 100644
--- a/src/mame/includes/sshangha.h
+++ b/src/mame/includes/sshangha.h
@@ -58,4 +58,5 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_sshangha(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ inline void sshangha_set_color_888(pen_t color, int rshift, int gshift, int bshift, UINT32 data);
};
diff --git a/src/mame/includes/sslam.h b/src/mame/includes/sslam.h
index 62ef04d04b3..586df1e0be9 100644
--- a/src/mame/includes/sslam.h
+++ b/src/mame/includes/sslam.h
@@ -53,4 +53,5 @@ public:
UINT32 screen_update_sslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_powerbls(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(music_playback);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/ssozumo.h b/src/mame/includes/ssozumo.h
index ddce6e12cb4..ad54fd9c974 100644
--- a/src/mame/includes/ssozumo.h
+++ b/src/mame/includes/ssozumo.h
@@ -37,4 +37,5 @@ public:
virtual void palette_init();
UINT32 screen_update_ssozumo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(sound_timer_irq);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/sspeedr.h b/src/mame/includes/sspeedr.h
index 5a864acd806..38e1152b221 100644
--- a/src/mame/includes/sspeedr.h
+++ b/src/mame/includes/sspeedr.h
@@ -37,4 +37,7 @@ public:
virtual void palette_init();
UINT32 screen_update_sspeedr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_sspeedr(screen_device &screen, bool state);
+ void draw_track(bitmap_ind16 &bitmap);
+ void draw_drones(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_driver(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/ssrj.h b/src/mame/includes/ssrj.h
index 5b2a50699bf..bb9f91df660 100644
--- a/src/mame/includes/ssrj.h
+++ b/src/mame/includes/ssrj.h
@@ -31,4 +31,5 @@ public:
virtual void palette_init();
UINT32 screen_update_ssrj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_ssrj(screen_device &screen, bool state);
+ void draw_objects(bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/ssv.h b/src/mame/includes/ssv.h
index 16926e8f43e..3cf3fd2d7b9 100644
--- a/src/mame/includes/ssv.h
+++ b/src/mame/includes/ssv.h
@@ -132,6 +132,13 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(gdfs_interrupt);
void update_irq_state();
IRQ_CALLBACK_MEMBER(ssv_irq_callback);
+ void draw_row(bitmap_ind16 &bitmap, const rectangle &cliprect, int sx, int sy, int scroll);
+ void draw_layer(bitmap_ind16 &bitmap, const rectangle &cliprect, int nr);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void ssv_enable_video(int enable);
+ void init_ssv(int interrupt_ultrax);
+ void init_hypreac2_common();
+ void init_st010();
};
/*----------- defined in video/ssv.c -----------*/
diff --git a/src/mame/includes/st0016.h b/src/mame/includes/st0016.h
index d2c448f0195..55f9f4cc5e4 100644
--- a/src/mame/includes/st0016.h
+++ b/src/mame/includes/st0016.h
@@ -40,6 +40,9 @@ public:
void st0016_draw_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_st0016(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(st0016_int);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void st0016_save_init();
+ void draw_bgmap(bitmap_ind16 &bitmap,const rectangle &cliprect, int priority);
};
#define ISMACS (st0016_game&0x80)
diff --git a/src/mame/includes/stactics.h b/src/mame/includes/stactics.h
index 6b521ed866c..0dbc10789d5 100644
--- a/src/mame/includes/stactics.h
+++ b/src/mame/includes/stactics.h
@@ -61,6 +61,12 @@ public:
DECLARE_PALETTE_INIT(stactics);
UINT32 screen_update_stactics(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(stactics_interrupt);
+ void update_beam();
+ inline int get_pixel_on_plane(UINT8 *videoram, UINT8 y, UINT8 x, UINT8 y_scroll);
+ void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void set_indicator_leds(int data, const char *output_name, int base_index);
+ void update_artwork();
+ void move_motor();
};
/*----------- defined in video/stactics.c -----------*/
MACHINE_CONFIG_EXTERN( stactics_video );
diff --git a/src/mame/includes/starcrus.h b/src/mame/includes/starcrus.h
index 6e3b52f74dc..dd9954c6614 100644
--- a/src/mame/includes/starcrus.h
+++ b/src/mame/includes/starcrus.h
@@ -51,4 +51,8 @@ public:
DECLARE_READ8_MEMBER(starcrus_coll_det_r);
virtual void video_start();
UINT32 screen_update_starcrus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ int collision_check_s1s2();
+ int collision_check_p1p2();
+ int collision_check_s1p1p2();
+ int collision_check_s2p1p2();
};
diff --git a/src/mame/includes/starfire.h b/src/mame/includes/starfire.h
index fc821149e6c..9c30769f66e 100644
--- a/src/mame/includes/starfire.h
+++ b/src/mame/includes/starfire.h
@@ -62,4 +62,5 @@ public:
UINT32 screen_update_starfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(starfire_scanline_callback);
INTERRUPT_GEN_MEMBER(vblank_int);
+ void get_pens(pen_t *pens);
};
diff --git a/src/mame/includes/starshp1.h b/src/mame/includes/starshp1.h
index d860f6bda18..80799d4b9c7 100644
--- a/src/mame/includes/starshp1.h
+++ b/src/mame/includes/starshp1.h
@@ -81,6 +81,21 @@ public:
UINT32 screen_update_starshp1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_starshp1(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(starshp1_interrupt);
+ void set_pens(colortable_t *colortable);
+ void draw_starfield(bitmap_ind16 &bitmap);
+ int get_sprite_hpos(int i);
+ int get_sprite_vpos(int i);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_spaceship(bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_phasor(bitmap_ind16 &bitmap);
+ int get_radius();
+ int get_circle_hpos();
+ int get_circle_vpos();
+ void draw_circle_line(bitmap_ind16 &bitmap, int x, int y, int l);
+ void draw_circle(bitmap_ind16 &bitmap);
+ int spaceship_collision(bitmap_ind16 &bitmap, const rectangle &rect);
+ int point_in_circle(int x, int y, int center_x, int center_y, int r);
+ int circle_collision(const rectangle &rect);
};
/*----------- defined in audio/starshp1.c -----------*/
diff --git a/src/mame/includes/starwars.h b/src/mame/includes/starwars.h
index 44e5b15dbb0..637e8350c06 100644
--- a/src/mame/includes/starwars.h
+++ b/src/mame/includes/starwars.h
@@ -67,6 +67,10 @@ public:
DECLARE_READ8_MEMBER(r6532_porta_r);
DECLARE_WRITE8_MEMBER(r6532_porta_w);
DECLARE_WRITE_LINE_MEMBER(snd_interrupt);
+ void starwars_mproc_init();
+ void starwars_mproc_reset();
+ void run_mproc();
+ void esb_slapstic_tweak(address_space &space, offs_t offset);
};
diff --git a/src/mame/includes/stfight.h b/src/mame/includes/stfight.h
index 92d4ff5815c..bbfbbe8c511 100644
--- a/src/mame/includes/stfight.h
+++ b/src/mame/includes/stfight.h
@@ -49,6 +49,8 @@ public:
INTERRUPT_GEN_MEMBER(stfight_vb_interrupt);
TIMER_CALLBACK_MEMBER(stfight_interrupt_1);
DECLARE_WRITE8_MEMBER(stfight_adpcm_control_w);
+ void set_pens();
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
/*----------- defined in machine/stfight.c -----------*/
diff --git a/src/mame/includes/stlforce.h b/src/mame/includes/stlforce.h
index 80fd0914bb8..5c1cccf9f14 100644
--- a/src/mame/includes/stlforce.h
+++ b/src/mame/includes/stlforce.h
@@ -44,4 +44,5 @@ public:
TILE_GET_INFO_MEMBER(get_stlforce_tx_tile_info);
virtual void video_start();
UINT32 screen_update_stlforce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
};
diff --git a/src/mame/includes/strnskil.h b/src/mame/includes/strnskil.h
index 21ddf3ff366..3d1b515fc0e 100644
--- a/src/mame/includes/strnskil.h
+++ b/src/mame/includes/strnskil.h
@@ -32,4 +32,5 @@ public:
virtual void palette_init();
UINT32 screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(strnskil_irq);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/subs.h b/src/mame/includes/subs.h
index f819863d438..0c2bec28a89 100644
--- a/src/mame/includes/subs.h
+++ b/src/mame/includes/subs.h
@@ -52,6 +52,8 @@ public:
DECLARE_WRITE8_MEMBER(subs_crash_w);
DECLARE_WRITE8_MEMBER(subs_explode_w);
DECLARE_WRITE8_MEMBER(subs_noise_reset_w);
+ int subs_steering_1();
+ int subs_steering_2();
};
/*----------- defined in audio/subs.c -----------*/
diff --git a/src/mame/includes/suna16.h b/src/mame/includes/suna16.h
index 24b3f9e8ac8..cb540ee191e 100644
--- a/src/mame/includes/suna16.h
+++ b/src/mame/includes/suna16.h
@@ -42,4 +42,5 @@ public:
UINT32 screen_update_suna16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_bestbest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(bssoccer_interrupt);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *sprites, int gfx);
};
diff --git a/src/mame/includes/suna8.h b/src/mame/includes/suna8.h
index de21770c038..f7689a6a71d 100644
--- a/src/mame/includes/suna8.h
+++ b/src/mame/includes/suna8.h
@@ -137,6 +137,9 @@ public:
DECLARE_WRITE8_MEMBER(rranger_play_samples_w);
DECLARE_WRITE8_MEMBER(suna8_samples_number_w);
void play_sample(int index);
+ void draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int which);
+ void draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
+ UINT8 *brickzn_decrypt();
};
/*----------- defined in audio/suna8.c -----------*/
diff --git a/src/mame/includes/superchs.h b/src/mame/includes/superchs.h
index 1a97bf5043b..97d66e19d85 100644
--- a/src/mame/includes/superchs.h
+++ b/src/mame/includes/superchs.h
@@ -39,4 +39,5 @@ public:
DECLARE_DRIVER_INIT(superchs);
virtual void video_start();
UINT32 screen_update_superchs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs);
};
diff --git a/src/mame/includes/superqix.h b/src/mame/includes/superqix.h
index c44a1489c75..2e6f35209af 100644
--- a/src/mame/includes/superqix.h
+++ b/src/mame/includes/superqix.h
@@ -83,4 +83,8 @@ public:
TIMER_CALLBACK_MEMBER(mcu_acknowledge_callback);
TIMER_CALLBACK_MEMBER(delayed_z80_mcu_w);
TIMER_CALLBACK_MEMBER(delayed_mcu_z80_w);
+ void pbillian_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
+ void superqix_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
+ int read_dial(int player);
+ void machine_init_common();
};
diff --git a/src/mame/includes/suprloco.h b/src/mame/includes/suprloco.h
index 980997b23d4..3dd83504018 100644
--- a/src/mame/includes/suprloco.h
+++ b/src/mame/includes/suprloco.h
@@ -23,4 +23,7 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_suprloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ inline void draw_pixel(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip);
+ void draw_sprite(bitmap_ind16 &bitmap,const rectangle &cliprect,int spr_number);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/suprnova.h b/src/mame/includes/suprnova.h
index 3a9ac1b74d5..a0f4386a7b4 100644
--- a/src/mame/includes/suprnova.h
+++ b/src/mame/includes/suprnova.h
@@ -138,12 +138,13 @@ public:
void screen_eof_skns(screen_device &screen, bool state);
TIMER_DEVICE_CALLBACK_MEMBER(interrupt_callback);
TIMER_DEVICE_CALLBACK_MEMBER(skns_irq);
+ void suprnova_draw_roz(bitmap_ind16 &bitmap, bitmap_ind8& bitmapflags, const rectangle &cliprect, tilemap_t *tmap, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound, int columnscroll, UINT32* scrollram);
+ void palette_set_rgb_brightness (int offset, UINT8 brightness_r, UINT8 brightness_g, UINT8 brightness_b);
+ void palette_update();
+ void supernova_draw_a( bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const rectangle &cliprect, int tran );
+ void supernova_draw_b( bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const rectangle &cliprect, int tran );
+ void hit_recalc();
+ void init_skns();
+ void set_drc_pcflush(UINT32 addr);
};
-/*----------- defined in video/suprnova.c -----------*/
-void skns_sprite_kludge(int x, int y);
-void skns_draw_sprites(
- running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect,
- UINT32* spriteram_source, size_t spriteram_size,
- UINT8* gfx_source, size_t gfx_length,
- UINT32* sprite_regs );
diff --git a/src/mame/includes/suprridr.h b/src/mame/includes/suprridr.h
index 23703820e80..e65b979267e 100644
--- a/src/mame/includes/suprridr.h
+++ b/src/mame/includes/suprridr.h
@@ -43,6 +43,7 @@ public:
UINT32 screen_update_suprridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(main_nmi_gen);
TIMER_CALLBACK_MEMBER(delayed_sound_w);
+ int suprridr_is_screen_flipped();
};
/*----------- defined in video/suprridr.c -----------*/
diff --git a/src/mame/includes/system1.h b/src/mame/includes/system1.h
index 5c2ab2018e9..3950dc280b4 100644
--- a/src/mame/includes/system1.h
+++ b/src/mame/includes/system1.h
@@ -18,7 +18,7 @@ public:
optional_shared_ptr<UINT8> m_nob_mcu_status;
UINT8 *m_videoram;
- void (*m_videomode_custom)(running_machine &machine, UINT8 data, UINT8 prevdata);
+ void (system1_state::*m_videomode_custom)(UINT8 data, UINT8 prevdata);
UINT8 m_mute_xor;
UINT8 m_dakkochn_mux_data;
UINT8 m_videomode_prev;
@@ -113,4 +113,11 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(soundirq_gen);
TIMER_DEVICE_CALLBACK_MEMBER(mcu_t0_callback);
DECLARE_WRITE8_MEMBER(system1_videoram_bank_w);
+ void video_start_common(int pagecount);
+ inline void videoram_wait_states(cpu_device *cpu);
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset);
+ void video_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &fgpixmap, bitmap_ind16 **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs);
+ void bank44_custom_w(UINT8 data, UINT8 prevdata);
+ void bank0c_custom_w(UINT8 data, UINT8 prevdata);
+ void dakkochn_custom_w(UINT8 data, UINT8 prevdata);
};
diff --git a/src/mame/includes/system16.h b/src/mame/includes/system16.h
index fabffa8e317..b1912762a02 100644
--- a/src/mame/includes/system16.h
+++ b/src/mame/includes/system16.h
@@ -194,4 +194,10 @@ public:
UINT32 screen_update_s16a_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_s16a_bootleg_passht4b(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(sys16_interrupt);
+ void setup_system16_bootleg_spritebanking( );
+ void update_page( );
+ void set_tile_bank( int data );
+ void set_fg_page( int data );
+ void set_bg_page( int data );
+ void datsu_set_pages( );
};
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index c87d89e62fa..a5a6f2eefcc 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -101,21 +101,20 @@ READ8_HANDLER( triplep_pap_r )
-static void cavelon_banksw(running_machine &machine)
+void scramble_state::cavelon_banksw()
{
- scramble_state *state = machine.driver_data<scramble_state>();
/* any read/write access in the 0x8000-0xffff region causes a bank switch.
Only the lower 0x2000 is switched but we switch the whole region
to keep the CPU core happy at the boundaries */
- state->m_cavelon_bank = !state->m_cavelon_bank;
- state->membank("bank1")->set_entry(state->m_cavelon_bank);
+ m_cavelon_bank = !m_cavelon_bank;
+ membank("bank1")->set_entry(m_cavelon_bank);
}
static READ8_HANDLER( cavelon_banksw_r )
{
scramble_state *state = space.machine().driver_data<scramble_state>();
- cavelon_banksw(space.machine());
+ state->cavelon_banksw();
if ((offset >= 0x0100) && (offset <= 0x0103))
return state->m_ppi8255_0->read(space, offset - 0x0100);
@@ -128,7 +127,7 @@ static READ8_HANDLER( cavelon_banksw_r )
static WRITE8_HANDLER( cavelon_banksw_w )
{
scramble_state *state = space.machine().driver_data<scramble_state>();
- cavelon_banksw(space.machine());
+ state->cavelon_banksw();
if ((offset >= 0x0100) && (offset <= 0x0103))
state->m_ppi8255_0->write(space, offset - 0x0100, data);
@@ -277,7 +276,7 @@ DRIVER_INIT_MEMBER(scramble_state,cavelon)
/* banked ROM */
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x0000, 0x3fff, "bank1");
membank("bank1")->configure_entries(0, 2, &ROM[0x00000], 0x10000);
- cavelon_banksw(machine());
+ cavelon_banksw();
/* A15 switches memory banks */
machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x8000, 0xffff, FUNC(cavelon_banksw_r), FUNC(cavelon_banksw_w));
@@ -341,7 +340,7 @@ DRIVER_INIT_MEMBER(scramble_state,mimonscr)
}
-INLINE int bit(int i,int n)
+inline int scramble_state::bit(int i,int n)
{
return ((i >> n) & 1);
}
diff --git a/src/mame/machine/segas32.c b/src/mame/machine/segas32.c
index 354ccffe172..0ff70d2c8c6 100644
--- a/src/mame/machine/segas32.c
+++ b/src/mame/machine/segas32.c
@@ -33,11 +33,11 @@ const UINT8 ga2_v25_opcode_table[256] = {
#undef xxxx
-void decrypt_ga2_protrom(running_machine &machine)
+void segas32_state::decrypt_ga2_protrom()
{
int i;
- UINT8 *rom = machine.root_device().memregion("mcu")->base();
- UINT8* temp = auto_alloc_array(machine, UINT8, 0x100000);
+ UINT8 *rom = machine().root_device().memregion("mcu")->base();
+ UINT8* temp = auto_alloc_array(machine(), UINT8, 0x100000);
// make copy of ROM so original can be overwritten
memcpy(temp, rom, 0x10000);
@@ -46,7 +46,7 @@ void decrypt_ga2_protrom(running_machine &machine)
for(i = 0; i < 0x10000; i++)
rom[i] = temp[BITSWAP16(i, 14, 11, 15, 12, 13, 4, 3, 7, 5, 10, 2, 8, 9, 6, 1, 0)];
- auto_free(machine, temp);
+ auto_free(machine(), temp);
}
WRITE16_MEMBER(segas32_state::ga2_dpram_w)
diff --git a/src/mame/machine/simpsons.c b/src/mame/machine/simpsons.c
index 6e132cac290..6f455e988c3 100644
--- a/src/mame/machine/simpsons.c
+++ b/src/mame/machine/simpsons.c
@@ -19,7 +19,7 @@ WRITE8_MEMBER(simpsons_state::simpsons_eeprom_w)
ioport("EEPROMOUT")->write(data, 0xff);
m_video_bank = data & 0x03;
- simpsons_video_banking(machine(), m_video_bank);
+ simpsons_video_banking(m_video_bank);
m_firq_enabled = data & 0x04;
}
@@ -68,7 +68,7 @@ static KONAMI_SETLINES_CALLBACK( simpsons_banking )
void simpsons_state::simpsons_postload()
{
- simpsons_video_banking(machine(), m_video_bank);
+ simpsons_video_banking(m_video_bank);
}
void simpsons_state::machine_start()
@@ -118,5 +118,5 @@ void simpsons_state::machine_reset()
membank("bank2")->configure_entries(2, 6, machine().root_device().memregion("audiocpu")->base() + 0x10000, 0x4000);
membank("bank2")->set_entry(0);
- simpsons_video_banking(machine(), 0);
+ simpsons_video_banking(0);
}
diff --git a/src/mame/machine/starwars.c b/src/mame/machine/starwars.c
index 410a20c07a4..e46bc621f9c 100644
--- a/src/mame/machine/starwars.c
+++ b/src/mame/machine/starwars.c
@@ -149,15 +149,14 @@ WRITE8_MEMBER(starwars_state::starwars_adc_select_w)
*
*************************************/
-void starwars_mproc_init(running_machine &machine)
+void starwars_state::starwars_mproc_init()
{
- starwars_state *state = machine.driver_data<starwars_state>();
- UINT8 *src = state->memregion("user2")->base();
+ UINT8 *src = memregion("user2")->base();
int cnt, val;
- state->m_PROM_STR = auto_alloc_array(machine, UINT8, 1024);
- state->m_PROM_MAS = auto_alloc_array(machine, UINT8, 1024);
- state->m_PROM_AM = auto_alloc_array(machine, UINT8, 1024);
+ m_PROM_STR = auto_alloc_array(machine(), UINT8, 1024);
+ m_PROM_MAS = auto_alloc_array(machine(), UINT8, 1024);
+ m_PROM_AM = auto_alloc_array(machine(), UINT8, 1024);
for (cnt = 0; cnt < 1024; cnt++)
{
@@ -168,12 +167,12 @@ void starwars_mproc_init(running_machine &machine)
val |= (src[0x0000 + cnt] << 12) & 0xf000; /* Set MS nibble */
/* perform pre-decoding */
- state->m_PROM_STR[cnt] = (val >> 8) & 0x00ff;
- state->m_PROM_MAS[cnt] = val & 0x007f;
- state->m_PROM_AM[cnt] = (val >> 7) & 0x0001;
+ m_PROM_STR[cnt] = (val >> 8) & 0x00ff;
+ m_PROM_MAS[cnt] = val & 0x007f;
+ m_PROM_AM[cnt] = (val >> 7) & 0x0001;
}
- state->m_math_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(starwars_state::math_run_clear),state));
+ m_math_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(starwars_state::math_run_clear),this));
}
@@ -184,11 +183,10 @@ void starwars_mproc_init(running_machine &machine)
*
*************************************/
-void starwars_mproc_reset(running_machine &machine)
+void starwars_state::starwars_mproc_reset()
{
- starwars_state *state = machine.driver_data<starwars_state>();
- state->m_MPA = state->m_BIC = 0;
- state->m_math_run = 0;
+ m_MPA = m_BIC = 0;
+ m_math_run = 0;
}
@@ -199,9 +197,8 @@ void starwars_mproc_reset(running_machine &machine)
*
*************************************/
-static void run_mproc(running_machine &machine)
+void starwars_state::run_mproc()
{
- starwars_state *state = machine.driver_data<starwars_state>();
int RAMWORD = 0;
int MA_byte;
@@ -214,7 +211,7 @@ static void run_mproc(running_machine &machine)
logerror("Running Matrix Processor...\n");
mptime = 0;
- state->m_math_run = 1;
+ m_math_run = 1;
/* loop until finished */
while (M_STOP > 0)
@@ -223,18 +220,18 @@ static void run_mproc(running_machine &machine)
mptime += 5;
/* fetch the current instruction data */
- IP15_8 = state->m_PROM_STR[state->m_MPA];
- IP7 = state->m_PROM_AM[state->m_MPA];
- IP6_0 = state->m_PROM_MAS[state->m_MPA];
+ IP15_8 = m_PROM_STR[m_MPA];
+ IP7 = m_PROM_AM[m_MPA];
+ IP6_0 = m_PROM_MAS[m_MPA];
#if (MATHDEBUG)
- mame_printf_debug("\n(MPA:%x), Strobe: %x, IP7: %d, IP6_0:%x\n",state->m_MPA, IP15_8, IP7, IP6_0);
- mame_printf_debug("(BIC: %x), A: %x, B: %x, C: %x, ACC: %x\n",state->m_BIC,state->m_A,state->m_B,state->m_C,state->m_ACC);
+ mame_printf_debug("\n(MPA:%x), Strobe: %x, IP7: %d, IP6_0:%x\n",m_MPA, IP15_8, IP7, IP6_0);
+ mame_printf_debug("(BIC: %x), A: %x, B: %x, C: %x, ACC: %x\n",m_BIC,m_A,m_B,m_C,m_ACC);
#endif
/* construct the current RAM address */
if (IP7 == 0)
- MA = (IP6_0 & 3) | ((state->m_BIC & 0x01ff) << 2); /* MA10-2 set to BIC8-0 */
+ MA = (IP6_0 & 3) | ((m_BIC & 0x01ff) << 2); /* MA10-2 set to BIC8-0 */
else
MA = IP6_0;
@@ -242,7 +239,7 @@ static void run_mproc(running_machine &machine)
and apply base address offset */
MA_byte = MA << 1;
- RAMWORD = (state->m_mathram[MA_byte + 1] & 0x00ff) | ((state->m_mathram[MA_byte] & 0x00ff) << 8);
+ RAMWORD = (m_mathram[MA_byte + 1] & 0x00ff) | ((m_mathram[MA_byte] & 0x00ff) << 8);
// logerror("MATH ADDR: %x, CPU ADDR: %x, RAMWORD: %x\n", MA, MA_byte, RAMWORD);
@@ -264,18 +261,18 @@ static void run_mproc(running_machine &machine)
/* 0x10 - CLEAR_ACC */
if (IP15_8 & CLEAR_ACC)
{
- state->m_ACC = 0;
+ m_ACC = 0;
}
/* 0x01 - LAC (also clears lsb)*/
if (IP15_8 & LAC)
- state->m_ACC = (RAMWORD << 16);
+ m_ACC = (RAMWORD << 16);
/* 0x02 - READ_ACC */
if (IP15_8 & READ_ACC)
{
- state->m_mathram[MA_byte+1] = ((state->m_ACC >> 16) & 0xff);
- state->m_mathram[MA_byte ] = ((state->m_ACC >> 24) & 0xff);
+ m_mathram[MA_byte+1] = ((m_ACC >> 16) & 0xff);
+ m_mathram[MA_byte ] = ((m_ACC >> 24) & 0xff);
}
/* 0x04 - M_HALT */
@@ -284,12 +281,12 @@ static void run_mproc(running_machine &machine)
/* 0x08 - INC_BIC */
if (IP15_8 & INC_BIC)
- state->m_BIC = (state->m_BIC + 1) & 0x1ff; /* Restrict to 9 bits */
+ m_BIC = (m_BIC + 1) & 0x1ff; /* Restrict to 9 bits */
/* 0x20 - LDC*/
if (IP15_8 & LDC)
{
- state->m_C = RAMWORD;
+ m_C = RAMWORD;
/* This is a serial subtractor - multiplier (74ls384) -
* accumulator. For the full calculation 33 GMCLK pulses
@@ -320,13 +317,13 @@ static void run_mproc(running_machine &machine)
* takes 33 clock pulses to do a full rotation.
*/
- state->m_ACC += (((INT32)(state->m_A - state->m_B) << 1) * state->m_C) << 1;
+ m_ACC += (((INT32)(m_A - m_B) << 1) * m_C) << 1;
/* A and B are sign extended (requred by the ls384). After
* multiplication they just contain the sign.
*/
- state->m_A = (state->m_A & 0x8000)? 0xffff: 0;
- state->m_B = (state->m_B & 0x8000)? 0xffff: 0;
+ m_A = (m_A & 0x8000)? 0xffff: 0;
+ m_B = (m_B & 0x8000)? 0xffff: 0;
/* The multiply-add holds the main matrix processor counter
* for 33 cycles
@@ -336,11 +333,11 @@ static void run_mproc(running_machine &machine)
/* 0x40 - LDB */
if (IP15_8 & LDB)
- state->m_B = RAMWORD;
+ m_B = RAMWORD;
/* 0x80 - LDA */
if (IP15_8 & LDA)
- state->m_A = RAMWORD;
+ m_A = RAMWORD;
/*
* Now update the PROM address counter
@@ -348,13 +345,13 @@ static void run_mproc(running_machine &machine)
* This means that each of the four pages should wrap around rather than
* leaking from one to another. It may not matter, but I've put it in anyway
*/
- tmp = state->m_MPA + 1;
- state->m_MPA = (state->m_MPA & 0x0300) | (tmp & 0x00ff); /* New MPA value */
+ tmp = m_MPA + 1;
+ m_MPA = (m_MPA & 0x0300) | (tmp & 0x00ff); /* New MPA value */
M_STOP--; /* Decrease count */
}
- state->m_math_timer->adjust(attotime::from_hz(MASTER_CLOCK) * mptime, 1);
+ m_math_timer->adjust(attotime::from_hz(MASTER_CLOCK) * mptime, 1);
}
@@ -412,7 +409,7 @@ WRITE8_MEMBER(starwars_state::starwars_math_w)
{
case 0: /* mw0 */
m_MPA = data << 2; /* Set starting PROM address */
- run_mproc(machine()); /* and run the Matrix Processor */
+ run_mproc(); /* and run the Matrix Processor */
break;
case 1: /* mw1 */
diff --git a/src/mame/machine/subs.c b/src/mame/machine/subs.c
index c975ca0c1b6..4b17c06b44c 100644
--- a/src/mame/machine/subs.c
+++ b/src/mame/machine/subs.c
@@ -36,62 +36,60 @@ When D7 is high, the steering wheel has moved.
If D6 is high, it moved left. If D6 is low, it moved right.
Be sure to keep returning a direction until steer_reset is called.
***************************************************************************/
-static int subs_steering_1(running_machine &machine)
+int subs_state::subs_steering_1()
{
- subs_state *state = machine.driver_data<subs_state>();
int this_val;
int delta;
- this_val=state->ioport("DIAL2")->read();
+ this_val=ioport("DIAL2")->read();
- delta=this_val-state->m_last_val_1;
- state->m_last_val_1=this_val;
+ delta=this_val-m_last_val_1;
+ m_last_val_1=this_val;
if (delta>128) delta-=256;
else if (delta<-128) delta+=256;
/* Divide by four to make our steering less sensitive */
- state->m_steering_buf1+=(delta/4);
+ m_steering_buf1+=(delta/4);
- if (state->m_steering_buf1>0)
+ if (m_steering_buf1>0)
{
- state->m_steering_buf1--;
- state->m_steering_val1=0xC0;
+ m_steering_buf1--;
+ m_steering_val1=0xC0;
}
- else if (state->m_steering_buf1<0)
+ else if (m_steering_buf1<0)
{
- state->m_steering_buf1++;
- state->m_steering_val1=0x80;
+ m_steering_buf1++;
+ m_steering_val1=0x80;
}
- return state->m_steering_val1;
+ return m_steering_val1;
}
-static int subs_steering_2(running_machine &machine)
+int subs_state::subs_steering_2()
{
- subs_state *state = machine.driver_data<subs_state>();
int this_val;
int delta;
- this_val=state->ioport("DIAL1")->read();
+ this_val=ioport("DIAL1")->read();
- delta=this_val-state->m_last_val_2;
- state->m_last_val_2=this_val;
+ delta=this_val-m_last_val_2;
+ m_last_val_2=this_val;
if (delta>128) delta-=256;
else if (delta<-128) delta+=256;
/* Divide by four to make our steering less sensitive */
- state->m_steering_buf2+=(delta/4);
+ m_steering_buf2+=(delta/4);
- if (state->m_steering_buf2>0)
+ if (m_steering_buf2>0)
{
- state->m_steering_buf2--;
- state->m_steering_val2=0xC0;
+ m_steering_buf2--;
+ m_steering_val2=0xC0;
}
- else if (state->m_steering_buf2<0)
+ else if (m_steering_buf2<0)
{
- state->m_steering_buf2++;
- state->m_steering_val2=0x80;
+ m_steering_buf2++;
+ m_steering_val2=0x80;
}
- return state->m_steering_val2;
+ return m_steering_val2;
}
/***************************************************************************
@@ -116,10 +114,10 @@ READ8_MEMBER(subs_state::subs_control_r)
case 0x01: return ((inport & 0x02) << 6); /* diag hold */
case 0x02: return ((inport & 0x04) << 5); /* slam */
case 0x03: return ((inport & 0x08) << 4); /* spare */
- case 0x04: return ((subs_steering_1(machine()) & 0x40) << 1); /* steer dir 1 */
- case 0x05: return ((subs_steering_1(machine()) & 0x80) << 0); /* steer flag 1 */
- case 0x06: return ((subs_steering_2(machine()) & 0x40) << 1); /* steer dir 2 */
- case 0x07: return ((subs_steering_2(machine()) & 0x80) << 0); /* steer flag 2 */
+ case 0x04: return ((subs_steering_1() & 0x40) << 1); /* steer dir 1 */
+ case 0x05: return ((subs_steering_1() & 0x80) << 0); /* steer flag 1 */
+ case 0x06: return ((subs_steering_2() & 0x40) << 1); /* steer dir 2 */
+ case 0x07: return ((subs_steering_2() & 0x80) << 0); /* steer flag 2 */
}
return 0;
diff --git a/src/mame/video/sauro.c b/src/mame/video/sauro.c
index 22a3f00dafa..ef02c8acabf 100644
--- a/src/mame/video/sauro.c
+++ b/src/mame/video/sauro.c
@@ -89,14 +89,13 @@ VIDEO_START_MEMBER(sauro_state,sauro)
m_palette_bank = 0;
}
-static void sauro_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void sauro_state::sauro_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- sauro_state *state = machine.driver_data<sauro_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs,code,sx,sy,color,flipx;
- int flipy = state->flip_screen();
+ int flipy = flip_screen();
- for (offs = 3; offs < state->m_spriteram.bytes() - 1; offs += 4)
+ for (offs = 3; offs < m_spriteram.bytes() - 1; offs += 4)
{
sy = spriteram[offs];
if (sy == 0xf8) continue;
@@ -104,7 +103,7 @@ static void sauro_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, c
code = spriteram[offs+1] + ((spriteram[offs+3] & 0x03) << 8);
sx = spriteram[offs+2];
sy = 236 - sy;
- color = ((spriteram[offs+3] >> 4) & 0x0f) | state->m_palette_bank;
+ color = ((spriteram[offs+3] >> 4) & 0x0f) | m_palette_bank;
// I'm not really sure how this bit works
if (spriteram[offs+3] & 0x08)
@@ -129,7 +128,7 @@ static void sauro_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, c
sy = 240 - sy;
}
- drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
+ drawgfx_transpen(bitmap, cliprect, machine().gfx[2],
code,
color,
flipx, flipy,
@@ -141,7 +140,7 @@ UINT32 sauro_state::screen_update_sauro(screen_device &screen, bitmap_ind16 &bit
{
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
- sauro_draw_sprites(machine(), bitmap, cliprect);
+ sauro_draw_sprites(bitmap, cliprect);
return 0;
}
@@ -153,15 +152,14 @@ VIDEO_START_MEMBER(sauro_state,trckydoc)
8, 8, 32, 32);
}
-static void trckydoc_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void sauro_state::trckydoc_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- sauro_state *state = machine.driver_data<sauro_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs,code,sy,color,flipx,sx;
- int flipy = state->flip_screen();
+ int flipy = flip_screen();
/* Weird, sprites entries don't start on DWORD boundary */
- for (offs = 3; offs < state->m_spriteram.bytes() - 1; offs += 4)
+ for (offs = 3; offs < m_spriteram.bytes() - 1; offs += 4)
{
sy = spriteram[offs];
@@ -201,7 +199,7 @@ static void trckydoc_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap
sy = 240 - sy;
}
- drawgfx_transpen(bitmap, cliprect,machine.gfx[1],
+ drawgfx_transpen(bitmap, cliprect,machine().gfx[1],
code,
color,
flipx, flipy,
@@ -212,6 +210,6 @@ static void trckydoc_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap
UINT32 sauro_state::screen_update_trckydoc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
- trckydoc_draw_sprites(machine(), bitmap, cliprect);
+ trckydoc_draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/sbasketb.c b/src/mame/video/sbasketb.c
index 99a35dca304..9b372743961 100644
--- a/src/mame/video/sbasketb.c
+++ b/src/mame/video/sbasketb.c
@@ -131,11 +131,10 @@ void sbasketb_state::video_start()
m_bg_tilemap->set_scroll_cols(32);
}
-static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void sbasketb_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- sbasketb_state *state = machine.driver_data<sbasketb_state>();
- UINT8 *spriteram = state->m_spriteram;
- int offs = (*state->m_spriteram_select & 0x01) * 0x100;
+ UINT8 *spriteram = m_spriteram;
+ int offs = (*m_spriteram_select & 0x01) * 0x100;
int i;
for (i = 0; i < 64; i++, offs += 4)
@@ -146,11 +145,11 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
if (sx || sy)
{
int code = spriteram[offs + 0] | ((spriteram[offs + 1] & 0x20) << 3);
- int color = (spriteram[offs + 1] & 0x0f) + 16 * *state->m_palettebank;
+ int color = (spriteram[offs + 1] & 0x0f) + 16 * *m_palettebank;
int flipx = spriteram[offs + 1] & 0x40;
int flipy = spriteram[offs + 1] & 0x80;
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
@@ -159,7 +158,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
}
drawgfx_transpen(bitmap,cliprect,
- machine.gfx[1],
+ machine().gfx[1],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -175,6 +174,6 @@ UINT32 sbasketb_state::screen_update_sbasketb(screen_device &screen, bitmap_ind1
m_bg_tilemap->set_scrolly(col, *m_scroll);
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/scotrsht.c b/src/mame/video/scotrsht.c
index 23e13f4497c..03f4b4645e6 100644
--- a/src/mame/video/scotrsht.c
+++ b/src/mame/video/scotrsht.c
@@ -91,23 +91,22 @@ TILE_GET_INFO_MEMBER(scotrsht_state::scotrsht_get_bg_tile_info)
}
/* Same as Jailbreak + palette bank */
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void scotrsht_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- scotrsht_state *state = machine.driver_data<scotrsht_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int i;
- for (i = 0; i < state->m_spriteram.bytes(); i += 4)
+ for (i = 0; i < m_spriteram.bytes(); i += 4)
{
int attr = spriteram[i + 1]; // attributes = ?tyxcccc
int code = spriteram[i] + ((attr & 0x40) << 2);
- int color = (attr & 0x0f) + state->m_palette_bank * 16;
+ int color = (attr & 0x0f) + m_palette_bank * 16;
int flipx = attr & 0x10;
int flipy = attr & 0x20;
int sx = spriteram[i + 2] - ((attr & 0x80) << 1);
int sy = spriteram[i + 3];
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
@@ -115,9 +114,9 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
flipy = !flipy;
}
- drawgfx_transmask(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy,
+ drawgfx_transmask(bitmap, cliprect, machine().gfx[1], code, color, flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, state->m_palette_bank * 16));
+ colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color, m_palette_bank * 16));
}
}
@@ -136,6 +135,6 @@ UINT32 scotrsht_state::screen_update_scotrsht(screen_device &screen, bitmap_ind1
m_bg_tilemap->set_scrolly(col, m_scroll[col]);
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/sderby.c b/src/mame/video/sderby.c
index b3136506b3c..bfbf575823a 100644
--- a/src/mame/video/sderby.c
+++ b/src/mame/video/sderby.c
@@ -56,15 +56,14 @@ WRITE16_MEMBER(sderby_state::sderby_fg_videoram_w)
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,int codeshift)
+void sderby_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int codeshift)
{
- sderby_state *state = machine.driver_data<sderby_state>();
- UINT16 *spriteram16 = state->m_spriteram;
+ UINT16 *spriteram16 = m_spriteram;
int offs;
- int height = machine.gfx[0]->height();
- int colordiv = machine.gfx[0]->granularity() / 16;
+ int height = machine().gfx[0]->height();
+ int colordiv = machine().gfx[0]->granularity() / 16;
- for (offs = 4;offs < state->m_spriteram.bytes()/2;offs += 4)
+ for (offs = 4;offs < m_spriteram.bytes()/2;offs += 4)
{
int sx,sy,code,color,flipx;
@@ -77,7 +76,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
code = spriteram16[offs+2] >> codeshift;
color = (spriteram16[offs+1] & 0x3e00) >> 9;
- drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
code,
color/colordiv+48,
flipx,0,
@@ -100,7 +99,7 @@ void sderby_state::video_start()
UINT32 sderby_state::screen_update_sderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_tilemap->draw(bitmap, cliprect, 0,0);
- draw_sprites(machine(), bitmap,cliprect,0);
+ draw_sprites(bitmap,cliprect,0);
m_md_tilemap->draw(bitmap, cliprect, 0,0);
m_fg_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
@@ -110,7 +109,7 @@ UINT32 sderby_state::screen_update_pmroulet(screen_device &screen, bitmap_ind16
{
m_tilemap->draw(bitmap, cliprect, 0,0);
m_md_tilemap->draw(bitmap, cliprect, 0,0);
- draw_sprites(machine(), bitmap,cliprect,0);
+ draw_sprites(bitmap,cliprect,0);
m_fg_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
}
diff --git a/src/mame/video/segag80r.c b/src/mame/video/segag80r.c
index 9ab8911b4b2..818d7f2b3f3 100644
--- a/src/mame/video/segag80r.c
+++ b/src/mame/video/segag80r.c
@@ -25,22 +25,21 @@ TIMER_CALLBACK_MEMBER(segag80r_state::vblank_latch_clear)
}
-static void vblank_latch_set(running_machine &machine)
+void segag80r_state::vblank_latch_set()
{
- segag80r_state *state = machine.driver_data<segag80r_state>();
/* set a timer to mimic the 555 timer that drives the EDGINT signal */
/* the 555 is run in monostable mode with R=56000 and C=1000pF */
- state->m_vblank_latch = 1;
- machine.scheduler().timer_set(PERIOD_OF_555_MONOSTABLE(CAP_P(1000), RES_K(56)), timer_expired_delegate(FUNC(segag80r_state::vblank_latch_clear),state));
+ m_vblank_latch = 1;
+ machine().scheduler().timer_set(PERIOD_OF_555_MONOSTABLE(CAP_P(1000), RES_K(56)), timer_expired_delegate(FUNC(segag80r_state::vblank_latch_clear),this));
/* latch the current flip state at the same time */
- state->m_video_flip = state->m_video_control & 1;
+ m_video_flip = m_video_control & 1;
}
INTERRUPT_GEN_MEMBER(segag80r_state::segag80r_vblank_start)
{
- vblank_latch_set(machine());
+ vblank_latch_set();
/* if interrupts are enabled, clock one */
if (m_video_control & 0x04)
@@ -50,7 +49,7 @@ INTERRUPT_GEN_MEMBER(segag80r_state::segag80r_vblank_start)
INTERRUPT_GEN_MEMBER(segag80r_state::sindbadm_vblank_start)
{
- vblank_latch_set(machine());
+ vblank_latch_set();
/* interrupts appear to always be enabled, but they have a manual */
/* acknowledge rather than an automatic ack; they are also not masked */
@@ -66,9 +65,8 @@ INTERRUPT_GEN_MEMBER(segag80r_state::sindbadm_vblank_start)
*
*************************************/
-static void g80_set_palette_entry(running_machine &machine, int entry, UINT8 data)
+void segag80r_state::g80_set_palette_entry(int entry, UINT8 data)
{
- segag80r_state *state = machine.driver_data<segag80r_state>();
int bit0, bit1, bit2;
int r, g, b;
@@ -81,24 +79,24 @@ static void g80_set_palette_entry(running_machine &machine, int entry, UINT8 dat
bit0 = (r >> 0) & 0x01;
bit1 = (r >> 1) & 0x01;
bit2 = (r >> 2) & 0x01;
- r = combine_3_weights(state->m_rweights, bit0, bit1, bit2);
+ r = combine_3_weights(m_rweights, bit0, bit1, bit2);
/* green component */
bit0 = (g >> 0) & 0x01;
bit1 = (g >> 1) & 0x01;
bit2 = (g >> 2) & 0x01;
- g = combine_3_weights(state->m_gweights, bit0, bit1, bit2);
+ g = combine_3_weights(m_gweights, bit0, bit1, bit2);
/* blue component */
bit0 = (b >> 0) & 0x01;
bit1 = (b >> 1) & 0x01;
- b = combine_2_weights(state->m_bweights, bit0, bit1);
+ b = combine_2_weights(m_bweights, bit0, bit1);
- palette_set_color(machine, entry, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), entry, MAKE_RGB(r, g, b));
}
-static void spaceod_bg_init_palette(running_machine &machine)
+void segag80r_state::spaceod_bg_init_palette()
{
static const int resistances[2] = { 1800, 1200 };
double trweights[2], tgweights[2], tbweights[2];
@@ -136,7 +134,7 @@ static void spaceod_bg_init_palette(running_machine &machine)
bit1 = (b >> 1) & 0x01;
b = combine_2_weights(tbweights, bit0, bit1);
- palette_set_color(machine, 64 + i, MAKE_RGB(r, g, b));
+ palette_set_color(machine(), 64 + i, MAKE_RGB(r, g, b));
}
}
@@ -204,7 +202,7 @@ void segag80r_state::video_start()
/* create a fixed background palette and two tilemaps, one horizontally scrolling */
/* and one vertically scrolling */
case G80_BACKGROUND_SPACEOD:
- spaceod_bg_init_palette(machine());
+ spaceod_bg_init_palette();
m_spaceod_bg_htilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segag80r_state::spaceod_get_tile_info),this), tilemap_mapper_delegate(FUNC(segag80r_state::spaceod_scan_rows),this), 8,8, 128,32);
m_spaceod_bg_vtilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segag80r_state::spaceod_get_tile_info),this), tilemap_mapper_delegate(FUNC(segag80r_state::spaceod_scan_rows),this), 8,8, 32,128);
break;
@@ -256,7 +254,7 @@ WRITE8_MEMBER(segag80r_state::segag80r_videoram_w)
{
offset &= 0x3f;
m_generic_paletteram_8[offset] = data;
- g80_set_palette_entry(machine(), offset, data);
+ g80_set_palette_entry(offset, data);
return;
}
@@ -420,7 +418,7 @@ WRITE8_MEMBER(segag80r_state::monsterb_videoram_w)
{
offs_t paloffs = offset & 0x3f;
m_generic_paletteram_8[paloffs | 0x40] = data;
- g80_set_palette_entry(machine(), paloffs | 0x40, data);
+ g80_set_palette_entry(paloffs | 0x40, data);
/* note that since the background board is not integrated with the main board */
/* writes here also write through to regular videoram */
}
@@ -490,7 +488,7 @@ WRITE8_MEMBER(segag80r_state::pignewt_videoram_w)
{
offs_t paloffs = offset & 0x3f;
m_generic_paletteram_8[paloffs | 0x40] = data;
- g80_set_palette_entry(machine(), paloffs | 0x40, data);
+ g80_set_palette_entry(paloffs | 0x40, data);
return;
}
@@ -573,7 +571,7 @@ WRITE8_MEMBER(segag80r_state::sindbadm_videoram_w)
{
offs_t paloffs = offset & 0x3f;
m_generic_paletteram_8[paloffs | 0x40] = data;
- g80_set_palette_entry(machine(), paloffs | 0x40, data);
+ g80_set_palette_entry(paloffs | 0x40, data);
return;
}
@@ -621,24 +619,23 @@ WRITE8_MEMBER(segag80r_state::sindbadm_back_port_w)
*
*************************************/
-static void draw_videoram(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *transparent_pens)
+void segag80r_state::draw_videoram(bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8 *transparent_pens)
{
- segag80r_state *state = machine.driver_data<segag80r_state>();
- UINT8 *videoram = state->m_videoram;
- int flipmask = state->m_video_flip ? 0x1f : 0x00;
+ UINT8 *videoram = m_videoram;
+ int flipmask = m_video_flip ? 0x1f : 0x00;
int x, y;
/* iterate over the screen and draw visible tiles */
for (y = cliprect.min_y / 8; y <= cliprect.max_y / 8; y++)
{
- int effy = state->m_video_flip ? 27 - y : y;
+ int effy = m_video_flip ? 27 - y : y;
for (x = cliprect.min_x / 8; x <= cliprect.max_x / 8; x++)
{
int offs = effy * 32 + (x ^ flipmask);
UINT8 tile = videoram[offs];
/* draw the tile */
- drawgfx_transmask(bitmap, cliprect, machine.gfx[0], tile, tile >> 4, state->m_video_flip, state->m_video_flip, x*8, y*8, transparent_pens[tile >> 4]);
+ drawgfx_transmask(bitmap, cliprect, machine().gfx[0], tile, tile >> 4, m_video_flip, m_video_flip, x*8, y*8, transparent_pens[tile >> 4]);
}
}
}
@@ -651,12 +648,11 @@ static void draw_videoram(running_machine &machine, bitmap_ind16 &bitmap, const
*
*************************************/
-static void draw_background_spaceod(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void segag80r_state::draw_background_spaceod(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- segag80r_state *state = machine.driver_data<segag80r_state>();
- bitmap_ind16 &pixmap = (!(state->m_spaceod_bg_control & 0x02) ? state->m_spaceod_bg_htilemap : state->m_spaceod_bg_vtilemap)->pixmap();
- int flipmask = (state->m_spaceod_bg_control & 0x01) ? 0xff : 0x00;
- int xoffset = (state->m_spaceod_bg_control & 0x02) ? 0x10 : 0x00;
+ bitmap_ind16 &pixmap = (!(m_spaceod_bg_control & 0x02) ? m_spaceod_bg_htilemap : m_spaceod_bg_vtilemap)->pixmap();
+ int flipmask = (m_spaceod_bg_control & 0x01) ? 0xff : 0x00;
+ int xoffset = (m_spaceod_bg_control & 0x02) ? 0x10 : 0x00;
int xmask = pixmap.width() - 1;
int ymask = pixmap.height() - 1;
int x, y;
@@ -670,15 +666,15 @@ static void draw_background_spaceod(running_machine &machine, bitmap_ind16 &bitm
/* now fill in the background wherever there are black pixels */
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
{
- int effy = (y + state->m_spaceod_vcounter + 22) ^ flipmask;
+ int effy = (y + m_spaceod_vcounter + 22) ^ flipmask;
UINT16 *src = &pixmap.pix16(effy & ymask);
UINT16 *dst = &bitmap.pix16(y);
/* loop over horizontal pixels */
for (x = cliprect.min_x; x <= cliprect.max_x; x++)
{
- int effx = ((x + state->m_spaceod_hcounter) ^ flipmask) + xoffset;
- UINT8 fgpix = state->m_generic_paletteram_8[dst[x]];
+ int effx = ((x + m_spaceod_hcounter) ^ flipmask) + xoffset;
+ UINT8 fgpix = m_generic_paletteram_8[dst[x]];
UINT8 bgpix = src[effx & xmask] & 0x3f;
/* the background detect flag is set if:
@@ -687,15 +683,15 @@ static void draw_background_spaceod(running_machine &machine, bitmap_ind16 &bitm
- the original tile color == DIP switches
*/
if (bgpix != 0 && fgpix != 0 && (dst[x] >> 2) == spaceod_bg_detect_tile_color)
- state->m_spaceod_bg_detect = 1;
+ m_spaceod_bg_detect = 1;
/* the background graphics are only displayed if:
- fgpix == 0 AND
- !EXTBLK (not blanked) AND
- - state->m_bg_enable == 0
+ - m_bg_enable == 0
*/
- if (fgpix == 0 && state->m_bg_enable == 0)
- dst[x] = bgpix | state->m_spaceod_fixed_color | 0x40;
+ if (fgpix == 0 && m_bg_enable == 0)
+ dst[x] = bgpix | m_spaceod_fixed_color | 0x40;
}
}
}
@@ -709,17 +705,16 @@ static void draw_background_spaceod(running_machine &machine, bitmap_ind16 &bitm
*
*************************************/
-static void draw_background_page_scroll(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void segag80r_state::draw_background_page_scroll(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- segag80r_state *state = machine.driver_data<segag80r_state>();
- bitmap_ind16 &pixmap = state->m_bg_tilemap->pixmap();
- int flipmask = (state->m_video_control & 0x08) ? 0xff : 0x00;
+ bitmap_ind16 &pixmap = m_bg_tilemap->pixmap();
+ int flipmask = (m_video_control & 0x08) ? 0xff : 0x00;
int xmask = pixmap.width() - 1;
int ymask = pixmap.height() - 1;
int x, y;
/* if disabled, draw nothing */
- if (!state->m_bg_enable)
+ if (!m_bg_enable)
{
bitmap.fill(0, cliprect);
return;
@@ -728,14 +723,14 @@ static void draw_background_page_scroll(running_machine &machine, bitmap_ind16 &
/* now fill in the background wherever there are black pixels */
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
{
- int effy = state->m_bg_scrolly + (((y ^ flipmask) + (flipmask & 0xe0)) & 0xff);
+ int effy = m_bg_scrolly + (((y ^ flipmask) + (flipmask & 0xe0)) & 0xff);
UINT16 *src = &pixmap.pix16(effy & ymask);
UINT16 *dst = &bitmap.pix16(y);
/* loop over horizontal pixels */
for (x = cliprect.min_x; x <= cliprect.max_x; x++)
{
- int effx = state->m_bg_scrollx + (x ^ flipmask);
+ int effx = m_bg_scrollx + (x ^ flipmask);
dst[x] = src[effx & xmask];
}
}
@@ -750,17 +745,16 @@ static void draw_background_page_scroll(running_machine &machine, bitmap_ind16 &
*
*************************************/
-static void draw_background_full_scroll(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void segag80r_state::draw_background_full_scroll(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- segag80r_state *state = machine.driver_data<segag80r_state>();
- bitmap_ind16 &pixmap = state->m_bg_tilemap->pixmap();
- int flipmask = (state->m_video_control & 0x08) ? 0x3ff : 0x000;
+ bitmap_ind16 &pixmap = m_bg_tilemap->pixmap();
+ int flipmask = (m_video_control & 0x08) ? 0x3ff : 0x000;
int xmask = pixmap.width() - 1;
int ymask = pixmap.height() - 1;
int x, y;
/* if disabled, draw nothing */
- if (!state->m_bg_enable)
+ if (!m_bg_enable)
{
bitmap.fill(0, cliprect);
return;
@@ -769,14 +763,14 @@ static void draw_background_full_scroll(running_machine &machine, bitmap_ind16 &
/* now fill in the background wherever there are black pixels */
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
{
- int effy = (y + state->m_bg_scrolly) ^ flipmask;
+ int effy = (y + m_bg_scrolly) ^ flipmask;
UINT16 *src = &pixmap.pix16(effy & ymask);
UINT16 *dst = &bitmap.pix16(y);
/* loop over horizontal pixels */
for (x = cliprect.min_x; x <= cliprect.max_x; x++)
{
- int effx = (x + state->m_bg_scrollx) ^ flipmask;
+ int effx = (x + m_bg_scrollx) ^ flipmask;
dst[x] = src[effx & xmask];
}
}
@@ -800,7 +794,7 @@ UINT32 segag80r_state::screen_update_segag80r(screen_device &screen, bitmap_ind1
/* background: none */
case G80_BACKGROUND_NONE:
memset(transparent_pens, 0, 16);
- draw_videoram(machine(), bitmap, cliprect, transparent_pens);
+ draw_videoram(bitmap, cliprect, transparent_pens);
break;
/* foreground: visible except where black */
@@ -808,32 +802,32 @@ UINT32 segag80r_state::screen_update_segag80r(screen_device &screen, bitmap_ind1
/* we draw the foreground first, then the background to do collision detection */
case G80_BACKGROUND_SPACEOD:
memset(transparent_pens, 0, 16);
- draw_videoram(machine(), bitmap, cliprect, transparent_pens);
- draw_background_spaceod(machine(), bitmap, cliprect);
+ draw_videoram(bitmap, cliprect, transparent_pens);
+ draw_background_spaceod(bitmap, cliprect);
break;
/* foreground: visible except for pen 0 (this disagrees with schematics) */
/* background: page-granular scrolling */
case G80_BACKGROUND_MONSTERB:
memset(transparent_pens, 1, 16);
- draw_background_page_scroll(machine(), bitmap, cliprect);
- draw_videoram(machine(), bitmap, cliprect, transparent_pens);
+ draw_background_page_scroll(bitmap, cliprect);
+ draw_videoram(bitmap, cliprect, transparent_pens);
break;
/* foreground: visible except for pen 0 */
/* background: full scrolling */
case G80_BACKGROUND_PIGNEWT:
memset(transparent_pens, 1, 16);
- draw_background_full_scroll(machine(), bitmap, cliprect);
- draw_videoram(machine(), bitmap, cliprect, transparent_pens);
+ draw_background_full_scroll(bitmap, cliprect);
+ draw_videoram(bitmap, cliprect, transparent_pens);
break;
/* foreground: visible except for pen 0 */
/* background: page-granular scrolling */
case G80_BACKGROUND_SINDBADM:
memset(transparent_pens, 1, 16);
- draw_background_page_scroll(machine(), bitmap, cliprect);
- draw_videoram(machine(), bitmap, cliprect, transparent_pens);
+ draw_background_page_scroll(bitmap, cliprect);
+ draw_videoram(bitmap, cliprect, transparent_pens);
break;
}
return 0;
diff --git a/src/mame/video/segag80v.c b/src/mame/video/segag80v.c
index 901a0253e58..2bfae23371e 100644
--- a/src/mame/video/segag80v.c
+++ b/src/mame/video/segag80v.c
@@ -76,7 +76,7 @@
*/
-INLINE int adjust_xy(segag80v_state *state, int rawx, int rawy, int *outx, int *outy)
+inline int segag80v_state::adjust_xy(int rawx, int rawy, int *outx, int *outy)
{
int clipped = FALSE;
@@ -101,19 +101,18 @@ INLINE int adjust_xy(segag80v_state *state, int rawx, int rawy, int *outx, int *
*outy &= 0x3ff;
/* convert into .16 values */
- *outx = (*outx - (state->m_min_x - 512)) << 16;
- *outy = (*outy - (state->m_min_y - 512)) << 16;
+ *outx = (*outx - (m_min_x - 512)) << 16;
+ *outy = (*outy - (m_min_y - 512)) << 16;
return clipped;
}
-static void sega_generate_vector_list(running_machine &machine)
+void segag80v_state::sega_generate_vector_list()
{
- segag80v_state *state = machine.driver_data<segag80v_state>();
- UINT8 *sintable = state->memregion("proms")->base();
+ UINT8 *sintable = memregion("proms")->base();
double total_time = 1.0 / (double)IRQ_CLOCK;
UINT16 symaddr = 0;
- UINT8 *vectorram = state->m_vectorram;
+ UINT8 *vectorram = m_vectorram;
vector_clear_list();
@@ -176,9 +175,9 @@ static void sega_generate_vector_list(running_machine &machine)
int adjx, adjy, clipped;
/* Add a starting point to the vector list. */
- clipped = adjust_xy(state, curx, cury, &adjx, &adjy);
+ clipped = adjust_xy(curx, cury, &adjx, &adjy);
if (!clipped)
- vector_add_point(machine, adjx, adjy, 0, 0);
+ vector_add_point(machine(), adjx, adjy, 0, 0);
/* Loop until we run out of time. */
while (total_time > 0)
@@ -242,7 +241,7 @@ static void sega_generate_vector_list(running_machine &machine)
intensity = 0;
/* Loop over the length of the vector. */
- clipped = adjust_xy(state, curx, cury, &adjx, &adjy);
+ clipped = adjust_xy(curx, cury, &adjx, &adjy);
xaccum = yaccum = 0;
while (length-- != 0 && total_time > 0)
{
@@ -281,16 +280,16 @@ static void sega_generate_vector_list(running_machine &machine)
/* Apply the clipping from the DAC circuit. If the values clip */
/* the beam is turned off, but the computations continue right */
/* on going. */
- newclip = adjust_xy(state, curx, cury, &adjx, &adjy);
+ newclip = adjust_xy(curx, cury, &adjx, &adjy);
if (newclip != clipped)
{
/* if we're just becoming unclipped, add an empty point */
if (!newclip)
- vector_add_point(machine, adjx, adjy, 0, 0);
+ vector_add_point(machine(), adjx, adjy, 0, 0);
/* otherwise, add a colored point */
else
- vector_add_point(machine, adjx, adjy, color, intensity);
+ vector_add_point(machine(), adjx, adjy, color, intensity);
}
clipped = newclip;
@@ -300,7 +299,7 @@ static void sega_generate_vector_list(running_machine &machine)
/* We're done; if we are not clipped, add a final point. */
if (!clipped)
- vector_add_point(machine, adjx, adjy, color, intensity);
+ vector_add_point(machine(), adjx, adjy, color, intensity);
/* if the high bit of the attribute is set, we break out of */
/* this loop and fetch another symbol */
@@ -336,7 +335,7 @@ void segag80v_state::video_start()
UINT32 segag80v_state::screen_update_segag80v(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- sega_generate_vector_list(machine());
+ sega_generate_vector_list();
SCREEN_UPDATE32_CALL(vector);
return 0;
}
diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c
index bf7fc222f84..32bde3498d3 100644
--- a/src/mame/video/segas32.c
+++ b/src/mame/video/segas32.c
@@ -198,36 +198,6 @@
*
*************************************/
-struct extents_list
-{
- UINT8 scan_extent[256];
- UINT16 extent[32][16];
-};
-
-
-struct cache_entry
-{
- struct cache_entry * next;
- tilemap_t * tmap;
- UINT8 page;
- UINT8 bank;
-};
-
-
-
-/*************************************
- *
- * Prototypes
- *
- *************************************/
-
-
-static void sprite_erase_buffer(segas32_state *state);
-static void sprite_swap_buffers(segas32_state *state);
-static void sprite_render_list(running_machine &machine);
-
-
-
/*************************************
*
@@ -235,59 +205,58 @@ static void sprite_render_list(running_machine &machine);
*
*************************************/
-static void common_start(running_machine &machine, int multi32)
+void segas32_state::common_start(int multi32)
{
- segas32_state *state = machine.driver_data<segas32_state>();
int tmap;
/* remember whether or not we are multi32 */
- state->m_is_multi32 = multi32;
+ m_is_multi32 = multi32;
/* allocate a copy of spriteram in 32-bit format */
- state->m_spriteram_32bit = auto_alloc_array(machine, UINT32, 0x20000/4);
+ m_spriteram_32bit = auto_alloc_array(machine(), UINT32, 0x20000/4);
/* allocate the tilemap cache */
- state->m_cache_head = NULL;
+ m_cache_head = NULL;
for (tmap = 0; tmap < TILEMAP_CACHE_SIZE; tmap++)
{
- struct cache_entry *entry = auto_alloc(machine, struct cache_entry);
+ struct cache_entry *entry = auto_alloc(machine(), struct cache_entry);
- entry->tmap = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(segas32_state::get_tile_info),state), TILEMAP_SCAN_ROWS, 16,16, 32,16);
+ entry->tmap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(segas32_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 16,16, 32,16);
entry->page = 0xff;
entry->bank = 0;
- entry->next = state->m_cache_head;
+ entry->next = m_cache_head;
entry->tmap->set_user_data(entry);
- state->m_cache_head = entry;
+ m_cache_head = entry;
}
/* allocate the bitmaps (a few extra for multi32) */
for (tmap = 0; tmap < 9 + 2 * multi32; tmap++)
{
- state->m_layer_data[tmap].bitmap = auto_bitmap_ind16_alloc(machine, 416, 224);
- state->m_layer_data[tmap].transparent = auto_alloc_array_clear(machine, UINT8, 256);
+ m_layer_data[tmap].bitmap = auto_bitmap_ind16_alloc(machine(), 416, 224);
+ m_layer_data[tmap].transparent = auto_alloc_array_clear(machine(), UINT8, 256);
}
/* allocate pre-rendered solid lines of 0's and ffff's */
- state->m_solid_0000 = auto_alloc_array(machine, UINT16, 512);
- memset(state->m_solid_0000, 0x00, sizeof(state->m_solid_0000[0]) * 512);
- state->m_solid_ffff = auto_alloc_array(machine, UINT16, 512);
- memset(state->m_solid_ffff, 0xff, sizeof(state->m_solid_ffff[0]) * 512);
+ m_solid_0000 = auto_alloc_array(machine(), UINT16, 512);
+ memset(m_solid_0000, 0x00, sizeof(m_solid_0000[0]) * 512);
+ m_solid_ffff = auto_alloc_array(machine(), UINT16, 512);
+ memset(m_solid_ffff, 0xff, sizeof(m_solid_ffff[0]) * 512);
/* initialize videoram */
- state->m_system32_videoram[0x1ff00/2] = 0x8000;
+ m_system32_videoram[0x1ff00/2] = 0x8000;
}
VIDEO_START_MEMBER(segas32_state,system32)
{
- common_start(machine(), 0);
+ common_start(0);
}
VIDEO_START_MEMBER(segas32_state,multi32)
{
- common_start(machine(), 1);
+ common_start(1);
}
@@ -313,22 +282,21 @@ TIMER_CALLBACK_MEMBER(segas32_state::update_sprites)
/* look for pending commands */
if (m_sprite_control[0] & 2)
- sprite_erase_buffer(this);
+ sprite_erase_buffer();
if (m_sprite_control[0] & 1)
{
- sprite_swap_buffers(this);
- sprite_render_list(machine());
+ sprite_swap_buffers();
+ sprite_render_list();
}
m_sprite_control[0] = 0;
}
-void system32_set_vblank(running_machine &machine, int state)
+void segas32_state::system32_set_vblank(int state)
{
- segas32_state *drvstate = machine.driver_data<segas32_state>();
/* at the end of VBLANK is when automatic sprite rendering happens */
if (!state)
- machine.scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(segas32_state::update_sprites),drvstate), 1);
+ machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(segas32_state::update_sprites),this), 1);
}
@@ -339,7 +307,7 @@ void system32_set_vblank(running_machine &machine, int state)
*
*************************************/
-INLINE UINT16 xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(UINT16 value)
+inline UINT16 segas32_state::xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(UINT16 value)
{
int r = (value >> 0) & 0x1f;
int g = (value >> 5) & 0x1f;
@@ -350,7 +318,7 @@ INLINE UINT16 xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(UINT16 value)
}
-INLINE UINT16 xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(UINT16 value)
+inline UINT16 segas32_state::xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(UINT16 value)
{
int r = ((value >> 12) & 0x01) | ((value << 1) & 0x1e);
int g = ((value >> 13) & 0x01) | ((value >> 3) & 0x1e);
@@ -359,20 +327,19 @@ INLINE UINT16 xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(UINT16 value)
}
-INLINE void update_color(running_machine &machine, int offset, UINT16 data)
+inline void segas32_state::update_color(int offset, UINT16 data)
{
/* note that since we use this RAM directly, we don't technically need */
/* to call palette_set_color() at all; however, it does give us that */
/* nice display when you hit F4, which is useful for debugging */
/* set the color */
- palette_set_color_rgb(machine, offset, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
+ palette_set_color_rgb(machine(), offset, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
}
-INLINE UINT16 common_paletteram_r(address_space &space, int which, offs_t offset)
+inline UINT16 segas32_state::common_paletteram_r(address_space &space, int which, offs_t offset)
{
- segas32_state *state = space.machine().driver_data<segas32_state>();
int convert;
/* the lower half of palette RAM is formatted xBBBBBGGGGGRRRRR */
@@ -383,15 +350,14 @@ INLINE UINT16 common_paletteram_r(address_space &space, int which, offs_t offset
offset &= 0x3fff;
if (!convert)
- return state->m_system32_paletteram[which][offset];
+ return m_system32_paletteram[which][offset];
else
- return xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(state->m_system32_paletteram[which][offset]);
+ return xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(m_system32_paletteram[which][offset]);
}
-static void common_paletteram_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
+void segas32_state::common_paletteram_w(address_space &space, int which, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- segas32_state *state = space.machine().driver_data<segas32_state>();
UINT16 value;
int convert;
@@ -403,25 +369,25 @@ static void common_paletteram_w(address_space &space, int which, offs_t offset,
offset &= 0x3fff;
/* read, modify, and write the new value, updating the palette */
- value = state->m_system32_paletteram[which][offset];
+ value = m_system32_paletteram[which][offset];
if (convert) value = xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(value);
COMBINE_DATA(&value);
if (convert) value = xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(value);
- state->m_system32_paletteram[which][offset] = value;
- update_color(space.machine(), 0x4000*which + offset, value);
+ m_system32_paletteram[which][offset] = value;
+ update_color(0x4000*which + offset, value);
/* if blending is enabled, writes go to both halves of palette RAM */
- if (state->m_mixer_control[which][0x4e/2] & 0x0880)
+ if (m_mixer_control[which][0x4e/2] & 0x0880)
{
offset ^= 0x2000;
/* read, modify, and write the new value, updating the palette */
- value = state->m_system32_paletteram[which][offset];
+ value = m_system32_paletteram[which][offset];
if (convert) value = xBBBBBGGGGGRRRRR_to_xBGRBBBBGGGGRRRR(value);
COMBINE_DATA(&value);
if (convert) value = xBGRBBBBGGGGRRRR_to_xBBBBBGGGGGRRRRR(value);
- state->m_system32_paletteram[which][offset] = value;
- update_color(space.machine(), 0x4000*which + offset, value);
+ m_system32_paletteram[which][offset] = value;
+ update_color(0x4000*which + offset, value);
}
}
@@ -698,13 +664,13 @@ WRITE32_MEMBER(segas32_state::multi32_mixer_1_w)
*
*************************************/
-static tilemap_t *find_cache_entry(segas32_state *state, int page, int bank)
+tilemap_t *segas32_state::find_cache_entry(int page, int bank)
{
- struct cache_entry *entry, *prev;
+ struct segas32_state::cache_entry *entry, *prev;
/* scan the list for a matching entry */
prev = NULL;
- entry = state->m_cache_head;
+ entry = m_cache_head;
while (1)
{
if (entry->page == page && entry->bank == bank)
@@ -713,8 +679,8 @@ static tilemap_t *find_cache_entry(segas32_state *state, int page, int bank)
if (prev)
{
prev->next = entry->next;
- entry->next = state->m_cache_head;
- state->m_cache_head = entry;
+ entry->next = m_cache_head;
+ m_cache_head = entry;
}
return entry->tmap;
}
@@ -733,8 +699,8 @@ static tilemap_t *find_cache_entry(segas32_state *state, int page, int bank)
/* move it to the head */
prev->next = entry->next;
- entry->next = state->m_cache_head;
- state->m_cache_head = entry;
+ entry->next = m_cache_head;
+ m_cache_head = entry;
return entry->tmap;
}
@@ -749,7 +715,7 @@ static tilemap_t *find_cache_entry(segas32_state *state, int page, int bank)
TILE_GET_INFO_MEMBER(segas32_state::get_tile_info)
{
- struct cache_entry *entry = (struct cache_entry *)param;
+ struct segas32_state::cache_entry *entry = (struct segas32_state::cache_entry *)param;
UINT16 data = m_system32_videoram[(entry->page & 0x7f) * 0x200 + tile_index];
SET_TILE_INFO_MEMBER(0, (entry->bank << 13) + (data & 0x1fff), (data >> 4) & 0x1ff, (data >> 14) & 3);
}
@@ -762,10 +728,9 @@ TILE_GET_INFO_MEMBER(segas32_state::get_tile_info)
*
*************************************/
-static int compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle &cliprect, struct extents_list *list)
+int segas32_state::compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle &cliprect, struct extents_list *list)
{
- segas32_state *state = screen.machine().driver_data<segas32_state>();
- int flip = (state->m_system32_videoram[0x1ff00/2] >> 9) & 1;
+ int flip = (m_system32_videoram[0x1ff00/2] >> 9) & 1;
rectangle tempclip;
rectangle clips[5];
int sorted[5];
@@ -792,19 +757,19 @@ static int compute_clipping_extents(screen_device &screen, int enable, int clipo
{
if (!flip)
{
- clips[i].min_x = state->m_system32_videoram[0x1ff60/2 + i * 4] & 0x1ff;
- clips[i].min_y = state->m_system32_videoram[0x1ff62/2 + i * 4] & 0x0ff;
- clips[i].max_x = (state->m_system32_videoram[0x1ff64/2 + i * 4] & 0x1ff) + 1;
- clips[i].max_y = (state->m_system32_videoram[0x1ff66/2 + i * 4] & 0x0ff) + 1;
+ clips[i].min_x = m_system32_videoram[0x1ff60/2 + i * 4] & 0x1ff;
+ clips[i].min_y = m_system32_videoram[0x1ff62/2 + i * 4] & 0x0ff;
+ clips[i].max_x = (m_system32_videoram[0x1ff64/2 + i * 4] & 0x1ff) + 1;
+ clips[i].max_y = (m_system32_videoram[0x1ff66/2 + i * 4] & 0x0ff) + 1;
}
else
{
const rectangle &visarea = screen.visible_area();
- clips[i].max_x = (visarea.max_x + 1) - (state->m_system32_videoram[0x1ff60/2 + i * 4] & 0x1ff);
- clips[i].max_y = (visarea.max_y + 1) - (state->m_system32_videoram[0x1ff62/2 + i * 4] & 0x0ff);
- clips[i].min_x = (visarea.max_x + 1) - ((state->m_system32_videoram[0x1ff64/2 + i * 4] & 0x1ff) + 1);
- clips[i].min_y = (visarea.max_y + 1) - ((state->m_system32_videoram[0x1ff66/2 + i * 4] & 0x0ff) + 1);
+ clips[i].max_x = (visarea.max_x + 1) - (m_system32_videoram[0x1ff60/2 + i * 4] & 0x1ff);
+ clips[i].max_y = (visarea.max_y + 1) - (m_system32_videoram[0x1ff62/2 + i * 4] & 0x0ff);
+ clips[i].min_x = (visarea.max_x + 1) - ((m_system32_videoram[0x1ff64/2 + i * 4] & 0x1ff) + 1);
+ clips[i].min_y = (visarea.max_y + 1) - ((m_system32_videoram[0x1ff66/2 + i * 4] & 0x0ff) + 1);
}
clips[i] &= tempclip;
sorted[i] = i;
@@ -872,31 +837,30 @@ static int compute_clipping_extents(screen_device &screen, int enable, int clipo
*
*************************************/
-INLINE void get_tilemaps(segas32_state *state, int bgnum, tilemap_t **tilemaps)
+inline void segas32_state::get_tilemaps(int bgnum, tilemap_t **tilemaps)
{
int tilebank, page;
/* determine the current tilebank */
- if (state->m_is_multi32)
- tilebank = (state->m_system32_tilebank_external >> (2*bgnum)) & 3;
+ if (m_is_multi32)
+ tilebank = (m_system32_tilebank_external >> (2*bgnum)) & 3;
else
- tilebank = ((state->m_system32_tilebank_external & 1) << 1) | ((state->m_system32_videoram[0x1ff00/2] & 0x400) >> 10);
+ tilebank = ((m_system32_tilebank_external & 1) << 1) | ((m_system32_videoram[0x1ff00/2] & 0x400) >> 10);
/* find the cache entries */
- page = (state->m_system32_videoram[0x1ff40/2 + 2 * bgnum + 0] >> 0) & 0x7f;
- tilemaps[0] = find_cache_entry(state, page, tilebank);
- page = (state->m_system32_videoram[0x1ff40/2 + 2 * bgnum + 0] >> 8) & 0x7f;
- tilemaps[1] = find_cache_entry(state, page, tilebank);
- page = (state->m_system32_videoram[0x1ff40/2 + 2 * bgnum + 1] >> 0) & 0x7f;
- tilemaps[2] = find_cache_entry(state, page, tilebank);
- page = (state->m_system32_videoram[0x1ff40/2 + 2 * bgnum + 1] >> 8) & 0x7f;
- tilemaps[3] = find_cache_entry(state, page, tilebank);
+ page = (m_system32_videoram[0x1ff40/2 + 2 * bgnum + 0] >> 0) & 0x7f;
+ tilemaps[0] = find_cache_entry(page, tilebank);
+ page = (m_system32_videoram[0x1ff40/2 + 2 * bgnum + 0] >> 8) & 0x7f;
+ tilemaps[1] = find_cache_entry(page, tilebank);
+ page = (m_system32_videoram[0x1ff40/2 + 2 * bgnum + 1] >> 0) & 0x7f;
+ tilemaps[2] = find_cache_entry(page, tilebank);
+ page = (m_system32_videoram[0x1ff40/2 + 2 * bgnum + 1] >> 8) & 0x7f;
+ tilemaps[3] = find_cache_entry(page, tilebank);
}
-static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum)
+void segas32_state::update_tilemap_zoom(screen_device &screen, struct segas32_state::layer_info *layer, const rectangle &cliprect, int bgnum)
{
- segas32_state *state = screen.machine().driver_data<segas32_state>();
int clipenable, clipout, clips, clipdraw_start;
bitmap_ind16 &bitmap = *layer->bitmap;
struct extents_list clip_extents;
@@ -908,7 +872,7 @@ static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer,
int x, y;
/* get the tilemaps */
- get_tilemaps(state, bgnum, tilemaps);
+ get_tilemaps(bgnum, tilemaps);
/* configure the layer */
opaque = 0;
@@ -917,18 +881,18 @@ static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer,
//if (screen.machine().input().code_pressed(KEYCODE_X) && bgnum == 1) opaque = 1;
/* determine if we're flipped */
- flip = ((state->m_system32_videoram[0x1ff00/2] >> 9) ^ (state->m_system32_videoram[0x1ff00/2] >> bgnum)) & 1;
+ flip = ((m_system32_videoram[0x1ff00/2] >> 9) ^ (m_system32_videoram[0x1ff00/2] >> bgnum)) & 1;
/* determine the clipping */
- clipenable = (state->m_system32_videoram[0x1ff02/2] >> (11 + bgnum)) & 1;
- clipout = (state->m_system32_videoram[0x1ff02/2] >> (6 + bgnum)) & 1;
- clips = (state->m_system32_videoram[0x1ff06/2] >> (4 * bgnum)) & 0x0f;
+ clipenable = (m_system32_videoram[0x1ff02/2] >> (11 + bgnum)) & 1;
+ clipout = (m_system32_videoram[0x1ff02/2] >> (6 + bgnum)) & 1;
+ clips = (m_system32_videoram[0x1ff06/2] >> (4 * bgnum)) & 0x0f;
clipdraw_start = compute_clipping_extents(screen, clipenable, clipout, clips, cliprect, &clip_extents);
/* extract the X/Y step values (these are in destination space!) */
- dstxstep = state->m_system32_videoram[0x1ff50/2 + 2 * bgnum] & 0xfff;
- if (state->m_system32_videoram[0x1ff00/2] & 0x4000)
- dstystep = state->m_system32_videoram[0x1ff52/2 + 2 * bgnum] & 0xfff;
+ dstxstep = m_system32_videoram[0x1ff50/2 + 2 * bgnum] & 0xfff;
+ if (m_system32_videoram[0x1ff00/2] & 0x4000)
+ dstystep = m_system32_videoram[0x1ff52/2 + 2 * bgnum] & 0xfff;
else
dstystep = dstxstep;
@@ -943,14 +907,14 @@ static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer,
srcystep = (0x200 << 20) / dstystep;
/* start with the fractional scroll offsets, in source coordinates */
- srcx_start = (state->m_system32_videoram[0x1ff12/2 + 4 * bgnum] & 0x3ff) << 20;
- srcx_start += (state->m_system32_videoram[0x1ff10/2 + 4 * bgnum] & 0xff00) << 4;
- srcy = (state->m_system32_videoram[0x1ff16/2 + 4 * bgnum] & 0x1ff) << 20;
- srcy += (state->m_system32_videoram[0x1ff14/2 + 4 * bgnum] & 0xfe00) << 4;
+ srcx_start = (m_system32_videoram[0x1ff12/2 + 4 * bgnum] & 0x3ff) << 20;
+ srcx_start += (m_system32_videoram[0x1ff10/2 + 4 * bgnum] & 0xff00) << 4;
+ srcy = (m_system32_videoram[0x1ff16/2 + 4 * bgnum] & 0x1ff) << 20;
+ srcy += (m_system32_videoram[0x1ff14/2 + 4 * bgnum] & 0xfe00) << 4;
/* then account for the destination center coordinates */
- srcx_start -= ((INT16)(state->m_system32_videoram[0x1ff30/2 + 2 * bgnum] << 6) >> 6) * srcxstep;
- srcy -= ((INT16)(state->m_system32_videoram[0x1ff32/2 + 2 * bgnum] << 7) >> 7) * srcystep;
+ srcx_start -= ((INT16)(m_system32_videoram[0x1ff30/2 + 2 * bgnum] << 6) >> 6) * srcxstep;
+ srcy -= ((INT16)(m_system32_videoram[0x1ff32/2 + 2 * bgnum] << 7) >> 7) * srcystep;
/* finally, account for destination top,left coordinates */
srcx_start += cliprect.min_x * srcxstep;
@@ -1034,8 +998,8 @@ static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer,
#if 0
if (dstxstep != 0x200 || dstystep != 0x200)
popmessage("Zoom=%03X,%03X Cent=%03X,%03X", dstxstep, dstystep,
- state->m_system32_videoram[0x1ff30/2 + 2 * bgnum],
- state->m_system32_videoram[0x1ff32/2 + 2 * bgnum]);
+ m_system32_videoram[0x1ff30/2 + 2 * bgnum],
+ m_system32_videoram[0x1ff32/2 + 2 * bgnum]);
#endif
}
@@ -1047,9 +1011,8 @@ static void update_tilemap_zoom(screen_device &screen, struct layer_info *layer,
*
*************************************/
-static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum)
+void segas32_state::update_tilemap_rowscroll(screen_device &screen, struct segas32_state::layer_info *layer, const rectangle &cliprect, int bgnum)
{
- segas32_state *state = screen.machine().driver_data<segas32_state>();
int clipenable, clipout, clips, clipdraw_start;
bitmap_ind16 &bitmap = *layer->bitmap;
struct extents_list clip_extents;
@@ -1062,35 +1025,35 @@ static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *l
int x, y;
/* get the tilemaps */
- get_tilemaps(state, bgnum, tilemaps);
+ get_tilemaps(bgnum, tilemaps);
/* configure the layer */
opaque = 0;
-//opaque = (state->m_system32_videoram[0x1ff8e/2] >> (8 + bgnum)) & 1;
+//opaque = (m_system32_videoram[0x1ff8e/2] >> (8 + bgnum)) & 1;
//if (screen.machine().input().code_pressed(KEYCODE_C) && bgnum == 2) opaque = 1;
//if (screen.machine().input().code_pressed(KEYCODE_V) && bgnum == 3) opaque = 1;
/* determine if we're flipped */
- flip = ((state->m_system32_videoram[0x1ff00/2] >> 9) ^ (state->m_system32_videoram[0x1ff00/2] >> bgnum)) & 1;
+ flip = ((m_system32_videoram[0x1ff00/2] >> 9) ^ (m_system32_videoram[0x1ff00/2] >> bgnum)) & 1;
/* determine the clipping */
- clipenable = (state->m_system32_videoram[0x1ff02/2] >> (11 + bgnum)) & 1;
- clipout = (state->m_system32_videoram[0x1ff02/2] >> (6 + bgnum)) & 1;
- clips = (state->m_system32_videoram[0x1ff06/2] >> (4 * bgnum)) & 0x0f;
+ clipenable = (m_system32_videoram[0x1ff02/2] >> (11 + bgnum)) & 1;
+ clipout = (m_system32_videoram[0x1ff02/2] >> (6 + bgnum)) & 1;
+ clips = (m_system32_videoram[0x1ff06/2] >> (4 * bgnum)) & 0x0f;
clipdraw_start = compute_clipping_extents(screen, clipenable, clipout, clips, cliprect, &clip_extents);
/* determine if row scroll and/or row select is enabled */
- rowscroll = (state->m_system32_videoram[0x1ff04/2] >> (bgnum - 2)) & 1;
- rowselect = (state->m_system32_videoram[0x1ff04/2] >> bgnum) & 1;
- if ((state->m_system32_videoram[0x1ff04/2] >> (bgnum + 2)) & 1)
+ rowscroll = (m_system32_videoram[0x1ff04/2] >> (bgnum - 2)) & 1;
+ rowselect = (m_system32_videoram[0x1ff04/2] >> bgnum) & 1;
+ if ((m_system32_videoram[0x1ff04/2] >> (bgnum + 2)) & 1)
rowscroll = rowselect = 0;
/* get a pointer to the table */
- table = &state->m_system32_videoram[(state->m_system32_videoram[0x1ff04/2] >> 10) * 0x400];
+ table = &m_system32_videoram[(m_system32_videoram[0x1ff04/2] >> 10) * 0x400];
/* start with screen-wide X and Y scrolls */
- xscroll = (state->m_system32_videoram[0x1ff12/2 + 4 * bgnum] & 0x3ff) - (state->m_system32_videoram[0x1ff30/2 + 2 * bgnum] & 0x1ff);
- yscroll = (state->m_system32_videoram[0x1ff16/2 + 4 * bgnum] & 0x1ff);
+ xscroll = (m_system32_videoram[0x1ff12/2 + 4 * bgnum] & 0x3ff) - (m_system32_videoram[0x1ff30/2 + 2 * bgnum] & 0x1ff);
+ yscroll = (m_system32_videoram[0x1ff16/2 + 4 * bgnum] & 0x1ff);
/* render the tilemap into its bitmap */
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
@@ -1187,7 +1150,7 @@ static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *l
#if 0
if (rowscroll || rowselect)
popmessage("Scroll=%d Select=%d Table@%06X",
- rowscroll, rowselect, (state->m_system32_videoram[0x1ff04/2] >> 10) * 0x800);
+ rowscroll, rowselect, (m_system32_videoram[0x1ff04/2] >> 10) * 0x800);
#endif
}
@@ -1199,9 +1162,8 @@ static void update_tilemap_rowscroll(screen_device &screen, struct layer_info *l
*
*************************************/
-static void update_tilemap_text(screen_device &screen, struct layer_info *layer, const rectangle &cliprect)
+void segas32_state::update_tilemap_text(screen_device &screen, struct segas32_state::layer_info *layer, const rectangle &cliprect)
{
- segas32_state *state = screen.machine().driver_data<segas32_state>();
bitmap_ind16 &bitmap = *layer->bitmap;
UINT16 *tilebase;
UINT16 *gfxbase;
@@ -1211,11 +1173,11 @@ static void update_tilemap_text(screen_device &screen, struct layer_info *layer,
int flip;
/* determine if we're flipped */
- flip = (state->m_system32_videoram[0x1ff00/2] >> 9) & 1;
+ flip = (m_system32_videoram[0x1ff00/2] >> 9) & 1;
/* determine the base of the tilemap and graphics data */
- tilebase = &state->m_system32_videoram[((state->m_system32_videoram[0x1ff5c/2] >> 4) & 0x1f) * 0x800];
- gfxbase = &state->m_system32_videoram[(state->m_system32_videoram[0x1ff5c/2] & 7) * 0x2000];
+ tilebase = &m_system32_videoram[((m_system32_videoram[0x1ff5c/2] >> 4) & 0x1f) * 0x800];
+ gfxbase = &m_system32_videoram[(m_system32_videoram[0x1ff5c/2] & 7) * 0x2000];
/* compute start/end tile numbers */
startx = cliprect.min_x / 8;
@@ -1359,9 +1321,8 @@ static void update_tilemap_text(screen_device &screen, struct layer_info *layer,
*
*************************************/
-static void update_bitmap(screen_device &screen, struct layer_info *layer, const rectangle &cliprect)
+void segas32_state::update_bitmap(screen_device &screen, struct segas32_state::layer_info *layer, const rectangle &cliprect)
{
- segas32_state *state = screen.machine().driver_data<segas32_state>();
int clipenable, clipout, clips, clipdraw_start;
bitmap_ind16 &bitmap = *layer->bitmap;
struct extents_list clip_extents;
@@ -1371,18 +1332,18 @@ static void update_bitmap(screen_device &screen, struct layer_info *layer, const
int bpp;
/* configure the layer */
- bpp = (state->m_system32_videoram[0x1ff00/2] & 0x0800) ? 8 : 4;
+ bpp = (m_system32_videoram[0x1ff00/2] & 0x0800) ? 8 : 4;
/* determine the clipping */
- clipenable = (state->m_system32_videoram[0x1ff02/2] >> 15) & 1;
- clipout = (state->m_system32_videoram[0x1ff02/2] >> 10) & 1;
+ clipenable = (m_system32_videoram[0x1ff02/2] >> 15) & 1;
+ clipout = (m_system32_videoram[0x1ff02/2] >> 10) & 1;
clips = 0x10;
clipdraw_start = compute_clipping_extents(screen, clipenable, clipout, clips, cliprect, &clip_extents);
/* determine x/y scroll */
- xscroll = state->m_system32_videoram[0x1ff88/2] & 0x1ff;
- yscroll = state->m_system32_videoram[0x1ff8a/2] & 0x1ff;
- color = (state->m_system32_videoram[0x1ff8c/2] << 4) & 0x1fff0 & ~((1 << bpp) - 1);
+ xscroll = m_system32_videoram[0x1ff88/2] & 0x1ff;
+ yscroll = m_system32_videoram[0x1ff8a/2] & 0x1ff;
+ color = (m_system32_videoram[0x1ff8c/2] << 4) & 0x1fff0 & ~((1 << bpp) - 1);
/* loop over target rows */
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
@@ -1405,7 +1366,7 @@ static void update_bitmap(screen_device &screen, struct layer_info *layer, const
/* 8bpp mode case */
if (bpp == 8)
{
- UINT8 *src = (UINT8 *)&state->m_system32_videoram[512/2 * ((y + yscroll) & 0xff)];
+ UINT8 *src = (UINT8 *)&m_system32_videoram[512/2 * ((y + yscroll) & 0xff)];
for (x = extents[0]; x < extents[1]; x++)
{
int effx = (x + xscroll) & 0x1ff;
@@ -1419,7 +1380,7 @@ static void update_bitmap(screen_device &screen, struct layer_info *layer, const
/* 4bpp mode case */
else
{
- UINT16 *src = &state->m_system32_videoram[512/4 * ((y + yscroll) & 0x1ff)];
+ UINT16 *src = &m_system32_videoram[512/4 * ((y + yscroll) & 0x1ff)];
for (x = extents[0]; x < extents[1]; x++)
{
int effx = (x + xscroll) & 0x1ff;
@@ -1463,7 +1424,7 @@ static void update_bitmap(screen_device &screen, struct layer_info *layer, const
*
*************************************/
-static void update_background(segas32_state *state, struct layer_info *layer, const rectangle &cliprect)
+void segas32_state::update_background(struct segas32_state::layer_info *layer, const rectangle &cliprect)
{
bitmap_ind16 &bitmap = *layer->bitmap;
int x, y;
@@ -1474,10 +1435,10 @@ static void update_background(segas32_state *state, struct layer_info *layer, co
int color;
/* determine the color */
- if (state->m_system32_videoram[0x1ff5e/2] & 0x8000)
- color = (state->m_system32_videoram[0x1ff5e/2] & 0x1fff) + y;
+ if (m_system32_videoram[0x1ff5e/2] & 0x8000)
+ color = (m_system32_videoram[0x1ff5e/2] & 0x1fff) + y;
else
- color = state->m_system32_videoram[0x1ff5e/2] & 0x1e00;
+ color = m_system32_videoram[0x1ff5e/2] & 0x1e00;
/* if the color doesn't match, fill */
if (dst[cliprect.min_x] != color)
@@ -1487,30 +1448,29 @@ static void update_background(segas32_state *state, struct layer_info *layer, co
}
-static UINT8 update_tilemaps(screen_device &screen, const rectangle &cliprect)
+UINT8 segas32_state::update_tilemaps(screen_device &screen, const rectangle &cliprect)
{
- segas32_state *state = screen.machine().driver_data<segas32_state>();
- int enable0 = !(state->m_system32_videoram[0x1ff02/2] & 0x0001) && !(state->m_system32_videoram[0x1ff8e/2] & 0x0002);
- int enable1 = !(state->m_system32_videoram[0x1ff02/2] & 0x0002) && !(state->m_system32_videoram[0x1ff8e/2] & 0x0004);
- int enable2 = !(state->m_system32_videoram[0x1ff02/2] & 0x0004) && !(state->m_system32_videoram[0x1ff8e/2] & 0x0008) && !(state->m_system32_videoram[0x1ff00/2] & 0x1000);
- int enable3 = !(state->m_system32_videoram[0x1ff02/2] & 0x0008) && !(state->m_system32_videoram[0x1ff8e/2] & 0x0010) && !(state->m_system32_videoram[0x1ff00/2] & 0x2000);
- int enablet = !(state->m_system32_videoram[0x1ff02/2] & 0x0010) && !(state->m_system32_videoram[0x1ff8e/2] & 0x0001);
- int enableb = !(state->m_system32_videoram[0x1ff02/2] & 0x0020) && !(state->m_system32_videoram[0x1ff8e/2] & 0x0020);
+ int enable0 = !(m_system32_videoram[0x1ff02/2] & 0x0001) && !(m_system32_videoram[0x1ff8e/2] & 0x0002);
+ int enable1 = !(m_system32_videoram[0x1ff02/2] & 0x0002) && !(m_system32_videoram[0x1ff8e/2] & 0x0004);
+ int enable2 = !(m_system32_videoram[0x1ff02/2] & 0x0004) && !(m_system32_videoram[0x1ff8e/2] & 0x0008) && !(m_system32_videoram[0x1ff00/2] & 0x1000);
+ int enable3 = !(m_system32_videoram[0x1ff02/2] & 0x0008) && !(m_system32_videoram[0x1ff8e/2] & 0x0010) && !(m_system32_videoram[0x1ff00/2] & 0x2000);
+ int enablet = !(m_system32_videoram[0x1ff02/2] & 0x0010) && !(m_system32_videoram[0x1ff8e/2] & 0x0001);
+ int enableb = !(m_system32_videoram[0x1ff02/2] & 0x0020) && !(m_system32_videoram[0x1ff8e/2] & 0x0020);
/* update any tilemaps */
if (enable0)
- update_tilemap_zoom(screen, &state->m_layer_data[MIXER_LAYER_NBG0], cliprect, 0);
+ update_tilemap_zoom(screen, &m_layer_data[MIXER_LAYER_NBG0], cliprect, 0);
if (enable1)
- update_tilemap_zoom(screen, &state->m_layer_data[MIXER_LAYER_NBG1], cliprect, 1);
+ update_tilemap_zoom(screen, &m_layer_data[MIXER_LAYER_NBG1], cliprect, 1);
if (enable2)
- update_tilemap_rowscroll(screen, &state->m_layer_data[MIXER_LAYER_NBG2], cliprect, 2);
+ update_tilemap_rowscroll(screen, &m_layer_data[MIXER_LAYER_NBG2], cliprect, 2);
if (enable3)
- update_tilemap_rowscroll(screen, &state->m_layer_data[MIXER_LAYER_NBG3], cliprect, 3);
+ update_tilemap_rowscroll(screen, &m_layer_data[MIXER_LAYER_NBG3], cliprect, 3);
if (enablet)
- update_tilemap_text(screen, &state->m_layer_data[MIXER_LAYER_TEXT], cliprect);
+ update_tilemap_text(screen, &m_layer_data[MIXER_LAYER_TEXT], cliprect);
if (enableb)
- update_bitmap(screen, &state->m_layer_data[MIXER_LAYER_BITMAP], cliprect);
- update_background(state, &state->m_layer_data[MIXER_LAYER_BACKGROUND], cliprect);
+ update_bitmap(screen, &m_layer_data[MIXER_LAYER_BITMAP], cliprect);
+ update_background(&m_layer_data[MIXER_LAYER_BACKGROUND], cliprect);
return (enablet << 0) | (enable0 << 1) | (enable1 << 2) | (enable2 << 3) | (enable3 << 4) | (enableb << 5);
}
@@ -1523,35 +1483,35 @@ static UINT8 update_tilemaps(screen_device &screen, const rectangle &cliprect)
*
*************************************/
-static void sprite_erase_buffer(segas32_state *state)
+void segas32_state::sprite_erase_buffer()
{
/* erase the visible sprite buffer and clear the checksums */
- state->m_layer_data[MIXER_LAYER_SPRITES].bitmap->fill(0xffff);
+ m_layer_data[MIXER_LAYER_SPRITES].bitmap->fill(0xffff);
/* for multi32, erase the other buffer as well */
- if (state->m_is_multi32)
- state->m_layer_data[MIXER_LAYER_MULTISPR].bitmap->fill(0xffff);
+ if (m_is_multi32)
+ m_layer_data[MIXER_LAYER_MULTISPR].bitmap->fill(0xffff);
}
-static void sprite_swap_buffers(segas32_state *state)
+void segas32_state::sprite_swap_buffers()
{
/* swap between the two sprite buffers */
- struct layer_info temp;
- temp = state->m_layer_data[MIXER_LAYER_SPRITES];
- state->m_layer_data[MIXER_LAYER_SPRITES] = state->m_layer_data[MIXER_LAYER_SPRITES_2];
- state->m_layer_data[MIXER_LAYER_SPRITES_2] = temp;
+ struct segas32_state::layer_info temp;
+ temp = m_layer_data[MIXER_LAYER_SPRITES];
+ m_layer_data[MIXER_LAYER_SPRITES] = m_layer_data[MIXER_LAYER_SPRITES_2];
+ m_layer_data[MIXER_LAYER_SPRITES_2] = temp;
/* for multi32, swap the other buffer as well */
- if (state->m_is_multi32)
+ if (m_is_multi32)
{
- temp = state->m_layer_data[MIXER_LAYER_MULTISPR];
- state->m_layer_data[MIXER_LAYER_MULTISPR] = state->m_layer_data[MIXER_LAYER_MULTISPR_2];
- state->m_layer_data[MIXER_LAYER_MULTISPR_2] = temp;
+ temp = m_layer_data[MIXER_LAYER_MULTISPR];
+ m_layer_data[MIXER_LAYER_MULTISPR] = m_layer_data[MIXER_LAYER_MULTISPR_2];
+ m_layer_data[MIXER_LAYER_MULTISPR_2] = temp;
}
/* latch any pending info */
- memcpy(state->m_sprite_control_latched, state->m_sprite_control, sizeof(state->m_sprite_control_latched));
+ memcpy(m_sprite_control_latched, m_sprite_control, sizeof(m_sprite_control_latched));
}
@@ -1652,9 +1612,8 @@ static void sprite_swap_buffers(segas32_state *state)
} \
}
-static int draw_one_sprite(running_machine &machine, UINT16 *data, int xoffs, int yoffs, const rectangle &clipin, const rectangle &clipout)
+int segas32_state::draw_one_sprite(UINT16 *data, int xoffs, int yoffs, const rectangle &clipin, const rectangle &clipout)
{
- segas32_state *state = machine.driver_data<segas32_state>();
static const int transparency_masks[4][4] =
{
{ 0x7fff, 0x3fff, 0x1fff, 0x0fff },
@@ -1663,13 +1622,13 @@ static int draw_one_sprite(running_machine &machine, UINT16 *data, int xoffs, in
{ 0x1fff, 0x0fff, 0x07ff, 0x03ff }
};
- bitmap_ind16 &bitmap = *state->m_layer_data[(!state->m_is_multi32 || !(data[3] & 0x0800)) ? MIXER_LAYER_SPRITES_2 : MIXER_LAYER_MULTISPR_2].bitmap;
- UINT8 numbanks = machine.root_device().memregion("gfx2")->bytes() / 0x400000;
- const UINT32 *spritebase = (const UINT32 *)machine.root_device().memregion("gfx2")->base();
+ bitmap_ind16 &bitmap = *m_layer_data[(!m_is_multi32 || !(data[3] & 0x0800)) ? MIXER_LAYER_SPRITES_2 : MIXER_LAYER_MULTISPR_2].bitmap;
+ UINT8 numbanks = machine().root_device().memregion("gfx2")->bytes() / 0x400000;
+ const UINT32 *spritebase = (const UINT32 *)machine().root_device().memregion("gfx2")->base();
int indirect = data[0] & 0x2000;
int indlocal = data[0] & 0x1000;
- int shadow = (data[0] & 0x0800) && (state->m_sprite_control_latched[0x0a/2] & 1);
+ int shadow = (data[0] & 0x0800) && (m_sprite_control_latched[0x0a/2] & 1);
int fromram = data[0] & 0x0400;
int bpp8 = data[0] & 0x0200;
int transp = (data[0] & 0x0100) ? 0 : (bpp8 ? 0xff : 0x0f);
@@ -1681,7 +1640,7 @@ static int draw_one_sprite(running_machine &machine, UINT16 *data, int xoffs, in
int adjustx = (data[0] >> 0) & 3;
int srch = (data[1] >> 8);
int srcw = bpp8 ? (data[1] & 0x3f) : ((data[1] >> 1) & 0x3f);
- int bank = state->m_is_multi32 ?
+ int bank = m_is_multi32 ?
((data[3] & 0x2000) >> 13) | ((data[3] & 0x8000) >> 14) :
((data[3] & 0x0800) >> 11) | ((data[3] & 0x4000) >> 13);
int dsth = data[2] & 0x3ff;
@@ -1702,22 +1661,22 @@ static int draw_one_sprite(running_machine &machine, UINT16 *data, int xoffs, in
goto bail;
/* determine the transparency mask for pixels */
- transmask = transparency_masks[state->m_sprite_control_latched[0x08/2] & 3][state->m_sprite_control_latched[0x0a/2] & 3];
+ transmask = transparency_masks[m_sprite_control_latched[0x08/2] & 3][m_sprite_control_latched[0x0a/2] & 3];
if (bpp8)
transmask &= 0xfff0;
/* create the local palette for the indirect case */
if (indirect)
{
- UINT16 *src = indlocal ? &data[8] : &state->m_system32_spriteram[8 * (data[7] & 0x1fff)];
+ UINT16 *src = indlocal ? &data[8] : &m_system32_spriteram[8 * (data[7] & 0x1fff)];
for (x = 0; x < 16; x++)
- indtable[x] = (src[x] & (bpp8 ? 0xfff0 : 0xffff)) | ((state->m_sprite_control_latched[0x0a/2] & 1) ? 0x8000 : 0x0000);
+ indtable[x] = (src[x] & (bpp8 ? 0xfff0 : 0xffff)) | ((m_sprite_control_latched[0x0a/2] & 1) ? 0x8000 : 0x0000);
}
/* clamp to within the memory region size */
if (fromram)
{
- spritedata = state->m_spriteram_32bit;
+ spritedata = m_spriteram_32bit;
addrmask = (0x20000 / 4) - 1;
}
else
@@ -1854,9 +1813,8 @@ bail:
-static void sprite_render_list(running_machine &machine)
+void segas32_state::sprite_render_list()
{
- segas32_state *state = machine.driver_data<segas32_state>();
rectangle outerclip, clipin, clipout;
int xoffs = 0, yoffs = 0;
int numentries = 0;
@@ -1869,7 +1827,7 @@ static void sprite_render_list(running_machine &machine)
/* compute the outer clip */
outerclip.min_x = outerclip.min_y = 0;
- outerclip.max_x = (state->m_sprite_control_latched[0x0c/2] & 1) ? 415 : 319;
+ outerclip.max_x = (m_sprite_control_latched[0x0c/2] & 1) ? 415 : 319;
outerclip.max_y = 223;
/* initialize the cliprects */
@@ -1881,12 +1839,12 @@ static void sprite_render_list(running_machine &machine)
while (numentries++ < 0x20000/16)
{
/* top two bits are a command */
- sprite = &state->m_system32_spriteram[8 * (spritenum & 0x1fff)];
+ sprite = &m_system32_spriteram[8 * (spritenum & 0x1fff)];
switch (sprite[0] >> 14)
{
/* command 0 = draw sprite */
case 0:
- spritenum += 1 + draw_one_sprite(machine, sprite, xoffs, yoffs, clipin, clipout);
+ spritenum += 1 + draw_one_sprite(sprite, xoffs, yoffs, clipin, clipout);
break;
/* command 1 = set clipping */
@@ -1945,9 +1903,9 @@ static void sprite_render_list(running_machine &machine)
*
*************************************/
-INLINE UINT8 compute_color_offsets(segas32_state *state,int which, int layerbit, int layerflag)
+inline UINT8 segas32_state::compute_color_offsets(int which, int layerbit, int layerflag)
{
- int mode = ((state->m_mixer_control[which][0x3e/2] & 0x8000) >> 14) | (layerbit & 1);
+ int mode = ((m_mixer_control[which][0x3e/2] & 0x8000) >> 14) | (layerbit & 1);
switch (mode)
{
@@ -1965,7 +1923,7 @@ INLINE UINT8 compute_color_offsets(segas32_state *state,int which, int layerbit,
}
}
-INLINE UINT16 compute_sprite_blend(UINT8 encoding)
+inline UINT16 segas32_state::compute_sprite_blend(UINT8 encoding)
{
int value = encoding & 0xf;
@@ -1986,17 +1944,17 @@ INLINE UINT16 compute_sprite_blend(UINT8 encoding)
}
}
-INLINE UINT16 *get_layer_scanline(segas32_state *state, int layer, int scanline)
+inline UINT16 *segas32_state::get_layer_scanline(int layer, int scanline)
{
- if (state->m_layer_data[layer].transparent[scanline])
- return (layer == MIXER_LAYER_SPRITES) ? state->m_solid_ffff : state->m_solid_0000;
- return &state->m_layer_data[layer].bitmap->pix16(scanline);
+ if (m_layer_data[layer].transparent[scanline])
+ return (layer == MIXER_LAYER_SPRITES) ? m_solid_ffff : m_solid_0000;
+ return &m_layer_data[layer].bitmap->pix16(scanline);
}
-static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 enablemask)
+void segas32_state::mix_all_layers(int which, int xoffs, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 enablemask)
{
- int blendenable = state->m_mixer_control[which][0x4e/2] & 0x0800;
- int blendfactor = (state->m_mixer_control[which][0x4e/2] >> 8) & 7;
+ int blendenable = m_mixer_control[which][0x4e/2] & 0x0800;
+ int blendfactor = (m_mixer_control[which][0x4e/2] >> 8) & 7;
struct mixer_layer_info
{
UINT16 palbase; /* palette base from control reg */
@@ -2020,23 +1978,23 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
/* if we are the second monitor on multi32, swap in the proper sprite bank */
if (which == 1)
{
- temp_sprite_save = state->m_layer_data[MIXER_LAYER_SPRITES];
- state->m_layer_data[MIXER_LAYER_SPRITES] = state->m_layer_data[MIXER_LAYER_MULTISPR];
+ temp_sprite_save = m_layer_data[MIXER_LAYER_SPRITES];
+ m_layer_data[MIXER_LAYER_SPRITES] = m_layer_data[MIXER_LAYER_MULTISPR];
}
/* extract the RGB offsets */
- rgboffs[0][0] = (INT8)(state->m_mixer_control[which][0x40/2] << 2) >> 2;
- rgboffs[0][1] = (INT8)(state->m_mixer_control[which][0x42/2] << 2) >> 2;
- rgboffs[0][2] = (INT8)(state->m_mixer_control[which][0x44/2] << 2) >> 2;
- rgboffs[1][0] = (INT8)(state->m_mixer_control[which][0x46/2] << 2) >> 2;
- rgboffs[1][1] = (INT8)(state->m_mixer_control[which][0x48/2] << 2) >> 2;
- rgboffs[1][2] = (INT8)(state->m_mixer_control[which][0x4a/2] << 2) >> 2;
+ rgboffs[0][0] = (INT8)(m_mixer_control[which][0x40/2] << 2) >> 2;
+ rgboffs[0][1] = (INT8)(m_mixer_control[which][0x42/2] << 2) >> 2;
+ rgboffs[0][2] = (INT8)(m_mixer_control[which][0x44/2] << 2) >> 2;
+ rgboffs[1][0] = (INT8)(m_mixer_control[which][0x46/2] << 2) >> 2;
+ rgboffs[1][1] = (INT8)(m_mixer_control[which][0x48/2] << 2) >> 2;
+ rgboffs[1][2] = (INT8)(m_mixer_control[which][0x4a/2] << 2) >> 2;
rgboffs[2][0] = 0;
rgboffs[2][1] = 0;
rgboffs[2][2] = 0;
/* determine the sprite grouping parameters first */
- switch (state->m_mixer_control[which][0x4c/2] & 0x0f)
+ switch (m_mixer_control[which][0x4c/2] & 0x0f)
{
default:
case 0x0: sprgroup_shift = 14; sprgroup_mask = 0x00; sprgroup_or = 0x01; break;
@@ -2059,7 +2017,7 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
case 0xe: sprgroup_shift = 11; sprgroup_mask = 0x07; sprgroup_or = 0x00; break;
case 0xf: sprgroup_shift = 10; sprgroup_mask = 0x0f; sprgroup_or = 0x00; break;
}
- sprshadowmask = (state->m_mixer_control[which][0x4c/2] & 0x04) ? 0x8000 : 0x0000;
+ sprshadowmask = (m_mixer_control[which][0x4c/2] & 0x04) ? 0x8000 : 0x0000;
sprpixmask = ((1 << sprgroup_shift) - 1) & 0x3fff;
sprshadow = 0x7ffe & sprpixmask;
@@ -2067,16 +2025,16 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
numlayers = 0;
for (laynum = MIXER_LAYER_TEXT; laynum <= MIXER_LAYER_BITMAP; laynum++)
{
- int priority = state->m_mixer_control[which][0x20/2 + laynum] & 0x0f;
+ int priority = m_mixer_control[which][0x20/2 + laynum] & 0x0f;
if ((enablemask & (1 << laynum)) && priority != 0)
{
layersort[numlayers].index = laynum;
layersort[numlayers].effpri = (priority << 3) | (6 - laynum);
- layersort[numlayers].palbase = (state->m_mixer_control[which][0x20/2 + laynum] & 0x00f0) << 6;
- layersort[numlayers].mixshift = (state->m_mixer_control[which][0x20/2 + laynum] >> 8) & 3;
- layersort[numlayers].blendmask = blendenable ? ((state->m_mixer_control[which][0x30/2 + laynum] >> 6) & 0xff) : 0;
- layersort[numlayers].sprblendmask = compute_sprite_blend(state->m_mixer_control[which][0x30/2 + laynum] & 0x3f);
- layersort[numlayers].coloroffs = compute_color_offsets(state, which, (state->m_mixer_control[which][0x3e/2] >> laynum) & 1, (state->m_mixer_control[which][0x30/2 + laynum] >> 14) & 1);
+ layersort[numlayers].palbase = (m_mixer_control[which][0x20/2 + laynum] & 0x00f0) << 6;
+ layersort[numlayers].mixshift = (m_mixer_control[which][0x20/2 + laynum] >> 8) & 3;
+ layersort[numlayers].blendmask = blendenable ? ((m_mixer_control[which][0x30/2 + laynum] >> 6) & 0xff) : 0;
+ layersort[numlayers].sprblendmask = compute_sprite_blend(m_mixer_control[which][0x30/2 + laynum] & 0x3f);
+ layersort[numlayers].coloroffs = compute_color_offsets(which, (m_mixer_control[which][0x3e/2] >> laynum) & 1, (m_mixer_control[which][0x30/2 + laynum] >> 14) & 1);
numlayers++;
}
}
@@ -2084,11 +2042,11 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
/* extract info about the BACKGROUND layer */
layersort[numlayers].index = MIXER_LAYER_BACKGROUND;
layersort[numlayers].effpri = (1 << 3) | 0;
- layersort[numlayers].palbase = (state->m_mixer_control[which][0x2c/2] & 0x00f0) << 6;
- layersort[numlayers].mixshift = (state->m_mixer_control[which][0x2c/2] >> 8) & 3;
+ layersort[numlayers].palbase = (m_mixer_control[which][0x2c/2] & 0x00f0) << 6;
+ layersort[numlayers].mixshift = (m_mixer_control[which][0x2c/2] >> 8) & 3;
layersort[numlayers].blendmask = 0;
layersort[numlayers].sprblendmask = 0;
- layersort[numlayers].coloroffs = compute_color_offsets(state, which, (state->m_mixer_control[which][0x3e/2] >> 8) & 1, (state->m_mixer_control[which][0x3e/2] >> 14) & 1);
+ layersort[numlayers].coloroffs = compute_color_offsets(which, (m_mixer_control[which][0x3e/2] >> 8) & 1, (m_mixer_control[which][0x3e/2] >> 14) & 1);
numlayers++;
/* now bubble sort the list by effective priority */
@@ -2105,7 +2063,7 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
for (groupnum = 0; groupnum <= sprgroup_mask; groupnum++)
{
int effgroup = sprgroup_or | groupnum;
- int priority = state->m_mixer_control[which][0x00/2 + effgroup] & 0x0f;
+ int priority = m_mixer_control[which][0x00/2 + effgroup] & 0x0f;
int effpri = (priority << 3) | 7;
int sprindex = numlayers;
int dstnum = 0;
@@ -2121,14 +2079,14 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
/* build the sprite entry */
layerorder[groupnum][sprindex].index = MIXER_LAYER_SPRITES;
layerorder[groupnum][sprindex].effpri = effpri;
- if ((state->m_mixer_control[which][0x4c/2] & 3) != 3)
- layerorder[groupnum][sprindex].palbase = (state->m_mixer_control[which][0x00/2 + effgroup] & 0x00f0) << 6;
+ if ((m_mixer_control[which][0x4c/2] & 3) != 3)
+ layerorder[groupnum][sprindex].palbase = (m_mixer_control[which][0x00/2 + effgroup] & 0x00f0) << 6;
else
- layerorder[groupnum][sprindex].palbase = (state->m_mixer_control[which][0x4c/2] & 0x00f0) << 6;
- layerorder[groupnum][sprindex].mixshift = (state->m_mixer_control[which][0x00/2 + effgroup] >> 8) & 3;
+ layerorder[groupnum][sprindex].palbase = (m_mixer_control[which][0x4c/2] & 0x00f0) << 6;
+ layerorder[groupnum][sprindex].mixshift = (m_mixer_control[which][0x00/2 + effgroup] >> 8) & 3;
layerorder[groupnum][sprindex].blendmask = 0;
layerorder[groupnum][sprindex].sprblendmask = 0;
- layerorder[groupnum][sprindex].coloroffs = compute_color_offsets(state, which, (state->m_mixer_control[which][0x3e/2] >> 6) & 1, (state->m_mixer_control[which][0x4c/2] >> 15) & 1);
+ layerorder[groupnum][sprindex].coloroffs = compute_color_offsets(which, (m_mixer_control[which][0x3e/2] >> 6) & 1, (m_mixer_control[which][0x4c/2] >> 15) & 1);
}
/*
{
@@ -2144,7 +2102,7 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
/* based on the sprite controller flip bits, the data is scanned to us in different */
/* directions; account for this */
- if (state->m_sprite_control_latched[0x04/2] & 1)
+ if (m_sprite_control_latched[0x04/2] & 1)
{
sprx_start = cliprect.max_x;
sprdx = -1;
@@ -2155,7 +2113,7 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
sprdx = 1;
}
- if (state->m_sprite_control_latched[0x04/2] & 2)
+ if (m_sprite_control_latched[0x04/2] & 2)
{
spry = cliprect.max_y;
sprdy = -1;
@@ -2173,14 +2131,14 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
UINT16 *layerbase[8];
/* get the starting address for each layer */
- layerbase[MIXER_LAYER_TEXT] = get_layer_scanline(state, MIXER_LAYER_TEXT, y);
- layerbase[MIXER_LAYER_NBG0] = get_layer_scanline(state, MIXER_LAYER_NBG0, y);
- layerbase[MIXER_LAYER_NBG1] = get_layer_scanline(state, MIXER_LAYER_NBG1, y);
- layerbase[MIXER_LAYER_NBG2] = get_layer_scanline(state, MIXER_LAYER_NBG2, y);
- layerbase[MIXER_LAYER_NBG3] = get_layer_scanline(state, MIXER_LAYER_NBG3, y);
- layerbase[MIXER_LAYER_BITMAP] = get_layer_scanline(state, MIXER_LAYER_BITMAP, y);
- layerbase[MIXER_LAYER_SPRITES] = get_layer_scanline(state, MIXER_LAYER_SPRITES, spry);
- layerbase[MIXER_LAYER_BACKGROUND] = get_layer_scanline(state, MIXER_LAYER_BACKGROUND, y);
+ layerbase[MIXER_LAYER_TEXT] = get_layer_scanline(MIXER_LAYER_TEXT, y);
+ layerbase[MIXER_LAYER_NBG0] = get_layer_scanline(MIXER_LAYER_NBG0, y);
+ layerbase[MIXER_LAYER_NBG1] = get_layer_scanline(MIXER_LAYER_NBG1, y);
+ layerbase[MIXER_LAYER_NBG2] = get_layer_scanline(MIXER_LAYER_NBG2, y);
+ layerbase[MIXER_LAYER_NBG3] = get_layer_scanline(MIXER_LAYER_NBG3, y);
+ layerbase[MIXER_LAYER_BITMAP] = get_layer_scanline(MIXER_LAYER_BITMAP, y);
+ layerbase[MIXER_LAYER_SPRITES] = get_layer_scanline(MIXER_LAYER_SPRITES, spry);
+ layerbase[MIXER_LAYER_BACKGROUND] = get_layer_scanline(MIXER_LAYER_BACKGROUND, y);
/* loop over columns */
for (x = cliprect.min_x, sprx = sprx_start; x <= cliprect.max_x; x++, sprx += sprdx)
@@ -2225,7 +2183,7 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
}
/* adjust the first pixel */
- firstpix = state->m_system32_paletteram[which][(first->palbase + ((firstpix >> first->mixshift) & 0xfff0) + (firstpix & 0x0f)) & 0x3fff];
+ firstpix = m_system32_paletteram[which][(first->palbase + ((firstpix >> first->mixshift) & 0xfff0) + (firstpix & 0x0f)) & 0x3fff];
/* compute R, G, B */
rgbdelta = &rgboffs[first->coloroffs][0];
@@ -2272,7 +2230,7 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
(laynum != MIXER_LAYER_SPRITES || (first->sprblendmask & (1 << sprgroup))))
{
/* adjust the second pixel */
- secondpix = state->m_system32_paletteram[which][(second->palbase + ((secondpix >> second->mixshift) & 0xfff0) + (secondpix & 0x0f)) & 0x3fff];
+ secondpix = m_system32_paletteram[which][(second->palbase + ((secondpix >> second->mixshift) & 0xfff0) + (secondpix & 0x0f)) & 0x3fff];
/* compute first RGB */
r *= 7 - blendfactor;
@@ -2323,7 +2281,7 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
/* if we are the second monitor on multi32, swap back the sprite layer */
if (which == 1)
- state->m_layer_data[MIXER_LAYER_SPRITES] = temp_sprite_save;
+ m_layer_data[MIXER_LAYER_SPRITES] = temp_sprite_save;
}
@@ -2334,73 +2292,73 @@ static void mix_all_layers(segas32_state *state, int which, int xoffs, bitmap_rg
*
*************************************/
-static void print_mixer_data(segas32_state *state, int which)
+void segas32_state::print_mixer_data(int which)
{
- if (++state->m_print_count > 60 * 5)
+ if (++m_print_count > 60 * 5)
{
mame_printf_debug("\n");
- mame_printf_debug("OP: %04X\n", state->m_system32_videoram[0x1ff8e/2]);
+ mame_printf_debug("OP: %04X\n", m_system32_videoram[0x1ff8e/2]);
mame_printf_debug("SC: %04X %04X %04X %04X - %04X %04X %04X %04X\n",
- state->m_sprite_control_latched[0x00],
- state->m_sprite_control_latched[0x01],
- state->m_sprite_control_latched[0x02],
- state->m_sprite_control_latched[0x03],
- state->m_sprite_control_latched[0x04],
- state->m_sprite_control_latched[0x05],
- state->m_sprite_control_latched[0x06],
- state->m_sprite_control_latched[0x07]);
+ m_sprite_control_latched[0x00],
+ m_sprite_control_latched[0x01],
+ m_sprite_control_latched[0x02],
+ m_sprite_control_latched[0x03],
+ m_sprite_control_latched[0x04],
+ m_sprite_control_latched[0x05],
+ m_sprite_control_latched[0x06],
+ m_sprite_control_latched[0x07]);
mame_printf_debug("00: %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X\n",
- state->m_mixer_control[which][0x00],
- state->m_mixer_control[which][0x01],
- state->m_mixer_control[which][0x02],
- state->m_mixer_control[which][0x03],
- state->m_mixer_control[which][0x04],
- state->m_mixer_control[which][0x05],
- state->m_mixer_control[which][0x06],
- state->m_mixer_control[which][0x07],
- state->m_mixer_control[which][0x08],
- state->m_mixer_control[which][0x09],
- state->m_mixer_control[which][0x0a],
- state->m_mixer_control[which][0x0b],
- state->m_mixer_control[which][0x0c],
- state->m_mixer_control[which][0x0d],
- state->m_mixer_control[which][0x0e],
- state->m_mixer_control[which][0x0f]);
+ m_mixer_control[which][0x00],
+ m_mixer_control[which][0x01],
+ m_mixer_control[which][0x02],
+ m_mixer_control[which][0x03],
+ m_mixer_control[which][0x04],
+ m_mixer_control[which][0x05],
+ m_mixer_control[which][0x06],
+ m_mixer_control[which][0x07],
+ m_mixer_control[which][0x08],
+ m_mixer_control[which][0x09],
+ m_mixer_control[which][0x0a],
+ m_mixer_control[which][0x0b],
+ m_mixer_control[which][0x0c],
+ m_mixer_control[which][0x0d],
+ m_mixer_control[which][0x0e],
+ m_mixer_control[which][0x0f]);
mame_printf_debug("20: %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X\n",
- state->m_mixer_control[which][0x10],
- state->m_mixer_control[which][0x11],
- state->m_mixer_control[which][0x12],
- state->m_mixer_control[which][0x13],
- state->m_mixer_control[which][0x14],
- state->m_mixer_control[which][0x15],
- state->m_mixer_control[which][0x16],
- state->m_mixer_control[which][0x17],
- state->m_mixer_control[which][0x18],
- state->m_mixer_control[which][0x19],
- state->m_mixer_control[which][0x1a],
- state->m_mixer_control[which][0x1b],
- state->m_mixer_control[which][0x1c],
- state->m_mixer_control[which][0x1d],
- state->m_mixer_control[which][0x1e],
- state->m_mixer_control[which][0x1f]);
+ m_mixer_control[which][0x10],
+ m_mixer_control[which][0x11],
+ m_mixer_control[which][0x12],
+ m_mixer_control[which][0x13],
+ m_mixer_control[which][0x14],
+ m_mixer_control[which][0x15],
+ m_mixer_control[which][0x16],
+ m_mixer_control[which][0x17],
+ m_mixer_control[which][0x18],
+ m_mixer_control[which][0x19],
+ m_mixer_control[which][0x1a],
+ m_mixer_control[which][0x1b],
+ m_mixer_control[which][0x1c],
+ m_mixer_control[which][0x1d],
+ m_mixer_control[which][0x1e],
+ m_mixer_control[which][0x1f]);
mame_printf_debug("40: %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X - %04X %04X %04X %04X\n",
- state->m_mixer_control[which][0x20],
- state->m_mixer_control[which][0x21],
- state->m_mixer_control[which][0x22],
- state->m_mixer_control[which][0x23],
- state->m_mixer_control[which][0x24],
- state->m_mixer_control[which][0x25],
- state->m_mixer_control[which][0x26],
- state->m_mixer_control[which][0x27],
- state->m_mixer_control[which][0x28],
- state->m_mixer_control[which][0x29],
- state->m_mixer_control[which][0x2a],
- state->m_mixer_control[which][0x2b],
- state->m_mixer_control[which][0x2c],
- state->m_mixer_control[which][0x2d],
- state->m_mixer_control[which][0x2e],
- state->m_mixer_control[which][0x2f]);
- state->m_print_count = 0;
+ m_mixer_control[which][0x20],
+ m_mixer_control[which][0x21],
+ m_mixer_control[which][0x22],
+ m_mixer_control[which][0x23],
+ m_mixer_control[which][0x24],
+ m_mixer_control[which][0x25],
+ m_mixer_control[which][0x26],
+ m_mixer_control[which][0x27],
+ m_mixer_control[which][0x28],
+ m_mixer_control[which][0x29],
+ m_mixer_control[which][0x2a],
+ m_mixer_control[which][0x2b],
+ m_mixer_control[which][0x2c],
+ m_mixer_control[which][0x2d],
+ m_mixer_control[which][0x2e],
+ m_mixer_control[which][0x2f]);
+ m_print_count = 0;
}
}
@@ -2438,7 +2396,7 @@ UINT32 segas32_state::screen_update_system32(screen_device &screen, bitmap_rgb32
/* do the mixing */
g_profiler.start(PROFILER_USER3);
- mix_all_layers(this, 0, 0, bitmap, cliprect, enablemask);
+ mix_all_layers(0, 0, bitmap, cliprect, enablemask);
g_profiler.stop();
if (LOG_SPRITES && machine().input().code_pressed(KEYCODE_L))
@@ -2449,7 +2407,7 @@ UINT32 segas32_state::screen_update_system32(screen_device &screen, bitmap_rgb32
for (y = visarea.min_y; y <= visarea.max_y; y++)
{
- UINT16 *src = get_layer_scanline(this, MIXER_LAYER_SPRITES, y);
+ UINT16 *src = get_layer_scanline(MIXER_LAYER_SPRITES, y);
for (x = visarea.min_x; x <= visarea.max_x; x++)
fprintf(f, "%04X ", *src++);
fprintf(f, "\n");
@@ -2459,7 +2417,7 @@ UINT32 segas32_state::screen_update_system32(screen_device &screen, bitmap_rgb32
f = fopen("nbg0.txt", "w");
for (y = visarea.min_y; y <= visarea.max_y; y++)
{
- UINT16 *src = get_layer_scanline(this, MIXER_LAYER_NBG0, y);
+ UINT16 *src = get_layer_scanline(MIXER_LAYER_NBG0, y);
for (x = visarea.min_x; x <= visarea.max_x; x++)
fprintf(f, "%04X ", *src++);
fprintf(f, "\n");
@@ -2469,7 +2427,7 @@ UINT32 segas32_state::screen_update_system32(screen_device &screen, bitmap_rgb32
f = fopen("nbg1.txt", "w");
for (y = visarea.min_y; y <= visarea.max_y; y++)
{
- UINT16 *src = get_layer_scanline(this, MIXER_LAYER_NBG1, y);
+ UINT16 *src = get_layer_scanline(MIXER_LAYER_NBG1, y);
for (x = visarea.min_x; x <= visarea.max_x; x++)
fprintf(f, "%04X ", *src++);
fprintf(f, "\n");
@@ -2479,7 +2437,7 @@ UINT32 segas32_state::screen_update_system32(screen_device &screen, bitmap_rgb32
f = fopen("nbg2.txt", "w");
for (y = visarea.min_y; y <= visarea.max_y; y++)
{
- UINT16 *src = get_layer_scanline(this, MIXER_LAYER_NBG2, y);
+ UINT16 *src = get_layer_scanline(MIXER_LAYER_NBG2, y);
for (x = visarea.min_x; x <= visarea.max_x; x++)
fprintf(f, "%04X ", *src++);
fprintf(f, "\n");
@@ -2489,7 +2447,7 @@ UINT32 segas32_state::screen_update_system32(screen_device &screen, bitmap_rgb32
f = fopen("nbg3.txt", "w");
for (y = visarea.min_y; y <= visarea.max_y; y++)
{
- UINT16 *src = get_layer_scanline(this, MIXER_LAYER_NBG3, y);
+ UINT16 *src = get_layer_scanline(MIXER_LAYER_NBG3, y);
for (x = visarea.min_x; x <= visarea.max_x; x++)
fprintf(f, "%04X ", *src++);
fprintf(f, "\n");
@@ -2530,9 +2488,9 @@ UINT32 segas32_state::screen_update_system32(screen_device &screen, bitmap_rgb32
// if (showclip != -1)
for (showclip = 0; showclip < 4; showclip++)
{
- int flip = (state->m_system32_videoram[0x1ff00/2] >> 9) & 1;
- int clips = (state->m_system32_videoram[0x1ff06/2] >> (4 * showclip)) & 0x0f;
- if (((state->m_system32_videoram[0x1ff02/2] >> (11 + showclip)) & 1) && clips)
+ int flip = (m_system32_videoram[0x1ff00/2] >> 9) & 1;
+ int clips = (m_system32_videoram[0x1ff06/2] >> (4 * showclip)) & 0x0f;
+ if (((m_system32_videoram[0x1ff02/2] >> (11 + showclip)) & 1) && clips)
{
int i, x, y;
for (i = 0; i < 4; i++)
@@ -2544,17 +2502,17 @@ for (showclip = 0; showclip < 4; showclip++)
pen_t white = get_white_pen(screen.machine());
if (!flip)
{
- rect.min_x = state->m_system32_videoram[0x1ff60/2 + i * 4] & 0x1ff;
- rect.min_y = state->m_system32_videoram[0x1ff62/2 + i * 4] & 0x0ff;
- rect.max_x = (state->m_system32_videoram[0x1ff64/2 + i * 4] & 0x1ff) + 1;
- rect.max_y = (state->m_system32_videoram[0x1ff66/2 + i * 4] & 0x0ff) + 1;
+ rect.min_x = m_system32_videoram[0x1ff60/2 + i * 4] & 0x1ff;
+ rect.min_y = m_system32_videoram[0x1ff62/2 + i * 4] & 0x0ff;
+ rect.max_x = (m_system32_videoram[0x1ff64/2 + i * 4] & 0x1ff) + 1;
+ rect.max_y = (m_system32_videoram[0x1ff66/2 + i * 4] & 0x0ff) + 1;
}
else
{
- rect.max_x = (visarea.max_x + 1) - (state->m_system32_videoram[0x1ff60/2 + i * 4] & 0x1ff);
- rect.max_y = (visarea.max_y + 1) - (state->m_system32_videoram[0x1ff62/2 + i * 4] & 0x0ff);
- rect.min_x = (visarea.max_x + 1) - ((state->m_system32_videoram[0x1ff64/2 + i * 4] & 0x1ff) + 1);
- rect.min_y = (visarea.max_y + 1) - ((state->m_system32_videoram[0x1ff66/2 + i * 4] & 0x0ff) + 1);
+ rect.max_x = (visarea.max_x + 1) - (m_system32_videoram[0x1ff60/2 + i * 4] & 0x1ff);
+ rect.max_y = (visarea.max_y + 1) - (m_system32_videoram[0x1ff62/2 + i * 4] & 0x0ff);
+ rect.min_x = (visarea.max_x + 1) - ((m_system32_videoram[0x1ff64/2 + i * 4] & 0x1ff) + 1);
+ rect.min_y = (visarea.max_y + 1) - ((m_system32_videoram[0x1ff66/2 + i * 4] & 0x0ff) + 1);
}
sect_rect(&rect, &screen.visible_area());
@@ -2577,24 +2535,23 @@ for (showclip = 0; showclip < 4; showclip++)
}
#endif
- if (PRINTF_MIXER_DATA) print_mixer_data(this, 0);
+ if (PRINTF_MIXER_DATA) print_mixer_data(0);
return 0;
}
-static UINT32 multi32_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index)
+UINT32 segas32_state::multi32_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index)
{
- segas32_state *state = screen.machine().driver_data<segas32_state>();
UINT8 enablemask;
/* update the visible area */
- if (state->m_system32_videoram[0x1ff00/2] & 0x8000)
+ if (m_system32_videoram[0x1ff00/2] & 0x8000)
screen.set_visible_area(0, 52*8-1, 0, 28*8-1);
else
screen.set_visible_area(0, 40*8-1, 0, 28*8-1);
/* if the display is off, punt */
- if (!state->m_system32_displayenable[index])
+ if (!m_system32_displayenable[index])
{
bitmap.fill(get_black_pen(screen.machine()), cliprect);
return 0;
@@ -2617,13 +2574,13 @@ static UINT32 multi32_update(screen_device &screen, bitmap_rgb32 &bitmap, const
/* do the mixing */
g_profiler.start(PROFILER_USER3);
- mix_all_layers(state, index, 0, bitmap, cliprect, enablemask);
+ mix_all_layers(index, 0, bitmap, cliprect, enablemask);
g_profiler.stop();
if (PRINTF_MIXER_DATA)
{
- if (!screen.machine().input().code_pressed(KEYCODE_M)) print_mixer_data(state, 0);
- else print_mixer_data(state, 1);
+ if (!screen.machine().input().code_pressed(KEYCODE_M)) print_mixer_data(0);
+ else print_mixer_data(1);
}
if (LOG_SPRITES && screen.machine().input().code_pressed(KEYCODE_L))
{
@@ -2633,7 +2590,7 @@ if (PRINTF_MIXER_DATA)
for (y = visarea.min_y; y <= visarea.max_y; y++)
{
- UINT16 *src = get_layer_scanline(state, MIXER_LAYER_SPRITES, y);
+ UINT16 *src = get_layer_scanline(MIXER_LAYER_SPRITES, y);
for (x = visarea.min_x; x <= visarea.max_x; x++)
fprintf(f, "%04X ", *src++);
fprintf(f, "\n");
diff --git a/src/mame/video/seibuspi.c b/src/mame/video/seibuspi.c
index 3f70edb4eab..f3bea41545d 100644
--- a/src/mame/video/seibuspi.c
+++ b/src/mame/video/seibuspi.c
@@ -23,25 +23,24 @@ WRITE32_MEMBER(seibuspi_state::spi_layer_bank_w)
}
}
-void rf2_set_layer_banks(running_machine &machine, int banks)
+void seibuspi_state::rf2_set_layer_banks(int banks)
{
- seibuspi_state *state = machine.driver_data<seibuspi_state>();
- if (state->m_rf2_layer_bank[0] != BIT(banks,0))
+ if (m_rf2_layer_bank[0] != BIT(banks,0))
{
- state->m_rf2_layer_bank[0] = BIT(banks,0);
- state->m_back_layer->mark_all_dirty();
+ m_rf2_layer_bank[0] = BIT(banks,0);
+ m_back_layer->mark_all_dirty();
}
- if (state->m_rf2_layer_bank[1] != BIT(banks,1))
+ if (m_rf2_layer_bank[1] != BIT(banks,1))
{
- state->m_rf2_layer_bank[1] = BIT(banks,1);
- state->m_mid_layer->mark_all_dirty();
+ m_rf2_layer_bank[1] = BIT(banks,1);
+ m_mid_layer->mark_all_dirty();
}
- if (state->m_rf2_layer_bank[2] != BIT(banks,2))
+ if (m_rf2_layer_bank[2] != BIT(banks,2))
{
- state->m_rf2_layer_bank[2] = BIT(banks,2);
- state->m_fore_layer->mark_all_dirty();
+ m_rf2_layer_bank[2] = BIT(banks,2);
+ m_fore_layer->mark_all_dirty();
}
}
@@ -209,9 +208,8 @@ WRITE32_MEMBER(seibuspi_state::video_dma_address_w)
COMBINE_DATA( &m_video_dma_address );
}
-static void drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy)
-{
- seibuspi_state *state = gfx->machine().driver_data<seibuspi_state>();
+void seibuspi_state::drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx, UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy)
+{
const pen_t *pens = &gfx->machine().pens[gfx->colorbase()];
const UINT8 *dp;
int i, j;
@@ -298,7 +296,7 @@ static void drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_e
for (j=y1; j <= y2; j++)
{
UINT32 *p = &bitmap.pix32(j);
- UINT8 trans_pen = (1 << state->m_sprite_bpp) - 1;
+ UINT8 trans_pen = (1 << m_sprite_bpp) - 1;
int dp_i = (py * width) + px;
py += yd;
@@ -307,8 +305,8 @@ static void drawgfx_blend(bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_e
UINT8 pen = dp[dp_i];
if (pen != trans_pen)
{
- int global_pen = pen + (color << state->m_sprite_bpp);
- UINT8 alpha = state->m_alpha_table[global_pen];
+ int global_pen = pen + (color << m_sprite_bpp);
+ UINT8 alpha = m_alpha_table[global_pen];
if (alpha)
{
p[i] = alpha_blend_r32(p[i], pens[global_pen], 0x7f);
@@ -334,9 +332,8 @@ static const int sprite_ytable[2][8] =
{ 7*16, 6*16, 5*16, 4*16, 3*16, 2*16, 1*16, 0*16 }
};
-static void draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, int pri_mask)
+void seibuspi_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int pri_mask)
{
- seibuspi_state *state = machine.driver_data<seibuspi_state>();
INT16 xpos, ypos;
int tile_num, color;
int width, height;
@@ -344,35 +341,35 @@ static void draw_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const r
int a;
int priority;
int x,y, x1, y1;
- gfx_element *gfx = machine.gfx[2];
+ gfx_element *gfx = machine().gfx[2];
- if( state->m_layer_enable & 0x10 )
+ if( m_layer_enable & 0x10 )
return;
- for( a = (state->m_sprite_dma_length / 4) - 2; a >= 0; a -= 2 ) {
- tile_num = (state->m_sprite_ram[a + 0] >> 16) & 0xffff;
- if( state->m_sprite_ram[a + 1] & 0x1000 )
+ for( a = (m_sprite_dma_length / 4) - 2; a >= 0; a -= 2 ) {
+ tile_num = (m_sprite_ram[a + 0] >> 16) & 0xffff;
+ if( m_sprite_ram[a + 1] & 0x1000 )
tile_num |= 0x10000;
if( !tile_num )
continue;
- priority = (state->m_sprite_ram[a + 0] >> 6) & 0x3;
+ priority = (m_sprite_ram[a + 0] >> 6) & 0x3;
if( pri_mask != priority )
continue;
- xpos = state->m_sprite_ram[a + 1] & 0x3ff;
+ xpos = m_sprite_ram[a + 1] & 0x3ff;
if( xpos & 0x200 )
xpos |= 0xfc00;
- ypos = (state->m_sprite_ram[a + 1] >> 16) & 0x1ff;
+ ypos = (m_sprite_ram[a + 1] >> 16) & 0x1ff;
if( ypos & 0x100 )
ypos |= 0xfe00;
- color = (state->m_sprite_ram[a + 0] & 0x3f);
+ color = (m_sprite_ram[a + 0] & 0x3f);
- width = ((state->m_sprite_ram[a + 0] >> 8) & 0x7) + 1;
- height = ((state->m_sprite_ram[a + 0] >> 12) & 0x7) + 1;
- flip_x = (state->m_sprite_ram[a + 0] >> 11) & 0x1;
- flip_y = (state->m_sprite_ram[a + 0] >> 15) & 0x1;
+ width = ((m_sprite_ram[a + 0] >> 8) & 0x7) + 1;
+ height = ((m_sprite_ram[a + 0] >> 12) & 0x7) + 1;
+ flip_x = (m_sprite_ram[a + 0] >> 11) & 0x1;
+ flip_y = (m_sprite_ram[a + 0] >> 15) & 0x1;
x1 = 0;
y1 = 0;
@@ -520,12 +517,11 @@ VIDEO_START_MEMBER(seibuspi_state,spi)
}
#ifdef UNUSED_FUNCTION
-static void set_rowscroll(tilemap_t *layer, int scroll, INT16* rows)
+void seibuspi_state::set_rowscroll(tilemap_t *layer, int scroll, INT16* rows)
{
- seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i;
- int x = state->m_spi_scrollram[scroll] & 0xffff;
- int y = (state->m_spi_scrollram[scroll] >> 16) & 0xffff;
+ int x = m_spi_scrollram[scroll] & 0xffff;
+ int y = (m_spi_scrollram[scroll] >> 16) & 0xffff;
layer->set_scroll_rows(512);
for( i=0; i < 512; i++ ) {
layer->set_scrollx(i, x + rows[i]);
@@ -533,20 +529,18 @@ static void set_rowscroll(tilemap_t *layer, int scroll, INT16* rows)
layer->set_scrolly(0, y);
}
-static void set_scroll(tilemap_t *layer, int scroll)
+void seibuspi_state::set_scroll(tilemap_t *layer, int scroll)
{
- seibuspi_state *state = machine.driver_data<seibuspi_state>();
- int x = state->m_spi_scrollram[scroll] & 0xffff;
- int y = (state->m_spi_scrollram[scroll] >> 16) & 0xffff;
+ int x = m_spi_scrollram[scroll] & 0xffff;
+ int y = (m_spi_scrollram[scroll] >> 16) & 0xffff;
layer->set_scrollx(0, x);
layer->set_scrolly(0, y);
}
#endif
-static void combine_tilemap(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *tile, int x, int y, int opaque, INT16 *rowscroll)
+void seibuspi_state::combine_tilemap(bitmap_rgb32 &bitmap, const rectangle &cliprect, tilemap_t *tile, int x, int y, int opaque, INT16 *rowscroll)
{
- seibuspi_state *state = machine.driver_data<seibuspi_state>();
int i,j;
UINT16 *s;
UINT32 *d;
@@ -574,14 +568,14 @@ static void combine_tilemap(running_machine &machine, bitmap_rgb32 &bitmap, cons
if (opaque || (t[i & xscroll_mask] & (TILEMAP_PIXEL_LAYER0 | TILEMAP_PIXEL_LAYER1)))
{
UINT16 pen = s[i & xscroll_mask];
- UINT8 alpha = state->m_alpha_table[pen];
+ UINT8 alpha = m_alpha_table[pen];
if (alpha)
{
- *d = alpha_blend_r32(*d, machine.pens[pen], 0x7f);
+ *d = alpha_blend_r32(*d, machine().pens[pen], 0x7f);
}
else
{
- *d = machine.pens[pen];
+ *d = machine().pens[pen];
}
}
++d;
@@ -608,29 +602,29 @@ UINT32 seibuspi_state::screen_update_spi(screen_device &screen, bitmap_rgb32 &bi
bitmap.fill(0, cliprect);
if (!(m_layer_enable & 0x1))
- combine_tilemap(machine(), bitmap, cliprect, m_back_layer, m_spi_scrollram[0] & 0xffff, (m_spi_scrollram[0] >> 16) & 0xffff, 1, back_rowscroll);
+ combine_tilemap(bitmap, cliprect, m_back_layer, m_spi_scrollram[0] & 0xffff, (m_spi_scrollram[0] >> 16) & 0xffff, 1, back_rowscroll);
- draw_sprites(machine(), bitmap, cliprect, 0);
+ draw_sprites(bitmap, cliprect, 0);
// if fore layer is enabled, draw priority 1 sprites behind mid layer
if (!(m_layer_enable & 0x4))
- draw_sprites(machine(), bitmap, cliprect, 1);
+ draw_sprites(bitmap, cliprect, 1);
if (!(m_layer_enable & 0x2))
- combine_tilemap(machine(), bitmap, cliprect, m_mid_layer, m_spi_scrollram[1] & 0xffff, (m_spi_scrollram[1] >> 16) & 0xffff, 0, mid_rowscroll);
+ combine_tilemap(bitmap, cliprect, m_mid_layer, m_spi_scrollram[1] & 0xffff, (m_spi_scrollram[1] >> 16) & 0xffff, 0, mid_rowscroll);
// if fore layer is disabled, draw priority 1 sprites above mid layer
if ((m_layer_enable & 0x4))
- draw_sprites(machine(), bitmap, cliprect, 1);
+ draw_sprites(bitmap, cliprect, 1);
- draw_sprites(machine(), bitmap, cliprect, 2);
+ draw_sprites(bitmap, cliprect, 2);
if (!(m_layer_enable & 0x4))
- combine_tilemap(machine(), bitmap, cliprect, m_fore_layer, m_spi_scrollram[2] & 0xffff, (m_spi_scrollram[2] >> 16) & 0xffff, 0, fore_rowscroll);
+ combine_tilemap(bitmap, cliprect, m_fore_layer, m_spi_scrollram[2] & 0xffff, (m_spi_scrollram[2] >> 16) & 0xffff, 0, fore_rowscroll);
- draw_sprites(machine(), bitmap, cliprect, 3);
+ draw_sprites(bitmap, cliprect, 3);
- combine_tilemap(machine(), bitmap, cliprect, m_text_layer, 0, 0, 0, NULL);
+ combine_tilemap(bitmap, cliprect, m_text_layer, 0, 0, 0, NULL);
return 0;
}
@@ -655,9 +649,9 @@ VIDEO_START_MEMBER(seibuspi_state,sys386f2)
UINT32 seibuspi_state::screen_update_sys386f2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
bitmap.fill(0, cliprect);
- draw_sprites(machine(), bitmap, cliprect, 0);
- draw_sprites(machine(), bitmap, cliprect, 1);
- draw_sprites(machine(), bitmap, cliprect, 2);
- draw_sprites(machine(), bitmap, cliprect, 3);
+ draw_sprites(bitmap, cliprect, 0);
+ draw_sprites(bitmap, cliprect, 1);
+ draw_sprites(bitmap, cliprect, 2);
+ draw_sprites(bitmap, cliprect, 3);
return 0;
}
diff --git a/src/mame/video/seicross.c b/src/mame/video/seicross.c
index 655b432a34b..9d0f62ee4df 100644
--- a/src/mame/video/seicross.c
+++ b/src/mame/video/seicross.c
@@ -92,39 +92,38 @@ void seicross_state::video_start()
m_bg_tilemap->set_scroll_cols(32);
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void seicross_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- seicross_state *state = machine.driver_data<seicross_state>();
- UINT8 *spriteram = state->m_spriteram;
- UINT8 *spriteram_2 = state->m_spriteram2;
+ UINT8 *spriteram = m_spriteram;
+ UINT8 *spriteram_2 = m_spriteram2;
int offs;
- for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
+ for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
int x = spriteram[offs + 3];
- drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
(spriteram[offs] & 0x3f) + ((spriteram[offs + 1] & 0x10) << 2) + 128,
spriteram[offs + 1] & 0x0f,
spriteram[offs] & 0x40,spriteram[offs] & 0x80,
x,240-spriteram[offs + 2],0);
if(x>0xf0)
- drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
(spriteram[offs] & 0x3f) + ((spriteram[offs + 1] & 0x10) << 2) + 128,
spriteram[offs + 1] & 0x0f,
spriteram[offs] & 0x40,spriteram[offs] & 0x80,
x-256,240-spriteram[offs + 2],0);
}
- for (offs = state->m_spriteram2.bytes() - 4; offs >= 0; offs -= 4)
+ for (offs = m_spriteram2.bytes() - 4; offs >= 0; offs -= 4)
{
int x = spriteram_2[offs + 3];
- drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
(spriteram_2[offs] & 0x3f) + ((spriteram_2[offs + 1] & 0x10) << 2),
spriteram_2[offs + 1] & 0x0f,
spriteram_2[offs] & 0x40,spriteram_2[offs] & 0x80,
x,240-spriteram_2[offs + 2],0);
if(x>0xf0)
- drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
(spriteram_2[offs] & 0x3f) + ((spriteram_2[offs + 1] & 0x10) << 2),
spriteram_2[offs + 1] & 0x0f,
spriteram_2[offs] & 0x40,spriteram_2[offs] & 0x80,
@@ -140,6 +139,6 @@ UINT32 seicross_state::screen_update_seicross(screen_device &screen, bitmap_ind1
m_bg_tilemap->set_scrolly(col, m_row_scroll[col]);
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/senjyo.c b/src/mame/video/senjyo.c
index a42894cb07a..d8f5a1a7ea3 100644
--- a/src/mame/video/senjyo.c
+++ b/src/mame/video/senjyo.c
@@ -156,21 +156,20 @@ WRITE8_MEMBER(senjyo_state::senjyo_bgstripes_w)
***************************************************************************/
-static void draw_bgbitmap(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
+void senjyo_state::draw_bgbitmap(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- senjyo_state *state = machine.driver_data<senjyo_state>();
int x,y,pen,strwid,count;
- if (state->m_bgstripes == 0xff) /* off */
+ if (m_bgstripes == 0xff) /* off */
bitmap.fill(0, cliprect);
else
{
- int flip = state->flip_screen();
+ int flip = flip_screen();
pen = 0;
count = 0;
- strwid = state->m_bgstripes;
+ strwid = m_bgstripes;
if (strwid == 0) strwid = 0x100;
if (flip) strwid ^= 0xff;
@@ -193,21 +192,20 @@ static void draw_bgbitmap(running_machine &machine, bitmap_ind16 &bitmap,const r
}
}
-static void draw_radar(running_machine &machine,bitmap_ind16 &bitmap,const rectangle &cliprect)
+void senjyo_state::draw_radar(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- senjyo_state *state = machine.driver_data<senjyo_state>();
int offs,x;
for (offs = 0;offs < 0x400;offs++)
for (x = 0;x < 8;x++)
- if (state->m_radarram[offs] & (1 << x))
+ if (m_radarram[offs] & (1 << x))
{
int sx, sy;
sx = (8 * (offs % 8) + x) + 256-64;
sy = ((offs & 0x1ff) / 8) + 96;
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 255 - sx;
sy = 255 - sy;
@@ -218,19 +216,18 @@ static void draw_radar(running_machine &machine,bitmap_ind16 &bitmap,const recta
}
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,int priority)
+void senjyo_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int priority)
{
- senjyo_state *state = machine.driver_data<senjyo_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs;
- for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
+ for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
int big,sx,sy,flipx,flipy;
if (((spriteram[offs+1] & 0x30) >> 4) == priority)
{
- if (state->m_is_senjyo) /* Senjyo */
+ if (m_is_senjyo) /* Senjyo */
big = (spriteram[offs] & 0x80);
else /* Star Force */
big = ((spriteram[offs] & 0xc0) == 0xc0);
@@ -242,7 +239,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
flipx = spriteram[offs+1] & 0x40;
flipy = spriteram[offs+1] & 0x80;
- if (state->flip_screen())
+ if (flip_screen())
{
flipx = !flipx;
flipy = !flipy;
@@ -260,7 +257,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
}
- drawgfx_transpen(bitmap,cliprect,machine.gfx[big ? 5 : 4],
+ drawgfx_transpen(bitmap,cliprect,machine().gfx[big ? 5 : 4],
spriteram[offs],
spriteram[offs + 1] & 0x07,
flipx,flipy,
@@ -312,16 +309,16 @@ UINT32 senjyo_state::screen_update_senjyo(screen_device &screen, bitmap_ind16 &b
m_bg3_tilemap->set_scrolly(0, scrolly);
}
- draw_bgbitmap(machine(), bitmap, cliprect);
- draw_sprites(machine(), bitmap, cliprect, 0);
+ draw_bgbitmap(bitmap, cliprect);
+ draw_sprites(bitmap, cliprect, 0);
m_bg3_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect, 1);
+ draw_sprites(bitmap, cliprect, 1);
m_bg2_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect, 2);
+ draw_sprites(bitmap, cliprect, 2);
m_bg1_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect, 3);
+ draw_sprites(bitmap, cliprect, 3);
m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_radar(machine(), bitmap, cliprect);
+ draw_radar(bitmap, cliprect);
#if 0
{
diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c
index 3797d2fcaa8..5d8155118f9 100644
--- a/src/mame/video/seta.c
+++ b/src/mame/video/seta.c
@@ -214,38 +214,37 @@ static const game_offset game_offsets[] =
---- --1- Coin #1 Counter
---- ---0 Coin #0 Counter */
-void seta_coin_lockout_w(running_machine &machine, int data)
+void seta_state::seta_coin_lockout_w(int data)
{
- seta_state *state = machine.driver_data<seta_state>();
static const char *const seta_nolockout[] =
{ "blandia", "eightfrc", "extdwnhl", "gundhara", "kamenrid", "magspeed", "sokonuke", "zingzip", "zombraid"};
/* Only compute seta_coin_lockout when confronted with a new gamedrv */
- if (!state->m_coin_lockout_initialized)
+ if (!m_coin_lockout_initialized)
{
- state->m_coin_lockout_initialized = true;
+ m_coin_lockout_initialized = true;
int i;
- state->m_coin_lockout = 1;
+ m_coin_lockout = 1;
for (i=0; i<ARRAY_LENGTH(seta_nolockout); i++)
{
- if (strcmp(machine.system().name, seta_nolockout[i]) == 0 ||
- strcmp(machine.system().parent, seta_nolockout[i]) == 0)
+ if (strcmp(machine().system().name, seta_nolockout[i]) == 0 ||
+ strcmp(machine().system().parent, seta_nolockout[i]) == 0)
{
- state->m_coin_lockout = 0;
+ m_coin_lockout = 0;
break;
}
}
}
- coin_counter_w (machine, 0, (( data) >> 0) & 1 );
- coin_counter_w (machine, 1, (( data) >> 1) & 1 );
+ coin_counter_w (machine(), 0, (( data) >> 0) & 1 );
+ coin_counter_w (machine(), 1, (( data) >> 1) & 1 );
/* some games haven't the coin lockout device */
- if ( !state->m_coin_lockout )
+ if ( !m_coin_lockout )
return;
- coin_lockout_w (machine, 0, ((~data) >> 2) & 1 );
- coin_lockout_w (machine, 1, ((~data) >> 3) & 1 );
+ coin_lockout_w (machine(), 0, ((~data) >> 2) & 1 );
+ coin_lockout_w (machine(), 1, ((~data) >> 3) & 1 );
}
@@ -267,7 +266,7 @@ WRITE16_MEMBER(seta_state::seta_vregs_w)
if (ACCESSING_BITS_0_7)
{
device_t *x1_010 = machine().device("x1snd");
- seta_coin_lockout_w (machine(), data & 0x0f);
+ seta_coin_lockout_w (data & 0x0f);
if (x1_010 != NULL)
seta_sound_enable_w (x1_010, data & 0x20);
coin_counter_w(machine(), 0,data & 0x01);
@@ -362,46 +361,44 @@ Offset + 0x4:
***************************************************************************/
-INLINE void twineagl_tile_info( running_machine &machine, tile_data &tileinfo, int tile_index, int offset )
+inline void seta_state::twineagl_tile_info( tile_data &tileinfo, int tile_index, int offset )
{
- seta_state *state = machine.driver_data<seta_state>();
- UINT16 *vram = state->m_vram_0 + offset;
+ UINT16 *vram = m_vram_0 + offset;
UINT16 code = vram[ tile_index ];
UINT16 attr = vram[ tile_index + 0x800 ];
if ((code & 0x3e00) == 0x3e00)
- code = (code & 0xc07f) | ((state->m_twineagl_tilebank[(code & 0x0180) >> 7] >> 1) << 7);
- SET_TILE_INFO( 1, (code & 0x3fff), attr & 0x1f, TILE_FLIPXY((code & 0xc000) >> 14) );
+ code = (code & 0xc07f) | ((m_twineagl_tilebank[(code & 0x0180) >> 7] >> 1) << 7);
+ SET_TILE_INFO_MEMBER( 1, (code & 0x3fff), attr & 0x1f, TILE_FLIPXY((code & 0xc000) >> 14) );
}
-TILE_GET_INFO_MEMBER(seta_state::twineagl_get_tile_info_0){ twineagl_tile_info( machine(), tileinfo, tile_index, 0x0000 ); }
-TILE_GET_INFO_MEMBER(seta_state::twineagl_get_tile_info_1){ twineagl_tile_info( machine(), tileinfo, tile_index, 0x1000 ); }
+TILE_GET_INFO_MEMBER(seta_state::twineagl_get_tile_info_0){ twineagl_tile_info(tileinfo, tile_index, 0x0000 ); }
+TILE_GET_INFO_MEMBER(seta_state::twineagl_get_tile_info_1){ twineagl_tile_info(tileinfo, tile_index, 0x1000 ); }
-INLINE void get_tile_info( running_machine &machine, tile_data &tileinfo, int tile_index, int layer, int offset )
+inline void seta_state::get_tile_info( tile_data &tileinfo, int tile_index, int layer, int offset )
{
- seta_state *state = machine.driver_data<seta_state>();
int gfx = 1 + layer;
- UINT16 *vram = (layer == 0) ? state->m_vram_0 + offset : state->m_vram_2 + offset;
- UINT16 *vctrl = (layer == 0) ? state->m_vctrl_0 : state->m_vctrl_2;
+ UINT16 *vram = (layer == 0) ? m_vram_0 + offset : m_vram_2 + offset;
+ UINT16 *vctrl = (layer == 0) ? m_vctrl_0 : m_vctrl_2;
UINT16 code = vram[ tile_index ];
UINT16 attr = vram[ tile_index + 0x800 ];
- if(machine.gfx[gfx + ((vctrl[ 4/2 ] & 0x10) >> state->m_color_mode_shift)] != NULL)
+ if(machine().gfx[gfx + ((vctrl[ 4/2 ] & 0x10) >> m_color_mode_shift)] != NULL)
{
- gfx += (vctrl[ 4/2 ] & 0x10) >> state->m_color_mode_shift;
+ gfx += (vctrl[ 4/2 ] & 0x10) >> m_color_mode_shift;
}
else
{
popmessage("Missing Color Mode = 1 for Layer = %d. Contact MAMETesters.",layer);
}
- SET_TILE_INFO( gfx, state->m_tiles_offset + (code & 0x3fff), attr & 0x1f, TILE_FLIPXY((code & 0xc000) >> 14) );
+ SET_TILE_INFO_MEMBER( gfx, m_tiles_offset + (code & 0x3fff), attr & 0x1f, TILE_FLIPXY((code & 0xc000) >> 14) );
}
-TILE_GET_INFO_MEMBER(seta_state::get_tile_info_0){ get_tile_info( machine(), tileinfo, tile_index, 0, 0x0000 ); }
-TILE_GET_INFO_MEMBER(seta_state::get_tile_info_1){ get_tile_info( machine(), tileinfo, tile_index, 0, 0x1000 ); }
-TILE_GET_INFO_MEMBER(seta_state::get_tile_info_2){ get_tile_info( machine(), tileinfo, tile_index, 1, 0x0000 ); }
-TILE_GET_INFO_MEMBER(seta_state::get_tile_info_3){ get_tile_info( machine(), tileinfo, tile_index, 1, 0x1000 ); }
+TILE_GET_INFO_MEMBER(seta_state::get_tile_info_0){ get_tile_info(tileinfo, tile_index, 0, 0x0000 ); }
+TILE_GET_INFO_MEMBER(seta_state::get_tile_info_1){ get_tile_info(tileinfo, tile_index, 0, 0x1000 ); }
+TILE_GET_INFO_MEMBER(seta_state::get_tile_info_2){ get_tile_info(tileinfo, tile_index, 1, 0x0000 ); }
+TILE_GET_INFO_MEMBER(seta_state::get_tile_info_3){ get_tile_info(tileinfo, tile_index, 1, 0x1000 ); }
WRITE16_MEMBER(seta_state::seta_vram_0_w)
@@ -511,7 +508,6 @@ VIDEO_START_MEMBER(seta_state,twineagl_1_layer)
int setac_gfxbank_callback( running_machine &machine, UINT16 code, UINT8 color )
{
- //seta_state *state = machine.driver_data<seta_state>();
int bank = (color & 0x06) >> 1;
code = (code & 0x3fff) + (bank * 0x4000);
@@ -704,65 +700,63 @@ PALETTE_INIT_MEMBER(seta_state,usclssic)
}
-static void set_pens(running_machine &machine)
+void seta_state::set_pens()
{
- seta_state *state = machine.driver_data<seta_state>();
offs_t i;
- for (i = 0; i < state->m_paletteram.bytes() / 2; i++)
+ for (i = 0; i < m_paletteram.bytes() / 2; i++)
{
- UINT16 data = state->m_paletteram[i];
+ UINT16 data = m_paletteram[i];
rgb_t color = MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
- if (machine.colortable != NULL)
- colortable_palette_set_color(machine.colortable, i, color);
+ if (machine().colortable != NULL)
+ colortable_palette_set_color(machine().colortable, i, color);
else
- palette_set_color(machine, i, color);
+ palette_set_color(machine(), i, color);
}
- if(state->m_paletteram2 != NULL)
+ if(m_paletteram2 != NULL)
{
- for (i = 0; i < state->m_paletteram2.bytes() / 2; i++)
+ for (i = 0; i < m_paletteram2.bytes() / 2; i++)
{
- UINT16 data = state->m_paletteram2[i];
+ UINT16 data = m_paletteram2[i];
rgb_t color = MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
- if (machine.colortable != NULL)
- colortable_palette_set_color(machine.colortable, i + state->m_paletteram.bytes() / 2, color);
+ if (machine().colortable != NULL)
+ colortable_palette_set_color(machine().colortable, i + m_paletteram.bytes() / 2, color);
else
- palette_set_color(machine, i + state->m_paletteram.bytes() / 2, color);
+ palette_set_color(machine(), i + m_paletteram.bytes() / 2, color);
}
}
}
-static void usclssic_set_pens(running_machine &machine)
+void seta_state::usclssic_set_pens()
{
- seta_state *state = machine.driver_data<seta_state>();
offs_t i;
for (i = 0; i < 0x200; i++)
{
- UINT16 data = state->m_paletteram[i];
+ UINT16 data = m_paletteram[i];
rgb_t color = MAKE_RGB(pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
if (i >= 0x100)
- colortable_palette_set_color(machine.colortable, i - 0x100, color);
+ colortable_palette_set_color(machine().colortable, i - 0x100, color);
else
- colortable_palette_set_color(machine.colortable, i + 0x200, color);
+ colortable_palette_set_color(machine().colortable, i + 0x200, color);
}
}
-static void draw_tilemap_palette_effect(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen)
+void seta_state::draw_tilemap_palette_effect(bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t *tilemap, int scrollx, int scrolly, int gfxnum, int flipscreen)
{
int y;
- gfx_element *gfx_tilemap = machine.gfx[gfxnum];
+ gfx_element *gfx_tilemap = machine().gfx[gfxnum];
const bitmap_ind16 &src_bitmap = tilemap->pixmap();
int width_mask, height_mask;
int opaque_mask = gfx_tilemap->granularity() - 1;
@@ -794,11 +788,11 @@ static void draw_tilemap_palette_effect(running_machine &machine, bitmap_ind16 &
// pixels with the last color are not drawn and the 2nd palette is added to the current bitmap color
if((p & pixel_effect_mask) == pixel_effect_mask)
{
- dest[x] = machine.total_colors() / 2 + dest[x];
+ dest[x] = machine().total_colors() / 2 + dest[x];
}
else
{
- dest[x] = machine.pens[p];
+ dest[x] = machine().pens[p];
}
}
}
@@ -819,7 +813,7 @@ static void draw_tilemap_palette_effect(running_machine &machine, bitmap_ind16 &
/* For games without tilemaps */
UINT32 seta_state::screen_update_seta_no_layers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- set_pens(machine());
+ set_pens();
bitmap.fill(0x1f0, cliprect);
machine().device<seta001_device>("spritegen")->seta001_draw_sprites(machine(),bitmap,cliprect,0x1000, 1);
@@ -828,48 +822,47 @@ UINT32 seta_state::screen_update_seta_no_layers(screen_device &screen, bitmap_in
/* For games with 1 or 2 tilemaps */
-void seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int sprite_bank_size, int sprite_setac )
+void seta_state::seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int sprite_bank_size, int sprite_setac )
{
- seta_state *state = screen.machine().driver_data<seta_state>();
int layers_ctrl = -1;
int enab_0, enab_1, x_0, x_1=0, y_0, y_1=0;
int order = 0;
- int flip = screen.machine().device<seta001_device>("spritegen")->is_flipped();
+ int flip = machine().device<seta001_device>("spritegen")->is_flipped();
const rectangle &visarea = screen.visible_area();
int vis_dimy = visarea.max_y - visarea.min_y + 1;
// check tilemaps color modes
- if(state->m_current_tilemap_mode[0] != (state->m_vctrl_0[ 4/2 ] & 0x10))
+ if(m_current_tilemap_mode[0] != (m_vctrl_0[ 4/2 ] & 0x10))
{
- state->m_current_tilemap_mode[0] = state->m_vctrl_0[ 4/2 ] & 0x10;
- state->m_tilemap_0->mark_all_dirty();
- state->m_tilemap_1->mark_all_dirty();
+ m_current_tilemap_mode[0] = m_vctrl_0[ 4/2 ] & 0x10;
+ m_tilemap_0->mark_all_dirty();
+ m_tilemap_1->mark_all_dirty();
}
- if(state->m_tilemap_2 != NULL && state->m_tilemap_3 != NULL)
+ if(m_tilemap_2 != NULL && m_tilemap_3 != NULL)
{
- if(state->m_current_tilemap_mode[1] != (state->m_vctrl_2[ 4/2 ] & 0x10))
+ if(m_current_tilemap_mode[1] != (m_vctrl_2[ 4/2 ] & 0x10))
{
- state->m_current_tilemap_mode[1] = state->m_vctrl_2[ 4/2 ] & 0x10;
- state->m_tilemap_2->mark_all_dirty();
- state->m_tilemap_3->mark_all_dirty();
+ m_current_tilemap_mode[1] = m_vctrl_2[ 4/2 ] & 0x10;
+ m_tilemap_2->mark_all_dirty();
+ m_tilemap_3->mark_all_dirty();
}
}
- flip ^= state->m_tilemaps_flip;
+ flip ^= m_tilemaps_flip;
screen.machine().tilemap().set_flip_all(flip ? (TILEMAP_FLIPX|TILEMAP_FLIPY) : 0 );
- x_0 = state->m_vctrl_0[ 0/2 ];
- y_0 = state->m_vctrl_0[ 2/2 ];
- enab_0 = state->m_vctrl_0[ 4/2 ];
+ x_0 = m_vctrl_0[ 0/2 ];
+ y_0 = m_vctrl_0[ 2/2 ];
+ enab_0 = m_vctrl_0[ 4/2 ];
/* Only one tilemap per layer is enabled! */
- state->m_tilemap_0->enable((!(enab_0 & 0x0008)) /*&& (enab_0 & 0x0001)*/ );
- state->m_tilemap_1->enable(( (enab_0 & 0x0008)) /*&& (enab_0 & 0x0001)*/ );
+ m_tilemap_0->enable((!(enab_0 & 0x0008)) /*&& (enab_0 & 0x0001)*/ );
+ m_tilemap_1->enable(( (enab_0 & 0x0008)) /*&& (enab_0 & 0x0001)*/ );
/* the hardware wants different scroll values when flipped */
@@ -879,7 +872,7 @@ void seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const recta
fff0 0260 = -$10, $400-$190 -$10
ffe8 0272 = -$18, $400-$190 -$18 + $1a */
- x_0 += 0x10 - state->m_global_offsets->tilemap_offs[flip ? 1 : 0];
+ x_0 += 0x10 - m_global_offsets->tilemap_offs[flip ? 1 : 0];
y_0 -= (256 - vis_dimy)/2;
if (flip)
{
@@ -887,21 +880,21 @@ void seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const recta
y_0 = y_0 - vis_dimy;
}
- state->m_tilemap_0->set_scrollx(0, x_0);
- state->m_tilemap_1->set_scrollx(0, x_0);
- state->m_tilemap_0->set_scrolly(0, y_0);
- state->m_tilemap_1->set_scrolly(0, y_0);
+ m_tilemap_0->set_scrollx(0, x_0);
+ m_tilemap_1->set_scrollx(0, x_0);
+ m_tilemap_0->set_scrolly(0, y_0);
+ m_tilemap_1->set_scrolly(0, y_0);
- if (state->m_tilemap_2)
+ if (m_tilemap_2)
{
- x_1 = state->m_vctrl_2[ 0/2 ];
- y_1 = state->m_vctrl_2[ 2/2 ];
- enab_1 = state->m_vctrl_2[ 4/2 ];
+ x_1 = m_vctrl_2[ 0/2 ];
+ y_1 = m_vctrl_2[ 2/2 ];
+ enab_1 = m_vctrl_2[ 4/2 ];
- state->m_tilemap_2->enable((!(enab_1 & 0x0008)) /*&& (enab_1 & 0x0001)*/ );
- state->m_tilemap_3->enable(( (enab_1 & 0x0008)) /*&& (enab_1 & 0x0001)*/ );
+ m_tilemap_2->enable((!(enab_1 & 0x0008)) /*&& (enab_1 & 0x0001)*/ );
+ m_tilemap_3->enable(( (enab_1 & 0x0008)) /*&& (enab_1 & 0x0001)*/ );
- x_1 += 0x10 - state->m_global_offsets->tilemap_offs[flip ? 1 : 0];
+ x_1 += 0x10 - m_global_offsets->tilemap_offs[flip ? 1 : 0];
y_1 -= (256 - vis_dimy)/2;
if (flip)
{
@@ -909,12 +902,12 @@ void seta_layers_update(screen_device &screen, bitmap_ind16 &bitmap, const recta
y_1 = y_1 - vis_dimy;
}
- state->m_tilemap_2->set_scrollx(0, x_1);
- state->m_tilemap_3->set_scrollx(0, x_1);
- state->m_tilemap_2->set_scrolly(0, y_1);
- state->m_tilemap_3->set_scrolly(0, y_1);
+ m_tilemap_2->set_scrollx(0, x_1);
+ m_tilemap_3->set_scrollx(0, x_1);
+ m_tilemap_2->set_scrolly(0, y_1);
+ m_tilemap_3->set_scrolly(0, y_1);
- order = state->m_vregs[ 2/2 ];
+ order = m_vregs[ 2/2 ];
}
@@ -926,10 +919,10 @@ if (screen.machine().input().code_pressed(KEYCODE_Z))
if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
- if (state->m_tilemap_2)
+ if (m_tilemap_2)
popmessage("VR:%04X-%04X-%04X L0:%04X L1:%04X",
- state->m_vregs[0], state->m_vregs[1], state->m_vregs[2], state->m_vctrl_0[4/2], state->m_vctrl_2[4/2]);
- else if (state->m_tilemap_0) popmessage("L0:%04X", state->m_vctrl_0[4/2]);
+ m_vregs[0], m_vregs[1], m_vregs[2], m_vctrl_0[4/2], m_vctrl_2[4/2]);
+ else if (m_tilemap_0) popmessage("L0:%04X", m_vctrl_0[4/2]);
}
#endif
@@ -937,10 +930,10 @@ if (screen.machine().input().code_pressed(KEYCODE_Z))
if (order & 1) // swap the layers?
{
- if (state->m_tilemap_2)
+ if (m_tilemap_2)
{
- if (layers_ctrl & 2) state->m_tilemap_2->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
- if (layers_ctrl & 2) state->m_tilemap_3->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
+ if (layers_ctrl & 2) m_tilemap_2->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
+ if (layers_ctrl & 2) m_tilemap_3->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
}
if (order & 2) // layer-sprite priority?
@@ -952,8 +945,8 @@ if (screen.machine().input().code_pressed(KEYCODE_Z))
popmessage("Missing palette effect. Contact MAMETesters.");
}
- if (layers_ctrl & 1) state->m_tilemap_0->draw(bitmap, cliprect, 0, 0);
- if (layers_ctrl & 1) state->m_tilemap_1->draw(bitmap, cliprect, 0, 0);
+ if (layers_ctrl & 1) m_tilemap_0->draw(bitmap, cliprect, 0, 0);
+ if (layers_ctrl & 1) m_tilemap_1->draw(bitmap, cliprect, 0, 0);
}
else
{
@@ -962,30 +955,30 @@ if (screen.machine().input().code_pressed(KEYCODE_Z))
popmessage("Missing palette effect. Contact MAMETesters.");
}
- if (layers_ctrl & 1) state->m_tilemap_0->draw(bitmap, cliprect, 0, 0);
- if (layers_ctrl & 1) state->m_tilemap_1->draw(bitmap, cliprect, 0, 0);
+ if (layers_ctrl & 1) m_tilemap_0->draw(bitmap, cliprect, 0, 0);
+ if (layers_ctrl & 1) m_tilemap_1->draw(bitmap, cliprect, 0, 0);
- if (layers_ctrl & 8) screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,sprite_bank_size, sprite_setac);
+ if (layers_ctrl & 8) machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,sprite_bank_size, sprite_setac);
}
}
else
{
- if (layers_ctrl & 1) state->m_tilemap_0->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
- if (layers_ctrl & 1) state->m_tilemap_1->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
+ if (layers_ctrl & 1) m_tilemap_0->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
+ if (layers_ctrl & 1) m_tilemap_1->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
if (order & 2) // layer-sprite priority?
{
- if (layers_ctrl & 8) screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,sprite_bank_size, sprite_setac);
+ if (layers_ctrl & 8) machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,sprite_bank_size, sprite_setac);
- if((order & 4) && state->m_paletteram2 != NULL)
+ if((order & 4) && m_paletteram2 != NULL)
{
- if(state->m_tilemap_2->enabled())
+ if(m_tilemap_2->enabled())
{
- draw_tilemap_palette_effect(screen.machine(), bitmap, cliprect, state->m_tilemap_2, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip);
+ draw_tilemap_palette_effect(bitmap, cliprect, m_tilemap_2, x_1, y_1, 2 + ((m_vctrl_2[ 4/2 ] & 0x10) >> m_color_mode_shift), flip);
}
else
{
- draw_tilemap_palette_effect(screen.machine(), bitmap, cliprect, state->m_tilemap_3, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip);
+ draw_tilemap_palette_effect(bitmap, cliprect, m_tilemap_3, x_1, y_1, 2 + ((m_vctrl_2[ 4/2 ] & 0x10) >> m_color_mode_shift), flip);
}
}
else
@@ -995,24 +988,24 @@ if (screen.machine().input().code_pressed(KEYCODE_Z))
popmessage("Missing palette effect. Contact MAMETesters.");
}
- if (state->m_tilemap_2)
+ if (m_tilemap_2)
{
- if (layers_ctrl & 2) state->m_tilemap_2->draw(bitmap, cliprect, 0, 0);
- if (layers_ctrl & 2) state->m_tilemap_3->draw(bitmap, cliprect, 0, 0);
+ if (layers_ctrl & 2) m_tilemap_2->draw(bitmap, cliprect, 0, 0);
+ if (layers_ctrl & 2) m_tilemap_3->draw(bitmap, cliprect, 0, 0);
}
}
}
else
{
- if((order & 4) && state->m_paletteram2 != NULL)
+ if((order & 4) && m_paletteram2 != NULL)
{
- if(state->m_tilemap_2->enabled())
+ if(m_tilemap_2->enabled())
{
- draw_tilemap_palette_effect(screen.machine(), bitmap, cliprect, state->m_tilemap_2, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip);
+ draw_tilemap_palette_effect(bitmap, cliprect, m_tilemap_2, x_1, y_1, 2 + ((m_vctrl_2[ 4/2 ] & 0x10) >> m_color_mode_shift), flip);
}
else
{
- draw_tilemap_palette_effect(screen.machine(), bitmap, cliprect, state->m_tilemap_3, x_1, y_1, 2 + ((state->m_vctrl_2[ 4/2 ] & 0x10) >> state->m_color_mode_shift), flip);
+ draw_tilemap_palette_effect(bitmap, cliprect, m_tilemap_3, x_1, y_1, 2 + ((m_vctrl_2[ 4/2 ] & 0x10) >> m_color_mode_shift), flip);
}
}
else
@@ -1022,14 +1015,14 @@ if (screen.machine().input().code_pressed(KEYCODE_Z))
popmessage("Missing palette effect. Contact MAMETesters.");
}
- if (state->m_tilemap_2)
+ if (m_tilemap_2)
{
- if (layers_ctrl & 2) state->m_tilemap_2->draw(bitmap, cliprect, 0, 0);
- if (layers_ctrl & 2) state->m_tilemap_3->draw(bitmap, cliprect, 0, 0);
+ if (layers_ctrl & 2) m_tilemap_2->draw(bitmap, cliprect, 0, 0);
+ if (layers_ctrl & 2) m_tilemap_3->draw(bitmap, cliprect, 0, 0);
}
}
- if (layers_ctrl & 8) screen.machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,sprite_bank_size, sprite_setac);
+ if (layers_ctrl & 8) machine().device<seta001_device>("spritegen")->seta001_draw_sprites(screen.machine(),bitmap,cliprect,sprite_bank_size, sprite_setac);
}
}
@@ -1065,14 +1058,14 @@ void seta_state::screen_eof_setaroul(screen_device &screen, bool state)
UINT32 seta_state::screen_update_seta(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- set_pens(machine());
+ set_pens();
return screen_update_seta_layers(screen, bitmap, cliprect);
}
UINT32 seta_state::screen_update_usclssic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- usclssic_set_pens(machine());
+ usclssic_set_pens();
return screen_update_seta_layers(screen, bitmap, cliprect);
}
diff --git a/src/mame/video/seta2.c b/src/mame/video/seta2.c
index 6577899ec6f..ea3f2291249 100644
--- a/src/mame/video/seta2.c
+++ b/src/mame/video/seta2.c
@@ -211,15 +211,14 @@ static void seta_drawgfx( bitmap_ind16 &bitmap, const rectangle &cliprect, gfx
}
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
+void seta2_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
// Sprites list
- seta2_state *state = machine.driver_data<seta2_state>();
- // When debugging, use state->m_spriteram here, and run mame -update_in_pause
- UINT16 *buffered_spriteram16 = state->m_buffered_spriteram;
+ // When debugging, use m_spriteram here, and run mame -update_in_pause
+ UINT16 *buffered_spriteram16 = m_buffered_spriteram;
UINT16 *s1 = buffered_spriteram16 + 0x3000/2;
- UINT16 *end = &buffered_spriteram16[state->m_spriteram.bytes()/2];
+ UINT16 *end = &buffered_spriteram16[m_spriteram.bytes()/2];
// for ( ; s1 < end; s1+=4 )
for ( ; s1 < buffered_spriteram16 + 0x4000/2; s1+=4 ) // more reasonable (and it cures MAME lockup in e.g. funcube3 boot)
@@ -250,37 +249,37 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
default:
popmessage("unknown gfxset %x",(num & 0x0700)>>8);
shadow_depth = 0;
- gfx = machine.gfx[machine.rand()&3];
+ gfx = machine().gfx[machine().rand()&3];
break;
case 0x0700: // 8bpp tiles (76543210)
shadow_depth = 8; // ?
- gfx = machine.gfx[3];
+ gfx = machine().gfx[3];
break;
case 0x0600: // 6bpp tiles (--543210) (myangel sliding blocks test)
shadow_depth = 6; // ?
- gfx = machine.gfx[2];
+ gfx = machine().gfx[2];
break;
case 0x0500: // 4bpp tiles (3210----)
shadow_depth = 4; // ?
- gfx = machine.gfx[1];
+ gfx = machine().gfx[1];
break;
case 0x0400: // 4bpp tiles (----3210)
shadow_depth = 3; // reelquak
- gfx = machine.gfx[0];
+ gfx = machine().gfx[0];
break;
// case 0x0300:
// unknown
case 0x0200: // 3bpp tiles? (-----210) (myangel "Graduate Tests")
shadow_depth = 3; // ?
- gfx = machine.gfx[4];
+ gfx = machine().gfx[4];
break;
case 0x0100: // 2bpp tiles??? (--10----) (myangel2 question bubble, myangel endgame)
shadow_depth = 2; // myangel2
- gfx = machine.gfx[5];
+ gfx = machine().gfx[5];
break;
case 0x0000: // no idea!
shadow_depth = 4; // ?
- gfx = machine.gfx[0];
+ gfx = machine().gfx[0];
break;
}
if (!use_shadow)
@@ -318,7 +317,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
sx &= 0x3ff;
sy &= 0x1ff;
- scrollx += state->m_xoffset;
+ scrollx += m_xoffset;
scrollx &= 0x3ff;
scrolly &= 0x1ff;
@@ -333,7 +332,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
if (clip.max_x > cliprect.max_x) clip.max_x = cliprect.max_x;
// sprite clipping region (y)
- clip.min_y = ((sy + yoffs) & 0x1ff) - state->m_yoffset;
+ clip.min_y = ((sy + yoffs) & 0x1ff) - m_yoffset;
clip.max_y = clip.min_y + height * 0x10 - 1;
if (clip.min_y > cliprect.max_y) continue;
@@ -346,7 +345,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
// Draw the rows
for (y = 0; y < (0x40 >> tilesize); y++)
{
- int py = ((scrolly - (y+1) * (8 << tilesize) + 0x10) & 0x1ff) - 0x10 - state->m_yoffset;
+ int py = ((scrolly - (y+1) * (8 << tilesize) + 0x10) & 0x1ff) - 0x10 - m_yoffset;
for (x = 0; x < 0x40; x++)
{
@@ -410,7 +409,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
sx = (sx & 0x1ff) - (sx & 0x200);
sy &= 0x1ff;
- sy -= state->m_yoffset;
+ sy -= m_yoffset;
code &= ~((sizex+1) * (sizey+1) - 1); // see myangel, myangel2 and grdians
@@ -478,7 +477,7 @@ UINT32 seta2_state::screen_update_seta2(screen_device &screen, bitmap_ind16 &bit
bitmap.fill(machine().pens[0], cliprect);
if ( (m_vregs[0x30/2] & 1) == 0 ) // 1 = BLANK SCREEN
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/sf.c b/src/mame/video/sf.c
index 03e0060b175..2f681d28f47 100644
--- a/src/mame/video/sf.c
+++ b/src/mame/video/sf.c
@@ -116,23 +116,22 @@ WRITE16_MEMBER(sf_state::sf_gfxctrl_w)
***************************************************************************/
-INLINE int sf_invert( int nb )
+inline int sf_state::sf_invert( int nb )
{
static const int delta[4] = {0x00, 0x18, 0x18, 0x00};
return nb ^ delta[(nb >> 3) & 3];
}
-static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect )
+void sf_state::draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect )
{
- sf_state *state = machine.driver_data<sf_state>();
int offs;
for (offs = 0x1000 - 0x20; offs >= 0; offs -= 0x20)
{
- int c = state->m_objectram[offs];
- int attr = state->m_objectram[offs + 1];
- int sy = state->m_objectram[offs + 2];
- int sx = state->m_objectram[offs + 3];
+ int c = m_objectram[offs];
+ int attr = m_objectram[offs + 1];
+ int sy = m_objectram[offs + 2];
+ int sx = m_objectram[offs + 3];
int color = attr & 0x000f;
int flipx = attr & 0x0100;
int flipy = attr & 0x0200;
@@ -141,7 +140,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap,const r
{
int c1, c2, c3, c4, t;
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 480 - sx;
sy = 224 - sy;
@@ -166,25 +165,25 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap,const r
}
drawgfx_transpen(bitmap,
- cliprect, machine.gfx[2],
+ cliprect, machine().gfx[2],
sf_invert(c1),
color,
flipx,flipy,
sx,sy, 15);
drawgfx_transpen(bitmap,
- cliprect, machine.gfx[2],
+ cliprect, machine().gfx[2],
sf_invert(c2),
color,
flipx,flipy,
sx+16,sy, 15);
drawgfx_transpen(bitmap,
- cliprect, machine.gfx[2],
+ cliprect, machine().gfx[2],
sf_invert(c3),
color,
flipx,flipy,
sx,sy+16, 15);
drawgfx_transpen(bitmap,
- cliprect, machine.gfx[2],
+ cliprect, machine().gfx[2],
sf_invert(c4),
color,
flipx,flipy,
@@ -192,7 +191,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap,const r
}
else
{
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 496 - sx;
sy = 240 - sy;
@@ -201,7 +200,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap,const r
}
drawgfx_transpen(bitmap,
- cliprect, machine.gfx[2],
+ cliprect, machine().gfx[2],
sf_invert(c),
color,
flipx,flipy,
@@ -221,7 +220,7 @@ UINT32 sf_state::screen_update_sf(screen_device &screen, bitmap_ind16 &bitmap, c
m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
if (m_sf_active & 0x80)
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
return 0;
diff --git a/src/mame/video/shadfrce.c b/src/mame/video/shadfrce.c
index bf7173b096c..5d3064ac6c7 100644
--- a/src/mame/video/shadfrce.c
+++ b/src/mame/video/shadfrce.c
@@ -92,7 +92,7 @@ WRITE16_MEMBER(shadfrce_state::shadfrce_bg1scrolly_w)
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void shadfrce_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
/* | ---- ---- hhhf Fe-Y | ---- ---- yyyy yyyy | ---- ---- TTTT TTTT | ---- ---- tttt tttt |
| ---- ---- -pCc cccX | ---- ---- xxxx xxxx | ---- ---- ---- ---- | ---- ---- ---- ---- | */
@@ -108,9 +108,8 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
P = priority
*/
- shadfrce_state *state = machine.driver_data<shadfrce_state>();
- gfx_element *gfx = machine.gfx[1];
- UINT16 *finish = state->m_spvideoram_old;
+ gfx_element *gfx = machine().gfx[1];
+ UINT16 *finish = m_spvideoram_old;
UINT16 *source = finish + 0x2000/2 - 8;
int hcount;
while( source>=finish )
@@ -130,10 +129,10 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
height++;
if (enable) {
for (hcount=0;hcount<height;hcount++) {
- pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16,machine.priority_bitmap,pri_mask,0);
- pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16,machine.priority_bitmap,pri_mask,0);
- pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16+0x200,machine.priority_bitmap,pri_mask,0);
- pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16+0x200,machine.priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16,machine().priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16,machine().priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos,ypos-hcount*16-16+0x200,machine().priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tile+hcount,pal,flipx,flipy,xpos-0x200,ypos-hcount*16-16+0x200,machine().priority_bitmap,pri_mask,0);
}
}
source-=8;
@@ -148,7 +147,7 @@ UINT32 shadfrce_state::screen_update_shadfrce(screen_device &screen, bitmap_ind1
{
m_bg1tilemap->draw(bitmap, cliprect, 0,0);
m_bg0tilemap->draw(bitmap, cliprect, 0,1);
- draw_sprites(machine(), bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
m_fgtilemap->draw(bitmap, cliprect, 0,0);
}
else
diff --git a/src/mame/video/shangkid.c b/src/mame/video/shangkid.c
index 55688ed9f3a..03f47308cbf 100644
--- a/src/mame/video/shangkid.c
+++ b/src/mame/video/shangkid.c
@@ -57,9 +57,8 @@ WRITE8_MEMBER(shangkid_state::shangkid_videoram_w)
m_background->mark_tile_dirty(offset&0x7ff );
}
-static void draw_sprite(running_machine &machine, const UINT8 *source, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void shangkid_state::draw_sprite(const UINT8 *source, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- shangkid_state *state = machine.driver_data<shangkid_state>();
gfx_element *gfx;
int transparent_pen;
int bank_index;
@@ -83,7 +82,7 @@ static void draw_sprite(running_machine &machine, const UINT8 *source, bitmap_in
if( xsize==0 && xflip ) xpos -= 16;
if( ysize==0 && yflip==0 ) ypos += 16;
- if( state->m_gfx_type == 1 )
+ if( m_gfx_type == 1 )
{
/* Shanghai Kid */
switch( bank&0x30 )
@@ -129,7 +128,7 @@ static void draw_sprite(running_machine &machine, const UINT8 *source, bitmap_in
transparent_pen = 7;
}
- gfx = machine.gfx[1+bank_index];
+ gfx = machine().gfx[1+bank_index];
width = (xscale+1)*2;
height = (yscale+1)*2;
@@ -168,16 +167,15 @@ static void draw_sprite(running_machine &machine, const UINT8 *source, bitmap_in
}
}
-static void shangkid_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void shangkid_state::shangkid_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- shangkid_state *state = machine.driver_data<shangkid_state>();
const UINT8 *source, *finish;
- finish = state->m_spriteram;
- source = state->m_spriteram+0x200;
+ finish = m_spriteram;
+ source = m_spriteram+0x200;
while( source>finish ){
source -= 8;
- draw_sprite(machine, source, bitmap,cliprect );
+ draw_sprite(source, bitmap,cliprect );
}
}
@@ -189,7 +187,7 @@ UINT32 shangkid_state::screen_update_shangkid(screen_device &screen, bitmap_ind1
m_background->set_scrolly(0,m_videoreg[2]+0x10 );
m_background->draw(bitmap, cliprect, 0,0 );
- shangkid_draw_sprites(machine(), bitmap,cliprect );
+ shangkid_draw_sprites(bitmap,cliprect );
m_background->draw(bitmap, cliprect, 1,0 ); /* high priority tiles */
return 0;
}
@@ -231,10 +229,9 @@ PALETTE_INIT_MEMBER(shangkid_state,dynamski)
}
-static void dynamski_draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri )
+void shangkid_state::dynamski_draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect, int pri )
{
- shangkid_state *state = machine.driver_data<shangkid_state>();
- UINT8 *videoram = state->m_videoram;
+ UINT8 *videoram = m_videoram;
int i;
int sx,sy;
int tile;
@@ -275,7 +272,7 @@ static void dynamski_draw_background(running_machine &machine, bitmap_ind16 &bit
drawgfx_transpen(
bitmap,
cliprect,
- machine.gfx[0],
+ machine().gfx[0],
tile,
attr & 0x0f,
0,0,//xflip,yflip,
@@ -285,10 +282,9 @@ static void dynamski_draw_background(running_machine &machine, bitmap_ind16 &bit
}
}
-static void dynamski_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void shangkid_state::dynamski_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- shangkid_state *state = machine.driver_data<shangkid_state>();
- UINT8 *videoram = state->m_videoram;
+ UINT8 *videoram = m_videoram;
int i;
int sx,sy;
int tile;
@@ -309,7 +305,7 @@ static void dynamski_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap
drawgfx_transpen(
bitmap,
cliprect,
- machine.gfx[1],
+ machine().gfx[1],
bank*0x40 + (tile&0x3f),
color,
tile&0x80,tile&0x40, /* flipx,flipy */
@@ -319,8 +315,8 @@ static void dynamski_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap
UINT32 shangkid_state::screen_update_dynamski(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- dynamski_draw_background(machine(), bitmap,cliprect, 0 );
- dynamski_draw_sprites(machine(), bitmap,cliprect );
- dynamski_draw_background(machine(), bitmap,cliprect, 1 );
+ dynamski_draw_background(bitmap,cliprect, 0 );
+ dynamski_draw_sprites(bitmap,cliprect );
+ dynamski_draw_background(bitmap,cliprect, 1 );
return 0;
}
diff --git a/src/mame/video/shaolins.c b/src/mame/video/shaolins.c
index ac934c0afa0..b61a59debf3 100644
--- a/src/mame/video/shaolins.c
+++ b/src/mame/video/shaolins.c
@@ -147,24 +147,23 @@ void shaolins_state::video_start()
m_bg_tilemap->set_scroll_cols(32);
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void shaolins_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- shaolins_state *state = machine.driver_data<shaolins_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs;
- for (offs = state->m_spriteram.bytes() - 32; offs >= 0; offs -= 32 ) /* max 24 sprites */
+ for (offs = m_spriteram.bytes() - 32; offs >= 0; offs -= 32 ) /* max 24 sprites */
{
if (spriteram[offs] && spriteram[offs + 6]) /* stop rogue sprites on high score screen */
{
int code = spriteram[offs + 8];
- int color = (spriteram[offs + 9] & 0x0f) | (state->m_palettebank << 4);
+ int color = (spriteram[offs + 9] & 0x0f) | (m_palettebank << 4);
int flipx = !(spriteram[offs + 9] & 0x40);
int flipy = spriteram[offs + 9] & 0x80;
int sx = 240 - spriteram[offs + 6];
int sy = 248 - spriteram[offs + 4];
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 240 - sx;
sy = 248 - sy;
@@ -172,11 +171,11 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
flipy = !flipy;
}
- drawgfx_transmask(bitmap, cliprect,machine.gfx[1],
+ drawgfx_transmask(bitmap, cliprect,machine().gfx[1],
code, color,
flipx, flipy,
sx, sy,
- colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, state->m_palettebank << 5));
+ colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color, m_palettebank << 5));
}
}
}
@@ -184,6 +183,6 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
UINT32 shaolins_state::screen_update_shaolins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/shootout.c b/src/mame/video/shootout.c
index 9f2700cd158..88a05488834 100644
--- a/src/mame/video/shootout.c
+++ b/src/mame/video/shootout.c
@@ -84,15 +84,14 @@ void shootout_state::video_start()
m_foreground->set_transparent_pen(0 );
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_bits )
+void shootout_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int bank_bits )
{
- shootout_state *state = machine.driver_data<shootout_state>();
- UINT8 *spriteram = state->m_spriteram;
- gfx_element *gfx = machine.gfx[1];
+ UINT8 *spriteram = m_spriteram;
+ gfx_element *gfx = machine().gfx[1];
const UINT8 *source = spriteram+127*4;
int count;
- state->m_bFlicker = !state->m_bFlicker;
+ m_bFlicker = !m_bFlicker;
for( count=0; count<128; count++ )
{
@@ -107,7 +106,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
-------x enable
*/
if ( attributes & 0x01 ){ /* visible */
- if( state->m_bFlicker || (attributes&0x02)==0 ){
+ if( m_bFlicker || (attributes&0x02)==0 ){
int priority_mask = (attributes&0x08)?0x2:0;
int sx = (240 - source[2])&0xff;
int sy = (240 - source[0])&0xff;
@@ -116,7 +115,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
int flipx = (attributes & 0x04);
int flipy = 0;
- if (state->flip_screen()) {
+ if (flip_screen()) {
flipx = !flipx;
flipy = !flipy;
}
@@ -127,7 +126,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
vx = sx;
vy = sy;
- if (state->flip_screen()) {
+ if (flip_screen()) {
vx = 240 - vx;
vy = 240 - vy;
}
@@ -137,7 +136,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
0 /*color*/,
flipx,flipy,
vx,vy,
- machine.priority_bitmap,
+ machine().priority_bitmap,
priority_mask,0);
number++;
@@ -146,7 +145,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
vx = sx;
vy = sy;
- if (state->flip_screen()) {
+ if (flip_screen()) {
vx = 240 - vx;
vy = 240 - vy;
}
@@ -156,7 +155,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
0 /*color*/,
flipx,flipy,
vx,vy,
- machine.priority_bitmap,
+ machine().priority_bitmap,
priority_mask,0);
}
}
@@ -170,7 +169,7 @@ UINT32 shootout_state::screen_update_shootout(screen_device &screen, bitmap_ind1
m_background->draw(bitmap, cliprect, 0,0);
m_foreground->draw(bitmap, cliprect, 0,1);
- draw_sprites(machine(), bitmap,cliprect,3/*bank bits */);
+ draw_sprites(bitmap,cliprect,3/*bank bits */);
return 0;
}
@@ -180,6 +179,6 @@ UINT32 shootout_state::screen_update_shootouj(screen_device &screen, bitmap_ind1
m_background->draw(bitmap, cliprect, 0,0);
m_foreground->draw(bitmap, cliprect, 0,1);
- draw_sprites(machine(), bitmap,cliprect,2/*bank bits*/);
+ draw_sprites(bitmap,cliprect,2/*bank bits*/);
return 0;
}
diff --git a/src/mame/video/sidearms.c b/src/mame/video/sidearms.c
index a420f2c664e..050dce252a8 100644
--- a/src/mame/video/sidearms.c
+++ b/src/mame/video/sidearms.c
@@ -161,14 +161,13 @@ void sidearms_state::video_start()
m_flipon = m_charon = m_staron = m_objon = m_bgon = 0;
}
-static void draw_sprites_region(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset, int end_offset )
+void sidearms_state::draw_sprites_region(bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset, int end_offset )
{
- sidearms_state *state = machine.driver_data<sidearms_state>();
- UINT8 *buffered_spriteram = state->m_spriteram->buffer();
- gfx_element *gfx = machine.gfx[2];
+ UINT8 *buffered_spriteram = m_spriteram->buffer();
+ gfx_element *gfx = machine().gfx[2];
int offs, attr, color, code, x, y, flipx, flipy;
- flipy = flipx = state->m_flipon;
+ flipy = flipx = m_flipon;
for (offs = end_offset - 32; offs >= start_offset; offs -= 32)
{
@@ -180,7 +179,7 @@ static void draw_sprites_region(running_machine &machine, bitmap_ind16 &bitmap,
code = buffered_spriteram[offs] + ((attr << 3) & 0x700);
x = buffered_spriteram[offs + 3] + ((attr << 4) & 0x100);
- if (state->m_flipon)
+ if (m_flipon)
{
x = (62 * 8) - x;
y = (30 * 8) - y;
@@ -194,14 +193,13 @@ static void draw_sprites_region(running_machine &machine, bitmap_ind16 &bitmap,
}
}
-static void sidearms_draw_starfield( running_machine &machine, bitmap_ind16 &bitmap )
+void sidearms_state::sidearms_draw_starfield( bitmap_ind16 &bitmap )
{
int x, y, i;
UINT32 hadd_283, vadd_283, _hflop_74a_n, _hcount_191, _vcount_191;
UINT8 *sf_rom;
UINT16 *lineptr;
int pixadv, lineadv;
- sidearms_state *state = machine.driver_data<sidearms_state>();
// clear starfield background
lineptr = &bitmap.pix16(16, 64);
@@ -210,16 +208,16 @@ static void sidearms_draw_starfield( running_machine &machine, bitmap_ind16 &bit
for (i=224; i; i--) { memset(lineptr, 0, 768); lineptr += lineadv; }
// bail if not Side Arms or the starfield has been disabled
- if (state->m_gameid || !state->m_staron) return;
+ if (m_gameid || !m_staron) return;
// init and cache some global vars in stack frame
hadd_283 = 0;
- _hflop_74a_n = state->m_hflop_74a_n;
- _vcount_191 = state->m_vcount_191;
- _hcount_191 = state->m_hcount_191 & 0xff;
+ _hflop_74a_n = m_hflop_74a_n;
+ _vcount_191 = m_vcount_191;
+ _hcount_191 = m_hcount_191 & 0xff;
- sf_rom = machine.root_device().memregion("user1")->base();
+ sf_rom = machine().root_device().memregion("user1")->base();
#if 0 // old loop (for reference; easier to read)
if (!flipon)
@@ -265,7 +263,7 @@ static void sidearms_draw_starfield( running_machine &machine, bitmap_ind16 &bit
lineptr += lineadv;
}
#else // optimized loop
- if (!state->m_flipon)
+ if (!m_flipon)
{
lineptr = &bitmap.pix16(16, 64);
pixadv = 1;
@@ -287,7 +285,7 @@ static void sidearms_draw_starfield( running_machine &machine, bitmap_ind16 &bit
i = vadd_283<<4 & 0xff0; // to starfield EPROM A04-A11 (8 bits)
i |= (_hflop_74a_n^(hadd_283>>8)) << 3; // to starfield EPROM A03 (1 bit)
i |= hadd_283>>5 & 7; // to starfield EPROM A00-A02 (3 bits)
- state->m_latch_374 = sf_rom[i + 0x3000]; // lines A12-A13 are always high
+ m_latch_374 = sf_rom[i + 0x3000]; // lines A12-A13 are always high
hadd_283 = _hcount_191 + 63;
@@ -306,36 +304,35 @@ static void sidearms_draw_starfield( running_machine &machine, bitmap_ind16 &bit
i = vadd_283<<4 & 0xff0; // to starfield EPROM A04-A11 (8 bits)
i |= (_hflop_74a_n^(hadd_283>>8)) << 3; // to starfield EPROM A03 (1 bit)
i |= hadd_283>>5 & 7; // to starfield EPROM A00-A02 (3 bits)
- state->m_latch_374 = sf_rom[i + 0x3000]; // lines A12-A13 are always high
+ m_latch_374 = sf_rom[i + 0x3000]; // lines A12-A13 are always high
}
- if ((~((state->m_latch_374^hadd_283)^1) & 0x1f)) continue; // logic rejection 3
+ if ((~((m_latch_374^hadd_283)^1) & 0x1f)) continue; // logic rejection 3
- *lineptr = (UINT16)(state->m_latch_374>>5 | 0x378); // to color mixer
+ *lineptr = (UINT16)(m_latch_374>>5 | 0x378); // to color mixer
}
lineptr += lineadv;
}
#endif
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void sidearms_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- sidearms_state *state = machine.driver_data<sidearms_state>();
- if (state->m_gameid == 2 || state->m_gameid == 3) // Dyger and Whizz have simple front-to-back sprite priority
- draw_sprites_region(machine, bitmap, cliprect, 0x0000, 0x1000);
+ if (m_gameid == 2 || m_gameid == 3) // Dyger and Whizz have simple front-to-back sprite priority
+ draw_sprites_region(bitmap, cliprect, 0x0000, 0x1000);
else
{
- draw_sprites_region(machine, bitmap, cliprect, 0x0700, 0x0800);
- draw_sprites_region(machine, bitmap, cliprect, 0x0e00, 0x1000);
- draw_sprites_region(machine, bitmap, cliprect, 0x0800, 0x0f00);
- draw_sprites_region(machine, bitmap, cliprect, 0x0000, 0x0700);
+ draw_sprites_region(bitmap, cliprect, 0x0700, 0x0800);
+ draw_sprites_region(bitmap, cliprect, 0x0e00, 0x1000);
+ draw_sprites_region(bitmap, cliprect, 0x0800, 0x0f00);
+ draw_sprites_region(bitmap, cliprect, 0x0000, 0x0700);
}
}
UINT32 sidearms_state::screen_update_sidearms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- sidearms_draw_starfield(machine(), bitmap);
+ sidearms_draw_starfield(bitmap);
m_bg_tilemap->set_scrollx(0, m_bg_scrollx[0] + (m_bg_scrollx[1] << 8 & 0xf00));
m_bg_tilemap->set_scrolly(0, m_bg_scrolly[0] + (m_bg_scrolly[1] << 8 & 0xf00));
@@ -344,7 +341,7 @@ UINT32 sidearms_state::screen_update_sidearms(screen_device &screen, bitmap_ind1
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
if (m_objon)
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
if (m_charon)
m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
diff --git a/src/mame/video/sidepckt.c b/src/mame/video/sidepckt.c
index 682c00f2097..bfff8c5c871 100644
--- a/src/mame/video/sidepckt.c
+++ b/src/mame/video/sidepckt.c
@@ -104,13 +104,12 @@ WRITE8_MEMBER(sidepckt_state::sidepckt_flipscreen_w)
***************************************************************************/
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
+void sidepckt_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- sidepckt_state *state = machine.driver_data<sidepckt_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs;
- for (offs = 0;offs < state->m_spriteram.bytes(); offs += 4)
+ for (offs = 0;offs < m_spriteram.bytes(); offs += 4)
{
int sx,sy,code,color,flipx,flipy;
@@ -123,13 +122,13 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
flipx = spriteram[offs+1] & 0x08;
flipy = spriteram[offs+1] & 0x04;
- drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
code,
color,
flipx,flipy,
sx,sy,0);
/* wraparound */
- drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
code,
color,
flipx,flipy,
@@ -141,7 +140,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
UINT32 sidepckt_state::screen_update_sidepckt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
- draw_sprites(machine(), bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
return 0;
}
diff --git a/src/mame/video/silkroad.c b/src/mame/video/silkroad.c
index f6112f7b5b6..c4e177e4f1e 100644
--- a/src/mame/video/silkroad.c
+++ b/src/mame/video/silkroad.c
@@ -7,11 +7,10 @@
/* Clean Up */
/* is theres a bg colour register? */
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void silkroad_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- silkroad_state *state = machine.driver_data<silkroad_state>();
- gfx_element *gfx = machine.gfx[0];
- UINT32 *source = state->m_sprram;
+ gfx_element *gfx = machine().gfx[0];
+ UINT32 *source = m_sprram;
UINT32 *finish = source + 0x1000/4;
while( source < finish )
@@ -37,14 +36,14 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
{
for (wcount=0;wcount<width;wcount++)
{
- pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+wcount,color,0,0,xpos+wcount*16+8,ypos,machine.priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+wcount,color,0,0,xpos+wcount*16+8,ypos,machine().priority_bitmap,pri_mask,0);
}
}
else
{
for (wcount=width;wcount>0;wcount--)
{
- pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+(width-wcount),color,1,0,xpos+wcount*16-16+8,ypos,machine.priority_bitmap,pri_mask,0);
+ pdrawgfx_transpen(bitmap,cliprect,gfx,tileno+(width-wcount),color,1,0,xpos+wcount*16-16+8,ypos,machine().priority_bitmap,pri_mask,0);
}
}
@@ -146,7 +145,7 @@ UINT32 silkroad_state::screen_update_silkroad(screen_device &screen, bitmap_ind1
m_fg_tilemap->draw(bitmap, cliprect, 0,0);
m_fg2_tilemap->draw(bitmap, cliprect, 0,1);
m_fg3_tilemap->draw(bitmap, cliprect, 0,2);
- draw_sprites(machine(),bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
if (0)
{
diff --git a/src/mame/video/simpsons.c b/src/mame/video/simpsons.c
index 181a08c8442..a4adeb5c5d4 100644
--- a/src/mame/video/simpsons.c
+++ b/src/mame/video/simpsons.c
@@ -90,24 +90,23 @@ WRITE8_MEMBER(simpsons_state::simpsons_k053247_w)
else m_xtraram[offset - 0x1000] = data;
}
-void simpsons_video_banking( running_machine &machine, int bank )
+void simpsons_state::simpsons_video_banking( int bank )
{
- simpsons_state *state = machine.driver_data<simpsons_state>();
- address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
if (bank & 1)
{
space.install_read_bank(0x0000, 0x0fff, "bank5");
- space.install_write_handler(0x0000, 0x0fff, write8_delegate(FUNC(simpsons_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), state));
- state->membank("bank5")->set_base(state->m_generic_paletteram_8);
+ space.install_write_handler(0x0000, 0x0fff, write8_delegate(FUNC(simpsons_state::paletteram_xBBBBBGGGGGRRRRR_byte_be_w), this));
+ membank("bank5")->set_base(m_generic_paletteram_8);
}
else
- space.install_legacy_readwrite_handler(*state->m_k052109, 0x0000, 0x0fff, FUNC(k052109_r), FUNC(k052109_w));
+ space.install_legacy_readwrite_handler(*m_k052109, 0x0000, 0x0fff, FUNC(k052109_r), FUNC(k052109_w));
if (bank & 2)
- space.install_readwrite_handler(0x2000, 0x3fff, read8_delegate(FUNC(simpsons_state::simpsons_k053247_r),state), write8_delegate(FUNC(simpsons_state::simpsons_k053247_w),state));
+ space.install_readwrite_handler(0x2000, 0x3fff, read8_delegate(FUNC(simpsons_state::simpsons_k053247_r),this), write8_delegate(FUNC(simpsons_state::simpsons_k053247_w),this));
else
- space.install_readwrite_handler(0x2000, 0x3fff, read8_delegate(FUNC(simpsons_state::simpsons_k052109_r),state), write8_delegate(FUNC(simpsons_state::simpsons_k052109_w),state));
+ space.install_readwrite_handler(0x2000, 0x3fff, read8_delegate(FUNC(simpsons_state::simpsons_k052109_r),this), write8_delegate(FUNC(simpsons_state::simpsons_k052109_w),this));
}
diff --git a/src/mame/video/skullxbo.c b/src/mame/video/skullxbo.c
index f8861eee476..7723e493ed6 100644
--- a/src/mame/video/skullxbo.c
+++ b/src/mame/video/skullxbo.c
@@ -187,21 +187,20 @@ WRITE16_HANDLER( skullxbo_playfieldlatch_w )
*
*************************************/
-void skullxbo_scanline_update(running_machine &machine, int scanline)
+void skullxbo_state::skullxbo_scanline_update(int scanline)
{
- skullxbo_state *state = machine.driver_data<skullxbo_state>();
- UINT16 *base = &state->m_alpha[(scanline / 8) * 64 + 42];
+ UINT16 *base = &m_alpha[(scanline / 8) * 64 + 42];
int x;
/* keep in range */
- if (base >= &state->m_alpha[0x7c0])
+ if (base >= &m_alpha[0x7c0])
return;
/* special case: scanline 0 should re-latch the previous raw scroll */
if (scanline == 0)
{
- int newscroll = (*state->m_yscroll >> 7) & 0x1ff;
- state->m_playfield_tilemap->set_scrolly(0, newscroll);
+ int newscroll = (*m_yscroll >> 7) & 0x1ff;
+ m_playfield_tilemap->set_scrolly(0, newscroll);
atarimo_set_yscroll(0, newscroll);
}
@@ -219,15 +218,15 @@ void skullxbo_scanline_update(running_machine &machine, int scanline)
/* force a partial update with the previous scroll */
if (scanline > 0)
- machine.primary_screen->update_partial(scanline - 1);
+ machine().primary_screen->update_partial(scanline - 1);
/* update the new scroll */
- state->m_playfield_tilemap->set_scrolly(0, newscroll);
+ m_playfield_tilemap->set_scrolly(0, newscroll);
atarimo_set_yscroll(0, newscroll);
/* make sure we change this value so that writes to the scroll register */
/* know whether or not they are a different scroll */
- *state->m_yscroll = data;
+ *m_yscroll = data;
}
}
}
diff --git a/src/mame/video/skydiver.c b/src/mame/video/skydiver.c
index 4edbd00e6e4..b82f25fd5f6 100644
--- a/src/mame/video/skydiver.c
+++ b/src/mame/video/skydiver.c
@@ -162,9 +162,8 @@ WRITE8_MEMBER(skydiver_state::skydiver_2000_201F_w)
*
*************************************/
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void skydiver_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- skydiver_state *state = machine.driver_data<skydiver_state>();
int pic;
@@ -178,12 +177,12 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
int color;
int wide;
- sx = 29*8 - state->m_videoram[pic + 0x0390];
- sy = 30*8 - state->m_videoram[pic*2 + 0x0398];
- charcode = state->m_videoram[pic*2 + 0x0399];
+ sx = 29*8 - m_videoram[pic + 0x0390];
+ sy = 30*8 - m_videoram[pic*2 + 0x0398];
+ charcode = m_videoram[pic*2 + 0x0399];
xflip = charcode & 0x10;
yflip = charcode & 0x08;
- wide = (~pic & 0x02) && state->m_width;
+ wide = (~pic & 0x02) && m_width;
charcode = (charcode & 0x07) | ((charcode & 0x60) >> 2);
color = pic & 0x01;
@@ -192,7 +191,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
sx -= 8;
}
- drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[1],
+ drawgfxzoom_transpen(bitmap,cliprect,machine().gfx[1],
charcode, color,
xflip,yflip,sx,sy,
wide ? 0x20000 : 0x10000, 0x10000,0);
@@ -204,6 +203,6 @@ UINT32 skydiver_state::screen_update_skydiver(screen_device &screen, bitmap_ind1
{
m_bg_tilemap->draw(bitmap, cliprect, 0,0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/skyfox.c b/src/mame/video/skyfox.c
index 82c32c532a4..a67a93d03f8 100644
--- a/src/mame/video/skyfox.c
+++ b/src/mame/video/skyfox.c
@@ -157,26 +157,25 @@ Offset: Value:
***************************************************************************/
-static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void skyfox_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- skyfox_state *state = machine.driver_data<skyfox_state>();
int offs;
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine().primary_screen->width();
+ int height = machine().primary_screen->height();
/* The 32x32 tiles in the 80-ff range are bankswitched */
- int shift =(state->m_bg_ctrl & 0x80) ? (4 - 1) : 4;
+ int shift =(m_bg_ctrl & 0x80) ? (4 - 1) : 4;
- for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
+ for (offs = 0; offs < m_spriteram.bytes(); offs += 4)
{
int xstart, ystart, xend, yend;
int xinc, yinc, dx, dy;
int low_code, high_code, n;
- int y = state->m_spriteram[offs + 0];
- int x = state->m_spriteram[offs + 1];
- int code = state->m_spriteram[offs + 2] + state->m_spriteram[offs + 3] * 256;
+ int y = m_spriteram[offs + 0];
+ int x = m_spriteram[offs + 1];
+ int code = m_spriteram[offs + 2] + m_spriteram[offs + 3] * 256;
int flipx = code & 0x2;
int flipy = code & 0x4;
@@ -193,12 +192,12 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
#define DRAW_SPRITE(DX,DY,CODE) \
drawgfx_transpen(bitmap,\
- cliprect,machine.gfx[0], \
+ cliprect,machine().gfx[0], \
(CODE), \
0, \
flipx,flipy, \
x + (DX),y + (DY), 0xff);
- if (state->m_bg_ctrl & 1) // flipscreen
+ if (m_bg_ctrl & 1) // flipscreen
{
x = width - x - (n - 1) * 8;
y = height - y - (n - 1) * 8;
@@ -235,27 +234,26 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
***************************************************************************/
-static void draw_background(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void skyfox_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- skyfox_state *state = machine.driver_data<skyfox_state>();
- UINT8 *RAM = state->memregion("gfx2")->base();
+ UINT8 *RAM = memregion("gfx2")->base();
int x, y, i;
/* The foreground stars (sprites) move at twice this speed when
the bg scroll rate [e.g. (skyfox_bg_reg >> 1) & 7] is 4 */
- int pos = (state->m_bg_pos >> 4) & (512 * 2 - 1);
+ int pos = (m_bg_pos >> 4) & (512 * 2 - 1);
for (i = 0 ; i < 0x1000; i++)
{
int pen, offs, j;
- offs = (i * 2 + ((state->m_bg_ctrl >> 4) & 0x3) * 0x2000) % 0x8000;
+ offs = (i * 2 + ((m_bg_ctrl >> 4) & 0x3) * 0x2000) % 0x8000;
pen = RAM[offs];
x = RAM[offs + 1] * 2 + (i & 1) + pos + ((i & 8) ? 512 : 0);
y = ((i / 8) / 2) * 8 + (i % 8);
- if (state->m_bg_ctrl & 1) // flipscreen
+ if (m_bg_ctrl & 1) // flipscreen
{
x = 512 * 2 - (x % (512 * 2));
y = 256 - (y % 256);
@@ -281,7 +279,7 @@ static void draw_background(running_machine &machine, bitmap_ind16 &bitmap, cons
UINT32 skyfox_state::screen_update_skyfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(255, cliprect); // the bg is black
- draw_background(machine(), bitmap, cliprect);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_background(bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/skykid.c b/src/mame/video/skykid.c
index 71e2281d282..8386cb3afc8 100644
--- a/src/mame/video/skykid.c
+++ b/src/mame/video/skykid.c
@@ -176,10 +176,9 @@ WRITE8_MEMBER(skykid_state::skykid_flipscreen_priority_w)
***************************************************************************/
/* the sprite generator IC is the same as Mappy */
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
+void skykid_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- skykid_state *state = machine.driver_data<skykid_state>();
- UINT8 *spriteram = state->m_spriteram + 0x780;
+ UINT8 *spriteram = m_spriteram + 0x780;
UINT8 *spriteram_2 = spriteram + 0x0800;
UINT8 *spriteram_3 = spriteram_2 + 0x0800;
int offs;
@@ -204,7 +203,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
sprite &= ~sizex;
sprite &= ~(sizey << 1);
- if (state->flip_screen())
+ if (flip_screen())
{
flipx ^= 1;
flipy ^= 1;
@@ -217,12 +216,12 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
{
for (x = 0;x <= sizex;x++)
{
- drawgfx_transmask(bitmap,cliprect,machine.gfx[2],
+ drawgfx_transmask(bitmap,cliprect,machine().gfx[2],
sprite + gfx_offs[y ^ (sizey * flipy)][x ^ (sizex * flipx)],
color,
flipx,flipy,
sx + 16*x,sy + 16*y,
- colortable_get_transpen_mask(machine.colortable, machine.gfx[2], color, 0xff));
+ colortable_get_transpen_mask(machine().colortable, machine().gfx[2], color, 0xff));
}
}
}
@@ -252,7 +251,7 @@ UINT32 skykid_state::screen_update_skykid(screen_device &screen, bitmap_ind16 &b
// draw low priority tiles
m_tx_tilemap->draw(bitmap, cliprect, pri, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
// draw the other tiles
for (cat = 0; cat < 0xf; cat++)
@@ -260,7 +259,7 @@ UINT32 skykid_state::screen_update_skykid(screen_device &screen, bitmap_ind16 &b
}
else
{
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
m_tx_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_ALL_CATEGORIES, 0);
}
diff --git a/src/mame/video/skyraid.c b/src/mame/video/skyraid.c
index 8498515d644..7397e89395a 100644
--- a/src/mame/video/skyraid.c
+++ b/src/mame/video/skyraid.c
@@ -14,10 +14,9 @@ void skyraid_state::video_start()
}
-static void draw_text(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void skyraid_state::draw_text(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- skyraid_state *state = machine.driver_data<skyraid_state>();
- const UINT8* p = state->m_alpha_num_ram;
+ const UINT8* p = m_alpha_num_ram;
int i;
@@ -29,22 +28,21 @@ static void draw_text(running_machine &machine, bitmap_ind16 &bitmap, const rect
y = 136 + 16 * (i ^ 1);
for (x = 0; x < bitmap.width(); x += 16)
- drawgfx_transpen(bitmap, cliprect, machine.gfx[0], *p++, 0, 0, 0, x, y, 0);
+ drawgfx_transpen(bitmap, cliprect, machine().gfx[0], *p++, 0, 0, 0, x, y, 0);
}
}
-static void draw_terrain(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void skyraid_state::draw_terrain(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- skyraid_state *state = machine.driver_data<skyraid_state>();
- const UINT8* p = state->memregion("user1")->base();
+ const UINT8* p = memregion("user1")->base();
int x;
int y;
for (y = 0; y < bitmap.height(); y++)
{
- int offset = (16 * state->m_scroll + 16 * ((y + 1) / 2)) & 0x7FF;
+ int offset = (16 * m_scroll + 16 * ((y + 1) / 2)) & 0x7FF;
x = 0;
@@ -65,54 +63,52 @@ static void draw_terrain(running_machine &machine, bitmap_ind16 &bitmap, const r
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void skyraid_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- skyraid_state *state = machine.driver_data<skyraid_state>();
int i;
for (i = 0; i < 4; i++)
{
- int code = state->m_obj_ram[8 + 2 * i + 0] & 15;
- int flag = state->m_obj_ram[8 + 2 * i + 1] & 15;
- int vert = state->m_pos_ram[8 + 2 * i + 0];
- int horz = state->m_pos_ram[8 + 2 * i + 1];
+ int code = m_obj_ram[8 + 2 * i + 0] & 15;
+ int flag = m_obj_ram[8 + 2 * i + 1] & 15;
+ int vert = m_pos_ram[8 + 2 * i + 0];
+ int horz = m_pos_ram[8 + 2 * i + 1];
vert -= 31;
if (flag & 1)
- drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
code ^ 15, code >> 3, 0, 0,
horz / 2, vert, 2);
}
}
-static void draw_missiles(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void skyraid_state::draw_missiles(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- skyraid_state *state = machine.driver_data<skyraid_state>();
int i;
/* hardware is restricted to one sprite per scanline */
for (i = 0; i < 4; i++)
{
- int code = state->m_obj_ram[2 * i + 0] & 15;
- int vert = state->m_pos_ram[2 * i + 0];
- int horz = state->m_pos_ram[2 * i + 1];
+ int code = m_obj_ram[2 * i + 0] & 15;
+ int vert = m_pos_ram[2 * i + 0];
+ int horz = m_pos_ram[2 * i + 1];
vert -= 15;
horz -= 31;
- drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
+ drawgfx_transpen(bitmap, cliprect, machine().gfx[2],
code ^ 15, 0, 0, 0,
horz / 2, vert, 0);
}
}
-static void draw_trapezoid(running_machine &machine, bitmap_ind16& dst, bitmap_ind16& src)
+void skyraid_state::draw_trapezoid(bitmap_ind16& dst, bitmap_ind16& src)
{
- const UINT8* p = machine.root_device().memregion("user2")->base();
+ const UINT8* p = machine().root_device().memregion("user2")->base();
int x;
int y;
@@ -138,10 +134,10 @@ UINT32 skyraid_state::screen_update_skyraid(screen_device &screen, bitmap_ind16
rectangle helper_clip = cliprect;
helper_clip &= m_helper.cliprect();
- draw_terrain(machine(), m_helper, helper_clip);
- draw_sprites(machine(), m_helper, helper_clip);
- draw_missiles(machine(), m_helper, helper_clip);
- draw_trapezoid(machine(), bitmap, m_helper);
- draw_text(machine(), bitmap, cliprect);
+ draw_terrain(m_helper, helper_clip);
+ draw_sprites(m_helper, helper_clip);
+ draw_missiles(m_helper, helper_clip);
+ draw_trapezoid(bitmap, m_helper);
+ draw_text(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/slapfght.c b/src/mame/video/slapfght.c
index ce977fed5b9..27638321bc4 100644
--- a/src/mame/video/slapfght.c
+++ b/src/mame/video/slapfght.c
@@ -122,16 +122,15 @@ WRITE8_MEMBER(slapfght_state::slapfight_palette_bank_w)
m_slapfight_palette_bank = offset;
}
-static void slapfght_log_vram(running_machine &machine)
+void slapfght_state::slapfght_log_vram()
{
#ifdef MAME_DEBUG
- slapfght_state *state = machine.driver_data<slapfght_state>();
- if ( machine.input().code_pressed_once(KEYCODE_B) )
+ if ( machine().input().code_pressed_once(KEYCODE_B) )
{
int i;
for (i=0; i<0x800; i++)
{
- logerror("Offset:%03x TileRAM:%02x AttribRAM:%02x SpriteRAM:%02x\n",i, state->m_slapfight_videoram[i],state->m_slapfight_colorram[i],state->m_spriteram->live()[i]);
+ logerror("Offset:%03x TileRAM:%02x AttribRAM:%02x SpriteRAM:%02x\n",i, m_slapfight_videoram[i],m_slapfight_colorram[i],m_spriteram->live()[i]);
}
}
#endif
@@ -142,19 +141,18 @@ static void slapfght_log_vram(running_machine &machine)
Render the Sprites
***************************************************************************/
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_display )
+void slapfght_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_display )
{
- slapfght_state *state = machine.driver_data<slapfght_state>();
- UINT8 *buffered_spriteram = state->m_spriteram->buffer();
+ UINT8 *buffered_spriteram = m_spriteram->buffer();
int offs;
- for (offs = 0;offs < state->m_spriteram->bytes();offs += 4)
+ for (offs = 0;offs < m_spriteram->bytes();offs += 4)
{
int sx, sy;
if ((buffered_spriteram[offs+2] & 0x80) == priority_to_display)
{
- if (state->m_flipscreen)
+ if (m_flipscreen)
{
sx = 265 - buffered_spriteram[offs+1];
sy = 239 - buffered_spriteram[offs+3];
@@ -165,11 +163,11 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
sx = buffered_spriteram[offs+1] + 3;
sy = buffered_spriteram[offs+3] - 1;
}
- drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine().gfx[1],
buffered_spriteram[offs],
((buffered_spriteram[offs+2] >> 1) & 3) |
- ((buffered_spriteram[offs+2] << 2) & 4) | (state->m_slapfight_palette_bank << 3),
- state->m_flipscreen, state->m_flipscreen,
+ ((buffered_spriteram[offs+2] << 2) & 4) | (m_slapfight_palette_bank << 3),
+ m_flipscreen, m_flipscreen,
sx, sy,0);
}
}
@@ -188,11 +186,11 @@ UINT32 slapfght_state::screen_update_perfrman(screen_device &screen, bitmap_ind1
}
m_pf1_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
- draw_sprites(machine(), bitmap,cliprect,0);
+ draw_sprites(bitmap,cliprect,0);
m_pf1_tilemap->draw(bitmap, cliprect, 0,0);
- draw_sprites(machine(), bitmap,cliprect,0x80);
+ draw_sprites(bitmap,cliprect,0x80);
- slapfght_log_vram(machine());
+ slapfght_log_vram();
return 0;
}
@@ -237,6 +235,6 @@ UINT32 slapfght_state::screen_update_slapfight(screen_device &screen, bitmap_ind
m_fix_tilemap->draw(bitmap, cliprect, 0,0);
- slapfght_log_vram(machine());
+ slapfght_log_vram();
return 0;
}
diff --git a/src/mame/video/slapshot.c b/src/mame/video/slapshot.c
index c9f7c3510be..01ee5fa1e81 100644
--- a/src/mame/video/slapshot.c
+++ b/src/mame/video/slapshot.c
@@ -33,7 +33,7 @@ void slapshot_state::video_start()
SPRITE DRAW ROUTINES
************************************************************/
-static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int *primasks, int y_offset )
+void slapshot_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int *primasks, int y_offset )
{
/*
Sprite format:
@@ -88,7 +88,6 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
000b - 000f : unused
*/
- slapshot_state *state = machine.driver_data<slapshot_state>();
int x, y, off, extoffs;
int code, color, spritedata, spritecont, flipx, flipy;
int xcurrent, ycurrent, big_sprite = 0;
@@ -101,19 +100,19 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
/* pdrawgfx() needs us to draw sprites front to back, so we have to build a list
while processing sprite ram and then draw them all at the end */
- struct slapshot_tempsprite *sprite_ptr = state->m_spritelist;
+ struct slapshot_tempsprite *sprite_ptr = m_spritelist;
/* must remember enable status from last frame because driftout fails to
reactivate them from a certain point onwards. */
- int disabled = state->m_sprites_disabled;
+ int disabled = m_sprites_disabled;
/* must remember master scroll from previous frame because driftout
sometimes doesn't set it. */
- int master_scrollx = state->m_sprites_master_scrollx;
- int master_scrolly = state->m_sprites_master_scrolly;
+ int master_scrollx = m_sprites_master_scrollx;
+ int master_scrolly = m_sprites_master_scrolly;
/* must also remember the sprite bank from previous frame. */
- int area = state->m_sprites_active_area;
+ int area = m_sprites_active_area;
scroll1x = 0;
scroll1y = 0;
@@ -122,12 +121,12 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
color = 0;
x_offset = 3; /* Get rid of 0-3 unwanted pixels on edge of screen. */
- if (state->m_sprites_flipscreen) x_offset = -x_offset;
+ if (m_sprites_flipscreen) x_offset = -x_offset;
/* safety check to avoid getting stuck in bank 2 for games using only one bank */
if (area == 0x8000 &&
- state->m_spriteram_buffered[(0x8000 + 6) / 2] == 0 &&
- state->m_spriteram_buffered[(0x8000 + 10) / 2] == 0)
+ m_spriteram_buffered[(0x8000 + 6) / 2] == 0 &&
+ m_spriteram_buffered[(0x8000 + 10) / 2] == 0)
area = 0;
@@ -136,37 +135,37 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
/* sprites_active_area may change during processing */
int offs = off + area;
- if (state->m_spriteram_buffered[(offs + 6) / 2] & 0x8000)
+ if (m_spriteram_buffered[(offs + 6) / 2] & 0x8000)
{
- disabled = state->m_spriteram_buffered[(offs + 10) / 2] & 0x1000;
- state->m_sprites_flipscreen = state->m_spriteram_buffered[(offs + 10) / 2] & 0x2000;
+ disabled = m_spriteram_buffered[(offs + 10) / 2] & 0x1000;
+ m_sprites_flipscreen = m_spriteram_buffered[(offs + 10) / 2] & 0x2000;
x_offset = 3; /* Get rid of 0-3 unwanted pixels on edge of screen. */
- if (state->m_sprites_flipscreen) x_offset = -x_offset;
- area = 0x8000 * (state->m_spriteram_buffered[(offs + 10) / 2] & 0x0001);
+ if (m_sprites_flipscreen) x_offset = -x_offset;
+ area = 0x8000 * (m_spriteram_buffered[(offs + 10) / 2] & 0x0001);
continue;
}
//popmessage("%04x",area);
/* check for extra scroll offset */
- if ((state->m_spriteram_buffered[(offs + 4) / 2] & 0xf000) == 0xa000)
+ if ((m_spriteram_buffered[(offs + 4) / 2] & 0xf000) == 0xa000)
{
- master_scrollx = state->m_spriteram_buffered[(offs + 4) / 2] & 0xfff;
+ master_scrollx = m_spriteram_buffered[(offs + 4) / 2] & 0xfff;
if (master_scrollx >= 0x800)
master_scrollx -= 0x1000; /* signed value */
- master_scrolly = state->m_spriteram_buffered[(offs + 6) / 2] & 0xfff;
+ master_scrolly = m_spriteram_buffered[(offs + 6) / 2] & 0xfff;
if (master_scrolly >= 0x800)
master_scrolly -= 0x1000; /* signed value */
}
- if ((state->m_spriteram_buffered[(offs + 4) / 2] & 0xf000) == 0x5000)
+ if ((m_spriteram_buffered[(offs + 4) / 2] & 0xf000) == 0x5000)
{
- scroll1x = state->m_spriteram_buffered[(offs + 4) / 2] & 0xfff;
+ scroll1x = m_spriteram_buffered[(offs + 4) / 2] & 0xfff;
if (scroll1x >= 0x800)
scroll1x -= 0x1000; /* signed value */
- scroll1y = state->m_spriteram_buffered[(offs + 6) / 2] & 0xfff;
+ scroll1y = m_spriteram_buffered[(offs + 6) / 2] & 0xfff;
if (scroll1y >= 0x800)
scroll1y -= 0x1000; /* signed value */
}
@@ -174,7 +173,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
if (disabled)
continue;
- spritedata = state->m_spriteram_buffered[(offs + 8) / 2];
+ spritedata = m_spriteram_buffered[(offs + 8) / 2];
spritecont = (spritedata & 0xff00) >> 8;
@@ -182,11 +181,11 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
{
if (big_sprite == 0) /* are we starting a big sprite ? */
{
- xlatch = state->m_spriteram_buffered[(offs + 4) / 2] & 0xfff;
- ylatch = state->m_spriteram_buffered[(offs + 6) / 2] & 0xfff;
+ xlatch = m_spriteram_buffered[(offs + 4) / 2] & 0xfff;
+ ylatch = m_spriteram_buffered[(offs + 6) / 2] & 0xfff;
x_no = 0;
y_no = 0;
- zoomword = state->m_spriteram_buffered[(offs + 2) / 2];
+ zoomword = m_spriteram_buffered[(offs + 2) / 2];
zoomylatch = (zoomword >> 8) & 0xff;
zoomxlatch = (zoomword >> 0) & 0xff;
big_sprite = 1; /* we have started a new big sprite */
@@ -207,7 +206,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
// of anything.
if (big_sprite == 0 || (spritecont & 0xf0) == 0)
{
- x = state->m_spriteram_buffered[(offs + 4) / 2];
+ x = m_spriteram_buffered[(offs + 4) / 2];
// DG: some absolute x values deduced here are 1 too high (scenes when you get
// home run in Koshien, and may also relate to BG layer woods and stuff as you
@@ -230,7 +229,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
scrolly = scroll1y + master_scrolly;
}
x &= 0xfff;
- y = state->m_spriteram_buffered[(offs+6)/2] & 0xfff;
+ y = m_spriteram_buffered[(offs+6)/2] & 0xfff;
xcurrent = x;
ycurrent = y;
@@ -278,7 +277,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
}
else
{
- zoomword = state->m_spriteram_buffered[(offs+2)/2];
+ zoomword = m_spriteram_buffered[(offs+2)/2];
zoomy = (zoomword >> 8) & 0xff;
zoomx = (zoomword >> 0) & 0xff;
zx = (0x100 - zoomx) / 16;
@@ -298,8 +297,8 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
{
int i;
- code = state->m_spriteram_buffered[(offs)/2] & 0xff;
- i = (state->m_spriteext[(extoffs >> 4)] & 0xff00 );
+ code = m_spriteram_buffered[(offs)/2] & 0xff;
+ i = (m_spriteext[(extoffs >> 4)] & 0xff00 );
code = (i | code);
}
@@ -315,7 +314,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
cury = (y + scrolly) & 0xfff;
if (cury >= 0x800) cury -= 0x1000; /* treat it as signed */
- if (state->m_sprites_flipscreen)
+ if (m_sprites_flipscreen)
{
/* -zx/y is there to fix zoomed sprite coords in screenflip.
drawgfxzoom does not know to draw from flip-side of sprites when
@@ -332,7 +331,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
{
sprite_ptr->code = code;
sprite_ptr->color = color;
- if (machine.gfx[0]->granularity() == 64) /* Final Blow, Slapshot are 6bpp */
+ if (machine().gfx[0]->granularity() == 64) /* Final Blow, Slapshot are 6bpp */
sprite_ptr->color /= 4;
sprite_ptr->flipx = flipx;
sprite_ptr->flipy = flipy;
@@ -349,7 +348,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
}
else
{
- drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
+ drawgfxzoom_transpen(bitmap,cliprect,machine().gfx[0],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
@@ -361,68 +360,66 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
/* this happens only if primsks != NULL */
- while (sprite_ptr != state->m_spritelist)
+ while (sprite_ptr != m_spritelist)
{
sprite_ptr--;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[0],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine().gfx[0],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine.priority_bitmap,sprite_ptr->primask,0);
+ machine().priority_bitmap,sprite_ptr->primask,0);
}
}
-static void taito_handle_sprite_buffering( running_machine &machine )
+void slapshot_state::taito_handle_sprite_buffering( )
{
- slapshot_state *state = machine.driver_data<slapshot_state>();
- if (state->m_prepare_sprites) /* no buffering */
+ if (m_prepare_sprites) /* no buffering */
{
- memcpy(state->m_spriteram_buffered, state->m_spriteram, state->m_spriteram.bytes());
- state->m_prepare_sprites = 0;
+ memcpy(m_spriteram_buffered, m_spriteram, m_spriteram.bytes());
+ m_prepare_sprites = 0;
}
}
-static void taito_update_sprites_active_area( running_machine &machine )
+void slapshot_state::taito_update_sprites_active_area( )
{
- slapshot_state *state = machine.driver_data<slapshot_state>();
int off;
/* if the frame was skipped, we'll have to do the buffering now */
- taito_handle_sprite_buffering(machine);
+ taito_handle_sprite_buffering();
/* safety check to avoid getting stuck in bank 2 for games using only one bank */
- if (state->m_sprites_active_area == 0x8000 &&
- state->m_spriteram_buffered[(0x8000 + 6) / 2] == 0 &&
- state->m_spriteram_buffered[(0x8000 + 10) / 2] == 0)
- state->m_sprites_active_area = 0;
+ if (m_sprites_active_area == 0x8000 &&
+ m_spriteram_buffered[(0x8000 + 6) / 2] == 0 &&
+ m_spriteram_buffered[(0x8000 + 10) / 2] == 0)
+ m_sprites_active_area = 0;
for (off = 0; off < 0x4000; off += 16)
{
/* sprites_active_area may change during processing */
- int offs = off + state->m_sprites_active_area;
+ int offs = off + m_sprites_active_area;
- if (state->m_spriteram_buffered[(offs + 6) / 2] & 0x8000)
+ if (m_spriteram_buffered[(offs + 6) / 2] & 0x8000)
{
- state->m_sprites_disabled = state->m_spriteram_buffered[(offs + 10) / 2] & 0x1000;
- state->m_sprites_active_area = 0x8000 * (state->m_spriteram_buffered[(offs + 10) / 2] & 0x0001);
+ m_sprites_disabled = m_spriteram_buffered[(offs + 10) / 2] & 0x1000;
+ m_sprites_active_area = 0x8000 * (m_spriteram_buffered[(offs + 10) / 2] & 0x0001);
continue;
}
/* check for extra scroll offset */
- if ((state->m_spriteram_buffered[(offs+4)/2] & 0xf000) == 0xa000)
+ if ((m_spriteram_buffered[(offs+4)/2] & 0xf000) == 0xa000)
{
- state->m_sprites_master_scrollx = state->m_spriteram_buffered[(offs + 4) / 2] & 0xfff;
- if (state->m_sprites_master_scrollx >= 0x800)
- state->m_sprites_master_scrollx -= 0x1000; /* signed value */
+ m_sprites_master_scrollx = m_spriteram_buffered[(offs + 4) / 2] & 0xfff;
+ if (m_sprites_master_scrollx >= 0x800)
+ m_sprites_master_scrollx -= 0x1000; /* signed value */
- state->m_sprites_master_scrolly = state->m_spriteram_buffered[(offs + 6) / 2] & 0xfff;
- if (state->m_sprites_master_scrolly >= 0x800)
- state->m_sprites_master_scrolly -= 0x1000; /* signed value */
+ m_sprites_master_scrolly = m_spriteram_buffered[(offs + 6) / 2] & 0xfff;
+ if (m_sprites_master_scrolly >= 0x800)
+ m_sprites_master_scrolly -= 0x1000; /* signed value */
}
}
}
@@ -432,7 +429,7 @@ void slapshot_state::screen_eof_taito_no_buffer(screen_device &screen, bool stat
// rising edge
if (state)
{
- taito_update_sprites_active_area(machine());
+ taito_update_sprites_active_area();
m_prepare_sprites = 1;
}
@@ -495,7 +492,7 @@ UINT32 slapshot_state::screen_update_slapshot(screen_device &screen, bitmap_ind1
}
#endif
- taito_handle_sprite_buffering(machine());
+ taito_handle_sprite_buffering();
tc0480scp_tilemap_update(m_tc0480scp);
@@ -555,7 +552,7 @@ UINT32 slapshot_state::screen_update_slapshot(screen_device &screen, bitmap_ind1
if (spritepri[i] < tilepri[(layer[3])]) primasks[i] |= 0xff00;
}
- draw_sprites(machine(),bitmap,cliprect,primasks,0);
+ draw_sprites(bitmap,cliprect,primasks,0);
}
/*
diff --git a/src/mame/video/snk.c b/src/mame/video/snk.c
index 9ed565de61c..eb620f0f090 100644
--- a/src/mame/video/snk.c
+++ b/src/mame/video/snk.c
@@ -703,11 +703,10 @@ static void marvins_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,
}
-static void tnk3_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll)
+void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll)
{
- snk_state *state = machine.driver_data<snk_state>();
- UINT8 *spriteram = state->m_spriteram;
- gfx_element *gfx = machine.gfx[2];
+ UINT8 *spriteram = m_spriteram;
+ gfx_element *gfx = machine().gfx[2];
const int size = gfx->width();
int tile_number, attributes, color, sx, sy;
int xflip,yflip;
@@ -719,7 +718,7 @@ static void tnk3_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, co
/* sgladiat and tnk3 have 512 tiles, bit 6 is bank and bit 5 is y-flip */
/* athena has 1024 tiles, bit 6 and bit 5 are bank */
- for (offs = 0; offs < state->m_num_sprites*4; offs += 4)
+ for (offs = 0; offs < m_num_sprites*4; offs += 4)
{
tile_number = spriteram[offs+1];
attributes = spriteram[offs+3];
@@ -745,7 +744,7 @@ static void tnk3_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, co
yflip = attributes & 0x20;
}
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 89 - size - sx; // this causes slight misalignment in tnk3 but is correct for athena and fitegolf
sy = 262 - size - sy;
@@ -754,16 +753,16 @@ static void tnk3_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, co
}
sx &= 0x1ff;
- sy &= state->m_yscroll_mask; // sgladiat apparently has only 256 pixels of vertical scrolling range
+ sy &= m_yscroll_mask; // sgladiat apparently has only 256 pixels of vertical scrolling range
if (sx > 512-size) sx -= 512;
- if (sy > (state->m_yscroll_mask+1)-size) sy -= (state->m_yscroll_mask+1);
+ if (sy > (m_yscroll_mask+1)-size) sy -= (m_yscroll_mask+1);
drawgfx_transtable(bitmap,cliprect,gfx,
tile_number,
color,
xflip,yflip,
sx,sy,
- state->m_drawmode_table, machine.shadow_table);
+ m_drawmode_table, machine().shadow_table);
}
}
@@ -927,7 +926,7 @@ UINT32 snk_state::screen_update_tnk3(screen_device &screen, bitmap_ind16 &bitmap
m_bg_tilemap->set_scrolly(0, m_bg_scrolly);
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
- tnk3_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly);
+ tnk3_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly);
m_tx_tilemap->draw(bitmap, cliprect, 0, 0);
return 0;
diff --git a/src/mame/video/snk68.c b/src/mame/video/snk68.c
index a97858b04ee..1c822cc0a60 100644
--- a/src/mame/video/snk68.c
+++ b/src/mame/video/snk68.c
@@ -48,14 +48,13 @@ TILE_GET_INFO_MEMBER(snk68_state::get_searchar_tile_info)
***************************************************************************/
-static void common_video_start(running_machine &machine)
+void snk68_state::common_video_start()
{
- snk68_state *state = machine.driver_data<snk68_state>();
- state->m_fg_tilemap->set_transparent_pen(0);
+ m_fg_tilemap->set_transparent_pen(0);
- state->m_fg_tilemap->set_scrolldx(0, machine.primary_screen->width() - 256);
- state->m_fg_tilemap->set_scrolldy(0, machine.primary_screen->height() - 256);
+ m_fg_tilemap->set_scrolldx(0, machine().primary_screen->width() - 256);
+ m_fg_tilemap->set_scrolldy(0, machine().primary_screen->height() - 256);
}
void snk68_state::video_start()
@@ -63,14 +62,14 @@ void snk68_state::video_start()
m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk68_state::get_pow_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
m_fg_tile_offset = 0;
- common_video_start(machine());
+ common_video_start();
}
VIDEO_START_MEMBER(snk68_state,searchar)
{
m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(snk68_state::get_searchar_tile_info),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32);
- common_video_start(machine());
+ common_video_start();
}
/***************************************************************************
@@ -180,18 +179,17 @@ WRITE16_MEMBER(snk68_state::pow_paletteram16_word_w)
***************************************************************************/
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int group)
+void snk68_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int group)
{
- snk68_state *state = machine.driver_data<snk68_state>();
- UINT16 *spriteram16 = state->m_spriteram;
- int flipscreen = state->m_flipscreen;
- int sprite_flip_axis = state->m_sprite_flip_axis;
+ UINT16 *spriteram16 = m_spriteram;
+ int flipscreen = m_flipscreen;
+ int sprite_flip_axis = m_sprite_flip_axis;
const UINT16* tiledata = &spriteram16[0x800*group];
// pow has 0x4000 tiles and independent x/y flipping
// the other games have > 0x4000 tiles and flipping in only one direction
// (globally selected)
- int const is_pow = (machine.gfx[1]->elements() <= 0x4000);
+ int const is_pow = (machine().gfx[1]->elements() <= 0x4000);
int offs;
for (offs = 0; offs < 0x800; offs += 0x40)
@@ -249,7 +247,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
fy = !fy;
}
- drawgfx_transpen(bitmap,cliprect, machine.gfx[1],
+ drawgfx_transpen(bitmap,cliprect, machine().gfx[1],
tile,
color,
fx, fy,
@@ -274,9 +272,9 @@ UINT32 snk68_state::screen_update_pow(screen_device &screen, bitmap_ind16 &bitma
bitmap.fill(0x7ff, cliprect);
/* This appears to be the correct priority order */
- draw_sprites(machine(), bitmap, cliprect, 2);
- draw_sprites(machine(), bitmap, cliprect, 3);
- draw_sprites(machine(), bitmap, cliprect, 1);
+ draw_sprites(bitmap, cliprect, 2);
+ draw_sprites(bitmap, cliprect, 3);
+ draw_sprites(bitmap, cliprect, 1);
m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
return 0;
diff --git a/src/mame/video/solomon.c b/src/mame/video/solomon.c
index 0190dbd0d12..3f758922c11 100644
--- a/src/mame/video/solomon.c
+++ b/src/mame/video/solomon.c
@@ -64,13 +64,12 @@ void solomon_state::video_start()
m_fg_tilemap->set_transparent_pen(0);
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void solomon_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- solomon_state *state = machine.driver_data<solomon_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs;
- for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
+ for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
int code = spriteram[offs] + 16 * (spriteram[offs + 1] & 0x10);
int color = (spriteram[offs + 1] & 0x0e) >> 1;
@@ -79,7 +78,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
int sx = spriteram[offs + 3];
int sy = 241 - spriteram[offs + 2];
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 240 - sx;
sy = 242 - sy;
@@ -88,7 +87,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
}
drawgfx_transpen(bitmap, cliprect,
- machine.gfx[2],
+ machine().gfx[2],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -99,6 +98,6 @@ UINT32 solomon_state::screen_update_solomon(screen_device &screen, bitmap_ind16
{
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/sonson.c b/src/mame/video/sonson.c
index 82b082bd861..427afe288de 100644
--- a/src/mame/video/sonson.c
+++ b/src/mame/video/sonson.c
@@ -135,13 +135,12 @@ void sonson_state::video_start()
m_bg_tilemap->set_scroll_rows(32);
}
-static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void sonson_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- sonson_state *state = machine.driver_data<sonson_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs;
- for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
+ for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
int code = spriteram[offs + 2] + ((spriteram[offs + 1] & 0x20) << 3);
int color = spriteram[offs + 1] & 0x1f;
@@ -150,7 +149,7 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
int sx = spriteram[offs + 3];
int sy = spriteram[offs + 0];
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
@@ -159,20 +158,20 @@ static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const
}
drawgfx_transpen(bitmap, cliprect,
- machine.gfx[1],
+ machine().gfx[1],
code, color,
flipx, flipy,
sx, sy, 0);
/* wrap-around */
- drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx - 256, sy, 0);
- drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy - 256, 0);
+ drawgfx_transpen(bitmap, cliprect, machine().gfx[1], code, color, flipx, flipy, sx - 256, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine().gfx[1], code, color, flipx, flipy, sx, sy - 256, 0);
}
}
UINT32 sonson_state::screen_update_sonson(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/spacefb.c b/src/mame/video/spacefb.c
index 8ed5cb3ecc9..6e68043eb75 100644
--- a/src/mame/video/spacefb.c
+++ b/src/mame/video/spacefb.c
@@ -99,23 +99,23 @@ void spacefb_state::video_start()
#define NUM_STARFIELD_PENS (0x40)
-INLINE void shift_star_generator(spacefb_state *state)
+inline void spacefb_state::shift_star_generator(spacefb_state *state)
{
- state->m_star_shift_reg = ((state->m_star_shift_reg << 1) | (((~state->m_star_shift_reg >> 16) & 0x01) ^ ((state->m_star_shift_reg >> 4) & 0x01))) & 0x1ffff;
+ m_star_shift_reg = ((m_star_shift_reg << 1) | (((~m_star_shift_reg >> 16) & 0x01) ^ ((m_star_shift_reg >> 4) & 0x01))) & 0x1ffff;
}
-static void get_starfield_pens(spacefb_state *state, pen_t *pens)
+void spacefb_state::get_starfield_pens(spacefb_state *state, pen_t *pens)
{
/* generate the pens based on the various enable bits */
int i;
- int color_contrast_r = state->m_port_2 & 0x01;
- int color_contrast_g = state->m_port_2 & 0x02;
- int color_contrast_b = state->m_port_2 & 0x04;
- int background_red = state->m_port_2 & 0x08;
- int background_blue = state->m_port_2 & 0x10;
- int disable_star_field = state->m_port_2 & 0x80;
+ int color_contrast_r = m_port_2 & 0x01;
+ int color_contrast_g = m_port_2 & 0x02;
+ int color_contrast_b = m_port_2 & 0x04;
+ int background_red = m_port_2 & 0x08;
+ int background_blue = m_port_2 & 0x10;
+ int disable_star_field = m_port_2 & 0x80;
for (i = 0; i < NUM_STARFIELD_PENS; i++)
{
@@ -126,16 +126,16 @@ static void get_starfield_pens(spacefb_state *state, pen_t *pens)
UINT8 ra = (((i >> 4) & 0x01) || background_red) && !disable_star_field;
UINT8 rb = ((i >> 5) & 0x01) && color_contrast_r && !disable_star_field;
- UINT8 r = combine_3_weights(state->m_color_weights_rg, 0, rb, ra);
- UINT8 g = combine_3_weights(state->m_color_weights_rg, 0, gb, ga);
- UINT8 b = combine_2_weights(state->m_color_weights_b, bb, ba);
+ UINT8 r = combine_3_weights(m_color_weights_rg, 0, rb, ra);
+ UINT8 g = combine_3_weights(m_color_weights_rg, 0, gb, ga);
+ UINT8 b = combine_2_weights(m_color_weights_b, bb, ba);
pens[i] = MAKE_RGB(r, g, b);
}
}
-static void draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+void spacefb_state::draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
spacefb_state *state = screen.machine().driver_data<spacefb_state>();
int y;
@@ -162,14 +162,14 @@ static void draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const re
for (x = SPACEFB_HBEND; x < SPACEFB_HBSTART; x++)
{
- if (state->m_object_present_map[(y * bitmap.width()) + x] == 0)
+ if (m_object_present_map[(y * bitmap.width()) + x] == 0)
{
/* draw the star - the 4 possible values come from the effect of the two XOR gates */
- if (((state->m_star_shift_reg & 0x1c0ff) == 0x0c0b7) ||
- ((state->m_star_shift_reg & 0x1c0ff) == 0x0c0d7) ||
- ((state->m_star_shift_reg & 0x1c0ff) == 0x0c0bb) ||
- ((state->m_star_shift_reg & 0x1c0ff) == 0x0c0db))
- bitmap.pix32(y, x) = pens[(state->m_star_shift_reg >> 8) & 0x3f];
+ if (((m_star_shift_reg & 0x1c0ff) == 0x0c0b7) ||
+ ((m_star_shift_reg & 0x1c0ff) == 0x0c0d7) ||
+ ((m_star_shift_reg & 0x1c0ff) == 0x0c0bb) ||
+ ((m_star_shift_reg & 0x1c0ff) == 0x0c0db))
+ bitmap.pix32(y, x) = pens[(m_star_shift_reg >> 8) & 0x3f];
else
bitmap.pix32(y, x) = pens[0];
}
@@ -204,16 +204,15 @@ static void draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const re
#define NUM_SPRITE_PENS (0x40)
-static void get_sprite_pens(running_machine &machine, pen_t *pens)
+void spacefb_state::get_sprite_pens(pen_t *pens)
{
- spacefb_state *state = machine.driver_data<spacefb_state>();
static const double fade_weights[] = { 1.0, 1.5, 2.5, 4.0 };
- const UINT8 *prom = machine.root_device().memregion("proms")->base();
+ const UINT8 *prom = machine().root_device().memregion("proms")->base();
int i;
for (i = 0; i < NUM_SPRITE_PENS; i++)
{
- UINT8 data = prom[((state->m_port_0 & 0x40) >> 2) | (i & 0x0f)];
+ UINT8 data = prom[((m_port_0 & 0x40) >> 2) | (i & 0x0f)];
UINT8 r0 = (data >> 0) & 0x01;
UINT8 r1 = (data >> 1) & 0x01;
@@ -226,9 +225,9 @@ static void get_sprite_pens(running_machine &machine, pen_t *pens)
UINT8 b1 = (data >> 6) & 0x01;
UINT8 b2 = (data >> 7) & 0x01;
- UINT8 r = combine_3_weights(state->m_color_weights_rg, r0, r1, r2);
- UINT8 g = combine_3_weights(state->m_color_weights_rg, g0, g1, g2);
- UINT8 b = combine_2_weights(state->m_color_weights_b, b1, b2);
+ UINT8 r = combine_3_weights(m_color_weights_rg, r0, r1, r2);
+ UINT8 g = combine_3_weights(m_color_weights_rg, g0, g1, g2);
+ UINT8 b = combine_2_weights(m_color_weights_b, b1, b2);
if (i >> 4)
{
@@ -245,22 +244,21 @@ static void get_sprite_pens(running_machine &machine, pen_t *pens)
}
-static void draw_bullet(running_machine &machine, offs_t offs, pen_t pen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flip)
+void spacefb_state::draw_bullet(offs_t offs, pen_t pen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flip)
{
- spacefb_state *state = machine.driver_data<spacefb_state>();
UINT8 sy;
- UINT8 *gfx = state->memregion("gfx2")->base();
+ UINT8 *gfx = memregion("gfx2")->base();
- UINT8 code = state->m_videoram[offs + 0x0200] & 0x3f;
- UINT8 y = ~state->m_videoram[offs + 0x0100] - 2;
+ UINT8 code = m_videoram[offs + 0x0200] & 0x3f;
+ UINT8 y = ~m_videoram[offs + 0x0100] - 2;
for (sy = 0; sy < 4; sy++)
{
UINT8 sx, dy;
UINT8 data = gfx[(code << 2) | sy];
- UINT8 x = state->m_videoram[offs + 0x0000];
+ UINT8 x = m_videoram[offs + 0x0000];
if (flip)
dy = ~y;
@@ -283,8 +281,8 @@ static void draw_bullet(running_machine &machine, offs_t offs, pen_t pen, bitmap
bitmap.pix32(dy, dx + 0) = pen;
bitmap.pix32(dy, dx + 1) = pen;
- state->m_object_present_map[(dy * bitmap.width()) + dx + 0] = 1;
- state->m_object_present_map[(dy * bitmap.width()) + dx + 1] = 1;
+ m_object_present_map[(dy * bitmap.width()) + dx + 0] = 1;
+ m_object_present_map[(dy * bitmap.width()) + dx + 1] = 1;
}
x = x + 1;
@@ -297,16 +295,15 @@ static void draw_bullet(running_machine &machine, offs_t offs, pen_t pen, bitmap
}
-static void draw_sprite(running_machine &machine, offs_t offs, pen_t *pens, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flip)
+void spacefb_state::draw_sprite(offs_t offs, pen_t *pens, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flip)
{
- spacefb_state *state = machine.driver_data<spacefb_state>();
UINT8 sy;
- UINT8 *gfx = state->memregion("gfx1")->base();
+ UINT8 *gfx = memregion("gfx1")->base();
- UINT8 code = ~state->m_videoram[offs + 0x0200];
- UINT8 color_base = (~state->m_videoram[offs + 0x0300] & 0x0f) << 2;
- UINT8 y = ~state->m_videoram[offs + 0x0100] - 2;
+ UINT8 code = ~m_videoram[offs + 0x0200];
+ UINT8 color_base = (~m_videoram[offs + 0x0300] & 0x0f) << 2;
+ UINT8 y = ~m_videoram[offs + 0x0100] - 2;
for (sy = 0; sy < 8; sy++)
{
@@ -315,7 +312,7 @@ static void draw_sprite(running_machine &machine, offs_t offs, pen_t *pens, bitm
UINT8 data1 = gfx[0x0000 | (code << 3) | (sy ^ 0x07)];
UINT8 data2 = gfx[0x0800 | (code << 3) | (sy ^ 0x07)];
- UINT8 x = state->m_videoram[offs + 0x0000] - 3;
+ UINT8 x = m_videoram[offs + 0x0000] - 3;
if (flip)
dy = ~y;
@@ -341,8 +338,8 @@ static void draw_sprite(running_machine &machine, offs_t offs, pen_t *pens, bitm
bitmap.pix32(dy, dx + 0) = pen;
bitmap.pix32(dy, dx + 1) = pen;
- state->m_object_present_map[(dy * bitmap.width()) + dx + 0] = (data != 0);
- state->m_object_present_map[(dy * bitmap.width()) + dx + 1] = (data != 0);
+ m_object_present_map[(dy * bitmap.width()) + dx + 0] = (data != 0);
+ m_object_present_map[(dy * bitmap.width()) + dx + 1] = (data != 0);
x = x + 1;
data1 = data1 >> 1;
@@ -355,28 +352,27 @@ static void draw_sprite(running_machine &machine, offs_t offs, pen_t *pens, bitm
}
-static void draw_objects(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+void spacefb_state::draw_objects(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- spacefb_state *state = machine.driver_data<spacefb_state>();
pen_t sprite_pens[NUM_SPRITE_PENS];
- offs_t offs = (state->m_port_0 & 0x20) ? 0x80 : 0x00;
- int flip = state->m_port_0 & 0x01;
+ offs_t offs = (m_port_0 & 0x20) ? 0x80 : 0x00;
+ int flip = m_port_0 & 0x01;
/* since the way the schematics show the bullet color
connected is impossible, just use pure red for now */
pen_t bullet_pen = MAKE_RGB(0xff, 0x00, 0x00);
- get_sprite_pens(machine, sprite_pens);
+ get_sprite_pens(sprite_pens);
- memset(state->m_object_present_map, 0, bitmap.width() * bitmap.height());
+ memset(m_object_present_map, 0, bitmap.width() * bitmap.height());
while (1)
{
- if (state->m_videoram[offs + 0x0300] & 0x20)
- draw_bullet(machine, offs, bullet_pen, bitmap, cliprect, flip);
- else if (state->m_videoram[offs + 0x0300] & 0x40)
- draw_sprite(machine, offs, sprite_pens, bitmap, cliprect, flip);
+ if (m_videoram[offs + 0x0300] & 0x20)
+ draw_bullet(offs, bullet_pen, bitmap, cliprect, flip);
+ else if (m_videoram[offs + 0x0300] & 0x40)
+ draw_sprite(offs, sprite_pens, bitmap, cliprect, flip);
/* next object */
offs = offs + 1;
@@ -396,7 +392,7 @@ static void draw_objects(running_machine &machine, bitmap_rgb32 &bitmap, const r
UINT32 spacefb_state::screen_update_spacefb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- draw_objects(machine(), bitmap, cliprect);
+ draw_objects(bitmap, cliprect);
draw_starfield(screen, bitmap, cliprect);
return 0;
diff --git a/src/mame/video/spdodgeb.c b/src/mame/video/spdodgeb.c
index 00806759c62..ad8ddb5e692 100644
--- a/src/mame/video/spdodgeb.c
+++ b/src/mame/video/spdodgeb.c
@@ -143,13 +143,12 @@ WRITE8_MEMBER(spdodgeb_state::spdodgeb_videoram_w)
#define DRAW_SPRITE( order, sx, sy ) drawgfx_transpen( bitmap, \
cliprect,gfx, \
- (which+order),color+ 8 * state->m_sprite_palbank,flipx,flipy,sx,sy,0);
+ (which+order),color+ 8 * m_sprite_palbank,flipx,flipy,sx,sy,0);
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void spdodgeb_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- spdodgeb_state *state = machine.driver_data<spdodgeb_state>();
- UINT8 *spriteram = state->m_spriteram;
- gfx_element *gfx = machine.gfx[1];
+ UINT8 *spriteram = m_spriteram;
+ gfx_element *gfx = machine().gfx[1];
UINT8 *src;
int i;
@@ -158,7 +157,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
/* 240-SY Z|F|CLR|WCH WHICH SX
xxxxxxxx x|x|xxx|xxx xxxxxxxx xxxxxxxx
*/
- for (i = 0;i < state->m_spriteram.bytes();i += 4)
+ for (i = 0;i < m_spriteram.bytes();i += 4)
{
int attr = src[i+1];
int which = src[i+2]+((attr & 0x07)<<8);
@@ -171,7 +170,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
int dy = -16;
int cy;
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
@@ -190,7 +189,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
break;
case 1: /* double y */
- if (state->flip_screen()) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; }
+ if (flip_screen()) { if (sy > 240) sy -= 256; } else { if (sy < 0) sy += 256; }
cy = sy + dy;
which &= ~1;
DRAW_SPRITE(0,sx,cy);
@@ -207,6 +206,6 @@ UINT32 spdodgeb_state::screen_update_spdodgeb(screen_device &screen, bitmap_ind1
{
m_bg_tilemap->set_scrollx(0,m_lastscroll+5);
m_bg_tilemap->draw(bitmap, cliprect, 0,0);
- draw_sprites(machine(), bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/speedbal.c b/src/mame/video/speedbal.c
index 237d28b0543..ee5dfd90a15 100644
--- a/src/mame/video/speedbal.c
+++ b/src/mame/video/speedbal.c
@@ -79,15 +79,14 @@ WRITE8_MEMBER(speedbal_state::speedbal_background_videoram_w)
* *
*************************************/
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void speedbal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- speedbal_state *state = machine.driver_data<speedbal_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int x,y,code,color,offset,flipx,flipy;
/* Drawing sprites: 64 in total */
- for (offset = 0;offset < state->m_spriteram.bytes();offset += 4)
+ for (offset = 0;offset < m_spriteram.bytes();offset += 4)
{
if(!(spriteram[offset + 2] & 0x80))
continue;
@@ -101,14 +100,14 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
flipx = flipy = 0;
- if(state->flip_screen())
+ if(flip_screen())
{
x = 246 - x;
y = 238 - y;
flipx = flipy = 1;
}
- drawgfx_transpen (bitmap,cliprect,machine.gfx[2],
+ drawgfx_transpen (bitmap,cliprect,machine().gfx[2],
code,
color,
flipx,flipy,
@@ -126,7 +125,7 @@ UINT32 speedbal_state::screen_update_speedbal(screen_device &screen, bitmap_ind1
{
m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
return 0;
diff --git a/src/mame/video/speedspn.c b/src/mame/video/speedspn.c
index 3b1de6bbccf..8080f32d1e9 100644
--- a/src/mame/video/speedspn.c
+++ b/src/mame/video/speedspn.c
@@ -52,11 +52,10 @@ WRITE8_MEMBER(speedspn_state::speedspn_global_display_w)
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void speedspn_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- speedspn_state *state = machine.driver_data<speedspn_state>();
- gfx_element *gfx = machine.gfx[1];
- UINT8 *source = state->m_vidram+ 0x1000;
+ gfx_element *gfx = machine().gfx[1];
+ UINT8 *source = m_vidram+ 0x1000;
UINT8 *finish = source + 0x1000;
while( source<finish )
@@ -104,6 +103,6 @@ UINT32 speedspn_state::screen_update_speedspn(screen_device &screen, bitmap_ind1
#endif
m_tilemap->set_scrollx(0, 0x100); // verify
m_tilemap->draw(bitmap, cliprect, 0,0);
- draw_sprites(machine(), bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/splash.c b/src/mame/video/splash.c
index fa9ce4ecba2..d6f75cc94ae 100644
--- a/src/mame/video/splash.c
+++ b/src/mame/video/splash.c
@@ -76,46 +76,45 @@ WRITE16_MEMBER(splash_state::splash_vram_w)
m_bg_tilemap[offset >> 11]->mark_tile_dirty(((offset << 1) & 0x0fff) >> 1);
}
-static void draw_bitmap(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void splash_state::draw_bitmap(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- splash_state *state = machine.driver_data<splash_state>();
int sx,sy,color,count,colxor,bitswap;
colxor = 0; /* splash and some bitmap modes in roldfrog */
bitswap = 0;
- if (state->m_bitmap_type == 1) /* roldfrog */
+ if (m_bitmap_type == 1) /* roldfrog */
{
- if (state->m_bitmap_mode[0] == 0x0000)
+ if (m_bitmap_mode[0] == 0x0000)
{
colxor = 0x7f;
}
- else if (state->m_bitmap_mode[0] == 0x0100)
+ else if (m_bitmap_mode[0] == 0x0100)
{
bitswap = 1;
}
- else if (state->m_bitmap_mode[0] == 0x0200)
+ else if (m_bitmap_mode[0] == 0x0200)
{
colxor = 0x55;
}
- else if (state->m_bitmap_mode[0] == 0x0300)
+ else if (m_bitmap_mode[0] == 0x0300)
{
bitswap = 2;
colxor = 0x7f;
}
- else if (state->m_bitmap_mode[0] == 0x0400)
+ else if (m_bitmap_mode[0] == 0x0400)
{
bitswap = 3;
}
- else if (state->m_bitmap_mode[0] == 0x0500)
+ else if (m_bitmap_mode[0] == 0x0500)
{
bitswap = 4;
}
- else if (state->m_bitmap_mode[0] == 0x0600)
+ else if (m_bitmap_mode[0] == 0x0600)
{
bitswap = 5;
colxor = 0x7f;
}
- else if (state->m_bitmap_mode[0] == 0x0700)
+ else if (m_bitmap_mode[0] == 0x0700)
{
bitswap = 6;
colxor = 0x55;
@@ -127,7 +126,7 @@ static void draw_bitmap(running_machine &machine, bitmap_ind16 &bitmap, const re
{
for (sx=0;sx<512;sx++)
{
- color = state->m_pixelram[count]&0xff;
+ color = m_pixelram[count]&0xff;
count++;
switch( bitswap )
@@ -204,18 +203,17 @@ void splash_state::video_start()
400| xxxxxxxx -------- | unused
*/
-static void splash_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
+void splash_state::splash_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- splash_state *state = machine.driver_data<splash_state>();
int i;
- gfx_element *gfx = machine.gfx[1];
+ gfx_element *gfx = machine().gfx[1];
for (i = 0; i < 0x400; i += 4){
- int sx = state->m_spriteram[i+2] & 0xff;
- int sy = (240 - (state->m_spriteram[i+1] & 0xff)) & 0xff;
- int attr = state->m_spriteram[i+3] & 0xff;
- int attr2 = state->m_spriteram[i+0x400] >> state->m_sprite_attr2_shift;
- int number = (state->m_spriteram[i] & 0xff) + (attr & 0xf)*256;
+ int sx = m_spriteram[i+2] & 0xff;
+ int sy = (240 - (m_spriteram[i+1] & 0xff)) & 0xff;
+ int attr = m_spriteram[i+3] & 0xff;
+ int attr2 = m_spriteram[i+0x400] >> m_sprite_attr2_shift;
+ int number = (m_spriteram[i] & 0xff) + (attr & 0xf)*256;
if (attr2 & 0x80) sx += 256;
@@ -225,18 +223,17 @@ static void splash_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,c
}
}
-static void funystrp_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
+void splash_state::funystrp_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- splash_state *state = machine.driver_data<splash_state>();
int i;
- gfx_element *gfx = machine.gfx[1];
+ gfx_element *gfx = machine().gfx[1];
for (i = 0; i < 0x400; i += 4){
- int sx = state->m_spriteram[i+2] & 0xff;
- int sy = (240 - (state->m_spriteram[i+1] & 0xff)) & 0xff;
- int attr = state->m_spriteram[i+3] & 0xff;
- int attr2 = state->m_spriteram[i+0x400] >> state->m_sprite_attr2_shift;
- int number = (state->m_spriteram[i] & 0xff) + (attr & 0xf)*256;
+ int sx = m_spriteram[i+2] & 0xff;
+ int sy = (240 - (m_spriteram[i+1] & 0xff)) & 0xff;
+ int attr = m_spriteram[i+3] & 0xff;
+ int attr2 = m_spriteram[i+0x400] >> m_sprite_attr2_shift;
+ int number = (m_spriteram[i] & 0xff) + (attr & 0xf)*256;
if (attr2 & 0x80) sx += 256;
@@ -258,10 +255,10 @@ UINT32 splash_state::screen_update_splash(screen_device &screen, bitmap_ind16 &b
m_bg_tilemap[0]->set_scrolly(0, m_vregs[0]);
m_bg_tilemap[1]->set_scrolly(0, m_vregs[1]);
- draw_bitmap(machine(), bitmap, cliprect);
+ draw_bitmap(bitmap, cliprect);
m_bg_tilemap[1]->draw(bitmap, cliprect, 0, 0);
- splash_draw_sprites(machine(), bitmap, cliprect);
+ splash_draw_sprites(bitmap, cliprect);
m_bg_tilemap[0]->draw(bitmap, cliprect, 0, 0);
return 0;
}
@@ -272,11 +269,11 @@ UINT32 splash_state::screen_update_funystrp(screen_device &screen, bitmap_ind16
m_bg_tilemap[0]->set_scrolly(0, m_vregs[0]);
m_bg_tilemap[1]->set_scrolly(0, m_vregs[1]);
- draw_bitmap(machine(), bitmap, cliprect);
+ draw_bitmap(bitmap, cliprect);
m_bg_tilemap[1]->draw(bitmap, cliprect, 0, 0);
/*Sprite chip is similar but not the same*/
- funystrp_draw_sprites(machine(), bitmap, cliprect);
+ funystrp_draw_sprites(bitmap, cliprect);
m_bg_tilemap[0]->draw(bitmap, cliprect, 0, 0);
return 0;
}
diff --git a/src/mame/video/sprcros2.c b/src/mame/video/sprcros2.c
index 96fddd1b5dd..6d42d28f084 100644
--- a/src/mame/video/sprcros2.c
+++ b/src/mame/video/sprcros2.c
@@ -135,14 +135,13 @@ void sprcros2_state::video_start()
colortable_configure_tilemap_groups(machine().colortable, m_fgtilemap, machine().gfx[2], 0);
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
+void sprcros2_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- sprcros2_state *state = machine.driver_data<sprcros2_state>();
int offs,sx,sy,color,flipx,flipy;
- for (offs = state->m_spriteram.bytes()-4; offs >= 0; offs -= 4)
+ for (offs = m_spriteram.bytes()-4; offs >= 0; offs -= 4)
{
- if (state->m_spriteram[offs])
+ if (m_spriteram[offs])
{
//offs
//76543210
@@ -158,13 +157,13 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
//offs+2 y pos
//offs+3 x pos
- sx = ((state->m_spriteram[offs+3]+0x10)%0x100)-0x10;
- sy = 225-(((state->m_spriteram[offs+2]+0x10)%0x100)-0x10);
- color = (state->m_spriteram[offs+1]&0x38)>>3;
- flipx = state->m_spriteram[offs+1]&0x02;
+ sx = ((m_spriteram[offs+3]+0x10)%0x100)-0x10;
+ sy = 225-(((m_spriteram[offs+2]+0x10)%0x100)-0x10);
+ color = (m_spriteram[offs+1]&0x38)>>3;
+ flipx = m_spriteram[offs+1]&0x02;
flipy = 0;
- if (state->m_port7&0x02)
+ if (m_port7&0x02)
{
sx = 224-sx;
sy = 224-sy;
@@ -172,12 +171,12 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
flipy = !flipy;
}
- drawgfx_transmask(bitmap,cliprect,machine.gfx[1],
- state->m_spriteram[offs],
+ drawgfx_transmask(bitmap,cliprect,machine().gfx[1],
+ m_spriteram[offs],
color,
flipx,flipy,
sx,sy,
- colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
+ colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color, 0));
}
}
}
@@ -185,7 +184,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
UINT32 sprcros2_state::screen_update_sprcros2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bgtilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
m_fgtilemap->draw(bitmap, cliprect, 0, 0);
return 0;
}
diff --git a/src/mame/video/sprint2.c b/src/mame/video/sprint2.c
index 373c52b7d51..0f5bf83dc51 100644
--- a/src/mame/video/sprint2.c
+++ b/src/mame/video/sprint2.c
@@ -77,7 +77,7 @@ WRITE8_MEMBER(sprint2_state::sprint2_video_ram_w)
}
-static UINT8 collision_check(sprint2_state *state, colortable_t *colortable, rectangle& rect)
+UINT8 sprint2_state::collision_check(colortable_t *colortable, rectangle& rect)
{
UINT8 data = 0;
@@ -87,7 +87,7 @@ static UINT8 collision_check(sprint2_state *state, colortable_t *colortable, rec
for (y = rect.min_y; y <= rect.max_y; y++)
for (x = rect.min_x; x <= rect.max_x; x++)
{
- UINT16 a = colortable_entry_get_value(colortable, state->m_helper.pix16(y, x));
+ UINT16 a = colortable_entry_get_value(colortable, m_helper.pix16(y, x));
if (a == 0)
data |= 0x40;
@@ -100,15 +100,15 @@ static UINT8 collision_check(sprint2_state *state, colortable_t *colortable, rec
}
-INLINE int get_sprite_code(UINT8 *video_ram, int n)
+inline int sprint2_state::get_sprite_code(UINT8 *video_ram, int n)
{
return video_ram[0x398 + 2 * n + 1] >> 3;
}
-INLINE int get_sprite_x(UINT8 *video_ram, int n)
+inline int sprint2_state::get_sprite_x(UINT8 *video_ram, int n)
{
return 2 * (248 - video_ram[0x390 + 1 * n]);
}
-INLINE int get_sprite_y(UINT8 *video_ram, int n)
+inline int sprint2_state::get_sprite_y(UINT8 *video_ram, int n)
{
return 1 * (248 - video_ram[0x398 + 2 * n]);
}
@@ -176,7 +176,7 @@ void sprint2_state::screen_eof_sprint2(screen_device &screen, bool state)
get_sprite_x(video_ram, i),
get_sprite_y(video_ram, i), 1);
- m_collision[i] |= collision_check(this, machine().colortable, rect);
+ m_collision[i] |= collision_check(machine().colortable, rect);
/* check for sprite-sprite collisions */
@@ -198,7 +198,7 @@ void sprint2_state::screen_eof_sprint2(screen_device &screen, bool state)
get_sprite_x(video_ram, i),
get_sprite_y(video_ram, i), 1);
- m_collision[i] |= collision_check(this, machine().colortable, rect);
+ m_collision[i] |= collision_check(machine().colortable, rect);
}
}
}
diff --git a/src/mame/video/sprint8.c b/src/mame/video/sprint8.c
index 0ee14696ebe..cb3c86ba7e5 100644
--- a/src/mame/video/sprint8.c
+++ b/src/mame/video/sprint8.c
@@ -28,13 +28,13 @@ void sprint8_state::palette_init()
}
-static void set_pens(sprint8_state *state, colortable_t *colortable)
+void sprint8_state::set_pens(sprint8_state *state, colortable_t *colortable)
{
int i;
for (i = 0; i < 0x10; i += 8)
{
- if (*state->m_team & 1)
+ if (*m_team & 1)
{
colortable_palette_set_color(colortable, i + 0, MAKE_RGB(0xff, 0x00, 0x00)); /* red */
colortable_palette_set_color(colortable, i + 1, MAKE_RGB(0x00, 0x00, 0xff)); /* blue */
@@ -124,22 +124,21 @@ void sprint8_state::video_start()
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void sprint8_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- sprint8_state *state = machine.driver_data<sprint8_state>();
int i;
for (i = 0; i < 16; i++)
{
- UINT8 code = state->m_pos_d_ram[i];
+ UINT8 code = m_pos_d_ram[i];
- int x = state->m_pos_h_ram[i];
- int y = state->m_pos_v_ram[i];
+ int x = m_pos_h_ram[i];
+ int y = m_pos_v_ram[i];
if (code & 0x80)
x |= 0x100;
- drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
+ drawgfx_transpen(bitmap, cliprect, machine().gfx[2],
code ^ 7,
i,
!(code & 0x10), !(code & 0x08),
@@ -150,7 +149,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
TIMER_CALLBACK_MEMBER(sprint8_state::sprint8_collision_callback)
{
- sprint8_set_collision(machine(), param);
+ sprint8_set_collision(param);
}
@@ -158,7 +157,7 @@ UINT32 sprint8_state::screen_update_sprint8(screen_device &screen, bitmap_ind16
{
set_pens(this, machine().colortable);
m_tilemap1->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
@@ -176,7 +175,7 @@ void sprint8_state::screen_eof_sprint8(screen_device &screen, bool state)
m_helper1.fill(0x20, visarea);
- draw_sprites(machine(), m_helper1, visarea);
+ draw_sprites(m_helper1, visarea);
for (y = visarea.min_y; y <= visarea.max_y; y++)
{
diff --git a/src/mame/video/srumbler.c b/src/mame/video/srumbler.c
index 30ba54f7e8f..031c9b74756 100644
--- a/src/mame/video/srumbler.c
+++ b/src/mame/video/srumbler.c
@@ -106,14 +106,13 @@ WRITE8_MEMBER(srumbler_state::srumbler_scroll_w)
***************************************************************************/
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void srumbler_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- srumbler_state *state = machine.driver_data<srumbler_state>();
- UINT8 *buffered_spriteram = state->m_spriteram->buffer();
+ UINT8 *buffered_spriteram = m_spriteram->buffer();
int offs;
/* Draw the sprites. */
- for (offs = state->m_spriteram->bytes()-4; offs>=0;offs -= 4)
+ for (offs = m_spriteram->bytes()-4; offs>=0;offs -= 4)
{
/* SPRITES
=====
@@ -138,17 +137,17 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
sx = buffered_spriteram[offs + 3] + 0x100 * ( attr & 0x01);
flipy = attr & 0x02;
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 496 - sx;
sy = 240 - sy;
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine().gfx[2],
code,
colour,
- state->flip_screen(),flipy,
+ flip_screen(),flipy,
sx, sy,15);
}
}
@@ -157,7 +156,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
UINT32 srumbler_state::screen_update_srumbler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1,0);
- draw_sprites(machine(), bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0,0);
m_fg_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
diff --git a/src/mame/video/sslam.c b/src/mame/video/sslam.c
index 47679568bda..f941db08d75 100644
--- a/src/mame/video/sslam.c
+++ b/src/mame/video/sslam.c
@@ -22,11 +22,10 @@ WRITE16_MEMBER(sslam_state::sslam_paletteram_w)
palette_set_color_rgb(machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void sslam_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- sslam_state *state = machine.driver_data<sslam_state>();
- gfx_element *gfx = machine.gfx[0];
- UINT16 *source = state->m_spriteram;
+ gfx_element *gfx = machine().gfx[0];
+ UINT16 *source = m_spriteram;
UINT16 *finish = source + 0x1000/2;
source += 3; // strange
@@ -44,7 +43,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
flipx = source[0] & 0x4000;
number = source[3];
- xpos -=16; xpos -=7; xpos += state->m_sprites_x_offset;
+ xpos -=16; xpos -=7; xpos += m_sprites_x_offset;
ypos = 0xff - ypos;
ypos -=16; ypos -=7;
@@ -208,7 +207,7 @@ UINT32 sslam_state::screen_update_sslam(screen_device &screen, bitmap_ind16 &bit
m_md_tilemap->draw(bitmap, cliprect, 0,0);
}
- draw_sprites(machine(), bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
}
@@ -225,6 +224,6 @@ UINT32 sslam_state::screen_update_powerbls(screen_device &screen, bitmap_ind16 &
m_bg_tilemap->set_scrolly(0, m_regs[1]-240);
m_bg_tilemap->draw(bitmap, cliprect, 0,0);
- draw_sprites(machine(), bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
return 0;
}
diff --git a/src/mame/video/ssozumo.c b/src/mame/video/ssozumo.c
index db31c6a4f0e..1c159380a2d 100644
--- a/src/mame/video/ssozumo.c
+++ b/src/mame/video/ssozumo.c
@@ -136,13 +136,12 @@ void ssozumo_state::video_start()
m_fg_tilemap->set_transparent_pen(0);
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void ssozumo_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- ssozumo_state *state = machine.driver_data<ssozumo_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs;
- for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
+ for (offs = 0; offs < m_spriteram.bytes(); offs += 4)
{
if (spriteram[offs] & 0x01)
{
@@ -153,7 +152,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
int sx = 239 - spriteram[offs + 3];
int sy = (240 - spriteram[offs + 2]) & 0xff;
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
@@ -162,7 +161,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
}
drawgfx_transpen(bitmap, cliprect,
- machine.gfx[2],
+ machine().gfx[2],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -174,6 +173,6 @@ UINT32 ssozumo_state::screen_update_ssozumo(screen_device &screen, bitmap_ind16
{
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/sspeedr.c b/src/mame/video/sspeedr.c
index 16c6b3f835b..5f24c33041e 100644
--- a/src/mame/video/sspeedr.c
+++ b/src/mame/video/sspeedr.c
@@ -80,27 +80,26 @@ WRITE8_MEMBER(sspeedr_state::sspeedr_track_ice_w)
}
-static void draw_track(running_machine &machine, bitmap_ind16 &bitmap)
+void sspeedr_state::draw_track(bitmap_ind16 &bitmap)
{
- sspeedr_state *state = machine.driver_data<sspeedr_state>();
- const UINT8* p = state->memregion("gfx3")->base();
+ const UINT8* p = memregion("gfx3")->base();
int x;
int y;
for (x = 0; x < 376; x++)
{
- unsigned counter_x = x + state->m_track_horz + 0x50;
+ unsigned counter_x = x + m_track_horz + 0x50;
int flag = 0;
- if (state->m_track_ice & 2)
+ if (m_track_ice & 2)
{
flag = 1;
}
- else if (state->m_track_ice & 4)
+ else if (m_track_ice & 4)
{
- if (state->m_track_ice & 1)
+ if (m_track_ice & 1)
{
flag = (counter_x <= 0x1ff);
}
@@ -119,9 +118,9 @@ static void draw_track(running_machine &machine, bitmap_ind16 &bitmap)
/* upper landscape */
- for (; y < state->m_track_vert[0]; y++)
+ for (; y < m_track_vert[0]; y++)
{
- unsigned counter_y = y - state->m_track_vert[0];
+ unsigned counter_y = y - m_track_vert[0];
int offset =
((counter_y & 0x1f) << 3) |
@@ -140,7 +139,7 @@ static void draw_track(running_machine &machine, bitmap_ind16 &bitmap)
/* street */
- for (; y < 128 + state->m_track_vert[1]; y++)
+ for (; y < 128 + m_track_vert[1]; y++)
{
bitmap.pix16(y, x) = flag ? 15 : 0;
}
@@ -149,7 +148,7 @@ static void draw_track(running_machine &machine, bitmap_ind16 &bitmap)
for (; y < 248; y++)
{
- unsigned counter_y = y - state->m_track_vert[1];
+ unsigned counter_y = y - m_track_vert[1];
int offset =
((counter_y & 0x1f) << 3) |
@@ -169,9 +168,8 @@ static void draw_track(running_machine &machine, bitmap_ind16 &bitmap)
}
-static void draw_drones(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void sspeedr_state::draw_drones(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- sspeedr_state *state = machine.driver_data<sspeedr_state>();
static const UINT8 code[6] =
{
0xf, 0x4, 0x3, 0x9, 0x7, 0xc
@@ -184,23 +182,23 @@ static void draw_drones(running_machine &machine, bitmap_ind16 &bitmap, const re
int x;
int y;
- if ((state->m_drones_mask >> i) & 1)
+ if ((m_drones_mask >> i) & 1)
{
continue;
}
- x = (code[i] << 5) - state->m_drones_horz - 0x50;
+ x = (code[i] << 5) - m_drones_horz - 0x50;
if (x <= -32)
{
x += 0x1c8;
}
- y = 0xf0 - state->m_drones_vert[i >> 1];
+ y = 0xf0 - m_drones_vert[i >> 1];
drawgfx_transpen(bitmap, cliprect,
- machine.gfx[1],
- code[i] ^ state->m_toggle,
+ machine().gfx[1],
+ code[i] ^ m_toggle,
0,
0, 0,
x,
@@ -209,29 +207,28 @@ static void draw_drones(running_machine &machine, bitmap_ind16 &bitmap, const re
}
-static void draw_driver(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void sspeedr_state::draw_driver(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- sspeedr_state *state = machine.driver_data<sspeedr_state>();
int x;
int y;
- if (!(state->m_driver_pic & 0x10))
+ if (!(m_driver_pic & 0x10))
{
return;
}
- x = 0x1e0 - state->m_driver_horz - 0x50;
+ x = 0x1e0 - m_driver_horz - 0x50;
if (x <= -32)
{
x += 0x1c8;
}
- y = 0xf0 - state->m_driver_vert;
+ y = 0xf0 - m_driver_vert;
drawgfx_transpen(bitmap, cliprect,
- machine.gfx[0],
- state->m_driver_pic,
+ machine().gfx[0],
+ m_driver_pic,
0,
0, 0,
x,
@@ -247,9 +244,9 @@ void sspeedr_state::video_start()
UINT32 sspeedr_state::screen_update_sspeedr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- draw_track(machine(), bitmap);
- draw_drones(machine(), bitmap, cliprect);
- draw_driver(machine(), bitmap, cliprect);
+ draw_track(bitmap);
+ draw_drones(bitmap, cliprect);
+ draw_driver(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/ssrj.c b/src/mame/video/ssrj.c
index 2e4016859f8..6a2d7ce20bc 100644
--- a/src/mame/video/ssrj.c
+++ b/src/mame/video/ssrj.c
@@ -224,16 +224,15 @@ void ssrj_state::video_start()
}
-static void draw_objects(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void ssrj_state::draw_objects(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- ssrj_state *state = machine.driver_data<ssrj_state>();
int i,j,k,x,y;
for(i=0;i<6;i++)
{
- y = state->m_buffer_spriteram[0x80+20*i];
- x = state->m_buffer_spriteram[0x80+20*i+2];
- if (!state->m_buffer_spriteram[0x80+20*i+3])
+ y = m_buffer_spriteram[0x80+20*i];
+ x = m_buffer_spriteram[0x80+20*i+2];
+ if (!m_buffer_spriteram[0x80+20*i+3])
{
for(k=0;k<5;k++,x+=8)
{
@@ -242,9 +241,9 @@ static void draw_objects(running_machine &machine, bitmap_ind16 &bitmap, const r
int code;
int offs = (i * 5 + k) * 64 + (31 - j) * 2;
- code = state->m_vram3[offs] + 256 * state->m_vram3[offs + 1];
+ code = m_vram3[offs] + 256 * m_vram3[offs + 1];
drawgfx_transpen(bitmap,
- cliprect,machine.gfx[0],
+ cliprect,machine().gfx[0],
code&1023,
((code>>12)&0x3)+8,
code&0x4000,
@@ -272,7 +271,7 @@ UINT32 ssrj_state::screen_update_ssrj(screen_device &screen, bitmap_ind16 &bitma
m_tilemap1->set_scrollx(0, 0xff-m_scrollram[2] );
m_tilemap1->set_scrolly(0, m_scrollram[0] );
m_tilemap1->draw(bitmap, cliprect, 0, 0);
- draw_objects(machine(), bitmap, cliprect);
+ draw_objects(bitmap, cliprect);
m_tilemap2->draw(bitmap, cliprect, 0, 0);
if (m_scrollram[0x101] == 0xb) m_tilemap4->draw(bitmap, cliprect, 0, 0);/* hack to display 4th tilemap */
diff --git a/src/mame/video/ssv.c b/src/mame/video/ssv.c
index f0567a7dffc..42cec7dbb65 100644
--- a/src/mame/video/ssv.c
+++ b/src/mame/video/ssv.c
@@ -592,11 +592,10 @@ From the above some noteworthy cases are:
/* Draw a tilemap sprite */
-static void draw_row(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int sx, int sy, int scroll)
+void ssv_state::draw_row(bitmap_ind16 &bitmap, const rectangle &cliprect, int sx, int sy, int scroll)
{
- ssv_state *state = machine.driver_data<ssv_state>();
- UINT16 *spriteram16 = state->m_spriteram;
- UINT16 *ssv_scroll = state->m_scroll;
+ UINT16 *spriteram16 = m_spriteram;
+ UINT16 *ssv_scroll = m_scroll;
rectangle clip;
int attr, code, color, mode, size, page, shadow;
int x, x1, sx1, flipx, xnum, xstart, xend, xinc;
@@ -678,7 +677,7 @@ static void draw_row(running_machine &machine, bitmap_ind16 &bitmap, const recta
attr = s3[1]; // code low bits + color
/* Code's high bits are scrambled */
- code += state->m_tile_code[(attr & 0x3c00)>>10];
+ code += m_tile_code[(attr & 0x3c00)>>10];
flipy = (attr & 0x4000);
flipx = (attr & 0x8000);
@@ -708,7 +707,7 @@ static void draw_row(running_machine &machine, bitmap_ind16 &bitmap, const recta
{
for (ty = ystart; ty != yend; ty += yinc)
{
- ssv_drawgfx( bitmap, clip, machine.gfx[gfx],
+ ssv_drawgfx( bitmap, clip, machine().gfx[gfx],
code++,
color,
flipx, flipy,
@@ -724,21 +723,20 @@ static void draw_row(running_machine &machine, bitmap_ind16 &bitmap, const recta
/* Draw the "background layer" using multiple tilemap sprites */
-static void draw_layer(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int nr)
+void ssv_state::draw_layer(bitmap_ind16 &bitmap, const rectangle &cliprect, int nr)
{
int sy;
- for ( sy = 0; sy <= machine.primary_screen->visible_area().max_y; sy += 0x40 )
- draw_row(machine, bitmap, cliprect, 0, sy, nr);
+ for ( sy = 0; sy <= machine().primary_screen->visible_area().max_y; sy += 0x40 )
+ draw_row(bitmap, cliprect, 0, sy, nr);
}
/* Draw sprites in the sprites list */
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void ssv_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/* Sprites list */
- ssv_state *state = machine.driver_data<ssv_state>();
- UINT16 *ssv_scroll = state->m_scroll;
- UINT16 *spriteram16 = state->m_spriteram;
+ UINT16 *ssv_scroll = m_scroll;
+ UINT16 *spriteram16 = m_spriteram;
UINT16 *s1 = spriteram16;
UINT16 *end1 = spriteram16 + 0x02000/2;
@@ -823,7 +821,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
}
if ((mode & 0x001f) != 0)
- draw_row(machine, bitmap, cliprect, sx, sy, scroll);
+ draw_row(bitmap, cliprect, sx, sy, scroll);
}
else
{
@@ -844,7 +842,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
attr = s2[1]; // code low bits + color
/* Code's high bits are scrambled */
- code += state->m_tile_code[(attr & 0x3c00)>>10];
+ code += m_tile_code[(attr & 0x3c00)>>10];
flipy = (attr & 0x4000);
flipx = (attr & 0x8000);
@@ -934,7 +932,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
{
for (y = ystart; y != yend; y += yinc)
{
- ssv_drawgfx( bitmap, cliprect, machine.gfx[gfx],
+ ssv_drawgfx( bitmap, cliprect, machine().gfx[gfx],
code++,
color,
flipx, flipy,
@@ -944,10 +942,10 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
}
#ifdef MAME_DEBUG
- if (machine.input().code_pressed(KEYCODE_Z)) /* Display some info on each sprite */
+ if (machine().input().code_pressed(KEYCODE_Z)) /* Display some info on each sprite */
{ char buf[30];
sprintf(buf, "%02X",/*(s2[2] & ~0x3ff)>>8*/mode>>8);
- ui_draw_text(&machine.render().ui_container(), buf, sx, sy);
+ ui_draw_text(&machine().render().ui_container(), buf, sx, sy);
}
#endif
@@ -986,11 +984,10 @@ UINT32 ssv_state::screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap
return 0;
}
-void ssv_enable_video(running_machine &machine, int enable)
+void ssv_state::ssv_enable_video(int enable)
{
- ssv_state *state = machine.driver_data<ssv_state>();
- state->m_enable_video = enable;
+ m_enable_video = enable;
}
UINT32 ssv_state::screen_update_ssv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -1035,9 +1032,9 @@ UINT32 ssv_state::screen_update_ssv(screen_device &screen, bitmap_ind16 &bitmap,
if (!m_enable_video)
return 0;
- draw_layer(machine(), bitmap, clip, 0); // "background layer"
+ draw_layer(bitmap, clip, 0); // "background layer"
- draw_sprites(machine(), bitmap, clip); // sprites list
+ draw_sprites(bitmap, clip); // sprites list
return 0;
diff --git a/src/mame/video/st0016.c b/src/mame/video/st0016.c
index 3c06522964e..2973111d8b2 100644
--- a/src/mame/video/st0016.c
+++ b/src/mame/video/st0016.c
@@ -211,7 +211,7 @@ WRITE8_MEMBER(st0016_state::st0016_vregs_w)
}
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void st0016_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/*
object ram :
@@ -256,7 +256,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
*/
- gfx_element *gfx = machine.gfx[st0016_ramgfx];
+ gfx_element *gfx = machine().gfx[st0016_ramgfx];
int i,j,lx,ly,x,y,code,offset,length,sx,sy,color,flipx,flipy,scrollx,scrolly/*,plx,ply*/;
@@ -418,17 +418,17 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
}
-static void st0016_save_init(running_machine &machine)
+void st0016_state::st0016_save_init()
{
- state_save_register_global(machine, st0016_spr_bank);
- state_save_register_global(machine, st0016_spr2_bank);
- state_save_register_global(machine, st0016_pal_bank);
- state_save_register_global(machine, st0016_char_bank);
- //state_save_register_global(machine, st0016_rom_bank);
- state_save_register_global_array(machine, st0016_vregs);
- state_save_register_global_pointer(machine, st0016_charram, ST0016_MAX_CHAR_BANK*ST0016_CHAR_BANK_SIZE);
- state_save_register_global_pointer(machine, st0016_paletteram, ST0016_MAX_PAL_BANK*ST0016_PAL_BANK_SIZE);
- state_save_register_global_pointer(machine, st0016_spriteram, ST0016_MAX_SPR_BANK*ST0016_SPR_BANK_SIZE);
+ state_save_register_global(machine(), st0016_spr_bank);
+ state_save_register_global(machine(), st0016_spr2_bank);
+ state_save_register_global(machine(), st0016_pal_bank);
+ state_save_register_global(machine(), st0016_char_bank);
+ //state_save_register_global(machine(), st0016_rom_bank);
+ state_save_register_global_array(machine(), st0016_vregs);
+ state_save_register_global_pointer(machine(), st0016_charram, ST0016_MAX_CHAR_BANK*ST0016_CHAR_BANK_SIZE);
+ state_save_register_global_pointer(machine(), st0016_paletteram, ST0016_MAX_PAL_BANK*ST0016_PAL_BANK_SIZE);
+ state_save_register_global_pointer(machine(), st0016_spriteram, ST0016_MAX_SPR_BANK*ST0016_SPR_BANK_SIZE);
}
@@ -483,13 +483,13 @@ VIDEO_START_MEMBER(st0016_state,st0016)
}
- st0016_save_init(machine());
+ st0016_save_init();
}
-static void draw_bgmap(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, int priority)
+void st0016_state::draw_bgmap(bitmap_ind16 &bitmap,const rectangle &cliprect, int priority)
{
- gfx_element *gfx = machine.gfx[st0016_ramgfx];
+ gfx_element *gfx = machine().gfx[st0016_ramgfx];
int j;
//for(j=0x40-8;j>=0;j-=8)
for(j=0;j<0x40;j+=8)
@@ -583,9 +583,9 @@ static void draw_bgmap(running_machine &machine, bitmap_ind16 &bitmap,const rect
void st0016_state::st0016_draw_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- draw_bgmap(machine(), bitmap,cliprect,0);
- draw_sprites(machine(), bitmap,cliprect);
- draw_bgmap(machine(), bitmap,cliprect,1);
+ draw_bgmap(bitmap,cliprect,0);
+ draw_sprites(bitmap,cliprect);
+ draw_bgmap(bitmap,cliprect,1);
}
UINT32 st0016_state::screen_update_st0016(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/stactics.c b/src/mame/video/stactics.c
index 1cb37572253..d0b54be0d45 100644
--- a/src/mame/video/stactics.c
+++ b/src/mame/video/stactics.c
@@ -173,26 +173,26 @@ CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_not_shot_arrive)
}
-static void update_beam(stactics_state *state)
+void stactics_state::update_beam()
{
/* first, update the firebeam state */
- state->m_old_beam_state = state->m_beam_state;
- if (state->m_shot_standby == 0)
- state->m_beam_state = state->m_beam_state + state->m_beam_states_per_frame;
+ m_old_beam_state = m_beam_state;
+ if (m_shot_standby == 0)
+ m_beam_state = m_beam_state + m_beam_states_per_frame;
/* These are thresholds for the two shots from the LED fire ROM */
/* (Note: There are two more for sound triggers, */
/* whenever that gets implemented) */
- if ((state->m_old_beam_state < 0x8b) & (state->m_beam_state >= 0x8b))
- state->m_shot_arrive = 1;
+ if ((m_old_beam_state < 0x8b) & (m_beam_state >= 0x8b))
+ m_shot_arrive = 1;
- if ((state->m_old_beam_state < 0xca) & (state->m_beam_state >= 0xca))
- state->m_shot_arrive = 1;
+ if ((m_old_beam_state < 0xca) & (m_beam_state >= 0xca))
+ m_shot_arrive = 1;
- if (state->m_beam_state >= 0x100)
+ if (m_beam_state >= 0x100)
{
- state->m_beam_state = 0;
- state->m_shot_standby = 1;
+ m_beam_state = 0;
+ m_shot_standby = 1;
}
}
@@ -204,7 +204,7 @@ static void update_beam(stactics_state *state)
*
*************************************/
-INLINE int get_pixel_on_plane(UINT8 *videoram, UINT8 y, UINT8 x, UINT8 y_scroll)
+inline int stactics_state::get_pixel_on_plane(UINT8 *videoram, UINT8 y, UINT8 x, UINT8 y_scroll)
{
UINT8 code;
UINT8 gfx;
@@ -223,7 +223,7 @@ INLINE int get_pixel_on_plane(UINT8 *videoram, UINT8 y, UINT8 x, UINT8 y_scroll)
}
-static void draw_background(stactics_state *state, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void stactics_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int y;
@@ -238,13 +238,13 @@ static void draw_background(stactics_state *state, bitmap_ind16 &bitmap, const r
for (x = 0; x < 0x100; x++)
{
/* get the pixels for the four planes */
- int pixel_b = get_pixel_on_plane(state->m_videoram_b, y, x, 0);
- int pixel_d = get_pixel_on_plane(state->m_videoram_d, y, x, state->m_y_scroll_d);
- int pixel_e = get_pixel_on_plane(state->m_videoram_e, y, x, state->m_y_scroll_e);
- int pixel_f = get_pixel_on_plane(state->m_videoram_f, y, x, state->m_y_scroll_f);
+ int pixel_b = get_pixel_on_plane(m_videoram_b, y, x, 0);
+ int pixel_d = get_pixel_on_plane(m_videoram_d, y, x, m_y_scroll_d);
+ int pixel_e = get_pixel_on_plane(m_videoram_e, y, x, m_y_scroll_e);
+ int pixel_f = get_pixel_on_plane(m_videoram_f, y, x, m_y_scroll_f);
/* get the color for this pixel */
- UINT8 color = state->m_videoram_b[((y >> 3) << 5) | (x >> 3)] >> 4;
+ UINT8 color = m_videoram_b[((y >> 3) << 5) | (x >> 3)] >> 4;
/* assemble the pen index */
int pen = color |
@@ -252,13 +252,13 @@ static void draw_background(stactics_state *state, bitmap_ind16 &bitmap, const r
(pixel_f << 5) |
(pixel_e << 6) |
(pixel_d << 7) |
- ((state->m_palette[0] & 0x01) << 8) |
- ((state->m_palette[1] & 0x01) << 9);
+ ((m_palette[0] & 0x01) << 8) |
+ ((m_palette[1] & 0x01) << 9);
/* compute the effective pixel coordinate after adjusting for the
mirror movement - this is mechanical on the real machine */
- int sy = y + state->m_vert_pos;
- int sx = x - state->m_horiz_pos;
+ int sy = y + m_vert_pos;
+ int sx = x - m_horiz_pos;
/* plot if visible */
if ((sy >= 0) && (sy < 0x100) && (sx >= 0) && (sx < 0x100))
@@ -283,7 +283,7 @@ static const int to_7seg[0x10] =
};
-static void set_indicator_leds(int data, const char *output_name, int base_index)
+void stactics_state::set_indicator_leds(int data, const char *output_name, int base_index)
{
/* decode the data */
data = to_7seg[~data & 0x0f];
@@ -296,24 +296,24 @@ static void set_indicator_leds(int data, const char *output_name, int base_index
}
-static void update_artwork(running_machine &machine, stactics_state *state)
+void stactics_state::update_artwork()
{
int i;
- UINT8 *beam_region = machine.root_device().memregion("user1")->base();
+ UINT8 *beam_region = machine().root_device().memregion("user1")->base();
/* set the lamps first */
- output_set_indexed_value("base_lamp", 4, state->m_lamps[0] & 0x01);
- output_set_indexed_value("base_lamp", 3, state->m_lamps[1] & 0x01);
- output_set_indexed_value("base_lamp", 2, state->m_lamps[2] & 0x01);
- output_set_indexed_value("base_lamp", 1, state->m_lamps[3] & 0x01);
- output_set_indexed_value("base_lamp", 0, state->m_lamps[4] & 0x01);
- output_set_value("start_lamp", state->m_lamps[5] & 0x01);
- output_set_value("barrier_lamp", state->m_lamps[6] & 0x01); /* this needs to flash on/off, not implemented */
+ output_set_indexed_value("base_lamp", 4, m_lamps[0] & 0x01);
+ output_set_indexed_value("base_lamp", 3, m_lamps[1] & 0x01);
+ output_set_indexed_value("base_lamp", 2, m_lamps[2] & 0x01);
+ output_set_indexed_value("base_lamp", 1, m_lamps[3] & 0x01);
+ output_set_indexed_value("base_lamp", 0, m_lamps[4] & 0x01);
+ output_set_value("start_lamp", m_lamps[5] & 0x01);
+ output_set_value("barrier_lamp", m_lamps[6] & 0x01); /* this needs to flash on/off, not implemented */
/* laser beam - loop for each LED */
for (i = 0; i < 0x40; i++)
{
- offs_t beam_data_offs = ((i & 0x08) << 7) | ((i & 0x30) << 4) | state->m_beam_state;
+ offs_t beam_data_offs = ((i & 0x08) << 7) | ((i & 0x30) << 4) | m_beam_state;
UINT8 beam_data = beam_region[beam_data_offs];
int on = (beam_data >> (i & 0x07)) & 0x01;
@@ -322,26 +322,26 @@ static void update_artwork(running_machine &machine, stactics_state *state)
}
/* sight LED */
- output_set_value("sight_led", *state->m_motor_on & 0x01);
+ output_set_value("sight_led", *m_motor_on & 0x01);
/* score display */
for (i = 0x01; i < 0x07; i++)
- output_set_digit_value(i - 1, to_7seg[~state->m_display_buffer[i] & 0x0f]);
+ output_set_digit_value(i - 1, to_7seg[~m_display_buffer[i] & 0x0f]);
/* credits indicator */
- set_indicator_leds(state->m_display_buffer[0x07], "credit_led", 0x00);
- set_indicator_leds(state->m_display_buffer[0x08], "credit_led", 0x04);
+ set_indicator_leds(m_display_buffer[0x07], "credit_led", 0x00);
+ set_indicator_leds(m_display_buffer[0x08], "credit_led", 0x04);
/* barriers indicator */
- set_indicator_leds(state->m_display_buffer[0x09], "barrier_led", 0x00);
- set_indicator_leds(state->m_display_buffer[0x0a], "barrier_led", 0x04);
- set_indicator_leds(state->m_display_buffer[0x0b], "barrier_led", 0x08);
+ set_indicator_leds(m_display_buffer[0x09], "barrier_led", 0x00);
+ set_indicator_leds(m_display_buffer[0x0a], "barrier_led", 0x04);
+ set_indicator_leds(m_display_buffer[0x0b], "barrier_led", 0x08);
/* rounds indicator */
- set_indicator_leds(state->m_display_buffer[0x0c], "round_led", 0x00);
- set_indicator_leds(state->m_display_buffer[0x0d], "round_led", 0x04);
- set_indicator_leds(state->m_display_buffer[0x0e], "round_led", 0x08);
- set_indicator_leds(state->m_display_buffer[0x0f], "round_led", 0x0c);
+ set_indicator_leds(m_display_buffer[0x0c], "round_led", 0x00);
+ set_indicator_leds(m_display_buffer[0x0d], "round_led", 0x04);
+ set_indicator_leds(m_display_buffer[0x0e], "round_led", 0x08);
+ set_indicator_leds(m_display_buffer[0x0f], "round_led", 0x0c);
}
@@ -375,9 +375,9 @@ VIDEO_START_MEMBER(stactics_state,stactics)
UINT32 stactics_state::screen_update_stactics(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- update_beam(this);
- draw_background(this, bitmap, cliprect);
- update_artwork(machine(), this);
+ update_beam();
+ draw_background(bitmap, cliprect);
+ update_artwork();
m_frame_count = (m_frame_count + 1) & 0x0f;
diff --git a/src/mame/video/starcrus.c b/src/mame/video/starcrus.c
index ad452e66177..e5dbcd30105 100644
--- a/src/mame/video/starcrus.c
+++ b/src/mame/video/starcrus.c
@@ -157,243 +157,239 @@ WRITE8_MEMBER(starcrus_state::starcrus_proj_parm_2_w)
}
}
-static int collision_check_s1s2(running_machine &machine)
+int starcrus_state::collision_check_s1s2()
{
- starcrus_state *state = machine.driver_data<starcrus_state>();
int org_x, org_y;
int sx, sy;
rectangle clip(0, 15, 0, 15);
- state->m_ship1_vid->fill(0, clip);
- state->m_ship2_vid->fill(0, clip);
+ m_ship1_vid->fill(0, clip);
+ m_ship2_vid->fill(0, clip);
/* origin is with respect to ship1 */
- org_x = state->m_s1_x;
- org_y = state->m_s1_y;
+ org_x = m_s1_x;
+ org_y = m_s1_y;
/* Draw ship 1 */
- drawgfx_opaque(*state->m_ship1_vid,
+ drawgfx_opaque(*m_ship1_vid,
clip,
- machine.gfx[8+((state->m_s1_sprite&0x04)>>2)],
- (state->m_s1_sprite&0x03)^0x03,
+ machine().gfx[8+((m_s1_sprite&0x04)>>2)],
+ (m_s1_sprite&0x03)^0x03,
0,
- (state->m_s1_sprite&0x08)>>3, (state->m_s1_sprite&0x10)>>4,
- state->m_s1_x-org_x, state->m_s1_y-org_y);
+ (m_s1_sprite&0x08)>>3, (m_s1_sprite&0x10)>>4,
+ m_s1_x-org_x, m_s1_y-org_y);
/* Draw ship 2 */
- drawgfx_opaque(*state->m_ship2_vid,
+ drawgfx_opaque(*m_ship2_vid,
clip,
- machine.gfx[10+((state->m_s2_sprite&0x04)>>2)],
- (state->m_s2_sprite&0x03)^0x03,
+ machine().gfx[10+((m_s2_sprite&0x04)>>2)],
+ (m_s2_sprite&0x03)^0x03,
0,
- (state->m_s2_sprite&0x08)>>3, (state->m_s2_sprite&0x10)>>4,
- state->m_s2_x-org_x, state->m_s2_y-org_y);
+ (m_s2_sprite&0x08)>>3, (m_s2_sprite&0x10)>>4,
+ m_s2_x-org_x, m_s2_y-org_y);
/* Now check for collisions */
for (sy=0;sy<16;sy++)
for (sx=0;sx<16;sx++)
/* Condition 1 - ship 1 = ship 2 */
- if ((state->m_ship1_vid->pix16(sy, sx) == 1) && (state->m_ship2_vid->pix16(sy, sx) == 1))
+ if ((m_ship1_vid->pix16(sy, sx) == 1) && (m_ship2_vid->pix16(sy, sx) == 1))
return 1;
return 0;
}
-static int collision_check_p1p2(running_machine &machine)
+int starcrus_state::collision_check_p1p2()
{
- starcrus_state *state = machine.driver_data<starcrus_state>();
int org_x, org_y;
int sx, sy;
rectangle clip(0, 15, 0, 15);
/* if both are scores, return */
- if ( ((state->m_p1_sprite & 0x08) == 0) &&
- ((state->m_p2_sprite & 0x08) == 0) )
+ if ( ((m_p1_sprite & 0x08) == 0) &&
+ ((m_p2_sprite & 0x08) == 0) )
{
return 0;
}
- state->m_proj1_vid->fill(0, clip);
- state->m_proj2_vid->fill(0, clip);
+ m_proj1_vid->fill(0, clip);
+ m_proj2_vid->fill(0, clip);
/* origin is with respect to proj1 */
- org_x = state->m_p1_x;
- org_y = state->m_p1_y;
+ org_x = m_p1_x;
+ org_y = m_p1_y;
- if (state->m_p1_sprite & 0x08) /* if p1 is a projectile */
+ if (m_p1_sprite & 0x08) /* if p1 is a projectile */
{
/* Draw score/projectile 1 */
- drawgfx_opaque(*state->m_proj1_vid,
+ drawgfx_opaque(*m_proj1_vid,
clip,
- machine.gfx[(state->m_p1_sprite&0x0c)>>2],
- (state->m_p1_sprite&0x03)^0x03,
+ machine().gfx[(m_p1_sprite&0x0c)>>2],
+ (m_p1_sprite&0x03)^0x03,
0,
0,0,
- state->m_p1_x-org_x, state->m_p1_y-org_y);
+ m_p1_x-org_x, m_p1_y-org_y);
}
- if (state->m_p2_sprite & 0x08) /* if p2 is a projectile */
+ if (m_p2_sprite & 0x08) /* if p2 is a projectile */
{
/* Draw score/projectile 2 */
- drawgfx_opaque(*state->m_proj2_vid,
+ drawgfx_opaque(*m_proj2_vid,
clip,
- machine.gfx[4+((state->m_p2_sprite&0x0c)>>2)],
- (state->m_p2_sprite&0x03)^0x03,
+ machine().gfx[4+((m_p2_sprite&0x0c)>>2)],
+ (m_p2_sprite&0x03)^0x03,
0,
0,0,
- state->m_p2_x-org_x, state->m_p2_y-org_y);
+ m_p2_x-org_x, m_p2_y-org_y);
}
/* Now check for collisions */
for (sy=0;sy<16;sy++)
for (sx=0;sx<16;sx++)
/* Condition 1 - proj 1 = proj 2 */
- if ((state->m_proj1_vid->pix16(sy, sx) == 1) && (state->m_proj2_vid->pix16(sy, sx) == 1))
+ if ((m_proj1_vid->pix16(sy, sx) == 1) && (m_proj2_vid->pix16(sy, sx) == 1))
return 1;
return 0;
}
-static int collision_check_s1p1p2(running_machine &machine)
+int starcrus_state::collision_check_s1p1p2()
{
- starcrus_state *state = machine.driver_data<starcrus_state>();
int org_x, org_y;
int sx, sy;
rectangle clip(0, 15, 0, 15);
/* if both are scores, return */
- if ( ((state->m_p1_sprite & 0x08) == 0) &&
- ((state->m_p2_sprite & 0x08) == 0) )
+ if ( ((m_p1_sprite & 0x08) == 0) &&
+ ((m_p2_sprite & 0x08) == 0) )
{
return 0;
}
- state->m_ship1_vid->fill(0, clip);
- state->m_proj1_vid->fill(0, clip);
- state->m_proj2_vid->fill(0, clip);
+ m_ship1_vid->fill(0, clip);
+ m_proj1_vid->fill(0, clip);
+ m_proj2_vid->fill(0, clip);
/* origin is with respect to ship1 */
- org_x = state->m_s1_x;
- org_y = state->m_s1_y;
+ org_x = m_s1_x;
+ org_y = m_s1_y;
/* Draw ship 1 */
- drawgfx_opaque(*state->m_ship1_vid,
+ drawgfx_opaque(*m_ship1_vid,
clip,
- machine.gfx[8+((state->m_s1_sprite&0x04)>>2)],
- (state->m_s1_sprite&0x03)^0x03,
+ machine().gfx[8+((m_s1_sprite&0x04)>>2)],
+ (m_s1_sprite&0x03)^0x03,
0,
- (state->m_s1_sprite&0x08)>>3, (state->m_s1_sprite&0x10)>>4,
- state->m_s1_x-org_x, state->m_s1_y-org_y);
+ (m_s1_sprite&0x08)>>3, (m_s1_sprite&0x10)>>4,
+ m_s1_x-org_x, m_s1_y-org_y);
- if (state->m_p1_sprite & 0x08) /* if p1 is a projectile */
+ if (m_p1_sprite & 0x08) /* if p1 is a projectile */
{
/* Draw projectile 1 */
- drawgfx_opaque(*state->m_proj1_vid,
+ drawgfx_opaque(*m_proj1_vid,
clip,
- machine.gfx[(state->m_p1_sprite&0x0c)>>2],
- (state->m_p1_sprite&0x03)^0x03,
+ machine().gfx[(m_p1_sprite&0x0c)>>2],
+ (m_p1_sprite&0x03)^0x03,
0,
0,0,
- state->m_p1_x-org_x, state->m_p1_y-org_y);
+ m_p1_x-org_x, m_p1_y-org_y);
}
- if (state->m_p2_sprite & 0x08) /* if p2 is a projectile */
+ if (m_p2_sprite & 0x08) /* if p2 is a projectile */
{
/* Draw projectile 2 */
- drawgfx_opaque(*state->m_proj2_vid,
+ drawgfx_opaque(*m_proj2_vid,
clip,
- machine.gfx[4+((state->m_p2_sprite&0x0c)>>2)],
- (state->m_p2_sprite&0x03)^0x03,
+ machine().gfx[4+((m_p2_sprite&0x0c)>>2)],
+ (m_p2_sprite&0x03)^0x03,
0,
0,0,
- state->m_p2_x-org_x, state->m_p2_y-org_y);
+ m_p2_x-org_x, m_p2_y-org_y);
}
/* Now check for collisions */
for (sy=0;sy<16;sy++)
for (sx=0;sx<16;sx++)
- if (state->m_ship1_vid->pix16(sy, sx) == 1)
+ if (m_ship1_vid->pix16(sy, sx) == 1)
{
/* Condition 1 - ship 1 = proj 1 */
- if (state->m_proj1_vid->pix16(sy, sx) == 1)
+ if (m_proj1_vid->pix16(sy, sx) == 1)
return 1;
/* Condition 2 - ship 1 = proj 2 */
- if (state->m_proj2_vid->pix16(sy, sx) == 1)
+ if (m_proj2_vid->pix16(sy, sx) == 1)
return 1;
}
return 0;
}
-static int collision_check_s2p1p2(running_machine &machine)
+int starcrus_state::collision_check_s2p1p2()
{
- starcrus_state *state = machine.driver_data<starcrus_state>();
int org_x, org_y;
int sx, sy;
rectangle clip(0, 15, 0, 15);
/* if both are scores, return */
- if ( ((state->m_p1_sprite & 0x08) == 0) &&
- ((state->m_p2_sprite & 0x08) == 0) )
+ if ( ((m_p1_sprite & 0x08) == 0) &&
+ ((m_p2_sprite & 0x08) == 0) )
{
return 0;
}
- state->m_ship2_vid->fill(0, clip);
- state->m_proj1_vid->fill(0, clip);
- state->m_proj2_vid->fill(0, clip);
+ m_ship2_vid->fill(0, clip);
+ m_proj1_vid->fill(0, clip);
+ m_proj2_vid->fill(0, clip);
/* origin is with respect to ship2 */
- org_x = state->m_s2_x;
- org_y = state->m_s2_y;
+ org_x = m_s2_x;
+ org_y = m_s2_y;
/* Draw ship 2 */
- drawgfx_opaque(*state->m_ship2_vid,
+ drawgfx_opaque(*m_ship2_vid,
clip,
- machine.gfx[10+((state->m_s2_sprite&0x04)>>2)],
- (state->m_s2_sprite&0x03)^0x03,
+ machine().gfx[10+((m_s2_sprite&0x04)>>2)],
+ (m_s2_sprite&0x03)^0x03,
0,
- (state->m_s2_sprite&0x08)>>3, (state->m_s2_sprite&0x10)>>4,
- state->m_s2_x-org_x, state->m_s2_y-org_y);
+ (m_s2_sprite&0x08)>>3, (m_s2_sprite&0x10)>>4,
+ m_s2_x-org_x, m_s2_y-org_y);
- if (state->m_p1_sprite & 0x08) /* if p1 is a projectile */
+ if (m_p1_sprite & 0x08) /* if p1 is a projectile */
{
/* Draw projectile 1 */
- drawgfx_opaque(*state->m_proj1_vid,
+ drawgfx_opaque(*m_proj1_vid,
clip,
- machine.gfx[(state->m_p1_sprite&0x0c)>>2],
- (state->m_p1_sprite&0x03)^0x03,
+ machine().gfx[(m_p1_sprite&0x0c)>>2],
+ (m_p1_sprite&0x03)^0x03,
0,
0,0,
- state->m_p1_x-org_x, state->m_p1_y-org_y);
+ m_p1_x-org_x, m_p1_y-org_y);
}
- if (state->m_p2_sprite & 0x08) /* if p2 is a projectile */
+ if (m_p2_sprite & 0x08) /* if p2 is a projectile */
{
/* Draw projectile 2 */
- drawgfx_opaque(*state->m_proj2_vid,
+ drawgfx_opaque(*m_proj2_vid,
clip,
- machine.gfx[4+((state->m_p2_sprite&0x0c)>>2)],
- (state->m_p2_sprite&0x03)^0x03,
+ machine().gfx[4+((m_p2_sprite&0x0c)>>2)],
+ (m_p2_sprite&0x03)^0x03,
0,
0,0,
- state->m_p2_x-org_x, state->m_p2_y-org_y);
+ m_p2_x-org_x, m_p2_y-org_y);
}
/* Now check for collisions */
for (sy=0;sy<16;sy++)
for (sx=0;sx<16;sx++)
- if (state->m_ship2_vid->pix16(sy, sx) == 1)
+ if (m_ship2_vid->pix16(sy, sx) == 1)
{
/* Condition 1 - ship 2 = proj 1 */
- if (state->m_proj1_vid->pix16(sy, sx) == 1)
+ if (m_proj1_vid->pix16(sy, sx) == 1)
return 1;
/* Condition 2 - ship 2 = proj 2 */
- if (state->m_proj2_vid->pix16(sy, sx) == 1)
+ if (m_proj2_vid->pix16(sy, sx) == 1)
return 1;
}
@@ -450,23 +446,23 @@ UINT32 starcrus_state::screen_update_starcrus(screen_device &screen, bitmap_ind1
m_collision_reg = 0x00;
/* Check for collisions between ship1 and ship2 */
- if (collision_check_s1s2(machine()))
+ if (collision_check_s1s2())
{
m_collision_reg |= 0x08;
}
/* Check for collisions between ship1 and projectiles */
- if (collision_check_s1p1p2(machine()))
+ if (collision_check_s1p1p2())
{
m_collision_reg |= 0x02;
}
/* Check for collisions between ship1 and projectiles */
- if (collision_check_s2p1p2(machine()))
+ if (collision_check_s2p1p2())
{
m_collision_reg |= 0x01;
}
/* Check for collisions between ship1 and projectiles */
/* Note: I don't think this is used by the game */
- if (collision_check_p1p2(machine()))
+ if (collision_check_p1p2())
{
m_collision_reg |= 0x04;
}
diff --git a/src/mame/video/starfire.c b/src/mame/video/starfire.c
index 0eead4ef5d8..6aa29ce06db 100644
--- a/src/mame/video/starfire.c
+++ b/src/mame/video/starfire.c
@@ -213,14 +213,13 @@ READ8_MEMBER(starfire_state::starfire_videoram_r)
*
*************************************/
-static void get_pens(running_machine &machine, pen_t *pens)
+void starfire_state::get_pens(pen_t *pens)
{
offs_t offs;
- starfire_state *state = machine.driver_data<starfire_state>();
for (offs = 0; offs < STARFIRE_NUM_PENS; offs++)
{
- UINT16 color = state->m_starfire_colors[offs];
+ UINT16 color = m_starfire_colors[offs];
pens[offs] = MAKE_RGB(pal3bit(color >> 6), pal3bit(color >> 3), pal3bit(color >> 0));
}
@@ -231,7 +230,7 @@ TIMER_CALLBACK_MEMBER(starfire_state::starfire_scanline_callback)
pen_t pens[STARFIRE_NUM_PENS];
int y = param;
- get_pens(machine(), pens);
+ get_pens(pens);
UINT8 *pix = &m_starfire_videoram[y];
UINT8 *col = &m_starfire_colorram[y];
diff --git a/src/mame/video/starshp1.c b/src/mame/video/starshp1.c
index 22d254e2fa9..d5058571280 100644
--- a/src/mame/video/starshp1.c
+++ b/src/mame/video/starshp1.c
@@ -8,16 +8,16 @@ Atari Starship 1 video emulation
#include "includes/starshp1.h"
-static void set_pens(starshp1_state *state, colortable_t *colortable)
+void starshp1_state::set_pens(colortable_t *colortable)
{
- colortable_palette_set_color(colortable, state->m_inverse ? 7 : 0, MAKE_RGB(0x00, 0x00, 0x00));
- colortable_palette_set_color(colortable, state->m_inverse ? 6 : 1, MAKE_RGB(0x1e, 0x1e, 0x1e));
- colortable_palette_set_color(colortable, state->m_inverse ? 5 : 2, MAKE_RGB(0x4e, 0x4e, 0x4e));
- colortable_palette_set_color(colortable, state->m_inverse ? 4 : 3, MAKE_RGB(0x6c, 0x6c, 0x6c));
- colortable_palette_set_color(colortable, state->m_inverse ? 3 : 4, MAKE_RGB(0x93, 0x93, 0x93));
- colortable_palette_set_color(colortable, state->m_inverse ? 2 : 5, MAKE_RGB(0xb1, 0xb1, 0xb1));
- colortable_palette_set_color(colortable, state->m_inverse ? 1 : 6, MAKE_RGB(0xe1, 0xe1, 0xe1));
- colortable_palette_set_color(colortable, state->m_inverse ? 0 : 7, MAKE_RGB(0xff, 0xff, 0xff));
+ colortable_palette_set_color(colortable, m_inverse ? 7 : 0, MAKE_RGB(0x00, 0x00, 0x00));
+ colortable_palette_set_color(colortable, m_inverse ? 6 : 1, MAKE_RGB(0x1e, 0x1e, 0x1e));
+ colortable_palette_set_color(colortable, m_inverse ? 5 : 2, MAKE_RGB(0x4e, 0x4e, 0x4e));
+ colortable_palette_set_color(colortable, m_inverse ? 4 : 3, MAKE_RGB(0x6c, 0x6c, 0x6c));
+ colortable_palette_set_color(colortable, m_inverse ? 3 : 4, MAKE_RGB(0x93, 0x93, 0x93));
+ colortable_palette_set_color(colortable, m_inverse ? 2 : 5, MAKE_RGB(0xb1, 0xb1, 0xb1));
+ colortable_palette_set_color(colortable, m_inverse ? 1 : 6, MAKE_RGB(0xe1, 0xe1, 0xe1));
+ colortable_palette_set_color(colortable, m_inverse ? 0 : 7, MAKE_RGB(0xff, 0xff, 0xff));
}
@@ -141,7 +141,7 @@ WRITE8_MEMBER(starshp1_state::starshp1_playfield_w)
}
-static void draw_starfield(starshp1_state *state, bitmap_ind16 &bitmap)
+void starshp1_state::draw_starfield(bitmap_ind16 &bitmap)
{
/*
* The LSFR is reset once per frame at the position of
@@ -154,7 +154,7 @@ static void draw_starfield(starshp1_state *state, bitmap_ind16 &bitmap)
for (y = 0; y < bitmap.height(); y++)
{
- const UINT16* p = state->m_LSFR + (UINT16) (512 * y);
+ const UINT16* p = m_LSFR + (UINT16) (512 * y);
UINT16* pLine = &bitmap.pix16(y);
@@ -165,67 +165,65 @@ static void draw_starfield(starshp1_state *state, bitmap_ind16 &bitmap)
}
-static int get_sprite_hpos(starshp1_state *state, int i)
+int starshp1_state::get_sprite_hpos(int i)
{
- return 2 * (state->m_hpos_ram[i] ^ 0xff);
+ return 2 * (m_hpos_ram[i] ^ 0xff);
}
-static int get_sprite_vpos(starshp1_state *state, int i)
+int starshp1_state::get_sprite_vpos(int i)
{
- return 1 * (state->m_vpos_ram[i] - 0x07);
+ return 1 * (m_vpos_ram[i] - 0x07);
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void starshp1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- starshp1_state *state = machine.driver_data<starshp1_state>();
int i;
for (i = 0; i < 14; i++)
{
- int code = (state->m_obj_ram[i] & 0xf) ^ 0xf;
+ int code = (m_obj_ram[i] & 0xf) ^ 0xf;
- drawgfx_transpen(bitmap, cliprect, machine.gfx[1],
+ drawgfx_transpen(bitmap, cliprect, machine().gfx[1],
code % 8,
code / 8,
0, 0,
- get_sprite_hpos(state, i),
- get_sprite_vpos(state, i), 0);
+ get_sprite_hpos(i),
+ get_sprite_vpos(i), 0);
}
}
-static void draw_spaceship(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void starshp1_state::draw_spaceship(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- starshp1_state *state = machine.driver_data<starshp1_state>();
- double scaler = -5 * log(1 - state->m_ship_size / 256.0); /* ? */
+ double scaler = -5 * log(1 - m_ship_size / 256.0); /* ? */
unsigned xzoom = 2 * 0x10000 * scaler;
unsigned yzoom = 1 * 0x10000 * scaler;
- int x = get_sprite_hpos(state, 14);
- int y = get_sprite_vpos(state, 14);
+ int x = get_sprite_hpos(14);
+ int y = get_sprite_vpos(14);
if (x <= 0)
- x -= (xzoom * state->m_ship_hoffset) >> 16;
+ x -= (xzoom * m_ship_hoffset) >> 16;
if (y <= 0)
- y -= (yzoom * state->m_ship_voffset) >> 16;
+ y -= (yzoom * m_ship_voffset) >> 16;
- drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[2],
- state->m_ship_picture & 0x03,
- state->m_ship_explode,
- state->m_ship_picture & 0x80, 0,
+ drawgfxzoom_transpen(bitmap, cliprect, machine().gfx[2],
+ m_ship_picture & 0x03,
+ m_ship_explode,
+ m_ship_picture & 0x80, 0,
x, y,
xzoom, yzoom, 0);
}
-static void draw_phasor(starshp1_state *state, bitmap_ind16 &bitmap)
+void starshp1_state::draw_phasor(bitmap_ind16 &bitmap)
{
int i;
for (i = 128; i < 240; i++)
- if (i >= get_sprite_vpos(state, 13))
+ if (i >= get_sprite_vpos(13))
{
bitmap.pix16(i, 2 * i + 0) = 0x10;
bitmap.pix16(i, 2 * i + 1) = 0x10;
@@ -235,26 +233,25 @@ static void draw_phasor(starshp1_state *state, bitmap_ind16 &bitmap)
}
-static int get_radius(starshp1_state *state)
+int starshp1_state::get_radius()
{
- return 6 * sqrt((double)state->m_circle_size); /* size calibrated by hand */
+ return 6 * sqrt((double)m_circle_size); /* size calibrated by hand */
}
-static int get_circle_hpos(starshp1_state *state)
+int starshp1_state::get_circle_hpos()
{
- return 2 * (3 * state->m_circle_hpos / 2 - 64);
+ return 2 * (3 * m_circle_hpos / 2 - 64);
}
-static int get_circle_vpos(starshp1_state *state)
+int starshp1_state::get_circle_vpos()
{
- return 1 * (3 * state->m_circle_vpos / 2 - 64);
+ return 1 * (3 * m_circle_vpos / 2 - 64);
}
-static void draw_circle_line(running_machine &machine, bitmap_ind16 &bitmap, int x, int y, int l)
+void starshp1_state::draw_circle_line(bitmap_ind16 &bitmap, int x, int y, int l)
{
- starshp1_state *state = machine.driver_data<starshp1_state>();
if (y >= 0 && y <= bitmap.height() - 1)
{
- const UINT16* p = state->m_LSFR + (UINT16) (512 * y);
+ const UINT16* p = m_LSFR + (UINT16) (512 * y);
UINT16* pLine = &bitmap.pix16(y);
@@ -267,7 +264,7 @@ static void draw_circle_line(running_machine &machine, bitmap_ind16 &bitmap, int
h2 = bitmap.width() - 1;
for (x = h1; x <= h2; x++)
- if (state->m_circle_mod)
+ if (m_circle_mod)
{
if (p[x] & 1)
pLine[x] = 0x11;
@@ -278,25 +275,24 @@ static void draw_circle_line(running_machine &machine, bitmap_ind16 &bitmap, int
}
-static void draw_circle(running_machine &machine, bitmap_ind16 &bitmap)
+void starshp1_state::draw_circle(bitmap_ind16 &bitmap)
{
- starshp1_state *state = machine.driver_data<starshp1_state>();
- int cx = get_circle_hpos(state);
- int cy = get_circle_vpos(state);
+ int cx = get_circle_hpos();
+ int cy = get_circle_vpos();
int x = 0;
- int y = get_radius(state);
+ int y = get_radius();
/* Bresenham's circle algorithm */
- int d = 3 - 2 * get_radius(state);
+ int d = 3 - 2 * get_radius();
while (x <= y)
{
- draw_circle_line(machine, bitmap, cx, cy - x, y);
- draw_circle_line(machine, bitmap, cx, cy + x, y);
- draw_circle_line(machine, bitmap, cx, cy - y, x);
- draw_circle_line(machine, bitmap, cx, cy + y, x);
+ draw_circle_line(bitmap, cx, cy - x, y);
+ draw_circle_line(bitmap, cx, cy + x, y);
+ draw_circle_line(bitmap, cx, cy - y, x);
+ draw_circle_line(bitmap, cx, cy + y, x);
x++;
@@ -308,15 +304,14 @@ static void draw_circle(running_machine &machine, bitmap_ind16 &bitmap)
}
-static int spaceship_collision(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &rect)
+int starshp1_state::spaceship_collision(bitmap_ind16 &bitmap, const rectangle &rect)
{
- starshp1_state *state = machine.driver_data<starshp1_state>();
int x;
int y;
for (y = rect.min_y; y <= rect.max_y; y++)
{
- const UINT16* pLine = &state->m_helper.pix16(y);
+ const UINT16* pLine = &m_helper.pix16(y);
for (x = rect.min_x; x <= rect.max_x; x++)
if (pLine[x] != 0)
@@ -327,7 +322,7 @@ static int spaceship_collision(running_machine &machine, bitmap_ind16 &bitmap, c
}
-static int point_in_circle(int x, int y, int center_x, int center_y, int r)
+int starshp1_state::point_in_circle(int x, int y, int center_x, int center_y, int r)
{
int dx = abs(x - center_x) / 2;
int dy = abs(y - center_y) / 1;
@@ -336,12 +331,12 @@ static int point_in_circle(int x, int y, int center_x, int center_y, int r)
}
-static int circle_collision(starshp1_state *state, const rectangle &rect)
+int starshp1_state::circle_collision(const rectangle &rect)
{
- int center_x = get_circle_hpos(state);
- int center_y = get_circle_vpos(state);
+ int center_x = get_circle_hpos();
+ int center_y = get_circle_vpos();
- int r = get_radius(state);
+ int r = get_radius();
return point_in_circle(rect.min_x, rect.min_y, center_x, center_y, r) ||
point_in_circle(rect.min_x, rect.max_y, center_x, center_y, r) ||
@@ -352,28 +347,28 @@ static int circle_collision(starshp1_state *state, const rectangle &rect)
UINT32 starshp1_state::screen_update_starshp1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- set_pens(this, machine().colortable);
+ set_pens(machine().colortable);
bitmap.fill(0, cliprect);
if (m_starfield_kill == 0)
- draw_starfield(this, bitmap);
+ draw_starfield(bitmap);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
if (m_circle_kill == 0 && m_circle_mod != 0)
- draw_circle(machine(), bitmap);
+ draw_circle(bitmap);
if (m_attract == 0)
- draw_spaceship(machine(), bitmap, cliprect);
+ draw_spaceship(bitmap, cliprect);
if (m_circle_kill == 0 && m_circle_mod == 0)
- draw_circle(machine(), bitmap);
+ draw_circle(bitmap);
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
if (m_phasor != 0)
- draw_phasor(this, bitmap);
+ draw_phasor(bitmap);
return 0;
}
@@ -387,8 +382,8 @@ void starshp1_state::screen_eof_starshp1(screen_device &screen, bool state)
rectangle rect;
const rectangle &visarea = machine().primary_screen->visible_area();
- rect.min_x = get_sprite_hpos(this, 13);
- rect.min_y = get_sprite_vpos(this, 13);
+ rect.min_x = get_sprite_hpos(13);
+ rect.min_y = get_sprite_vpos(13);
rect.max_x = rect.min_x + machine().gfx[1]->width() - 1;
rect.max_y = rect.min_y + machine().gfx[1]->height() - 1;
@@ -397,18 +392,18 @@ void starshp1_state::screen_eof_starshp1(screen_device &screen, bool state)
m_helper.fill(0, visarea);
if (m_attract == 0)
- draw_spaceship(machine(), m_helper, visarea);
+ draw_spaceship(m_helper, visarea);
- if (circle_collision(this, visarea))
+ if (circle_collision(visarea))
m_collision_latch |= 1;
- if (circle_collision(this, rect))
+ if (circle_collision(rect))
m_collision_latch |= 2;
- if (spaceship_collision(machine(), m_helper, rect))
+ if (spaceship_collision(m_helper, rect))
m_collision_latch |= 4;
- if (spaceship_collision(machine(), m_helper, visarea))
+ if (spaceship_collision(m_helper, visarea))
m_collision_latch |= 8;
}
}
diff --git a/src/mame/video/stfight.c b/src/mame/video/stfight.c
index f0da91c5acc..171017b65f7 100644
--- a/src/mame/video/stfight.c
+++ b/src/mame/video/stfight.c
@@ -68,17 +68,16 @@ void stfight_state::palette_init()
}
-static void set_pens(running_machine &machine)
+void stfight_state::set_pens()
{
- stfight_state *state = machine.driver_data<stfight_state>();
int i;
for (i = 0; i < 0x100; i++)
{
- UINT16 data = state->m_generic_paletteram_8[i] | (state->m_generic_paletteram2_8[i] << 8);
+ UINT16 data = m_generic_paletteram_8[i] | (m_generic_paletteram2_8[i] << 8);
rgb_t color = MAKE_RGB(pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
- colortable_palette_set_color(machine.colortable, i, color);
+ colortable_palette_set_color(machine().colortable, i, color);
}
}
@@ -240,21 +239,20 @@ WRITE8_MEMBER(stfight_state::stfight_vh_latch_w)
***************************************************************************/
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void stfight_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- stfight_state *state = machine.driver_data<stfight_state>();
int offs,sx,sy;
for (offs = 0;offs < 4096;offs += 32)
{
int code;
- int attr = state->m_sprite_ram[offs+1];
+ int attr = m_sprite_ram[offs+1];
int flipx = attr & 0x10;
int color = attr & 0x0f;
int pri = (attr & 0x20) >> 5;
- sy = state->m_sprite_ram[offs+2];
- sx = state->m_sprite_ram[offs+3];
+ sy = m_sprite_ram[offs+2];
+ sx = m_sprite_ram[offs+3];
// non-active sprites have zero y coordinate value
if( sy > 0 )
@@ -267,21 +265,21 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
sx -= 0x100;
}
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
flipx = !flipx;
}
- code = state->m_sprite_base + state->m_sprite_ram[offs];
+ code = m_sprite_base + m_sprite_ram[offs];
- pdrawgfx_transpen(bitmap,cliprect,machine.gfx[4],
+ pdrawgfx_transpen(bitmap,cliprect,machine().gfx[4],
code,
color,
- flipx,state->flip_screen(),
+ flipx,flip_screen(),
sx,sy,
- machine.priority_bitmap,
+ machine().priority_bitmap,
pri ? 0x02 : 0,0x0f);
}
}
@@ -290,7 +288,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
UINT32 stfight_state::screen_update_stfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- set_pens(machine());
+ set_pens();
machine().priority_bitmap.fill(0, cliprect);
@@ -300,7 +298,7 @@ UINT32 stfight_state::screen_update_stfight(screen_device &screen, bitmap_ind16
/* Draw sprites (may be obscured by foreground layer) */
if (m_vh_latch_ram[0x07] & 0x40)
- draw_sprites(machine(), bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
diff --git a/src/mame/video/stlforce.c b/src/mame/video/stlforce.c
index 94c7d3c051d..21472e14516 100644
--- a/src/mame/video/stlforce.c
+++ b/src/mame/video/stlforce.c
@@ -87,12 +87,11 @@ WRITE16_MEMBER(stlforce_state::stlforce_tx_videoram_w)
/* sprites - quite a bit still needs doing .. */
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void stlforce_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- stlforce_state *state = machine.driver_data<stlforce_state>();
- const UINT16 *source = state->m_spriteram+0x0;
- const UINT16 *finish = state->m_spriteram+0x800;
- gfx_element *gfx = machine.gfx[2];
+ const UINT16 *source = m_spriteram+0x0;
+ const UINT16 *finish = m_spriteram+0x800;
+ gfx_element *gfx = machine().gfx[2];
int ypos, xpos, attr, num;
while (source<finish)
@@ -112,7 +111,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
num,
64+attr,
0,0,
- xpos+state->m_sprxoffs,ypos,0 );
+ xpos+m_sprxoffs,ypos,0 );
}
source += 0x4;
@@ -166,7 +165,7 @@ UINT32 stlforce_state::screen_update_stlforce(screen_device &screen, bitmap_ind1
m_bg_tilemap->draw(bitmap, cliprect, 0,0);
m_mlow_tilemap->draw(bitmap, cliprect, 0,0);
m_mhigh_tilemap->draw(bitmap, cliprect, 0,0);
- draw_sprites(machine(), bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
}
diff --git a/src/mame/video/strnskil.c b/src/mame/video/strnskil.c
index 231ca34f1b0..fdbff97801e 100644
--- a/src/mame/video/strnskil.c
+++ b/src/mame/video/strnskil.c
@@ -78,24 +78,23 @@ void strnskil_state::video_start()
m_bg_tilemap->set_scroll_rows(32);
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void strnskil_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- strnskil_state *state = machine.driver_data<strnskil_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs;
for (offs = 0x60; offs < 0x100; offs += 4)
{
int code = spriteram[offs + 1];
int color = spriteram[offs + 2] & 0x3f;
- int flipx = state->flip_screen_x();
- int flipy = state->flip_screen_y();
+ int flipx = flip_screen_x();
+ int flipy = flip_screen_y();
int sx = spriteram[offs + 3];
int sy = spriteram[offs];
int px, py;
- if (state->flip_screen())
+ if (flip_screen())
{
px = 240 - sx + 0; /* +2 or +0 ? */
py = sy;
@@ -112,11 +111,11 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
sx = sx - 256;
drawgfx_transmask(bitmap, cliprect,
- machine.gfx[1],
+ machine().gfx[1],
code, color,
flipx, flipy,
px, py,
- colortable_get_transpen_mask(machine.colortable, machine.gfx[1], color, 0));
+ colortable_get_transpen_mask(machine().colortable, machine().gfx[1], color, 0));
}
}
@@ -142,6 +141,6 @@ UINT32 strnskil_state::screen_update_strnskil(screen_device &screen, bitmap_ind1
}
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
- draw_sprites(machine(), bitmap, cliprect);
+ draw_sprites(bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c
index 3ee07b6a142..1310dd0a8a3 100644
--- a/src/mame/video/suna16.c
+++ b/src/mame/video/suna16.c
@@ -115,12 +115,11 @@ WRITE16_MEMBER(suna16_state::suna16_paletteram16_w)
***************************************************************************/
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *sprites, int gfx)
+void suna16_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 *sprites, int gfx)
{
- suna16_state *state = machine.driver_data<suna16_state>();
int offs;
- int max_x = machine.primary_screen->width() - 8;
- int max_y = machine.primary_screen->height() - 8;
+ int max_x = machine().primary_screen->width() - 8;
+ int max_y = machine().primary_screen->height() - 8;
for ( offs = 0xfc00/2; offs < 0x10000/2 ; offs += 4/2 )
{
@@ -181,7 +180,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
if (flipx) tile_flipx = !tile_flipx;
- if (state->flip_screen())
+ if (flip_screen())
{
sx = max_x - sx;
sy = max_y - sy;
@@ -189,9 +188,9 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
tile_flipy = !tile_flipy;
}
- drawgfx_transpen( bitmap, cliprect,machine.gfx[gfx],
+ drawgfx_transpen( bitmap, cliprect,machine().gfx[gfx],
(tile & 0x3fff) + bank*0x4000,
- attr + (state->m_color_bank << 4),
+ attr + (m_color_bank << 4),
tile_flipx, tile_flipy,
sx, sy,15 );
@@ -218,7 +217,7 @@ UINT32 suna16_state::screen_update_suna16(screen_device &screen, bitmap_ind16 &b
{
/* Suna Quiz indicates the background is the last pen */
bitmap.fill(0xff, cliprect);
- draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0);
+ draw_sprites(bitmap, cliprect, m_spriteram, 0);
return 0;
}
@@ -237,7 +236,7 @@ if (machine().input().code_pressed(KEYCODE_Z))
/* Suna Quiz indicates the background is the last pen */
bitmap.fill(0xff, cliprect);
- if (layers_ctrl & 1) draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0);
- if (layers_ctrl & 2) draw_sprites(machine(), bitmap, cliprect, m_spriteram2, 1);
+ if (layers_ctrl & 1) draw_sprites(bitmap, cliprect, m_spriteram, 0);
+ if (layers_ctrl & 2) draw_sprites(bitmap, cliprect, m_spriteram2, 1);
return 0;
}
diff --git a/src/mame/video/suna8.c b/src/mame/video/suna8.c
index 421d9836b29..8b302d2b261 100644
--- a/src/mame/video/suna8.c
+++ b/src/mame/video/suna8.c
@@ -218,17 +218,16 @@ VIDEO_START_MEMBER(suna8_state,suna8_starfigh) { suna8_vh_start_common(
***************************************************************************/
-static void draw_normal_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, int which)
+void suna8_state::draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int which)
{
- suna8_state *state = machine.driver_data<suna8_state>();
- UINT8 *spriteram = state->m_spriteram + which * 0x2000 * 2;
+ UINT8 *spriteram = m_spriteram + which * 0x2000 * 2;
int i;
int mx = 0; // multisprite x counter
- int max_x = machine.primary_screen->width() - 8;
- int max_y = machine.primary_screen->height() - 8;
+ int max_x = machine().primary_screen->width() - 8;
+ int max_y = machine().primary_screen->height() - 8;
for (i = 0x1d00; i < 0x2000; i += 4)
{
@@ -240,7 +239,7 @@ static void draw_normal_sprites(running_machine &machine, bitmap_ind16 &bitmap,c
int x = spriteram[i + 2];
int bank = spriteram[i + 3];
- if (state->m_text_dim)
+ if (m_text_dim)
{
// Older, simpler hardware: hardhead, rranger
flipx = 0;
@@ -292,7 +291,7 @@ static void draw_normal_sprites(running_machine &machine, bitmap_ind16 &bitmap,c
srcy = (((bank & 0x80)>>4) + (bank & 0x04) + ((~bank >> 4)&2)) * 2;
srcpg = ((code >> 4) & 3) + 4;
gfxbank = (bank & 0x3);
- switch (state->m_gfxbank_type)
+ switch (m_gfxbank_type)
{
case suna8_state::GFXBANK_TYPE_SPARKMAN:
break;
@@ -314,7 +313,7 @@ static void draw_normal_sprites(running_machine &machine, bitmap_ind16 &bitmap,c
// 70 56/8/a/c 0e 01 (gfxhi=1)
// 6f 78/a/c/e 0f 04 ""
if (gfxbank == 3)
- gfxbank += state->m_gfxbank;
+ gfxbank += m_gfxbank;
break;
}
colorbank = (bank & 8) >> 3;
@@ -328,13 +327,13 @@ static void draw_normal_sprites(running_machine &machine, bitmap_ind16 &bitmap,c
srcy = (((bank & 0x80)>>4) + (bank & 0x04) + ((~bank >> 4)&3)) * 2;
srcpg = (code >> 4) & 3;
gfxbank = bank & 0x03;
- switch (state->m_gfxbank_type)
+ switch (m_gfxbank_type)
{
case suna8_state::GFXBANK_TYPE_STARFIGH:
// starfigh: boss 2 tail, p2 g7:
// 61 20 1b 27
if (gfxbank == 3)
- gfxbank += state->m_gfxbank;
+ gfxbank += m_gfxbank;
break;
default:
@@ -374,15 +373,15 @@ static void draw_normal_sprites(running_machine &machine, bitmap_ind16 &bitmap,c
if (flipx) tile_flipx = !tile_flipx;
if (flipy) tile_flipy = !tile_flipy;
- if (state->flip_screen())
+ if (flip_screen())
{
sx = max_x - sx; tile_flipx = !tile_flipx;
sy = max_y - sy; tile_flipy = !tile_flipy;
}
- drawgfx_transpen( bitmap, cliprect, machine.gfx[which],
+ drawgfx_transpen( bitmap, cliprect, machine().gfx[which],
tile + (attr & 0x3)*0x100 + gfxbank,
- (((attr >> 2) & 0xf) | colorbank) + 0x10 * state->m_palettebank, // hardhea2 player2
+ (((attr >> 2) & 0xf) | colorbank) + 0x10 * m_palettebank, // hardhea2 player2
tile_flipx, tile_flipy,
sx, sy, 0xf);
}
@@ -391,14 +390,13 @@ static void draw_normal_sprites(running_machine &machine, bitmap_ind16 &bitmap,c
}
}
-static void draw_text_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
+void suna8_state::draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- suna8_state *state = machine.driver_data<suna8_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int i;
- int max_x = machine.primary_screen->width() - 8;
- int max_y = machine.primary_screen->height() - 8;
+ int max_x = machine().primary_screen->width() - 8;
+ int max_y = machine().primary_screen->height() - 8;
for (i = 0x1900; i < 0x19ff; i += 4)
{
@@ -411,7 +409,7 @@ static void draw_text_sprites(running_machine &machine, bitmap_ind16 &bitmap,con
if (~code & 0x80) continue;
- dimx = 2; dimy = state->m_text_dim;
+ dimx = 2; dimy = m_text_dim;
srcx = (code & 0xf) * 2; srcy = (y & 0xf0) / 8;
srcpg = (code >> 4) & 3;
@@ -439,13 +437,13 @@ static void draw_text_sprites(running_machine &machine, bitmap_ind16 &bitmap,con
int sx = x + tx * 8;
int sy = (y + real_ty * 8) & 0xff;
- if (state->flip_screen())
+ if (flip_screen())
{
sx = max_x - sx; flipx = !flipx;
sy = max_y - sy; flipy = !flipy;
}
- drawgfx_transpen( bitmap,cliprect,machine.gfx[0],
+ drawgfx_transpen( bitmap,cliprect,machine().gfx[0],
tile + (attr & 0x3)*0x100 + bank,
(attr >> 2) & 0xf,
flipx, flipy,
@@ -501,15 +499,15 @@ UINT32 suna8_state::screen_update_suna8(screen_device &screen, bitmap_ind16 &bit
#endif
{
// Normal sprites
- draw_normal_sprites(machine(), bitmap,cliprect, 0);
+ draw_normal_sprites(bitmap,cliprect, 0);
// More normal sprites (second sprite "chip" in sparkman)
if (machine().gfx[1])
- draw_normal_sprites(machine(), bitmap,cliprect, 1);
+ draw_normal_sprites(bitmap,cliprect, 1);
// Text sprites (earlier games only)
if (m_text_dim)
- draw_text_sprites(machine(), bitmap,cliprect);
+ draw_text_sprites(bitmap,cliprect);
}
return 0;
}
diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c
index 11cee98d6d4..ece065ea43f 100644
--- a/src/mame/video/superchs.c
+++ b/src/mame/video/superchs.c
@@ -53,11 +53,10 @@ Heavy use is made of sprite zooming.
********************************************************/
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs)
+void superchs_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs)
{
- superchs_state *state = machine.driver_data<superchs_state>();
- UINT32 *spriteram32 = state->m_spriteram;
- UINT16 *spritemap = (UINT16 *)state->memregion("user1")->base();
+ UINT32 *spriteram32 = m_spriteram;
+ UINT16 *spritemap = (UINT16 *)memregion("user1")->base();
int offs, data, tilenum, color, flipx, flipy;
int x, y, priority, dblsize, curx, cury;
int sprites_flipscreen = 0;
@@ -67,9 +66,9 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
/* pdrawgfx() needs us to draw sprites front to back, so we have to build a list
while processing sprite ram and then draw them all at the end */
- struct tempsprite *sprite_ptr = state->m_spritelist;
+ struct tempsprite *sprite_ptr = m_spritelist;
- for (offs = (state->m_spriteram.bytes()/4-4);offs >= 0;offs -= 4)
+ for (offs = (m_spriteram.bytes()/4-4);offs >= 0;offs -= 4)
{
data = spriteram32[offs+0];
flipx = (data & 0x00800000) >> 23;
@@ -164,7 +163,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const re
}
else
{
- drawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
+ drawgfxzoom_transpen(bitmap,cliprect,machine().gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
@@ -179,17 +178,17 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks);
}
/* this happens only if primsks != NULL */
- while (sprite_ptr != state->m_spritelist)
+ while (sprite_ptr != m_spritelist)
{
sprite_ptr--;
- pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_ptr->gfx],
+ pdrawgfxzoom_transpen(bitmap,cliprect,machine().gfx[sprite_ptr->gfx],
sprite_ptr->code,
sprite_ptr->color,
sprite_ptr->flipx,sprite_ptr->flipy,
sprite_ptr->x,sprite_ptr->y,
sprite_ptr->zoomx,sprite_ptr->zoomy,
- machine.priority_bitmap,sprite_ptr->primask,0);
+ machine().priority_bitmap,sprite_ptr->primask,0);
}
}
@@ -225,14 +224,14 @@ UINT32 superchs_state::screen_update_superchs(screen_device &screen, bitmap_ind1
if (!machine().input().code_pressed (KEYCODE_C)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
if (!machine().input().code_pressed (KEYCODE_V)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
if (!machine().input().code_pressed (KEYCODE_B)) tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8);
- if (!machine().input().code_pressed (KEYCODE_N)) draw_sprites(machine(), bitmap, cliprect, primasks, 48, -116);
+ if (!machine().input().code_pressed (KEYCODE_N)) draw_sprites(bitmap, cliprect, primasks, 48, -116);
#else
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[1], 0, 1);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[2], 0, 2);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[3], 0, 4);
tc0480scp_tilemap_draw(tc0480scp, bitmap, cliprect, layer[4], 0, 8); /* text layer */
- draw_sprites(machine(), bitmap, cliprect, primasks, 48, -116);
+ draw_sprites(bitmap, cliprect, primasks, 48, -116);
#endif
return 0;
}
diff --git a/src/mame/video/superqix.c b/src/mame/video/superqix.c
index 55761abe659..eac4a11119e 100644
--- a/src/mame/video/superqix.c
+++ b/src/mame/video/superqix.c
@@ -156,13 +156,12 @@ WRITE8_MEMBER(superqix_state::superqix_0410_w)
***************************************************************************/
-static void pbillian_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
+void superqix_state::pbillian_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- superqix_state *state = machine.driver_data<superqix_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs;
- for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
+ for (offs = 0; offs < m_spriteram.bytes(); offs += 4)
{
int attr = spriteram[offs + 3];
int code = ((spriteram[offs] & 0xfc) >> 2) + 64 * (attr & 0x0f);
@@ -170,27 +169,26 @@ static void pbillian_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap
int sx = spriteram[offs + 1] + 256 * (spriteram[offs] & 0x01);
int sy = spriteram[offs + 2];
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
}
- drawgfx_transpen(bitmap,cliprect, machine.gfx[1],
+ drawgfx_transpen(bitmap,cliprect, machine().gfx[1],
code,
color,
- state->flip_screen(), state->flip_screen(),
+ flip_screen(), flip_screen(),
sx, sy, 0);
}
}
-static void superqix_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
+void superqix_state::superqix_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- superqix_state *state = machine.driver_data<superqix_state>();
- UINT8 *spriteram = state->m_spriteram;
+ UINT8 *spriteram = m_spriteram;
int offs;
- for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
+ for (offs = 0; offs < m_spriteram.bytes(); offs += 4)
{
int attr = spriteram[offs + 3];
int code = spriteram[offs] + 256 * (attr & 0x01);
@@ -200,7 +198,7 @@ static void superqix_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap
int sx = spriteram[offs + 1];
int sy = spriteram[offs + 2];
- if (state->flip_screen())
+ if (flip_screen())
{
sx = 240 - sx;
sy = 240 - sy;
@@ -208,7 +206,7 @@ static void superqix_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap
flipy = !flipy;
}
- drawgfx_transpen(bitmap,cliprect, machine.gfx[2],
+ drawgfx_transpen(bitmap,cliprect, machine().gfx[2],
code,
color,
flipx, flipy,
@@ -219,7 +217,7 @@ static void superqix_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap
UINT32 superqix_state::screen_update_pbillian(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(bitmap, cliprect, 0, 0);
- pbillian_draw_sprites(machine(), bitmap,cliprect);
+ pbillian_draw_sprites(bitmap,cliprect);
return 0;
}
@@ -228,7 +226,7 @@ UINT32 superqix_state::screen_update_superqix(screen_device &screen, bitmap_ind1
{
m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
copybitmap_trans(bitmap,*m_fg_bitmap[m_show_bitmap],flip_screen(),flip_screen(),0,0,cliprect,0);
- superqix_draw_sprites(machine(), bitmap,cliprect);
+ superqix_draw_sprites(bitmap,cliprect);
m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
return 0;
}
diff --git a/src/mame/video/suprloco.c b/src/mame/video/suprloco.c
index ecfcce95e99..39f31ca2b9d 100644
--- a/src/mame/video/suprloco.c
+++ b/src/mame/video/suprloco.c
@@ -156,7 +156,7 @@ READ8_MEMBER(suprloco_state::suprloco_control_r)
-INLINE void draw_pixel(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip)
+inline void suprloco_state::draw_pixel(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip)
{
if (flip)
{
@@ -169,10 +169,9 @@ INLINE void draw_pixel(bitmap_ind16 &bitmap,const rectangle &cliprect,int x,int
}
-static void draw_sprite(running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect,int spr_number)
+void suprloco_state::draw_sprite(bitmap_ind16 &bitmap,const rectangle &cliprect,int spr_number)
{
- suprloco_state *state = machine.driver_data<suprloco_state>();
- int flip = state->flip_screen();
+ int flip = flip_screen();
int sx,sy,col,row,height,src,adjy,dy;
UINT8 *spr_reg;
UINT8 *gfx2;
@@ -180,17 +179,17 @@ static void draw_sprite(running_machine &machine, bitmap_ind16 &bitmap,const rec
short skip; /* bytes to skip before drawing each row (can be negative) */
- spr_reg = state->m_spriteram + 0x10 * spr_number;
+ spr_reg = m_spriteram + 0x10 * spr_number;
src = spr_reg[SPR_GFXOFS_LO] + (spr_reg[SPR_GFXOFS_HI] << 8);
skip = spr_reg[SPR_SKIP_LO] + (spr_reg[SPR_SKIP_HI] << 8);
height = spr_reg[SPR_Y_BOTTOM] - spr_reg[SPR_Y_TOP];
- pen_base = 0x100 + 0x10 * (spr_reg[SPR_COL]&0x03) + ((state->m_control & 0x20)?0x100:0);
+ pen_base = 0x100 + 0x10 * (spr_reg[SPR_COL]&0x03) + ((m_control & 0x20)?0x100:0);
sx = spr_reg[SPR_X];
sy = spr_reg[SPR_Y_TOP] + 1;
- if (!state->flip_screen())
+ if (!flip_screen())
{
adjy = sy;
dy = 1;
@@ -201,7 +200,7 @@ static void draw_sprite(running_machine &machine, bitmap_ind16 &bitmap,const rec
dy = -1;
}
- gfx2 = machine.root_device().memregion("gfx2")->base();
+ gfx2 = machine().root_device().memregion("gfx2")->base();
for (row = 0;row < height;row++,adjy+=dy)
{
int color1,color2,flipx;
@@ -244,25 +243,24 @@ static void draw_sprite(running_machine &machine, bitmap_ind16 &bitmap,const rec
}
}
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void suprloco_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- suprloco_state *state = machine.driver_data<suprloco_state>();
int spr_number;
UINT8 *spr_reg;
- for (spr_number = 0;spr_number < (state->m_spriteram.bytes() >> 4);spr_number++)
+ for (spr_number = 0;spr_number < (m_spriteram.bytes() >> 4);spr_number++)
{
- spr_reg = state->m_spriteram + 0x10 * spr_number;
+ spr_reg = m_spriteram + 0x10 * spr_number;
if (spr_reg[SPR_X] != 0xff)
- draw_sprite(machine, bitmap, cliprect, spr_number);
+ draw_sprite(bitmap, cliprect, spr_number);
}
}
UINT32 suprloco_state::screen_update_suprloco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(bitmap, cliprect, 0,0);
- draw_sprites(machine(),bitmap,cliprect);
+ draw_sprites(bitmap,cliprect);
m_bg_tilemap->draw(bitmap, cliprect, 1,0);
return 0;
}
diff --git a/src/mame/video/suprnova.c b/src/mame/video/suprnova.c
index 14b1192eaea..adcf4ba532c 100644
--- a/src/mame/video/suprnova.c
+++ b/src/mame/video/suprnova.c
@@ -6,7 +6,7 @@
/* draws ROZ with linescroll OR columnscroll to 16-bit indexed bitmap */
-static void suprnova_draw_roz(bitmap_ind16 &bitmap, bitmap_ind8& bitmapflags, const rectangle &cliprect, tilemap_t *tmap, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound, int columnscroll, UINT32* scrollram)
+void skns_state::suprnova_draw_roz(bitmap_ind16 &bitmap, bitmap_ind8& bitmapflags, const rectangle &cliprect, tilemap_t *tmap, UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound, int columnscroll, UINT32* scrollram)
{
//bitmap_ind16 *destbitmap = bitmap;
bitmap_ind16 &srcbitmap = tmap->pixmap();
@@ -217,21 +217,20 @@ WRITE32_MEMBER(skns_state::skns_palette_ram_w)
}
-static void palette_set_rgb_brightness (running_machine &machine, int offset, UINT8 brightness_r, UINT8 brightness_g, UINT8 brightness_b)
+void skns_state::palette_set_rgb_brightness (int offset, UINT8 brightness_r, UINT8 brightness_g, UINT8 brightness_b)
{
- skns_state *state = machine.driver_data<skns_state>();
int use_bright, r, g, b/*, alpha*/;
- b = ((state->m_palette_ram[offset] >> 0 ) & 0x1f);
- g = ((state->m_palette_ram[offset] >> 5 ) & 0x1f);
- r = ((state->m_palette_ram[offset] >> 10 ) & 0x1f);
+ b = ((m_palette_ram[offset] >> 0 ) & 0x1f);
+ g = ((m_palette_ram[offset] >> 5 ) & 0x1f);
+ r = ((m_palette_ram[offset] >> 10 ) & 0x1f);
- //alpha = ((state->m_palette_ram[offset] >> 15 ) & 0x1);
+ //alpha = ((m_palette_ram[offset] >> 15 ) & 0x1);
if(offset<(0x40*256)) { // 1st half is for Sprites
- use_bright = state->m_use_spc_bright;
+ use_bright = m_use_spc_bright;
} else { // V3 bg's
- use_bright = state->m_use_v3_bright;
+ use_bright = m_use_v3_bright;
}
if(use_bright) {
@@ -247,25 +246,24 @@ static void palette_set_rgb_brightness (running_machine &machine, int offset, UI
r <<= 3;
}
- palette_set_color(machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(machine(),offset,MAKE_RGB(r,g,b));
}
-static void palette_update(running_machine &machine)
+void skns_state::palette_update()
{
- skns_state *state = machine.driver_data<skns_state>();
int i;
- if (state->m_palette_updated)
+ if (m_palette_updated)
{
- if(state->m_spc_changed)
+ if(m_spc_changed)
for(i=0; i<=((0x40*256)-1); i++)
- palette_set_rgb_brightness (machine, i, state->m_bright_spc_r, state->m_bright_spc_g, state->m_bright_spc_b);
+ palette_set_rgb_brightness (i, m_bright_spc_r, m_bright_spc_g, m_bright_spc_b);
- if(state->m_v3_changed)
+ if(m_v3_changed)
for(i=(0x40*256); i<=((0x80*256)-1); i++)
- palette_set_rgb_brightness (machine, i, state->m_bright_v3_r, state->m_bright_v3_g, state->m_bright_v3_b);
- state->m_palette_updated =0;
+ palette_set_rgb_brightness (i, m_bright_v3_r, m_bright_v3_g, m_bright_v3_b);
+ m_palette_updated =0;
}
}
@@ -380,11 +378,10 @@ void skns_state::video_reset()
m_alt_enable_background = m_alt_enable_sprites = 1;
}
-static void supernova_draw_a( running_machine &machine, bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const rectangle &cliprect, int tran )
+void skns_state::supernova_draw_a( bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const rectangle &cliprect, int tran )
{
- skns_state *state = machine.driver_data<skns_state>();
- int enable_a = (state->m_v3_regs[0x10/4] >> 0) & 0x0001;
- int nowrap_a = (state->m_v3_regs[0x10/4] >> 0) & 0x0004;
+ int enable_a = (m_v3_regs[0x10/4] >> 0) & 0x0001;
+ int nowrap_a = (m_v3_regs[0x10/4] >> 0) & 0x0004;
UINT32 startx,starty;
@@ -393,29 +390,28 @@ static void supernova_draw_a( running_machine &machine, bitmap_ind16 &bitmap, bi
//if(nowrap_a) printf("a\n");
- if (enable_a && state->m_alt_enable_background)
+ if (enable_a && m_alt_enable_background)
{
- startx = state->m_v3_regs[0x1c/4];
- incyy = state->m_v3_regs[0x30/4]&0x7ffff;
+ startx = m_v3_regs[0x1c/4];
+ incyy = m_v3_regs[0x30/4]&0x7ffff;
if (incyy&0x40000) incyy = incyy-0x80000; // level 3 boss in sengekis
- incyx = state->m_v3_regs[0x2c/4];
- starty = state->m_v3_regs[0x20/4];
- incxy = state->m_v3_regs[0x28/4];
- incxx = state->m_v3_regs[0x24/4]&0x7ffff;
+ incyx = m_v3_regs[0x2c/4];
+ starty = m_v3_regs[0x20/4];
+ incxy = m_v3_regs[0x28/4];
+ incxx = m_v3_regs[0x24/4]&0x7ffff;
if (incxx&0x40000) incxx = incxx-0x80000;
- columnscroll = (state->m_v3_regs[0x0c/4] >> 1) & 0x0001;
+ columnscroll = (m_v3_regs[0x0c/4] >> 1) & 0x0001;
- suprnova_draw_roz(bitmap,bitmap_flags,cliprect, state->m_tilemap_A, startx << 8,starty << 8, incxx << 8,incxy << 8,incyx << 8,incyy << 8, !nowrap_a, columnscroll, &state->m_v3slc_ram[0]);
- //tilemap_copy_bitmap(bitmap, state->m_tilemap_bitmap_lower, state->m_tilemap_bitmapflags_lower);
+ suprnova_draw_roz(bitmap,bitmap_flags,cliprect, m_tilemap_A, startx << 8,starty << 8, incxx << 8,incxy << 8,incyx << 8,incyy << 8, !nowrap_a, columnscroll, &m_v3slc_ram[0]);
+ //tilemap_copy_bitmap(bitmap, m_tilemap_bitmap_lower, m_tilemap_bitmapflags_lower);
}
}
-static void supernova_draw_b( running_machine &machine, bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const rectangle &cliprect, int tran )
+void skns_state::supernova_draw_b( bitmap_ind16 &bitmap, bitmap_ind8 &bitmap_flags, const rectangle &cliprect, int tran )
{
- skns_state *state = machine.driver_data<skns_state>();
- int enable_b = (state->m_v3_regs[0x34/4] >> 0) & 0x0001;
- int nowrap_b = (state->m_v3_regs[0x34/4] >> 0) & 0x0004;
+ int enable_b = (m_v3_regs[0x34/4] >> 0) & 0x0001;
+ int nowrap_b = (m_v3_regs[0x34/4] >> 0) & 0x0004;
UINT32 startx,starty;
@@ -424,18 +420,18 @@ static void supernova_draw_b( running_machine &machine, bitmap_ind16 &bitmap, bi
//if(nowrap_b) printf("b\n");
- if (enable_b && state->m_alt_enable_background)
+ if (enable_b && m_alt_enable_background)
{
- startx = state->m_v3_regs[0x40/4];
- incyy = state->m_v3_regs[0x54/4]&0x7ffff;
+ startx = m_v3_regs[0x40/4];
+ incyy = m_v3_regs[0x54/4]&0x7ffff;
if (incyy&0x40000) incyy = incyy-0x80000;
- incyx = state->m_v3_regs[0x50/4];
- starty = state->m_v3_regs[0x44/4];
- incxy = state->m_v3_regs[0x4c/4];
- incxx = state->m_v3_regs[0x48/4]&0x7ffff;
+ incyx = m_v3_regs[0x50/4];
+ starty = m_v3_regs[0x44/4];
+ incxy = m_v3_regs[0x4c/4];
+ incxx = m_v3_regs[0x48/4]&0x7ffff;
if (incxx&0x40000) incxx = incxx-0x80000;
- columnscroll = (state->m_v3_regs[0x0c/4] >> 9) & 0x0001; // selects column scroll or rowscroll
- suprnova_draw_roz(bitmap,bitmap_flags, cliprect, state->m_tilemap_B, startx << 8,starty << 8, incxx << 8,incxy << 8,incyx << 8,incyy << 8, !nowrap_b, columnscroll, &state->m_v3slc_ram[0x1000/4]);
+ columnscroll = (m_v3_regs[0x0c/4] >> 9) & 0x0001; // selects column scroll or rowscroll
+ suprnova_draw_roz(bitmap,bitmap_flags, cliprect, m_tilemap_B, startx << 8,starty << 8, incxx << 8,incxy << 8,incyx << 8,incyy << 8, !nowrap_b, columnscroll, &m_v3slc_ram[0x1000/4]);
//popmessage("%08x %08x %08x %08x %08x %08x", startx, starty, incxx, incyy, incxy, incyx);
@@ -444,7 +440,7 @@ static void supernova_draw_b( running_machine &machine, bitmap_ind16 &bitmap, bi
UINT32 skns_state::screen_update_skns(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- palette_update(machine());
+ palette_update();
bitmap.fill(get_black_pen(machine()), cliprect);
m_tilemap_bitmap_lower.fill(0);
@@ -463,8 +459,8 @@ UINT32 skns_state::screen_update_skns(screen_device &screen, bitmap_rgb32 &bitma
//popmessage("pri %d %d\n", supernova_pri_a, supernova_pri_b);
/*if (!supernova_pri_b) { */
- supernova_draw_b(machine(), m_tilemap_bitmap_lower, m_tilemap_bitmapflags_lower, cliprect,tran);// tran = 1;
- supernova_draw_a(machine(), m_tilemap_bitmap_higher,m_tilemap_bitmapflags_higher,cliprect,tran);// tran = 1;
+ supernova_draw_b(m_tilemap_bitmap_lower, m_tilemap_bitmapflags_lower, cliprect,tran);// tran = 1;
+ supernova_draw_a(m_tilemap_bitmap_higher,m_tilemap_bitmapflags_higher,cliprect,tran);// tran = 1;
{
int x,y;
diff --git a/src/mame/video/suprridr.c b/src/mame/video/suprridr.c
index c2dea185f21..031488ee46e 100644
--- a/src/mame/video/suprridr.c
+++ b/src/mame/video/suprridr.c
@@ -121,10 +121,9 @@ WRITE8_MEMBER(suprridr_state::suprridr_bgscrolly_w)
}
-int suprridr_is_screen_flipped(running_machine &machine)
+int suprridr_state::suprridr_is_screen_flipped()
{
- suprridr_state *state = machine.driver_data<suprridr_state>();
- return state->m_flipx; /* or is it flipy? */
+ return m_flipx; /* or is it flipy? */
}
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c
index 26567ca0beb..1281386faa5 100644
--- a/src/mame/video/system1.c
+++ b/src/mame/video/system1.c
@@ -114,49 +114,48 @@ TILE_GET_INFO_MEMBER(system1_state::tile_get_info)
*
*************************************/
-static void video_start_common(running_machine &machine, int pagecount)
+void system1_state::video_start_common(int pagecount)
{
- system1_state *state = machine.driver_data<system1_state>();
int pagenum;
/* allocate memory for the collision arrays */
- state->m_mix_collide = auto_alloc_array_clear(machine, UINT8, 64);
- state->m_sprite_collide = auto_alloc_array_clear(machine, UINT8, 1024);
+ m_mix_collide = auto_alloc_array_clear(machine(), UINT8, 64);
+ m_sprite_collide = auto_alloc_array_clear(machine(), UINT8, 1024);
/* allocate memory for videoram */
- state->m_tilemap_pages = pagecount;
- state->m_videoram = auto_alloc_array_clear(machine, UINT8, 0x800 * pagecount);
+ m_tilemap_pages = pagecount;
+ m_videoram = auto_alloc_array_clear(machine(), UINT8, 0x800 * pagecount);
/* create the tilemap pages */
for (pagenum = 0; pagenum < pagecount; pagenum++)
{
- state->m_tilemap_page[pagenum] = &machine.tilemap().create(tilemap_get_info_delegate(FUNC(system1_state::tile_get_info),state), TILEMAP_SCAN_ROWS, 8,8, 32,32);
- state->m_tilemap_page[pagenum]->set_transparent_pen(0);
- state->m_tilemap_page[pagenum]->set_user_data(state->m_videoram + 0x800 * pagenum);
+ m_tilemap_page[pagenum] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(system1_state::tile_get_info),this), TILEMAP_SCAN_ROWS, 8,8, 32,32);
+ m_tilemap_page[pagenum]->set_transparent_pen(0);
+ m_tilemap_page[pagenum]->set_user_data(m_videoram + 0x800 * pagenum);
}
/* allocate a temporary bitmap for sprite rendering */
- state->m_sprite_bitmap = auto_bitmap_ind16_alloc(machine, 512, 256);
+ m_sprite_bitmap = auto_bitmap_ind16_alloc(machine(), 512, 256);
/* register for save stats */
- state_save_register_global(machine, state->m_video_mode);
- state_save_register_global(machine, state->m_mix_collide_summary);
- state_save_register_global(machine, state->m_sprite_collide_summary);
- state->save_pointer(NAME(state->m_videoram), 0x800 * pagecount);
- state_save_register_global_pointer(machine, state->m_mix_collide, 64);
- state_save_register_global_pointer(machine, state->m_sprite_collide, 1024);
+ state_save_register_global(machine(), m_video_mode);
+ state_save_register_global(machine(), m_mix_collide_summary);
+ state_save_register_global(machine(), m_sprite_collide_summary);
+ save_pointer(NAME(m_videoram), 0x800 * pagecount);
+ state_save_register_global_pointer(machine(), m_mix_collide, 64);
+ state_save_register_global_pointer(machine(), m_sprite_collide, 1024);
}
void system1_state::video_start()
{
- video_start_common(machine(), 2);
+ video_start_common(2);
}
VIDEO_START_MEMBER(system1_state,system2)
{
- video_start_common(machine(), 8);
+ video_start_common(8);
}
@@ -238,7 +237,7 @@ WRITE8_MEMBER(system1_state::system1_sprite_collision_reset_w)
*
*************************************/
-INLINE void videoram_wait_states(cpu_device *cpu)
+inline void system1_state::videoram_wait_states(cpu_device *cpu)
{
/* The main Z80's CPU clock is halted whenever an access to VRAM happens,
and is only restarted by the FIXST signal, which occurs once every
@@ -359,13 +358,12 @@ WRITE8_MEMBER(system1_state::system1_paletteram_w)
*
*************************************/
-static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset)
+void system1_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffset)
{
- system1_state *state = machine.driver_data<system1_state>();
- UINT32 gfxbanks = state->memregion("sprites")->bytes() / 0x8000;
- const UINT8 *gfxbase = state->memregion("sprites")->base();
- UINT8 *spriteram = state->m_spriteram;
- int flipscreen = state->flip_screen();
+ UINT32 gfxbanks = memregion("sprites")->bytes() / 0x8000;
+ const UINT8 *gfxbase = memregion("sprites")->base();
+ UINT8 *spriteram = m_spriteram;
+ int flipscreen = flip_screen();
int spritenum;
/* up to 32 sprites total */
@@ -450,7 +448,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
int prevpix = destbase[effx];
if ((prevpix & 0x0f) != 0)
- state->m_sprite_collide[((prevpix >> 4) & 0x1f) + 32 * spritenum] = state->m_sprite_collide_summary = 1;
+ m_sprite_collide[((prevpix >> 4) & 0x1f) + 32 * spritenum] = m_sprite_collide_summary = 1;
destbase[effx] = color1 | palettebase;
}
}
@@ -471,7 +469,7 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
int prevpix = destbase[effx];
if ((prevpix & 0x0f) != 0)
- state->m_sprite_collide[((prevpix >> 4) & 0x1f) + 32 * spritenum] = state->m_sprite_collide_summary = 1;
+ m_sprite_collide[((prevpix >> 4) & 0x1f) + 32 * spritenum] = m_sprite_collide_summary = 1;
destbase[effx] = color2 | palettebase;
}
}
@@ -489,21 +487,20 @@ static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const r
*
*************************************/
-static void video_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &fgpixmap, bitmap_ind16 **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs)
+void system1_state::video_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind16 &fgpixmap, bitmap_ind16 **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs)
{
- system1_state *state = screen.machine().driver_data<system1_state>();
- const UINT8 *lookup = state->memregion("proms")->base();
+ const UINT8 *lookup = memregion("proms")->base();
int x, y;
/* first clear the sprite bitmap and draw sprites within this area */
- state->m_sprite_bitmap->fill(0, cliprect);
- draw_sprites(screen.machine(), *state->m_sprite_bitmap, cliprect, spritexoffs);
+ m_sprite_bitmap->fill(0, cliprect);
+ draw_sprites(*m_sprite_bitmap, cliprect, spritexoffs);
/* iterate over rows */
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
{
UINT16 *fgbase = &fgpixmap.pix16(y & 0xff);
- UINT16 *sprbase = &state->m_sprite_bitmap->pix16(y & 0xff);
+ UINT16 *sprbase = &m_sprite_bitmap->pix16(y & 0xff);
UINT16 *dstbase = &bitmap.pix16(y);
int bgy = (y + bgyscroll) & 0x1ff;
int bgxscroll = bgrowscroll[y >> 3 & 0x1f];
@@ -533,11 +530,11 @@ static void video_update_common(screen_device &screen, bitmap_ind16 &bitmap, con
/* compute collisions based on two of the PROM bits */
if (!(lookup_value & 4))
- state->m_mix_collide[((lookup_value & 8) << 2) | ((sprpix >> 4) & 0x1f)] = state->m_mix_collide_summary = 1;
+ m_mix_collide[((lookup_value & 8) << 2) | ((sprpix >> 4) & 0x1f)] = m_mix_collide_summary = 1;
/* the lower 2 PROM bits select the palette and which pixels */
lookup_value &= 3;
- if (state->m_video_mode & 0x10)
+ if (m_video_mode & 0x10)
dstbase[x] = 0;
else if (lookup_value == 0)
dstbase[x] = 0x000 | (sprpix & 0x1ff);
diff --git a/src/mame/video/system16.c b/src/mame/video/system16.c
index 15c9ced69b8..540af436896 100644
--- a/src/mame/video/system16.c
+++ b/src/mame/video/system16.c
@@ -30,23 +30,22 @@
#include "video/segaic16.h"
-static void setup_system16_bootleg_spritebanking( running_machine& machine )
+void segas1x_bootleg_state::setup_system16_bootleg_spritebanking( )
{
- segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
- if (state->m_spritebank_type == 1)
+ if (m_spritebank_type == 1)
{
static const UINT8 default_banklist[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
int i;
for (i = 0; i < 16; i++)
- state->m_sprites->set_bank(i, default_banklist[i]);
+ m_sprites->set_bank(i, default_banklist[i]);
}
else
{
static const UINT8 alternate_banklist[] = { 0,255,255,255, 255,255,255,3, 255,255,255,2, 255,1,0,255 };
int i;
for (i = 0; i < 16; i++)
- state->m_sprites->set_bank(i, alternate_banklist[i]);
+ m_sprites->set_bank(i, alternate_banklist[i]);
}
@@ -159,75 +158,74 @@ WRITE16_MEMBER(segas1x_bootleg_state::sys16_paletteram_w)
}
#endif
-static void update_page( running_machine &machine )
+void segas1x_bootleg_state::update_page( )
{
- segas1x_bootleg_state *state = machine.driver_data<segas1x_bootleg_state>();
int all_dirty = 0;
int i, offset;
- if (state->m_old_tile_bank1 != state->m_tile_bank1)
+ if (m_old_tile_bank1 != m_tile_bank1)
{
all_dirty = 1;
- state->m_old_tile_bank1 = state->m_tile_bank1;
+ m_old_tile_bank1 = m_tile_bank1;
}
- if (state->m_old_tile_bank0 != state->m_tile_bank0)
+ if (m_old_tile_bank0 != m_tile_bank0)
{
all_dirty = 1;
- state->m_old_tile_bank0 = state->m_tile_bank0;
- state->m_text_layer->mark_all_dirty();
+ m_old_tile_bank0 = m_tile_bank0;
+ m_text_layer->mark_all_dirty();
}
if (all_dirty)
{
- state->m_background->mark_all_dirty();
- state->m_foreground->mark_all_dirty();
+ m_background->mark_all_dirty();
+ m_foreground->mark_all_dirty();
- if (state->m_system18)
+ if (m_system18)
{
- state->m_background2->mark_all_dirty();
- state->m_foreground2->mark_all_dirty();
+ m_background2->mark_all_dirty();
+ m_foreground2->mark_all_dirty();
}
}
else {
for (i = 0; i < 4; i++)
{
int page0 = 64 * 32 * i;
- if (state->m_old_bg_page[i] != state->m_bg_page[i])
+ if (m_old_bg_page[i] != m_bg_page[i])
{
- state->m_old_bg_page[i] = state->m_bg_page[i];
+ m_old_bg_page[i] = m_bg_page[i];
for (offset = page0; offset < page0 + 64 * 32; offset++)
{
- state->m_background->mark_tile_dirty(offset);
+ m_background->mark_tile_dirty(offset);
}
}
- if (state->m_old_fg_page[i] != state->m_fg_page[i])
+ if (m_old_fg_page[i] != m_fg_page[i])
{
- state->m_old_fg_page[i] = state->m_fg_page[i];
+ m_old_fg_page[i] = m_fg_page[i];
for (offset = page0; offset < page0 + 64 * 32; offset++)
{
- state->m_foreground->mark_tile_dirty(offset);
+ m_foreground->mark_tile_dirty(offset);
}
}
- if (state->m_system18)
+ if (m_system18)
{
- if (state->m_old_bg2_page[i] != state->m_bg2_page[i])
+ if (m_old_bg2_page[i] != m_bg2_page[i])
{
- state->m_old_bg2_page[i] = state->m_bg2_page[i];
+ m_old_bg2_page[i] = m_bg2_page[i];
for (offset = page0; offset < page0 + 64 * 32; offset++)
{
- state->m_background2->mark_tile_dirty(offset);
+ m_background2->mark_tile_dirty(offset);
}
}
- if (state->m_old_fg2_page[i] != state->m_fg2_page[i])
+ if (m_old_fg2_page[i] != m_fg2_page[i])
{
- state->m_old_fg2_page[i] = state->m_fg2_page[i];
+ m_old_fg2_page[i] = m_fg2_page[i];
for (offset = page0; offset < page0 + 64 * 32; offset++)
{
- state->m_foreground2->mark_tile_dirty(offset);
+ m_foreground2->mark_tile_dirty(offset);
}
}
}
@@ -423,7 +421,7 @@ VIDEO_START_MEMBER(segas1x_bootleg_state,system16)
m_system18 = 0;
}
- setup_system16_bootleg_spritebanking(machine());
+ setup_system16_bootleg_spritebanking();
}
VIDEO_START_MEMBER(segas1x_bootleg_state,system18old)
@@ -583,19 +581,19 @@ VIDEO_START_MEMBER(segas1x_bootleg_state,s16a_bootleg)
VIDEO_START_MEMBER(segas1x_bootleg_state,s16a_bootleg_wb3bl)
{
VIDEO_START_CALL_MEMBER(s16a_bootleg);
- setup_system16_bootleg_spritebanking(machine());
+ setup_system16_bootleg_spritebanking();
}
VIDEO_START_MEMBER(segas1x_bootleg_state,s16a_bootleg_shinobi)
{
VIDEO_START_CALL_MEMBER(s16a_bootleg);
- setup_system16_bootleg_spritebanking(machine());
+ setup_system16_bootleg_spritebanking();
}
VIDEO_START_MEMBER(segas1x_bootleg_state,s16a_bootleg_passsht)
{
VIDEO_START_CALL_MEMBER(s16a_bootleg);
- setup_system16_bootleg_spritebanking(machine());
+ setup_system16_bootleg_spritebanking();
}
// Passing Shot (2 player), Shinobi (Datsu), Wonderboy 3
@@ -769,7 +767,7 @@ UINT32 segas1x_bootleg_state::screen_update_system16(screen_device &screen, bitm
// start the sprites drawing
m_sprites->draw_async(cliprect);
- update_page(machine());
+ update_page();
machine().priority_bitmap.fill(0, cliprect);
@@ -845,7 +843,7 @@ UINT32 segas1x_bootleg_state::screen_update_system18old(screen_device &screen, b
// start the sprites drawing
m_sprites->draw_async(cliprect);
- update_page(machine());
+ update_page();
machine().priority_bitmap.fill(0);