From b7cc9ca58b7a1114728ef27d392dc0522e44f9b7 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 23 Dec 2013 10:19:36 +0100 Subject: [PATCH] PANDORA: Fix nvram save at exit --- newdc/sdl/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/newdc/sdl/main.cpp b/newdc/sdl/main.cpp index c0d925346..8953c55a4 100755 --- a/newdc/sdl/main.cpp +++ b/newdc/sdl/main.cpp @@ -75,6 +75,7 @@ s8 joyx[4],joyy[4]; u8 rt[4],lt[4]; extern bool KillTex; +extern void dc_term(); enum DCPad { Btn_C = 1, @@ -328,7 +329,15 @@ bool HandleEvents(u32 port) { if (keys[3]) { kcode[port] &= ~DPad_Left; } if (keys[4]) { kcode[port] &= ~DPad_Right; } if (keys[12]){ kcode[port] &= ~Btn_Start; } - if (keys[9]){ die("death by escape key"); } + if (keys[9]){ + //die("death by escape key"); + //printf("death by escape key\n"); + // clean exit + dc_term(); + + // is there a proper way to exit? dc_term() doesn't end the dc_run() loop it seems + die("death by escape key"); + } if (keys[10]) rt[port]=255; if (keys[11]) lt[port]=255;