diff options
| author | 2025-09-29 15:17:41 +0200 | |
|---|---|---|
| committer | 2025-09-29 15:17:41 +0200 | |
| commit | 1c8fd6ff6f63b00a276564083b566d6edf13286f (patch) | |
| tree | 25b26b4660bccb823f231f1a0b9288a61756bd50 | |
| parent | 7eb5bff1b4dc0c1ab3e11c1efa10b505319b3c17 (diff) | |
First titanic pass to reorganize and clean goldstar.cpp driver. [Roberto Fresca, Grull Osgo]
| -rw-r--r-- | src/mame/igs/goldstar.cpp | 2361 |
1 files changed, 1192 insertions, 1169 deletions
diff --git a/src/mame/igs/goldstar.cpp b/src/mame/igs/goldstar.cpp index 0c88f8b1e10..8878d3ac586 100644 --- a/src/mame/igs/goldstar.cpp +++ b/src/mame/igs/goldstar.cpp @@ -297,6 +297,13 @@ #include "unkch.lh" +constexpr XTAL MASTER_CLOCK = 12_MHz_XTAL; +constexpr XTAL CPU_CLOCK = MASTER_CLOCK / 4; +constexpr XTAL PSG_CLOCK = MASTER_CLOCK / 4; +constexpr XTAL AY_CLOCK = MASTER_CLOCK / 8; +#define OKI_CLOCK 1056000 // unverified resonator + + namespace { class goldstar_state : public driver_device @@ -849,7 +856,6 @@ private: template <uint8_t Which> TILE_GET_INFO_MEMBER(get_reel_tile_info); }; - class cd3poker_state : public cmaster_state { public: @@ -897,7 +903,6 @@ void cd3poker_state::machine_start() save_item(NAME(m_prot_index)); } - /*************************************************************************** Start the video hardware emulation. @@ -930,6 +935,11 @@ void goldstar_state::bg_atrram_w(offs_t offset, uint8_t data) } +/**************************************************** + Tile Get Info + +****************************************************/ + TILE_GET_INFO_MEMBER(goldstar_state::get_goldstar_fg_tile_info) { int const code = m_fg_vidram[tile_index]; @@ -941,7 +951,6 @@ TILE_GET_INFO_MEMBER(goldstar_state::get_goldstar_fg_tile_info) 0); } - // colour / high tile bits are swapped around TILE_GET_INFO_MEMBER(cmaster_state::get_cherrym_fg_tile_info) { @@ -1017,6 +1026,97 @@ TILE_GET_INFO_MEMBER(goldstar_state::get_reel_tile_info) 0); } + +TILE_GET_INFO_MEMBER(cmast97_state::get_cmast97_bg_tile_info) +{ + int const code = m_bg_vidram[tile_index]; + int const attr = m_bg_atrram[tile_index]; + + tileinfo.set(2, + code | (attr & 0x0f) << 8, + (attr & 0xf0) >> 4, + 0); +} + +template <uint8_t Which> +void sanghopm_state::reel_attrram_w(offs_t offset, uint8_t data) +{ + m_reel_attrram[Which][offset] = data; + m_reel_tilemap[Which]->mark_tile_dirty(offset); +} + + +TILE_GET_INFO_MEMBER(sanghopm_state::get_fg_tile_info) +{ + int const code = m_fg_vidram[tile_index]; + int const attr = m_fg_atrram[tile_index]; + + tileinfo.set(0, + code | (attr & 0x0f) << 8, + (attr & 0x70) >> 4, + 0); +} + +TILE_GET_INFO_MEMBER(sanghopm_state::get_bg_tile_info) +{ + int const code = m_bg_vidram[tile_index]; + int const attr = m_bg_atrram[tile_index]; + + tileinfo.set(1, + code | (attr & 0x0f) << 8, + (attr & 0x70) >> 4, + 0); +} + +template <uint8_t Which> +TILE_GET_INFO_MEMBER(sanghopm_state::get_reel_tile_info) +{ + int const code = m_reel_ram[Which][tile_index]; + int const attr = m_reel_attrram[Which][tile_index]; + + tileinfo.set(1, + code | (attr & 0x0f) << 8, + (attr & 0x70) >> 4, + 0); +} + + +TILE_GET_INFO_MEMBER(wingco_state::get_magical_fg_tile_info) +{ + int const code = m_fg_vidram[tile_index]; + int const attr = m_fg_atrram[tile_index]; + + tileinfo.set(0, + (code | (attr & 0xf0)<<4) + (m_tile_bank * 0x1000), + attr & 0x0f, + 0); +} + +template <uint8_t Which> +void unkch_state::reel_attrram_w(offs_t offset, uint8_t data) +{ + m_reel_attrram[Which][offset] = data; + m_reel_tilemap[Which]->mark_tile_dirty(offset); +} + +template <uint8_t Which> +TILE_GET_INFO_MEMBER(unkch_state::get_reel_tile_info) +{ + int const code = m_reel_ram[Which][tile_index]; + int const attr = m_reel_attrram[Which][tile_index]; + + tileinfo.set(1, + code | (attr & 0x0f) << 8, + (attr & 0xf0) >> 4, + 0); +} + + +/**************************************************** + Video Start + +****************************************************/ + void goldstar_state::video_start() { m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(goldstar_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); @@ -1053,6 +1153,66 @@ void cmaster_state::video_start() m_enable_reg = 0x0b; } +void cmast97_state::video_start() +{ + m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmast97_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + m_reel_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmast97_state::get_reel_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + m_reel_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmast97_state::get_reel_tile_info<2>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + + m_reel_tilemap[0]->set_scroll_cols(64); + m_reel_tilemap[1]->set_scroll_cols(64); + m_reel_tilemap[2]->set_scroll_cols(64); + + m_reel_tilemap[0]->set_transparent_pen(0); + m_reel_tilemap[1]->set_transparent_pen(0); + m_reel_tilemap[2]->set_transparent_pen(0); + + m_cmaster_girl_num = 0; + m_cmaster_girl_pal = 0; + + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmast97_state::get_cherrym_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_fg_tilemap->set_transparent_pen(0); + m_fg_tilemap->set_scrolly(0, -16); + + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmast97_state::get_cmast97_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); +} + +void sanghopm_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sanghopm_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + + m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sanghopm_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + m_reel_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sanghopm_state::get_reel_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + m_reel_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sanghopm_state::get_reel_tile_info<2>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + + m_reel_tilemap[0]->set_scroll_cols(64); + m_reel_tilemap[1]->set_scroll_cols(64); + m_reel_tilemap[2]->set_scroll_cols(64); + + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sanghopm_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_fg_tilemap->set_transparent_pen(0); +} + +void unkch_state::video_start() +{ + m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unkch_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + m_reel_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unkch_state::get_reel_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + m_reel_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unkch_state::get_reel_tile_info<2>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + + m_reel_tilemap[0]->set_scroll_cols(32); + m_reel_tilemap[1]->set_scroll_cols(32); + m_reel_tilemap[2]->set_scroll_cols(32); + + m_cmaster_girl_num = 0; + m_cmaster_girl_pal = 0; + m_vidreg = 0x00; + + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unkch_state::get_cherrym_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_fg_tilemap->set_transparent_pen(0); + + m_enable_reg = 0x0b; +} + VIDEO_START_MEMBER(cmaster_state, pkrmast) { m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmaster_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); @@ -1076,7 +1236,6 @@ VIDEO_START_MEMBER(cmaster_state, pkrmast) m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmaster_state::get_pkrmast_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); // m_enable_reg = 0x1b; - // save_item(NAME(m_reel_bank)); } @@ -1108,18 +1267,41 @@ VIDEO_START_MEMBER(cmaster_state, jkrmast) // save_item(NAME(m_reel_bank)); } -void goldstar_state::goldstar_fa00_w(uint8_t data) +VIDEO_START_MEMBER(wingco_state, bingowng) { - // bit 1 toggles continuously - might be irq enable or watchdog reset - // bit 2 selects background gfx color (I think) - m_bgcolor = (data & 0x04) >> 2; - m_reel_tilemap[0]->mark_all_dirty(); - m_reel_tilemap[1]->mark_all_dirty(); - m_reel_tilemap[2]->mark_all_dirty(); + m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - m_ticket_dispenser->motor_w(BIT(data, 7)); + m_reel_tilemap[0]->set_scroll_cols(64); + + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_goldstar_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_fg_tilemap->set_transparent_pen(0); + + // is there an enable reg for this game? + m_enable_reg = 0x0b; } +VIDEO_START_MEMBER(wingco_state, magical) +{ + m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + m_reel_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_reel_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + m_reel_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_reel_tile_info<2>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); + + m_reel_tilemap[0]->set_scroll_cols(32); + m_reel_tilemap[1]->set_scroll_cols(32); + m_reel_tilemap[2]->set_scroll_cols(32); + + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_magical_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_fg_tilemap->set_transparent_pen(0); + + // is there an enable reg for this game? + m_enable_reg = 0x0b; +} + + +/**************************************************** + Screen Update + +****************************************************/ uint32_t goldstar_state::screen_update_goldstar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { @@ -1174,7 +1356,6 @@ uint32_t goldstar_state::screen_update_goldstar(screen_device &screen, bitmap_rg return 0; } - uint32_t cmaster_state::screen_update_cmast91(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black(), cliprect); @@ -1218,74 +1399,6 @@ uint32_t cmaster_state::screen_update_cmast91(screen_device &screen, bitmap_rgb3 return 0; } - - -void cmaster_state::outport0_w(uint8_t data) -{ -/* - ---- ---x (global enable or irq enable?) - ---- --x- (fg enable) - ---- -x-- (girl enable?) - ---- x--- (reels enable) - xxxx ---- unused? - -*/ -// popmessage("outport %02x",data); - m_enable_reg = data; -} - -void cmaster_state::chyangb_outport0_w(uint8_t data) -{ -// popmessage("outport %02x",data); - m_enable_reg = data & 0xef; // mask bg register flag -} - -void cmaster_state::girl_scroll_w(uint8_t data) -{ -/* - xxxx ---- yscroll - ---- xxxx xscroll - - this isn't very fine scrolling, but i see no other registers. - 1000 1000 is the center of the screen. - -*/ - m_cm_girl_scroll = data; -} - -void cmaster_state::background_col_w(uint8_t data) -{ - //printf("cm_background_col_w %02x\n",data); - - // cherry master writes - // so it's probably - // 0ggg cc00 - // where g is which girl to display and c is the colour palette - // (note, this doesn't apply to the amcoe games which have no girls, - // I'm unsure how the priority/positioning works) - - m_cmaster_girl_num = (data >> 4) & 0x7; - m_cmaster_girl_pal = (data >> 2) & 0x3; - - //bgcolor = (data & 0x03) >> 0; - - // apparently some boards have this colour scheme? - // i'm not convinced it isn't just a different prom on them - #if 0 - m_bgcolor = 0; - m_bgcolor |= (data & 0x01) << 1; - m_bgcolor |= (data & 0x02) >> 1; - #else - m_bgcolor = (data & 0x03) >> 0; - #endif - - m_reel_tilemap[0]->mark_all_dirty(); - m_reel_tilemap[1]->mark_all_dirty(); - m_reel_tilemap[2]->mark_all_dirty(); - -} - - uint32_t cmaster_state::screen_update_amcoe1a(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black(), cliprect); @@ -1322,53 +1435,6 @@ uint32_t cmaster_state::screen_update_amcoe1a(screen_device &screen, bitmap_rgb3 return 0; } - -TILE_GET_INFO_MEMBER(cmast97_state::get_cmast97_bg_tile_info) -{ - int const code = m_bg_vidram[tile_index]; - int const attr = m_bg_atrram[tile_index]; - - tileinfo.set(2, - code | (attr & 0x0f) << 8, - (attr & 0xf0) >> 4, - 0); -} - -void cmast97_state::video_start() -{ - m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmast97_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - m_reel_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmast97_state::get_reel_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - m_reel_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmast97_state::get_reel_tile_info<2>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - - m_reel_tilemap[0]->set_scroll_cols(64); - m_reel_tilemap[1]->set_scroll_cols(64); - m_reel_tilemap[2]->set_scroll_cols(64); - - m_reel_tilemap[0]->set_transparent_pen(0); - m_reel_tilemap[1]->set_transparent_pen(0); - m_reel_tilemap[2]->set_transparent_pen(0); - - m_cmaster_girl_num = 0; - m_cmaster_girl_pal = 0; - - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmast97_state::get_cherrym_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_fg_tilemap->set_transparent_pen(0); - m_fg_tilemap->set_scrolly(0, -16); - - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cmast97_state::get_cmast97_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); -} - -void cmast97_state::cmast97_palette_init(palette_device &palette) const -{ - // TODO: probably wrong - uint8_t const *const colours = memregion("proms")->base(); - for (int i = 0; i < 0x200; i++) - { - uint8_t const data = colours[i]; - palette.set_pen_color(i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); - } -} - uint32_t cmast97_state::screen_update_cmast97(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black(), cliprect); @@ -1399,50 +1465,6 @@ uint32_t cmast97_state::screen_update_cmast97(screen_device &screen, bitmap_rgb3 return 0; } - -TILE_GET_INFO_MEMBER(wingco_state::get_magical_fg_tile_info) -{ - int const code = m_fg_vidram[tile_index]; - int const attr = m_fg_atrram[tile_index]; - - tileinfo.set(0, - (code | (attr & 0xf0)<<4) + (m_tile_bank * 0x1000), - attr & 0x0f, - 0); -} - - -VIDEO_START_MEMBER(wingco_state, bingowng) -{ - m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - - m_reel_tilemap[0]->set_scroll_cols(64); - - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_goldstar_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_fg_tilemap->set_transparent_pen(0); - - // is there an enable reg for this game? - m_enable_reg = 0x0b; -} - -VIDEO_START_MEMBER(wingco_state, magical) -{ - m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - m_reel_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_reel_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - m_reel_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_reel_tile_info<2>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - - m_reel_tilemap[0]->set_scroll_cols(32); - m_reel_tilemap[1]->set_scroll_cols(32); - m_reel_tilemap[2]->set_scroll_cols(32); - - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wingco_state::get_magical_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_fg_tilemap->set_transparent_pen(0); - - // is there an enable reg for this game? - m_enable_reg = 0x0b; -} - - uint32_t wingco_state::screen_update_lucky8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black(), cliprect); @@ -1489,7 +1511,6 @@ uint32_t wingco_state::screen_update_lucky8(screen_device &screen, bitmap_rgb32 return 0; } - uint32_t wingco_state::screen_update_bingowng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black(), cliprect); @@ -1626,7 +1647,6 @@ uint32_t wingco_state::screen_update_magical(screen_device &screen, bitmap_rgb32 return 0; } - uint32_t wingco_state::screen_update_mbstar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black(), cliprect); @@ -1659,67 +1679,6 @@ uint32_t wingco_state::screen_update_mbstar(screen_device &screen, bitmap_rgb32 return 0; } - -template <uint8_t Which> -void sanghopm_state::reel_attrram_w(offs_t offset, uint8_t data) -{ - m_reel_attrram[Which][offset] = data; - m_reel_tilemap[Which]->mark_tile_dirty(offset); -} - - -TILE_GET_INFO_MEMBER(sanghopm_state::get_fg_tile_info) -{ - int const code = m_fg_vidram[tile_index]; - int const attr = m_fg_atrram[tile_index]; - - tileinfo.set(0, - code | (attr & 0x0f) << 8, - (attr & 0x70) >> 4, - 0); -} - -TILE_GET_INFO_MEMBER(sanghopm_state::get_bg_tile_info) -{ - int const code = m_bg_vidram[tile_index]; - int const attr = m_bg_atrram[tile_index]; - - tileinfo.set(1, - code | (attr & 0x0f) << 8, - (attr & 0x70) >> 4, - 0); -} - -template <uint8_t Which> -TILE_GET_INFO_MEMBER(sanghopm_state::get_reel_tile_info) -{ - int const code = m_reel_ram[Which][tile_index]; - int const attr = m_reel_attrram[Which][tile_index]; - - tileinfo.set(1, - code | (attr & 0x0f) << 8, - (attr & 0x70) >> 4, - 0); -} - - -void sanghopm_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sanghopm_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - - m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sanghopm_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - m_reel_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sanghopm_state::get_reel_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - m_reel_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sanghopm_state::get_reel_tile_info<2>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - - m_reel_tilemap[0]->set_scroll_cols(64); - m_reel_tilemap[1]->set_scroll_cols(64); - m_reel_tilemap[2]->set_scroll_cols(64); - - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sanghopm_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_fg_tilemap->set_transparent_pen(0); -} - - uint32_t sanghopm_state::screen_update_sangho(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black(), cliprect); @@ -1752,47 +1711,6 @@ uint32_t sanghopm_state::screen_update_sangho(screen_device &screen, bitmap_rgb3 return 0; } - -template <uint8_t Which> -void unkch_state::reel_attrram_w(offs_t offset, uint8_t data) -{ - m_reel_attrram[Which][offset] = data; - m_reel_tilemap[Which]->mark_tile_dirty(offset); -} - -template <uint8_t Which> -TILE_GET_INFO_MEMBER(unkch_state::get_reel_tile_info) -{ - int const code = m_reel_ram[Which][tile_index]; - int const attr = m_reel_attrram[Which][tile_index]; - - tileinfo.set(1, - code | (attr & 0x0f) << 8, - (attr & 0xf0) >> 4, - 0); -} - - -void unkch_state::video_start() -{ - m_reel_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unkch_state::get_reel_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - m_reel_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unkch_state::get_reel_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - m_reel_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unkch_state::get_reel_tile_info<2>)), TILEMAP_SCAN_ROWS, 8, 32, 64, 8); - - m_reel_tilemap[0]->set_scroll_cols(32); - m_reel_tilemap[1]->set_scroll_cols(32); - m_reel_tilemap[2]->set_scroll_cols(32); - - m_cmaster_girl_num = 0; - m_cmaster_girl_pal = 0; - m_vidreg = 0x00; - - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unkch_state::get_cherrym_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_fg_tilemap->set_transparent_pen(0); - - m_enable_reg = 0x0b; -} - uint32_t unkch_state::screen_update_unkch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { bitmap.fill(rgb_t::black(), cliprect); @@ -1842,6 +1760,179 @@ uint32_t unkch_state::screen_update_unkch(screen_device &screen, bitmap_rgb32 &b return 0; } + +/**************************************************** + Palette Decode Routines + +****************************************************/ + +void cmast97_state::cmast97_palette_init(palette_device &palette) const +{ + // TODO: probably wrong + uint8_t const *const colours = memregion("proms")->base(); + for (int i = 0; i < 0x200; i++) + { + uint8_t const data = colours[i]; + palette.set_pen_color(i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); + } +} + +void goldstar_state::cm_palette(palette_device &palette) const +{ + // BBGGGRRR + uint8_t const *const proms = memregion("proms")->base(); + for (int i = 0; i < 0x100; i++) + { + uint8_t const data = proms[0x000 + i] | (proms[0x100 + i] << 4); + palette.set_pen_color(i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); + } +} + +void cmaster_state::cmast91_palette(palette_device &palette) const +{ + uint8_t const *const proms = memregion("proms")->base(); + for (int i = 0; i < 0x100; i++) + { + int const b = pal4bit(proms[0x000 + i]); + int const g = pal4bit(proms[0x100 + i]); + int const r = pal4bit(proms[0x200 + i]); + + palette.set_pen_color(i, rgb_t(r, g, b)); + } +} + +void goldstar_state::lucky8_palette(palette_device &palette) const +{ + // BBGGGRRR + uint8_t const *proms; + + proms = memregion("proms")->base(); + for (int i = 0; i < 0x100; i++) + { + uint8_t const data = proms[0x000 + i] | (proms[0x100 + i] << 4); + palette.set_pen_color(i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); + } + + proms = memregion("proms2")->base(); + for (int i = 0; i < 0x20; i++) + { + uint8_t const data = proms[i]; + palette.set_pen_color(i + 0x80, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); + } +} + +void cmaster_state::nfm_palette(palette_device &palette) const +{ + // BBGGGRRR + uint8_t const *const colours = memregion("colours")->base(); + for (int i = 0; i < 0x100; i++) + { + uint8_t const data = bitswap<8>(colours[0x000 + i], 3, 2, 1, 0, 7, 6, 5, 4); + palette.set_pen_color(i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); + } + + // TODO: what's 0x100-0x1ff for? For the currently undecoded user1 ROM? +} + + +void wingco_state::magodds_palette(palette_device &palette) const +{ + uint8_t const *const proms = memregion("proms")->base(); + for (int i = 0; i < 0x100; i++) + { + uint8_t const b = pal4bit(proms[0x000 + i]); + uint8_t const g = pal4bit(proms[0x100 + i]); + uint8_t const r = pal4bit(proms[0x200 + i]); + + palette.set_pen_color(i, rgb_t(r, g, b)); + } +} + + +/**************************************************** + Read & Write Handlers + +****************************************************/ + +void goldstar_state::goldstar_fa00_w(uint8_t data) +{ + // bit 1 toggles continuously - might be irq enable or watchdog reset + // bit 2 selects background gfx color (I think) + m_bgcolor = (data & 0x04) >> 2; + m_reel_tilemap[0]->mark_all_dirty(); + m_reel_tilemap[1]->mark_all_dirty(); + m_reel_tilemap[2]->mark_all_dirty(); + + m_ticket_dispenser->motor_w(BIT(data, 7)); +} + + +void cmaster_state::outport0_w(uint8_t data) +{ +/* + ---- ---x (global enable or irq enable?) + ---- --x- (fg enable) + ---- -x-- (girl enable?) + ---- x--- (reels enable) + xxxx ---- unused? + +*/ +// popmessage("outport %02x",data); + m_enable_reg = data; +} + +void cmaster_state::chyangb_outport0_w(uint8_t data) +{ +// popmessage("outport %02x",data); + m_enable_reg = data & 0xef; // mask bg register flag +} + +void cmaster_state::girl_scroll_w(uint8_t data) +{ +/* + xxxx ---- yscroll + ---- xxxx xscroll + + this isn't very fine scrolling, but i see no other registers. + 1000 1000 is the center of the screen. + +*/ + m_cm_girl_scroll = data; +} + +void cmaster_state::background_col_w(uint8_t data) +{ + //printf("cm_background_col_w %02x\n",data); + + // cherry master writes + // so it's probably + // 0ggg cc00 + // where g is which girl to display and c is the colour palette + // (note, this doesn't apply to the amcoe games which have no girls, + // I'm unsure how the priority/positioning works) + + m_cmaster_girl_num = (data >> 4) & 0x7; + m_cmaster_girl_pal = (data >> 2) & 0x3; + + //bgcolor = (data & 0x03) >> 0; + + // apparently some boards have this colour scheme? + // i'm not convinced it isn't just a different prom on them + #if 0 + m_bgcolor = 0; + m_bgcolor |= (data & 0x01) << 1; + m_bgcolor |= (data & 0x02) >> 1; + #else + m_bgcolor = (data & 0x03) >> 0; + #endif + + m_reel_tilemap[0]->mark_all_dirty(); + m_reel_tilemap[1]->mark_all_dirty(); + m_reel_tilemap[2]->mark_all_dirty(); + +} + + void goldstar_state::protection_w(uint8_t data) { if (data == 0x2a) @@ -1912,6 +2003,13 @@ void goldstar_state::p2_lamps_w(uint8_t data) // popmessage("p2 lamps: %02X", data); } + +void wingco_state::masked_irq(int state) +{ + if (state && m_nmi_enable) + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); +} + // lucky bar mcu uint8_t wingco_state::mcu_portb_r() { @@ -1959,6 +2057,475 @@ uint8_t wingco_state::nvram_r(offs_t offset) } +void sanghopm_state::coincount_w(uint8_t data) +{ +/* + 7654 3210 + ---- ---x Coin Out counter. + ---- x--- Coin A counter.. + ---x ---- Coin B counter. + --x- ---- Key In counter. + -x-- ---- Coin C counter. + x--- -xx- Unknown. + +*/ + machine().bookkeeping().coin_counter_w(0, data & 0x08); // counter1 coin a + machine().bookkeeping().coin_counter_w(1, data & 0x10); // counter2 coin b + machine().bookkeeping().coin_counter_w(2, data & 0x20); // counter3 key in + machine().bookkeeping().coin_counter_w(3, data & 0x40); // counter4 coin c + machine().bookkeeping().coin_counter_w(4, data & 0x01); // counter5 payout +} + +void sanghopm_state::enable_w(uint8_t data) +{ + m_enable_reg = data; +} + +void cmaster_state::coincount_w(uint8_t data) +{ +/* bits + 7654 3210 + ---- ---x Coin Out counter + ---- x--- Coin D counter + ---x ---- Coin C counter + --x- ---- Key In counter + -x-- ---- Coin A counter + x--- -xx- unknown + + interestingly there is no counter for coin B in the cm/cmaster games + +*/ + + machine().bookkeeping().coin_counter_w(0, data & 0x40); // Counter 1 Coin A + machine().bookkeeping().coin_counter_w(1, data & 0x20); // Counter 2 Key In + machine().bookkeeping().coin_counter_w(2, data & 0x10); // Counter 3 Coin C + machine().bookkeeping().coin_counter_w(3, data & 0x08); // Counter 4 Coin D + machine().bookkeeping().coin_counter_w(4, data & 0x01); // Counter 5 Payout + +// if (data & 0x86) // triggered by fb2010 +// popmessage("counters: %02X", data); + + m_ticket_dispenser->motor_w(BIT(data,7)); +// popmessage("counters: %02X", data); + +} + +void cmaster_state::pkm_out0_w(uint8_t data) +{ +/* bits + 7654 3210 + ---- x--- Coin D counter + ---x ---- Coin C counter + --x- ---- Key In counter + -x-- ---- Coin A counter +*/ + + machine().bookkeeping().coin_counter_w(0, data & 0x40); // Counter 1 Coin A + machine().bookkeeping().coin_counter_w(1, data & 0x20); // Counter 2 Key In + machine().bookkeeping().coin_counter_w(2, data & 0x10); // Counter 3 Coin C + machine().bookkeeping().coin_counter_w(3, data & 0x08); // Counter 4 Coin D + + m_ticket_dispenser->motor_w(BIT(data,0)); //pkrmast:port 0x00 - jkrmast:port 0x13 +// popmessage("pkm_out0_w: %02X", data); + +} + + +void cmaster_state::jkm_vid_reg_w(uint8_t data) +{ + m_enable_reg = bitswap<8>(data, 7, 6, 5, 4, 2, 3, 1, 0); + +// popmessage("jkm data, enable reg:%02x :: reg:%02x", data, m_enable_reg); + +} + +void cmaster_state::pkm_vid_reg_w(uint8_t data) +{ + m_enable_reg = bitswap<8>(data, 7, 6, 5, 4, 2, 3, 1, 0); + + if(m_enable_reg == 0x1b) + m_enable_reg = 0x13; // if bg activates, reels should be disabled + +// popmessage("pkm enable reg:%02x", m_enable_reg ); +// popmessage("pkm reel bank:%02x", m_reel_bank ); + +} + +void cmaster_state::pkm_reel_reg_w(uint8_t data) +{ +/* + Poker Master hardware is accessing the extended gfx + through the following pairs table: + + girl0 girl1 girl2 girl3 girl4 girl5 + .-----.-----.-----.-----.-----.-----. + 46BE: 10 00 11 80 22 80 33 00 20 00 33 80 FF FF FF FF + -- -- + || || + Where || ''---> internal offset inside the 0x100 tiles bank + |'------> color code (up to 4 colors) + '-------> 0x100 tiles bank number +*/ + m_reel_bank = (data & 0x30) >> 4; + m_bgcolor = (data & 0x01); + m_bg_tilemap->mark_all_dirty(); + +// popmessage("pkm reel data:%02x", data ); + +} + +void cmaster_state::ll3_vid_reg_w(uint8_t data) +{ +/* + ---- ---x global enable + ---- --x- fg enable + ---- -x-- girl enable + ---- x--- reels enable + ---x --- bg enable + xxx- ---- unused + + All the writes have masked the register, getting + the video totally disabled. Surely for protection. + +*/ + if(data > 0) + data = data + 0x01; + m_enable_reg = data; + +// popmessage("ll3 vidreg:%02x", m_enable_reg ); +} + +void cmaster_state::czb_vid_reg_w(uint8_t data) +{ +/* + ---- ---x global enable + xxxx xxx- unused + + Harcoded foreground and reels on. just enable/disable + background, switching with reels off when enable. + +*/ + m_enable_reg = 0x0b; // harcoded + + if(data == 1) + m_enable_reg = 0x13; // if bg activates, reels should be disabled + +// popmessage("enable data:%02x", data ); +} + + +void cb3_state::coincount_w(uint8_t data) +{ + + machine().bookkeeping().coin_counter_w(0, data & 0x40); // Counter 1 Coin A + machine().bookkeeping().coin_counter_w(1, data & 0x20); // Counter 2 Key In + machine().bookkeeping().coin_counter_w(2, data & 0x10); // Counter 3 Coin C + machine().bookkeeping().coin_counter_w(3, data & 0x08); // Counter 4 Coin D + machine().bookkeeping().coin_counter_w(4, data & 0x01); // Counter 5 Payout + +} + +void cb3_state::misc_out_w(uint8_t data) +{ + + m_bgcolor = (data & 0x04) >> 2; + m_reel_tilemap[0]->mark_all_dirty(); + m_reel_tilemap[1]->mark_all_dirty(); + m_reel_tilemap[2]->mark_all_dirty(); + + m_ticket_dispenser->motor_w(!BIT(data,7)); + +} + +void wingco_state::magodds_outb850_w(uint8_t data) +{ + // guess, could be wrong, this might just be lights + + if (data&0x20) + m_tile_bank = 1; + else + m_tile_bank = 0; + +// popmessage("magodds_outb850_w %02x\n", data); + + m_fg_tilemap->mark_all_dirty(); + +} + +void wingco_state::magodds_outb860_w(uint8_t data) +{ +// popmessage("magodds_outb860_w %02x\n", data); +} + +void wingco_state::fl7w4_outc802_w(uint8_t data) +{ + m_fl7w4_id->write((data >> 6) & 0x01); +} + + +void cb3_state::ncb3_port81_w(uint8_t data) +{ +// if (data!=0x00) +// popmessage("ncb3_port81_w %02x\n",data); +} + + +void unkch_state::coincount_w(uint8_t data) +{ +/* + 7654 3210 + ---- --x- Payout counter (rate set with DIP switches) + ---- -x-- Credit counter (1 pulse/10 credits) + ---- x--- Key In counter + --xx ---- used for something during ticket dispensing + x--- ---- Ticket Dispenser Motor + -x-- ---x unused/unknown + +*/ + + m_ticket_dispenser->motor_w(BIT(data, 7)); + + machine().bookkeeping().coin_counter_w(0, data & 0x04); // Credit counter + machine().bookkeeping().coin_counter_w(1, data & 0x08); // Key In counter + machine().bookkeeping().coin_counter_w(2, data & 0x02); // payout counter + +// popmessage("coin counters: %02x", data); +} + +void unkch_state::unkcm_0x02_w(uint8_t data) +{ +/* bits + 7654 3210 + ---- ---x button lamp: Bet-A / Stop 2 + ---- --x- button lamp: Start / Stop All + ---- -x-- button lamp: Info / Small / Stop 3 + ---- x--- button lamp: Big + ---x ---- button lamp: Bet-B / D-Up + --x- ---- button lamp: Take / Stop 1 + -x-- ---- unknown/unused + x--- ---- vblank IRQ enable + + these sets use crude PWM to dim lamp 2 which requires + filament physics simulation to work properly + +*/ + +// popmessage("unkcm_0x02_w %02x", data); + + m_vblank_irq_enable = data & 0x80; + if (!m_vblank_irq_enable) + m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + + m_lamps[0] = BIT(data, 0); // Bet-A / Stop 2 + m_lamps[1] = BIT(data, 1); // Start / Stop All + m_lamps[2] = BIT(data, 2); // Info / Small / Stop 3 + m_lamps[3] = BIT(data, 3); // Big + m_lamps[4] = BIT(data, 4); // Bet-B / D-Up + m_lamps[5] = BIT(data, 5); // Take / Stop 1 +} + +void unkch_state::unkcm_0x03_w(uint8_t data) +{ + // -x-- ---- seems to toggle when a 'normal' tilemap + // should be displayed instead of the reels? + + m_vidreg = data; + +// popmessage("unkcm_0x03_w %02x", data); +} + +#if 0 +void goldstar_state::ladylinr_outport_w(uint8_t data) +{ +/* LAMPS (b840)... + + .... ...x + .... ..x. + .... .x.. + .... x... BET + ...x .... SMALL/INFO + ..x. .... START + .x.. .... + x... .... +*/ +// popmessage("Output: %02X", data); +} +#endif + +void wingco_state::system_outputa_w(uint8_t data) +{ +// popmessage("system_outputa_w %02x",data); +} + +void wingco_state::system_outputb_w(uint8_t data) +{ +// popmessage("system_outputb_w %02x",data); +} + +void wingco_state::system_outputc_w(uint8_t data) +{ + m_nmi_enable = data & 8; + m_vidreg = data & 2; +// popmessage("system_outputc_w %02x",data); + + if (!m_nmi_enable) + m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); + + m_ticket_dispenser->motor_w(!BIT(data, 7)); +// popmessage("system_outputc_w %02x",data); +} + +void wingco_state::megaline_outputa_w(uint8_t data) +{ + m_enable_reg = data & 0x7f; + m_ticket_dispenser->motor_w(BIT(data, 7)); + +// popmessage("megaline_outputa_w %02x",data); +} + +void wingco_state::megaline_outputb_w(uint8_t data) +{ + machine().bookkeeping().coin_counter_w(0, data & 0x01); // counter A coin a + machine().bookkeeping().coin_counter_w(1, data & 0x02); // counter H Key In + machine().bookkeeping().coin_counter_w(2, data & 0x04); // counter B coin c + machine().bookkeeping().coin_counter_w(3, data & 0x08); // counter C coin d + machine().bookkeeping().coin_counter_w(4, data & 0x10); // counter D Hopper Out + machine().bookkeeping().coin_counter_w(5, data & 0x40); // counter F Key Out + +// popmessage("megaline_outputb_w %02x",data); +} + +void wingco_state::megaline_outputc_w(uint8_t data) +{ + m_lamps[0] = BIT(data, 0); + m_lamps[1] = BIT(data, 1); + m_lamps[2] = BIT(data, 2); + m_lamps[3] = BIT(data, 3); + m_lamps[4] = BIT(data, 4); + m_lamps[5] = BIT(data, 5); + m_lamps[6] = BIT(data, 6); + m_lamps[7] = BIT(data, 7); + +// popmessage("megaline_outputc_w %02x",data); +} + +void wingco_state::megaline_outputd_w(uint8_t data) +{ + m_lamps[8+0] = BIT(data, 0); + m_lamps[8+1] = BIT(data, 1); + m_lamps[8+2] = BIT(data, 2); + m_lamps[8+3] = BIT(data, 3); + m_lamps[8+4] = BIT(data, 4); + m_lamps[8+5] = BIT(data, 5); + m_lamps[8+6] = BIT(data, 6); + m_lamps[8+7] = BIT(data, 7); + +// popmessage("megaline_outputd_w %02x",data); +} + +void wingco_state::ay8910_outputa_w(uint8_t data) +{ +// popmessage("ay8910_outputa_w %02x", data); +} + +void wingco_state::ay8910_outputb_w(uint8_t data) +{ +// popmessage("ay8910_outputb_w %02x", data); +} + + +uint8_t wingco_state::tetin3_r() +{ + uint8_t ret = ioport("IN3")->read(); + + if (ret == 0xfe) // r > lucky to tetris + { + if (m_tcount++ == 2) + { + m_z80_p02 = true; + m_tcount = 0; + } + ret = 0xfe; + } + + if (ret == 0xfd) // t > tetris to lucky + { + if (m_tcount++ == 2) + { + m_z80_p02 = false; + m_tcount = 0; + } + ret = 0xfd; + } + return ret; +} + +uint8_t wingco_state::z80_io_r(offs_t offset) +{ + if (offset == 0x01) + return 0x00; // returning a different value inhibits the game swap (comprobed). Asign an input toggle to give functionality. + + if (offset == 0x02) + return m_z80_p02; + + if (offset == 0x32) + return 00; + + if (offset == 0xc0) + { + logerror("z80_io_r: offset:%02x\n", offset); + return m_z80_io_c0; + } + +// logerror("z80_io_r: offset:%02x\n", offset); // investigate functionality ports 0x31, 0x32, 0xc0. + return machine().rand() & 0x0f; +} + +void wingco_state::z80_io_w(offs_t offset, uint8_t data) +{ + if (offset == 0xc0) + m_z80_io_c0 = data; + logerror("Z80_io_w(): offset:%02x - data: %02x\n", offset, data); // investigate functionality port 0xc0 +} + +void wingco_state::tmcu_io_w(offs_t offset, uint8_t data) +{ + if ((offset != 0x122) & (offset != 0x123)) + logerror("tmcu_io Write: Offs:%04x - Data:%02x\n", offset, data); +} + +uint8_t wingco_state::tmcu_io_r(offs_t offset) +{ + return 0x00; +} + +void wingco_state::tmcu_p1_out(uint8_t data) +{ + m_mcu_p1 = data; +// logerror("MCU Port1:%02x\n", tmcu_p1_out); + +} + +uint8_t cd3poker_state::armaly_prot_r() +{ + int index = m_prot_index; + if (!machine().side_effects_disabled()) + { + if (++m_prot_index > 0x10) + m_prot_index = 0; + } + + if (index < 0x0f) + return "ANISA_ARMALY<=>"[index]; + else + return index == 0x0f ? 0xa5 : 0x5a; +} + +/**************************************************** + Memory Map Information + +****************************************************/ + void goldstar_state::goldstar_map(address_map &map) { map(0x0000, 0xb7ff).rom(); @@ -1976,8 +2543,6 @@ void goldstar_state::goldstar_map(address_map &map) map(0xf800, 0xf800).portr("IN0"); map(0xf801, 0xf801).portr("IN1"); // Test Mode map(0xf802, 0xf802).portr("DSW1"); -// map(0xf803, 0xf803) -// map(0xf804, 0xf804) map(0xf805, 0xf805).portr("DSW4"); // DSW 4 (also appears in 8910 port) map(0xf806, 0xf806).portr("DSW7"); map(0xf810, 0xf810).portr("UNK1"); @@ -2041,7 +2606,6 @@ void goldstar_state::super9_portmap(address_map &map) map(0x10, 0x10).portr("DSW5"); // DSW5 ok } - void sanghopm_state::star100_map(address_map &map) { map(0x0000, 0xbfff).rom(); @@ -2073,31 +2637,6 @@ void sanghopm_state::star100_map(address_map &map) } - -void sanghopm_state::coincount_w(uint8_t data) -{ -/* - 7654 3210 - ---- ---x Coin Out counter. - ---- x--- Coin A counter.. - ---x ---- Coin B counter. - --x- ---- Key In counter. - -x-- ---- Coin C counter. - x--- -xx- Unknown. - -*/ - machine().bookkeeping().coin_counter_w(0, data & 0x08); // counter1 coin a - machine().bookkeeping().coin_counter_w(1, data & 0x10); // counter2 coin b - machine().bookkeeping().coin_counter_w(2, data & 0x20); // counter3 key in - machine().bookkeeping().coin_counter_w(3, data & 0x40); // counter4 coin c - machine().bookkeeping().coin_counter_w(4, data & 0x01); // counter5 payout -} - -void sanghopm_state::enable_w(uint8_t data) -{ - m_enable_reg = data; -} - void sanghopm_state::star100_readport(address_map &map) { map.global_mask(0xff); @@ -2159,124 +2698,6 @@ void sanghopm_state::star100_readport(address_map &map) */ -void sanghopm_state::ramdac_map(address_map &map) -{ - map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); -} - -/* - RAMDAC written commands: - - 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D - ------------- ------------- ------------- ------------- - 00 00 00 00 10 00 00 00 20 00 00 00 30 00 00 00 - 01 E8 18 06 11 E8 18 06 21 E8 18 06 31 E8 18 06 - 02 FC EA 00 12 FC EA 00 22 FC EA 00 32 FC EA 00 - 03 FF FF 00 13 FF FF 00 23 FF FF 00 33 FF FF 00 - 04 FF 00 00 14 FF 00 00 24 FF 00 00 34 FF 00 00 - 05 00 00 FF 15 00 00 FF 25 00 00 FF 35 00 00 FF - 06 00 E6 00 16 00 E6 00 26 00 E6 00 36 00 E6 00 - 07 01 F0 02 17 01 F0 02 27 01 F0 02 37 01 F0 02 - 08 EF FF E8 18 EF FF E8 28 EF FF E8 38 EF FF E8 - 09 12 08 F2 19 12 08 F2 29 12 08 F2 39 12 08 F2 - 0A 1A 12 FF 1A 1A 12 FF 2A 1A 12 FF 3A 1A 12 FF - 0B 1F 1F F9 1B 1F 1F F9 2B 1F 1F F9 3B 1F 1F F9 - 0C F9 F9 F9 1C F9 F9 F9 2C F9 F9 F9 3C F9 F9 F9 - 0D EF 18 00 1D EF 18 00 2D EF 18 00 3D EF 18 00 - 0E F0 F0 F0 1E F0 F0 F0 2E F0 F0 F0 3E F0 F0 F0 - 0F FF FF FF 1F FF 00 00 2F 00 FF FF 3F 00 FF 00 - - - 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D - ------------- ------------- ------------- ------------- - 40 00 00 00 50 00 00 00 60 00 00 00 70 00 00 00 - 41 E8 18 06 51 E8 18 06 61 E8 18 06 71 E8 18 06 - 42 FC EA 00 52 FC EA 00 62 FC EA 00 72 FC EA 00 - 43 FF FF 00 53 FF FF 00 63 FF FF 00 73 FF FF 00 - 44 FF 00 00 54 FF 00 00 64 FF 00 00 74 FF 00 00 - 45 00 00 FF 55 00 00 FF 65 00 00 FF 75 00 00 FF - 46 00 E6 00 56 00 E6 00 66 00 E6 00 76 00 E6 00 - 47 01 F0 02 57 01 F0 02 67 01 F0 02 77 01 F0 02 - 48 EF FF E8 58 EF FF E8 68 EF FF E8 78 EF FF E8 - 49 12 08 F2 59 12 08 F2 69 12 08 F2 79 12 08 F2 - 4A 1A 12 FF 5A 1A 12 FF 6A 1A 12 FF 7A 1A 12 FF - 4B 1F 1F F9 5B 1F 1F F9 6B 1F 1F F9 7B 1F 1F F9 - 4C F9 F9 F9 5C F9 F9 F9 6C F9 F9 F9 7C F9 F9 F9 - 4D EF 18 00 5D EF 18 00 6D EF 18 00 7D EF 18 00 - 4E F0 F0 F0 5E 01 EC FF 6E 00 00 00 7E 00 00 00 - 4F FF FF 00 5F 00 00 00 6F 01 EC FF 7F 00 00 00 - - - 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D - ------------- ------------- ------------- ------------- - 80 28 28 28 90 28 28 28 A0 28 28 28 B0 28 28 28 - 81 FF ED E3 91 0B 00 00 A1 18 11 00 B1 02 16 00 - 82 FF F7 1E 92 13 00 00 A2 00 E1 00 B2 02 E1 00 - 83 FF F8 18 93 1C 00 00 A3 00 E8 00 B3 01 ED 02 - 84 14 0B 0B 94 E5 00 00 A4 13 F0 00 B4 02 FA 09 - 85 1F 10 0A 95 ED 00 00 A5 FF F7 1E B5 F1 1A 00 - 86 E3 13 08 96 F6 00 00 A6 FF F0 EE B6 F1 EA 00 - 87 E8 18 06 97 FF 05 0D A7 EF 18 00 B7 1F 00 00 - 88 EC 1E 03 98 FF 0C 13 A8 F4 1B 00 B8 F2 00 00 - 89 F0 E3 02 99 FF 13 19 A9 FD 1F 00 B9 FF 00 00 - 8A F5 E9 01 9A FF 1A 1F AA FF E3 00 BA FF 0C 02 - 8B FA EF 01 9B FF E2 E6 AB FF EA 00 BB FF 18 06 - 8C FF F6 00 9C FF E9 EC AC FF F1 00 BC FF E3 0A - 8D FF FF 00 9D FF F0 F2 AD FF F8 00 BD FF EC 19 - 8E FF FF 1F 9E FF F7 F8 AE FF FF 00 BE FF F4 1F - 8F FF FF FF 9F FF FF FF AF FF FF 1F BF FF FF FF - - - 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D - ------------- ------------- ------------- ------------- - C0 28 28 28 D0 28 28 28 E0 28 28 28 F0 12 12 E0 - C1 F1 E6 00 D1 00 00 E4 E1 00 05 00 F1 1B 00 00 - C2 F8 F1 00 D2 00 00 FF E2 00 0A 00 F2 E0 10 04 - C3 FF FF 00 D3 00 13 FF E3 00 10 00 F3 E9 14 05 - C4 14 07 E7 D4 00 1A FF E4 00 15 00 F4 EF 1E 12 - C5 15 0C EF D5 00 E8 FF E5 00 1B 00 F5 EC E3 1A - C6 1A 12 FA D6 16 0B 00 E6 00 E0 00 F6 EE 05 04 - C7 1B 16 FA D7 19 0F 00 E7 00 E6 00 F7 F4 05 04 - C8 1D 1A FB D8 1D 14 00 E8 04 EC 05 F8 FE 04 04 - C9 1F 1E FC D9 E5 1A 00 E9 0C F2 0E F9 F6 E4 15 - CA E2 E2 FC DA EE E0 00 EA 15 F8 18 FA F8 EC E0 - CB E6 E7 FD DB F6 E6 00 EB E0 FF E3 FB FD F0 E4 - CC EA EC FE DC FF ED 00 EC FD 0C 02 FC FF F6 E7 - CD EF F1 FF DD FF F6 00 ED FD 12 0D FD FF FA EA - CE F6 F8 FF DE FF FF 00 EE FE 1A 18 FE FF FF F2 - CF FF FF FF DF FF FF FF EF FF E4 E4 FF FF FF FF - - - And set again.... - - 1C 1D 1D 1D 1C 1D 1D 1D - ------------- ------------- - 70 00 00 00 F0 12 12 E0 - 71 18 0C F6 F1 1B 00 00 - 72 1B 13 0B F2 E0 10 04 - 73 E1 15 1E F3 E9 14 05 - 74 F3 E9 E4 F4 EF 1E 12 - 75 F3 E7 00 F5 EC E3 1A - 76 FE 17 E3 F6 EE 05 04 - 77 FE 0C F1 F7 F4 05 04 - 78 FD E3 13 F8 FE 04 04 - 79 FE ED 05 F9 F6 E4 15 - 7A FF F5 03 FA F8 EC E0 - 7B FF FB 14 FB FD F0 E4 - 7C FC FB FA FC FF F6 E7 - 7D FF FC E0 FD FF FA EA - 7E FE FE FC FE FF FF F2 - 7F FF 00 FF FF FF FF FF - -*/ - - -void cb3_state::ncb3_port81_w(uint8_t data) -{ -// if (data!=0x00) -// popmessage("ncb3_port81_w %02x\n",data); -} - void cb3_state::ncb3_map(address_map &map) { @@ -2659,168 +3080,6 @@ void cmaster_state::animalhs_map(address_map &map) map(0xf800, 0xffff).ram(); } -void cmaster_state::ramdac_map(address_map &map) -{ - map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); -} - - -void cmaster_state::coincount_w(uint8_t data) -{ -/* bits - 7654 3210 - ---- ---x Coin Out counter - ---- x--- Coin D counter - ---x ---- Coin C counter - --x- ---- Key In counter - -x-- ---- Coin A counter - x--- -xx- unknown - - interestingly there is no counter for coin B in the cm/cmaster games - -*/ - - machine().bookkeeping().coin_counter_w(0, data & 0x40); // Counter 1 Coin A - machine().bookkeeping().coin_counter_w(1, data & 0x20); // Counter 2 Key In - machine().bookkeeping().coin_counter_w(2, data & 0x10); // Counter 3 Coin C - machine().bookkeeping().coin_counter_w(3, data & 0x08); // Counter 4 Coin D - machine().bookkeeping().coin_counter_w(4, data & 0x01); // Counter 5 Payout - -// if (data & 0x86) // triggered by fb2010 -// popmessage("counters: %02X", data); - - m_ticket_dispenser->motor_w(BIT(data,7)); -// popmessage("counters: %02X", data); - -} - -void cmaster_state::pkm_out0_w(uint8_t data) -{ -/* bits - 7654 3210 - ---- x--- Coin D counter - ---x ---- Coin C counter - --x- ---- Key In counter - -x-- ---- Coin A counter -*/ - - machine().bookkeeping().coin_counter_w(0, data & 0x40); // Counter 1 Coin A - machine().bookkeeping().coin_counter_w(1, data & 0x20); // Counter 2 Key In - machine().bookkeeping().coin_counter_w(2, data & 0x10); // Counter 3 Coin C - machine().bookkeeping().coin_counter_w(3, data & 0x08); // Counter 4 Coin D - - m_ticket_dispenser->motor_w(BIT(data,0)); //pkrmast:port 0x00 - jkrmast:port 0x13 -// popmessage("pkm_out0_w: %02X", data); - -} - - -void cmaster_state::jkm_vid_reg_w(uint8_t data) -{ - m_enable_reg = bitswap<8>(data, 7, 6, 5, 4, 2, 3, 1, 0); - -// popmessage("jkm data, enable reg:%02x :: reg:%02x", data, m_enable_reg); - -} - -void cmaster_state::pkm_vid_reg_w(uint8_t data) -{ - m_enable_reg = bitswap<8>(data, 7, 6, 5, 4, 2, 3, 1, 0); - - if(m_enable_reg == 0x1b) - m_enable_reg = 0x13; // if bg activates, reels should be disabled - -// popmessage("pkm enable reg:%02x", m_enable_reg ); -// popmessage("pkm reel bank:%02x", m_reel_bank ); - -} - -void cmaster_state::pkm_reel_reg_w(uint8_t data) -{ -/* - Poker Master hardware is accessing the extended gfx - through the following pairs table: - - girl0 girl1 girl2 girl3 girl4 girl5 - .-----.-----.-----.-----.-----.-----. - 46BE: 10 00 11 80 22 80 33 00 20 00 33 80 FF FF FF FF - -- -- - || || - Where || ''---> internal offset inside the 0x100 tiles bank - |'------> color code (up to 4 colors) - '-------> 0x100 tiles bank number -*/ - m_reel_bank = (data & 0x30) >> 4; - m_bgcolor = (data & 0x01); - m_bg_tilemap->mark_all_dirty(); - -// popmessage("pkm reel data:%02x", data ); - -} - -void cmaster_state::ll3_vid_reg_w(uint8_t data) -{ -/* - ---- ---x global enable - ---- --x- fg enable - ---- -x-- girl enable - ---- x--- reels enable - ---x --- bg enable - xxx- ---- unused - - All the writes have masked the register, getting - the video totally disabled. Surely for protection. - -*/ - if(data > 0) - data = data + 0x01; - m_enable_reg = data; - -// popmessage("ll3 vidreg:%02x", m_enable_reg ); -} - -void cmaster_state::czb_vid_reg_w(uint8_t data) -{ -/* - ---- ---x global enable - xxxx xxx- unused - - Harcoded foreground and reels on. just enable/disable - background, switching with reels off when enable. - -*/ - m_enable_reg = 0x0b; // harcoded - - if(data == 1) - m_enable_reg = 0x13; // if bg activates, reels should be disabled - -// popmessage("enable data:%02x", data ); -} - - -void cb3_state::coincount_w(uint8_t data) -{ - - machine().bookkeeping().coin_counter_w(0, data & 0x40); // Counter 1 Coin A - machine().bookkeeping().coin_counter_w(1, data & 0x20); // Counter 2 Key In - machine().bookkeeping().coin_counter_w(2, data & 0x10); // Counter 3 Coin C - machine().bookkeeping().coin_counter_w(3, data & 0x08); // Counter 4 Coin D - machine().bookkeeping().coin_counter_w(4, data & 0x01); // Counter 5 Payout - -} - -void cb3_state::misc_out_w(uint8_t data) -{ - - m_bgcolor = (data & 0x04) >> 2; - m_reel_tilemap[0]->mark_all_dirty(); - m_reel_tilemap[1]->mark_all_dirty(); - m_reel_tilemap[2]->mark_all_dirty(); - - m_ticket_dispenser->motor_w(!BIT(data,7)); - -} - void cmaster_state::cm_portmap(address_map &map) { @@ -3335,31 +3594,6 @@ void wingco_state::mbstar_map(address_map &map) } -void wingco_state::magodds_outb850_w(uint8_t data) -{ - // guess, could be wrong, this might just be lights - - if (data&0x20) - m_tile_bank = 1; - else - m_tile_bank = 0; - -// popmessage("magodds_outb850_w %02x\n", data); - - m_fg_tilemap->mark_all_dirty(); - -} - -void wingco_state::magodds_outb860_w(uint8_t data) -{ -// popmessage("magodds_outb860_w %02x\n", data); -} - -void wingco_state::fl7w4_outc802_w(uint8_t data) -{ - m_fl7w4_id->write((data >> 6) & 0x01); -} - void wingco_state::magodds_map(address_map &map) { map(0x0000, 0x7fff).rom(); @@ -3410,24 +3644,6 @@ void goldstar_state::kkotnoli_map(address_map &map) } -#if 0 -void goldstar_state::ladylinr_outport_w(uint8_t data) -{ -/* LAMPS (b840)... - - .... ...x - .... ..x. - .... .x.. - .... x... BET - ...x .... SMALL/INFO - ..x. .... START - .x.. .... - x... .... -*/ -// popmessage("Output: %02X", data); -} -#endif - void goldstar_state::ladylinr_map(address_map &map) { map(0x0000, 0x7fff).rom(); @@ -3504,71 +3720,6 @@ void unkch_state::unkch_map(address_map &map) } -void unkch_state::coincount_w(uint8_t data) -{ -/* - 7654 3210 - ---- --x- Payout counter (rate set with DIP switches) - ---- -x-- Credit counter (1 pulse/10 credits) - ---- x--- Key In counter - --xx ---- used for something during ticket dispensing - x--- ---- Ticket Dispenser Motor - -x-- ---x unused/unknown - -*/ - - m_ticket_dispenser->motor_w(BIT(data, 7)); - - machine().bookkeeping().coin_counter_w(0, data & 0x04); // Credit counter - machine().bookkeeping().coin_counter_w(1, data & 0x08); // Key In counter - machine().bookkeeping().coin_counter_w(2, data & 0x02); // payout counter - -// popmessage("coin counters: %02x", data); -} - -void unkch_state::unkcm_0x02_w(uint8_t data) -{ -/* bits - 7654 3210 - ---- ---x button lamp: Bet-A / Stop 2 - ---- --x- button lamp: Start / Stop All - ---- -x-- button lamp: Info / Small / Stop 3 - ---- x--- button lamp: Big - ---x ---- button lamp: Bet-B / D-Up - --x- ---- button lamp: Take / Stop 1 - -x-- ---- unknown/unused - x--- ---- vblank IRQ enable - - these sets use crude PWM to dim lamp 2 which requires - filament physics simulation to work properly - -*/ - -// popmessage("unkcm_0x02_w %02x", data); - - m_vblank_irq_enable = data & 0x80; - if (!m_vblank_irq_enable) - m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); - - m_lamps[0] = BIT(data, 0); // Bet-A / Stop 2 - m_lamps[1] = BIT(data, 1); // Start / Stop All - m_lamps[2] = BIT(data, 2); // Info / Small / Stop 3 - m_lamps[3] = BIT(data, 3); // Big - m_lamps[4] = BIT(data, 4); // Bet-B / D-Up - m_lamps[5] = BIT(data, 5); // Take / Stop 1 -} - -void unkch_state::unkcm_0x03_w(uint8_t data) -{ - // -x-- ---- seems to toggle when a 'normal' tilemap - // should be displayed instead of the reels? - - m_vidreg = data; - -// popmessage("unkcm_0x03_w %02x", data); -} - - void unkch_state::unkch_portmap(address_map &map) { map.global_mask(0xff); @@ -3723,6 +3874,7 @@ void goldstar_state::feverch_map(address_map &map) map(0xf000, 0xffff).ram(); } + void goldstar_state::feverch_portmap(address_map &map) { map.global_mask(0xff); @@ -3735,6 +3887,156 @@ void goldstar_state::feverch_portmap(address_map &map) //map(0x38, 0x3b) } + +void cd3poker_state::cd3poker_map(address_map &map) +{ + map(0x0000, 0x9fff).rom(); + + map(0xa000, 0xa000).r(FUNC(cd3poker_state::armaly_prot_r)); + + map(0xd000, 0xd7ff).ram().share("nvram"); + map(0xd800, 0xdfff).ram(); + + map(0xe000, 0xe7ff).ram().w(FUNC(cd3poker_state::fg_vidram_w)).share(m_fg_vidram); + map(0xe800, 0xefff).ram().w(FUNC(cd3poker_state::fg_atrram_w)).share(m_fg_atrram); + + map(0xf000, 0xf1ff).ram().w(FUNC(cd3poker_state::reel_ram_w<0>)).share(m_reel_ram[0]); + map(0xf200, 0xf3ff).ram().w(FUNC(cd3poker_state::reel_ram_w<1>)).share(m_reel_ram[1]); + map(0xf400, 0xf5ff).ram().w(FUNC(cd3poker_state::reel_ram_w<2>)).share(m_reel_ram[2]); + map(0xf600, 0xf7ff).ram(); + + map(0xf800, 0xf87f).ram().share(m_reel_scroll[0]); + map(0xf880, 0xf9ff).ram(); + map(0xfa00, 0xfa7f).ram().share(m_reel_scroll[1]); + map(0xfa80, 0xfbff).ram(); + map(0xfc00, 0xfc7f).ram().share(m_reel_scroll[2]); + map(0xfc80, 0xffff).ram(); +} + + +void cmaster_state::ramdac_map(address_map &map) +{ + map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); +} + + +void sanghopm_state::ramdac_map(address_map &map) +{ + map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); +} + +/* + RAMDAC written commands: + + 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D + ------------- ------------- ------------- ------------- + 00 00 00 00 10 00 00 00 20 00 00 00 30 00 00 00 + 01 E8 18 06 11 E8 18 06 21 E8 18 06 31 E8 18 06 + 02 FC EA 00 12 FC EA 00 22 FC EA 00 32 FC EA 00 + 03 FF FF 00 13 FF FF 00 23 FF FF 00 33 FF FF 00 + 04 FF 00 00 14 FF 00 00 24 FF 00 00 34 FF 00 00 + 05 00 00 FF 15 00 00 FF 25 00 00 FF 35 00 00 FF + 06 00 E6 00 16 00 E6 00 26 00 E6 00 36 00 E6 00 + 07 01 F0 02 17 01 F0 02 27 01 F0 02 37 01 F0 02 + 08 EF FF E8 18 EF FF E8 28 EF FF E8 38 EF FF E8 + 09 12 08 F2 19 12 08 F2 29 12 08 F2 39 12 08 F2 + 0A 1A 12 FF 1A 1A 12 FF 2A 1A 12 FF 3A 1A 12 FF + 0B 1F 1F F9 1B 1F 1F F9 2B 1F 1F F9 3B 1F 1F F9 + 0C F9 F9 F9 1C F9 F9 F9 2C F9 F9 F9 3C F9 F9 F9 + 0D EF 18 00 1D EF 18 00 2D EF 18 00 3D EF 18 00 + 0E F0 F0 F0 1E F0 F0 F0 2E F0 F0 F0 3E F0 F0 F0 + 0F FF FF FF 1F FF 00 00 2F 00 FF FF 3F 00 FF 00 + + + 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D + ------------- ------------- ------------- ------------- + 40 00 00 00 50 00 00 00 60 00 00 00 70 00 00 00 + 41 E8 18 06 51 E8 18 06 61 E8 18 06 71 E8 18 06 + 42 FC EA 00 52 FC EA 00 62 FC EA 00 72 FC EA 00 + 43 FF FF 00 53 FF FF 00 63 FF FF 00 73 FF FF 00 + 44 FF 00 00 54 FF 00 00 64 FF 00 00 74 FF 00 00 + 45 00 00 FF 55 00 00 FF 65 00 00 FF 75 00 00 FF + 46 00 E6 00 56 00 E6 00 66 00 E6 00 76 00 E6 00 + 47 01 F0 02 57 01 F0 02 67 01 F0 02 77 01 F0 02 + 48 EF FF E8 58 EF FF E8 68 EF FF E8 78 EF FF E8 + 49 12 08 F2 59 12 08 F2 69 12 08 F2 79 12 08 F2 + 4A 1A 12 FF 5A 1A 12 FF 6A 1A 12 FF 7A 1A 12 FF + 4B 1F 1F F9 5B 1F 1F F9 6B 1F 1F F9 7B 1F 1F F9 + 4C F9 F9 F9 5C F9 F9 F9 6C F9 F9 F9 7C F9 F9 F9 + 4D EF 18 00 5D EF 18 00 6D EF 18 00 7D EF 18 00 + 4E F0 F0 F0 5E 01 EC FF 6E 00 00 00 7E 00 00 00 + 4F FF FF 00 5F 00 00 00 6F 01 EC FF 7F 00 00 00 + + + 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D + ------------- ------------- ------------- ------------- + 80 28 28 28 90 28 28 28 A0 28 28 28 B0 28 28 28 + 81 FF ED E3 91 0B 00 00 A1 18 11 00 B1 02 16 00 + 82 FF F7 1E 92 13 00 00 A2 00 E1 00 B2 02 E1 00 + 83 FF F8 18 93 1C 00 00 A3 00 E8 00 B3 01 ED 02 + 84 14 0B 0B 94 E5 00 00 A4 13 F0 00 B4 02 FA 09 + 85 1F 10 0A 95 ED 00 00 A5 FF F7 1E B5 F1 1A 00 + 86 E3 13 08 96 F6 00 00 A6 FF F0 EE B6 F1 EA 00 + 87 E8 18 06 97 FF 05 0D A7 EF 18 00 B7 1F 00 00 + 88 EC 1E 03 98 FF 0C 13 A8 F4 1B 00 B8 F2 00 00 + 89 F0 E3 02 99 FF 13 19 A9 FD 1F 00 B9 FF 00 00 + 8A F5 E9 01 9A FF 1A 1F AA FF E3 00 BA FF 0C 02 + 8B FA EF 01 9B FF E2 E6 AB FF EA 00 BB FF 18 06 + 8C FF F6 00 9C FF E9 EC AC FF F1 00 BC FF E3 0A + 8D FF FF 00 9D FF F0 F2 AD FF F8 00 BD FF EC 19 + 8E FF FF 1F 9E FF F7 F8 AE FF FF 00 BE FF F4 1F + 8F FF FF FF 9F FF FF FF AF FF FF 1F BF FF FF FF + + + 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D + ------------- ------------- ------------- ------------- + C0 28 28 28 D0 28 28 28 E0 28 28 28 F0 12 12 E0 + C1 F1 E6 00 D1 00 00 E4 E1 00 05 00 F1 1B 00 00 + C2 F8 F1 00 D2 00 00 FF E2 00 0A 00 F2 E0 10 04 + C3 FF FF 00 D3 00 13 FF E3 00 10 00 F3 E9 14 05 + C4 14 07 E7 D4 00 1A FF E4 00 15 00 F4 EF 1E 12 + C5 15 0C EF D5 00 E8 FF E5 00 1B 00 F5 EC E3 1A + C6 1A 12 FA D6 16 0B 00 E6 00 E0 00 F6 EE 05 04 + C7 1B 16 FA D7 19 0F 00 E7 00 E6 00 F7 F4 05 04 + C8 1D 1A FB D8 1D 14 00 E8 04 EC 05 F8 FE 04 04 + C9 1F 1E FC D9 E5 1A 00 E9 0C F2 0E F9 F6 E4 15 + CA E2 E2 FC DA EE E0 00 EA 15 F8 18 FA F8 EC E0 + CB E6 E7 FD DB F6 E6 00 EB E0 FF E3 FB FD F0 E4 + CC EA EC FE DC FF ED 00 EC FD 0C 02 FC FF F6 E7 + CD EF F1 FF DD FF F6 00 ED FD 12 0D FD FF FA EA + CE F6 F8 FF DE FF FF 00 EE FE 1A 18 FE FF FF F2 + CF FF FF FF DF FF FF FF EF FF E4 E4 FF FF FF FF + + + And set again.... + + 1C 1D 1D 1D 1C 1D 1D 1D + ------------- ------------- + 70 00 00 00 F0 12 12 E0 + 71 18 0C F6 F1 1B 00 00 + 72 1B 13 0B F2 E0 10 04 + 73 E1 15 1E F3 E9 14 05 + 74 F3 E9 E4 F4 EF 1E 12 + 75 F3 E7 00 F5 EC E3 1A + 76 FE 17 E3 F6 EE 05 04 + 77 FE 0C F1 F7 F4 05 04 + 78 FD E3 13 F8 FE 04 04 + 79 FE ED 05 F9 F6 E4 15 + 7A FF F5 03 FA F8 EC E0 + 7B FF FB 14 FB FD F0 E4 + 7C FC FB FA FC FF F6 E7 + 7D FF FC E0 FD FF FA EA + 7E FE FE FC FE FF FF F2 + 7F FF 00 FF FF FF FF FF + +*/ + + +/**************************************************** + Input Ports + +****************************************************/ + static INPUT_PORTS_START( cmv4_player ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -11516,7 +11818,8 @@ INPUT_PORTS_END /***************************************************** -* Graphics Layouts & Decode * + Graphics Layouts & Decode + *****************************************************/ static const gfx_layout charlayout = @@ -11878,6 +12181,113 @@ static const gfx_layout flam7_tw_tilelayout = // FIXME 128*8 // every char takes 128 consecutive bytes }; +static const gfx_layout tiles8x32_4bpp_layout = +{ + 8,32, + RGN_FRAC(1,4), + 4, + { RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) }, + { 0, 1, 2, 3, 4, 5, 6, 7}, + { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, + 13*8, 14*8, 15*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8, + 24*8, 25*8, 26*8, 27*8, 28*8, 29*8, 30*8, 31*8 }, + 32*8 +}; + +static const gfx_layout tiles8x8_3bpp_layout = +{ + 8,8, + RGN_FRAC(1,3), + 3, + { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) }, + { 0, 1, 2, 3, 4, 5, 6, 7}, + { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, + 8*8 +}; + +static const gfx_layout tiles8x8x3_miss1bpp_layout = +{ + 8,8, + RGN_FRAC(1,1), + 3, + { 1, 2, 3 }, + { 8, 12, 0, 4, 24, 28, 16, 20 }, + { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, + 8*32 +}; + + +static const gfx_layout tiles8x32x4alt2_layout = +{ + 8,32, + RGN_FRAC(1,1), + 4, + { 0, 1, 2, 3 }, + { 4, 0, 12, 8, 20, 16, 28, 24 }, + { STEP32(0,32) }, + 32*32 +}; + +static const gfx_layout tilescherrys_layout = +{ + 8,32, + RGN_FRAC(1,1), + 4, + { 3, 2, 1, 0 }, + { 8, 12, 0, 4, 24, 28, 16, 20 }, + { STEP32(0,32) }, + 32*32 +}; + +static const gfx_layout tiles8x32x4pkr_layout = +{ + 8,32, // 8*32 characters + RGN_FRAC(1,1), // 1024 characters + 4, // 4 bits per pixel + { 0, 2, 4, 6 }, // the bitplanes are packed in one byte + { 0*8+0, 0*8+1, 1*8+0, 1*8+1, 2*8+0, 2*8+1, 3*8+0, 3*8+1 }, + { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, + 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32, + 16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32, + 24*32, 25*32, 26*32, 27*32, 28*32, 29*32, 30*32, 31*32 }, + 8*32*4 // every char takes 128 consecutive bytes +}; + +static const gfx_layout cmast97_layout = +{ + 8,8, + RGN_FRAC(1,1), + 4, + { 0, 1, 2, 3 }, + { 8, 12, 0, 4, 24, 28, 16, 20 }, + { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, + 8*32 +}; + +static const gfx_layout cmast97_layout32 = +{ + 8,32, + RGN_FRAC(1,1), + 4, + { 0,1,2,3 }, + { 8,12,0,4,24,28, 16,20 }, + { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, + 12*32, 13*32, 14*32, 15*32, 16*32, 17*32, 18*32, 19*32, 20*32, 21*32, + 22*32, 23*32, 24*32, 25*32, 26*32, 27*32, 28*32, 29*32, 30*32, 31*32 }, + 32*32 +}; + +static const gfx_layout animalhs_tiles8x32_layout = +{ + 8,32, + RGN_FRAC(1,1), + 4, + { STEP4(0,1) }, + { STEP8(0,4) }, + { STEP32(0,32) }, + 32*32 +}; + static GFXDECODE_START( gfx_goldstar ) GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) @@ -11992,98 +12402,22 @@ static GFXDECODE_START( gfx_flam7_tw ) // gfx 2 still wrong... GFXDECODE_ENTRY( "gfx2", 0, flam7_tw_tilelayout, 104, 8 ) GFXDECODE_END - -static const gfx_layout tiles8x32_4bpp_layout = -{ - 8,32, - RGN_FRAC(1,4), - 4, - { RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) }, - { 0, 1, 2, 3, 4, 5, 6, 7}, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, - 13*8, 14*8, 15*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8, - 24*8, 25*8, 26*8, 27*8, 28*8, 29*8, 30*8, 31*8 }, - 32*8 -}; - -static const gfx_layout tiles8x8_3bpp_layout = -{ - 8,8, - RGN_FRAC(1,3), - 3, - { RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) }, - { 0, 1, 2, 3, 4, 5, 6, 7}, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 -}; - static GFXDECODE_START( gfx_nfm ) GFXDECODE_ENTRY( "tilegfx", 0, tiles8x8_3bpp_layout, 0, 16 ) GFXDECODE_ENTRY( "reelgfx", 0, tiles8x32_4bpp_layout, 128+64, 4 ) GFXDECODE_ENTRY( "user1", 0, gfx_8x8x8_raw, 0, 16 ) GFXDECODE_END - -static const gfx_layout tiles8x8x3_miss1bpp_layout = -{ - 8,8, - RGN_FRAC(1,1), - 3, - { 1, 2, 3 }, - { 8, 12, 0, 4, 24, 28, 16, 20 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*32 -}; - - -static const gfx_layout tiles8x32x4alt2_layout = -{ - 8,32, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 4, 0, 12, 8, 20, 16, 28, 24 }, - { STEP32(0,32) }, - 32*32 -}; - - static GFXDECODE_START( gfx_unkch ) GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_lsb, 0, 16 ) GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4alt2_layout, 0, 16 ) GFXDECODE_END -static const gfx_layout tilescherrys_layout = -{ - 8,32, - RGN_FRAC(1,1), - 4, - { 3, 2, 1, 0 }, - { 8, 12, 0, 4, 24, 28, 16, 20 }, - { STEP32(0,32) }, - 32*32 -}; - static GFXDECODE_START( gfx_cherrys ) GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x3_miss1bpp_layout, 0, 16 ) GFXDECODE_ENTRY( "gfx2", 0, tilescherrys_layout, 128, 8 ) GFXDECODE_END - -static const gfx_layout tiles8x32x4pkr_layout = -{ - 8,32, // 8*32 characters - RGN_FRAC(1,1), // 1024 characters - 4, // 4 bits per pixel - { 0, 2, 4, 6 }, // the bitplanes are packed in one byte - { 0*8+0, 0*8+1, 1*8+0, 1*8+1, 2*8+0, 2*8+1, 3*8+0, 3*8+1 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, - 8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32, - 16*32, 17*32, 18*32, 19*32, 20*32, 21*32, 22*32, 23*32, - 24*32, 25*32, 26*32, 27*32, 28*32, 29*32, 30*32, 31*32 }, - 8*32*4 // every char takes 128 consecutive bytes -}; - static GFXDECODE_START( gfx_pkrmast ) GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4pkr_layout, 128 + 64, 16 ) @@ -12096,47 +12430,12 @@ static GFXDECODE_START( gfx_cmfb55 ) GFXDECODE_ENTRY( "user1", 0, tiles128x128x4_layout, 128, 4 ) GFXDECODE_END -static const gfx_layout cmast97_layout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { 0, 1, 2, 3 }, - { 8, 12, 0, 4, 24, 28, 16, 20 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, - 8*32 -}; - -static const gfx_layout cmast97_layout32 = -{ - 8,32, - RGN_FRAC(1,1), - 4, - { 0,1,2,3 }, - { 8,12,0,4,24,28, 16,20 }, - { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 8*32, 9*32, 10*32, 11*32, - 12*32, 13*32, 14*32, 15*32, 16*32, 17*32, 18*32, 19*32, 20*32, 21*32, - 22*32, 23*32, 24*32, 25*32, 26*32, 27*32, 28*32, 29*32, 30*32, 31*32 }, - 32*32 -}; - static GFXDECODE_START( gfx_cmast97 ) GFXDECODE_ENTRY( "gfx", 0, cmast97_layout, 0x0, 16 ) GFXDECODE_ENTRY( "gfx", 0x20000, cmast97_layout32, 0x0, 16 ) GFXDECODE_ENTRY( "gfx", 0x40000, cmast97_layout, 0x0, 16 ) GFXDECODE_END -static const gfx_layout animalhs_tiles8x32_layout = -{ - 8,32, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP32(0,32) }, - 32*32 -}; - static GFXDECODE_START( gfx_animalhs ) GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x4_packed_msb, 0, 16 ) GFXDECODE_ENTRY( "gfx2", 0, animalhs_tiles8x32_layout, 128+64, 4 ) @@ -12148,166 +12447,10 @@ static GFXDECODE_START( gfx_rolling ) GFXDECODE_END -void wingco_state::system_outputa_w(uint8_t data) -{ -// popmessage("system_outputa_w %02x",data); -} - -void wingco_state::system_outputb_w(uint8_t data) -{ -// popmessage("system_outputb_w %02x",data); -} - -void wingco_state::system_outputc_w(uint8_t data) -{ - m_nmi_enable = data & 8; - m_vidreg = data & 2; -// popmessage("system_outputc_w %02x",data); +/**************************************************** + Machine Config - if (!m_nmi_enable) - m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); - - m_ticket_dispenser->motor_w(!BIT(data, 7)); -// popmessage("system_outputc_w %02x",data); -} - -void wingco_state::megaline_outputa_w(uint8_t data) -{ - m_enable_reg = data & 0x7f; - m_ticket_dispenser->motor_w(BIT(data, 7)); - -// popmessage("megaline_outputa_w %02x",data); -} - -void wingco_state::megaline_outputb_w(uint8_t data) -{ - machine().bookkeeping().coin_counter_w(0, data & 0x01); // counter A coin a - machine().bookkeeping().coin_counter_w(1, data & 0x02); // counter H Key In - machine().bookkeeping().coin_counter_w(2, data & 0x04); // counter B coin c - machine().bookkeeping().coin_counter_w(3, data & 0x08); // counter C coin d - machine().bookkeeping().coin_counter_w(4, data & 0x10); // counter D Hopper Out - machine().bookkeeping().coin_counter_w(5, data & 0x40); // counter F Key Out - -// popmessage("megaline_outputb_w %02x",data); -} - -void wingco_state::megaline_outputc_w(uint8_t data) -{ - m_lamps[0] = BIT(data, 0); - m_lamps[1] = BIT(data, 1); - m_lamps[2] = BIT(data, 2); - m_lamps[3] = BIT(data, 3); - m_lamps[4] = BIT(data, 4); - m_lamps[5] = BIT(data, 5); - m_lamps[6] = BIT(data, 6); - m_lamps[7] = BIT(data, 7); - -// popmessage("megaline_outputc_w %02x",data); -} - -void wingco_state::megaline_outputd_w(uint8_t data) -{ - m_lamps[8+0] = BIT(data, 0); - m_lamps[8+1] = BIT(data, 1); - m_lamps[8+2] = BIT(data, 2); - m_lamps[8+3] = BIT(data, 3); - m_lamps[8+4] = BIT(data, 4); - m_lamps[8+5] = BIT(data, 5); - m_lamps[8+6] = BIT(data, 6); - m_lamps[8+7] = BIT(data, 7); - -// popmessage("megaline_outputd_w %02x",data); -} - -void wingco_state::ay8910_outputa_w(uint8_t data) -{ -// popmessage("ay8910_outputa_w %02x", data); -} - -void wingco_state::ay8910_outputb_w(uint8_t data) -{ -// popmessage("ay8910_outputb_w %02x", data); -} - - -uint8_t wingco_state::tetin3_r() -{ - uint8_t ret = ioport("IN3")->read(); - - if (ret == 0xfe) // r > lucky to tetris - { - if (m_tcount++ == 2) - { - m_z80_p02 = true; - m_tcount = 0; - } - ret = 0xfe; - } - - if (ret == 0xfd) // t > tetris to lucky - { - if (m_tcount++ == 2) - { - m_z80_p02 = false; - m_tcount = 0; - } - ret = 0xfd; - } - return ret; -} - -uint8_t wingco_state::z80_io_r(offs_t offset) -{ - if (offset == 0x01) - return 0x00; // returning a different value inhibits the game swap (comprobed). Asign an input toggle to give functionality. - - if (offset == 0x02) - return m_z80_p02; - - if (offset == 0x32) - return 00; - - if (offset == 0xc0) - { - logerror("z80_io_r: offset:%02x\n", offset); - return m_z80_io_c0; - } - -// logerror("z80_io_r: offset:%02x\n", offset); // investigate functionality ports 0x31, 0x32, 0xc0. - return machine().rand() & 0x0f; -} - -void wingco_state::z80_io_w(offs_t offset, uint8_t data) -{ - if (offset == 0xc0) - m_z80_io_c0 = data; - logerror("Z80_io_w(): offset:%02x - data: %02x\n", offset, data); // investigate functionality port 0xc0 -} - -void wingco_state::tmcu_io_w(offs_t offset, uint8_t data) -{ - if ((offset != 0x122) & (offset != 0x123)) - logerror("tmcu_io Write: Offs:%04x - Data:%02x\n", offset, data); -} - -uint8_t wingco_state::tmcu_io_r(offs_t offset) -{ - return 0x00; -} - -void wingco_state::tmcu_p1_out(uint8_t data) -{ - m_mcu_p1 = data; -// logerror("MCU Port1:%02x\n", tmcu_p1_out); - -} - - -constexpr XTAL MASTER_CLOCK = 12_MHz_XTAL; -constexpr XTAL CPU_CLOCK = MASTER_CLOCK / 4; -constexpr XTAL PSG_CLOCK = MASTER_CLOCK / 4; -constexpr XTAL AY_CLOCK = MASTER_CLOCK / 8; -#define OKI_CLOCK 1056000 // unverified resonator +****************************************************/ void goldstar_state::goldstar(machine_config &config) { @@ -12457,64 +12600,6 @@ void goldstar_state::super9(machine_config &config) } -void goldstar_state::cm_palette(palette_device &palette) const -{ - // BBGGGRRR - uint8_t const *const proms = memregion("proms")->base(); - for (int i = 0; i < 0x100; i++) - { - uint8_t const data = proms[0x000 + i] | (proms[0x100 + i] << 4); - palette.set_pen_color(i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); - } -} - -void cmaster_state::cmast91_palette(palette_device &palette) const -{ - uint8_t const *const proms = memregion("proms")->base(); - for (int i = 0; i < 0x100; i++) - { - int const b = pal4bit(proms[0x000 + i]); - int const g = pal4bit(proms[0x100 + i]); - int const r = pal4bit(proms[0x200 + i]); - - palette.set_pen_color(i, rgb_t(r, g, b)); - } -} - -void goldstar_state::lucky8_palette(palette_device &palette) const -{ - // BBGGGRRR - uint8_t const *proms; - - proms = memregion("proms")->base(); - for (int i = 0; i < 0x100; i++) - { - uint8_t const data = proms[0x000 + i] | (proms[0x100 + i] << 4); - palette.set_pen_color(i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); - } - - proms = memregion("proms2")->base(); - for (int i = 0; i < 0x20; i++) - { - uint8_t const data = proms[i]; - palette.set_pen_color(i + 0x80, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); - } -} - -void cmaster_state::nfm_palette(palette_device &palette) const -{ - // BBGGGRRR - uint8_t const *const colours = memregion("colours")->base(); - for (int i = 0; i < 0x100; i++) - { - uint8_t const data = bitswap<8>(colours[0x000 + i], 3, 2, 1, 0, 7, 6, 5, 4); - palette.set_pen_color(i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6)); - } - - // TODO: what's 0x100-0x1ff for? For the currently undecoded user1 ROM? -} - - void cb3_state::ncb3(machine_config &config) { // basic machine hardware @@ -12762,46 +12847,6 @@ void cmaster_state::super7(machine_config &config) subdevice<ay8910_device>("aysnd")->port_b_read_callback().set_ioport("DSW2"); } -void cd3poker_state::cd3poker_map(address_map &map) -{ - map(0x0000, 0x9fff).rom(); - - map(0xa000, 0xa000).r(FUNC(cd3poker_state::armaly_prot_r)); - - map(0xd000, 0xd7ff).ram().share("nvram"); - map(0xd800, 0xdfff).ram(); - - map(0xe000, 0xe7ff).ram().w(FUNC(cd3poker_state::fg_vidram_w)).share(m_fg_vidram); - map(0xe800, 0xefff).ram().w(FUNC(cd3poker_state::fg_atrram_w)).share(m_fg_atrram); - - map(0xf000, 0xf1ff).ram().w(FUNC(cd3poker_state::reel_ram_w<0>)).share(m_reel_ram[0]); - map(0xf200, 0xf3ff).ram().w(FUNC(cd3poker_state::reel_ram_w<1>)).share(m_reel_ram[1]); - map(0xf400, 0xf5ff).ram().w(FUNC(cd3poker_state::reel_ram_w<2>)).share(m_reel_ram[2]); - map(0xf600, 0xf7ff).ram(); - - map(0xf800, 0xf87f).ram().share(m_reel_scroll[0]); - map(0xf880, 0xf9ff).ram(); - map(0xfa00, 0xfa7f).ram().share(m_reel_scroll[1]); - map(0xfa80, 0xfbff).ram(); - map(0xfc00, 0xfc7f).ram().share(m_reel_scroll[2]); - map(0xfc80, 0xffff).ram(); -} - -uint8_t cd3poker_state::armaly_prot_r() -{ - int index = m_prot_index; - if (!machine().side_effects_disabled()) - { - if (++m_prot_index > 0x10) - m_prot_index = 0; - } - - if (index < 0x0f) - return "ANISA_ARMALY<=>"[index]; - else - return index == 0x0f ? 0xa5 : 0x5a; -} - void cd3poker_state::cd3poker(machine_config &config) { cm(config); @@ -12876,12 +12921,6 @@ void cmaster_state::cutylineb(machine_config &config) } -void wingco_state::masked_irq(int state) -{ - if (state && m_nmi_enable) - m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); -} - void wingco_state::lucky8(machine_config &config) { // basic machine hardware @@ -13153,20 +13192,6 @@ void wingco_state::mbstar(machine_config &config) } - -void wingco_state::magodds_palette(palette_device &palette) const -{ - uint8_t const *const proms = memregion("proms")->base(); - for (int i = 0; i < 0x100; i++) - { - uint8_t const b = pal4bit(proms[0x000 + i]); - uint8_t const g = pal4bit(proms[0x100 + i]); - uint8_t const r = pal4bit(proms[0x200 + i]); - - palette.set_pen_color(i, rgb_t(r, g, b)); - } -} - void wingco_state::magodds(machine_config &config) { // basic machine hardware @@ -13220,7 +13245,6 @@ void wingco_state::magodds(machine_config &config) } - void goldstar_state::kkotnoli(machine_config &config) { // basic machine hardware @@ -13254,10 +13278,8 @@ void goldstar_state::kkotnoli(machine_config &config) SPEAKER(config, "mono").front_center(); SN76489(config, "snsnd", PSG_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.80); - } - void goldstar_state::ladylinr(machine_config &config) { // basic machine hardware @@ -13292,7 +13314,6 @@ void goldstar_state::ladylinr(machine_config &config) AY8930(config, "aysnd", AY_CLOCK).add_route(ALL_OUTPUTS, "mono", 0.50); // unused? } - void goldstar_state::ladylinrb(machine_config &config) { ladylinr(config); @@ -13735,11 +13756,10 @@ void wingco_state::lucky8tet(machine_config &config) } -/*************************************************************************** - - Game driver(s) +/**************************************************** + ROM Load Routines -***************************************************************************/ +****************************************************/ /* Golden Star (bootleg of Cherry 1 Gold) @@ -19886,34 +19906,19 @@ ROM_END /* - Magical Tonic unknown, 40 pin cpu (plastic box, with "Tonic" sticker on it) 8255 x3 YM2203 12 MHz - 4x DSW is this the original Magical Odds? -*/ -void wingco_state::init_magoddsc() -{ - uint8_t *ROM = memregion("maincpu")->base(); - for (int A = 0; A < 0x8000; A++) - { - if ((A & 4) == 4) - ROM[A] ^= 0x01; + also found with correctly sized program ROMs on a 03/25/93 DREAM97-1 PCB - ROM[A] = bitswap<8>(ROM[A], 3,6,5,4,7,2,1,0); - } -} - - -// is this a bootleg board? -// also found with correctly sized program ROMs on a 03/25/93 DREAM97-1 PCB +*/ ROM_START( magodds ) ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "8_p6_d12.512", 0x00000, 0x08000, CRC(6978c662) SHA1(cfdbcdcd4085c264e1d0ad4f18160b40d2d4e406) ) @@ -22215,64 +22220,6 @@ ROM_START( fb2010a ) ROM_END -void cmaster_state::init_fb2010() -{ - uint8_t *ROM = memregion("maincpu")->base(); - for (int i = 0; i < 0x10000; i++) - { - uint8_t x = ROM[i]; - - switch (i & 0x22) - { - case 0x00: x = bitswap<8>(x^0x4c^0xff, 0,4,7,6,5,1,3,2); break; - case 0x02: x = bitswap<8>(x^0xc0^0xff, 7,6,0,5,3,2,1,4); break; - case 0x20: x = bitswap<8>(x^0x6b^0xff, 4,3,2,7,5,6,0,1); break; - case 0x22: x = bitswap<8>(x^0x23^0xff, 0,6,1,3,4,5,2,7); break; - } - - ROM[i] = x; - } - - m_maincpu->space(AS_IO).install_read_handler(0x1e, 0x1e, read8smo_delegate(*this, FUNC(cmaster_state::fixedval_r<0x7d>))); -} - - -/* descrambled by looking at CALLs - - 0000 -> 0000 - - 46e7 -> 16e7 - 4027 -> 1027 - - 35f3 -> 25f3 - 3327 -> 2327 - - 7f6a -> 3f6a - - 1095 -> 4095 - 1d2f -> 4d2f - 1e8b -> 4e8b - - 6246 -> 5246 - 628f -> 528f - - 2bed -> 6bed - 2db7 -> 6db7 - - 5838 -> 7838 - 58a2 -> 78a2 - - 810f -> 810f - - 9762 -> 9762 - - a??? -> a??? - - b84a -> b84a - - c??? -> c??? - -*/ ROM_START( nfb96se ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "dogdptb.prg",0x00000, 0x1000, CRC(0690f915) SHA1(ed2477ba260a421013603017cfd1e1ba5ecd7f4e) ) // alt program? @@ -25134,7 +25081,11 @@ ROM_START( fl7_tw ) // Serial 00000050E9B7. ROM_END -/*********************************************************************************************************************/ +/**************************************************** + Driver Init Routines + +****************************************************/ + void goldstar_state::init_goldstar() { @@ -25320,7 +25271,6 @@ void cd3poker_state::init_3cdp() // v1.6 & v1.0 rom[0x020d] = 0x9b; // ppi1 init } - void goldstar_state::init_ladylinrb() { uint8_t *rom = memregion("maincpu")->base(); @@ -26606,6 +26556,18 @@ void wingco_state::init_mbs2() rom[0xd6b1] = 0x97; } +void wingco_state::init_magoddsc() +{ + uint8_t *ROM = memregion("maincpu")->base(); + for (int A = 0; A < 0x8000; A++) + { + if ((A & 4) == 4) + ROM[A] ^= 0x01; + + ROM[A] = bitswap<8>(ROM[A], 3,6,5,4,7,2,1,0); + } +} + void cmaster_state::init_nfb96sea() { @@ -26693,6 +26655,64 @@ void cmaster_state::init_skill98() // Oki 6295 at 0x20 } +void cmaster_state::init_fb2010() +{ + uint8_t *ROM = memregion("maincpu")->base(); + for (int i = 0; i < 0x10000; i++) + { + uint8_t x = ROM[i]; + + switch (i & 0x22) + { + case 0x00: x = bitswap<8>(x^0x4c^0xff, 0,4,7,6,5,1,3,2); break; + case 0x02: x = bitswap<8>(x^0xc0^0xff, 7,6,0,5,3,2,1,4); break; + case 0x20: x = bitswap<8>(x^0x6b^0xff, 4,3,2,7,5,6,0,1); break; + case 0x22: x = bitswap<8>(x^0x23^0xff, 0,6,1,3,4,5,2,7); break; + } + + ROM[i] = x; + } + + m_maincpu->space(AS_IO).install_read_handler(0x1e, 0x1e, read8smo_delegate(*this, FUNC(cmaster_state::fixedval_r<0x7d>))); +} + +/* descrambled by looking at CALLs + + 0000 -> 0000 + + 46e7 -> 16e7 + 4027 -> 1027 + + 35f3 -> 25f3 + 3327 -> 2327 + + 7f6a -> 3f6a + + 1095 -> 4095 + 1d2f -> 4d2f + 1e8b -> 4e8b + + 6246 -> 5246 + 628f -> 528f + + 2bed -> 6bed + 2db7 -> 6db7 + + 5838 -> 7838 + 58a2 -> 78a2 + + 810f -> 810f + + 9762 -> 9762 + + a??? -> a??? + + b84a -> b84a + + c??? -> c??? + +*/ + void cmaster_state::init_nfb96_a() { uint8_t *rom = memregion("maincpu")->base(); @@ -27563,9 +27583,12 @@ void wingco_state::init_mgln() } // anonymous namespace -/********************************************* -* Game Drivers * -*********************************************/ +/*********************************************************************************************************************/ + +/**************************************************** + Game Drivers + +****************************************************/ // YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT GAMEL( 199?, goldstar, 0, goldstar, goldstar, goldstar_state, init_goldstar, ROT0, "IGS", "Golden Star", 0, layout_goldstar ) |
