mirror of
https://github.com/Oibaf66/uae-wii.git
synced 2025-02-21 12:47:10 +01:00
Virtual Keyboard for 320X240 resolution
This commit is contained in:
parent
b987c14078
commit
c86f7fbbd8
@ -203,6 +203,7 @@ dist:uae.dol
|
|||||||
cp FreeMono.ttf $@/apps/uae/
|
cp FreeMono.ttf $@/apps/uae/
|
||||||
cp README.Cloanto-Amiga_Forever $@/apps/uae/docs/
|
cp README.Cloanto-Amiga_Forever $@/apps/uae/docs/
|
||||||
cp images/kb_amiga.png $@/apps/uae/images/
|
cp images/kb_amiga.png $@/apps/uae/images/
|
||||||
|
cp images/kb_amiga_small.png $@/apps/uae/images/
|
||||||
cp uaerc.wii $@/uae/uaerc
|
cp uaerc.wii $@/uae/uaerc
|
||||||
cp uaerc.smb $@/uae/
|
cp uaerc.smb $@/uae/
|
||||||
cp docs/configuration.txt $@/apps/uae/docs/
|
cp docs/configuration.txt $@/apps/uae/docs/
|
||||||
|
BIN
images/kb_amiga_small.png
Normal file
BIN
images/kb_amiga_small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
@ -46,10 +46,8 @@
|
|||||||
#include "inputdevice.h"
|
#include "inputdevice.h"
|
||||||
#include "hotkeys.h"
|
#include "hotkeys.h"
|
||||||
#include "sdlgfx.h"
|
#include "sdlgfx.h"
|
||||||
|
|
||||||
#ifdef USE_SDL
|
|
||||||
#include "guidep/menu.h"
|
#include "guidep/menu.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Uncomment for debugging output */
|
/* Uncomment for debugging output */
|
||||||
//#define DEBUG
|
//#define DEBUG
|
||||||
@ -945,9 +943,9 @@ static int graphics_subinit (void)
|
|||||||
gui_message ("Unable to set video mode: %s\n", SDL_GetError ());
|
gui_message ("Unable to set video mode: %s\n", SDL_GetError ());
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
#ifdef USE_SDL
|
|
||||||
menu_init(screen); //GEKKO
|
menu_init(screen); //GEKKO
|
||||||
#endif
|
|
||||||
/* Just in case we didn't get exactly what we asked for . . . */
|
/* Just in case we didn't get exactly what we asked for . . . */
|
||||||
fullscreen = ((screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN);
|
fullscreen = ((screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN);
|
||||||
is_hwsurface = ((screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE);
|
is_hwsurface = ((screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE);
|
||||||
@ -1112,6 +1110,9 @@ static void graphics_subshutdown (void)
|
|||||||
if (display != screen)
|
if (display != screen)
|
||||||
SDL_FreeSurface (screen);
|
SDL_FreeSurface (screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menu_deinit(); //GEKKO
|
||||||
|
|
||||||
display = screen = 0;
|
display = screen = 0;
|
||||||
mousehack = 0;
|
mousehack = 0;
|
||||||
|
|
||||||
@ -1144,9 +1145,6 @@ void graphics_leave (void)
|
|||||||
graphics_subshutdown ();
|
graphics_subshutdown ();
|
||||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||||
dumpcustom ();
|
dumpcustom ();
|
||||||
#ifdef USE_SDL
|
|
||||||
menu_deinit(); //GEKKO
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void graphics_notify_state (int state)
|
void graphics_notify_state (int state)
|
||||||
|
@ -24,6 +24,14 @@
|
|||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include "gensound.h"
|
#include "gensound.h"
|
||||||
|
|
||||||
|
/* Uncomment for debugging output */
|
||||||
|
//#define DEBUG_VK
|
||||||
|
#ifdef DEBUG_VK
|
||||||
|
#define DEBUG_LOG write_log
|
||||||
|
#else
|
||||||
|
#define DEBUG_LOG(...) do {} while(0)
|
||||||
|
#endif
|
||||||
|
|
||||||
static SDL_Surface *image_kbd, *tmp_surface ;
|
static SDL_Surface *image_kbd, *tmp_surface ;
|
||||||
static int vkb_is_init;
|
static int vkb_is_init;
|
||||||
//static int key_code;
|
//static int key_code;
|
||||||
@ -68,14 +76,15 @@ static int buttons_margins[KEY_ROWS][KEY_COLS+1] = {
|
|||||||
{28,63,95,329,361,396,515,567,593,620},
|
{28,63,95,329,361,396,515,567,593,620},
|
||||||
{14,80,146,212,278,344,411,476,543}};
|
{14,80,146,212,278,344,411,476,543}};
|
||||||
|
|
||||||
|
extern int RATIO;
|
||||||
|
|
||||||
void VirtualKeyboard_init(SDL_Surface *screen)
|
void VirtualKeyboard_init(SDL_Surface *screen)
|
||||||
{
|
{
|
||||||
|
if (vkb_is_init) return;
|
||||||
|
|
||||||
VirtualKeyboard.screen = screen;
|
VirtualKeyboard.screen = screen;
|
||||||
VirtualKeyboard.x = 3; //Where to print the keyboard
|
VirtualKeyboard.x = 2/RATIO; //Where to print the keyboard
|
||||||
VirtualKeyboard.y = 100;
|
VirtualKeyboard.y = 100/RATIO;
|
||||||
vkb_is_init = -1;
|
|
||||||
|
|
||||||
char kbd_image[255];
|
char kbd_image[255];
|
||||||
|
|
||||||
@ -91,7 +100,7 @@ void VirtualKeyboard_init(SDL_Surface *screen)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strcat (kbd_image, KBDIMAGE);
|
if (RATIO == 1) strcat (kbd_image, KBDIMAGE); else strcat (kbd_image, KBDIMAGE_SMALL);
|
||||||
|
|
||||||
tmp_surface=IMG_Load(kbd_image);
|
tmp_surface=IMG_Load(kbd_image);
|
||||||
|
|
||||||
@ -102,19 +111,23 @@ void VirtualKeyboard_init(SDL_Surface *screen)
|
|||||||
memset(VirtualKeyboard.buf, 0, sizeof(VirtualKeyboard.buf));
|
memset(VirtualKeyboard.buf, 0, sizeof(VirtualKeyboard.buf));
|
||||||
vkb_is_init = 1;
|
vkb_is_init = 1;
|
||||||
kbd_is_active=0;
|
kbd_is_active=0;
|
||||||
|
DEBUG_LOG("Virtual keyboard is inited\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void VirtualKeyboard_fini(void)
|
void VirtualKeyboard_fini(void)
|
||||||
{
|
{
|
||||||
|
if (!vkb_is_init) return;
|
||||||
|
|
||||||
SDL_FreeSurface (image_kbd);
|
SDL_FreeSurface (image_kbd);
|
||||||
vkb_is_init = -1;
|
vkb_is_init = 0;
|
||||||
kbd_is_active = 0;
|
kbd_is_active = 0;
|
||||||
|
DEBUG_LOG("Virtual keyboard is finished\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_vk()
|
void draw_vk()
|
||||||
{
|
{
|
||||||
SDL_Rect dst_rect = {VirtualKeyboard.x, VirtualKeyboard.y, 0, 0};
|
SDL_Rect dst_rect = {VirtualKeyboard.x, VirtualKeyboard.y, 0, 0};
|
||||||
SDL_BlitSurface(image_kbd, NULL, VirtualKeyboard.screen, &dst_rect);
|
SDL_BlitSurface(image_kbd, NULL, VirtualKeyboard.screen, &dst_rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void flip_VKB()
|
inline void flip_VKB()
|
||||||
@ -181,7 +194,7 @@ struct virtkey *get_key_internal()
|
|||||||
x = (xm-border_x);
|
x = (xm-border_x);
|
||||||
y = (ym-border_y);
|
y = (ym-border_y);
|
||||||
|
|
||||||
i = get_index(x,y);
|
i = get_index(x*RATIO,y*RATIO);
|
||||||
|
|
||||||
if (i==-1) continue;
|
if (i==-1) continue;
|
||||||
|
|
||||||
@ -205,9 +218,7 @@ struct virtkey* virtkbd_get_key()
|
|||||||
{
|
{
|
||||||
virtkey_t *key;
|
virtkey_t *key;
|
||||||
|
|
||||||
if (FULL_DISPLAY_X != 640) {msgInfo("Virtual Keyboard only with 640X480 res",4000,NULL);return NULL;}
|
if (!vkb_is_init) return NULL;
|
||||||
|
|
||||||
if (vkb_is_init != 1) return NULL;
|
|
||||||
|
|
||||||
pause_sound();
|
pause_sound();
|
||||||
|
|
||||||
|
@ -26,7 +26,13 @@
|
|||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "filesys.h"
|
#include "filesys.h"
|
||||||
|
|
||||||
|
/* Uncomment for debugging output */
|
||||||
|
//#define DEBUG_MENU
|
||||||
|
#ifdef DEBUG_MENU
|
||||||
|
#define DEBUG_LOG write_log
|
||||||
|
#else
|
||||||
|
#define DEBUG_LOG(...) do {} while(0)
|
||||||
|
#endif
|
||||||
|
|
||||||
struct joyinfo {
|
struct joyinfo {
|
||||||
SDL_Joystick *joy;
|
SDL_Joystick *joy;
|
||||||
@ -1159,10 +1165,13 @@ void menu_init(SDL_Surface *screen)
|
|||||||
real_screen = screen;
|
real_screen = screen;
|
||||||
VirtualKeyboard_init(screen);
|
VirtualKeyboard_init(screen);
|
||||||
is_inited = 1;
|
is_inited = 1;
|
||||||
|
DEBUG_LOG("Menu is inited\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_deinit(void)
|
void menu_deinit(void)
|
||||||
{
|
{
|
||||||
|
if (!is_inited) return;
|
||||||
|
|
||||||
is_inited = 0;
|
is_inited = 0;
|
||||||
VirtualKeyboard_fini();
|
VirtualKeyboard_fini();
|
||||||
|
|
||||||
@ -1172,6 +1181,7 @@ void menu_deinit(void)
|
|||||||
TTF_CloseFont(menu_font10);
|
TTF_CloseFont(menu_font10);
|
||||||
|
|
||||||
TTF_Quit();
|
TTF_Quit();
|
||||||
|
DEBUG_LOG("Menu is finished\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#define USERFILENAME "/uae/uaerc.user"
|
#define USERFILENAME "/uae/uaerc.user"
|
||||||
#define SAVEDFILENAME "/uae/uaerc.saved"
|
#define SAVEDFILENAME "/uae/uaerc.saved"
|
||||||
#define KBDIMAGE "/apps/uae/images/kb_amiga.png"
|
#define KBDIMAGE "/apps/uae/images/kb_amiga.png"
|
||||||
|
#define KBDIMAGE_SMALL "/apps/uae/images/kb_amiga_small.png"
|
||||||
|
|
||||||
#define DEFPRTNAME "lpr"
|
#define DEFPRTNAME "lpr"
|
||||||
#define DEFSERNAME "/dev/ttyS1"
|
#define DEFSERNAME "/dev/ttyS1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user