genesis: grab r859 and r872 from upstream
This commit is contained in:
parent
9e1c678b4a
commit
00d31f41e1
|
@ -20,7 +20,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
||||||
"",
|
"",
|
||||||
isPorted: true,
|
isPorted: true,
|
||||||
isReleased: true,
|
isReleased: true,
|
||||||
portedVersion: "r850",
|
portedVersion: "r872",
|
||||||
portedUrl: "https://code.google.com/p/genplus-gx/"
|
portedUrl: "https://code.google.com/p/genplus-gx/"
|
||||||
)]
|
)]
|
||||||
public class GPGX : IEmulator, ISyncSoundProvider, IVideoProvider
|
public class GPGX : IEmulator, ISyncSoundProvider, IVideoProvider
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Genesis Plus
|
* Genesis Plus
|
||||||
* Team Player support
|
* Team Player support
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2011 Eke-Eke (Genesis Plus GX)
|
* Copyright (C) 2007-2014 Eke-Eke (Genesis Plus GX)
|
||||||
*
|
*
|
||||||
* Redistribution and use of this code or any derivative works are permitted
|
* Redistribution and use of this code or any derivative works are permitted
|
||||||
* provided that the following conditions are met:
|
* provided that the following conditions are met:
|
||||||
|
@ -87,18 +87,20 @@ INLINE unsigned int teamplayer_read(int port)
|
||||||
/* acquisition sequence */
|
/* acquisition sequence */
|
||||||
switch (counter)
|
switch (counter)
|
||||||
{
|
{
|
||||||
case 0: /* initial state: TH = 1, TR = 1 -> RLDU = 0011 */
|
case 0: /* initial state: xxx0011 */
|
||||||
{
|
{
|
||||||
return 0x73;
|
/* TL should match TR */
|
||||||
|
return ((teamplayer[port].State & 0x20) >> 1) | 0x03;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 1: /* start request: TH = 0, TR = 1 -> RLDU = 1111 */
|
case 1: /* start request: xxx1111 */
|
||||||
{
|
{
|
||||||
return 0x3F;
|
/* TL should match TR */
|
||||||
|
return ((teamplayer[port].State & 0x20) >> 1) | 0x0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
case 3: /* ack request: TH=0, TR=0/1 -> RLDU = 0000 */
|
case 3: /* ack request: xxx0000 */
|
||||||
{
|
{
|
||||||
/* TL should match TR */
|
/* TL should match TR */
|
||||||
return ((teamplayer[port].State & 0x20) >> 1);
|
return ((teamplayer[port].State & 0x20) >> 1);
|
||||||
|
@ -107,7 +109,7 @@ INLINE unsigned int teamplayer_read(int port)
|
||||||
case 4:
|
case 4:
|
||||||
case 5:
|
case 5:
|
||||||
case 6:
|
case 6:
|
||||||
case 7: /* PAD type */
|
case 7: /* PAD type: xxx0000 (3B), xxx0001 (6B) or xxx1111 (NC)*/
|
||||||
{
|
{
|
||||||
unsigned int retval = input.dev[(port << 2) + (counter - 4)];
|
unsigned int retval = input.dev[(port << 2) + (counter - 4)];
|
||||||
|
|
||||||
|
@ -115,7 +117,7 @@ INLINE unsigned int teamplayer_read(int port)
|
||||||
return (((teamplayer[port].State & 0x20) >> 1) | retval);
|
return (((teamplayer[port].State & 0x20) >> 1) | retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
default: /* PAD status */
|
default: /* PAD status: xxxRLDU -> xxxSACB -> xxxMXYZ */
|
||||||
{
|
{
|
||||||
unsigned int retval = 0x0F;
|
unsigned int retval = 0x0F;
|
||||||
|
|
||||||
|
@ -136,15 +138,15 @@ INLINE void teamplayer_write(int port, unsigned char data, unsigned char mask)
|
||||||
/* update bits set as output only */
|
/* update bits set as output only */
|
||||||
unsigned int state = (teamplayer[port].State & ~mask) | (data & mask);
|
unsigned int state = (teamplayer[port].State & ~mask) | (data & mask);
|
||||||
|
|
||||||
/* TH & TR handshaking */
|
/* check if TH is HIGH */
|
||||||
if ((teamplayer[port].State ^ state) & 0x60)
|
|
||||||
{
|
|
||||||
if (state & 0x40)
|
if (state & 0x40)
|
||||||
{
|
{
|
||||||
/* TH high -> reset counter */
|
/* reset counter */
|
||||||
teamplayer[port].Counter = 0;
|
teamplayer[port].Counter = 0;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
/* TH & TR handshaking */
|
||||||
|
else if ((teamplayer[port].State ^ state) & 0x60)
|
||||||
{
|
{
|
||||||
/* increment counter */
|
/* increment counter */
|
||||||
teamplayer[port].Counter++;
|
teamplayer[port].Counter++;
|
||||||
|
@ -153,7 +155,6 @@ INLINE void teamplayer_write(int port, unsigned char data, unsigned char mask)
|
||||||
/* update internal state */
|
/* update internal state */
|
||||||
teamplayer[port].State = state;
|
teamplayer[port].State = state;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
unsigned char teamplayer_1_read(void)
|
unsigned char teamplayer_1_read(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Genesis Plus
|
* Genesis Plus
|
||||||
* Team Player support
|
* Team Player support
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2011 Eke-Eke (Genesis Plus GX)
|
* Copyright (C) 2007-2014 Eke-Eke (Genesis Plus GX)
|
||||||
*
|
*
|
||||||
* Redistribution and use of this code or any derivative works are permitted
|
* Redistribution and use of this code or any derivative works are permitted
|
||||||
* provided that the following conditions are met:
|
* provided that the following conditions are met:
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue