diff --git a/Makefile b/Makefile index 0090d240..036982b9 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,10 @@ else ifeq ($(PLATFORM),go-advance) LDFLAGS += ${LIBGO2_LDFLAGS} AARCH64 = 1 -# Rockchip RK3288 e.g. Asus Tinker Board / RK3328 e.g. PINE64 Rock64 / RK3399 e.g. PINE64 RockPro64 - 32-bit userspace +# RK3288 e.g. Asus Tinker Board +# RK3328 e.g. PINE64 Rock64 +# RK3399 e.g. PINE64 RockPro64 +# RK3326 e.g. Odroid Go Advance - 32-bit userspace else ifneq (,$(findstring RK,$(PLATFORM))) CPPFLAGS += -DARMV6_ASSEMBLY -D_FILE_OFFSET_BITS=64 -DARMV6T2 -DUSE_ARMNEON -DARM_HAS_DIV -DFASTERCYCLES -DSOFTWARE_CURSOR HAVE_NEON = 1 diff --git a/conf/amiberry.conf b/conf/amiberry.conf index 33296da5..aa203d5b 100644 --- a/conf/amiberry.conf +++ b/conf/amiberry.conf @@ -2,6 +2,13 @@ Quickstart=1 read_config_descriptions=yes write_logfile=no scanlines_by_default=no +swap_win_alt_keys=no +gui_joystick_control=yes +use_sdl2_render_thread=no +input_default_mouse_speed=100 +input_keyboard_as_joystick_stop_keypresses=no +default_open_gui_key=F12 +rotation_angle=0 speedup_cycles_jit_pal=10000 speedup_cycles_jit_ntsc=6667 speedup_cycles_nonjit=256 diff --git a/src/main.cpp b/src/main.cpp index 51b6c469..a9703c30 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -805,7 +805,7 @@ bool check_internet_connection() auto result = false; FILE* output; - if (!((output = popen("/sbin/route -n | grep -c '^0\\.0\\.0\\.0'", "r")))) + if (!((output = popen("route -n | grep -c '^0\\.0\\.0\\.0'", "r")))) return result; unsigned int i; diff --git a/src/osdep/amiberry.cpp b/src/osdep/amiberry.cpp index cfed092e..6c66bf26 100644 --- a/src/osdep/amiberry.cpp +++ b/src/osdep/amiberry.cpp @@ -56,9 +56,12 @@ bool use_sdl2_render_thread = false; #endif int input_default_mouse_speed = 100; bool input_keyboard_as_joystick_stop_keypresses = false; +static char default_open_gui_key[128]; +static char default_quit_key[128]; +int rotation_angle = 0; // Default Enter GUI key is F12 -int enter_gui_key = SDLK_F12; +int enter_gui_key = 0; // We don't set a default value for Quitting int quit_key = 0; // The default value for Action Replay is Pause/Break @@ -81,12 +84,21 @@ void set_key_configs(struct uae_prefs* p) // If we have a value in the config, we use that instead enter_gui_key = SDL_GetKeyFromName(p->open_gui); } + else + { + // Otherwise we go for the default found in amiberry.conf + enter_gui_key = SDL_GetKeyFromName(default_open_gui_key); + } if (strncmp(p->quit_amiberry, "", 1) != 0) { // If we have a value in the config, we use that instead quit_key = SDL_GetKeyFromName(p->quit_amiberry); } + else + { + quit_key = SDL_GetKeyFromName(default_quit_key); + } if (strncmp(p->action_replay, "", 1) != 0) { @@ -410,8 +422,8 @@ void target_default_options(struct uae_prefs* p, int type) p->gfx_pscanlines = 0; } - _tcscpy(p->open_gui, "F12"); - _tcscpy(p->quit_amiberry, ""); + _tcscpy(p->open_gui, default_open_gui_key); + _tcscpy(p->quit_amiberry, default_quit_key); _tcscpy(p->action_replay, "Pause"); _tcscpy(p->fullscreen_toggle, ""); @@ -855,11 +867,23 @@ void save_amiberry_settings(void) snprintf(buffer, MAX_DPATH, "gui_joystick_control=%s\n", gui_joystick_control ? "yes" : "no"); fputs(buffer, f); - // Use a separate render thread uner SDL2? + // Use a separate render thread under SDL2? // This might give a performance boost, but it's not supported on all SDL2 back-ends snprintf(buffer, MAX_DPATH, "use_sdl2_render_thread=%s\n", use_sdl2_render_thread ? "yes" : "no"); fputs(buffer, f); + // Default key for opening the GUI (e.g. "F12") + snprintf(buffer, MAX_DPATH, "default_open_gui_key=%s\n", default_open_gui_key); + fputs(buffer, f); + + // Default key for Quitting the emulator + snprintf(buffer, MAX_DPATH, "default_quit_key=%s\n", default_quit_key); + fputs(buffer, f); + + // Rotation angle of the output display (useful for screens with portrait orientation, like the Go Advance) + snprintf(buffer, MAX_DPATH, "rotation_angle=%d\n", rotation_angle); + fputs(buffer, f); + // Timing settings snprintf(buffer, MAX_DPATH, "speedup_cycles_jit_pal=%d\n", speedup_cycles_jit_pal); fputs(buffer, f); @@ -1044,6 +1068,9 @@ void load_amiberry_settings(void) cfgfile_yesno(option, value, "use_sdl2_render_thread", &use_sdl2_render_thread); cfgfile_intval(option, value, "input_default_mouse_speed", &input_default_mouse_speed, 1); cfgfile_yesno(option, value, "input_keyboard_as_joystick_stop_keypresses", &input_keyboard_as_joystick_stop_keypresses); + cfgfile_string(option, value, "default_open_gui_key", default_open_gui_key, sizeof default_open_gui_key); + cfgfile_string(option, value, "default_quit_key", default_quit_key, sizeof default_quit_key); + cfgfile_intval(option, value, "rotation_angle", &rotation_angle, 1); cfgfile_intval(option, value, "speedup_cycles_jit_pal", &speedup_cycles_jit_pal, 1); cfgfile_intval(option, value, "speedup_cycles_jit_ntsc", &speedup_cycles_jit_ntsc, 1); diff --git a/src/osdep/amiberry_gfx.cpp b/src/osdep/amiberry_gfx.cpp index 4fce25ac..0fae81fb 100644 --- a/src/osdep/amiberry_gfx.cpp +++ b/src/osdep/amiberry_gfx.cpp @@ -819,7 +819,7 @@ int sdl2_render_thread(void *ptr) { SDL_UpdateTexture(texture, nullptr, screen->pixels, screen->pitch); SDL_RenderClear(renderer); - SDL_RenderCopy(renderer, texture, nullptr, nullptr); + SDL_RenderCopyEx(renderer, texture, nullptr, nullptr, rotation_angle, nullptr, SDL_FLIP_NONE); return 0; } @@ -899,7 +899,7 @@ void show_screen(int mode) { SDL_UpdateTexture(texture, nullptr, screen->pixels, screen->pitch); SDL_RenderClear(renderer); - SDL_RenderCopy(renderer, texture, nullptr, nullptr); + SDL_RenderCopyEx(renderer, texture, nullptr, nullptr, rotation_angle, nullptr, SDL_FLIP_NONE); SDL_RenderPresent(renderer); } #endif diff --git a/src/osdep/amiberry_gfx.h b/src/osdep/amiberry_gfx.h index 18bbdf76..72d2665b 100644 --- a/src/osdep/amiberry_gfx.h +++ b/src/osdep/amiberry_gfx.h @@ -27,6 +27,7 @@ extern const char* sdl_video_driver; extern SDL_Renderer* renderer; extern SDL_Window* sdl_window; extern SDL_Surface* gui_screen; +extern int rotation_angle; extern bool can_have_linedouble; extern bool use_sdl2_render_thread; diff --git a/src/osdep/gui/InGameMessage.cpp b/src/osdep/gui/InGameMessage.cpp index 660b0b82..d687734c 100644 --- a/src/osdep/gui/InGameMessage.cpp +++ b/src/osdep/gui/InGameMessage.cpp @@ -122,7 +122,7 @@ void message_UpdateScreen() vc_dispmanx_update_submit_sync(updateHandle); #else SDL_RenderClear(renderer); - SDL_RenderCopy(renderer, msg_texture, nullptr, nullptr); + SDL_RenderCopyEx(renderer, msg_texture, nullptr, nullptr, rotation_angle, nullptr, SDL_FLIP_NONE); SDL_RenderPresent(renderer); #endif } diff --git a/src/osdep/gui/main_window.cpp b/src/osdep/gui/main_window.cpp index 7740848c..913a098d 100644 --- a/src/osdep/gui/main_window.cpp +++ b/src/osdep/gui/main_window.cpp @@ -260,7 +260,7 @@ void swcursor(bool op) { SDL_GetMouseState(&dst.x, &dst.y); dst.x *= mscalex * 1.03; dst.y *= mscaley * 1.005; - SDL_RenderCopy(renderer, swcursor_texture, nullptr, &dst); + SDL_RenderCopyEx(renderer, swcursor_texture, nullptr, &dst, rotation_angle, nullptr, SDL_FLIP_NONE); } } #endif @@ -274,7 +274,7 @@ void UpdateGuiScreen() vc_dispmanx_update_submit_sync(updateHandle); #else SDL_RenderClear(renderer); - SDL_RenderCopy(renderer, gui_texture, nullptr, nullptr); + SDL_RenderCopyEx(renderer, gui_texture, nullptr, nullptr, rotation_angle, nullptr, SDL_FLIP_NONE); #ifdef SOFTWARE_CURSOR swcursor(true); #endif