Skip to content

Commit

Permalink
Merge remote-tracking branch 'irixxxx/master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
irixxxx committed Jun 15, 2024
2 parents dab9c6e + 924708e commit ac3a4bf
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 18 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ cfg/
libs/
obj/
.opk_data
.od_data
PicoDrive
PicoDrive.opk
picodrive
picodrive_libretro*
PicoDrive*.opk
PicoDrive*.zip
pico_int_offs.h
amalgamate
textfilter
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ PicoDrive.zip: $(TARGET)
mkdir .od_data
cp -r platform/linux/skin .od_data
cp platform/game_def.cfg .od_data
cp $< .od_data/PicoDrive
$(STRIP) .od_data/PicoDrive
$(STRIP) $< -o .od_data/picodrive
cd .od_data && zip -9 -r ../$@ *
all: PicoDrive.zip
endif
Expand All @@ -128,8 +127,7 @@ ifeq "$(PLATFORM)" "opendingux"
mkdir .od_data
cp -r platform/opendingux/data/. .od_data
cp platform/game_def.cfg .od_data
cp $< .od_data/PicoDrive
$(STRIP) .od_data/PicoDrive
$(STRIP) $< -o .od_data/picodrive
.PHONY: .od_data

ifneq (,$(filter %__DINGUX__, $(CFLAGS)))
Expand Down Expand Up @@ -339,7 +337,9 @@ ZSTD_OBJS += $(ZSTD)/common/entropy_common.o $(ZSTD)/common/error_private.o
ZSTD_OBJS += $(ZSTD)/common/fse_decompress.o $(ZSTD)/common/xxhash.o
ZSTD_OBJS += $(ZSTD)/common/zstd_common.o
ZSTD_OBJS += $(ZSTD)/decompress/huf_decompress.o
ifneq (,$(filter x86%, $(ARCH)))
ZSTD_OBJS += $(ZSTD)/decompress/huf_decompress_amd64.o
endif
ZSTD_OBJS += $(ZSTD)/decompress/zstd_ddict.o
ZSTD_OBJS += $(ZSTD)/decompress/zstd_decompress_block.o
ZSTD_OBJS += $(ZSTD)/decompress/zstd_decompress.o
Expand Down
2 changes: 1 addition & 1 deletion Makefile.libretro
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ endif
# x86/x86_64 generic
else ifneq (,$(findstring x86,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so
ARCH := 86
ARCH := x86
fpic := -fPIC
SHARED := -shared
CFLAGS += -DFAMEC_NO_GOTOS
Expand Down
8 changes: 7 additions & 1 deletion cpu/fame/famec.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
#define ROR_33(A, C) (LSR_32(A, C) | LSL_32(A, 33-(C)))

#ifndef FAMEC_NO_GOTOS
#define NEXT do { \
#define NEXT { \
FETCH_WORD(Opcode); \
goto *JumpTable[Opcode]; \
}
Expand Down Expand Up @@ -799,6 +799,8 @@ int fm68k_emulate(M68K_CONTEXT *ctx, int cycles, fm68k_call_reason reason)
case fm68k_reason_emulate:
break;
}
PC = ctx->PC;
BasePC = ctx->BasePC;
#endif // FAMEC_NO_GOTOS

// won't emulate double fault
Expand Down Expand Up @@ -932,6 +934,10 @@ int fm68k_emulate(M68K_CONTEXT *ctx, int cycles, fm68k_call_reason reason)
famec_End:
ctx->sr = GET_SR;
ctx->pc = GET_PC;
#ifndef FAMEC_NO_GOTOS
ctx->PC = PC;
ctx->BasePC = BasePC;
#endif

ctx->execinfo &= ~M68K_RUNNING;

Expand Down
4 changes: 0 additions & 4 deletions pico/cart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,10 +1341,6 @@ static void PicoCartDetect(const char *carthw_cfg)
memset(Pico.sv.data, 0xff, Pico.sv.size);
}

// Unusual region 'code'
if (rom_strcmp(0x1f0, "EUROPE") == 0 || rom_strcmp(0x1f0, "Europe") == 0)
*(u32 *) (Pico.rom + 0x1f0) = CPU_LE4(0x20204520);

// tweak for Blackthorne: master SH2 overwrites stack of slave SH2 being in PWM
// interrupt. On real hardware, nothing happens since slave fetches the values
// it has written from its cache, but picodrive doesn't emulate caching.
Expand Down
8 changes: 7 additions & 1 deletion pico/pico.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,21 @@ PICO_INTERNAL void PicoDetectRegion(void)
{
int support=0, hw=0, i;
unsigned char pal=0;
char *pr = (char *)(Pico.rom + 0x1f0);

if (PicoIn.regionOverride)
{
support = PicoIn.regionOverride;
}
else if (strcmp(pr, "EUROPE") == 0 || strcmp(pr, "Europe") == 0)
{
// Unusual cartridge region 'code'
support|=8;
}
else
{
// Read cartridge region data:
unsigned short *rd = (unsigned short *)(Pico.rom + 0x1f0);
unsigned short *rd = (unsigned short *)pr;
int region = (rd[0] << 16) | rd[1];

for (i = 0; i < 4; i++)
Expand Down
2 changes: 1 addition & 1 deletion platform/opendingux/data/PicoDrive.dge
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/sh
echo 0 > /proc/sys/kernel/printk
./PicoDrive "$@"
./picodrive "$@"
sync
2 changes: 1 addition & 1 deletion platform/opendingux/data/default.gcw0.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Type=Application
Name=Picodrive
Comment=A mega drive/genesis emulator
Exec=PicoDrive %f
Exec=picodrive %f
Icon=megadrive
Terminal=false
Categories=emulators;
Expand Down
2 changes: 1 addition & 1 deletion platform/opendingux/data/default.lepus.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Type=Application
Name=Picodrive
Comment=A mega drive/genesis emulator
Exec=PicoDrive %f
Exec=picodrive %f
Icon=megadrive
Terminal=false
Categories=emulators;
Expand Down
2 changes: 1 addition & 1 deletion platform/opendingux/data/default.retrofw.desktop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Picodrive
Comment=A mega drive/genesis emulator
Exec=PicoDrive %f
Exec=picodrive %f
Icon=megadrive
Categories=emulators;
X-OD-Manual=
Expand Down
2 changes: 1 addition & 1 deletion platform/opendingux/data/default.rg99.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Type=Application
Name=Picodrive
Comment=A mega drive/genesis emulator
Exec=PicoDrive %f
Exec=picodrive %f
Icon=megadrive
Terminal=false
Categories=emulators;
Expand Down
2 changes: 1 addition & 1 deletion tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# gcw0,opendingux:ghcr.io/irixxxx/toolchain-opendingux
# miyoo: ghcr.io/irixxxx/toolchain-miyoo
# psp: docker.io/pspdev/pspdev
# psp: docker.io/ps2dev/ps2dev
# ps2: docker.io/ps2dev/ps2dev
# pandora: ghcr.io/irixxxx/toolchain-pandora
# odbeta-gcw0: ghcr.io/irixxxx/toolchain-odbeta-gcw0
# odbeta-lepus: ghcr.io/irixxxx/toolchain-odbeta-lepus
Expand Down

0 comments on commit ac3a4bf

Please sign in to comment.