deprecat.h, 60 to go

This commit is contained in:
Angelo Salese 2011-12-08 20:15:04 +00:00
parent 7b345f39fa
commit a3cb723be8
5 changed files with 125 additions and 104 deletions

View File

@ -42,7 +42,6 @@ Notes:
************************************************************************************************************/ ************************************************************************************************************/
#include "emu.h" #include "emu.h"
#include "deprecat.h"
#include "cpu/m68000/m68000.h" #include "cpu/m68000/m68000.h"
#include "cpu/z180/z180.h" #include "cpu/z180/z180.h"
#include "machine/8255ppi.h" #include "machine/8255ppi.h"
@ -54,7 +53,9 @@ class igs017_state : public driver_device
{ {
public: public:
igs017_state(const machine_config &mconfig, device_type type, const char *tag) igs017_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { } : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu")
{ }
int m_toggle; int m_toggle;
int m_debug_addr; int m_debug_addr;
@ -75,6 +76,8 @@ public:
int m_irq1_enable; int m_irq1_enable;
int m_irq2_enable; int m_irq2_enable;
UINT8 *m_spriteram; UINT8 *m_spriteram;
required_device<cpu_device> m_maincpu;
}; };
@ -2271,21 +2274,19 @@ GFXDECODE_END
Machine Drivers Machine Drivers
***************************************************************************/ ***************************************************************************/
static INTERRUPT_GEN( iqblocka_interrupt ) static TIMER_DEVICE_CALLBACK( irqblocka_interrupt )
{ {
igs017_state *state = device->machine().driver_data<igs017_state>(); igs017_state *state = timer.machine().driver_data<igs017_state>();
if (cpu_getiloops(device) & 1) int scanline = param;
{
if (state->m_nmi_enable) if(scanline == 240 && state->m_irq_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); device_set_input_line(state->m_maincpu, 0, HOLD_LINE);
}
else if(scanline == 0 && state->m_nmi_enable)
{ device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, PULSE_LINE);
if (state->m_irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
}
} }
// Dips are read through the 8255 // Dips are read through the 8255
static const ppi8255_interface iqblocka_ppi8255_intf = static const ppi8255_interface iqblocka_ppi8255_intf =
{ {
@ -2310,7 +2311,7 @@ static MACHINE_CONFIG_START( iqblocka, igs017_state )
MCFG_CPU_ADD("maincpu", Z180, XTAL_16MHz / 2) MCFG_CPU_ADD("maincpu", Z180, XTAL_16MHz / 2)
MCFG_CPU_PROGRAM_MAP(iqblocka_map) MCFG_CPU_PROGRAM_MAP(iqblocka_map)
MCFG_CPU_IO_MAP(iqblocka_io) MCFG_CPU_IO_MAP(iqblocka_io)
MCFG_CPU_VBLANK_INT_HACK(iqblocka_interrupt,2) MCFG_TIMER_ADD_SCANLINE("scantimer", irqblocka_interrupt, "screen", 0, 1)
MCFG_PPI8255_ADD( "ppi8255", iqblocka_ppi8255_intf ) MCFG_PPI8255_ADD( "ppi8255", iqblocka_ppi8255_intf )
@ -2344,19 +2345,16 @@ MACHINE_CONFIG_END
// mgcs // mgcs
static INTERRUPT_GEN( mgcs_interrupt ) static TIMER_DEVICE_CALLBACK( mgcs_interrupt )
{ {
igs017_state *state = device->machine().driver_data<igs017_state>(); igs017_state *state = timer.machine().driver_data<igs017_state>();
if (cpu_getiloops(device) & 1) int scanline = param;
{
if (state->m_irq2_enable) if(scanline == 240 && state->m_irq1_enable)
device_set_input_line(device, 2, HOLD_LINE); device_set_input_line(state->m_maincpu, 1, HOLD_LINE);
}
else if(scanline == 0 && state->m_irq2_enable)
{ device_set_input_line(state->m_maincpu, 2, HOLD_LINE);
if (state->m_irq1_enable)
device_set_input_line(device, 1, HOLD_LINE);
}
} }
static MACHINE_RESET( mgcs ) static MACHINE_RESET( mgcs )
@ -2383,7 +2381,7 @@ static const ppi8255_interface mgcs_ppi8255_intf =
static MACHINE_CONFIG_START( mgcs, igs017_state ) static MACHINE_CONFIG_START( mgcs, igs017_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2) MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2)
MCFG_CPU_PROGRAM_MAP(mgcs) MCFG_CPU_PROGRAM_MAP(mgcs)
MCFG_CPU_VBLANK_INT_HACK(mgcs_interrupt,2) MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET(mgcs) MCFG_MACHINE_RESET(mgcs)
@ -2428,7 +2426,7 @@ static const ppi8255_interface sdmg2_ppi8255_intf =
static MACHINE_CONFIG_START( sdmg2, igs017_state ) static MACHINE_CONFIG_START( sdmg2, igs017_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz/2) MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz/2)
MCFG_CPU_PROGRAM_MAP(sdmg2) MCFG_CPU_PROGRAM_MAP(sdmg2)
MCFG_CPU_VBLANK_INT_HACK(mgcs_interrupt,2) MCFG_TIMER_ADD_SCANLINE("scantimer", mgcs_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET(mgcs) MCFG_MACHINE_RESET(mgcs)
@ -2458,19 +2456,16 @@ MACHINE_CONFIG_END
// mgdh // mgdh
static INTERRUPT_GEN( mgdh_interrupt ) static TIMER_DEVICE_CALLBACK( mgdh_interrupt )
{ {
igs017_state *state = device->machine().driver_data<igs017_state>(); igs017_state *state = timer.machine().driver_data<igs017_state>();
if (cpu_getiloops(device) & 1) int scanline = param;
{
if (state->m_irq2_enable) if(scanline == 240 && state->m_irq1_enable)
device_set_input_line(device, 3, HOLD_LINE); // lev 3 instead of 2 device_set_input_line(state->m_maincpu, 1, HOLD_LINE);
}
else if(scanline == 0 && state->m_irq2_enable)
{ device_set_input_line(state->m_maincpu, 3, HOLD_LINE); // lev 3 instead of 2
if (state->m_irq1_enable)
device_set_input_line(device, 1, HOLD_LINE);
}
} }
static const ppi8255_interface mgdh_ppi8255_intf = static const ppi8255_interface mgdh_ppi8255_intf =
@ -2487,7 +2482,7 @@ static const ppi8255_interface mgdh_ppi8255_intf =
static MACHINE_CONFIG_START( mgdha, igs017_state ) static MACHINE_CONFIG_START( mgdha, igs017_state )
MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2) MCFG_CPU_ADD("maincpu", M68000, XTAL_22MHz / 2)
MCFG_CPU_PROGRAM_MAP(mgdha_map) MCFG_CPU_PROGRAM_MAP(mgdha_map)
MCFG_CPU_VBLANK_INT_HACK(mgdh_interrupt,2) MCFG_TIMER_ADD_SCANLINE("scantimer", mgdh_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET(mgcs) MCFG_MACHINE_RESET(mgcs)
@ -2521,7 +2516,7 @@ static MACHINE_CONFIG_START( tjsb, igs017_state )
MCFG_CPU_ADD("maincpu", Z180, XTAL_16MHz / 2) MCFG_CPU_ADD("maincpu", Z180, XTAL_16MHz / 2)
MCFG_CPU_PROGRAM_MAP(tjsb_map) MCFG_CPU_PROGRAM_MAP(tjsb_map)
MCFG_CPU_IO_MAP(tjsb_io) MCFG_CPU_IO_MAP(tjsb_io)
MCFG_CPU_VBLANK_INT_HACK(iqblocka_interrupt,2) MCFG_TIMER_ADD_SCANLINE("scantimer", irqblocka_interrupt, "screen", 0, 1)
MCFG_PPI8255_ADD( "ppi8255", iqblocka_ppi8255_intf ) MCFG_PPI8255_ADD( "ppi8255", iqblocka_ppi8255_intf )

View File

@ -65,7 +65,6 @@ FIX: PK Tetris have an input named AMUSE which I couldn't map. Maybe it is
#define VERBOSE 0 #define VERBOSE 0
#include "emu.h" #include "emu.h"
#include "deprecat.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "sound/2413intf.h" #include "sound/2413intf.h"
#include "sound/okim6295.h" #include "sound/okim6295.h"
@ -76,7 +75,9 @@ class igspoker_state : public driver_device
{ {
public: public:
igspoker_state(const machine_config &mconfig, device_type type, const char *tag) igspoker_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { } : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu")
{ }
int m_nmi_enable; int m_nmi_enable;
int m_bg_enable; int m_bg_enable;
@ -88,6 +89,8 @@ public:
tilemap_t *m_bg_tilemap; tilemap_t *m_bg_tilemap;
UINT8 m_out[3]; UINT8 m_out[3];
size_t m_protection_res; size_t m_protection_res;
required_device<cpu_device> m_maincpu;
}; };
@ -99,19 +102,27 @@ static MACHINE_RESET( igs )
state->m_bg_enable = 1; state->m_bg_enable = 1;
} }
static INTERRUPT_GEN( igs_interrupt )
static TIMER_DEVICE_CALLBACK( igs_interrupt )
{ {
igspoker_state *state = device->machine().driver_data<igspoker_state>(); igspoker_state *state = timer.machine().driver_data<igspoker_state>();
if (cpu_getiloops(device) % 2) { int scanline = param;
device_set_input_line(device, 0, HOLD_LINE);
} else { if((scanline % 32) != 0)
if (state->m_nmi_enable) return;
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
} if((scanline % 64) == 32)
device_set_input_line(state->m_maincpu, 0, ASSERT_LINE);
if((scanline % 64) == 0 && state->m_nmi_enable)
device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, PULSE_LINE);
} }
static READ8_HANDLER( igs_irqack_r ) static READ8_HANDLER( igs_irqack_r )
{ {
igspoker_state *state = space->machine().driver_data<igspoker_state>();
device_set_input_line(state->m_maincpu, 0, CLEAR_LINE);
return 0; return 0;
} }
@ -1746,7 +1757,7 @@ static MACHINE_CONFIG_START( igspoker, igspoker_state )
MCFG_CPU_ADD("maincpu",Z80, 3579545) MCFG_CPU_ADD("maincpu",Z80, 3579545)
MCFG_CPU_PROGRAM_MAP(igspoker_prg_map) MCFG_CPU_PROGRAM_MAP(igspoker_prg_map)
MCFG_CPU_IO_MAP(igspoker_io_map) MCFG_CPU_IO_MAP(igspoker_io_map)
MCFG_CPU_VBLANK_INT_HACK(igs_interrupt,8) MCFG_TIMER_ADD_SCANLINE("scantimer", igs_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET(igs) MCFG_MACHINE_RESET(igs)
@ -1755,7 +1766,7 @@ static MACHINE_CONFIG_START( igspoker, igspoker_state )
MCFG_SCREEN_REFRESH_RATE(57) MCFG_SCREEN_REFRESH_RATE(57)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_SIZE(64*8, 32*8) // TODO: wrong screen size!
MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0, 32*8-1) MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0, 32*8-1)
MCFG_SCREEN_UPDATE(igs_video) MCFG_SCREEN_UPDATE(igs_video)

View File

@ -74,7 +74,6 @@ Known issues:
***************************************************************************/ ***************************************************************************/
#include "emu.h" #include "emu.h"
#include "deprecat.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "machine/8255ppi.h" #include "machine/8255ppi.h"
#include "sound/ay8910.h" #include "sound/ay8910.h"
@ -87,7 +86,9 @@ class imolagp_state : public driver_device
{ {
public: public:
imolagp_state(const machine_config &mconfig, device_type type, const char *tag) imolagp_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { } : driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu")
{ }
UINT8 *m_slave_workram; // used only ifdef HLE_COM UINT8 *m_slave_workram; // used only ifdef HLE_COM
@ -110,6 +111,8 @@ public:
/* memory */ /* memory */
UINT8 m_videoram[3][0x4000]; UINT8 m_videoram[3][0x4000];
required_device<cpu_device> m_maincpu;
}; };
@ -463,21 +466,13 @@ INPUT_PORTS_END
/***************************************************************************/ /***************************************************************************/
static INTERRUPT_GEN( master_interrupt )
static TIMER_DEVICE_CALLBACK ( imolagp_nmi_cb )
{ {
imolagp_state *state = device->machine().driver_data<imolagp_state>(); imolagp_state *state = timer.machine().driver_data<imolagp_state>();
int which = cpu_getiloops(device);
if (which == 0)
{ {
#ifdef HLE_COM int newsteer = input_port_read(timer.machine(), "2802") & 0xf;
memcpy(&state->m_slave_workram[0x80], state->m_mComData, state->m_mComCount);
state->m_mComCount = 0;
#endif
device_set_input_line(device, 0, HOLD_LINE);
}
else
{
int newsteer = input_port_read(device->machine(), "2802") & 0xf;
if (newsteer != state->m_oldsteer) if (newsteer != state->m_oldsteer)
{ {
if (state->m_steerlatch == 0) if (state->m_steerlatch == 0)
@ -491,9 +486,20 @@ static INTERRUPT_GEN( master_interrupt )
{ {
state->m_oldsteer = (state->m_oldsteer + 1) & 0xf; state->m_oldsteer = (state->m_oldsteer + 1) & 0xf;
} }
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); device_set_input_line(state->m_maincpu, INPUT_LINE_NMI, PULSE_LINE);
} }
} }
}
static INTERRUPT_GEN( vblank_irq )
{
imolagp_state *state = device->machine().driver_data<imolagp_state>();
#ifdef HLE_COM
memcpy(&state->m_slave_workram[0x80], state->m_mComData, state->m_mComCount);
state->m_mComCount = 0;
#endif
device_set_input_line(device, 0, HOLD_LINE);
} /* master_interrupt */ } /* master_interrupt */
@ -550,7 +556,8 @@ static MACHINE_CONFIG_START( imolagp, imolagp_state )
MCFG_CPU_ADD("maincpu", Z80,8000000) /* ? */ MCFG_CPU_ADD("maincpu", Z80,8000000) /* ? */
MCFG_CPU_PROGRAM_MAP(imolagp_master) MCFG_CPU_PROGRAM_MAP(imolagp_master)
MCFG_CPU_IO_MAP(readport_master) MCFG_CPU_IO_MAP(readport_master)
MCFG_CPU_VBLANK_INT_HACK(master_interrupt,4) MCFG_CPU_VBLANK_INT("screen",vblank_irq)
MCFG_TIMER_ADD_PERIODIC("pot_irq", imolagp_nmi_cb, attotime::from_hz(60*3))
MCFG_CPU_ADD("slave", Z80,8000000) /* ? */ MCFG_CPU_ADD("slave", Z80,8000000) /* ? */
MCFG_CPU_PROGRAM_MAP(imolagp_slave) MCFG_CPU_PROGRAM_MAP(imolagp_slave)

View File

@ -42,7 +42,6 @@ The 2 ay-8910 read ports are responsible for reading the sound commands.
***************************************************************************/ ***************************************************************************/
#include "emu.h" #include "emu.h"
#include "deprecat.h"
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "sound/ay8910.h" #include "sound/ay8910.h"
#include "includes/jack.h" #include "includes/jack.h"
@ -860,23 +859,20 @@ static MACHINE_CONFIG_DERIVED( tripool, jack )
MCFG_CPU_PERIODIC_INT(irq0_line_hold,2*60) /* tripool needs 2 or the palette is broken */ MCFG_CPU_PERIODIC_INT(irq0_line_hold,2*60) /* tripool needs 2 or the palette is broken */
MACHINE_CONFIG_END MACHINE_CONFIG_END
static INTERRUPT_GEN( joinem_interrupts ) static INTERRUPT_GEN( joinem_vblank_irq )
{ {
if (cpu_getiloops(device) > 0) /* TODO: looks hackish to me ... */
device_set_input_line(device, 0, HOLD_LINE); if (!(input_port_read(device->machine(), "IN2") & 0x80))
else
{
if (!(input_port_read(device->machine(), "IN2") & 0x80)) /* TODO: remove me */
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
} }
}
static MACHINE_CONFIG_DERIVED( joinem, jack ) static MACHINE_CONFIG_DERIVED( joinem, jack )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(joinem_map) MCFG_CPU_PROGRAM_MAP(joinem_map)
MCFG_CPU_VBLANK_INT_HACK(joinem_interrupts,3) MCFG_CPU_VBLANK_INT("screen",joinem_vblank_irq)
MCFG_CPU_PERIODIC_INT(irq0_line_hold,2*60)
MCFG_GFXDECODE(joinem) MCFG_GFXDECODE(joinem)
MCFG_PALETTE_LENGTH(0x100) MCFG_PALETTE_LENGTH(0x100)

View File

@ -29,7 +29,6 @@ ft5_v6_c4.u58 /
#define NVRAM_HACK 1 #define NVRAM_HACK 1
#include "emu.h" #include "emu.h"
#include "deprecat.h"
#include "cpu/m68000/m68000.h" #include "cpu/m68000/m68000.h"
#include "sound/okim6295.h" #include "sound/okim6295.h"
@ -38,7 +37,9 @@ class koftball_state : public driver_device
{ {
public: public:
koftball_state(const machine_config &mconfig, device_type type, const char *tag) koftball_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { } : driver_device(mconfig, type, tag),
m_maincpu(*this,"maincpu")
{ }
UINT16 *m_bmc_1_videoram; UINT16 *m_bmc_1_videoram;
UINT16 *m_bmc_2_videoram; UINT16 *m_bmc_2_videoram;
@ -48,6 +49,8 @@ public:
UINT8 *m_bmc_colorram; UINT8 *m_bmc_colorram;
int m_clr_offset; int m_clr_offset;
UINT16 m_prot_data; UINT16 m_prot_data;
required_device<cpu_device> m_maincpu;
}; };
@ -202,10 +205,19 @@ static INPUT_PORTS_START( koftball )
INPUT_PORTS_END INPUT_PORTS_END
static INTERRUPT_GEN( bmc_interrupt ) static TIMER_DEVICE_CALLBACK( bmc_interrupt )
{ {
static const int bmcints[]={2,3,6}; koftball_state *state = timer.machine().driver_data<koftball_state>();
device_set_input_line(device, bmcints[cpu_getiloops(device)], HOLD_LINE); int scanline = param;
if(scanline == 240)
device_set_input_line(state->m_maincpu, 2, HOLD_LINE);
if(scanline == 128)
device_set_input_line(state->m_maincpu, 3, HOLD_LINE);
if(scanline == 64)
device_set_input_line(state->m_maincpu, 6, HOLD_LINE);
} }
static const gfx_layout tilelayout = static const gfx_layout tilelayout =
@ -227,7 +239,7 @@ GFXDECODE_END
static MACHINE_CONFIG_START( koftball, koftball_state ) static MACHINE_CONFIG_START( koftball, koftball_state )
MCFG_CPU_ADD("maincpu", M68000, 21477270/2 ) MCFG_CPU_ADD("maincpu", M68000, 21477270/2 )
MCFG_CPU_PROGRAM_MAP(koftball_mem) MCFG_CPU_PROGRAM_MAP(koftball_mem)
MCFG_CPU_VBLANK_INT_HACK(bmc_interrupt,3) MCFG_TIMER_ADD_SCANLINE("scantimer", bmc_interrupt, "screen", 0, 1)
MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_REFRESH_RATE(60)