summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2009-06-05 19:14:26 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2009-06-05 19:14:26 +0000
commit6190903b5494ec8e5a7c1ca1d5b77f793548babb (patch)
tree764416d5b05f154f261f45c993ff006cd8758b48
parent053506483fe2e98cf7c6cd038c2c85e6c1ee9803 (diff)
Fixed MT3241. It seems I had sent an outdated patch, sorry.
-rw-r--r--src/mame/drivers/megadriv.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c
index b95bd8d365c..404ee56bbee 100644
--- a/src/mame/drivers/megadriv.c
+++ b/src/mame/drivers/megadriv.c
@@ -1637,7 +1637,7 @@ INPUT_PORTS_START( aladbl )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x07, DEF_STR( 1C_7C ) )
-// PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* to avoid it being changed and corrupting Coinage settings */
+// PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* to avoid it being changed and corrupting Coinage settings */
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) /* code at 0x1b2680 */
PORT_DIPSETTING( 0x10, DEF_STR( Easy ) ) /* "PRACTICE" */
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) /* "NORMAL" */
@@ -1674,7 +1674,7 @@ static void megadrive_init_io(running_machine *machine)
/************* 6 buttons version **************************/
static UINT8 megadrive_io_read_data_port_6button(running_machine *machine, int portnum)
{
- UINT8 retdata, helper = (megadrive_io_ctrl_regs[portnum] & 0x7f) | 0xc0; // bits 6 & 7 always come from megadrive_io_data_regs
+ UINT8 retdata, helper = (megadrive_io_ctrl_regs[portnum] & 0x3f) | 0xc0; // bits 6 & 7 always come from megadrive_io_data_regs
static const char *pad3names[] = { "PAD1", "PAD2", "IN0", "UNK" };
static const char *pad6names[] = { "EXTRA1", "EXTRA2", "IN0", "UNK" };
@@ -1683,14 +1683,14 @@ static UINT8 megadrive_io_read_data_port_6button(running_machine *machine, int p
if (io_stage[portnum] == 2)
{
/* here we read B, C & the additional buttons */
- retdata = (megadrive_io_data_regs[portnum] & helper) |
- (((input_port_read_safe(machine, pad3names[portnum], 0) & 0x30) |
+ retdata = (megadrive_io_data_regs[portnum] & helper) |
+ (((input_port_read_safe(machine, pad3names[portnum], 0) & 0x30) |
(input_port_read_safe(machine, pad6names[portnum], 0) & 0x0f)) & ~helper);
}
else
{
/* here we read B, C & the directional buttons */
- retdata = (megadrive_io_data_regs[portnum] & helper) |
+ retdata = (megadrive_io_data_regs[portnum] & helper) |
((input_port_read_safe(machine, pad3names[portnum], 0) & 0x3f) & ~helper);
}
}
@@ -1699,21 +1699,21 @@ static UINT8 megadrive_io_read_data_port_6button(running_machine *machine, int p
if (io_stage[portnum] == 1)
{
/* here we read ((Start & A) >> 2) | 0x00 */
- retdata = (megadrive_io_data_regs[portnum] & helper) |
+ retdata = (megadrive_io_data_regs[portnum] & helper) |
(((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) & ~helper);
}
else if (io_stage[portnum]==2)
{
/* here we read ((Start & A) >> 2) | 0x0f */
- retdata = (megadrive_io_data_regs[portnum] & helper) |
+ retdata = (megadrive_io_data_regs[portnum] & helper) |
((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) | 0x0f) & ~helper);
}
else
{
/* here we read ((Start & A) >> 2) | Up and Down */
- retdata = (megadrive_io_data_regs[portnum] & helper) |
- ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) |
- (input_port_read_safe(machine, pad3names[portnum], 0) & 0x02)) & ~helper);
+ retdata = (megadrive_io_data_regs[portnum] & helper) |
+ ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) |
+ (input_port_read_safe(machine, pad3names[portnum], 0) & 0x03)) & ~helper);
}
}
@@ -1726,21 +1726,21 @@ static UINT8 megadrive_io_read_data_port_6button(running_machine *machine, int p
/************* 3 buttons version **************************/
static UINT8 megadrive_io_read_data_port_3button(running_machine *machine, int portnum)
{
- UINT8 retdata, helper = (megadrive_io_ctrl_regs[portnum] & 0x3f) | 0xc0; // bits 6 & 7 always come from megadrive_io_data_regs
+ UINT8 retdata, helper = (megadrive_io_ctrl_regs[portnum] & 0x7f) | 0x80; // bit 7 always comes from megadrive_io_data_regs
static const char *pad3names[] = { "PAD1", "PAD2", "IN0", "UNK" };
- if (megadrive_io_data_regs[portnum]&0x40)
+ if (megadrive_io_data_regs[portnum] & 0x40)
{
/* here we read B, C & the directional buttons */
- retdata = (megadrive_io_data_regs[portnum] & helper) |
- ((input_port_read_safe(machine, pad3names[portnum], 0) & 0x3f) & ~helper);
+ retdata = (megadrive_io_data_regs[portnum] & helper) |
+ (((input_port_read_safe(machine, pad3names[portnum], 0) & 0x3f) | 0x40) & ~helper);
}
else
{
/* here we read ((Start & A) >> 2) | Up and Down */
- retdata = (megadrive_io_data_regs[portnum] & helper) |
- ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) |
- (input_port_read_safe(machine, pad3names[portnum], 0) & 0x02)) & ~helper);
+ retdata = (megadrive_io_data_regs[portnum] & helper) |
+ ((((input_port_read_safe(machine, pad3names[portnum], 0) & 0xc0) >> 2) |
+ (input_port_read_safe(machine, pad3names[portnum], 0) & 0x03) | 0x40) & ~helper);
}
return retdata;
@@ -1754,7 +1754,7 @@ UINT8 megatech_bios_port_cc_dc_r(running_machine *machine, int offset, int ctrl)
if (ctrl == 0x55)
{
/* A keys */
- retdata = ((input_port_read(machine, "PAD1") & 0x40) >> 2) |
+ retdata = ((input_port_read(machine, "PAD1") & 0x40) >> 2) |
((input_port_read(machine, "PAD2") & 0x40) >> 4) | 0xeb;
}
else
@@ -5925,7 +5925,7 @@ VIDEO_EOF(megadriv)
megadrive_imode_odd_frame^=1;
// cputag_set_input_line(machine, "genesis_snd_z80", 0, CLEAR_LINE); // if the z80 interrupt hasn't happened by now, clear it..
- if (input_port_read_safe(machine, "RESET", 0x00) & 0x01)
+ if (input_port_read_safe(machine, "RESET", 0x00) & 0x01)
cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
/*