mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-02 12:00:01 -06:00
allow entering joystick config
This commit is contained in:
@ -57,6 +57,8 @@ u32 ScreenBuffer[256*384];
|
||||
|
||||
bool Touching = false;
|
||||
|
||||
SDL_Joystick* Joystick;
|
||||
|
||||
|
||||
void AudioCallback(void* data, Uint8* stream, int len)
|
||||
{
|
||||
@ -93,6 +95,12 @@ int EmuThreadFunc(void* burp)
|
||||
SDL_PauseAudioDevice(audio, 0);
|
||||
}
|
||||
|
||||
// TODO: support more joysticks
|
||||
if (SDL_NumJoysticks() > 0)
|
||||
Joystick = SDL_JoystickOpen(0);
|
||||
else
|
||||
Joystick = NULL;
|
||||
|
||||
u32 nframes = 0;
|
||||
u32 starttick = SDL_GetTicks();
|
||||
u32 lasttick = starttick;
|
||||
@ -172,6 +180,8 @@ int EmuThreadFunc(void* burp)
|
||||
|
||||
EmuStatus = 0;
|
||||
|
||||
if (Joystick) SDL_JoystickClose(Joystick);
|
||||
|
||||
if (audio) SDL_CloseAudioDevice(audio);
|
||||
|
||||
NDS::DeInit();
|
||||
@ -464,6 +474,8 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
SDL_JoystickEventState(SDL_ENABLE);
|
||||
|
||||
uiInitOptions ui_opt;
|
||||
memset(&ui_opt, 0, sizeof(uiInitOptions));
|
||||
const char* ui_err = uiInit(&ui_opt);
|
||||
|
Reference in New Issue
Block a user