mirror of
https://github.com/holub/mame
synced 2025-07-01 08:18:59 +03:00
markham.cpp: Fix coin counters for banbam by doing something even more unusual. (nw)
Misc polishing in markham.cpp; also update notes on banbam MCU. (nw) Added coin chute DIP switch settings to banbam, strnskil and clones.
This commit is contained in:
parent
3e25578693
commit
a857572dac
@ -313,7 +313,7 @@ MACHINE_CONFIG_START(galaxia_state::galaxia)
|
|||||||
/* video hardware */
|
/* video hardware */
|
||||||
MCFG_SCREEN_ADD("screen", RASTER)
|
MCFG_SCREEN_ADD("screen", RASTER)
|
||||||
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
|
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
|
||||||
MCFG_SCREEN_REFRESH_RATE(60)
|
MCFG_SCREEN_REFRESH_RATE(60) // wrong
|
||||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
|
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
|
||||||
MCFG_SCREEN_SIZE(256, 256)
|
MCFG_SCREEN_SIZE(256, 256)
|
||||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 30*8-1, 2*8, 32*8-1)
|
MCFG_SCREEN_VISIBLE_AREA(0*8, 30*8-1, 2*8, 32*8-1)
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
TODO:
|
TODO:
|
||||||
- needs merging with ikki.cpp
|
- needs merging with ikki.cpp
|
||||||
- look up schematics for all games
|
- look up schematics for all games
|
||||||
- banbam and pettanp likely share the same MCU code, check once redumped
|
- MB8841 data might be good! same hash as arabian, unsure if dumped twice
|
||||||
|
or just copied from arabian. hookup looks to be very(?) different compared
|
||||||
|
to arabian though
|
||||||
- fix banbam/pettanp simulated comms or hopefully hook up MCU ports and
|
- fix banbam/pettanp simulated comms or hopefully hook up MCU ports and
|
||||||
at least get something out of the existing dump
|
at least get something out of the existing dump
|
||||||
|
|
||||||
@ -50,19 +52,18 @@ READ8_MEMBER(markham_state::markham_e004_r)
|
|||||||
|
|
||||||
WRITE8_MEMBER(markham_state::coin_output_w)
|
WRITE8_MEMBER(markham_state::coin_output_w)
|
||||||
{
|
{
|
||||||
/* only activated after first write? */
|
|
||||||
/* all machines write to slot B at selftest even without a coin */
|
|
||||||
if (m_coin_unlock)
|
|
||||||
{
|
|
||||||
/* banbam and pettanp write to both slot A and B when a coin
|
|
||||||
is inserted regardless of which; does this imply that they only
|
|
||||||
have one coin counter? */
|
|
||||||
machine().bookkeeping().coin_counter_w(0, BIT(data, 0));
|
machine().bookkeeping().coin_counter_w(0, BIT(data, 0));
|
||||||
|
|
||||||
|
// plain, flat out weird stuff needed to prevent phantom coins
|
||||||
|
// likely an activation mechanism to test individual chute behavior?
|
||||||
|
// this can't be boolean wise, because banbam triggers this three times
|
||||||
|
if (m_coin2_lock_cnt == 0)
|
||||||
|
{
|
||||||
machine().bookkeeping().coin_counter_w(1, BIT(data, 1));
|
machine().bookkeeping().coin_counter_w(1, BIT(data, 1));
|
||||||
}
|
}
|
||||||
else
|
else if (BIT(data, 1))
|
||||||
{
|
{
|
||||||
m_coin_unlock = true;
|
m_coin2_lock_cnt--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +200,15 @@ void markham_state::strnskil_master_map(address_map &map)
|
|||||||
map(0xd80a, 0xd80b).writeonly().share("xscroll");
|
map(0xd80a, 0xd80b).writeonly().share("xscroll");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// void markham_state::banbam_master_map(address_map &map)
|
||||||
|
// {
|
||||||
|
// /* TODO: uncomment when ready */
|
||||||
|
// strnskil_master_map(map);
|
||||||
|
// map(0xd806, 0xd806).r(this, FUNC(markham_state::mcu_r)); /* mcu data read */
|
||||||
|
// map(0xd80d, 0xd80d).w(this, FUNC(markham_state::mcu_w)); /* mcu data write */
|
||||||
|
// map(0xd80c, 0xd80c).w(this, FUNC(markham_state::mcu_reset)); /* mcu reset? */
|
||||||
|
// }
|
||||||
|
|
||||||
void markham_state::markham_slave_map(address_map &map)
|
void markham_state::markham_slave_map(address_map &map)
|
||||||
{
|
{
|
||||||
map(0x0000, 0x5fff).rom();
|
map(0x0000, 0x5fff).rom();
|
||||||
@ -305,19 +315,19 @@ INPUT_PORTS_END
|
|||||||
|
|
||||||
static INPUT_PORTS_START( strnskil )
|
static INPUT_PORTS_START( strnskil )
|
||||||
PORT_START("DSW1")
|
PORT_START("DSW1")
|
||||||
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
|
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1")
|
||||||
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0x02, 0x00, "Unknown 1-2" )
|
PORT_DIPNAME( 0x02, 0x00, "Unknown 1-2" ) PORT_DIPLOCATION("SW1:2")
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Flip_Screen ) )
|
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:3")
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
|
||||||
PORT_DIPNAME( 0x08, 0x00, "Unknown 1-4" )
|
PORT_DIPNAME( 0x08, 0x00, "Coin Chutes" ) PORT_DIPLOCATION("SW1:4")
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x00, "Individual" )
|
||||||
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x08, "Common" )
|
||||||
PORT_DIPNAME( 0xf0, 0x00, "Coin1 / Coin2" )
|
PORT_DIPNAME( 0xf0, 0x00, "Coin1 / Coin2" ) PORT_DIPLOCATION("SW1:5,6,7,8")
|
||||||
PORT_DIPSETTING( 0x00, "1C 1C / 1C 1C" )
|
PORT_DIPSETTING( 0x00, "1C 1C / 1C 1C" )
|
||||||
PORT_DIPSETTING( 0x10, "2C 1C / 2C 1C" )
|
PORT_DIPSETTING( 0x10, "2C 1C / 2C 1C" )
|
||||||
PORT_DIPSETTING( 0x20, "2C 1C / 1C 3C" )
|
PORT_DIPSETTING( 0x20, "2C 1C / 1C 3C" )
|
||||||
@ -336,7 +346,7 @@ static INPUT_PORTS_START( strnskil )
|
|||||||
PORT_DIPSETTING( 0xf0, DEF_STR( Free_Play ) )
|
PORT_DIPSETTING( 0xf0, DEF_STR( Free_Play ) )
|
||||||
|
|
||||||
PORT_START("DSW2")
|
PORT_START("DSW2")
|
||||||
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Difficulty ) )
|
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1")
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
|
||||||
PORT_DIPSETTING( 0x01, DEF_STR( Hard ) )
|
PORT_DIPSETTING( 0x01, DEF_STR( Hard ) )
|
||||||
PORT_DIPNAME( 0x02, 0x00, "Unknown 2-2" )
|
PORT_DIPNAME( 0x02, 0x00, "Unknown 2-2" )
|
||||||
@ -403,7 +413,9 @@ static INPUT_PORTS_START( banbam )
|
|||||||
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:3")
|
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:3")
|
||||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||||
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
|
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
|
||||||
PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW1:4" )
|
PORT_DIPNAME(0x08, 0x00, "Coin Chutes") PORT_DIPLOCATION("SW1:4")
|
||||||
|
PORT_DIPSETTING( 0x00, "Individual")
|
||||||
|
PORT_DIPSETTING( 0x08, "Common")
|
||||||
PORT_DIPNAME( 0xf0, 0x00, "Coin1 / Coin2" ) PORT_DIPLOCATION("SW1:5,6,7,8")
|
PORT_DIPNAME( 0xf0, 0x00, "Coin1 / Coin2" ) PORT_DIPLOCATION("SW1:5,6,7,8")
|
||||||
PORT_DIPSETTING( 0x00, "1C 1C / 1C 1C" )
|
PORT_DIPSETTING( 0x00, "1C 1C / 1C 1C" )
|
||||||
PORT_DIPSETTING( 0x10, "2C 1C / 2C 1C" )
|
PORT_DIPSETTING( 0x10, "2C 1C / 2C 1C" )
|
||||||
@ -703,7 +715,7 @@ ROM_START( banbam )
|
|||||||
ROM_LOAD( "ban-rom12.ic2", 0x0000, 0x2000, CRC(044bb2f6) SHA1(829b2152740061e0506c7504885d8404fb8fe360) )
|
ROM_LOAD( "ban-rom12.ic2", 0x0000, 0x2000, CRC(044bb2f6) SHA1(829b2152740061e0506c7504885d8404fb8fe360) )
|
||||||
|
|
||||||
ROM_REGION(0x800, "mcu", 0) /* Fujitsu MB8841 4-Bit MCU internal ROM */
|
ROM_REGION(0x800, "mcu", 0) /* Fujitsu MB8841 4-Bit MCU internal ROM */
|
||||||
ROM_LOAD("sun-8212.ic3", 0x000, 0x800, BAD_DUMP CRC(8869611e) SHA1(c6443f3bcb0cdb4d7b1b19afcbfe339c300f36aa))
|
ROM_LOAD( "sun-8212.ic3", 0x000, 0x800, BAD_DUMP CRC(8869611e) SHA1(c6443f3bcb0cdb4d7b1b19afcbfe339c300f36aa) )
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
ROM_START( pettanp )
|
ROM_START( pettanp )
|
||||||
@ -723,8 +735,8 @@ ROM_START( pettanp )
|
|||||||
ROM_LOAD( "tvg8-16.94", 0x4000, 0x2000, CRC(b18a2244) SHA1(168061e050530e6a5bc78c14a64e635370256dfd) )
|
ROM_LOAD( "tvg8-16.94", 0x4000, 0x2000, CRC(b18a2244) SHA1(168061e050530e6a5bc78c14a64e635370256dfd) )
|
||||||
|
|
||||||
ROM_REGION( 0x6000, "gfx2", 0 ) /* bg */
|
ROM_REGION( 0x6000, "gfx2", 0 ) /* bg */
|
||||||
ROM_LOAD( "tvg11-16.102",0x0000, 0x2000, CRC(327b7a29) SHA1(4b8d57607c4a1e84c630c38eba3fa90b5496dcde) )
|
ROM_LOAD( "tvg11-16.102", 0x0000, 0x2000, CRC(327b7a29) SHA1(4b8d57607c4a1e84c630c38eba3fa90b5496dcde) )
|
||||||
ROM_LOAD( "tvg10-16.101",0x2000, 0x2000, CRC(624ac061) SHA1(9d479a8a256a8ff37c00bc7449b11357f9fe6cdc) )
|
ROM_LOAD( "tvg10-16.101", 0x2000, 0x2000, CRC(624ac061) SHA1(9d479a8a256a8ff37c00bc7449b11357f9fe6cdc) )
|
||||||
ROM_LOAD( "tvg9-16.100", 0x4000, 0x2000, CRC(c477e74c) SHA1(864eddcd9c817aeecb09423071f87d3b39eb5fc4) )
|
ROM_LOAD( "tvg9-16.100", 0x4000, 0x2000, CRC(c477e74c) SHA1(864eddcd9c817aeecb09423071f87d3b39eb5fc4) )
|
||||||
|
|
||||||
ROM_REGION( 0x0700, "proms", 0 ) /* color PROMs */
|
ROM_REGION( 0x0700, "proms", 0 ) /* color PROMs */
|
||||||
@ -741,9 +753,20 @@ ROM_START( pettanp )
|
|||||||
ROM_LOAD( "tvg12-16.2", 0x0000, 0x1000, CRC(3abc6ba8) SHA1(15e0b0f9d068f6094e2be4f4f1dea0ff6e85686b) )
|
ROM_LOAD( "tvg12-16.2", 0x0000, 0x1000, CRC(3abc6ba8) SHA1(15e0b0f9d068f6094e2be4f4f1dea0ff6e85686b) )
|
||||||
|
|
||||||
ROM_REGION(0x800, "mcu", 0) /* Fujitsu MB8841 4-Bit MCU internal ROM */
|
ROM_REGION(0x800, "mcu", 0) /* Fujitsu MB8841 4-Bit MCU internal ROM */
|
||||||
ROM_LOAD("sun-8212.ic3", 0x000, 0x800, NO_DUMP)
|
ROM_LOAD( "sun-8212.ic3", 0x000, 0x800, NO_DUMP ) // very much likely to be same as banbam and arabian
|
||||||
ROM_END
|
ROM_END
|
||||||
|
|
||||||
|
void markham_state::machine_start()
|
||||||
|
{
|
||||||
|
save_item(NAME(m_coin2_lock_cnt));
|
||||||
|
}
|
||||||
|
|
||||||
|
void markham_state::machine_reset()
|
||||||
|
{
|
||||||
|
/* prevent phantom coins again */
|
||||||
|
m_coin2_lock_cnt = 3;
|
||||||
|
}
|
||||||
|
|
||||||
void markham_state::init_banbam()
|
void markham_state::init_banbam()
|
||||||
{
|
{
|
||||||
/* Fujitsu MB8841 4-Bit MCU comms */
|
/* Fujitsu MB8841 4-Bit MCU comms */
|
||||||
@ -753,10 +776,6 @@ void markham_state::init_banbam()
|
|||||||
|
|
||||||
void markham_state::init_pettanp()
|
void markham_state::init_pettanp()
|
||||||
{
|
{
|
||||||
// AM_RANGE(0xd80c, 0xd80c) AM_WRITENOP /* protection reset? */
|
|
||||||
// AM_RANGE(0xd80d, 0xd80d) AM_WRITE(protection_w) /* protection data write (pettanp) */
|
|
||||||
// AM_RANGE(0xd806, 0xd806) AM_READ(protection_r) /* protection data read (pettanp) */
|
|
||||||
|
|
||||||
/* Fujitsu MB8841 4-Bit MCU comms */
|
/* Fujitsu MB8841 4-Bit MCU comms */
|
||||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd806, 0xd806, read8_delegate(FUNC(markham_state::pettanp_protection_r),this));
|
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd806, 0xd806, read8_delegate(FUNC(markham_state::pettanp_protection_r),this));
|
||||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd80d, 0xd80d, write8_delegate(FUNC(markham_state::protection_w),this));
|
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd80d, 0xd80d, write8_delegate(FUNC(markham_state::protection_w),this));
|
||||||
|
@ -40,10 +40,11 @@ public:
|
|||||||
, m_irq_source(0)
|
, m_irq_source(0)
|
||||||
, m_irq_scanline_start(0)
|
, m_irq_scanline_start(0)
|
||||||
, m_irq_scanline_end(0)
|
, m_irq_scanline_end(0)
|
||||||
, m_coin_unlock(false)
|
, m_coin2_lock_cnt(3)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void init_common();
|
||||||
void init_banbam();
|
void init_banbam();
|
||||||
void init_pettanp();
|
void init_pettanp();
|
||||||
|
|
||||||
@ -73,6 +74,8 @@ protected:
|
|||||||
DECLARE_READ8_MEMBER(banbam_protection_r);
|
DECLARE_READ8_MEMBER(banbam_protection_r);
|
||||||
DECLARE_WRITE8_MEMBER(protection_w);
|
DECLARE_WRITE8_MEMBER(protection_w);
|
||||||
|
|
||||||
|
virtual void machine_start() override;
|
||||||
|
virtual void machine_reset() override;
|
||||||
virtual void video_start() override;
|
virtual void video_start() override;
|
||||||
|
|
||||||
uint32_t screen_update_markham(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
uint32_t screen_update_markham(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||||
@ -109,7 +112,7 @@ private:
|
|||||||
uint8_t m_irq_scanline_start;
|
uint8_t m_irq_scanline_start;
|
||||||
uint8_t m_irq_scanline_end;
|
uint8_t m_irq_scanline_end;
|
||||||
|
|
||||||
bool m_coin_unlock;
|
uint8_t m_coin2_lock_cnt;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAME_INCLUDES_MARKHAM_H
|
#endif // MAME_INCLUDES_MARKHAM_H
|
@ -71,6 +71,7 @@ VIDEO_START_MEMBER(markham_state, strnskil)
|
|||||||
save_item(NAME(m_irq_source));
|
save_item(NAME(m_irq_source));
|
||||||
save_item(NAME(m_irq_scanline_start));
|
save_item(NAME(m_irq_scanline_start));
|
||||||
save_item(NAME(m_irq_scanline_end));
|
save_item(NAME(m_irq_scanline_end));
|
||||||
|
save_item(NAME(m_scroll_ctrl));
|
||||||
}
|
}
|
||||||
|
|
||||||
void markham_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
void markham_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||||
|
Loading…
Reference in New Issue
Block a user