Added new amiberry.conf parameters

- Default open gui key
- Default quit key
- Rotation Angle
This commit is contained in:
Dimitris Panokostas 2020-01-25 16:49:22 +01:00
parent e61e34e436
commit a59896d96d
8 changed files with 49 additions and 11 deletions

View file

@ -148,7 +148,10 @@ else ifeq ($(PLATFORM),go-advance)
LDFLAGS += ${LIBGO2_LDFLAGS} LDFLAGS += ${LIBGO2_LDFLAGS}
AARCH64 = 1 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))) else ifneq (,$(findstring RK,$(PLATFORM)))
CPPFLAGS += -DARMV6_ASSEMBLY -D_FILE_OFFSET_BITS=64 -DARMV6T2 -DUSE_ARMNEON -DARM_HAS_DIV -DFASTERCYCLES -DSOFTWARE_CURSOR CPPFLAGS += -DARMV6_ASSEMBLY -D_FILE_OFFSET_BITS=64 -DARMV6T2 -DUSE_ARMNEON -DARM_HAS_DIV -DFASTERCYCLES -DSOFTWARE_CURSOR
HAVE_NEON = 1 HAVE_NEON = 1

View file

@ -2,6 +2,13 @@ Quickstart=1
read_config_descriptions=yes read_config_descriptions=yes
write_logfile=no write_logfile=no
scanlines_by_default=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_pal=10000
speedup_cycles_jit_ntsc=6667 speedup_cycles_jit_ntsc=6667
speedup_cycles_nonjit=256 speedup_cycles_nonjit=256

View file

@ -805,7 +805,7 @@ bool check_internet_connection()
auto result = false; auto result = false;
FILE* output; 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; return result;
unsigned int i; unsigned int i;

View file

@ -56,9 +56,12 @@ bool use_sdl2_render_thread = false;
#endif #endif
int input_default_mouse_speed = 100; int input_default_mouse_speed = 100;
bool input_keyboard_as_joystick_stop_keypresses = false; 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 // 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 // We don't set a default value for Quitting
int quit_key = 0; int quit_key = 0;
// The default value for Action Replay is Pause/Break // 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 // If we have a value in the config, we use that instead
enter_gui_key = SDL_GetKeyFromName(p->open_gui); 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 (strncmp(p->quit_amiberry, "", 1) != 0)
{ {
// If we have a value in the config, we use that instead // If we have a value in the config, we use that instead
quit_key = SDL_GetKeyFromName(p->quit_amiberry); quit_key = SDL_GetKeyFromName(p->quit_amiberry);
} }
else
{
quit_key = SDL_GetKeyFromName(default_quit_key);
}
if (strncmp(p->action_replay, "", 1) != 0) 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; p->gfx_pscanlines = 0;
} }
_tcscpy(p->open_gui, "F12"); _tcscpy(p->open_gui, default_open_gui_key);
_tcscpy(p->quit_amiberry, ""); _tcscpy(p->quit_amiberry, default_quit_key);
_tcscpy(p->action_replay, "Pause"); _tcscpy(p->action_replay, "Pause");
_tcscpy(p->fullscreen_toggle, ""); _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"); snprintf(buffer, MAX_DPATH, "gui_joystick_control=%s\n", gui_joystick_control ? "yes" : "no");
fputs(buffer, f); 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 // 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"); snprintf(buffer, MAX_DPATH, "use_sdl2_render_thread=%s\n", use_sdl2_render_thread ? "yes" : "no");
fputs(buffer, f); 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 // Timing settings
snprintf(buffer, MAX_DPATH, "speedup_cycles_jit_pal=%d\n", speedup_cycles_jit_pal); snprintf(buffer, MAX_DPATH, "speedup_cycles_jit_pal=%d\n", speedup_cycles_jit_pal);
fputs(buffer, f); 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_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_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_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_pal", &speedup_cycles_jit_pal, 1);
cfgfile_intval(option, value, "speedup_cycles_jit_ntsc", &speedup_cycles_jit_ntsc, 1); cfgfile_intval(option, value, "speedup_cycles_jit_ntsc", &speedup_cycles_jit_ntsc, 1);

View file

@ -819,7 +819,7 @@ int sdl2_render_thread(void *ptr) {
SDL_UpdateTexture(texture, nullptr, screen->pixels, screen->pitch); SDL_UpdateTexture(texture, nullptr, screen->pixels, screen->pitch);
SDL_RenderClear(renderer); SDL_RenderClear(renderer);
SDL_RenderCopy(renderer, texture, nullptr, nullptr); SDL_RenderCopyEx(renderer, texture, nullptr, nullptr, rotation_angle, nullptr, SDL_FLIP_NONE);
return 0; return 0;
} }
@ -899,7 +899,7 @@ void show_screen(int mode)
{ {
SDL_UpdateTexture(texture, nullptr, screen->pixels, screen->pitch); SDL_UpdateTexture(texture, nullptr, screen->pixels, screen->pitch);
SDL_RenderClear(renderer); SDL_RenderClear(renderer);
SDL_RenderCopy(renderer, texture, nullptr, nullptr); SDL_RenderCopyEx(renderer, texture, nullptr, nullptr, rotation_angle, nullptr, SDL_FLIP_NONE);
SDL_RenderPresent(renderer); SDL_RenderPresent(renderer);
} }
#endif #endif

View file

@ -27,6 +27,7 @@ extern const char* sdl_video_driver;
extern SDL_Renderer* renderer; extern SDL_Renderer* renderer;
extern SDL_Window* sdl_window; extern SDL_Window* sdl_window;
extern SDL_Surface* gui_screen; extern SDL_Surface* gui_screen;
extern int rotation_angle;
extern bool can_have_linedouble; extern bool can_have_linedouble;
extern bool use_sdl2_render_thread; extern bool use_sdl2_render_thread;

View file

@ -122,7 +122,7 @@ void message_UpdateScreen()
vc_dispmanx_update_submit_sync(updateHandle); vc_dispmanx_update_submit_sync(updateHandle);
#else #else
SDL_RenderClear(renderer); 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); SDL_RenderPresent(renderer);
#endif #endif
} }

View file

@ -260,7 +260,7 @@ void swcursor(bool op) {
SDL_GetMouseState(&dst.x, &dst.y); SDL_GetMouseState(&dst.x, &dst.y);
dst.x *= mscalex * 1.03; dst.x *= mscalex * 1.03;
dst.y *= mscaley * 1.005; 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 #endif
@ -274,7 +274,7 @@ void UpdateGuiScreen()
vc_dispmanx_update_submit_sync(updateHandle); vc_dispmanx_update_submit_sync(updateHandle);
#else #else
SDL_RenderClear(renderer); 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 #ifdef SOFTWARE_CURSOR
swcursor(true); swcursor(true);
#endif #endif