vastar_viddev.cpp - better sprite flip handling (#11039)

This commit is contained in:
David Haywood 2023-03-27 03:11:54 +01:00 committed by Vas Crabb
parent d2f8af5301
commit 860cd36026
3 changed files with 18 additions and 5 deletions

View File

@ -287,6 +287,7 @@ void akazukin_state::akazukin(machine_config &config)
m_vasvid->set_bg0ram_tag("bg0videoram");
m_vasvid->set_bg1ram_tag("bg1videoram");
m_vasvid->set_fgram_tag("fgvideoram");
m_vasvid->set_alt_sprite_flips(true);
// sound hardware
SPEAKER(config, "mono").front_center();

View File

@ -145,14 +145,23 @@ void vastar_video_device::draw_sprites(bitmap_rgb32& bitmap, const rectangle& cl
const int sx = spriteram[m_spr_code_x + offs + 1];
int sy = spriteram[m_spr_y_col + offs];
const int color = spriteram[m_spr_y_col + offs + 1] & 0x3f;
int flipx = spriteram[m_spr_code_x + offs] & 0x02;
int flipy = spriteram[m_spr_code_x + offs] & 0x01;
bool flipy, flipx;
if (m_alt_spriteflip)
{
flipy = (spriteram[m_spr_code_x + offs] & 0x02) ? true : false;
flipx = (spriteram[m_spr_code_x + offs] & 0x01) ? true : false;
}
else
{
flipy = (spriteram[m_spr_code_x + offs] & 0x01) ? true : false;
flipx = (spriteram[m_spr_code_x + offs] & 0x02) ? true : false;
}
if (m_flip_screen)
{
int temp = flipx;
flipx = !flipy;
flipy = !temp;
flipx = !flipx;
flipy = !flipy;
}
if (spriteram[m_spr_attr + offs] & 0x08) // double width

View File

@ -31,6 +31,7 @@ public:
void set_bg_bases(uint16_t code, uint16_t attr, uint16_t col) { m_bg_codebase = code; m_bg_attrbase = attr; m_bg_colbase = col; }
void set_fg_bases(uint16_t code, uint16_t attr, uint16_t col) { m_fg_codebase = code; m_fg_attrbase = attr; m_fg_colbase = col; }
void set_other_bases(uint16_t spy, uint16_t atr, uint16_t spx, uint16_t bgs0, uint16_t bgs1) { m_spr_y_col = spy; m_spr_attr = atr; m_spr_code_x = spx; m_bg_scroll0 = bgs0; m_bg_scroll1 = bgs1; }
void set_alt_sprite_flips(bool alt_flip) { m_alt_spriteflip = alt_flip; }
template <typename... T> void set_bg0ram_tag(T &&... args) { m_bgvideoram[0].set_tag(std::forward<T>(args)...); }
template <typename... T> void set_bg1ram_tag(T &&... args) { m_bgvideoram[1].set_tag(std::forward<T>(args)...); }
@ -88,6 +89,8 @@ private:
uint16_t m_bg_scroll0 = 0;
uint16_t m_bg_scroll1 = 0;
bool m_alt_spriteflip = false;
TILE_GET_INFO_MEMBER(get_fg_tile_info);
template <uint8_t Which> TILE_GET_INFO_MEMBER(get_bg_tile_info);