small cleanup

This commit is contained in:
Michaël Banaan Ananas 2014-03-26 00:49:27 +00:00
parent 70bd74c915
commit 67682746d9
4 changed files with 115 additions and 104 deletions

View File

@ -85,7 +85,7 @@ static ADDRESS_MAP_START( amspdwy_map, AS_PROGRAM, 8, amspdwy_state )
AM_RANGE(0xa800, 0xa800) AM_READ(amspdwy_wheel_0_r) AM_RANGE(0xa800, 0xa800) AM_READ(amspdwy_wheel_0_r)
AM_RANGE(0xac00, 0xac00) AM_READ(amspdwy_wheel_1_r) AM_RANGE(0xac00, 0xac00) AM_READ(amspdwy_wheel_1_r)
AM_RANGE(0xb000, 0xb000) AM_WRITENOP // irq ack? AM_RANGE(0xb000, 0xb000) AM_WRITENOP // irq ack?
AM_RANGE(0xb400, 0xb400) AM_READ(amspdwy_sound_r) AM_WRITE(amspdwy_sound_w) AM_RANGE(0xb400, 0xb400) AM_READWRITE(amspdwy_sound_r, amspdwy_sound_w)
AM_RANGE(0xc000, 0xc0ff) AM_RAM AM_SHARE("spriteram") AM_RANGE(0xc000, 0xc0ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_RANGE(0xe000, 0xe7ff) AM_RAM
ADDRESS_MAP_END ADDRESS_MAP_END

View File

@ -1,5 +1,7 @@
/*************************************************************************** /***************************************************************************
Toaplan Slap Fight hardware
Driver by K.Wilkins Jan 1998 Driver by K.Wilkins Jan 1998
Games supported: Games supported:
@ -8,6 +10,11 @@ Games supported:
Performan Performan
Tiger Heli Tiger Heli
TODO:
- proper MCU emulation (mame/machine/slapfght.c)
****************************************************************************
Main CPU Memory Map Main CPU Memory Map
------------------- -------------------
@ -729,12 +736,12 @@ INTERRUPT_GEN_MEMBER(slapfght_state::vblank_irq)
static MACHINE_CONFIG_START( perfrman, slapfght_state ) static MACHINE_CONFIG_START( perfrman, slapfght_state )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80,16000000/4) /* 4MHz ???, 16MHz Oscillator */ MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/4) /* 4MHz ???, 16MHz Oscillator */
MCFG_CPU_PROGRAM_MAP(perfrman_map) MCFG_CPU_PROGRAM_MAP(perfrman_map)
MCFG_CPU_IO_MAP(slapfght_io_map) MCFG_CPU_IO_MAP(slapfght_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", slapfght_state, vblank_irq) MCFG_CPU_VBLANK_INT_DRIVER("screen", slapfght_state, vblank_irq)
MCFG_CPU_ADD("audiocpu", Z80,16000000/8) /* 2MHz ???, 16MHz Oscillator */ MCFG_CPU_ADD("audiocpu", Z80, XTAL_16MHz/8) /* 2MHz ???, 16MHz Oscillator */
MCFG_CPU_PROGRAM_MAP(perfrman_sound_map) MCFG_CPU_PROGRAM_MAP(perfrman_sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(slapfght_state, getstar_interrupt, 4*60) /* music speed, verified */ MCFG_CPU_PERIODIC_INT_DRIVER(slapfght_state, getstar_interrupt, 4*60) /* music speed, verified */
@ -761,60 +768,16 @@ static MACHINE_CONFIG_START( perfrman, slapfght_state )
/* sound hardware */ /* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ay1", AY8910, 16000000/8) MCFG_SOUND_ADD("ay1", AY8910, XTAL_16MHz/8)
MCFG_SOUND_CONFIG(ay8910_interface_1) MCFG_SOUND_CONFIG(ay8910_interface_1)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, 16000000/8) MCFG_SOUND_ADD("ay2", AY8910, XTAL_16MHz/8)
MCFG_SOUND_CONFIG(ay8910_interface_2) MCFG_SOUND_CONFIG(ay8910_interface_2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( tigerhb, slapfght_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 6000000)
MCFG_CPU_PROGRAM_MAP(tigerh_map)
MCFG_CPU_IO_MAP(tigerhb_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", slapfght_state, vblank_irq)
MCFG_CPU_ADD("audiocpu", Z80, 6000000)
MCFG_CPU_PROGRAM_MAP(slapfght_sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(slapfght_state, nmi_line_pulse, 6*60) /* ??? */
MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
MCFG_MACHINE_RESET_OVERRIDE(slapfght_state,slapfight)
/* video hardware */
MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(1*8, 36*8-1, 2*8, 32*8-1)
MCFG_SCREEN_UPDATE_DRIVER(slapfght_state, screen_update_slapfight)
MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", slapfght)
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", 256)
MCFG_VIDEO_START_OVERRIDE(slapfght_state,slapfight)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ay1", AY8910, 1500000)
MCFG_SOUND_CONFIG(ay8910_interface_1)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, 1500000)
MCFG_SOUND_CONFIG(ay8910_interface_2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( tigerh, slapfght_state ) static MACHINE_CONFIG_START( tigerh, slapfght_state )
/* basic machine hardware */ /* basic machine hardware */
@ -862,6 +825,50 @@ static MACHINE_CONFIG_START( tigerh, slapfght_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( tigerhb, slapfght_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 6000000)
MCFG_CPU_PROGRAM_MAP(tigerh_map)
MCFG_CPU_IO_MAP(tigerhb_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", slapfght_state, vblank_irq)
MCFG_CPU_ADD("audiocpu", Z80, 6000000)
MCFG_CPU_PROGRAM_MAP(slapfght_sound_map)
MCFG_CPU_PERIODIC_INT_DRIVER(slapfght_state, nmi_line_pulse, 6*60) /* ??? */
MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* 10 CPU slices per frame - enough for the sound CPU to read all commands */
MCFG_MACHINE_RESET_OVERRIDE(slapfght_state,slapfight)
/* video hardware */
MCFG_BUFFERED_SPRITERAM8_ADD("spriteram")
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(1*8, 36*8-1, 2*8, 32*8-1)
MCFG_SCREEN_UPDATE_DRIVER(slapfght_state, screen_update_slapfight)
MCFG_SCREEN_VBLANK_DEVICE("spriteram", buffered_spriteram8_device, vblank_copy_rising)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", slapfght)
MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", 256)
MCFG_VIDEO_START_OVERRIDE(slapfght_state,slapfight)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ay1", AY8910, 1500000)
MCFG_SOUND_CONFIG(ay8910_interface_1)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MCFG_SOUND_ADD("ay2", AY8910, 1500000)
MCFG_SOUND_CONFIG(ay8910_interface_2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( slapfigh, slapfght_state ) static MACHINE_CONFIG_START( slapfigh, slapfght_state )
@ -913,7 +920,6 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( slapfighb1, slapfigh ) static MACHINE_CONFIG_DERIVED( slapfighb1, slapfigh )
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_REMOVE("mcu") MCFG_DEVICE_REMOVE("mcu")
MACHINE_CONFIG_END MACHINE_CONFIG_END
@ -921,7 +927,6 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( slapfighb2, slapfigh ) static MACHINE_CONFIG_DERIVED( slapfighb2, slapfigh )
/* basic machine hardware */ /* basic machine hardware */
MCFG_CPU_MODIFY("maincpu") MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(slapfighb2_map) MCFG_CPU_PROGRAM_MAP(slapfighb2_map)
@ -1833,7 +1838,7 @@ DRIVER_INIT_MEMBER(slapfght_state,perfrman)
m_maincpu->space(AS_IO).install_read_handler(0x00, 0x00, read8_delegate(FUNC(slapfght_state::perfrman_port_00_r),this)); m_maincpu->space(AS_IO).install_read_handler(0x00, 0x00, read8_delegate(FUNC(slapfght_state::perfrman_port_00_r),this));
} }
/* ( YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY FULLNAME FLAGS ) */ /* ( YEAR NAME PARENT MACHINE INPUT INIT MONITOR, COMPANY, FULLNAME, FLAGS ) */
GAME( 1985, perfrman, 0, perfrman, perfrman, slapfght_state, perfrman, ROT270, "Toaplan / Data East Corporation", "Performan (Japan)", 0 ) GAME( 1985, perfrman, 0, perfrman, perfrman, slapfght_state, perfrman, ROT270, "Toaplan / Data East Corporation", "Performan (Japan)", 0 )
GAME( 1985, perfrmanu, perfrman, perfrman, perfrman, slapfght_state, perfrman, ROT270, "Toaplan / Data East USA", "Performan (US)", 0 ) GAME( 1985, perfrmanu, perfrman, perfrman, perfrman, slapfght_state, perfrman, ROT270, "Toaplan / Data East USA", "Performan (US)", 0 )

View File

@ -1,3 +1,9 @@
/***************************************************************************
Toaplan Slap Fight hardware
***************************************************************************/
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "video/bufsprite.h" #include "video/bufsprite.h"
@ -17,21 +23,31 @@ class slapfght_state : public driver_device
public: public:
slapfght_state(const machine_config &mconfig, device_type type, const char *tag) slapfght_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"),
m_audiocpu(*this, "audiocpu"),
m_mcu(*this, "mcu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_spriteram(*this, "spriteram"),
m_slapfight_videoram(*this, "videoram"), m_slapfight_videoram(*this, "videoram"),
m_slapfight_colorram(*this, "colorram"), m_slapfight_colorram(*this, "colorram"),
m_slapfight_fixvideoram(*this, "fixvideoram"), m_slapfight_fixvideoram(*this, "fixvideoram"),
m_slapfight_fixcolorram(*this, "fixcolorram"), m_slapfight_fixcolorram(*this, "fixcolorram"),
m_slapfight_scrollx_lo(*this, "scrollx_lo"), m_slapfight_scrollx_lo(*this, "scrollx_lo"),
m_slapfight_scrollx_hi(*this, "scrollx_hi"), m_slapfight_scrollx_hi(*this, "scrollx_hi"),
m_slapfight_scrolly(*this, "scrolly"), m_slapfight_scrolly(*this, "scrolly")
m_spriteram(*this, "spriteram") , { }
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_mcu(*this, "mcu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
int m_getstar_id; int m_getstar_id;
// devices, memory pointers
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_mcu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<buffered_spriteram8_device> m_spriteram;
required_shared_ptr<UINT8> m_slapfight_videoram; required_shared_ptr<UINT8> m_slapfight_videoram;
required_shared_ptr<UINT8> m_slapfight_colorram; required_shared_ptr<UINT8> m_slapfight_colorram;
optional_shared_ptr<UINT8> m_slapfight_fixvideoram; optional_shared_ptr<UINT8> m_slapfight_fixvideoram;
@ -39,6 +55,7 @@ public:
optional_shared_ptr<UINT8> m_slapfight_scrollx_lo; optional_shared_ptr<UINT8> m_slapfight_scrollx_lo;
optional_shared_ptr<UINT8> m_slapfight_scrollx_hi; optional_shared_ptr<UINT8> m_slapfight_scrollx_hi;
optional_shared_ptr<UINT8> m_slapfight_scrolly; optional_shared_ptr<UINT8> m_slapfight_scrolly;
int m_slapfight_status; int m_slapfight_status;
int m_getstar_sequence_index; int m_getstar_sequence_index;
int m_getstar_sh_intenabled; int m_getstar_sh_intenabled;
@ -67,7 +84,7 @@ public:
tilemap_t *m_pf1_tilemap; tilemap_t *m_pf1_tilemap;
tilemap_t *m_fix_tilemap; tilemap_t *m_fix_tilemap;
UINT8 m_irq_mask; UINT8 m_irq_mask;
required_device<buffered_spriteram8_device> m_spriteram;
DECLARE_READ8_MEMBER(tigerh_status_r); DECLARE_READ8_MEMBER(tigerh_status_r);
DECLARE_READ8_MEMBER(gtstarb1_port_0_read); DECLARE_READ8_MEMBER(gtstarb1_port_0_read);
DECLARE_WRITE8_MEMBER(slapfight_port_00_w); DECLARE_WRITE8_MEMBER(slapfight_port_00_w);
@ -135,23 +152,4 @@ public:
void slapfght_log_vram(); void slapfght_log_vram();
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_display ); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_display );
void getstar_init(); void getstar_init();
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_mcu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
}; };
/*----------- defines -----------*/
/* due to code at 0x108d (GUARDIAN) or 0x1152 (GETSTARJ),
register C is a unaltered copy of register A */
#define GS_SAVE_REGS m_gs_a = space.device().state().state_int(Z80_BC) >> 0; \
m_gs_d = space.device().state().state_int(Z80_DE) >> 8; \
m_gs_e = space.device().state().state_int(Z80_DE) >> 0;
#define GS_RESET_REGS m_gs_a = 0; \
m_gs_d = 0; \
m_gs_e = 0;

View File

@ -15,7 +15,6 @@
MACHINE_RESET_MEMBER(slapfght_state,slapfight) MACHINE_RESET_MEMBER(slapfght_state,slapfight)
{ {
/* MAIN CPU */ /* MAIN CPU */
m_slapfight_status_state=0; m_slapfight_status_state=0;
m_slapfight_status = 0xc7; m_slapfight_status = 0xc7;
@ -297,6 +296,15 @@ READ8_MEMBER(slapfght_state::getstar_e803_r)
WRITE8_MEMBER(slapfght_state::getstar_e803_w) WRITE8_MEMBER(slapfght_state::getstar_e803_w)
{ {
/* due to code at 0x108d (GUARDIAN) or 0x1152 (GETSTARJ), register C is a unaltered copy of register A */
#define GS_SAVE_REGS m_gs_a = space.device().state().state_int(Z80_BC) >> 0; \
m_gs_d = space.device().state().state_int(Z80_DE) >> 8; \
m_gs_e = space.device().state().state_int(Z80_DE) >> 0;
#define GS_RESET_REGS m_gs_a = 0; \
m_gs_d = 0; \
m_gs_e = 0;
switch (m_getstar_id) switch (m_getstar_id)
{ {
case GETSTAR: case GETSTAR: