From 85ccd075801e22fdfc42a6e216cfd5ae5a642995 Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sun, 26 Feb 2017 14:20:32 +0100 Subject: [PATCH 1/3] polyplay: hook up the SIO (nw) --- src/mame/drivers/polyplay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/polyplay.cpp b/src/mame/drivers/polyplay.cpp index 8ca87d1058a..8dcd977188f 100644 --- a/src/mame/drivers/polyplay.cpp +++ b/src/mame/drivers/polyplay.cpp @@ -262,7 +262,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( polyplay_io_zrepp, AS_IO, 8, polyplay_state ) AM_IMPORT_FROM(polyplay_io_zre) - // TODO: add SIO ports here + AM_RANGE(0x88, 0x8b) AM_DEVREADWRITE(Z80SIO_TAG, z80ctc_device, read, write) ADDRESS_MAP_END static INPUT_PORTS_START( polyplay ) From ee4c5d0889a5c3b3f3998f8cad1e10b1862ba581 Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sun, 26 Feb 2017 14:22:41 +0100 Subject: [PATCH 2/3] 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. --- src/mame/drivers/vicdual.cpp | 6 +++++- src/mame/includes/vicdual.h | 1 + src/mame/video/vicdual.cpp | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/mame/drivers/vicdual.cpp b/src/mame/drivers/vicdual.cpp index a6a2d6a64a5..b21e1dc7d25 100644 --- a/src/mame/drivers/vicdual.cpp +++ b/src/mame/drivers/vicdual.cpp @@ -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; + } } diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h index 75062f2886b..9cde2e1ce38 100644 --- a/src/mame/includes/vicdual.h +++ b/src/mame/includes/vicdual.h @@ -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; diff --git a/src/mame/video/vicdual.cpp b/src/mame/video/vicdual.cpp index f541766edfd..12c8c83d34a 100644 --- a/src/mame/video/vicdual.cpp +++ b/src/mame/video/vicdual.cpp @@ -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; From 34b4f62e0c059afb99b6e312ea9f6a3fb0a37af5 Mon Sep 17 00:00:00 2001 From: Ariane Fugmann Date: Sun, 26 Feb 2017 20:57:16 +0100 Subject: [PATCH 3/3] polyplay: fix device (nw) oops :) --- src/mame/drivers/polyplay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/drivers/polyplay.cpp b/src/mame/drivers/polyplay.cpp index 8dcd977188f..02c449258e6 100644 --- a/src/mame/drivers/polyplay.cpp +++ b/src/mame/drivers/polyplay.cpp @@ -262,7 +262,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( polyplay_io_zrepp, AS_IO, 8, polyplay_state ) AM_IMPORT_FROM(polyplay_io_zre) - AM_RANGE(0x88, 0x8b) AM_DEVREADWRITE(Z80SIO_TAG, z80ctc_device, read, write) + AM_RANGE(0x88, 0x8b) AM_DEVREADWRITE(Z80SIO_TAG, z80sio_device, read, write) ADDRESS_MAP_END static INPUT_PORTS_START( polyplay )