vicdual: simulate the gradient in nsub.

figured out how the starfield and gradient get enabled on vicdual
hardware.
don't exactly know how they work yet, so I added a simulation of the
gradient for nsub.
This commit is contained in:
Ariane Fugmann 2017-02-26 14:22:41 +01:00
parent 85ccd07580
commit ee4c5d0889
3 changed files with 23 additions and 1 deletions

View File

@ -2245,7 +2245,11 @@ WRITE8_MEMBER(vicdual_state::nsub_io_w)
{
if (offset & 0x01) assert_coin_status();
if (offset & 0x02) { /* nsub_audio_w(0, data) */ }
if (offset & 0x04) palette_bank_w(space, 0, data);
if (offset & 0x04)
{
palette_bank_w(space, 0, data);
m_gradient = data & 4;
}
}

View File

@ -57,6 +57,7 @@ public:
uint8_t m_coin_status;
uint8_t m_palette_bank;
uint8_t m_gradient;
uint8_t m_samurai_protection_data;
int m_nsub_coin_counter;
int m_nsub_play_counter;

View File

@ -112,6 +112,23 @@ uint32_t vicdual_state::screen_update_color(screen_device &screen, bitmap_rgb32
fore_pen = pens_from_color_prom[(color_prom[offs] >> 5) & 0x07];
}
if (m_gradient == 0x04)
{
// used by nsub and starrkr (maybe others)
// bit 4 on palette_bank_w seems to enable/disable the starfield/gradient
// how exactly those work is unclear right now
if (x >= 24 && x < 105)
{
// nsub - black to blue gradient
back_pen = rgb_t(0x00, 0x00, (x - 24) * 3);
}
if (x >= 105 && x < 233)
{
// nsub - blue to cyan gradient
back_pen = rgb_t(0x00, 0x80 + (x - 105), 0xff);
}
}
/* plot the current pixel */
pen = (video_data & 0x80) ? fore_pen : back_pen;
bitmap.pix32(y, x) = pen;