[Core/Input] fixed Master Tap adapter & XE-1AP device naming in sourcecode

This commit is contained in:
EkeEke 2014-08-09 18:59:14 +02:00
parent c85990f53b
commit f3d4cf51d2
13 changed files with 76 additions and 76 deletions

View File

@ -197,7 +197,7 @@ LIBRETRO_SRC := $(GENPLUS_SRC_DIR)/genesis.c \
$(GENPLUS_SRC_DIR)/input_hw/paddle.c \ $(GENPLUS_SRC_DIR)/input_hw/paddle.c \
$(GENPLUS_SRC_DIR)/input_hw/sportspad.c \ $(GENPLUS_SRC_DIR)/input_hw/sportspad.c \
$(GENPLUS_SRC_DIR)/input_hw/teamplayer.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)/input_hw/terebi_oekaki.c \
$(GENPLUS_SRC_DIR)/cd_hw/cd_cart.c \ $(GENPLUS_SRC_DIR)/cd_hw/cd_cart.c \
$(GENPLUS_SRC_DIR)/cd_hw/cdc.c \ $(GENPLUS_SRC_DIR)/cd_hw/cdc.c \

View File

@ -254,7 +254,7 @@ static const rominfo_t game_list[] =
{0xE42E4998, 0, 0, SYSTEM_SPORTSPAD, MAPPER_SEGA, SYSTEM_SMS2, REGION_USA}, /* Sports Pad Football */ {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 */ {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) */ {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) */ {0x143AB50B, 0, 0, SYSTEM_MASTERTAP, MAPPER_NONE, SYSTEM_SMS2, REGION_USA}, /* BOom (v1.1) */

View File

@ -1,7 +1,7 @@
/*************************************************************************************** /***************************************************************************************
* Genesis Plus * Genesis Plus
* 2-Buttons, 3-Buttons & 6-Buttons controller support * 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) * Copyright (C) 2007-2014 Eke-Eke (Genesis Plus GX)
* *
@ -66,7 +66,7 @@ void gamepad_reset(int port)
/* reset 4-WayPlay latch */ /* reset 4-WayPlay latch */
latch = 0; latch = 0;
/* reset Master System multitap flip-flop */ /* reset Master Tap flip-flop */
flipflop[port>>2].Latch = 0; flipflop[port>>2].Latch = 0;
flipflop[port>>2].Counter = 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 */ /* cf. http://www.smspower.org/uploads/Homebrew/BOoM-SMS-sms4p_2.png */
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
unsigned char mastertap_1_read(void) unsigned char mastertap_1_read(void)

View File

@ -1,7 +1,7 @@
/*************************************************************************************** /***************************************************************************************
* Genesis Plus * Genesis Plus
* 2-Buttons, 3-Buttons & 6-Buttons controller support * 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) * Copyright (C) 2007-2014 Eke-Eke (Genesis Plus GX)
* *

View File

@ -42,7 +42,7 @@
#include "lightgun.h" #include "lightgun.h"
#include "mouse.h" #include "mouse.h"
#include "activator.h" #include "activator.h"
#include "xe_a1p.h" #include "xe_1ap.h"
#include "teamplayer.h" #include "teamplayer.h"
#include "paddle.h" #include "paddle.h"
#include "sportspad.h" #include "sportspad.h"
@ -120,9 +120,9 @@ void input_init(void)
break; break;
} }
case SYSTEM_XE_A1P: case SYSTEM_XE_1AP:
{ {
input.dev[0] = DEVICE_XE_A1P; input.dev[0] = DEVICE_XE_1AP;
player++; player++;
break; break;
} }
@ -240,9 +240,9 @@ void input_init(void)
break; break;
} }
case SYSTEM_XE_A1P: case SYSTEM_XE_1AP:
{ {
input.dev[4] = DEVICE_XE_A1P; input.dev[4] = DEVICE_XE_1AP;
player++; player++;
break; break;
} }
@ -381,9 +381,9 @@ void input_reset(void)
break; break;
} }
case DEVICE_XE_A1P: case DEVICE_XE_1AP:
{ {
xe_a1p_reset(i); xe_1ap_reset(i);
break; break;
} }

View File

@ -46,15 +46,15 @@
/* Ports configuration */ /* Ports configuration */
#define NO_SYSTEM (0) /* unconnected port*/ #define NO_SYSTEM (0) /* unconnected port*/
#define SYSTEM_GAMEPAD (1) /* 2-buttons, 3-buttons or 6-buttons Control Pad */ #define SYSTEM_GAMEPAD (1) /* 2-buttons, 3-buttons or 6-buttons Control Pad */
#define SYSTEM_MOUSE (2) /* Sega Mouse */ #define SYSTEM_MOUSE (2) /* Sega Mouse (only supported in either port A or port B) */
#define SYSTEM_MENACER (3) /* Sega Menacer (port B only) */ #define SYSTEM_MENACER (3) /* Sega Menacer (only supported in port B) */
#define SYSTEM_JUSTIFIER (4) /* Konami Justifiers (port B only) */ #define SYSTEM_JUSTIFIER (4) /* Konami Justifiers (only supported in port B) */
#define SYSTEM_XE_A1P (5) /* XE-A1P analog controller (port A only) */ #define SYSTEM_XE_1AP (5) /* XE-1AP analog controller */
#define SYSTEM_ACTIVATOR (6) /* Sega Activator */ #define SYSTEM_ACTIVATOR (6) /* Sega Activator */
#define SYSTEM_LIGHTPHASER (7) /* Sega Light Phaser (Master System) */ #define SYSTEM_LIGHTPHASER (7) /* Sega Light Phaser */
#define SYSTEM_PADDLE (8) /* Sega Paddle Control (Master System) */ #define SYSTEM_PADDLE (8) /* Sega Paddle Control */
#define SYSTEM_SPORTSPAD (9) /* Sega Sports Pad (Master System) */ #define SYSTEM_SPORTSPAD (9) /* Sega Sports Pad */
#define SYSTEM_MASTERTAP (10) /* Multi Tap -- Master System homemade */ #define SYSTEM_MASTERTAP (10) /* Multi Tap -- Furrtek's Master Tap (unofficial) */
#define SYSTEM_TEAMPLAYER (11) /* Multi Tap -- Sega TeamPlayer */ #define SYSTEM_TEAMPLAYER (11) /* Multi Tap -- Sega TeamPlayer */
#define SYSTEM_WAYPLAY (12) /* Multi Tap -- EA 4-Way Play (use both ports) */ #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_SPORTSPAD (0x06) /* Sega Sports Pad */
#define DEVICE_PICO (0x07) /* PICO tablet */ #define DEVICE_PICO (0x07) /* PICO tablet */
#define DEVICE_TEREBI (0x08) /* Terebi Oekaki 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 */ #define DEVICE_ACTIVATOR (0x0a) /* Activator */
/* Default Input bitmasks */ /* Default Input bitmasks */

View File

@ -1,8 +1,8 @@
/*************************************************************************************** /***************************************************************************************
* Genesis Plus * 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 * 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:
@ -43,20 +43,20 @@ static struct
uint8 State; uint8 State;
uint8 Counter; uint8 Counter;
uint8 Latency; 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][0] = 128;
input.analog[index][1] = 128; input.analog[index][1] = 128;
input.analog[index+1][0] = 128; input.analog[index+1][0] = 128;
index >>= 2; index >>= 2;
xe_a1p[index].State = 0x40; xe_1ap[index].State = 0x40;
xe_a1p[index].Counter = 0; xe_1ap[index].Counter = 0;
xe_a1p[index].Latency = 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 temp = 0x40;
unsigned int port = index << 2; unsigned int port = index << 2;
@ -72,12 +72,12 @@ INLINE unsigned char xe_a1p_read(int index)
uint16 pad = ~input.pad[port]; uint16 pad = ~input.pad[port];
/* Current internal cycle (0-7) */ /* 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 */ /* Current 4-bit data cycle */
/* There are eight internal data cycle for each 5 acquisition sequence */ /* 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 */ /* 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: case 0:
temp |= ((pad >> 8) & 0x0F); /* E1 E2 Start Select */ temp |= ((pad >> 8) & 0x0F); /* E1 E2 Start Select */
@ -121,62 +121,62 @@ INLINE unsigned char xe_a1p_read(int index)
cycle = (cycle + 1) & 7; cycle = (cycle + 1) & 7;
/* Update internal cycle counter */ /* 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 */ /* Update internal latency on each read */
xe_a1p[index].Latency++; xe_1ap[index].Latency++;
return temp; 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 */ /* 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 */ /* 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 */ /* reset acquisition cycle */
xe_a1p[index].Latency = xe_a1p[index].Counter = 0; xe_1ap[index].Latency = xe_1ap[index].Counter = 0;
} }
else else
{ {
/* some games immediately write new data to TH */ /* some games immediately write new data to TH */
/* so we make sure first sequence has actually been handled */ /* 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 */ /* 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 */ /* 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 */ /* 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);
} }

View File

@ -1,8 +1,8 @@
/*************************************************************************************** /***************************************************************************************
* Genesis Plus * 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 * 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:
@ -36,14 +36,14 @@
* *
****************************************************************************************/ ****************************************************************************************/
#ifndef _XE_A1PH_ #ifndef _XE_1APH_
#define _XE_A1PH_ #define _XE_1APH_
/* Function prototypes */ /* Function prototypes */
extern void xe_a1p_reset(int index); extern void xe_1ap_reset(int index);
extern unsigned char xe_a1p_1_read(void); extern unsigned char xe_1ap_1_read(void);
extern unsigned char xe_a1p_2_read(void); extern unsigned char xe_1ap_2_read(void);
extern void xe_a1p_1_write(unsigned char data, unsigned char mask); extern void xe_1ap_1_write(unsigned char data, unsigned char mask);
extern void xe_a1p_2_write(unsigned char data, unsigned char mask); extern void xe_1ap_2_write(unsigned char data, unsigned char mask);
#endif #endif

View File

@ -44,7 +44,7 @@
#include "lightgun.h" #include "lightgun.h"
#include "mouse.h" #include "mouse.h"
#include "activator.h" #include "activator.h"
#include "xe_a1p.h" #include "xe_1ap.h"
#include "teamplayer.h" #include "teamplayer.h"
#include "paddle.h" #include "paddle.h"
#include "sportspad.h" #include "sportspad.h"
@ -101,10 +101,10 @@ void io_init(void)
break; break;
} }
case SYSTEM_XE_A1P: case SYSTEM_XE_1AP:
{ {
port[0].data_w = xe_a1p_1_write; port[0].data_w = xe_1ap_1_write;
port[0].data_r = xe_a1p_1_read; port[0].data_r = xe_1ap_1_read;
break; break;
} }
@ -174,10 +174,10 @@ void io_init(void)
break; break;
} }
case SYSTEM_XE_A1P: case SYSTEM_XE_1AP:
{ {
port[1].data_w = xe_a1p_2_write; port[1].data_w = xe_1ap_2_write;
port[1].data_r = xe_a1p_2_read; port[1].data_r = xe_1ap_2_read;
break; break;
} }

View File

@ -101,7 +101,7 @@ extern const u8 Ctrl_gamepad_png[];
extern const u8 Ctrl_justifiers_png[]; extern const u8 Ctrl_justifiers_png[];
extern const u8 Ctrl_menacer_png[]; extern const u8 Ctrl_menacer_png[];
extern const u8 Ctrl_mouse_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_activator_png[];
extern const u8 Ctrl_lightphaser_png[]; extern const u8 Ctrl_lightphaser_png[];
extern const u8 Ctrl_paddle_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_mouse_png ,"","Select Port 1 device", 97,113,64,88},
{NULL,Ctrl_menacer_png ,"","Select Port 1 device", 94,113,80,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_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_activator_png ,"","Select Port 1 device", 94,121,72,80},
{NULL,Ctrl_lightphaser_png,"","Select Port 1 device", 89,109,88,92}, {NULL,Ctrl_lightphaser_png,"","Select Port 1 device", 89,109,88,92},
{NULL,Ctrl_paddle_png ,"","Select Port 1 device", 86,117,96,84}, {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_mouse_png ,"","Select Port 2 device", 97,283,64,88},
{NULL,Ctrl_menacer_png ,"","Select Port 2 device", 94,283,80,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_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_activator_png ,"","Select Port 2 device", 94,291,72,80},
{NULL,Ctrl_lightphaser_png,"","Select Port 2 device", 89,279,88,92}, {NULL,Ctrl_lightphaser_png,"","Select Port 2 device", 89,279,88,92},
{NULL,Ctrl_paddle_png ,"","Select Port 2 device", 86,287,96,84}, {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); GUI_DrawMenuFX(m, 20, 0);
/* some devices require analog sticks */ /* 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 !"); GUI_WaitPrompt("Warning","One Analog Stick required !");
} }

View File

@ -234,7 +234,7 @@ static void pad_update(s8 chan, u8 i)
} }
/* Default menu key (right analog stick if not needed by emulated device) */ /* 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; ConfigRequested = 1;
return; return;
@ -274,7 +274,7 @@ static void pad_update(s8 chan, u8 i)
break; break;
} }
case DEVICE_XE_A1P: case DEVICE_XE_1AP:
{ {
/* Left Stick analog position [0-255] */ /* Left Stick analog position [0-255] */
input.analog[i][0] = (x + 128); input.analog[i][0] = (x + 128);
@ -747,7 +747,7 @@ static void wpad_update(s8 chan, u8 i, u32 exp)
break; break;
} }
case DEVICE_XE_A1P: case DEVICE_XE_1AP:
{ {
/* Left Stick analog position [0-255] */ /* Left Stick analog position [0-255] */
input.analog[i][0] = (x + 128); input.analog[i][0] = (x + 128);
@ -1324,7 +1324,7 @@ void gx_input_Config(u8 chan, u8 device, u8 type)
break; break;
} }
case DEVICE_XE_A1P: case DEVICE_XE_1AP:
{ {
first_key = KEY_BUTTONA; first_key = KEY_BUTTONA;
last_key = KEY_MODE; last_key = KEY_MODE;

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -575,7 +575,7 @@ int sdl_input_update(void)
break; 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 */ /* 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; if(keystate[SDLK_a]) input.pad[joynum] |= INPUT_START;