mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
Added some more meter communication to System 5 and MPS, games should complain about less now [J. Wallace]
This commit is contained in:
parent
0056342255
commit
ef0903ee8b
@ -32,21 +32,30 @@
|
||||
#include "sound/sn76496.h"
|
||||
#include "machine/i8255.h"
|
||||
#include "machine/tms9902.h"
|
||||
#include "machine/meters.h"
|
||||
#include "jpmmps.lh"
|
||||
|
||||
class jpmmps_state : public driver_device
|
||||
{
|
||||
public:
|
||||
jpmmps_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu")
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_psg(*this, "sn")
|
||||
{ }
|
||||
|
||||
UINT8 m_sound_buffer;
|
||||
UINT8 m_psg_latch;
|
||||
protected:
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
optional_device<sn76489_device> m_psg;
|
||||
public:
|
||||
DECLARE_DRIVER_INIT(jpmmps);
|
||||
DECLARE_WRITE8_MEMBER(jpmmps_meters_w);
|
||||
DECLARE_WRITE8_MEMBER(jpmmps_psg_buf_w);
|
||||
DECLARE_WRITE8_MEMBER(jpmmps_ic22_portc_w);
|
||||
DECLARE_MACHINE_START(jpmmps);
|
||||
};
|
||||
|
||||
static ADDRESS_MAP_START( jpmmps_map, AS_PROGRAM, 8, jpmmps_state )
|
||||
@ -88,14 +97,24 @@ ADDRESS_MAP_END
|
||||
static INPUT_PORTS_START( jpmmps )
|
||||
INPUT_PORTS_END
|
||||
|
||||
WRITE8_MEMBER(jpmmps_state::jpmmps_meters_w)
|
||||
{
|
||||
int meter=0;
|
||||
for (meter = 0; meter < 8; meter ++)
|
||||
{
|
||||
MechMtr_update(meter, (data & (1 << meter)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static I8255_INTERFACE (ppi8255_intf_ic26)
|
||||
{
|
||||
DEVCB_NULL, /* Port A read */
|
||||
DEVCB_NULL, /* Port A write */
|
||||
DEVCB_NULL, /* Port B read */
|
||||
DEVCB_NULL, /* Port B write */
|
||||
DEVCB_NULL, /* Port B write (0 is coin lockout) */
|
||||
DEVCB_NULL, /* Port C read */
|
||||
DEVCB_NULL /* Port C write */
|
||||
DEVCB_DRIVER_MEMBER(jpmmps_state,jpmmps_meters_w) /* Port C write meters */
|
||||
};
|
||||
|
||||
static I8255_INTERFACE (ppi8255_intf_ic21)
|
||||
@ -108,14 +127,37 @@ static I8255_INTERFACE (ppi8255_intf_ic21)
|
||||
DEVCB_NULL /* Port C write */
|
||||
};
|
||||
|
||||
|
||||
WRITE8_MEMBER(jpmmps_state::jpmmps_psg_buf_w)
|
||||
{
|
||||
m_sound_buffer = data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(jpmmps_state::jpmmps_ic22_portc_w)
|
||||
{
|
||||
//Handle PSG
|
||||
|
||||
if (m_psg_latch != (data & 0x04))
|
||||
{
|
||||
if (!m_psg_latch)//falling edge
|
||||
{
|
||||
m_psg->write(m_sound_buffer);
|
||||
}
|
||||
}
|
||||
m_psg_latch = (data & 0x04);
|
||||
|
||||
MechMtr_update(8, (data & 0x08));
|
||||
|
||||
}
|
||||
|
||||
static I8255_INTERFACE (ppi8255_intf_ic22)
|
||||
{
|
||||
DEVCB_NULL, /* Port A read */
|
||||
DEVCB_NULL, /* Port A write */
|
||||
DEVCB_NULL, /* Port B read */
|
||||
DEVCB_NULL, /* Port B write */
|
||||
DEVCB_DRIVER_MEMBER(jpmmps_state,jpmmps_psg_buf_w), /* Port B write (SN chip data)*/
|
||||
DEVCB_NULL, /* Port C read */
|
||||
DEVCB_NULL /* Port C write */
|
||||
DEVCB_DRIVER_MEMBER(jpmmps_state,jpmmps_ic22_portc_w) /* Port C write (C3 is last meter, C2 latches in data) */
|
||||
};
|
||||
|
||||
static I8255_INTERFACE (ppi8255_intf_ic25)
|
||||
@ -168,6 +210,12 @@ static const sn76496_config psg_intf =
|
||||
DEVCB_NULL
|
||||
};
|
||||
|
||||
MACHINE_START_MEMBER(jpmmps_state,jpmmps)
|
||||
{
|
||||
/* setup 9 mechanical meters */
|
||||
MechMtr_config(machine(),9);
|
||||
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( jpmmps, jpmmps_state )
|
||||
|
||||
@ -184,13 +232,14 @@ static MACHINE_CONFIG_START( jpmmps, jpmmps_state )
|
||||
MCFG_TMS9902_ADD("tms9902_ic10", tms9902_uart4_ic10_params, DUART_CLOCK)
|
||||
MCFG_TMS9902_ADD("tms9902_ic5", tms9902_uart2_ic5_params, DUART_CLOCK)
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(jpmmps_state,jpmmps)
|
||||
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MCFG_SOUND_ADD("sn", SN76489, SOUND_CLOCK)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
MCFG_SOUND_CONFIG(psg_intf)
|
||||
|
||||
MCFG_DEFAULT_LAYOUT(layout_jpmmps)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
DRIVER_INIT_MEMBER(jpmmps_state,jpmmps)
|
||||
|
@ -6,16 +6,17 @@
|
||||
|
||||
driver by Phil Bennett
|
||||
|
||||
AWP bits J.Wallace, D. Haywood
|
||||
|
||||
Video System Games supported:
|
||||
* Monopoly
|
||||
* Monopoly Classic
|
||||
* Monopoly Deluxe
|
||||
|
||||
Known Issues:
|
||||
* Some features used by the AWP games such as reels and meters
|
||||
are not emulated.
|
||||
* Timing for reels, and other opto devices is controlled by the same clock
|
||||
as the lamps, in a weird daisychain setup.
|
||||
* Some features used by the AWP games such as reels are not emulated.
|
||||
* Timing for reels, and other opto devices is controlled by a generated clock
|
||||
in a weird daisychain setup.
|
||||
|
||||
AWP game notes:
|
||||
The byte at 0x81 of the EVEN 68k rom appears to be some kind of
|
||||
@ -290,26 +291,22 @@ READ16_MEMBER(jpmsys5_state::jpm_upd7759_r)
|
||||
*************************************/
|
||||
|
||||
#define JPM_SYS5_COMMON_MAP \
|
||||
ADDRESS_MAP_UNMAP_HIGH \
|
||||
AM_RANGE(0x000000, 0x01ffff) AM_ROM \
|
||||
AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("nvram") \
|
||||
AM_RANGE(0x046000, 0x046001) AM_WRITENOP \
|
||||
AM_RANGE(0x046020, 0x046021) AM_DEVREADWRITE8("acia6850_0", acia6850_device, status_read, control_write, 0xff) \
|
||||
AM_RANGE(0x046022, 0x046023) AM_DEVREADWRITE8("acia6850_0", acia6850_device, data_read, data_write, 0xff) \
|
||||
AM_RANGE(0x046040, 0x04604f) AM_DEVREADWRITE8("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(0x046060, 0x046067) AM_DEVREADWRITE8("6821pia", pia6821_device, read, write,0xff) \
|
||||
AM_RANGE(0x046080, 0x046081) AM_DEVREADWRITE8("acia6850_1", acia6850_device, status_read, control_write, 0xff) \
|
||||
AM_RANGE(0x046082, 0x046083) AM_DEVREADWRITE8("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("acia6850_2", acia6850_device, status_read, control_write, 0xff) \
|
||||
AM_RANGE(0x04608e, 0x04608f) AM_DEVREADWRITE8("acia6850_2", acia6850_device, data_read, data_write, 0xff) \
|
||||
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)
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( 68000_awp_map, AS_PROGRAM, 16, jpmsys5_state )
|
||||
JPM_SYS5_COMMON_MAP
|
||||
AM_RANGE(0x0460a0, 0x0460a3) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
|
||||
@ -481,6 +478,73 @@ static INPUT_PORTS_START( monopoly )
|
||||
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(15)
|
||||
INPUT_PORTS_END
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* 6821 PIA
|
||||
*
|
||||
*************************************/
|
||||
WRITE_LINE_MEMBER(jpmsys5_state::pia_irq)
|
||||
{
|
||||
m_maincpu->set_input_line(INT_6821PIA, state ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
|
||||
READ8_MEMBER(jpmsys5_state::u29_porta_r)
|
||||
{
|
||||
|
||||
int combined_meter = MechMtr_GetActivity(0) | MechMtr_GetActivity(1) |
|
||||
MechMtr_GetActivity(2) | MechMtr_GetActivity(3) |
|
||||
MechMtr_GetActivity(4) | MechMtr_GetActivity(5) |
|
||||
MechMtr_GetActivity(6) | MechMtr_GetActivity(7);
|
||||
|
||||
int meter_bit =0;
|
||||
if(combined_meter)
|
||||
{
|
||||
meter_bit = 0x80;
|
||||
}
|
||||
else
|
||||
{
|
||||
meter_bit = 0x00;
|
||||
}
|
||||
|
||||
return m_direct_port->read() | meter_bit;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(jpmsys5_state::u29_portb_w)
|
||||
{
|
||||
int meter =0;
|
||||
for (meter = 0; meter < 8; meter ++)
|
||||
{
|
||||
MechMtr_update(meter, (data & (1 << meter)));
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(jpmsys5_state::u29_ca2_w)
|
||||
{
|
||||
//The 'CHOP' line controls power to the reel motors, without this the reels won't turn
|
||||
m_chop = state;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(jpmsys5_state::u29_cb2_w)
|
||||
{
|
||||
//On a cabinet, this overrides the volume, we don't emulate this yet
|
||||
logerror("Alarm override enabled \n");
|
||||
}
|
||||
|
||||
static const pia6821_interface pia_intf =
|
||||
{
|
||||
DEVCB_DRIVER_MEMBER(jpmsys5_state,u29_porta_r), /* port A in */
|
||||
DEVCB_NULL, /* port B in */
|
||||
DEVCB_NULL, /* line CA1 in */
|
||||
DEVCB_NULL, /* line CB1 in */
|
||||
DEVCB_NULL, /* line CA2 in */
|
||||
DEVCB_NULL, /* line CB2 in */
|
||||
DEVCB_NULL, /* port A out */
|
||||
DEVCB_DRIVER_MEMBER(jpmsys5_state,u29_portb_w), /* port B out */
|
||||
DEVCB_DRIVER_LINE_MEMBER(jpmsys5_state,u29_ca2_w), /* line CA2 out */
|
||||
DEVCB_DRIVER_LINE_MEMBER(jpmsys5_state,u29_cb2_w), /* port CB2 out */
|
||||
DEVCB_DRIVER_LINE_MEMBER(jpmsys5_state,pia_irq), /* IRQA */
|
||||
DEVCB_DRIVER_LINE_MEMBER(jpmsys5_state,pia_irq) /* IRQB */
|
||||
};
|
||||
|
||||
/*************************************
|
||||
*
|
||||
@ -672,10 +736,12 @@ static MACHINE_CONFIG_START( jpmsys5v, jpmsys5_state )
|
||||
MCFG_SOUND_ADD("upd7759", UPD7759, UPD7759_STANDARD_CLOCK)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
|
||||
|
||||
/* Earlier revisions use an SAA1099 */
|
||||
/* Earlier revisions use an SAA1099, but no video card games seem to (?) */
|
||||
MCFG_SOUND_ADD("ym2413", YM2413, 4000000 ) /* Unconfirmed */
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
|
||||
MCFG_PIA6821_ADD("6821pia", pia_intf)
|
||||
|
||||
/* 6840 PTM */
|
||||
MCFG_PTM6840_ADD("6840ptm", ptm_intf)
|
||||
MACHINE_CONFIG_END
|
||||
@ -747,7 +813,7 @@ INPUT_PORTS_START( popeye )
|
||||
PORT_START("DSW2")
|
||||
PORT_BIT(0xFF, IP_ACTIVE_LOW, IPT_UNKNOWN)
|
||||
|
||||
PORT_START("ROTARY")//not everything has this hooked up, cna be used as a test switch internally
|
||||
PORT_START("ROTARY")//not everything has this hooked up, can be used as a test switch internally
|
||||
PORT_CONFNAME(0x0F, 0x0F, "Rotary Switch")
|
||||
PORT_CONFSETTING( 0x0F, "0")
|
||||
PORT_CONFSETTING( 0x0E, "1")
|
||||
@ -782,9 +848,7 @@ INPUT_PORTS_START( popeye )
|
||||
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_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL )
|
||||
|
||||
PORT_START("COINS")
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("10p")
|
||||
@ -821,6 +885,10 @@ INPUT_PORTS_END
|
||||
MACHINE_START_MEMBER(jpmsys5_state,jpmsys5)
|
||||
{
|
||||
// membank("bank1")->set_base(memregion("maincpu")->base()+0x20000);
|
||||
|
||||
/* setup 8 mechanical meters */
|
||||
MechMtr_config(machine(),8);
|
||||
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(jpmsys5_state,jpmsys5)
|
||||
@ -859,6 +927,8 @@ MACHINE_CONFIG_START( jpmsys5_ym, jpmsys5_state )
|
||||
MCFG_SOUND_ADD("ym2413", YM2413, 4000000 ) /* Unconfirmed */
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
|
||||
MCFG_PIA6821_ADD("6821pia", pia_intf)
|
||||
|
||||
/* 6840 PTM */
|
||||
MCFG_PTM6840_ADD("6840ptm", ptm_intf)
|
||||
MCFG_DEFAULT_LAYOUT(layout_jpmsys5)
|
||||
@ -886,6 +956,8 @@ MACHINE_CONFIG_START( jpmsys5, jpmsys5_state )
|
||||
MCFG_SAA1099_ADD("saa", 4000000 /* guess */)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
|
||||
MCFG_PIA6821_ADD("6821pia", pia_intf)
|
||||
|
||||
/* 6840 PTM */
|
||||
MCFG_PTM6840_ADD("6840ptm", ptm_intf)
|
||||
MCFG_DEFAULT_LAYOUT(layout_jpmsys5)
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "machine/6821pia.h"
|
||||
#include "machine/6840ptm.h"
|
||||
#include "machine/6850acia.h"
|
||||
#include "sound/2413intf.h"
|
||||
@ -9,6 +10,7 @@
|
||||
#include "video/awpvid.h"
|
||||
#include "machine/steppers.h"
|
||||
#include "machine/roc10937.h"
|
||||
#include "machine/meters.h"
|
||||
|
||||
class jpmsys5_state : public driver_device
|
||||
{
|
||||
@ -18,12 +20,14 @@ public:
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_upd7759(*this, "upd7759"),
|
||||
m_tms34061(*this, "tms34061"),
|
||||
m_vfd(*this, "vfd") { }
|
||||
m_vfd(*this, "vfd"),
|
||||
m_direct_port(*this, "DIRECT") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<upd7759_device> m_upd7759;
|
||||
optional_device<tms34061_device> m_tms34061;
|
||||
optional_device<roc10937_t> m_vfd;
|
||||
required_ioport m_direct_port;
|
||||
|
||||
UINT8 m_palette[16][3];
|
||||
int m_pal_addr;
|
||||
@ -37,6 +41,7 @@ public:
|
||||
int m_mpxclk;
|
||||
int m_muxram[255];
|
||||
int m_alpha_clock;
|
||||
int m_chop;
|
||||
UINT8 m_a0_acia_dcd;
|
||||
UINT8 m_a0_data_out;
|
||||
UINT8 m_a0_data_in;
|
||||
@ -60,6 +65,11 @@ public:
|
||||
DECLARE_READ16_MEMBER(jpm_upd7759_r);
|
||||
DECLARE_WRITE_LINE_MEMBER(ptm_irq);
|
||||
DECLARE_WRITE8_MEMBER(u26_o1_callback);
|
||||
DECLARE_WRITE_LINE_MEMBER(pia_irq);
|
||||
DECLARE_READ8_MEMBER(u29_porta_r);
|
||||
DECLARE_WRITE8_MEMBER(u29_portb_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(u29_ca2_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(u29_cb2_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(acia_irq);
|
||||
DECLARE_READ_LINE_MEMBER(a0_rx_r);
|
||||
DECLARE_WRITE_LINE_MEMBER(a0_tx_w);
|
||||
|
@ -2432,6 +2432,8 @@ $(DRIVERS)/jankenmn.o: $(LAYOUT)/jankenmn.lh
|
||||
|
||||
$(DRIVERS)/jpmimpct.o: $(LAYOUT)/jpmimpct.lh
|
||||
|
||||
$(DRIVERS)/jpmmps.o: $(LAYOUT)/jpmmps.lh
|
||||
|
||||
$(DRIVERS)/jpmsys5.o: $(LAYOUT)/jpmsys5.lh
|
||||
|
||||
$(DRIVERS)/kas89.o: $(LAYOUT)/kas89.lh
|
||||
|
Loading…
Reference in New Issue
Block a user