Fix Dolphin crash
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "input/input.h"
|
||||
#include "assert/assert.h"
|
||||
#include "debug/debug.h"
|
||||
|
||||
inputbuttondata_t INPUT_BUTTON_DATA[] = {
|
||||
#ifdef DUSK_INPUT_GAMEPAD
|
||||
@@ -38,6 +39,12 @@ inputbuttondata_t INPUT_BUTTON_DATA[] = {
|
||||
{ .name = NULL }
|
||||
};
|
||||
|
||||
errorret_t inputInitDolphin(void) {
|
||||
PAD_Init();
|
||||
|
||||
errorOk();
|
||||
}
|
||||
|
||||
void inputUpdateDolphin(void) {
|
||||
PAD_ScanPads();
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
#include "dusk.h"
|
||||
#include "error/error.h"
|
||||
|
||||
#define INPUT_DOLPHIN_PAD_COUNT PAD_CHANMAX
|
||||
#define INPUT_DOLPHIN_AXIS(value) ((float_t)(value) / 128.0f)
|
||||
@@ -44,6 +45,13 @@ typedef struct {
|
||||
#endif
|
||||
} inputdolphin_t;
|
||||
|
||||
/**
|
||||
* Initializes the input system for Dolphin.
|
||||
*
|
||||
* @return An error code if initialization fails.
|
||||
*/
|
||||
errorret_t inputInitDolphin(void);
|
||||
|
||||
/**
|
||||
* Updates the input state for Dolphin.
|
||||
*/
|
||||
|
||||
@@ -15,5 +15,6 @@
|
||||
|
||||
typedef inputdolphin_t inputplatform_t;
|
||||
|
||||
#define inputInitPlatform inputInitDolphin
|
||||
#define inputUpdatePlatform inputUpdateDolphin
|
||||
#define inputButtonGetValuePlatform inputButtonGetValueDolphin
|
||||
Reference in New Issue
Block a user