Skip to content

Commit

Permalink
Various changes
Browse files Browse the repository at this point in the history
- Fixed OPK desktop settings
- Cleaned up menu keybind related code to better support the
bittboy/pocketgo versions
- Changed version label to r572u4
- Updated manual and readme
  • Loading branch information
hi-ban committed Jan 27, 2020
1 parent 034ecc6 commit efcf397
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 53 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gameboy emulator for handheld devices, using a modified Gambatte core (based on r572).

Working on the following systems:
- GCW Zero / RG-350 / GKD350H
- GCW Zero / RG-350 / PocketGo2 / PlayGo / MiyooMax / GKD350H
- RS-97 / RS-97 Plus / RS-97 Pro / RetroGame Plus / RetroGame Pro / LDK Vertical / LDK Landscape/ RG-300 and other RetroFW devices
- New Bittboy / PocketGo / MiYoo
4 changes: 2 additions & 2 deletions build_multi_opk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ echo "cd gambatte_sdl && scons"
(cd gambatte_sdl && scons -Q target=opendingux)
mv gambatte_sdl/gambatte_sdl gambatte_sdl/gambatte.opendingux

rm -f gambatte-multi-r572u3-$BDAT.opk
rm -f gambatte-multi-r572u4-$BDAT.opk

mksquashfs ./dist/gcw0/default.gcw0.desktop ./dist/retrofw/default.retrofw.desktop ./dist/retrofw/gb.retrofw.desktop ./dist/retrofw/gbc.retrofw.desktop ./gambatte_sdl/gambatte.opendingux ./gambatte_sdl/gambatte.retrofw ./dist/gcw0/gambatte.png ./dist/gcw0/manual.txt ./dist/retrofw/gambatte.man.txt gambatte-multi-r572u3-$BDAT.opk -all-root -no-xattrs -noappend -no-exports
mksquashfs ./dist/gcw0/default.gcw0.desktop ./dist/retrofw/default.retrofw.desktop ./dist/retrofw/gb.retrofw.desktop ./dist/retrofw/gbc.retrofw.desktop ./gambatte_sdl/gambatte.opendingux ./gambatte_sdl/gambatte.retrofw ./dist/gcw0/gambatte.png ./dist/gcw0/manual.txt ./dist/retrofw/gambatte.man.txt gambatte-multi-r572u4-$BDAT.opk -all-root -no-xattrs -noappend -no-exports

echo "cd gambatte_sdl && scons -c"
(cd gambatte_sdl && scons -c)
Expand Down
4 changes: 2 additions & 2 deletions build_opendingux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ echo "cd gambatte_sdl && scons"
(cd gambatte_sdl && scons -Q target=opendingux)
mv gambatte_sdl/gambatte_sdl gambatte_sdl/gambatte.opendingux

rm -f gambatte-opendingux-r572u3-$BDAT.opk
rm -f gambatte-opendingux-r572u4-$BDAT.opk

mksquashfs ./dist/gcw0/default.gcw0.desktop ./gambatte_sdl/gambatte.opendingux ./dist/gcw0/gambatte.png ./dist/gcw0/manual.txt gambatte-opendingux-r572u3-$BDAT.opk -all-root -no-xattrs -noappend -no-exports
mksquashfs ./dist/gcw0/default.gcw0.desktop ./gambatte_sdl/gambatte.opendingux ./dist/gcw0/gambatte.png ./dist/gcw0/manual.txt gambatte-opendingux-r572u4-$BDAT.opk -all-root -no-xattrs -noappend -no-exports

echo "cd gambatte_sdl && scons -c"
(cd gambatte_sdl && scons -c)
Expand Down
2 changes: 1 addition & 1 deletion build_retrofw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sed "s/^Version:.*/Version: `date +%Y%m%d`/" dist/retrofw/control > /tmp/.gambat
tar --owner=0 --group=0 -czvf /tmp/.gambatte-ipk/control.tar.gz -C /tmp/.gambatte-ipk/ control
tar --owner=0 --group=0 -czvf /tmp/.gambatte-ipk/data.tar.gz -C /tmp/.gambatte-ipk/root/ .
echo 2.0 > /tmp/.gambatte-ipk/debian-binary
ar r gambatte-retrofw-r572u3-$BDAT.ipk /tmp/.gambatte-ipk/control.tar.gz /tmp/.gambatte-ipk/data.tar.gz /tmp/.gambatte-ipk/debian-binary
ar r gambatte-retrofw-r572u4-$BDAT.ipk /tmp/.gambatte-ipk/control.tar.gz /tmp/.gambatte-ipk/data.tar.gz /tmp/.gambatte-ipk/debian-binary

echo "cd gambatte_sdl && scons -c"
(cd gambatte_sdl && scons -c)
Expand Down
2 changes: 1 addition & 1 deletion dist/gcw0/manual.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ File Paths
------------------------------------------------

- Emulator Settings are saved in:
$HOME/.gambatte/config.cfg
$HOME/.gambatte/settings/

- Savestates and game saves are stored in:
$HOME/.gambatte/saves/
Expand Down
3 changes: 2 additions & 1 deletion dist/retrofw/default.retrofw.desktop
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[Desktop Entry]
Name=Gambatte
Comment=GB/GBC emulator
Exec=gambatte.retrofw %f
Exec=gambatte.retrofw
Terminal=false
Type=Application
StartupNotify=true
Icon=gambatte
Categories=emulators;
X-OD-Manual=gambatte.man.txt
X-OD-Selector=/home/retrofw/roms/gb
X-OD-Filter=.zip,.gb,.gbc
2 changes: 1 addition & 1 deletion dist/retrofw/gambatte.man.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ File Paths
------------------------------------------------

- Emulator Settings are saved in:
$HOME/.gambatte/config.cfg
$HOME/.gambatte/settings/

- Savestates and game saves are stored in:
$HOME/.gambatte/saves/
Expand Down
3 changes: 2 additions & 1 deletion dist/retrofw/gb.retrofw.desktop
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[Desktop Entry]
Name=GB
Comment=Gambatte emulator
Exec=gambatte.retrofw %f
Exec=gambatte.retrofw
Terminal=false
Type=Application
StartupNotify=true
Icon=gambatte
Categories=emulators.systems;
X-OD-Manual=gambatte.man.txt
X-OD-Selector=/home/retrofw/roms/gb
X-OD-Filter=.zip,.gb
3 changes: 2 additions & 1 deletion dist/retrofw/gbc.retrofw.desktop
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[Desktop Entry]
Name=GBC
Comment=Gambatte emulator
Exec=gambatte.retrofw %f
Exec=gambatte.retrofw
Terminal=false
Type=Application
StartupNotify=true
Icon=gambatte
Categories=emulators.systems;
X-OD-Manual=gambatte.man.txt
X-OD-Selector=/home/retrofw/roms/gbc
X-OD-Filter=.zip,.gbc
2 changes: 1 addition & 1 deletion gambatte_sdl/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ conf = env.Configure()
conf.CheckLib('z')
conf.Finish()

version_str_def = [ 'GAMBATTE_SDL_VERSION_STR', r'\"r572u3\"' ]
version_str_def = [ 'GAMBATTE_SDL_VERSION_STR', r'\"r572u4\"' ]

env.Program('gambatte_sdl',
[env.Object('src/gambatte_sdl.cpp',
Expand Down
2 changes: 1 addition & 1 deletion gambatte_sdl/builddate.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILDDATE "20200115-012225"
#define BUILDDATE "20200127-194104"
42 changes: 5 additions & 37 deletions gambatte_sdl/libmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ int menu_main(menu_t *menu) {
textanim_reset();
}
break;
case SDLK_LCTRL: /* A button - TA button in bittboy*/
case KEYMAP_MENUACCEPT: // button used to accept/select a menu item
if(menuin == -1){
if (menu->entries[menu->selected_entry]->callback != NULL) {
footer_alt = 0;
Expand All @@ -489,7 +489,7 @@ int menu_main(menu_t *menu) {
}
}
break;
case SDLK_LALT: /* B button - A button in bittboy, being used as 'back' */
case KEYMAP_MENUCANCEL: // button used to cancel/go back
if(menuin == -1){
if (menu->back_callback != NULL) {
footer_alt = 0;
Expand Down Expand Up @@ -698,14 +698,14 @@ int menu_cheat(menu_t *menu) {
}
dirty = 1;
break;
case SDLK_LCTRL: /* A button - TA button in bittboy*/
case KEYMAP_MENUACCEPT: // button used to accept/select a menu item
if (menu->entries[menu->selected_entry]->callback != NULL) {
footer_alt = 0;
menu->entries[menu->selected_entry]->callback(menu);
redraw_cheat(menu);
}
break;
case SDLK_LALT: /* B button - A button in bittboy, being used as 'back' */
case KEYMAP_MENUCANCEL: // button used to cancel/go back
if (menu->back_callback != NULL) {
if (editmode == 1){
footer_alt = 0;
Expand All @@ -715,7 +715,7 @@ int menu_cheat(menu_t *menu) {
}
dirty = 1;
break;
case SDLK_RETURN: /* start button - Apply*/
case SDLK_RETURN: // start button - Apply
if (collimit == 11){ // if gamegenie
if (menu->entries[menu->n_entries -1]->callback != NULL) {
menu->entries[menu->n_entries -1]->callback(menu);
Expand Down Expand Up @@ -904,23 +904,6 @@ static void display_menu(SDL_Surface *surface, menu_t *menu) {
num_selectable++; // count num of selectable entries
}
}
#ifdef VERSION_BITTBOY
if(strcmp(menu->title, " Game Genie ") == 0){
SFont_WriteCenter(surface, font, 17 * font_height, "A-Cancel Apply-TA"); // footer while in "Apply Cheats" confirmation screen
} else if((strcmp(menu->title, " Settings ") == 0) || (strcmp(menu->title, " Per-Game Settings ") == 0)){
SFont_WriteCenter(surface, font, 17 * font_height, "A-Cancel Save-TA"); // footer while in "Save Settings" confirmation screen
} else if((strcmp(menu->title, " Settings ") == 0) || (strcmp(menu->title, " Per-Game Settings ") == 0)){
SFont_WriteCenter(surface, font, 17 * font_height, "A-Cancel Delete-TA"); // footer while in "Delete Settings" confirmation screen
} else if(strcmp(menu->title, "Credits") == 0){
SFont_WriteCenter(surface, font, 17 * font_height, "A-Back Back-TA"); // footer while in "Credits" screen
} else {
if((gambatte_p->isLoaded()) || (strcmp(menu->title, "Main Menu") != 0)){
SFont_WriteCenter(surface, font, 17 * font_height, "A-Back Select-TA"); // footer in normal menus
} else {
SFont_WriteCenter(surface, font, 17 * font_height, " Select-TA"); // footer in main menu while no rom is loaded
}
}
#else
if(strcmp(menu->title, " Game Genie ") == 0){
SFont_WriteCenter(surface, font, 17 * font_height, "B-Cancel Apply-A"); // footer while in "Apply Cheats" confirmation screen
} else if((strcmp(menu->title, " Settings ") == 0) || (strcmp(menu->title, " Per-Game Settings ") == 0)){
Expand All @@ -936,7 +919,6 @@ static void display_menu(SDL_Surface *surface, menu_t *menu) {
SFont_WriteCenter(surface, font, 17 * font_height, " Select-A"); // footer in main menu while no rom is loaded
}
}
#endif
}

static void display_menu_cheat(SDL_Surface *surface, menu_t *menu) {
Expand Down Expand Up @@ -1114,19 +1096,6 @@ static void display_menu_cheat(SDL_Surface *surface, menu_t *menu) {
if(downarrow == 1){
SFont_WriteCenter(surface, font, line * font_height, "}"); // down arrow
}
#ifdef VERSION_BITTBOY
if(editmode == 1){
SFont_WriteCenter(surface, font, 17 * font_height, "A-Cancel Accept-TA"); // footer while in edit mode
} else if ((collimit == 10) && (menu->selected_entry % 10 == 0)){
SFont_WriteCenter(surface, font, 17 * font_height, "A-Back Toggle-TA"); // footer while highlighting a toggle option in gameshark menu
} else {
if(footer_alt < FOOTER_ALT_SPEED){
SFont_WriteCenter(surface, font, 17 * font_height, "A-Back Edit-TA"); // footer while highlighting a cheat code
} else {
SFont_WriteCenter(surface, font, 17 * font_height, "Press Start to Apply"); // alternating footer for gamegenie
}
}
#else
if(editmode == 1){
SFont_WriteCenter(surface, font, 17 * font_height, "B-Cancel Accept-A"); // footer while in edit mode
} else if ((collimit == 10) && (menu->selected_entry % 10 == 0)){
Expand All @@ -1138,7 +1107,6 @@ static void display_menu_cheat(SDL_Surface *surface, menu_t *menu) {
SFont_WriteCenter(surface, font, 17 * font_height, "Press Start to Apply"); // alternating footer for gamegenie
}
}
#endif
}

menu_t *new_menu() {
Expand Down
36 changes: 33 additions & 3 deletions gambatte_sdl/libmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,56 @@ extern "C" {
#define NUM_GG_CODES 20
#define NUM_GS_CODES 20

#ifdef VERSION_OPENDINGUX
#if defined VERSION_OPENDINGUX

#define BLINK_SPEED 12
#define FOOTER_ALT_SPEED 100
#define TEXTANIM_DELAY 46
#define TEXTANIM_SPEED 10
#elif VERSION_RETROFW

#define KEYMAP_MENUCANCEL SDLK_LALT
#define KEYMAP_MENUACCEPT SDLK_LCTRL

#elif defined VERSION_RETROFW

#define BLINK_SPEED 8
#define FOOTER_ALT_SPEED 80
#define TEXTANIM_DELAY 36
#define TEXTANIM_SPEED 6
#elif defined VERSION_BITTBOY || defined VERSION_POCKETGO

#define KEYMAP_MENUCANCEL SDLK_LALT
#define KEYMAP_MENUACCEPT SDLK_LCTRL

#elif defined VERSION_BITTBOY

#define BLINK_SPEED 16
#define FOOTER_ALT_SPEED 156
#define TEXTANIM_DELAY 66
#define TEXTANIM_SPEED 13

#define KEYMAP_MENUCANCEL SDLK_SPACE
#define KEYMAP_MENUACCEPT SDLK_LCTRL

#elif defined VERSION_POCKETGO

#define BLINK_SPEED 16
#define FOOTER_ALT_SPEED 156
#define TEXTANIM_DELAY 66
#define TEXTANIM_SPEED 13

#define KEYMAP_MENUCANCEL SDLK_LCTRL
#define KEYMAP_MENUACCEPT SDLK_LALT

#else

#define BLINK_SPEED 12
#define FOOTER_ALT_SPEED 100
#define TEXTANIM_DELAY 50
#define TEXTANIM_SPEED 10

#define KEYMAP_MENUCANCEL SDLK_LALT
#define KEYMAP_MENUACCEPT SDLK_LCTRL

#endif

#include <SDL/SDL.h>
Expand Down

0 comments on commit efcf397

Please sign in to comment.