From 456343030d5e5a2818a12b2cc1b52a8c17d602cc Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Tue, 5 Feb 2013 01:26:30 +0000 Subject: [PATCH] Fixed input regression with Bug 2 --- src/emu/cpu/scudsp/scudspdasm.c | 15 +++++++++------ src/mame/drivers/saturn.c | 8 +++----- src/mame/video/stvvdp1.c | 5 +++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/emu/cpu/scudsp/scudspdasm.c b/src/emu/cpu/scudsp/scudspdasm.c index 86dface1f53..afb750cf5ed 100644 --- a/src/emu/cpu/scudsp/scudspdasm.c +++ b/src/emu/cpu/scudsp/scudspdasm.c @@ -24,13 +24,16 @@ enum EA_DMADSTMEM, EA_DSTMEM, EA_MVIDSTMEM, + EA_FLAGS, + EA_DMASRCMEM + }; struct SCUDSP_OPCODE { char mnemonic[32]; int address_mode_1; int address_mode_2; - int address_mode_3, + int address_mode_3; }; static const SCUDSP_OPCODE alu_table[16] = @@ -95,7 +98,7 @@ static const SCUDSP_OPCODE dma_table[] = { { "DMA", EA_D0, EA_DMADSTMEM, EA_IMM8, }, /* 000 */ // "DMA%H%A D0,%M,%I", { "DMA", EA_DMASRCMEM, EA_D0, EA_IMM8, }, /* 001 */ // "DMA%H%A %s,D0,%I", - { "DMA", 0, 0, 0, }, /* 010 */ // "DMA%H%A D0,%M,%s", + { "DMA", 0, 0, 0, }, /* 010 */ // "DMA%H%A D0,%M,%s", { "DMA", 0, 0, 0, }, /* 011 */ // "DMA%H%A %s,D0,%s", { "DMAH", EA_D0, EA_DMADSTMEM, EA_IMM8, }, /* 100 */ // "DMA%H%A D0,%M,%I", { "DMAH", EA_DMASRCMEM, EA_D0, EA_IMM8, }, /* 101 */ // "DMA%H%A %s,D0,%I", @@ -206,7 +209,7 @@ static const char *const cond_flags[] = /*****************************************************************************/ static char *output; -static const UINT32 *rombase; +static const UINT8 *rombase; static void ATTR_PRINTF(1,2) print(const char *fmt, ...) { @@ -236,9 +239,9 @@ static UINT8 add_table(UINT32 cur_opcode) static UINT32 decode_opcode(UINT32 pc, const SCUDSP_OPCODE *op_table,UINT32 cur_opcode) { - INT8 rel8; - UINT32 imm32; - UINT8 op2; +// INT8 rel8; +// UINT32 imm32; +// UINT8 op2; UINT32 flags = 0; //if (!strcmp(op_table->mnemonic, "jsr") || !strcmp(op_table->mnemonic, "bsr")) diff --git a/src/mame/drivers/saturn.c b/src/mame/drivers/saturn.c index da9eb049676..9dfe2be9be8 100644 --- a/src/mame/drivers/saturn.c +++ b/src/mame/drivers/saturn.c @@ -850,6 +850,7 @@ INPUT_CHANGED_MEMBER(saturn_state::key_stroke) } } +/* Note: unused bits must stay high, Bug 2 relies on this. */ #define SATURN_PAD_P1(_mask_, _val_) \ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ @@ -864,9 +865,7 @@ INPUT_CHANGED_MEMBER(saturn_state::key_stroke) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Y") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Z") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P1 L") PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ - PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) - + PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) #define SATURN_PAD_P2(_mask_, _val_) \ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ @@ -882,8 +881,7 @@ INPUT_CHANGED_MEMBER(saturn_state::key_stroke) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Y") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Z") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("P2 L") PORT_PLAYER(2) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ - PORT_BIT( 0x0003, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) + PORT_BIT( 0x0007, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) #define MD_PAD_P1(_mask_, _val_) \ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("INPUT_TYPE", _mask_, EQUALS, _val_) \ diff --git a/src/mame/video/stvvdp1.c b/src/mame/video/stvvdp1.c index ad5d26eedd8..4ff175d4f09 100644 --- a/src/mame/video/stvvdp1.c +++ b/src/mame/video/stvvdp1.c @@ -194,6 +194,7 @@ READ16_HANDLER( saturn_vdp1_regs_r ) return modr; default: + if(!space.debugger_access()) printf ("cpu %s (PC=%08X) VDP1: Read from Registers, Offset %04x\n", space.device().tag(), space.device().safe_pc(), offset*2); break; } @@ -1985,7 +1986,7 @@ static void stv_vdp1_process_list(running_machine &machine) break; case 0x0005: -// case 0x0007: // mirror? +// case 0x0007: // mirror? Baroque uses it, crashes for whatever reason if (VDP1_LOG) logerror ("Sprite List Polyline\n"); stv2_current_sprite.ispoly = 1; stv_vdp1_draw_poly_line(machine, *cliprect); @@ -1998,7 +1999,7 @@ static void stv_vdp1_process_list(running_machine &machine) break; case 0x0008: -// case 0x000b: // mirror? +// case 0x000b: // mirror? Bug 2 if (VDP1_LOG) logerror ("Sprite List Set Command for User Clipping (%d,%d),(%d,%d)\n", stv2_current_sprite.CMDXA, stv2_current_sprite.CMDYA, stv2_current_sprite.CMDXC, stv2_current_sprite.CMDYC); state->m_vdp1.user_cliprect.set(stv2_current_sprite.CMDXA, stv2_current_sprite.CMDXC, stv2_current_sprite.CMDYA, stv2_current_sprite.CMDYC); break;