Skip to content

Commit

Permalink
mgba_sgb, shutdown fix
Browse files Browse the repository at this point in the history
after latest picoarch update, mgba is 50% smaller and uses less memory.
mgba_sgb bifurcated to a standalone core, which is half the size.

hopefully fixed the poweroff screen getting stuck, in short: fork bad vfork good.

mgba savestates on 32MB roms seem to work fine now, provided that the rom is stored in unpacked form.
  • Loading branch information
anzz1 committed May 30, 2023
1 parent bb4930c commit 8ea073e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions commits.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
5e600602 DinguxCommander
c57a554b SDL-1.2
c320273d dropbear-embedded
fb7d4e59 picoarch
ee40c1cc picoarch
76e45c34 libpicofe
88252880 libretro-common
15efb9df st-sdl
Expand All @@ -15,7 +15,8 @@ ad2c71d8 fceumm
a9376c86 gpsp
720b8ad4 mame2000
75c658cc mednafen_supafaust
314bf7b6 mgba
5d48e074 mgba
5d48e074 mgba_sgb
1f371e51 nxengine
1ebc39a1 pcsx_rearmed
44a6c678 picodrive
Expand Down
2 changes: 1 addition & 1 deletion extras/Emus/SGB.pak/launch.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

EMU_EXE=mgba
EMU_EXE=mgba_sgb
PERF_LEVEL=performance
CORES_PATH=$(dirname "$0")

Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ payload:
cp ./third-party/picoarch/output/beetle-supergrafx_libretro.so ./build/EXTRAS/Emus/SGX.pak/mednafen_supergrafx_libretro.so
cp ./third-party/picoarch/output/pokemini_libretro.so ./build/EXTRAS/Emus/PKM.pak/
cp ./third-party/picoarch/output/mgba_libretro.so ./build/EXTRAS/Emus/MGBA.pak/
cp ./third-party/picoarch/output/mgba_libretro.so ./build/EXTRAS/Emus/SGB.pak/
cp ./third-party/picoarch/output/mgba_sgb_libretro.so ./build/EXTRAS/Emus/SGB.pak/
cp ./third-party/picoarch/output/fake-08_libretro.so ./build/EXTRAS/Emus/P8.pak/
cp ./third-party/picoarch/output/smsplus-gx_libretro.so ./build/EXTRAS/Emus/GG.pak/smsplus_libretro.so
cp ./third-party/picoarch/output/mame2000_libretro.so ./build/EXTRAS/Emus/MAME.pak/
Expand Down
8 changes: 6 additions & 2 deletions src/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,13 +894,17 @@ int preventAutosleep(void) {

void powerOff(void) {
if (can_poweroff) {
pid_t pid = -1;
char* msg = exists(kAutoResumePath) ? "Quicksave created,\npowering off" : "Powering off";
SDL_FillRect(screen, NULL, 0);
GFX_blitBodyCopy(screen, msg, 0,0,Screen.width,Screen.height);
SDL_Flip(screen);
sleep(1);
system("shutdown");
while (1) pause();
while (pid < 0) {
pid = vfork();
}
if (pid == 0) execlp("shutdown", "shutdown", NULL);
_exit(0);
}
}

Expand Down

0 comments on commit 8ea073e

Please sign in to comment.