summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author David Haywood <28625134+DavidHaywood@users.noreply.github.com>2023-03-27 03:11:54 +0100
committer Vas Crabb <vas@vastheman.com>2023-03-27 16:45:49 +1100
commit860cd360262c9045eea765bc9abe1d72fa8d741c (patch)
tree35c3e620e5f56f3c370ab2834aadf0cdef39c876 /src
parentd2f8af5301637a78095b3032d0a60c70eb089ae0 (diff)
vastar_viddev.cpp - better sprite flip handling (#11039)
Diffstat (limited to 'src')
-rw-r--r--src/mame/orca/akazukin.cpp1
-rw-r--r--src/mame/orca/vastar_viddev.cpp19
-rw-r--r--src/mame/orca/vastar_viddev.h3
3 files changed, 18 insertions, 5 deletions
diff --git a/src/mame/orca/akazukin.cpp b/src/mame/orca/akazukin.cpp
index 2c74ddedf83..42024a7f1f5 100644
--- a/src/mame/orca/akazukin.cpp
+++ b/src/mame/orca/akazukin.cpp
@@ -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();
diff --git a/src/mame/orca/vastar_viddev.cpp b/src/mame/orca/vastar_viddev.cpp
index 49911883ef8..03e3c64543a 100644
--- a/src/mame/orca/vastar_viddev.cpp
+++ b/src/mame/orca/vastar_viddev.cpp
@@ -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
diff --git a/src/mame/orca/vastar_viddev.h b/src/mame/orca/vastar_viddev.h
index 9234ee52dde..8b599f647a5 100644
--- a/src/mame/orca/vastar_viddev.h
+++ b/src/mame/orca/vastar_viddev.h
@@ -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);