mirror of
https://github.com/holub/mame
synced 2025-06-30 07:58:56 +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 */
|
||||
MCFG_SCREEN_ADD("screen", RASTER)
|
||||
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_SIZE(256, 256)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 30*8-1, 2*8, 32*8-1)
|
||||
|
@ -10,7 +10,9 @@
|
||||
TODO:
|
||||
- needs merging with ikki.cpp
|
||||
- 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
|
||||
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)
|
||||
{
|
||||
/* 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));
|
||||
|
||||
// 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));
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
map(0x0000, 0x5fff).rom();
|
||||
@ -305,19 +315,19 @@ INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( strnskil )
|
||||
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( 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( 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( 0x04, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0x08, 0x00, "Unknown 1-4" )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
|
||||
PORT_DIPNAME( 0xf0, 0x00, "Coin1 / Coin2" )
|
||||
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_DIPSETTING( 0x00, "1C 1C / 1C 1C" )
|
||||
PORT_DIPSETTING( 0x10, "2C 1C / 2C 1C" )
|
||||
PORT_DIPSETTING( 0x20, "2C 1C / 1C 3C" )
|
||||
@ -336,7 +346,7 @@ static INPUT_PORTS_START( strnskil )
|
||||
PORT_DIPSETTING( 0xf0, DEF_STR( Free_Play ) )
|
||||
|
||||
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( 0x01, DEF_STR( Hard ) )
|
||||
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_DIPSETTING( 0x00, DEF_STR( Off ) )
|
||||
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_DIPSETTING( 0x00, "1C 1C / 1C 1C" )
|
||||
PORT_DIPSETTING( 0x10, "2C 1C / 2C 1C" )
|
||||
@ -741,9 +753,20 @@ ROM_START( pettanp )
|
||||
ROM_LOAD( "tvg12-16.2", 0x0000, 0x1000, CRC(3abc6ba8) SHA1(15e0b0f9d068f6094e2be4f4f1dea0ff6e85686b) )
|
||||
|
||||
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
|
||||
|
||||
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()
|
||||
{
|
||||
/* Fujitsu MB8841 4-Bit MCU comms */
|
||||
@ -753,10 +776,6 @@ void markham_state::init_banbam()
|
||||
|
||||
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 */
|
||||
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));
|
||||
|
@ -40,10 +40,11 @@ public:
|
||||
, m_irq_source(0)
|
||||
, m_irq_scanline_start(0)
|
||||
, m_irq_scanline_end(0)
|
||||
, m_coin_unlock(false)
|
||||
, m_coin2_lock_cnt(3)
|
||||
{
|
||||
}
|
||||
|
||||
void init_common();
|
||||
void init_banbam();
|
||||
void init_pettanp();
|
||||
|
||||
@ -73,6 +74,8 @@ protected:
|
||||
DECLARE_READ8_MEMBER(banbam_protection_r);
|
||||
DECLARE_WRITE8_MEMBER(protection_w);
|
||||
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
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_end;
|
||||
|
||||
bool m_coin_unlock;
|
||||
uint8_t m_coin2_lock_cnt;
|
||||
};
|
||||
|
||||
#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_scanline_start));
|
||||
save_item(NAME(m_irq_scanline_end));
|
||||
save_item(NAME(m_scroll_ctrl));
|
||||
}
|
||||
|
||||
void markham_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
|
||||
|
Loading…
Reference in New Issue
Block a user