Frank Zago to sdl

The following patch fixes some of the bitrot for the Nintendo DS port.
The support is still basic at the moment, but it allows to run the "general"
test under the current head of tree (parent: 5269:11bd1585efb5 tip).
Most of the patch is mine, but I integrated a couple changes that John
Magnotti posted on Feb 1st.
This commit is contained in:
Sam Lantinga 2011-02-12 11:36:56 -08:00
parent 5fc9a80e24
commit 96656bb924
15 changed files with 603 additions and 82 deletions

View file

@ -26,21 +26,21 @@
#include "SDL_haptic.h"
#include "../SDL_syshaptic.h"
#include "SDL_joystick.h"
#include <nds/arm9/rumble.h>
#include <nds/memory.h>
#include <nds/arm9/rumble.h>
#define MAX_HAPTICS 1
/* right now only the ezf3in1 (and maybe official rumble pak) are supported
and there can only be one of those in at a time (in GBA slot.) */
SDL_Haptic *nds_haptic = NULL;
static SDL_Haptic *nds_haptic = NULL;
typedef struct
struct haptic_hwdata
{
enum
{ NONE, OFFICIAL, EZF3IN1 } type;
int pos;
} NDS_HapticData;
};
void
@ -165,7 +165,7 @@ SDL_SYS_HapticOpen(SDL_Haptic * haptic)
return -1;
}
haptic->hwdata = SDL_malloc(sizeof(NDS_HapticData));
haptic->hwdata = SDL_malloc(sizeof(struct haptic_hwdata));
if (!haptic->hwdata) {
SDL_OutOfMemory();
return -1;