mirror of
https://github.com/libretro/Mu.git
synced 2026-09-22 14:45:57 +00:00
Add hard reset option, use new classic console makefile
This commit is contained in:
11
bugs/brokenLibretroPlatforms.txt
Normal file
11
bugs/brokenLibretroPlatforms.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
PSP
|
||||
msvc2003
|
||||
msvc2010
|
||||
classics/new haxchi(should work)
|
||||
xbox(don't know)
|
||||
xbox360(don't know)
|
||||
|
||||
Fixed:
|
||||
remove old haxchi
|
||||
emscripten
|
||||
msvc2005
|
||||
@@ -267,6 +267,38 @@ else ifeq ($(platform), rpi3)
|
||||
CFLAGS += -fomit-frame-pointer -ffast-math
|
||||
HAVE_NEON = 1
|
||||
|
||||
# Classic Platforms ####################
|
||||
# Platform affix = classic_<ISA>_<µARCH>
|
||||
# Help at https://modmyclassic.com/comp
|
||||
# (armv7 a7, hard point, neon based) ###
|
||||
# NESC, SNESC, C64 mini
|
||||
else ifeq ($(platform), classic_armv7_a7)
|
||||
TARGET := $(TARGET_NAME)_libretro.so
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined
|
||||
CFLAGS += -Ofast \
|
||||
-flto=4 -fwhole-program -fuse-linker-plugin \
|
||||
-fdata-sections -ffunction-sections -Wl,--gc-sections \
|
||||
-fno-stack-protector -fno-ident -fomit-frame-pointer \
|
||||
-falign-functions=1 -falign-jumps=1 -falign-loops=1 \
|
||||
-fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \
|
||||
-fmerge-all-constants -fno-math-errno \
|
||||
-marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
|
||||
CXXFLAGS += $(CFLAGS)
|
||||
CPPFLAGS += $(CFLAGS)
|
||||
ASFLAGS += $(CFLAGS)
|
||||
HAVE_NEON = 1
|
||||
ARCH = arm
|
||||
ifeq ($(shell echo `$(CC) -dumpversion` "< 4.9" | bc -l), 1)
|
||||
CFLAGS += -march=armv7-a
|
||||
else
|
||||
CFLAGS += -march=armv7ve
|
||||
# If gcc is 5.0 or later
|
||||
ifeq ($(shell echo `$(CC) -dumpversion` ">= 5" | bc -l), 1)
|
||||
LDFLAGS += -static-libgcc -static-libstdc++
|
||||
endif
|
||||
endif
|
||||
|
||||
# Xbox 360
|
||||
else ifeq ($(platform), xenon)
|
||||
EXT=a
|
||||
@@ -277,16 +309,6 @@ else ifeq ($(platform), xenon)
|
||||
STATIC_LINKING=1
|
||||
STATIC_LINKING_LINK=1
|
||||
|
||||
# Nintendo Classics (Hakchi)
|
||||
else ifeq ($(platform), nintendoc)
|
||||
TARGET := $(TARGET_NAME)_libretro.so
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=$(BUILD_DIR)/link.T -Wl,--no-undefined
|
||||
CFLAGS += -DARM
|
||||
CFLAGS += -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -funsafe-math-optimizations
|
||||
CFLAGS += -fomit-frame-pointer -ffast-math
|
||||
HAVE_NEON = 1
|
||||
|
||||
# Nintendo Game Cube
|
||||
else ifeq ($(platform), ngc)
|
||||
EXT=a
|
||||
@@ -327,26 +349,26 @@ else ifneq (,$(findstring armv,$(platform)))
|
||||
SHARED := -shared -Wl,--no-undefined
|
||||
fpic := -fPIC
|
||||
CC ?= gcc
|
||||
ifneq (,$(findstring cortexa8,$(platform)))
|
||||
ifneq (,$(findstring cortexa8,$(platform)))
|
||||
CFLAGS += -marm -mcpu=cortex-a8
|
||||
ASFLAGS += -mcpu=cortex-a8
|
||||
else ifneq (,$(findstring cortexa9,$(platform)))
|
||||
else ifneq (,$(findstring cortexa9,$(platform)))
|
||||
CFLAGS += -marm -mcpu=cortex-a9
|
||||
ASFLAGS += -mcpu=cortex-a9
|
||||
endif
|
||||
CFLAGS += -marm
|
||||
ifneq (,$(findstring neon,$(platform)))
|
||||
ifneq (,$(findstring neon,$(platform)))
|
||||
CFLAGS += -mfpu=neon
|
||||
ASFLAGS += -mfpu=neon
|
||||
HAVE_NEON = 1
|
||||
endif
|
||||
ifneq (,$(findstring softfloat,$(platform)))
|
||||
endif
|
||||
ifneq (,$(findstring softfloat,$(platform)))
|
||||
CFLAGS += -mfloat-abi=softfp
|
||||
ASFLAGS += -mfloat-abi=softfp
|
||||
else ifneq (,$(findstring hardfloat,$(platform)))
|
||||
else ifneq (,$(findstring hardfloat,$(platform)))
|
||||
CFLAGS += -mfloat-abi=hard
|
||||
ASFLAGS += -mfloat-abi=hard
|
||||
endif
|
||||
endif
|
||||
CFLAGS += -DARM
|
||||
|
||||
# Emscripten
|
||||
@@ -481,6 +503,7 @@ else
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
@echo "** BUILDING $(TARGET) FOR PLATFORM $(platform) **"
|
||||
ifeq ($(platform), emscripten)
|
||||
$(CC) $(CFLAGS) $(OBJOUT)$@ $^
|
||||
else ifeq ($(STATIC_LINKING_LINK),1)
|
||||
@@ -493,14 +516,7 @@ else
|
||||
$(CC) $(fpic) $(SHARED) $(INCFLAGS) $(LDFLAGS) $(OBJOUT)$@ $(OBJECTS) $(LIBM)
|
||||
endif
|
||||
|
||||
ifeq ($(platform),nintendoc)
|
||||
@echo "** BUILDING HAKCHI HMOD PACKAGE **"
|
||||
mkdir -p hakchi/etc/libretro/core/ hakchi/etc/libretro/info/ hakchi/etc/preinit.d/
|
||||
rm -f hakchi/etc/libretro/info/*
|
||||
cp $(TARGET_NAME)_libretro.so hakchi/etc/libretro/core/
|
||||
cd hakchi/etc/libretro/info/; wget https://buildbot.libretro.com/assets/frontend/info/$(TARGET_NAME)_libretro.info
|
||||
cd hakchi/; tar -czvf "CORE_$(TARGET_NAME).hmod" *
|
||||
endif
|
||||
@echo "** BUILD SUCCESSFUL! GG NO RE **"
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(INCFLAGS) $(CFLAGS) -c $(OBJOUT)$@ $<
|
||||
@@ -512,7 +528,7 @@ clean-objs:
|
||||
rm -rf $(OBJECTS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) $(TARGET) hakchi/CORE_$(TARGET_NAME).hmod
|
||||
rm -f $(OBJECTS) $(TARGET)
|
||||
|
||||
.PHONY: clean
|
||||
endif
|
||||
|
||||
@@ -245,7 +245,7 @@ void retro_set_video_refresh(retro_video_refresh_t cb){
|
||||
}
|
||||
|
||||
void retro_reset(void){
|
||||
emulatorReset();
|
||||
emulatorSoftReset();
|
||||
}
|
||||
|
||||
void retro_run(void){
|
||||
|
||||
@@ -85,7 +85,7 @@ uint32_t emulatorInit(buffer_t palmRomDump, buffer_t palmBootDump, uint32_t spec
|
||||
palmCycleCounter = 0.0;
|
||||
|
||||
//memory
|
||||
memset(palmRam, 0x00, (specialFeatures & FEATURE_RAM_HUGE) ? SUPERMASSIVE_RAM_SIZE : RAM_SIZE);
|
||||
memset(palmRam, 0x00, specialFeatures & FEATURE_RAM_HUGE ? SUPERMASSIVE_RAM_SIZE : RAM_SIZE);
|
||||
memcpy(palmRom, palmRomDump.data, u64Min(palmRomDump.size, ROM_SIZE));
|
||||
if(palmRomDump.size < ROM_SIZE)
|
||||
memset(palmRom + palmRomDump.size, 0x00, ROM_SIZE - palmRomDump.size);
|
||||
@@ -147,14 +147,26 @@ void emulatorExit(){
|
||||
}
|
||||
}
|
||||
|
||||
void emulatorReset(){
|
||||
//reset doesnt clear RAM or SD card, all programs are stored in RAM or on SD card
|
||||
debugLog("Reset triggered, PC:0x%08X\n", flx68000GetPc());
|
||||
void emulatorHardReset(){
|
||||
//equivalent to taking the battery out and putting it back in
|
||||
memset(palmRam, 0x00, palmSpecialFeatures & FEATURE_RAM_HUGE ? SUPERMASSIVE_RAM_SIZE : RAM_SIZE);
|
||||
memset(palmFramebuffer, 0x00, 160 * 160 * sizeof(uint16_t));
|
||||
if(palmExtendedFramebuffer)
|
||||
memset(palmExtendedFramebuffer, 0x00, 320 * 320 * sizeof(uint16_t));
|
||||
flx68000Reset();
|
||||
sed1376Reset();
|
||||
ads7846Reset();
|
||||
pdiUsbD12Reset();
|
||||
inductorReset();
|
||||
setRtc(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
void emulatorSoftReset(){
|
||||
//equivalent to pushing the reset button on the back of the device
|
||||
flx68000Reset();
|
||||
sed1376Reset();
|
||||
ads7846Reset();
|
||||
pdiUsbD12Reset();
|
||||
}
|
||||
|
||||
void emulatorSetRtc(uint16_t days, uint8_t hours, uint8_t minutes, uint8_t seconds){
|
||||
|
||||
@@ -139,7 +139,8 @@ extern double palmClk32Sysclks;//dont touch
|
||||
//functions
|
||||
uint32_t emulatorInit(buffer_t palmRomDump, buffer_t palmBootDump, uint32_t specialFeatures);//calling any emulator functions before emulatorInit results in undefined behavior
|
||||
void emulatorExit();
|
||||
void emulatorReset();
|
||||
void emulatorHardReset();
|
||||
void emulatorSoftReset();
|
||||
void emulatorSetRtc(uint16_t days, uint8_t hours, uint8_t minutes, uint8_t seconds);
|
||||
uint64_t emulatorGetStateSize();
|
||||
bool emulatorSaveState(buffer_t buffer);//true = success
|
||||
|
||||
@@ -70,14 +70,14 @@ void flx68000Init(){
|
||||
cycloneCpu.write32 = m68k_write_memory_32;
|
||||
cycloneCpu.checkpc = checkPc;
|
||||
cycloneCpu.IrqCallback = interruptAcknowledge;
|
||||
cycloneCpu.ResetCallback = emulatorReset;
|
||||
cycloneCpu.ResetCallback = emulatorSoftReset;
|
||||
#else
|
||||
m68k_init();
|
||||
m68k_set_cpu_type(M68K_CPU_TYPE_68000);
|
||||
|
||||
CPU_ADDRESS_MASK = 0xFFFFFFFF;
|
||||
|
||||
m68k_set_reset_instr_callback(emulatorReset);
|
||||
m68k_set_reset_instr_callback(emulatorSoftReset);
|
||||
m68k_set_int_ack_callback(interruptAcknowledge);
|
||||
#endif
|
||||
inited = true;
|
||||
|
||||
@@ -226,7 +226,8 @@ static void watchdogSecondTickClk32(){
|
||||
}
|
||||
else{
|
||||
//reset
|
||||
emulatorReset();
|
||||
debugLog("Watchdog reset triggered, PC:0x%08X\n", flx68000GetPc());
|
||||
emulatorSoftReset();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user