mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-11-14 06:45:09 +01:00
[Core/Input] fixed Master Tap adapter & XE-1AP device naming in sourcecode
This commit is contained in:
parent
c85990f53b
commit
f3d4cf51d2
@ -197,7 +197,7 @@ LIBRETRO_SRC := $(GENPLUS_SRC_DIR)/genesis.c \
|
||||
$(GENPLUS_SRC_DIR)/input_hw/paddle.c \
|
||||
$(GENPLUS_SRC_DIR)/input_hw/sportspad.c \
|
||||
$(GENPLUS_SRC_DIR)/input_hw/teamplayer.c \
|
||||
$(GENPLUS_SRC_DIR)/input_hw/xe_a1p.c \
|
||||
$(GENPLUS_SRC_DIR)/input_hw/xe_1ap.c \
|
||||
$(GENPLUS_SRC_DIR)/input_hw/terebi_oekaki.c \
|
||||
$(GENPLUS_SRC_DIR)/cd_hw/cd_cart.c \
|
||||
$(GENPLUS_SRC_DIR)/cd_hw/cdc.c \
|
||||
|
@ -254,7 +254,7 @@ static const rominfo_t game_list[] =
|
||||
{0xE42E4998, 0, 0, SYSTEM_SPORTSPAD, MAPPER_SEGA, SYSTEM_SMS2, REGION_USA}, /* Sports Pad Football */
|
||||
{0x41C948BF, 0, 0, SYSTEM_SPORTSPAD, MAPPER_SEGA, SYSTEM_SMS2, REGION_USA}, /* Sports Pad Soccer */
|
||||
|
||||
/* games requiring homemade multitap */
|
||||
/* games requiring Furrtek's Master Tap */
|
||||
{0xFAB6F52F, 0, 0, SYSTEM_MASTERTAP, MAPPER_NONE, SYSTEM_SMS2, REGION_USA}, /* BOom (v1.0) */
|
||||
{0x143AB50B, 0, 0, SYSTEM_MASTERTAP, MAPPER_NONE, SYSTEM_SMS2, REGION_USA}, /* BOom (v1.1) */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/***************************************************************************************
|
||||
* Genesis Plus
|
||||
* 2-Buttons, 3-Buttons & 6-Buttons controller support
|
||||
* Additional support for J-Cart, 4-Way Play & homemade Master System multitap
|
||||
* Additional support for J-Cart, 4-Way Play & Master Tap adapters
|
||||
*
|
||||
* Copyright (C) 2007-2014 Eke-Eke (Genesis Plus GX)
|
||||
*
|
||||
@ -66,7 +66,7 @@ void gamepad_reset(int port)
|
||||
/* reset 4-WayPlay latch */
|
||||
latch = 0;
|
||||
|
||||
/* reset Master System multitap flip-flop */
|
||||
/* reset Master Tap flip-flop */
|
||||
flipflop[port>>2].Latch = 0;
|
||||
flipflop[port>>2].Counter = 0;
|
||||
}
|
||||
@ -250,7 +250,7 @@ void jcart_write(unsigned int address, unsigned int data)
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/* Master System multitap ports handler (original design by Furrtek) */
|
||||
/* Master Tap ports handler (unofficial, designed by Furrtek) */
|
||||
/* cf. http://www.smspower.org/uploads/Homebrew/BOoM-SMS-sms4p_2.png */
|
||||
/*--------------------------------------------------------------------------*/
|
||||
unsigned char mastertap_1_read(void)
|
||||
|
@ -1,7 +1,7 @@
|
||||
/***************************************************************************************
|
||||
* Genesis Plus
|
||||
* 2-Buttons, 3-Buttons & 6-Buttons controller support
|
||||
* Additional support for J-Cart, 4-Way Play & homemade Master System multitap
|
||||
* Additional support for J-Cart, 4-Way Play & Master Tap adapters
|
||||
*
|
||||
* Copyright (C) 2007-2014 Eke-Eke (Genesis Plus GX)
|
||||
*
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include "lightgun.h"
|
||||
#include "mouse.h"
|
||||
#include "activator.h"
|
||||
#include "xe_a1p.h"
|
||||
#include "xe_1ap.h"
|
||||
#include "teamplayer.h"
|
||||
#include "paddle.h"
|
||||
#include "sportspad.h"
|
||||
@ -120,9 +120,9 @@ void input_init(void)
|
||||
break;
|
||||
}
|
||||
|
||||
case SYSTEM_XE_A1P:
|
||||
case SYSTEM_XE_1AP:
|
||||
{
|
||||
input.dev[0] = DEVICE_XE_A1P;
|
||||
input.dev[0] = DEVICE_XE_1AP;
|
||||
player++;
|
||||
break;
|
||||
}
|
||||
@ -240,9 +240,9 @@ void input_init(void)
|
||||
break;
|
||||
}
|
||||
|
||||
case SYSTEM_XE_A1P:
|
||||
case SYSTEM_XE_1AP:
|
||||
{
|
||||
input.dev[4] = DEVICE_XE_A1P;
|
||||
input.dev[4] = DEVICE_XE_1AP;
|
||||
player++;
|
||||
break;
|
||||
}
|
||||
@ -381,9 +381,9 @@ void input_reset(void)
|
||||
break;
|
||||
}
|
||||
|
||||
case DEVICE_XE_A1P:
|
||||
case DEVICE_XE_1AP:
|
||||
{
|
||||
xe_a1p_reset(i);
|
||||
xe_1ap_reset(i);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -46,15 +46,15 @@
|
||||
/* Ports configuration */
|
||||
#define NO_SYSTEM (0) /* unconnected port*/
|
||||
#define SYSTEM_GAMEPAD (1) /* 2-buttons, 3-buttons or 6-buttons Control Pad */
|
||||
#define SYSTEM_MOUSE (2) /* Sega Mouse */
|
||||
#define SYSTEM_MENACER (3) /* Sega Menacer (port B only) */
|
||||
#define SYSTEM_JUSTIFIER (4) /* Konami Justifiers (port B only) */
|
||||
#define SYSTEM_XE_A1P (5) /* XE-A1P analog controller (port A only) */
|
||||
#define SYSTEM_MOUSE (2) /* Sega Mouse (only supported in either port A or port B) */
|
||||
#define SYSTEM_MENACER (3) /* Sega Menacer (only supported in port B) */
|
||||
#define SYSTEM_JUSTIFIER (4) /* Konami Justifiers (only supported in port B) */
|
||||
#define SYSTEM_XE_1AP (5) /* XE-1AP analog controller */
|
||||
#define SYSTEM_ACTIVATOR (6) /* Sega Activator */
|
||||
#define SYSTEM_LIGHTPHASER (7) /* Sega Light Phaser (Master System) */
|
||||
#define SYSTEM_PADDLE (8) /* Sega Paddle Control (Master System) */
|
||||
#define SYSTEM_SPORTSPAD (9) /* Sega Sports Pad (Master System) */
|
||||
#define SYSTEM_MASTERTAP (10) /* Multi Tap -- Master System homemade */
|
||||
#define SYSTEM_LIGHTPHASER (7) /* Sega Light Phaser */
|
||||
#define SYSTEM_PADDLE (8) /* Sega Paddle Control */
|
||||
#define SYSTEM_SPORTSPAD (9) /* Sega Sports Pad */
|
||||
#define SYSTEM_MASTERTAP (10) /* Multi Tap -- Furrtek's Master Tap (unofficial) */
|
||||
#define SYSTEM_TEAMPLAYER (11) /* Multi Tap -- Sega TeamPlayer */
|
||||
#define SYSTEM_WAYPLAY (12) /* Multi Tap -- EA 4-Way Play (use both ports) */
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
#define DEVICE_SPORTSPAD (0x06) /* Sega Sports Pad */
|
||||
#define DEVICE_PICO (0x07) /* PICO tablet */
|
||||
#define DEVICE_TEREBI (0x08) /* Terebi Oekaki tablet */
|
||||
#define DEVICE_XE_A1P (0x09) /* XE-A1P analog controller */
|
||||
#define DEVICE_XE_1AP (0x09) /* XE-1AP analog controller */
|
||||
#define DEVICE_ACTIVATOR (0x0a) /* Activator */
|
||||
|
||||
/* Default Input bitmasks */
|
||||
|
@ -1,8 +1,8 @@
|
||||
/***************************************************************************************
|
||||
* Genesis Plus
|
||||
* XE-A1P analog controller support
|
||||
* XE-1AP analog controller support
|
||||
*
|
||||
* Copyright (C) 2011-2013 Eke-Eke (Genesis Plus GX)
|
||||
* Copyright (C) 2011-2014 Eke-Eke (Genesis Plus GX)
|
||||
*
|
||||
* Redistribution and use of this code or any derivative works are permitted
|
||||
* provided that the following conditions are met:
|
||||
@ -43,20 +43,20 @@ static struct
|
||||
uint8 State;
|
||||
uint8 Counter;
|
||||
uint8 Latency;
|
||||
} xe_a1p[2];
|
||||
} xe_1ap[2];
|
||||
|
||||
void xe_a1p_reset(int index)
|
||||
void xe_1ap_reset(int index)
|
||||
{
|
||||
input.analog[index][0] = 128;
|
||||
input.analog[index][1] = 128;
|
||||
input.analog[index+1][0] = 128;
|
||||
index >>= 2;
|
||||
xe_a1p[index].State = 0x40;
|
||||
xe_a1p[index].Counter = 0;
|
||||
xe_a1p[index].Latency = 0;
|
||||
xe_1ap[index].State = 0x40;
|
||||
xe_1ap[index].Counter = 0;
|
||||
xe_1ap[index].Latency = 0;
|
||||
}
|
||||
|
||||
INLINE unsigned char xe_a1p_read(int index)
|
||||
INLINE unsigned char xe_1ap_read(int index)
|
||||
{
|
||||
unsigned int temp = 0x40;
|
||||
unsigned int port = index << 2;
|
||||
@ -72,12 +72,12 @@ INLINE unsigned char xe_a1p_read(int index)
|
||||
uint16 pad = ~input.pad[port];
|
||||
|
||||
/* Current internal cycle (0-7) */
|
||||
unsigned int cycle = xe_a1p[index].Counter & 7;
|
||||
unsigned int cycle = xe_1ap[index].Counter & 7;
|
||||
|
||||
/* Current 4-bit data cycle */
|
||||
/* There are eight internal data cycle for each 5 acquisition sequence */
|
||||
/* First 4 return the same 4-bit data, next 4 return next 4-bit data */
|
||||
switch (xe_a1p[index].Counter >> 2)
|
||||
switch (xe_1ap[index].Counter >> 2)
|
||||
{
|
||||
case 0:
|
||||
temp |= ((pad >> 8) & 0x0F); /* E1 E2 Start Select */
|
||||
@ -121,62 +121,62 @@ INLINE unsigned char xe_a1p_read(int index)
|
||||
cycle = (cycle + 1) & 7;
|
||||
|
||||
/* Update internal cycle counter */
|
||||
xe_a1p[index].Counter = (xe_a1p[index].Counter & ~7) | cycle;
|
||||
xe_1ap[index].Counter = (xe_1ap[index].Counter & ~7) | cycle;
|
||||
|
||||
/* Update internal latency on each read */
|
||||
xe_a1p[index].Latency++;
|
||||
xe_1ap[index].Latency++;
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
INLINE void xe_a1p_write(int index, unsigned char data, unsigned char mask)
|
||||
INLINE void xe_1ap_write(int index, unsigned char data, unsigned char mask)
|
||||
{
|
||||
/* update bits set as output only */
|
||||
data = (xe_a1p[index].State & ~mask) | (data & mask);
|
||||
data = (xe_1ap[index].State & ~mask) | (data & mask);
|
||||
|
||||
/* look for TH 1->0 transitions */
|
||||
if (!(data & 0x40) && (xe_a1p[index].State & 0x40))
|
||||
if (!(data & 0x40) && (xe_1ap[index].State & 0x40))
|
||||
{
|
||||
/* reset acquisition cycle */
|
||||
xe_a1p[index].Latency = xe_a1p[index].Counter = 0;
|
||||
xe_1ap[index].Latency = xe_1ap[index].Counter = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* some games immediately write new data to TH */
|
||||
/* so we make sure first sequence has actually been handled */
|
||||
if (xe_a1p[index].Latency > 2)
|
||||
if (xe_1ap[index].Latency > 2)
|
||||
{
|
||||
/* next acquisition sequence */
|
||||
xe_a1p[index].Counter = (xe_a1p[index].Counter & ~7) + 8;
|
||||
xe_1ap[index].Counter = (xe_1ap[index].Counter & ~7) + 8;
|
||||
|
||||
/* 5 sequence max with 8 cycles each */
|
||||
if (xe_a1p[index].Counter > 32)
|
||||
if (xe_1ap[index].Counter > 32)
|
||||
{
|
||||
xe_a1p[index].Counter = 32;
|
||||
xe_1ap[index].Counter = 32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* update internal state */
|
||||
xe_a1p[index].State = data;
|
||||
xe_1ap[index].State = data;
|
||||
}
|
||||
|
||||
unsigned char xe_a1p_1_read(void)
|
||||
unsigned char xe_1ap_1_read(void)
|
||||
{
|
||||
return xe_a1p_read(0);
|
||||
return xe_1ap_read(0);
|
||||
}
|
||||
|
||||
unsigned char xe_a1p_2_read(void)
|
||||
unsigned char xe_1ap_2_read(void)
|
||||
{
|
||||
return xe_a1p_read(1);
|
||||
return xe_1ap_read(1);
|
||||
}
|
||||
|
||||
void xe_a1p_1_write(unsigned char data, unsigned char mask)
|
||||
void xe_1ap_1_write(unsigned char data, unsigned char mask)
|
||||
{
|
||||
xe_a1p_write(0, data, mask);
|
||||
xe_1ap_write(0, data, mask);
|
||||
}
|
||||
|
||||
void xe_a1p_2_write(unsigned char data, unsigned char mask)
|
||||
void xe_1ap_2_write(unsigned char data, unsigned char mask)
|
||||
{
|
||||
xe_a1p_write(1, data, mask);
|
||||
xe_1ap_write(1, data, mask);
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
/***************************************************************************************
|
||||
* Genesis Plus
|
||||
* XE-A1P analog controller support
|
||||
* XE-1AP analog controller support
|
||||
*
|
||||
* Copyright (C) 2011-2013 Eke-Eke (Genesis Plus GX)
|
||||
* Copyright (C) 2011-2014 Eke-Eke (Genesis Plus GX)
|
||||
*
|
||||
* Redistribution and use of this code or any derivative works are permitted
|
||||
* provided that the following conditions are met:
|
||||
@ -36,14 +36,14 @@
|
||||
*
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef _XE_A1PH_
|
||||
#define _XE_A1PH_
|
||||
#ifndef _XE_1APH_
|
||||
#define _XE_1APH_
|
||||
|
||||
/* Function prototypes */
|
||||
extern void xe_a1p_reset(int index);
|
||||
extern unsigned char xe_a1p_1_read(void);
|
||||
extern unsigned char xe_a1p_2_read(void);
|
||||
extern void xe_a1p_1_write(unsigned char data, unsigned char mask);
|
||||
extern void xe_a1p_2_write(unsigned char data, unsigned char mask);
|
||||
extern void xe_1ap_reset(int index);
|
||||
extern unsigned char xe_1ap_1_read(void);
|
||||
extern unsigned char xe_1ap_2_read(void);
|
||||
extern void xe_1ap_1_write(unsigned char data, unsigned char mask);
|
||||
extern void xe_1ap_2_write(unsigned char data, unsigned char mask);
|
||||
|
||||
#endif
|
@ -44,7 +44,7 @@
|
||||
#include "lightgun.h"
|
||||
#include "mouse.h"
|
||||
#include "activator.h"
|
||||
#include "xe_a1p.h"
|
||||
#include "xe_1ap.h"
|
||||
#include "teamplayer.h"
|
||||
#include "paddle.h"
|
||||
#include "sportspad.h"
|
||||
@ -101,10 +101,10 @@ void io_init(void)
|
||||
break;
|
||||
}
|
||||
|
||||
case SYSTEM_XE_A1P:
|
||||
case SYSTEM_XE_1AP:
|
||||
{
|
||||
port[0].data_w = xe_a1p_1_write;
|
||||
port[0].data_r = xe_a1p_1_read;
|
||||
port[0].data_w = xe_1ap_1_write;
|
||||
port[0].data_r = xe_1ap_1_read;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -174,10 +174,10 @@ void io_init(void)
|
||||
break;
|
||||
}
|
||||
|
||||
case SYSTEM_XE_A1P:
|
||||
case SYSTEM_XE_1AP:
|
||||
{
|
||||
port[1].data_w = xe_a1p_2_write;
|
||||
port[1].data_r = xe_a1p_2_read;
|
||||
port[1].data_w = xe_1ap_2_write;
|
||||
port[1].data_r = xe_1ap_2_read;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ extern const u8 Ctrl_gamepad_png[];
|
||||
extern const u8 Ctrl_justifiers_png[];
|
||||
extern const u8 Ctrl_menacer_png[];
|
||||
extern const u8 Ctrl_mouse_png[];
|
||||
extern const u8 Ctrl_xe_a1p_png[];
|
||||
extern const u8 Ctrl_xe_1ap_png[];
|
||||
extern const u8 Ctrl_activator_png[];
|
||||
extern const u8 Ctrl_lightphaser_png[];
|
||||
extern const u8 Ctrl_paddle_png[];
|
||||
@ -2057,7 +2057,7 @@ static void ctrlmenu(void)
|
||||
{NULL,Ctrl_mouse_png ,"","Select Port 1 device", 97,113,64,88},
|
||||
{NULL,Ctrl_menacer_png ,"","Select Port 1 device", 94,113,80,88},
|
||||
{NULL,Ctrl_justifiers_png ,"","Select Port 1 device", 88,117,80,84},
|
||||
{NULL,Ctrl_xe_a1p_png ,"","Select Port 1 device", 98,118,72,84},
|
||||
{NULL,Ctrl_xe_1ap_png ,"","Select Port 1 device", 98,118,72,84},
|
||||
{NULL,Ctrl_activator_png ,"","Select Port 1 device", 94,121,72,80},
|
||||
{NULL,Ctrl_lightphaser_png,"","Select Port 1 device", 89,109,88,92},
|
||||
{NULL,Ctrl_paddle_png ,"","Select Port 1 device", 86,117,96,84},
|
||||
@ -2072,7 +2072,7 @@ static void ctrlmenu(void)
|
||||
{NULL,Ctrl_mouse_png ,"","Select Port 2 device", 97,283,64,88},
|
||||
{NULL,Ctrl_menacer_png ,"","Select Port 2 device", 94,283,80,88},
|
||||
{NULL,Ctrl_justifiers_png ,"","Select Port 2 device", 88,287,80,84},
|
||||
{NULL,Ctrl_xe_a1p_png ,"","Select Port 2 device", 98,288,72,84},
|
||||
{NULL,Ctrl_xe_1ap_png ,"","Select Port 2 device", 98,288,72,84},
|
||||
{NULL,Ctrl_activator_png ,"","Select Port 2 device", 94,291,72,80},
|
||||
{NULL,Ctrl_lightphaser_png,"","Select Port 2 device", 89,279,88,92},
|
||||
{NULL,Ctrl_paddle_png ,"","Select Port 2 device", 86,287,96,84},
|
||||
@ -2502,7 +2502,7 @@ static void ctrlmenu(void)
|
||||
GUI_DrawMenuFX(m, 20, 0);
|
||||
|
||||
/* some devices require analog sticks */
|
||||
if ((input.dev[index] == DEVICE_XE_A1P) && ((config.input[player].device == -1) || (config.input[player].device == 1)))
|
||||
if ((input.dev[index] == DEVICE_XE_1AP) && ((config.input[player].device == -1) || (config.input[player].device == 1)))
|
||||
{
|
||||
GUI_WaitPrompt("Warning","One Analog Stick required !");
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ static void pad_update(s8 chan, u8 i)
|
||||
}
|
||||
|
||||
/* Default menu key (right analog stick if not needed by emulated device) */
|
||||
if ((input.dev[i] < DEVICE_XE_A1P) && (PAD_SubStickX(chan) > ANALOG_SENSITIVITY))
|
||||
if ((input.dev[i] < DEVICE_XE_1AP) && (PAD_SubStickX(chan) > ANALOG_SENSITIVITY))
|
||||
{
|
||||
ConfigRequested = 1;
|
||||
return;
|
||||
@ -274,7 +274,7 @@ static void pad_update(s8 chan, u8 i)
|
||||
break;
|
||||
}
|
||||
|
||||
case DEVICE_XE_A1P:
|
||||
case DEVICE_XE_1AP:
|
||||
{
|
||||
/* Left Stick analog position [0-255] */
|
||||
input.analog[i][0] = (x + 128);
|
||||
@ -747,7 +747,7 @@ static void wpad_update(s8 chan, u8 i, u32 exp)
|
||||
break;
|
||||
}
|
||||
|
||||
case DEVICE_XE_A1P:
|
||||
case DEVICE_XE_1AP:
|
||||
{
|
||||
/* Left Stick analog position [0-255] */
|
||||
input.analog[i][0] = (x + 128);
|
||||
@ -1324,7 +1324,7 @@ void gx_input_Config(u8 chan, u8 device, u8 type)
|
||||
break;
|
||||
}
|
||||
|
||||
case DEVICE_XE_A1P:
|
||||
case DEVICE_XE_1AP:
|
||||
{
|
||||
first_key = KEY_BUTTONA;
|
||||
last_key = KEY_MODE;
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@ -575,7 +575,7 @@ int sdl_input_update(void)
|
||||
break;
|
||||
}
|
||||
|
||||
case DEVICE_XE_A1P:
|
||||
case DEVICE_XE_1AP:
|
||||
{
|
||||
/* A,B,C,D,Select,START,E1,E2 buttons -> E1(?) E2(?) START SELECT(?) A B C D */
|
||||
if(keystate[SDLK_a]) input.pad[joynum] |= INPUT_START;
|
||||
|
Loading…
Reference in New Issue
Block a user