From d28ded97eee08bb3cb02ddf413197e189503b832 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Wed, 15 Feb 2023 06:46:40 -0500 Subject: [PATCH] Add 353 and 503. --- Makefile | 2 ++ src/def.h | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/Makefile b/Makefile index c05961b..a7a9d61 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ TARGET = fileman # DEVICE ?= HANDHELD +# DEVICE ?= RG353P +# DEVICE ?= RG503 # DEVICE ?= RG351P # DEVICE ?= RG351V # DEVICE ?= RG351MP diff --git a/src/def.h b/src/def.h index f6d2f74..ddf4aa4 100644 --- a/src/def.h +++ b/src/def.h @@ -10,6 +10,38 @@ #define APP_NAME "fileman" +// Parameters for RG353P +#elif defined(DEVICE_RG353P) + #define SCREEN_WIDTH 640 + #define SCREEN_HEIGHT 480 + #define HARDWARE_ACCELERATION 0 + #define FULLSCREEN 1 + #define FONT_NAME "NotoSans-Regular.ttf" + #define FONT_NAME_MONO "NotoSansMono-Regular.ttf" + #define FONT_SIZE 20 + #define LINE_HEIGHT 32 + #define ICON_SIZE 24 + #define MARGIN_X 10 + #define KEYBOARD_MARGIN 8 + #define KEYBOARD_KEY_SPACING 4 + #define KEYBOARD_SYMBOL_SIZE 24 + +// Parameters for RG503 +#elif defined(DEVICE_RG503) + #define SCREEN_WIDTH 960 + #define SCREEN_HEIGHT 544 + #define HARDWARE_ACCELERATION 0 + #define FULLSCREEN 1 + #define FONT_NAME "NotoSans-Regular.ttf" + #define FONT_NAME_MONO "NotoSansMono-Regular.ttf" + #define FONT_SIZE 24 + #define LINE_HEIGHT 36 + #define ICON_SIZE 32 + #define MARGIN_X 12 + #define KEYBOARD_MARGIN 10 + #define KEYBOARD_KEY_SPACING 5 + #define KEYBOARD_SYMBOL_SIZE 29 + // Parameters for RG351P #if defined(DEVICE_RG351P) #define SCREEN_WIDTH 480 @@ -185,6 +217,44 @@ #define BUTTON_HELD_PAGEDOWN SDL_JoystickGetButton(g_joystick, 5) || SDL_JoystickGetButton(g_joystick, 7) #define BUTTON_HELD_SELECT SDL_JoystickGetButton(g_joystick, 3) #define BUTTON_HELD_VALIDATE SDL_JoystickGetButton(g_joystick, 1) +#elif defined(DEVICE_RG353P) + #define BUTTON_PRESSED_UP event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 13 + #define BUTTON_PRESSED_DOWN event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 14 + #define BUTTON_PRESSED_LEFT event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 15 + #define BUTTON_PRESSED_RIGHT event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 16 + #define BUTTON_PRESSED_PAGEUP event.type == SDL_JOYBUTTONDOWN && (event.jbutton.button == 4 || event.jbutton.button == 6) + #define BUTTON_PRESSED_PAGEDOWN event.type == SDL_JOYBUTTONDOWN && (event.jbutton.button == 5 || event.jbutton.button == 7) + #define BUTTON_PRESSED_VALIDATE event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 1 + #define BUTTON_PRESSED_BACK event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 0 + #define BUTTON_PRESSED_MENU_CONTEXT event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 2 + #define BUTTON_PRESSED_SELECT event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 3 + #define BUTTON_HELD_UP SDL_JoystickGetButton(g_joystick, 13) + #define BUTTON_HELD_DOWN SDL_JoystickGetButton(g_joystick, 14) + #define BUTTON_HELD_LEFT SDL_JoystickGetButton(g_joystick, 15) + #define BUTTON_HELD_RIGHT SDL_JoystickGetButton(g_joystick, 16) + #define BUTTON_HELD_PAGEUP SDL_JoystickGetButton(g_joystick, 4) || SDL_JoystickGetButton(g_joystick, 6) + #define BUTTON_HELD_PAGEDOWN SDL_JoystickGetButton(g_joystick, 5) || SDL_JoystickGetButton(g_joystick, 7) + #define BUTTON_HELD_SELECT SDL_JoystickGetButton(g_joystick, 3) + #define BUTTON_HELD_VALIDATE SDL_JoystickGetButton(g_joystick, 1) +#elif defined(DEVICE_RG503) + #define BUTTON_PRESSED_UP event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 13 + #define BUTTON_PRESSED_DOWN event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 14 + #define BUTTON_PRESSED_LEFT event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 15 + #define BUTTON_PRESSED_RIGHT event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 16 + #define BUTTON_PRESSED_PAGEUP event.type == SDL_JOYBUTTONDOWN && (event.jbutton.button == 4 || event.jbutton.button == 6) + #define BUTTON_PRESSED_PAGEDOWN event.type == SDL_JOYBUTTONDOWN && (event.jbutton.button == 5 || event.jbutton.button == 7) + #define BUTTON_PRESSED_VALIDATE event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 1 + #define BUTTON_PRESSED_BACK event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 0 + #define BUTTON_PRESSED_MENU_CONTEXT event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 2 + #define BUTTON_PRESSED_SELECT event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 3 + #define BUTTON_HELD_UP SDL_JoystickGetButton(g_joystick, 13) + #define BUTTON_HELD_DOWN SDL_JoystickGetButton(g_joystick, 14) + #define BUTTON_HELD_LEFT SDL_JoystickGetButton(g_joystick, 15) + #define BUTTON_HELD_RIGHT SDL_JoystickGetButton(g_joystick, 16) + #define BUTTON_HELD_PAGEUP SDL_JoystickGetButton(g_joystick, 4) || SDL_JoystickGetButton(g_joystick, 6) + #define BUTTON_HELD_PAGEDOWN SDL_JoystickGetButton(g_joystick, 5) || SDL_JoystickGetButton(g_joystick, 7) + #define BUTTON_HELD_SELECT SDL_JoystickGetButton(g_joystick, 3) + #define BUTTON_HELD_VALIDATE SDL_JoystickGetButton(g_joystick, 1) #elif defined(DEVICE_RG351P) #define BUTTON_PRESSED_UP event.type == SDL_JOYHATMOTION && event.jhat.value == SDL_HAT_UP #define BUTTON_PRESSED_DOWN event.type == SDL_JOYHATMOTION && event.jhat.value == SDL_HAT_DOWN