Sync to upstream

This commit is contained in:
ds22x 2021-08-28 00:34:26 +02:00
commit b86465e8e0
20 changed files with 162 additions and 186 deletions

View File

@ -56,10 +56,12 @@ Genesis Plus GX 1.7.5 (xx/xx/xxxx) (Eke-Eke)
* added support for Everdrive extended SSF mapper * added support for Everdrive extended SSF mapper
* added (very basic) emulation of Flashkit MD hardware * added (very basic) emulation of Flashkit MD hardware
* added emulation of Micro Machines USA on-board TMSS bypass logic hardware * added emulation of Micro Machines USA on-board TMSS bypass logic hardware
* added SRAM support for games larger than 8MB
* improved console region auto-detection for a few PAL-only games (The Smurfs Travel the World & Williams Arcade's Greatest Hits) * improved console region auto-detection for a few PAL-only games (The Smurfs Travel the World & Williams Arcade's Greatest Hits)
* improved I2C EEPROM boards emulation accuracy * improved I2C EEPROM boards emulation accuracy
* improved SVP memory handlers accuracy (fixes Virtua Racing debug mode) * improved SVP memory handlers accuracy (fixes Virtua Racing debug mode)
* fixed Game Genie / Pro Action Replay lock-on support when Mega CD hardware is enabled * fixed Game Genie / Pro Action Replay lock-on support when Mega CD hardware is enabled
* fixed Game Genie / Pro Action Replay lock-on support with games larger than 8MB
* fixed SRAM support in Triple Play 96 & Triple Play - Gold Edition * fixed SRAM support in Triple Play 96 & Triple Play - Gold Edition
* fixed automatic CD loading with .md ROM files * fixed automatic CD loading with .md ROM files
* fixed ROM padding for Sonic & Knuckles * fixed ROM padding for Sonic & Knuckles
@ -187,6 +189,7 @@ Genesis Plus GX 1.7.5 (xx/xx/xxxx) (Eke-Eke)
* added configurable Wiimote timeout * added configurable Wiimote timeout
* added game auto-load support through DOL args (compatible with "Wiiflow" plugin arguments) * added game auto-load support through DOL args (compatible with "Wiiflow" plugin arguments)
* fixed support for 3rd-party classic controllers with invalid calibration settings * fixed support for 3rd-party classic controllers with invalid calibration settings
* increased maximal ROM size to 15MB
[GCW0] [GCW0]
--------------- ---------------

View File

@ -87,7 +87,7 @@ ifneq (,$(findstring unix,$(platform)))
fpic := -fPIC fpic := -fPIC
SHARED := -shared -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined SHARED := -shared -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
PLATFORM_DEFINES := -DHAVE_ZLIB PLATFORM_DEFINES := -DHAVE_ZLIB -DMAXROMSIZE=33554432
ifneq ($(findstring Linux,$(shell uname -s)),) ifneq ($(findstring Linux,$(shell uname -s)),)
HAVE_CDROM = 1 HAVE_CDROM = 1
@ -213,7 +213,7 @@ ifeq ($(arch),ppc)
else else
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
endif endif
PLATFORM_DEFINES := -DHAVE_ZLIB PLATFORM_DEFINES := -DHAVE_ZLIB -DMAXROMSIZE=33554432
OSXVER = `sw_vers -productVersion | cut -d. -f 2` OSXVER = `sw_vers -productVersion | cut -d. -f 2`
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"` OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
@ -241,7 +241,7 @@ else ifneq (,$(findstring ios,$(platform)))
fpic := -fPIC fpic := -fPIC
SHARED := -dynamiclib SHARED := -dynamiclib
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
PLATFORM_DEFINES := -DHAVE_ZLIB PLATFORM_DEFINES := -DHAVE_ZLIB -DMAXROMSIZE=16777216
MINVERSION := MINVERSION :=
ifeq ($(IOSSDK),) ifeq ($(IOSSDK),)
@ -713,7 +713,7 @@ else
CXX ?= g++ CXX ?= g++
SHARED := -shared -static-libgcc -static-libstdc++ -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined SHARED := -shared -static-libgcc -static-libstdc++ -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
PLATFORM_DEFINES := -DHAVE_ZLIB PLATFORM_DEFINES := -DHAVE_ZLIB -DMAXROMSIZE=33554432
HAVE_CDROM = 1 HAVE_CDROM = 1
endif endif

View File

@ -30,7 +30,7 @@ INCLUDES := core core/m68k core/z80 core/sound core/tremor core/ntsc core/input_
# options for code generation # options for code generation
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
CFLAGS = -O3 -fomit-frame-pointer -Wall -Wno-strict-aliasing $(MACHDEP) $(INCLUDE) -DUSE_LIBTREMOR -DUSE_LIBCHDR -DUSE_16BPP_RENDERING -DALT_RENDERER -DBLIP_INVERT -DHW_RVL -DCPU_IS_BIG_ENDIAN=1 -DWORDS_BIGENDIAN=1 -DPACKAGE_VERSION=\"1.3.2\" -DFLAC_API_EXPORTS -DFLAC__HAS_OGG=0 -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_SYS_PARAM_H -D_7ZIP_ST CFLAGS = -O3 -fomit-frame-pointer -Wall -Wno-strict-aliasing $(MACHDEP) $(INCLUDE) -DMAXROMSIZE=15728640 -DUSE_LIBTREMOR -DUSE_LIBCHDR -DUSE_16BPP_RENDERING -DALT_RENDERER -DBLIP_INVERT -DHW_RVL -DCPU_IS_BIG_ENDIAN=1 -DWORDS_BIGENDIAN=1 -DPACKAGE_VERSION=\"1.3.2\" -DFLAC_API_EXPORTS -DFLAC__HAS_OGG=0 -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_SYS_PARAM_H -D_7ZIP_ST
CXXFLAGS = $(CFLAGS) CXXFLAGS = $(CFLAGS)
LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map

Binary file not shown.

View File

@ -1,8 +1,8 @@
/**************************************************************************** /****************************************************************************
* Genesis Plus * Genesis Plus
* Action Replay / Pro Action Replay emulation * Action Replay / Pro Action Replay hardware support
* *
* Copyright (C) 2009-2014 Eke-Eke (Genesis Plus GX) * Copyright (C) 2009-2021 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:
@ -45,8 +45,7 @@ static struct
{ {
uint8 enabled; uint8 enabled;
uint8 status; uint8 status;
uint8 *rom; uint8 ram[0x10000];
uint8 *ram;
uint16 regs[13]; uint16 regs[13];
uint16 old[4]; uint16 old[4];
uint16 data[4]; uint16 data[4];
@ -54,64 +53,52 @@ static struct
} action_replay; } action_replay;
static void ar_write_regs(uint32 address, uint32 data); static void ar_write_regs(uint32 address, uint32 data);
static void ar_write_regs_2(uint32 address, uint32 data); static void ar2_write_reg(uint32 address, uint32 data);
static void ar_write_ram_8(uint32 address, uint32 data); static void ar_write_ram_8(uint32 address, uint32 data);
void areplay_init(void) void areplay_init(void)
{ {
int size; action_replay.enabled = action_replay.status = 0;
memset(&action_replay,0,sizeof(action_replay));
/* store Action replay ROM (max. 128k) & RAM (64k) above cartridge ROM + SRAM area */ /* try to load Action Replay ROM file (max. 64KB) */
if (cart.romsize > 0x810000) return; if (load_archive(AR_ROM, cart.lockrom, 0x10000, NULL) > 0)
action_replay.rom = cart.rom + 0x810000;
action_replay.ram = cart.rom + 0x830000;
/* try to load Action Replay ROM file */
size = load_archive(AR_ROM, action_replay.rom, 0x20000, NULL);
/* detect Action Replay board type */
switch (size)
{ {
case 0x8000: /* detect Action Replay board type */
if (!memcmp(cart.lockrom + 0x120, "ACTION REPLAY ", 16))
{ {
if (!memcmp(action_replay.rom + 0x120, "ACTION REPLAY ", 16)) /* normal Action Replay (32KB ROM) */
{ action_replay.enabled = TYPE_AR;
/* normal Action Replay (32K) */
action_replay.enabled = TYPE_AR;
/* internal registers mapped at $010000-$01ffff */
m68k.memory_map[0x01].write16 = ar_write_regs;
break;
}
}
case 0x10000: /* $0000-$7fff mirrored into $8000-$ffff */
case 0x20000: memcpy(cart.lockrom + 0x8000, cart.lockrom, 0x8000);
/* internal registers mapped at $010000-$01ffff */
m68k.memory_map[0x01].write16 = ar_write_regs;
}
else
{ {
/* Read stack pointer MSB */ /* Read stack pointer MSB */
uint8 sp = READ_BYTE(action_replay.rom, 0x01); uint8 sp = cart.lockrom[0x01];
/* Detect board version */ /* Detect board version */
if ((sp == 0x42) && !memcmp(action_replay.rom + 0x120, "ACTION REPLAY 2 ", 16)) if ((sp == 0x42) && !memcmp(cart.lockrom + 0x120, "ACTION REPLAY 2 ", 16))
{ {
/* PRO Action Replay 1 (64/128K) */ /* PRO Action Replay (2x32KB ROM) */
action_replay.enabled = TYPE_PRO1; action_replay.enabled = TYPE_PRO1;
/* internal registers mapped at $010000-$01ffff */ /* internal registers mapped at $010000-$01ffff */
m68k.memory_map[0x01].write16 = ar_write_regs; m68k.memory_map[0x01].write16 = ar_write_regs;
} }
else if ((sp == 0x60) && !memcmp(action_replay.rom + 0x3c6, "ACTION REPLAY II", 16)) else if ((sp == 0x60) && !memcmp(cart.lockrom + 0x3c6, "ACTION REPLAY II", 16))
{ {
/* PRO Action Replay 2 (64K) */ /* PRO Action Replay 2 (2x32KB ROM) */
action_replay.enabled = TYPE_PRO2; action_replay.enabled = TYPE_PRO2;
/* internal registers mapped at $100000-$10ffff */ /* internal register mapped at $100000-$10ffff */
m68k.memory_map[0x10].write16 = ar_write_regs_2; m68k.memory_map[0x10].write16 = ar2_write_reg;
} }
/* internal RAM (64k), mapped at $420000-$42ffff or $600000-$60ffff */ /* internal RAM (64KB), mapped at $420000-$42ffff or $600000-$60ffff */
if (action_replay.enabled) if (action_replay.enabled)
{ {
m68k.memory_map[sp].base = action_replay.ram; m68k.memory_map[sp].base = action_replay.ram;
@ -120,28 +107,22 @@ void areplay_init(void)
m68k.memory_map[sp].write8 = ar_write_ram_8; m68k.memory_map[sp].write8 = ar_write_ram_8;
m68k.memory_map[sp].write16 = NULL; m68k.memory_map[sp].write16 = NULL;
} }
break;
} }
default:
{
break;
}
}
#ifdef LSB_FIRST #ifdef LSB_FIRST
if (action_replay.enabled) if (action_replay.enabled)
{
int i;
for (i= 0; i<size; i+=2)
{ {
/* Byteswap ROM */ int i;
uint8 temp = action_replay.rom[i]; for (i= 0; i<0x10000; i+=2)
action_replay.rom[i] = action_replay.rom[i+1]; {
action_replay.rom[i+1] = temp; /* Byteswap ROM */
uint8 temp = cart.lockrom[i];
cart.lockrom[i] = cart.lockrom[i+1];
cart.lockrom[i+1] = temp;
}
} }
}
#endif #endif
}
} }
void areplay_shutdown(void) void areplay_shutdown(void)
@ -166,7 +147,7 @@ void areplay_reset(int hard)
memset(action_replay.addr, 0, sizeof(action_replay.addr)); memset(action_replay.addr, 0, sizeof(action_replay.addr));
/* by default, internal ROM is mapped at $000000-$00FFFF */ /* by default, internal ROM is mapped at $000000-$00FFFF */
m68k.memory_map[0].base = action_replay.rom; m68k.memory_map[0].base = cart.lockrom;
/* reset internal RAM on power-on */ /* reset internal RAM on power-on */
if (hard) if (hard)
@ -287,7 +268,7 @@ static void ar_write_regs(uint32 address, uint32 data)
} }
} }
static void ar_write_regs_2(uint32 address, uint32 data) static void ar2_write_reg(uint32 address, uint32 data)
{ {
/* enable Cartridge ROM */ /* enable Cartridge ROM */
if (((address & 0xff) == 0x78) && (data == 0xffff)) if (((address & 0xff) == 0x78) && (data == 0xffff))
@ -300,5 +281,4 @@ static void ar_write_ram_8(uint32 address, uint32 data)
{ {
/* byte writes are handled as word writes, with LSB duplicated in MSB (/LWR is not used) */ /* byte writes are handled as word writes, with LSB duplicated in MSB (/LWR is not used) */
*(uint16 *)(action_replay.ram + (address & 0xfffe)) = (data | (data << 8)); *(uint16 *)(action_replay.ram + (address & 0xfffe)) = (data | (data << 8));
} }

View File

@ -1,8 +1,8 @@
/**************************************************************************** /****************************************************************************
* Genesis Plus * Genesis Plus
* DATEL Action Replay / Pro Action Replay emulation * Action Replay / Pro Action Replay hardware support
* *
* Copyright (C) 2009-2014 Eke-Eke (Genesis Plus GX) * Copyright (C) 2009-2021 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:

View File

@ -1,8 +1,8 @@
/**************************************************************************** /****************************************************************************
* Genesis Plus * Genesis Plus
* Game Genie Hardware emulation * Game Genie hardware support
* *
* Copyright (C) 2009-2014 Eke-Eke (Genesis Plus GX) * Copyright (C) 2009-2021 Eke-Eke (Genesis Plus GX)
* *
* Based on documentation from Charles McDonald * Based on documentation from Charles McDonald
* (http://cgfm2.emuviews.com/txt/genie.txt) * (http://cgfm2.emuviews.com/txt/genie.txt)
@ -44,7 +44,6 @@
static struct static struct
{ {
uint8 enabled; uint8 enabled;
uint8 *rom;
uint16 regs[0x20]; uint16 regs[0x20];
uint16 old[6]; uint16 old[6];
uint16 data[6]; uint16 data[6];
@ -58,29 +57,25 @@ static void ggenie_write_word(unsigned int address, unsigned int data);
static void ggenie_write_regs(unsigned int offset, unsigned int data); static void ggenie_write_regs(unsigned int offset, unsigned int data);
void ggenie_init(void) void ggenie_init(void)
{ {
memset(&ggenie,0,sizeof(ggenie)); ggenie.enabled = 0;
/* Store Game Genie ROM (32k) above cartridge ROM + SRAM area */ /* Try to load Game Genie ROM file (32KB) */
if (cart.romsize > 0x810000) return; if (load_archive(GG_ROM, cart.lockrom, 0x8000, NULL) > 0)
ggenie.rom = cart.rom + 0x810000;
/* Try to load Game Genie ROM file */
if (load_archive(GG_ROM, ggenie.rom, 0x8000, NULL) > 0)
{ {
#ifdef LSB_FIRST #ifdef LSB_FIRST
int i; int i;
for (i=0; i<0x8000; i+=2) for (i=0; i<0x8000; i+=2)
{ {
/* Byteswap ROM */ /* Byteswap ROM */
uint8 temp = ggenie.rom[i]; uint8 temp = cart.lockrom[i];
ggenie.rom[i] = ggenie.rom[i+1]; cart.lockrom[i] = cart.lockrom[i+1];
ggenie.rom[i+1] = temp; cart.lockrom[i+1] = temp;
} }
#endif #endif
/* $0000-$7fff mirrored into $8000-$ffff */ /* $0000-$7fff mirrored into $8000-$ffff */
memcpy(ggenie.rom + 0x8000, ggenie.rom, 0x8000); memcpy(cart.lockrom + 0x8000, cart.lockrom, 0x8000);
/* Game Genie hardware is enabled */ /* Game Genie hardware is enabled */
ggenie.enabled = 1; ggenie.enabled = 1;
@ -113,7 +108,7 @@ void ggenie_reset(int hard)
} }
/* Game Genie ROM is mapped at $000000-$007fff */ /* Game Genie ROM is mapped at $000000-$007fff */
m68k.memory_map[0].base = ggenie.rom; m68k.memory_map[0].base = cart.lockrom;
/* Internal registers are mapped at $000000-$00001f */ /* Internal registers are mapped at $000000-$00001f */
m68k.memory_map[0].write8 = ggenie_write_byte; m68k.memory_map[0].write8 = ggenie_write_byte;
@ -214,7 +209,7 @@ static void ggenie_write_regs(unsigned int offset, unsigned int data)
else else
{ {
/* $0000-$7ffff reads mapped to Game Genie ROM */ /* $0000-$7ffff reads mapped to Game Genie ROM */
m68k.memory_map[0].base = ggenie.rom; m68k.memory_map[0].base = cart.lockrom;
m68k.memory_map[0].read8 = NULL; m68k.memory_map[0].read8 = NULL;
m68k.memory_map[0].read16 = NULL; m68k.memory_map[0].read16 = NULL;

View File

@ -1,8 +1,8 @@
/**************************************************************************** /****************************************************************************
* Genesis Plus * Genesis Plus
* Game Genie Hardware emulation * Game Genie hardware support
* *
* Copyright (C) 2009-2014 Eke-Eke (Genesis Plus GX) * Copyright (C) 2009-2021 Eke-Eke (Genesis Plus GX)
* *
* Based on documentation from Charles McDonald * Based on documentation from Charles McDonald
* (http://cgfm2.emuviews.com/txt/genie.txt) * (http://cgfm2.emuviews.com/txt/genie.txt)

View File

@ -453,79 +453,6 @@ void md_cart_init(void)
svp_init(); svp_init();
} }
/**********************************************
LOCK-ON
***********************************************/
/* clear existing patches */
ggenie_shutdown();
areplay_shutdown();
/* initialize extra hardware */
switch (config.lock_on)
{
case TYPE_GG:
{
ggenie_init();
break;
}
case TYPE_AR:
{
areplay_init();
break;
}
case TYPE_SK:
{
/* store S&K ROM above cartridge ROM (and before backup memory) */
if (cart.romsize > 0x600000) break;
/* try to load Sonic & Knuckles ROM file (2 MB) */
if (load_archive(SK_ROM, cart.rom + 0x600000, 0x200000, NULL) == 0x200000)
{
/* check ROM header */
if (!memcmp(cart.rom + 0x600000 + 0x120, "SONIC & KNUCKLES",16))
{
/* try to load Sonic 2 & Knuckles UPMEM ROM (256 KB) */
if (load_archive(SK_UPMEM, cart.rom + 0x900000, 0x40000, NULL) == 0x40000)
{
/* $000000-$1FFFFF is mapped to S&K ROM */
for (i=0x00; i<0x20; i++)
{
m68k.memory_map[i].base = cart.rom + 0x600000 + (i << 16);
}
#ifdef LSB_FIRST
for (i=0; i<0x200000; i+=2)
{
/* Byteswap ROM */
uint8 temp = cart.rom[i + 0x600000];
cart.rom[i + 0x600000] = cart.rom[i + 0x600000 + 1];
cart.rom[i + 0x600000 + 1] = temp;
}
for (i=0; i<0x40000; i+=2)
{
/* Byteswap ROM */
uint8 temp = cart.rom[i + 0x900000];
cart.rom[i + 0x900000] = cart.rom[i + 0x900000 + 1];
cart.rom[i + 0x900000 + 1] = temp;
}
#endif
cart.special |= HW_LOCK_ON;
}
}
}
break;
}
default:
{
break;
}
}
/********************************************** /**********************************************
CARTRIDGE EXTRA HARDWARE CARTRIDGE EXTRA HARDWARE
***********************************************/ ***********************************************/
@ -569,16 +496,16 @@ void md_cart_init(void)
/* Realtec mapper */ /* Realtec mapper */
if (cart.hw.realtec) if (cart.hw.realtec)
{ {
/* 8k BOOT ROM */ /* copy 8KB Boot ROM after cartridge ROM area */
for (i=0; i<8; i++) for (i=0; i<8; i++)
{ {
memcpy(cart.rom + 0x900000 + i*0x2000, cart.rom + 0x7e000, 0x2000); memcpy(cart.rom + 0x400000 + i*0x2000, cart.rom + 0x7e000, 0x2000);
} }
/* BOOT ROM is mapped to $000000-$3FFFFF */ /* Boot ROM (8KB mirrored) is mapped to $000000-$3FFFFF */
for (i=0x00; i<0x40; i++) for (i=0x00; i<0x40; i++)
{ {
m68k.memory_map[i].base = cart.rom + 0x900000; m68k.memory_map[i].base = cart.rom + 0x400000;
} }
} }
@ -768,6 +695,79 @@ void md_cart_init(void)
{ {
cart.hw.time_w = default_time_w; cart.hw.time_w = default_time_w;
} }
/**********************************************
LOCK-ON
***********************************************/
/* clear existing patches */
ggenie_shutdown();
areplay_shutdown();
/* initialize extra hardware */
switch (config.lock_on)
{
case TYPE_GG:
{
ggenie_init();
break;
}
case TYPE_AR:
{
areplay_init();
break;
}
case TYPE_SK:
{
/* store Sonic & Knuckles ROM files after cartridge ROM area */
if (cart.romsize > 0x400000) break;
/* try to load Sonic & Knuckles ROM file (2MB) */
if (load_archive(SK_ROM, cart.rom + 0x400000, 0x200000, NULL) == 0x200000)
{
/* check ROM header */
if (!memcmp(cart.rom + 0x400000 + 0x120, "SONIC & KNUCKLES",16))
{
/* try to load Sonic 2 & Knuckles upmem ROM file (256KB) */
if (load_archive(SK_UPMEM, cart.rom + 0x600000, 0x40000, NULL) == 0x40000)
{
/* $000000-$1FFFFF is mapped to S&K ROM */
for (i=0x00; i<0x20; i++)
{
m68k.memory_map[i].base = cart.rom + 0x400000 + (i << 16);
}
#ifdef LSB_FIRST
for (i=0; i<0x200000; i+=2)
{
/* Byteswap ROM */
uint8 temp = cart.rom[i + 0x400000];
cart.rom[i + 0x400000] = cart.rom[i + 0x400000 + 1];
cart.rom[i + 0x400000 + 1] = temp;
}
for (i=0; i<0x40000; i+=2)
{
/* Byteswap ROM */
uint8 temp = cart.rom[i + 0x600000];
cart.rom[i + 0x600000] = cart.rom[i + 0x600000 + 1];
cart.rom[i + 0x600000 + 1] = temp;
}
#endif
cart.special |= HW_LOCK_ON;
}
}
}
break;
}
default:
{
break;
}
}
} }
/* hardware that need to be reseted on power on */ /* hardware that need to be reseted on power on */
@ -961,12 +961,12 @@ static void mapper_sega_w(uint32 data)
} }
/* S&K lock-on chip */ /* S&K lock-on chip */
if ((cart.special & HW_LOCK_ON) && (config.lock_on == TYPE_SK)) if (cart.special & HW_LOCK_ON)
{ {
/* S2K upmem chip mapped to $300000-$3fffff (256K mirrored) */ /* S2K upmem chip mapped to $300000-$3fffff (256KB mirrored) */
for (i=0x30; i<0x40; i++) for (i=0x30; i<0x40; i++)
{ {
m68k.memory_map[i].base = (cart.rom + 0x900000) + ((i & 3) << 16); m68k.memory_map[i].base = (cart.rom + 0x600000) + ((i & 3) << 16);
} }
} }
} }

View File

@ -81,7 +81,8 @@ typedef struct
uint32 mask; /* ROM mask */ uint32 mask; /* ROM mask */
uint8 special; /* custom external hardware (Lock-On, J-Cart, 3-D glasses, Terebi Oekaki,...) */ uint8 special; /* custom external hardware (Lock-On, J-Cart, 3-D glasses, Terebi Oekaki,...) */
cart_hw_t hw; /* cartridge internal hardware */ cart_hw_t hw; /* cartridge internal hardware */
uint8 rom[MAXROMSIZE]; /* ROM area */ uint8 lockrom[0x10000]; /* Game Genie / (Pro) Action Replay Lock-On ROM area (max 64KB) */
uint8 rom[MAXROMSIZE]; /* cartridge ROM area */
} md_cart_t; } md_cart_t;

View File

@ -199,6 +199,7 @@ static const rominfo_t game_list[] =
{0xC0E25D62, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* California Games II */ {0xC0E25D62, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* California Games II */
{0x45C50294, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Jogos de Verao II (BR) */ {0x45C50294, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Jogos de Verao II (BR) */
{0xC9DBF936, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Home Alone */ {0xC9DBF936, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Home Alone */
{0xA109A6FE, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Power Strike II */
{0x0047B615, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Predator2 */ {0x0047B615, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Predator2 */
{0xF42E145C, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Quest for the Shaven Yak Starring Ren Hoek & Stimpy (BR) */ {0xF42E145C, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* Quest for the Shaven Yak Starring Ren Hoek & Stimpy (BR) */
{0x9F951756, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* RoboCop 3 */ {0x9F951756, 0, 0, 0, MAPPER_SEGA, SYSTEM_SMS2, REGION_EUROPE}, /* RoboCop 3 */

View File

@ -2,7 +2,7 @@
* Genesis Plus * Genesis Plus
* Backup RAM support * Backup RAM support
* *
* Copyright (C) 2007-2020 Eke-Eke (Genesis Plus GX) * Copyright (C) 2007-2021 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:
@ -61,11 +61,8 @@ T_SRAM sram;
****************************************************************************/ ****************************************************************************/
void sram_init() void sram_init()
{ {
memset(&sram, 0, sizeof (T_SRAM)); /* disable Backup RAM by default */
sram.detected = sram.on = sram.custom = sram.start = sram.end = 0;
/* backup RAM data is stored above cartridge ROM area, at $800000-$80FFFF (max. 64K) */
if (cart.romsize > 0x800000) return;
sram.sram = cart.rom + 0x800000;
/* initialize Backup RAM */ /* initialize Backup RAM */
if (strstr(rominfo.international,"Sonic 1 Remastered")) if (strstr(rominfo.international,"Sonic 1 Remastered"))

View File

@ -2,7 +2,7 @@
* Genesis Plus * Genesis Plus
* Backup RAM support * Backup RAM support
* *
* Copyright (C) 2007-2020 Eke-Eke (Genesis Plus GX) * Copyright (C) 2007-2021 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:
@ -47,7 +47,7 @@ typedef struct
uint32 start; uint32 start;
uint32 end; uint32 end;
uint32 crc; uint32 crc;
uint8 *sram; uint8 sram[0x10000];
} T_SRAM; } T_SRAM;
/* Function prototypes */ /* Function prototypes */

View File

@ -2,7 +2,7 @@
* Genesis Plus * Genesis Plus
* CD compatible ROM/RAM cartridge support * CD compatible ROM/RAM cartridge support
* *
* Copyright (C) 2012-2016 Eke-Eke (Genesis Plus GX) * Copyright (C) 2012-2021 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:
@ -38,7 +38,6 @@
#include "shared.h" #include "shared.h"
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* backup RAM cartridge (max. 512KB) */ /* backup RAM cartridge (max. 512KB) */
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
* Genesis Plus * Genesis Plus
* CD compatible ROM/RAM cartridge support * CD compatible ROM/RAM cartridge support
* *
* Copyright (C) 2012-2016 Eke-Eke (Genesis Plus GX) * Copyright (C) 2012-2021 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:
@ -41,7 +41,7 @@
typedef struct typedef struct
{ {
uint8 reserved[0x80]; /* reserved for ROM cartridge infos (see md_cart.h) */ uint8 reserved[0x80]; /* reserved for ROM cartridge infos (see md_cart.h) */
uint8 area[0x840000]; /* cartridge ROM/RAM area (max. 8MB ROM + 64KB backup memory + Pro Action Replay 128KB ROM / 64KB RAM) */ uint8 area[0x810000]; /* cartridge ROM/RAM area (max. 8MB ROM + Pro Action Replay 64KB ROM) */
uint8 boot; /* cartridge boot mode (0x00: boot from CD with ROM/RAM cartridge enabled, 0x40: boot from ROM cartridge with CD enabled) */ uint8 boot; /* cartridge boot mode (0x00: boot from CD with ROM/RAM cartridge enabled, 0x40: boot from ROM cartridge with CD enabled) */
uint8 id; /* RAM cartridge ID (related to RAM size, 0 if disabled) */ uint8 id; /* RAM cartridge ID (related to RAM size, 0 if disabled) */
uint8 prot; /* RAM cartridge write protection */ uint8 prot; /* RAM cartridge write protection */

View File

@ -3,7 +3,7 @@
* *
* Genesis Plus GX video & rendering support * Genesis Plus GX video & rendering support
* *
* Copyright Eke-Eke (2007-2019), based on original work from Softdev (2006) * Copyright Eke-Eke (2007-2021), based on original work from Softdev (2006)
* *
* 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:
@ -1888,6 +1888,9 @@ void gx_video_Init(void)
/* Configure VI */ /* Configure VI */
VIDEO_Configure(vmode); VIDEO_Configure(vmode);
/* Initialize font first (to ensure IPL font buffer is allocated in MEM1 as DMA from EXI bus to MEM2 is apparently not possible) */
FONT_Init();
/* Allocate framebuffers */ /* Allocate framebuffers */
xfb[0] = (u32 *) MEM_K0_TO_K1((u32 *) SYS_AllocateFramebuffer(&TV50hz_576i)); xfb[0] = (u32 *) MEM_K0_TO_K1((u32 *) SYS_AllocateFramebuffer(&TV50hz_576i));
xfb[1] = (u32 *) MEM_K0_TO_K1((u32 *) SYS_AllocateFramebuffer(&TV50hz_576i)); xfb[1] = (u32 *) MEM_K0_TO_K1((u32 *) SYS_AllocateFramebuffer(&TV50hz_576i));
@ -1916,9 +1919,6 @@ void gx_video_Init(void)
gxStart(); gxStart();
gxResetRendering(1); gxResetRendering(1);
gxResetMode(vmode, GX_TRUE); gxResetMode(vmode, GX_TRUE);
/* Initialize FONT */
FONT_Init();
} }
void gx_video_Shutdown(void) void gx_video_Shutdown(void)

View File

@ -3,7 +3,7 @@
* *
* Genesis Plus GX video support * Genesis Plus GX video support
* *
* Copyright Eke-Eke (2007-2019), based on original work from Softdev (2006) * Copyright Eke-Eke (2007-2021), based on original work from Softdev (2006)
* *
* 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:

View File

@ -10,7 +10,7 @@ USE_PER_SOUND_CHANNELS_CONFIG := 1
include $(CORE_DIR)/libretro/Makefile.common include $(CORE_DIR)/libretro/Makefile.common
COREFLAGS := -ffast-math -funroll-loops -DINLINE="static inline" -DUSE_LIBTREMOR -DUSE_16BPP_RENDERING -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565 -DALIGN_LONG -DALIGN_WORD -DM68K_OVERCLOCK_SHIFT=20 -DZ80_OVERCLOCK_SHIFT=20 -DHAVE_YM3438_CORE -DUSE_LIBCHDR -D_7ZIP_ST -DUSE_LIBRETRO_VFS -DHAVE_OPLL_CORE -DUSE_PER_SOUND_CHANNELS_CONFIG $(INCFLAGS) COREFLAGS := -ffast-math -funroll-loops -DINLINE="static inline" -DUSE_LIBTREMOR -DUSE_16BPP_RENDERING -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565 -DALIGN_LONG -DALIGN_WORD -DM68K_OVERCLOCK_SHIFT=20 -DZ80_OVERCLOCK_SHIFT=20 -DHAVE_YM3438_CORE -DUSE_LIBCHDR -D_7ZIP_ST -DUSE_LIBRETRO_VFS -DHAVE_OPLL_CORE -DUSE_PER_SOUND_CHANNELS_CONFIG $(INCFLAGS) -DMAXROMSIZE=16777216
ifeq ($(TARGET_ARCH),arm) ifeq ($(TARGET_ARCH),arm)
COREFLAGS += -D_ARM_ASSEM_ COREFLAGS += -D_ARM_ASSEM_

View File

@ -22,7 +22,7 @@
# -DUSE_LIBTREMOR : enable OGG file support for CD emulation using provided TREMOR library # -DUSE_LIBTREMOR : enable OGG file support for CD emulation using provided TREMOR library
# -DUSE_LIBVORBIS : enable OGG file support for CD emulation using external VORBIS library # -DUSE_LIBVORBIS : enable OGG file support for CD emulation using external VORBIS library
# -DISABLE_MANY_OGG_OPEN_FILES : only have one OGG file opened at once to save RAM # -DISABLE_MANY_OGG_OPEN_FILES : only have one OGG file opened at once to save RAM
# -DMAXROMSIZE : defines maximal size of ROM/SRAM buffer (also shared with CD hardware) # -DMAXROMSIZE : defines maximal size of ROM buffer (also shared with CD hardware)
# -DHAVE_YM3438_CORE : enable (configurable) support for Nuked cycle-accurate YM2612/YM3438 core # -DHAVE_YM3438_CORE : enable (configurable) support for Nuked cycle-accurate YM2612/YM3438 core
# -DHAVE_OPLL_CORE : enable (configurable) support for Nuked cycle-accurate YM2413 core # -DHAVE_OPLL_CORE : enable (configurable) support for Nuked cycle-accurate YM2413 core
# -DHOOK_CPU : enable CPU hooks # -DHOOK_CPU : enable CPU hooks

View File

@ -22,7 +22,7 @@
# -DUSE_LIBTREMOR : enable OGG file support for CD emulation using provided TREMOR library # -DUSE_LIBTREMOR : enable OGG file support for CD emulation using provided TREMOR library
# -DUSE_LIBVORBIS : enable OGG file support for CD emulation using external VORBIS library # -DUSE_LIBVORBIS : enable OGG file support for CD emulation using external VORBIS library
# -DISABLE_MANY_OGG_OPEN_FILES : only have one OGG file opened at once to save RAM # -DISABLE_MANY_OGG_OPEN_FILES : only have one OGG file opened at once to save RAM
# -DMAXROMSIZE : defines maximal size of ROM/SRAM buffer (also shared with CD hardware) # -DMAXROMSIZE : defines maximal size of ROM buffer (also shared with CD hardware)
# -DHAVE_YM3438_CORE : enable (configurable) support for Nuked cycle-accurate YM2612/YM3438 core # -DHAVE_YM3438_CORE : enable (configurable) support for Nuked cycle-accurate YM2612/YM3438 core
# -DHAVE_OPLL_CORE : enable (configurable) support for Nuked cycle-accurate YM2413 core # -DHAVE_OPLL_CORE : enable (configurable) support for Nuked cycle-accurate YM2413 core
# -DHOOK_CPU : enable CPU hooks # -DHOOK_CPU : enable CPU hooks