Skip to content

Commit

Permalink
fixed crash on home menu close
Browse files Browse the repository at this point in the history
  • Loading branch information
elhobbs committed May 6, 2017
1 parent c937091 commit cdefba3
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 6 deletions.
45 changes: 44 additions & 1 deletion Debug/prboom.log
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
 make[1]: Nothing to be done for `all'.
 d_main.c
arm-none-eabi-gcc -MMD -MP -MF /c/devl/prboom3ds/build/d_main.d -g -Wall -O2 -mword-relocations -save-temps -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -I/c/devl/prboom3ds/include -I/c/devl/prboom3ds/src -I/c/devl/prboom3ds/arm9/include -I/c/devl/prboom3ds/arm11/include -I/c/devl/prboom3ds/khax -I/c/devkitPro/libctru/include -I/c/devl/prboom3ds/build -DARM11 -D_3DS -DHAVE_CONFIG_H -c /c/devl/prboom3ds/src/d_main.c -o d_main.o
c:/devl/prboom3ds/src/d_main.c: In function 'D_PostEvent':
c:/devl/prboom3ds/src/d_main.c(160):6: warning: value computed is not used [-Wunused-value]
) ||
^~
c:/devl/prboom3ds/src/d_main.c: In function 'D_Wipe':
c:/devl/prboom3ds/src/d_main.c(194):4: warning: implicit declaration of function 'copy_screen' [-Wimplicit-function-declaration]
copy_screen(GFX_LEFT);
^~~~~~~~~~~
c:/devl/prboom3ds/src/d_main.c: In function 'D_Display':
c:/devl/prboom3ds/src/d_main.c(240):5: warning: case label value is less than minimum value for type
case -1:
^~~~
c:/devl/prboom3ds/src/d_main.c: In function 'CheckIWAD':
c:/devl/prboom3ds/src/d_main.c(652):9: warning: implicit declaration of function 'access_3ds' [-Wimplicit-function-declaration]
if ( !access_3ds (iwadname,R_OK) )
^~~~~~~~~~
c:/devl/prboom3ds/src/d_main.c: In function 'find_wads':
c:/devl/prboom3ds/src/d_main.c(804):22: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
wads_found_path[i] = iwad;
^
c:/devl/prboom3ds/src/d_main.c: In function 'ds_game_choose':
c:/devl/prboom3ds/src/d_main.c(889):26: warning: return makes pointer from integer without a cast [-Wint-conversion]
return wads_found_path[wads_found[pos]];
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
c:/devl/prboom3ds/src/d_main.c(882):8: warning: unused variable 'dhcp' [-Wunused-variable]
int dhcp = 0;
^~~~
ds_main.c
arm-none-eabi-gcc -MMD -MP -MF /c/devl/prboom3ds/build/ds_main.d -g -Wall -O2 -mword-relocations -save-temps -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -I/c/devl/prboom3ds/include -I/c/devl/prboom3ds/src -I/c/devl/prboom3ds/arm9/include -I/c/devl/prboom3ds/arm11/include -I/c/devl/prboom3ds/khax -I/c/devkitPro/libctru/include -I/c/devl/prboom3ds/build -DARM11 -D_3DS -DHAVE_CONFIG_H -c /c/devl/prboom3ds/arm9/source/ds_main.c -o ds_main.o
c:/devl/prboom3ds/arm9/source/ds_main.c: In function 'sys_init':
c:/devl/prboom3ds/arm9/source/ds_main.c(80):2: warning: implicit declaration of function 'dkeyboard_init' [-Wimplicit-function-declaration]
dkeyboard_init();
^~~~~~~~~~~~~~
c:/devl/prboom3ds/arm9/source/ds_main.c: In function 'main':
c:/devl/prboom3ds/arm9/source/ds_main.c(138):10: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
myargv = argv;
^
c:/devl/prboom3ds/arm9/source/ds_main.c(142):10: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
myargv = "\0\0\0\0";// argv;
^
linking prboom3ds.elf
built ... prboom3ds.3dsx
13 changes: 13 additions & 0 deletions arm9/source/ds_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void drawFrame()
}

int audio_initialized = 0;
static u32 old_time_limit = UINT32_MAX;

static void sys_init() {
gfxInitDefault();
Expand Down Expand Up @@ -90,6 +91,12 @@ static void sys_init() {

osSetSpeedupEnable(true);
//while (1);
//stolen from FBI - thanks steveice10
APT_GetAppCpuTimeLimit(&old_time_limit);
Result cpuRes = APT_SetAppCpuTimeLimit(30);
if (R_FAILED(cpuRes)) {
printf("Failed to set syscore CPU time limit: %08lX", cpuRes);
}
}

void I_Quit() {
Expand All @@ -100,6 +107,12 @@ void I_Quit() {
csndExit();
printf("csndExit ok!\n");
}
if (old_time_limit != UINT32_MAX) {
APT_SetAppCpuTimeLimit(old_time_limit);
}

gfxSet3D(false);
osSetSpeedupEnable(false);
//ndspExit();
#if 0
khaxExit();
Expand Down
Binary file modified prboom3ds.3ds
Binary file not shown.
Binary file modified prboom3ds.3dsx
Binary file not shown.
Binary file modified prboom3ds.cia
Binary file not shown.
5 changes: 0 additions & 5 deletions src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,6 @@ static void D_DoomLoop(void)
//gspWaitForEvent(GSPEVENT_VBlank0, false);
}

gfxExit();
irrstExit();
hidExit();
aptExit();
srvExit();
}

//
Expand Down

0 comments on commit cdefba3

Please sign in to comment.