Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
vibration_test.c File Reference
Include dependency graph for vibration_test.c:

Go to the source code of this file.

Macros

#define SCENE_TASK   Task
 
#define SCENE_CHILD   Task
 
#define SCENE_CREATE   OVL_NAME(createLoader)
 
#define SCENE_PRIM_BUFFERS   0x5000
 
#define SCENE_OT_SHIFT   1
 

Functions

void SHOCKTST_highlight (ShockTest *task, ShockTestWindows *win, s32 highlight)
 Colors the editor's windows: palette 3 for the one under the cursor (highlight 1-5 and 10), 1 for the one being edited (0 and 6-9, 11)
 
s32 SHOCKTST_selectPattern (ShockTest *task, ShockTestWindows *win)
 Picks the pattern with up and down: 1 on cross, -1 on triangle.
 
void SHOCKTST_showPattern (ShockTest *task, ShockTestWindows *win, s32 pattern)
 Shows a pattern's number and each motor's time and power.
 
void SHOCKTST_showTimers (ShockTest *task, ShockTestWindows *win, s32 pattern)
 Shows each motor's power and the time it has left.
 
s32 SHOCKTST_playPattern (ShockTest *task, ShockTestWindows *win, s32 pattern)
 Plays a pattern on both motors, one frame on: 1 once both have stopped or triangle stops them.
 
s32 SHOCKTST_playAllPatterns (ShockTest *task, ShockTestWindows *win)
 Plays the patterns from task->playing to task->count in turn, the next one once a pattern ends or both motors stop, and returns 1 after the last.
 
s32 SHOCKTST_moveCursor (ShockTest *task, ShockTestWindows *win)
 Moves the editor's cursor over its rows and columns, skipping the empty ones: 1 when cross picks a value, -1 when it picks the play row, 2 on circle.
 
s32 SHOCKTST_editValue (ShockTest *task, ShockTestWindows *win, TextWindow **windows, u8 *value, u8 toggle)
 Changes a time or power with up and down (by 10 when repeating), or flips it between 0 and 1 when toggle is set: 1 on cross, -1 on triangle.
 
s32 SHOCKTST_editRow (ShockTest *task, ShockTestWindows *win)
 Edits what the cursor picked: the pattern, or a motor's time or power (the small motor's is only on or off); 1 once done.
 
void SHOCKTST_updateEditor (ShockTest *task, ShockTestWindows *win)
 The editor's task: creates its windows, then edits and plays the patterns (play with L1 held plays them all, circle checks the memory card); when killed, frees them and stops the motors.
 
void SHOCKTST_loadPatterns (ShockTest *task, ShockFile *file)
 Copies the pattern file's times and powers into the editor.
 
ShockTest * SHOCKTST_createEditor (s32 count)
 Creates the editor, with room for count patterns.
 
void SHOCKTST_convertText (ShockLoader *task)
 Turns DLSKDATA.TXT (the count, then a tab-separated row per pattern, of which type 1 holds the motors' times and powers) into the pattern file, and writes it to the PC as DLSKDATA.BIN.
 
void SHOCKTST_updateLoader (ShockLoader *task, ShockLoaderWindows *win)
 The loader's task: creates the title and help windows, reads DLSKDATA.TXT from the PC and starts the editor on it; START goes back to the stage select (MODE_STAGE_SELECT)
 
Task * SHOCKTST_createLoader (void)
 Creates the loader.
 

Variables

ShockTestRow SHOCKTST_menuRows [4]
 
char SHOCKTST_numberFormats [3][0x40]
 The strings of the pattern, time and power windows (setString), in font codes: the label, icon 7 (01 07), then control code 5 (02 05 01), which inserts work buffer 1, where setNumber writes the value.
 
char * SHOCKTST_motorNames [2]
 The names of the motors: "こうそく" (fast) and "ていそく" (slow)
 
char * SHOCKTST_textPath = "sim:C:\\DEVELOP\\DLSKDATA.TXT"
 
const char SHOCKTST_STR_START_BACK [20]
 "START:もどる" (START: back), padded to a word: the USA file's padding isn't zeros but what the assembler left there; the size leaves out the closing NUL
 

Macro Definition Documentation

◆ SCENE_TASK

#define SCENE_TASK   Task

Definition at line 19 of file vibration_test.c.

◆ SCENE_CHILD

#define SCENE_CHILD   Task

Definition at line 20 of file vibration_test.c.

◆ SCENE_CREATE

#define SCENE_CREATE   OVL_NAME(createLoader)

Definition at line 21 of file vibration_test.c.

◆ SCENE_PRIM_BUFFERS

#define SCENE_PRIM_BUFFERS   0x5000

Definition at line 22 of file vibration_test.c.

◆ SCENE_OT_SHIFT

#define SCENE_OT_SHIFT   1

Definition at line 23 of file vibration_test.c.

Function Documentation

◆ SHOCKTST_highlight()

void SHOCKTST_highlight ( ShockTest *  task,
ShockTestWindows *  win,
s32  highlight 
)

Colors the editor's windows: palette 3 for the one under the cursor (highlight 1-5 and 10), 1 for the one being edited (0 and 6-9, 11)

< a light blue: what is highlighted or current

< a light blue: what is highlighted or current

< a light blue: what is highlighted or current

< a light blue: what is highlighted or current

< a light blue: what is highlighted or current

< a light blue: what is highlighted or current

Definition at line 29 of file vibration_test.c.

Referenced by SHOCKTST_moveCursor().

Here is the caller graph for this function:

◆ SHOCKTST_selectPattern()

s32 SHOCKTST_selectPattern ( ShockTest *  task,
ShockTestWindows *  win 
)

Picks the pattern with up and down: 1 on cross, -1 on triangle.

Definition at line 79 of file vibration_test.c.

Referenced by SHOCKTST_editRow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SHOCKTST_showPattern()

void SHOCKTST_showPattern ( ShockTest *  task,
ShockTestWindows *  win,
s32  pattern 
)

Shows a pattern's number and each motor's time and power.

Definition at line 101 of file vibration_test.c.

Referenced by SHOCKTST_editValue(), SHOCKTST_playAllPatterns(), SHOCKTST_playPattern(), and SHOCKTST_selectPattern().

Here is the caller graph for this function:

◆ SHOCKTST_showTimers()

void SHOCKTST_showTimers ( ShockTest *  task,
ShockTestWindows *  win,
s32  pattern 
)

Shows each motor's power and the time it has left.

Definition at line 112 of file vibration_test.c.

Referenced by SHOCKTST_playAllPatterns(), and SHOCKTST_playPattern().

Here is the caller graph for this function:

◆ SHOCKTST_playPattern()

s32 SHOCKTST_playPattern ( ShockTest *  task,
ShockTestWindows *  win,
s32  pattern 
)

Plays a pattern on both motors, one frame on: 1 once both have stopped or triangle stops them.

Definition at line 123 of file vibration_test.c.

Referenced by SHOCKTST_playAllPatterns(), and SHOCKTST_updateEditor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SHOCKTST_playAllPatterns()

s32 SHOCKTST_playAllPatterns ( ShockTest *  task,
ShockTestWindows *  win 
)

Plays the patterns from task->playing to task->count in turn, the next one once a pattern ends or both motors stop, and returns 1 after the last.

The match depends on the reset being written in both branches.

Definition at line 161 of file vibration_test.c.

Referenced by SHOCKTST_updateEditor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SHOCKTST_moveCursor()

s32 SHOCKTST_moveCursor ( ShockTest *  task,
ShockTestWindows *  win 
)

Moves the editor's cursor over its rows and columns, skipping the empty ones: 1 when cross picks a value, -1 when it picks the play row, 2 on circle.

Definition at line 184 of file vibration_test.c.

Referenced by SHOCKTST_updateEditor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SHOCKTST_editValue()

s32 SHOCKTST_editValue ( ShockTest *  task,
ShockTestWindows *  win,
TextWindow **  windows,
u8 *  value,
u8  toggle 
)

Changes a time or power with up and down (by 10 when repeating), or flips it between 0 and 1 when toggle is set: 1 on cross, -1 on triangle.

Definition at line 227 of file vibration_test.c.

Referenced by SHOCKTST_editRow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SHOCKTST_editRow()

s32 SHOCKTST_editRow ( ShockTest *  task,
ShockTestWindows *  win 
)

Edits what the cursor picked: the pattern, or a motor's time or power (the small motor's is only on or off); 1 once done.

Definition at line 253 of file vibration_test.c.

Referenced by SHOCKTST_updateEditor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SHOCKTST_updateEditor()

void SHOCKTST_updateEditor ( ShockTest *  task,
ShockTestWindows *  win 
)

The editor's task: creates its windows, then edits and plays the patterns (play with L1 held plays them all, circle checks the memory card); when killed, frees them and stops the motors.

Definition at line 290 of file vibration_test.c.

Referenced by SHOCKTST_createEditor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SHOCKTST_loadPatterns()

void SHOCKTST_loadPatterns ( ShockTest *  task,
ShockFile *  file 
)

Copies the pattern file's times and powers into the editor.

Definition at line 374 of file vibration_test.c.

Referenced by SHOCKTST_updateLoader().

Here is the caller graph for this function:

◆ SHOCKTST_createEditor()

ShockTest * SHOCKTST_createEditor ( s32  count)

Creates the editor, with room for count patterns.

Definition at line 391 of file vibration_test.c.

Referenced by SHOCKTST_updateLoader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SHOCKTST_convertText()

void SHOCKTST_convertText ( ShockLoader *  task)

Turns DLSKDATA.TXT (the count, then a tab-separated row per pattern, of which type 1 holds the motors' times and powers) into the pattern file, and writes it to the PC as DLSKDATA.BIN.

Definition at line 405 of file vibration_test.c.

Referenced by SHOCKTST_updateLoader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SHOCKTST_updateLoader()

void SHOCKTST_updateLoader ( ShockLoader *  task,
ShockLoaderWindows *  win 
)

The loader's task: creates the title and help windows, reads DLSKDATA.TXT from the PC and starts the editor on it; START goes back to the stage select (MODE_STAGE_SELECT)

< STAGSLCT, the debug stage select

Definition at line 496 of file vibration_test.c.

Referenced by SHOCKTST_createLoader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SHOCKTST_createLoader()

Task * SHOCKTST_createLoader ( void  )

Creates the loader.

Definition at line 550 of file vibration_test.c.

Here is the call graph for this function:

Variable Documentation

◆ SHOCKTST_menuRows

ShockTestRow SHOCKTST_menuRows[4]
Initial value:
= {
{{1, 0}, {1, 0, 0, 0}},
{{1, 1}, {2, 3, 6, 7}},
{{1, 1}, {4, 5, 8, 9}},
{{1, 0}, {10, 0, 11, 0}},
}

Definition at line 3 of file vibration_test.c.

Referenced by SHOCKTST_moveCursor().

◆ SHOCKTST_numberFormats

char SHOCKTST_numberFormats[3][0x40]
Initial value:
= {
"\xC3\xB1\xE8\xE3\x01\x07\x02\x05\x01",
"\xC7\xDE\xE8\xD2\x01\x07\x02\x05\x01",
"\x65\x89\x56\x01\x07\x02\x05\x01",
}

The strings of the pattern, time and power windows (setString), in font codes: the label, icon 7 (01 07), then control code 5 (02 05 01), which inserts work buffer 1, where setNumber writes the value.

Definition at line 13 of file vibration_test.c.

Referenced by SHOCKTST_updateEditor().

◆ SHOCKTST_motorNames

char* SHOCKTST_motorNames[2]
Initial value:
= {
"\x82\xB1\x82\xA4\x82\xBB\x82\xAD",
"\x82\xC4\x82\xA2\x82\xBB\x82\xAD",
}

The names of the motors: "こうそく" (fast) and "ていそく" (slow)

Definition at line 282 of file vibration_test.c.

Referenced by SHOCKTST_updateEditor().

◆ SHOCKTST_textPath

char* SHOCKTST_textPath = "sim:C:\\DEVELOP\\DLSKDATA.TXT"

Definition at line 400 of file vibration_test.c.

Referenced by SHOCKTST_updateLoader().

◆ SHOCKTST_STR_START_BACK

const char SHOCKTST_STR_START_BACK[20]
Initial value:
=
"\x82\x72\x82\x73\x82\x60\x82\x71\x82\x73\x81\x46\x82\xE0\x82\xC7\x82\xE9\0\0"

"START:もどる" (START: back), padded to a word: the USA file's padding isn't zeros but what the assembler left there; the size leaves out the closing NUL

Definition at line 557 of file vibration_test.c.

Referenced by SHOCKTST_updateLoader().