diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c index b6f1beb222e..24e71e8c71b 100644 --- a/src/mame/drivers/galpani3.c +++ b/src/mame/drivers/galpani3.c @@ -351,7 +351,7 @@ UINT32 galpani3_state::screen_update_galpani3(screen_device &screen, bitmap_rgb3 m_sprite_bitmap_1.fill(0x0000, cliprect); - m_spritegen->skns_draw_sprites(machine(), m_sprite_bitmap_1, cliprect, &m_spriteram32[0], 0x4000, memregion("gfx1")->base(), memregion ("gfx1")->bytes(), m_spc_regs ); + m_spritegen->skns_draw_sprites(m_sprite_bitmap_1, cliprect, &m_spriteram32[0], 0x4000, memregion("gfx1")->base(), memregion ("gfx1")->bytes(), m_spc_regs ); // ignoring priority bits for now.. for (y=0;y<240;y++) diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c index 878fd21c3f8..284a28db841 100644 --- a/src/mame/drivers/jchan.c +++ b/src/mame/drivers/jchan.c @@ -319,8 +319,8 @@ UINT32 jchan_state::screen_update_jchan(screen_device &screen, bitmap_ind16 &bit m_sprite_bitmap_1->fill(0x0000, cliprect); m_sprite_bitmap_2->fill(0x0000, cliprect); - m_spritegen1->skns_draw_sprites(machine(), *m_sprite_bitmap_1, cliprect, m_sprite_ram32_1, 0x4000, memregion("gfx1")->base(), memregion ("gfx1")->bytes(), m_sprite_regs32_1 ); - m_spritegen2->skns_draw_sprites(machine(), *m_sprite_bitmap_2, cliprect, m_sprite_ram32_2, 0x4000, memregion("gfx2")->base(), memregion ("gfx2")->bytes(), m_sprite_regs32_2 ); + m_spritegen1->skns_draw_sprites(*m_sprite_bitmap_1, cliprect, m_sprite_ram32_1, 0x4000, memregion("gfx1")->base(), memregion ("gfx1")->bytes(), m_sprite_regs32_1 ); + m_spritegen2->skns_draw_sprites(*m_sprite_bitmap_2, cliprect, m_sprite_ram32_2, 0x4000, memregion("gfx2")->base(), memregion ("gfx2")->bytes(), m_sprite_regs32_2 ); // ignoring priority bits for now - might use alpha too, check 0x8000 of palette writes for (y=0;y<240;y++) diff --git a/src/mame/drivers/jclub2.c b/src/mame/drivers/jclub2.c index fd198847bc2..1aa4571b600 100644 --- a/src/mame/drivers/jclub2.c +++ b/src/mame/drivers/jclub2.c @@ -136,7 +136,7 @@ public: DECLARE_WRITE32_MEMBER(darkhors_tmapram2_w); DECLARE_WRITE32_MEMBER(darkhors_input_sel_w); DECLARE_READ32_MEMBER(darkhors_input_sel_r); -DECLARE_READ32_MEMBER(p_4e0000); + DECLARE_READ32_MEMBER(p_4e0000); DECLARE_READ32_MEMBER(p_580000); DECLARE_READ32_MEMBER(p_580004); DECLARE_READ32_MEMBER(p_580008); @@ -996,7 +996,7 @@ VIDEO_START_MEMBER(darkhors_state,jclub2) UINT32 darkhors_state::screen_update_jclub2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { // this isn't an st0020.. - m_gdfs_st0020->st0020_draw_all(machine(), bitmap, cliprect); + m_gdfs_st0020->st0020_draw_all(bitmap, cliprect); return 0; } @@ -1066,7 +1066,7 @@ VIDEO_START_MEMBER(darkhors_state,jclub2o) UINT32 darkhors_state::screen_update_jclub2o(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - m_gdfs_st0020->st0020_draw_all(machine(), bitmap, cliprect); + m_gdfs_st0020->st0020_draw_all(bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/tatsumi.c b/src/mame/drivers/tatsumi.c index 97720ca7d79..ce949dafd61 100644 --- a/src/mame/drivers/tatsumi.c +++ b/src/mame/drivers/tatsumi.c @@ -1360,7 +1360,7 @@ DRIVER_INIT_MEMBER(tatsumi_state,apache3) m_rom_clut0 = memregion("gfx2")->base()+ 0x100000 - 0x800; m_rom_clut1 = memregion("gfx3")->base()+ 0x100000 - 0x800; - tatsumi_reset(machine()); + tatsumi_reset(); // TODO: ym2151_set_port_write_handler for CT1/CT2 outputs } @@ -1387,7 +1387,7 @@ DRIVER_INIT_MEMBER(tatsumi_state,roundup5) m_rom_clut0 = memregion("gfx2")->base()+ 0xc0000 - 0x800; m_rom_clut1 = memregion("gfx3")->base()+ 0xc0000 - 0x800; - tatsumi_reset(machine()); + tatsumi_reset(); } DRIVER_INIT_MEMBER(tatsumi_state,cyclwarr) @@ -1422,7 +1422,7 @@ DRIVER_INIT_MEMBER(tatsumi_state,cyclwarr) m_rom_clut0 = memregion("gfx2")->base() + len1 - 0x1000; m_rom_clut1 = memregion("gfx3")->base() + len2 - 0x1000; - tatsumi_reset(machine()); + tatsumi_reset(); } /***************************************************************************/ diff --git a/src/mame/includes/asterix.h b/src/mame/includes/asterix.h index 2ac7913ec1f..6c84f50ce0a 100644 --- a/src/mame/includes/asterix.h +++ b/src/mame/includes/asterix.h @@ -58,6 +58,7 @@ public: INTERRUPT_GEN_MEMBER(asterix_interrupt); K05324X_CB_MEMBER(sprite_callback); K056832_CB_MEMBER(tile_callback); + void reset_spritebank(); protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h index 27baaddcef6..c60b16337b0 100644 --- a/src/mame/includes/cps1.h +++ b/src/mame/includes/cps1.h @@ -337,6 +337,7 @@ public: /* cps video */ + inline UINT16 *cps1_base( int offset, int boundary ); void cps1_get_video_base(); void unshuffle(UINT64 *buf, int len); void cps2_gfx_decode(); diff --git a/src/mame/includes/konamigx.h b/src/mame/includes/konamigx.h index 46e6e0e4c9f..f4a2e6223ee 100644 --- a/src/mame/includes/konamigx.h +++ b/src/mame/includes/konamigx.h @@ -155,6 +155,8 @@ public: void konamigx_esc_alert(UINT32 *srcbase, int srcoffs, int count, int mode); void konamigx_precache_registers(void); + + void wipezbuf(int noshadow); void dmastart_callback(int data); diff --git a/src/mame/includes/snk.h b/src/mame/includes/snk.h index e0e38ca2327..0f7f25159ad 100644 --- a/src/mame/includes/snk.h +++ b/src/mame/includes/snk.h @@ -9,16 +9,28 @@ class snk_state : public driver_device public: snk_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_fg_videoram(*this, "fg_videoram"), - m_bg_videoram(*this, "bg_videoram"), - m_tx_videoram(*this, "tx_videoram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_subcpu(*this, "sub"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette"), + m_spriteram(*this, "spriteram"), + m_fg_videoram(*this, "fg_videoram"), + m_bg_videoram(*this, "bg_videoram"), + m_tx_videoram(*this, "tx_videoram") { } + + required_device m_maincpu; + required_device m_audiocpu; + required_device m_subcpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + required_shared_ptr m_spriteram; + optional_shared_ptr m_fg_videoram; + required_shared_ptr m_bg_videoram; + required_shared_ptr m_tx_videoram; int m_countryc_trackball; int m_last_value[2]; @@ -27,12 +39,7 @@ public: int m_marvins_sound_busy_flag; // FIXME this should be initialised on machine reset int m_sound_status; - - required_shared_ptr m_spriteram; - optional_shared_ptr m_fg_videoram; - required_shared_ptr m_bg_videoram; - required_shared_ptr m_tx_videoram; - + tilemap_t *m_tx_tilemap; tilemap_t *m_fg_tilemap; tilemap_t *m_bg_tilemap; @@ -174,20 +181,17 @@ public: UINT32 screen_update_tnk3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - UINT32 screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + UINT32 screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(sgladiat_sndirq_update_callback); TIMER_CALLBACK_MEMBER(sndirq_update_callback); DECLARE_WRITE_LINE_MEMBER(ymirq_callback_2); + void marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to); void tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll); + void ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum ); + void tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to); int hardflags_check(int num); int hardflags_check8(int num); int turbofront_check(int small, int num); int turbofront_check8(int small, int num); DECLARE_WRITE_LINE_MEMBER(ymirq_callback_1); - required_device m_maincpu; - required_device m_audiocpu; - required_device m_subcpu; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; }; diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h index 2d70683c1e2..839efb1b839 100644 --- a/src/mame/includes/tatsumi.h +++ b/src/mame/includes/tatsumi.h @@ -6,6 +6,13 @@ class tatsumi_state : public driver_device public: tatsumi_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_subcpu(*this, "sub"), + m_subcpu2(*this, "sub2"), + m_oki(*this, "oki"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), m_videoram(*this, "videoram"), m_cyclwarr_cpua_ram(*this, "cw_cpua_ram"), m_cyclwarr_cpub_ram(*this, "cw_cpub_ram"), @@ -23,26 +30,20 @@ public: m_roundup_r_ram(*this, "roundup_r_ram"), m_roundup_p_ram(*this, "roundup_p_ram"), m_roundup_l_ram(*this, "roundup_l_ram"), - m_spriteram(*this, "spriteram") , - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_subcpu(*this, "sub"), - m_subcpu2(*this, "sub2"), - m_oki(*this, "oki"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_spriteram(*this, "spriteram") { } + required_device m_maincpu; + required_device m_audiocpu; + required_device m_subcpu; + optional_device m_subcpu2; + required_device m_oki; + required_device m_gfxdecode; + required_device m_palette; + optional_shared_ptr m_videoram; optional_shared_ptr m_cyclwarr_cpua_ram; optional_shared_ptr m_cyclwarr_cpub_ram; - UINT16 m_bigfight_a20000[8]; - UINT16 m_bigfight_a60000[2]; optional_shared_ptr m_apache3_g_ram; - UINT16 m_bigfight_a40000[2]; - UINT8 *m_rom_sprite_lookup1; - UINT8 *m_rom_sprite_lookup2; - UINT8 *m_rom_clut0; - UINT8 *m_rom_clut1; optional_shared_ptr m_roundup5_d0000_ram; optional_shared_ptr m_roundup5_e0000_ram; optional_shared_ptr m_roundup5_unknown0; @@ -50,14 +51,23 @@ public: optional_shared_ptr m_roundup5_unknown2; optional_shared_ptr m_68k_ram; optional_shared_ptr m_apache3_z80_ram; - UINT16 m_control_word; - UINT16 m_apache3_rotate_ctrl[12]; required_shared_ptr m_sprite_control_ram; optional_shared_ptr m_cyclwarr_videoram0; optional_shared_ptr m_cyclwarr_videoram1; optional_shared_ptr m_roundup_r_ram; optional_shared_ptr m_roundup_p_ram; optional_shared_ptr m_roundup_l_ram; + required_shared_ptr m_spriteram; + + UINT16 m_bigfight_a20000[8]; + UINT16 m_bigfight_a60000[2]; + UINT16 m_bigfight_a40000[2]; + UINT8 *m_rom_sprite_lookup1; + UINT8 *m_rom_sprite_lookup2; + UINT8 *m_rom_clut0; + UINT8 *m_rom_clut1; + UINT16 m_control_word; + UINT16 m_apache3_rotate_ctrl[12]; UINT16 m_last_control; UINT8 m_apache3_adc; int m_apache3_rot_idx; @@ -75,7 +85,6 @@ public: UINT8 m_roundupt_crt_selected_reg; UINT8 m_roundupt_crt_reg[64]; UINT8* m_shadow_pen_array; - required_shared_ptr m_spriteram; DECLARE_READ16_MEMBER(cyclwarr_sprite_r); DECLARE_WRITE16_MEMBER(cyclwarr_sprite_w); DECLARE_WRITE16_MEMBER(bigfight_a20000_w); @@ -131,14 +140,5 @@ public: DECLARE_READ8_MEMBER(tatsumi_hack_ym2151_r); DECLARE_READ8_MEMBER(tatsumi_hack_oki_r); DECLARE_WRITE_LINE_MEMBER(apache3_68000_reset); - required_device m_maincpu; - required_device m_audiocpu; - required_device m_subcpu; - optional_device m_subcpu2; - required_device m_oki; - required_device m_gfxdecode; - required_device m_palette; + void tatsumi_reset(); }; - -/*----------- defined in machine/tatsumi.c -----------*/ -void tatsumi_reset(running_machine &machine); diff --git a/src/mame/machine/tatsumi.c b/src/mame/machine/tatsumi.c index 44972ec71bd..4c51c62da0b 100644 --- a/src/mame/machine/tatsumi.c +++ b/src/mame/machine/tatsumi.c @@ -6,17 +6,16 @@ /******************************************************************************/ -void tatsumi_reset(running_machine &machine) +void tatsumi_state::tatsumi_reset() { - tatsumi_state *state = machine.driver_data(); - state->m_last_control = 0; - state->m_control_word = 0; - state->m_apache3_adc = 0; - state->m_apache3_rot_idx = 0; + m_last_control = 0; + m_control_word = 0; + m_apache3_adc = 0; + m_apache3_rot_idx = 0; - state->save_item(NAME(state->m_last_control)); - state->save_item(NAME(state->m_control_word)); - state->save_item(NAME(state->m_apache3_adc)); + save_item(NAME(m_last_control)); + save_item(NAME(m_control_word)); + save_item(NAME(m_apache3_adc)); } /******************************************************************************/ diff --git a/src/mame/video/aerofgt.c b/src/mame/video/aerofgt.c index ff6c2b714a2..ae95bc61fbe 100644 --- a/src/mame/video/aerofgt.c +++ b/src/mame/video/aerofgt.c @@ -296,8 +296,8 @@ UINT32 aerofgt_state::screen_update_pspikes(screen_device &screen, bitmap_ind16 screen.priority().fill(0, cliprect); m_bg1_tilemap->draw(screen, bitmap, cliprect, 0, 0); - m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); - m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); + m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); + m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); return 0; } @@ -315,11 +315,11 @@ UINT32 aerofgt_state::screen_update_karatblz(screen_device &screen, bitmap_ind16 m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0); /* we use the priority buffer so sprites are drawn front to back */ - m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); - m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); + m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); + m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); - m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); - m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); + m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); + m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); return 0; } @@ -341,11 +341,11 @@ UINT32 aerofgt_state::screen_update_spinlbrk(screen_device &screen, bitmap_ind16 m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 1); /* we use the priority buffer so sprites are drawn front to back */ - m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); - m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); + m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); + m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); - m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); - m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); + m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); + m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); return 0; } @@ -368,11 +368,11 @@ UINT32 aerofgt_state::screen_update_turbofrc(screen_device &screen, bitmap_ind16 m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 1); /* we use the priority buffer so sprites are drawn front to back */ - m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); //enemy - m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); //enemy + m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); //enemy + m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); //enemy - m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); //ship - m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); //intro + m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); //ship + m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); //intro return 0; } @@ -834,7 +834,7 @@ UINT32 aerofgt_state::screen_update_wbbc97(screen_device &screen, bitmap_rgb32 & m_bg1_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); } - m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); - m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 1); + m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); + m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); return 0; } diff --git a/src/mame/video/asterix.c b/src/mame/video/asterix.c index d1b7ce85d3f..810dd10b771 100644 --- a/src/mame/video/asterix.c +++ b/src/mame/video/asterix.c @@ -2,20 +2,19 @@ #include "includes/asterix.h" -static void reset_spritebank( running_machine &machine ) +void asterix_state::reset_spritebank() { - asterix_state *state = machine.driver_data(); - state->m_k053244->bankselect(state->m_spritebank & 7); - state->m_spritebanks[0] = (state->m_spritebank << 12) & 0x7000; - state->m_spritebanks[1] = (state->m_spritebank << 9) & 0x7000; - state->m_spritebanks[2] = (state->m_spritebank << 6) & 0x7000; - state->m_spritebanks[3] = (state->m_spritebank << 3) & 0x7000; + m_k053244->bankselect(m_spritebank & 7); + m_spritebanks[0] = (m_spritebank << 12) & 0x7000; + m_spritebanks[1] = (m_spritebank << 9) & 0x7000; + m_spritebanks[2] = (m_spritebank << 6) & 0x7000; + m_spritebanks[3] = (m_spritebank << 3) & 0x7000; } WRITE16_MEMBER(asterix_state::asterix_spritebank_w) { COMBINE_DATA(&m_spritebank); - reset_spritebank(machine()); + reset_spritebank(); } K05324X_CB_MEMBER(asterix_state::sprite_callback) diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index be8f485a7de..eb8dd0b928f 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -1684,10 +1684,9 @@ MACHINE_RESET_MEMBER(cps_state,cps) } -INLINE UINT16 *cps1_base( running_machine &machine, int offset, int boundary ) +inline UINT16 *cps_state::cps1_base( int offset, int boundary ) { - cps_state *state = machine.driver_data(); - int base = state->m_cps_a_regs[offset] * 256; + int base = m_cps_a_regs[offset] * 256; /* The scroll RAM must start on a 0x4000 boundary. @@ -1698,7 +1697,7 @@ INLINE UINT16 *cps1_base( running_machine &machine, int offset, int boundary ) Mask out the irrelevant bits. */ base &= ~(boundary - 1); - return &state->m_gfxram[(base & 0x3ffff) / 2]; + return &m_gfxram[(base & 0x3ffff) / 2]; } @@ -1716,7 +1715,7 @@ WRITE16_MEMBER(cps_state::cps1_cps_a_w) fixes glitches in the ghouls intro, but it might happen at next vblank. */ if (offset == CPS1_PALETTE_BASE) - cps1_build_palette(cps1_base(machine(), CPS1_PALETTE_BASE, m_palette_align)); + cps1_build_palette(cps1_base(CPS1_PALETTE_BASE, m_palette_align)); // pzloop2 write to register 24 on startup. This is probably just a bug. if (offset == 0x24 / 2 && m_cps_version == 2) @@ -1902,19 +1901,19 @@ void cps_state::cps1_get_video_base() int layercontrol=0, videocontrol=0, scroll1xoff=0, scroll2xoff=0, scroll3xoff=0; /* Re-calculate the VIDEO RAM base */ - if (m_scroll1 != cps1_base(machine(), CPS1_SCROLL1_BASE, m_scroll_size)) + if (m_scroll1 != cps1_base(CPS1_SCROLL1_BASE, m_scroll_size)) { - m_scroll1 = cps1_base(machine(), CPS1_SCROLL1_BASE, m_scroll_size); + m_scroll1 = cps1_base(CPS1_SCROLL1_BASE, m_scroll_size); m_bg_tilemap[0]->mark_all_dirty(); } - if (m_scroll2 != cps1_base(machine(), CPS1_SCROLL2_BASE, m_scroll_size)) + if (m_scroll2 != cps1_base(CPS1_SCROLL2_BASE, m_scroll_size)) { - m_scroll2 = cps1_base(machine(), CPS1_SCROLL2_BASE, m_scroll_size); + m_scroll2 = cps1_base(CPS1_SCROLL2_BASE, m_scroll_size); m_bg_tilemap[1]->mark_all_dirty(); } - if (m_scroll3 != cps1_base(machine(), CPS1_SCROLL3_BASE, m_scroll_size)) + if (m_scroll3 != cps1_base(CPS1_SCROLL3_BASE, m_scroll_size)) { - m_scroll3 = cps1_base(machine(), CPS1_SCROLL3_BASE, m_scroll_size); + m_scroll3 = cps1_base(CPS1_SCROLL3_BASE, m_scroll_size); m_bg_tilemap[2]->mark_all_dirty(); } @@ -1942,8 +1941,8 @@ void cps_state::cps1_get_video_base() scroll3xoff = -0x0c; } - m_obj = cps1_base(machine(), CPS1_OBJ_BASE, m_obj_size); - m_other = cps1_base(machine(), CPS1_OTHER_BASE, m_other_size); + m_obj = cps1_base(CPS1_OBJ_BASE, m_obj_size); + m_other = cps1_base(CPS1_OTHER_BASE, m_other_size); /* Get scroll values */ m_scroll1x = m_cps_a_regs[CPS1_SCROLL1_SCROLLX] + scroll1xoff; diff --git a/src/mame/video/f1gp.c b/src/mame/video/f1gp.c index 5320805e0e4..0ca9a996317 100644 --- a/src/mame/video/f1gp.c +++ b/src/mame/video/f1gp.c @@ -195,13 +195,13 @@ UINT32 f1gp_state::screen_update_f1gp(screen_device &screen, bitmap_ind16 &bitma /* quick kludge for "continue" screen priority */ if (m_gfxctrl == 0x00) { - m_spr_old->turbofrc_draw_sprites(m_spr1vram, m_spr1vram.bytes(), 0, machine(), bitmap, cliprect, screen.priority(), 0x02); - m_spr_old2->turbofrc_draw_sprites(m_spr2vram, m_spr2vram.bytes(), 0, machine(), bitmap, cliprect, screen.priority(), 0x02); + m_spr_old->turbofrc_draw_sprites(m_spr1vram, m_spr1vram.bytes(), 0, bitmap, cliprect, screen.priority(), 0x02); + m_spr_old2->turbofrc_draw_sprites(m_spr2vram, m_spr2vram.bytes(), 0, bitmap, cliprect, screen.priority(), 0x02); } else { - m_spr_old->turbofrc_draw_sprites(m_spr1vram, m_spr1vram.bytes(), 0, machine(), bitmap, cliprect, screen.priority(), 0x00); - m_spr_old2->turbofrc_draw_sprites(m_spr2vram, m_spr2vram.bytes(), 0, machine(), bitmap, cliprect, screen.priority(), 0x02); + m_spr_old->turbofrc_draw_sprites(m_spr1vram, m_spr1vram.bytes(), 0, bitmap, cliprect, screen.priority(), 0x00); + m_spr_old2->turbofrc_draw_sprites(m_spr2vram, m_spr2vram.bytes(), 0, bitmap, cliprect, screen.priority(), 0x02); } return 0; } diff --git a/src/mame/video/fromance.c b/src/mame/video/fromance.c index eb70a412e5f..fd21c82d850 100644 --- a/src/mame/video/fromance.c +++ b/src/mame/video/fromance.c @@ -306,7 +306,7 @@ UINT32 fromance_state::screen_update_pipedrm(screen_device &screen, bitmap_ind16 m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - m_spr_old->turbofrc_draw_sprites((UINT16*)sram, m_spriteram.bytes(), 0, machine(), bitmap, cliprect, screen.priority(), 0); - m_spr_old->turbofrc_draw_sprites((UINT16*)sram, m_spriteram.bytes(), 0, machine(), bitmap, cliprect, screen.priority(), 1); + m_spr_old->turbofrc_draw_sprites((UINT16*)sram, m_spriteram.bytes(), 0, bitmap, cliprect, screen.priority(), 0); + m_spr_old->turbofrc_draw_sprites((UINT16*)sram, m_spriteram.bytes(), 0, bitmap, cliprect, screen.priority(), 1); return 0; } diff --git a/src/mame/video/gp9001.c b/src/mame/video/gp9001.c index 2796d45921d..ff6f173ad8d 100644 --- a/src/mame/video/gp9001.c +++ b/src/mame/video/gp9001.c @@ -669,7 +669,7 @@ WRITE16_MEMBER( gp9001vdp_device::pipibibi_bootleg_spriteram16_w ) Sprite Handlers ***************************************************************************/ -void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8* primap ) +void gp9001vdp_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8* primap ) { const UINT16 primask = (GP9001_PRIMASK << 8); @@ -859,10 +859,10 @@ void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_ind16 &bit Draw the game screen in the given bitmap_ind16. ***************************************************************************/ -void gp9001vdp_device::gp9001_draw_custom_tilemap(running_machine& machine, bitmap_ind16 &bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable ) +void gp9001vdp_device::gp9001_draw_custom_tilemap( bitmap_ind16 &bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable ) { - int width = machine.first_screen()->width(); - int height = machine.first_screen()->height(); + int width = m_screen->width(); + int height = m_screen->height(); int y,x; bitmap_ind16 &tmb = tilemap->pixmap(); UINT16* srcptr; @@ -912,7 +912,7 @@ static const UINT8 gp9001_sprprimap1[16] = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14 static const UINT8 batsugun_prienable0[16]={ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; -void gp9001vdp_device::gp9001_render_vdp(running_machine& machine, bitmap_ind16 &bitmap, const rectangle &cliprect) +void gp9001vdp_device::gp9001_render_vdp(bitmap_ind16 &bitmap, const rectangle &cliprect) { if (gp9001_gfxrom_is_banked && gp9001_gfxrom_bank_dirty) { @@ -921,10 +921,10 @@ void gp9001vdp_device::gp9001_render_vdp(running_machine& machine, bitmap_ind16 gp9001_gfxrom_bank_dirty = 0; } - gp9001_draw_custom_tilemap( machine, bitmap, bg.tmap, gp9001_primap1, batsugun_prienable0); - gp9001_draw_custom_tilemap( machine, bitmap, fg.tmap, gp9001_primap1, batsugun_prienable0); - gp9001_draw_custom_tilemap( machine, bitmap, top.tmap, gp9001_primap1, batsugun_prienable0); - draw_sprites( machine,bitmap,cliprect, gp9001_sprprimap1); + gp9001_draw_custom_tilemap(bitmap, bg.tmap, gp9001_primap1, batsugun_prienable0); + gp9001_draw_custom_tilemap(bitmap, fg.tmap, gp9001_primap1, batsugun_prienable0); + gp9001_draw_custom_tilemap(bitmap, top.tmap, gp9001_primap1, batsugun_prienable0); + draw_sprites(bitmap,cliprect, gp9001_sprprimap1); } diff --git a/src/mame/video/gp9001.h b/src/mame/video/gp9001.h index b7f79b06eb7..35f80bf612d 100644 --- a/src/mame/video/gp9001.h +++ b/src/mame/video/gp9001.h @@ -53,9 +53,9 @@ public: UINT16 gp9001_gfxrom_bank[8]; /* Batrider object bank */ - void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8* primap ); - void gp9001_draw_custom_tilemap(running_machine& machine, bitmap_ind16 &bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable ); - void gp9001_render_vdp(running_machine& machine, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const UINT8* primap ); + void gp9001_draw_custom_tilemap( bitmap_ind16 &bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable ); + void gp9001_render_vdp( bitmap_ind16 &bitmap, const rectangle &cliprect); void gp9001_screen_eof(void); void create_tilemaps(void); void init_scroll_regs(void); diff --git a/src/mame/video/k054156_k054157_k056832.c b/src/mame/video/k054156_k054157_k056832.c index 867a955e0ba..7e3aa03de1e 100644 --- a/src/mame/video/k054156_k054157_k056832.c +++ b/src/mame/video/k054156_k054157_k056832.c @@ -1269,8 +1269,7 @@ int k056832_device::update_linemap( screen_device &screen, _BitmapClass &bitmap, */ { bitmap_ind16 *pixmap; - running_machine &machine = device->machine(); - + UINT8 code_transparent, code_opaque; const pen_t *pal_ptr; const UINT8 *src_ptr; @@ -1292,7 +1291,7 @@ int k056832_device::update_linemap( screen_device &screen, _BitmapClass &bitmap, { xpr_ptr[count+N] = 0; } pixmap = m_pixmap[page]; - pal_ptr = machine.pens; + pal_ptr = machine().pens; src_gfx = m_gfxdecode->gfx(m_gfx_num]; src_pitch = src_gfx->rowbytes(); src_modulo = src_gfx->char_modulo; @@ -2229,7 +2228,7 @@ int k056832_device::altK056832_update_linemap(screen_device &screen, bitmap_rgb3 { xpr_ptr[count+N] = 0; } pixmap = m_pixmap[page]; - pal_ptr = machine.pens; + pal_ptr = machine().pens; src_gfx = m_gfxdecode->gfx(m_gfx_num]; src_pitch = src_gfx->rowbytes(); src_modulo = src_gfx->char_modulo; diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c index 452f3236c64..61d20cdd6c7 100644 --- a/src/mame/video/konamigx.c +++ b/src/mame/video/konamigx.c @@ -285,9 +285,9 @@ int K055555GX_decode_osmixcolor(int layer, int *color) // (see p.63, p.49-50 and } #endif -static void gx_wipezbuf(running_machine &machine, int noshadow) +void konamigx_state::wipezbuf(int noshadow) { - const rectangle &visarea = machine.first_screen()->visible_area(); + const rectangle &visarea = m_screen->visible_area(); int w = visarea.width(); int h = visarea.height(); @@ -427,7 +427,7 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap, if (mixerflags & GXMIX_NOZBUF) mixerflags |= GXMIX_NOSHADOW; else - gx_wipezbuf(machine(), mixerflags & GXMIX_NOSHADOW); + wipezbuf(mixerflags & GXMIX_NOSHADOW); // cache global parameters konamigx_precache_registers(); diff --git a/src/mame/video/sknsspr.c b/src/mame/video/sknsspr.c index 6c87a4ff714..41b533c2753 100644 --- a/src/mame/video/sknsspr.c +++ b/src/mame/video/sknsspr.c @@ -20,7 +20,8 @@ const device_type SKNS_SPRITE = &device_creator; sknsspr_device::sknsspr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, SKNS_SPRITE, "SKNS Sprite", tag, owner, clock, "sknsspr", __FILE__) + : device_t(mconfig, SKNS_SPRITE, "SKNS Sprite", tag, owner, clock, "sknsspr", __FILE__), + device_video_interface(mconfig, *this) { } @@ -34,7 +35,7 @@ void sknsspr_device::device_reset() //printf("sknsspr_device::device_reset()\n"); } -int sknsspr_device::skns_rle_decode ( running_machine &machine, int romoffset, int size, UINT8*gfx_source, size_t gfx_length ) +int sknsspr_device::skns_rle_decode ( int romoffset, int size, UINT8*gfx_source, size_t gfx_length ) { UINT8 *src = gfx_source; size_t srcsize = gfx_length; @@ -229,7 +230,7 @@ static void (*const blit_z[4])(bitmap_ind16 &bitmap, const rectangle &cliprect, blit_fxy_z, }; -void sknsspr_device::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) +void sknsspr_device::skns_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs) { /*- SPR RAM Format -** @@ -395,12 +396,12 @@ void sknsspr_device::skns_draw_sprites(running_machine &machine, bitmap_ind16 &b if (sprite_flip&2) { xflip ^= 1; - sx = machine.first_screen()->visible_area().max_x+1 - sx; + sx = m_screen->visible_area().max_x+1 - sx; } if (sprite_flip&1) { yflip ^= 1; - sy = machine.first_screen()->visible_area().max_y+1 - sy; + sy = m_screen->visible_area().max_y+1 - sy; } /* Palette linking */ @@ -446,7 +447,7 @@ void sknsspr_device::skns_draw_sprites(running_machine &machine, bitmap_ind16 &b romoffset &= gfxlen-1; - endromoffs = skns_rle_decode ( machine, romoffset, size, gfx_source, gfx_length ); + endromoffs = skns_rle_decode ( romoffset, size, gfx_source, gfx_length ); // in Cyvern diff --git a/src/mame/video/sknsspr.h b/src/mame/video/sknsspr.h index a651120b298..4701e865093 100644 --- a/src/mame/video/sknsspr.h +++ b/src/mame/video/sknsspr.h @@ -1,9 +1,11 @@ -class sknsspr_device : public device_t +class sknsspr_device : public device_t, + public device_video_interface { public: sknsspr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - 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); + + void skns_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs); void skns_sprite_kludge(int x, int y); protected: @@ -13,7 +15,7 @@ private: int sprite_kludge_x, sprite_kludge_y; #define SUPRNOVA_DECODE_BUFFER_SIZE 0x2000 UINT8 decodebuffer[SUPRNOVA_DECODE_BUFFER_SIZE]; - int skns_rle_decode ( running_machine &machine, int romoffset, int size, UINT8*gfx_source, size_t gfx_length ); + int skns_rle_decode ( int romoffset, int size, UINT8*gfx_source, size_t gfx_length ); }; extern const device_type SKNS_SPRITE; diff --git a/src/mame/video/snk.c b/src/mame/video/snk.c index 98bf6c428af..a9dcd0b3b38 100644 --- a/src/mame/video/snk.c +++ b/src/mame/video/snk.c @@ -658,15 +658,13 @@ WRITE8_MEMBER(snk_state::tdfever_spriteram_w) /**************************************************************************************/ -static void marvins_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, - const int scrollx, const int scrolly, const int from, const int to) +void snk_state::marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to) { - snk_state *state = machine.driver_data(); - gfx_element *gfx = state->m_gfxdecode->gfx(3); + gfx_element *gfx = m_gfxdecode->gfx(3); const UINT8 *source, *finish; - source = state->m_spriteram + from*4; - finish = state->m_spriteram + to*4; + source = m_spriteram + from*4; + finish = m_spriteram + to*4; while( sourceflip_screen()) + if (flip_screen()) { sx = 89 - 16 - sx; sy = 262 - 16 - sy; @@ -696,7 +694,7 @@ static void marvins_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, color, flipx, flipy, sx, sy, - state->m_drawmode_table); + m_drawmode_table); source+=4; } @@ -767,11 +765,9 @@ void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } -static void ikari_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, - const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum ) +void snk_state::ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum ) { - snk_state *state = machine.driver_data(); - gfx_element *gfx = state->m_gfxdecode->gfx(gfxnum); + gfx_element *gfx = m_gfxdecode->gfx(gfxnum); const int size = gfx->width(); int tile_number, attributes, color, sx, sy; int which, finish; @@ -809,7 +805,7 @@ static void ikari_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, c color, 0,0, sx,sy, - state->m_drawmode_table); + m_drawmode_table); } } @@ -839,11 +835,10 @@ byte3: attributes -xx-x--- (bank number) x------- (x offset bit8) */ -static void tdfever_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, - const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, const int hw_xflip, const int from, const int to ) +void snk_state::tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const UINT8 *source, const int gfxnum, + const int hw_xflip, const int from, const int to) { - snk_state *state = machine.driver_data(); - gfx_element *gfx = state->m_gfxdecode->gfx(gfxnum); + gfx_element *gfx = m_gfxdecode->gfx(gfxnum); const int size = gfx->width(); int tile_number, attributes, sx, sy, color; int which; @@ -879,7 +874,7 @@ static void tdfever_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, if (hw_xflip) sx = 495 - size - sx; - if (state->flip_screen()) + if (flip_screen()) { sx = 495 - size - sx; sy = 258 - size - sy; @@ -897,7 +892,7 @@ static void tdfever_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, color, flipx,flipy, sx,sy, - state->m_drawmode_table); + m_drawmode_table); } } @@ -911,9 +906,9 @@ UINT32 snk_state::screen_update_marvins(screen_device &screen, bitmap_ind16 &bit m_fg_tilemap->set_scrolly(0, m_fg_scrolly); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - marvins_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, 0, m_sprite_split_point>>2); + marvins_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, 0, m_sprite_split_point>>2); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - marvins_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_sprite_split_point>>2, 25); + marvins_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_sprite_split_point>>2, 25); m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -940,9 +935,9 @@ UINT32 snk_state::screen_update_ikari(screen_device &screen, bitmap_ind16 &bitma m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - ikari_draw_sprites(machine(), bitmap, cliprect, 0, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 ); - ikari_draw_sprites(machine(), bitmap, cliprect, 0, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3 ); - ikari_draw_sprites(machine(), bitmap, cliprect, 25, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 ); + ikari_draw_sprites(bitmap, cliprect, 0, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 ); + ikari_draw_sprites(bitmap, cliprect, 0, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3 ); + ikari_draw_sprites(bitmap, cliprect, 25, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2 ); m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -956,9 +951,9 @@ UINT32 snk_state::screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, 0, m_sprite_split_point ); - tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3, 0, 0, 32 ); - tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, m_sprite_split_point, 64 ); + tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, 0, m_sprite_split_point ); + tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3, 0, 0, 32 ); + tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, m_sprite_split_point, 64 ); m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -973,7 +968,7 @@ UINT32 snk_state::screen_update_tdfever(screen_device &screen, bitmap_ind16 &bit m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - tdfever_draw_sprites(machine(), bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 2, 1, 0, 32 ); + tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 2, 1, 0, 32 ); m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); diff --git a/src/mame/video/ssv.c b/src/mame/video/ssv.c index 450aebc1aef..9ed000d5f97 100644 --- a/src/mame/video/ssv.c +++ b/src/mame/video/ssv.c @@ -975,7 +975,7 @@ UINT32 ssv_state::screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap screen_update_ssv(screen, bitmap, cliprect); // draw zooming sprites - m_gdfs_st0020->st0020_draw_all(machine(), bitmap, cliprect); + m_gdfs_st0020->st0020_draw_all(bitmap, cliprect); m_gdfs_tmap->set_scrollx(0, m_gdfs_tmapscroll[0x0c/2]); m_gdfs_tmap->set_scrolly(0, m_gdfs_tmapscroll[0x10/2]); diff --git a/src/mame/video/st0020.c b/src/mame/video/st0020.c index 13dc6f5b3da..7575beade11 100644 --- a/src/mame/video/st0020.c +++ b/src/mame/video/st0020.c @@ -276,7 +276,7 @@ WRITE16_MEMBER(st0020_device::st0020_blitram_w) E.h Unused */ -void st0020_device::st0020_draw_zooming_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority) +void st0020_device::st0020_draw_zooming_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority) { /* Sprites list */ UINT16 *spriteram16_2 = m_st0020_spriteram; @@ -405,11 +405,11 @@ void st0020_device::st0020_draw_zooming_sprites(running_machine &machine, bitmap #if 0 /* doesn't compile in a device context (can't use ui_draw_text? */ - 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[10]; sprintf(buf, "%X",size); - ui_draw_text(&machine.render().ui_container(), buf, sx / 0x10000, sy / 0x10000); + ui_draw_text(&machine().render().ui_container(), buf, sx / 0x10000, sy / 0x10000); } #endif } /* single-sprites */ @@ -421,8 +421,8 @@ void st0020_device::st0020_draw_zooming_sprites(running_machine &machine, bitmap -void st0020_device::st0020_draw_all(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) +void st0020_device::st0020_draw_all(bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int pri = 0; pri <= 0xf; pri++) - st0020_draw_zooming_sprites(machine, bitmap, cliprect, pri); + st0020_draw_zooming_sprites(bitmap, cliprect, pri); } diff --git a/src/mame/video/st0020.h b/src/mame/video/st0020.h index 2ba2c8c0ead..61657349f68 100644 --- a/src/mame/video/st0020.h +++ b/src/mame/video/st0020.h @@ -21,7 +21,7 @@ public: // per-game hack int m_is_jclub2; - void st0020_draw_all(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect); + void st0020_draw_all(bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER(st0020_gfxram_r); DECLARE_WRITE16_MEMBER(st0020_gfxram_w); @@ -40,7 +40,7 @@ private: UINT16* m_st0020_gfxram; UINT16* m_st0020_spriteram; UINT16* m_st0020_blitram; - void st0020_draw_zooming_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); + void st0020_draw_zooming_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority); DECLARE_READ16_MEMBER(st0020_blit_r); DECLARE_WRITE16_MEMBER(st0020_blit_w); required_device m_gfxdecode; diff --git a/src/mame/video/suprnova.c b/src/mame/video/suprnova.c index 5cd6f09c648..24fd6bfdcdb 100644 --- a/src/mame/video/suprnova.c +++ b/src/mame/video/suprnova.c @@ -608,7 +608,7 @@ UINT32 skns_state::screen_update_skns(screen_device &screen, bitmap_rgb32 &bitma m_sprite_bitmap.fill(0x0000, cliprect); if (m_alt_enable_sprites) - m_spritegen->skns_draw_sprites(machine(), m_sprite_bitmap, cliprect, m_spriteram, m_spriteram.bytes(), memregion("gfx1")->base(), memregion ("gfx1")->bytes(), m_spc_regs ); + m_spritegen->skns_draw_sprites(m_sprite_bitmap, cliprect, m_spriteram, m_spriteram.bytes(), memregion("gfx1")->base(), memregion ("gfx1")->bytes(), m_spc_regs ); return 0; diff --git a/src/mame/video/toaplan2.c b/src/mame/video/toaplan2.c index ae840b5df8a..edb27a16b89 100644 --- a/src/mame/video/toaplan2.c +++ b/src/mame/video/toaplan2.c @@ -230,13 +230,13 @@ UINT32 toaplan2_state::screen_update_dogyuun(screen_device &screen, bitmap_ind16 { bitmap.fill(0, cliprect); m_custom_priority_bitmap.fill(0, cliprect); - m_vdp1->gp9001_render_vdp(machine(), bitmap, cliprect); + m_vdp1->gp9001_render_vdp(bitmap, cliprect); } if (m_vdp0) { // bitmap.fill(0, cliprect); m_custom_priority_bitmap.fill(0, cliprect); - m_vdp0->gp9001_render_vdp(machine(), bitmap, cliprect); + m_vdp0->gp9001_render_vdp(bitmap, cliprect); } @@ -254,13 +254,13 @@ UINT32 toaplan2_state::screen_update_batsugun(screen_device &screen, bitmap_ind1 { bitmap.fill(0, cliprect); m_custom_priority_bitmap.fill(0, cliprect); - m_vdp0->gp9001_render_vdp(machine(), bitmap, cliprect); + m_vdp0->gp9001_render_vdp(bitmap, cliprect); } if (m_vdp1) { m_secondary_render_bitmap.fill(0, cliprect); m_custom_priority_bitmap.fill(0, cliprect); - m_vdp1->gp9001_render_vdp(machine(), m_secondary_render_bitmap, cliprect); + m_vdp1->gp9001_render_vdp(m_secondary_render_bitmap, cliprect); } @@ -348,7 +348,7 @@ UINT32 toaplan2_state::screen_update_toaplan2(screen_device &screen, bitmap_ind1 { bitmap.fill(0, cliprect); m_custom_priority_bitmap.fill(0, cliprect); - m_vdp0->gp9001_render_vdp(machine(), bitmap, cliprect); + m_vdp0->gp9001_render_vdp(bitmap, cliprect); return 0; } diff --git a/src/mame/video/vsystem_spr2.c b/src/mame/video/vsystem_spr2.c index f413bac4f77..0ff4006e128 100644 --- a/src/mame/video/vsystem_spr2.c +++ b/src/mame/video/vsystem_spr2.c @@ -137,7 +137,7 @@ void vsystem_spr2_device::handle_xsize_map_inc(void) } template -void vsystem_spr2_device::turbofrc_draw_sprites_common( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) +void vsystem_spr2_device::turbofrc_draw_sprites_common( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) { int attr_start, first; first = 4 * spriteram3[0x1fe]; @@ -244,8 +244,8 @@ void vsystem_spr2_device::turbofrc_draw_sprites_common( UINT16* spriteram3, int } } -void vsystem_spr2_device::turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) -{ turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spritepalettebank, machine, bitmap, cliprect, priority_bitmap, pri_param ); } +void vsystem_spr2_device::turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) +{ turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spritepalettebank, bitmap, cliprect, priority_bitmap, pri_param ); } -void vsystem_spr2_device::turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) -{ turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spritepalettebank, machine, bitmap, cliprect, priority_bitmap, pri_param ); } +void vsystem_spr2_device::turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ) +{ turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spritepalettebank, bitmap, cliprect, priority_bitmap, pri_param ); } diff --git a/src/mame/video/vsystem_spr2.h b/src/mame/video/vsystem_spr2.h index 643aae4c722..f14eb44e3cd 100644 --- a/src/mame/video/vsystem_spr2.h +++ b/src/mame/video/vsystem_spr2.h @@ -52,10 +52,10 @@ public: int m_xoffs, m_yoffs; template - void turbofrc_draw_sprites_common( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ); + void turbofrc_draw_sprites_common( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ); - void turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ); - void turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ); + void turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ); + void turbofrc_draw_sprites( UINT16* spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param ); diff --git a/src/mame/video/welltris.c b/src/mame/video/welltris.c index 2568bb590cc..f84f110a51a 100644 --- a/src/mame/video/welltris.c +++ b/src/mame/video/welltris.c @@ -98,6 +98,6 @@ UINT32 welltris_state::screen_update_welltris(screen_device &screen, bitmap_ind1 draw_background(bitmap, cliprect); m_char_tilemap->draw(screen, bitmap, cliprect, 0, 0); - m_spr_old->turbofrc_draw_sprites(m_spriteram, m_spriteram.bytes(), m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0); + m_spr_old->turbofrc_draw_sprites(m_spriteram, m_spriteram.bytes(), m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); return 0; }