Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
vibration_test.h File Reference

SHOCKTST.PRO: the debug vibration test. More...

#include "engine/game.h"
Include dependency graph for vibration_test.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ShockFile
 DLSKDATA.BIN: a header, then the offsets are from its start. More...
 
struct  ShockLoader
 The patterns loader: the scene's first task. More...
 
struct  ShockLoaderWindows
 
struct  ShockStep
 One step of a motor's pattern. More...
 
struct  ShockTest
 The pattern editor. More...
 
struct  ShockTestWindows
 The editor's text windows. More...
 
struct  ShockTestRow
 One row of the editor's menu. More...
 

Macros

#define OVL_NAME(name)   SHOCKTST_##name
 The name of this overlay's copy of a function of src/shared/.
 
#define SHOCKTST_FILE   0xBE
 A file the editor loads when it starts and never reads (ShockTest.file); the discs number their files differently.
 

Functions

Task * SHOCKTST_createLoader (void)
 Creates the loader.
 
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)
 
void SHOCKTST_updateScene (Task *task, Task **child)
 
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.
 

Variables

const char SHOCKTST_STR_START_BACK []
 "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
 

Detailed Description

SHOCKTST.PRO: the debug vibration test.

It loads the vibration patterns from the PC (DLSKDATA.TXT), writes them back as DLSKDATA.BIN, and lets the patterns be edited and played on the controller's two motors.

Definition in file vibration_test.h.

Macro Definition Documentation

◆ OVL_NAME

#define OVL_NAME (   name)    SHOCKTST_##name

The name of this overlay's copy of a function of src/shared/.

Definition at line 11 of file vibration_test.h.

◆ SHOCKTST_FILE

#define SHOCKTST_FILE   0xBE

A file the editor loads when it starts and never reads (ShockTest.file); the discs number their files differently.

Definition at line 18 of file vibration_test.h.

Function Documentation

◆ 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:

◆ 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_updateScene()

void SHOCKTST_updateScene ( Task *  task,
Task **  child 
)

◆ 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:

Variable Documentation

◆ SHOCKTST_STR_START_BACK

const char SHOCKTST_STR_START_BACK[]
extern

"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().