summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author David Haywood <28625134+DavidHaywood@users.noreply.github.com>2021-01-22 11:13:47 +0000
committer GitHub <noreply@github.com>2021-01-22 22:13:47 +1100
commit8abe07d6678ef772d84d96787e81fbc72fd8473c (patch)
tree86fec5d3dff651c4cc1af787806950055f32e9c0
parentfed17f41440182463d0f1db9335ed9844aae1969 (diff)
galaxian.cpp: Fixed sprite clipping issue in namenayo. [David Haywood] (#7688)
-rw-r--r--src/mame/includes/galaxian.h6
-rw-r--r--src/mame/video/galaxian.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index 6f62a5750f6..b174603eb8a 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -85,6 +85,7 @@ public:
, m_decrypted_opcodes(*this, "decrypted_opcodes")
, m_lamps(*this, "lamp%u", 0U)
, m_bank1(*this, "bank1")
+ , m_leftspriteclip(16)
{ }
/* video extension callbacks */
@@ -525,6 +526,7 @@ protected:
uint8_t m_stars_blink_state;
rgb_t m_bullet_color[8];
uint8_t m_gfxbank[5];
+ uint8_t m_leftspriteclip;
void fourplay_rombank_w(offs_t offset, uint8_t data);
void videight_rombank_w(offs_t offset, uint8_t data);
@@ -562,7 +564,9 @@ class namenayo_state : public galaxian_state
public:
namenayo_state(const machine_config &mconfig, device_type type, const char *tag)
: galaxian_state(mconfig, type, tag)
- {}
+ {
+ m_leftspriteclip = 0;
+ }
void namenayo(machine_config &config);
void init_namenayo();
diff --git a/src/mame/video/galaxian.cpp b/src/mame/video/galaxian.cpp
index f3eaa37ac9e..74b5ebb7c4b 100644
--- a/src/mame/video/galaxian.cpp
+++ b/src/mame/video/galaxian.cpp
@@ -551,7 +551,7 @@ void galaxian_state::sprites_draw(bitmap_rgb32 &bitmap, const rectangle &cliprec
/* 16 of the 256 pixels of the sprites are hard-clipped at the line buffer */
/* according to the schematics, it should be the first 16 pixels */
- clip.min_x = std::max(clip.min_x, (!m_flipscreen_x) * (16 + hoffset) * m_x_scale);
+ clip.min_x = std::max(clip.min_x, (!m_flipscreen_x) * (m_leftspriteclip + hoffset) * m_x_scale);
clip.max_x = std::min(clip.max_x, (256 - m_flipscreen_x * (16 + hoffset)) * m_x_scale - 1);
/* The line buffer is only written if it contains a '0' currently; */