Skip to content

Commit

Permalink
SWITCH: Add option to display online instruction manual
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Jul 18, 2019
1 parent 172ec80 commit 3664604
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
set(CMAKE_VERBOSE_MAKEFILE OFF)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 96)
set(VERSION_MINOR 97)

if(BUILD_PSP2)
if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
Expand Down
10 changes: 9 additions & 1 deletion README.MD
Expand Up @@ -4,6 +4,10 @@ On the Switch, since v1.84, please use nsp injection to start uae4all2, otherwis

Recent Changes
======
1.97 (Switch only)

- add option to main menu that displays online instruction manual (opens web browser)

1.96

- increase maximum displayed lines from 270 to 286, useful for overscan games like Babeanoid
Expand Down Expand Up @@ -289,7 +293,7 @@ Compiling

* Switch:
* Install DevkitPro: https://devkitpro.org/wiki/devkitPro_pacman#Using_Pacman
* Install required libs (libnx 1.6.0 and recent sdl2 are required):
* Install required libs (libnx >1.6.0 and recent sdl2 are required):
```
sudo -E dkp-pacman -S switch-dev
sudo -E dkp-pacman -S switch-sdl2
Expand All @@ -314,6 +318,10 @@ Compiling

CHANGELOG
=====
1.97 (Switch only)

- add option to main menu that displays online instruction manual (opens web browser)

1.96

- increase maximum displayed lines from 270 to 286, useful for overscan games like Babeanoid
Expand Down
71 changes: 52 additions & 19 deletions src/gp2x/menu/menu_main.cpp
Expand Up @@ -126,6 +126,9 @@ static const char *text_str_more= "More Options";
#else
static const char *text_str_more= "More Options (B)";
#endif
#if defined(__SWITCH__)
static const char *text_str_releasenotes= "Release Notes";
#endif

int mainMenu_case=-1;
int mainMenu_system=-1;
Expand Down Expand Up @@ -233,6 +236,7 @@ static void draw_mainMenu(int c)
16 = save general config
17 = save config current game
18 = quit
19 = release notes (Switch only)
*/
static int b=0;
int bb=(b%6)/3;
Expand All @@ -250,7 +254,8 @@ static void draw_mainMenu(int c)

text_draw_background();
text_draw_window(leftMargin-1,menuLine-1,35,40,text_str_title);
// 1

// 0
if ((c==0)&&(bb))
write_text_inv(leftMargin,menuLine,text_str_df0);
else
Expand All @@ -260,7 +265,7 @@ static void draw_mainMenu(int c)
else
write_text_inv(13,menuLine,filename0);

// 2
// 1
menuLine+=2;
if(nr_drives > 1)
{
Expand All @@ -274,7 +279,7 @@ static void draw_mainMenu(int c)
write_text_inv(13,menuLine,filename1);
}

// 3
// 2
menuLine+=2;
if(nr_drives > 2)
{
Expand All @@ -288,7 +293,7 @@ static void draw_mainMenu(int c)
write_text_inv(13,menuLine,filename2);
}

// 4
// 3
menuLine+=2;
if(nr_drives > 3)
{
Expand All @@ -306,13 +311,13 @@ static void draw_mainMenu(int c)
write_text(leftMargin,menuLine,text_str_separator);
menuLine++;

// 5
// 4
if ((c==4)&&(bb))
write_text_inv(leftMargin,menuLine,text_str_eject);
else
write_text(leftMargin, menuLine,text_str_eject);

// 6
// 5
menuLine+=2;
write_text(leftMargin,menuLine,"Number of Drives");

Expand Down Expand Up @@ -340,7 +345,7 @@ static void draw_mainMenu(int c)
write_text(leftMargin,menuLine,text_str_separator);
menuLine++;

// 7
// 6
write_text(leftMargin,menuLine,"Preset System Setup:");

if ((mainMenu_system!=1)&&((c!=6)||(bb)))
Expand All @@ -353,35 +358,35 @@ static void draw_mainMenu(int c)
else
write_text(tabstop8,menuLine,"A1200");

// 8
// 7
menuLine+=2;
if ((c==7)&&(bb))
write_text_inv(leftMargin,menuLine,text_str_hdnmem);
else
write_text(leftMargin,menuLine,text_str_hdnmem);

// 9
// 8
menuLine+=2;
if ((c==8)&&(bb))
write_text_inv(leftMargin,menuLine,text_str_display);
else
write_text(leftMargin,menuLine,text_str_display);

// 10
// 9
menuLine+=2;
if ((c==9)&&(bb))
write_text_inv(leftMargin,menuLine,text_str_savestates);
else
write_text(leftMargin,menuLine,text_str_savestates);

// 11
// 10
menuLine+=2;
if ((c==10)&&(bb))
write_text_inv(leftMargin,menuLine,text_str_custom);
else
write_text(leftMargin,menuLine,text_str_custom);

// 12
// 11
menuLine+=2;
if ((c==11)&&(bb))
write_text_inv(leftMargin,menuLine,text_str_more);
Expand All @@ -391,7 +396,7 @@ static void draw_mainMenu(int c)
menuLine++;
write_text(leftMargin,menuLine,text_str_separator);

// 13
// 12
menuLine++;
if ((c==12)&&(bb))
write_text_inv(leftMargin,menuLine,text_str_reset);
Expand All @@ -401,7 +406,7 @@ static void draw_mainMenu(int c)
menuLine++;
write_text(leftMargin,menuLine,text_str_separator);

// 14
// 13
menuLine++;
write_text(leftMargin,menuLine,"Config");

Expand All @@ -410,26 +415,26 @@ static void draw_mainMenu(int c)
else
write_text(leftMargin+7,menuLine,"Load");

// 15
// 14
if ((c==14)&&(bb))
write_text_inv(leftMargin+13,menuLine,"Save As");
else
write_text(leftMargin+13,menuLine,"Save As");

// 16
// 15
if ((c==15)&&(bb))
write_text_inv(leftMargin+22,menuLine,"Delete");
else
write_text(leftMargin+22,menuLine,"Delete");

// 17
// 16
menuLine+=2;
if ((c==16)&&(bb))
write_text_inv(leftMargin+7,menuLine,"Save General");
else
write_text(leftMargin+7,menuLine,"Save General");

// 18
// 17
if ((c==17)&&(bb))
write_text_inv(leftMargin+20,menuLine,"Save Per-Game");
else
Expand All @@ -438,13 +443,21 @@ static void draw_mainMenu(int c)
menuLine++;
write_text(leftMargin,menuLine,text_str_separator);

// 19
// 18
menuLine++;
if ((c==18)&&(bb))
write_text_inv(leftMargin,menuLine,text_str_exit);
else
write_text(leftMargin,menuLine,text_str_exit);

#ifdef __SWITCH__
// 19
if ((c==19)&&(bb))
write_text_inv(leftMargin+20,menuLine,text_str_releasenotes);
else
write_text(leftMargin+20,menuLine,text_str_releasenotes);
#endif

menuLine++;
write_text(leftMargin,menuLine,text_str_separator);

Expand Down Expand Up @@ -711,7 +724,11 @@ SDL_ANDROID_SetScreenKeyboardShown(1);
c=2;
else
c--;
#ifdef __SWITCH__
if (c < 0) c = 19;
#else
if (c < 0) c = 18;
#endif
}
else if (down)
{
Expand All @@ -722,7 +739,11 @@ SDL_ANDROID_SetScreenKeyboardShown(1);
else if(nr_drives<2 && c==0)
c=4;
else
#ifdef __SWITCH__
c=(c+1)%20;
#else
c=(c+1)%19;
#endif
}

/* New Menu
Expand All @@ -745,6 +766,7 @@ SDL_ANDROID_SetScreenKeyboardShown(1);
16 = save general config
17 = save config current game
18 = exit
19 = release notes (Switch only)
*/
switch(c)
{
Expand Down Expand Up @@ -916,6 +938,17 @@ SDL_ANDROID_SetScreenKeyboardShown(1);
mainMenu_case=MAIN_MENU_CASE_QUIT;
end=1;
}
break;
#ifdef __SWITCH__
case 19:
if (hit0)
{
WebWifiConfig conf;
webWifiCreate(&conf, NULL, "https://github.com/rsn8887/uae4all2/releases/latest", 0, 0);
webWifiShow(&conf, NULL);
}
break;
#endif
}
if (back_c>=0)
{
Expand Down
4 changes: 4 additions & 0 deletions src/main.cpp
Expand Up @@ -227,6 +227,9 @@ void do_leave_program (void)
SDL_Quit ();
#endif
memory_cleanup ();
#ifdef __SWITCH__
socketExit();
#endif
}

void start_program (void)
Expand Down Expand Up @@ -263,6 +266,7 @@ void real_main (int argc, char **argv)

#if defined(__SWITCH__)
appletLockExit();
socketInitializeDefault();
#endif

#ifdef USE_SDL
Expand Down

0 comments on commit 3664604

Please sign in to comment.