diff --git a/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs b/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs index b91c903f22..582eb81713 100644 --- a/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs +++ b/BizHawk.Emulation.Cores/Consoles/Sega/PicoDrive/PicoDrive.cs @@ -51,11 +51,11 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive _core = PreInit(new PeRunnerOptions { Filename = "picodrive.wbx", - SbrkHeapSizeKB = 4096, - SealedHeapSizeKB = 4096, - InvisibleHeapSizeKB = 4096, - MmapHeapSizeKB = 65536, - PlainHeapSizeKB = 4096, + SbrkHeapSizeKB = 64, + SealedHeapSizeKB = 18 * 1024, + InvisibleHeapSizeKB = 1024, + MmapHeapSizeKB = 4096, + PlainHeapSizeKB = 64, }); if (has32xBios) diff --git a/waterbox/picodrive/Makefile b/waterbox/picodrive/Makefile index 313ccb3961..cc07e63829 100644 --- a/waterbox/picodrive/Makefile +++ b/waterbox/picodrive/Makefile @@ -6,7 +6,7 @@ CCFLAGS:=-I. \ -std=c99 -fomit-frame-pointer -fvisibility=hidden \ -falign-functions=16 \ -DLSB_FIRST -DNDEBUG -DEMU_F68K -D_USE_CZ80 \ - -O0 -g + -O3 -flto TARGET = picodrive.wbx @@ -31,8 +31,8 @@ $(TARGET).in: $(OBJS) @$(CC) -o $@ $(LDFLAGS) $(CCFLAGS) $(OBJS) ../emulibc/libemuhost.so $(TARGET): $(TARGET).in -# strip $< -o $@ -R /4 -R /14 -R /29 -R /41 -R /55 -R /67 -R /78 -R /89 -R /104 - cp $< $@ + strip $< -o $@ -R /4 -R /14 -R /29 -R /41 -R /55 -R /67 -R /78 -R /89 -R /104 +# cp $< $@ clean: rm -rf $(OBJ_DIR) diff --git a/waterbox/picodrive/bizhawk.c b/waterbox/picodrive/bizhawk.c index 86970d5893..9efd46520f 100644 --- a/waterbox/picodrive/bizhawk.c +++ b/waterbox/picodrive/bizhawk.c @@ -143,7 +143,7 @@ ECL_EXPORT int Init(int cd) p32x_bios_m = TryLoadBios("32x.m"); p32x_bios_s = TryLoadBios("32x.s"); - PicoOpt = POPT_EN_FM | POPT_EN_PSG | POPT_EN_Z80 | POPT_EN_STEREO | POPT_ACC_SPRITES | POPT_DIS_32C_BORDER | POPT_EN_MCD_PCM | POPT_EN_MCD_CDDA | POPT_EN_MCD_GFX | POPT_EN_32X | POPT_EN_PWM; + PicoOpt = POPT_EN_FM | POPT_EN_PSG | POPT_EN_Z80 | POPT_EN_STEREO | POPT_ACC_SPRITES | POPT_DIS_32C_BORDER | POPT_EN_MCD_PCM | POPT_EN_MCD_CDDA | POPT_EN_MCD_GFX | POPT_EN_32X | POPT_EN_PWM | POPT_DIS_IDLE_DET; PicoInit(); if (cd) diff --git a/waterbox/picodrive/pico/cart.c b/waterbox/picodrive/pico/cart.c index 926212e0b9..6288823af4 100644 --- a/waterbox/picodrive/pico/cart.c +++ b/waterbox/picodrive/pico/cart.c @@ -9,6 +9,7 @@ #include "pico_int.h" #include +#include static const uint32_t crc32tab[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, @@ -188,7 +189,7 @@ static unsigned char *PicoCartAlloc(int filesize, int is_sms) rom_alloc_size += 4; // padding for out-of-bound exec protection // Allocate space for the rom plus padding - rom = malloc(rom_alloc_size); + rom = alloc_sealed(rom_alloc_size); return rom; }