Removed running_machine parameter from various methods were it wasn't needed anymore (nw)

Moved some more functions into driver classes. (nw)
This commit is contained in:
Ivan Vangelista 2014-10-06 16:30:06 +00:00
parent 53e61f6171
commit 4568e59a27
38 changed files with 225 additions and 226 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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 );

View File

@ -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<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<okim6295_device> m_oki;
required_device<palette_device> m_palette;
optional_device<williams_narc_sound_device> m_narc_sound;
optional_device<williams_cvsd_sound_device> m_cvsd_sound;
optional_device<williams_adpcm_sound_device> m_adpcm_sound;
required_shared_ptr<UINT16> m_generic_paletteram_16;
optional_shared_ptr<UINT8> m_gfx_rom;
UINT16 *m_cmos_ram;
UINT32 m_cmos_page;
optional_shared_ptr<UINT8> 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<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<okim6295_device> m_oki;
required_device<palette_device> m_palette;
required_shared_ptr<UINT16> 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);
};

View File

@ -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();
};

View File

@ -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);
};

View File

@ -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;

View File

@ -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<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_colorram;
required_shared_ptr<UINT8> m_attributesram;
required_shared_ptr<UINT8> 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<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_draw);
};

View File

@ -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;

View File

@ -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<carpolo_state>();
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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -49,6 +49,7 @@ const device_type DECO_MXC06 = &device_creator<deco_mxc06_device>;
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;

View File

@ -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();

View File

@ -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;
}

View File

@ -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<harddriv_state>();
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);
}

View File

@ -245,7 +245,7 @@ void k056832_device::static_set_palette_tag(device_t &device, const char *tag)
downcast<k056832_device &>(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;

View File

@ -211,9 +211,9 @@ private:
template<class _BitmapClass>
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<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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<class _BitmapClass>
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<class _BitmapClass>
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);
}
}

View File

@ -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<class _BitmapClass>
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<class _BitmapClass>
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<class _BitmapClass>
@ -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);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<midyunit_state>();
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 */

View File

@ -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<mystwarr_state>();
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);

View File

@ -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<namcos86_state>();
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);

View File

@ -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;
}

View File

@ -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<taitojc_state>();
const rectangle visarea = machine.first_screen()->visible_area();
const rectangle visarea = machine().first_screen()->visible_area();
vertex_t vert[4];
int i;
int ptr;

View File

@ -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<thepit_state>();
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;
}

View File

@ -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;
}

View File

@ -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());
}
}

View File

@ -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);