21 for (j = 0; j < 3; j++) {
25 for (i = 0; i < 5; i++, pos++) {
29 for (i = 0; i < 5; i++, pos++) {
36 for (i = 0; i < 5; i++) {
60 for (i = 0; i < 5; i++, layout++) {
64 for (i = 0; i < 5; i++) {
70 for (i = 0; i < 5; i++) {
73 for (i = 0; i < 5; i++) {
98 for (i = 0; i < 5; i++) {
103 for (i = 0; i < 5; i++) {
142 if (info->
type >= 2 && info->
type <= 14) {
146 }
else if (mode == -1) {
148 }
else if (mode == 2) {
153 }
else if (mode == -2) {
190 switch (effect->
kind) {
220 values = stats->
stats;
221 if (values[entry->
stat] < entry->
max) {
223 values[entry->
stat] += amount;
224 if (values[entry->
stat] > entry->
max) {
225 values[entry->
stat] = entry->
max;
255 for (i = 0; i < screen->
count; i++) {
286 for (i = 0; i < screen->
count; i++) {
353 switch (screen->
count) {
358 if (screen->
step == 0) {
378 if (screen->
step == 0) {
400 if (screen->
step == 0) {
415 if (screen->
step == 0) {
449 if (screen->
step == 0) {
463 if (screen->
step == 0) {
489 if (screen->
option >= 5) {
493 if (old != screen->
option) {
515 for (i = 0; i < screen->
count; i++) {
527 for (i = 0; i < 5; i++) {
539 for (i = 0; i < screen->
count; i++) {
573 if (screen->
count != 1) {
587 if (screen->
count == 2) {
621 if (old != screen->
member) {
654 switch (screen->
count) {
698 if (screen->
step == 0) {
771 switch (screen->
count) {
1010 switch (screen->
state) {
1014 for (i = 0; i < 3; i++) {
1019 for (i = 0; i < screen->
count; i++) {
1022 for (i = 0; i < 2; i++) {
1046 screen->
menu = menu;
1047 return (
Task *)screen;
1052 1, 0x80000002, 0x80000003, 0x80000004,
GfxState GFX
GFX: the graphics state and its methods.
GameState GAME
The save data, the game mode and the methods.
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Cursor * createCursor(s16 layerId, s32 depth, s16 x, s16 y)
A menu cursor on a layer at (x, y)
#define TEXT_ITEM_INFO
ITMINF.
#define TEXT_STATUS
STATUS: the field menu's and STSTATUS's.
#define TEXT_ITEM_NAMES
ITMNAM.
#define FILE_MENU_SPRITES
Files the engine loads by number.
FileCache FILE_CACHE
The file cache.
#define STAT_STRENGTH
the six battle stats
#define STAT_TP
what the training's intensities cost
#define STAT_LEVEL
Indices of a partner's stats (PartnerStats.stats, computeStats, setStat)
#define STAT_RESISTS
the first of the seven resistances
#define STRETCH_SPRITE(sprite, level, x, y)
#define ZOOM_SPRITE(sprite, level, x, y)
#define SCREEN_LAYER
The layer over the whole screen that most modes create first and draw their menus on (FIELDSTG and ST...
static void STSTATUS_closeThirdItemPage(ItemScreen *screen, ItemScreenWindows *windows)
Three members: once the third page and its panels are closed, starts closing the second and the optio...
void STSTATUS_updateItemScreen(ItemScreen *screen, ItemScreenWindows *windows)
The first screen's task: counts the party, sets the fades and creates the windows,...
void STSTATUS_useItem(ItemScreen *screen, ItemScreenWindows *windows)
Uses the chosen item on the chosen party member.
Task * STSTATUS_createItemScreen(FieldMenuScreen *menu, s32 extra)
Creates the field menu's first screen (task), the items.
void STSTATUS_runItemScreen(ItemScreen *screen, ItemScreenWindows *windows)
The first screen's update: opens the pages, picks an item list, then the party member to use the chos...
static void STSTATUS_openSecondOfThreeItemPages(ItemScreen *screen, ItemScreenWindows *windows)
Three members: once the second page and the options' panel are in, shows them and starts the third pa...
void STSTATUS_drawItemScreen(ItemScreen *screen)
Draws the partners' portraits and frames, the item, the cursor and the help arrow.
static void STSTATUS_closeItemScreenAlone(ItemScreen *screen)
One member: ends the screen once the page and the panels are closed.
static void STSTATUS_openFirstOfThreeItemPages(ItemScreen *screen, ItemScreenWindows *windows)
Three members: once the first page and the title are in, shows them and starts the second page and th...
static void STSTATUS_chooseItemList(ItemScreen *screen, ItemScreenWindows *windows)
The options, the item lists: up and down move the cursor, cross opens the chosen list (or says it is ...
static void STSTATUS_closeItemScreenForList(ItemScreen *screen, ItemScreenWindows *windows)
Starts closing the pages and the panels but the help's, for the item list.
static void STSTATUS_startItemScreen(ItemScreen *screen)
Starts the fades of the first page and the title and, with one party member, of the other panels (the...
void STSTATUS_fadeItemInfo(ItemScreen *screen, s32 show)
Opens or closes the chosen item's panel (its icon and frame); closing it also hides the item's name,...
static void STSTATUS_openItemList(ItemScreen *screen, ItemScreenWindows *windows)
Once they are closed, opens the chosen option's item list and the item's panel.
static void STSTATUS_closeItemTitle(ItemScreen *screen)
Hides the cursor; once the title's and the item's panels are closed, goes on to closing the pages.
static void STSTATUS_reopenItemOptions(ItemScreen *screen, ItemScreenWindows *windows)
Once the panels are in again, shows the title, the options, the money and the help.
static void STSTATUS_openSecondOfTwoItemPages(ItemScreen *screen, ItemScreenWindows *windows)
Two members: once the second page and the panels are in, shows the page, the options,...
static void STSTATUS_openFirstOfTwoItemPages(ItemScreen *screen, ItemScreenWindows *windows)
Two members: once the first page and the title are in, shows them and starts the second page and the ...
static void STSTATUS_unlockItemOptions(ItemScreen *screen, ItemScreenWindows *windows)
Triangle gives the options' cursor back.
static void STSTATUS_closeSecondOfTwoItemPages(ItemScreen *screen, ItemScreenWindows *windows)
Two members: once the second page and its panels are closed, starts closing the first and the title.
void STSTATUS_createItemWindows(ItemScreen *screen, ItemScreenWindows *windows)
Creates the first screen's windows.
s32 STSTATUS_itemLists[]
The item lists of the first screen's options.
StatusStatItem STSTATUS_statItems[]
What the items that raise a stat raise.
static void STSTATUS_closeFirstOfThreeItemPages(ItemScreen *screen)
Three members: ends the screen once the first page and the title are closed.
static void STSTATUS_openThirdMemberPage(ItemScreen *screen, ItemScreenWindows *windows)
Once the third page is in, shows it.
static void STSTATUS_closeFirstOfTwoItemPages(ItemScreen *screen)
Two members: ends the screen once the first page and the help are closed.
static void STSTATUS_closeUsedItem(ItemScreen *screen)
Hides the cursor; once the item's panel is closed, waits for cross.
static void STSTATUS_closeSecondOfThreeItemPages(ItemScreen *screen, ItemScreenWindows *windows)
Three members: once the second page and the options are closed, starts closing the first and the titl...
static void STSTATUS_lockItemOptions(ItemScreen *screen, ItemScreenWindows *windows)
Greys the options' cursor and says the chosen list is empty.
s32 STSTATUS_pageStats0[]
void STSTATUS_showItemPage(ItemScreen *screen, ItemScreenWindows *windows, s32 member, s32 show)
As STSTATUS_showCardPage.
static void STSTATUS_reopenItemList(ItemScreen *screen, ItemScreenWindows *windows)
Once the first page is closed, opens the item list again on the item (and the item's panel,...
s32 STSTATUS_itemInfoFaded(ItemScreen *screen)
Moves the chosen item's panel on; 1 once it is fully open or closed.
static void STSTATUS_closeItemScreen(ItemScreen *screen, ItemScreenWindows *windows)
Starts closing the screen: the last page and, with it, the panels the other pages don't wait for.
static void STSTATUS_closeMemberPages(ItemScreen *screen, ItemScreenWindows *windows)
Starts closing the last page (and the title with one member)
static void STSTATUS_leaveItemList(ItemScreen *screen, ItemScreenWindows *windows)
Once the item list closes: back to the options when it was cancelled, to the end (0x28) at -2,...
s32 STSTATUS_kindStrings0[]
The strings of the item kinds (WeaponData.kind), from 0.
static void STSTATUS_openFirstMemberPage(ItemScreen *screen, ItemScreenWindows *windows)
Once the first page and the title are in, shows them and starts the second page, or shows the cursor ...
static void STSTATUS_openSecondMemberPage(ItemScreen *screen, ItemScreenWindows *windows)
Once the second page is in, shows it and starts the third, or shows the cursor with two members.
void STSTATUS_showItemHelp(ItemScreen *screen, s32 mode)
The help line: 1 the chosen item and the kind of a weapon, 2 a question with two answers,...
static void STSTATUS_animateItemPortraits(ItemScreen *screen)
Moves the partners' portraits to their next frames every 13 frames.
static void STSTATUS_closeThirdMemberPage(ItemScreen *screen, ItemScreenWindows *windows)
Once the third page is closed, starts closing the second.
void STSTATUS_showMoney(ItemScreen *screen, ItemScreenWindows *windows, s32 show)
Shows or hides the player's money.
static void STSTATUS_chooseItemMember(ItemScreen *screen, ItemScreenWindows *windows)
Choosing the member to use the item on: up and down move the cursor, cross uses the item,...
static void STSTATUS_openItemScreenAlone(ItemScreen *screen, ItemScreenWindows *windows)
One member: once the panels are in, shows the title, the page, the help, the money and the options.
static void STSTATUS_closeSecondMemberPage(ItemScreen *screen, ItemScreenWindows *windows)
Once the second page is closed, starts closing the first and the title.
static void STSTATUS_stepItemCursor(ItemScreen *screen)
Moves the member cursor's palette on every 9 frames.
void STSTATUS_showChosenItem(ItemScreen *screen, s32 show)
Shows or hides the chosen item's name and how many are equipped and owned.
static void STSTATUS_openThirdItemPage(ItemScreen *screen, ItemScreenWindows *windows)
Three members: once the third page and the panels are in, shows the page, the help and the money.
void STSTATUS_showItemLists(ItemScreen *screen, ItemScreenWindows *windows, s32 show)
Shows or hides the first screen's five options, the item lists.
static void STSTATUS_confirmItemUsed(ItemScreen *screen)
Cross after an item was used: back to the item list, or to the options when the list is empty now.
#define PAD_PRESSED(button)
One button of pad 1: newly pressed, auto-repeated while held, or held.
#define PAD_REPEATED(button)
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
#define SOUND_RECOVERY
RECOVERY.
#define SOUND_MENU_CONFIRM
SYSTEM07.
#define SOUND_SELECT
Sounds the overlays share, with SOUNDTST's names.
#define SOUND_MENU_CANCEL
SYSTEM01.
#define SOUND_MENU_MOVE
SYSTEM06.
#define SOUND_CURSOR
SYSTEM02: a cursor moves.
void initSpriteDrawer(SpriteDrawer *obj)
Clears a sprite drawer to neutral (no scale, gray tint, follows the scroll), gives it its methods and...
void(* setPos)()
(cursor, x, y)
void(* setVisible)()
(cursor, visible)
void *(* getEntry)(u32 fileAndIndex)
struct PartnerStats *(* getPartnerStats)(s32 partner)
void(* computeStats)(s32 partner, union PartnerTotals *out)
s32(* getPartyMember)(u32 index)
s8 items[0x193]
counts, up to 99
What a usable item does (its ItemInfo.data, an ITEM_EFFECT_*)
u16 amount
the HP it heals, the gauge it fills, a boost in 128ths
u8 kind
1 heals amount HP, 2-17 raise a stat by up to amount (STSTATUS_useItem)
s32(* getCategory)(s32 item)
getItemCategory
struct ItemInfo *(* get)(s32 item)
getItem
s32(* list)(s32 type, s16 *out)
listItems
An item (ITEMS, ITEM_FUNCS)
u8 type
2-14 weapons, 15-20 armour, 21-24 accessories
ItemRecord data
the type's record, or the usable items' effect
struct ItemList * panel
STSTATUS_createItemList's, while open.
TextWindow * equippedLabel
TextWindow * equipped
how many of the item are equipped
The field menu's first screen (STSTATUS_createItemScreen)
s16 items[0x194]
of the chosen option's list
void(* nextSubstate)(struct ItemScreen *task)
void(* nextState)(struct ItemScreen *task)
void(* setSubstate)(struct ItemScreen *task, s32 substate)
s32 frames[3]
of the partners' portraits
s32 member
the one an item is used on
A partner Digimon from its name on (Partner.info), as getPartnerStats gives it.
s32(* next)(void)
0 to RANDOM_COUNT - 1
short(* playSound)(s32 id)
returns the voice of a key-on
Draws sprites from a sprite sheet (such as file 0x277, the menu graphics): a sheet has a table of fra...
void(* setScale)()
(x, y, z), ONE = 1.0
void(* setLayerId)()
(id, depth)
void(* setClutRow)()
(row)
void(* draw)()
(sheet, frame, x, y)
void(* setTexture)()
(x, y)
WindowPos * layout
where the windows go, and their strings
PartnerAnim * partnerAnims
the partners' portraits
s32(* updateFade)(PanelAnim *fade)
void(* startFade)(PanelAnim *fade, s32 fadeIn)
What the items that raise a stat raise (STSTATUS_statItems), up to a kind of -1.
s16 kind
the item's second byte
s16 stat
in PartnerStats.stats
Any task, seen through its header.
void(* setRightAlign)()
no prototype: callers would truncate u8 args
void(* setVisible)(struct TextWindow *obj, u8 arg)
Where a window goes, and the string it shows.
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
#define PALETTE_WHITE
The text windows' palettes (TextWindow.palette, setPalette): rows of the font's CLUTs,...
#define PALETTE_GREY
what is unavailable
TextWindow * createTextWindow(s16 layerId, s16 style, s16 x, s16 y)
A text window on a layer, in a font style, at (x, y)
ItemInfo.data's record, by ItemInfo.type.
computeStats' result: the stats with the equipment added, by STAT_* or by name.