From 4568e59a27dc78b1b8477cac196f8a11ab31b65d Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 6 Oct 2014 16:30:06 +0000 Subject: [PATCH] Removed running_machine parameter from various methods were it wasn't needed anymore (nw) Moved some more functions into driver classes. (nw) --- src/emu/video/tms34061.c | 2 +- src/mame/drivers/expro02.c | 2 +- src/mame/drivers/taitojc.c | 2 +- src/mame/includes/carpolo.h | 4 +- src/mame/includes/harddriv.h | 2 + src/mame/includes/midyunit.h | 27 ++++---- src/mame/includes/mystwarr.h | 1 + src/mame/includes/namcos86.h | 1 + src/mame/includes/taitojc.h | 2 +- src/mame/includes/thepit.h | 23 ++++--- src/mame/video/actfancr.c | 2 +- src/mame/video/carpolo.c | 29 ++++----- src/mame/video/dec0.c | 40 ++++++------ src/mame/video/dec8.c | 18 +++--- src/mame/video/deckarn.c | 4 +- src/mame/video/deckarn.h | 2 +- src/mame/video/decmxc06.c | 9 +-- src/mame/video/decmxc06.h | 8 ++- src/mame/video/galpani2.c | 2 +- src/mame/video/harddriv.c | 15 +++-- src/mame/video/k054156_k054157_k056832.c | 80 ++++++++++++------------ src/mame/video/k054156_k054157_k056832.h | 6 +- src/mame/video/kaneko16.c | 4 +- src/mame/video/kaneko_grap2.c | 6 +- src/mame/video/kaneko_grap2.h | 2 +- src/mame/video/kaneko_spr.c | 16 ++--- src/mame/video/kaneko_spr.h | 10 +-- src/mame/video/karnov.c | 2 +- src/mame/video/madmotor.c | 2 +- src/mame/video/midyunit.c | 11 ++-- src/mame/video/mystwarr.c | 25 ++++---- src/mame/video/namcos86.c | 21 +++---- src/mame/video/stadhero.c | 2 +- src/mame/video/taitojc.c | 5 +- src/mame/video/thepit.c | 46 ++++++-------- src/mame/video/vaportra.c | 10 +-- src/mame/video/vsystem_spr.c | 6 +- src/mame/video/vsystem_spr.h | 2 +- 38 files changed, 225 insertions(+), 226 deletions(-) diff --git a/src/emu/video/tms34061.c b/src/emu/video/tms34061.c index c2b3a324ecf..b0111eedaf0 100644 --- a/src/emu/video/tms34061.c +++ b/src/emu/video/tms34061.c @@ -61,7 +61,7 @@ void tms34061_device::device_start() /* allocate memory for VRAM */ m_vram = auto_alloc_array_clear(machine(), UINT8, m_vramsize + 256 * 2); /* not really a save state, just there for debugging purposes */ - machine().save().save_pointer(NAME(m_vram), m_vramsize); + save_pointer(NAME(m_vram), m_vramsize); /* allocate memory for latch RAM */ m_latchram = auto_alloc_array_clear(machine(), UINT8, m_vramsize + 256 * 2); diff --git a/src/mame/drivers/expro02.c b/src/mame/drivers/expro02.c index 8c814064e38..c2beedc0813 100644 --- a/src/mame/drivers/expro02.c +++ b/src/mame/drivers/expro02.c @@ -253,7 +253,7 @@ UINT32 expro02_state::screen_update_galsnew(screen_device &screen, bitmap_ind16 m_view2_0->render_tilemap_chip(screen,bitmap,cliprect,i); } - m_kaneko_spr->kaneko16_render_sprites(machine(),bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); + m_kaneko_spr->kaneko16_render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); return 0; } diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c index 55d143cf8c3..c1a36c93c3d 100644 --- a/src/mame/drivers/taitojc.c +++ b/src/mame/drivers/taitojc.c @@ -897,7 +897,7 @@ WRITE16_MEMBER(taitojc_state::dsp_unk2_w) if (offset == 0) { taitojc_clear_frame(); - m_renderer->render_polygons(machine(), m_polygon_fifo, m_polygon_fifo_ptr); + m_renderer->render_polygons(m_polygon_fifo, m_polygon_fifo_ptr); m_polygon_fifo_ptr = 0; } diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h index 77802a89410..8fc22640e73 100644 --- a/src/mame/includes/carpolo.h +++ b/src/mame/includes/carpolo.h @@ -119,8 +119,8 @@ public: void carpolo_generate_car_goal_interrupt(int car, int right_goal); void carpolo_generate_car_ball_interrupt(int car, int car_x, int car_y); void carpolo_generate_car_border_interrupt(int car, int horizontal_border); - void draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, - UINT8 x, UINT8 y, int bank, int code, int col); + void draw_alpha_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int alpha_line, int video_line); + void draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 x, UINT8 y, int bank, int code, int col); int check_sprite_sprite_collision(int x1, int y1, int code1, int flipy1, int x2, int y2, int code2, int flipy2, int *col_x, int *col_y); diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h index d282b13e522..bbbd6d6aadf 100644 --- a/src/mame/includes/harddriv.h +++ b/src/mame/includes/harddriv.h @@ -453,6 +453,8 @@ public: DECLARE_WRITE16_MEMBER( hdgsp_vram_1bpp_w ); DECLARE_WRITE16_MEMBER( hdgsp_vram_2bpp_w ); + inline void gsp_palette_change(int offset); + DECLARE_READ16_MEMBER( hdgsp_paletteram_lo_r ); DECLARE_WRITE16_MEMBER( hdgsp_paletteram_lo_w ); DECLARE_READ16_MEMBER( hdgsp_paletteram_hi_r ); diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h index 532114f4b47..414909fba89 100644 --- a/src/mame/includes/midyunit.h +++ b/src/mame/includes/midyunit.h @@ -40,23 +40,29 @@ public: midyunit_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_oki(*this, "oki"), + m_palette(*this, "palette"), m_narc_sound(*this, "narcsnd"), m_cvsd_sound(*this, "cvsd"), m_adpcm_sound(*this, "adpcm"), - m_gfx_rom(*this, "gfx_rom", 16) , - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_oki(*this, "oki"), - m_palette(*this, "palette"), - m_generic_paletteram_16(*this, "paletteram") { } + m_generic_paletteram_16(*this, "paletteram"), + m_gfx_rom(*this, "gfx_rom", 16) { } + required_device m_maincpu; + optional_device m_audiocpu; + optional_device m_oki; + required_device m_palette; optional_device m_narc_sound; optional_device m_cvsd_sound; optional_device m_adpcm_sound; + + required_shared_ptr m_generic_paletteram_16; + optional_shared_ptr m_gfx_rom; UINT16 *m_cmos_ram; UINT32 m_cmos_page; - optional_shared_ptr m_gfx_rom; UINT16 m_prot_result; UINT16 m_prot_sequence[3]; UINT8 m_prot_index; @@ -124,11 +130,8 @@ public: DECLARE_VIDEO_START(common); TIMER_CALLBACK_MEMBER(dma_callback); TIMER_CALLBACK_MEMBER(autoerase_line); - required_device m_maincpu; - optional_device m_audiocpu; - optional_device m_oki; - required_device m_palette; - required_shared_ptr m_generic_paletteram_16; + protected: virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + void dma_draw(UINT16 command); }; diff --git a/src/mame/includes/mystwarr.h b/src/mame/includes/mystwarr.h index e27c85f550a..a3265f15fdd 100644 --- a/src/mame/includes/mystwarr.h +++ b/src/mame/includes/mystwarr.h @@ -100,4 +100,5 @@ public: K055673_CB_MEMBER(metamrph_sprite_callback); K055673_CB_MEMBER(gaiapols_sprite_callback); K055673_CB_MEMBER(martchmp_sprite_callback); + void decode_tiles(); }; diff --git a/src/mame/includes/namcos86.h b/src/mame/includes/namcos86.h index 7f041cd951f..f51921325a2 100644 --- a/src/mame/includes/namcos86.h +++ b/src/mame/includes/namcos86.h @@ -69,4 +69,5 @@ public: private: inline void get_tile_info(tile_data &tileinfo,int tile_index,int layer,UINT8 *vram); + void set_scroll(int layer); }; diff --git a/src/mame/includes/taitojc.h b/src/mame/includes/taitojc.h index 63bec6e3c60..2701b7ee11b 100644 --- a/src/mame/includes/taitojc.h +++ b/src/mame/includes/taitojc.h @@ -26,7 +26,7 @@ public: void render_shade_scan(INT32 scanline, const extent_t &extent, const taitojc_polydata &extradata, int threadid); void render_texture_scan(INT32 scanline, const extent_t &extent, const taitojc_polydata &extradata, int threadid); - void render_polygons(running_machine &machine, UINT16 *polygon_fifo, int length); + void render_polygons(UINT16 *polygon_fifo, int length); private: bitmap_ind16 *m_framebuffer; diff --git a/src/mame/includes/thepit.h b/src/mame/includes/thepit.h index f9b0c8ac0fb..7e9d4b5a7b5 100644 --- a/src/mame/includes/thepit.h +++ b/src/mame/includes/thepit.h @@ -3,21 +3,26 @@ class thepit_state : public driver_device public: thepit_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), m_attributesram(*this, "attributesram"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_spriteram(*this, "spriteram") { } - int m_question_address; - int m_question_rom; - int m_remap_address[16]; + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; + required_shared_ptr m_videoram; required_shared_ptr m_colorram; required_shared_ptr m_attributesram; required_shared_ptr m_spriteram; + + int m_question_address; + int m_question_rom; + int m_remap_address[16]; UINT8 m_graphics_bank; UINT8 m_flip_screen_x; UINT8 m_flip_screen_y; @@ -44,7 +49,5 @@ public: UINT32 screen_update_thepit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_desertdan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(vblank_irq); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_draw); }; diff --git a/src/mame/video/actfancr.c b/src/mame/video/actfancr.c index 9769e1f36ac..fbd1b96e942 100644 --- a/src/mame/video/actfancr.c +++ b/src/mame/video/actfancr.c @@ -27,7 +27,7 @@ UINT32 actfancr_state::screen_update_actfancr(screen_device &screen, bitmap_ind1 flip_screen_set(m_tilegen2->get_flip_state()); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_spriteram16, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram16, 0x00, 0x00, 0x0f); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; diff --git a/src/mame/video/carpolo.c b/src/mame/video/carpolo.c index d35c8acf1ba..65b8ba08343 100644 --- a/src/mame/video/carpolo.c +++ b/src/mame/video/carpolo.c @@ -165,20 +165,17 @@ void carpolo_state::video_start() * *************************************/ -static void draw_alpha_line(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, +void carpolo_state::draw_alpha_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int alpha_line, int video_line) { - carpolo_state *state = machine.driver_data(); - int x; - - for (x = 0; x < 32; x++) + for (int x = 0; x < 32; x++) { UINT8 code, col; - code = state->m_alpharam[alpha_line * 32 + x] >> 2; - col = state->m_alpharam[alpha_line * 32 + x] & 0x03; + code = m_alpharam[alpha_line * 32 + x] >> 2; + col = m_alpharam[alpha_line * 32 + x] & 0x03; - state->m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, code,col, 0,0, x*8,video_line*8,0); @@ -292,14 +289,14 @@ UINT32 carpolo_state::screen_update_carpolo(screen_device &screen, bitmap_ind16 and bit 3 of the vertical timing PROM controls in which quadrant the line will actually appear */ - draw_alpha_line(machine(), bitmap, cliprect, 0, (0*4+0)*2 ); - draw_alpha_line(machine(), bitmap, cliprect, 1, (0*4+0)*2+1); - draw_alpha_line(machine(), bitmap, cliprect, 2, (3*4+1)*2 ); - draw_alpha_line(machine(), bitmap, cliprect, 3, (3*4+1)*2+1); - draw_alpha_line(machine(), bitmap, cliprect, 4, (1*4+2)*2 ); - draw_alpha_line(machine(), bitmap, cliprect, 5, (1*4+2)*2+1); - draw_alpha_line(machine(), bitmap, cliprect, 6, (0*4+3)*2 ); - draw_alpha_line(machine(), bitmap, cliprect, 7, (0*4+3)*2+1); + draw_alpha_line(bitmap, cliprect, 0, (0*4+0)*2 ); + draw_alpha_line(bitmap, cliprect, 1, (0*4+0)*2+1); + draw_alpha_line(bitmap, cliprect, 2, (3*4+1)*2 ); + draw_alpha_line(bitmap, cliprect, 3, (3*4+1)*2+1); + draw_alpha_line(bitmap, cliprect, 4, (1*4+2)*2 ); + draw_alpha_line(bitmap, cliprect, 5, (1*4+2)*2+1); + draw_alpha_line(bitmap, cliprect, 6, (0*4+3)*2 ); + draw_alpha_line(bitmap, cliprect, 7, (0*4+3)*2+1); return 0; } diff --git a/src/mame/video/dec0.c b/src/mame/video/dec0.c index 6e824ffd690..6faa77133ea 100644 --- a/src/mame/video/dec0.c +++ b/src/mame/video/dec0.c @@ -24,12 +24,12 @@ UINT32 dec0_state::screen_update_hbarrel(screen_device &screen, bitmap_ind16 &bi flip_screen_set(m_tilegen1->get_flip_state()); m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, 0x08, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, 0x08, 0x0f); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); /* HB always keeps pf2 on top of pf3, no need explicitly support priority register */ - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, 0x00, 0x0f); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } @@ -49,7 +49,7 @@ UINT32 dec0_state::screen_update_baddudes(screen_device &screen, bitmap_ind16 &b if (m_pri & 2) m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); if (m_pri & 4) m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ @@ -62,7 +62,7 @@ UINT32 dec0_state::screen_update_baddudes(screen_device &screen, bitmap_ind16 &b if (m_pri & 2) m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); if (m_pri & 4) m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0,0x08,0x08,0x08,0x08); // upper 8 pens of upper 8 priority marked tiles /* Foreground pens only */ @@ -94,7 +94,7 @@ UINT32 dec0_state::screen_update_robocop(screen_device &screen, bitmap_ind16 &bi m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); if (m_pri & 0x02) - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } @@ -103,15 +103,15 @@ UINT32 dec0_state::screen_update_robocop(screen_device &screen, bitmap_ind16 &bi m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); if (m_pri & 0x02) - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } if (m_pri & 0x02) - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans^0x08, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans^0x08, 0x0f); else - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; @@ -164,7 +164,7 @@ UINT32 dec0_automat_state::screen_update_automat(screen_device &screen, bitmap_i m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); if (m_pri & 0x02) - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } @@ -173,15 +173,15 @@ UINT32 dec0_automat_state::screen_update_automat(screen_device &screen, bitmap_i m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); if (m_pri & 0x02) - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } if (m_pri & 0x02) - m_spritegen->draw_sprites_bootleg(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans^0x08, 0x0f); + m_spritegen->draw_sprites_bootleg(bitmap, cliprect, m_buffered_spriteram, 0x08, trans^0x08, 0x0f); else - m_spritegen->draw_sprites_bootleg(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites_bootleg(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; @@ -223,7 +223,7 @@ UINT32 dec0_automat_state::screen_update_secretab(screen_device &screen, bitmap_ m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); - m_spritegen->draw_sprites_bootleg(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites_bootleg(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); /* Redraw top 8 pens of top 8 palettes over sprites */ if (m_pri&0x80) @@ -244,7 +244,7 @@ UINT32 dec0_state::screen_update_birdtry(screen_device &screen, bitmap_ind16 &bi the palette does show through. */ bitmap.fill(m_palette->pen(768), cliprect); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } @@ -266,7 +266,7 @@ UINT32 dec0_state::screen_update_hippodrm(screen_device &screen, bitmap_ind16 &b m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } @@ -280,7 +280,7 @@ UINT32 dec0_state::screen_update_slyspy(screen_device &screen, bitmap_ind16 &bit m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); /* Redraw top 8 pens of top 8 palettes over sprites */ if (m_pri&0x80) @@ -307,7 +307,7 @@ UINT32 dec0_state::screen_update_midres(screen_device &screen, bitmap_ind16 &bit m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); if (m_pri & 0x02) - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } @@ -316,15 +316,15 @@ UINT32 dec0_state::screen_update_midres(screen_device &screen, bitmap_ind16 &bit m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); if (m_pri & 0x02) - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans, 0x0f); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); } if (m_pri & 0x02) - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x08, trans ^ 0x08, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, trans ^ 0x08, 0x0f); else - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x00, 0x00, 0x0f); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; diff --git a/src/mame/video/dec8.c b/src/mame/video/dec8.c index 475d24a6604..4d0bd1e80f4 100644 --- a/src/mame/video/dec8.c +++ b/src/mame/video/dec8.c @@ -261,9 +261,9 @@ UINT32 dec8_state::screen_update_cobracom(screen_device &screen, bitmap_ind16 &b flip_screen_set(m_tilegen1->get_flip_state()); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - m_spritegen_mxc->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x00, 0x03); + m_spritegen_mxc->draw_sprites(bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x00, 0x03); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); - m_spritegen_mxc->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x04, 0x03); + m_spritegen_mxc->draw_sprites(bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x04, 0x03); m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } @@ -299,7 +299,7 @@ VIDEO_START_MEMBER(dec8_state,cobracom) UINT32 dec8_state::screen_update_ghostb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - m_spritegen_krn->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0); + m_spritegen_krn->draw_sprites(bitmap, cliprect, m_buffered_spriteram16, 0x400, 0); m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } @@ -333,7 +333,7 @@ UINT32 dec8_state::screen_update_oscar(screen_device &screen, bitmap_ind16 &bitm // we mimic the priority scheme in dec0.c, this was originally a bit different, so this could be wrong m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - m_spritegen_mxc->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x00, 0x00, 0x0f); + m_spritegen_mxc->draw_sprites(bitmap, cliprect, m_buffered_spriteram16, 0x00, 0x00, 0x0f); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x08,0x08,0x08,0x08); m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -369,7 +369,7 @@ UINT32 dec8_state::screen_update_lastmisn(screen_device &screen, bitmap_ind16 &b m_bg_tilemap->set_scrolly(0, ((m_scroll2[2] << 8)+ m_scroll2[3])); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - m_spritegen_krn->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0); + m_spritegen_krn->draw_sprites(bitmap, cliprect, m_buffered_spriteram16, 0x400, 0); m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } @@ -382,7 +382,7 @@ UINT32 dec8_state::screen_update_shackled(screen_device &screen, bitmap_ind16 &b m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0, 0); m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 1, 0); m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 0); - m_spritegen_krn->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0); + m_spritegen_krn->draw_sprites(bitmap, cliprect, m_buffered_spriteram16, 0x400, 0); m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1, 0); m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -505,9 +505,9 @@ UINT32 dec8_state::screen_update_gondo(screen_device &screen, bitmap_ind16 &bitm m_bg_tilemap->set_scrolly(0, ((m_scroll2[2] << 8) + m_scroll2[3])); m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0); - m_spritegen_krn->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 2); + m_spritegen_krn->draw_sprites(bitmap, cliprect, m_buffered_spriteram16, 0x400, 2); m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0); - m_spritegen_krn->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 1); + m_spritegen_krn->draw_sprites(bitmap, cliprect, m_buffered_spriteram16, 0x400, 1); m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } @@ -518,7 +518,7 @@ UINT32 dec8_state::screen_update_garyoret(screen_device &screen, bitmap_ind16 &b m_bg_tilemap->set_scrolly(0, ((m_scroll2[2] << 8) + m_scroll2[3])); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - m_spritegen_krn->draw_sprites(machine(), bitmap, cliprect, m_buffered_spriteram16, 0x400, 0); + m_spritegen_krn->draw_sprites(bitmap, cliprect, m_buffered_spriteram16, 0x400, 0); m_bg_tilemap->draw(screen, bitmap, cliprect, 1, 0); m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; diff --git a/src/mame/video/deckarn.c b/src/mame/video/deckarn.c index 9320ae73594..6d3e4383688 100644 --- a/src/mame/video/deckarn.c +++ b/src/mame/video/deckarn.c @@ -38,7 +38,7 @@ void deco_karnovsprites_device::device_reset() { } -void deco_karnovsprites_device::draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int size, int priority ) +void deco_karnovsprites_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int size, int priority ) { int offs; @@ -81,7 +81,7 @@ void deco_karnovsprites_device::draw_sprites( running_machine &machine, bitmap_i y = (y + 16) % 0x200; x = 256 - x; y = 256 - y; - if (machine.driver_data()->flip_screen()) + if (machine().driver_data()->flip_screen()) { y = 240 - y; x = 240 - x; diff --git a/src/mame/video/deckarn.h b/src/mame/video/deckarn.h index 382f7f059b4..893b6b70894 100644 --- a/src/mame/video/deckarn.h +++ b/src/mame/video/deckarn.h @@ -5,7 +5,7 @@ class deco_karnovsprites_device : public device_t public: deco_karnovsprites_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); void set_gfxregion(int region) { m_gfxregion = region; }; - void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int size, int priority ); + void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int size, int priority ); // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); diff --git a/src/mame/video/decmxc06.c b/src/mame/video/decmxc06.c index 168e304bf94..3b908b6df80 100644 --- a/src/mame/video/decmxc06.c +++ b/src/mame/video/decmxc06.c @@ -49,6 +49,7 @@ const device_type DECO_MXC06 = &device_creator; deco_mxc06_device::deco_mxc06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, DECO_MXC06, "DECO MXC06 Sprite", tag, owner, clock, "deco_mxc06", __FILE__), + device_video_interface(mconfig, *this), m_gfxregion(0), m_gfxdecode(*this), m_palette(*this) @@ -67,7 +68,7 @@ void deco_mxc06_device::static_set_gfxdecode_tag(device_t &device, const char *t /* this implementation was originally from Mad Motor */ -void deco_mxc06_device::draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask ) +void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask ) { int offs; @@ -97,7 +98,7 @@ void deco_mxc06_device::draw_sprites( running_machine &machine, bitmap_ind16 &bi sx = 240 - sx; sy = 240 - sy; - if (machine.driver_data()->flip_screen()) + if (machine().driver_data()->flip_screen()) { sy = 240 - sy; sx = 240 - sx; @@ -128,7 +129,7 @@ void deco_mxc06_device::draw_sprites( running_machine &machine, bitmap_ind16 &bi if (spriteram[offs] & 0x8000) { int draw = 0; - if (!flash || (machine.first_screen()->frame_number() & 1)) + if (!flash || (m_screen->frame_number() & 1)) { if (m_priority_type==0) // most cases { @@ -169,7 +170,7 @@ void deco_mxc06_device::draw_sprites( running_machine &machine, bitmap_ind16 &bi /* this is used by the automat bootleg, it seems to have greatly simplified sprites compared to the real chip */ /* spriteram is twice the size tho! */ -void deco_mxc06_device::draw_sprites_bootleg( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask ) +void deco_mxc06_device::draw_sprites_bootleg( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask ) { int offs; diff --git a/src/mame/video/decmxc06.h b/src/mame/video/decmxc06.h index 354c919cde7..54405fb3683 100644 --- a/src/mame/video/decmxc06.h +++ b/src/mame/video/decmxc06.h @@ -1,7 +1,8 @@ /* MXC06 */ -class deco_mxc06_device : public device_t +class deco_mxc06_device : public device_t, + public device_video_interface { public: deco_mxc06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -12,9 +13,10 @@ public: static void set_gfx_region(device_t &device, int region); void set_gfxregion(int region) { m_gfxregion = region; }; - void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask ); - void draw_sprites_bootleg( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask ); + void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask ); + void draw_sprites_bootleg( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* spriteram, int pri_mask, int pri_val, int col_mask ); void set_pri_type( int type ) { m_priority_type = type; } + protected: virtual void device_start(); virtual void device_reset(); diff --git a/src/mame/video/galpani2.c b/src/mame/video/galpani2.c index 26e2d742484..a71c2e2c758 100644 --- a/src/mame/video/galpani2.c +++ b/src/mame/video/galpani2.c @@ -184,6 +184,6 @@ if (machine().input().code_pressed(KEYCODE_Z)) cliprect,0x4000 + 0); } - if (layers_ctrl & 0x8) m_kaneko_spr->kaneko16_render_sprites(machine(), bitmap, cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); + if (layers_ctrl & 0x8) m_kaneko_spr->kaneko16_render_sprites(bitmap, cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); return 0; } diff --git a/src/mame/video/harddriv.c b/src/mame/video/harddriv.c index 991feb25ec7..99c47df0b0e 100644 --- a/src/mame/video/harddriv.c +++ b/src/mame/video/harddriv.c @@ -319,13 +319,12 @@ WRITE16_MEMBER( harddriv_state::hdgsp_vram_2bpp_w ) * *************************************/ -INLINE void gsp_palette_change(running_machine &machine, int offset) +inline void harddriv_state::gsp_palette_change(int offset) { - harddriv_state *state = machine.driver_data(); - int red = (state->m_gsp_paletteram_lo[offset] >> 8) & 0xff; - int green = state->m_gsp_paletteram_lo[offset] & 0xff; - int blue = state->m_gsp_paletteram_hi[offset] & 0xff; - state->m_palette->set_pen_color(offset, rgb_t(red, green, blue)); + int red = (m_gsp_paletteram_lo[offset] >> 8) & 0xff; + int green = m_gsp_paletteram_lo[offset] & 0xff; + int blue = m_gsp_paletteram_hi[offset] & 0xff; + m_palette->set_pen_color(offset, rgb_t(red, green, blue)); } @@ -346,7 +345,7 @@ WRITE16_MEMBER( harddriv_state::hdgsp_paletteram_lo_w ) offset = m_gfx_palettebank * 0x100 + (offset & 0xff); COMBINE_DATA(&m_gsp_paletteram_lo[offset]); - gsp_palette_change(space.machine(), offset); + gsp_palette_change(offset); } @@ -374,7 +373,7 @@ WRITE16_MEMBER( harddriv_state::hdgsp_paletteram_hi_w ) offset = m_gfx_palettebank * 0x100 + (offset & 0xff); COMBINE_DATA(&m_gsp_paletteram_hi[offset]); - gsp_palette_change(space.machine(), offset); + gsp_palette_change(offset); } diff --git a/src/mame/video/k054156_k054157_k056832.c b/src/mame/video/k054156_k054157_k056832.c index 0b7b499e41e..867a955e0ba 100644 --- a/src/mame/video/k054156_k054157_k056832.c +++ b/src/mame/video/k054156_k054157_k056832.c @@ -245,7 +245,7 @@ void k056832_device::static_set_palette_tag(device_t &device, const char *tag) downcast(device).m_palette.set_tag(tag); } -void k056832_device::create_tilemaps(running_machine &machine) +void k056832_device::create_tilemaps() { tilemap_t *tmap; int i; @@ -280,24 +280,24 @@ void k056832_device::create_tilemaps(running_machine &machine) - m_videoram = auto_alloc_array_clear(machine, UINT16, 0x2000 * (K056832_PAGE_COUNT + 1) / 2); + m_videoram = auto_alloc_array_clear(machine(), UINT16, 0x2000 * (K056832_PAGE_COUNT + 1) / 2); - m_tilemap[0x0] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x1] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x2] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x3] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info3),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x4] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info4),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x5] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info5),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x6] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info6),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x7] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info7),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x8] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info8),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0x9] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info9),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xa] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoa),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xb] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infob),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xc] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoc),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xd] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infod),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xe] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoe),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_tilemap[0xf] = &machine.tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infof),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x2] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x3] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info3),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x4] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info4),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x5] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info5),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x6] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info6),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x7] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info7),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x8] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info8),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0x9] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_info9),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xa] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoa),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xb] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infob),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xc] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoc),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xd] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infod),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xe] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infoe),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_tilemap[0xf] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(k056832_device::get_tile_infof),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); for (i = 0; i < K056832_PAGE_COUNT; i++) { @@ -310,7 +310,7 @@ void k056832_device::create_tilemaps(running_machine &machine) } -void k056832_device::finalize_init(running_machine &machine) +void k056832_device::finalize_init() { int i; @@ -354,7 +354,7 @@ void k056832_device::finalize_init(running_machine &machine) save_item(NAME(m_last_colorbase[i]), i); } - machine.save().register_postload(save_prepost_delegate(FUNC(k056832_device::postload), this)); + machine().save().register_postload(save_prepost_delegate(FUNC(k056832_device::postload), this)); } @@ -372,11 +372,11 @@ void k056832_device::device_start() /* TODO: understand which elements MUST be init here (to keep correct layer associations) and which ones can can be init at RESET, if any */ - create_gfx(machine(), m_gfx_memory_region, m_bpp, m_big); + create_gfx(m_gfx_memory_region, m_bpp, m_big); - create_tilemaps(machine()); + create_tilemaps(); - finalize_init(machine()); + finalize_init(); // bind callbacks m_k056832_cb.bind_relative_to(*owner()); @@ -2019,7 +2019,7 @@ READ16_MEMBER( k056832_device::b_word_r ) /***************************************************************************/ -void k056832_device::create_gfx(running_machine &machine, const char *gfx_memory_region, int bpp, int big) +void k056832_device::create_gfx(const char *gfx_memory_region, int bpp, int big) { int gfx_index; int i; @@ -2112,38 +2112,38 @@ void k056832_device::create_gfx(running_machine &machine, const char *gfx_memory switch (bpp) { case K056832_BPP_4: - total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*4); - konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout4, 4); + total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*4); + konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout4, 4); break; case K056832_BPP_5: - total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*5); - konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout5, 5); + total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*5); + konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout5, 5); break; case K056832_BPP_6: - total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*6); - konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout6, 6); + total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*6); + konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout6, 6); break; case K056832_BPP_8: - total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*8); - konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout8, 8); + total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*8); + konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout8, 8); break; case K056832_BPP_8LE: - total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*8); - konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout8le, 8); + total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*8); + konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout8le, 8); break; case K056832_BPP_8TASMAN: - total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*8); - konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout8_tasman, 8); + total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*8); + konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout8_tasman, 8); break; case K056832_BPP_4dj: - total = machine.root_device().memregion(gfx_memory_region)->bytes() / (i*4); - konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, machine.root_device().memregion(gfx_memory_region)->base(), total, &charlayout4dj, 4); + total = machine().root_device().memregion(gfx_memory_region)->bytes() / (i*4); + konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, machine().root_device().memregion(gfx_memory_region)->base(), total, &charlayout4dj, 4); break; default: @@ -2155,8 +2155,8 @@ void k056832_device::create_gfx(running_machine &machine, const char *gfx_memory m_gfx_memory_region = gfx_memory_region; m_gfx_num = gfx_index; - m_rombase = machine.root_device().memregion(gfx_memory_region)->base(); - m_num_gfx_banks = machine.root_device().memregion(gfx_memory_region)->bytes() / 0x2000; + m_rombase = machine().root_device().memregion(gfx_memory_region)->base(); + m_num_gfx_banks = machine().root_device().memregion(gfx_memory_region)->bytes() / 0x2000; m_cur_gfx_banks = 0; m_use_ext_linescroll = 0; m_uses_tile_banks = 0; diff --git a/src/mame/video/k054156_k054157_k056832.h b/src/mame/video/k054156_k054157_k056832.h index 03613aba542..4b13d435bce 100644 --- a/src/mame/video/k054156_k054157_k056832.h +++ b/src/mame/video/k054156_k054157_k056832.h @@ -211,9 +211,9 @@ private: template void tilemap_draw_common(screen_device &screen, _BitmapClass &bitmap, const rectangle &cliprect, int layer, UINT32 flags, UINT32 priority); - void create_gfx(running_machine &machine, const char *gfx_memory_region, int bpp, int big); - void create_tilemaps(running_machine &machine); - void finalize_init(running_machine &machine); + void create_gfx(const char *gfx_memory_region, int bpp, int big); + void create_tilemaps(); + void finalize_init(); required_device m_gfxdecode; required_device m_palette; diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c index 2141f5d0d0c..e6689f5e5e9 100644 --- a/src/mame/video/kaneko16.c +++ b/src/mame/video/kaneko16.c @@ -87,7 +87,7 @@ UINT32 kaneko16_state::screen_update_kaneko16(screen_device &screen, bitmap_ind1 if (!m_disp_enable) return 0; screen_update_common(screen, bitmap, cliprect); - m_kaneko_spr->kaneko16_render_sprites(machine(),bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); + m_kaneko_spr->kaneko16_render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); return 0; } @@ -248,6 +248,6 @@ UINT32 kaneko16_berlwall_state::screen_update_berlwall(screen_device &screen, bi if (!m_disp_enable) return 0; screen_update_common(screen, bitmap, cliprect); - m_kaneko_spr->kaneko16_render_sprites(machine(),bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()/2); + m_kaneko_spr->kaneko16_render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()/2); return 0; } diff --git a/src/mame/video/kaneko_grap2.c b/src/mame/video/kaneko_grap2.c index 1d7eb096896..2895516b2a8 100644 --- a/src/mame/video/kaneko_grap2.c +++ b/src/mame/video/kaneko_grap2.c @@ -162,7 +162,7 @@ WRITE16_MEMBER(kaneko_grap2_device::galpani3_regs1_go_w) } -void kaneko_grap2_device::set_color_555_gp3(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data) +void kaneko_grap2_device::set_color_555_gp3(pen_t color, int rshift, int gshift, int bshift, UINT16 data) { m_palette->set_pen_color(color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift)); } @@ -170,12 +170,12 @@ void kaneko_grap2_device::set_color_555_gp3(running_machine &machine, pen_t colo WRITE16_MEMBER(kaneko_grap2_device::galpani3_framebuffer1_palette_w) { COMBINE_DATA(&m_framebuffer_palette[offset]); - set_color_555_gp3(machine(), offset+0x4000 + (m_chipnum * 0x100), 5, 10, 0, m_framebuffer_palette[offset]); + set_color_555_gp3(offset+0x4000 + (m_chipnum * 0x100), 5, 10, 0, m_framebuffer_palette[offset]); } /* definitely looks like a cycling bg colour used for the girls */ WRITE16_MEMBER(kaneko_grap2_device::galpani3_framebuffer1_bgcol_w) { COMBINE_DATA(&m_framebuffer_bgcol); - set_color_555_gp3(machine(), offset+0x4300 + (m_chipnum), 5, 10, 0, m_framebuffer_bgcol); + set_color_555_gp3(offset+0x4300 + (m_chipnum), 5, 10, 0, m_framebuffer_bgcol); } diff --git a/src/mame/video/kaneko_grap2.h b/src/mame/video/kaneko_grap2.h index 59e0c99438a..cb6b6005b42 100644 --- a/src/mame/video/kaneko_grap2.h +++ b/src/mame/video/kaneko_grap2.h @@ -33,7 +33,7 @@ public: void gp3_do_rle(UINT32 address, UINT16*framebuffer, UINT8* rledata); - void set_color_555_gp3(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data); + void set_color_555_gp3(pen_t color, int rshift, int gshift, int bshift, UINT16 data); UINT16 m_framebuffer_bgcol; UINT16 m_framebuffer_scrolly; diff --git a/src/mame/video/kaneko_spr.c b/src/mame/video/kaneko_spr.c index 012fb4662df..c5e36b2f40e 100644 --- a/src/mame/video/kaneko_spr.c +++ b/src/mame/video/kaneko_spr.c @@ -185,7 +185,7 @@ void kaneko_vu002_sprite_device::get_sprite_attributes(struct tempsprite *s, UIN } -int kaneko16_sprite_device::kaneko16_parse_sprite_type012(running_machine &machine, int i, struct tempsprite *s, UINT16* spriteram16, int spriteram16_bytes) +int kaneko16_sprite_device::kaneko16_parse_sprite_type012(int i, struct tempsprite *s, UINT16* spriteram16, int spriteram16_bytes) { int attr, xoffs, offs; @@ -336,7 +336,7 @@ void kaneko16_sprite_device::kaneko16_draw_sprites_custom(_BitmapClass &dest_bmp /* Build a list of sprites to display & draw them */ template -void kaneko16_sprite_device::kaneko16_draw_sprites(running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes) +void kaneko16_sprite_device::kaneko16_draw_sprites(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes) { /* Sprites *must* be parsed from the first in RAM to the last, because of the multisprite feature. But they *must* be drawn @@ -367,7 +367,7 @@ void kaneko16_sprite_device::kaneko16_draw_sprites(running_machine &machine, _Bi { int flags; - flags = kaneko16_parse_sprite_type012(machine, i,s, spriteram16, spriteram16_bytes); + flags = kaneko16_parse_sprite_type012(i,s, spriteram16, spriteram16_bytes); if (flags == -1) // End of Sprites break; @@ -587,11 +587,11 @@ void kaneko16_sprite_device::kaneko16_copybitmap(bitmap_rgb32 &bitmap, const rec -void kaneko16_sprite_device::kaneko16_render_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes) { kaneko16_render_sprites_common(machine, bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } -void kaneko16_sprite_device::kaneko16_render_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes) { kaneko16_render_sprites_common(machine, bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } +void kaneko16_sprite_device::kaneko16_render_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes) { kaneko16_render_sprites_common(bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } +void kaneko16_sprite_device::kaneko16_render_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes) { kaneko16_render_sprites_common(bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } template -void kaneko16_sprite_device::kaneko16_render_sprites_common(running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes) +void kaneko16_sprite_device::kaneko16_render_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes) { /* Sprites last (rendered with pdrawgfx, so they can slip in between the layers) */ @@ -599,13 +599,13 @@ void kaneko16_sprite_device::kaneko16_render_sprites_common(running_machine &mac if(m_keep_sprites) { /* keep sprites on screen - used by mgcrystl when you get the first gem and it shows instructions */ - kaneko16_draw_sprites(machine,m_sprites_bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); + kaneko16_draw_sprites(m_sprites_bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); kaneko16_copybitmap(bitmap,cliprect); } else { m_sprites_bitmap.fill(0, cliprect); - kaneko16_draw_sprites(machine,bitmap,cliprect, priority_bitmap, spriteram16, spriteram16_bytes); + kaneko16_draw_sprites(bitmap,cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } } diff --git a/src/mame/video/kaneko_spr.h b/src/mame/video/kaneko_spr.h index 3614bcc5767..199136e1754 100644 --- a/src/mame/video/kaneko_spr.h +++ b/src/mame/video/kaneko_spr.h @@ -40,12 +40,12 @@ public: // (legacy) used in the bitmap clear functions virtual int get_sprite_type(void) =0; - void kaneko16_render_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes); - void kaneko16_render_sprites(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes); + void kaneko16_render_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes); + void kaneko16_render_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes); template - void kaneko16_render_sprites_common(running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes); + void kaneko16_render_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes); DECLARE_READ16_MEMBER(kaneko16_sprites_regs_r); @@ -83,7 +83,7 @@ private: template - void kaneko16_draw_sprites(running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes); + void kaneko16_draw_sprites(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT16* spriteram16, int spriteram16_bytes); template @@ -91,7 +91,7 @@ private: UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy, bitmap_ind8 &priority_bitmap, int priority); - int kaneko16_parse_sprite_type012(running_machine &machine, int i, struct tempsprite *s, UINT16* spriteram16, int spriteram16_bytes); + int kaneko16_parse_sprite_type012(int i, struct tempsprite *s, UINT16* spriteram16, int spriteram16_bytes); void kaneko16_copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); void kaneko16_copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/video/karnov.c b/src/mame/video/karnov.c index 93cb954693f..f14b29f995f 100644 --- a/src/mame/video/karnov.c +++ b/src/mame/video/karnov.c @@ -125,7 +125,7 @@ void karnov_state::draw_background( bitmap_ind16 &bitmap, const rectangle &clipr UINT32 karnov_state::screen_update_karnov(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { draw_background(bitmap, cliprect); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0x800, 0); + m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x800, 0); m_fix_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/madmotor.c b/src/mame/video/madmotor.c index 7d7b324cfb5..4ccddccbb80 100644 --- a/src/mame/video/madmotor.c +++ b/src/mame/video/madmotor.c @@ -28,7 +28,7 @@ UINT32 madmotor_state::screen_update_madmotor(screen_device &screen, bitmap_ind1 m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); return 0; } diff --git a/src/mame/video/midyunit.c b/src/mame/video/midyunit.c index b30ee421120..f1205326158 100644 --- a/src/mame/video/midyunit.c +++ b/src/mame/video/midyunit.c @@ -244,14 +244,13 @@ WRITE16_MEMBER(midyunit_state::midyunit_paletteram_w) * *************************************/ -static void dma_draw(running_machine &machine, UINT16 command) +void midyunit_state::dma_draw(UINT16 command) { - midyunit_state *state = machine.driver_data(); - struct dma_state_t &dma_state = state->m_dma_state; + struct dma_state_t &dma_state = m_dma_state; int dx = (command & 0x10) ? -1 : 1; int height = dma_state.height; int width = dma_state.width; - UINT8 *base = state->m_gfx_rom; + UINT8 *base = m_gfx_rom; UINT32 offset = dma_state.offset >> 3; UINT16 pal = dma_state.palette; UINT16 color = pal | dma_state.color; @@ -273,7 +272,7 @@ static void dma_draw(running_machine &machine, UINT16 command) offset += dma_state.rowbytes; /* determine destination pointer */ - dest = &state->m_local_videoram[ty * 512]; + dest = &m_local_videoram[ty * 512]; /* check for overruns if they are relevant */ if (o >= 0x06000000 && command < 0x0c) @@ -524,7 +523,7 @@ if (LOG_DMA) gfxoffset += 0x02000000; { dma_state.offset = gfxoffset - 0x02000000; - dma_draw(machine(), command); + dma_draw(command); } /* signal we're done */ diff --git a/src/mame/video/mystwarr.c b/src/mame/video/mystwarr.c index d3aaa3fa8b1..61c83448070 100644 --- a/src/mame/video/mystwarr.c +++ b/src/mame/video/mystwarr.c @@ -12,17 +12,16 @@ // create a decoding buffer to hold decodable tiles so that the ROM test will pass by // reading the original raw data -static void mystwarr_decode_tiles(running_machine &machine) +void mystwarr_state::decode_tiles() { - mystwarr_state *state = machine.driver_data(); - UINT8 *s = machine.root_device().memregion("gfx1")->base(); - int len = machine.root_device().memregion("gfx1")->bytes(); + UINT8 *s = memregion("gfx1")->base(); + int len = memregion("gfx1")->bytes(); UINT8 *pFinish = s+len-3; UINT8 *d, *decoded; - int gfxnum = state->m_k056832->get_gfx_num(); + int gfxnum = m_k056832->get_gfx_num(); - decoded = auto_alloc_array(machine, UINT8, len); + decoded = auto_alloc_array(machine(), UINT8, len); d = decoded; // now convert the data into a drawable format so we can decode it @@ -51,7 +50,7 @@ static void mystwarr_decode_tiles(running_machine &machine) d += 5; } - state->m_gfxdecode->gfx(gfxnum)->set_source(decoded); + m_gfxdecode->gfx(gfxnum)->set_source(decoded); } @@ -151,7 +150,7 @@ VIDEO_START_MEMBER(mystwarr_state, gaiapols) { m_gametype = 0; - mystwarr_decode_tiles(machine()); + decode_tiles(); konamigx_mixer_init(*m_screen, 0); @@ -184,7 +183,7 @@ VIDEO_START_MEMBER(mystwarr_state, dadandrn) { m_gametype = 1; - mystwarr_decode_tiles(machine()); + decode_tiles(); konamigx_mixer_init(*m_screen, 0); @@ -206,7 +205,7 @@ VIDEO_START_MEMBER(mystwarr_state, mystwarr) { m_gametype = 0; - mystwarr_decode_tiles(machine()); + decode_tiles(); konamigx_mixer_init(*m_screen, 0); @@ -222,7 +221,7 @@ VIDEO_START_MEMBER(mystwarr_state, metamrph) { m_gametype = 0; - mystwarr_decode_tiles(machine()); + decode_tiles(); konamigx_mixer_init(*m_screen, 0); @@ -237,7 +236,7 @@ VIDEO_START_MEMBER(mystwarr_state, viostorm) { m_gametype = 0; - mystwarr_decode_tiles(machine()); + decode_tiles(); konamigx_mixer_init(*m_screen, 0); @@ -251,7 +250,7 @@ VIDEO_START_MEMBER(mystwarr_state, martchmp) { m_gametype = 0; - mystwarr_decode_tiles(machine()); + decode_tiles(); konamigx_mixer_init(*m_screen, 0); diff --git a/src/mame/video/namcos86.c b/src/mame/video/namcos86.c index f22b7658e3f..a181895433f 100644 --- a/src/mame/video/namcos86.c +++ b/src/mame/video/namcos86.c @@ -333,20 +333,19 @@ static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rect } -static void set_scroll(running_machine &machine, int layer) +void namcos86_state::set_scroll(int layer) { - namcos86_state *state = machine.driver_data(); int scrollx,scrolly; - scrollx = state->m_xscroll[layer]; - scrolly = state->m_yscroll[layer]; - if (state->flip_screen()) + scrollx = m_xscroll[layer]; + scrolly = m_yscroll[layer]; + if (flip_screen()) { scrollx = -scrollx; scrolly = -scrolly; } - state->m_bg_tilemap[layer]->set_scrollx(0, scrollx); - state->m_bg_tilemap[layer]->set_scrolly(0, scrolly); + m_bg_tilemap[layer]->set_scrollx(0, scrollx); + m_bg_tilemap[layer]->set_scrolly(0, scrolly); } @@ -356,10 +355,10 @@ UINT32 namcos86_state::screen_update_namcos86(screen_device &screen, bitmap_ind1 /* flip screen is embedded in the sprite control registers */ flip_screen_set(m_spriteram[0x07f6] & 1); - set_scroll(machine(), 0); - set_scroll(machine(), 1); - set_scroll(machine(), 2); - set_scroll(machine(), 3); + set_scroll(0); + set_scroll(1); + set_scroll(2); + set_scroll(3); screen.priority().fill(0, cliprect); diff --git a/src/mame/video/stadhero.c b/src/mame/video/stadhero.c index c0ddc2aaf64..29b1ab68d69 100644 --- a/src/mame/video/stadhero.c +++ b/src/mame/video/stadhero.c @@ -26,7 +26,7 @@ UINT32 stadhero_state::screen_update_stadhero(screen_device &screen, bitmap_ind1 m_tilegen1->set_bppmultmask(0x8, 0x7); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram, 0x00, 0x00, 0x0f); m_pf1_tilemap->draw(screen, bitmap, cliprect, 0,0); return 0; } diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c index 7ffa4ed488b..02d9c77c44b 100644 --- a/src/mame/video/taitojc.c +++ b/src/mame/video/taitojc.c @@ -480,10 +480,9 @@ void taitojc_renderer::render_texture_scan(INT32 scanline, const extent_t &exten } } -void taitojc_renderer::render_polygons(running_machine &machine, UINT16 *polygon_fifo, int length) +void taitojc_renderer::render_polygons(UINT16 *polygon_fifo, int length) { -// taitojc_state *state = machine.driver_data(); - const rectangle visarea = machine.first_screen()->visible_area(); + const rectangle visarea = machine().first_screen()->visible_area(); vertex_t vert[4]; int i; int ptr; diff --git a/src/mame/video/thepit.c b/src/mame/video/thepit.c index ac3940ca594..2f5354ee250 100644 --- a/src/mame/video/thepit.c +++ b/src/mame/video/thepit.c @@ -226,38 +226,32 @@ READ8_MEMBER(thepit_state::thepit_input_port_0_r) * *************************************/ -static void draw_sprites(running_machine &machine, - bitmap_ind16 &bitmap, - const rectangle &cliprect, - int priority_to_draw) +void thepit_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_draw) { - thepit_state *state = machine.driver_data(); - int offs; - - for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4) + for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) { - if (((state->m_spriteram[offs + 2] & 0x08) >> 3) == priority_to_draw) + if (((m_spriteram[offs + 2] & 0x08) >> 3) == priority_to_draw) { UINT8 y, x, flipx, flipy; - if ((state->m_spriteram[offs + 0] == 0) || (state->m_spriteram[offs + 3] == 0)) + if ((m_spriteram[offs + 0] == 0) || (m_spriteram[offs + 3] == 0)) { continue; } - y = 240 - state->m_spriteram[offs]; - x = state->m_spriteram[offs + 3] + 1; + y = 240 - m_spriteram[offs]; + x = m_spriteram[offs + 3] + 1; - flipx = state->m_spriteram[offs + 1] & 0x40; - flipy = state->m_spriteram[offs + 1] & 0x80; + flipx = m_spriteram[offs + 1] & 0x40; + flipy = m_spriteram[offs + 1] & 0x80; - if (state->m_flip_screen_y) + if (m_flip_screen_y) { y = 240 - y; flipy = !flipy; } - if (state->m_flip_screen_x) + if (m_flip_screen_x) { x = 242 - x; flipx = !flipx; @@ -267,15 +261,15 @@ static void draw_sprites(running_machine &machine, if (offs < 16) y++; - state->m_gfxdecode->gfx(2 * state->m_graphics_bank + 1)->transpen(bitmap,cliprect, - state->m_spriteram[offs + 1] & 0x3f, - state->m_spriteram[offs + 2], + m_gfxdecode->gfx(2 * m_graphics_bank + 1)->transpen(bitmap,cliprect, + m_spriteram[offs + 1] & 0x3f, + m_spriteram[offs + 2], flipx, flipy, x, y, 0); - state->m_gfxdecode->gfx(2 * state->m_graphics_bank + 1)->transpen(bitmap,cliprect, - state->m_spriteram[offs + 1] & 0x3f, - state->m_spriteram[offs + 2], + m_gfxdecode->gfx(2 * m_graphics_bank + 1)->transpen(bitmap,cliprect, + m_spriteram[offs + 1] & 0x3f, + m_spriteram[offs + 2], flipx, flipy, x-256, y, 0); } @@ -307,13 +301,13 @@ UINT32 thepit_state::screen_update_thepit(screen_device &screen, bitmap_ind16 &b m_tilemap->draw(screen, bitmap, cliprect, 0, 0); /* low priority sprites */ - draw_sprites(machine(), bitmap, m_flip_screen_x ? spritevisibleareaflipx : spritevisiblearea, 0); + draw_sprites(bitmap, m_flip_screen_x ? spritevisibleareaflipx : spritevisiblearea, 0); /* high priority tiles */ m_solid_tilemap->draw(screen, bitmap, cliprect, 1, 1); /* high priority sprites */ - draw_sprites(machine(), bitmap, m_flip_screen_x ? spritevisibleareaflipx : spritevisiblearea, 1); + draw_sprites(bitmap, m_flip_screen_x ? spritevisibleareaflipx : spritevisiblearea, 1); return 0; } @@ -343,7 +337,7 @@ UINT32 thepit_state::screen_update_desertdan(screen_device &screen, bitmap_ind16 /* low priority sprites */ m_graphics_bank = 1; - draw_sprites(machine(), bitmap, m_flip_screen_y ? spritevisibleareaflipx : spritevisiblearea, 0); + draw_sprites(bitmap, m_flip_screen_y ? spritevisibleareaflipx : spritevisiblearea, 0); /* high priority tiles */ // not sure about this, draws a white block over the title logo sprite, looks like it should be behind? m_graphics_bank = 0; @@ -351,7 +345,7 @@ UINT32 thepit_state::screen_update_desertdan(screen_device &screen, bitmap_ind16 /* high priority sprites */ m_graphics_bank = 1; - draw_sprites(machine(), bitmap, m_flip_screen_y ? spritevisibleareaflipx : spritevisiblearea, 1); + draw_sprites(bitmap, m_flip_screen_y ? spritevisibleareaflipx : spritevisiblearea, 1); return 0; } diff --git a/src/mame/video/vaportra.c b/src/mame/video/vaportra.c index b25d30f3a1a..29c7256a0b2 100644 --- a/src/mame/video/vaportra.c +++ b/src/mame/video/vaportra.c @@ -64,32 +64,32 @@ UINT32 vaportra_state::screen_update_vaportra(screen_device &screen, bitmap_ind1 { m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f); m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); } else if (pri == 1) { m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f); m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); } else if (pri == 2) { m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f); m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); } else { m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0, m_priority[1], 0x0f); m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); } - m_spritegen->draw_sprites(machine(), bitmap, cliprect, m_spriteram->buffer(), 1, m_priority[1], 0x0f); + m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 1, m_priority[1], 0x0f); m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/vsystem_spr.c b/src/mame/video/vsystem_spr.c index d018d02ca23..ff208ad3e6c 100644 --- a/src/mame/video/vsystem_spr.c +++ b/src/mame/video/vsystem_spr.c @@ -221,7 +221,7 @@ void vsystem_spr_device::get_sprite_attributes(UINT16* ram) } -void vsystem_spr_device::common_sprite_drawgfx( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap) +void vsystem_spr_device::common_sprite_drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap) { gfx_element *gfx = m_gfxdecode->gfx(m_gfx_region); int priority_mask = 0x00; @@ -329,11 +329,11 @@ void vsystem_spr_device::draw_sprites( UINT16* spriteram, int spriteram_bytes, s if (prihack_mask != -1) { if ((curr_sprite.pri & prihack_mask) == prihack_val) - common_sprite_drawgfx(screen.machine(), bitmap, cliprect, screen.priority()); + common_sprite_drawgfx(bitmap, cliprect, screen.priority()); } else { - common_sprite_drawgfx(screen.machine(), bitmap, cliprect, screen.priority()); + common_sprite_drawgfx(bitmap, cliprect, screen.priority()); } } diff --git a/src/mame/video/vsystem_spr.h b/src/mame/video/vsystem_spr.h index 86121111ca1..d5bec5cca5f 100644 --- a/src/mame/video/vsystem_spr.h +++ b/src/mame/video/vsystem_spr.h @@ -64,7 +64,7 @@ public: } curr_sprite; void get_sprite_attributes(UINT16* ram); - void common_sprite_drawgfx(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); + void common_sprite_drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap); void draw_sprites( UINT16* spriteram, int spriteram_bytes, screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int prihack_mask = -1, int prihack_val = -1 ); void set_pal_base(int pal_base);