sgyxz - boots up, sound works, some gfx issues

This commit is contained in:
Robbbert 2013-03-17 11:36:59 +00:00
parent b3b3257747
commit c5905d049c
2 changed files with 153 additions and 12 deletions

View File

@ -63,7 +63,16 @@ None of this is hooked up currently due to issues with row scroll on the scroll2
#include "sound/msm5205.h"
#include "sound/2151intf.h"
#include "sound/okim6295.h"
#include "machine/eeprom.h"
static const eeprom_interface qsound_eeprom_interface =
{
7, /* address bits */
8, /* data bits */
"0110", /* read command */
"0101", /* write command */
"0111" /* erase command */
};
WRITE16_MEMBER( cps_state::fcrash_soundlatch_w )
{
@ -483,6 +492,22 @@ static ADDRESS_MAP_START( fcrash_map, AS_PROGRAM, 16, cps_state )
AM_RANGE(0xff0000, 0xffffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( sgyxz_map, AS_PROGRAM, 16, cps_state )
AM_RANGE(0x000000, 0x3fffff) AM_ROM
AM_RANGE(0x800030, 0x800031) AM_WRITE(cps1_coinctrl_w)
AM_RANGE(0x800100, 0x80013f) AM_RAM AM_SHARE("cps_a_regs") /* CPS-A custom */
AM_RANGE(0x800140, 0x80017f) AM_RAM AM_SHARE("cps_b_regs") /* CPS-B custom */
AM_RANGE(0x880000, 0x880001) AM_READ_PORT("IN1") /* Player input ports */
AM_RANGE(0x880006, 0x88000d) AM_READ(cps1_dsw_r) /* System input ports / Dip Switches */
AM_RANGE(0x88000e, 0x88000f) AM_WRITE(cps1_soundlatch_w)
AM_RANGE(0x880e78, 0x880e79) AM_READ(cps1_in2_r) /* Player 3 controls (later games) */
AM_RANGE(0x890000, 0x890001) AM_WRITE(cps1_soundlatch2_w)
AM_RANGE(0x900000, 0x92ffff) AM_RAM_WRITE(cps1_gfxram_w) AM_SHARE("gfxram")
AM_RANGE(0xf1c004, 0xf1c005) AM_WRITE(cpsq_coinctrl2_w) /* Coin control2 (later games) */
AM_RANGE(0xf1c006, 0xf1c007) AM_READ_PORT("EEPROMIN") AM_WRITE_PORT("EEPROMOUT")
AM_RANGE(0xff0000, 0xffffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cps_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
@ -526,6 +551,18 @@ static ADDRESS_MAP_START( knightsb_z80map, AS_PROGRAM, 8, cps_state )
AM_RANGE(0xe800, 0xe800) AM_WRITE(fcrash_msm5205_1_data_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sgyxz_sound_map, AS_PROGRAM, 8, cps_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
AM_RANGE(0xd000, 0xd7ff) AM_RAM
AM_RANGE(0xf000, 0xf001) AM_DEVREADWRITE("2151", ym2151_device, read, write)
AM_RANGE(0xf002, 0xf002) AM_DEVREADWRITE("oki", okim6295_device, read, write)
AM_RANGE(0xf004, 0xf004) AM_WRITE(cps1_snd_bankswitch_w)
AM_RANGE(0xf006, 0xf006) AM_WRITE(cps1_oki_pin7_w) /* controls pin 7 of OKI chip */
AM_RANGE(0xf008, 0xf008) AM_READ(soundlatch_byte_r) /* Sound command */
AM_RANGE(0xf00a, 0xf00a) AM_READ(soundlatch2_byte_r) /* Sound timer fade */
ADDRESS_MAP_END
#define CPS1_COINAGE_1 \
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) \
@ -935,6 +972,71 @@ static INPUT_PORTS_START( sf2mdt )
PORT_DIPSETTING( 0x00, DEF_STR( Test ) )
INPUT_PORTS_END
static INPUT_PORTS_START( sgyxz )
PORT_START ("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START ("DSWA")
PORT_DIPNAME( 0x03, 0x00, "Play Mode" )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x03, "Tournament" )
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START ("DSWB")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) )
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START ("DSWC")
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START ("IN1")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START ("IN2") /* Player 3 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
PORT_START( "EEPROMIN" )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
PORT_START( "EEPROMOUT" )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, write_bit)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_clock_line)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_device, set_cs_line)
INPUT_PORTS_END
static const msm5205_interface msm5205_interface1 =
{
@ -978,6 +1080,15 @@ MACHINE_START_MEMBER(cps_state,fcrash)
save_item(NAME(m_sample_select2));
}
MACHINE_START_MEMBER(cps_state,sgyxz)
{
MACHINE_START_CALL_MEMBER(kodb);
m_layer_scroll1x_offset = 0x40;
m_layer_scroll2x_offset = 0x40;
m_layer_scroll3x_offset = 0x40;
membank("bank1")->configure_entries(0, 2, memregion("audiocpu")->base() + 0x10000, 0x4000);
}
MACHINE_START_MEMBER(cps_state,kodb)
{
m_maincpu = machine().device<cpu_device>("maincpu");
@ -1554,13 +1665,13 @@ ROM_END
static MACHINE_CONFIG_START( sgyxz, cps_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 12000000)
MCFG_CPU_PROGRAM_MAP(fcrash_map)
MCFG_CPU_PROGRAM_MAP(sgyxz_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", cps_state, cps1_interrupt)
// MCFG_CPU_ADD("audiocpu", Z80, 3579545)
// MCFG_CPU_PROGRAM_MAP(sub_map)
MCFG_CPU_ADD("audiocpu", Z80, 3579545)
MCFG_CPU_PROGRAM_MAP(sgyxz_sound_map)
MCFG_MACHINE_START_OVERRIDE(cps_state,kodb)
MCFG_MACHINE_START_OVERRIDE(cps_state,sgyxz)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@ -1570,26 +1681,55 @@ static MACHINE_CONFIG_START( sgyxz, cps_state )
MCFG_SCREEN_VISIBLE_AREA(8*8, (64-8)*8-1, 2*8, 30*8-1 )
MCFG_SCREEN_UPDATE_DRIVER(cps_state, screen_update_fcrash)
MCFG_SCREEN_VBLANK_DRIVER(cps_state, screen_eof_cps1)
MCFG_GFXDECODE(cps1)
MCFG_PALETTE_LENGTH(0xc00)
MCFG_VIDEO_START_OVERRIDE(cps_state,cps1)
MCFG_EEPROM_ADD("eeprom", qsound_eeprom_interface)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_YM2151_ADD("2151", XTAL_3_579545MHz) /* verified on pcb */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.35)
MCFG_SOUND_ROUTE(1, "mono", 0.35)
/* CPS PPU is fed by a 16mhz clock,pin 117 outputs a 4mhz clock which is divided by 4 using 2 74ls74 */
MCFG_OKIM6295_ADD("oki", XTAL_16MHz/4/4, OKIM6295_PIN7_HIGH) // pin 7 can be changed by the game code, see f006 on z80
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MACHINE_CONFIG_END
ROM_START( sgyxz )
ROM_REGION( 0x400000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "sgyxz_prg1.bin", 0x000001, 0x80000, CRC(d8511929) SHA1(4de9263778f327693f4d1e21b48e43806f673487) )
ROM_LOAD16_BYTE( "sgyxz_prg2.bin", 0x000000, 0x80000, CRC(95429c83) SHA1(e981624d018132e5625a66113b6ac4fc44e55cf7) )
ROM_LOAD16_BYTE( "sgyxz_prg1.bin", 0x000001, 0x20000, CRC(d8511929) SHA1(4de9263778f327693f4d1e21b48e43806f673487) )
ROM_CONTINUE( 0x80001, 0x20000 )
ROM_CONTINUE( 0x40001, 0x20000 )
ROM_CONTINUE( 0xc0001, 0x20000 )
ROM_LOAD16_BYTE( "sgyxz_prg2.bin", 0x000000, 0x20000, CRC(95429c83) SHA1(e981624d018132e5625a66113b6ac4fc44e55cf7) )
ROM_CONTINUE( 0x80000, 0x20000 )
ROM_CONTINUE( 0x40000, 0x20000 )
ROM_CONTINUE( 0xc0000, 0x20000 )
ROM_FILL(0x708da, 4, 0xff) // patch out protections
ROM_FILL(0xf11ea, 1, 0x60)
ROM_FILL(0x00007, 1, 0xa2) // start address
ROM_FILL(0x02448, 1, 0x07) // transitions
ROM_REGION( 0x400000, "gfx", 0 )
ROM_LOAD16_BYTE("sgyxz_gfx1.bin", 0x000000, 0x200000, CRC(a60be9f6) SHA1(2298a4b6a2c83b76dc106a1efa19606b298d378a) ) // 'picture 1'
ROM_LOAD16_BYTE("sgyxz_gfx2.bin", 0x000001, 0x200000, CRC(6ad9d048) SHA1(d47212d28d0a1ce349e4c59e5d0d99c541b3458e) ) // 'picture 2'
ROMX_LOAD("sgyxz_gfx1.bin", 0x000000, 0x80000, CRC(a60be9f6) SHA1(2298a4b6a2c83b76dc106a1efa19606b298d378a), ROM_GROUPWORD | ROM_SKIP(6) ) // 'picture 1'
ROM_CONTINUE( 0x000004, 0x80000 )
ROM_CONTINUE( 0x200000, 0x80000 )
ROM_CONTINUE( 0x200004, 0x80000 )
ROMX_LOAD("sgyxz_gfx2.bin", 0x000002, 0x80000, CRC(6ad9d048) SHA1(d47212d28d0a1ce349e4c59e5d0d99c541b3458e), ROM_GROUPWORD | ROM_SKIP(6) ) // 'picture 2'
ROM_CONTINUE( 0x000006, 0x80000 )
ROM_CONTINUE( 0x200002, 0x80000 )
ROM_CONTINUE( 0x200006, 0x80000 )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Z80 code */
ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 code */
ROM_LOAD( "sgyxz_snd2.bin", 0x00000, 0x10000, CRC(210c376f) SHA1(0d937c86078d0a106f5636b7daf5fc0266c2c2ec) )
ROM_RELOAD( 0x8000, 0x10000 )
ROM_REGION( 0x040000, "oki", 0 ) /* Samples */
ROM_LOAD( "sgyxz_snd1.bin", 0x00000, 0x40000, CRC(c15ac0f2) SHA1(8d9e5519d9820e4ac4f70555088c80e64d052c9d) )
@ -1679,4 +1819,4 @@ GAME( 1990, cawingbl, cawing, cawingbl, cawingbl, cps_state, cawingbl, ROT0,
GAME( 1990, cawingb2, cawing, cawingbl, cawingbl, cps_state, cawingbl, ROT0, "bootleg", "Carrier Air Wing (bootleg with 2xYM2203 + 2xMSM205 set 2)", GAME_SUPPORTS_SAVE )
GAME( 1992, sf2mdt, sf2ce, sf2mdt, sf2mdt, cps_state, sf2mdt, ROT0, "bootleg", "Street Fighter II': Magic Delta Turbo (bootleg, set 1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 920313 - based on (heavily modified) World version
GAME( 1992, sf2mdta, sf2ce, sf2mdt, sf2mdt, cps_state, sf2mdta, ROT0, "bootleg", "Street Fighter II': Magic Delta Turbo (bootleg, set 2)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 920313 - based on World version
GAME( 199?, sgyxz, wof, sgyxz, fcrash, cps_state, cps1, ROT0, "bootleg (All-In Electronic)", "Warriors of Fate ('sgyxz' bootleg)", GAME_NOT_WORKING | GAME_NO_SOUND )
GAME( 1999, sgyxz, wof, sgyxz, sgyxz, cps_state, cps1, ROT0, "bootleg (All-In Electronic)", "Warriors of Fate ('sgyxz' bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // 921005 - Sangokushi 2

View File

@ -256,6 +256,7 @@ public:
DECLARE_MACHINE_START(cawingbl);
DECLARE_MACHINE_START(knightsb);
DECLARE_MACHINE_START(sf2mdt);
DECLARE_MACHINE_START(sgyxz);
DECLARE_WRITE16_MEMBER(kodb_layer_w);
DECLARE_WRITE16_MEMBER(cawingbl_soundlatch_w);
DECLARE_WRITE16_MEMBER(knightsb_layer_w);