Exemplo n.º 1
0
int
SDL_SYS_HapticOpen(SDL_Haptic * haptic)
{
    if (!haptic) {
        return -1;
    }

    haptic->hwdata = SDL_malloc(sizeof(struct haptic_hwdata));
    if (!haptic->hwdata) {
        SDL_OutOfMemory();
        return -1;
    }
    nds_haptic = haptic;

    haptic->supported = SDL_HAPTIC_CONSTANT;

    /* determine what is here, if anything */
    haptic->hwdata->type = NONE;
    if (isRumbleInserted()) {
        /* official rumble pak is present. */
        haptic->hwdata->type = OFFICIAL;
    } else if (NDS_EZF_IsPresent()) {
        /* ezflash 3-in-1 pak is present. */
        haptic->hwdata->type = EZF3IN1;
        NDS_EZF_ChipReset();
    } else {
        /* no haptic present */
        SDL_SYS_LogicError();
        return -1;
    }

    return 0;
}
Exemplo n.º 2
0
int checkRumble() {
    if (__dsimode)
        return 0;

    sysSetCartOwner(BUS_OWNER_ARM9);

    OpenNorWrite();
    uint32 rumbleID = ReadNorFlashID();
    CloseNorWrite();


    if (isRumbleInserted())
        return 1; //Warioware / Official rumble found.
    else if (rumbleID != 0)
        return 2; //3in1 found
    else
        return 0; //No rumble found
}
Exemplo n.º 3
0
int RumbleCheck(void)
{
	sysSetCartOwner(BUS_OWNER_ARM9);

	if (isRumbleInserted()) {
		// Warioware / Official rumble
		rumbleType = 1;
	} else {
		// 3-in-1 found
		OpenNorWrite();
		uint32 rumbleID = ReadNorFlashID();
		CloseNorWrite();
		if (rumbleID != 0) rumbleType = 2; 
		else rumbleType = 0;
	}

	return rumbleType;
}
Exemplo n.º 4
0
int
SDL_SYS_HapticInit(void)
{
    int ret = 0;
    if (isRumbleInserted()) {
        /* official rumble pak is present. */
        ret = 1;
        printf("debug: haptic present: nintendo\n");
    } else if (NDS_EZF_IsPresent()) {
        /* ezflash 3-in-1 pak is present. */
        ret = 1;
        printf("debug: haptic present: ezf3in1\n");
        NDS_EZF_ChipReset();
    } else {
        printf("debug: no haptic found\n");
    }

    return ret;
}