@@ -106,7 +106,7 @@ void printRight(int x, int y, const unsigned char *str, FontPalette palette, boo
106106 * (dst -- ) = * (-- str ) | palette << 12 ;
107107}
108108
109- void printMsg (int y , const unsigned char * str , FontPalette palette , bool main ) {
109+ int printMsg (int y , const unsigned char * str , FontPalette palette , bool main ) {
110110 u16 * dst = main ? BG_MAP_RAM (15 ) : BG_MAP_RAM_SUB (15 );
111111 while (* str ) {
112112 bool endFound = false;
@@ -143,6 +143,7 @@ void printMsg(int y, const unsigned char *str, FontPalette palette, bool main) {
143143 }
144144 if (y == 0x18 ) break ;
145145 }
146+ return y ;
146147}
147148
148149void printChar (int x , int y , unsigned char c , FontPalette palette , bool main ) {
@@ -237,6 +238,40 @@ void clearScreen(bool main) {
237238 toncset16 (main ? BG_MAP_RAM (15 ) : BG_MAP_RAM_SUB (15 ), 0 , 0x300 );
238239}
239240
241+ bool boolQuestion (const unsigned char * str ) {
242+ clearScreen (false);
243+
244+ const int y = printMsg (0 , str , FONT_WHITE , false) + 1 ;
245+ if (igmText .rtl ) {
246+ printRight (0x20 , y , igmText .aYes , FONT_WHITE , false);
247+ printRight (0x20 , y + 1 , igmText .bNo , FONT_WHITE , false);
248+ } else {
249+ print (0 , y , igmText .aYes , FONT_WHITE , false);
250+ print (0 , y + 1 , igmText .bNo , FONT_WHITE , false);
251+ }
252+
253+ do {
254+ while (REG_VCOUNT != 191 ) mySwiDelay (100 );
255+ while (REG_VCOUNT == 191 ) mySwiDelay (100 );
256+ } while (KEYS & KEY_A );
257+
258+ waitKeys (KEY_A | KEY_B );
259+
260+ if (KEYS & KEY_A ) {
261+ do {
262+ while (REG_VCOUNT != 191 ) mySwiDelay (100 );
263+ while (REG_VCOUNT == 191 ) mySwiDelay (100 );
264+ } while (KEYS & KEY_A );
265+ return true;
266+ } else {
267+ do {
268+ while (REG_VCOUNT != 191 ) mySwiDelay (100 );
269+ while (REG_VCOUNT == 191 ) mySwiDelay (100 );
270+ } while (KEYS & KEY_B );
271+ }
272+ return false;
273+ }
274+
240275#define VRAM_x (bank ) ((u16*)(0x6800000 + (0x0020000 * (bank))))
241276#define VRAM_x_CR (bank ) (((vu8*)0x04000240)[bank])
242277
@@ -949,11 +984,13 @@ u32 inGameMenu(s32 *mainScreen, u32 consoleModel, s32 *exceptionRegisters) {
949984 while (sharedAddr [4 ] != 0 ) swiDelay (100 );
950985 break ;
951986 case MENU_RESET :
952- extern bool exceptionPrinted ;
953- exceptionPrinted = false;
954- res = 0x52534554 ; // TESR
955- sharedAddr [3 ] = res ;
956- sharedAddr [4 ] = 0x54455352 ; // RSET
987+ if (boolQuestion (igmText .resetGameMessage )) {
988+ extern bool exceptionPrinted ;
989+ exceptionPrinted = false;
990+ res = 0x52534554 ; // TESR
991+ sharedAddr [3 ] = res ;
992+ sharedAddr [4 ] = 0x54455352 ; // RSET
993+ }
957994 break ;
958995 case MENU_SCREENSHOT :
959996 screenshot ();
@@ -983,9 +1020,11 @@ u32 inGameMenu(s32 *mainScreen, u32 consoleModel, s32 *exceptionRegisters) {
9831020 ramViewer ();
9841021 break ;
9851022 case MENU_QUIT :
986- res = 0x54495845 ; // EXIT
987- sharedAddr [3 ] = res ;
988- sharedAddr [4 ] = 0x54495551 ; // QUIT
1023+ if (boolQuestion (igmText .quitGameMessage )) {
1024+ res = 0x54495845 ; // EXIT
1025+ sharedAddr [3 ] = res ;
1026+ sharedAddr [4 ] = 0x54495551 ; // QUIT
1027+ }
9891028 break ;
9901029 default :
9911030 break ;
0 commit comments