snk/dmndrby.cpp: implement sound CPU reset, add dmndrbybl base inputs

This commit is contained in:
angelosa 2023-11-22 02:41:12 +01:00
parent 8d18affed7
commit 3b3edfec0b

View File

@ -6,10 +6,11 @@ Diamond Derby - G4001 board (c) 1986 SNK / Electrocoin
Notes:
- Press Collect Button to "get the money";
- dmndrbybl: hold together SERVICE1 + P1 1-2 to move on from input test
TODO:
- Fix colors (check bar test on the first Service Mode menu);
- dmndrbybl Quinella style inputs (game seems based over an original set we don't have yet);
- dmndrbybl: identify remaining inputs (game seems based over an original set we don't have yet);
- Enters into Service Mode (?) if you let it go in attract mode after some time (cannot reproduce);
- When booted up game disallows coin inputs (including setting with lockout disabled) for a couple timer seconds. Is this intentional?
@ -85,11 +86,13 @@ public:
{ }
void dderby(machine_config &config);
void dderbybl(machine_config &config);
protected:
virtual void video_start() override;
virtual void main_map(address_map &map);
virtual void ca00_w(offs_t offset, u8 data);
private:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
@ -113,15 +116,92 @@ private:
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb);
uint8_t m_io_port[8]{}; // TODO: written to but never used?
void output_w(offs_t offset, uint8_t data);
void main_map(address_map &map);
void bootleg_main_map(address_map &map);
void sound_map(address_map &map);
};
class dmndrby_quinella_state : public dmndrby_state
{
public:
dmndrby_quinella_state(const machine_config &mconfig, device_type type, const char *tag)
: dmndrby_state(mconfig, type, tag)
{ }
protected:
virtual void main_map(address_map &map) override;
private:
// FIXME: should really use IPT_OUTPUT instead of subclassing
virtual void ca00_w(offs_t offset, u8 data) override;
};
/******************
*
* Video
*
*****************/
// TODO: incorrect resistors, reference shows gravel track with more charged red
void dmndrby_state::palette_init(palette_device &palette) const
{
const uint8_t *color_prom = memregion("proms")->base();
static constexpr int resistances_rg[3] = { 1000, 470, 220 };
static constexpr int resistances_b [2] = { 470, 220 };
// compute the color output resistor weights
double rweights[3], gweights[3], bweights[2];
compute_resistor_weights(0, 255, -1.0,
3, &resistances_rg[0], rweights, 470, 0,
3, &resistances_rg[0], gweights, 470, 0,
2, &resistances_b[0], bweights, 470, 0);
// create a lookup table for the palette
for (int i = 0; i < 0x20; i++)
{
int bit0, bit1, bit2;
// red component */
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}
// color_prom now points to the beginning of the lookup table
color_prom = memregion("proms2")->base();
// normal tiles use colors 0-15
for (int i = 0x000; i < 0x300; i++)
{
uint8_t ctabentry = color_prom[i];
palette.set_pen_indirect(i, ctabentry);
}
}
void dmndrby_state::video_start()
{
m_fix_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dmndrby_state::get_fix_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_racetrack_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dmndrby_state::get_racetrack_tile_info)), tilemap_mapper_delegate(*this, FUNC(dmndrby_state::racetrack_scan_rows)), 16, 16, 128, 64);
m_racetrack_tilemap->mark_all_dirty();
m_fix_tilemap->set_transparent_pen(0);
m_racetrack_tilemap->set_transparent_pen(0);
}
TILE_GET_INFO_MEMBER(dmndrby_state::get_fix_tile_info)
{
u8 attr = m_fix_attr[tile_index];
@ -151,17 +231,6 @@ TILE_GET_INFO_MEMBER(dmndrby_state::get_racetrack_tile_info)
tileinfo.set(2, code, col, TILE_FLIPYX(flipx));
}
void dmndrby_state::video_start()
{
m_fix_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dmndrby_state::get_fix_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_racetrack_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(dmndrby_state::get_racetrack_tile_info)), tilemap_mapper_delegate(*this, FUNC(dmndrby_state::racetrack_scan_rows)), 16, 16, 128, 64);
m_racetrack_tilemap->mark_all_dirty();
m_fix_tilemap->set_transparent_pen(0);
m_racetrack_tilemap->set_transparent_pen(0);
}
void dmndrby_state::fix_vram_w(offs_t offset, u8 data)
{
m_fix_vram[offset] = data;
@ -176,12 +245,14 @@ void dmndrby_state::fix_attr_w(offs_t offset, u8 data)
uint32_t dmndrby_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// gfx_element *gfx = m_gfxdecode->gfx(0);
// gfx_element *gfx = m_gfxdecode->gfx(0);
gfx_element *sprites = m_gfxdecode->gfx(1);
//gfx_element *track = m_gfxdecode->gfx(2);
bitmap.fill(m_palette->black_pen(), cliprect);
// NOTE: dmndrbybl service mode horse/scroll test items expects following two to be reversed
// That won't work in game, buggy routine?
const bool track_enable = BIT(m_scroll_ram[4], 2);
const bool sprite_enable = BIT(m_scroll_ram[4], 1);
const bool fix_enable = BIT(m_scroll_ram[4], 0);
@ -243,56 +314,11 @@ wouldn't like to say it's the most effective way though...
return 0;
}
// copied from elsewhere. Surely incorrect
void dmndrby_state::palette_init(palette_device &palette) const
{
const uint8_t *color_prom = memregion("proms")->base();
static constexpr int resistances_rg[3] = { 1000, 470, 220 };
static constexpr int resistances_b [2] = { 470, 220 };
// compute the color output resistor weights
double rweights[3], gweights[3], bweights[2];
compute_resistor_weights(0, 255, -1.0,
3, &resistances_rg[0], rweights, 470, 0,
3, &resistances_rg[0], gweights, 470, 0,
2, &resistances_b[0], bweights, 470, 0);
// create a lookup table for the palette
for (int i = 0; i < 0x20; i++)
{
int bit0, bit1, bit2;
// red component */
bit0 = BIT(color_prom[i], 0);
bit1 = BIT(color_prom[i], 1);
bit2 = BIT(color_prom[i], 2);
int const r = combine_weights(rweights, bit0, bit1, bit2);
// green component
bit0 = BIT(color_prom[i], 3);
bit1 = BIT(color_prom[i], 4);
bit2 = BIT(color_prom[i], 5);
int const g = combine_weights(gweights, bit0, bit1, bit2);
// blue component
bit0 = BIT(color_prom[i], 6);
bit1 = BIT(color_prom[i], 7);
int const b = combine_weights(bweights, bit0, bit1);
palette.set_indirect_color(i, rgb_t(r, g, b));
}
// color_prom now points to the beginning of the lookup table
color_prom = memregion("proms2")->base();
// normal tiles use colors 0-15
for (int i = 0x000; i < 0x300; i++)
{
uint8_t ctabentry = color_prom[i];
palette.set_pen_indirect(i, ctabentry);
}
}
/******************
*
* I/O (stubs)
*
*****************/
void dmndrby_state::output_w(offs_t offset, uint8_t data)
{
@ -307,8 +333,11 @@ void dmndrby_state::output_w(offs_t offset, uint8_t data)
---- --x- coin lockout [0-3]
---- ---x lamp [0-6]
*/
m_io_port[offset] = data;
// popmessage("%02x|%02x|%02x|%02x|%02x|%02x|%02x|%02x|",m_io_port[0],m_io_port[1],m_io_port[2],m_io_port[3],m_io_port[4],m_io_port[5],m_io_port[6],m_io_port[7]);
}
void dmndrby_state::ca00_w(offs_t offset, uint8_t data)
{
m_audiocpu->set_input_line(INPUT_LINE_RESET, BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
}
void dmndrby_state::main_map(address_map &map)
@ -326,7 +355,7 @@ void dmndrby_state::main_map(address_map &map)
map(0xc000, 0xc007).w(FUNC(dmndrby_state::output_w));
map(0xc802, 0xc802).portr("DSW1");
map(0xc803, 0xc803).portr("DSW2");
map(0xca00, 0xca00).nopw();//(vblank_irq_w) //???
map(0xca00, 0xca00).w(FUNC(dmndrby_state::ca00_w));
map(0xca01, 0xca01).nopw(); //watchdog
map(0xca02, 0xca02).w("soundlatch", FUNC(generic_latch_8_device::write));
map(0xca03, 0xca03).w("soundlatch2", FUNC(generic_latch_8_device::write));
@ -336,29 +365,29 @@ void dmndrby_state::main_map(address_map &map)
map(0xd400, 0xd7ff).ram().w(FUNC(dmndrby_state::fix_attr_w)).share(m_fix_attr);
}
void dmndrby_state::bootleg_main_map(address_map &map)
void dmndrby_quinella_state::ca00_w(offs_t offset, u8 data)
{
map(0x0000, 0x5fff).rom();
map(0x8000, 0x8fff).ram().share("nvram");
dmndrby_state::ca00_w(offset, data);
// bit 7: coin counter bit 6: coin out counter bit 3: hopper motor 1, bit 2: hopper motor 2
machine().bookkeeping().coin_counter_w(0, BIT(data, 7));
}
void dmndrby_quinella_state::main_map(address_map &map)
{
dmndrby_state::main_map(map);
map(0xc000, 0xc007).unmaprw();
// different I/O ports
map(0xc000, 0xc000).portr("IN0");
map(0xc001, 0xc001).portr("IN1");
map(0xc002, 0xc002).portr("IN2");
map(0xc200, 0xc200).portr("IN3");
map(0xc201, 0xc201).portr("IN4");
map(0xc202, 0xc202).portr("IN5");
map(0xc400, 0xc41f).nopw(); // 7 segs, in upper/lower digits (0F clears, [0] upper [1] lower)
map(0xc600, 0xc61f).nopw(); // cocktail side 7 segs
map(0xc800, 0xc800).portr("IN6");
map(0xc801, 0xc801).portr("IN7");
map(0xc802, 0xc802).portr("DSW1");
map(0xc803, 0xc803).portr("DSW2");
//map(0xc000, 0xc007).w(FUNC(dmndrby_state::output_w));
map(0xca00, 0xca00).nopw();//(vblank_irq_w) //???
map(0xca01, 0xca01).nopw(); //watchdog
map(0xca02, 0xca02).w("soundlatch", FUNC(generic_latch_8_device::write));
map(0xca03, 0xca03).w("soundlatch2", FUNC(generic_latch_8_device::write));
map(0xcc00, 0xcc05).ram().share(m_scroll_ram);
map(0xce08, 0xce1f).ram().share(m_sprite_ram); // horse sprites
map(0xd000, 0xd3ff).ram().w(FUNC(dmndrby_state::fix_vram_w)).share(m_fix_vram);
map(0xd400, 0xd7ff).ram().w(FUNC(dmndrby_state::fix_attr_w)).share(m_fix_attr);
// map(0xca00, 0xca00)
}
void dmndrby_state::sound_map(address_map &map)
@ -368,7 +397,6 @@ void dmndrby_state::sound_map(address_map &map)
map(0x4000, 0x4001).w("ay1", FUNC(ay8910_device::address_data_w));
map(0x4000, 0x4000).r("soundlatch", FUNC(generic_latch_8_device::read));
map(0x4001, 0x4001).r("soundlatch2", FUNC(generic_latch_8_device::read));
// map(0x4000, 0x4000).r("ay1", FUNC(ay8910_device::data_r));
map(0x6000, 0x67ff).ram();
}
@ -502,92 +530,145 @@ static INPUT_PORTS_START( dderbya )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
// TODO: no clear service mode, following is guesswork
static INPUT_PORTS_START( dderbybl )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("1P 2-5") PORT_CODE(KEYCODE_D)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("1P 2-4") PORT_CODE(KEYCODE_S)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("1P 2-3") PORT_CODE(KEYCODE_A)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("1P 1-6") PORT_CODE(KEYCODE_T)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("1P 1-5") PORT_CODE(KEYCODE_R)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("1P 1-4") PORT_CODE(KEYCODE_E)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("1P 1-3") PORT_CODE(KEYCODE_W)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("1P 1-2") PORT_CODE(KEYCODE_Q)
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_DIPNAME( 0x01, 0x01, "IN1" )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_NAME("1P 5-6") PORT_CODE(KEYCODE_V)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("1P 4-6") PORT_CODE(KEYCODE_C)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("1P 4-5") PORT_CODE(KEYCODE_X)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("1P 3-6") PORT_CODE(KEYCODE_Z)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("1P 3-5") PORT_CODE(KEYCODE_H)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("1P 3-4") PORT_CODE(KEYCODE_G)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("1P 2-6") PORT_CODE(KEYCODE_F)
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_DIPNAME( 0x01, 0x01, "IN2" )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("2P 2-5") PORT_CODE(KEYCODE_D) PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("2P 2-4") PORT_CODE(KEYCODE_S) PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("2P 2-3") PORT_CODE(KEYCODE_A) PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("2P 1-6") PORT_CODE(KEYCODE_T) PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("2P 1-5") PORT_CODE(KEYCODE_R) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("2P 1-4") PORT_CODE(KEYCODE_E) PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("2P 1-3") PORT_CODE(KEYCODE_W) PORT_COCKTAIL
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("2P 1-2") PORT_CODE(KEYCODE_Q) PORT_COCKTAIL
PORT_START("IN4")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_DIPNAME( 0x01, 0x01, "IN4" )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_NAME("2P 5-6") PORT_CODE(KEYCODE_V) PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("2P 4-6") PORT_CODE(KEYCODE_C) PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("2P 4-5") PORT_CODE(KEYCODE_X) PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("2P 3-6") PORT_CODE(KEYCODE_Z) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("2P 3-5") PORT_CODE(KEYCODE_H) PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("2P 3-4") PORT_CODE(KEYCODE_G) PORT_COCKTAIL
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("2P 2-6") PORT_CODE(KEYCODE_F) PORT_COCKTAIL
PORT_START("IN5")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_DIPNAME( 0x01, 0x01, "IN5" )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN6")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_DIPNAME( 0x01, 0x01, "IN6" )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("Coin 1 Cocktail side")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN5 ) PORT_NAME("Coin 2 Cocktail side")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_START("IN7")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_DIPNAME( 0x01, 0x01, "IN7" )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 ) // augments 'meter' 10 at a time, 'credit up' in book-keeping
PORT_START("DSW1")
// more like Upright/Cocktail switch
PORT_DIPNAME( 0x01, 0x00, "Show Title" )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x01, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x02, 0x02, "Unknown DSW1-2" )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@ -632,7 +713,7 @@ static INPUT_PORTS_START( dderbybl )
PORT_DIPNAME( 0x40, 0x40, "Unknown DSW2-7" )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, "RAM Test" )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Service_Mode ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@ -693,7 +774,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(dmndrby_state::scanline_cb)
void dmndrby_state::dderby(machine_config &config)
{
// basic machine hardware
Z80(config, m_maincpu, 4'000'000); // ? MHz
m_maincpu->set_addrmap(AS_PROGRAM, &dmndrby_state::main_map);
TIMER(config, "scantimer").configure_scanline(FUNC(dmndrby_state::scanline_cb), "screen", 0, 1);
@ -705,7 +785,6 @@ void dmndrby_state::dderby(machine_config &config)
config.set_maximum_quantum(attotime::from_hz(6000));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500));
@ -725,13 +804,6 @@ void dmndrby_state::dderby(machine_config &config)
AY8910(config, "ay1", 4'000'000 / 2).add_route(ALL_OUTPUTS, "mono", 0.35); // frequency guessed, tied with sound timer irq above
}
void dmndrby_state::dderbybl(machine_config &config)
{
dderby(config);
m_maincpu->set_addrmap(AS_PROGRAM, &dmndrby_state::bootleg_main_map);
}
ROM_START( dmndrby )
ROM_REGION( 0x10000, "maincpu", 0 )
@ -875,6 +947,6 @@ ROM_END
// YEAR, NAME, PARENT, MACHINE, INPUT, STATE, INIT, MONITOR, COMPANY, FULLNAME FLAGS
GAME( 1994, dmndrby, 0, dderby, dderby, dmndrby_state, empty_init, ROT0, "Electrocoin", "Diamond Derby (Win bet, newer)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // hack?
GAME( 1986, dmndrbya, dmndrby, dderby, dderbya, dmndrby_state, empty_init, ROT0, "Electrocoin", "Diamond Derby (Win bet, original)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1986, dmndrbybl, dmndrby, dderbybl, dderbybl, dmndrby_state, empty_init, ROT0, "bootleg (EDG Impeuropex)", "Diamond Derby (Quinella bet, EDG Impeuropex bootleg)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1994, dmndrby, 0, dderby, dderby, dmndrby_state, empty_init, ROT0, "Electrocoin", "Diamond Derby (Win bet, newer)", MACHINE_IMPERFECT_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // hack?
GAME( 1986, dmndrbya, dmndrby, dderby, dderbya, dmndrby_state, empty_init, ROT0, "Electrocoin", "Diamond Derby (Win bet, original)", MACHINE_IMPERFECT_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 1986, dmndrbybl, dmndrby, dderby, dderbybl, dmndrby_quinella_state, empty_init, ROT0, "bootleg (EDG Impeuropex)", "Diamond Derby (Quinella bet, EDG Impeuropex bootleg)", MACHINE_IMPERFECT_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )