Unverified Commit 3773f823 authored by hizzlekizzle's avatar hizzlekizzle Committed by GitHub
Browse files

Merge pull request #160 from kps501/multicart_merge

backport bsx, multicart, cleanup sync
parents ea68e8e5 e1f8df95
This diff is collapsed.
......@@ -22,10 +22,12 @@
(c) Copyright 2006 - 2007 nitsuja
(c) Copyright 2009 - 2011 BearOso,
(c) Copyright 2009 - 2018 BearOso,
OV2
(c) Copyright 2011 - 2016 Hans-Kristian Arntzen,
(c) Copyright 2017 qwertymodo
(c) Copyright 2011 - 2017 Hans-Kristian Arntzen,
Daniel De Matteis
(Under no circumstances will commercial rights be given)
......@@ -122,6 +124,9 @@
Sound emulator code used in 1.52+
(c) Copyright 2004 - 2007 Shay Green (gblargg@gmail.com)
S-SMP emulator code used in 1.54+
(c) Copyright 2016 byuu
SH assembler code partly based on x86 assembler code
(c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se)
......@@ -135,7 +140,7 @@
(c) Copyright 2006 - 2007 Shay Green
GTK+ GUI code
(c) Copyright 2004 - 2011 BearOso
(c) Copyright 2004 - 2018 BearOso
Win32 GUI code
(c) Copyright 2003 - 2006 blip,
......@@ -143,14 +148,14 @@
Matthew Kendora,
Nach,
nitsuja
(c) Copyright 2009 - 2011 OV2
(c) Copyright 2009 - 2018 OV2
Mac OS GUI code
(c) Copyright 1998 - 2001 John Stiles
(c) Copyright 2001 - 2011 zones
Libretro port
(c) Copyright 2011 - 2016 Hans-Kristian Arntzen,
(c) Copyright 2011 - 2017 Hans-Kristian Arntzen,
Daniel De Matteis
(Under no circumstances will commercial rights be given)
......@@ -188,6 +193,8 @@
#ifndef _BSX_H_
#define _BSX_H_
#include <fstream>
struct SBSX
{
bool8 dirty; // Changed register values
......@@ -205,6 +212,22 @@ struct SBSX
uint8 MMC[16];
uint8 prevMMC[16];
uint8 test2192[32];
bool flash_csr;
bool flash_gsr;
bool flash_bsr;
bool flash_cmd_done;
std::ifstream sat_stream1;
std::ifstream sat_stream2;
bool sat_pf_latch1_enable, sat_dt_latch1_enable;
bool sat_pf_latch2_enable, sat_dt_latch2_enable;
bool sat_stream1_loaded, sat_stream2_loaded;
bool sat_stream1_first, sat_stream2_first;
uint8 sat_stream1_count, sat_stream2_count;
uint16 sat_stream1_queue, sat_stream2_queue;
};
extern struct SBSX BSX;
......
......@@ -199,7 +199,11 @@
#include <string>
#ifdef UNZIP_SUPPORT
#include "unzip/unzip.h"
# ifdef SYSTEM_ZIP
# include <minizip/unzip.h>
# else
# include "unzip/unzip.h"
# endif
#endif
#include "snes9x.h"
......
......@@ -570,6 +570,7 @@ void S9xControlsReset (void)
mouse[0].buttons &= ~0x30;
mouse[1].buttons &= ~0x30;
justifier.buttons &= ~JUSTIFIER_SELECT;
macsrifle.buttons = 0;
}
void S9xControlsSoftReset (void)
......@@ -2284,8 +2285,8 @@ void S9xApplyCommand (s9xcommand_t cmd, int16 data1, int16 data2)
superscope.next_buttons |= i & (SUPERSCOPE_FIRE | SUPERSCOPE_CURSOR | SUPERSCOPE_PAUSE);
if ((superscope.next_buttons & (SUPERSCOPE_FIRE | SUPERSCOPE_CURSOR)) && curcontrollers[1] == SUPERSCOPE && !(superscope.phys_buttons & SUPERSCOPE_OFFSCREEN))
DoGunLatch(superscope.x, superscope.y);
if ((superscope.next_buttons & (SUPERSCOPE_FIRE | SUPERSCOPE_CURSOR)) && curcontrollers[1] == SUPERSCOPE && !(superscope.phys_buttons & SUPERSCOPE_OFFSCREEN))
DoGunLatch(superscope.x, superscope.y);
}
else
{
......@@ -2975,9 +2976,9 @@ void S9xSetJoypadLatch (bool latch)
switch (i = curcontrollers[n])
{
case MP5:
for (int j = 0, k; j < 4; ++j)
{
k = mp5[n].pads[j];
for (int j = 0, k; j < 4; ++j)
{
k = mp5[n].pads[j];
if (k == NONE)
continue;
do_polling(k);
......@@ -2999,7 +3000,7 @@ void S9xSetJoypadLatch (bool latch)
case MOUSE0:
case MOUSE1:
do_polling(i);
UpdatePolledMouse(i);
UpdatePolledMouse(i);
break;
case SUPERSCOPE:
......@@ -3283,9 +3284,9 @@ void S9xControlEOF (void)
switch (i = curcontrollers[n])
{
case MP5:
for (j = 0; j < 4; ++j)
{
i = mp5[n].pads[j];
for (j = 0; j < 4; ++j)
{
i = mp5[n].pads[j];
if (i == NONE)
continue;
......@@ -3701,6 +3702,7 @@ void S9xControlPostLoadState (struct SControlSnapshot *s)
COPY(superscope.next_buttons);
COPY(superscope.read_buttons);
for (int j = 0; j < 2; j++)
COPY(justifier.x[j]);
for (int j = 0; j < 2; j++)
......
......@@ -299,14 +299,12 @@ void S9xReset (void)
memset(Memory.VRAM, 0x00, 0x10000);
memset(Memory.FillRAM, 0, 0x8000);
if (Settings.BS)
S9xResetBSX();
S9xResetBSX();
S9xResetCPU();
S9xResetPPU();
S9xResetDMA();
S9xResetAPU();
S9xResetMSU();
S9xResetMSU();
if (Settings.DSP)
S9xResetDSP();
......
......@@ -206,14 +206,16 @@ enum s9x_getdirtype
SCREENSHOT_DIR,
SPC_DIR,
CHEAT_DIR,
IPS_DIR,
PATCH_DIR,
BIOS_DIR,
LOG_DIR,
SAT_DIR,
LAST_DIR
};
void S9xUsage (void);
char * S9xParseArgs (char **, int);
void S9xParseArgsForCheats (char **, int);
void S9xLoadConfigFiles (char **, int);
void S9xSetInfoString (const char *);
......
......@@ -35,15 +35,19 @@
#define RETRO_MEMORY_SNES_GAME_BOY_RAM ((5 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_GAME_BOY_RTC ((6 << 8) | RETRO_MEMORY_RTC)
#define RETRO_GAME_TYPE_BSX 0x101
#define RETRO_GAME_TYPE_BSX_SLOTTED 0x102
#define RETRO_GAME_TYPE_SUFAMI_TURBO 0x103
#define RETRO_GAME_TYPE_SUPER_GAME_BOY 0x104
#define RETRO_GAME_TYPE_BSX 0x101 | 0x1000
#define RETRO_GAME_TYPE_BSX_SLOTTED 0x102 | 0x1000
#define RETRO_GAME_TYPE_SUFAMI_TURBO 0x103 | 0x1000
#define RETRO_GAME_TYPE_SUPER_GAME_BOY 0x104 | 0x1000
#define RETRO_GAME_TYPE_MULTI_CART 0x105 | 0x1000
#define SNES_4_3 4.0f / 3.0f
char g_rom_dir[1024];
char g_basename[1024];
char retro_system_directory[4096];
char retro_save_directory[4096];
bool hires_blend = false;
bool overclock_cycles = false;
......@@ -108,7 +112,7 @@ void retro_set_audio_sample(retro_audio_sample_t cb)
void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb)
{
audio_batch_cb = cb;
audio_batch_cb = cb;
}
void retro_set_input_poll(retro_input_poll_t cb)
......@@ -121,14 +125,37 @@ void retro_set_input_state(retro_input_state_t cb)
input_state_cb = cb;
}
static retro_environment_t environ_cb;
static unsigned crop_overscan_mode = 0;
static unsigned aspect_ratio_mode = 0;
static bool rom_loaded = false;
void retro_set_environment(retro_environment_t cb)
{
environ_cb = cb;
static const struct retro_subsystem_memory_info multi_a_memory[] = {
{ "srm", RETRO_MEMORY_SNES_SUFAMI_TURBO_A_RAM },
};
static const struct retro_subsystem_memory_info multi_b_memory[] = {
{ "srm", RETRO_MEMORY_SNES_SUFAMI_TURBO_B_RAM },
};
static const struct retro_subsystem_rom_info multicart_roms[] = {
{ "Cart A", "smc|sfc|swc|fig|bs", false, false, false, multi_a_memory, 1 },
{ "Add-On B", "smc|sfc|swc|fig|bs", false, false, false, multi_b_memory, 1 },
};
static const struct retro_subsystem_info subsystems[] = {
{ "Multi-Cart Link", "multicart_addon", multicart_roms, 2, RETRO_GAME_TYPE_MULTI_CART },
{}
};
cb(RETRO_ENVIRONMENT_SET_SUBSYSTEM_INFO, (void*)subsystems);
struct retro_variable variables[] = {
// These variable names and possible values constitute an ABI with ZMZ (ZSNES Libretro player).
// Changing "Show layer 1" is fine, but don't change "layer_1"/etc or the possible values ("Yes|No").
......@@ -159,7 +186,7 @@ void retro_set_environment(retro_environment_t cb)
{ "snes9x_aspect", "Preferred aspect ratio; auto|ntsc|pal|4:3" },
{ "snes9x_macsrifle_adjust_x", "M.A.C.S. Rifle - adjust aim x; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|-25|-24|-23|-22|-21|-20|-19|-18|-17|-16|-15|-14|-13|-12|-11|-10|-9|-8|-7|-6|-5|-4|-3|-2|-1" },
{ "snes9x_macsrifle_adjust_y", "M.A.C.S. Rifle - adjust aim y; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|-25|-24|-23|-22|-21|-20|-19|-18|-17|-16|-15|-14|-13|-12|-11|-10|-9|-8|-7|-6|-5|-4|-3|-2|-1" },
{ NULL, NULL },
{},
};
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
......@@ -184,19 +211,17 @@ void retro_set_environment(retro_environment_t cb)
static const struct retro_controller_info ports[] = {
{ port_1, 4 },
{ port_2, 7 },
{ 0, 0 },
{},
};
environ_cb(RETRO_ENVIRONMENT_SET_CONTROLLER_INFO, (void*)ports);
}
extern void S9xResetSuperFX(void);
void update_geometry(void)
{
struct retro_system_av_info av_info;
retro_get_system_av_info(&av_info);
environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &av_info);
struct retro_system_av_info av_info;
retro_get_system_av_info(&av_info);
environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &av_info);
}
static void update_variables(void)
......@@ -396,7 +421,7 @@ void retro_get_system_info(struct retro_system_info *info)
#define GIT_VERSION ""
#endif
info->library_version = VERSION GIT_VERSION;
info->valid_extensions = "smc|sfc|swc|fig";
info->valid_extensions = "smc|sfc|swc|fig|bs";
info->need_fullpath = false;
info->block_extract = false;
}
......@@ -573,41 +598,41 @@ static unsigned memorydesc_c;
static bool merge_mapping()
{
if (memorydesc_c==1) return false;//can't merge the only one
struct retro_memory_descriptor * a=&memorydesc[MAX_MAPS - (memorydesc_c-1)];
struct retro_memory_descriptor * b=&memorydesc[MAX_MAPS - memorydesc_c];
if (memorydesc_c==1) return false;//can't merge the only one
struct retro_memory_descriptor * a=&memorydesc[MAX_MAPS - (memorydesc_c-1)];
struct retro_memory_descriptor * b=&memorydesc[MAX_MAPS - memorydesc_c];
//printf("test %x/%x\n",a->start,b->start);
if (a->flags != b->flags) return false;
if (a->disconnect != b->disconnect) return false;
if (a->len != b->len) return false;
if (a->addrspace || b->addrspace) return false;//we don't use these
if (((char*)a->ptr)+a->offset==((char*)b->ptr)+b->offset && a->select==b->select)
{
if (a->flags != b->flags) return false;
if (a->disconnect != b->disconnect) return false;
if (a->len != b->len) return false;
if (a->addrspace || b->addrspace) return false;//we don't use these
if (((char*)a->ptr)+a->offset==((char*)b->ptr)+b->offset && a->select==b->select)
{
//printf("merge/mirror\n");
a->select&=~(a->start^b->start);
memorydesc_c--;
return true;
}
uint32 len=a->len;
if (!len) len=(0x1000000 - a->select);
if (len && ((len-1) & (len | a->disconnect))==0 && ((char*)a->ptr)+a->offset+len == ((char*)b->ptr)+b->offset)
{
a->select&=~(a->start^b->start);
memorydesc_c--;
return true;
}
uint32 len=a->len;
if (!len) len=(0x1000000 - a->select);
if (len && ((len-1) & (len | a->disconnect))==0 && ((char*)a->ptr)+a->offset+len == ((char*)b->ptr)+b->offset)
{
//printf("merge/consec\n");
a->select &=~ len;
a->disconnect &=~ len;
memorydesc_c--;
return true;
}
a->select &=~ len;
a->disconnect &=~ len;
memorydesc_c--;
return true;
}
//printf("nomerge\n");
return false;
return false;
}
void S9xAppendMapping(struct retro_memory_descriptor *desc)
{
//do it backwards - snes9x defines the last one to win, while we define the first one to win
//printf("add %x\n",desc->start);
memcpy(&memorydesc[MAX_MAPS - (++memorydesc_c)], desc, sizeof(struct retro_memory_descriptor));
while (merge_mapping()) {}
//do it backwards - snes9x defines the last one to win, while we define the first one to win
//printf("add %x\n",desc->start);
memcpy(&memorydesc[MAX_MAPS - (++memorydesc_c)], desc, sizeof(struct retro_memory_descriptor));
while (merge_mapping()) {}
}
static void init_descriptors(void)
......@@ -686,6 +711,75 @@ static void init_descriptors(void)
static bool ChronoTriggerFrameHack;
static bool valid_normal_bank (uint8 bankbyte)
{
switch (bankbyte)
{
case 32: case 33: case 48: case 49:
return (true);
}
return (false);
}
static int is_bsx (uint8 *p)
{
if ((p[26] == 0x33 || p[26] == 0xFF) && (!p[21] || (p[21] & 131) == 128) && valid_normal_bank(p[24]))
{
unsigned char m = p[22];
if (!m && !p[23])
return (2);
if ((m == 0xFF && p[23] == 0xFF) || (!(m & 0xF) && ((m >> 4) - 1 < 12)))
return (1);
}
return (0);
}
static bool8 LoadBIOS(uint8 *biosrom, const char *biosname, size_t biossize)
{
FILE *fp;
char name[PATH_MAX + 1];
bool8 r = FALSE;
strcpy(name, S9xGetDirectory(ROMFILENAME_DIR));
strcat(name, SLASH_STR);
strcat(name, biosname);
fp = fopen(name, "rb");
if (!fp)
{
strcpy(name, S9xGetDirectory(BIOS_DIR));
strcat(name, SLASH_STR);
strcat(name, biosname);
fp = fopen(name, "rb");
}
if (fp)
{
size_t size;
size = fread((void *) biosrom, 1, biossize, fp);
fclose(fp);
if (size == biossize)
r = TRUE;
}
return (r);
}
static bool8 is_SufamiTurbo_Cart (const uint8 *data, size_t size)
{
if (size >= 0x80000 && size <= 0x100000 &&
strncmp((char *) data, "BANDAI SFC-ADX", 14) == 0 && strncmp((char * ) (data + 0x10), "SFC-ADX BACKUP", 14) != 0)
return (TRUE);
else
return (FALSE);
}
bool retro_load_game(const struct retro_game_info *game)
{
init_descriptors();
......@@ -697,13 +791,29 @@ bool retro_load_game(const struct retro_game_info *game)
rom_loaded = Memory.LoadROM(game->path);
else
{
uint8 *biosrom = new uint8[0x100000];
if (game->path != NULL)
{
extract_basename(g_basename, game->path, sizeof(g_basename));
extract_basename(g_basename, game->path, sizeof(g_basename));
extract_directory(g_rom_dir, game->path, sizeof(g_rom_dir));
}
rom_loaded = Memory.LoadROMMem((const uint8_t*)game->data ,game->size);
if (is_SufamiTurbo_Cart((uint8 *) game->data, game->size)) {
if ((rom_loaded = LoadBIOS(biosrom,"STBIOS.bin",0x40000)))
rom_loaded = Memory.LoadMultiCartMem((const uint8_t*)game->data, game->size, 0, 0, biosrom, 0x40000);
}
else
if ((is_bsx((uint8 *) game->data + 0x7fc0)==1) | (is_bsx((uint8 *) game->data + 0xffc0)==1)) {
if ((rom_loaded = LoadBIOS(biosrom,"BS-X.bin",0x100000)))
rom_loaded = Memory.LoadMultiCartMem(biosrom, 0x100000, (const uint8_t*)game->data, game->size, 0, 0);
}
else
rom_loaded = Memory.LoadROMMem((const uint8_t*)game->data ,game->size);
if(biosrom) delete[] biosrom;
}
int pixel_format = RGB555;
......@@ -727,8 +837,8 @@ bool retro_load_game(const struct retro_game_info *game)
* mode to battle mode and vice versa. */
ChronoTriggerFrameHack = false;
if (Memory.match_nc("CHRONO TRIGGER") || /* Chrono Trigger */
Memory.match_id("ACT") ||
Memory.match_id("AC9J") /* Chrono Trigger (Sample) */
Memory.match_id("ACT") ||
Memory.match_id("AC9J") /* Chrono Trigger (Sample) */
)
{
ChronoTriggerFrameHack = true;
......@@ -757,8 +867,7 @@ bool retro_load_game(const struct retro_game_info *game)
void retro_unload_game(void)
{}
bool retro_load_game_special(unsigned game_type,
const struct retro_game_info *info, size_t num_info) {
bool retro_load_game_special(unsigned game_type, const struct retro_game_info *info, size_t num_info) {
init_descriptors();
memorydesc_c = 0;
......@@ -781,10 +890,24 @@ bool retro_load_game_special(unsigned game_type,
break;
case RETRO_GAME_TYPE_BSX_SLOTTED:
case RETRO_GAME_TYPE_MULTI_CART:
if(num_info == 2)
rom_loaded = Memory.LoadMultiCartMem((const uint8_t*)info[0].data, info[0].size,
(const uint8_t*)info[1].data, info[1].size, NULL, 0);
if(num_info == 2) {
uint8 *biosrom = new uint8[0x100000];
if (is_SufamiTurbo_Cart((const uint8_t*)info[0].data, info[0].size)) {
if ((rom_loaded = LoadBIOS(biosrom,"STBIOS.bin",0x40000)))
rom_loaded = Memory.LoadMultiCartMem((const uint8_t*)info[0].data, info[0].size,
(const uint8_t*)info[1].data, info[1].size, biosrom, 0x40000);
}
else {
rom_loaded = Memory.LoadMultiCartMem((const uint8_t*)info[0].data, info[0].size,
(const uint8_t*)info[1].data, info[1].size, NULL, 0);
}
if (biosrom) delete[] biosrom;
}
if (!rom_loaded && log_cb)
log_cb(RETRO_LOG_ERROR, "[libretro]: Multirom loading failed...\n");
......@@ -792,10 +915,16 @@ bool retro_load_game_special(unsigned game_type,
break;
case RETRO_GAME_TYPE_SUFAMI_TURBO:
if(num_info == 3)
rom_loaded = Memory.LoadMultiCartMem((const uint8_t*)info[1].data, info[1].size,
(const uint8_t*)info[2].data, info[2].size, (const uint8_t*)info[0].data, info[0].size);
if(num_info == 2) {
uint8 *biosrom = new uint8[0x100000];
if ((rom_loaded = LoadBIOS(biosrom,"STBIOS.bin",0x40000)))
rom_loaded = Memory.LoadMultiCartMem((const uint8_t*)info[0].data, info[0].size,
(const uint8_t*)info[1].data, info[1].size, biosrom, 0x40000);
if (biosrom) delete[] biosrom;
}
if (!rom_loaded && log_cb)
log_cb(RETRO_LOG_ERROR, "[libretro]: Sufami Turbo ROM loading failed...\n");
......@@ -807,9 +936,23 @@ bool retro_load_game_special(unsigned game_type,
break;
}
int pixel_format = RGB555;
if(environ_cb) {
pixel_format = RGB565;
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
pixel_format = RGB555;
}
S9xGraphicsDeinit();
S9xSetRenderPixelFormat(pixel_format);
S9xGraphicsInit();
struct retro_memory_map map={ memorydesc+MAX_MAPS-memorydesc_c, memorydesc_c };
if (rom_loaded) environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &map);
update_geometry();
return rom_loaded;
}
......@@ -831,6 +974,18 @@ void retro_init(void)
else
log_cb = NULL;
const char *dir = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir)
snprintf(retro_system_directory, sizeof(retro_system_directory), "%s", dir);
else
snprintf(retro_system_directory, sizeof(retro_system_directory), "%s", ".");
if (environ_cb(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &dir) && dir)
snprintf(retro_save_directory, sizeof(retro_save_directory), "%s", dir);
else
snprintf(retro_save_directory, sizeof(retro_save_directory), "%s", ".");
// State that SNES9X supports achievements.
bool achievements = true;
environ_cb(RETRO_ENVIRONMENT_SET_SUPPORT_ACHIEVEMENTS, &achievements);
......@@ -1056,7 +1211,7 @@ static void report_buttons()
case RETRO_DEVICE_JOYPAD_MULTITAP:
for (int j = 0; j < 4; j++)
for (int i = BTN_FIRST; i <= BTN_LAST; i++)
S9xReportButton(MAKE_BUTTON(port * offset + j + 1, i), input_state_cb(port * offset + j, RETRO_DEVICE_JOYPAD, 0, i));
S9xReportButton(MAKE_BUTTON(port * offset + j + 1, i), input_state_cb(port * offset + j, RETRO_DEVICE_JOYPAD, 0, i));
break;
case RETRO_DEVICE_MOUSE:
......@@ -1078,7 +1233,7 @@ static void report_buttons()
else if (snes_scope_state[1] > (SNES_HEIGHT-1)) snes_scope_state[1] = SNES_HEIGHT-1;
S9xReportPointer(BTN_POINTER, snes_scope_state[0], snes_scope_state[1]);
for (int i = SCOPE_TRIGGER; i <= SCOPE_LAST; i++)
S9xReportButton(MAKE_BUTTON(2, i), input_state_cb(port, RETRO_DEVICE_LIGHTGUN, 0, i));
S9xReportButton(MAKE_BUTTON(2, i), input_state_cb(port, RETRO_DEVICE_LIGHTGUN, 0, i));
break;
case RETRO_DEVICE_LIGHTGUN_JUSTIFIER:
......@@ -1103,7 +1258,7 @@ static void report_buttons()
else if (snes_macsrifle_state[1] > (SNES_HEIGHT-1)) snes_macsrifle_state[1] = SNES_HEIGHT-1;
S9xReportPointer(BTN_POINTER, snes_macsrifle_state[0], snes_macsrifle_state[1]);
for (int i = MACSRIFLE_TRIGGER; i <= MACSRIFLE_LAST; i++)
S9xReportButton(MAKE_BUTTON(2, i), input_state_cb(port, RETRO_DEVICE_LIGHTGUN, 0, i));
S9xReportButton(MAKE_BUTTON(2, i), input_state_cb(port, RETRO_DEVICE_LIGHTGUN, 0, i));
break;
default:
......@@ -1213,7 +1368,7 @@ size_t retro_get_memory_size(unsigned type)
size = 0x20000;
break;