From 1a0c7eceeaa5838eff7ad6c1956c7ffb0d60a447 Mon Sep 17 00:00:00 2001 From: smf- Date: Mon, 11 Feb 2013 15:41:23 +0000 Subject: [PATCH] Moved some of the saturn code from mame/ into emu/ and made saturn.c & stv.c separately compilable. Still needs work before saturn.c can be moved to mess/ [smf] --- .gitattributes | 14 +- src/emu/emu.mak | 5 + src/{mame => emu}/machine/scudsp.c | 0 src/{mame => emu}/machine/scudsp.h | 0 src/{mame => emu}/machine/smpc.c | 0 src/{mame => emu}/machine/smpc.h | 0 src/{mame => emu}/machine/stvcd.c | 0 src/{mame => emu}/video/stvvdp1.c | 0 src/{mame => emu}/video/stvvdp2.c | 0 src/mame/drivers/saturn.c | 511 +-------------------------- src/mame/drivers/stv.c | 535 +++++++++++++++++++++++++++++ src/mame/includes/stv.h | 3 + src/mame/mame.mak | 3 +- src/mess/mess.mak | 13 +- 14 files changed, 557 insertions(+), 527 deletions(-) rename src/{mame => emu}/machine/scudsp.c (100%) rename src/{mame => emu}/machine/scudsp.h (100%) rename src/{mame => emu}/machine/smpc.c (100%) rename src/{mame => emu}/machine/smpc.h (100%) rename src/{mame => emu}/machine/stvcd.c (100%) rename src/{mame => emu}/video/stvvdp1.c (100%) rename src/{mame => emu}/video/stvvdp2.c (100%) diff --git a/.gitattributes b/.gitattributes index d659c9cd7d8..c4e64357df6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1347,12 +1347,17 @@ src/emu/machine/scsihd.c svneol=native#text/plain src/emu/machine/scsihd.h svneol=native#text/plain src/emu/machine/scsihle.c svneol=native#text/plain src/emu/machine/scsihle.h svneol=native#text/plain +src/emu/machine/scudsp.c svneol=native#text/plain +src/emu/machine/scudsp.h svneol=native#text/plain src/emu/machine/secflash.c svneol=native#text/plain src/emu/machine/secflash.h svneol=native#text/plain src/emu/machine/seibu_cop.c svneol=native#text/plain src/emu/machine/seibu_cop.h svneol=native#text/plain src/emu/machine/smc91c9x.c svneol=native#text/plain src/emu/machine/smc91c9x.h svneol=native#text/plain +src/emu/machine/smpc.c svneol=native#text/plain +src/emu/machine/smpc.h svneol=native#text/plain +src/emu/machine/stvcd.c svneol=native#text/plain src/emu/machine/tc009xlvc.c svneol=native#text/plain src/emu/machine/tc009xlvc.h svneol=native#text/plain src/emu/machine/timekpr.c svneol=native#text/plain @@ -1797,6 +1802,8 @@ src/emu/video/saa5050.c svneol=native#text/plain src/emu/video/saa5050.h svneol=native#text/plain src/emu/video/sed1330.c svneol=native#text/plain src/emu/video/sed1330.h svneol=native#text/plain +src/emu/video/stvvdp1.c svneol=native#text/plain +src/emu/video/stvvdp2.c svneol=native#text/plain src/emu/video/tlc34076.c svneol=native#text/plain src/emu/video/tlc34076.h svneol=native#text/plain src/emu/video/tms34061.c svneol=native#text/plain @@ -4955,8 +4962,6 @@ src/mame/machine/r2crypt.c svneol=native#text/plain src/mame/machine/rainbow.c svneol=native#text/plain src/mame/machine/retofinv.c svneol=native#text/plain src/mame/machine/scramble.c svneol=native#text/plain -src/mame/machine/scudsp.c svneol=native#text/plain -src/mame/machine/scudsp.h svneol=native#text/plain src/mame/machine/sec.c svneol=native#text/native src/mame/machine/sec.h svneol=native#text/plain src/mame/machine/segacrp2.c svneol=native#text/plain @@ -4977,8 +4982,6 @@ src/mame/machine/simpsons.c svneol=native#text/plain src/mame/machine/slapfght.c svneol=native#text/plain src/mame/machine/slapstic.c svneol=native#text/plain src/mame/machine/slikshot.c svneol=native#text/plain -src/mame/machine/smpc.c svneol=native#text/plain -src/mame/machine/smpc.h svneol=native#text/plain src/mame/machine/snes.c svneol=native#text/plain src/mame/machine/snes7110.c svneol=native#text/plain src/mame/machine/snesbsx.c svneol=native#text/plain @@ -4992,7 +4995,6 @@ src/mame/machine/starwars.c svneol=native#text/plain src/mame/machine/steppers.c svneol=native#text/plain src/mame/machine/steppers.h svneol=native#text/plain src/mame/machine/stfight.c svneol=native#text/plain -src/mame/machine/stvcd.c svneol=native#text/plain src/mame/machine/stvprot.c svneol=native#text/plain src/mame/machine/stvprot.h svneol=native#text/plain src/mame/machine/subs.c svneol=native#text/plain @@ -5641,8 +5643,6 @@ src/mame/video/starshp1.c svneol=native#text/plain src/mame/video/stfight.c svneol=native#text/plain src/mame/video/stlforce.c svneol=native#text/plain src/mame/video/strnskil.c svneol=native#text/plain -src/mame/video/stvvdp1.c svneol=native#text/plain -src/mame/video/stvvdp2.c svneol=native#text/plain src/mame/video/subs.c svneol=native#text/plain src/mame/video/suna16.c svneol=native#text/plain src/mame/video/suna8.c svneol=native#text/plain diff --git a/src/emu/emu.mak b/src/emu/emu.mak index f776f2fbe0a..8539a623f09 100644 --- a/src/emu/emu.mak +++ b/src/emu/emu.mak @@ -261,9 +261,12 @@ EMUMACHINEOBJS = \ $(EMUMACHINE)/scsidev.o \ $(EMUMACHINE)/scsihd.o \ $(EMUMACHINE)/scsihle.o \ + $(EMUMACHINE)/scudsp.o \ $(EMUMACHINE)/secflash.o \ $(EMUMACHINE)/seibu_cop.o \ $(EMUMACHINE)/smc91c9x.o \ + $(EMUMACHINE)/smpc.o \ + $(EMUMACHINE)/stvcd.o \ $(EMUMACHINE)/tc009xlvc.o \ $(EMUMACHINE)/timekpr.o \ $(EMUMACHINE)/tmp68301.o \ @@ -328,6 +331,8 @@ EMUVIDEOOBJS = \ $(EMUVIDEO)/s2636.o \ $(EMUVIDEO)/saa5050.o \ $(EMUVIDEO)/sed1330.o \ + $(EMUVIDEO)/stvvdp1.o \ + $(EMUVIDEO)/stvvdp2.o \ $(EMUVIDEO)/tlc34076.o \ $(EMUVIDEO)/tms34061.o \ $(EMUVIDEO)/tms9927.o \ diff --git a/src/mame/machine/scudsp.c b/src/emu/machine/scudsp.c similarity index 100% rename from src/mame/machine/scudsp.c rename to src/emu/machine/scudsp.c diff --git a/src/mame/machine/scudsp.h b/src/emu/machine/scudsp.h similarity index 100% rename from src/mame/machine/scudsp.h rename to src/emu/machine/scudsp.h diff --git a/src/mame/machine/smpc.c b/src/emu/machine/smpc.c similarity index 100% rename from src/mame/machine/smpc.c rename to src/emu/machine/smpc.c diff --git a/src/mame/machine/smpc.h b/src/emu/machine/smpc.h similarity index 100% rename from src/mame/machine/smpc.h rename to src/emu/machine/smpc.h diff --git a/src/mame/machine/stvcd.c b/src/emu/machine/stvcd.c similarity index 100% rename from src/mame/machine/stvcd.c rename to src/emu/machine/stvcd.c diff --git a/src/mame/video/stvvdp1.c b/src/emu/video/stvvdp1.c similarity index 100% rename from src/mame/video/stvvdp1.c rename to src/emu/video/stvvdp1.c diff --git a/src/mame/video/stvvdp2.c b/src/emu/video/stvvdp2.c similarity index 100% rename from src/mame/video/stvvdp2.c rename to src/emu/video/stvvdp2.c diff --git a/src/mame/drivers/saturn.c b/src/mame/drivers/saturn.c index 37010d4df82..018057f0673 100644 --- a/src/mame/drivers/saturn.c +++ b/src/mame/drivers/saturn.c @@ -800,33 +800,6 @@ static ADDRESS_MAP_START( saturn_mem, AS_PROGRAM, 32, saturn_state ) AM_RANGE(0xc0000000, 0xc00007ff) AM_RAM // cache data array, Dragon Ball Z sprites relies on this ADDRESS_MAP_END -static ADDRESS_MAP_START( stv_mem, AS_PROGRAM, 32, saturn_state ) - AM_RANGE(0x00000000, 0x0007ffff) AM_ROM AM_SHARE("share6") // bios - AM_RANGE(0x00100000, 0x0010007f) AM_READWRITE8_LEGACY(stv_SMPC_r, stv_SMPC_w,0xffffffff) - AM_RANGE(0x00180000, 0x0018ffff) AM_READWRITE8(saturn_backupram_r,saturn_backupram_w,0xffffffff) AM_SHARE("share1") - AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_MIRROR(0x20100000) AM_SHARE("workram_l") -// AM_RANGE(0x00400000, 0x0040001f) AM_READWRITE_LEGACY(stv_ioga_r32, stv_io_w32) AM_SHARE("ioga") AM_MIRROR(0x20) /* installed with per-game specific */ - AM_RANGE(0x01000000, 0x017fffff) AM_WRITE(minit_w) - AM_RANGE(0x01800000, 0x01ffffff) AM_WRITE(sinit_w) - AM_RANGE(0x02000000, 0x04ffffff) AM_ROM AM_SHARE("share7") AM_REGION("abus", 0) // cartridge - AM_RANGE(0x05800000, 0x0589ffff) AM_READWRITE(stvcd_r, stvcd_w) - /* Sound */ - AM_RANGE(0x05a00000, 0x05afffff) AM_READWRITE16(saturn_soundram_r, saturn_soundram_w,0xffffffff) - AM_RANGE(0x05b00000, 0x05b00fff) AM_DEVREADWRITE16_LEGACY("scsp", scsp_r, scsp_w, 0xffffffff) - /* VDP1 */ - AM_RANGE(0x05c00000, 0x05c7ffff) AM_READWRITE(saturn_vdp1_vram_r, saturn_vdp1_vram_w) - AM_RANGE(0x05c80000, 0x05cbffff) AM_READWRITE(saturn_vdp1_framebuffer0_r, saturn_vdp1_framebuffer0_w) - AM_RANGE(0x05d00000, 0x05d0001f) AM_READWRITE16(saturn_vdp1_regs_r, saturn_vdp1_regs_w,0xffffffff) - AM_RANGE(0x05e00000, 0x05e7ffff) AM_MIRROR(0x80000) AM_READWRITE(saturn_vdp2_vram_r, saturn_vdp2_vram_w) - AM_RANGE(0x05f00000, 0x05f7ffff) AM_READWRITE(saturn_vdp2_cram_r, saturn_vdp2_cram_w) - AM_RANGE(0x05f80000, 0x05fbffff) AM_READWRITE16(saturn_vdp2_regs_r, saturn_vdp2_regs_w,0xffffffff) - AM_RANGE(0x05fe0000, 0x05fe00cf) AM_READWRITE(saturn_scu_r, saturn_scu_w) - AM_RANGE(0x06000000, 0x060fffff) AM_RAM AM_MIRROR(0x21f00000) AM_SHARE("workram_h") - AM_RANGE(0x20000000, 0x2007ffff) AM_ROM AM_SHARE("share6") // bios mirror - AM_RANGE(0x22000000, 0x24ffffff) AM_ROM AM_SHARE("share7") // cart mirror - AM_RANGE(0xc0000000, 0xc00007ff) AM_RAM // cache RAM -ADDRESS_MAP_END - static ADDRESS_MAP_START( sound_mem, AS_PROGRAM, 16, saturn_state ) AM_RANGE(0x000000, 0x0fffff) AM_RAM AM_SHARE("sound_ram") AM_RANGE(0x100000, 0x100fff) AM_DEVREADWRITE_LEGACY("scsp", scsp_r, scsp_w) @@ -1235,351 +1208,6 @@ static INPUT_PORTS_START( saturn ) PORT_CONFSETTING(0x01,"One Shot (Hack)") INPUT_PORTS_END -#define STV_PLAYER_INPUTS(_n_, _b1_, _b2_, _b3_,_b4_) \ - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_##_b1_ ) PORT_PLAYER(_n_) \ - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_##_b2_ ) PORT_PLAYER(_n_) \ - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_##_b3_ ) PORT_PLAYER(_n_) \ - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_##_b4_ ) PORT_PLAYER(_n_) \ - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(_n_) \ - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(_n_) \ - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(_n_) \ - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(_n_) - -static INPUT_PORTS_START( stv ) - PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, "PDR1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - 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, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "PDR2" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - 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, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("PORTA") - STV_PLAYER_INPUTS(1, BUTTON1, BUTTON2, BUTTON3, BUTTON4) - - PORT_START("PORTB") - STV_PLAYER_INPUTS(2, BUTTON1, BUTTON2, BUTTON3, BUTTON4) - - PORT_START("PORTC") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("1P Push Switch") PORT_CODE(KEYCODE_7) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("2P Push Switch") PORT_CODE(KEYCODE_8) - - PORT_START("PORTE") - STV_PLAYER_INPUTS(3, BUTTON1, BUTTON2, BUTTON3, START) - - PORT_START("PORTF") - STV_PLAYER_INPUTS(4, BUTTON1, BUTTON2, BUTTON3, START) -INPUT_PORTS_END - -static INPUT_PORTS_START( stv6b ) - PORT_INCLUDE( stv ) - - PORT_MODIFY("PORTA") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTB") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTE") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - /* Extra button layout, used by Power Instinct 3, Suikoenbu, Elan Doree, Golden Axe Duel & Astra SuperStars */ - PORT_MODIFY("PORTF") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) -INPUT_PORTS_END - -static INPUT_PORTS_START( critcrsh ) - PORT_INCLUDE( stv ) - - PORT_MODIFY("PORTA") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTB") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTC") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hammer Hit") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTE") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTF") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("LIGHTX") /* mask default type sens delta min max */ - PORT_BIT( 0x3f, 0x00, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(0,0x3f) PORT_SENSITIVITY(50) PORT_KEYDELTA(1) PORT_PLAYER(1) - - PORT_START("LIGHTY") - PORT_BIT( 0x3f, 0x00, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0x0,0x3f) PORT_SENSITIVITY(50) PORT_KEYDELTA(1) PORT_PLAYER(1) -INPUT_PORTS_END - -/* Same as the regular one, but with an additional & optional mahjong panel */ -static INPUT_PORTS_START( stvmp ) - PORT_INCLUDE( stv ) - - PORT_MODIFY("PORTE") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTF") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - /* Mahjong panel/player 1 side */ - PORT_START("P1_KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_M ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_I ) - - PORT_START("P1_KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_N ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_J ) - - PORT_START("P1_KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_K ) - - PORT_START("P1_KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_L ) - - PORT_START("P1_KEY4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - /* Mahjong panel/player 2 side */ - PORT_START("P2_KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2) - - PORT_START("P2_KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2) - - PORT_START("P2_KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2) - - PORT_START("P2_KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2) - - PORT_START("P2_KEY4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) -INPUT_PORTS_END - -/* Micronet layout, routes joystick port to the mux! */ -static INPUT_PORTS_START( myfairld ) - PORT_INCLUDE( stv ) - - PORT_MODIFY("PORTA") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTB") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTC") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTE") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_MODIFY("PORTF") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("P1_KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - - PORT_START("P1_KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - - PORT_START("P1_KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - - PORT_START("P1_KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x00) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("IO_TYPE", 0x01, EQUALS, 0x01) - - PORT_START("P1_KEY4") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) /* F/F is there, but these two games are single player so it isn't connected */ - - PORT_START("P2_KEY0") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("P2_KEY1") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("P2_KEY2") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("P2_KEY3") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("P2_KEY4") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IO_TYPE") - PORT_CONFNAME( 0x01, 0x01, "I/O Device type" ) - PORT_CONFSETTING( 0x00, "Mahjong Panel" ) - PORT_CONFSETTING( 0x01, "Joystick" ) -INPUT_PORTS_END - static const gfx_layout tiles8x8x4_layout = { 8,8, @@ -1638,7 +1266,7 @@ static const gfx_layout tiles16x16x8_layout = -static GFXDECODE_START( stv ) +GFXDECODE_START( stv ) GFXDECODE_ENTRY( NULL, 0, tiles8x8x4_layout, 0x00, (0x80*(2+1)) ) GFXDECODE_ENTRY( NULL, 0, tiles16x16x4_layout, 0x00, (0x80*(2+1)) ) GFXDECODE_ENTRY( NULL, 0, tiles8x8x8_layout, 0x00, (0x08*(2+1)) ) @@ -1648,7 +1276,7 @@ GFXDECODE_END static const sh2_cpu_core sh2_conf_master = { 0, NULL }; static const sh2_cpu_core sh2_conf_slave = { 1, NULL }; -static void scsp_irq(device_t *device, int irq) +void scsp_irq(device_t *device, int irq) { saturn_state *state = device->machine().driver_data(); @@ -2267,139 +1895,6 @@ MACHINE_CONFIG_DERIVED( saturnjp, saturn ) MACHINE_CONFIG_END -static MACHINE_CONFIG_START( stv, saturn_state ) - - /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz - MCFG_CPU_PROGRAM_MAP(stv_mem) - MCFG_CPU_CONFIG(sh2_conf_master) - MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", saturn_state, saturn_scanline, "screen", 0, 1) - - MCFG_CPU_ADD("slave", SH2, MASTER_CLOCK_352/2) // 28.6364 MHz - MCFG_CPU_PROGRAM_MAP(stv_mem) - MCFG_CPU_CONFIG(sh2_conf_slave) - MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_scantimer", saturn_state, saturn_slave_scanline, "screen", 0, 1) - - MCFG_CPU_ADD("audiocpu", M68000, 11289600) //11.2896 MHz - MCFG_CPU_PROGRAM_MAP(sound_mem) - - MCFG_MACHINE_START_OVERRIDE(saturn_state,stv) - MCFG_MACHINE_RESET_OVERRIDE(saturn_state,stv) - - MCFG_EEPROM_93C46_ADD("eeprom") /* Actually 93c45 */ - - MCFG_TIMER_DRIVER_ADD("sector_timer", saturn_state, stv_sector_cb) - MCFG_TIMER_DRIVER_ADD("sh1_cmd", saturn_state, stv_sh1_sim) - - /* video hardware */ - MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK_320/8, 427, 0, 320, 263, 0, 224) - MCFG_SCREEN_UPDATE_DRIVER(saturn_state, screen_update_stv_vdp2) - MCFG_PALETTE_LENGTH(2048+(2048*2))//standard palette + extra memory for rgb brightness. - - MCFG_GFXDECODE(stv) - - MCFG_VIDEO_START_OVERRIDE(saturn_state,stv_vdp2) - - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - - MCFG_SOUND_ADD("scsp", SCSP, 0) - MCFG_SOUND_CONFIG(scsp_config) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) - - MCFG_SOUND_ADD("cdda", CDDA, 0) - MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) -MACHINE_CONFIG_END - -struct stv_cart_region -{ - const char *tag; - int slot; - const char *region; -}; - -static const struct stv_cart_region stv_cart_table[] = -{ - { ":cart1", 0, "game0" }, - { ":cart2", 1, "game1" }, - { ":cart3", 2, "game2" }, - { ":cart4", 3, "game3" }, - { 0 } -}; - -DEVICE_IMAGE_LOAD_MEMBER( saturn_state, stv_cart ) -{ -// saturn_state *state = image.device().machine().driver_data(); - const struct stv_cart_region *stv_cart = &stv_cart_table[0], *this_cart; - //const char *pcb_name; - - /* First, determine where this cart has to be loaded */ - while (stv_cart->tag) - { - if (strcmp(stv_cart->tag, image.device().tag()) == 0) - break; - - stv_cart++; - } - - this_cart = stv_cart; - - if (image.software_entry() == NULL) - return IMAGE_INIT_FAIL; - - UINT8 *ROM = image.device().machine().root_device().memregion(this_cart->region)->base(); - UINT32 length = image.get_software_region_length("rom"); - - memcpy(ROM, image.get_software_region("rom"), length); - - /* fix endianess */ - { - UINT8 j[4]; - int i; - - for(i=0;i(); + const struct stv_cart_region *stv_cart = &stv_cart_table[0], *this_cart; + //const char *pcb_name; + + /* First, determine where this cart has to be loaded */ + while (stv_cart->tag) + { + if (strcmp(stv_cart->tag, image.device().tag()) == 0) + break; + + stv_cart++; + } + + this_cart = stv_cart; + + if (image.software_entry() == NULL) + return IMAGE_INIT_FAIL; + + UINT8 *ROM = image.device().machine().root_device().memregion(this_cart->region)->base(); + UINT32 length = image.get_software_region_length("rom"); + + memcpy(ROM, image.get_software_region("rom"), length); + + /* fix endianess */ + { + UINT8 j[4]; + int i; + + for(i=0;i