small cleanups here and there (nw)

This commit is contained in:
Ivan Vangelista 2014-09-26 15:25:03 +00:00
parent d5cf855364
commit 1c45d62486
5 changed files with 26 additions and 31 deletions

View File

@ -52,18 +52,27 @@ public:
taito_f3_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_f3_ram(*this,"f3_ram") ,
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_oki(*this, "oki"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_f3_ram(*this,"f3_ram"),
m_paletteram32(*this, "paletteram") { }
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<okim6295_device> m_oki;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
optional_shared_ptr<UINT32> m_f3_ram;
optional_shared_ptr<UINT32> m_paletteram32;
UINT16 *m_videoram;
UINT16 *m_spriteram;
optional_shared_ptr<UINT32> m_f3_ram;
UINT16 *m_f3_vram;
UINT16 *m_f3_line_ram;
UINT16 *m_f3_pf_data;
@ -288,13 +297,6 @@ public:
UINT32 screen_update_f3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void screen_eof_f3(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(f3_interrupt2);
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<okim6295_device> m_oki;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
optional_shared_ptr<UINT32> m_paletteram32;
protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@ -304,4 +306,5 @@ private:
inline void f3_drawgfx(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,int code,int color,int flipx,int flipy,int sx,int sy,UINT8 pri_dst);
inline void f3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx,int code,int color,int flipx,int flipy,int sx,int sy,int scalex,int scaley,UINT8 pri_dst);
void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
void get_sprite_info(const UINT16 *spriteram16_ptr);
};

View File

@ -29,9 +29,6 @@ struct am2901
class vector_generator
{
public:
running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
void set_machine(running_machine &machine) { m_machine = &machine; }
UINT32 sreg; /* shift register */
UINT32 l1; /* latch 1 adder operand only */
UINT32 l2; /* latch 2 adder operand only */
@ -52,7 +49,6 @@ public:
UINT32 ven; /* vector intensity enable */
private:
running_machine *m_machine;
};
struct microcode

View File

@ -271,8 +271,6 @@ struct tempsprite
int pri;
};
static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_ptr);
struct f3_playfield_line_inf
{
int alpha_mode[256];
@ -511,7 +509,7 @@ void taito_f3_state::screen_eof_f3(screen_device &screen, bool state)
{
if (machine().video().skip_this_frame() == 0)
{
get_sprite_info(machine(), m_spriteram16_buffered);
get_sprite_info(m_spriteram16_buffered);
}
memcpy(m_spriteram16_buffered,m_spriteram,0x10000);
}
@ -519,7 +517,7 @@ void taito_f3_state::screen_eof_f3(screen_device &screen, bool state)
{
if (machine().video().skip_this_frame() == 0)
{
get_sprite_info(machine(), m_spriteram);
get_sprite_info(m_spriteram);
}
}
}
@ -2832,10 +2830,9 @@ inline void taito_f3_state::f3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangl
/*zoom##p = p##_addition << 12;*/ \
}
static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_ptr)
void taito_f3_state::get_sprite_info(const UINT16 *spriteram16_ptr)
{
taito_f3_state *state = machine.driver_data<taito_f3_state>();
const rectangle &visarea = machine.first_screen()->visible_area();
const rectangle &visarea = m_screen->visible_area();
const int min_x=visarea.min_x,max_x=visarea.max_x;
const int min_y=visarea.min_y,max_y=visarea.max_y;
int offs,spritecont,flipx,flipy,/*old_x,*/color,x,y;
@ -2849,7 +2846,7 @@ static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_
int x_addition_left = 8, y_addition_left = 8;
struct tempsprite *sprite_ptr = state->m_spritelist;
struct tempsprite *sprite_ptr = m_spritelist;
int total_sprites=0;
@ -2876,15 +2873,15 @@ static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_
/* Check if special command bit is set */
if (spriteram16_ptr[current_offs+2+1] & 0x8000) {
UINT32 cntrl=(spriteram16_ptr[current_offs+4+1])&0xffff;
state->m_flipscreen=cntrl&0x2000;
m_flipscreen=cntrl&0x2000;
/* cntrl&0x1000 = disabled? (From F2 driver, doesn't seem used anywhere)
cntrl&0x0010 = ???
cntrl&0x0020 = ???
*/
state->m_sprite_extra_planes = (cntrl & 0x0300) >> 8; // 0 = 4bpp, 1 = 5bpp, 2 = unused?, 3 = 6bpp
state->m_sprite_pen_mask = (state->m_sprite_extra_planes << 4) | 0x0f;
m_sprite_extra_planes = (cntrl & 0x0300) >> 8; // 0 = 4bpp, 1 = 5bpp, 2 = unused?, 3 = 6bpp
m_sprite_pen_mask = (m_sprite_extra_planes << 4) | 0x0f;
/* Sprite bank select */
if (cntrl&1) {
@ -2925,7 +2922,7 @@ static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_
/* These games either don't set the XY control bits properly (68020 bug?), or
have some different mode from the others */
#ifdef DARIUSG_KLUDGE
if (state->m_f3_game==DARIUSG || state->m_f3_game==GEKIRIDO || state->m_f3_game==CLEOPATR || state->m_f3_game==RECALH)
if (m_f3_game==DARIUSG || m_f3_game==GEKIRIDO || m_f3_game==CLEOPATR || m_f3_game==RECALH)
multi=spritecont&0xf0;
#endif
@ -2936,7 +2933,7 @@ static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_
else color=(spriteram16_ptr[current_offs+4+0])&0xff;
#ifdef DARIUSG_KLUDGE
if (state->m_f3_game==DARIUSG || state->m_f3_game==GEKIRIDO || state->m_f3_game==CLEOPATR || state->m_f3_game==RECALH) {
if (m_f3_game==DARIUSG || m_f3_game==GEKIRIDO || m_f3_game==CLEOPATR || m_f3_game==RECALH) {
/* Adjust X Position */
if ((spritecont & 0x40) == 0) {
if (spritecont & 0x4) {
@ -3064,7 +3061,7 @@ static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_
if (!sprite) continue;
if (!x_addition || !y_addition) continue;
if (state->m_flipscreen)
if (m_flipscreen)
{
int tx,ty;
@ -3095,7 +3092,7 @@ static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_
sprite_ptr++;
total_sprites++;
}
state->m_sprite_end = sprite_ptr;
m_sprite_end = sprite_ptr;
}
#undef CALC_ZOOM
@ -3183,7 +3180,7 @@ UINT32 taito_f3_state::screen_update_f3(screen_device &screen, bitmap_rgb32 &bit
/* sprites */
if (m_sprite_lag==0)
get_sprite_info(machine(), m_spriteram);
get_sprite_info(m_spriteram);
/* Update sprite buffer */
draw_sprites(bitmap,cliprect);

View File

@ -183,7 +183,6 @@ void vertigo_state::vertigo_vproc_reset()
memset(&m_vs, 0, sizeof(m_vs));
memset(&m_bsp, 0, sizeof(m_bsp));
memset(&m_vgen, 0, sizeof(m_vgen));
m_vgen.set_machine(machine());
}

View File

@ -789,7 +789,7 @@ void wecleman_state::hotchase_draw_road(bitmap_ind16 &bitmap, const rectangle &c
#define YSIZE 512
int sx, sy;
const rectangle &visarea = machine().first_screen()->visible_area();
const rectangle &visarea = m_screen->visible_area();
/* Let's draw from the top to the bottom of the visible screen */
for (sy = visarea.min_y;sy <= visarea.max_y;sy++)