Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions Makefile.libretro
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
DEBUG = 0
LOGSOUND = 0
FRONTEND_SUPPORTS_RGB565 = 1
FRONTEND_SUPPORTS_RGB565 = 0
FRONTEND_SUPPORTS_RGB888 = 1
HAVE_CHD = 1
HAVE_SYS_PARAM = 1
HOOK_CPU = 0
HAVE_CDROM = 0
USE_PER_SOUND_CHANNELS_CONFIG = 1
LOW_MEMORY = 0
MAX_ROM_SIZE = 10485760
LTO ?= -flto

CORE_DIR := .

Expand Down Expand Up @@ -785,8 +787,8 @@ ifeq ($(platform), emscripten)
CFLAGS += -O3 -DNDEBUG
CXXFLAGS += -O3 -DNDEBUG
else
CFLAGS += -O2 -DNDEBUG
CXXFLAGS += -O2 -DNDEBUG
CFLAGS += -O3 -DNDEBUG
CXXFLAGS += -O3 -DNDEBUG
endif
endif

Expand Down Expand Up @@ -820,12 +822,15 @@ ifeq ($(LOW_MEMORY), 1)
DEFINES += -DLOW_MEMORY
endif

CFLAGS += $(fpic) $(DEFINES) $(CODE_DEFINES) $(FLAGS)
CXXFLAGS += $(fpic) $(DEFINES) $(CODE_DEFINES) $(FLAGS)
CFLAGS += $(fpic) $(DEFINES) $(CODE_DEFINES) $(FLAGS) -MMD
CXXFLAGS += $(fpic) $(DEFINES) $(CODE_DEFINES) $(FLAGS) -MMD

ifeq ($(FRONTEND_SUPPORTS_RGB565), 1)
# if you have a new frontend that supports RGB565
BPP_DEFINES = -DUSE_16BPP_RENDERING -DFRONTEND_SUPPORTS_RGB565
else ifeq ($(FRONTEND_SUPPORTS_RGB888), 1)
# if you have a new frontend that supports RGB888
BPP_DEFINES = -DUSE_32BPP_RENDERING -DFRONTEND_SUPPORTS_RGB888
else
BPP_DEFINES = -DUSE_15BPP_RENDERING
endif
Expand Down Expand Up @@ -908,3 +913,6 @@ endif

print-%:
@echo '$*=$($*)'

DEPENDS = ${OBJECTS:.o=.d} # substitutes ".o" with ".d"
-include ${DEPENDS} # copies files x.d, y.d, z.d (if they exist)
31 changes: 31 additions & 0 deletions core/cart_hw/md_cart.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ static void topshooter_w(uint32 address, uint32 data);
static uint32 tekken_regs_r(uint32 address);
static void tekken_regs_w(uint32 address, uint32 data);

#include "paprium.h"

/* Games that need extra hardware emulation:
- copy protection device
- custom ROM banking device
Expand Down Expand Up @@ -571,6 +573,15 @@ void md_cart_init(void)
/* initialize SPI EEPROM board */
eeprom_spi_init();
}
else if (strstr(rominfo.product,"T-574120-00"))
{
cart.special |= HW_PAPRIUM;

paprium_init();

/* initialize SPI EEPROM board */
eeprom_spi_init();
}
else if (strstr(rominfo.ROMType,"SF") && strstr(rominfo.product,"001"))
{
/* SF-001 mapper */
Expand Down Expand Up @@ -848,6 +859,12 @@ void md_cart_reset(int hard_reset)
megasd_reset();
}

/* MegaSD hardware */
if (cart.special & HW_PAPRIUM)
{
paprium_reset();
}

/* SVP chip */
if (svp)
{
Expand Down Expand Up @@ -935,6 +952,11 @@ int md_cart_context_save(uint8 *state)
bufferptr += megasd_context_save(&state[bufferptr]);
}

if (cart.special & HW_PAPRIUM)
{
save_param(&paprium_s, sizeof(paprium_s));
}

return bufferptr;
}

Expand Down Expand Up @@ -997,6 +1019,15 @@ int md_cart_context_load(uint8 *state)
bufferptr += megasd_context_load(&state[bufferptr]);
}

if (cart.special & HW_PAPRIUM)
{
load_param(&paprium_s, sizeof(paprium_s));

paprium_map();

log_cb(RETRO_LOG_ERROR, "\n\n\n ############################\n\n\n");
}

return bufferptr;
}

Expand Down
1 change: 1 addition & 0 deletions core/cart_hw/md_cart.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#define HW_J_CART 0x04
#define HW_LOCK_ON 0x08
#define HW_MEGASD 0x10
#define HW_PAPRIUM 0x20

/* Cartridge extra hardware */
typedef struct
Expand Down
Loading