small sms update

This commit is contained in:
dinkc64 2015-03-22 21:19:15 +00:00
parent af792ae6e3
commit 61f20973d3
3 changed files with 25 additions and 19 deletions

View File

@ -101,6 +101,16 @@ INT32 SMSExit()
return 0;
}
static inline void DrvClearOpposites(UINT8* nJoystickInputs)
{
if ((*nJoystickInputs & 0x03) == 0x03) {
*nJoystickInputs &= ~0x03;
}
if ((*nJoystickInputs & 0x0c) == 0x0c) {
*nJoystickInputs &= ~0x0c;
}
}
void DrvCalcPalette()
{
for (INT32 i = 0; i < PALETTE_SIZE; i++)
@ -135,24 +145,22 @@ INT32 SMSFrame()
input.analog[0] = 0x7F;
input.analog[1] = 0x7F;
/* Parse player 1 joystick state */
if(SMSJoy1[3]) input.pad[0] |= INPUT_UP;
else
if(SMSJoy1[4]) input.pad[0] |= INPUT_DOWN;
if(SMSJoy1[5]) input.pad[0] |= INPUT_LEFT;
else
if(SMSJoy1[6]) input.pad[0] |= INPUT_RIGHT;
if(SMSJoy1[7]) input.pad[0] |= INPUT_BUTTON2;
/* Parse player 1 joystick state */
if(SMSJoy1[3]) input.pad[0] |= INPUT_UP;
if(SMSJoy1[4]) input.pad[0] |= INPUT_DOWN;
if(SMSJoy1[5]) input.pad[0] |= INPUT_LEFT;
if(SMSJoy1[6]) input.pad[0] |= INPUT_RIGHT;
if(SMSJoy1[7]) input.pad[0] |= INPUT_BUTTON2;
if(SMSJoy1[8]) input.pad[0] |= INPUT_BUTTON1;
DrvClearOpposites(&input.pad[0]);
// Player 2
if(SMSJoy2[3]) input.pad[1] |= INPUT_UP;
else
if(SMSJoy2[4]) input.pad[1] |= INPUT_DOWN;
if(SMSJoy2[5]) input.pad[1] |= INPUT_LEFT;
else
if(SMSJoy2[6]) input.pad[1] |= INPUT_RIGHT;
if(SMSJoy2[7]) input.pad[1] |= INPUT_BUTTON2;
if(SMSJoy2[4]) input.pad[1] |= INPUT_DOWN;
if(SMSJoy2[5]) input.pad[1] |= INPUT_LEFT;
if(SMSJoy2[6]) input.pad[1] |= INPUT_RIGHT;
if(SMSJoy2[7]) input.pad[1] |= INPUT_BUTTON2;
if(SMSJoy2[8]) input.pad[1] |= INPUT_BUTTON1;
DrvClearOpposites(&input.pad[1]);
if(SMSJoy1[1]) input.system |= (IS_GG) ? INPUT_START : INPUT_PAUSE;
gg_overscanmode = (SMSDips[0] & 0x08);
@ -179,8 +187,6 @@ void system_manage_sram(UINT8 */*sram*/, INT32 /*slot*/, INT32 /*mode*/)
// Notes:
// Back to the Future II - bottom of the screen is corrupt, playable
// Street Fighter II - reboots @ game start
// The Best Game Collection - don't work
// Janggun ui Adeul (Kor) - needs decryption in the mapper
// GG:
// Surf ninjas - weird graphics at boot, playable

View File

@ -12,9 +12,9 @@ sms_t sms;
UINT8 data_bus_pullup = 0x00;
UINT8 data_bus_pulldown = 0x00;
UINT8 dummy_write[0xffff];
static UINT8 dummy_write[0xffff];
UINT8 *korean8kmap8000_9fff, *korean8kmapa000_bfff, *korean8kmap4000_5fff, *korean8kmap6000_7fff;
static UINT8 *korean8kmap8000_9fff, *korean8kmapa000_bfff, *korean8kmap4000_5fff, *korean8kmap6000_7fff;
void __fastcall writemem_mapper_sega(UINT16 offset, UINT8 data)
{

View File

@ -32,7 +32,7 @@ enum {
/* User input structure */
typedef struct
{
UINT32 pad[2];
UINT8 pad[2];
UINT8 analog[2];
UINT32 system;
} input_t;