diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c index af9a0f56578..21991c82955 100644 --- a/src/mame/drivers/neogeo.c +++ b/src/mame/drivers/neogeo.c @@ -1080,13 +1080,13 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, neogeo_state ) /* some games have protection devices in the 0x200000 region, it appears to map to cart space, not surprising, the ROM is read here too */ AM_RANGE(0x200000, 0x2fffff) AM_ROMBANK(NEOGEO_BANK_CARTRIDGE) AM_RANGE(0x2ffff0, 0x2fffff) AM_WRITE(main_cpu_bank_select_w) - AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ff7e) AM_READ_PORT("IN0") - AM_RANGE(0x300080, 0x300081) AM_MIRROR(0x01ff7e) AM_READ_PORT("IN4") - AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ffe0) AM_READ(neogeo_unmapped_r) AM_WRITE(watchdog_w) - AM_RANGE(0x320000, 0x320001) AM_MIRROR(0x01fffe) AM_READ_PORT("IN3") AM_WRITE(audio_command_w) - AM_RANGE(0x340000, 0x340001) AM_MIRROR(0x01fffe) AM_READ_PORT("IN1") + AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ff7e) AM_READ_PORT("P1/DSW") + AM_RANGE(0x300080, 0x300081) AM_MIRROR(0x01ff7e) AM_READ_PORT("TEST") + AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ffe0) AM_WRITE(watchdog_w) + AM_RANGE(0x320000, 0x320001) AM_MIRROR(0x01fffe) AM_READ_PORT("AUDIO/COIN") AM_WRITE(audio_command_w) + AM_RANGE(0x340000, 0x340001) AM_MIRROR(0x01fffe) AM_READ_PORT("P2") AM_RANGE(0x360000, 0x37ffff) AM_READ(neogeo_unmapped_r) - AM_RANGE(0x380000, 0x380001) AM_MIRROR(0x01fffe) AM_READ_PORT("IN2") + AM_RANGE(0x380000, 0x380001) AM_MIRROR(0x01fffe) AM_READ_PORT("SYSTEM") AM_RANGE(0x380000, 0x38007f) AM_MIRROR(0x01ff80) AM_WRITE(io_control_w) AM_RANGE(0x3a0000, 0x3a001f) AM_MIRROR(0x01ffe0) AM_READ(neogeo_unmapped_r) AM_WRITE(system_control_w) AM_RANGE(0x3c0000, 0x3c0007) AM_MIRROR(0x01fff8) AM_READ(neogeo_video_register_r) @@ -1147,104 +1147,78 @@ ADDRESS_MAP_END * *************************************/ -#define STANDARD_DIPS \ - PORT_DIPNAME( 0x0001, 0x0001, "Test Switch" ) PORT_DIPLOCATION("SW:1") \ - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) \ - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ - PORT_DIPNAME( 0x0002, 0x0002, "Coin Chutes?" ) PORT_DIPLOCATION("SW:2") \ - PORT_DIPSETTING( 0x0000, "1?" ) \ - PORT_DIPSETTING( 0x0002, "2?" ) \ - PORT_DIPNAME( 0x0004, 0x0004, "Autofire (in some games)" ) PORT_DIPLOCATION("SW:3") \ - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) \ - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ - PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5") \ - PORT_DIPSETTING( 0x0018, "1" ) \ - PORT_DIPSETTING( 0x0010, "2" ) \ - PORT_DIPSETTING( 0x0008, "3" ) \ - PORT_DIPSETTING( 0x0000, "4" ) \ - PORT_DIPNAME( 0x0020, 0x0020, "COMM Setting (Link Enable)" ) PORT_DIPLOCATION("SW:6") \ - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) \ - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW:7") \ - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) \ - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ - PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8") \ - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) \ +static INPUT_PORTS_START( neogeo ) + PORT_START("P1/DSW") + PORT_SERVICE_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW:1" ) + PORT_DIPNAME( 0x0002, 0x0002, "Coin Chutes?" ) PORT_DIPLOCATION("SW:2") + PORT_DIPSETTING( 0x0000, "1?" ) + PORT_DIPSETTING( 0x0002, "2?" ) + PORT_DIPNAME( 0x0004, 0x0004, "Autofire (in some games)" ) PORT_DIPLOCATION("SW:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - - -#define STANDARD_IN0 \ - PORT_START("IN0") \ - STANDARD_DIPS \ - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) \ - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) \ - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) \ - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) \ - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) \ - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) \ - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) \ + PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5") + PORT_DIPSETTING( 0x0018, "1" ) + PORT_DIPSETTING( 0x0010, "2" ) + PORT_DIPSETTING( 0x0008, "3" ) + PORT_DIPSETTING( 0x0000, "4" ) + PORT_DIPNAME( 0x0020, 0x0020, "COMM Setting (Link Enable)" ) PORT_DIPLOCATION("SW:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) - -#define STANDARD_IN1 \ - PORT_START("IN1") \ - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) \ - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) \ - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) \ - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) \ - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) 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_START("P2") + PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) 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_BUTTON4 ) PORT_PLAYER(2) - -#define STANDARD_IN2 \ - PORT_START("IN2") \ - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) \ - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) \ - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_7) \ - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 ) \ - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_8) \ - PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_memcard_status, NULL) \ + PORT_START("SYSTEM") + PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_7) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_8) + PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_memcard_status, NULL) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* In AES 'mode' nitd, kof2000, sengoku3, matrim and mslug5 check if this is ACTIVE_HIGH */ - -#define STANDARD_IN3 \ - PORT_START("IN3") \ - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) \ - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) \ - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) \ - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms; if ACTIVE_HIGH + IN4 bit 6 ACTIVE_HIGH = AES 'mode' */ \ - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms; if ACTIVE_HIGH + IN4 bit 6 ACTIVE_HIGH = AES 'mode' */ \ - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* what is this? When ACTIVE_HIGH + IN4 bit 6 ACTIVE_LOW MVS-4 slot is detected */ \ - PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_calendar_status, NULL) \ + PORT_START("AUDIO/COIN") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms; if ACTIVE_HIGH + IN4 bit 6 ACTIVE_HIGH = AES 'mode' */ + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms; if ACTIVE_HIGH + IN4 bit 6 ACTIVE_HIGH = AES 'mode' */ + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* what is this? When ACTIVE_HIGH + IN4 bit 6 ACTIVE_LOW MVS-4 slot is detected */ + PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_calendar_status, NULL) PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_audio_result, NULL) - -#define STANDARD_IN4 \ - PORT_START("IN4") \ - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* what is this? If ACTIVE_LOW, MVS-6 slot detected, when ACTIVE_HIGH MVS-1 slot (AES) detected */ \ - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter BIOS") PORT_CODE(KEYCODE_F2) \ + PORT_START("TEST") + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* what is this? If ACTIVE_LOW, MVS-6 slot detected, when ACTIVE_HIGH MVS-1 slot (AES) detected */ + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) - - -static INPUT_PORTS_START( neogeo ) - STANDARD_IN0 - - STANDARD_IN1 - - STANDARD_IN2 - - STANDARD_IN3 - - STANDARD_IN4 INPUT_PORTS_END diff --git a/src/mame/drivers/neogeo.inc b/src/mame/drivers/neogeo.inc index 29da96e9eec..ba05e3ffc69 100644 --- a/src/mame/drivers/neogeo.inc +++ b/src/mame/drivers/neogeo.inc @@ -8986,16 +8986,12 @@ ROM_END ****************************************************************************/ -static INPUT_PORTS_START( svcpcb ) - STANDARD_IN0 +static INPUT_PORTS_START( ms5pcb ) + PORT_INCLUDE( neogeo ) - STANDARD_IN1 - - STANDARD_IN2 - - STANDARD_IN3 - - STANDARD_IN4 + PORT_MODIFY("SYSTEM") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) /* the rom banking is tied directly to the dipswitch?, or is there a bank write somewhere? */ PORT_START("HARDDIP") @@ -9005,35 +9001,17 @@ static INPUT_PORTS_START( svcpcb ) INPUT_PORTS_END -static INPUT_PORTS_START( ms5pcb ) - STANDARD_IN0 +static INPUT_PORTS_START( kf2k3pcb ) + PORT_INCLUDE( neogeo ) - STANDARD_IN1 - - STANDARD_IN2 - - STANDARD_IN3 - - STANDARD_IN4 - - /* the rom banking is tied directly to the dipswitch?, or is there a bank write somewhere? */ - PORT_START("HARDDIP") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Region ) ) PORT_DIPLOCATION("HARDDIP:3") - PORT_DIPSETTING( 0x00, DEF_STR( Asia ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Japan ) ) + PORT_MODIFY("SYSTEM") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END static INPUT_PORTS_START( kog ) - STANDARD_IN0 - - STANDARD_IN1 - - STANDARD_IN2 - - STANDARD_IN3 - - STANDARD_IN4 + PORT_INCLUDE( neogeo ) /* a jumper on the pcb overlays a ROM address, very strange but that's how it works. */ PORT_START("JUMPER") @@ -9046,40 +9024,14 @@ INPUT_PORTS_END static INPUT_PORTS_START( mjneogeo ) - PORT_START("IN0") - PORT_DIPNAME( 0x0001, 0x0001, "Test Switch" ) PORT_DIPLOCATION("SW:1") - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, "Coin Chutes?" ) PORT_DIPLOCATION("SW:2") - PORT_DIPSETTING( 0x0000, "1?" ) - PORT_DIPSETTING( 0x0002, "2?" ) + PORT_INCLUDE( neogeo ) + + PORT_MODIFY("P1/DSW") PORT_DIPNAME( 0x0004, 0x0000, "Mahjong Control Panel" ) PORT_DIPLOCATION("SW:3") PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5") - PORT_DIPSETTING( 0x0018, "1" ) - PORT_DIPSETTING( 0x0008, "2" ) - PORT_DIPSETTING( 0x0010, "3" ) - PORT_DIPSETTING( 0x0000, "4" ) - PORT_DIPNAME( 0x0020, 0x0020, "COMM Setting (Link Enable)" ) PORT_DIPLOCATION("SW:6") - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW:7") - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8") - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,mahjong_controller_r, NULL) - STANDARD_IN1 - - STANDARD_IN2 - - STANDARD_IN3 - - STANDARD_IN4 - PORT_START("MAHJONG1") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_B ) @@ -9127,39 +9079,24 @@ INPUT_PORTS_END static INPUT_PORTS_START( irrmaze ) - PORT_START("IN0") - STANDARD_DIPS + PORT_INCLUDE( neogeo ) + + PORT_MODIFY("P1/DSW") PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,multiplexed_controller_r, (void *)0) - PORT_START("IN1") + PORT_MODIFY("P2") PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_START("IN2") - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) + PORT_MODIFY("SYSTEM") PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_memcard_status, NULL) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - STANDARD_IN3 - - PORT_START("IN4") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* this bit is used.. */ - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter BIOS") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("IN0-0") PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(10) PORT_KEYDELTA(20) PORT_REVERSE @@ -9169,20 +9106,14 @@ INPUT_PORTS_END static INPUT_PORTS_START( popbounc ) - PORT_START("IN0") - STANDARD_DIPS + PORT_INCLUDE( neogeo ) + + PORT_MODIFY("P1/DSW") PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,multiplexed_controller_r, (void *)0) - PORT_START("IN1") - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_MODIFY("P2") PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,multiplexed_controller_r, (void *)1) - STANDARD_IN2 - - STANDARD_IN3 - - STANDARD_IN4 - /* Fake inputs read by CUSTOM_INPUT handlers */ PORT_START("IN0-0") PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) @@ -9211,35 +9142,25 @@ INPUT_PORTS_END static INPUT_PORTS_START( vliner ) - PORT_START("IN0") - STANDARD_DIPS - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_INCLUDE( neogeo ) + + PORT_MODIFY("P1/DSW") PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("View Payout Table/Big") PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet/Small") PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop/Double Up") PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Start/Collect") - PORT_START("IN1") + PORT_MODIFY("P2") PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("IN2") - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_MODIFY("SYSTEM") PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* this bit is used.. */ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* this bit is used.. */ - PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_memcard_status, NULL) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("IN3") + PORT_MODIFY("AUDIO/COIN") PORT_BIT( 0x003f, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_calendar_status, NULL) - PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_audio_result, NULL) - - STANDARD_IN4 PORT_START("IN5") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) @@ -9260,22 +9181,11 @@ INPUT_PORTS_END static INPUT_PORTS_START( jockeygp ) - STANDARD_IN0 + PORT_INCLUDE( neogeo ) - STANDARD_IN1 - - PORT_START("IN2") - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_MODIFY("SYSTEM") PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* game freezes with this bit enabled */ - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_7) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* game freezes with this bit enabled */ - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_8) - PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, neogeo_state,get_memcard_status, NULL) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - STANDARD_IN3 - - STANDARD_IN4 INPUT_PORTS_END @@ -10157,8 +10067,8 @@ GAME( 2003, mslug5, neogeo, neogeo, neogeo, neogeo_state, mslug5, RO GAME( 2003, mslug5h, mslug5, neogeo, neogeo, neogeo_state, mslug5, ROT0, "SNK Playmore", "Metal Slug 5 (NGH-2680)", GAME_SUPPORTS_SAVE ) /* Also found in later MVS carts */ GAME( 2003, ms5pcb, 0, neogeo, ms5pcb, neogeo_state, ms5pcb, ROT0, "SNK Playmore", "Metal Slug 5 (JAMMA PCB)", GAME_SUPPORTS_SAVE ) GAME( 2003, ms5plus, mslug5, neogeo, neogeo, neogeo_state, ms5plus, ROT0, "bootleg", "Metal Slug 5 Plus (bootleg)", GAME_SUPPORTS_SAVE ) -GAME( 2003, svcpcb, 0, neogeo, svcpcb, neogeo_state, svcpcb, ROT0, "SNK Playmore", "SNK vs. Capcom - SVC Chaos (JAMMA PCB, set 1)", GAME_SUPPORTS_SAVE ) // not a clone of neogeo because it's NOT a neogeo cart. -GAME( 2003, svcpcba, svcpcb, neogeo, svcpcb, neogeo_state, svcpcb, ROT0, "SNK Playmore", "SNK vs. Capcom - SVC Chaos (JAMMA PCB, set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code */ +GAME( 2003, svcpcb, 0, neogeo, ms5pcb, neogeo_state, svcpcb, ROT0, "SNK Playmore", "SNK vs. Capcom - SVC Chaos (JAMMA PCB, set 1)", GAME_SUPPORTS_SAVE ) // not a clone of neogeo because it's NOT a neogeo cart. +GAME( 2003, svcpcba, svcpcb, neogeo, ms5pcb, neogeo_state, svcpcb, ROT0, "SNK Playmore", "SNK vs. Capcom - SVC Chaos (JAMMA PCB, set 2)" , GAME_SUPPORTS_SAVE ) /* Encrypted Code */ GAME( 2003, svc, neogeo, neogeo, neogeo, neogeo_state, svc, ROT0, "SNK Playmore", "SNK vs. Capcom - SVC Chaos (NGM-2690)(NGH-2690)", GAME_SUPPORTS_SAVE ) GAME( 2003, svcboot, svc, neogeo, neogeo, neogeo_state, svcboot, ROT0, "bootleg", "SNK vs. Capcom - SVC Chaos (bootleg)", GAME_SUPPORTS_SAVE ) GAME( 2003, svcplus, svc, neogeo, neogeo, neogeo_state, svcplus, ROT0, "bootleg", "SNK vs. Capcom - SVC Chaos Plus (bootleg set 1)", GAME_SUPPORTS_SAVE ) @@ -10167,7 +10077,7 @@ GAME( 2003, svcsplus, svc, neogeo, neogeo, neogeo_state, svcsplus, RO GAME( 2003, samsho5, neogeo, neogeo, neogeo, neogeo_state, samsho5, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (NGM-2700)", GAME_SUPPORTS_SAVE ) GAME( 2003, samsho5h, samsho5, neogeo, neogeo, neogeo_state, samsho5, ROT0, "Yuki Enterprise / SNK Playmore", "Samurai Shodown V / Samurai Spirits Zero (NGH-2700)", GAME_SUPPORTS_SAVE ) GAME( 2003, samsho5b, samsho5, neogeo, neogeo, neogeo_state, samsho5b, ROT0, "bootleg", "Samurai Shodown V / Samurai Spirits Zero (bootleg)", GAME_SUPPORTS_SAVE ) // different program scrambling -GAME( 2003, kf2k3pcb, 0, neogeo, neogeo, neogeo_state, kf2k3pcb, ROT0, "SNK Playmore", "The King of Fighters 2003 (Japan, JAMMA PCB)", GAME_SUPPORTS_SAVE ) // not a clone of neogeo because it's NOT a neogeo cart. +GAME( 2003, kf2k3pcb, 0, neogeo, kf2k3pcb, neogeo_state, kf2k3pcb, ROT0, "SNK Playmore", "The King of Fighters 2003 (Japan, JAMMA PCB)", GAME_SUPPORTS_SAVE ) // not a clone of neogeo because it's NOT a neogeo cart. GAME( 2003, kof2003, neogeo, neogeo, neogeo, neogeo_state, kof2003, ROT0, "SNK Playmore", "The King of Fighters 2003 (NGM-2710)", GAME_SUPPORTS_SAVE ) GAME( 2003, kof2003h, kof2003, neogeo, neogeo, neogeo_state, kof2003h, ROT0, "SNK Playmore", "The King of Fighters 2003 (NGH-2710)", GAME_SUPPORTS_SAVE ) GAME( 2003, kf2k3bl, kof2003, neogeo, neogeo, neogeo_state, kf2k3bl , ROT0, "bootleg", "The King of Fighters 2003 (bootleg set 1)", GAME_SUPPORTS_SAVE ) // zooming is wrong because its a bootleg of the pcb version on a cart (unless it was a bootleg pcb with the new bios?) diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c index 2b2c07959db..48254a5be53 100644 --- a/src/mame/video/neogeo.c +++ b/src/mame/video/neogeo.c @@ -654,40 +654,42 @@ void neogeo_state::optimize_sprite_data() { /* convert the sprite graphics data into a format that allows faster blitting */ - int i; - int len; UINT8 *src; UINT8 *dest; + UINT32 mask; + UINT32 len; UINT32 bit; /* get mask based on the length rounded up to the nearest power of 2 */ - m_sprite_gfx_address_mask = 0xffffffff; + mask = 0xffffffff; len = m_region_sprites->bytes(); for (bit = 0x80000000; bit != 0; bit >>= 1) { - if (((len * 2) - 1) & bit) + if ((len * 2 - 1) & bit) break; - m_sprite_gfx_address_mask >>= 1; + mask >>= 1; } - m_sprite_gfx = auto_alloc_array_clear(machine(), UINT8, m_sprite_gfx_address_mask + 1); + if (mask > m_sprite_gfx_address_mask) + { + if (m_sprite_gfx != NULL) + auto_free(machine(), m_sprite_gfx); + m_sprite_gfx = auto_alloc_array_clear(machine(), UINT8, mask + 1); + m_sprite_gfx_address_mask = mask; + } src = m_region_sprites->base(); dest = m_sprite_gfx; - for (i = 0; i < len; i += 0x80, src += 0x80) + for (unsigned i = 0; i < len; i += 0x80, src += 0x80) { - int y; - - for (y = 0; y < 0x10; y++) + for (unsigned y = 0; y < 0x10; y++) { - int x; - - for (x = 0; x < 8; x++) + for (unsigned x = 0; x < 8; x++) { *(dest++) = (((src[0x43 | (y << 2)] >> x) & 0x01) << 3) | (((src[0x41 | (y << 2)] >> x) & 0x01) << 2) | @@ -695,7 +697,7 @@ void neogeo_state::optimize_sprite_data() (((src[0x40 | (y << 2)] >> x) & 0x01) << 0); } - for (x = 0; x < 8; x++) + for (unsigned x = 0; x < 8; x++) { *(dest++) = (((src[0x03 | (y << 2)] >> x) & 0x01) << 3) | (((src[0x01 | (y << 2)] >> x) & 0x01) << 2) | @@ -837,6 +839,9 @@ void neogeo_state::video_start() compute_rgb_weights(); create_sprite_line_timer(); create_auto_animation_timer(); + + m_sprite_gfx = NULL; + m_sprite_gfx_address_mask = 0; optimize_sprite_data(); /* initialize values that are not modified on a reset */ @@ -880,7 +885,6 @@ void neogeo_state::video_reset() { start_sprite_line_timer(); start_auto_animation_timer(); - optimize_sprite_data(); } diff --git a/src/mess/drivers/ng_aes.c b/src/mess/drivers/ng_aes.c index 5a591c3a2e5..9f69baef4c4 100644 --- a/src/mess/drivers/ng_aes.c +++ b/src/mess/drivers/ng_aes.c @@ -453,7 +453,7 @@ WRITE16_MEMBER(ng_aes_state::neocd_control_w) case 0x0140: // bprintf(PRINT_NORMAL, _T(" - NGCD OBJ BUSREQ -> 0 (PC: 0x%06X)\n"), SekGetPC(-1)); m_has_sprite_bus = true; - video_reset(); + optimize_sprite_data(); break; case 0x0142: // bprintf(PRINT_NORMAL, _T(" - NGCD PCM BUSREQ -> 0 (PC: 0x%06X)\n"), SekGetPC(-1)); @@ -468,7 +468,6 @@ WRITE16_MEMBER(ng_aes_state::neocd_control_w) case 0x0148: // bprintf(PRINT_NORMAL, _T(" - NGCD FIX BUSREQ -> 0 (PC: 0x%06X)\n"), SekGetPC(-1)); m_has_text_bus = true; - video_reset(); break; // CD mechanism communication @@ -1223,7 +1222,7 @@ static ADDRESS_MAP_START( aes_main_map, AS_PROGRAM, 16, ng_aes_state ) AM_RANGE(0x2ffff0, 0x2fffff) AM_WRITE(main_cpu_bank_select_w) AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ff7e) AM_READ(aes_in0_r) AM_RANGE(0x300080, 0x300081) AM_MIRROR(0x01ff7e) AM_READ_PORT("IN4") - AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ffe0) AM_READ(neogeo_unmapped_r) AM_WRITENOP // AES has no watchdog + AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ffe0) AM_WRITENOP // AES has no watchdog AM_RANGE(0x320000, 0x320001) AM_MIRROR(0x01fffe) AM_READ_PORT("IN3") AM_WRITE(audio_command_w) AM_RANGE(0x340000, 0x340001) AM_MIRROR(0x01fffe) AM_READ(aes_in1_r) AM_RANGE(0x360000, 0x37ffff) AM_READ(neogeo_unmapped_r) @@ -1312,38 +1311,13 @@ ADDRESS_MAP_END * *************************************/ -#define STANDARD_DIPS \ - PORT_DIPNAME( 0x0001, 0x0001, "Test Switch" ) PORT_DIPLOCATION("SW:1") \ - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) \ - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ - PORT_DIPNAME( 0x0002, 0x0002, "Coin Chutes?" ) PORT_DIPLOCATION("SW:2") \ - PORT_DIPSETTING( 0x0000, "1?" ) \ - PORT_DIPSETTING( 0x0002, "2?" ) \ - PORT_DIPNAME( 0x0004, 0x0004, "Autofire (in some games)" ) PORT_DIPLOCATION("SW:3") \ - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) \ - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ - PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5") \ - PORT_DIPSETTING( 0x0018, "1" ) \ - PORT_DIPSETTING( 0x0008, "2" ) \ - PORT_DIPSETTING( 0x0010, "3" ) \ - PORT_DIPSETTING( 0x0000, "4" ) \ - PORT_DIPNAME( 0x0020, 0x0020, "COMM Setting (Link Enable)" ) PORT_DIPLOCATION("SW:6") \ - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) \ - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW:7") \ - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) \ - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ - PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8") \ - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) \ - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - -#define STANDARD_IN2 \ - PORT_START("IN2") \ - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) \ - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) \ - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_NAME("1P Select") PORT_CODE(KEYCODE_5) PORT_PLAYER(1) \ - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 ) \ - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_NAME("2P Select") PORT_CODE(KEYCODE_6) PORT_PLAYER(2) \ +#define STANDARD_IN2 \ + PORT_START("IN2") \ + PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) \ + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) \ + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SELECT ) PORT_PLAYER(1) \ + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) \ + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SELECT ) PORT_PLAYER(2) \ PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ng_aes_state, get_memcard_status, NULL) \ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Matrimelee expects this bit to be active high when on an AES */ @@ -1482,7 +1456,6 @@ static INPUT_PORTS_START( mjpanel ) PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - INPUT_PORTS_END static INPUT_PORTS_START( aes )