SDL2 support
Initial changes, not working yet
This commit is contained in:
parent
553247cd61
commit
0a8464acc1
21 changed files with 256 additions and 313 deletions
|
@ -118,7 +118,7 @@ static unsigned int hval;
|
|||
static int matchlen;
|
||||
static unsigned int matchpos;
|
||||
static unsigned int pos;
|
||||
static unsigned int remainder;
|
||||
//static unsigned int remainder;
|
||||
|
||||
#if 0
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include "blkdev.h"
|
||||
#include "calc.h"
|
||||
|
||||
#include "SDL_keysym.h"
|
||||
|
||||
static int config_newfilesystem;
|
||||
static struct strlist *temp_lines;
|
||||
static struct zfile *default_file, *configstore;
|
||||
|
|
|
@ -71,7 +71,7 @@ bool ham_drawn = false;
|
|||
coordinates have a lower resolution (i.e. we're shrinking the image). */
|
||||
static int res_shift;
|
||||
|
||||
extern SDL_Surface *prSDLScreen;
|
||||
extern SDL_Surface *screenSurface;
|
||||
|
||||
/* Lookup tables for dual playfields. The dblpf_*1 versions are for the case
|
||||
that playfield 1 has the priority, dbplpf_*2 are used if playfield 2 has
|
||||
|
|
|
@ -623,12 +623,12 @@ void virtualdevice_init (void)
|
|||
|
||||
static int real_main2 (int argc, TCHAR **argv)
|
||||
{
|
||||
printf("Amiberry v2.0 build 2016-09-14.1\n");
|
||||
printf("Amiberry v2.1 build 2016-09-18.1\n");
|
||||
#ifdef PANDORA_SPECIFIC
|
||||
SDL_Init(SDL_INIT_NOPARACHUTE | SDL_INIT_VIDEO);
|
||||
#else
|
||||
#ifdef USE_SDL
|
||||
SDL_Init(SDL_INIT_NOPARACHUTE | SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
|
||||
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -249,7 +249,7 @@ static void CreateFilesysHardfileLoop(void)
|
|||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
// SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ static void EditFilesysHardfileLoop(void)
|
|||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
// SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ static void EditFilesysVirtualLoop(void)
|
|||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
// SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "gui_handling.h"
|
||||
|
||||
|
||||
extern SDL_Surface *prSDLScreen;
|
||||
extern SDL_Surface *screenSurface;
|
||||
extern void flush_screen();
|
||||
|
||||
static int msg_done = 0;
|
||||
|
@ -45,7 +45,7 @@ void InGameMessage(const char *msg)
|
|||
int msgHeight = 100;
|
||||
|
||||
msg_graphics = new gcn::SDLGraphics();
|
||||
msg_graphics->setTarget(prSDLScreen);
|
||||
msg_graphics->setTarget(screenSurface);
|
||||
msg_input = new gcn::SDLInput();
|
||||
msg_gui = new gcn::Gui();
|
||||
msg_gui->setGraphics(msg_graphics);
|
||||
|
@ -56,7 +56,7 @@ void InGameMessage(const char *msg)
|
|||
msg_baseCol.b = 208;
|
||||
|
||||
msg_top = new gcn::Container();
|
||||
msg_top->setDimension(gcn::Rectangle((prSDLScreen->w - msgWidth) / 2, (prSDLScreen->h - msgHeight) / 2, msgWidth, msgHeight));
|
||||
msg_top->setDimension(gcn::Rectangle((screenSurface->w - msgWidth) / 2, (screenSurface->h - msgHeight) / 2, msgWidth, msgHeight));
|
||||
msg_top->setBaseColor(msg_baseCol);
|
||||
msg_gui->setTop(msg_top);
|
||||
|
||||
|
@ -124,7 +124,7 @@ void InGameMessage(const char *msg)
|
|||
msg_gui->draw();
|
||||
// Finally we update the screen.
|
||||
if (!drawn)
|
||||
SDL_Flip(prSDLScreen);
|
||||
// SDL_Flip(screenSurface);
|
||||
drawn = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -267,38 +267,38 @@ public:
|
|||
changed_prefs.input_tablet = chkMouseHack->isSelected() ? TABLET_MOUSEHACK : TABLET_OFF;
|
||||
}
|
||||
#endif
|
||||
else if (actionEvent.getSource() == chkCustomCtrl)
|
||||
changed_prefs.pandora_customControls = chkCustomCtrl->isSelected() ? 1 : 0;
|
||||
|
||||
else if (actionEvent.getSource() == cboA)
|
||||
customControlMap[SDLK_HOME] = amigaKey[cboA->getSelected()];
|
||||
|
||||
else if (actionEvent.getSource() == cboB)
|
||||
customControlMap[SDLK_END] = amigaKey[cboB->getSelected()];
|
||||
|
||||
else if (actionEvent.getSource() == cboX)
|
||||
customControlMap[SDLK_PAGEDOWN] = amigaKey[cboX->getSelected()];
|
||||
|
||||
else if (actionEvent.getSource() == cboY)
|
||||
customControlMap[SDLK_PAGEUP] = amigaKey[cboY->getSelected()];
|
||||
|
||||
else if (actionEvent.getSource() == cboL)
|
||||
customControlMap[SDLK_RSHIFT] = amigaKey[cboL->getSelected()];
|
||||
|
||||
else if (actionEvent.getSource() == cboR)
|
||||
customControlMap[SDLK_RCTRL] = amigaKey[cboR->getSelected()];
|
||||
|
||||
else if (actionEvent.getSource() == cboUp)
|
||||
customControlMap[SDLK_UP] = amigaKey[cboUp->getSelected()];
|
||||
|
||||
else if (actionEvent.getSource() == cboDown)
|
||||
customControlMap[SDLK_DOWN] = amigaKey[cboDown->getSelected()];
|
||||
|
||||
else if (actionEvent.getSource() == cboLeft)
|
||||
customControlMap[SDLK_LEFT] = amigaKey[cboLeft->getSelected()];
|
||||
|
||||
else if (actionEvent.getSource() == cboRight)
|
||||
customControlMap[SDLK_RIGHT] = amigaKey[cboRight->getSelected()];
|
||||
// else if (actionEvent.getSource() == chkCustomCtrl)
|
||||
// changed_prefs.pandora_customControls = chkCustomCtrl->isSelected() ? 1 : 0;
|
||||
//
|
||||
// else if (actionEvent.getSource() == cboA)
|
||||
// customControlMap[SDLK_HOME] = amigaKey[cboA->getSelected()];
|
||||
//
|
||||
// else if (actionEvent.getSource() == cboB)
|
||||
// customControlMap[SDLK_END] = amigaKey[cboB->getSelected()];
|
||||
//
|
||||
// else if (actionEvent.getSource() == cboX)
|
||||
// customControlMap[SDLK_PAGEDOWN] = amigaKey[cboX->getSelected()];
|
||||
//
|
||||
// else if (actionEvent.getSource() == cboY)
|
||||
// customControlMap[SDLK_PAGEUP] = amigaKey[cboY->getSelected()];
|
||||
//
|
||||
// else if (actionEvent.getSource() == cboL)
|
||||
// customControlMap[SDLK_RSHIFT] = amigaKey[cboL->getSelected()];
|
||||
//
|
||||
// else if (actionEvent.getSource() == cboR)
|
||||
// customControlMap[SDLK_RCTRL] = amigaKey[cboR->getSelected()];
|
||||
//
|
||||
// else if (actionEvent.getSource() == cboUp)
|
||||
// customControlMap[SDLK_UP] = amigaKey[cboUp->getSelected()];
|
||||
//
|
||||
// else if (actionEvent.getSource() == cboDown)
|
||||
// customControlMap[SDLK_DOWN] = amigaKey[cboDown->getSelected()];
|
||||
//
|
||||
// else if (actionEvent.getSource() == cboLeft)
|
||||
// customControlMap[SDLK_LEFT] = amigaKey[cboLeft->getSelected()];
|
||||
//
|
||||
// else if (actionEvent.getSource() == cboRight)
|
||||
// customControlMap[SDLK_RIGHT] = amigaKey[cboRight->getSelected()];
|
||||
|
||||
else if (actionEvent.getSource() == KeyForMenu)
|
||||
changed_prefs.key_for_menu = ControlKey_SDLKeyValues[KeyForMenu->getSelected()] ;
|
||||
|
@ -659,17 +659,17 @@ void RefreshPanelInput(void)
|
|||
|
||||
chkMouseHack->setSelected(changed_prefs.input_tablet == TABLET_MOUSEHACK);
|
||||
#endif
|
||||
chkCustomCtrl->setSelected(changed_prefs.pandora_customControls);
|
||||
cboA->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_HOME]));
|
||||
cboB->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_END]));
|
||||
cboX->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_PAGEDOWN]));
|
||||
cboY->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_PAGEUP]));
|
||||
cboL->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_RSHIFT]));
|
||||
cboR->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_RCTRL]));
|
||||
cboUp->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_UP]));
|
||||
cboDown->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_DOWN]));
|
||||
cboLeft->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_LEFT]));
|
||||
cboRight->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_RIGHT]));
|
||||
// chkCustomCtrl->setSelected(changed_prefs.pandora_customControls);
|
||||
// cboA->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_HOME]));
|
||||
// cboB->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_END]));
|
||||
// cboX->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_PAGEDOWN]));
|
||||
// cboY->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_PAGEUP]));
|
||||
// cboL->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_RSHIFT]));
|
||||
// cboR->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_RCTRL]));
|
||||
// cboUp->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_UP]));
|
||||
// cboDown->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_DOWN]));
|
||||
// cboLeft->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_LEFT]));
|
||||
// cboRight->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_RIGHT]));
|
||||
|
||||
for(i=0; i<4; ++i)
|
||||
{
|
||||
|
|
|
@ -351,7 +351,7 @@ static void SelectFileLoop(void)
|
|||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
// SDL_Flip(gui_screen);
|
||||
|
||||
if (!dialogCreated)
|
||||
{
|
||||
|
|
|
@ -253,7 +253,7 @@ static void SelectFolderLoop(void)
|
|||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
// SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ static void ShowMessageLoop(void)
|
|||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
// SDL_Flip(gui_screen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -127,15 +127,7 @@ namespace sdl
|
|||
//-------------------------------------------------
|
||||
// Create new screen for GUI
|
||||
//-------------------------------------------------
|
||||
#if defined (RASPBERRY)
|
||||
const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo ();
|
||||
printf("Current resolution: %d x %d %d bpp\n",videoInfo->current_w, videoInfo->current_h, videoInfo->vfmt->BitsPerPixel);
|
||||
gui_screen = SDL_SetVideoMode(videoInfo->current_w, videoInfo->current_h, videoInfo->vfmt->BitsPerPixel, SDL_SWSURFACE);
|
||||
#else
|
||||
gui_screen = SDL_SetVideoMode(GUI_WIDTH, GUI_HEIGHT, 16, SDL_SWSURFACE);
|
||||
#endif
|
||||
SDL_EnableUNICODE(1);
|
||||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
gui_screen = SDL_CreateRGBSurface(0, GUI_WIDTH, GUI_HEIGHT, 32, 0, 0, 0, 0);
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -282,7 +274,7 @@ namespace sdl
|
|||
uae_gui->draw();
|
||||
// Finally we update the screen.
|
||||
wait_for_vsync();
|
||||
SDL_Flip(gui_screen);
|
||||
// SDL_Flip(gui_screen);
|
||||
|
||||
if(refreshFuncAfterDraw != NULL)
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "keybuf.h"
|
||||
#include "gui.h"
|
||||
#include <SDL.h>
|
||||
#include <SDL_video.h>
|
||||
|
||||
char keyboard_type = 0;
|
||||
|
||||
|
@ -289,16 +290,16 @@ static struct uae_input_device_kbr_default keytrans_amiga[] =
|
|||
{ SDLK_8, INPUTEVENT_KEY_8 },
|
||||
{ SDLK_9, INPUTEVENT_KEY_9 },
|
||||
|
||||
{ SDLK_KP0, INPUTEVENT_KEY_NP_0 },
|
||||
{ SDLK_KP1, INPUTEVENT_KEY_NP_1 },
|
||||
{ SDLK_KP2, INPUTEVENT_KEY_NP_2 },
|
||||
{ SDLK_KP3, INPUTEVENT_KEY_NP_3 },
|
||||
{ SDLK_KP4, INPUTEVENT_KEY_NP_4 },
|
||||
{ SDLK_KP5, INPUTEVENT_KEY_NP_5 },
|
||||
{ SDLK_KP6, INPUTEVENT_KEY_NP_6 },
|
||||
{ SDLK_KP7, INPUTEVENT_KEY_NP_7 },
|
||||
{ SDLK_KP8, INPUTEVENT_KEY_NP_8 },
|
||||
{ SDLK_KP9, INPUTEVENT_KEY_NP_9 },
|
||||
{ SDLK_KP_0, INPUTEVENT_KEY_NP_0 },
|
||||
{ SDLK_KP_1, INPUTEVENT_KEY_NP_1 },
|
||||
{ SDLK_KP_2, INPUTEVENT_KEY_NP_2 },
|
||||
{ SDLK_KP_3, INPUTEVENT_KEY_NP_3 },
|
||||
{ SDLK_KP_4, INPUTEVENT_KEY_NP_4 },
|
||||
{ SDLK_KP_5, INPUTEVENT_KEY_NP_5 },
|
||||
{ SDLK_KP_6, INPUTEVENT_KEY_NP_6 },
|
||||
{ SDLK_KP_7, INPUTEVENT_KEY_NP_7 },
|
||||
{ SDLK_KP_8, INPUTEVENT_KEY_NP_8 },
|
||||
{ SDLK_KP_9, INPUTEVENT_KEY_NP_9 },
|
||||
{ SDLK_KP_DIVIDE, INPUTEVENT_KEY_NP_DIV },
|
||||
{ SDLK_KP_MULTIPLY, INPUTEVENT_KEY_NP_MUL },
|
||||
{ SDLK_KP_MINUS, INPUTEVENT_KEY_NP_SUB },
|
||||
|
@ -378,9 +379,7 @@ static int *kbmaps[] = { kb_none, kb_none, kb_none, kb_none, kb_none,
|
|||
|
||||
void keyboard_settrans (void)
|
||||
{
|
||||
char vid_drv_name[32];
|
||||
// get display type...
|
||||
SDL_VideoDriverName(vid_drv_name, sizeof(vid_drv_name));
|
||||
const char* vid_drv_name = SDL_GetCurrentVideoDriver();
|
||||
if (strcmp(vid_drv_name, "x11") == 0)
|
||||
{
|
||||
printf("Will use keycode from x11 mapping.\n");
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "disk.h"
|
||||
#include "SDL.h"
|
||||
|
||||
extern int customControlMap[SDLK_LAST];
|
||||
//extern int customControlMap[SDLK_LAST];
|
||||
|
||||
static int kickstart;
|
||||
|
||||
|
@ -486,16 +486,16 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath)
|
|||
fscanf(f, "cutRight=%d\n", &dummy);
|
||||
fscanf(f, "customControls=%d\n", &p->pandora_customControls);
|
||||
fscanf(f, "custom_dpad=%d\n", &dummy);
|
||||
fscanf(f, "custom_up=%d\n", &customControlMap[SDLK_UP]);
|
||||
fscanf(f, "custom_down=%d\n", &customControlMap[SDLK_DOWN]);
|
||||
fscanf(f, "custom_left=%d\n", &customControlMap[SDLK_LEFT]);
|
||||
fscanf(f, "custom_right=%d\n", &customControlMap[SDLK_RIGHT]);
|
||||
fscanf(f, "custom_A=%d\n", &customControlMap[SDLK_HOME]);
|
||||
fscanf(f, "custom_B=%d\n", &customControlMap[SDLK_END]);
|
||||
fscanf(f, "custom_X=%d\n", &customControlMap[SDLK_PAGEDOWN]);
|
||||
fscanf(f, "custom_Y=%d\n", &customControlMap[SDLK_PAGEUP]);
|
||||
fscanf(f, "custom_L=%d\n", &customControlMap[SDLK_RSHIFT]);
|
||||
fscanf(f, "custom_R=%d\n", &customControlMap[SDLK_RCTRL]);
|
||||
// fscanf(f, "custom_up=%d\n", &customControlMap[SDLK_UP]);
|
||||
// fscanf(f, "custom_down=%d\n", &customControlMap[SDLK_DOWN]);
|
||||
// fscanf(f, "custom_left=%d\n", &customControlMap[SDLK_LEFT]);
|
||||
// fscanf(f, "custom_right=%d\n", &customControlMap[SDLK_RIGHT]);
|
||||
// fscanf(f, "custom_A=%d\n", &customControlMap[SDLK_HOME]);
|
||||
// fscanf(f, "custom_B=%d\n", &customControlMap[SDLK_END]);
|
||||
// fscanf(f, "custom_X=%d\n", &customControlMap[SDLK_PAGEDOWN]);
|
||||
// fscanf(f, "custom_Y=%d\n", &customControlMap[SDLK_PAGEUP]);
|
||||
// fscanf(f, "custom_L=%d\n", &customControlMap[SDLK_RSHIFT]);
|
||||
// fscanf(f, "custom_R=%d\n", &customControlMap[SDLK_RCTRL]);
|
||||
fscanf(f, "cpu=%d\n", &cpu_level);
|
||||
if (cpu_level > 0) // M68000
|
||||
// Was old format
|
||||
|
|
|
@ -54,7 +54,7 @@ extern int loadconfig_old(struct uae_prefs *p, const char *orgpath);
|
|||
extern void SetLastActiveConfig(const char *filename);
|
||||
|
||||
/* Keyboard */
|
||||
int customControlMap[SDLK_LAST];
|
||||
//int customControlMap[SDLK_LAST];
|
||||
|
||||
char start_path_data[MAX_DPATH];
|
||||
char currentDir[MAX_DPATH];
|
||||
|
@ -261,7 +261,7 @@ void target_default_options (struct uae_prefs *p, int type)
|
|||
|
||||
p->picasso96_modeflags = RGBFF_CLUT | RGBFF_R5G6B5 | RGBFF_R8G8B8A8;
|
||||
|
||||
memset(customControlMap, 0, sizeof(customControlMap));
|
||||
// memset(customControlMap, 0, sizeof(customControlMap));
|
||||
}
|
||||
|
||||
|
||||
|
@ -271,16 +271,16 @@ void target_save_options (struct zfile *f, struct uae_prefs *p)
|
|||
cfgfile_write (f, "pandora.hide_idle_led", "%d", p->pandora_hide_idle_led);
|
||||
cfgfile_write (f, "pandora.tap_delay", "%d", p->pandora_tapDelay);
|
||||
cfgfile_write (f, "pandora.custom_controls", "%d", p->pandora_customControls);
|
||||
cfgfile_write (f, "pandora.custom_up", "%d", customControlMap[SDLK_UP]);
|
||||
cfgfile_write (f, "pandora.custom_down", "%d", customControlMap[SDLK_DOWN]);
|
||||
cfgfile_write (f, "pandora.custom_left", "%d", customControlMap[SDLK_LEFT]);
|
||||
cfgfile_write (f, "pandora.custom_right", "%d", customControlMap[SDLK_RIGHT]);
|
||||
cfgfile_write (f, "pandora.custom_a", "%d", customControlMap[SDLK_HOME]);
|
||||
cfgfile_write (f, "pandora.custom_b", "%d", customControlMap[SDLK_END]);
|
||||
cfgfile_write (f, "pandora.custom_x", "%d", customControlMap[SDLK_PAGEDOWN]);
|
||||
cfgfile_write (f, "pandora.custom_y", "%d", customControlMap[SDLK_PAGEUP]);
|
||||
cfgfile_write (f, "pandora.custom_l", "%d", customControlMap[SDLK_RSHIFT]);
|
||||
cfgfile_write (f, "pandora.custom_r", "%d", customControlMap[SDLK_RCTRL]);
|
||||
// cfgfile_write (f, "pandora.custom_up", "%d", customControlMap[SDLK_UP]);
|
||||
// cfgfile_write (f, "pandora.custom_down", "%d", customControlMap[SDLK_DOWN]);
|
||||
// cfgfile_write (f, "pandora.custom_left", "%d", customControlMap[SDLK_LEFT]);
|
||||
// cfgfile_write (f, "pandora.custom_right", "%d", customControlMap[SDLK_RIGHT]);
|
||||
// cfgfile_write (f, "pandora.custom_a", "%d", customControlMap[SDLK_HOME]);
|
||||
// cfgfile_write (f, "pandora.custom_b", "%d", customControlMap[SDLK_END]);
|
||||
// cfgfile_write (f, "pandora.custom_x", "%d", customControlMap[SDLK_PAGEDOWN]);
|
||||
// cfgfile_write (f, "pandora.custom_y", "%d", customControlMap[SDLK_PAGEUP]);
|
||||
// cfgfile_write (f, "pandora.custom_l", "%d", customControlMap[SDLK_RSHIFT]);
|
||||
// cfgfile_write (f, "pandora.custom_r", "%d", customControlMap[SDLK_RCTRL]);
|
||||
cfgfile_write (f, "pandora.move_x", "%d", p->pandora_horizontal_offset);
|
||||
cfgfile_write (f, "pandora.move_y", "%d", p->pandora_vertical_offset);
|
||||
}
|
||||
|
@ -302,16 +302,16 @@ int target_parse_option (struct uae_prefs *p, const char *option, const char *va
|
|||
|| cfgfile_intval (option, value, "hide_idle_led", &p->pandora_hide_idle_led, 1)
|
||||
|| cfgfile_intval (option, value, "tap_delay", &p->pandora_tapDelay, 1)
|
||||
|| cfgfile_intval (option, value, "custom_controls", &p->pandora_customControls, 1)
|
||||
|| cfgfile_intval (option, value, "custom_up", &customControlMap[SDLK_UP], 1)
|
||||
|| cfgfile_intval (option, value, "custom_down", &customControlMap[SDLK_DOWN], 1)
|
||||
|| cfgfile_intval (option, value, "custom_left", &customControlMap[SDLK_LEFT], 1)
|
||||
|| cfgfile_intval (option, value, "custom_right", &customControlMap[SDLK_RIGHT], 1)
|
||||
|| cfgfile_intval (option, value, "custom_a", &customControlMap[SDLK_HOME], 1)
|
||||
|| cfgfile_intval (option, value, "custom_b", &customControlMap[SDLK_END], 1)
|
||||
|| cfgfile_intval (option, value, "custom_x", &customControlMap[SDLK_PAGEDOWN], 1)
|
||||
|| cfgfile_intval (option, value, "custom_y", &customControlMap[SDLK_PAGEUP], 1)
|
||||
|| cfgfile_intval (option, value, "custom_l", &customControlMap[SDLK_RSHIFT], 1)
|
||||
|| cfgfile_intval (option, value, "custom_r", &customControlMap[SDLK_RCTRL], 1)
|
||||
// || cfgfile_intval (option, value, "custom_up", &customControlMap[SDLK_UP], 1)
|
||||
// || cfgfile_intval (option, value, "custom_down", &customControlMap[SDLK_DOWN], 1)
|
||||
// || cfgfile_intval (option, value, "custom_left", &customControlMap[SDLK_LEFT], 1)
|
||||
// || cfgfile_intval (option, value, "custom_right", &customControlMap[SDLK_RIGHT], 1)
|
||||
// || cfgfile_intval (option, value, "custom_a", &customControlMap[SDLK_HOME], 1)
|
||||
// || cfgfile_intval (option, value, "custom_b", &customControlMap[SDLK_END], 1)
|
||||
// || cfgfile_intval (option, value, "custom_x", &customControlMap[SDLK_PAGEDOWN], 1)
|
||||
// || cfgfile_intval (option, value, "custom_y", &customControlMap[SDLK_PAGEUP], 1)
|
||||
// || cfgfile_intval (option, value, "custom_l", &customControlMap[SDLK_RSHIFT], 1)
|
||||
// || cfgfile_intval (option, value, "custom_r", &customControlMap[SDLK_RCTRL], 1)
|
||||
|| cfgfile_intval (option, value, "move_x", &p->pandora_horizontal_offset, 1)
|
||||
|| cfgfile_intval (option, value, "move_y", &p->pandora_vertical_offset, 1)
|
||||
);
|
||||
|
@ -895,23 +895,23 @@ int handle_msgpump (void)
|
|||
// Fall through...
|
||||
|
||||
default:
|
||||
if(currprefs.pandora_customControls)
|
||||
{
|
||||
keycode = customControlMap[rEvent.key.keysym.sym];
|
||||
if(keycode < 0)
|
||||
{
|
||||
// Simulate mouse or joystick
|
||||
SimulateMouseOrJoy(keycode, 1);
|
||||
break;
|
||||
}
|
||||
else if(keycode > 0)
|
||||
{
|
||||
// Send mapped key press
|
||||
inputdevice_do_keyboard(keycode, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
// if(currprefs.pandora_customControls)
|
||||
// {
|
||||
// keycode = customControlMap[rEvent.key.keysym.sym];
|
||||
// if(keycode < 0)
|
||||
// {
|
||||
// // Simulate mouse or joystick
|
||||
// SimulateMouseOrJoy(keycode, 1);
|
||||
// break;
|
||||
// }
|
||||
// else if(keycode > 0)
|
||||
// {
|
||||
// // Send mapped key press
|
||||
// inputdevice_do_keyboard(keycode, 1);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
|
||||
modifier = rEvent.key.keysym.mod;
|
||||
keycode = translate_pandora_keys(rEvent.key.keysym.sym, &modifier);
|
||||
|
@ -961,22 +961,22 @@ int handle_msgpump (void)
|
|||
// Fall through...
|
||||
|
||||
default:
|
||||
if(currprefs.pandora_customControls)
|
||||
{
|
||||
keycode = customControlMap[rEvent.key.keysym.sym];
|
||||
if(keycode < 0)
|
||||
{
|
||||
// Simulate mouse or joystick
|
||||
SimulateMouseOrJoy(keycode, 0);
|
||||
break;
|
||||
}
|
||||
else if(keycode > 0)
|
||||
{
|
||||
// Send mapped key release
|
||||
inputdevice_do_keyboard(keycode, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if(currprefs.pandora_customControls)
|
||||
// {
|
||||
// keycode = customControlMap[rEvent.key.keysym.sym];
|
||||
// if(keycode < 0)
|
||||
// {
|
||||
// // Simulate mouse or joystick
|
||||
// SimulateMouseOrJoy(keycode, 0);
|
||||
// break;
|
||||
// }
|
||||
// else if(keycode > 0)
|
||||
// {
|
||||
// // Send mapped key release
|
||||
// inputdevice_do_keyboard(keycode, 0);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
modifier = rEvent.key.keysym.mod;
|
||||
keycode = translate_pandora_keys(rEvent.key.keysym.sym, &modifier);
|
||||
|
|
|
@ -604,9 +604,9 @@ void moveVertical(int value)
|
|||
|
||||
void gui_handle_events(void)
|
||||
{
|
||||
Uint8 *keystate = SDL_GetKeyState(NULL);
|
||||
const Uint8 *keystate = SDL_GetKeyboardState(NULL);
|
||||
|
||||
if (keystate[SDLK_LCTRL] && keystate[SDLK_LSUPER] && (keystate[SDLK_RSUPER] || keystate[SDLK_MENU]))
|
||||
if (keystate[SDLK_LCTRL] && keystate[SDLK_LGUI] && (keystate[SDLK_RGUI] || keystate[SDLK_MENU]))
|
||||
uae_reset(0, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ static void read_mouse(void)
|
|||
if (currprefs.jports[0].id == JSEM_MICE + 1 || currprefs.jports[1].id == JSEM_MICE + 1)
|
||||
{
|
||||
// dPad is mouse
|
||||
Uint8 *keystate = SDL_GetKeyState(NULL);
|
||||
const Uint8 *keystate = SDL_GetKeyboardState(NULL);
|
||||
int mouseScale = currprefs.input_joymouse_multiplier / 4;
|
||||
|
||||
if (keystate[SDLK_LEFT])
|
||||
|
@ -301,7 +301,7 @@ static int init_joystick(void)
|
|||
for (int cpt; cpt < nr_joysticks; cpt++)
|
||||
{
|
||||
Joysticktable[cpt] = SDL_JoystickOpen(cpt);
|
||||
strncpy(JoystickName[cpt], SDL_JoystickName(cpt), 80);
|
||||
strncpy(JoystickName[cpt], SDL_JoystickNameForIndex(cpt), 80);
|
||||
printf("Joystick %i : %s\n", cpt, JoystickName[cpt]);
|
||||
printf(" Buttons: %i Axis: %i Hats: %i\n", SDL_JoystickNumButtons(Joysticktable[cpt]), SDL_JoystickNumAxes(Joysticktable[cpt]), SDL_JoystickNumHats(Joysticktable[cpt]));
|
||||
|
||||
|
@ -444,7 +444,7 @@ static void read_joystick(void)
|
|||
// First handle fake joystick from pandora...
|
||||
if (currprefs.jports[joyid].id == JSEM_JOYS)
|
||||
{
|
||||
Uint8 *keystate = SDL_GetKeyState(NULL);
|
||||
const Uint8 *keystate = SDL_GetKeyboardState(NULL);
|
||||
|
||||
if (!keystate[SDLK_RCTRL])
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <png.h>
|
||||
#include <SDL.h>
|
||||
#include <SDL_image.h>
|
||||
#include <SDL_gfxPrimitives.h>
|
||||
//#include <SDL_gfxPrimitives.h>
|
||||
#ifdef ANDROIDSDL
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
@ -25,9 +25,8 @@
|
|||
|
||||
|
||||
/* SDL surface variable for output of emulation */
|
||||
SDL_Surface *prSDLScreen = NULL;
|
||||
/* Dummy SDL variable for screen init */
|
||||
SDL_Surface *Dummy_prSDLScreen = NULL;
|
||||
SDL_Surface *screenSurface = NULL;
|
||||
|
||||
static SDL_Surface *current_screenshot = NULL;
|
||||
/* Possible screen modes (x and y resolutions) */
|
||||
|
||||
|
@ -67,12 +66,13 @@ static unsigned long next_synctime = 0;
|
|||
|
||||
uae_sem_t vsync_wait_sem;
|
||||
|
||||
DISPMANX_DISPLAY_HANDLE_T dispmanxdisplay;
|
||||
DISPMANX_MODEINFO_T dispmanxdinfo;
|
||||
DISPMANX_RESOURCE_HANDLE_T dispmanxresource_amigafb_1;
|
||||
DISPMANX_RESOURCE_HANDLE_T dispmanxresource_amigafb_2;
|
||||
DISPMANX_ELEMENT_HANDLE_T dispmanxelement;
|
||||
DISPMANX_UPDATE_HANDLE_T dispmanxupdate;
|
||||
DISPMANX_DISPLAY_HANDLE_T display;
|
||||
DISPMANX_MODEINFO_T info;
|
||||
DISPMANX_RESOURCE_HANDLE_T resource_amigafb_1;
|
||||
DISPMANX_RESOURCE_HANDLE_T resource_amigafb_2;
|
||||
DISPMANX_ELEMENT_HANDLE_T element;
|
||||
DISPMANX_UPDATE_HANDLE_T update;
|
||||
VC_IMAGE_TYPE_T type = VC_IMAGE_RGBA32;
|
||||
VC_RECT_T src_rect;
|
||||
VC_RECT_T dst_rect;
|
||||
VC_RECT_T blit_rect;
|
||||
|
@ -81,11 +81,6 @@ unsigned char current_resource_amigafb = 0;
|
|||
|
||||
void vsync_callback(unsigned int a, void* b)
|
||||
{
|
||||
//vsync_timing=SDL_GetTicks();
|
||||
//vsync_frequency = vsync_timing - old_time;
|
||||
//old_time = vsync_timing;
|
||||
//need_frameskip = ( vsync_frequency > 31 ) ? (need_frameskip+1) : need_frameskip;
|
||||
//printf("d: %i", vsync_frequency );
|
||||
uae_sem_post (&vsync_wait_sem);
|
||||
}
|
||||
|
||||
|
@ -103,7 +98,7 @@ void InitAmigaVidMode(struct uae_prefs *p)
|
|||
{
|
||||
/* Initialize structure for Amiga video modes */
|
||||
gfxvidinfo.pixbytes = 2;
|
||||
gfxvidinfo.bufmem = (uae_u8 *)prSDLScreen->pixels;
|
||||
gfxvidinfo.bufmem = (uae_u8 *)screenSurface->pixels;
|
||||
gfxvidinfo.outwidth = p->gfx_size.width;
|
||||
gfxvidinfo.outheight = p->gfx_size.height;
|
||||
#ifdef PICASSO96
|
||||
|
@ -122,19 +117,19 @@ void graphics_dispmanshutdown (void)
|
|||
if (DispManXElementpresent == 1)
|
||||
{
|
||||
DispManXElementpresent = 0;
|
||||
dispmanxupdate = vc_dispmanx_update_start( 10 );
|
||||
vc_dispmanx_element_remove( dispmanxupdate, dispmanxelement);
|
||||
vc_dispmanx_update_submit_sync(dispmanxupdate);
|
||||
update = vc_dispmanx_update_start( 10 );
|
||||
vc_dispmanx_element_remove(update, element);
|
||||
vc_dispmanx_update_submit_sync(update);
|
||||
}
|
||||
}
|
||||
|
||||
void graphics_subshutdown (void)
|
||||
{
|
||||
if (dispmanxresource_amigafb_1 != 0)
|
||||
if (resource_amigafb_1 != 0)
|
||||
graphics_dispmanshutdown();
|
||||
// Dunno if below lines are usefull for Rpi...
|
||||
//SDL_FreeSurface(prSDLScreen);
|
||||
//prSDLScreen = NULL;
|
||||
|
||||
SDL_FreeSurface(screenSurface);
|
||||
screenSurface = NULL;
|
||||
}
|
||||
|
||||
static void open_screen(struct uae_prefs *p)
|
||||
|
@ -162,120 +157,95 @@ static void open_screen(struct uae_prefs *p)
|
|||
height = p->gfx_size.height;
|
||||
}
|
||||
|
||||
//if(prSDLScreen != NULL)
|
||||
//{
|
||||
// SDL_FreeSurface(prSDLScreen);
|
||||
// prSDLScreen = NULL;
|
||||
//}
|
||||
|
||||
if(Dummy_prSDLScreen == NULL )
|
||||
{
|
||||
const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo ();
|
||||
printf("DispmanX: Current resolution: %d x %d %d bpp\n",videoInfo->current_w, videoInfo->current_h, videoInfo->vfmt->BitsPerPixel);
|
||||
// For debug, in order to avoid full screen.
|
||||
Dummy_prSDLScreen = SDL_SetVideoMode(videoInfo->current_w,videoInfo->current_h, 16, SDL_SWSURFACE | SDL_FULLSCREEN);
|
||||
//Dummy_prSDLScreen = SDL_SetVideoMode(800,480,16,SDL_SWSURFACE );
|
||||
}
|
||||
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
|
||||
// check if resolution hasn't change in menu. otherwise free the resources so that they will be re-generated with new resolution.
|
||||
if ((dispmanxresource_amigafb_1 != 0) &&
|
||||
// check if resolution hasn't changed in menu, otherwise free the resources so that they will be re-generated with new resolution.
|
||||
if ((resource_amigafb_1 != 0) &&
|
||||
((blit_rect.width != width) || (blit_rect.height != height) || (currprefs.gfx_correct_aspect != changed_prefs.gfx_correct_aspect) ||
|
||||
(currprefs.gfx_fullscreen_ratio != changed_prefs.gfx_fullscreen_ratio)))
|
||||
{
|
||||
printf("Emulation resolution change detected.\n");
|
||||
if(prSDLScreen != NULL )
|
||||
// printf("Emulation resolution change detected.\n");
|
||||
if(screenSurface != NULL )
|
||||
{
|
||||
SDL_FreeSurface(prSDLScreen);
|
||||
prSDLScreen = 0;
|
||||
SDL_FreeSurface(screenSurface);
|
||||
screenSurface = 0;
|
||||
}
|
||||
graphics_dispmanshutdown();
|
||||
vc_dispmanx_resource_delete( dispmanxresource_amigafb_1 );
|
||||
vc_dispmanx_resource_delete( dispmanxresource_amigafb_2 );
|
||||
dispmanxresource_amigafb_1 = 0;
|
||||
dispmanxresource_amigafb_2 = 0;
|
||||
vc_dispmanx_resource_delete( resource_amigafb_1 );
|
||||
vc_dispmanx_resource_delete( resource_amigafb_2 );
|
||||
resource_amigafb_1 = 0;
|
||||
resource_amigafb_2 = 0;
|
||||
}
|
||||
|
||||
if (dispmanxresource_amigafb_1 == 0)
|
||||
if (resource_amigafb_1 == 0)
|
||||
{
|
||||
printf("Emulation resolution: Width %i Height: %i\n",width,height);
|
||||
printf("Emulation resolution: Width %i Height: %i\n", width, height);
|
||||
currprefs.gfx_correct_aspect = changed_prefs.gfx_correct_aspect;
|
||||
currprefs.gfx_fullscreen_ratio = changed_prefs.gfx_fullscreen_ratio;
|
||||
prSDLScreen = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 16,
|
||||
Dummy_prSDLScreen->format->Rmask,
|
||||
Dummy_prSDLScreen->format->Gmask,
|
||||
Dummy_prSDLScreen->format->Bmask,
|
||||
Dummy_prSDLScreen->format->Amask);
|
||||
screenSurface = SDL_CreateRGBSurface(0, width, height, 32, 0, 0, 0, 0);
|
||||
|
||||
dispmanxdisplay = vc_dispmanx_display_open( 0 );
|
||||
vc_dispmanx_display_get_info( dispmanxdisplay, &dispmanxdinfo);
|
||||
display = vc_dispmanx_display_open(0);
|
||||
vc_dispmanx_display_get_info(display, &info);
|
||||
|
||||
dispmanxresource_amigafb_1 = vc_dispmanx_resource_create( VC_IMAGE_RGB565, width, height, &vc_image_ptr);
|
||||
dispmanxresource_amigafb_2 = vc_dispmanx_resource_create( VC_IMAGE_RGB565, width, height, &vc_image_ptr);
|
||||
vc_dispmanx_rect_set( &blit_rect, 0, 0, width,height);
|
||||
vc_dispmanx_resource_write_data( dispmanxresource_amigafb_1,
|
||||
VC_IMAGE_RGB565,
|
||||
width *2,
|
||||
prSDLScreen->pixels,
|
||||
&blit_rect );
|
||||
vc_dispmanx_rect_set( &src_rect, 0, 0, width << 16, height << 16 );
|
||||
resource_amigafb_1 = vc_dispmanx_resource_create(type, width, height, &vc_image_ptr);
|
||||
resource_amigafb_2 = vc_dispmanx_resource_create(type, width, height, &vc_image_ptr);
|
||||
vc_dispmanx_rect_set( &blit_rect, 0, 0, width, height);
|
||||
vc_dispmanx_resource_write_data(resource_amigafb_1, type, sizeof(width), screenSurface->pixels, &blit_rect);
|
||||
vc_dispmanx_rect_set( &src_rect, 0, 0, width << 16, height << 16);
|
||||
|
||||
}
|
||||
// 16/9 to 4/3 ratio adaptation.
|
||||
if (currprefs.gfx_correct_aspect == 0)
|
||||
{
|
||||
// Fullscreen.
|
||||
int scaled_width = dispmanxdinfo.width * currprefs.gfx_fullscreen_ratio/100;
|
||||
int scaled_height = dispmanxdinfo.height * currprefs.gfx_fullscreen_ratio/100;
|
||||
vc_dispmanx_rect_set( &dst_rect, (dispmanxdinfo.width - scaled_width)/2,
|
||||
(dispmanxdinfo.height - scaled_height)/2,
|
||||
int scaled_width = info.width * currprefs.gfx_fullscreen_ratio/100;
|
||||
int scaled_height = info.height * currprefs.gfx_fullscreen_ratio/100;
|
||||
vc_dispmanx_rect_set( &dst_rect, (info.width - scaled_width)/2,
|
||||
(info.height - scaled_height)/2,
|
||||
scaled_width,
|
||||
scaled_height );
|
||||
}
|
||||
else
|
||||
{
|
||||
// 4/3 shrink.
|
||||
int scaled_width = dispmanxdinfo.width * currprefs.gfx_fullscreen_ratio/100;
|
||||
int scaled_height = dispmanxdinfo.height * currprefs.gfx_fullscreen_ratio/100;
|
||||
vc_dispmanx_rect_set( &dst_rect, (dispmanxdinfo.width - scaled_width/16*12)/2,
|
||||
(dispmanxdinfo.height - scaled_height)/2,
|
||||
int scaled_width = info.width * currprefs.gfx_fullscreen_ratio/100;
|
||||
int scaled_height = info.height * currprefs.gfx_fullscreen_ratio/100;
|
||||
vc_dispmanx_rect_set( &dst_rect, (info.width - scaled_width/16*12)/2,
|
||||
(info.height - scaled_height)/2,
|
||||
scaled_width/16*12,
|
||||
scaled_height );
|
||||
}
|
||||
|
||||
// For debug, in order to avoid full screen.
|
||||
//vc_dispmanx_rect_set( &dst_rect, (dispmanxdinfo.width /2.7),
|
||||
//vc_dispmanx_rect_set( &dst_rect, (info.width /2.7),
|
||||
// 0 ,
|
||||
// (dispmanxdinfo.width - (dispmanxdinfo.width * 6)/100 )/1.5,
|
||||
// (dispmanxdinfo.height - (dispmanxdinfo.height * 7)/100 )/1.5);
|
||||
// (info.width - (info.width * 6)/100 )/1.5,
|
||||
// (info.height - (info.height * 7)/100 )/1.5);
|
||||
|
||||
|
||||
if (DispManXElementpresent == 0)
|
||||
{
|
||||
DispManXElementpresent = 1;
|
||||
dispmanxupdate = vc_dispmanx_update_start( 10 );
|
||||
dispmanxelement = vc_dispmanx_element_add( dispmanxupdate,
|
||||
dispmanxdisplay,
|
||||
2000, // layer
|
||||
update = vc_dispmanx_update_start( 10 );
|
||||
element = vc_dispmanx_element_add(update,
|
||||
display,
|
||||
1, // layer
|
||||
&dst_rect,
|
||||
dispmanxresource_amigafb_1,
|
||||
resource_amigafb_1,
|
||||
&src_rect,
|
||||
DISPMANX_PROTECTION_NONE,
|
||||
&alpha,
|
||||
NULL, // clamp
|
||||
DISPMANX_NO_ROTATE );
|
||||
|
||||
vc_dispmanx_update_submit(dispmanxupdate,NULL,NULL);
|
||||
//dispmanxupdate = vc_dispmanx_update_start( 10 );
|
||||
vc_dispmanx_update_submit_sync(update);
|
||||
}
|
||||
|
||||
if(prSDLScreen != NULL)
|
||||
if(screenSurface != NULL)
|
||||
{
|
||||
InitAmigaVidMode(p);
|
||||
init_row_map();
|
||||
}
|
||||
//framecnt = 1; // Don't draw frame before reset done
|
||||
}
|
||||
|
||||
void update_display(struct uae_prefs *p)
|
||||
|
@ -343,14 +313,6 @@ void wait_for_vsync(void)
|
|||
|
||||
void flush_screen ()
|
||||
{
|
||||
//SDL_UnlockSurface (prSDLScreen);
|
||||
|
||||
//if (show_inputmode)
|
||||
//{
|
||||
// inputmode_redraw();
|
||||
//}
|
||||
|
||||
|
||||
if (savestate_state == STATE_DOSAVE)
|
||||
{
|
||||
if(delay_savestate_frame > 0)
|
||||
|
@ -364,38 +326,33 @@ void flush_screen ()
|
|||
}
|
||||
|
||||
unsigned long start = read_processor_time();
|
||||
//if(start < next_synctime && next_synctime - start > time_per_frame - 1000)
|
||||
// usleep((next_synctime - start) - 1000);
|
||||
//SDL_Flip(prSDLScreen);
|
||||
|
||||
|
||||
if (current_resource_amigafb == 1)
|
||||
{
|
||||
current_resource_amigafb = 0;
|
||||
vc_dispmanx_resource_write_data( dispmanxresource_amigafb_1,
|
||||
VC_IMAGE_RGB565,
|
||||
gfxvidinfo.outwidth * 2,
|
||||
vc_dispmanx_resource_write_data(resource_amigafb_1,
|
||||
type,
|
||||
sizeof(gfxvidinfo.outwidth),
|
||||
gfxvidinfo.bufmem,
|
||||
&blit_rect );
|
||||
dispmanxupdate = vc_dispmanx_update_start( 10 );
|
||||
vc_dispmanx_element_change_source(dispmanxupdate,dispmanxelement,dispmanxresource_amigafb_1);
|
||||
|
||||
vc_dispmanx_update_submit(dispmanxupdate,vsync_callback,NULL);
|
||||
//vc_dispmanx_update_submit_sync(dispmanxupdate);
|
||||
update = vc_dispmanx_update_start( 10 );
|
||||
vc_dispmanx_element_change_source(update, element, resource_amigafb_1);
|
||||
|
||||
// vc_dispmanx_update_submit(update, vsync_callback, NULL);
|
||||
vc_dispmanx_update_submit_sync(update);
|
||||
}
|
||||
else
|
||||
{
|
||||
current_resource_amigafb = 1;
|
||||
vc_dispmanx_resource_write_data( dispmanxresource_amigafb_2,
|
||||
VC_IMAGE_RGB565,
|
||||
gfxvidinfo.outwidth * 2,
|
||||
vc_dispmanx_resource_write_data(resource_amigafb_2,
|
||||
type,
|
||||
sizeof(gfxvidinfo.outwidth),
|
||||
gfxvidinfo.bufmem,
|
||||
&blit_rect );
|
||||
dispmanxupdate = vc_dispmanx_update_start( 10 );
|
||||
vc_dispmanx_element_change_source(dispmanxupdate,dispmanxelement,dispmanxresource_amigafb_2);
|
||||
|
||||
vc_dispmanx_update_submit(dispmanxupdate,vsync_callback,NULL);
|
||||
update = vc_dispmanx_update_start( 10 );
|
||||
vc_dispmanx_element_change_source(update, element, resource_amigafb_2);
|
||||
vc_dispmanx_update_submit_sync(update);
|
||||
// vc_dispmanx_update_submit(update, vsync_callback,NULL);
|
||||
}
|
||||
|
||||
last_synctime = read_processor_time();
|
||||
|
@ -416,13 +373,15 @@ void flush_screen ()
|
|||
|
||||
void black_screen_now(void)
|
||||
{
|
||||
SDL_FillRect(Dummy_prSDLScreen,NULL,0);
|
||||
SDL_Flip(Dummy_prSDLScreen);
|
||||
SDL_FillRect(screenSurface, NULL, 0);
|
||||
|
||||
// SDL_FillRect(Dummy_prSDLScreen,NULL,0);
|
||||
// SDL_Flip(Dummy_prSDLScreen);
|
||||
}
|
||||
|
||||
static void graphics_subinit (void)
|
||||
{
|
||||
if (prSDLScreen == NULL)
|
||||
if (screenSurface == NULL)
|
||||
{
|
||||
fprintf(stderr, "Unable to set video mode: %s\n", SDL_GetError());
|
||||
return;
|
||||
|
@ -430,7 +389,6 @@ static void graphics_subinit (void)
|
|||
else
|
||||
{
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
|
||||
InitAmigaVidMode(&currprefs);
|
||||
}
|
||||
}
|
||||
|
@ -466,12 +424,12 @@ static int init_colors (void)
|
|||
int red_shift, green_shift, blue_shift;
|
||||
|
||||
/* Truecolor: */
|
||||
red_bits = bitsInMask(prSDLScreen->format->Rmask);
|
||||
green_bits = bitsInMask(prSDLScreen->format->Gmask);
|
||||
blue_bits = bitsInMask(prSDLScreen->format->Bmask);
|
||||
red_shift = maskShift(prSDLScreen->format->Rmask);
|
||||
green_shift = maskShift(prSDLScreen->format->Gmask);
|
||||
blue_shift = maskShift(prSDLScreen->format->Bmask);
|
||||
red_bits = bitsInMask(screenSurface->format->Rmask);
|
||||
green_bits = bitsInMask(screenSurface->format->Gmask);
|
||||
blue_bits = bitsInMask(screenSurface->format->Bmask);
|
||||
red_shift = maskShift(screenSurface->format->Rmask);
|
||||
green_shift = maskShift(screenSurface->format->Gmask);
|
||||
blue_shift = maskShift(screenSurface->format->Bmask);
|
||||
alloc_colors64k (red_bits, green_bits, blue_bits, red_shift, green_shift, blue_shift, 0);
|
||||
notice_new_xcolors();
|
||||
for (i = 0; i < 4096; i++)
|
||||
|
@ -485,19 +443,19 @@ static int init_colors (void)
|
|||
*/
|
||||
static int get_display_depth (void)
|
||||
{
|
||||
const SDL_VideoInfo *vid_info;
|
||||
int depth = 0;
|
||||
// const SDL_VideoInfo *vid_info;
|
||||
int depth = 32;
|
||||
|
||||
if ((vid_info = SDL_GetVideoInfo()))
|
||||
{
|
||||
depth = vid_info->vfmt->BitsPerPixel;
|
||||
|
||||
/* Don't trust the answer if it's 16 bits; the display
|
||||
* could actually be 15 bits deep. We'll count the bits
|
||||
* ourselves */
|
||||
if (depth == 16)
|
||||
depth = bitsInMask (vid_info->vfmt->Rmask) + bitsInMask (vid_info->vfmt->Gmask) + bitsInMask (vid_info->vfmt->Bmask);
|
||||
}
|
||||
// if ((vid_info = SDL_GetVideoInfo()))
|
||||
// {
|
||||
// depth = vid_info->vfmt->BitsPerPixel;
|
||||
//
|
||||
// /* Don't trust the answer if it's 16 bits; the display
|
||||
// * could actually be 15 bits deep. We'll count the bits
|
||||
// * ourselves */
|
||||
// if (depth == 16)
|
||||
// depth = bitsInMask (vid_info->vfmt->Rmask) + bitsInMask (vid_info->vfmt->Gmask) + bitsInMask (vid_info->vfmt->Bmask);
|
||||
// }
|
||||
return depth;
|
||||
}
|
||||
|
||||
|
@ -525,26 +483,22 @@ int graphics_init(bool mousecapture)
|
|||
if (!init_colors ())
|
||||
return 0;
|
||||
|
||||
//buttonstate[0] = buttonstate[1] = buttonstate[2] = 0;
|
||||
//keyboard_init();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void graphics_leave (void)
|
||||
{
|
||||
graphics_subshutdown ();
|
||||
SDL_FreeSurface(Dummy_prSDLScreen);
|
||||
bcm_host_deinit();
|
||||
SDL_VideoQuit();
|
||||
}
|
||||
|
||||
#define systemRedShift (prSDLScreen->format->Rshift)
|
||||
#define systemGreenShift (prSDLScreen->format->Gshift)
|
||||
#define systemBlueShift (prSDLScreen->format->Bshift)
|
||||
#define systemRedMask (prSDLScreen->format->Rmask)
|
||||
#define systemGreenMask (prSDLScreen->format->Gmask)
|
||||
#define systemBlueMask (prSDLScreen->format->Bmask)
|
||||
#define systemRedShift (screenSurface->format->Rshift)
|
||||
#define systemGreenShift (screenSurface->format->Gshift)
|
||||
#define systemBlueShift (screenSurface->format->Bshift)
|
||||
#define systemRedMask (screenSurface->format->Rmask)
|
||||
#define systemGreenMask (screenSurface->format->Gmask)
|
||||
#define systemBlueMask (screenSurface->format->Bmask)
|
||||
|
||||
static int save_png(SDL_Surface* surface, char *path)
|
||||
{
|
||||
|
@ -628,10 +582,10 @@ static void CreateScreenshot(void)
|
|||
current_screenshot = NULL;
|
||||
}
|
||||
|
||||
w=prSDLScreen->w;
|
||||
h=prSDLScreen->h;
|
||||
current_screenshot = SDL_CreateRGBSurfaceFrom(prSDLScreen->pixels, w, h, prSDLScreen->format->BitsPerPixel, prSDLScreen->pitch,
|
||||
prSDLScreen->format->Rmask, prSDLScreen->format->Gmask, prSDLScreen->format->Bmask, prSDLScreen->format->Amask);
|
||||
w=screenSurface->w;
|
||||
h=screenSurface->h;
|
||||
current_screenshot = SDL_CreateRGBSurfaceFrom(screenSurface->pixels, w, h, screenSurface->format->BitsPerPixel, screenSurface->pitch,
|
||||
screenSurface->format->Rmask, screenSurface->format->Gmask, screenSurface->format->Bmask, screenSurface->format->Amask);
|
||||
}
|
||||
|
||||
static int save_thumb(char *path)
|
||||
|
@ -871,7 +825,7 @@ void gfx_set_picasso_state (int on)
|
|||
|
||||
screen_is_picasso = on;
|
||||
open_screen(&currprefs);
|
||||
picasso_vidinfo.rowbytes = prSDLScreen->pitch;
|
||||
picasso_vidinfo.rowbytes = screenSurface->pitch;
|
||||
}
|
||||
|
||||
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgbfmt)
|
||||
|
@ -893,7 +847,7 @@ void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgb
|
|||
if (screen_is_picasso)
|
||||
{
|
||||
open_screen(&currprefs);
|
||||
picasso_vidinfo.rowbytes = prSDLScreen->pitch;
|
||||
picasso_vidinfo.rowbytes = screenSurface->pitch;
|
||||
picasso_vidinfo.rgbformat = RGBFB_R5G6B5;
|
||||
}
|
||||
}
|
||||
|
@ -901,8 +855,8 @@ void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgb
|
|||
uae_u8 *gfx_lock_picasso (void)
|
||||
{
|
||||
// We lock the surface directly after create and flip
|
||||
picasso_vidinfo.rowbytes = prSDLScreen->pitch;
|
||||
return (uae_u8 *)prSDLScreen->pixels;
|
||||
picasso_vidinfo.rowbytes = screenSurface->pitch;
|
||||
return (uae_u8 *)screenSurface->pixels;
|
||||
}
|
||||
|
||||
void gfx_unlock_picasso (void)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "savestate.h"
|
||||
#include "statusline.h"
|
||||
|
||||
extern SDL_Surface *prSDLScreen;
|
||||
extern SDL_Surface *screenSurface;
|
||||
extern int idletime_percent;
|
||||
|
||||
/*
|
||||
|
@ -71,7 +71,7 @@ void draw_status_line_single (uae_u8 *buf, int y, int totalwidth)
|
|||
x += TD_WIDTH;
|
||||
|
||||
if(picasso_on)
|
||||
memset (buf + (x - 4) * 2, 0, (prSDLScreen->w - x + 4) * 2);
|
||||
memset (buf + (x - 4) * 2, 0, (screenSurface->w - x + 4) * 2);
|
||||
else
|
||||
memset (buf + (x - 4) * gfxvidinfo.pixbytes, 0, (gfxvidinfo.outwidth - x + 4) * gfxvidinfo.pixbytes);
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ STATIC_INLINE void uae_set_thread_priority (uae_thread_id *id, int pri)
|
|||
|
||||
STATIC_INLINE int uae_start_thread (const TCHAR *name, void *(*f) (void *), void *arg, uae_thread_id *foo)
|
||||
{
|
||||
uae_thread_id id = SDL_CreateThread ((int (*)(void *))f, arg);
|
||||
uae_thread_id id = SDL_CreateThread ((int (*)(void *))f, "StartThread", arg);
|
||||
if(foo != NULL)
|
||||
*foo = id;
|
||||
// dbg_add_thread(id, name);
|
||||
|
@ -49,7 +49,7 @@ STATIC_INLINE int uae_start_thread (const TCHAR *name, void *(*f) (void *), void
|
|||
|
||||
STATIC_INLINE int uae_start_thread_fast (void *(*f) (void *), void *arg, uae_thread_id *foo)
|
||||
{
|
||||
uae_thread_id id = SDL_CreateThread ((int (*)(void *))f, arg);
|
||||
uae_thread_id id = SDL_CreateThread ((int (*)(void *))f, "StartThreadFast", arg);
|
||||
if(foo != NULL)
|
||||
*foo = id;
|
||||
// dbg_add_thread(id, "<fast>");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue