mirror of
https://github.com/holub/mame
synced 2025-06-06 21:03:47 +03:00
taito_f2.cpp : Updates (#5019)
* taito_f2.cpp : Updates Simplify handlers, Simplify gfxdecodes, Reduce register_postload, duplicates, Runtime tag lookups, Unnecessary lines, Fix bankswitching behaviors, Fix spacings, Namings, Use shorter / Correct type values, Add notes * taito_f2.cpp : Remove unused
This commit is contained in:
parent
7bf4459620
commit
d463c7dbe7
File diff suppressed because it is too large
Load Diff
@ -30,9 +30,7 @@ public:
|
||||
, m_cchip(*this, "cchip")
|
||||
, m_cchip_irq_clear(*this, "cchip_irq_clear")
|
||||
, m_oki(*this, "oki")
|
||||
, m_tc0100scn(*this, "tc0100scn")
|
||||
, m_tc0100scn_1(*this, "tc0100scn_1")
|
||||
, m_tc0100scn_2(*this, "tc0100scn_2")
|
||||
, m_tc0100scn(*this, "tc0100scn_%u", 1U)
|
||||
, m_tc0110pcr(*this, "tc0110pcr")
|
||||
, m_tc0360pri(*this, "tc0360pri")
|
||||
, m_tc0280grd(*this, "tc0280grd")
|
||||
@ -43,6 +41,12 @@ public:
|
||||
, m_gfxdecode(*this, "gfxdecode")
|
||||
, m_screen(*this, "screen")
|
||||
, m_palette(*this, "palette")
|
||||
, m_io_paddle(*this, "PADDLE%u", 1U)
|
||||
, m_io_in(*this, "IN%u", 0U)
|
||||
, m_io_dswa(*this, "DSWA")
|
||||
, m_io_dswb(*this, "DSWB")
|
||||
, m_audiobank(*this, "audiobank")
|
||||
, m_okibank(*this, "okibank")
|
||||
{ }
|
||||
|
||||
|
||||
@ -91,67 +95,69 @@ public:
|
||||
void init_finalb();
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
enum
|
||||
{
|
||||
TIMER_TAITOF2_INTERRUPT6
|
||||
TIMER_INTERRUPT6
|
||||
};
|
||||
|
||||
struct f2_tempsprite
|
||||
{
|
||||
int code, color;
|
||||
int flipx, flipy;
|
||||
u32 code, color;
|
||||
bool flipx, flipy;
|
||||
int x, y;
|
||||
int zoomx, zoomy;
|
||||
int primask;
|
||||
u32 primask;
|
||||
};
|
||||
/* memory pointers */
|
||||
optional_shared_ptr<uint16_t> m_sprite_extension;
|
||||
required_shared_ptr<uint16_t> m_spriteram;
|
||||
std::unique_ptr<uint16_t[]> m_spriteram_buffered;
|
||||
std::unique_ptr<uint16_t[]> m_spriteram_delayed;
|
||||
optional_shared_ptr<u16> m_sprite_extension;
|
||||
required_shared_ptr<u16> m_spriteram;
|
||||
std::unique_ptr<u16[]> m_spriteram_buffered;
|
||||
std::unique_ptr<u16[]> m_spriteram_delayed;
|
||||
|
||||
/* video-related */
|
||||
std::unique_ptr<struct f2_tempsprite[]> m_spritelist;
|
||||
int m_sprite_type;
|
||||
int m_sprite_type;
|
||||
|
||||
uint16_t m_spritebank[8];
|
||||
// uint16_t m_spritebank_eof[8];
|
||||
uint16_t m_spritebank_buffered[8];
|
||||
u16 m_spritebank[8];
|
||||
// u16 m_spritebank_eof[8];
|
||||
u16 m_spritebank_buffered[8];
|
||||
|
||||
int32_t m_sprites_disabled;
|
||||
int32_t m_sprites_active_area;
|
||||
int32_t m_sprites_master_scrollx;
|
||||
int32_t m_sprites_master_scrolly;
|
||||
bool m_sprites_disabled;
|
||||
s32 m_sprites_active_area;
|
||||
s32 m_sprites_master_scrollx;
|
||||
s32 m_sprites_master_scrolly;
|
||||
/* remember flip status over frames because driftout can fail to set it */
|
||||
int32_t m_sprites_flipscreen;
|
||||
bool m_sprites_flipscreen;
|
||||
|
||||
/* On the left hand screen edge (assuming horiz screen, no
|
||||
screenflip: in screenflip it is the right hand edge etc.)
|
||||
there may be 0-3 unwanted pixels in both tilemaps *and*
|
||||
sprites. To erase this we use f2_hide_pixels (0 to +3). */
|
||||
|
||||
int32_t m_hide_pixels;
|
||||
int32_t m_flip_hide_pixels; /* Different in some games */
|
||||
s32 m_hide_pixels;
|
||||
s32 m_flip_hide_pixels; /* Different in some games */
|
||||
|
||||
int32_t m_pivot_xdisp; /* Needed in games with a pivot layer */
|
||||
int32_t m_pivot_ydisp;
|
||||
s32 m_pivot_xdisp; /* Needed in games with a pivot layer */
|
||||
s32 m_pivot_ydisp;
|
||||
|
||||
int32_t m_game;
|
||||
s32 m_game;
|
||||
|
||||
uint8_t m_tilepri[6]; // todo - move into taitoic.c
|
||||
uint8_t m_spritepri[6]; // todo - move into taitoic.c
|
||||
uint8_t m_spriteblendmode; // todo - move into taitoic.c
|
||||
u8 m_tilepri[6]; // todo - move into taitoic.c
|
||||
u8 m_spritepri[6]; // todo - move into taitoic.c
|
||||
u8 m_spriteblendmode; // todo - move into taitoic.c
|
||||
|
||||
int m_prepare_sprites;
|
||||
uint8_t m_gfxbank;
|
||||
int m_prepare_sprites;
|
||||
u8 m_gfxbank;
|
||||
|
||||
/* misc */
|
||||
int32_t m_mjnquest_input;
|
||||
int m_last[2];
|
||||
int m_nibble;
|
||||
int32_t m_driveout_sound_latch;
|
||||
int32_t m_oki_bank;
|
||||
emu_timer *m_int6_timer;
|
||||
s32 m_mjnquest_input;
|
||||
int m_last[2];
|
||||
int m_nibble;
|
||||
s32 m_driveout_sound_latch;
|
||||
emu_timer *m_int6_timer;
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
@ -159,9 +165,7 @@ protected:
|
||||
optional_device<taito_cchip_device> m_cchip;
|
||||
optional_device<timer_device> m_cchip_irq_clear;
|
||||
optional_device<okim6295_device> m_oki;
|
||||
optional_device<tc0100scn_device> m_tc0100scn;
|
||||
optional_device<tc0100scn_device> m_tc0100scn_1;
|
||||
optional_device<tc0100scn_device> m_tc0100scn_2;
|
||||
optional_device_array<tc0100scn_device, 2> m_tc0100scn;
|
||||
optional_device<tc0110pcr_device> m_tc0110pcr;
|
||||
optional_device<tc0360pri_device> m_tc0360pri;
|
||||
optional_device<tc0280grd_device> m_tc0280grd;
|
||||
@ -173,75 +177,79 @@ protected:
|
||||
required_device<screen_device> m_screen;
|
||||
optional_device<palette_device> m_palette;
|
||||
|
||||
DECLARE_WRITE8_MEMBER(coin_nibble_w);
|
||||
DECLARE_WRITE16_MEMBER(growl_coin_word_w);
|
||||
DECLARE_WRITE8_MEMBER(taitof2_4p_coin_word_w);
|
||||
DECLARE_READ16_MEMBER(cameltry_paddle_r);
|
||||
DECLARE_READ16_MEMBER(mjnquest_dsw_r);
|
||||
DECLARE_READ16_MEMBER(mjnquest_input_r);
|
||||
DECLARE_WRITE16_MEMBER(mjnquest_inputselect_w);
|
||||
DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
|
||||
DECLARE_READ8_MEMBER(driveout_sound_command_r);
|
||||
DECLARE_WRITE8_MEMBER(oki_bank_w);
|
||||
DECLARE_WRITE16_MEMBER(driveout_sound_command_w);
|
||||
DECLARE_WRITE16_MEMBER(taitof2_sprite_extension_w);
|
||||
DECLARE_WRITE16_MEMBER(taitof2_spritebank_w);
|
||||
DECLARE_WRITE16_MEMBER(koshien_spritebank_w);
|
||||
optional_ioport_array<2> m_io_paddle;
|
||||
optional_ioport_array<7> m_io_in;
|
||||
optional_ioport m_io_dswa;
|
||||
optional_ioport m_io_dswb;
|
||||
|
||||
optional_memory_bank m_audiobank;
|
||||
optional_memory_bank m_okibank;
|
||||
|
||||
void coin_nibble_w(u8 data);
|
||||
void growl_coin_word_w(u8 data);
|
||||
void _4p_coin_word_w(u8 data);
|
||||
u16 cameltry_paddle_r(offs_t offset);
|
||||
u16 mjnquest_dsw_r(offs_t offset);
|
||||
u16 mjnquest_input_r();
|
||||
void mjnquest_inputselect_w(u16 data);
|
||||
void sound_bankswitch_w(u8 data);
|
||||
u8 driveout_sound_command_r();
|
||||
void oki_bank_w(u8 data);
|
||||
void driveout_sound_command_w(offs_t offset, u8 data);
|
||||
void sprite_extension_w(offs_t offset, u16 data, u16 mem_mask = ~0);
|
||||
void spritebank_w(offs_t offset, u16 data);
|
||||
void koshien_spritebank_w(u16 data);
|
||||
DECLARE_WRITE8_MEMBER(cameltrya_porta_w);
|
||||
void mjnquest_gfxbank_w(u8 data);
|
||||
TC0100SCN_CB_MEMBER(mjnquest_tmap_cb);
|
||||
|
||||
DECLARE_MACHINE_START(f2);
|
||||
DECLARE_VIDEO_START(taitof2_default);
|
||||
DECLARE_MACHINE_START(common);
|
||||
DECLARE_VIDEO_START(taitof2_dondokod);
|
||||
DECLARE_VIDEO_START(taitof2_driftout);
|
||||
DECLARE_VIDEO_START(taitof2_finalb);
|
||||
DECLARE_VIDEO_START(taitof2_megab);
|
||||
DECLARE_VIDEO_START(taitof2_thundfox);
|
||||
DECLARE_VIDEO_START(taitof2_ssi);
|
||||
DECLARE_VIDEO_START(taitof2_gunfront);
|
||||
DECLARE_VIDEO_START(taitof2_growl);
|
||||
DECLARE_VIDEO_START(taitof2_mjnquest);
|
||||
DECLARE_VIDEO_START(taitof2_footchmp);
|
||||
DECLARE_VIDEO_START(taitof2_hthero);
|
||||
DECLARE_VIDEO_START(taitof2_koshien);
|
||||
DECLARE_VIDEO_START(taitof2_yuyugogo);
|
||||
DECLARE_VIDEO_START(taitof2_ninjak);
|
||||
DECLARE_VIDEO_START(taitof2_solfigtr);
|
||||
DECLARE_VIDEO_START(taitof2_pulirula);
|
||||
DECLARE_VIDEO_START(taitof2_metalb);
|
||||
DECLARE_VIDEO_START(taitof2_qzchikyu);
|
||||
DECLARE_VIDEO_START(taitof2_yesnoj);
|
||||
DECLARE_VIDEO_START(taitof2_deadconx);
|
||||
DECLARE_VIDEO_START(taitof2_deadconxj);
|
||||
DECLARE_VIDEO_START(taitof2_dinorex);
|
||||
DECLARE_VIDEO_START(taitof2_quiz);
|
||||
uint32_t screen_update_taitof2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_taitof2_pri_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_taitof2_pri(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_taitof2_thundfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_taitof2_ssi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_taitof2_deadconx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_taitof2_yesnoj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_taitof2_metalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_VIDEO_START(dondokod);
|
||||
DECLARE_VIDEO_START(driftout);
|
||||
DECLARE_VIDEO_START(finalb);
|
||||
DECLARE_VIDEO_START(megab);
|
||||
DECLARE_VIDEO_START(thundfox);
|
||||
DECLARE_VIDEO_START(ssi);
|
||||
DECLARE_VIDEO_START(gunfront);
|
||||
DECLARE_VIDEO_START(growl);
|
||||
DECLARE_VIDEO_START(mjnquest);
|
||||
DECLARE_VIDEO_START(footchmp);
|
||||
DECLARE_VIDEO_START(hthero);
|
||||
DECLARE_VIDEO_START(koshien);
|
||||
DECLARE_VIDEO_START(yuyugogo);
|
||||
DECLARE_VIDEO_START(ninjak);
|
||||
DECLARE_VIDEO_START(solfigtr);
|
||||
DECLARE_VIDEO_START(pulirula);
|
||||
DECLARE_VIDEO_START(metalb);
|
||||
DECLARE_VIDEO_START(qzchikyu);
|
||||
DECLARE_VIDEO_START(yesnoj);
|
||||
DECLARE_VIDEO_START(deadconx);
|
||||
DECLARE_VIDEO_START(deadconxj);
|
||||
DECLARE_VIDEO_START(dinorex);
|
||||
DECLARE_VIDEO_START(quiz);
|
||||
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u32 screen_update_pri_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u32 screen_update_pri(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u32 screen_update_thundfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u32 screen_update_ssi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u32 screen_update_deadconx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u32 screen_update_yesnoj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
u32 screen_update_metalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank_no_buffer);
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank_partial_buffer_delayed);
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank_partial_buffer_delayed_thundfox);
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank_full_buffer_delayed);
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank_partial_buffer_delayed_qzchikyu);
|
||||
INTERRUPT_GEN_MEMBER(taitof2_interrupt);
|
||||
INTERRUPT_GEN_MEMBER(interrupt);
|
||||
INTERRUPT_GEN_MEMBER(megab_interrupt);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(cchip_irq_clear_cb);
|
||||
void reset_driveout_sound_region();
|
||||
void taitof2_core_vh_start (int sprite_type, int hide, int flip_hide );
|
||||
void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int *primasks, int uses_tc360_mixer );
|
||||
void update_spritebanks( );
|
||||
void taitof2_handle_sprite_buffering( );
|
||||
void taitof2_update_sprites_active_area( );
|
||||
void draw_roz_layer( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint32_t priority);
|
||||
void core_vh_start(int sprite_type, int hide, int flip_hide);
|
||||
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u32 *primasks, int uses_tc360_mixer);
|
||||
void update_spritebanks();
|
||||
void handle_sprite_buffering();
|
||||
void update_sprites_active_area();
|
||||
void draw_roz_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u32 priority);
|
||||
void taito_f2_tc360_spritemixdraw(screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx,
|
||||
uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley );
|
||||
u32 code, u32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley);
|
||||
|
||||
void cameltry_map(address_map &map);
|
||||
void cameltrya_map(address_map &map);
|
||||
@ -251,6 +259,7 @@ protected:
|
||||
void dondokod_map(address_map &map);
|
||||
void driftout_map(address_map &map);
|
||||
void driveout_map(address_map &map);
|
||||
void driveout_oki_map(address_map &map);
|
||||
void driveout_sound_map(address_map &map);
|
||||
void finalb_map(address_map &map);
|
||||
void footchmp_map(address_map &map);
|
||||
|
@ -38,30 +38,29 @@ void taitof2_state::mjnquest_gfxbank_w(u8 data)
|
||||
if ((data ^ m_gfxbank) & 1)
|
||||
{
|
||||
m_gfxbank = data & 1;
|
||||
m_tc0100scn->tilemap_set_dirty();
|
||||
m_tc0100scn[0]->tilemap_set_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
void taitof2_state::taitof2_core_vh_start (int sprite_type, int hide, int flip_hide )
|
||||
void taitof2_state::core_vh_start(int sprite_type, int hide, int flip_hide)
|
||||
{
|
||||
int i;
|
||||
m_sprite_type = sprite_type;
|
||||
m_hide_pixels = hide;
|
||||
m_flip_hide_pixels = flip_hide;
|
||||
|
||||
m_spriteram_delayed = make_unique_clear<uint16_t[]>(m_spriteram.bytes() / 2);
|
||||
m_spriteram_buffered = make_unique_clear<uint16_t[]>(m_spriteram.bytes() / 2);
|
||||
m_spriteram_delayed = make_unique_clear<u16[]>(m_spriteram.bytes() / 2);
|
||||
m_spriteram_buffered = make_unique_clear<u16[]>(m_spriteram.bytes() / 2);
|
||||
m_spritelist = make_unique_clear<struct f2_tempsprite[]>(0x400);
|
||||
|
||||
for (i = 0; i < 8; i ++)
|
||||
for (int i = 0; i < 8; i ++)
|
||||
{
|
||||
m_spritebank_buffered[i] = 0x400 * i;
|
||||
m_spritebank[i] = m_spritebank_buffered[i];
|
||||
}
|
||||
|
||||
m_sprites_disabled = 1;
|
||||
m_sprites_disabled = true;
|
||||
m_sprites_active_area = 0;
|
||||
m_sprites_flipscreen = 0;
|
||||
m_sprites_flipscreen = false;
|
||||
|
||||
m_sprites_master_scrollx = 0;
|
||||
m_sprites_master_scrolly = 0;
|
||||
@ -87,137 +86,137 @@ void taitof2_state::taitof2_core_vh_start (int sprite_type, int hide, int flip_h
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
/* ( spritetype, hide, hideflip, xoffs, yoffs, flipx, flipy, textflipx, textflipy) */
|
||||
/* (spritetype, hide, hideflip, xoffs, yoffs, flipx, flipy, textflipx, textflipy) */
|
||||
/**************************************************************************************/
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_default)
|
||||
void taitof2_state::video_start()
|
||||
{
|
||||
taitof2_core_vh_start(0, 0, 0);
|
||||
core_vh_start(0, 0, 0);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_megab)/* Megab, Liquidk */
|
||||
VIDEO_START_MEMBER(taitof2_state,megab)/* Megab, Liquidk */
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_quiz)/* Quiz Crayons, Quiz Jinsei */
|
||||
VIDEO_START_MEMBER(taitof2_state,quiz)/* Quiz Crayons, Quiz Jinsei */
|
||||
{
|
||||
taitof2_core_vh_start(3, 3, 3);
|
||||
core_vh_start(3, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_finalb)
|
||||
VIDEO_START_MEMBER(taitof2_state,finalb)
|
||||
{
|
||||
taitof2_core_vh_start(0, 1, 1);
|
||||
core_vh_start(0, 1, 1);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_ssi)
|
||||
VIDEO_START_MEMBER(taitof2_state,ssi)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_growl)
|
||||
VIDEO_START_MEMBER(taitof2_state,growl)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_ninjak)
|
||||
VIDEO_START_MEMBER(taitof2_state,ninjak)
|
||||
{
|
||||
taitof2_core_vh_start(0, 0, 0);
|
||||
core_vh_start(0, 0, 0);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_qzchikyu)
|
||||
VIDEO_START_MEMBER(taitof2_state,qzchikyu)
|
||||
{
|
||||
taitof2_core_vh_start(0, 0, 4);
|
||||
core_vh_start(0, 0, 4);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_solfigtr)
|
||||
VIDEO_START_MEMBER(taitof2_state,solfigtr)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, -3);
|
||||
core_vh_start(0, 3, -3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_koshien)
|
||||
VIDEO_START_MEMBER(taitof2_state,koshien)
|
||||
{
|
||||
taitof2_core_vh_start(0, 1, - 1);
|
||||
core_vh_start(0, 1, - 1);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_gunfront)
|
||||
VIDEO_START_MEMBER(taitof2_state,gunfront)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_thundfox)
|
||||
VIDEO_START_MEMBER(taitof2_state,thundfox)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, -3);
|
||||
core_vh_start(0, 3, -3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_mjnquest)
|
||||
VIDEO_START_MEMBER(taitof2_state,mjnquest)
|
||||
{
|
||||
taitof2_core_vh_start(0, 0, 0);
|
||||
core_vh_start(0, 0, 0);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_footchmp)
|
||||
VIDEO_START_MEMBER(taitof2_state,footchmp)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
|
||||
m_game = FOOTCHMP;
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_hthero)
|
||||
VIDEO_START_MEMBER(taitof2_state,hthero)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
|
||||
m_game = FOOTCHMP;
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_deadconx)
|
||||
VIDEO_START_MEMBER(taitof2_state,deadconx)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_deadconxj)
|
||||
VIDEO_START_MEMBER(taitof2_state,deadconxj)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_metalb)
|
||||
VIDEO_START_MEMBER(taitof2_state,metalb)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_yuyugogo)
|
||||
VIDEO_START_MEMBER(taitof2_state,yuyugogo)
|
||||
{
|
||||
taitof2_core_vh_start(1, 3, 3);
|
||||
core_vh_start(1, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_yesnoj)
|
||||
VIDEO_START_MEMBER(taitof2_state,yesnoj)
|
||||
{
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_dinorex)
|
||||
VIDEO_START_MEMBER(taitof2_state,dinorex)
|
||||
{
|
||||
taitof2_core_vh_start(3, 3, 3);
|
||||
core_vh_start(3, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_dondokod)/* dondokod, cameltry */
|
||||
VIDEO_START_MEMBER(taitof2_state,dondokod)/* dondokod, cameltry */
|
||||
{
|
||||
m_pivot_xdisp = -16;
|
||||
m_pivot_ydisp = 0;
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_pulirula)
|
||||
VIDEO_START_MEMBER(taitof2_state,pulirula)
|
||||
{
|
||||
m_pivot_xdisp = -10; /* alignment seems correct (see level 2, falling */
|
||||
m_pivot_ydisp = 16; /* block of ice after armour man) */
|
||||
taitof2_core_vh_start(2, 3, 3);
|
||||
core_vh_start(2, 3, 3);
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(taitof2_state,taitof2_driftout)
|
||||
VIDEO_START_MEMBER(taitof2_state,driftout)
|
||||
{
|
||||
m_pivot_xdisp = -16;
|
||||
m_pivot_ydisp = 16;
|
||||
taitof2_core_vh_start(0, 3, 3);
|
||||
core_vh_start(0, 3, 3);
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
@ -230,7 +229,7 @@ might be for Footchmp. That seems to be the only game
|
||||
altering spritebanks of sprites while they're on screen.
|
||||
********************************************************/
|
||||
|
||||
WRITE16_MEMBER(taitof2_state::taitof2_sprite_extension_w)
|
||||
void taitof2_state::sprite_extension_w(offs_t offset, u16 data, u16 mem_mask)
|
||||
{
|
||||
/* areas above 0x1000 cleared in some games, but not used */
|
||||
|
||||
@ -241,7 +240,7 @@ WRITE16_MEMBER(taitof2_state::taitof2_sprite_extension_w)
|
||||
}
|
||||
|
||||
|
||||
WRITE16_MEMBER(taitof2_state::taitof2_spritebank_w)
|
||||
void taitof2_state::spritebank_w(offs_t offset, u16 data)
|
||||
{
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
@ -270,7 +269,7 @@ WRITE16_MEMBER(taitof2_state::taitof2_spritebank_w)
|
||||
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(taitof2_state::koshien_spritebank_w)
|
||||
void taitof2_state::koshien_spritebank_w(u16 data)
|
||||
{
|
||||
m_spritebank_buffered[0] = 0x0000; /* never changes */
|
||||
m_spritebank_buffered[1] = 0x0400;
|
||||
@ -283,14 +282,14 @@ WRITE16_MEMBER(taitof2_state::koshien_spritebank_w)
|
||||
m_spritebank_buffered[7] = m_spritebank_buffered[6] + 0x400;
|
||||
}
|
||||
|
||||
void taitof2_state::taito_f2_tc360_spritemixdraw( screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx,
|
||||
uint32_t code, uint32_t color, int flipx, int flipy, int sx, int sy, int scalex, int scaley )
|
||||
void taitof2_state::taito_f2_tc360_spritemixdraw(screen_device &screen, bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx,
|
||||
u32 code, u32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley)
|
||||
{
|
||||
int pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors());
|
||||
const uint8_t *source_base = gfx->get_data(code % gfx->elements());
|
||||
const u16 pal_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors());
|
||||
const u8 *source_base = gfx->get_data(code % gfx->elements());
|
||||
bitmap_ind8 &priority_bitmap = screen.priority();
|
||||
int sprite_screen_height = (scaley * gfx->height() + 0x8000) >> 16;
|
||||
int sprite_screen_width = (scalex * gfx->width() + 0x8000) >> 16;
|
||||
const int sprite_screen_height = (scaley * gfx->height() + 0x8000) >> 16;
|
||||
const int sprite_screen_width = (scalex * gfx->width() + 0x8000) >> 16;
|
||||
|
||||
if (!scalex || !scaley)
|
||||
return;
|
||||
@ -342,33 +341,31 @@ void taitof2_state::taito_f2_tc360_spritemixdraw( screen_device &screen, bitmap_
|
||||
/* NS 980211 - fixed incorrect clipping */
|
||||
if (ex > clip.max_x + 1)
|
||||
{ /* clip right */
|
||||
int pixels = ex-clip.max_x - 1;
|
||||
int pixels = ex - clip.max_x - 1;
|
||||
ex -= pixels;
|
||||
}
|
||||
if (ey > clip.max_y + 1)
|
||||
{ /* clip bottom */
|
||||
int pixels = ey-clip.max_y - 1;
|
||||
int pixels = ey - clip.max_y - 1;
|
||||
ey -= pixels;
|
||||
}
|
||||
|
||||
if (ex > sx)
|
||||
{
|
||||
/* skip if inner loop doesn't draw anything */
|
||||
int y;
|
||||
|
||||
for (y = sy; y < ey; y++)
|
||||
for (int y = sy; y < ey; y++)
|
||||
{
|
||||
const uint8_t *source = source_base + (y_index >> 16) * gfx->rowbytes();
|
||||
uint16_t *dest = &dest_bmp.pix16(y);
|
||||
uint8_t *pri = &priority_bitmap.pix8(y);
|
||||
const u8 *source = source_base + (y_index >> 16) * gfx->rowbytes();
|
||||
u16 *dest = &dest_bmp.pix16(y);
|
||||
u8 *pri = &priority_bitmap.pix8(y);
|
||||
|
||||
int x, x_index = x_index_base;
|
||||
for (x = sx; x < ex; x++)
|
||||
int x_index = x_index_base;
|
||||
for (int x = sx; x < ex; x++)
|
||||
{
|
||||
int c = source[x_index >> 16];
|
||||
const u8 c = source[x_index >> 16];
|
||||
if (c && (pri[x] & 0x80) == 0)
|
||||
{
|
||||
uint8_t tilemap_priority = 0, sprite_priority = 0;
|
||||
u8 tilemap_priority = 0, sprite_priority = 0;
|
||||
|
||||
// Get tilemap priority (0 - 0xf) for this destination pixel
|
||||
if (pri[x] & 0x10) tilemap_priority = m_tilepri[4];
|
||||
@ -418,17 +415,15 @@ void taitof2_state::taito_f2_tc360_spritemixdraw( screen_device &screen, bitmap_
|
||||
}
|
||||
pri[x] |= 0x80;
|
||||
}
|
||||
|
||||
x_index += dx;
|
||||
}
|
||||
|
||||
y_index += dy;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void taitof2_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int *primasks, int uses_tc360_mixer )
|
||||
void taitof2_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u32 *primasks, int uses_tc360_mixer)
|
||||
{
|
||||
/*
|
||||
Sprite format:
|
||||
@ -487,15 +482,10 @@ void taitof2_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, c
|
||||
non zoom parts.
|
||||
|
||||
*/
|
||||
int i, x, y, off, extoffs;
|
||||
int code, color, spritedata, spritecont, flipx, flipy;
|
||||
int xcurrent, ycurrent, big_sprite = 0;
|
||||
int big_sprite = 0;
|
||||
int y_no = 0, x_no = 0, xlatch = 0, ylatch = 0, last_continuation_tile = 0; /* for zooms */
|
||||
uint32_t zoomword, zoomx, zoomy, zx = 0, zy = 0, zoomxlatch = 0, zoomylatch = 0; /* for zooms */
|
||||
int scroll1x, scroll1y;
|
||||
u32 zoomword, zoomx, zoomy, zx = 0, zy = 0, zoomxlatch = 0, zoomylatch = 0; /* for zooms */
|
||||
int scrollx = 0, scrolly = 0;
|
||||
int curx, cury;
|
||||
int f2_x_offset;
|
||||
|
||||
/* pdrawgfx() needs us to draw sprites front to back, so we have to build a list
|
||||
while processing sprite ram and then draw them all at the end */
|
||||
@ -503,7 +493,7 @@ void taitof2_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, c
|
||||
|
||||
/* must remember enable status from last frame because driftout fails to
|
||||
reactivate them from a certain point onwards. */
|
||||
int disabled = m_sprites_disabled;
|
||||
bool disabled = m_sprites_disabled;
|
||||
|
||||
/* must remember master scroll from previous frame because driftout
|
||||
sometimes doesn't set it. */
|
||||
@ -513,13 +503,13 @@ void taitof2_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, c
|
||||
/* must also remember the sprite bank from previous frame. */
|
||||
int area = m_sprites_active_area;
|
||||
|
||||
scroll1x = 0;
|
||||
scroll1y = 0;
|
||||
x = y = 0;
|
||||
xcurrent = ycurrent = 0;
|
||||
color = 0;
|
||||
int scroll1x = 0;
|
||||
int scroll1y = 0;
|
||||
int x = 0, y = 0;
|
||||
int xcurrent = 0, ycurrent = 0;
|
||||
u32 color = 0;
|
||||
|
||||
f2_x_offset = m_hide_pixels; /* Get rid of 0-3 unwanted pixels on edge of screen. */
|
||||
int f2_x_offset = m_hide_pixels; /* Get rid of 0-3 unwanted pixels on edge of screen. */
|
||||
if (m_sprites_flipscreen)
|
||||
f2_x_offset = -m_flip_hide_pixels; // was -f2_x_offset
|
||||
|
||||
@ -527,10 +517,10 @@ void taitof2_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, c
|
||||
if (area == 0x8000 && m_spriteram_buffered[(0x8000 + 6) / 2] == 0 && m_spriteram_buffered[(0x8000 + 10) / 2] == 0)
|
||||
area = 0;
|
||||
|
||||
for (off = 0; off < 0x4000; off += 16)
|
||||
for (int off = 0; off < 0x4000; off += 16)
|
||||
{
|
||||
/* sprites_active_area may change during processing */
|
||||
int offs = off + area;
|
||||
const int offs = off + area;
|
||||
|
||||
if (m_spriteram_buffered[(offs + 6) / 2] & 0x8000)
|
||||
{
|
||||
@ -577,9 +567,9 @@ void taitof2_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, c
|
||||
if (disabled)
|
||||
continue;
|
||||
|
||||
spritedata = m_spriteram_buffered[(offs + 8) / 2];
|
||||
const u16 spritedata = m_spriteram_buffered[(offs + 8) / 2];
|
||||
|
||||
spritecont = (spritedata & 0xff00) >> 8;
|
||||
const u16 spritecont = (spritedata & 0xff00) >> 8;
|
||||
|
||||
if ((spritecont & 0x08) != 0) /* sprite continuation flag set */
|
||||
{
|
||||
@ -698,48 +688,45 @@ void taitof2_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, c
|
||||
last_continuation_tile=0;
|
||||
}
|
||||
|
||||
code = 0;
|
||||
extoffs = offs;
|
||||
u32 code = 0;
|
||||
int extoffs = offs;
|
||||
/* spriteram[0x4000-7fff] has no corresponding extension area */
|
||||
if (extoffs >= 0x8000) extoffs -= 0x4000;
|
||||
|
||||
if (m_sprite_type == 0)
|
||||
{
|
||||
code = m_spriteram_buffered[(offs) / 2] & 0x1fff;
|
||||
i = (code & 0x1c00) >> 10;
|
||||
u32 i = (code & 0x1c00) >> 10;
|
||||
code = m_spritebank[i] + (code & 0x3ff);
|
||||
}
|
||||
|
||||
if (m_sprite_type == 1) /* Yuyugogo */
|
||||
{
|
||||
code = m_spriteram_buffered[(offs) / 2] & 0x3ff;
|
||||
i = (m_sprite_extension[(extoffs >> 4)] & 0x3f ) << 10;
|
||||
code = (i | code);
|
||||
code |= (m_sprite_extension[(extoffs >> 4)] & 0x3f) << 10;
|
||||
}
|
||||
|
||||
if (m_sprite_type == 2) /* Pulirula */
|
||||
{
|
||||
code = m_spriteram_buffered[(offs) / 2] & 0xff;
|
||||
i = (m_sprite_extension[(extoffs >> 4)] & 0xff00 );
|
||||
code = (i | code);
|
||||
code |= (m_sprite_extension[(extoffs >> 4)] & 0xff00);
|
||||
}
|
||||
|
||||
if (m_sprite_type == 3) /* Dinorex and a few quizzes */
|
||||
{
|
||||
code = m_spriteram_buffered[(offs) / 2] & 0xff;
|
||||
i = (m_sprite_extension[(extoffs >> 4)] & 0xff ) << 8;
|
||||
code = (i | code);
|
||||
code |= (m_sprite_extension[(extoffs >> 4)] & 0xff) << 8;
|
||||
}
|
||||
|
||||
if (code == 0) continue;
|
||||
|
||||
flipx = spritecont & 0x01;
|
||||
flipy = spritecont & 0x02;
|
||||
int flipx = spritecont & 0x01;
|
||||
int flipy = spritecont & 0x02;
|
||||
|
||||
curx = (x + scrollx) & 0xfff;
|
||||
int curx = (x + scrollx) & 0xfff;
|
||||
if (curx >= 0x800) curx -= 0x1000; /* treat it as signed */
|
||||
|
||||
cury = (y + scrolly) & 0xfff;
|
||||
int cury = (y + scrolly) & 0xfff;
|
||||
if (cury >= 0x800) cury -= 0x1000; /* treat it as signed */
|
||||
|
||||
if (m_sprites_flipscreen)
|
||||
@ -810,11 +797,10 @@ void taitof2_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, c
|
||||
}
|
||||
|
||||
|
||||
void taitof2_state::update_spritebanks( )
|
||||
void taitof2_state::update_spritebanks()
|
||||
{
|
||||
int i;
|
||||
#if 1
|
||||
for (i = 0; i < 8; i ++)
|
||||
for (int i = 0; i < 8; i ++)
|
||||
{
|
||||
m_spritebank[i] = m_spritebank_buffered[i];
|
||||
}
|
||||
@ -828,7 +814,7 @@ void taitof2_state::update_spritebanks( )
|
||||
#endif
|
||||
}
|
||||
|
||||
void taitof2_state::taitof2_handle_sprite_buffering( )
|
||||
void taitof2_state::handle_sprite_buffering()
|
||||
{
|
||||
if (m_prepare_sprites) /* no buffering */
|
||||
{
|
||||
@ -837,14 +823,12 @@ void taitof2_state::taitof2_handle_sprite_buffering( )
|
||||
}
|
||||
}
|
||||
|
||||
void taitof2_state::taitof2_update_sprites_active_area( )
|
||||
void taitof2_state::update_sprites_active_area()
|
||||
{
|
||||
int off;
|
||||
|
||||
update_spritebanks();
|
||||
|
||||
/* if the frame was skipped, we'll have to do the buffering now */
|
||||
taitof2_handle_sprite_buffering();
|
||||
handle_sprite_buffering();
|
||||
|
||||
/* safety check to avoid getting stuck in bank 2 for games using only one bank */
|
||||
if (m_sprites_active_area == 0x8000 &&
|
||||
@ -852,10 +836,10 @@ void taitof2_state::taitof2_update_sprites_active_area( )
|
||||
m_spriteram_buffered[(0x8000 + 10) / 2] == 0)
|
||||
m_sprites_active_area = 0;
|
||||
|
||||
for (off = 0; off < 0x4000; off += 16)
|
||||
for (int off = 0; off < 0x4000; off += 16)
|
||||
{
|
||||
/* sprites_active_area may change during processing */
|
||||
int offs = off + m_sprites_active_area;
|
||||
const int offs = off + m_sprites_active_area;
|
||||
|
||||
if (m_spriteram_buffered[(offs + 6) / 2] & 0x8000)
|
||||
{
|
||||
@ -887,7 +871,7 @@ WRITE_LINE_MEMBER(taitof2_state::screen_vblank_no_buffer)
|
||||
// rising edge
|
||||
if (state)
|
||||
{
|
||||
taitof2_update_sprites_active_area();
|
||||
update_sprites_active_area();
|
||||
|
||||
m_prepare_sprites = 1;
|
||||
}
|
||||
@ -898,16 +882,13 @@ WRITE_LINE_MEMBER(taitof2_state::screen_vblank_full_buffer_delayed)
|
||||
// rising edge
|
||||
if (state)
|
||||
{
|
||||
uint16_t *spriteram = m_spriteram;
|
||||
int i;
|
||||
|
||||
taitof2_update_sprites_active_area();
|
||||
update_sprites_active_area();
|
||||
|
||||
m_prepare_sprites = 0;
|
||||
memcpy(m_spriteram_buffered.get(), m_spriteram_delayed.get(), m_spriteram.bytes());
|
||||
for (i = 0; i < m_spriteram.bytes() / 2; i++)
|
||||
m_spriteram_buffered[i] = spriteram[i];
|
||||
memcpy(m_spriteram_delayed.get(), spriteram, m_spriteram.bytes());
|
||||
for (int i = 0; i < m_spriteram.bytes() / 2; i++)
|
||||
m_spriteram_buffered[i] = m_spriteram[i];
|
||||
memcpy(m_spriteram_delayed.get(), m_spriteram, m_spriteram.bytes());
|
||||
}
|
||||
}
|
||||
|
||||
@ -916,16 +897,13 @@ WRITE_LINE_MEMBER(taitof2_state::screen_vblank_partial_buffer_delayed)
|
||||
// rising edge
|
||||
if (state)
|
||||
{
|
||||
uint16_t *spriteram = m_spriteram;
|
||||
int i;
|
||||
|
||||
taitof2_update_sprites_active_area();
|
||||
update_sprites_active_area();
|
||||
|
||||
m_prepare_sprites = 0;
|
||||
memcpy(m_spriteram_buffered.get(), m_spriteram_delayed.get(), m_spriteram.bytes());
|
||||
for (i = 0;i < m_spriteram.bytes() / 2; i += 4)
|
||||
m_spriteram_buffered[i] = spriteram[i];
|
||||
memcpy(m_spriteram_delayed.get(), spriteram, m_spriteram.bytes());
|
||||
for (int i = 0; i < m_spriteram.bytes() / 2; i += 4)
|
||||
m_spriteram_buffered[i] = m_spriteram[i];
|
||||
memcpy(m_spriteram_delayed.get(), m_spriteram, m_spriteram.bytes());
|
||||
}
|
||||
}
|
||||
|
||||
@ -934,20 +912,17 @@ WRITE_LINE_MEMBER(taitof2_state::screen_vblank_partial_buffer_delayed_thundfox)
|
||||
// rising edge
|
||||
if (state)
|
||||
{
|
||||
uint16_t *spriteram = m_spriteram;
|
||||
int i;
|
||||
|
||||
taitof2_update_sprites_active_area();
|
||||
update_sprites_active_area();
|
||||
|
||||
m_prepare_sprites = 0;
|
||||
memcpy(m_spriteram_buffered.get(), m_spriteram_delayed.get(), m_spriteram.bytes());
|
||||
for (i = 0; i < m_spriteram.bytes() / 2; i += 8)
|
||||
for (int i = 0; i < m_spriteram.bytes() / 2; i += 8)
|
||||
{
|
||||
m_spriteram_buffered[i] = spriteram[i];
|
||||
m_spriteram_buffered[i + 1] = spriteram[i + 1];
|
||||
m_spriteram_buffered[i + 4] = spriteram[i + 4];
|
||||
m_spriteram_buffered[i] = m_spriteram[i];
|
||||
m_spriteram_buffered[i + 1] = m_spriteram[i + 1];
|
||||
m_spriteram_buffered[i + 4] = m_spriteram[i + 4];
|
||||
}
|
||||
memcpy(m_spriteram_delayed.get(), spriteram, m_spriteram.bytes());
|
||||
memcpy(m_spriteram_delayed.get(), m_spriteram, m_spriteram.bytes());
|
||||
}
|
||||
}
|
||||
|
||||
@ -959,31 +934,28 @@ WRITE_LINE_MEMBER(taitof2_state::screen_vblank_partial_buffer_delayed_qzchikyu)
|
||||
/* spriteram[2] and [3] are 1 frame behind...
|
||||
probably thundfox_eof_callback would work fine */
|
||||
|
||||
uint16_t *spriteram = m_spriteram;
|
||||
int i;
|
||||
|
||||
taitof2_update_sprites_active_area();
|
||||
update_sprites_active_area();
|
||||
|
||||
m_prepare_sprites = 0;
|
||||
memcpy(m_spriteram_buffered.get(), m_spriteram_delayed.get(), m_spriteram.bytes());
|
||||
for (i = 0; i < m_spriteram.bytes() / 2; i += 8)
|
||||
for (int i = 0; i < m_spriteram.bytes() / 2; i += 8)
|
||||
{
|
||||
m_spriteram_buffered[i] = spriteram[i];
|
||||
m_spriteram_buffered[i + 1] = spriteram[i + 1];
|
||||
m_spriteram_buffered[i + 4] = spriteram[i + 4];
|
||||
m_spriteram_buffered[i + 5] = spriteram[i + 5]; // not needed?
|
||||
m_spriteram_buffered[i + 6] = spriteram[i + 6]; // not needed?
|
||||
m_spriteram_buffered[i + 7] = spriteram[i + 7]; // not needed?
|
||||
m_spriteram_buffered[i] = m_spriteram[i];
|
||||
m_spriteram_buffered[i + 1] = m_spriteram[i + 1];
|
||||
m_spriteram_buffered[i + 4] = m_spriteram[i + 4];
|
||||
m_spriteram_buffered[i + 5] = m_spriteram[i + 5]; // not needed?
|
||||
m_spriteram_buffered[i + 6] = m_spriteram[i + 6]; // not needed?
|
||||
m_spriteram_buffered[i + 7] = m_spriteram[i + 7]; // not needed?
|
||||
}
|
||||
memcpy(m_spriteram_delayed.get(), spriteram, m_spriteram.bytes());
|
||||
memcpy(m_spriteram_delayed.get(), m_spriteram, m_spriteram.bytes());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* SSI */
|
||||
uint32_t taitof2_state::screen_update_taitof2_ssi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
u32 taitof2_state::screen_update_ssi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
taitof2_handle_sprite_buffering();
|
||||
handle_sprite_buffering();
|
||||
|
||||
/* SSI only uses sprites, the tilemap registers are not even initialized.
|
||||
(they are in Majestic 12, but the tilemaps are not used anyway) */
|
||||
@ -994,47 +966,47 @@ uint32_t taitof2_state::screen_update_taitof2_ssi(screen_device &screen, bitmap_
|
||||
}
|
||||
|
||||
|
||||
uint32_t taitof2_state::screen_update_taitof2_yesnoj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
u32 taitof2_state::screen_update_yesnoj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
taitof2_handle_sprite_buffering();
|
||||
handle_sprite_buffering();
|
||||
|
||||
m_tc0100scn->tilemap_update();
|
||||
m_tc0100scn[0]->tilemap_update();
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
bitmap.fill(0, cliprect); /* wrong color? */
|
||||
draw_sprites(screen, bitmap, cliprect, nullptr, 0);
|
||||
m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, m_tc0100scn->bottomlayer(), 0, 0);
|
||||
m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, m_tc0100scn->bottomlayer() ^ 1, 0, 0);
|
||||
m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, m_tc0100scn[0]->bottomlayer(), 0, 0);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, m_tc0100scn[0]->bottomlayer() ^ 1, 0, 0);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
uint32_t taitof2_state::screen_update_taitof2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
u32 taitof2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
taitof2_handle_sprite_buffering();
|
||||
handle_sprite_buffering();
|
||||
|
||||
m_tc0100scn->tilemap_update();
|
||||
m_tc0100scn[0]->tilemap_update();
|
||||
|
||||
screen.priority().fill(0, cliprect);
|
||||
bitmap.fill(0, cliprect); /* wrong color? */
|
||||
m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, m_tc0100scn->bottomlayer(), 0, 0);
|
||||
m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, m_tc0100scn->bottomlayer() ^ 1, 0, 0);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, m_tc0100scn[0]->bottomlayer(), 0, 0);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, m_tc0100scn[0]->bottomlayer() ^ 1, 0, 0);
|
||||
draw_sprites(screen, bitmap, cliprect, nullptr, 0);
|
||||
m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
uint32_t taitof2_state::screen_update_taitof2_pri(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
u32 taitof2_state::screen_update_pri(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int layer[3];
|
||||
|
||||
taitof2_handle_sprite_buffering();
|
||||
handle_sprite_buffering();
|
||||
|
||||
m_tc0100scn->tilemap_update();
|
||||
m_tc0100scn[0]->tilemap_update();
|
||||
|
||||
layer[0] = m_tc0100scn->bottomlayer();
|
||||
layer[0] = m_tc0100scn[0]->bottomlayer();
|
||||
layer[1] = layer[0] ^ 1;
|
||||
layer[2] = 2;
|
||||
m_tilepri[layer[0]] = m_tc0360pri->read(5) & 0x0f;
|
||||
@ -1051,9 +1023,9 @@ uint32_t taitof2_state::screen_update_taitof2_pri(screen_device &screen, bitmap_
|
||||
screen.priority().fill(0, cliprect);
|
||||
bitmap.fill(0, cliprect); /* wrong color? */
|
||||
|
||||
m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, layer[0], 0, 1);
|
||||
m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, layer[1], 0, 2);
|
||||
m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, layer[2], 0, 4);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, layer[0], 0, 1);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, layer[1], 0, 2);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, layer[2], 0, 4);
|
||||
|
||||
draw_sprites(screen, bitmap, cliprect, nullptr, 1);
|
||||
return 0;
|
||||
@ -1061,7 +1033,7 @@ uint32_t taitof2_state::screen_update_taitof2_pri(screen_device &screen, bitmap_
|
||||
|
||||
|
||||
|
||||
void taitof2_state::draw_roz_layer( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint32_t priority)
|
||||
void taitof2_state::draw_roz_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, u32 priority)
|
||||
{
|
||||
if (m_tc0280grd != nullptr)
|
||||
m_tc0280grd->tc0280grd_zoom_draw(screen, bitmap, cliprect, m_pivot_xdisp, m_pivot_ydisp, priority);
|
||||
@ -1070,16 +1042,13 @@ void taitof2_state::draw_roz_layer( screen_device &screen, bitmap_ind16 &bitmap,
|
||||
m_tc0430grw->tc0430grw_zoom_draw(screen, bitmap, cliprect, m_pivot_xdisp, m_pivot_ydisp, priority);
|
||||
}
|
||||
|
||||
uint32_t taitof2_state::screen_update_taitof2_pri_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
u32 taitof2_state::screen_update_pri_roz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int tilepri[3];
|
||||
int rozpri;
|
||||
int layer[3];
|
||||
int drawn;
|
||||
int i,j;
|
||||
int roz_base_color = (m_tc0360pri->read(1) & 0x3f) << 2;
|
||||
const u16 roz_base_color = (m_tc0360pri->read(1) & 0x3f) << 2;
|
||||
|
||||
taitof2_handle_sprite_buffering();
|
||||
handle_sprite_buffering();
|
||||
|
||||
if (m_tc0280grd != nullptr)
|
||||
m_tc0280grd->tc0280grd_tilemap_update(roz_base_color);
|
||||
@ -1087,12 +1056,12 @@ uint32_t taitof2_state::screen_update_taitof2_pri_roz(screen_device &screen, bit
|
||||
if (m_tc0430grw != nullptr)
|
||||
m_tc0430grw->tc0430grw_tilemap_update(roz_base_color);
|
||||
|
||||
m_tc0100scn->tilemap_update();
|
||||
m_tc0100scn[0]->tilemap_update();
|
||||
|
||||
rozpri = (m_tc0360pri->read(1) & 0xc0) >> 6;
|
||||
u8 rozpri = (m_tc0360pri->read(1) & 0xc0) >> 6;
|
||||
rozpri = (m_tc0360pri->read(8 + rozpri / 2) >> 4 * (rozpri & 1)) & 0x0f;
|
||||
|
||||
layer[0] = m_tc0100scn->bottomlayer();
|
||||
layer[0] = m_tc0100scn[0]->bottomlayer();
|
||||
layer[1] = layer[0] ^ 1;
|
||||
layer[2] = 2;
|
||||
|
||||
@ -1110,8 +1079,8 @@ uint32_t taitof2_state::screen_update_taitof2_pri_roz(screen_device &screen, bit
|
||||
screen.priority().fill(0, cliprect);
|
||||
bitmap.fill(0, cliprect); /* wrong color? */
|
||||
|
||||
drawn = 0;
|
||||
for (i = 0; i < 16; i++)
|
||||
int drawn = 0;
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
if (rozpri == i)
|
||||
{
|
||||
@ -1120,11 +1089,11 @@ uint32_t taitof2_state::screen_update_taitof2_pri_roz(screen_device &screen, bit
|
||||
drawn++;
|
||||
}
|
||||
|
||||
for (j = 0; j < 3; j++)
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
if (tilepri[layer[j]] == i)
|
||||
{
|
||||
m_tc0100scn->tilemap_draw(screen, bitmap, cliprect, layer[j], 0, 1 << drawn);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, layer[j], 0, 1 << drawn);
|
||||
m_tilepri[drawn] = i;
|
||||
drawn++;
|
||||
}
|
||||
@ -1138,26 +1107,26 @@ uint32_t taitof2_state::screen_update_taitof2_pri_roz(screen_device &screen, bit
|
||||
|
||||
|
||||
/* Thunderfox */
|
||||
uint32_t taitof2_state::screen_update_taitof2_thundfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
u32 taitof2_state::screen_update_thundfox(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int tilepri[2][3];
|
||||
int spritepri[4];
|
||||
int layer[2][3];
|
||||
int drawn[2];
|
||||
|
||||
taitof2_handle_sprite_buffering();
|
||||
handle_sprite_buffering();
|
||||
|
||||
m_tc0100scn_1->tilemap_update();
|
||||
m_tc0100scn_2->tilemap_update();
|
||||
m_tc0100scn[0]->tilemap_update();
|
||||
m_tc0100scn[1]->tilemap_update();
|
||||
|
||||
layer[0][0] = m_tc0100scn_1->bottomlayer();
|
||||
layer[0][0] = m_tc0100scn[0]->bottomlayer();
|
||||
layer[0][1] = layer[0][0] ^ 1;
|
||||
layer[0][2] = 2;
|
||||
tilepri[0][layer[0][0]] = m_tc0360pri->read(5) & 0x0f;
|
||||
tilepri[0][layer[0][1]] = m_tc0360pri->read(5) >> 4;
|
||||
tilepri[0][layer[0][2]] = m_tc0360pri->read(4) >> 4;
|
||||
|
||||
layer[1][0] = m_tc0100scn_2->bottomlayer();
|
||||
layer[1][0] = m_tc0100scn[1]->bottomlayer();
|
||||
layer[1][1] = layer[1][0] ^ 1;
|
||||
layer[1][2] = 2;
|
||||
tilepri[1][layer[1][0]] = m_tc0360pri->read(9) & 0x0f;
|
||||
@ -1182,48 +1151,41 @@ uint32_t taitof2_state::screen_update_taitof2_thundfox(screen_device &screen, bi
|
||||
while (drawn[0] < 2 && drawn[1] < 2)
|
||||
{
|
||||
int pick;
|
||||
tc0100scn_device *tc0100scn;
|
||||
|
||||
if (tilepri[0][drawn[0]] < tilepri[1][drawn[1]])
|
||||
{
|
||||
pick = 0;
|
||||
tc0100scn = m_tc0100scn_1;
|
||||
}
|
||||
else
|
||||
{
|
||||
pick = 1;
|
||||
tc0100scn = m_tc0100scn_2;
|
||||
}
|
||||
|
||||
tc0100scn->tilemap_draw(screen, bitmap, cliprect, layer[pick][drawn[pick]], 0, 1 << (drawn[pick] + 2 * pick));
|
||||
m_tc0100scn[pick]->tilemap_draw(screen, bitmap, cliprect, layer[pick][drawn[pick]], 0, 1 << (drawn[pick] + 2 * pick));
|
||||
drawn[pick]++;
|
||||
}
|
||||
while (drawn[0] < 2)
|
||||
{
|
||||
m_tc0100scn_1->tilemap_draw(screen, bitmap, cliprect, layer[0][drawn[0]], 0, 1 << drawn[0]);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, layer[0][drawn[0]], 0, 1 << drawn[0]);
|
||||
drawn[0]++;
|
||||
}
|
||||
while (drawn[1] < 2)
|
||||
{
|
||||
m_tc0100scn_2->tilemap_draw(screen, bitmap, cliprect, layer[1][drawn[1]], 0, 1 << (drawn[1] + 2));
|
||||
m_tc0100scn[1]->tilemap_draw(screen, bitmap, cliprect, layer[1][drawn[1]], 0, 1 << (drawn[1] + 2));
|
||||
drawn[1]++;
|
||||
}
|
||||
|
||||
u32 primasks[4] = {0,0,0,0};
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int primasks[4] = {0,0,0,0};
|
||||
int i;
|
||||
|
||||
for (i = 0;i < 4;i++)
|
||||
{
|
||||
if (spritepri[i] < tilepri[0][0]) primasks[i] |= 0xaaaa;
|
||||
if (spritepri[i] < tilepri[0][1]) primasks[i] |= 0xcccc;
|
||||
if (spritepri[i] < tilepri[1][0]) primasks[i] |= 0xf0f0;
|
||||
if (spritepri[i] < tilepri[1][1]) primasks[i] |= 0xff00;
|
||||
}
|
||||
|
||||
draw_sprites(screen, bitmap,cliprect,primasks,0);
|
||||
if (spritepri[i] < tilepri[0][0]) primasks[i] |= 0xaaaa;
|
||||
if (spritepri[i] < tilepri[0][1]) primasks[i] |= 0xcccc;
|
||||
if (spritepri[i] < tilepri[1][0]) primasks[i] |= 0xf0f0;
|
||||
if (spritepri[i] < tilepri[1][1]) primasks[i] |= 0xff00;
|
||||
}
|
||||
|
||||
draw_sprites(screen, bitmap,cliprect,primasks,0);
|
||||
|
||||
/*
|
||||
TODO: This isn't the correct way to handle the priority. At the moment of
|
||||
@ -1233,13 +1195,13 @@ uint32_t taitof2_state::screen_update_taitof2_thundfox(screen_device &screen, bi
|
||||
|
||||
if (tilepri[0][2] < tilepri[1][2])
|
||||
{
|
||||
m_tc0100scn_1->tilemap_draw(screen, bitmap, cliprect, layer[0][2], 0, 0);
|
||||
m_tc0100scn_2->tilemap_draw(screen, bitmap, cliprect, layer[1][2], 0, 0);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, layer[0][2], 0, 0);
|
||||
m_tc0100scn[1]->tilemap_draw(screen, bitmap, cliprect, layer[1][2], 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_tc0100scn_2->tilemap_draw(screen, bitmap, cliprect, layer[1][2], 0, 0);
|
||||
m_tc0100scn_1->tilemap_draw(screen, bitmap, cliprect, layer[0][2], 0, 0);
|
||||
m_tc0100scn[1]->tilemap_draw(screen, bitmap, cliprect, layer[1][2], 0, 0);
|
||||
m_tc0100scn[0]->tilemap_draw(screen, bitmap, cliprect, layer[0][2], 0, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -1274,16 +1236,15 @@ and it changes these (and the sprite pri settings) a lot.
|
||||
|
||||
********************************************************************/
|
||||
|
||||
uint32_t taitof2_state::screen_update_taitof2_metalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
u32 taitof2_state::screen_update_metalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
uint8_t layer[5], invlayer[4];
|
||||
uint16_t priority;
|
||||
u8 layer[5], invlayer[4];
|
||||
|
||||
taitof2_handle_sprite_buffering();
|
||||
handle_sprite_buffering();
|
||||
|
||||
m_tc0480scp->tilemap_update();
|
||||
|
||||
priority = m_tc0480scp->get_bg_priority();
|
||||
const u16 priority = m_tc0480scp->get_bg_priority();
|
||||
|
||||
layer[0] = (priority & 0xf000) >> 12; /* tells us which bg layer is bottom */
|
||||
layer[1] = (priority & 0x0f00) >> 8;
|
||||
@ -1324,18 +1285,17 @@ uint32_t taitof2_state::screen_update_taitof2_metalb(screen_device &screen, bitm
|
||||
|
||||
|
||||
/* Deadconx, Footchmp */
|
||||
uint32_t taitof2_state::screen_update_taitof2_deadconx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
u32 taitof2_state::screen_update_deadconx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
uint8_t layer[5];
|
||||
uint8_t tilepri[5];
|
||||
uint8_t spritepri[4];
|
||||
uint16_t priority;
|
||||
u8 layer[5];
|
||||
u8 tilepri[5];
|
||||
u8 spritepri[4];
|
||||
|
||||
taitof2_handle_sprite_buffering();
|
||||
handle_sprite_buffering();
|
||||
|
||||
m_tc0480scp->tilemap_update();
|
||||
|
||||
priority = m_tc0480scp->get_bg_priority();
|
||||
const u16 priority = m_tc0480scp->get_bg_priority();
|
||||
|
||||
layer[0] = (priority & 0xf000) >> 12; /* tells us which bg layer is bottom */
|
||||
layer[1] = (priority & 0x0f00) >> 8;
|
||||
@ -1364,21 +1324,18 @@ uint32_t taitof2_state::screen_update_taitof2_deadconx(screen_device &screen, bi
|
||||
m_tc0480scp->tilemap_draw(screen, bitmap, cliprect, layer[2], 0, 4);
|
||||
m_tc0480scp->tilemap_draw(screen, bitmap, cliprect, layer[3], 0, 8);
|
||||
|
||||
u32 primasks[4] = {0,0,0,0};
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int primasks[4] = {0,0,0,0};
|
||||
int i;
|
||||
|
||||
for (i = 0;i < 4;i++)
|
||||
{
|
||||
if (spritepri[i] < tilepri[(layer[0])]) primasks[i] |= 0xaaaa;
|
||||
if (spritepri[i] < tilepri[(layer[1])]) primasks[i] |= 0xcccc;
|
||||
if (spritepri[i] < tilepri[(layer[2])]) primasks[i] |= 0xf0f0;
|
||||
if (spritepri[i] < tilepri[(layer[3])]) primasks[i] |= 0xff00;
|
||||
}
|
||||
|
||||
draw_sprites(screen, bitmap, cliprect, primasks, 0);
|
||||
if (spritepri[i] < tilepri[(layer[0])]) primasks[i] |= 0xaaaa;
|
||||
if (spritepri[i] < tilepri[(layer[1])]) primasks[i] |= 0xcccc;
|
||||
if (spritepri[i] < tilepri[(layer[2])]) primasks[i] |= 0xf0f0;
|
||||
if (spritepri[i] < tilepri[(layer[3])]) primasks[i] |= 0xff00;
|
||||
}
|
||||
|
||||
draw_sprites(screen, bitmap, cliprect, primasks, 0);
|
||||
|
||||
/*
|
||||
TODO: This isn't the correct way to handle the priority. At the moment of
|
||||
writing, pdrawgfx() doesn't support 5 layers, so I have to cheat, assuming
|
||||
|
Loading…
Reference in New Issue
Block a user