X-1.18 Martin Borgman 10-APR-2008 Handle SDL support on OS X through OS_X/SDLMain.m.
X-1.15 Camiel Vanderhoeven 29-FEB-2008 Comments
X-1.14 Camiel Vanderhoeven 12-FEB-2008 Moved keyboard code into it's own class (CKeyboard)
X-1.13 Camiel Vanderhoeven 22-JAN-2008 Minor cleanups.
X-1.12 Fang Zhe 05-JAN-2008 Last patch was applied incompletely.
X-1.11 Fang Zhe 04-JAN-2008 Improved compatibility with Apple OS X; keyboard works now.
X-1.10 Fang Zhe 03-JAN-2008 Compatibility with Apple OS X.
X-1.9 Camiel Vanderhoeven 02-JAN-2008 Comments.
X-1.4 Camiel Vanderhoeven 10-DEC-2007 Use Configurator.
X-1.3 Camiel Vanderhoeven 7-DEC-2007 Made keyboard messages conditional.
X-1.2 Camiel Vanderhoeven 7-DEC-2007 Code cleanup.
X-1.1 Camiel Vanderhoeven 6-DEC-2007 Initial version for ES40 emulator.
Definition in file sdl.cpp.
#include "../StdAfx.h"
#include "gui.h"
#include "keymap.h"
#include "../VGA.h"
#include "../System.h"
#include "../Keyboard.h"
#include "../Configurator.h"
#include <stdlib.h>
#include <SDL.h>
#include <SDL_endian.h>
#include <SDL_thread.h>
#include "sdl_fonts.h"
#include "sdlkeys.h"
Go to the source code of this file.
Data Structures | |
| class | bx_sdl_gui_c |
| GUI implementation using SDL. More... | |
| struct | keyTableEntry |
| key mapping for SDL More... | |
Defines | |
| #define | _MULTI_THREAD |
| #define | BX_PLUGGABLE |
| #define | DEF_SDL_KEY(key) |
Functions | |
| int | libsdl_LTX_plugin_init (CConfigurator *cfg) |
| void | libsdl_LTX_plugin_fini (void) |
| static u32 | convertStringToSDLKey (const char *string) |
| static u32 | sdl_sym_to_bx_key (SDLKey sym) |
Variables | |
| static bx_sdl_gui_c * | theGui = NULL |
| static unsigned | prev_cursor_x = 0 |
| static unsigned | prev_cursor_y = 0 |
| SDL_Thread * | sdl_thread |
| SDL_Surface * | sdl_screen |
| SDL_Event | sdl_event |
| int | sdl_grab |
| unsigned | res_x |
| unsigned | res_y |
| unsigned | half_res_x |
| unsigned | half_res_y |
| static unsigned int | text_cols = 80 |
| static unsigned int | text_rows = 25 |
| u8 | h_panning = 0 |
| u8 | v_panning = 0 |
| u16 | line_compare = 1023 |
| int | fontwidth = 8 |
| int | fontheight = 16 |
| static unsigned | vga_bpp = 8 |
| unsigned | tilewidth |
| unsigned | tileheight |
| u32 | palette [256] |
| u8 | old_mousebuttons = 0 |
| u8 | new_mousebuttons = 0 |
| int | old_mousex = 0 |
| int | new_mousex = 0 |
| int | old_mousey = 0 |
| int | new_mousey = 0 |
| bool | just_warped = false |
| keyTableEntry | keytable [] |
| static u32 convertStringToSDLKey | ( | const char * | string | ) | [static] |
Definition at line 1314 of file sdl.cpp.
References BX_KEYMAP_UNKNOWN, keyTableEntry::name, and keyTableEntry::value.
Referenced by bx_sdl_gui_c::specific_init().
| int libsdl_LTX_plugin_init | ( | CConfigurator * | cfg | ) |
| static u32 sdl_sym_to_bx_key | ( | SDLKey | sym | ) | [static] |
Definition at line 585 of file sdl.cpp.
References BX_ERROR, BX_KEY_0, BX_KEY_1, BX_KEY_2, BX_KEY_3, BX_KEY_4, BX_KEY_5, BX_KEY_6, BX_KEY_7, BX_KEY_8, BX_KEY_9, BX_KEY_A, BX_KEY_ALT_L, BX_KEY_ALT_R, BX_KEY_B, BX_KEY_BACKSLASH, BX_KEY_BACKSPACE, BX_KEY_C, BX_KEY_CAPS_LOCK, BX_KEY_COMMA, BX_KEY_CTRL_L, BX_KEY_CTRL_R, BX_KEY_D, BX_KEY_DELETE, BX_KEY_DOWN, BX_KEY_E, BX_KEY_END, BX_KEY_ENTER, BX_KEY_EQUALS, BX_KEY_ESC, BX_KEY_F, BX_KEY_F1, BX_KEY_F10, BX_KEY_F11, BX_KEY_F12, BX_KEY_F2, BX_KEY_F3, BX_KEY_F4, BX_KEY_F5, BX_KEY_F6, BX_KEY_F7, BX_KEY_F8, BX_KEY_F9, BX_KEY_G, BX_KEY_GRAVE, BX_KEY_H, BX_KEY_HOME, BX_KEY_I, BX_KEY_INSERT, BX_KEY_J, BX_KEY_K, BX_KEY_KP_5, BX_KEY_KP_ADD, BX_KEY_KP_DELETE, BX_KEY_KP_DIVIDE, BX_KEY_KP_DOWN, BX_KEY_KP_END, BX_KEY_KP_ENTER, BX_KEY_KP_HOME, BX_KEY_KP_INSERT, BX_KEY_KP_LEFT, BX_KEY_KP_MULTIPLY, BX_KEY_KP_PAGE_DOWN, BX_KEY_KP_PAGE_UP, BX_KEY_KP_RIGHT, BX_KEY_KP_SUBTRACT, BX_KEY_KP_UP, BX_KEY_L, BX_KEY_LEFT, BX_KEY_LEFT_BRACKET, BX_KEY_M, BX_KEY_MENU, BX_KEY_MINUS, BX_KEY_N, BX_KEY_NUM_LOCK, BX_KEY_O, BX_KEY_P, BX_KEY_PAGE_DOWN, BX_KEY_PAGE_UP, BX_KEY_PAUSE, BX_KEY_PERIOD, BX_KEY_PRINT, BX_KEY_Q, BX_KEY_R, BX_KEY_RIGHT, BX_KEY_RIGHT_BRACKET, BX_KEY_S, BX_KEY_SCRL_LOCK, BX_KEY_SEMICOLON, BX_KEY_SHIFT_L, BX_KEY_SHIFT_R, BX_KEY_SINGLE_QUOTE, BX_KEY_SLASH, BX_KEY_SPACE, BX_KEY_T, BX_KEY_TAB, BX_KEY_U, BX_KEY_UNHANDLED, BX_KEY_UP, BX_KEY_V, BX_KEY_W, BX_KEY_WIN_L, BX_KEY_WIN_R, BX_KEY_X, BX_KEY_Y, and BX_KEY_Z.
Referenced by bx_sdl_gui_c::handle_events().
| int fontheight = 16 |
Definition at line 157 of file sdl.cpp.
Referenced by bx_sdl_gui_c::dimension_update(), and bx_sdl_gui_c::text_update().
| int fontwidth = 8 |
Definition at line 157 of file sdl.cpp.
Referenced by bx_sdl_gui_c::dimension_update(), and bx_sdl_gui_c::text_update().
| unsigned half_res_x |
Definition at line 153 of file sdl.cpp.
Referenced by bx_sdl_gui_c::dimension_update(), and bx_sdl_gui_c::specific_init().
| unsigned half_res_y |
Definition at line 153 of file sdl.cpp.
Referenced by bx_sdl_gui_c::dimension_update(), and bx_sdl_gui_c::specific_init().
| bool just_warped = false |
| u16 line_compare = 1023 |
| u8 new_mousebuttons = 0 |
| int new_mousex = 0 |
| int new_mousey = 0 |
| u8 old_mousebuttons = 0 |
| int old_mousex = 0 |
| int old_mousey = 0 |
Definition at line 160 of file sdl.cpp.
Referenced by bx_sdl_gui_c::graphics_tile_update(), bx_sdl_gui_c::palette_change(), and bx_sdl_gui_c::text_update().
unsigned prev_cursor_x = 0 [static] |
unsigned prev_cursor_y = 0 [static] |
| unsigned res_x |
Definition at line 152 of file sdl.cpp.
Referenced by bx_sdl_gui_c::clear_screen(), bx_sdl_gui_c::dimension_update(), bx_sdl_gui_c::flush(), bx_sdl_gui_c::graphics_tile_get(), and bx_sdl_gui_c::handle_events().
| unsigned res_y |
Definition at line 152 of file sdl.cpp.
Referenced by bx_sdl_gui_c::clear_screen(), bx_sdl_gui_c::dimension_update(), bx_sdl_gui_c::flush(), bx_sdl_gui_c::graphics_tile_get(), bx_sdl_gui_c::graphics_tile_update(), bx_sdl_gui_c::handle_events(), and bx_sdl_gui_c::text_update().
| SDL_Event sdl_event |
| int sdl_grab |
Definition at line 151 of file sdl.cpp.
Referenced by bx_sdl_gui_c::mouse_enabled_changed_specific().
| SDL_Surface* sdl_screen |
Definition at line 149 of file sdl.cpp.
Referenced by bx_sdl_gui_c::clear_screen(), bx_sdl_gui_c::dimension_update(), bx_sdl_gui_c::exit(), bx_sdl_gui_c::flush(), bx_sdl_gui_c::graphics_tile_get(), bx_sdl_gui_c::graphics_tile_info(), bx_sdl_gui_c::graphics_tile_update(), bx_sdl_gui_c::handle_events(), bx_sdl_gui_c::palette_change(), bx_sdl_gui_c::specific_init(), and bx_sdl_gui_c::text_update().
| SDL_Thread* sdl_thread |
bx_sdl_gui_c* theGui = NULL [static] |
| unsigned tileheight |
Definition at line 159 of file sdl.cpp.
Referenced by bx_sdl_gui_c::graphics_tile_get(), bx_sdl_gui_c::graphics_tile_update(), and bx_sdl_gui_c::specific_init().
| unsigned tilewidth |
Definition at line 159 of file sdl.cpp.
Referenced by bx_sdl_gui_c::graphics_tile_get(), bx_sdl_gui_c::graphics_tile_update(), and bx_sdl_gui_c::specific_init().