Managed to get the multiplexer/state machine emulated, amongst some watchdog fixes for BFM games. [J. Wallace]

new NOT WORKING games
---------------------
Popeye (20p/8 GBP Token) [J. Wallace]
This commit is contained in:
Angelo Salese 2011-05-21 14:06:35 +00:00
parent 3abda49b4f
commit aa54afa8e3
6 changed files with 276 additions and 191 deletions

View File

@ -2,14 +2,12 @@
Bellfruit scorpion1 driver, (under heavy construction !!!)
A.G.E Code Copyright J. Wallace and the AGEMAME Development Team.
Visit http://agemame.mameworld.info for more information.
M.A.M.E Core Copyright Nicola Salmoria and the MAME Team,
used under license from http://mamedev.org
******************************************************************************************
04-2011: J Wallace: Fixed watchdog to match actual circuit, also fixed lamping code.
20-01-2007: J Wallace: Tidy up of coding
30-12-2006: J Wallace: Fixed init routines.
07-03-2006: El Condor: Recoded to more accurately represent the hardware setup.
@ -18,6 +16,10 @@
25-08-2005: Added support for adder2 (Toppoker), added support for NEC upd7759 soundcard
Standard scorpion1 memorymap
Note the similarity to system85 - indeed, the working title for this system was System 88,
and was considered an update to existing technology. Later revisions made it a platform in
its own right, prompting marketers to change the name.
___________________________________________________________________________________
hex |r/w| D D D D D D D D |
location | | 7 6 5 4 3 2 1 0 | function
@ -119,9 +121,6 @@ public:
int m_mux2_datalo;
int m_mux2_datahi;
int m_mux2_input;
int m_watchdog_cnt;
int m_watchdog_kicked;
UINT8 m_Lamps[256];
UINT8 m_sc1_Inputs[64];
UINT8 m_codec_data[256];
};
@ -164,20 +163,6 @@ static WRITE8_HANDLER( bankswitch_w )
static INTERRUPT_GEN( timer_irq )
{
bfm_sc1_state *state = device->machine().driver_data<bfm_sc1_state>();
if ( state->m_watchdog_kicked )
{
state->m_watchdog_cnt = 0;
state->m_watchdog_kicked = 0;
}
else
{
state->m_watchdog_cnt++;
if ( state->m_watchdog_cnt > 2 ) // this is a hack, i don't know what the watchdog timeout is, 3 IRQ's works fine
{ // reset board
device->machine().schedule_soft_reset();// reset entire machine. CPU 0 should be enough, but that doesn't seem to work !!
return;
}
}
if ( state->m_is_timer_enabled )
{
@ -421,19 +406,12 @@ static WRITE8_HANDLER( mux1latch_w )
for ( i = 0; i < 8; i++ )
{
state->m_Lamps[ BFM_strcnv[offset ] ] = state->m_mux1_datalo & pattern?1:0;
state->m_Lamps[ BFM_strcnv[offset+8] ] = state->m_mux1_datahi & pattern?1:0;
output_set_lamp_value(BFM_strcnv[offset ], (state->m_mux1_datalo & pattern?1:0) );
output_set_lamp_value(BFM_strcnv[offset+8], (state->m_mux1_datahi & pattern?1:0) );
pattern<<=1;
offset++;
}
if (strobe == 0)
{
for ( i = 0; i < 256; i++ )
{
output_set_lamp_value(i, state->m_Lamps[i]);
}
}
}
if ( !(data & 0x08) )
@ -505,9 +483,9 @@ static WRITE8_HANDLER( mux2latch_w )
for ( i = 0; i < 8; i++ )
{
state->m_Lamps[ BFM_strcnv[offset ] ] = state->m_mux2_datalo & pattern?1:0;
state->m_Lamps[ BFM_strcnv[offset+8] ] = state->m_mux2_datahi & pattern?1:0;
pattern<<=1;
output_set_lamp_value(BFM_strcnv[offset ], (state->m_mux2_datalo & pattern?1:0) );
output_set_lamp_value(BFM_strcnv[offset+8], (state->m_mux2_datahi & pattern?1:0) );
pattern<<=1;
offset++;
}
}
@ -535,14 +513,6 @@ static WRITE8_HANDLER( mux2dathi_w )
state->m_mux2_datahi = data;
}
/////////////////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( watchdog_w )
{
bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->m_watchdog_kicked = 1;
}
/////////////////////////////////////////////////////////////////////////////////////
// serial port //////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
@ -797,7 +767,7 @@ static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8 )
AM_RANGE(0x4000, 0x5FFF) AM_ROM // 8k ROM
AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK("bank1") // 8k paged ROM (4 pages)
AM_RANGE(0x8000, 0xFFFF) AM_ROM AM_WRITE (watchdog_w)//AM_RAM_WRITE(watchdog_w) // 32k ROM
AM_RANGE(0x8000, 0xFFFF) AM_ROM AM_WRITE (watchdog_reset_w) // 32k ROM
ADDRESS_MAP_END
@ -845,7 +815,7 @@ static ADDRESS_MAP_START( memmap_adder2, AS_PROGRAM, 8 )
AM_RANGE(0x4000, 0x5FFF) AM_ROM // 8k ROM
AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK("bank1") // 8k paged ROM (4 pages)
AM_RANGE(0x8000, 0xFFFF) AM_ROM AM_WRITE(watchdog_w) // 32k ROM
AM_RANGE(0x8000, 0xFFFF) AM_ROM AM_WRITE(watchdog_reset_w) // 32k ROM
ADDRESS_MAP_END
@ -890,7 +860,7 @@ static ADDRESS_MAP_START( sc1_nec_uk, AS_PROGRAM, 8 )
AM_RANGE(0x4000, 0x5FFF) AM_ROM // 8k ROM
AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK("bank1") // 8k paged ROM (4 pages)
AM_RANGE(0x8000, 0xFFFF) AM_ROM AM_WRITE(watchdog_w) // 32k ROM
AM_RANGE(0x8000, 0xFFFF) AM_ROM AM_WRITE(watchdog_reset_w) // 32k ROM
ADDRESS_MAP_END
@ -1244,6 +1214,7 @@ static MACHINE_CONFIG_START( scorpion1, bfm_sc1_state )
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4) // 6809 CPU at 1 Mhz
MCFG_CPU_PROGRAM_MAP(memmap) // setup read and write memorymap
MCFG_CPU_PERIODIC_INT(timer_irq, 1000 ) // generate 1000 IRQ's per second
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("aysnd",AY8912, MASTER_CLOCK/4)

View File

@ -6,13 +6,15 @@
*****************************************************************************************
04-2011: J Wallace: Fixed watchdog to match actual circuit, also fixed lamping code.
30-12-2006: J Wallace: Fixed init routines.
07-03-2006: El Condor: Recoded to more accurately represent the hardware setup.
18-01-2006: Cleaned up for MAME inclusion
19-08-2005: Re-Animator
Standard scorpion2 memorymap
The hardware in Scorpion 2 is effectively a Scorpion 1 board with better, non-compatible
microcontrollers, incorporating many of the old expansions on board.
hex |r/w| D D D D D D D D |
location | | 7 6 5 4 3 2 1 0 | function
@ -193,6 +195,7 @@ public:
int m_volume_override;
int m_sc2_show_door;
int m_sc2_door_state;
int m_reels;
int m_reel12_latch;
int m_reel34_latch;
int m_reel56_latch;
@ -204,9 +207,6 @@ public:
int m_hopper_running;
int m_hopper_coin_sense;
int m_timercnt;
int m_watchdog_cnt;
int m_watchdog_kicked;
UINT8 m_Lamps[256];
UINT8 m_sc2_Inputs[64];
UINT8 m_input_override[64];
int m_e2reg;
@ -293,10 +293,6 @@ static void on_scorpion2_reset(running_machine &machine)
state->m_slide_states[4] = 0;
state->m_slide_states[5] = 0;
state->m_watchdog_cnt = 0;
state->m_watchdog_kicked = 0;
BFM_BD1_reset(0); // reset display1
BFM_BD1_reset(1); // reset display2
@ -306,13 +302,9 @@ static void on_scorpion2_reset(running_machine &machine)
// reset stepper motors /////////////////////////////////////////////////
{
/* Although the BFM video games don't use stepper motors to control reels,
the connections are still present on the board, and some of the programs still
send data to them, although obviously there's no response. */
int pattern =0, i;
for ( i = 0; i < 6; i++)
for ( i = 0; i < state->m_reels; i++)
{
stepper_reset_position(i);
if ( stepper_optic_state(i) ) pattern |= 1<<i;
@ -427,14 +419,6 @@ static NVRAM_HANDLER( bfm_sc2 )
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( watchdog_w )
{
bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->m_watchdog_kicked = 1;
}
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( bankswitch_w )
{
memory_set_bank(space->machine(), "bank1",data & 0x03);
@ -447,22 +431,6 @@ static INTERRUPT_GEN( timer_irq )
bfm_sc2_state *state = device->machine().driver_data<bfm_sc2_state>();
state->m_timercnt++;
if ( state->m_watchdog_kicked )
{
state->m_watchdog_cnt = 0;
state->m_watchdog_kicked = 0;
}
else
{
state->m_watchdog_cnt++;
if ( state->m_watchdog_cnt > 2 ) // this is a hack, i don't know what the watchdog timeout is, 3 IRQ's works fine
{ // reset board
device->machine().schedule_soft_reset(); // reset entire machine. CPU 0 should be enough, but that doesn't seem to work !!
on_scorpion2_reset(device->machine());
return;
}
}
if ( state->m_is_timer_enabled )
{
state->m_irq_timer_stat = 0x01;
@ -508,44 +476,6 @@ static WRITE8_HANDLER( reel12_vid_w ) // in a video cabinet this is used to dri
}
}
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( reel34_w )
{
bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->m_reel34_latch = data;
if ( stepper_update(2, data&0x0f ) ) state->m_reel_changed |= 0x04;
if ( stepper_update(3, (data>>4)&0x0f) ) state->m_reel_changed |= 0x08;
if ( stepper_optic_state(2) ) state->m_optic_pattern |= 0x04;
else state->m_optic_pattern &= ~0x04;
if ( stepper_optic_state(3) ) state->m_optic_pattern |= 0x08;
else state->m_optic_pattern &= ~0x08;
awp_draw_reel(2);
awp_draw_reel(3);
}
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( reel56_w )
{
bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->m_reel56_latch = data;
if ( stepper_update(4, data&0x0f ) ) state->m_reel_changed |= 0x10;
if ( stepper_update(5, (data>>4)&0x0f) ) state->m_reel_changed |= 0x20;
if ( stepper_optic_state(4) ) state->m_optic_pattern |= 0x10;
else state->m_optic_pattern &= ~0x10;
if ( stepper_optic_state(5) ) state->m_optic_pattern |= 0x20;
else state->m_optic_pattern &= ~0x20;
awp_draw_reel(4);
awp_draw_reel(5);
}
///////////////////////////////////////////////////////////////////////////
// mechanical meters //////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
@ -572,21 +502,12 @@ static WRITE8_HANDLER( mmtr_w )
static WRITE8_HANDLER( mux_output_w )
{
bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int i;
int off = offset<<3;
for (i=0; i<8; i++)
{
state->m_Lamps[ off+i ] = (data & (1 << i)) != 0;
}
if (offset == 0) // update all lamps after strobe 0 has been updated (HACK)
{
for ( i = 0; i < 256; i++ )
{
output_set_lamp_value(i, state->m_Lamps[i]);
}
}
output_set_lamp_value(off+i, ((data & (1 << i)) != 0));
}
///////////////////////////////////////////////////////////////////////////
@ -1448,7 +1369,6 @@ static MACHINE_RESET( init )
on_scorpion2_reset(machine);
BFM_BD1_init(0);
BFM_BD1_init(1);
//BFM_dm01_reset(machine); No known video based game has a Matrix board
}
static SCREEN_UPDATE( addersc2 )
@ -1469,8 +1389,8 @@ static ADDRESS_MAP_START( memmap_vid, AS_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("nvram") //8k RAM
AM_RANGE(0x2000, 0x2000) AM_READ(vfd_status_hop_r) // vfd status register
AM_RANGE(0x2000, 0x20FF) AM_WRITE(reel12_vid_w)
AM_RANGE(0x2100, 0x21FF) AM_WRITE(reel34_w)
AM_RANGE(0x2200, 0x22FF) AM_WRITE(reel56_w)
AM_RANGE(0x2100, 0x21FF) AM_WRITENOP
AM_RANGE(0x2200, 0x22FF) AM_WRITENOP
AM_RANGE(0x2300, 0x230B) AM_READ(mux_input_r) // mux inputs
AM_RANGE(0x2300, 0x231F) AM_WRITE(mux_output_w) // mux outputs
@ -1485,7 +1405,7 @@ static ADDRESS_MAP_START( memmap_vid, AS_PROGRAM, 8 )
AM_RANGE(0x232F, 0x232F) AM_WRITE(coininhib_w) // coin inhibits
AM_RANGE(0x2330, 0x2330) AM_WRITE(payout_latch_w)
AM_RANGE(0x2331, 0x2331) AM_WRITE(payout_triac_w)
AM_RANGE(0x2332, 0x2332) AM_WRITE(watchdog_w) // kick watchdog
AM_RANGE(0x2332, 0x2332) AM_WRITE(watchdog_reset_w) // kick watchdog
AM_RANGE(0x2333, 0x2333) AM_WRITE(mmtr_w) // mechanical meters
AM_RANGE(0x2334, 0x2335) AM_WRITE(unknown_w)
AM_RANGE(0x2336, 0x2336) AM_WRITE(dimcnt_w) // ?unknown dim related
@ -1712,15 +1632,6 @@ static INPUT_PORTS_START( gldncrwn )
PORT_DIPSETTING( 0x01, "2 credits per game")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x00)
PORT_DIPSETTING( 0x00, "1 credit per round")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x10)
PORT_DIPSETTING( 0x01, "4 credits per round")PORT_CONDITION("STROBE10",0x10,PORTCOND_EQUALS,0x10)
/*
Type1 Type2
0 0 4 credits per game
0 1 2 credits per game
1 0 1 credit per round
1 1 4 credits per round
*/
PORT_DIPNAME( 0x02, 0x00, "Attract Mode" )PORT_DIPLOCATION("DIL:!13")
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@ -2180,6 +2091,7 @@ static MACHINE_CONFIG_START( scorpion2_vid, bfm_sc2_state )
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 ) // 6809 CPU at 2 Mhz
MCFG_CPU_PROGRAM_MAP(memmap_vid) // setup scorpion2 board memorymap
MCFG_CPU_PERIODIC_INT(timer_irq, 1000) // generate 1000 IRQ's per second
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_NVRAM_HANDLER(bfm_sc2)
@ -2201,7 +2113,7 @@ static MACHINE_CONFIG_START( scorpion2_vid, bfm_sc2_state )
MCFG_CPU_ADD("adder2", M6809, MASTER_CLOCK/4 ) // adder2 board 6809 CPU at 2 Mhz
MCFG_CPU_PROGRAM_MAP(adder2_memmap) // setup adder2 board memorymap
MCFG_CPU_VBLANK_INT("adder", adder2_vbl) // board has a VBL IRQ
MCFG_CPU_VBLANK_INT("adder", adder2_vbl) // board has a VBL IRQ
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("upd", UPD7759, UPD7759_STANDARD_CLOCK)
@ -2624,6 +2536,44 @@ static WRITE8_HANDLER( reel12_w )
awp_draw_reel(1);
}
static WRITE8_HANDLER( reel34_w )
{
bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->m_reel34_latch = data;
if ( stepper_update(2, data&0x0f ) ) state->m_reel_changed |= 0x04;
if ( stepper_update(3, (data>>4)&0x0f) ) state->m_reel_changed |= 0x08;
if ( stepper_optic_state(2) ) state->m_optic_pattern |= 0x04;
else state->m_optic_pattern &= ~0x04;
if ( stepper_optic_state(3) ) state->m_optic_pattern |= 0x08;
else state->m_optic_pattern &= ~0x08;
awp_draw_reel(2);
awp_draw_reel(3);
}
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( reel56_w )
{
bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->m_reel56_latch = data;
if ( stepper_update(4, data&0x0f ) ) state->m_reel_changed |= 0x10;
if ( stepper_update(5, (data>>4)&0x0f) ) state->m_reel_changed |= 0x20;
if ( stepper_optic_state(4) ) state->m_optic_pattern |= 0x10;
else state->m_optic_pattern &= ~0x10;
if ( stepper_optic_state(5) ) state->m_optic_pattern |= 0x20;
else state->m_optic_pattern &= ~0x20;
awp_draw_reel(4);
awp_draw_reel(5);
}
///////////////////////////////////////////////////////////////////////////
/* VFD Status */
static READ8_HANDLER( vfd_status_r )
@ -2738,7 +2688,7 @@ static ADDRESS_MAP_START( sc2_memmap, AS_PROGRAM, 8 )
AM_RANGE(0x232F, 0x232F) AM_WRITE(coininhib_w)
AM_RANGE(0x2330, 0x2330) AM_WRITE(payout_latch_w)
AM_RANGE(0x2331, 0x2331) AM_WRITE(payout_triac_w)
AM_RANGE(0x2332, 0x2332) AM_WRITE(watchdog_w)
AM_RANGE(0x2332, 0x2332) AM_WRITE(watchdog_reset_w)
AM_RANGE(0x2333, 0x2333) AM_WRITE(mmtr_w)
AM_RANGE(0x2334, 0x2335) AM_WRITE(unknown_w)
AM_RANGE(0x2336, 0x2336) AM_WRITE(dimcnt_w)
@ -2761,7 +2711,7 @@ static ADDRESS_MAP_START( sc2_memmap, AS_PROGRAM, 8 )
AM_RANGE(0x3FFF, 0x3FFF) AM_READ( coin_input_r)
AM_RANGE(0x4000, 0x5FFF) AM_ROM /* 8k fixed ROM */
AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK("bank1") /* 8k paged ROM (4 pages) */
AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK("bank1") /* 8k paged ROM (4 pages) */
AM_RANGE(0x8000, 0xFFFF) AM_ROM /* 32k ROM */
ADDRESS_MAP_END
@ -2787,7 +2737,7 @@ static ADDRESS_MAP_START( sc3_memmap, AS_PROGRAM, 8 )
AM_RANGE(0x232F, 0x232F) AM_WRITE(coininhib_w)
AM_RANGE(0x2330, 0x2330) AM_WRITE(payout_latch_w)
AM_RANGE(0x2331, 0x2331) AM_WRITE(payout_triac_w)
AM_RANGE(0x2332, 0x2332) AM_WRITE(watchdog_w)
AM_RANGE(0x2332, 0x2332) AM_WRITE(watchdog_reset_w)
AM_RANGE(0x2333, 0x2333) AM_WRITE(mmtr_w)
AM_RANGE(0x2334, 0x2335) AM_WRITE(unknown_w)
AM_RANGE(0x2336, 0x2336) AM_WRITE(dimcnt_w)
@ -2836,7 +2786,7 @@ static ADDRESS_MAP_START( memmap_sc2_dm01, AS_PROGRAM, 8 )
AM_RANGE(0x232F, 0x232F) AM_WRITE(coininhib_w)
AM_RANGE(0x2330, 0x2330) AM_WRITE(payout_latch_w)
AM_RANGE(0x2331, 0x2331) AM_WRITE(payout_triac_w)
AM_RANGE(0x2332, 0x2332) AM_WRITE(watchdog_w)
AM_RANGE(0x2332, 0x2332) AM_WRITE(watchdog_reset_w)
AM_RANGE(0x2333, 0x2333) AM_WRITE(mmtr_w)
AM_RANGE(0x2334, 0x2335) AM_WRITE(unknown_w)
AM_RANGE(0x2336, 0x2336) AM_WRITE(dimcnt_w)
@ -3311,7 +3261,6 @@ static INPUT_PORTS_START( drwho )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
INPUT_PORTS_END
static INPUT_PORTS_START( cpeno1 )
PORT_START("COINS")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3)
@ -3466,7 +3415,6 @@ static INPUT_PORTS_START( cpeno1 )
PORT_DIPSETTING( 0x18, "85%" )
INPUT_PORTS_END
static INPUT_PORTS_START( luvjub )
PORT_START("COINS")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3)
@ -3623,7 +3571,6 @@ static INPUT_PORTS_START( luvjub )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
INPUT_PORTS_END
static INPUT_PORTS_START( bfmcgslm )
PORT_START("COINS")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3)
@ -3780,7 +3727,6 @@ static INPUT_PORTS_START( bfmcgslm )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
INPUT_PORTS_END
static INPUT_PORTS_START( scorpion3 )
PORT_START("COINS")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Fl 5.00")
@ -3944,6 +3890,7 @@ static MACHINE_CONFIG_START( scorpion2, bfm_sc2_state )
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 )
MCFG_CPU_PROGRAM_MAP(sc2_memmap)
MCFG_CPU_PERIODIC_INT(timer_irq, 1000 )
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("upd",UPD7759, UPD7759_STANDARD_CLOCK)
@ -3974,6 +3921,8 @@ static MACHINE_CONFIG_START( scorpion2_dm01, bfm_sc2_state )
MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 )
MCFG_CPU_PROGRAM_MAP(memmap_sc2_dm01)
MCFG_CPU_PERIODIC_INT(timer_irq, 1000 )
MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ymsnd",YM2413, XTAL_3_579545MHz)
@ -3994,9 +3943,14 @@ MACHINE_CONFIG_END
static void sc2awp_common_init(running_machine &machine,int reels, int decrypt)
{
bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
int n;
sc2_common_init(machine, decrypt);
/* setup n default 96 half step reels */
state->m_reels=reels;
for ( n = 0; n < reels; n++ )
{
stepper_config(machine, n, &starpoint_interface_48step);

View File

@ -2,15 +2,13 @@
Bellfruit system85 driver, (under heavy construction !!!)
A.G.E Code Copyright J. Wallace and the AGEMAME Development Team.
Visit http://agemame.mameworld.info for more information.
M.A.M.E Core Copyright Nicola Salmoria and the MAME Team,
used under license from http://mamedev.org
******************************************************************************************
04-2011: J Wallace: Fixed lamping code.
19-08-2005: Re-Animator
Standard system85 memorymap
@ -86,7 +84,6 @@ public:
int m_mux_output_strobe;
int m_mux_input_strobe;
int m_mux_input;
UINT8 m_Lamps[128];
UINT8 m_Inputs[64];
UINT8 m_sys85_data_line_r;
UINT8 m_sys85_data_line_t;
@ -155,7 +152,7 @@ static MACHINE_RESET( bfm_sys85 )
}
state->m_optic_pattern = pattern;
}
state->m_locked = 0x00; // hardware is NOT state->m_locked
state->m_locked = 0x00; // hardware is open
}
///////////////////////////////////////////////////////////////////////////
@ -279,29 +276,6 @@ static WRITE8_HANDLER( vfd_w )
//////////////////////////////////////////////////////////////////////////////////
// input / output multiplexers ///////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
// conversion table BFM strobe data to internal lamp numbers
static const UINT8 BFM_strcnv85[] =
{
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, 0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, 0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37, 0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47, 0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57, 0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67, 0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77, 0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, 0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97, 0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7, 0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7, 0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7, 0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7, 0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7, 0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7, 0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
};
///////////////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( mux_ctrl_w )
{
@ -354,18 +328,10 @@ static WRITE8_HANDLER( mux_data_w )
for ( i = 0; i < 8; i++ )
{
state->m_Lamps[BFM_strcnv85[off]] = data & pattern ? 1 : 0;
output_set_lamp_value(off, (data & pattern ? 1 : 0));
pattern <<= 1;
off++;
}
if (state->m_mux_output_strobe == 0)
{
for ( i = 0; i < 128; i++ )
{
output_set_lamp_value(i, state->m_Lamps[i]);
}
}
}
static READ8_HANDLER( mux_data_r )

View File

@ -43,6 +43,9 @@ public:
int m_touch_data_count;
int m_touch_data[3];
int m_touch_shift_cnt;
int m_lamp_strobe;
int m_mpxclk;
int m_muxram[255];
UINT8 m_a0_acia_dcd;
UINT8 m_a0_data_out;
UINT8 m_a0_data_in;
@ -204,6 +207,16 @@ static SCREEN_UPDATE( jpmsys5v )
return 0;
}
static void sys5_draw_lamps(jpmsys5_state *state)
{
int i;
for (i = 0; i <8; i++)
{
output_set_lamp_value( (16*state->m_lamp_strobe)+i, (state->m_muxram[(4*state->m_lamp_strobe)] & (1 << i)) !=0);
output_set_lamp_value((16*state->m_lamp_strobe)+i+8, (state->m_muxram[(4*state->m_lamp_strobe) +1 ] & (1 << i)) !=0);
output_set_indexed_value("sys5led",(8*state->m_lamp_strobe)+i,(state->m_muxram[(4*state->m_lamp_strobe) +2 ] & (1 << i)) !=0);
}
}
/****************************************
*
@ -238,7 +251,8 @@ static READ16_HANDLER( unk_r )
static WRITE16_HANDLER( mux_w )
{
/* TODO: Lamps! */
jpmsys5_state *state = space->machine().driver_data<jpmsys5_state>();
state->m_muxram[offset]=data;
}
static READ16_HANDLER( mux_r )
@ -467,11 +481,30 @@ static WRITE_LINE_DEVICE_HANDLER( ptm_irq )
cputag_set_input_line(device->machine(), "maincpu", INT_6840PTM, state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE8_DEVICE_HANDLER(u26_o1_callback)
{
jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
if (state->m_mpxclk !=data)
{
if (!data) //falling edge
{
state->m_lamp_strobe++;
if (state->m_lamp_strobe >15)
{
state->m_lamp_strobe =0;
}
}
sys5_draw_lamps(state);
}
state->m_mpxclk = data;
}
static const ptm6840_interface ptm_intf =
{
1000000,
{ 0, 0, 0 },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL },
{ DEVCB_HANDLER(u26_o1_callback), DEVCB_NULL, DEVCB_NULL },
DEVCB_LINE(ptm_irq)
};
@ -700,3 +733,162 @@ ROM_END
GAME( 1994, monopoly, 0, jpmsys5v, monopoly, 0, ROT0, "JPM", "Monopoly", 0 )
GAME( 1995, monoplcl, monopoly, jpmsys5v, monopoly, 0, ROT0, "JPM", "Monopoly Classic", 0 )
GAME( 1995, monopldx, 0, jpmsys5v, monopoly, 0, ROT0, "JPM", "Monopoly Deluxe", 0 )
//AWP Skeleton driver
#include "video/awpvid.h"
#include "machine/steppers.h"
#include "machine/roc10937.h"
static ADDRESS_MAP_START( 68000_awp_map, AS_PROGRAM, 16 )
AM_RANGE(0x000000, 0x01ffff) AM_ROM
AM_RANGE(0x01fffe, 0x01ffff) AM_WRITE(rombank_w)
AM_RANGE(0x020000, 0x03ffff) AM_ROMBANK("bank1")
AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x046000, 0x046001) AM_WRITENOP
AM_RANGE(0x046020, 0x046021) AM_DEVREADWRITE8_MODERN("acia6850_0", acia6850_device, status_read, control_write, 0xff)
AM_RANGE(0x046022, 0x046023) AM_DEVREADWRITE8_MODERN("acia6850_0", acia6850_device, data_read, data_write, 0xff)
AM_RANGE(0x046040, 0x04604f) AM_DEVREADWRITE8_MODERN("6840ptm", ptm6840_device, read, write, 0xff)
AM_RANGE(0x046060, 0x046061) AM_READ_PORT("DIRECT") AM_WRITENOP
AM_RANGE(0x046062, 0x046063) AM_WRITENOP
AM_RANGE(0x046064, 0x046065) AM_WRITENOP
AM_RANGE(0x046066, 0x046067) AM_WRITENOP
AM_RANGE(0x046080, 0x046081) AM_DEVREADWRITE8_MODERN("acia6850_1", acia6850_device, status_read, control_write, 0xff)
AM_RANGE(0x046082, 0x046083) AM_DEVREADWRITE8_MODERN("acia6850_1", acia6850_device, data_read, data_write, 0xff)
AM_RANGE(0x046084, 0x046085) AM_READ(unk_r) // PIA?
AM_RANGE(0x046088, 0x046089) AM_READ(unk_r) // PIA?
AM_RANGE(0x04608c, 0x04608d) AM_DEVREADWRITE8_MODERN("acia6850_2", acia6850_device, status_read, control_write, 0xff)
AM_RANGE(0x04608e, 0x04608f) AM_DEVREADWRITE8_MODERN("acia6850_2", acia6850_device, data_read, data_write, 0xff)
AM_RANGE(0x0460a0, 0x0460a3) AM_DEVWRITE8("ym2413", ym2413_w, 0x00ff)
AM_RANGE(0x0460c0, 0x0460c1) AM_WRITENOP
AM_RANGE(0x048000, 0x04801f) AM_READWRITE(coins_r, coins_w)
AM_RANGE(0x04c000, 0x04c0ff) AM_READ(mux_r) AM_WRITE(mux_w)
AM_RANGE(0x04c100, 0x04c105) AM_DEVREADWRITE("upd7759", jpm_upd7759_r, jpm_upd7759_w)
ADDRESS_MAP_END
/*************************************
*
* Port definitions
*
*************************************/
static INPUT_PORTS_START( popeye )
PORT_START("DSW")
PORT_DIPNAME( 0x01, 0x01, "Change state to enter test" ) PORT_DIPLOCATION("SW2:1")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:2")
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, "Alarm" ) PORT_DIPLOCATION("SW2:3")
PORT_DIPSETTING( 0x04, "Discontinue alarm when jam is cleared" )
PORT_DIPSETTING( 0x00, "Continue alarm until back door open" )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0xc0, 0x00, "Payout Percentage" ) PORT_DIPLOCATION("SW2:7,8")
PORT_DIPSETTING( 0x00, "50%" )
PORT_DIPSETTING( 0x80, "45%" )
PORT_DIPSETTING( 0x40, "40%" )
PORT_DIPSETTING( 0xc0, "30%" )
PORT_START("DIRECT")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Back door") PORT_CODE(KEYCODE_R) PORT_TOGGLE
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Cash door") PORT_CODE(KEYCODE_T) PORT_TOGGLE
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Refill key") PORT_CODE(KEYCODE_Y) PORT_TOGGLE
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, "Reset" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x00, DEF_STR ( Unknown ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("COINS")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("20p")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("50p")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_NAME("100p")
PORT_BIT( 0xc3, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
/*************************************
*
* Initialisation
*
*************************************/
static MACHINE_START( jpmsys5 )
{
memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base());
}
static MACHINE_RESET( jpmsys5 )
{
jpmsys5_state *state = machine.driver_data<jpmsys5_state>();
state->m_a2_data_in = 1;
state->m_a2_acia_dcd = 0;
}
/*************************************
*
* Machine driver
*
*************************************/
static MACHINE_CONFIG_START( jpmsys5, jpmsys5_state )
MCFG_CPU_ADD("maincpu", M68000, 8000000)
MCFG_CPU_PROGRAM_MAP(68000_awp_map)
MCFG_ACIA6850_ADD("acia6850_0", acia0_if)
MCFG_ACIA6850_ADD("acia6850_1", acia1_if)
MCFG_ACIA6850_ADD("acia6850_2", acia2_if)
MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_MACHINE_START(jpmsys5)
MCFG_MACHINE_RESET(jpmsys5)
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("upd7759", UPD7759, UPD7759_STANDARD_CLOCK)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
/* Earlier revisions use an SAA1099 */
MCFG_SOUND_ADD("ym2413", YM2413, 4000000 ) /* Unconfirmed */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
/* 6840 PTM */
MCFG_PTM6840_ADD("6840ptm", ptm_intf)
MCFG_DEFAULT_LAYOUT(layout_awpvid16)
MACHINE_CONFIG_END
/*************************************
*
* ROM definition(s)
*
*************************************/
ROM_START( m_popeye )
ROM_REGION( 0x300000, "maincpu", 0 )
ROM_LOAD16_BYTE( "popeye_std_p1.bin", 0x000000, 0x10000, CRC(a8d5394c) SHA1(5be0cd8bc4cdb230a839f83e1297bc57dde20d94) )
ROM_LOAD16_BYTE( "popeye_std_p2.bin", 0x000001, 0x10000, CRC(5537afc2) SHA1(3e90fef908b80939c781a85a2ac9783de62d4122) )
ROM_REGION( 0x80000, "upd7759", 0 )
ROM_LOAD( "popsnd.bin", 0x00000, 0x80000, CRC(67378dbc) SHA1(83f87e35bb2c73a788c0ed778b33f3710eb95406) )
ROM_END
GAME( 1994, m_popeye, 0, jpmsys5, popeye, 0, ROT0, "JPM", "Popeye (20p/8 GBP Token)", GAME_NOT_WORKING )

View File

@ -3309,7 +3309,6 @@ some of the rom names were using something else and have been renamed to match t
0x2800000 - 0x2bfffff IC11
0x2c00000 - 0x2ffffff IC12
Update:Issue fixed,see stvhacks.c for more details (TODO: Clean-up that)
*/

View File

@ -9098,6 +9098,9 @@ crisscrs // (c) 1986
tenup // (c) 1988
tenup3 // (c) 1988
// JPM System 5 Games
m_popeye
// JPM System 5 + video expansion 2 Games
monopoly // (c) 1994
monoplcl // (c) 1995