diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs index ef1082f3bd..54a343ea22 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesApi.cs @@ -59,7 +59,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES Filename = "libsnes.wbx", Path = dllPath, SbrkHeapSizeKB = 4 * 1024, - InvisibleHeapSizeKB = 2048, + InvisibleHeapSizeKB = 8 * 1024, MmapHeapSizeKB = 32 * 1024, // TODO: see if we can safely make libco stacks smaller PlainHeapSizeKB = 2 * 1024, // TODO: wasn't there more in here? SealedHeapSizeKB = 128 * 1024 diff --git a/output64/dll/libsnes.wbx.gz b/output64/dll/libsnes.wbx.gz index 60aa0bb5e1..426e220108 100644 Binary files a/output64/dll/libsnes.wbx.gz and b/output64/dll/libsnes.wbx.gz differ diff --git a/waterbox/libsnes/bsnes/snes/alt/ppu-compatibility/ppu.cpp b/waterbox/libsnes/bsnes/snes/alt/ppu-compatibility/ppu.cpp index c39630a561..3dae68bff2 100644 --- a/waterbox/libsnes/bsnes/snes/alt/ppu-compatibility/ppu.cpp +++ b/waterbox/libsnes/bsnes/snes/alt/ppu-compatibility/ppu.cpp @@ -419,7 +419,7 @@ void PPU::initialize() oam = (uint8*)interface()->allocSharedMemory("OAM",544); cgram = (uint8*)interface()->allocSharedMemory("CGRAM",512); - surface = new uint32[512 * 512]; + surface = (uint32_t*)alloc_invisible(512 * 512 * sizeof(uint32_t)); output = surface + 16 * 512; alloc_tiledata_cache(); @@ -447,11 +447,7 @@ void PPU::initialize() } PPU::~PPU() { - delete[] surface; - free_tiledata_cache(); - interface()->freeSharedMemory(vram); - interface()->freeSharedMemory(oam); - interface()->freeSharedMemory(cgram); + abort(); } } diff --git a/waterbox/libsnes/bsnes/snes/alt/ppu-performance/ppu.cpp b/waterbox/libsnes/bsnes/snes/alt/ppu-performance/ppu.cpp index ef4617cb8b..a286e0b0dc 100644 --- a/waterbox/libsnes/bsnes/snes/alt/ppu-performance/ppu.cpp +++ b/waterbox/libsnes/bsnes/snes/alt/ppu-performance/ppu.cpp @@ -138,7 +138,7 @@ vram(nullptr), oam(nullptr), cgram(nullptr) { - surface = new uint32[512 * 512]; + surface = (uint32_t*)alloc_invisible(512 * 512 * sizeof(uint32_t)); output = surface + 16 * 512; display.width = 256; display.height = 224; @@ -147,10 +147,7 @@ cgram(nullptr) } PPU::~PPU() { - delete[] surface; - interface()->freeSharedMemory(vram); - interface()->freeSharedMemory(oam); - interface()->freeSharedMemory(cgram); + abort(); } void PPU::initialize() diff --git a/waterbox/libsnes/bsnes/snes/ppu/ppu.cpp b/waterbox/libsnes/bsnes/snes/ppu/ppu.cpp index f4bac6a44b..f78373e557 100644 --- a/waterbox/libsnes/bsnes/snes/ppu/ppu.cpp +++ b/waterbox/libsnes/bsnes/snes/ppu/ppu.cpp @@ -151,7 +151,7 @@ void PPU::initialize() vram = (uint8*)interface()->allocSharedMemory("VRAM",128 * 1024); oam = (uint8*)interface()->allocSharedMemory("OAM",544); cgram = (uint8*)interface()->allocSharedMemory("CGRAM",512); - surface = new uint32[512 * 512]; + surface = (uint32_t*)alloc_invisible(512 * 512 * sizeof(uint32_t)); output = surface + 16 * 512; } @@ -167,10 +167,7 @@ screen(*this) { } PPU::~PPU() { - delete[] surface; - interface()->freeSharedMemory(vram); - interface()->freeSharedMemory(oam); - interface()->freeSharedMemory(cgram); + abort(); } } diff --git a/waterbox/libsnes/bsnes/target-libsnes/libsnes.cpp b/waterbox/libsnes/bsnes/target-libsnes/libsnes.cpp index c5f8e53bdb..2de426e555 100644 --- a/waterbox/libsnes/bsnes/target-libsnes/libsnes.cpp +++ b/waterbox/libsnes/bsnes/target-libsnes/libsnes.cpp @@ -130,14 +130,13 @@ struct Interface : public SNES::Interface { ptrace(0), cart(nullptr, 0) { - buffer = new uint32_t[512 * 480]; - palette = new uint32_t[16 * 32768]; + buffer = (uint32_t*)alloc_invisible(512 * 480 * sizeof(uint32_t)); + palette = (uint32_t*)alloc_invisible(16 * 32768 * sizeof(uint32_t)); memset(&cdlInfo,0,sizeof(cdlInfo)); } ~Interface() { - delete[] buffer; - delete[] palette; + abort(); } };