Skip to content

Commit

Permalink
atari:events: remove proxy Atari events driver
Browse files Browse the repository at this point in the history
It was more confusing than helping. Atari_InitOSKeymap() set
this->InitOSKeymap and then called it immediately afterwards and
Atari_PumpEvents() was never even called.
  • Loading branch information
mikrosk committed Jun 29, 2024
1 parent 975e4d8 commit 30e74f7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 28 deletions.
22 changes: 3 additions & 19 deletions src/video/ataricommon/SDL_atarievents.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* Patrice Mandin
*
* This routines choose what the final event manager will be
* These routines choose what the final event manager will be
*/

#include <mint/osbind.h>
Expand All @@ -40,8 +40,8 @@

#include "SDL_atarikeys.h"
#include "SDL_atarievents_c.h"
#include "SDL_xbiosevents_c.h"
#include "SDL_ikbdevents_c.h"
#include "SDL_xbiosevents_c.h"

/* from src/audio/mint/SDL_mintaudio.c */
void SDL_AtariMint_UpdateAudio(void);
Expand All @@ -58,7 +58,7 @@ static const char *keytab_shift;
static SDL_bool conterm_set;
static char old_conterm;

static void Atari_InitializeEvents(_THIS)
void SDL_Atari_InitializeEvents(_THIS)
{
const char *envr;

Expand Down Expand Up @@ -90,16 +90,8 @@ static void Atari_InitializeEvents(_THIS)
this->PumpEvents=AtariXbios_PumpEvents;
XBIOS_ShutdownEvents=AtariXbios_ShutdownEvents;
}
}

void Atari_InitOSKeymap(_THIS)
{
Atari_InitializeEvents(this);

SDL_Atari_InitInternalKeymap(this);

/* Call choosen routine */
this->InitOSKeymap(this);
}

void SDL_Atari_InitConsoleSettings(void)
Expand Down Expand Up @@ -173,14 +165,6 @@ void SDL_Atari_InitInternalKeymap(_THIS)
keymap[SCANCODE_ALTGR] = SDLK_MODE;
}

void Atari_PumpEvents(_THIS)
{
Atari_InitializeEvents(this);

/* Call choosen routine */
this->PumpEvents(this);
}

/* Atari to Unicode charset translation table */
const static Uint16 SDL_AtariToUnicodeTable[256]={
/* Standard ASCII characters from 0x00 to 0x7e */
Expand Down
5 changes: 2 additions & 3 deletions src/video/ataricommon/SDL_atarievents_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@

#define ATARIBIOS_MAXKEYS 128

extern void Atari_InitOSKeymap(_THIS);
extern void Atari_PumpEvents(_THIS);
extern void SDL_Atari_InitializeEvents(_THIS);

extern void SDL_Atari_InitConsoleSettings(void);
extern void SDL_Atari_InitializeConsoleSettings(void);
extern void SDL_Atari_RestoreConsoleSettings(void);

extern void SDL_Atari_InitInternalKeymap(_THIS);
Expand Down
2 changes: 1 addition & 1 deletion src/video/gem/SDL_gemevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static int do_messages(_THIS, short *message, short latest_msg_id)
case WM_ONTOP:
SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
VDI_setpalette(this, VDI_curpalette);
SDL_Atari_InitConsoleSettings();
SDL_Atari_InitializeConsoleSettings();
break;
case WM_REDRAW:
if (!GEM_lock_redraw) {
Expand Down
2 changes: 1 addition & 1 deletion src/video/gem/SDL_gemvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat)
this->info.wm_available = 1;

/* Save & init CON: */
SDL_Atari_InitConsoleSettings();
SDL_Atari_InitializeConsoleSettings();

/* We're done! */
return(0);
Expand Down
7 changes: 3 additions & 4 deletions src/video/xbios/SDL_xbios.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ static SDL_VideoDevice *XBIOS_CreateDevice(int devindex)
device->GL_SwapBuffers = XBIOS_GL_SwapBuffers;
#endif

/* Events */
device->InitOSKeymap = Atari_InitOSKeymap;
device->PumpEvents = Atari_PumpEvents;
/* Events (XBIOS/IKBD driver) */
SDL_Atari_InitializeEvents(device);

device->free = XBIOS_DeleteDevice;

Expand Down Expand Up @@ -382,7 +381,7 @@ static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
}

/* Save & init CON: */
SDL_Atari_InitConsoleSettings();
SDL_Atari_InitializeConsoleSettings();

/* We're done! */
return(0);
Expand Down

0 comments on commit 30e74f7

Please sign in to comment.