mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-28 12:11:50 +01:00
fixed input controllers not being properly changed after hard reset
This commit is contained in:
parent
ecb5f0617b
commit
ee50adf375
@ -285,6 +285,83 @@ void cart_hw_init()
|
||||
m68k_memory_map[0x3a].read16 = svp_read_cell_2;
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
SPECIAL PERIPHERALS
|
||||
***********************************************/
|
||||
|
||||
/* restore previous settings */
|
||||
if (old_system[0] != -1)
|
||||
input.system[0] = old_system[0];
|
||||
if (old_system[1] != -1)
|
||||
input.system[1] = old_system[1];
|
||||
|
||||
/* initialize default GUN settings */
|
||||
input.x_offset = 0x00;
|
||||
input.y_offset = 0x00;
|
||||
|
||||
/**********************************************
|
||||
SEGA MENACER
|
||||
***********************************************/
|
||||
if (strstr(rominfo.international,"MENACER") != NULL)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
input.system[0] = NO_SYSTEM;
|
||||
input.system[1] = SYSTEM_MENACER;
|
||||
input.x_offset = 0x52;
|
||||
input.y_offset = 0x00;
|
||||
}
|
||||
else if (strstr(rominfo.international,"T2 ; THE ARCADE GAME") != NULL)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
input.system[0] = SYSTEM_GAMEPAD;
|
||||
input.system[1] = SYSTEM_MENACER;
|
||||
input.x_offset = 0x84;
|
||||
input.y_offset = 0x08;
|
||||
}
|
||||
else if (strstr(rominfo.international,"BODY COUNT") != NULL)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
input.system[0] = SYSTEM_MOUSE;
|
||||
input.system[1] = SYSTEM_MENACER;
|
||||
input.x_offset = 0x44;
|
||||
input.y_offset = 0x18;
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
KONAMI JUSTIFIER
|
||||
***********************************************/
|
||||
else if (strstr(rominfo.international,"LETHAL ENFORCERSII") != NULL)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
input.system[0] = SYSTEM_GAMEPAD;
|
||||
input.system[1] = SYSTEM_JUSTIFIER;
|
||||
input.x_offset = 0x18;
|
||||
input.y_offset = 0x00;
|
||||
}
|
||||
else if (strstr(rominfo.international,"LETHAL ENFORCERS") != NULL)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
input.system[0] = SYSTEM_GAMEPAD;
|
||||
input.system[1] = SYSTEM_JUSTIFIER;
|
||||
input.x_offset = 0x00;
|
||||
input.y_offset = 0x00;
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
J-CART
|
||||
***********************************************/
|
||||
@ -305,6 +382,14 @@ void cart_hw_init()
|
||||
m68k_memory_map[0x38].write16 = jcart_write;
|
||||
m68k_memory_map[0x3f].read16 = jcart_read;
|
||||
m68k_memory_map[0x3f].write16 = jcart_write;
|
||||
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
/* set default settings */
|
||||
input.system[0] = SYSTEM_GAMEPAD;
|
||||
input.system[1] = SYSTEM_GAMEPAD;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,97 +39,7 @@ static struct port_t
|
||||
*****************************************************************************/
|
||||
void io_init(void)
|
||||
{
|
||||
/* set region according to ROM header */
|
||||
set_region();
|
||||
|
||||
/* restore previous setting */
|
||||
if (old_system[0] != -1) input.system[0] = old_system[0];
|
||||
if (old_system[1] != -1) input.system[1] = old_system[1];
|
||||
|
||||
/* initialize default GUN settings */
|
||||
input.x_offset = 0x00;
|
||||
input.y_offset = 0x00;
|
||||
|
||||
/**********************************************
|
||||
SEGA MENACER
|
||||
***********************************************/
|
||||
if (strstr(rominfo.international,"MENACER") != NULL)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
input.system[0] = NO_SYSTEM;
|
||||
input.system[1] = SYSTEM_MENACER;
|
||||
input.x_offset = 0x52;
|
||||
input.y_offset = 0x00;
|
||||
}
|
||||
else if (strstr(rominfo.international,"T2 ; THE ARCADE GAME") != NULL)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
input.system[0] = SYSTEM_GAMEPAD;
|
||||
input.system[1] = SYSTEM_MENACER;
|
||||
input.x_offset = 0x84;
|
||||
input.y_offset = 0x08;
|
||||
}
|
||||
else if (strstr(rominfo.international,"BODY COUNT") != NULL)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
input.system[0] = SYSTEM_MOUSE;
|
||||
input.system[1] = SYSTEM_MENACER;
|
||||
input.x_offset = 0x44;
|
||||
input.y_offset = 0x18;
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
KONAMI JUSTIFIER
|
||||
***********************************************/
|
||||
else if (strstr(rominfo.international,"LETHAL ENFORCERSII") != NULL)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
input.system[0] = SYSTEM_GAMEPAD;
|
||||
input.system[1] = SYSTEM_JUSTIFIER;
|
||||
input.x_offset = 0x18;
|
||||
input.y_offset = 0x00;
|
||||
}
|
||||
else if (strstr(rominfo.international,"LETHAL ENFORCERS") != NULL)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
input.system[0] = SYSTEM_GAMEPAD;
|
||||
input.system[1] = SYSTEM_JUSTIFIER;
|
||||
input.x_offset = 0x00;
|
||||
input.y_offset = 0x00;
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
J-CART
|
||||
***********************************************/
|
||||
if (cart.hw.jcart)
|
||||
{
|
||||
/* save current setting */
|
||||
if (old_system[0] == -1) old_system[0] = input.system[0];
|
||||
if (old_system[1] == -1) old_system[1] = input.system[1];
|
||||
|
||||
/* set default settings */
|
||||
input.system[0] = SYSTEM_GAMEPAD;
|
||||
input.system[1] = SYSTEM_GAMEPAD;
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
Initialize IO Port handlers
|
||||
***********************************************/
|
||||
/* Initialize IO Ports handlers */
|
||||
switch (input.system[0])
|
||||
{
|
||||
case SYSTEM_GAMEPAD:
|
||||
@ -200,7 +110,7 @@ void io_init(void)
|
||||
port[2].data_w = NULL;
|
||||
port[2].data_r = NULL;
|
||||
|
||||
/* Initialize Input Devices */
|
||||
/* Initialize connected input devices */
|
||||
input_init();
|
||||
}
|
||||
|
||||
@ -221,7 +131,7 @@ void io_reset(void)
|
||||
/* Reset I/O registers */
|
||||
memcpy (io_reg, io_def, 0x10);
|
||||
|
||||
/* Reset Input Devices */
|
||||
/* Reset connected input devices */
|
||||
input_reset();
|
||||
}
|
||||
|
||||
|
@ -291,6 +291,9 @@ int load_rom(char *filename)
|
||||
/* get infos from ROM header */
|
||||
getrominfo((char *)cart.rom);
|
||||
|
||||
/* set system region */
|
||||
set_region();
|
||||
|
||||
#ifdef LSB_FIRST
|
||||
/* Byteswap ROM */
|
||||
uint8 temp;
|
||||
@ -316,9 +319,12 @@ int load_rom(char *filename)
|
||||
}
|
||||
|
||||
/* console hardware */
|
||||
if (strstr(rominfo.consoletype, "SEGA PICO") != NULL) system_hw = SYSTEM_PICO;
|
||||
else if (strstr(rominfo.consoletype, "SEGA MEGADRIVE") != NULL) system_hw = SYSTEM_MEGADRIVE;
|
||||
else system_hw = SYSTEM_GENESIS;
|
||||
if (strstr(rominfo.consoletype, "SEGA PICO") != NULL)
|
||||
system_hw = SYSTEM_PICO;
|
||||
else if (strstr(rominfo.consoletype, "SEGA MEGADRIVE") != NULL)
|
||||
system_hw = SYSTEM_MEGADRIVE;
|
||||
else
|
||||
system_hw = SYSTEM_GENESIS;
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user