galaxian.cpp: Fixed sprite clipping issue in namenayo. [David Haywood] (#7688)

This commit is contained in:
David Haywood 2021-01-22 11:13:47 +00:00 committed by GitHub
parent fed17f4144
commit 8abe07d667
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -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();

View File

@ -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; */