KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Rumble Pack

Maple driver for vibration pack peripherals More...

Files

file  purupuru.h
 Definitions for using the Puru Puru (Jump) Pack.
 

Data Structures

struct  purupuru_effect_t
 Effect generation structure. More...
 

Macros

#define PURUPURU_EFFECT2_UINTENSITY(x)
 Upper-nibble of effect2 convenience macro.
 
#define PURUPURU_EFFECT2_LINTENSITY(x)
 Lower-nibble of effect2 convenience macro.
 
#define PURUPURU_EFFECT2_DECAY   (8 << 4)
 Give a decay effect to the rumble on some packs.
 
#define PURUPURU_EFFECT2_PULSE   (8)
 Give a pulse effect to the rumble.
 
#define PURUPURU_EFFECT1_INTENSITY(x)
 Upper nibble of effect1 convenience macro.
 
#define PURUPURU_EFFECT1_PULSE   (8 << 4)
 Give a pulse effect to the rumble.
 
#define PURUPURU_EFFECT1_POWERSAVE   (15)
 Ignore this command.
 
#define PURUPURU_SPECIAL_MOTOR1   (1 << 4)
 Select motor #1.
 
#define PURUPURU_SPECIAL_MOTOR2   (1 << 7)
 Select motor #2.
 
#define PURUPURU_SPECIAL_PULSE   (1)
 Yet another pulse effect.
 

Functions

int purupuru_rumble (maple_device_t *dev, purupuru_effect_t *effect)
 Send an effect to a jump pack.
 
int purupuru_rumble_raw (maple_device_t *dev, uint32 effect)
 Send a raw effect to a jump pack.
 

Detailed Description

Maple driver for vibration pack peripherals

Macro Definition Documentation

◆ PURUPURU_EFFECT1_INTENSITY

#define PURUPURU_EFFECT1_INTENSITY ( x)
Value:
(x << 4)

Upper nibble of effect1 convenience macro.

This macro is for setting the upper nibble of the effect1 field of the purupuru_effect_t. This value works with the lower nibble of the effect2 field to increase the intensity of the rumble effect. Valid values are 0-7.

See also
PURUPURU_EFFECT2_LINTENSITY

◆ PURUPURU_EFFECT1_POWERSAVE

#define PURUPURU_EFFECT1_POWERSAVE   (15)

Ignore this command.

Most jump packs will ignore commands with this set in effect1, apparently.

◆ PURUPURU_EFFECT1_PULSE

#define PURUPURU_EFFECT1_PULSE   (8 << 4)

Give a pulse effect to the rumble.

This probably should be used with PURUPURU_EFFECT2_PULSE as well.

See also
PURUPURU_EFFECT2_PULSE

◆ PURUPURU_EFFECT2_DECAY

#define PURUPURU_EFFECT2_DECAY   (8 << 4)

Give a decay effect to the rumble on some packs.

◆ PURUPURU_EFFECT2_LINTENSITY

#define PURUPURU_EFFECT2_LINTENSITY ( x)
Value:
(x)

Lower-nibble of effect2 convenience macro.

This macro is for setting the lower nibble of the effect2 field of the purupuru_effect_t. This value works with the upper nibble of the effect1 field to increase the intensity of the rumble effect. Valid values are 0-7.

See also
PURUPURU_EFFECT1_INTENSITY

◆ PURUPURU_EFFECT2_PULSE

#define PURUPURU_EFFECT2_PULSE   (8)

Give a pulse effect to the rumble.

This probably should be used with PURUPURU_EFFECT1_PULSE as well.

See also
PURUPURU_EFFECT1_PULSE

◆ PURUPURU_EFFECT2_UINTENSITY

#define PURUPURU_EFFECT2_UINTENSITY ( x)
Value:
(x << 4)

Upper-nibble of effect2 convenience macro.

This macro is for setting the upper nibble of the effect2 field of the purupuru_effect_t. This apparently lowers the rumble's intensity somewhat. Valid values are 0-7.

◆ PURUPURU_SPECIAL_MOTOR1

#define PURUPURU_SPECIAL_MOTOR1   (1 << 4)

Select motor #1.

Most jump packs only have one motor, but on things that do have more than one motor (like PS1->Dreamcast controller adapters that support rumble), this selects the first motor.

◆ PURUPURU_SPECIAL_MOTOR2

#define PURUPURU_SPECIAL_MOTOR2   (1 << 7)

Select motor #2.

Most jump packs only have one motor, but on things that do have more than one motor (like PS1->Dreamcast controller adapters that support rumble), this selects the second motor.

◆ PURUPURU_SPECIAL_PULSE

#define PURUPURU_SPECIAL_PULSE   (1)

Yet another pulse effect.

This supposedly creates a sharp pulse effect.

Function Documentation

◆ purupuru_rumble()

int purupuru_rumble ( maple_device_t * dev,
purupuru_effect_t * effect )

Send an effect to a jump pack.

This function sends an effect created with the purupuru_effect_t structure to a jump pack to be executed.

Parameters
devThe device to send the command to.
effectThe effect to send.
Return values
MAPLE_EOKOn success.
MAPLE_EAGAINIf the command couldn't be sent. Try again later.
MAPLE_ETIMEOUTIf the command timed out while blocking.

◆ purupuru_rumble_raw()

int purupuru_rumble_raw ( maple_device_t * dev,
uint32 effect )

Send a raw effect to a jump pack.

This function sends an effect to a jump pack to be executed. This is for if you (for some reason) don't want to use purupuru_effect_t to build the effect up.

Parameters
devThe device to send the command to.
effectThe effect to send.
Return values
MAPLE_EOKOn success.
MAPLE_EAGAINIf the command couldn't be sent. Try again later.
MAPLE_ETIMEOUTIf the command timed out while blocking.