summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-02-17 16:02:26 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-02-17 16:02:26 -0500
commit2ff4e3da445b849c642430b0f8da9e6c5f289189 (patch)
tree2c46ad946ae7d50a6fce5a3f5270ead127d9e86a
parentdb492686ac81d17eb97b495d98dec17747ec48c5 (diff)
ccasino: No more state hacking for palette writes (nw)
-rw-r--r--src/mame/drivers/ojankohs.cpp23
-rw-r--r--src/mame/includes/ojankohs.h1
-rw-r--r--src/mame/video/ojankohs.cpp9
3 files changed, 19 insertions, 14 deletions
diff --git a/src/mame/drivers/ojankohs.cpp b/src/mame/drivers/ojankohs.cpp
index 41cc40f0154..d9058cedc6c 100644
--- a/src/mame/drivers/ojankohs.cpp
+++ b/src/mame/drivers/ojankohs.cpp
@@ -147,17 +147,16 @@ ADDRESS_MAP_START(ojankohs_state::ojankoy_io_map)
ADDRESS_MAP_END
ADDRESS_MAP_START(ojankohs_state::ccasino_io_map)
- ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ_PORT("system") AM_WRITE(port_select_w)
- AM_RANGE(0x01, 0x01) AM_READWRITE(keymatrix_p1_r, ojankohs_rombank_w)
- AM_RANGE(0x02, 0x02) AM_READWRITE(keymatrix_p2_r, ccasino_coinctr_w)
- AM_RANGE(0x03, 0x03) AM_READ(ccasino_dipsw3_r) AM_WRITE(ojankohs_adpcm_reset_w)
- AM_RANGE(0x04, 0x04) AM_READ(ccasino_dipsw4_r) AM_WRITE(ojankohs_flipscreen_w)
- AM_RANGE(0x05, 0x05) AM_WRITE(ojankohs_msm5205_w)
- AM_RANGE(0x06, 0x06) AM_DEVREAD("aysnd", ay8910_device, data_r)
- AM_RANGE(0x06, 0x07) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
- AM_RANGE(0x08, 0x0f) AM_WRITE(ccasino_palette_w) AM_SHARE("paletteram") // 16bit address access
- AM_RANGE(0x10, 0x11) AM_DEVWRITE("gga", vsystem_gga_device, write)
+ AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READ_PORT("system") AM_WRITE(port_select_w)
+ AM_RANGE(0x01, 0x01) AM_MIRROR(0xff00) AM_READWRITE(keymatrix_p1_r, ojankohs_rombank_w)
+ AM_RANGE(0x02, 0x02) AM_MIRROR(0xff00) AM_READWRITE(keymatrix_p2_r, ccasino_coinctr_w)
+ AM_RANGE(0x03, 0x03) AM_MIRROR(0xff00) AM_READ(ccasino_dipsw3_r) AM_WRITE(ojankohs_adpcm_reset_w)
+ AM_RANGE(0x04, 0x04) AM_MIRROR(0xff00) AM_READ(ccasino_dipsw4_r) AM_WRITE(ojankohs_flipscreen_w)
+ AM_RANGE(0x05, 0x05) AM_MIRROR(0xff00) AM_WRITE(ojankohs_msm5205_w)
+ AM_RANGE(0x06, 0x06) AM_MIRROR(0xff00) AM_DEVREAD("aysnd", ay8910_device, data_r)
+ AM_RANGE(0x06, 0x07) AM_MIRROR(0xff00) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
+ AM_RANGE(0x08, 0x0f) AM_SELECT(0xff00) AM_WRITE(ccasino_palette_w) // 16bit address access
+ AM_RANGE(0x10, 0x11) AM_MIRROR(0xff00) AM_DEVWRITE("gga", vsystem_gga_device, write)
ADDRESS_MAP_END
ADDRESS_MAP_START(ojankohs_state::ojankoc_io_map)
@@ -812,7 +811,7 @@ MACHINE_CONFIG_START(ojankohs_state::ccasino)
MCFG_DEVICE_ADD("gga", VSYSTEM_GGA, XTAL(13'333'000)/2) // divider not verified
- MCFG_VIDEO_START_OVERRIDE(ojankohs_state,ojankoy)
+ MCFG_VIDEO_START_OVERRIDE(ojankohs_state,ccasino)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/includes/ojankohs.h b/src/mame/includes/ojankohs.h
index d4c904ac00c..11df115fcd4 100644
--- a/src/mame/includes/ojankohs.h
+++ b/src/mame/includes/ojankohs.h
@@ -99,6 +99,7 @@ public:
DECLARE_MACHINE_START(ojankoy);
DECLARE_VIDEO_START(ojankoy);
DECLARE_PALETTE_INIT(ojankoy);
+ DECLARE_VIDEO_START(ccasino);
DECLARE_MACHINE_START(ojankoc);
DECLARE_VIDEO_START(ojankoc);
DECLARE_MACHINE_START(common);
diff --git a/src/mame/video/ojankohs.cpp b/src/mame/video/ojankohs.cpp
index f25bd5b3b89..8e3fa06c6c8 100644
--- a/src/mame/video/ojankohs.cpp
+++ b/src/mame/video/ojankohs.cpp
@@ -70,8 +70,7 @@ WRITE8_MEMBER(ojankohs_state::ccasino_palette_w)
{
int r, g, b;
- /* get top 8 bits of the I/O port address */
- offset = (offset << 8) | (m_maincpu->state_int(Z80_BC) >> 8);
+ offset = bitswap<11>(offset, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8);
m_paletteram[offset] = data;
@@ -270,6 +269,12 @@ VIDEO_START_MEMBER(ojankohs_state,ojankoy)
// m_colorram = std::make_unique<uint8_t[]>(0x1000);
}
+VIDEO_START_MEMBER(ojankohs_state,ccasino)
+{
+ VIDEO_START_CALL_MEMBER(ojankoy);
+ m_paletteram.allocate(0x800);
+}
+
VIDEO_START_MEMBER(ojankohs_state,ojankoc)
{
m_screen->register_screen_bitmap(m_tmpbitmap);