summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorRoman971 <romanlasnier@hotmail.com>2020-03-22 22:19:43 +0100
committerRoman971 <romanlasnier@hotmail.com>2020-03-22 22:20:03 +0100
commit8cfe7cce9f8d8abea794e67510879e751d373a87 (patch)
treec6c46f34d3575f6dc02b98b2b5f5ad88d2b2c64e /src/code
parent251aea64ab3e6e8cd6f1d9ed34f514e656724777 (diff)
Format all src C files
Diffstat (limited to 'src/code')
-rw-r--r--src/code/TwoHeadArena.c103
-rw-r--r--src/code/__osMalloc.c581
-rw-r--r--src/code/audioMgr.c1
-rw-r--r--src/code/code_80026B00.c6
-rw-r--r--src/code/code_800430A0.c39
-rw-r--r--src/code/code_80043480.c66
-rw-r--r--src/code/code_80069420.c12
-rw-r--r--src/code/code_8006C360.c6
-rw-r--r--src/code/code_8006C3A0.c1
-rw-r--r--src/code/code_8006C510.c1
-rw-r--r--src/code/code_8006EA30.c5
-rw-r--r--src/code/code_8007BF90.c31
-rw-r--r--src/code/code_80097A00.c279
-rw-r--r--src/code/code_800A9D40.c19
-rw-r--r--src/code/code_800A9F30.c40
-rw-r--r--src/code/code_800ACE70.c109
-rw-r--r--src/code/code_800FBCE0.c16
-rw-r--r--src/code/code_800FC620.c139
-rw-r--r--src/code/code_800FCE80.c158
-rw-r--r--src/code/db_camera.c1
-rw-r--r--src/code/debug_malloc.c83
-rw-r--r--src/code/fault.c296
-rw-r--r--src/code/fault_drawer.c226
-rw-r--r--src/code/gamealloc.c46
-rw-r--r--src/code/gfxprint.c435
-rw-r--r--src/code/irqmgr.c177
-rw-r--r--src/code/listalloc.c40
-rw-r--r--src/code/loadfragment2.c16
-rw-r--r--src/code/logseverity.c2
-rw-r--r--src/code/main.c62
-rw-r--r--src/code/padmgr.c185
-rw-r--r--src/code/relocation.c2
-rw-r--r--src/code/sched.c67
-rw-r--r--src/code/speed_meter.c24
-rw-r--r--src/code/sys_cfb.c53
-rw-r--r--src/code/sys_matrix.c297
-rw-r--r--src/code/sys_ucode.c12
-rw-r--r--src/code/system_malloc.c79
-rw-r--r--src/code/title_setup.c14
-rw-r--r--src/code/z_DLF.c79
-rw-r--r--src/code/z_actor.c3646
-rw-r--r--src/code/z_actor_dlftbls.c58
-rw-r--r--src/code/z_bgcheck.c192
-rw-r--r--src/code/z_camera.c742
-rw-r--r--src/code/z_cheap_proc.c12
-rw-r--r--src/code/z_collision_check.c105
-rw-r--r--src/code/z_common_data.c4
-rw-r--r--src/code/z_construct.c77
-rw-r--r--src/code/z_debug.c224
-rw-r--r--src/code/z_debug_display.c54
-rw-r--r--src/code/z_demo.c732
-rw-r--r--src/code/z_draw.c294
-rw-r--r--src/code/z_eff_blure.c4
-rw-r--r--src/code/z_eff_shield_particle.c1
-rw-r--r--src/code/z_eff_spark.c5
-rw-r--r--src/code/z_eff_ss_dead.c1
-rw-r--r--src/code/z_effect_soft_sprite.c65
-rw-r--r--src/code/z_effect_soft_sprite_old_init.c1
-rw-r--r--src/code/z_en_a_keep.c177
-rw-r--r--src/code/z_en_item00.c500
-rw-r--r--src/code/z_fbdemo.c1
-rw-r--r--src/code/z_fcurve_data_skelanime.c1
-rw-r--r--src/code/z_horse.c284
-rw-r--r--src/code/z_jpeg.c1
-rw-r--r--src/code/z_kaleido_manager.c63
-rw-r--r--src/code/z_kaleido_scope_call.c91
-rw-r--r--src/code/z_kanfont.c1
-rw-r--r--src/code/z_kankyo.c16
-rw-r--r--src/code/z_lib.c374
-rw-r--r--src/code/z_lifemeter.c306
-rw-r--r--src/code/z_lights.c103
-rw-r--r--src/code/z_malloc.c83
-rw-r--r--src/code/z_map_exp.c1
-rw-r--r--src/code/z_map_mark.c112
-rw-r--r--src/code/z_message_PAL.c1
-rw-r--r--src/code/z_moji.c75
-rw-r--r--src/code/z_msgevent.c3
-rw-r--r--src/code/z_onepointdemo.c43
-rw-r--r--src/code/z_parameter.c3475
-rw-r--r--src/code/z_play.c67
-rw-r--r--src/code/z_player_call.c18
-rw-r--r--src/code/z_player_lib.c101
-rw-r--r--src/code/z_prenmi.c22
-rw-r--r--src/code/z_prenmi_buff.c22
-rw-r--r--src/code/z_rcp.c45
-rw-r--r--src/code/z_room.c292
-rw-r--r--src/code/z_sample.c27
-rw-r--r--src/code/z_scene.c352
-rw-r--r--src/code/z_scene_table.c3044
-rw-r--r--src/code/z_skelanime.c1
-rw-r--r--src/code/z_skin.c1
-rw-r--r--src/code/z_skin_awb.c1
-rw-r--r--src/code/z_skin_matrix.c1
-rw-r--r--src/code/z_sram.c1
-rw-r--r--src/code/z_view.c1
-rw-r--r--src/code/z_vimode.c1
-rw-r--r--src/code/z_vismono.c1
-rw-r--r--src/code/z_vr_box.c1
-rw-r--r--src/code/z_vr_box_draw.c1
99 files changed, 7623 insertions, 12113 deletions
diff --git a/src/code/TwoHeadArena.c b/src/code/TwoHeadArena.c
index b46695442..23cfa00f8 100644
--- a/src/code/TwoHeadArena.c
+++ b/src/code/TwoHeadArena.c
@@ -1,172 +1,141 @@
#include <global.h>
-void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size)
-{
+void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, u32 size) {
THA_Ct((TwoHeadArena*)thga, start, size);
}
-void THGA_Dt(TwoHeadGfxArena* thga)
-{
+void THGA_Dt(TwoHeadGfxArena* thga) {
THA_Dt((TwoHeadArena*)thga);
}
-u32 THGA_IsCrash(TwoHeadGfxArena* thga)
-{
+u32 THGA_IsCrash(TwoHeadGfxArena* thga) {
return THA_IsCrash((TwoHeadArena*)thga);
}
-void THGA_Init(TwoHeadGfxArena* thga)
-{
+void THGA_Init(TwoHeadGfxArena* thga) {
THA_Init((TwoHeadArena*)thga);
}
-s32 THGA_GetSize(TwoHeadGfxArena* thga)
-{
+s32 THGA_GetSize(TwoHeadGfxArena* thga) {
return THA_GetSize((TwoHeadArena*)thga);
}
-Gfx* THGA_GetHead(TwoHeadGfxArena* thga)
-{
+Gfx* THGA_GetHead(TwoHeadGfxArena* thga) {
return THA_GetHead((TwoHeadArena*)thga);
}
-void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* start)
-{
+void THGA_SetHead(TwoHeadGfxArena* thga, Gfx* start) {
THA_SetHead((TwoHeadArena*)thga, start);
}
-Gfx* THGA_GetTail(TwoHeadGfxArena* thga)
-{
+Gfx* THGA_GetTail(TwoHeadGfxArena* thga) {
return THA_GetTail((TwoHeadArena*)thga);
}
-Gfx* THGA_AllocStartArray8(TwoHeadGfxArena* thga, u32 count)
-{
+Gfx* THGA_AllocStartArray8(TwoHeadGfxArena* thga, u32 count) {
return THA_AllocStart((TwoHeadArena*)thga, count * 8);
}
-Gfx* THGA_AllocStart8(TwoHeadGfxArena* thga)
-{
+Gfx* THGA_AllocStart8(TwoHeadGfxArena* thga) {
return THGA_AllocStartArray8(thga, 1);
}
-Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga)
-{
+Gfx* THGA_AllocStart8Wrapper(TwoHeadGfxArena* thga) {
return THGA_AllocStart8(thga);
}
-Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size)
-{
+Gfx* THGA_AllocEnd(TwoHeadGfxArena* thga, u32 size) {
return THA_AllocEnd((TwoHeadArena*)thga, size);
}
-Gfx* THGA_AllocEndArray64(TwoHeadGfxArena* thga, u32 count)
-{
+Gfx* THGA_AllocEndArray64(TwoHeadGfxArena* thga, u32 count) {
return THGA_AllocEnd(thga, count * 0x40);
}
-Gfx* THGA_AllocEnd64(TwoHeadGfxArena* thga)
-{
+Gfx* THGA_AllocEnd64(TwoHeadGfxArena* thga) {
return THGA_AllocEnd(thga, 0x40);
}
-Gfx* THGA_AllocEndArray16(TwoHeadGfxArena* thga, u32 count)
-{
+Gfx* THGA_AllocEndArray16(TwoHeadGfxArena* thga, u32 count) {
return THGA_AllocEnd(thga, count * 0x10);
}
-Gfx* THGA_AllocEnd16(TwoHeadGfxArena* thga)
-{
+Gfx* THGA_AllocEnd16(TwoHeadGfxArena* thga) {
return THGA_AllocEnd(thga, 0x10);
}
-
-
-
-
-void* THA_GetHead(TwoHeadArena* tha)
-{
+void* THA_GetHead(TwoHeadArena* tha) {
return tha->head;
}
-void THA_SetHead(TwoHeadArena* tha, void* start)
-{
+void THA_SetHead(TwoHeadArena* tha, void* start) {
tha->head = start;
}
-void* THA_GetTail(TwoHeadArena* tha)
-{
+void* THA_GetTail(TwoHeadArena* tha) {
return tha->tail;
}
-void* THA_AllocStart(TwoHeadArena* tha, u32 size)
-{
+void* THA_AllocStart(TwoHeadArena* tha, u32 size) {
void* start = tha->head;
tha->head += size;
return start;
}
-void* THA_AllocStart1(TwoHeadArena* tha)
-{
+void* THA_AllocStart1(TwoHeadArena* tha) {
return THA_AllocStart(tha, 1);
}
-void* THA_AllocEnd(TwoHeadArena* tha, u32 size)
-{
+void* THA_AllocEnd(TwoHeadArena* tha, u32 size) {
u32 mask;
u32* temp;
- if (size == 8)
+ if (size == 8) {
mask = ~7;
- else if (size == 4 || size == 12)
+ } else if (size == 4 || size == 12) {
mask = ~3;
- else if (size == 2 || size == 6 || size == 10 || size == 12 || size == 14)
+ } else if (size == 2 || size == 6 || size == 10 || size == 12 || size == 14) {
mask = ~1;
- else
+ } else {
mask = (size >= 0x10) ? ~0xF : 0;
+ }
temp = (u32*)&tha->tail; // required to match
return tha->tail = (void*)(((*temp & mask) - size) & mask);
}
-void* THA_AllocEndAlign16(TwoHeadArena *tha, u32 size)
-{
- void* ret = (void*)(u32)((((u32)tha->tail & ~0xF) - size) & ((~(0xF & 0xFFFFFFFFFFFFFFFF)) & 0xFFFFFFFFu)); // required to match
+void* THA_AllocEndAlign16(TwoHeadArena* tha, u32 size) {
+ void* ret = (void*)(u32)((((u32)tha->tail & ~0xF) - size) &
+ ((~(0xF & 0xFFFFFFFFFFFFFFFF)) & 0xFFFFFFFFu)); // required to match
tha->tail = ret;
return ret;
}
-void* THA_AllocEndAlign(TwoHeadArena* tha, u32 size, u32 mask)
-{
+void* THA_AllocEndAlign(TwoHeadArena* tha, u32 size, u32 mask) {
void* ret = (void*)((((u32)tha->tail & mask) - size) & mask);
tha->tail = ret;
return ret;
}
-s32 THA_GetSize(TwoHeadArena* tha)
-{
+s32 THA_GetSize(TwoHeadArena* tha) {
return tha->tail - tha->head;
}
-u32 THA_IsCrash(TwoHeadArena* tha)
-{
+u32 THA_IsCrash(TwoHeadArena* tha) {
return THA_GetSize(tha) < 0;
}
-void THA_Init(TwoHeadArena* tha)
-{
+void THA_Init(TwoHeadArena* tha) {
tha->head = tha->bufp;
tha->tail = tha->bufp + tha->size;
}
-void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size)
-{
+void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size) {
tha->bufp = ptr;
tha->size = size;
THA_Init(tha);
}
-void THA_Dt(TwoHeadArena* tha)
-{
+void THA_Dt(TwoHeadArena* tha) {
bzero(tha, sizeof(TwoHeadArena));
}
diff --git a/src/code/__osMalloc.c b/src/code/__osMalloc.c
index 34d602f0a..d5501c663 100644
--- a/src/code/__osMalloc.c
+++ b/src/code/__osMalloc.c
@@ -1,63 +1,53 @@
#include <global.h>
#include <vt.h>
-#define FILL_ALLOCBLOCK (1 << 0)
-#define FILL_FREEBLOCK (1 << 1)
-#define CHECK_FREE_BLOCK (1 << 2)
+#define FILL_ALLOCBLOCK (1 << 0)
+#define FILL_FREEBLOCK (1 << 1)
+#define CHECK_FREE_BLOCK (1 << 2)
-#define NODE_MAGIC (0x7373)
+#define NODE_MAGIC (0x7373)
-#define BLOCK_UNINIT_MAGIC (0xAB)
-#define BLOCK_UNINIT_MAGIC_32 (0xABABABAB)
-#define BLOCK_ALLOC_MAGIC (0xCD)
-#define BLOCK_ALLOC_MAGIC_32 (0xCDCDCDCD)
-#define BLOCK_FREE_MAGIC (0xEF)
-#define BLOCK_FREE_MAGIC_32 (0xEFEFEFEF)
+#define BLOCK_UNINIT_MAGIC (0xAB)
+#define BLOCK_UNINIT_MAGIC_32 (0xABABABAB)
+#define BLOCK_ALLOC_MAGIC (0xCD)
+#define BLOCK_ALLOC_MAGIC_32 (0xCDCDCDCD)
+#define BLOCK_FREE_MAGIC (0xEF)
+#define BLOCK_FREE_MAGIC_32 (0xEFEFEFEF)
OSMesg sArenaLockMsg;
u32 __osMalloc_FreeBlockTest_Enable;
-bool ArenaImpl_GetFillAllocBlock(Arena* arena)
-{
+bool ArenaImpl_GetFillAllocBlock(Arena* arena) {
return (arena->flag & FILL_ALLOCBLOCK) != 0;
}
-bool ArenaImpl_GetFillFreeBlock(Arena* arena)
-{
+bool ArenaImpl_GetFillFreeBlock(Arena* arena) {
return (arena->flag & FILL_FREEBLOCK) != 0;
}
-bool ArenaImpl_GetCheckFreeBlock(Arena* arena)
-{
+bool ArenaImpl_GetCheckFreeBlock(Arena* arena) {
return (arena->flag & CHECK_FREE_BLOCK) != 0;
}
-void ArenaImpl_SetFillAllocBlock(Arena* arena)
-{
+void ArenaImpl_SetFillAllocBlock(Arena* arena) {
arena->flag |= FILL_ALLOCBLOCK;
}
-void ArenaImpl_SetFillFreeBlock(Arena* arena)
-{
+void ArenaImpl_SetFillFreeBlock(Arena* arena) {
arena->flag |= FILL_FREEBLOCK;
}
-void ArenaImpl_SetCheckFreeBlock(Arena* arena)
-{
+void ArenaImpl_SetCheckFreeBlock(Arena* arena) {
arena->flag |= CHECK_FREE_BLOCK;
}
-void ArenaImpl_UnsetFillAllocBlock(Arena* arena)
-{
+void ArenaImpl_UnsetFillAllocBlock(Arena* arena) {
arena->flag &= ~FILL_ALLOCBLOCK;
}
-void ArenaImpl_UnsetFillFreeBlock(Arena* arena)
-{
+void ArenaImpl_UnsetFillFreeBlock(Arena* arena) {
arena->flag &= ~FILL_FREEBLOCK;
}
-void ArenaImpl_UnsetCheckFreeBlock(Arena* arena)
-{
+void ArenaImpl_UnsetCheckFreeBlock(Arena* arena) {
arena->flag &= ~CHECK_FREE_BLOCK;
}
-void ArenaImpl_SetDebugInfo(ArenaNode* node, const char* file, s32 line, Arena* arena)
-{
+void ArenaImpl_SetDebugInfo(ArenaNode* node, const char* file, s32 line, Arena* arena) {
node->filename = file;
node->line = line;
node->threadId = osGetThreadId(NULL);
@@ -65,28 +55,23 @@ void ArenaImpl_SetDebugInfo(ArenaNode* node, const char* file, s32 line, Arena*
node->time = osGetTime();
}
-void ArenaImpl_LockInit(Arena* arena)
-{
+void ArenaImpl_LockInit(Arena* arena) {
osCreateMesgQueue(&arena->lock, &sArenaLockMsg, 1);
}
-void ArenaImpl_Lock(Arena* arena)
-{
+void ArenaImpl_Lock(Arena* arena) {
osSendMesg(&arena->lock, NULL, OS_MESG_BLOCK);
}
-void ArenaImpl_Unlock(Arena* arena)
-{
+void ArenaImpl_Unlock(Arena* arena) {
osRecvMesg(&arena->lock, NULL, OS_MESG_BLOCK);
}
-ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node)
-{
+ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node) {
ArenaNode* ret;
ret = node->next;
- if (ret && (!ret || (ret->magic != NODE_MAGIC)))
- {
+ if (ret && (!ret || (ret->magic != NODE_MAGIC))) {
osSyncPrintf(VT_COL(RED, WHITE) "緊急事態!メモリリーク発見! (block=%08x)\n" VT_RST, ret);
ret = NULL;
node->next = NULL;
@@ -95,13 +80,11 @@ ArenaNode* ArenaImpl_GetNextBlock(ArenaNode* node)
return ret;
}
-ArenaNode* ArenaImpl_GetPrevBlock(ArenaNode* node)
-{
+ArenaNode* ArenaImpl_GetPrevBlock(ArenaNode* node) {
ArenaNode* ret;
ret = node->prev;
- if (ret && (!ret || (ret->magic != NODE_MAGIC)))
- {
+ if (ret && (!ret || (ret->magic != NODE_MAGIC))) {
osSyncPrintf(VT_COL(RED, WHITE) "緊急事態!メモリリーク発見! (block=%08x)\n" VT_RST, ret);
ret = NULL;
node->prev = NULL;
@@ -110,16 +93,13 @@ ArenaNode* ArenaImpl_GetPrevBlock(ArenaNode* node)
return ret;
}
-ArenaNode* ArenaImpl_GetLastBlock(Arena* arena)
-{
+ArenaNode* ArenaImpl_GetLastBlock(Arena* arena) {
ArenaNode* ret = NULL;
ArenaNode* iter;
- if (arena && arena->head && arena->head->magic == NODE_MAGIC)
- {
+ if (arena && arena->head && arena->head->magic == NODE_MAGIC) {
iter = arena->head;
- while (iter)
- {
+ while (iter) {
ret = iter;
iter = ArenaImpl_GetNextBlock(iter);
}
@@ -128,29 +108,25 @@ ArenaNode* ArenaImpl_GetLastBlock(Arena* arena)
return ret;
}
-void __osMallocInit(Arena* arena, void* start, u32 size)
-{
+void __osMallocInit(Arena* arena, void* start, u32 size) {
bzero(arena, sizeof(Arena));
ArenaImpl_LockInit(arena);
__osMallocAddBlock(arena, start, size);
arena->isInit = true;
}
-void __osMallocAddBlock(Arena* arena, void* start, s32 size)
-{
+void __osMallocAddBlock(Arena* arena, void* start, s32 size) {
s32 diff;
s32 size2;
ArenaNode* firstNode;
ArenaNode* lastNode;
-
- if (start)
- {
+
+ if (start) {
firstNode = (ArenaNode*)ALIGN16((u32)start);
diff = (s32)firstNode - (s32)start;
size2 = (size - diff) & ~0xF;
- if (size2 > (s32)sizeof(ArenaNode))
- {
- func_80106860(firstNode, BLOCK_UNINIT_MAGIC, size2); //memset
+ if (size2 > (s32)sizeof(ArenaNode)) {
+ func_80106860(firstNode, BLOCK_UNINIT_MAGIC, size2); // memset
firstNode->next = NULL;
firstNode->prev = NULL;
firstNode->size = size2 - sizeof(ArenaNode);
@@ -158,13 +134,10 @@ void __osMallocAddBlock(Arena* arena, void* start, s32 size)
firstNode->magic = NODE_MAGIC;
ArenaImpl_Lock(arena);
lastNode = ArenaImpl_GetLastBlock(arena);
- if (!lastNode)
- {
+ if (!lastNode) {
arena->head = firstNode;
arena->start = start;
- }
- else
- {
+ } else {
firstNode->prev = lastNode;
lastNode->next = firstNode;
}
@@ -173,53 +146,47 @@ void __osMallocAddBlock(Arena* arena, void* start, s32 size)
}
}
-void ArenaImpl_RemoveAllBlocks(Arena* arena)
-{
+void ArenaImpl_RemoveAllBlocks(Arena* arena) {
ArenaNode* iter;
ArenaNode* next;
ArenaImpl_Lock(arena);
iter = arena->head;
- while (iter)
- {
+ while (iter) {
next = ArenaImpl_GetNextBlock(iter);
- func_80106860(iter, BLOCK_UNINIT_MAGIC, iter->size + sizeof(ArenaNode)); //memset
+ func_80106860(iter, BLOCK_UNINIT_MAGIC, iter->size + sizeof(ArenaNode)); // memset
iter = next;
}
ArenaImpl_Unlock(arena);
}
-void __osMallocCleanup(Arena* arena)
-{
+void __osMallocCleanup(Arena* arena) {
ArenaImpl_RemoveAllBlocks(arena);
bzero(arena, sizeof(*arena));
}
-u8 __osMallocIsInitalized(Arena* arena)
-{
+u8 __osMallocIsInitalized(Arena* arena) {
return arena->isInit;
}
-void __osMalloc_FreeBlockTest(Arena *arena, ArenaNode *node)
-{
- ArenaNode *node2;
+void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node) {
+ ArenaNode* node2;
u32* start;
u32* end;
u32* iter;
node2 = node;
- if (__osMalloc_FreeBlockTest_Enable)
- {
+ if (__osMalloc_FreeBlockTest_Enable) {
start = (u32*)((u32)node + sizeof(ArenaNode));
- end = (u32*)((u32) start + node2->size);
+ end = (u32*)((u32)start + node2->size);
iter = start;
- while (iter < end)
- {
- if (*iter != BLOCK_UNINIT_MAGIC_32 && *iter != BLOCK_FREE_MAGIC_32)
- {
- osSyncPrintf(VT_COL(RED, WHITE) "緊急事態!メモリリーク検出! (block=%08x s=%08x e=%08x p=%08x)\n" VT_RST, node, start, end, iter);
+ while (iter < end) {
+ if (*iter != BLOCK_UNINIT_MAGIC_32 && *iter != BLOCK_FREE_MAGIC_32) {
+ osSyncPrintf(
+ VT_COL(RED, WHITE) "緊急事態!メモリリーク検出! (block=%08x s=%08x e=%08x p=%08x)\n" VT_RST, node,
+ start, end, iter);
__osDisplayArena(arena);
return;
}
@@ -228,29 +195,26 @@ void __osMalloc_FreeBlockTest(Arena *arena, ArenaNode *node)
}
}
-void* __osMalloc_NoLockDebug(Arena *arena, u32 size, const char *file, s32 line)
-{
- ArenaNode *iter;
+void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, s32 line) {
+ ArenaNode* iter;
u32 blockSize;
- ArenaNode *newNode;
- void *ret;
- ArenaNode *next;
+ ArenaNode* newNode;
+ void* ret;
+ ArenaNode* next;
ret = NULL;
iter = arena->head;
size = ALIGN16(size);
blockSize = ALIGN16(size) + sizeof(ArenaNode);
- while (iter)
- {
- if (iter->isFree && iter->size >= size)
- {
- if (arena->flag & CHECK_FREE_BLOCK)
+ while (iter) {
+ if (iter->isFree && iter->size >= size) {
+ if (arena->flag & CHECK_FREE_BLOCK) {
__osMalloc_FreeBlockTest(arena, iter);
+ }
- if (blockSize < iter->size)
- {
- newNode = (ArenaNode *)((u32)iter + blockSize);
+ if (blockSize < iter->size) {
+ newNode = (ArenaNode*)((u32)iter + blockSize);
newNode->next = ArenaImpl_GetNextBlock(iter);
newNode->prev = iter;
newNode->size = iter->size - blockSize;
@@ -260,15 +224,17 @@ void* __osMalloc_NoLockDebug(Arena *arena, u32 size, const char *file, s32 line)
iter->next = newNode;
iter->size = size;
next = ArenaImpl_GetNextBlock(newNode);
- if (next)
+ if (next) {
next->prev = newNode;
+ }
}
iter->isFree = false;
ArenaImpl_SetDebugInfo(iter, file, line, arena);
- ret = (void *)((u32)iter + sizeof(ArenaNode));
- if (arena->flag & FILL_ALLOCBLOCK)
+ ret = (void*)((u32)iter + sizeof(ArenaNode));
+ if (arena->flag & FILL_ALLOCBLOCK) {
func_80106860(ret, BLOCK_ALLOC_MAGIC, size);
+ }
break;
}
@@ -279,8 +245,7 @@ void* __osMalloc_NoLockDebug(Arena *arena, u32 size, const char *file, s32 line)
return ret;
}
-void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line)
-{
+void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line) {
void* ret;
ArenaImpl_Lock(arena);
ret = __osMalloc_NoLockDebug(arena, size, file, line);
@@ -288,29 +253,27 @@ void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line)
return ret;
}
-void* __osMallocRDebug(Arena *arena, u32 size, const char *file, s32 line)
-{
- ArenaNode *iter;
- ArenaNode *newNode;
+void* __osMallocRDebug(Arena* arena, u32 size, const char* file, s32 line) {
+ ArenaNode* iter;
+ ArenaNode* newNode;
u32 blockSize;
- ArenaNode *next;
- void *ret;
+ ArenaNode* next;
+ void* ret;
ret = NULL;
size = ALIGN16(size);
ArenaImpl_Lock(arena);
- iter = ArenaImpl_GetLastBlock(arena);;
- while (iter)
- {
- if (iter->isFree && iter->size >= size)
- {
- if (arena->flag & CHECK_FREE_BLOCK)
+ iter = ArenaImpl_GetLastBlock(arena);
+
+ while (iter) {
+ if (iter->isFree && iter->size >= size) {
+ if (arena->flag & CHECK_FREE_BLOCK) {
__osMalloc_FreeBlockTest(arena, iter);
+ }
blockSize = ALIGN16(size) + sizeof(ArenaNode);
- if (blockSize < iter->size)
- {
- newNode = (ArenaNode *)((u32)iter + (iter->size - size));
+ if (blockSize < iter->size) {
+ newNode = (ArenaNode*)((u32)iter + (iter->size - size));
newNode->next = ArenaImpl_GetNextBlock(iter);
newNode->prev = iter;
newNode->size = size;
@@ -319,17 +282,19 @@ void* __osMallocRDebug(Arena *arena, u32 size, const char *file, s32 line)
iter->next = newNode;
iter->size -= blockSize;
next = ArenaImpl_GetNextBlock(newNode);
- if (next)
+ if (next) {
next->prev = newNode;
+ }
iter = newNode;
}
iter->isFree = false;
ArenaImpl_SetDebugInfo(iter, file, line, arena);
- ret = (void *)((u32)iter + sizeof(ArenaNode));
- if (arena->flag & FILL_ALLOCBLOCK)
+ ret = (void*)((u32)iter + sizeof(ArenaNode));
+ if (arena->flag & FILL_ALLOCBLOCK) {
func_80106860(ret, BLOCK_ALLOC_MAGIC, size);
+ }
break;
}
@@ -341,30 +306,27 @@ void* __osMallocRDebug(Arena *arena, u32 size, const char *file, s32 line)
return ret;
}
-void* __osMalloc_NoLock(Arena *arena, u32 size)
-{
- ArenaNode *iter;
+void* __osMalloc_NoLock(Arena* arena, u32 size) {
+ ArenaNode* iter;
u32 blockSize;
- ArenaNode *newNode;
- void *ret;
- ArenaNode *next;
+ ArenaNode* newNode;
+ void* ret;
+ ArenaNode* next;
ret = NULL;
iter = arena->head;
size = ALIGN16(size);
blockSize = ALIGN16(size) + sizeof(ArenaNode);
- while (iter)
- {
+ while (iter) {
- if (iter->isFree && iter->size >= size)
- {
- if (arena->flag & CHECK_FREE_BLOCK)
+ if (iter->isFree && iter->size >= size) {
+ if (arena->flag & CHECK_FREE_BLOCK) {
__osMalloc_FreeBlockTest(arena, iter);
+ }
- if (blockSize < iter->size)
- {
- newNode = (ArenaNode *)((u32)iter + blockSize);
+ if (blockSize < iter->size) {
+ newNode = (ArenaNode*)((u32)iter + blockSize);
newNode->next = ArenaImpl_GetNextBlock(iter);
newNode->prev = iter;
newNode->size = iter->size - blockSize;
@@ -374,15 +336,17 @@ void* __osMalloc_NoLock(Arena *arena, u32 size)
iter->next = newNode;
iter->size = size;
next = ArenaImpl_GetNextBlock(newNode);
- if (next)
+ if (next) {
next->prev = newNode;
+ }
}
iter->isFree = false;
ArenaImpl_SetDebugInfo(iter, NULL, 0, arena);
- ret = (void *)((u32)iter + sizeof(ArenaNode));
- if (arena->flag & FILL_ALLOCBLOCK)
+ ret = (void*)((u32)iter + sizeof(ArenaNode));
+ if (arena->flag & FILL_ALLOCBLOCK) {
func_80106860(ret, BLOCK_ALLOC_MAGIC, size);
+ }
break;
}
@@ -393,8 +357,7 @@ void* __osMalloc_NoLock(Arena *arena, u32 size)
return ret;
}
-void* __osMalloc(Arena* arena, u32 size)
-{
+void* __osMalloc(Arena* arena, u32 size) {
void* ret;
ArenaImpl_Lock(arena);
ret = __osMalloc_NoLock(arena, size);
@@ -402,29 +365,27 @@ void* __osMalloc(Arena* arena, u32 size)
return ret;
}
-void* __osMallocR(Arena *arena, u32 size)
-{
- ArenaNode *iter;
- ArenaNode *newNode;
+void* __osMallocR(Arena* arena, u32 size) {
+ ArenaNode* iter;
+ ArenaNode* newNode;
u32 blockSize;
- ArenaNode *next;
- void *ret;
+ ArenaNode* next;
+ void* ret;
ret = NULL;
size = ALIGN16(size);
ArenaImpl_Lock(arena);
- iter = ArenaImpl_GetLastBlock(arena);;
- while (iter)
- {
- if (iter->isFree && iter->size >= size)
- {
- if (arena->flag & CHECK_FREE_BLOCK)
+ iter = ArenaImpl_GetLastBlock(arena);
+
+ while (iter) {
+ if (iter->isFree && iter->size >= size) {
+ if (arena->flag & CHECK_FREE_BLOCK) {
__osMalloc_FreeBlockTest(arena, iter);
+ }
blockSize = ALIGN16(size) + sizeof(ArenaNode);
- if (blockSize < iter->size)
- {
- newNode = (ArenaNode *)((u32)iter + (iter->size - size));
+ if (blockSize < iter->size) {
+ newNode = (ArenaNode*)((u32)iter + (iter->size - size));
newNode->next = ArenaImpl_GetNextBlock(iter);
newNode->prev = iter;
newNode->size = size;
@@ -433,17 +394,19 @@ void* __osMallocR(Arena *arena, u32 size)
iter->next = newNode;
iter->size -= blockSize;
next = ArenaImpl_GetNextBlock(newNode);
- if (next)
+ if (next) {
next->prev = newNode;
-
+ }
+
iter = newNode;
}
iter->isFree = false;
ArenaImpl_SetDebugInfo(iter, NULL, 0, arena);
- ret = (void *)((u32)iter + sizeof(ArenaNode));
- if (arena->flag & FILL_ALLOCBLOCK)
+ ret = (void*)((u32)iter + sizeof(ArenaNode));
+ if (arena->flag & FILL_ALLOCBLOCK) {
func_80106860(ret, BLOCK_ALLOC_MAGIC, size);
+ }
break;
}
@@ -455,30 +418,27 @@ void* __osMallocR(Arena *arena, u32 size)
return ret;
}
-void __osFree_NoLock(Arena* arena, void* ptr)
-{
+void __osFree_NoLock(Arena* arena, void* ptr) {
ArenaNode* node;
ArenaNode* next;
ArenaNode* prev;
ArenaNode* newNext;
- if (ptr)
- {
+ if (ptr) {
node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode));
- if (node == NULL || node->magic != NODE_MAGIC)
- {
- osSyncPrintf(VT_COL(RED, WHITE) "__osFree:不正解放(%08x)\n" VT_RST, ptr); //__osFree: Unauthorized release (%08x)
+ if (node == NULL || node->magic != NODE_MAGIC) {
+ osSyncPrintf(VT_COL(RED, WHITE) "__osFree:不正解放(%08x)\n" VT_RST,
+ ptr); // __osFree: Unauthorized release (%08x)
return;
}
- if (node->isFree)
- {
- osSyncPrintf(VT_COL(RED, WHITE) "__osFree:二重解放(%08x)\n" VT_RST, ptr); //__osFree: Double release (%08x)
+ if (node->isFree) {
+ osSyncPrintf(VT_COL(RED, WHITE) "__osFree:二重解放(%08x)\n" VT_RST, ptr); // __osFree: Double release (%08x)
return;
}
- if (arena != node->arena && arena != NULL)
- {
- //__osFree:Tried to release in a different way than when it was secured (%08x:%08x)
- osSyncPrintf(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena, node->arena);
+ if (arena != node->arena && arena != NULL) {
+ // __osFree:Tried to release in a different way than when it was secured (%08x:%08x)
+ osSyncPrintf(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena,
+ node->arena);
return;
}
@@ -486,68 +446,66 @@ void __osFree_NoLock(Arena* arena, void* ptr)
prev = ArenaImpl_GetPrevBlock(node);
node->isFree = true;
ArenaImpl_SetDebugInfo(node, NULL, 0, arena);
- if (arena->flag & FILL_FREEBLOCK)
- {
+ if (arena->flag & FILL_FREEBLOCK) {
func_80106860((u32)node + sizeof(ArenaNode), BLOCK_FREE_MAGIC, node->size);
}
newNext = next;
- if ((u32)next == (u32)node + sizeof(ArenaNode) + node->size && next->isFree)
- {
+ if ((u32)next == (u32)node + sizeof(ArenaNode) + node->size && next->isFree) {
newNext = ArenaImpl_GetNextBlock(next);
- if (newNext)
+ if (newNext) {
newNext->prev = node;
-
+ }
+
node->size += next->size + sizeof(ArenaNode);
- if (arena->flag & FILL_FREEBLOCK)
+ if (arena->flag & FILL_FREEBLOCK) {
func_80106860(next, BLOCK_FREE_MAGIC, sizeof(ArenaNode));
+ }
node->next = newNext;
next = newNext;
}
- if (prev && prev->isFree && (u32)node == (u32)prev + sizeof(ArenaNode) + prev->size)
- {
- if (next)
+ if (prev && prev->isFree && (u32)node == (u32)prev + sizeof(ArenaNode) + prev->size) {
+ if (next) {
next->prev = prev;
+ }
prev->next = next;
prev->size += node->size + sizeof(ArenaNode);
- if (arena->flag & FILL_FREEBLOCK)
+ if (arena->flag & FILL_FREEBLOCK) {
func_80106860(node, BLOCK_FREE_MAGIC, sizeof(ArenaNode));
+ }
}
}
}
-void __osFree(Arena* arena, void* ptr)
-{
+void __osFree(Arena* arena, void* ptr) {
ArenaImpl_Lock(arena);
__osFree_NoLock(arena, ptr);
ArenaImpl_Unlock(arena);
}
-void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line)
-{
+void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line) {
ArenaNode* node;
ArenaNode* next;
ArenaNode* prev;
ArenaNode* newNext;
- if (ptr)
- {
+ if (ptr) {
node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode));
- if (node == NULL || node->magic != NODE_MAGIC)
- {
- osSyncPrintf(VT_COL(RED, WHITE) "__osFree:不正解放(%08x) [%s:%d ]\n" VT_RST, ptr, file, line); //__osFree: Unauthorized release (%08x)
+ if (node == NULL || node->magic != NODE_MAGIC) {
+ osSyncPrintf(VT_COL(RED, WHITE) "__osFree:不正解放(%08x) [%s:%d ]\n" VT_RST, ptr, file,
+ line); // __osFree: Unauthorized release (%08x)
return;
}
- if (node->isFree)
- {
- osSyncPrintf(VT_COL(RED, WHITE) "__osFree:二重解放(%08x) [%s:%d ]\n" VT_RST, ptr, file, line); //__osFree: Double release (%08x)
+ if (node->isFree) {
+ osSyncPrintf(VT_COL(RED, WHITE) "__osFree:二重解放(%08x) [%s:%d ]\n" VT_RST, ptr, file,
+ line); // __osFree: Double release (%08x)
return;
}
- if (arena != node->arena && arena != NULL)
- {
- //__osFree:Tried to release in a different way than when it was secured (%08x:%08x)
- osSyncPrintf(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena, node->arena);
+ if (arena != node->arena && arena != NULL) {
+ // __osFree:Tried to release in a different way than when it was secured (%08x:%08x)
+ osSyncPrintf(VT_COL(RED, WHITE) "__osFree:確保時と違う方法で解放しようとした (%08x:%08x)\n" VT_RST, arena,
+ node->arena);
return;
}
@@ -555,46 +513,45 @@ void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line)
prev = ArenaImpl_GetPrevBlock(node);
node->isFree = true;
ArenaImpl_SetDebugInfo(node, file, line, arena);
- if (arena->flag & FILL_FREEBLOCK)
- {
+ if (arena->flag & FILL_FREEBLOCK) {
func_80106860((u32)node + sizeof(ArenaNode), BLOCK_FREE_MAGIC, node->size);
}
newNext = node->next;
- if ((u32)next == (u32)node + sizeof(ArenaNode) + node->size && next->isFree)
- {
+ if ((u32)next == (u32)node + sizeof(ArenaNode) + node->size && next->isFree) {
newNext = ArenaImpl_GetNextBlock(next);
- if (newNext)
+ if (newNext) {
newNext->prev = node;
-
+ }
+
node->size += next->size + sizeof(ArenaNode);
- if (arena->flag & FILL_FREEBLOCK)
+ if (arena->flag & FILL_FREEBLOCK) {
func_80106860(next, BLOCK_FREE_MAGIC, sizeof(ArenaNode));
+ }
node->next = newNext;
next = newNext;
}
- if (prev && prev->isFree && (u32)node == (u32)prev + sizeof(ArenaNode) + prev->size)
- {
- if (next)
+ if (prev && prev->isFree && (u32)node == (u32)prev + sizeof(ArenaNode) + prev->size) {
+ if (next) {
next->prev = prev;
+ }
prev->next = next;
prev->size += node->size + sizeof(ArenaNode);
- if (arena->flag & FILL_FREEBLOCK)
+ if (arena->flag & FILL_FREEBLOCK) {
func_80106860(node, BLOCK_FREE_MAGIC, sizeof(ArenaNode));
+ }
}
}
}
-void __osFreeDebug(Arena* arena, void* ptr, const char* file, s32 line)
-{
+void __osFreeDebug(Arena* arena, void* ptr, const char* file, s32 line) {
ArenaImpl_Lock(arena);
__osFree_NoLockDebug(arena, ptr, file, line);
ArenaImpl_Unlock(arena);
}
-void* __osRealloc(Arena* arena, void* ptr, u32 newSize)
-{
+void* __osRealloc(Arena* arena, void* ptr, u32 newSize) {
void* newAlloc;
ArenaNode* node;
ArenaNode* next;
@@ -611,60 +568,46 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize)
newSize = ALIGN16(newSize);
osSyncPrintf("__osRealloc(%08x, %d)\n", ptr, newSize);
ArenaImpl_Lock(arena);
- if (!ptr)
- {
+ if (!ptr) {
ptr = __osMalloc_NoLock(arena, newSize);
- }
- else if (!newSize)
- {
+ } else if (!newSize) {
__osFree_NoLock(arena, ptr);
ptr = NULL;
- }
- else
- {
+ } else {
node = (ArenaNode*)((u32)ptr - sizeof(ArenaNode));
- if (newSize == node->size)
- {
- //Does nothing because the memory block size does not change
+ if (newSize == node->size) {
+ // Does nothing because the memory block size does not change
osSyncPrintf("メモリブロックサイズが変わらないためなにもしません\n");
- }
- else if (node->size < newSize)
- {
+ } else if (node->size < newSize) {
next = ArenaImpl_GetNextBlock(node);
sizeDiff = newSize - node->size;
- if ((u32)next == ((u32)node + node->size + sizeof(ArenaNode)) && next->isFree && next->size >= sizeDiff)
- {
- //Merge because there is a free block after the current memory block
+ if ((u32)next == ((u32)node + node->size + sizeof(ArenaNode)) && next->isFree && next->size >= sizeDiff) {
+ // Merge because there is a free block after the current memory block
osSyncPrintf("現メモリブロックの後ろにフリーブロックがあるので結合します\n");
next->size -= sizeDiff;
overNext = ArenaImpl_GetNextBlock(next);
newNext = (ArenaNode*)((u32)next + sizeDiff);
- if (overNext)
+ if (overNext) {
overNext->prev = newNext;
+ }
node->next = newNext;
node->size = newSize;
- func_801068B0(newNext, next, sizeof(ArenaNode)); //memcpy
- }
- else
- {
- //Allocate a new memory block and move the contents
+ func_801068B0(newNext, next, sizeof(ArenaNode)); // memcpy
+ } else {
+ // Allocate a new memory block and move the contents
osSyncPrintf("新たにメモリブロックを確保して内容を移動します\n");
newAlloc = __osMalloc_NoLock(arena, newSize);
- if (newAlloc)
- {
+ if (newAlloc) {
bcopy(ptr, newAlloc, node->size);
__osFree_NoLock(arena, ptr);
}
ptr = newAlloc;
}
- }
- else if (newSize < node->size)
- {
+ } else if (newSize < node->size) {
next2 = ArenaImpl_GetNextBlock(node);
- if (next2 && next2->isFree)
- {
+ if (next2 && next2->isFree) {
blockSize = ALIGN16(newSize) + sizeof(ArenaNode);
- //Increased free block behind current memory block
+ // Increased free block behind current memory block
osSyncPrintf("現メモリブロックの後ろのフリーブロックを大きくしました\n");
newNext2 = (ArenaNode*)((u32)node + blockSize);
localCopy = *next2;
@@ -673,13 +616,12 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize)
node->next = newNext2;
node->size = newSize;
overNext2 = ArenaImpl_GetNextBlock(newNext2);
- if (overNext2)
+ if (overNext2) {
overNext2->prev = newNext2;
- }
- else if (newSize + sizeof(ArenaNode) < node->size)
- {
+ }
+ } else if (newSize + sizeof(ArenaNode) < node->size) {
blockSize = ALIGN16(newSize) + sizeof(ArenaNode);
- //Generated because there is no free block after the current memory block
+ // Generated because there is no free block after the current memory block
osSyncPrintf("現メモリブロックの後ろにフリーブロックがないので生成します\n");
newNext2 = (ArenaNode*)((u32)node + blockSize);
newNext2->next = ArenaImpl_GetNextBlock(node);
@@ -690,12 +632,11 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize)
node->next = newNext2;
node->size = newSize;
overNext2 = ArenaImpl_GetNextBlock(newNext2);
- if (overNext2)
+ if (overNext2) {
overNext2->prev = newNext2;
- }
- else
- {
- //There is no room to generate free blocks
+ }
+ } else {
+ // There is no room to generate free blocks
osSyncPrintf("フリーブロック生成するだけの空きがありません\n");
ptr = NULL;
}
@@ -706,13 +647,11 @@ void* __osRealloc(Arena* arena, void* ptr, u32 newSize)
return ptr;
}
-void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, s32 line)
-{
+void* __osReallocDebug(Arena* arena, void* ptr, u32 newSize, const char* file, s32 line) {
return __osRealloc(arena, ptr, newSize);
}
-void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc)
-{
+void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc) {
ArenaNode* iter;
ArenaImpl_Lock(arena);
@@ -722,16 +661,15 @@ void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAll
*outAlloc = 0;
iter = arena->head;
- while (iter)
- {
- if (iter->isFree)
- {
+ while (iter) {
+ if (iter->isFree) {
*outFree += iter->size;
- if (*outMaxFree < iter->size)
+ if (*outMaxFree < iter->size) {
*outMaxFree = iter->size;
- }
- else
+ }
+ } else {
*outAlloc += iter->size;
+ }
iter = ArenaImpl_GetNextBlock(iter);
}
@@ -739,17 +677,15 @@ void ArenaImpl_GetSizes(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAll
ArenaImpl_Unlock(arena);
}
-void __osDisplayArena(Arena* arena)
-{
+void __osDisplayArena(Arena* arena) {
u32 freeSize;
u32 allocatedSize;
u32 maxFree;
ArenaNode* iter;
ArenaNode* next;
- if (!__osMallocIsInitalized(arena))
- {
- //Arena is not initalized
+ if (!__osMallocIsInitalized(arena)) {
+ // Arena is not initalized
osSyncPrintf("アリーナは初期化されていません\n");
return;
}
@@ -760,40 +696,36 @@ void __osDisplayArena(Arena* arena)
freeSize = 0;
allocatedSize = 0;
- //Arena contents (0x%08x)
+ // Arena contents (0x%08x)
osSyncPrintf("アリーナの内容 (0x%08x)\n", arena);
- //Memory node range status size [time s ms us ns: TID: src: line]
+ // Memory node range status size [time s ms us ns: TID: src: line]
osSyncPrintf("メモリブロック範囲 status サイズ [時刻 s ms us ns: TID:src:行]\n");
iter = arena->head;
- while (iter)
- {
- if (iter && iter->magic == NODE_MAGIC)
- {
+ while (iter) {
+ if (iter && iter->magic == NODE_MAGIC) {
next = iter->next;
osSyncPrintf("%08x-%08x%c %s %08x", iter, ((u32)iter + sizeof(ArenaNode) + iter->size),
- (!next) ? '$' : (iter != next->prev ? '!' : ' '),
- iter->isFree ? "空き" : "確保", //? "Free" : "Secure"
- iter->size);
-
- if (!iter->isFree)
- osSyncPrintf(" [%016llu:%2d:%s:%d]", (iter->time*64ll)/3ull, iter->threadId, iter->filename ? iter->filename : "**NULL**", iter->line);
+ (!next) ? '$' : (iter != next->prev ? '!' : ' '),
+ iter->isFree ? "空き" : "確保", //? "Free" : "Secure"
+ iter->size);
+
+ if (!iter->isFree) {
+ osSyncPrintf(" [%016llu:%2d:%s:%d]", (iter->time * 64ll) / 3ull, iter->threadId,
+ iter->filename ? iter->filename : "**NULL**", iter->line);
+ }
osSyncPrintf("\n");
- if (iter->isFree)
- {
+ if (iter->isFree) {
freeSize += iter->size;
- if (maxFree < iter->size)
+ if (maxFree < iter->size) {
maxFree = iter->size;
- }
- else
- {
+ }
+ } else {
allocatedSize += iter->size;
}
- }
- else
- {
+ } else {
osSyncPrintf("%08x Block Invalid\n", iter);
next = NULL;
}
@@ -801,15 +733,14 @@ void __osDisplayArena(Arena* arena)
iter = next;
}
- osSyncPrintf("確保ブロックサイズの合計 0x%08x バイト\n", allocatedSize); //Total reserved node size 0x%08x bytes
- osSyncPrintf("空きブロックサイズの合計 0x%08x バイト\n", freeSize); //Total free node size 0x%08x bytes
- osSyncPrintf("最大空きブロックサイズ 0x%08x バイト\n", maxFree); //Maximum free node size 0x%08x bytes
+ osSyncPrintf("確保ブロックサイズの合計 0x%08x バイト\n", allocatedSize); // Total reserved node size 0x%08x bytes
+ osSyncPrintf("空きブロックサイズの合計 0x%08x バイト\n", freeSize); // Total free node size 0x%08x bytes
+ osSyncPrintf("最大空きブロックサイズ 0x%08x バイト\n", maxFree); // Maximum free node size 0x%08x bytes
ArenaImpl_Unlock(arena);
}
-void ArenaImpl_FaultClient(Arena* arena)
-{
+void ArenaImpl_FaultClient(Arena* arena) {
u32 freeSize;
u32 allocatedSize;
u32 maxFree;
@@ -817,8 +748,7 @@ void ArenaImpl_FaultClient(Arena* arena)
ArenaNode* next;
FaultDrawer_Printf("ARENA INFO (0x%08x)\n", arena);
- if (!__osMallocIsInitalized(arena))
- {
+ if (!__osMallocIsInitalized(arena)) {
FaultDrawer_Printf("Arena is uninitalized\n", arena);
return;
}
@@ -830,31 +760,23 @@ void ArenaImpl_FaultClient(Arena* arena)
FaultDrawer_Printf("Memory Block Region status size\n");
iter = arena->head;
- while (iter)
- {
- if (iter && iter->magic == NODE_MAGIC)
- {
+ while (iter) {
+ if (iter && iter->magic == NODE_MAGIC) {
next = iter->next;
FaultDrawer_Printf("%08x-%08x%c %s %08x", iter, ((u32)iter + sizeof(ArenaNode) + iter->size),
- (!next) ? '$' : (iter != next->prev ? '!' : ' '),
- iter->isFree ? "F" : "A",
- iter->size);
-
+ (!next) ? '$' : (iter != next->prev ? '!' : ' '), iter->isFree ? "F" : "A", iter->size);
+
FaultDrawer_Printf("\n");
- if (iter->isFree)
- {
+ if (iter->isFree) {
freeSize += iter->size;
- if (maxFree < iter->size)
+ if (maxFree < iter->size) {
maxFree = iter->size;
- }
- else
- {
+ }
+ } else {
allocatedSize += iter->size;
}
- }
- else
- {
+ } else {
FaultDrawer_SetFontColor(0xF801);
FaultDrawer_Printf("%08x Block Invalid\n", iter);
next = NULL;
@@ -869,37 +791,32 @@ void ArenaImpl_FaultClient(Arena* arena)
FaultDrawer_Printf("Largest Free Block Size %08x\n", maxFree);
}
-u32 __osCheckArena(Arena* arena)
-{
- ArenaNode *iter;
+u32 __osCheckArena(Arena* arena) {
+ ArenaNode* iter;
u32 error;
error = 0;
ArenaImpl_Lock(arena);
- //Checking the contents of the arena. . . (%08x)
+ // Checking the contents of the arena. . . (%08x)
osSyncPrintf("アリーナの内容をチェックしています... (%08x)\n", arena);
iter = arena->head;
- while (iter)
- {
- if (iter && iter->magic == NODE_MAGIC)
- {
- //Oops!! (%08x %08x)
+ while (iter) {
+ if (iter && iter->magic == NODE_MAGIC) {
+ // Oops!! (%08x %08x)
osSyncPrintf(VT_COL(RED, WHITE) "おおっと!! (%08x %08x)\n" VT_RST, iter, iter->magic);
error = 1;
break;
}
iter = ArenaImpl_GetNextBlock(iter);
}
- if (!error)
- {
- //The arena is still going well
+ if (!error) {
+ // The arena is still going well
osSyncPrintf("アリーナはまだ、いけそうです\n");
}
ArenaImpl_Unlock(arena);
return error;
}
-u8 func_800FF334(Arena* arena)
-{
+u8 func_800FF334(Arena* arena) {
return arena->unk_20;
}
diff --git a/src/code/audioMgr.c b/src/code/audioMgr.c
index a834c746e..2372355de 100644
--- a/src/code/audioMgr.c
+++ b/src/code/audioMgr.c
@@ -14,4 +14,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/audioMgr/func_800C3FC4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/audioMgr/func_800C3FEC.s")
-
diff --git a/src/code/code_80026B00.c b/src/code/code_80026B00.c
index 3cd8d4772..beb5006ee 100644
--- a/src/code/code_80026B00.c
+++ b/src/code/code_80026B00.c
@@ -1,15 +1,13 @@
#include <ultra64.h>
#include <global.h>
-GlobalContext* func_80026B00(void)
-{
+GlobalContext* func_80026B00(void) {
return D_80157DA0;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80026B00/func_80026B0C.s")
-void func_80026C1C(u8* arg0)
-{
+void func_80026C1C(u8* arg0) {
arg0[0] = 0;
arg0[1] = 0;
arg0[2] = 0;
diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c
index c03b84f3e..344c4ddb5 100644
--- a/src/code/code_800430A0.c
+++ b/src/code/code_800430A0.c
@@ -3,59 +3,56 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800430A0/func_800430A0.s")
-void func_800432A0(CollisionContext* colCtx, u32 floorPolySource, Actor* actor)
-{
- if (func_8003E934(floorPolySource) != 0)
- {
+void func_800432A0(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) {
+ if (func_8003E934(floorPolySource) != 0) {
s16 v1 = colCtx->dyna.actorMeshArr[floorPolySource].rot2.y - colCtx->dyna.actorMeshArr[floorPolySource].rot1.y;
- if (actor->id == 0)
+ if (actor->id == 0) {
((Player*)actor)->unk_83C += v1;
+ }
actor->shape.rot.y += v1;
actor->posRot.rot.y += v1;
}
}
-void func_80043334(CollisionContext* colCtx, Actor* actor, u32 floorPolySource)
-{
- if (func_8003E934(floorPolySource) != 0)
- {
+void func_80043334(CollisionContext* colCtx, Actor* actor, u32 floorPolySource) {
+ if (func_8003E934(floorPolySource) != 0) {
DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
- if (dynaActor != NULL)
- {
+ if (dynaActor != NULL) {
func_800434A8(dynaActor);
- if ((actor->flags & 0x4000000) == 0x4000000)
+ if ((actor->flags & 0x4000000) == 0x4000000) {
func_80043538(dynaActor);
+ }
}
}
}
-s32 func_800433A4(CollisionContext* colCtx, u32 floorPolySource, Actor* actor)
-{
+s32 func_800433A4(CollisionContext* colCtx, u32 floorPolySource, Actor* actor) {
s32 sp24 = 0;
DynaPolyActor* dynaActor;
- if (func_8003E934(floorPolySource) == 0)
+ if (func_8003E934(floorPolySource) == 0) {
return 0;
+ }
- if ((colCtx->dyna.flags[floorPolySource] & 2) || !(colCtx->dyna.flags[floorPolySource] & 1))
+ if ((colCtx->dyna.flags[floorPolySource] & 2) || !(colCtx->dyna.flags[floorPolySource] & 1)) {
return 0;
+ }
dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
- if (dynaActor == NULL)
+ if (dynaActor == NULL) {
return 0;
+ }
- if (dynaActor->unk_15C & 1)
- {
+ if (dynaActor->unk_15C & 1) {
func_800430A0(colCtx, floorPolySource, actor);
sp24 = 1;
}
- if (dynaActor->unk_15C & 2)
- {
+ if (dynaActor->unk_15C & 2) {
func_800432A0(colCtx, floorPolySource, actor);
sp24 = 1;
}
diff --git a/src/code/code_80043480.c b/src/code/code_80043480.c
index 7a040602f..ddd8d0e99 100644
--- a/src/code/code_80043480.c
+++ b/src/code/code_80043480.c
@@ -1,8 +1,7 @@
#include <ultra64.h>
#include <global.h>
-void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags)
-{
+void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags) {
dynaActor->dynaPolyId = -1;
dynaActor->unk_15C = flags;
dynaActor->unk_160 = 0;
@@ -10,77 +9,72 @@ void DynaPolyInfo_SetActorMove(DynaPolyActor* dynaActor, DynaPolyMoveFlag flags)
dynaActor->unk_154 = 0.0f;
}
-void func_800434A0(DynaPolyActor *dynaActor)
-{
+void func_800434A0(DynaPolyActor* dynaActor) {
dynaActor->unk_160 = 0;
}
-void func_800434A8(DynaPolyActor *dynaActor)
-{
+void func_800434A8(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 1;
}
-void func_800434B8(DynaPolyActor *dynaActor)
-{
+void func_800434B8(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 2;
}
-void func_800434C8(CollisionContext* colCtx, u32 floorPolySource)
-{
- DynaPolyActor *dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
+void func_800434C8(CollisionContext* colCtx, u32 floorPolySource) {
+ DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
- if (dynaActor != NULL)
+ if (dynaActor != NULL) {
func_800434B8(dynaActor);
+ }
}
-void func_800434F8(DynaPolyActor* dynaActor)
-{
+void func_800434F8(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 4;
}
-void func_80043508(CollisionContext* colCtx, u32 floorPolySource)
-{
- DynaPolyActor *dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
+void func_80043508(CollisionContext* colCtx, u32 floorPolySource) {
+ DynaPolyActor* dynaActor = DynaPolyInfo_GetActor(colCtx, floorPolySource);
- if (dynaActor != NULL)
+ if (dynaActor != NULL) {
func_800434F8(dynaActor);
+ }
}
-void func_80043538(DynaPolyActor* dynaActor)
-{
+void func_80043538(DynaPolyActor* dynaActor) {
dynaActor->unk_160 |= 8;
}
-s32 func_80043548(DynaPolyActor* dynaActor)
-{
- if (dynaActor->unk_160 & 1)
+s32 func_80043548(DynaPolyActor* dynaActor) {
+ if (dynaActor->unk_160 & 1) {
return 1;
- else
+ } else {
return 0;
+ }
}
-s32 func_8004356C(DynaPolyActor* dynaActor)
-{
- if (dynaActor->unk_160 & 2)
+s32 func_8004356C(DynaPolyActor* dynaActor) {
+ if (dynaActor->unk_160 & 2) {
return 1;
- else
+ } else {
return 0;
+ }
}
-s32 func_80043590(DynaPolyActor* dynaActor)
-{
- if (dynaActor->unk_160 & 4)
+s32 func_80043590(DynaPolyActor* dynaActor) {
+ if (dynaActor->unk_160 & 4) {
return 1;
- else
+ } else {
return 0;
+ }
}
-s32 func_800435B4(DynaPolyActor* dynaActor)
-{
- if (dynaActor->unk_160 & 8)
+s32 func_800435B4(DynaPolyActor* dynaActor) {
+ if (dynaActor->unk_160 & 8) {
return 1;
- else
+ } else {
return 0;
+ }
}
#pragma GLOBAL_ASM("asm/non_matchings/code/code_80043480/func_800435D8.s")
diff --git a/src/code/code_80069420.c b/src/code/code_80069420.c
index f0be5b4c3..ee9a179d7 100644
--- a/src/code/code_80069420.c
+++ b/src/code/code_80069420.c
@@ -1,13 +1,11 @@
#include <ultra64.h>
#include <global.h>
-void* MemCopy(void* dest, void* src, s32 size)
-{
+void* MemCopy(void* dest, void* src, s32 size) {
u8* destu = (u8*)dest;
u8* srcu = (u8*)src;
- while (size > 0)
- {
+ while (size > 0) {
*destu++ = *srcu++;
size--;
}
@@ -15,13 +13,11 @@ void* MemCopy(void* dest, void* src, s32 size)
return dest;
}
-void* MemSet(void* dest, s32 val, s32 size)
-{
+void* MemSet(void* dest, s32 val, s32 size) {
u8* destu = (u8*)dest;
s32 s = size;
- while (s > 0)
- {
+ while (s > 0) {
*destu++ = val;
s--;
}
diff --git a/src/code/code_8006C360.c b/src/code/code_8006C360.c
index fa48f62ed..01cf89b4d 100644
--- a/src/code/code_8006C360.c
+++ b/src/code/code_8006C360.c
@@ -1,8 +1,7 @@
#include <ultra64.h>
#include <global.h>
-u16 D_8011F3F0[60][9] =
-{
+u16 D_8011F3F0[60][9] = {
{ 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 },
{ 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B },
{ 0x0000, 0x7128, 0x712B, 0x7128, 0x7128, 0x7129, 0x7128, 0x712B, 0x7128 },
@@ -65,8 +64,7 @@ u16 D_8011F3F0[60][9] =
{ 0x0000, 0x7104, 0x7105, 0x7107, 0x7105, 0x710C, 0x7105, 0x7107, 0x7107 },
};
-u16 func_8006C360(GlobalContext* globalCtx, u32 idx)
-{
+u16 func_8006C360(GlobalContext* globalCtx, u32 idx) {
u8 mask = func_8008F080(globalCtx);
return D_8011F3F0[idx][mask];
}
diff --git a/src/code/code_8006C3A0.c b/src/code/code_8006C3A0.c
index 88889621b..1b7c77c4c 100644
--- a/src/code/code_8006C3A0.c
+++ b/src/code/code_8006C3A0.c
@@ -8,4 +8,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C438.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C4A4.s")
-
diff --git a/src/code/code_8006C510.c b/src/code/code_8006C510.c
index 5568b32e9..20fa80747 100644
--- a/src/code/code_8006C510.c
+++ b/src/code/code_8006C510.c
@@ -4,4 +4,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C510/func_8006C510.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C510/func_8006C5A8.s")
-
diff --git a/src/code/code_8006EA30.c b/src/code/code_8006EA30.c
index f433ed6b0..41104fea7 100644
--- a/src/code/code_8006EA30.c
+++ b/src/code/code_8006EA30.c
@@ -5,10 +5,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006EA30/func_8006ECF4.s")
-void func_8006EE48(UNK_TYPE arg0)
-{
-
+void func_8006EE48(UNK_TYPE arg0) {
}
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006EA30/func_8006EE50.s")
-
diff --git a/src/code/code_8007BF90.c b/src/code/code_8007BF90.c
index f947e042b..c51b222f9 100644
--- a/src/code/code_8007BF90.c
+++ b/src/code/code_8007BF90.c
@@ -3,8 +3,7 @@
Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1);
-f32 func_8007BF90(Vec3f* a, Vec3f* b)
-{
+f32 func_8007BF90(Vec3f* a, Vec3f* b) {
f32 dx = a->x - b->x;
f32 dy = a->y - b->y;
f32 dz = a->z - b->z;
@@ -12,8 +11,7 @@ f32 func_8007BF90(Vec3f* a, Vec3f* b)
return sqrtf(SQ(dx) + SQ(dy) + SQ(dz));
}
-f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest)
-{
+f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest) {
dest->x = a->x - b->x;
dest->y = a->y - b->y;
dest->z = a->z - b->z;
@@ -21,20 +19,17 @@ f32 func_8007BFD0(Vec3f* a, Vec3f* b, Vec3f* dest)
return sqrtf(SQ(dest->x) + SQ(dest->y) + SQ(dest->z));
}
-f32 func_8007C028(Vec3f* a, Vec3f* b)
-{
+f32 func_8007C028(Vec3f* a, Vec3f* b) {
return sqrtf(SQ(a->x - b->x) + SQ(a->z - b->z));
}
-f32 func_8007C058(f32 arg0, f32 arg1)
-{
+f32 func_8007C058(f32 arg0, f32 arg1) {
return (arg1 <= fabsf(arg0)) ? arg0 : ((arg0 >= 0) ? arg1 : -arg1);
}
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C0A8.s")
-Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b)
-{
+Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b) {
Vec3f v1;
Vec3f v2;
f32 temp;
@@ -54,8 +49,7 @@ Vec3f* func_8007C0F8(Vec3f* dest, Vec3f* a, Vec3f* b)
return dest;
}
-Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1)
-{
+Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1) {
Vec3f v;
f32 sin4;
f32 cos4;
@@ -78,8 +72,7 @@ Vec3f* func_8007C1AC(Vec3f* dest, struct_80045714* arg1)
void func_8007C3F4(struct_80045714* arg0, Vec3f* arg1);
-void func_8007C25C(Vec3f* dest, struct_80045714* arg1)
-{
+void func_8007C25C(Vec3f* dest, struct_80045714* arg1) {
struct_80045714 var;
var.unk_00 = arg1->unk_00;
@@ -95,8 +88,7 @@ void func_8007C25C(Vec3f* dest, struct_80045714* arg1)
void func_8007C29C(struct_80045714* arg0, Vec3f* arg1);
-void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b)
-{
+void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b) {
Vec3f var;
var.x = b->x - a->x;
@@ -106,8 +98,7 @@ void func_8007C440(struct_80045714* arg0, Vec3f* a, Vec3f* b)
func_8007C29C(arg0, &var);
}
-void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b)
-{
+void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b) {
Vec3f var;
var.x = b->x - a->x;
@@ -117,8 +108,7 @@ void func_8007C490(struct_80045714* arg0, Vec3f* a, Vec3f* b)
func_8007C3F4(arg0, &var);
}
-Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b)
-{
+Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b) {
Vec3f var;
var.x = Math_atan2f(b->z - a->z, b->y - a->y);
@@ -133,4 +123,3 @@ Vec3f* func_8007C4E0(Vec3f* dest, Vec3f* a, Vec3f* b)
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C574.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8007BF90/func_8007C5E0.s")
-
diff --git a/src/code/code_80097A00.c b/src/code/code_80097A00.c
index f30e01f1a..d709fd8c9 100644
--- a/src/code/code_80097A00.c
+++ b/src/code/code_80097A00.c
@@ -2,244 +2,77 @@
#include <global.h>
// Bit Flag array in which gBitFlags[n] is literally (1 << n)
-u32 gBitFlags[] =
-{
- (1 << 0), (1 << 1), (1 << 2), (1 << 3),
- (1 << 4), (1 << 5), (1 << 6), (1 << 7),
- (1 << 8), (1 << 9), (1 << 10), (1 << 11),
- (1 << 12), (1 << 13), (1 << 14), (1 << 15),
- (1 << 16), (1 << 17), (1 << 18), (1 << 19),
- (1 << 20), (1 << 21), (1 << 22), (1 << 23),
- (1 << 24), (1 << 25), (1 << 26), (1 << 27),
- (1 << 28), (1 << 29), (1 << 30), (1 << 31),
+u32 gBitFlags[] = {
+ (1 << 0), (1 << 1), (1 << 2), (1 << 3), (1 << 4), (1 << 5), (1 << 6), (1 << 7),
+ (1 << 8), (1 << 9), (1 << 10), (1 << 11), (1 << 12), (1 << 13), (1 << 14), (1 << 15),
+ (1 << 16), (1 << 17), (1 << 18), (1 << 19), (1 << 20), (1 << 21), (1 << 22), (1 << 23),
+ (1 << 24), (1 << 25), (1 << 26), (1 << 27), (1 << 28), (1 << 29), (1 << 30), (1 << 31),
};
u16 gEquipMasks[] = { 0x000F, 0x00F0, 0x0F00, 0xF000 };
u16 gEquipNegMasks[] = { 0xFFF0, 0xFF0F, 0xF0FF, 0x0FFF };
-u32 gUpgradeMasks[] = { 0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000 };
-u32 gUpgradeNegMasks[] = { 0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF };
+u32 gUpgradeMasks[] = {
+ 0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000,
+};
+u32 gUpgradeNegMasks[] = {
+ 0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF,
+};
u8 gEquipShifts[] = { 0, 4, 8, 12 };
u8 gUpgradeShifts[] = { 0, 3, 6, 9, 12, 14, 17, 20 };
-u16 gUpgradeCapacities[][4] =
-{
- { 0, 30, 40, 50 }, // Quivers
- { 0, 20, 30, 40 }, // Bomb Bags
- { 0, 0, 0, 0 }, // Unused (Scale)
- { 0, 0, 0, 0 }, // Unused (Strength)
- { 99, 200, 500, 500 }, // Wallets
- { 0, 30, 40, 50 }, // Deku Seed Bullet Bags
- { 0, 10, 20, 30 }, // Deku Stick Upgrades
- { 0, 20, 30, 40 }, // Deku Nut Upgrades
+u16 gUpgradeCapacities[][4] = {
+ { 0, 30, 40, 50 }, // Quivers
+ { 0, 20, 30, 40 }, // Bomb Bags
+ { 0, 0, 0, 0 }, // Unused (Scale)
+ { 0, 0, 0, 0 }, // Unused (Strength)
+ { 99, 200, 500, 500 }, // Wallets
+ { 0, 30, 40, 50 }, // Deku Seed Bullet Bags
+ { 0, 10, 20, 30 }, // Deku Stick Upgrades
+ { 0, 20, 30, 40 }, // Deku Nut Upgrades
};
u32 D_8012723C[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }; // Unused
-u32 D_8012724C[] = { 0, 8, 16, 24 }; // Unused
+u32 D_8012724C[] = { 0, 8, 16, 24 }; // Unused
// TODO: use symbols for these icon textures once textures are properly in C
-u32 gItemIcons[] =
-{
- 0x08000000,
- 0x08001000,
- 0x08002000,
- 0x08003000,
- 0x08004000,
- 0x08005000,
- 0x08006000,
- 0x08007000,
- 0x08008000,
- 0x08009000,
- 0x0800A000,
- 0x0800B000,
- 0x0800C000,
- 0x0800D000,
- 0x0800E000,
- 0x0800F000,
- 0x08010000,
- 0x08011000,
- 0x08012000,
- 0x08013000,
- 0x08014000,
- 0x08015000,
- 0x08016000,
- 0x08017000,
- 0x08018000,
- 0x08019000,
- 0x0801A000,
- 0x0801B000,
- 0x0801C000,
- 0x0801D000,
- 0x0801E000,
- 0x0801F000,
- 0x08020000,
- 0x08021000,
- 0x08022000,
- 0x08023000,
- 0x08024000,
- 0x08025000,
- 0x08026000,
- 0x08027000,
- 0x08028000,
- 0x08029000,
- 0x0802A000,
- 0x0802B000,
- 0x0802C000,
- 0x0802D000,
- 0x0802E000,
- 0x0802F000,
- 0x08030000,
- 0x08031000,
- 0x08032000,
- 0x08033000,
- 0x08034000,
- 0x08035000,
- 0x08036000,
- 0x08037000,
- 0x08038000,
- 0x08039000,
- 0x0803A000,
- 0x0803B000,
- 0x0803C000,
- 0x0803D000,
- 0x0803E000,
- 0x0803F000,
- 0x08040000,
- 0x08041000,
- 0x08042000,
- 0x08043000,
- 0x08044000,
- 0x08045000,
- 0x08046000,
- 0x08047000,
- 0x08048000,
- 0x08049000,
- 0x0804A000,
- 0x0804B000,
- 0x0804C000,
- 0x0804D000,
- 0x0804E000,
- 0x0804F000,
- 0x08050000,
- 0x08051000,
- 0x08052000,
- 0x08053000,
- 0x08054000,
- 0x08055000,
- 0x08056000,
- 0x08057000,
- 0x08058000,
- 0x08059000,
- 0x08089440,
- 0x08089440,
- 0x08089440,
- 0x08089440,
- 0x08089440,
- 0x08089440,
- 0x08089440,
- 0x08089440,
- 0x08089440,
- 0x08089440,
- 0x08089440,
- 0x08089440,
- 0x09000000,
- 0x09000900,
- 0x09001200,
- 0x09001B00,
- 0x09002400,
- 0x09002D00,
- 0x09003600,
- 0x09003F00,
- 0x09004800,
- 0x09005100,
- 0x09005A00,
- 0x09006300,
- 0x09006C00,
- 0x09007500,
- 0x09007E00,
- 0x09009000,
- 0x09008700,
- 0x09007E00,
- 0x0900A200,
- 0x0900AB00,
- 0x0805A000,
- 0x0805A900,
- 0x0805B200,
- 0x02002D40,
- 0x02002A40,
- 0x02002C40,
- 0x02002B40,
- 0x02002940,
+u32 gItemIcons[] = {
+ 0x08000000, 0x08001000, 0x08002000, 0x08003000, 0x08004000, 0x08005000, 0x08006000, 0x08007000, 0x08008000,
+ 0x08009000, 0x0800A000, 0x0800B000, 0x0800C000, 0x0800D000, 0x0800E000, 0x0800F000, 0x08010000, 0x08011000,
+ 0x08012000, 0x08013000, 0x08014000, 0x08015000, 0x08016000, 0x08017000, 0x08018000, 0x08019000, 0x0801A000,
+ 0x0801B000, 0x0801C000, 0x0801D000, 0x0801E000, 0x0801F000, 0x08020000, 0x08021000, 0x08022000, 0x08023000,
+ 0x08024000, 0x08025000, 0x08026000, 0x08027000, 0x08028000, 0x08029000, 0x0802A000, 0x0802B000, 0x0802C000,
+ 0x0802D000, 0x0802E000, 0x0802F000, 0x08030000, 0x08031000, 0x08032000, 0x08033000, 0x08034000, 0x08035000,
+ 0x08036000, 0x08037000, 0x08038000, 0x08039000, 0x0803A000, 0x0803B000, 0x0803C000, 0x0803D000, 0x0803E000,
+ 0x0803F000, 0x08040000, 0x08041000, 0x08042000, 0x08043000, 0x08044000, 0x08045000, 0x08046000, 0x08047000,
+ 0x08048000, 0x08049000, 0x0804A000, 0x0804B000, 0x0804C000, 0x0804D000, 0x0804E000, 0x0804F000, 0x08050000,
+ 0x08051000, 0x08052000, 0x08053000, 0x08054000, 0x08055000, 0x08056000, 0x08057000, 0x08058000, 0x08059000,
+ 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440, 0x08089440,
+ 0x08089440, 0x08089440, 0x08089440, 0x09000000, 0x09000900, 0x09001200, 0x09001B00, 0x09002400, 0x09002D00,
+ 0x09003600, 0x09003F00, 0x09004800, 0x09005100, 0x09005A00, 0x09006300, 0x09006C00, 0x09007500, 0x09007E00,
+ 0x09009000, 0x09008700, 0x09007E00, 0x0900A200, 0x0900AB00, 0x0805A000, 0x0805A900, 0x0805B200, 0x02002D40,
+ 0x02002A40, 0x02002C40, 0x02002B40, 0x02002940,
};
// Used to map item IDs to inventory slots
-u8 gItemSlots[] =
-{
- SLOT_STICK,
- SLOT_NUT,
- SLOT_BOMB,
- SLOT_BOW,
- SLOT_ARROW_FIRE,
- SLOT_DINS_FIRE,
- SLOT_SLINGSHOT,
- SLOT_OCARINA,
- SLOT_OCARINA,
- SLOT_BOMBCHU,
- SLOT_HOOKSHOT,
- SLOT_HOOKSHOT,
- SLOT_ARROW_ICE,
- SLOT_FARORES_WIND,
- SLOT_BOOMERANG,
- SLOT_LENS,
- SLOT_BEAN,
- SLOT_HAMMER,
- SLOT_ARROW_LIGHT,
- SLOT_NAYRUS_LOVE,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_BOTTLE_1,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_CHILD,
- SLOT_TRADE_ADULT,
- SLOT_TRADE_ADULT,
- SLOT_TRADE_ADULT,
- SLOT_TRADE_ADULT,
- SLOT_TRADE_ADULT,
- SLOT_TRADE_ADULT,
- SLOT_TRADE_ADULT,
- SLOT_TRADE_ADULT,
- SLOT_TRADE_ADULT,
- SLOT_TRADE_ADULT,
- SLOT_TRADE_ADULT
+u8 gItemSlots[] = {
+ SLOT_STICK, SLOT_NUT, SLOT_BOMB, SLOT_BOW, SLOT_ARROW_FIRE, SLOT_DINS_FIRE,
+ SLOT_SLINGSHOT, SLOT_OCARINA, SLOT_OCARINA, SLOT_BOMBCHU, SLOT_HOOKSHOT, SLOT_HOOKSHOT,
+ SLOT_ARROW_ICE, SLOT_FARORES_WIND, SLOT_BOOMERANG, SLOT_LENS, SLOT_BEAN, SLOT_HAMMER,
+ SLOT_ARROW_LIGHT, SLOT_NAYRUS_LOVE, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1,
+ SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1,
+ SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_BOTTLE_1, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD,
+ SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD,
+ SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_CHILD, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT,
+ SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT, SLOT_TRADE_ADULT,
+ SLOT_TRADE_ADULT, SLOT_TRADE_ADULT,
};
-void Inventory_ChangeEquipment(s16 equipment, u16 value)
-{
+void Inventory_ChangeEquipment(s16 equipment, u16 value) {
gSaveContext.equips.equipment &= gEquipNegMasks[equipment];
gSaveContext.equips.equipment |= value << gEquipShifts[equipment];
}
-u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment)
-{
+u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
Player* player = PLAYER;
s32 pad;
u16 sp26;
@@ -249,18 +82,17 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment)
// Translates to: "Erasing equipment item = %d zzz=%d"
osSyncPrintf("装備アイテム抹消 = %d zzz=%d\n", equipment, sp26);
- if (sp26)
- {
+ if (sp26) {
sp26 >>= gEquipShifts[equipment];
gSaveContext.equips.equipment &= gEquipNegMasks[equipment];
gSaveContext.equipment ^= gBitFlags[sp26 - 1] << gEquipShifts[equipment];
- if (equipment == EQUIP_TUNIC)
+ if (equipment == EQUIP_TUNIC) {
gSaveContext.equips.equipment |= 0x0100;
+ }
- if (equipment == EQUIP_SWORD)
- {
+ if (equipment == EQUIP_SWORD) {
gSaveContext.equips.button_items[0] = ITEM_NONE;
gSaveContext.inf_table[29] = 1;
}
@@ -272,8 +104,7 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment)
return sp26;
}
-void Inventory_ChangeUpgrade(s16 upgrade, s16 value)
-{
+void Inventory_ChangeUpgrade(s16 upgrade, s16 value) {
gSaveContext.upgrades &= gUpgradeNegMasks[upgrade];
gSaveContext.upgrades |= value << gUpgradeShifts[upgrade];
}
diff --git a/src/code/code_800A9D40.c b/src/code/code_800A9D40.c
index 960994614..c32d31d4e 100644
--- a/src/code/code_800A9D40.c
+++ b/src/code/code_800A9D40.c
@@ -1,23 +1,20 @@
#include <ultra64.h>
#include <global.h>
-typedef struct
-{
+typedef struct {
/* 0x00 */ OSPiHandle piHandle;
/* 0x74 */ OSIoMesg ioMesg;
/* 0x8C */ OSMesgQueue mesgQ;
} struct_800A9D40;
-struct_800A9D40 D_8012A690 = {0};
+struct_800A9D40 D_8012A690 = { 0 };
void func_800A9D40(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration,
- u8 handlePulse, u32 handleSpeed)
-{
+ u8 handlePulse, u32 handleSpeed) {
u32 int_disabled;
- OSPiHandle *handle = &D_8012A690.piHandle;
- if ((u32) OS_PHYSICAL_TO_K1(addr) != (*handle).baseAddress)
- {
+ OSPiHandle* handle = &D_8012A690.piHandle;
+ if ((u32)OS_PHYSICAL_TO_K1(addr) != (*handle).baseAddress) {
D_8012A690.piHandle.type = handleType;
(*handle).baseAddress = OS_PHYSICAL_TO_K1(addr);
D_8012A690.piHandle.latency = handleLatency;
@@ -37,8 +34,7 @@ void func_800A9D40(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u
}
}
-void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2)
-{
+void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2) {
OSMesg mesg;
osCreateMesgQueue(&D_8012A690.mesgQ, &mesg, 1);
@@ -50,8 +46,7 @@ void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2)
osInvalDCache(dramAddr, size);
}
-void Sram_ReadWrite(UNK_TYPE arg0, UNK_PTR dramAddr, size_t size, UNK_TYPE arg3)
-{
+void Sram_ReadWrite(UNK_TYPE arg0, UNK_PTR dramAddr, size_t size, UNK_TYPE arg3) {
osSyncPrintf("ssSRAMReadWrite:%08x %08x %08x %d\n", arg0, dramAddr, size, arg3);
func_800A9D40(arg0, 3, 1, 5, 0xd, 2, 0xc, 0);
func_800A9E14(dramAddr, size, arg3);
diff --git a/src/code/code_800A9F30.c b/src/code/code_800A9F30.c
index ad603fabe..ddc8c0223 100644
--- a/src/code/code_800A9F30.c
+++ b/src/code/code_800A9F30.c
@@ -5,26 +5,23 @@
extern u8 D_80160FD0[];
extern PadMgr gPadMgr;
-void func_800A9F30(s32 a, s32 b)
-{
+void func_800A9F30(s32 a, s32 b) {
func_800D2E30(&D_80160FD0);
func_800C7948(a, &D_80160FD0);
}
-void func_800A9F6C(f32 a, u8 b, u8 c, u8 d)
-{
+void func_800A9F6C(f32 a, u8 b, u8 c, u8 d) {
s32 temp1, temp2;
- if (1000000.0f < a)
+ if (1000000.0f < a) {
temp1 = 1000;
- else
+ } else {
temp1 = sqrtf(a);
+ }
- if ((temp1 < 1000) && (b != 0) && (d != 0))
- {
+ if ((temp1 < 1000) && (b != 0) && (d != 0)) {
temp2 = b - (temp1 * 255) / 1000;
- if (temp2 > 0)
- {
+ if (temp2 > 0) {
D_801610DA = temp2;
D_80160FD0[0x10B] = c;
D_80160FD0[0x10C] = d;
@@ -35,22 +32,19 @@ void func_800A9F6C(f32 a, u8 b, u8 c, u8 d)
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800A9F30/func_800AA000.s")
// this function is very similar to the one above but has a loop in it I can't figure out
-void func_800AA0B4(void)
-{
+void func_800AA0B4(void) {
func_800D3140(&D_80160FD0);
gPadMgr.unk_460 = func_800A9F30;
gPadMgr.unk_464 = 0;
- if (0) ; // Necessary to match
+ if (0) {} // Necessary to match
}
-void func_800AA0F0(void)
-{
+void func_800AA0F0(void) {
PadMgr* padmgr = &gPadMgr;
- if ((padmgr->unk_460 == func_800A9F30) && (padmgr->unk_464 == 0))
- {
+ if ((padmgr->unk_460 == func_800A9F30) && (padmgr->unk_464 == 0)) {
padmgr->unk_460 = NULL;
padmgr->unk_464 = 0;
}
@@ -58,22 +52,18 @@ void func_800AA0F0(void)
func_800D3178(&D_80160FD0);
}
-u32 func_800AA148(void)
-{
+u32 func_800AA148(void) {
return ((gPadMgr.unk_2AE[0] ^ 1) == 0);
}
-void func_800AA15C(void)
-{
+void func_800AA15C(void) {
D_801610D4 = 2;
}
-void func_800AA16C(void)
-{
+void func_800AA16C(void) {
D_801610D4 = 0;
}
-void func_800AA178(u32 a)
-{
+void func_800AA178(u32 a) {
D_801610D5 = !!a;
}
diff --git a/src/code/code_800ACE70.c b/src/code/code_800ACE70.c
index 9f606cffa..5bf69cc48 100644
--- a/src/code/code_800ACE70.c
+++ b/src/code/code_800ACE70.c
@@ -1,75 +1,63 @@
#include <global.h>
-typedef struct
-{
+typedef struct {
/* 0x00 */ u32 type;
/* 0x04 */ u32 setScissor;
- /* 0x08 */ union
- {
+ /* 0x08 */ union {
Color_RGBA8 c;
u32 rgba;
} color;
/* 0x0C */ u32 unk_0C;
} struct_801664F0;
-Gfx D_8012AC00[] =
-{
- gsDPSetOtherMode(
- G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
- G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
- G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2),
- gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
+Gfx D_8012AC00[] = {
+ gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_NONE | G_ZS_PRIM | G_RM_VISCVG | G_RM_VISCVG2),
+ gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
gsDPPipeSync(),
gsDPSetBlendColor(0, 0, 0, 8),
gsSPEndDisplayList(),
};
-Gfx D_8012AC28[] =
-{
- gsDPSetOtherMode(
- G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
- G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
- G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
- GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG,G_BL_CLR_MEM, G_BL_A_MEM) |
- GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)),
- gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
+Gfx D_8012AC28[] = {
+ gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
+ GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM) |
+ GBL_c2(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_A_MEM)),
+ gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
gsSPEndDisplayList(),
};
-Gfx D_8012AC40[] =
-{
- gsDPSetOtherMode(
- G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
- G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
- G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
- GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
- GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
+Gfx D_8012AC40[] = {
+ gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
+ GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
+ GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
- gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
+ gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
gsSPEndDisplayList(),
};
-Gfx D_8012AC58[] =
-{
+Gfx D_8012AC58[] = {
gsDPSetCombineLERP(K5, K5, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, K5, K5, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE),
- gsDPSetOtherMode(
- G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
- G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
- G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2),
- gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
- gsDPSetOtherMode(
- G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
- G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
- G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
- GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
- GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
- gsDPFillRectangle(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1),
+ gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_DISABLE | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_NONE | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2),
+ gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
+ gsDPSetOtherMode(G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_NONE | G_ZS_PRIM | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL |
+ GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM) |
+ GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_MEM, G_BL_A_MEM)),
+ gsDPFillRectangle(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1),
gsSPEndDisplayList(),
};
-//Init func
-void func_800ACE70(struct_801664F0* this)
-{
+// Init func
+void func_800ACE70(struct_801664F0* this) {
this->type = 0;
this->setScissor = false;
this->color.c.r = 0xFF;
@@ -78,15 +66,12 @@ void func_800ACE70(struct_801664F0* this)
this->color.c.a = 0xFF;
}
-//Destroy func
-void func_800ACE90(struct_801664F0* this)
-{
-
+// Destroy func
+void func_800ACE90(struct_801664F0* this) {
}
-//Update func
-void func_800ACE98(struct_801664F0* this, Gfx** gfxp)
-{
+// Update func
+void func_800ACE98(struct_801664F0* this, Gfx** gfxp) {
Gfx* gfx;
gfx = *gfxp;
@@ -94,37 +79,27 @@ void func_800ACE98(struct_801664F0* this, Gfx** gfxp)
gDPPipeSync(gfx++);
gDPSetPrimDepth(gfx++, -1, -1);
- if (this->setScissor == true)
- {
+ if (this->setScissor == true) {
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
}
-
- switch(this->type)
- {
+
+ switch (this->type) {
case 1:
- {
gSPDisplayList(gfx++, D_8012AC40);
break;
- }
case 2:
- {
gDPSetColor(gfx++, G_SETPRIMCOLOR, this->color.rgba);
gSPDisplayList(gfx++, D_8012AC58);
break;
- }
case 3:
- {
gDPSetColor(gfx++, G_SETBLENDCOLOR, this->color.rgba);
gSPDisplayList(gfx++, D_8012AC00);
break;
- }
case 4:
- {
gDPSetColor(gfx++, G_SETFOGCOLOR, this->color.rgba);
gSPDisplayList(gfx++, D_8012AC28);
break;
- }
- }
+ }
gDPPipeSync(gfx++);
*gfxp = gfx;
diff --git a/src/code/code_800FBCE0.c b/src/code/code_800FBCE0.c
index 251638883..2c17e6fa2 100644
--- a/src/code/code_800FBCE0.c
+++ b/src/code/code_800FBCE0.c
@@ -1,10 +1,13 @@
#include <z64.h>
-#define printSpStatus(x, name) if (x & SP_STATUS_##name) osSyncPrintf(#name " ")
-#define printDpStatus(x, name) if (x & DPC_STATUS_##name) osSyncPrintf(#name " ")
+#define printSpStatus(x, name) \
+ if (x & SP_STATUS_##name) \
+ osSyncPrintf(#name " ")
+#define printDpStatus(x, name) \
+ if (x & DPC_STATUS_##name) \
+ osSyncPrintf(#name " ")
-void func_800FBCE0()
-{
+void func_800FBCE0() {
u32 spStatus = __osSpGetStatus();
u32 dpStatus = osDpGetStatus();
@@ -41,10 +44,9 @@ void func_800FBCE0()
osSyncPrintf("\n");
}
-void func_800FBFD8()
-{
+void func_800FBFD8() {
func_800FBCE0();
osDpSetStatus(DPC_SET_FREEZE | DPC_SET_FLUSH);
__osSpSetStatus(SP_SET_HALT | SP_SET_SIG2 | SP_CLR_INTR_BREAK);
func_800FBCE0();
-} \ No newline at end of file
+}
diff --git a/src/code/code_800FC620.c b/src/code/code_800FC620.c
index 81f0f53e7..b0b16b8b7 100644
--- a/src/code/code_800FC620.c
+++ b/src/code/code_800FC620.c
@@ -1,52 +1,44 @@
#include <global.h>
typedef void (*arg3_800FC868)(void*);
-typedef void (*arg3_800FC8D8)(void*,u32);
-typedef void (*arg3_800FC948)(void*,u32,u32,u32,u32,u32,u32,u32,u32);
-typedef void (*arg3_800FCA18)(void*,u32);
+typedef void (*arg3_800FC8D8)(void*, u32);
+typedef void (*arg3_800FC948)(void*, u32, u32, u32, u32, u32, u32, u32, u32);
+typedef void (*arg3_800FCA18)(void*, u32);
-typedef struct InitFunc
-{
+typedef struct InitFunc {
s32 nextOffset;
void (*func)(void);
} InitFunc;
-//.data
-void *sInitFuncs = NULL;
+// .data
+void* sInitFuncs = NULL;
-char sNew[4] =
-{
- 'n', 'e', 'w',
-};
+char sNew[4] = { 'n', 'e', 'w' };
-char D_80134488[0x18] =
-{
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x7F, 0x80, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
+char D_80134488[0x18] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00,
+ 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
};
-s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, void *allocatedVRamAddr)
-{
+s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd, void* allocatedVRamAddr) {
u32 pad;
u32 end;
u32 bssSize;
- OverlayRelocationSection *ovl;
+ OverlayRelocationSection* ovl;
u32 relocCnt;
u32 ovlOffset;
u32 size;
- if(gOverlayLogSeverity >= 3)
- {
+ if (gOverlayLogSeverity >= 3) {
// Start loading dynamic link function
osSyncPrintf("\nダイナミックリンクファンクションのロードを開始します\n");
}
- if(gOverlayLogSeverity >= 3)
- {
+ if (gOverlayLogSeverity >= 3) {
size = vRomEnd - vRomStart;
- //DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)
- osSyncPrintf("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", allocatedVRamAddr, (u32)allocatedVRamAddr + size);
+ // DMA transfer of TEXT, DATA, RODATA + rel (%08x-%08x)
+ osSyncPrintf("TEXT,DATA,RODATA+relをDMA転送します(%08x-%08x)\n", allocatedVRamAddr,
+ (u32)allocatedVRamAddr + size);
}
size = vRomEnd - vRomStart;
@@ -56,13 +48,12 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
ovlOffset = ((s32*)end)[-1];
ovl = (OverlayRelocationSection*)((u32)end - ovlOffset);
- if(gOverlayLogSeverity >= 3)
- {
- osSyncPrintf("TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n", ovl->textSize, ovl->dataSize, ovl->rodataSize, ovl->bssSize);
+ if (gOverlayLogSeverity >= 3) {
+ osSyncPrintf("TEXT(%08x), DATA(%08x), RODATA(%08x), BSS(%08x)\n", ovl->textSize, ovl->dataSize, ovl->rodataSize,
+ ovl->bssSize);
}
- if(gOverlayLogSeverity >= 3)
- {
+ if (gOverlayLogSeverity >= 3) {
// Relocate
osSyncPrintf("リロケーションします\n");
}
@@ -70,10 +61,8 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
Overlay_DoRelocation(allocatedVRamAddr, ovl, vRamStart);
bssSize = ovl->bssSize;
- if(bssSize != 0)
- {
- if(gOverlayLogSeverity >= 3)
- {
+ if (bssSize != 0) {
+ if (gOverlayLogSeverity >= 3) {
// Clear BSS area (% 08x-% 08x)
osSyncPrintf("BSS領域をクリアします(%08x-%08x)\n", end, end + ovl->bssSize);
}
@@ -85,8 +74,7 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
}
size = (u32)&ovl->relocations[ovl->nRelocations] - (u32)ovl;
- if(gOverlayLogSeverity >= 3)
- {
+ if (gOverlayLogSeverity >= 3) {
// Clear REL area (%08x-%08x)
osSyncPrintf("REL領域をクリアします(%08x-%08x)\n", ovl, (u32)ovl + size);
}
@@ -97,8 +85,7 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
osWritebackDCache(allocatedVRamAddr, size);
osInvalICache(allocatedVRamAddr, size);
- if(gOverlayLogSeverity >= 3)
- {
+ if (gOverlayLogSeverity >= 3) {
// Finish loading dynamic link function
osSyncPrintf("ダイナミックリンクファンクションのロードを終了します\n\n");
}
@@ -106,10 +93,8 @@ s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, voi
}
// possibly some kind of new() function
-void *func_800FC800(u32 size)
-{
- if (size == 0)
- {
+void* func_800FC800(u32 size) {
+ if (size == 0) {
size = 1;
}
@@ -117,106 +102,87 @@ void *func_800FC800(u32 size)
}
// possible some kind of delete() function
-void func_800FC83C(void *ptr)
-{
- if (ptr != NULL)
- {
+void func_800FC83C(void* ptr) {
+ if (ptr != NULL) {
__osFree(&gSystemArena, ptr);
}
}
-void func_800FC868(void *blk, u32 nBlk, u32 blkSize, arg3_800FC868 arg3)
-{
+void func_800FC868(void* blk, u32 nBlk, u32 blkSize, arg3_800FC868 arg3) {
u32 pos;
- for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0))
- {
+ for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) {
arg3((void*)pos);
}
}
-void func_800FC8D8(void *blk, u32 nBlk, s32 blkSize, arg3_800FC8D8 arg3)
-{
+void func_800FC8D8(void* blk, u32 nBlk, s32 blkSize, arg3_800FC8D8 arg3) {
u32 pos;
- for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0))
- {
+ for (pos = (u32)blk; pos < (u32)blk + (nBlk * blkSize); pos = (u32)pos + (blkSize & ~0)) {
arg3((void*)pos, 2);
}
}
-void *func_800FC948(void *blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3)
-{
+void* func_800FC948(void* blk, u32 nBlk, u32 blkSize, arg3_800FC948 arg3) {
u32 pos;
- if (blk == NULL)
- {
+ if (blk == NULL) {
blk = func_800FC800(nBlk * blkSize);
}
- if (blk != NULL && arg3 != NULL)
- {
+ if (blk != NULL && arg3 != NULL) {
pos = (u32)blk;
- while(pos < (u32)blk + (nBlk * blkSize))
- {
+ while (pos < (u32)blk + (nBlk * blkSize)) {
arg3((void*)pos, 0, 0, 0, 0, 0, 0, 0, 0);
pos = (u32)pos + (blkSize & ~0);
}
-
}
return blk;
}
-void func_800FCA18(void *blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg4)
-{
+void func_800FCA18(void* blk, u32 nBlk, u32 blkSize, arg3_800FCA18 arg3, s32 arg4) {
u32 pos;
- u32 end ;
+ u32 end;
s32 masked_arg2;
- if (blk == 0)
- {
+ if (blk == 0) {
return;
}
- if (arg3 != 0)
- {
+ if (arg3 != 0) {
end = (u32)blk;
masked_arg2 = (s32)(blkSize & ~0);
pos = (u32)end + (nBlk * blkSize);
- if (masked_arg2) { }
+ if (masked_arg2) {}
- while (pos > end)
- {
+ while (pos > end) {
do {
pos -= masked_arg2;
arg3((void*)pos, 2);
} while (0);
}
- if (!masked_arg2){ }
+ if (!masked_arg2) {}
}
- if (arg4 != 0)
- {
+ if (arg4 != 0) {
func_800FC83C(blk);
}
}
-void func_800FCB34(void)
-{
- InitFunc *initFunc;
+void func_800FCB34(void) {
+ InitFunc* initFunc;
u32 nextOffset;
- InitFunc *prev;
+ InitFunc* prev;
initFunc = (InitFunc*)&sInitFuncs;
nextOffset = initFunc->nextOffset;
prev = NULL;
- while(nextOffset != 0)
- {
+ while (nextOffset != 0) {
initFunc = (InitFunc*)((s32)initFunc + nextOffset);
- if(initFunc->func != NULL)
- {
+ if (initFunc->func != NULL) {
(*initFunc->func)();
}
@@ -228,8 +194,7 @@ void func_800FCB34(void)
sInitFuncs = prev;
}
-void SystemHeap_Init(void *start, u32 size)
-{
+void SystemHeap_Init(void* start, u32 size) {
SystemArena_Init(start, size);
func_800FCB34();
-} \ No newline at end of file
+}
diff --git a/src/code/code_800FCE80.c b/src/code/code_800FCE80.c
index 60afd1dfb..5180c2444 100644
--- a/src/code/code_800FCE80.c
+++ b/src/code/code_800FCE80.c
@@ -4,65 +4,47 @@
s32 use_cfrac;
-f32 Math_tanf(f32 x)
-{
+f32 Math_tanf(f32 x) {
f32 sin = sinf(x);
f32 cos = cosf(x);
return sin / cos;
}
-f32 Math_floorf(f32 x)
-{
+f32 Math_floorf(f32 x) {
return floorf(x);
}
-f32 Math_ceilf(f32 x)
-{
+f32 Math_ceilf(f32 x) {
return ceilf(x);
}
-f32 Math_roundf(f32 x)
-{
+f32 Math_roundf(f32 x) {
return roundf(x);
}
-f32 Math_truncf(f32 x)
-{
+f32 Math_truncf(f32 x) {
return truncf(x);
}
-f32 Math_nearbyintf(f32 x)
-{
+f32 Math_nearbyintf(f32 x) {
return nearbyintf(x);
}
/* Arctangent approximation using a Taylor series (one quadrant) */
-f32 Math_atanf_taylor_q(f32 x)
-{
- static const f32 coeffs[] =
- {
- -1.f / 3,
- +1.f / 5,
- -1.f / 7,
- +1.f / 9,
- -1.f / 11,
- +1.f / 13,
- -1.f / 15,
- +1.f / 17,
- 0.f,
+f32 Math_atanf_taylor_q(f32 x) {
+ static const f32 coeffs[] = {
+ -1.f / 3, +1.f / 5, -1.f / 7, +1.f / 9, -1.f / 11, +1.f / 13, -1.f / 15, +1.f / 17, 0.f,
};
f32 poly = x;
f32 sq = SQ(x);
f32 exp = x * sq;
- const f32 *c = coeffs;
+ const f32* c = coeffs;
f32 term;
- while (1)
- {
+ while (1) {
term = *c++ * exp;
- if (poly + term == poly)
- {
+ if (poly + term == poly) {
break;
}
poly = poly + term;
@@ -73,157 +55,107 @@ f32 Math_atanf_taylor_q(f32 x)
}
/* Ditto for two quadrants */
-f32 Math_atanf_taylor(f32 x)
-{
+f32 Math_atanf_taylor(f32 x) {
f32 t;
f32 q;
- if (x > 0.f)
- {
+ if (x > 0.f) {
t = x;
- }
- else if (x < 0.f)
- {
+ } else if (x < 0.f) {
t = -x;
- }
- else if (x == 0.f)
- {
+ } else if (x == 0.f) {
return 0.f;
- }
- else
- {
+ } else {
return qNaN0x10000;
}
- if (t <= M_SQRT2 - 1.f)
- {
+ if (t <= M_SQRT2 - 1.f) {
return Math_atanf_taylor_q(x);
}
- if (t >= M_SQRT2 + 1.f)
- {
+ if (t >= M_SQRT2 + 1.f) {
q = M_PI / 2 - Math_atanf_taylor_q(1.f / t);
- }
- else
- {
+ } else {
q = M_PI / 4 - Math_atanf_taylor_q((1.f - t) / (1.f + t));
}
- if (x > 0.f)
- {
+ if (x > 0.f) {
return q;
- }
- else
- {
+ } else {
return -q;
}
}
/* Arctangent approximation using a continued fraction */
-f32 Math_atanf_cfrac(f32 x)
-{
+f32 Math_atanf_cfrac(f32 x) {
s32 sector;
f32 z;
f32 conv;
f32 sq;
s32 i;
- if (x >= -1.f && x <= 1.f)
- {
+ if (x >= -1.f && x <= 1.f) {
sector = 0;
- }
- else if (x > 1.f)
- {
+ } else if (x > 1.f) {
sector = 1;
x = 1.f / x;
- }
- else if (x < -1.f)
- {
+ } else if (x < -1.f) {
sector = -1;
x = 1.f / x;
- }
- else
- {
+ } else {
return qNaN0x10000;
}
sq = SQ(x);
conv = 0.f;
z = 8.f;
- for (i = 8; i != 0; i--)
- {
+ for (i = 8; i != 0; i--) {
conv = SQ(z) * sq / (2.f * z + 1.f + conv);
z -= 1.f;
}
conv = x / (1.f + conv);
- if (sector == 0)
- {
+ if (sector == 0) {
return conv;
- }
- else if (sector > 0)
- {
+ } else if (sector > 0) {
return M_PI / 2 - conv;
- }
- else
- {
+ } else {
return -M_PI / 2 - conv;
}
}
-f32 Math_atanf(f32 x)
-{
- if (use_cfrac == 0)
- {
+f32 Math_atanf(f32 x) {
+ if (use_cfrac == 0) {
return Math_atanf_taylor(x);
- }
- else
- {
+ } else {
return Math_atanf_cfrac(x);
}
}
-f32 Math_atan2f(f32 y, f32 x)
-{
- if (x == 0.f)
- {
- if (y == 0.f)
- {
+f32 Math_atan2f(f32 y, f32 x) {
+ if (x == 0.f) {
+ if (y == 0.f) {
return 0.f;
- }
- else if (y > 0.f)
- {
+ } else if (y > 0.f) {
return M_PI / 2;
- }
- else if (y < 0.f)
- {
+ } else if (y < 0.f) {
return -M_PI / 2;
- }
- else
- {
+ } else {
return qNaN0x10000;
}
- }
- else if (x >= 0.f)
- {
+ } else if (x >= 0.f) {
return Math_atanf(y / x);
- }
- else if (y < 0.f)
- {
+ } else if (y < 0.f) {
return Math_atanf(y / x) - M_PI;
- }
- else
- {
+ } else {
return M_PI - Math_atanf(-(y / x));
}
}
-f32 Math_asinf(f32 x)
-{
+f32 Math_asinf(f32 x) {
return Math_atan2f(x, sqrtf(1.f - SQ(x)));
}
-f32 Math_acosf(f32 x)
-{
+f32 Math_acosf(f32 x) {
return M_PI / 2 - Math_asinf(x);
}
diff --git a/src/code/db_camera.c b/src/code/db_camera.c
index e0580f6b7..b1e858e63 100644
--- a/src/code/db_camera.c
+++ b/src/code/db_camera.c
@@ -80,4 +80,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_800B958C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_800B9638.s")
-
diff --git a/src/code/debug_malloc.c b/src/code/debug_malloc.c
index 6e63e1c4a..789e382af 100644
--- a/src/code/debug_malloc.c
+++ b/src/code/debug_malloc.c
@@ -1,131 +1,112 @@
#include <global.h>
-#define LOG_SEVERITY_NOLOG 0
-#define LOG_SEVERITY_ERROR 2
-#define LOG_SEVERITY_VERBOSE 3
+#define LOG_SEVERITY_NOLOG 0
+#define LOG_SEVERITY_ERROR 2
+#define LOG_SEVERITY_VERBOSE 3
s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR;
Arena sDebugArena;
-void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action)
-{
- if (!ptr)
- {
- if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR)
- {
+void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
+ if (!ptr) {
+ if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) {
//"%s: %u bytes %s failed\n"
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
- __osDisplayArena(&sDebugArena);
+ __osDisplayArena(&sDebugArena);
return;
}
- }
- else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE)
- {
+ } else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
//"%s: %u bytes %s succeeded\n"
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
}
}
-void* DebugArena_Malloc(u32 size)
-{
+void* DebugArena_Malloc(u32 size) {
void* ptr;
ptr = __osMalloc(&sDebugArena, size);
- DebugArena_CheckPointer(ptr, size, "debug_malloc", "確保"); //Secure
+ DebugArena_CheckPointer(ptr, size, "debug_malloc", "確保"); // Secure
return ptr;
}
-void* DebugArena_MallocDebug(u32 size, const char* file, s32 line)
-{
+void* DebugArena_MallocDebug(u32 size, const char* file, s32 line) {
void* ptr;
ptr = __osMallocDebug(&sDebugArena, size, file, line);
- DebugArena_CheckPointer(ptr, size, "debug_malloc_DEBUG", "確保"); //Secure
+ DebugArena_CheckPointer(ptr, size, "debug_malloc_DEBUG", "確保"); // Secure
return ptr;
}
-void* DebugArena_MallocR(u32 size)
-{
+void* DebugArena_MallocR(u32 size) {
void* ptr;
ptr = __osMallocR(&sDebugArena, size);
- DebugArena_CheckPointer(ptr, size, "debug_malloc_r", "確保"); //Secure
+ DebugArena_CheckPointer(ptr, size, "debug_malloc_r", "確保"); // Secure
return ptr;
}
-void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line)
-{
+void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line) {
void* ptr;
ptr = __osMallocRDebug(&sDebugArena, size, file, line);
- DebugArena_CheckPointer(ptr, size, "debug_malloc_r_DEBUG", "確保"); //Secure
+ DebugArena_CheckPointer(ptr, size, "debug_malloc_r_DEBUG", "確保"); // Secure
return ptr;
}
-void* DebugArena_Realloc(void* ptr, u32 newSize)
-{
+void* DebugArena_Realloc(void* ptr, u32 newSize) {
ptr = __osRealloc(&sDebugArena, ptr, newSize);
DebugArena_CheckPointer(ptr, newSize, "debug_realloc", "再確保"); // Re-securing
return ptr;
}
-void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line)
-{
+void* DebugArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
ptr = __osReallocDebug(&sDebugArena, ptr, newSize, file, line);
DebugArena_CheckPointer(ptr, newSize, "debug_realloc_DEBUG", "再確保"); // Re-securing
return ptr;
}
-void DebugArena_Free(void* ptr)
-{
+void DebugArena_Free(void* ptr) {
__osFree(&sDebugArena, ptr);
}
-void DebugArena_FreeDebug(void* ptr, const char* file, s32 line)
-{
+void DebugArena_FreeDebug(void* ptr, const char* file, s32 line) {
__osFreeDebug(&sDebugArena, ptr, file, line);
}
-void* DebugArena_Calloc(u32 num, u32 size)
-{
+void* DebugArena_Calloc(u32 num, u32 size) {
void* ret;
u32 n;
-
- n = num*size;
+
+ n = num * size;
ret = __osMalloc(&sDebugArena, n);
- if (ret)
+ if (ret) {
bzero(ret, n);
+ }
DebugArena_CheckPointer(ret, n, "debug_calloc", "確保");
return ret;
}
-void DebugArena_Display()
-{
- //Zelda heap display (devs forgot to change "Zelda" to "Debug" apparently)
+void DebugArena_Display() {
+ // Zelda heap display (devs forgot to change "Zelda" to "Debug" apparently)
osSyncPrintf("ゼルダヒープ表示\n");
__osDisplayArena(&sDebugArena);
}
-void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc)
-{
+void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
ArenaImpl_GetSizes(&sDebugArena, outMaxFree, outFree, outAlloc);
}
-void DebugArena_Check()
-{
+void DebugArena_Check() {
__osCheckArena(&sDebugArena);
}
-void DebugArena_Init(void* start, u32 size)
-{
+void DebugArena_Init(void* start, u32 size) {
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocInit(&sDebugArena, start, size);
}
-void DebugArena_Cleanup()
-{
+void DebugArena_Cleanup() {
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocCleanup(&sDebugArena);
}
-u8 DebugArena_IsInitalized()
-{
+u8 DebugArena_IsInitalized() {
return __osMallocIsInitalized(&sDebugArena);
}
diff --git a/src/code/fault.c b/src/code/fault.c
index 4af2d6c60..7884c5057 100644
--- a/src/code/fault.c
+++ b/src/code/fault.c
@@ -3,9 +3,8 @@
#include <alloca.h>
#include <vt.h>
-//data
-const char* sExceptionNames[] =
-{
+// data
+const char* sExceptionNames[] = {
"Interrupt",
"TLB modification",
"TLB exception on load",
@@ -32,7 +31,7 @@ const char* sExceptionNames[] =
"Inexact operation",
};
-//bss
+// bss
FaultThreadStruct* sFaultStructPtr;
u8 sFaultIsWaitingForInput;
char sFaultStack[0x600];
@@ -41,23 +40,22 @@ FaultThreadStruct gFaultStruct;
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/pad_800D3F10.s")
-void Fault_SleepImpl(u32 duration)
-{
+void Fault_SleepImpl(u32 duration) {
u64 value = (duration * OS_CPU_COUNTER) / 1000ull;
func_800FF3A0(value);
}
-void Fault_ClientProcessThread(FaultClientContext* ctx)
-{
- if (ctx->callback)
+void Fault_ClientProcessThread(FaultClientContext* ctx) {
+ if (ctx->callback) {
ctx->ret = ctx->callback(ctx->param0, ctx->param1);
+ }
- if (ctx->queue)
+ if (ctx->queue) {
osSendMesg(ctx->queue, ctx->msg, 1);
+ }
}
-void Fault_ProcessClientContext(FaultClientContext* ctx)
-{
+void Fault_ProcessClientContext(FaultClientContext* ctx) {
OSMesgQueue queue;
OSMesg msg;
OSMesg recMsg;
@@ -72,27 +70,23 @@ void Fault_ProcessClientContext(FaultClientContext* ctx)
ctx->queue = &queue;
ctx->msg = NULL;
- if (sFaultStructPtr->currClientThreadSp != 0)
- {
+ if (sFaultStructPtr->currClientThreadSp != 0) {
thread = alloca(sizeof(OSThread));
osCreateThread(thread, 2, Fault_ClientProcessThread, ctx, sFaultStructPtr->currClientThreadSp, 0x7E);
osStartThread(thread);
- }
- else
- {
+ } else {
Fault_ClientProcessThread(ctx);
}
- while (true)
- {
+ while (true) {
osSetTimer(&timer, OS_USEC_TO_CYCLES(1000000), 0, &queue, (OSMesg)timerMsgVal);
osRecvMesg(&queue, &recMsg, 1);
- if (recMsg != (OSMesg)666)
+ if (recMsg != (OSMesg)666) {
break;
+ }
- if (!sFaultIsWaitingForInput)
- {
+ if (!sFaultIsWaitingForInput) {
ctx->ret = -1;
break;
}
@@ -100,15 +94,13 @@ void Fault_ProcessClientContext(FaultClientContext* ctx)
osStopTimer(&timer);
- if (thread != NULL)
- {
+ if (thread != NULL) {
osStopThread(thread);
osDestroyThread(thread);
}
}
-u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1)
-{
+u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1) {
FaultClientContext a;
a.callback = callback;
a.param0 = param0;
@@ -120,8 +112,7 @@ u32 Fault_ProcessClient(u32 callback, u32 param0, u32 param1)
#ifdef NON_MATCHING
// minor ordering differences
-void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1)
-{
+void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* param1) {
OSIntMask mask;
u32 alreadyExists;
FaultClient* iter;
@@ -130,10 +121,8 @@ void Fault_AddClient(FaultClient* client, void* callback, void* param0, void* pa
mask = osSetIntMask(1);
iter = sFaultStructPtr->clients;
- while (iter)
- {
- if (iter == client)
- {
+ while (iter) {
+ if (iter == client) {
alreadyExists = true;
goto end;
}
@@ -188,8 +177,9 @@ void Fault_RemoveClient(FaultClient* client) {
osSetIntMask(mask);
- if (listIsEmpty)
+ if (listIsEmpty) {
osSyncPrintf(VT_COL(RED, WHITE) "fault_RemoveClient: %08x リスト不整合です\n" VT_RST, client);
+ }
}
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_AddAddrConvClient.s")
@@ -228,24 +218,23 @@ void Fault_RemoveAddrConvClient(FaultAddrConvClient* client) {
osSetIntMask(mask);
if (listIsEmpty) {
- osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST, client);
+ osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST,
+ client);
}
}
-u32 Fault_ConvertAddress(FaultAddrConvClient* client)
-{
+u32 Fault_ConvertAddress(FaultAddrConvClient* client) {
u32 ret;
FaultAddrConvClient* iter = sFaultStructPtr->addrConvClients;
- while(iter)
- {
- if (iter->callback)
- {
+ while (iter) {
+ if (iter->callback) {
ret = Fault_ProcessClient(iter->callback, client, iter->param);
- if (ret == -1)
+ if (ret == -1) {
Fault_RemoveAddrConvClient(iter);
- else if (ret)
+ } else if (ret) {
return ret;
+ }
}
iter = iter->next;
}
@@ -253,35 +242,29 @@ u32 Fault_ConvertAddress(FaultAddrConvClient* client)
return 0;
}
-void Fault_Sleep(u32 duration)
-{
+void Fault_Sleep(u32 duration) {
Fault_SleepImpl(duration);
}
-void Fault_PadCallback(Input* input)
-{
- //BUG: this function is not called correctly and thus will crash from reading a bad pointer at 0x800C7E4C
+void Fault_PadCallback(Input* input) {
+ // BUG: this function is not called correctly and thus will crash from reading a bad pointer at 0x800C7E4C
func_800C7E08(input, 0);
}
-void Fault_UpdatePadImpl()
-{
+void Fault_UpdatePadImpl() {
sFaultStructPtr->padCallback(&sFaultStructPtr->padInput);
}
#ifdef NON_MATCHING
// ordering differences and possibly regalloc
-u32 Fault_WaitForInputImpl()
-{
+u32 Fault_WaitForInputImpl() {
u16 kDown;
u32 exitDebugger;
s32 count = 600;
Input* curInput = &sFaultStructPtr->padInput;
- while (true)
- {
- while (true)
- {
+ while (true) {
+ while (true) {
Fault_Sleep(0x10);
Fault_UpdatePadImpl();
@@ -316,71 +299,63 @@ u32 Fault_WaitForInputImpl()
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_WaitForInputImpl.s")
#endif
-void Fault_WaitForInput()
-{
+void Fault_WaitForInput() {
sFaultIsWaitingForInput = 1;
Fault_WaitForInputImpl();
sFaultIsWaitingForInput = 0;
}
-void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color)
-{
+void Fault_DrawRec(s32 x, s32 y, s32 w, s32 h, u16 color) {
FaultDrawer_DrawRecImpl(x, y, x + w - 1, y + h - 1, color);
}
-void Fault_FillScreenBlack()
-{
+void Fault_FillScreenBlack() {
FaultDrawer_SetForeColor(0xFFFF);
FaultDrawer_SetBackColor(1);
FaultDrawer_FillScreen();
FaultDrawer_SetBackColor(0);
}
-void Fault_FillScreenRed()
-{
+void Fault_FillScreenRed() {
FaultDrawer_SetForeColor(0xFFFF);
FaultDrawer_SetBackColor(0xF001);
FaultDrawer_FillScreen();
FaultDrawer_SetBackColor(0);
}
-void Fault_DrawCornerRec(u16 color)
-{
+void Fault_DrawCornerRec(u16 color) {
Fault_DrawRec(0x16, 0x10, 8, 1, color);
}
-void Fault_PrintFReg(s32 idx, f32* value)
-{
+void Fault_PrintFReg(s32 idx, f32* value) {
u32 raw = *(u32*)value;
s32 v0 = ((raw & 0x7f800000) >> 0x17) - 0x7f;
- if ((v0 >= -0x7e && v0 < 0x80) || raw == 0)
+ if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) {
FaultDrawer_Printf("F%02d:%14.7e ", idx, *value);
- else
+ } else {
FaultDrawer_Printf("F%02d: %08x(16) ", idx, raw);
+ }
}
-void Fault_LogFReg(s32 idx, f32* value)
-{
+void Fault_LogFReg(s32 idx, f32* value) {
u32 raw = *(u32*)value;
s32 v0 = ((raw & 0x7f800000) >> 0x17) - 0x7f;
- if ((v0 >= -0x7e && v0 < 0x80) || raw == 0)
+ if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) {
osSyncPrintf("F%02d:%14.7e ", idx, *value);
- else
+ } else {
osSyncPrintf("F%02d: %08x(16) ", idx, *(u32*)value);
+ }
}
-void Fault_PrintFPCR(u32 value)
-{
+void Fault_PrintFPCR(u32 value) {
s32 i;
u32 flag = 0x20000;
FaultDrawer_Printf("FPCSR:%08xH ", value);
- for (i = 0; i < 6; i++)
- {
- if (value & flag)
- {
- FaultDrawer_Printf("(%s)", sExceptionNames[i+18]);
+ for (i = 0; i < 6; i++) {
+ if (value & flag) {
+ FaultDrawer_Printf("(%s)", sExceptionNames[i + 18]);
break;
}
flag >>= 1;
@@ -388,30 +363,28 @@ void Fault_PrintFPCR(u32 value)
FaultDrawer_Printf("\n");
}
-void Fault_LogFPCR(u32 value)
-{
+void Fault_LogFPCR(u32 value) {
s32 i;
u32 flag = 0x20000;
osSyncPrintf("FPCSR:%08xH ", value);
- for (i = 0; i < 6; i++)
- {
- if (value & flag)
- {
- osSyncPrintf("(%s)\n", sExceptionNames[i+18]);
+ for (i = 0; i < 6; i++) {
+ if (value & flag) {
+ osSyncPrintf("(%s)\n", sExceptionNames[i + 18]);
break;
}
flag >>= 1;
}
}
-void Fault_PrintThreadContext(OSThread* t)
-{
- __OSThreadContext *ctx;
- s32 causeStrIdx = (s32) ((((u32) t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
- if (causeStrIdx == 0x17)
+void Fault_PrintThreadContext(OSThread* t) {
+ __OSThreadContext* ctx;
+ s32 causeStrIdx = (s32)((((u32)t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
+ if (causeStrIdx == 0x17) {
causeStrIdx = 0x10;
- if (causeStrIdx == 0x1f)
+ }
+ if (causeStrIdx == 0x1f) {
causeStrIdx = 0x11;
+ }
FaultDrawer_FillScreen();
FaultDrawer_SetCharPad(-2, 4);
@@ -462,14 +435,15 @@ void Fault_PrintThreadContext(OSThread* t)
FaultDrawer_SetCharPad(0, 0);
}
-void Fault_LogThreadContext(OSThread* t)
-{
- __OSThreadContext *ctx;
- s32 causeStrIdx = (s32) ((((u32) t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
- if (causeStrIdx == 0x17)
+void Fault_LogThreadContext(OSThread* t) {
+ __OSThreadContext* ctx;
+ s32 causeStrIdx = (s32)((((u32)t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
+ if (causeStrIdx == 0x17) {
causeStrIdx = 0x10;
- if (causeStrIdx == 0x1f)
+ }
+ if (causeStrIdx == 0x1f) {
causeStrIdx = 0x11;
+ }
ctx = &t->context;
osSyncPrintf("\n");
@@ -515,26 +489,23 @@ void Fault_LogThreadContext(OSThread* t)
osSyncPrintf("\n");
}
-OSThread* Fault_FindFaultedThread()
-{
+OSThread* Fault_FindFaultedThread() {
OSThread* iter = func_80104140();
- while (iter->priority != -1)
- {
- if (iter->priority > 0 && iter->priority < 0x7f && (iter->flags & 3))
+ while (iter->priority != -1) {
+ if (iter->priority > 0 && iter->priority < 0x7f && (iter->flags & 3)) {
return iter;
+ }
iter = iter->tlnext;
}
return NULL;
}
-void Fault_Wait5Seconds(void)
-{
- OSTime start[2]; //to make the function allocate 0x28 bytes of stack instead of 0x20
+void Fault_Wait5Seconds(void) {
+ OSTime start[2]; // to make the function allocate 0x28 bytes of stack instead of 0x20
start[0] = osGetTime();
- do
- {
+ do {
Fault_Sleep(0x10);
- } while ((osGetTime() - start[0]) < OS_USEC_TO_CYCLES(5000000)+1); //0xdf84759
+ } while ((osGetTime() - start[0]) < OS_USEC_TO_CYCLES(5000000) + 1); // 0xdf84759
sFaultStructPtr->faultActive = true;
}
@@ -561,7 +532,7 @@ void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3) {
Fault_FillScreenBlack();
FaultDrawer_SetCharPad(-2, 0);
- FaultDrawer_DrawText(0x24, 0x12, "%s %08x", title? title : "PrintDump", alignedAddr);
+ FaultDrawer_DrawText(0x24, 0x12, "%s %08x", title ? title : "PrintDump", alignedAddr);
if (alignedAddr >= (u32*)0x80000000 && alignedAddr < (u32*)0xC0000000) {
for (y = 0x1C; y != 0xE2; y += 9) {
FaultDrawer_DrawText(0x18, y, "%06x", writeAddr);
@@ -577,15 +548,13 @@ void Fault_DrawMemDumpPage(const char* title, u32* addr, u32 param_3) {
#ifdef NON_MATCHING
// saved register and stack usage differences
// possibly some minor ordering and regalloc differences
-void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
-{
+void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) {
Input* curInput = &sFaultStructPtr->padInput;
u32 addr = pc;
s32 count;
s32 off;
- while (true)
- {
+ while (true) {
if (addr < 0x80000000)
addr = 0x80000000;
if (addr > 0x807fff00)
@@ -595,8 +564,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
Fault_DrawMemDumpPage("Dump", (u32*)addr, 0);
count = 600;
- while (sFaultStructPtr->faultActive)
- {
+ while (sFaultStructPtr->faultActive) {
if (count == 0)
return;
@@ -607,8 +575,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
sFaultStructPtr->faultActive = false;
}
- do
- {
+ do {
Fault_Sleep(0x10);
Fault_UpdatePadImpl();
} while (curInput->padPressed == 0);
@@ -652,8 +619,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1)
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_LogStackTrace.s")
-void Fault_ResumeThread(OSThread* t)
-{
+void Fault_ResumeThread(OSThread* t) {
t->context.cause = 0;
t->context.fpcsr = 0;
t->context.pc += 4;
@@ -663,39 +629,39 @@ void Fault_ResumeThread(OSThread* t)
osStartThread(t);
}
-void Fault_CommitFB()
-{
+void Fault_CommitFB() {
u16* fb;
osViSetYScale(1.0f);
osViSetMode(&osViModeNtscLan1);
- osViSetSpecialFeatures(0x42); //gama_disable|dither_fliter_enable_aa_mode3_disable
+ osViSetSpecialFeatures(0x42); // gama_disable|dither_fliter_enable_aa_mode3_disable
osViBlack(false);
- if (sFaultStructPtr->fb)
+ if (sFaultStructPtr->fb) {
fb = sFaultStructPtr->fb;
- else
- {
+ } else {
fb = (u16*)osViGetNextFramebuffer();
- if ((u32)fb == 0x80000000)
+ if ((u32)fb == 0x80000000) {
fb = (u16*)((osMemSize | 0x80000000) - 0x25800);
+ }
}
osViSwapBuffer(fb);
FaultDrawer_SetDrawerFB(fb, 0x140, 0xf0);
}
-void Fault_ProcessClients(void)
-{
+void Fault_ProcessClients(void) {
FaultClient* iter = sFaultStructPtr->clients;
s32 idx = 0;
- while(iter)
- {
- if (iter->callback)
- {
+ while (iter) {
+ if (iter->callback) {
Fault_FillScreenBlack();
FaultDrawer_SetCharPad(-2, 0);
- FaultDrawer_Printf("\x1a""8CallBack (%d) %08x %08x %08x\n""\x1a""7", idx++, iter, iter->param1, iter->param2);
+ FaultDrawer_Printf("\x1a"
+ "8CallBack (%d) %08x %08x %08x\n"
+ "\x1a"
+ "7",
+ idx++, iter, iter->param1, iter->param2);
FaultDrawer_SetCharPad(0, 0);
Fault_ProcessClient(iter->callback, iter->param1, iter->param2);
Fault_WaitForInput();
@@ -705,45 +671,34 @@ void Fault_ProcessClients(void)
}
}
-void Fault_UpdatePad()
-{
+void Fault_UpdatePad() {
Fault_UpdatePadImpl();
}
#ifdef NON_MATCHING
// saved register and stack usage differences
-void Fault_ThreadEntry(void* arg)
-{
+void Fault_ThreadEntry(void* arg) {
OSThread* faultedThread;
OSMesg msg;
osSetEventMesg(OS_EVENT_CPU_BREAK, &sFaultStructPtr->queue, 1);
osSetEventMesg(OS_EVENT_FAULT, &sFaultStructPtr->queue, 2);
- while (true)
- {
- do
- {
+ while (true) {
+ do {
osRecvMesg(&sFaultStructPtr->queue, &msg, 1);
- if (msg == (OSMesg)1)
- {
+ if (msg == (OSMesg)1) {
sFaultStructPtr->msgId = 1;
osSyncPrintf("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n");
- }
- else if (1 && msg == (OSMesg)2)
- {
+ } else if (1 && msg == (OSMesg)2) {
sFaultStructPtr->msgId = 2;
osSyncPrintf("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n");
- }
- else if (msg == (OSMesg)3)
- {
+ } else if (msg == (OSMesg)3) {
Fault_UpdatePad();
faultedThread = NULL;
continue;
- }
- else
- {
+ } else {
sFaultStructPtr->msgId = 3;
osSyncPrintf("フォルトマネージャ:不明なメッセージを受信しました\n");
}
@@ -751,8 +706,7 @@ void Fault_ThreadEntry(void* arg)
faultedThread = __osGetCurrFaultedThread();
osSyncPrintf("__osGetCurrFaultedThread()=%08x\n", faultedThread);
- if (faultedThread == NULL)
- {
+ if (faultedThread == NULL) {
faultedThread = Fault_FindFaultedThread();
osSyncPrintf("FindFaultedThread()=%08x\n", faultedThread);
}
@@ -769,8 +723,7 @@ void Fault_ThreadEntry(void* arg)
if (sFaultStructPtr->faultActive)
Fault_Wait5Seconds();
- else
- {
+ else {
Fault_DrawCornerRec(0xF801);
Fault_WaitForButtonCombo();
}
@@ -779,8 +732,7 @@ void Fault_ThreadEntry(void* arg)
FaultDrawer_SetForeColor(0xFFFF);
FaultDrawer_SetBackColor(0);
- do
- {
+ do {
Fault_PrintThreadContext(faultedThread);
Fault_LogThreadContext(faultedThread);
Fault_WaitForInput();
@@ -799,10 +751,7 @@ void Fault_ThreadEntry(void* arg)
Fault_WaitForInput();
} while (!sFaultStructPtr->exitDebugger);
- while (!sFaultStructPtr->exitDebugger)
- {
-
- }
+ while (!sFaultStructPtr->exitDebugger) {}
Fault_ResumeThread(faultedThread);
}
@@ -811,14 +760,12 @@ void Fault_ThreadEntry(void* arg)
#pragma GLOBAL_ASM("asm/non_matchings/code/fault/Fault_ThreadEntry.s")
#endif
-void Fault_SetFB(void* fb, u16 w, u16 h)
-{
+void Fault_SetFB(void* fb, u16 w, u16 h) {
sFaultStructPtr->fb = fb;
FaultDrawer_SetDrawerFB(fb, w, h);
}
-void Fault_Start(void)
-{
+void Fault_Start(void) {
sFaultStructPtr = &gFaultStruct;
bzero(sFaultStructPtr, sizeof(FaultThreadStruct));
FaultDrawer_SetDefault();
@@ -832,13 +779,12 @@ void Fault_Start(void)
sFaultStructPtr->faultActive = false;
gFaultStruct.faultHandlerEnabled = true;
osCreateMesgQueue(&sFaultStructPtr->queue, &sFaultStructPtr->msg, 1);
- StackCheck_Init(sFaultThreadInfo, &sFaultStack, sFaultStack+sizeof(sFaultStack), 0, 0x100, "fault");
+ StackCheck_Init(sFaultThreadInfo, &sFaultStack, sFaultStack + sizeof(sFaultStack), 0, 0x100, "fault");
osCreateThread(&sFaultStructPtr->thread, 2, &Fault_ThreadEntry, 0, sFaultThreadInfo, 0x7f);
osStartThread(&sFaultStructPtr->thread);
}
-void Fault_HangupFaultClient(const char* arg0, const char* arg1)
-{
+void Fault_HangupFaultClient(const char* arg0, const char* arg1) {
osSyncPrintf("HungUp on Thread %d\n", osGetThreadId(0));
osSyncPrintf("%s\n", arg0 ? arg0 : "(NULL)");
osSyncPrintf("%s\n", arg1 ? arg1 : "(NULL)");
@@ -847,16 +793,14 @@ void Fault_HangupFaultClient(const char* arg0, const char* arg1)
FaultDrawer_Printf("%s\n", arg1 ? arg1 : "(NULL)");
}
-void Fault_AddHungupAndCrashImpl(const char* arg0, const char* arg1)
-{
+void Fault_AddHungupAndCrashImpl(const char* arg0, const char* arg1) {
FaultClient client;
char padd[4];
Fault_AddClient(&client, &Fault_HangupFaultClient, arg0, arg1);
- *(u32*)0x11111111 = 0; //trigger an exception
+ *(u32*)0x11111111 = 0; // trigger an exception
}
-void Fault_AddHungupAndCrash(const char* filename, u32 line)
-{
+void Fault_AddHungupAndCrash(const char* filename, u32 line) {
char msg[256];
sprintf(msg, "HungUp %s:%d", filename, line);
Fault_AddHungupAndCrashImpl(msg, NULL);
diff --git a/src/code/fault_drawer.c b/src/code/fault_drawer.c
index 82a7e83b0..8d85af18b 100644
--- a/src/code/fault_drawer.c
+++ b/src/code/fault_drawer.c
@@ -2,77 +2,72 @@
#include <global.h>
#include <vt.h>
-//rodata
+// rodata
const u32 sFaultDrawerFont[] = {
- 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700,
- 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000,
- 0x08BFFB00, 0x0EFFFFC0, 0x0BF00FB0, 0x0FF00330, 0x0FF00FF0, 0x0FF00220, 0x0CFBBF60, 0x0FFCCE20,
- 0x0DD44FF0, 0x0FF00220, 0x0FF00FF0, 0x0FF00330, 0x0CFBBF40, 0x0EF77740, 0x00000000, 0x00000000,
- 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700,
- 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000,
- 0x08BFFB00, 0x000DE000, 0x0BF00FB0, 0x005DE600, 0x0FF00FF0, 0x055CC660, 0x0CFBBF60, 0x773FF377,
- 0x0DD44FF0, 0xBB3FF3BB, 0x0FF00FF0, 0x099CCAA0, 0x0CFBBF40, 0x009DEA00, 0x00000000, 0x000DE000,
- 0x04C22C40, 0x028D5020, 0x0CCAACC0, 0x21F91710, 0x04C22C40, 0x12493400, 0x00820800, 0x01975110,
- 0x088A8880, 0x04615241, 0x00800800, 0x43117530, 0x00A20800, 0x60055600, 0x00000000, 0x04400040,
- 0x00221100, 0x00000080, 0x000FB000, 0x00000880, 0x040DA400, 0x00008800, 0x08CDE880, 0x022AA220,
- 0x08CDE880, 0x02AA2220, 0x040DA400, 0x0CD10000, 0x000FB000, 0x8C510000, 0x00221100, 0x81100000,
- 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700,
- 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000,
- 0x00333300, 0x04489980, 0x033CC330, 0x00CD1088, 0x033CC330, 0x02BF62A8, 0x00333320, 0x01104C80,
- 0x01100330, 0x0015C800, 0x033CC330, 0x02673220, 0x003FF300, 0x04409900, 0x00880000, 0x00000000,
- 0x05DFFD10, 0x07FFFF60, 0x1CE00EC1, 0x0FF00990, 0x1EE11661, 0x0FF00110, 0x1EF45621, 0x0FF66710,
- 0x1EF23661, 0x0FF08990, 0x1EF10FE1, 0x0FF00990, 0x16ECCE21, 0x07FBBB20, 0x01111110, 0x00000000,
- 0x09B66FD0, 0x27D88E60, 0x0992ED10, 0x2FF02EE0, 0x099AE510, 0x2FF62EE0, 0x099B7510, 0x2FD64EE0,
- 0x0DDAE510, 0x2FD04EE0, 0x0DD2ED10, 0x2FD00EE0, 0x09F66F90, 0x27D99F70, 0x00000000, 0x00000000,
- 0x07FFFF00, 0x8F711FF0, 0x2FD00FF0, 0x8F711FF0, 0x2FD00770, 0x8E611EE0, 0x27DDDF60, 0x8E691EE0,
- 0x27764AA0, 0x8EE99EE0, 0x2FD06E80, 0x8AE7FEA0, 0x07FA8E60, 0x88277A80, 0x00000000, 0x00000000,
- 0x077CCFF0, 0x13266011, 0x077CCFF0, 0x03766510, 0x0239D720, 0x04533540, 0x002FF200, 0x01133110,
- 0x005FB100, 0x00033000, 0x055EE550, 0x01133110, 0x055EEDD0, 0x02233000, 0x00088880, 0x8AABB888,
- 0x00001100, 0x00044510, 0x04623320, 0x00440110, 0x04C89AA0, 0x00EEAB10, 0x0CE66720, 0x0EF55FB0,
- 0x0EE00660, 0x0BF62B90, 0x0EE00660, 0x03FC8990, 0x04EEEEA0, 0x00773BB0, 0x00000000, 0x08888800,
- 0x09900000, 0x00111000, 0x09922440, 0x00011000, 0x09908800, 0x26EFDE20, 0x099BB540, 0x2EC33CE2,
- 0x0D9A2550, 0x2EC33CE2, 0x0DDAA550, 0x2EC33CE2, 0x09D6ED10, 0x26CBBC62, 0x00000000, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0x00011000, 0x05FBFFE0, 0x8E6116E8, 0x0FF40330, 0x8F7117F8,
- 0x07FC8B30, 0x8E6996E8, 0x05733BA0, 0x8A6DD6A8, 0x0DD88A20, 0x08A779B2, 0x01100220, 0x00000000,
- 0x00000080, 0x8A011000, 0x00000800, 0x80A11000, 0x07744F70, 0x80A99000, 0x0231DF20, 0x84E60004,
- 0x0027DA20, 0xC8AA4C40, 0x00573B20, 0x00A11800, 0x05546F50, 0x00A99800, 0x02222080, 0x02001888,
+ 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990,
+ 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, 0x08BFFB00, 0x0EFFFFC0,
+ 0x0BF00FB0, 0x0FF00330, 0x0FF00FF0, 0x0FF00220, 0x0CFBBF60, 0x0FFCCE20, 0x0DD44FF0, 0x0FF00220, 0x0FF00FF0,
+ 0x0FF00330, 0x0CFBBF40, 0x0EF77740, 0x00000000, 0x00000000, 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0, 0x06611DC0,
+ 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, 0x05589760, 0x0DD22990, 0x05599770, 0x04DFFD40,
+ 0x026EF700, 0x00000000, 0x00000000, 0x08BFFB00, 0x000DE000, 0x0BF00FB0, 0x005DE600, 0x0FF00FF0, 0x055CC660,
+ 0x0CFBBF60, 0x773FF377, 0x0DD44FF0, 0xBB3FF3BB, 0x0FF00FF0, 0x099CCAA0, 0x0CFBBF40, 0x009DEA00, 0x00000000,
+ 0x000DE000, 0x04C22C40, 0x028D5020, 0x0CCAACC0, 0x21F91710, 0x04C22C40, 0x12493400, 0x00820800, 0x01975110,
+ 0x088A8880, 0x04615241, 0x00800800, 0x43117530, 0x00A20800, 0x60055600, 0x00000000, 0x04400040, 0x00221100,
+ 0x00000080, 0x000FB000, 0x00000880, 0x040DA400, 0x00008800, 0x08CDE880, 0x022AA220, 0x08CDE880, 0x02AA2220,
+ 0x040DA400, 0x0CD10000, 0x000FB000, 0x8C510000, 0x00221100, 0x81100000, 0x00DFFD00, 0x0AEEFFA0, 0x0DF22DD0,
+ 0x06611DC0, 0x01122DD0, 0x06719900, 0x011EED10, 0x077EF700, 0x01562990, 0x05589760, 0x0DD22990, 0x05599770,
+ 0x04DFFD40, 0x026EF700, 0x00000000, 0x00000000, 0x00333300, 0x04489980, 0x033CC330, 0x00CD1088, 0x033CC330,
+ 0x02BF62A8, 0x00333320, 0x01104C80, 0x01100330, 0x0015C800, 0x033CC330, 0x02673220, 0x003FF300, 0x04409900,
+ 0x00880000, 0x00000000, 0x05DFFD10, 0x07FFFF60, 0x1CE00EC1, 0x0FF00990, 0x1EE11661, 0x0FF00110, 0x1EF45621,
+ 0x0FF66710, 0x1EF23661, 0x0FF08990, 0x1EF10FE1, 0x0FF00990, 0x16ECCE21, 0x07FBBB20, 0x01111110, 0x00000000,
+ 0x09B66FD0, 0x27D88E60, 0x0992ED10, 0x2FF02EE0, 0x099AE510, 0x2FF62EE0, 0x099B7510, 0x2FD64EE0, 0x0DDAE510,
+ 0x2FD04EE0, 0x0DD2ED10, 0x2FD00EE0, 0x09F66F90, 0x27D99F70, 0x00000000, 0x00000000, 0x07FFFF00, 0x8F711FF0,
+ 0x2FD00FF0, 0x8F711FF0, 0x2FD00770, 0x8E611EE0, 0x27DDDF60, 0x8E691EE0, 0x27764AA0, 0x8EE99EE0, 0x2FD06E80,
+ 0x8AE7FEA0, 0x07FA8E60, 0x88277A80, 0x00000000, 0x00000000, 0x077CCFF0, 0x13266011, 0x077CCFF0, 0x03766510,
+ 0x0239D720, 0x04533540, 0x002FF200, 0x01133110, 0x005FB100, 0x00033000, 0x055EE550, 0x01133110, 0x055EEDD0,
+ 0x02233000, 0x00088880, 0x8AABB888, 0x00001100, 0x00044510, 0x04623320, 0x00440110, 0x04C89AA0, 0x00EEAB10,
+ 0x0CE66720, 0x0EF55FB0, 0x0EE00660, 0x0BF62B90, 0x0EE00660, 0x03FC8990, 0x04EEEEA0, 0x00773BB0, 0x00000000,
+ 0x08888800, 0x09900000, 0x00111000, 0x09922440, 0x00011000, 0x09908800, 0x26EFDE20, 0x099BB540, 0x2EC33CE2,
+ 0x0D9A2550, 0x2EC33CE2, 0x0DDAA550, 0x2EC33CE2, 0x09D6ED10, 0x26CBBC62, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00011000, 0x05FBFFE0, 0x8E6116E8, 0x0FF40330, 0x8F7117F8, 0x07FC8B30, 0x8E6996E8,
+ 0x05733BA0, 0x8A6DD6A8, 0x0DD88A20, 0x08A779B2, 0x01100220, 0x00000000, 0x00000080, 0x8A011000, 0x00000800,
+ 0x80A11000, 0x07744F70, 0x80A99000, 0x0231DF20, 0x84E60004, 0x0027DA20, 0xC8AA4C40, 0x00573B20, 0x00A11800,
+ 0x05546F50, 0x00A99800, 0x02222080, 0x02001888,
};
-//data
-FaultDrawer sFaultDrawerDefault =
-{
- (u16*)0x803DA800, //fb
- 320, 240, //w, h
- 16, 223, //yStart, yEnd
- 22, 297,//xStart, xEnd
- 0xFFFF, 0x0000, //foreColor, backColor
- 22, 16, //cursorX, cursorY
- sFaultDrawerFont, //font
+// data
+// clang-format off
+FaultDrawer sFaultDrawerDefault = {
+ (u16*)0x803DA800, // fb
+ 320, 240, // w, h
+ 16, 223, // yStart, yEnd
+ 22, 297, // xStart, xEnd
+ 0xFFFF, 0x0000, // foreColor, backColor
+ 22, 16, // cursorX, cursorY
+ sFaultDrawerFont, // font
8, 8, 0, 0,
- { //printColors
+ { // printColors
0x0001, 0xF801, 0x07C1, 0xFFC1,
0x003F, 0xF83F, 0x07FF, 0xFFFF,
0x7BDF, 0xB5AD
},
- 0, //escCode
- 0, //osSyncPrintfEnabled
- NULL, //inputCallback
+ 0, // escCode
+ 0, // osSyncPrintfEnabled
+ NULL, // inputCallback
};
+// clang-format on
-//bss
+// bss
FaultDrawer sFaultDrawerStruct;
char D_8016B6C0[0x20]; //? unused
-void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled)
-{
+void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {
sFaultDrawerStruct.osSyncPrintfEnabled = enabled;
}
#ifdef NON_MATCHING
-void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 color)
-{
- if (sFaultDrawerStruct.w - xstart > 0 && sFaultDrawerStruct.h - ystart > 0)
- {
+void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 color) {
+ if (sFaultDrawerStruct.w - xstart > 0 && sFaultDrawerStruct.h - ystart > 0) {
s32 x, y;
for (y = 0; y <= yend - ystart; y++)
@@ -88,8 +83,7 @@ void FaultDrawer_DrawRecImpl(s32 xstart, s32 ystart, s32 xend, s32 yend, u16 col
#ifdef NON_MATCHING
// regalloc and minor ordering differences
-void FaultDrawer_DrawChar(char c)
-{
+void FaultDrawer_DrawChar(char c) {
s32 x, y;
u32* dataPtr;
u16* fb;
@@ -102,14 +96,11 @@ void FaultDrawer_DrawChar(char c)
if ((sFaultDrawerStruct.xStart <= sFaultDrawerStruct.cursorX) &&
((sFaultDrawerStruct.charW + sFaultDrawerStruct.cursorX - 1) <= sFaultDrawerStruct.xEnd) &&
(sFaultDrawerStruct.yStart <= sFaultDrawerStruct.cursorY) &&
- ((sFaultDrawerStruct.charH + sFaultDrawerStruct.cursorY - 1) <= sFaultDrawerStruct.yEnd))
- {
- for (y = 0; y < sFaultDrawerStruct.charH; y++)
- {
+ ((sFaultDrawerStruct.charH + sFaultDrawerStruct.cursorY - 1) <= sFaultDrawerStruct.yEnd)) {
+ for (y = 0; y < sFaultDrawerStruct.charH; y++) {
u32 mask = 0x10000000 << (c % 4);
u32 data = *dataPtr;
- for (x = 0; x < sFaultDrawerStruct.charW; x++)
- {
+ for (x = 0; x < sFaultDrawerStruct.charW; x++) {
if (mask & data)
fb[x] = sFaultDrawerStruct.foreColor;
else if (sFaultDrawerStruct.backColor & 1)
@@ -125,93 +116,89 @@ void FaultDrawer_DrawChar(char c)
#pragma GLOBAL_ASM("asm/non_matchings/code/fault_drawer/FaultDrawer_DrawChar.s")
#endif
-s32 FaultDrawer_ColorToPrintColor(u16 color)
-{
+s32 FaultDrawer_ColorToPrintColor(u16 color) {
s32 i;
- for (i = 0; i < 10; i++)
- if (color == sFaultDrawerStruct.printColors[i])
+ for (i = 0; i < 10; i++) {
+ if (color == sFaultDrawerStruct.printColors[i]) {
return i;
+ }
+ }
return -1;
}
-void FaultDrawer_UpdatePrintColor()
-{
+void FaultDrawer_UpdatePrintColor() {
s32 idx;
- if (sFaultDrawerStruct.osSyncPrintfEnabled)
- {
+ if (sFaultDrawerStruct.osSyncPrintfEnabled) {
osSyncPrintf(VT_RST);
idx = FaultDrawer_ColorToPrintColor(sFaultDrawerStruct.foreColor);
- if (idx >= 0 && idx < 8)
+ if (idx >= 0 && idx < 8) {
osSyncPrintf(VT_SGR("3%d"), idx);
+ }
idx = FaultDrawer_ColorToPrintColor(sFaultDrawerStruct.backColor);
- if (idx >= 0 && idx < 8)
+ if (idx >= 0 && idx < 8) {
osSyncPrintf(VT_SGR("4%d"), idx);
+ }
}
}
-void FaultDrawer_SetForeColor(u16 color)
-{
+void FaultDrawer_SetForeColor(u16 color) {
sFaultDrawerStruct.foreColor = color;
FaultDrawer_UpdatePrintColor();
}
-void FaultDrawer_SetBackColor(u16 color)
-{
+void FaultDrawer_SetBackColor(u16 color) {
sFaultDrawerStruct.backColor = color;
FaultDrawer_UpdatePrintColor();
}
-void FaultDrawer_SetFontColor(u16 color)
-{
- FaultDrawer_SetForeColor((u16)(color | 1)); //force alpha to be set
+void FaultDrawer_SetFontColor(u16 color) {
+ FaultDrawer_SetForeColor((u16)(color | 1)); // force alpha to be set
}
-void FaultDrawer_SetCharPad(s8 padW, s8 padH)
-{
+void FaultDrawer_SetCharPad(s8 padW, s8 padH) {
sFaultDrawerStruct.charWPad = padW;
sFaultDrawerStruct.charHPad = padH;
}
-void FaultDrawer_SetCursor(s32 x, s32 y)
-{
- if (sFaultDrawerStruct.osSyncPrintfEnabled)
- osSyncPrintf(VT_CUP("%d", "%d"), (y - sFaultDrawerStruct.yStart) / (sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad), (x - sFaultDrawerStruct.xStart) / (sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad));
+void FaultDrawer_SetCursor(s32 x, s32 y) {
+ if (sFaultDrawerStruct.osSyncPrintfEnabled) {
+ osSyncPrintf(VT_CUP("%d", "%d"),
+ (y - sFaultDrawerStruct.yStart) / (sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad),
+ (x - sFaultDrawerStruct.xStart) / (sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad));
+ }
sFaultDrawerStruct.cursorX = x;
sFaultDrawerStruct.cursorY = y;
}
-void FaultDrawer_FillScreen()
-{
- if (sFaultDrawerStruct.osSyncPrintfEnabled)
+void FaultDrawer_FillScreen() {
+ if (sFaultDrawerStruct.osSyncPrintfEnabled) {
osSyncPrintf(VT_CLS);
+ }
- FaultDrawer_DrawRecImpl(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart, sFaultDrawerStruct.xEnd, sFaultDrawerStruct.yEnd, sFaultDrawerStruct.backColor | 1);
+ FaultDrawer_DrawRecImpl(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart, sFaultDrawerStruct.xEnd,
+ sFaultDrawerStruct.yEnd, sFaultDrawerStruct.backColor | 1);
FaultDrawer_SetCursor(sFaultDrawerStruct.xStart, sFaultDrawerStruct.yStart);
}
-u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
-{
- for (count; count != 0; count--, str++)
- {
+u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count) {
+ for (count; count != 0; count--, str++) {
s32 curXStart;
s32 curXEnd;
- if (sFaultDrawerStruct.escCode)
- {
+ if (sFaultDrawerStruct.escCode) {
sFaultDrawerStruct.escCode = false;
- if (*str > 0x30 && *str < 0x3A)
+ if (*str > 0x30 && *str < 0x3A) {
FaultDrawer_SetForeColor(sFaultDrawerStruct.printColors[*str - 0x30]);
+ }
curXStart = sFaultDrawerStruct.cursorX;
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
- }
- else
- {
- switch (*str)
- {
+ } else {
+ switch (*str) {
case '\n':
- if (sFaultDrawerStruct.osSyncPrintfEnabled)
+ if (sFaultDrawerStruct.osSyncPrintfEnabled) {
osSyncPrintf("\n");
+ }
sFaultDrawerStruct.cursorX = sFaultDrawerStruct.w;
curXStart = sFaultDrawerStruct.cursorX;
@@ -223,8 +210,9 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
curXEnd = sFaultDrawerStruct.xEnd - sFaultDrawerStruct.charW;
break;
default:
- if (sFaultDrawerStruct.osSyncPrintfEnabled)
+ if (sFaultDrawerStruct.osSyncPrintfEnabled) {
osSyncPrintf("%c", *str);
+ }
FaultDrawer_DrawChar(*str);
sFaultDrawerStruct.cursorX += sFaultDrawerStruct.charW + sFaultDrawerStruct.charWPad;
@@ -234,14 +222,11 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
}
}
- if (curXEnd <= curXStart)
- {
+ if (curXEnd <= curXStart) {
sFaultDrawerStruct.cursorX = sFaultDrawerStruct.xStart;
sFaultDrawerStruct.cursorY += sFaultDrawerStruct.charH + sFaultDrawerStruct.charHPad;
- if (sFaultDrawerStruct.yEnd - sFaultDrawerStruct.charH <= sFaultDrawerStruct.cursorY)
- {
- if (sFaultDrawerStruct.inputCallback)
- {
+ if (sFaultDrawerStruct.yEnd - sFaultDrawerStruct.charH <= sFaultDrawerStruct.cursorY) {
+ if (sFaultDrawerStruct.inputCallback) {
sFaultDrawerStruct.inputCallback();
FaultDrawer_FillScreen();
}
@@ -255,21 +240,18 @@ u32 FaultDrawer_FormatStringFunc(u32 arg0, const char* str, s32 count)
return arg0;
}
-void FaultDrawer_VPrintf(const char* str, char* args) //va_list
-{
+void FaultDrawer_VPrintf(const char* str, char* args) { // va_list
_Printf(&FaultDrawer_FormatStringFunc, &sFaultDrawerStruct, str, args);
}
-void FaultDrawer_Printf(const char* fmt, ...)
-{
+void FaultDrawer_Printf(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
FaultDrawer_VPrintf(fmt, args);
}
-void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...)
-{
+void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
@@ -277,25 +259,21 @@ void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...)
FaultDrawer_VPrintf(fmt, args);
}
-void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h)
-{
+void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h) {
sFaultDrawerStruct.fb = (u16*)fb;
sFaultDrawerStruct.w = w;
sFaultDrawerStruct.h = h;
}
-void FaultDrawer_SetInputCallback(void(*callback)())
-{
+void FaultDrawer_SetInputCallback(void (*callback)()) {
sFaultDrawerStruct.inputCallback = callback;
}
-void FaultDrawer_WritebackFBDCache()
-{
- osWritebackDCache(sFaultDrawerStruct.fb, sFaultDrawerStruct.w*sFaultDrawerStruct.h*2);
+void FaultDrawer_WritebackFBDCache() {
+ osWritebackDCache(sFaultDrawerStruct.fb, sFaultDrawerStruct.w * sFaultDrawerStruct.h * 2);
}
-void FaultDrawer_SetDefault()
-{
+void FaultDrawer_SetDefault() {
bcopy(&sFaultDrawerDefault, &sFaultDrawerStruct, sizeof(FaultDrawer));
sFaultDrawerStruct.fb = (u16*)((osMemSize | 0x80000000) - 0x25800);
}
diff --git a/src/code/gamealloc.c b/src/code/gamealloc.c
index 87a32db16..9ec6886b2 100644
--- a/src/code/gamealloc.c
+++ b/src/code/gamealloc.c
@@ -1,26 +1,22 @@
#include <global.h>
-void GameAlloc_Log(GameAlloc* this)
-{
+void GameAlloc_Log(GameAlloc* this) {
GameAllocEntry* iter;
osSyncPrintf("this = %08x\n", this);
iter = this->base.next;
- while (iter != &this->base)
- {
+ while (iter != &this->base) {
osSyncPrintf("ptr = %08x size = %d\n", iter, iter->size);
iter = iter->next;
}
}
-void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line)
-{
+void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line) {
GameAllocEntry* ptr;
- ptr = SystemArena_MallocDebug(size+sizeof(GameAllocEntry), file, line);
- if (ptr)
- {
+ ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line);
+ if (ptr) {
ptr->size = size;
ptr->prev = this->head;
this->head->next = ptr;
@@ -28,18 +24,16 @@ void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 lin
ptr->next = &this->base;
this->base.prev = this->head;
return ptr + 1;
- }
- else
+ } else {
return NULL;
+ }
}
-void* GameAlloc_Malloc(GameAlloc* this, u32 size)
-{
+void* GameAlloc_Malloc(GameAlloc* this, u32 size) {
GameAllocEntry* ptr;
- ptr = SystemArena_MallocDebug(size+sizeof(GameAllocEntry), "../gamealloc.c", 93);
- if (ptr)
- {
+ ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), "../gamealloc.c", 93);
+ if (ptr) {
ptr->size = size;
ptr->prev = this->head;
this->head->next = ptr;
@@ -47,17 +41,15 @@ void* GameAlloc_Malloc(GameAlloc* this, u32 size)
ptr->next = &this->base;
this->base.prev = this->head;
return ptr + 1;
- }
- else
+ } else {
return NULL;
+ }
}
-void GameAlloc_Free(GameAlloc* this, void* data)
-{
+void GameAlloc_Free(GameAlloc* this, void* data) {
GameAllocEntry* ptr;
- if (data)
- {
+ if (data) {
ptr = &((GameAllocEntry*)data)[-1];
LogUtils_CheckNullPointer("ptr->prev", ptr->prev, "../gamealloc.c", 120);
LogUtils_CheckNullPointer("ptr->next", ptr->next, "../gamealloc.c", 121);
@@ -68,14 +60,12 @@ void GameAlloc_Free(GameAlloc* this, void* data)
}
}
-void GameAlloc_Cleanup(GameAlloc* this)
-{
+void GameAlloc_Cleanup(GameAlloc* this) {
GameAllocEntry* next;
GameAllocEntry* cur;
next = this->base.next;
- while (&this->base != next)
- {
+ while (&this->base != next) {
cur = next;
next = next->next;
SystemArena_FreeDebug(cur, "../gamealloc.c", 145);
@@ -84,11 +74,9 @@ void GameAlloc_Cleanup(GameAlloc* this)
this->head = &this->base;
this->base.next = &this->base;
this->base.prev = &this->base;
-
}
-void GameAlloc_Init(GameAlloc* this)
-{
+void GameAlloc_Init(GameAlloc* this) {
this->head = &this->base;
this->base.next = &this->base;
this->base.prev = &this->base;
diff --git a/src/code/gfxprint.c b/src/code/gfxprint.c
index 340d4702a..fbcca3cee 100644
--- a/src/code/gfxprint.c
+++ b/src/code/gfxprint.c
@@ -1,188 +1,196 @@
#include <ultra64.h>
#include <global.h>
-//.bss
+// .bss
u8 D_801755F0;
-//.data
-u16 sGfxPrintFontTLUT[64] =
-{
- 0x0000, 0xFFFF, 0x0000, 0xFFFF,
- 0x0000, 0xFFFF, 0x0000, 0xFFFF,
- 0x0000, 0xFFFF, 0x0000, 0xFFFF,
- 0x0000, 0xFFFF, 0x0000, 0xFFFF,
- 0x0000, 0x0000, 0xFFFF, 0xFFFF,
- 0x0000, 0x0000, 0xFFFF, 0xFFFF,
- 0x0000, 0x0000, 0xFFFF, 0xFFFF,
- 0x0000, 0x0000, 0xFFFF, 0xFFFF,
- 0x0000, 0x0000, 0x0000, 0x0000,
- 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
- 0x0000, 0x0000, 0x0000, 0x0000,
- 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
- 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000,
- 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
- 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
+// .data
+u16 sGfxPrintFontTLUT[64] = {
+ 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000,
+ 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000,
+ 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF,
+ 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
};
-u16 sGfxPrintUnkTLUT[16] =
-{
- 0xF801, 0xFBC1, 0xFFC1, 0x07C1,
- 0x0421, 0x003F, 0x803F, 0xF83F,
- 0xF801, 0xFBC1, 0xFFC1, 0x07C1,
- 0x0421, 0x003F, 0x803F, 0xF83F,
+u16 sGfxPrintUnkTLUT[16] = {
+ 0xF801, 0xFBC1, 0xFFC1, 0x07C1, 0x0421, 0x003F, 0x803F, 0xF83F,
+ 0xF801, 0xFBC1, 0xFFC1, 0x07C1, 0x0421, 0x003F, 0x803F, 0xF83F,
};
u8 sGfxPrintUnkData[8] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 };
-u8 sGfxPrintFontData[(16*256)/2] =
-{
- 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00,
- 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0xBF, 0xFB, 0x00, 0x0E, 0xFF, 0xFF, 0xC0, 0x0B, 0xF0, 0x0F, 0xB0, 0x0F, 0xF0, 0x03, 0x30, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0C, 0xFB, 0xBF, 0x60, 0x0F, 0xFC, 0xCE, 0x20,
- 0x0D, 0xD4, 0x4F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x03, 0x30, 0x0C, 0xFB, 0xBF, 0x40, 0x0E, 0xF7, 0x77, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00,
- 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0xBF, 0xFB, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x0B, 0xF0, 0x0F, 0xB0, 0x00, 0x5D, 0xE6, 0x00, 0x0F, 0xF0, 0x0F, 0xF0, 0x05, 0x5C, 0xC6, 0x60, 0x0C, 0xFB, 0xBF, 0x60, 0x77, 0x3F, 0xF3, 0x77,
- 0x0D, 0xD4, 0x4F, 0xF0, 0xBB, 0x3F, 0xF3, 0xBB, 0x0F, 0xF0, 0x0F, 0xF0, 0x09, 0x9C, 0xCA, 0xA0, 0x0C, 0xFB, 0xBF, 0x40, 0x00, 0x9D, 0xEA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xE0, 0x00,
- 0x04, 0xC2, 0x2C, 0x40, 0x02, 0x8D, 0x50, 0x20, 0x0C, 0xCA, 0xAC, 0xC0, 0x21, 0xF9, 0x17, 0x10, 0x04, 0xC2, 0x2C, 0x40, 0x12, 0x49, 0x34, 0x00, 0x00, 0x82, 0x08, 0x00, 0x01, 0x97, 0x51, 0x10,
- 0x08, 0x8A, 0x88, 0x80, 0x04, 0x61, 0x52, 0x41, 0x00, 0x80, 0x08, 0x00, 0x43, 0x11, 0x75, 0x30, 0x00, 0xA2, 0x08, 0x00, 0x60, 0x05, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x40,
- 0x00, 0x22, 0x11, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0F, 0xB0, 0x00, 0x00, 0x00, 0x08, 0x80, 0x04, 0x0D, 0xA4, 0x00, 0x00, 0x00, 0x88, 0x00, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0x2A, 0xA2, 0x20,
- 0x08, 0xCD, 0xE8, 0x80, 0x02, 0xAA, 0x22, 0x20, 0x04, 0x0D, 0xA4, 0x00, 0x0C, 0xD1, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0x00, 0x8C, 0x51, 0x00, 0x00, 0x00, 0x22, 0x11, 0x00, 0x81, 0x10, 0x00, 0x00,
- 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00,
- 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x33, 0x33, 0x00, 0x04, 0x48, 0x99, 0x80, 0x03, 0x3C, 0xC3, 0x30, 0x00, 0xCD, 0x10, 0x88, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0xBF, 0x62, 0xA8, 0x00, 0x33, 0x33, 0x20, 0x01, 0x10, 0x4C, 0x80,
- 0x01, 0x10, 0x03, 0x30, 0x00, 0x15, 0xC8, 0x00, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0x67, 0x32, 0x20, 0x00, 0x3F, 0xF3, 0x00, 0x04, 0x40, 0x99, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x05, 0xDF, 0xFD, 0x10, 0x07, 0xFF, 0xFF, 0x60, 0x1C, 0xE0, 0x0E, 0xC1, 0x0F, 0xF0, 0x09, 0x90, 0x1E, 0xE1, 0x16, 0x61, 0x0F, 0xF0, 0x01, 0x10, 0x1E, 0xF4, 0x56, 0x21, 0x0F, 0xF6, 0x67, 0x10,
- 0x1E, 0xF2, 0x36, 0x61, 0x0F, 0xF0, 0x89, 0x90, 0x1E, 0xF1, 0x0F, 0xE1, 0x0F, 0xF0, 0x09, 0x90, 0x16, 0xEC, 0xCE, 0x21, 0x07, 0xFB, 0xBB, 0x20, 0x01, 0x11, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00,
- 0x09, 0xB6, 0x6F, 0xD0, 0x27, 0xD8, 0x8E, 0x60, 0x09, 0x92, 0xED, 0x10, 0x2F, 0xF0, 0x2E, 0xE0, 0x09, 0x9A, 0xE5, 0x10, 0x2F, 0xF6, 0x2E, 0xE0, 0x09, 0x9B, 0x75, 0x10, 0x2F, 0xD6, 0x4E, 0xE0,
- 0x0D, 0xDA, 0xE5, 0x10, 0x2F, 0xD0, 0x4E, 0xE0, 0x0D, 0xD2, 0xED, 0x10, 0x2F, 0xD0, 0x0E, 0xE0, 0x09, 0xF6, 0x6F, 0x90, 0x27, 0xD9, 0x9F, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x07, 0xFF, 0xFF, 0x00, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x0F, 0xF0, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x07, 0x70, 0x8E, 0x61, 0x1E, 0xE0, 0x27, 0xDD, 0xDF, 0x60, 0x8E, 0x69, 0x1E, 0xE0,
- 0x27, 0x76, 0x4A, 0xA0, 0x8E, 0xE9, 0x9E, 0xE0, 0x2F, 0xD0, 0x6E, 0x80, 0x8A, 0xE7, 0xFE, 0xA0, 0x07, 0xFA, 0x8E, 0x60, 0x88, 0x27, 0x7A, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x07, 0x7C, 0xCF, 0xF0, 0x13, 0x26, 0x60, 0x11, 0x07, 0x7C, 0xCF, 0xF0, 0x03, 0x76, 0x65, 0x10, 0x02, 0x39, 0xD7, 0x20, 0x04, 0x53, 0x35, 0x40, 0x00, 0x2F, 0xF2, 0x00, 0x01, 0x13, 0x31, 0x10,
- 0x00, 0x5F, 0xB1, 0x00, 0x00, 0x03, 0x30, 0x00, 0x05, 0x5E, 0xE5, 0x50, 0x01, 0x13, 0x31, 0x10, 0x05, 0x5E, 0xED, 0xD0, 0x02, 0x23, 0x30, 0x00, 0x00, 0x08, 0x88, 0x80, 0x8A, 0xAB, 0xB8, 0x88,
- 0x00, 0x00, 0x11, 0x00, 0x00, 0x04, 0x45, 0x10, 0x04, 0x62, 0x33, 0x20, 0x00, 0x44, 0x01, 0x10, 0x04, 0xC8, 0x9A, 0xA0, 0x00, 0xEE, 0xAB, 0x10, 0x0C, 0xE6, 0x67, 0x20, 0x0E, 0xF5, 0x5F, 0xB0,
- 0x0E, 0xE0, 0x06, 0x60, 0x0B, 0xF6, 0x2B, 0x90, 0x0E, 0xE0, 0x06, 0x60, 0x03, 0xFC, 0x89, 0x90, 0x04, 0xEE, 0xEE, 0xA0, 0x00, 0x77, 0x3B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x88, 0x00,
- 0x09, 0x90, 0x00, 0x00, 0x00, 0x11, 0x10, 0x00, 0x09, 0x92, 0x24, 0x40, 0x00, 0x01, 0x10, 0x00, 0x09, 0x90, 0x88, 0x00, 0x26, 0xEF, 0xDE, 0x20, 0x09, 0x9B, 0xB5, 0x40, 0x2E, 0xC3, 0x3C, 0xE2,
- 0x0D, 0x9A, 0x25, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0xDA, 0xA5, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x09, 0xD6, 0xED, 0x10, 0x26, 0xCB, 0xBC, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x05, 0xFB, 0xFF, 0xE0, 0x8E, 0x61, 0x16, 0xE8, 0x0F, 0xF4, 0x03, 0x30, 0x8F, 0x71, 0x17, 0xF8,
- 0x07, 0xFC, 0x8B, 0x30, 0x8E, 0x69, 0x96, 0xE8, 0x05, 0x73, 0x3B, 0xA0, 0x8A, 0x6D, 0xD6, 0xA8, 0x0D, 0xD8, 0x8A, 0x20, 0x08, 0xA7, 0x79, 0xB2, 0x01, 0x10, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0x8A, 0x01, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x80, 0xA1, 0x10, 0x00, 0x07, 0x74, 0x4F, 0x70, 0x80, 0xA9, 0x90, 0x00, 0x02, 0x31, 0xDF, 0x20, 0x84, 0xE6, 0x00, 0x04,
- 0x00, 0x27, 0xDA, 0x20, 0xC8, 0xAA, 0x4C, 0x40, 0x00, 0x57, 0x3B, 0x20, 0x00, 0xA1, 0x18, 0x00, 0x05, 0x54, 0x6F, 0x50, 0x00, 0xA9, 0x98, 0x00, 0x02, 0x22, 0x20, 0x80, 0x02, 0x00, 0x18, 0x88,
- 0x00, 0x04, 0x44, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x0C, 0x44, 0x44, 0x00, 0x00, 0x04, 0x40, 0x00, 0x88, 0xC0, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x0C, 0x46, 0xA4, 0x40,
- 0x00, 0x0C, 0xC0, 0x00, 0x08, 0x8E, 0xE0, 0x00, 0x02, 0x08, 0x80, 0x00, 0x80, 0xD0, 0x88, 0x00, 0x28, 0xA8, 0x80, 0x00, 0x88, 0xCD, 0x4C, 0x40, 0x0A, 0x88, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xE0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x00, 0x80, 0x01, 0x06, 0x10, 0x00, 0x56, 0xE7, 0x50, 0x80, 0x02, 0x1F, 0xF1, 0x00,
- 0x38, 0x8C, 0xB8, 0x00, 0x0B, 0xF6, 0x0B, 0x00, 0x94, 0xC0, 0x28, 0x00, 0x06, 0x07, 0x6A, 0x00, 0xCB, 0xA6, 0xC8, 0x00, 0x00, 0x47, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x0A, 0x80, 0x00, 0x00, 0x39, 0x14, 0x20, 0x02, 0x22, 0x24, 0x00, 0x08, 0xAE, 0xA8, 0x60, 0x04, 0x28, 0x99, 0x70, 0x07, 0x75, 0xD1, 0x04, 0x0F, 0xB3, 0x33, 0xD0, 0x00, 0xAE, 0xBE, 0xA4,
- 0x25, 0x15, 0x20, 0xA0, 0x02, 0x61, 0x0C, 0x02, 0x20, 0x42, 0x08, 0x20, 0x2C, 0x30, 0x14, 0x02, 0x02, 0x28, 0x82, 0x00, 0x03, 0xAC, 0xC1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x08, 0x12, 0x00, 0x08, 0x00, 0x28, 0x00, 0x0A, 0xCF, 0xEE, 0x20, 0x0B, 0x62, 0x2E, 0x20, 0x02, 0x10, 0x82, 0x40, 0x01, 0x44, 0xE4, 0x40, 0x03, 0x00, 0x0E, 0x00, 0x8D, 0xEA, 0xAC, 0x00,
- 0x02, 0x10, 0x0A, 0x00, 0x01, 0xE0, 0x24, 0x00, 0x0C, 0x21, 0x02, 0x00, 0x09, 0x42, 0x21, 0x00, 0x00, 0xCC, 0xF4, 0x40, 0x02, 0xBF, 0xD4, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x0C, 0xCC, 0xC4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x00, 0x02, 0xA0, 0x40,
- 0x00, 0x0C, 0xC0, 0x00, 0x04, 0xCE, 0x64, 0x40, 0x02, 0x08, 0x80, 0x00, 0x00, 0x90, 0x00, 0x40, 0x28, 0xA8, 0x80, 0x00, 0x08, 0x01, 0x04, 0x00, 0x0A, 0x88, 0x80, 0x00, 0x04, 0x44, 0x40, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x54, 0x44, 0x00, 0xEE, 0xFE, 0xE0, 0x00, 0x09, 0x3B, 0x3F, 0x00,
- 0x21, 0xD8, 0x20, 0x00, 0x00, 0x54, 0x4F, 0x00, 0x18, 0x58, 0x20, 0x00, 0x00, 0x01, 0x86, 0x00, 0xC6, 0x7E, 0x40, 0x00, 0x00, 0xEF, 0x66, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x80, 0x04, 0x00, 0x00, 0xC0, 0x20, 0x00, 0xAA, 0xAA, 0xEA, 0x20, 0xEF, 0xFF, 0xFF, 0x00, 0x80, 0x44, 0x19, 0x30, 0x00, 0x49, 0x24, 0x00, 0xC5, 0x35, 0x1B, 0x10, 0x00, 0x4B, 0x24, 0x00,
- 0x01, 0x35, 0xA0, 0x00, 0x8C, 0xA9, 0xAC, 0x80, 0x00, 0x2C, 0x00, 0x00, 0x04, 0x21, 0xA4, 0x00, 0x2A, 0x84, 0x00, 0x00, 0x73, 0x11, 0xF1, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0B, 0x11, 0x19, 0x00, 0x00, 0x40, 0x00, 0x00, 0x8F, 0xEE, 0xEF, 0xE0, 0x0B, 0x76, 0x66, 0xD0, 0x1A, 0x00, 0x0B, 0x40, 0x4C, 0x40, 0x02, 0xD0, 0x28, 0x00, 0x1A, 0x40, 0x01, 0xD0, 0x2C, 0x10,
- 0x00, 0x00, 0x38, 0x40, 0x00, 0x40, 0x28, 0x10, 0x00, 0x01, 0xA0, 0x40, 0x00, 0x42, 0x83, 0x00, 0x05, 0xFE, 0x44, 0x40, 0x03, 0xFD, 0x54, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x09, 0x99, 0x9B, 0x00, 0x00, 0x10, 0x20, 0x00, 0x07, 0x26, 0x21, 0x40, 0x2A, 0xFE, 0xEE, 0xA0, 0x8D, 0x8C, 0xA9, 0xC0, 0x00, 0x10, 0x20, 0x80, 0x32, 0x33, 0xB3, 0x60, 0x00, 0x19, 0x28, 0x00,
- 0x00, 0x00, 0xA1, 0x40, 0x00, 0x10, 0xB1, 0x00, 0x00, 0x08, 0x34, 0x00, 0x00, 0x1A, 0x08, 0x00, 0x05, 0xF7, 0x40, 0x00, 0x8E, 0xF4, 0x44, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x14, 0x02, 0x80, 0x00, 0x04, 0x00, 0x00, 0x1D, 0x11, 0xDB, 0x00, 0xDD, 0xFD, 0xDD, 0xD0, 0x0C, 0x88, 0x07, 0x00, 0x02, 0x06, 0x00, 0x90, 0x48, 0x00, 0x34, 0x00, 0x2C, 0x04, 0x2C, 0x10,
- 0x48, 0x11, 0x21, 0x40, 0x04, 0x84, 0x83, 0x40, 0x59, 0x03, 0x00, 0x50, 0x40, 0x0C, 0x10, 0x60, 0x42, 0xA9, 0x88, 0xC0, 0x40, 0x15, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x11, 0x02, 0x00, 0x40, 0x08, 0x98, 0x88, 0x80, 0x08, 0xF9, 0x98, 0xC0, 0x06, 0x77, 0x75, 0x50, 0x02, 0x0C, 0x05, 0x00, 0x19, 0x98, 0xA8, 0xD0, 0x0B, 0x99, 0xCA, 0x80, 0x04, 0x54, 0x65, 0xC0,
- 0x20, 0x08, 0x50, 0x20, 0x00, 0x10, 0x20, 0xC0, 0x31, 0x1C, 0x04, 0x20, 0x00, 0x01, 0x28, 0x40, 0x26, 0x63, 0xBB, 0xE0, 0x26, 0xEF, 0xE6, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x02, 0x01, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0F, 0x8A, 0x89, 0x80, 0xC3, 0xF3, 0x11, 0x30, 0x0F, 0x02, 0x01, 0x80, 0xC9, 0xC0, 0x00, 0x30, 0x0F, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30,
- 0x0E, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30, 0x0E, 0x02, 0x52, 0x80, 0x00, 0x00, 0x03, 0x00, 0x2C, 0xDF, 0xA8, 0x80, 0x02, 0x33, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x03, 0x88, 0x00, 0x01, 0x02, 0x80, 0x00, 0x03, 0xFF, 0xF7, 0x00, 0x0F, 0x26, 0xE4, 0x72, 0xCC, 0x38, 0x00, 0x40, 0x0C, 0x38, 0x99, 0x00, 0x03, 0x0A, 0x31, 0x50, 0x0C, 0xB1, 0x82, 0x80,
- 0x03, 0x28, 0x06, 0x00, 0x87, 0x88, 0x2A, 0xA0, 0x01, 0x05, 0xC2, 0x00, 0x85, 0x82, 0xC2, 0x80, 0x10, 0x00, 0x39, 0x10, 0x08, 0x51, 0xBF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x80, 0x04, 0x00, 0x48, 0x9D, 0xCC, 0x40, 0xC9, 0xE6, 0x7F, 0x40, 0x40, 0x00, 0x94, 0x00, 0x5B, 0x21, 0x0C, 0xB0, 0x48, 0xAE, 0xCC, 0x40, 0xE1, 0x30, 0x0C, 0x30, 0x43, 0x01, 0xA4, 0x00,
- 0xE1, 0x24, 0x5D, 0x30, 0x78, 0x8C, 0xD6, 0x10, 0xF1, 0x60, 0x94, 0x70, 0xD0, 0x40, 0x9C, 0x70, 0x0B, 0x8C, 0x53, 0x00, 0x0C, 0x9D, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x39, 0x50, 0x00, 0x00, 0x88, 0xF0, 0x00, 0x2E, 0xAF, 0xC6, 0x00, 0x03, 0x01, 0x77, 0x60, 0x04, 0xF0, 0x41, 0x60, 0x03, 0x92, 0xF8, 0x12, 0x0F, 0xBD, 0x91, 0x40, 0x1B, 0x28, 0x60, 0x92,
- 0x70, 0xF4, 0x01, 0xF0, 0x0A, 0xD4, 0x65, 0x82, 0x53, 0xE0, 0x01, 0xE0, 0x04, 0x10, 0x68, 0x60, 0x04, 0x2A, 0xBE, 0x00, 0x00, 0x4F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x3A, 0xEE, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0D, 0x84, 0xA5, 0x00, 0xC1, 0xC2, 0x11, 0x00, 0x45, 0x0E, 0x27, 0x00, 0xD9, 0xC3, 0x00, 0x10, 0x07, 0xF8, 0x8D, 0x20, 0x01, 0x30, 0x00, 0x10,
- 0xAC, 0x02, 0x25, 0xA0, 0x01, 0x22, 0x00, 0x10, 0x44, 0x20, 0x16, 0xA0, 0x13, 0x02, 0x00, 0x30, 0x04, 0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+u8 sGfxPrintFontData[(16 * 256) / 2] = {
+ 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D,
+ 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56, 0x29, 0x90, 0x05, 0x58,
+ 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xBF, 0xFB, 0x00, 0x0E, 0xFF, 0xFF, 0xC0, 0x0B, 0xF0, 0x0F, 0xB0,
+ 0x0F, 0xF0, 0x03, 0x30, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0C, 0xFB, 0xBF, 0x60, 0x0F, 0xFC, 0xCE,
+ 0x20, 0x0D, 0xD4, 0x4F, 0xF0, 0x0F, 0xF0, 0x02, 0x20, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x03, 0x30, 0x0C, 0xFB,
+ 0xBF, 0x40, 0x0E, 0xF7, 0x77, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDF, 0xFD, 0x00, 0x0A,
+ 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D, 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00,
+ 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56, 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29,
+ 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02, 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0xBF, 0xFB, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x0B, 0xF0, 0x0F, 0xB0, 0x00, 0x5D, 0xE6, 0x00, 0x0F,
+ 0xF0, 0x0F, 0xF0, 0x05, 0x5C, 0xC6, 0x60, 0x0C, 0xFB, 0xBF, 0x60, 0x77, 0x3F, 0xF3, 0x77, 0x0D, 0xD4, 0x4F, 0xF0,
+ 0xBB, 0x3F, 0xF3, 0xBB, 0x0F, 0xF0, 0x0F, 0xF0, 0x09, 0x9C, 0xCA, 0xA0, 0x0C, 0xFB, 0xBF, 0x40, 0x00, 0x9D, 0xEA,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0xE0, 0x00, 0x04, 0xC2, 0x2C, 0x40, 0x02, 0x8D, 0x50, 0x20, 0x0C, 0xCA,
+ 0xAC, 0xC0, 0x21, 0xF9, 0x17, 0x10, 0x04, 0xC2, 0x2C, 0x40, 0x12, 0x49, 0x34, 0x00, 0x00, 0x82, 0x08, 0x00, 0x01,
+ 0x97, 0x51, 0x10, 0x08, 0x8A, 0x88, 0x80, 0x04, 0x61, 0x52, 0x41, 0x00, 0x80, 0x08, 0x00, 0x43, 0x11, 0x75, 0x30,
+ 0x00, 0xA2, 0x08, 0x00, 0x60, 0x05, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x40, 0x00, 0x22, 0x11,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0F, 0xB0, 0x00, 0x00, 0x00, 0x08, 0x80, 0x04, 0x0D, 0xA4, 0x00, 0x00, 0x00,
+ 0x88, 0x00, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0x2A, 0xA2, 0x20, 0x08, 0xCD, 0xE8, 0x80, 0x02, 0xAA, 0x22, 0x20, 0x04,
+ 0x0D, 0xA4, 0x00, 0x0C, 0xD1, 0x00, 0x00, 0x00, 0x0F, 0xB0, 0x00, 0x8C, 0x51, 0x00, 0x00, 0x00, 0x22, 0x11, 0x00,
+ 0x81, 0x10, 0x00, 0x00, 0x00, 0xDF, 0xFD, 0x00, 0x0A, 0xEE, 0xFF, 0xA0, 0x0D, 0xF2, 0x2D, 0xD0, 0x06, 0x61, 0x1D,
+ 0xC0, 0x01, 0x12, 0x2D, 0xD0, 0x06, 0x71, 0x99, 0x00, 0x01, 0x1E, 0xED, 0x10, 0x07, 0x7E, 0xF7, 0x00, 0x01, 0x56,
+ 0x29, 0x90, 0x05, 0x58, 0x97, 0x60, 0x0D, 0xD2, 0x29, 0x90, 0x05, 0x59, 0x97, 0x70, 0x04, 0xDF, 0xFD, 0x40, 0x02,
+ 0x6E, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x00, 0x04, 0x48, 0x99, 0x80,
+ 0x03, 0x3C, 0xC3, 0x30, 0x00, 0xCD, 0x10, 0x88, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0xBF, 0x62, 0xA8, 0x00, 0x33, 0x33,
+ 0x20, 0x01, 0x10, 0x4C, 0x80, 0x01, 0x10, 0x03, 0x30, 0x00, 0x15, 0xC8, 0x00, 0x03, 0x3C, 0xC3, 0x30, 0x02, 0x67,
+ 0x32, 0x20, 0x00, 0x3F, 0xF3, 0x00, 0x04, 0x40, 0x99, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
+ 0xDF, 0xFD, 0x10, 0x07, 0xFF, 0xFF, 0x60, 0x1C, 0xE0, 0x0E, 0xC1, 0x0F, 0xF0, 0x09, 0x90, 0x1E, 0xE1, 0x16, 0x61,
+ 0x0F, 0xF0, 0x01, 0x10, 0x1E, 0xF4, 0x56, 0x21, 0x0F, 0xF6, 0x67, 0x10, 0x1E, 0xF2, 0x36, 0x61, 0x0F, 0xF0, 0x89,
+ 0x90, 0x1E, 0xF1, 0x0F, 0xE1, 0x0F, 0xF0, 0x09, 0x90, 0x16, 0xEC, 0xCE, 0x21, 0x07, 0xFB, 0xBB, 0x20, 0x01, 0x11,
+ 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x09, 0xB6, 0x6F, 0xD0, 0x27, 0xD8, 0x8E, 0x60, 0x09, 0x92, 0xED, 0x10, 0x2F,
+ 0xF0, 0x2E, 0xE0, 0x09, 0x9A, 0xE5, 0x10, 0x2F, 0xF6, 0x2E, 0xE0, 0x09, 0x9B, 0x75, 0x10, 0x2F, 0xD6, 0x4E, 0xE0,
+ 0x0D, 0xDA, 0xE5, 0x10, 0x2F, 0xD0, 0x4E, 0xE0, 0x0D, 0xD2, 0xED, 0x10, 0x2F, 0xD0, 0x0E, 0xE0, 0x09, 0xF6, 0x6F,
+ 0x90, 0x27, 0xD9, 0x9F, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0x00, 0x8F, 0x71,
+ 0x1F, 0xF0, 0x2F, 0xD0, 0x0F, 0xF0, 0x8F, 0x71, 0x1F, 0xF0, 0x2F, 0xD0, 0x07, 0x70, 0x8E, 0x61, 0x1E, 0xE0, 0x27,
+ 0xDD, 0xDF, 0x60, 0x8E, 0x69, 0x1E, 0xE0, 0x27, 0x76, 0x4A, 0xA0, 0x8E, 0xE9, 0x9E, 0xE0, 0x2F, 0xD0, 0x6E, 0x80,
+ 0x8A, 0xE7, 0xFE, 0xA0, 0x07, 0xFA, 0x8E, 0x60, 0x88, 0x27, 0x7A, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x7C, 0xCF, 0xF0, 0x13, 0x26, 0x60, 0x11, 0x07, 0x7C, 0xCF, 0xF0, 0x03, 0x76, 0x65, 0x10, 0x02, 0x39,
+ 0xD7, 0x20, 0x04, 0x53, 0x35, 0x40, 0x00, 0x2F, 0xF2, 0x00, 0x01, 0x13, 0x31, 0x10, 0x00, 0x5F, 0xB1, 0x00, 0x00,
+ 0x03, 0x30, 0x00, 0x05, 0x5E, 0xE5, 0x50, 0x01, 0x13, 0x31, 0x10, 0x05, 0x5E, 0xED, 0xD0, 0x02, 0x23, 0x30, 0x00,
+ 0x00, 0x08, 0x88, 0x80, 0x8A, 0xAB, 0xB8, 0x88, 0x00, 0x00, 0x11, 0x00, 0x00, 0x04, 0x45, 0x10, 0x04, 0x62, 0x33,
+ 0x20, 0x00, 0x44, 0x01, 0x10, 0x04, 0xC8, 0x9A, 0xA0, 0x00, 0xEE, 0xAB, 0x10, 0x0C, 0xE6, 0x67, 0x20, 0x0E, 0xF5,
+ 0x5F, 0xB0, 0x0E, 0xE0, 0x06, 0x60, 0x0B, 0xF6, 0x2B, 0x90, 0x0E, 0xE0, 0x06, 0x60, 0x03, 0xFC, 0x89, 0x90, 0x04,
+ 0xEE, 0xEE, 0xA0, 0x00, 0x77, 0x3B, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x88, 0x00, 0x09, 0x90, 0x00, 0x00,
+ 0x00, 0x11, 0x10, 0x00, 0x09, 0x92, 0x24, 0x40, 0x00, 0x01, 0x10, 0x00, 0x09, 0x90, 0x88, 0x00, 0x26, 0xEF, 0xDE,
+ 0x20, 0x09, 0x9B, 0xB5, 0x40, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0x9A, 0x25, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x0D, 0xDA,
+ 0xA5, 0x50, 0x2E, 0xC3, 0x3C, 0xE2, 0x09, 0xD6, 0xED, 0x10, 0x26, 0xCB, 0xBC, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00,
+ 0x05, 0xFB, 0xFF, 0xE0, 0x8E, 0x61, 0x16, 0xE8, 0x0F, 0xF4, 0x03, 0x30, 0x8F, 0x71, 0x17, 0xF8, 0x07, 0xFC, 0x8B,
+ 0x30, 0x8E, 0x69, 0x96, 0xE8, 0x05, 0x73, 0x3B, 0xA0, 0x8A, 0x6D, 0xD6, 0xA8, 0x0D, 0xD8, 0x8A, 0x20, 0x08, 0xA7,
+ 0x79, 0xB2, 0x01, 0x10, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x8A, 0x01, 0x10, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x80, 0xA1, 0x10, 0x00, 0x07, 0x74, 0x4F, 0x70, 0x80, 0xA9, 0x90, 0x00, 0x02, 0x31, 0xDF, 0x20,
+ 0x84, 0xE6, 0x00, 0x04, 0x00, 0x27, 0xDA, 0x20, 0xC8, 0xAA, 0x4C, 0x40, 0x00, 0x57, 0x3B, 0x20, 0x00, 0xA1, 0x18,
+ 0x00, 0x05, 0x54, 0x6F, 0x50, 0x00, 0xA9, 0x98, 0x00, 0x02, 0x22, 0x20, 0x80, 0x02, 0x00, 0x18, 0x88, 0x00, 0x04,
+ 0x44, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x0C, 0x44, 0x44, 0x00, 0x00, 0x04, 0x40, 0x00, 0x88,
+ 0xC0, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x0C, 0x46, 0xA4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x08, 0x8E, 0xE0, 0x00,
+ 0x02, 0x08, 0x80, 0x00, 0x80, 0xD0, 0x88, 0x00, 0x28, 0xA8, 0x80, 0x00, 0x88, 0xCD, 0x4C, 0x40, 0x0A, 0x88, 0x80,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xE0, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x88, 0x00, 0x80, 0x01, 0x06, 0x10, 0x00, 0x56, 0xE7, 0x50, 0x80, 0x02, 0x1F, 0xF1, 0x00, 0x38,
+ 0x8C, 0xB8, 0x00, 0x0B, 0xF6, 0x0B, 0x00, 0x94, 0xC0, 0x28, 0x00, 0x06, 0x07, 0x6A, 0x00, 0xCB, 0xA6, 0xC8, 0x00,
+ 0x00, 0x47, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x80, 0x00, 0x00, 0x39, 0x14,
+ 0x20, 0x02, 0x22, 0x24, 0x00, 0x08, 0xAE, 0xA8, 0x60, 0x04, 0x28, 0x99, 0x70, 0x07, 0x75, 0xD1, 0x04, 0x0F, 0xB3,
+ 0x33, 0xD0, 0x00, 0xAE, 0xBE, 0xA4, 0x25, 0x15, 0x20, 0xA0, 0x02, 0x61, 0x0C, 0x02, 0x20, 0x42, 0x08, 0x20, 0x2C,
+ 0x30, 0x14, 0x02, 0x02, 0x28, 0x82, 0x00, 0x03, 0xAC, 0xC1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x12, 0x00, 0x08, 0x00, 0x28, 0x00, 0x0A, 0xCF, 0xEE, 0x20, 0x0B, 0x62, 0x2E, 0x20, 0x02, 0x10, 0x82,
+ 0x40, 0x01, 0x44, 0xE4, 0x40, 0x03, 0x00, 0x0E, 0x00, 0x8D, 0xEA, 0xAC, 0x00, 0x02, 0x10, 0x0A, 0x00, 0x01, 0xE0,
+ 0x24, 0x00, 0x0C, 0x21, 0x02, 0x00, 0x09, 0x42, 0x21, 0x00, 0x00, 0xCC, 0xF4, 0x40, 0x02, 0xBF, 0xD4, 0x40, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x44, 0x40,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x0C, 0xCC, 0xC4, 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x00, 0x02, 0xA0,
+ 0x40, 0x00, 0x0C, 0xC0, 0x00, 0x04, 0xCE, 0x64, 0x40, 0x02, 0x08, 0x80, 0x00, 0x00, 0x90, 0x00, 0x40, 0x28, 0xA8,
+ 0x80, 0x00, 0x08, 0x01, 0x04, 0x00, 0x0A, 0x88, 0x80, 0x00, 0x04, 0x44, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x54, 0x44, 0x00,
+ 0xEE, 0xFE, 0xE0, 0x00, 0x09, 0x3B, 0x3F, 0x00, 0x21, 0xD8, 0x20, 0x00, 0x00, 0x54, 0x4F, 0x00, 0x18, 0x58, 0x20,
+ 0x00, 0x00, 0x01, 0x86, 0x00, 0xC6, 0x7E, 0x40, 0x00, 0x00, 0xEF, 0x66, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x00, 0xC0, 0x20, 0x00, 0xAA, 0xAA, 0xEA, 0x20, 0xEF, 0xFF, 0xFF, 0x00, 0x80,
+ 0x44, 0x19, 0x30, 0x00, 0x49, 0x24, 0x00, 0xC5, 0x35, 0x1B, 0x10, 0x00, 0x4B, 0x24, 0x00, 0x01, 0x35, 0xA0, 0x00,
+ 0x8C, 0xA9, 0xAC, 0x80, 0x00, 0x2C, 0x00, 0x00, 0x04, 0x21, 0xA4, 0x00, 0x2A, 0x84, 0x00, 0x00, 0x73, 0x11, 0xF1,
+ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x11, 0x19, 0x00, 0x00, 0x40, 0x00, 0x00, 0x8F, 0xEE,
+ 0xEF, 0xE0, 0x0B, 0x76, 0x66, 0xD0, 0x1A, 0x00, 0x0B, 0x40, 0x4C, 0x40, 0x02, 0xD0, 0x28, 0x00, 0x1A, 0x40, 0x01,
+ 0xD0, 0x2C, 0x10, 0x00, 0x00, 0x38, 0x40, 0x00, 0x40, 0x28, 0x10, 0x00, 0x01, 0xA0, 0x40, 0x00, 0x42, 0x83, 0x00,
+ 0x05, 0xFE, 0x44, 0x40, 0x03, 0xFD, 0x54, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x99, 0x9B,
+ 0x00, 0x00, 0x10, 0x20, 0x00, 0x07, 0x26, 0x21, 0x40, 0x2A, 0xFE, 0xEE, 0xA0, 0x8D, 0x8C, 0xA9, 0xC0, 0x00, 0x10,
+ 0x20, 0x80, 0x32, 0x33, 0xB3, 0x60, 0x00, 0x19, 0x28, 0x00, 0x00, 0x00, 0xA1, 0x40, 0x00, 0x10, 0xB1, 0x00, 0x00,
+ 0x08, 0x34, 0x00, 0x00, 0x1A, 0x08, 0x00, 0x05, 0xF7, 0x40, 0x00, 0x8E, 0xF4, 0x44, 0xC0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x02, 0x80, 0x00, 0x04, 0x00, 0x00, 0x1D, 0x11, 0xDB, 0x00, 0xDD, 0xFD, 0xDD,
+ 0xD0, 0x0C, 0x88, 0x07, 0x00, 0x02, 0x06, 0x00, 0x90, 0x48, 0x00, 0x34, 0x00, 0x2C, 0x04, 0x2C, 0x10, 0x48, 0x11,
+ 0x21, 0x40, 0x04, 0x84, 0x83, 0x40, 0x59, 0x03, 0x00, 0x50, 0x40, 0x0C, 0x10, 0x60, 0x42, 0xA9, 0x88, 0xC0, 0x40,
+ 0x15, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x02, 0x00, 0x40, 0x08, 0x98, 0x88, 0x80,
+ 0x08, 0xF9, 0x98, 0xC0, 0x06, 0x77, 0x75, 0x50, 0x02, 0x0C, 0x05, 0x00, 0x19, 0x98, 0xA8, 0xD0, 0x0B, 0x99, 0xCA,
+ 0x80, 0x04, 0x54, 0x65, 0xC0, 0x20, 0x08, 0x50, 0x20, 0x00, 0x10, 0x20, 0xC0, 0x31, 0x1C, 0x04, 0x20, 0x00, 0x01,
+ 0x28, 0x40, 0x26, 0x63, 0xBB, 0xE0, 0x26, 0xEF, 0xE6, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x02, 0x01, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0F, 0x8A, 0x89, 0x80, 0xC3, 0xF3, 0x11, 0x30, 0x0F, 0x02, 0x01, 0x80,
+ 0xC9, 0xC0, 0x00, 0x30, 0x0F, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00, 0x30, 0x0E, 0x02, 0x05, 0xA0, 0x00, 0x00, 0x00,
+ 0x30, 0x0E, 0x02, 0x52, 0x80, 0x00, 0x00, 0x03, 0x00, 0x2C, 0xDF, 0xA8, 0x80, 0x02, 0x33, 0x30, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x88, 0x00, 0x01, 0x02, 0x80, 0x00, 0x03, 0xFF, 0xF7, 0x00, 0x0F,
+ 0x26, 0xE4, 0x72, 0xCC, 0x38, 0x00, 0x40, 0x0C, 0x38, 0x99, 0x00, 0x03, 0x0A, 0x31, 0x50, 0x0C, 0xB1, 0x82, 0x80,
+ 0x03, 0x28, 0x06, 0x00, 0x87, 0x88, 0x2A, 0xA0, 0x01, 0x05, 0xC2, 0x00, 0x85, 0x82, 0xC2, 0x80, 0x10, 0x00, 0x39,
+ 0x10, 0x08, 0x51, 0xBF, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x00, 0x48, 0x9D,
+ 0xCC, 0x40, 0xC9, 0xE6, 0x7F, 0x40, 0x40, 0x00, 0x94, 0x00, 0x5B, 0x21, 0x0C, 0xB0, 0x48, 0xAE, 0xCC, 0x40, 0xE1,
+ 0x30, 0x0C, 0x30, 0x43, 0x01, 0xA4, 0x00, 0xE1, 0x24, 0x5D, 0x30, 0x78, 0x8C, 0xD6, 0x10, 0xF1, 0x60, 0x94, 0x70,
+ 0xD0, 0x40, 0x9C, 0x70, 0x0B, 0x8C, 0x53, 0x00, 0x0C, 0x9D, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x01, 0x39, 0x50, 0x00, 0x00, 0x88, 0xF0, 0x00, 0x2E, 0xAF, 0xC6, 0x00, 0x03, 0x01, 0x77, 0x60, 0x04, 0xF0,
+ 0x41, 0x60, 0x03, 0x92, 0xF8, 0x12, 0x0F, 0xBD, 0x91, 0x40, 0x1B, 0x28, 0x60, 0x92, 0x70, 0xF4, 0x01, 0xF0, 0x0A,
+ 0xD4, 0x65, 0x82, 0x53, 0xE0, 0x01, 0xE0, 0x04, 0x10, 0x68, 0x60, 0x04, 0x2A, 0xBE, 0x00, 0x00, 0x4F, 0x80, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x3A, 0xEE, 0x00, 0xC8, 0xC0, 0x00, 0x00, 0x0D, 0x84, 0xA5,
+ 0x00, 0xC1, 0xC2, 0x11, 0x00, 0x45, 0x0E, 0x27, 0x00, 0xD9, 0xC3, 0x00, 0x10, 0x07, 0xF8, 0x8D, 0x20, 0x01, 0x30,
+ 0x00, 0x10, 0xAC, 0x02, 0x25, 0xA0, 0x01, 0x22, 0x00, 0x10, 0x44, 0x20, 0x16, 0xA0, 0x13, 0x02, 0x00, 0x30, 0x04,
+ 0x1B, 0xAA, 0x40, 0x21, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-#define gDPSetPrimColorMod(pkt, m, l, rgba) \
-_DW({ \
- Gfx *_g = (Gfx *)(pkt); \
- \
- _g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | \
- _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \
- _g->words.w1 = (rgba); \
-})
+#define gDPSetPrimColorMod(pkt, m, l, rgba) \
+ _DW({ \
+ Gfx* _g = (Gfx*)(pkt); \
+ \
+ _g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \
+ _g->words.w1 = (rgba); \
+ })
#ifdef NON_MATCHING
// regalloc and minor ordering differences
-void GfxPrint_InitDlist(GfxPrint* this)
-{
+void GfxPrint_InitDlist(GfxPrint* this) {
s32 width = 16;
s32 height = 256;
s32 i;
gDPPipeSync(this->dlist++);
gDPSetOtherMode(this->dlist++,
- G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP |
- G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_IA16 | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2);
- gDPSetCombineLERP(this->dlist++,
- 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0,
- 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0);
+ gDPSetCombineLERP(this->dlist++, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0);
gDPSetTextureImage(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK, 1, sGfxPrintFontData);
- gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK,
- 0, 0, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(this->dlist++);
- gDPLoadBlock(this->dlist++, G_TX_LOADTILE, 0, 0,
- (((width)*(height) + G_IM_SIZ_4b_INCR) >> G_IM_SIZ_4b_SHIFT) - 1,
- CALC_DXT(width, G_IM_SIZ_4b_BYTES));
+ gDPLoadBlock(this->dlist++, G_TX_LOADTILE, 0, 0, (((width) * (height) + G_IM_SIZ_4b_INCR) >> G_IM_SIZ_4b_SHIFT) - 1,
+ CALC_DXT(width, G_IM_SIZ_4b_BYTES));
gDPPipeSync(this->dlist++);
- gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b,
- 1, 0, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
- gDPSetTileSize(this->dlist++, G_TX_RENDERTILE, 0, 0,
- ((width)-1) << G_TEXTURE_IMAGE_FRAC,
+ gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTileSize(this->dlist++, G_TX_RENDERTILE, 0, 0, ((width)-1) << G_TEXTURE_IMAGE_FRAC,
((height)-1) << G_TEXTURE_IMAGE_FRAC);
gDPLoadTLUT(this->dlist++, 64, 256, sGfxPrintFontTLUT);
- for (i = 1; i < 4; i++)
- {
- gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b,
- 1, 0, i * 2, i,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ for (i = 1; i < 4; i++) {
+ gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2, i, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPSetTileSize(this->dlist++, i * 2, 0, 0, 60, 1020);
}
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
gDPSetTextureImage(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, sGfxPrintUnkData);
- gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b,
- 1, 0, G_TX_LOADTILE, 0 ,
- G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
+ gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 3,
+ G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
gDPLoadSync(this->dlist++);
gDPLoadTile(this->dlist++, G_TX_LOADTILE, 0, 0, 2, 28);
gDPPipeSync(this->dlist++);
- gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b,
- 1, 0, 1, 4,
- G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
+ gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, 1, 4, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
gDPSetTileSize(this->dlist++, 1, 0, 0, 4, 28);
gDPLoadTLUT(this->dlist++, 16, 320, sGfxPrintUnkTLUT);
- for (i = 1; i < 4; i++)
- {
- gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b,
- 1, 0, i * 2 + 1, 4,
- G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
+ for (i = 1; i < 4; i++) {
+ gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, i * 2 + 1, 4, G_TX_NOMIRROR | G_TX_WRAP, 3,
+ G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 1, G_TX_NOLOD);
gDPSetTileSize(this->dlist++, i * 2 + 1, 0, 0, 4, 28);
}
}
@@ -190,8 +198,7 @@ void GfxPrint_InitDlist(GfxPrint* this)
#pragma GLOBAL_ASM("asm/non_matchings/code/gfxprint/GfxPrint_InitDlist.s")
#endif
-void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a)
-{
+void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a) {
this->color.r = r;
this->color.g = g;
this->color.b = b;
@@ -200,89 +207,61 @@ void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a)
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
}
-
-void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y)
-{
+void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y) {
this->posX = this->baseX + (x << 2);
this->posY = this->baseY + (y << 2);
}
-void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y)
-{
+void GfxPrint_SetPos(GfxPrint* this, s32 x, s32 y) {
GfxPrint_SetPosPx(this, x << 3, y << 3);
}
-void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y)
-{
+void GfxPrint_SetBasePosPx(GfxPrint* this, s32 x, s32 y) {
this->baseX = x << 2;
this->baseY = y << 2;
}
#ifdef NON_MATCHING
// regalloc and ordering differences
-void GfxPrint_PrintCharImpl(GfxPrint* this, char c)
-{
- if (this->flag & GFXPRINT_UPDATE_MODE)
- {
+void GfxPrint_PrintCharImpl(GfxPrint* this, char c) {
+ if (this->flag & GFXPRINT_UPDATE_MODE) {
this->flag &= ~GFXPRINT_UPDATE_MODE;
gDPPipeSync(this->dlist++);
- if (this->flag & GFXPRINT_USE_RGBA16)
- {
+ if (this->flag & GFXPRINT_USE_RGBA16) {
gDPSetTextureLUT(this->dlist++, G_TT_RGBA16);
gDPSetCycleType(this->dlist++, G_CYC_2CYCLE);
gDPSetRenderMode(this->dlist++, G_RM_OPA_CI, G_RM_XLU_SURF2);
- gDPSetCombineLERP(this->dlist++,
- TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0,
- 0, 0, 0, COMBINED, 0, 0, 0, COMBINED);
- }
- else
- {
+ gDPSetCombineLERP(this->dlist++, TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0,
+ COMBINED);
+ } else {
gDPSetTextureLUT(this->dlist++, G_TT_IA16);
gDPSetCycleType(this->dlist++, G_CYC_1CYCLE);
gDPSetRenderMode(this->dlist++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
- gDPSetCombineLERP(this->dlist++,
- TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0,
- TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0);
+ gDPSetCombineLERP(this->dlist++, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0,
+ TEXEL0);
}
}
- if (this->flag & GFXPRINT_FLAG4)
- {
+ if (this->flag & GFXPRINT_FLAG4) {
gDPSetPrimColorMod(this->dlist++, 0, 0, 0);
if (this->flag & GFXPRINT_FLAG64)
- gSPTextureRectangle(this->dlist++,
- (this->posX + 4) << 1, (this->posY + 4) << 1,
- (this->posX + 4 + 32) << 1, (this->posY + 4 + 32) << 1,
- c * 2,
- (u16)(c & 4) * 64, (u16)(c >> 3) * 256,
- 512, 512);
+ gSPTextureRectangle(this->dlist++, (this->posX + 4) << 1, (this->posY + 4) << 1, (this->posX + 4 + 32) << 1,
+ (this->posY + 4 + 32) << 1, c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 512, 512);
else
- gSPTextureRectangle(this->dlist++,
- this->posX + 4, this->posY + 4,
- this->posX + 4 + 32, this->posY + 4 + 32,
- c * 2,
- (u16)(c & 4) * 64, (u16)(c >> 3) * 256,
- 1024, 1024);
+ gSPTextureRectangle(this->dlist++, this->posX + 4, this->posY + 4, this->posX + 4 + 32, this->posY + 4 + 32,
+ c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024);
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
}
if (this->flag & GFXPRINT_FLAG64)
- gSPTextureRectangle(this->dlist++,
- (this->posX) << 1, (this->posY) << 1,
- (this->posX + 32) << 1, (this->posY + 32) << 1,
- c * 2,
- (u16)(c & 4) * 64, (u16)(c >> 3) * 256,
- 512, 512);
+ gSPTextureRectangle(this->dlist++, (this->posX) << 1, (this->posY) << 1, (this->posX + 32) << 1,
+ (this->posY + 32) << 1, c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 512, 512);
else
- gSPTextureRectangle(this->dlist++,
- this->posX, this->posY,
- this->posX + 32, this->posY + 32,
- c * 2,
- (u16)(c & 4) * 64, (u16)(c >> 3) * 256,
- 1024, 1024);
+ gSPTextureRectangle(this->dlist++, this->posX, this->posY, this->posX + 32, this->posY + 32, c * 2,
+ (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024);
this->posX += 32;
}
@@ -290,33 +269,24 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, char c)
#pragma GLOBAL_ASM("asm/non_matchings/code/gfxprint/GfxPrint_PrintCharImpl.s")
#endif
-void GfxPrint_PrintChar(GfxPrint* this, u8 c)
-{
+void GfxPrint_PrintChar(GfxPrint* this, u8 c) {
u8 charParam = c;
- if (c == ' ')
- {
+ if (c == ' ') {
this->posX += 0x20;
- }
- else if (c > 0x20 && c < 0x7F)
- {
+ } else if (c > 0x20 && c < 0x7F) {
GfxPrint_PrintCharImpl(this, charParam);
- }
- else if (c >= 0xA0 && c < 0xE0)
- {
- if (this->flag & GFXPRINT_FLAG1)
- {
- if (c < 0xC0)
+ } else if (c >= 0xA0 && c < 0xE0) {
+ if (this->flag & GFXPRINT_FLAG1) {
+ if (c < 0xC0) {
charParam = c - 0x20;
- else
+ } else {
charParam = c + 0x20;
+ }
}
GfxPrint_PrintCharImpl(this, charParam);
- }
- else
- {
- switch (c)
- {
+ } else {
+ switch (c) {
case 0:
break;
case '\n':
@@ -325,8 +295,7 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c)
this->posX = this->baseX;
break;
case '\t':
- do
- {
+ do {
GfxPrint_PrintCharImpl(this, 0x20);
} while ((this->posX - this->baseX) % 256);
break;
@@ -351,32 +320,28 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c)
}
}
-void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount)
-{
+void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount) {
const char* str = (const char*)buffer;
size_t count = charSize * charCount;
- while (count)
- {
+ while (count) {
GfxPrint_PrintChar(this, *str++);
count--;
}
}
-void GfxPrint_PrintString(GfxPrint* this, const char* str)
-{
- while (*str)
+void GfxPrint_PrintString(GfxPrint* this, const char* str) {
+ while (*str) {
GfxPrint_PrintChar(this, *(str++));
+ }
}
-GfxPrint* GfxPrint_Callback(GfxPrint* this, const char* str, size_t size)
-{
+GfxPrint* GfxPrint_Callback(GfxPrint* this, const char* str, size_t size) {
GfxPrint_PrintStringWithSize(this, str, sizeof(char), size);
return this;
}
-void GfxPrint_Ctor(GfxPrint* this)
-{
+void GfxPrint_Ctor(GfxPrint* this) {
this->flag &= ~GFXPRINT_OPEN;
this->callback = &GfxPrint_Callback;
@@ -392,31 +357,27 @@ void GfxPrint_Ctor(GfxPrint* this)
this->flag |= GFXPRINT_FLAG4;
this->flag |= GFXPRINT_UPDATE_MODE;
- if ((D_801755F0 & GFXPRINT_FLAG64))
+ if ((D_801755F0 & GFXPRINT_FLAG64)) {
this->flag |= GFXPRINT_FLAG64; //? dsdx/dtdy
- else
+ } else {
this->flag &= ~GFXPRINT_FLAG64;
+ }
}
-void GfxPrint_Dtor(GfxPrint* this)
-{
-
+void GfxPrint_Dtor(GfxPrint* this) {
}
-void GfxPrint_Open(GfxPrint* this, Gfx* dlist)
-{
- if (!(this->flag & GFXPRINT_OPEN))
- {
+void GfxPrint_Open(GfxPrint* this, Gfx* dlist) {
+ if (!(this->flag & GFXPRINT_OPEN)) {
this->flag |= GFXPRINT_OPEN;
this->dlist = dlist;
GfxPrint_InitDlist(this);
- }
- else
+ } else {
osSyncPrintf("gfxprint_open:2重オープンです\n");
+ }
}
-Gfx* GfxPrint_Close(GfxPrint* this)
-{
+Gfx* GfxPrint_Close(GfxPrint* this) {
Gfx* ret;
this->flag &= ~GFXPRINT_OPEN;
@@ -426,13 +387,11 @@ Gfx* GfxPrint_Close(GfxPrint* this)
return ret;
}
-void GfxPrint_VPrintf(GfxPrint *this, const char *fmt, va_list args)
-{
+void GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) {
func_800FF340(&this->callback, fmt, args);
}
-void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...)
-{
+void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c
index eb7eb780b..35be0e353 100644
--- a/src/code/irqmgr.c
+++ b/src/code/irqmgr.c
@@ -6,18 +6,17 @@ volatile OSTime sIrqMgrResetTime = 0;
volatile OSTime sIrqMgrRetraceTime = 0;
u32 sIrqMgrRetraceCount = 0;
-#define RETRACE_MSG 666
-#define PRE_NMI_MSG 669
-#define PRENMI450_MSG 671
-#define PRENMI480_MSG 672
-#define PRENMI500_MSG 673
-
-#define STATUS_IDLE 0
-#define STATUS_PRENMI 1
-#define STATUS_NMI 2
-
-void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ)
-{
+#define RETRACE_MSG 666
+#define PRE_NMI_MSG 669
+#define PRENMI450_MSG 671
+#define PRENMI480_MSG 672
+#define PRENMI500_MSG 673
+
+#define STATUS_IDLE 0
+#define STATUS_PRENMI 1
+#define STATUS_NMI 2
+
+void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ) {
u32 prevMask;
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 96);
@@ -32,15 +31,16 @@ void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ)
osSetIntMask(prevMask);
- if (this->resetStatus > STATUS_IDLE)
- osSendMesg(c->queue, (OSMesg)&this->prenmiMsg, OS_MESG_NOBLOCK);
+ if (this->resetStatus > STATUS_IDLE) {
+ osSendMesg(c->queue, (OSMesg) & this->prenmiMsg, OS_MESG_NOBLOCK);
+ }
- if (this->resetStatus >= STATUS_NMI)
- osSendMesg(c->queue, (OSMesg)&this->nmiMsg, OS_MESG_NOBLOCK);
+ if (this->resetStatus >= STATUS_NMI) {
+ osSendMesg(c->queue, (OSMesg) & this->nmiMsg, OS_MESG_NOBLOCK);
+ }
}
-void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c)
-{
+void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c) {
IrqMgrClient* iter;
IrqMgrClient* lastIter;
u32 prevMask;
@@ -50,17 +50,16 @@ void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c)
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 129);
LogUtils_CheckNullPointer("c", c, "../irqmgr.c", 130);
-
+
prevMask = osSetIntMask(1);
- while (iter)
- {
- if (iter == c)
- {
- if (lastIter)
+ while (iter) {
+ if (iter == c) {
+ if (lastIter) {
lastIter->prev = c->prev;
- else
+ } else {
this->clients = c->prev;
+ }
break;
}
lastIter = iter;
@@ -70,160 +69,150 @@ void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c)
osSetIntMask(prevMask);
}
-void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg)
-{
+void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg) {
IrqMgrClient* iter;
iter = this->clients;
- while(iter)
- {
- if (iter->queue->validCount >= iter->queue->msgCount)
- //irqmgr_SendMesgForClient: Message queue is overflowing mq=%08x cnt=%d
- osSyncPrintf(VT_COL(RED, WHITE) "irqmgr_SendMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, iter->queue, iter->queue->validCount);
- else
+ while (iter) {
+ if (iter->queue->validCount >= iter->queue->msgCount) {
+ // irqmgr_SendMesgForClient: Message queue is overflowing mq=%08x cnt=%d
+ osSyncPrintf(
+ VT_COL(RED, WHITE) "irqmgr_SendMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST,
+ iter->queue, iter->queue->validCount);
+ } else {
osSendMesg(iter->queue, msg, OS_MESG_NOBLOCK);
-
+ }
+
iter = iter->prev;
}
}
-void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg)
-{
+void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg) {
IrqMgrClient* iter;
iter = this->clients;
- while(iter)
- {
- if (iter->queue->validCount >= iter->queue->msgCount)
- //irqmgr_JamMesgForClient: Message queue is overflowing mq=%08x cnt=%d
- osSyncPrintf(VT_COL(RED, WHITE) "irqmgr_JamMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST, iter->queue, iter->queue->validCount);
- else
- //mistake? the function's name suggests it would use osJamMesg
+ while (iter) {
+ if (iter->queue->validCount >= iter->queue->msgCount) {
+ // irqmgr_JamMesgForClient: Message queue is overflowing mq=%08x cnt=%d
+ osSyncPrintf(
+ VT_COL(RED, WHITE) "irqmgr_JamMesgForClient:メッセージキューがあふれています mq=%08x cnt=%d\n" VT_RST,
+ iter->queue, iter->queue->validCount);
+ } else {
+ // mistake? the function's name suggests it would use osJamMesg
osSendMesg(iter->queue, msg, OS_MESG_NOBLOCK);
-
+ }
+
iter = iter->prev;
}
}
-void IrqMgr_HandlePreNMI(IrqMgr *this)
-{
- u64 temp = STATUS_PRENMI; //required to match
+void IrqMgr_HandlePreNMI(IrqMgr* this) {
+ u64 temp = STATUS_PRENMI; // required to match
gIrqMgrResetStatus = temp;
this->resetStatus = STATUS_PRENMI;
sIrqMgrResetTime = this->resetTime = osGetTime();
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(450000), 0ull, &this->queue, (OSMesg)PRENMI450_MSG);
- IrqMgr_JamMesgForClient(this, (OSMesg)&this->prenmiMsg);
+ IrqMgr_JamMesgForClient(this, (OSMesg) & this->prenmiMsg);
}
-void IrqMgr_CheckStack()
-{
- osSyncPrintf("irqmgr.c: PRENMIから0.5秒経過\n"); //0.5 seconds after PRENMI
- if (StackCheck_Check(NULL) == 0)
- {
- osSyncPrintf("スタックは大丈夫みたいです\n"); //The stack looks ok
- }
- else
- {
+void IrqMgr_CheckStack() {
+ osSyncPrintf("irqmgr.c: PRENMIから0.5秒経過\n"); // 0.5 seconds after PRENMI
+ if (StackCheck_Check(NULL) == 0) {
+ osSyncPrintf("スタックは大丈夫みたいです\n"); // The stack looks ok
+ } else {
osSyncPrintf("%c", 7);
osSyncPrintf(VT_FGCOL(RED));
- osSyncPrintf("スタックがオーバーフローしたか危険な状態です\n"); //Stack overflow or dangerous
- osSyncPrintf("早々にスタックサイズを増やすか、スタックを消費しないようにしてください\n"); //Increase stack size early or don't consume stack
+ osSyncPrintf("スタックがオーバーフローしたか危険な状態です\n"); // Stack overflow or dangerous
+ osSyncPrintf(
+ "早々にスタックサイズを増やすか、スタックを消費しないようにしてください\n"); // Increase stack size early or
+ // don't consume stack
osSyncPrintf(VT_RST);
}
}
-void IrqMgr_HandlePRENMI450(IrqMgr* this)
-{
- u64 temp = STATUS_NMI; //required to match
+void IrqMgr_HandlePRENMI450(IrqMgr* this) {
+ u64 temp = STATUS_NMI; // required to match
gIrqMgrResetStatus = temp;
this->resetStatus = STATUS_NMI;
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(30000), 0ull, &this->queue, (OSMesg)PRENMI480_MSG);
- IrqMgr_SendMesgForClient(this, (OSMesg)&this->nmiMsg);
+ IrqMgr_SendMesgForClient(this, (OSMesg) & this->nmiMsg);
}
-void IrqMgr_HandlePRENMI480(IrqMgr* this)
-{
+void IrqMgr_HandlePRENMI480(IrqMgr* this) {
u32 ret;
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(20000), 0ull, &this->queue, (OSMesg)PRENMI500_MSG);
- ret = func_801031F0(); //osAfterPreNMI
- if (ret)
- {
- osSyncPrintf("osAfterPreNMIが %d を返しました!?\n", ret); //osAfterPreNMI returned %d !?
+ ret = func_801031F0(); // osAfterPreNMI
+ if (ret) {
+ osSyncPrintf("osAfterPreNMIが %d を返しました!?\n", ret); // osAfterPreNMI returned %d !?
osSetTimer(&this->timer, OS_USEC_TO_CYCLES(1000), 0ull, &this->queue, (OSMesg)PRENMI480_MSG);
}
}
-void IrqMgr_HandlePRENMI500(IrqMgr* this)
-{
+void IrqMgr_HandlePRENMI500(IrqMgr* this) {
IrqMgr_CheckStack();
}
-void IrqMgr_HandleRetrace(IrqMgr* this)
-{
- if (sIrqMgrRetraceTime == 0ull)
- {
- if (this->retraceTime == 0)
+void IrqMgr_HandleRetrace(IrqMgr* this) {
+ if (sIrqMgrRetraceTime == 0ull) {
+ if (this->retraceTime == 0) {
this->retraceTime = osGetTime();
- else
+ } else {
sIrqMgrRetraceTime = osGetTime() - this->retraceTime;
+ }
}
sIrqMgrRetraceCount++;
- IrqMgr_SendMesgForClient(this, (OSMesg)&this->retraceMsg);
+ IrqMgr_SendMesgForClient(this, (OSMesg) & this->retraceMsg);
}
-void IrqMgr_ThreadEntry(void* arg0)
-{
+void IrqMgr_ThreadEntry(void* arg0) {
OSMesg msg;
IrqMgr* this;
u8 exit;
this = (IrqMgr*)arg0;
msg = 0;
- osSyncPrintf("IRQマネージャスレッド実行開始\n"); //Start IRQ manager thread execution
+ osSyncPrintf("IRQマネージャスレッド実行開始\n"); // Start IRQ manager thread execution
exit = false;
- while (!exit)
- {
+ while (!exit) {
osRecvMesg(&this->queue, &msg, OS_MESG_BLOCK);
- switch ((u32)msg)
- {
+ switch ((u32)msg) {
case RETRACE_MSG:
IrqMgr_HandleRetrace(this);
break;
case PRE_NMI_MSG:
osSyncPrintf("PRE_NMI_MSG\n");
- osSyncPrintf("スケジューラ:PRE_NMIメッセージを受信\n"); //Scheduler: Receives PRE_NMI message
+ osSyncPrintf("スケジューラ:PRE_NMIメッセージを受信\n"); // Scheduler: Receives PRE_NMI message
IrqMgr_HandlePreNMI(this);
break;
case PRENMI450_MSG:
osSyncPrintf("PRENMI450_MSG\n");
- osSyncPrintf("スケジューラ:PRENMI450メッセージを受信\n"); //Scheduler: Receives PRENMI450 message
+ osSyncPrintf("スケジューラ:PRENMI450メッセージを受信\n"); // Scheduler: Receives PRENMI450 message
IrqMgr_HandlePRENMI450(this);
break;
case PRENMI480_MSG:
osSyncPrintf("PRENMI480_MSG\n");
- osSyncPrintf("スケジューラ:PRENMI480メッセージを受信\n"); //Scheduler: Receives PRENMI480 message
+ osSyncPrintf("スケジューラ:PRENMI480メッセージを受信\n"); // Scheduler: Receives PRENMI480 message
IrqMgr_HandlePRENMI480(this);
break;
case PRENMI500_MSG:
osSyncPrintf("PRENMI500_MSG\n");
- osSyncPrintf("スケジューラ:PRENMI500メッセージを受信\n"); //Scheduler: Receives PRENMI500 message
+ osSyncPrintf("スケジューラ:PRENMI500メッセージを受信\n"); // Scheduler: Receives PRENMI500 message
exit = true;
IrqMgr_HandlePRENMI500(this);
break;
default:
- osSyncPrintf("irqmgr.c:予期しないメッセージを受け取りました(%08x)\n", msg); //Unexpected message received
+ osSyncPrintf("irqmgr.c:予期しないメッセージを受け取りました(%08x)\n",
+ msg); // Unexpected message received
break;
-
}
}
- osSyncPrintf("IRQマネージャスレッド実行終了\n"); //End of IRQ manager thread execution
+ osSyncPrintf("IRQマネージャスレッド実行終了\n"); // End of IRQ manager thread execution
}
-void IrqMgr_Create(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount)
-{
+void IrqMgr_Create(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount) {
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 346);
LogUtils_CheckNullPointer("stack", stack, "../irqmgr.c", 347);
this->clients = NULL;
diff --git a/src/code/listalloc.c b/src/code/listalloc.c
index 20cc88e1c..b7d97281c 100644
--- a/src/code/listalloc.c
+++ b/src/code/listalloc.c
@@ -1,64 +1,66 @@
#include <global.h>
-ListAlloc* ListAlloc_Init(ListAlloc* this)
-{
+ListAlloc* ListAlloc_Init(ListAlloc* this) {
this->prev = NULL;
this->next = NULL;
return this;
}
-void* ListAlloc_Alloc(ListAlloc* this, u32 size)
-{
+void* ListAlloc_Alloc(ListAlloc* this, u32 size) {
ListAlloc* ptr;
ListAlloc* next;
-
+
ptr = SystemArena_MallocDebug(size + sizeof(ListAlloc), "../listalloc.c", 40);
- if (!ptr)
+ if (!ptr) {
return NULL;
+ }
next = this->next;
- if (next)
+ if (next) {
next->next = ptr;
-
+ }
+
ptr->prev = next;
ptr->next = NULL;
this->next = ptr;
- if (!this->prev)
+ if (!this->prev) {
this->prev = ptr;
+ }
return (u8*)ptr + sizeof(ListAlloc);
}
-void ListAlloc_Free(ListAlloc* this, void* data)
-{
+void ListAlloc_Free(ListAlloc* this, void* data) {
ListAlloc* ptr;
ptr = &((ListAlloc*)data)[-1];
- if (ptr->prev)
+ if (ptr->prev) {
ptr->prev->next = ptr->next;
+ }
- if (ptr->next)
+ if (ptr->next) {
ptr->next->prev = ptr->prev;
+ }
- if (this->prev == ptr)
+ if (this->prev == ptr) {
this->prev = ptr->next;
+ }
- if (this->next == ptr)
+ if (this->next == ptr) {
this->next = ptr->prev;
+ }
SystemArena_FreeDebug(ptr, "../listalloc.c", 72);
}
-void ListAlloc_FreeAll(ListAlloc* this)
-{
+void ListAlloc_FreeAll(ListAlloc* this) {
ListAlloc* iter;
iter = this->prev;
- while (iter)
- {
+ while (iter) {
ListAlloc_Free(this, (u8*)iter + sizeof(ListAlloc));
iter = this->prev;
}
diff --git a/src/code/loadfragment2.c b/src/code/loadfragment2.c
index b47bae4c1..2a304bbeb 100644
--- a/src/code/loadfragment2.c
+++ b/src/code/loadfragment2.c
@@ -1,20 +1,18 @@
#include <global.h>
-void *Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd)
-{
- void *allocatedVRamAddr;
+void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd) {
+ void* allocatedVRamAddr;
allocatedVRamAddr = SystemArena_MallocRDebug((s32)vRamEnd - (s32)vRamStart, "../loadfragment2.c", 31);
- if(gOverlayLogSeverity >= 3)
- {
- osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vRamStart, vRamEnd, allocatedVRamAddr, ((u32)vRamEnd - (u32)vRamStart) + (u32)allocatedVRamAddr, (u32)vRamStart - (u32)allocatedVRamAddr);
+ if (gOverlayLogSeverity >= 3) {
+ osSyncPrintf("OVL:SPEC(%08x-%08x) REAL(%08x-%08x) OFFSET(%08x)\n", vRamStart, vRamEnd, allocatedVRamAddr,
+ ((u32)vRamEnd - (u32)vRamStart) + (u32)allocatedVRamAddr, (u32)vRamStart - (u32)allocatedVRamAddr);
}
- if(allocatedVRamAddr != NULL)
- {
+ if (allocatedVRamAddr != NULL) {
Overlay_Load(vRomStart, vRomEnd, vRamStart, vRamEnd, allocatedVRamAddr);
}
return allocatedVRamAddr;
-} \ No newline at end of file
+}
diff --git a/src/code/logseverity.c b/src/code/logseverity.c
index b62552e1b..25bc68c46 100644
--- a/src/code/logseverity.c
+++ b/src/code/logseverity.c
@@ -1,3 +1,3 @@
#include <global.h>
-s32 gOverlayLogSeverity = 2; \ No newline at end of file
+s32 gOverlayLogSeverity = 2;
diff --git a/src/code/main.c b/src/code/main.c
index 987654a41..5e2b9a89e 100644
--- a/src/code/main.c
+++ b/src/code/main.c
@@ -23,21 +23,19 @@ StackEntry sSchedStackInfo;
StackEntry sAudioStackInfo;
StackEntry sPadMgrStackInfo;
StackEntry sIrqMgrStackInfo;
-u8 gAudioMgr[0x298]; //type should be AudioMgr
+u8 gAudioMgr[0x298]; // type should be AudioMgr
OSMesgQueue sSiIntMsgQ;
OSMesg sSiIntMsgBuf[1];
-
-void Main_LogSystemHeap()
-{
+void Main_LogSystemHeap() {
osSyncPrintf(VT_FGCOL(GREEN));
- //System heap size% 08x (% dKB) Start address% 08x
- osSyncPrintf("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024, gSystemHeap);
+ // System heap size% 08x (% dKB) Start address% 08x
+ osSyncPrintf("システムヒープサイズ %08x(%dKB) 開始アドレス %08x\n", gSystemHeapSize, gSystemHeapSize / 1024,
+ gSystemHeap);
osSyncPrintf(VT_RST);
}
-void Main(void* arg0)
-{
+void Main(void* arg0) {
IrqMgrClient irqClient;
OSMesgQueue irqMgrMsgQ;
OSMesg irqMgrMsgBuf[60];
@@ -45,9 +43,9 @@ void Main(void* arg0)
u32 fb;
s32 debugHeap;
s32 debugHeapSize;
- s16 *msg;
+ s16* msg;
- osSyncPrintf("mainproc 実行開始\n"); //Start running
+ osSyncPrintf("mainproc 実行開始\n"); // Start running
gScreenWidth = SCREEN_WIDTH;
gScreenHeight = SCREEN_HEIGHT;
gAppNmiBufferPtr = (PreNmiBuff*)osAppNmiBuffer;
@@ -57,15 +55,12 @@ void Main(void* arg0)
sysHeap = (u32)gSystemHeap;
fb = SysCfb_GetFbPtr(0);
gSystemHeapSize = (fb - sysHeap);
- osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", sysHeap, fb, gSystemHeapSize); //System heap initalization
- SystemHeap_Init(sysHeap, gSystemHeapSize); //initializes the system heap
- if (osMemSize >= 0x800000U)
- {
+ osSyncPrintf("システムヒープ初期化 %08x-%08x %08x\n", sysHeap, fb, gSystemHeapSize); // System heap initalization
+ SystemHeap_Init(sysHeap, gSystemHeapSize); // initializes the system heap
+ if (osMemSize >= 0x800000U) {
debugHeap = SysCfb_GetFbEnd();
- debugHeapSize = (s32) (0x80600000 - debugHeap);
- }
- else
- {
+ debugHeapSize = (s32)(0x80600000 - debugHeap);
+ } else {
debugHeapSize = 0x400;
debugHeap = SystemArena_MallocDebug(debugHeapSize, "../main.c", 0x235);
}
@@ -81,43 +76,42 @@ void Main(void* arg0)
Main_LogSystemHeap();
osCreateMesgQueue(&irqMgrMsgQ, irqMgrMsgBuf, 0x3c);
- StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, sIrqMgrStack+sizeof(sIrqMgrStack), 0, 0x100, "irqmgr");
+ StackCheck_Init(&sIrqMgrStackInfo, sIrqMgrStack, sIrqMgrStack + sizeof(sIrqMgrStack), 0, 0x100, "irqmgr");
IrqMgr_Create(&gIrqMgr, &sGraphStackInfo, 0x11, 1);
- osSyncPrintf("タスクスケジューラの初期化\n"); //Initialize the task scheduler
- StackCheck_Init(&sSchedStackInfo, sSchedStack, sSchedStack+sizeof(sSchedStack), 0, 0x100, "sched");
+ osSyncPrintf("タスクスケジューラの初期化\n"); // Initialize the task scheduler
+ StackCheck_Init(&sSchedStackInfo, sSchedStack, sSchedStack + sizeof(sSchedStack), 0, 0x100, "sched");
func_800C9874(&gSchedContext, &sAudioStack, 0xf, D_80013960, 1, &gIrqMgr);
IrqMgr_AddClient(&gIrqMgr, &irqClient, &irqMgrMsgQ);
- StackCheck_Init(&sAudioStackInfo, sAudioStack, sAudioStack+sizeof(sAudioStack), 0, 0x100, "audio");
- func_800C3FEC(&gAudioMgr, sAudioStack+sizeof(sAudioStack), 0xc, 0xa, &gSchedContext, &gIrqMgr);
+ StackCheck_Init(&sAudioStackInfo, sAudioStack, sAudioStack + sizeof(sAudioStack), 0, 0x100, "audio");
+ func_800C3FEC(&gAudioMgr, sAudioStack + sizeof(sAudioStack), 0xc, 0xa, &gSchedContext, &gIrqMgr);
- StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, sPadMgrStack+sizeof(sPadMgrStack), 0, 0x100, "padmgr");
+ StackCheck_Init(&sPadMgrStackInfo, sPadMgrStack, sPadMgrStack + sizeof(sPadMgrStack), 0, 0x100, "padmgr");
PadMgr_Init(&gPadMgr, &sSiIntMsgQ, &gIrqMgr, 7, 0xe, &sIrqMgrStack);
func_800C3FC4(&gAudioMgr);
- StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack+sizeof(sGraphStack), 0, 0x100, "graph");
- osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg0, sGraphStack+sizeof(sGraphStack), 0xb);
+ StackCheck_Init(&sGraphStackInfo, sGraphStack, sGraphStack + sizeof(sGraphStack), 0, 0x100, "graph");
+ osCreateThread(&sGraphThread, 4, Graph_ThreadEntry, arg0, sGraphStack + sizeof(sGraphStack), 0xb);
osStartThread(&sGraphThread);
osSetThreadPri(0, 0xf);
- while (true)
- {
+ while (true) {
msg = NULL;
osRecvMesg(&irqMgrMsgQ, &msg, OS_MESG_BLOCK);
- if (msg == NULL)
+ if (msg == NULL) {
break;
- if (*msg == OS_SC_PRE_NMI_MSG)
- {
- osSyncPrintf("main.c: リセットされたみたいだよ\n"); //Looks like it's been reset
+ }
+ if (*msg == OS_SC_PRE_NMI_MSG) {
+ osSyncPrintf("main.c: リセットされたみたいだよ\n"); // Looks like it's been reset
PreNmiBuff_SetReset(gAppNmiBufferPtr);
}
}
- osSyncPrintf("mainproc 後始末\n"); //Cleanup
+ osSyncPrintf("mainproc 後始末\n"); // Cleanup
osDestroyThread(&sGraphThread);
func_800FBFD8();
- osSyncPrintf("mainproc 実行終了\n"); //End of execution
+ osSyncPrintf("mainproc 実行終了\n"); // End of execution
}
diff --git a/src/code/padmgr.c b/src/code/padmgr.c
index 163e546b1..5cc539dbf 100644
--- a/src/code/padmgr.c
+++ b/src/code/padmgr.c
@@ -8,50 +8,53 @@
s32 D_8012D280 = 1;
-OSMesgQueue* PadMgr_LockGetControllerQueue(PadMgr* padmgr)
-{
+OSMesgQueue* PadMgr_LockGetControllerQueue(PadMgr* padmgr) {
OSMesgQueue* ctrlrqueue = NULL;
- if (D_8012D280 > 2)
- //EUC-JP: ロック待ち | Waiting for lock
- osSyncPrintf("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, &ctrlrqueue);
+ if (D_8012D280 > 2) {
+ // EUC-JP: ロック待ち | Waiting for lock
+ osSyncPrintf("%2d %d serialMsgQロック待ち %08x %08x %08x\n", osGetThreadId(NULL),
+ padmgr->queue1.validCount, padmgr, &padmgr->queue1, &ctrlrqueue);
+ }
osRecvMesg(&padmgr->queue1, &ctrlrqueue, OS_MESG_BLOCK);
- if (D_8012D280 > 2)
- //EUC-JP: をロックしました | Locked
- osSyncPrintf("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, ctrlrqueue);
+ if (D_8012D280 > 2) {
+ // EUC-JP: をロックしました | Locked
+ osSyncPrintf("%2d %d serialMsgQをロックしました %08x\n", osGetThreadId(NULL),
+ padmgr->queue1.validCount, ctrlrqueue);
+ }
return ctrlrqueue;
}
-void PadMgr_UnlockReleaseControllerQueue(PadMgr* padmgr, OSMesgQueue* ctrlrqueue)
-{
- if (D_8012D280 > 2)
- //EUC-JP: ロック解除します | Unlock
- osSyncPrintf("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
+void PadMgr_UnlockReleaseControllerQueue(PadMgr* padmgr, OSMesgQueue* ctrlrqueue) {
+ if (D_8012D280 > 2) {
+ // EUC-JP: ロック解除します | Unlock
+ osSyncPrintf("%2d %d serialMsgQロック解除します %08x %08x %08x\n", osGetThreadId(NULL),
+ padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
+ }
osSendMesg(&padmgr->queue1, ctrlrqueue, OS_MESG_BLOCK);
- if (D_8012D280 > 2)
- //EUC-JP: ロック解除しました | Unlocked
- osSyncPrintf("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL), padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
+ if (D_8012D280 > 2) {
+ // EUC-JP: ロック解除しました | Unlocked
+ osSyncPrintf("%2d %d serialMsgQロック解除しました %08x %08x %08x\n", osGetThreadId(NULL),
+ padmgr->queue1.validCount, padmgr, &padmgr->queue1, ctrlrqueue);
+ }
}
-void PadMgr_Lock2(PadMgr* padmgr)
-{
+void PadMgr_Lock2(PadMgr* padmgr) {
osRecvMesg(&padmgr->queue2, NULL, OS_MESG_BLOCK);
}
-void PadMgr_Unlock2(PadMgr* padmgr)
-{
+void PadMgr_Unlock2(PadMgr* padmgr) {
osSendMesg(&padmgr->queue2, NULL, OS_MESG_BLOCK);
}
#ifdef NON_MATCHING
// regalloc and minor ordering differences
-void func_800C740C(PadMgr* padmgr)
-{
+void func_800C740C(PadMgr* padmgr) {
static u32 D_8012D284 = 0;
static u32 D_8016A4F0;
s32 temp;
@@ -65,54 +68,39 @@ void func_800C740C(PadMgr* padmgr)
ctrlrqueue = PadMgr_LockGetControllerQueue(padmgr);
var1 = 0;
- for (i = 0; i < 4; i++)
- {
- if (padmgr->unk_2AA[i] != 0)
- {
- if (padmgr->pad_status[i].status & 1)
- {
- if (padmgr->unk_2AE[i] == temp)
- {
- if (padmgr->unk_2B2[i] != 0)
- {
- if (padmgr->unk_2B6[i] < 3)
- {
+ for (i = 0; i < 4; i++) {
+ if (padmgr->unk_2AA[i] != 0) {
+ if (padmgr->pad_status[i].status & 1) {
+ if (padmgr->unk_2AE[i] == temp) {
+ if (padmgr->unk_2B2[i] != 0) {
+ if (padmgr->unk_2B6[i] < 3) {
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック ぶるぶるぶるぶる");
osSyncPrintf(VT_RST);
- if (osSetVibration(&padmgr->unk_controller[i], temp) != 0)
- {
+ if (osSetVibration(&padmgr->unk_controller[i], temp) != 0) {
padmgr->unk_2AE[i] = 0;
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックで通信エラーが発生しました");
osSyncPrintf(VT_RST);
- }
- else
- {
+ } else {
padmgr->unk_2B6[i] = 3;
}
var1 = 1;
}
- }
- else
- {
- if (padmgr->unk_2B6[i] != 0)
- {
+ } else {
+ if (padmgr->unk_2B6[i] != 0) {
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止");
osSyncPrintf(VT_RST);
- if (osSetVibration(&padmgr->unk_controller[i], 0) != 0)
- {
+ if (osSetVibration(&padmgr->unk_controller[i], 0) != 0) {
padmgr->unk_2AE[i] = 0;
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックで通信エラーが発生しました");
osSyncPrintf(VT_RST);
- }
- else
- {
+ } else {
padmgr->unk_2B6[i]--;
}
@@ -120,22 +108,17 @@ void func_800C740C(PadMgr* padmgr)
}
}
}
- }
- else
- {
- if (padmgr->unk_2AE[i] != 0)
- {
- if (padmgr->unk_2AE[i] == 1)
- {
+ } else {
+ if (padmgr->unk_2AE[i] != 0) {
+ if (padmgr->unk_2AE[i] == 1) {
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックが抜かれたようです");
osSyncPrintf(VT_RST);
padmgr->unk_2AE[i] = 0;
- }
- else
- {
+ } else {
osSyncPrintf(VT_FGCOL(YELLOW));
- osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックではないコントローラパックが抜かれたようです");
+ osSyncPrintf("padmgr: %dコン: %s\n", i + 1,
+ "振動パックではないコントローラパックが抜かれたようです");
osSyncPrintf(VT_RST);
padmgr->unk_2AE[i] = 0;
}
@@ -144,29 +127,22 @@ void func_800C740C(PadMgr* padmgr)
}
}
- if (!var1)
- {
+ if (!var1) {
var3 = D_8016A4F0 % 4;
- if ((padmgr->unk_2AA[var3] != 0) && (padmgr->pad_status[var3].status & 1) && (padmgr->unk_2AE[var3] != 1))
- {
+ if ((padmgr->unk_2AA[var3] != 0) && (padmgr->pad_status[var3].status & 1) && (padmgr->unk_2AE[var3] != 1)) {
var4 = osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[var3], var3);
- if (var4 == 0)
- {
+ if (var4 == 0) {
padmgr->unk_2AE[var3] = 1;
osSetVibration(&padmgr->unk_controller[var3], 1);
osSetVibration(&padmgr->unk_controller[var3], 0);
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("padmgr: %dコン: %s\n", var3 + 1, "振動パックを認識しました");
osSyncPrintf(VT_RST);
- }
- else if (var4 == 11)
- {
+ } else if (var4 == 11) {
padmgr->unk_2AE[var3] = 2;
- }
- else if (var4 == 4)
- {
+ } else if (var4 == 4) {
LogUtils_LogThreadId("../padmgr.c", 282);
osSyncPrintf("++errcnt = %d\n", ++D_8012D284);
osSyncPrintf(VT_FGCOL(YELLOW));
@@ -185,22 +161,18 @@ u32 D_8016A4F0;
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C740C.s")
#endif
-//func_800A2300 in 1.0
-void func_800C7818(PadMgr* padmgr)
-{
+// func_800A2300 in 1.0
+void func_800C7818(PadMgr* padmgr) {
s32 i;
OSMesgQueue* ctrlrqueue;
ctrlrqueue = PadMgr_LockGetControllerQueue(padmgr);
- for (i = 0; i < 4; i++)
- {
- if (osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[i], i) == 0)
- {
- if ((gFaultStruct.msgId == 0) && (padmgr->unk_45D != 0))
- {
+ for (i = 0; i < 4; i++) {
+ if (osProbeVibrationPack(ctrlrqueue, &padmgr->unk_controller[i], i) == 0) {
+ if ((gFaultStruct.msgId == 0) && (padmgr->unk_45D != 0)) {
osSyncPrintf(VT_FGCOL(YELLOW));
- //EUC-JP: コン | 'Con'? , EUC-JP: 振動パック 停止 | Stop vibration pack
+ // EUC-JP: コン | 'Con'? , EUC-JP: 振動パック 停止 | Stop vibration pack
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止");
osSyncPrintf(VT_RST);
}
@@ -212,13 +184,11 @@ void func_800C7818(PadMgr* padmgr)
PadMgr_UnlockReleaseControllerQueue(padmgr, ctrlrqueue);
}
-void func_800C7928(PadMgr* padmgr)
-{
+void func_800C7928(PadMgr* padmgr) {
padmgr->unk_45C = 3;
}
-void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2)
-{
+void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2) {
padmgr->unk_2B2[a1] = a2;
padmgr->unk_45D = 0xF0;
}
@@ -226,8 +196,7 @@ void func_800C7934(PadMgr* padmgr, u32 a1, u32 a2)
#ifdef NON_MATCHING
// minor ordering difference
// 800A23CC in 1.0
-void func_800C7948(PadMgr* padmgr, u8* a1)
-{
+void func_800C7948(PadMgr* padmgr, u8* a1) {
padmgr->unk_2B2[0] = a1[0];
padmgr->unk_2B2[1] = a1[1];
padmgr->unk_2B2[2] = a1[2];
@@ -243,46 +212,45 @@ void func_800C7948(PadMgr* padmgr, u8* a1)
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C7C14.s")
-void func_800C7DD0(PadMgr* padmgr)
-{
+void func_800C7DD0(PadMgr* padmgr) {
osSyncPrintf("padmgr_HandlePreNMI()\n");
padmgr->unk_45E = 1;
func_800C7928(padmgr);
}
#pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/func_800C7E08.s")
-//void func_800C7E08(Input*, u32);
+// void func_800C7E08(Input*, u32);
-//800A2918 in 1.0
-void PadMgr_Run(PadMgr* padmgr)
-{
+// 800A2918 in 1.0
+void PadMgr_Run(PadMgr* padmgr) {
s16* mesg;
s32 bVar2;
mesg = NULL;
- //EUC-JP: コントローラスレッド実行開始 | Start of controller thread execution
+ // EUC-JP: コントローラスレッド実行開始 | Start of controller thread execution
osSyncPrintf("コントローラスレッド実行開始\n");
bVar2 = 0;
- while (bVar2 == 0)
- {
- if ((D_8012D280 > 2) && (padmgr->queue3.validCount == 0))
- //EUC-JP: コントローラスレッドイベント待ち | Waiting for controller thread event
- osSyncPrintf("コントローラスレッドイベント待ち %lld\n" , (osGetTime() * 64) / 3000);
+ while (bVar2 == 0) {
+ if ((D_8012D280 > 2) && (padmgr->queue3.validCount == 0)) {
+ // EUC-JP: コントローラスレッドイベント待ち | Waiting for controller thread event
+ osSyncPrintf("コントローラスレッドイベント待ち %lld\n", (osGetTime() * 64) / 3000);
+ }
osRecvMesg(&padmgr->queue3, &mesg, OS_MESG_BLOCK);
LogUtils_CheckNullPointer("msg", mesg, "../padmgr.c", 563);
- switch (*mesg)
- {
+ switch (*mesg) {
case OS_SC_RETRACE_MSG:
- if (D_8012D280 > 2)
+ if (D_8012D280 > 2) {
osSyncPrintf("padmgr_HandleRetraceMsg START %lld\n", (osGetTime() * 64) / 3000);
+ }
func_800C7C14(padmgr);
- if (D_8012D280 > 2)
+ if (D_8012D280 > 2) {
osSyncPrintf("padmgr_HandleRetraceMsg END %lld\n", (osGetTime() * 64) / 3000);
+ }
break;
case OS_SC_PRE_NMI_MSG:
@@ -295,14 +263,13 @@ void PadMgr_Run(PadMgr* padmgr)
}
IrqMgr_RemoveClient(padmgr->unk_78, &padmgr->unk_70);
- //EUC-JP: コントローラスレッド実行終了 | Controller thread execution end
+ // EUC-JP: コントローラスレッド実行終了 | Controller thread execution end
osSyncPrintf("コントローラスレッド実行終了\n");
}
-//func_800A2A14 in 1.0
-void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* ctrlrqueue, UNK_TYPE arg2, OSId id, OSPri priority, void* stack)
-{
- //EUC-JP: パッドマネージャ作成 | Create pad manager
+// func_800A2A14 in 1.0
+void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* ctrlrqueue, UNK_TYPE arg2, OSId id, OSPri priority, void* stack) {
+ // EUC-JP: パッドマネージャ作成 | Create pad manager
osSyncPrintf("パッドマネージャ作成 padmgr_Create()\n");
bzero(padmgr, sizeof(PadMgr));
padmgr->unk_78 = arg2;
diff --git a/src/code/relocation.c b/src/code/relocation.c
index 6e429742c..80839b9d9 100644
--- a/src/code/relocation.c
+++ b/src/code/relocation.c
@@ -1,3 +1,3 @@
#include <global.h>
-#pragma GLOBAL_ASM("asm/non_matchings/code/relocation/Overlay_DoRelocation.s") \ No newline at end of file
+#pragma GLOBAL_ASM("asm/non_matchings/code/relocation/Overlay_DoRelocation.s")
diff --git a/src/code/sched.c b/src/code/sched.c
index dcf38e22b..af971ff2e 100644
--- a/src/code/sched.c
+++ b/src/code/sched.c
@@ -4,14 +4,13 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C82A0.s")
-void func_800C84E4(SchedContext* sc, UNK_TYPE arg1)
-{
- if (sc->unk_24C != 0)
- {
+void func_800C84E4(SchedContext* sc, UNK_TYPE arg1) {
+ if (sc->unk_24C != 0) {
sc->unk_24C = 0;
- if (gIrqMgrResetStatus == 0)
+ if (gIrqMgrResetStatus == 0) {
ViConfig_UpdateVi(0);
+ }
}
func_800C82A0(arg1);
@@ -19,26 +18,25 @@ void func_800C84E4(SchedContext* sc, UNK_TYPE arg1)
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C8534.s")
-void func_800C87CC(SchedContext* sc)
-{
+void func_800C87CC(SchedContext* sc) {
ViConfig_UpdateVi(1);
}
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C87F0.s")
-void func_800C8910(SchedContext* sc)
-{
- if (!(sc->curRSPTask->state & 0x10))
- {
- if (sc->curRSPTask->list.t.type == M_AUDTASK)
+void func_800C8910(SchedContext* sc) {
+ if (!(sc->curRSPTask->state & 0x10)) {
+ if (sc->curRSPTask->list.t.type == M_AUDTASK) {
__assert("sc->curRSPTask->list.t.type != M_AUDTASK", "../sched.c", 496);
+ }
sc->curRSPTask->state |= 0x10;
osSpTaskYield();
- if (D_8012D290 != 0)
+ if (D_8012D290 != 0) {
osSyncPrintf("%08d:osSpTaskYield\n", (u32)((osGetTime() * 64) / 3000));
+ }
}
}
@@ -46,39 +44,37 @@ void func_800C8910(SchedContext* sc)
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C8A94.s")
-typedef struct
-{
- /* 0x00 */ char unk_00[0x04];
- /* 0x00 */ u32 unk_04;
- /* 0x00 */ u32 unk_08;
+typedef struct {
+ /* 0x00 */ char unk_00[0x04];
+ /* 0x00 */ u32 unk_04;
+ /* 0x00 */ u32 unk_08;
/* 0x0C */ UNK_TYPE unk_0C;
- /* 0x10 */ char unk_10[0x40];
+ /* 0x10 */ char unk_10[0x40];
/* 0x50 */ OSMesgQueue* msgQ;
- /* 0x54 */ OSMesg msg;
+ /* 0x54 */ OSMesg msg;
} struct_800C8C40;
-void func_800C8BC4(SchedContext* sc, struct_800C8C40* arg1)
-{
- if (sc->pendingSwapBuf1 == 0)
- {
+void func_800C8BC4(SchedContext* sc, struct_800C8C40* arg1) {
+ if (sc->pendingSwapBuf1 == 0) {
sc->pendingSwapBuf1 = arg1->unk_0C;
LogUtils_CheckValidPointer("sc->pending_swapbuffer1", sc->pendingSwapBuf1, "../sched.c", 618);
- if ((sc->unk_240 == NULL) || (sc->unk_240->unk_12 < 1))
+ if ((sc->unk_240 == NULL) || (sc->unk_240->unk_12 < 1)) {
func_800C84E4(sc, arg1->unk_0C);
+ }
}
}
-u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1)
-{
- if (!(arg1->unk_04 & 3))
- {
- if (arg1->msgQ != NULL)
+u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1) {
+ if (!(arg1->unk_04 & 3)) {
+ if (arg1->msgQ != NULL) {
osSendMesg(arg1->msgQ, arg1->msg, OS_MESG_BLOCK);
+ }
- if (arg1->unk_08 & 0x40)
+ if (arg1->unk_08 & 0x40) {
func_800C8BC4(sc, arg1);
+ }
return 1;
}
@@ -96,18 +92,17 @@ u32 func_800C8C40(SchedContext* sc, struct_800C8C40* arg1)
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C94B4.s")
-void func_800C95F8(OSMesgQueue* mq)
-{
- if (D_8012D290 != 0)
+void func_800C95F8(OSMesgQueue* mq) {
+ if (D_8012D290 != 0) {
osSyncPrintf("osScKickEntryMsg\n");
+ }
osSendMesg(mq, 670, OS_MESG_BLOCK);
}
#pragma GLOBAL_ASM("asm/non_matchings/code/sched/func_800C9644.s")
-void func_800C9874(SchedContext* sc, void* stack, OSPri priority, UNK_TYPE arg3, UNK_TYPE arg4, UNK_TYPE arg5)
-{
+void func_800C9874(SchedContext* sc, void* stack, OSPri priority, UNK_TYPE arg3, UNK_TYPE arg4, UNK_TYPE arg5) {
bzero(sc, sizeof(SchedContext));
sc->unk_24C = 1;
osCreateMesgQueue(&sc->interruptQ, sc->intBuf, 8);
diff --git a/src/code/speed_meter.c b/src/code/speed_meter.c
index 3c5cecf9c..ec5e93b07 100644
--- a/src/code/speed_meter.c
+++ b/src/code/speed_meter.c
@@ -1,36 +1,30 @@
#include <ultra64.h>
#include <global.h>
-typedef struct
-{
+typedef struct {
/* 0x00 */ char unk_00[0x18];
- /* 0x18 */ s32 unk_18;
- /* 0x1C */ s32 unk_1C;
+ /* 0x18 */ s32 unk_18;
+ /* 0x1C */ s32 unk_1C;
} struct_801664D0; // size = 0x20
extern struct_801664D0 D_801664D0;
-void func_800C9940(struct_801664D0* arg0, u32 arg1, u32 arg2)
-{
+void func_800C9940(struct_801664D0* arg0, u32 arg1, u32 arg2) {
LogUtils_CheckNullPointer("this", arg0, "../speed_meter.c", 181);
arg0->unk_18 = arg1;
arg0->unk_1C = arg2;
}
-void func_800C9998(struct_801664D0* arg0)
-{
+void func_800C9998(struct_801664D0* arg0) {
func_800C9940(arg0, 0x20, 0x16);
}
-void func_800C99BC(struct_801664D0* arg0)
-{
-
+void func_800C99BC(struct_801664D0* arg0) {
}
#pragma GLOBAL_ASM("asm/non_matchings/code/speed_meter/func_800C99C4.s")
-typedef struct
-{
+typedef struct {
/* 0x00 */ u32 unk_00;
/* 0x04 */ u32 unk_04;
/* 0x08 */ u16 unk_08;
@@ -41,8 +35,8 @@ typedef struct
/* 0x18 */ u32 unk_18;
} struct_800C9E08;
-void func_800C9E08(struct_800C9E08* arg0, u32 arg1, u32 arg2, u16 arg3, u16 arg4, u32 arg5, u32 arg6, u32 arg7, u32 arg8)
-{
+void func_800C9E08(struct_800C9E08* arg0, u32 arg1, u32 arg2, u16 arg3, u16 arg4, u32 arg5, u32 arg6, u32 arg7,
+ u32 arg8) {
arg0->unk_00 = arg1;
arg0->unk_04 = arg2;
arg0->unk_08 = arg3;
diff --git a/src/code/sys_cfb.c b/src/code/sys_cfb.c
index 182e53f4d..454b63a58 100644
--- a/src/code/sys_cfb.c
+++ b/src/code/sys_cfb.c
@@ -1,66 +1,55 @@
#include <global.h>
-volatile u32 sSysCfbFbPtr[2]; //may not be volatile but it currently gets SysCfb_Init closer from matching
+volatile u32 sSysCfbFbPtr[2]; // may not be volatile but it currently gets SysCfb_Init closer from matching
u32 sSysCfbEnd;
-//small reaordering
+// small reaordering
#ifdef NON_MATCHING
-void SysCfb_Init(s32 n64dd)
-{
- if (osMemSize >= 0x800000U)
- {
- //8MB or more memory is installed
+void SysCfb_Init(s32 n64dd) {
+ if (osMemSize >= 0x800000U) {
+ // 8MB or more memory is installed
osSyncPrintf("8Mバイト以上のメモリが搭載されています\n");
- if (n64dd == 1)
- {
- //RAM 8M mode (N64DD compatible)
+ if (n64dd == 1) {
+ // RAM 8M mode (N64DD compatible)
osSyncPrintf("RAM 8M mode (N64DD対応)\n");
sSysCfbEnd = 0x805FB000;
- }
- else
- {
- //The margin for this version is% dK bytes
+ } else {
+ // The margin for this version is% dK bytes
osSyncPrintf("このバージョンのマージンは %dK バイトです\n", (0x4BC00 / 1024));
sSysCfbEnd = 0x8044BE80;
}
- }
- else if (osMemSize >= 0x400000U)
- {
+ } else if (osMemSize >= 0x400000U) {
sSysCfbEnd = 0x80400000;
osSyncPrintf("RAM4M mode\n");
- }
- else
- {
+ } else {
LogUtils_HungupThread("../sys_cfb.c", 0x162);
}
sSysCfbEnd &= ~0x3f;
- //The final address used by the system is% 08x
+ // The final address used by the system is% 08x
osSyncPrintf("システムが使用する最終アドレスは %08x です\n", sSysCfbEnd);
- sSysCfbFbPtr[0] = sSysCfbEnd - (SCREEN_WIDTH*SCREEN_HEIGHT*4);
- sSysCfbFbPtr[1] = sSysCfbEnd - (SCREEN_WIDTH*SCREEN_HEIGHT*2);
- //Frame buffer addresses are% 08x and% 08x
+ sSysCfbFbPtr[0] = sSysCfbEnd - (SCREEN_WIDTH * SCREEN_HEIGHT * 4);
+ sSysCfbFbPtr[1] = sSysCfbEnd - (SCREEN_WIDTH * SCREEN_HEIGHT * 2);
+ // Frame buffer addresses are% 08x and% 08x
osSyncPrintf("フレームバッファのアドレスは %08x と %08x です\n", sSysCfbFbPtr[0], sSysCfbFbPtr[1]);
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_cfb/SysCfb_Init.s")
#endif
-void SysCfb_Reset()
-{
+void SysCfb_Reset() {
sSysCfbFbPtr[0] = 0;
sSysCfbFbPtr[1] = 0;
sSysCfbEnd = 0;
}
-u32 SysCfb_GetFbPtr(s32 idx)
-{
- if (idx < 2)
+u32 SysCfb_GetFbPtr(s32 idx) {
+ if (idx < 2) {
return sSysCfbFbPtr[idx];
+ }
return 0;
}
-u32 SysCfb_GetFbEnd()
-{
+u32 SysCfb_GetFbEnd() {
return sSysCfbEnd;
-} \ No newline at end of file
+}
diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c
index 75afbc5ee..b300f189d 100644
--- a/src/code/sys_matrix.c
+++ b/src/code/sys_matrix.c
@@ -1,83 +1,74 @@
#include <ultra64.h>
#include <global.h>
-Mtx gMtxClear =
-{
+// clang-format off
+Mtx gMtxClear = {
65536, 0, 1, 0,
0, 65536, 0, 1,
0, 0, 0, 0,
0, 0, 0, 0,
};
-MtxF gMtxFClear =
-{
+MtxF gMtxFClear = {
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f,
};
+// clang-format on
-MtxF* sMatrixStack; // "Matrix_stack"
+MtxF* sMatrixStack; // "Matrix_stack"
MtxF* sCurrentMatrix; // "Matrix_now"
-void Matrix_Init(GameState* gameState)
-{
+void Matrix_Init(GameState* gameState) {
sCurrentMatrix = Game_Alloc(gameState, 20 * sizeof(MtxF), "../sys_matrix.c", 153);
sMatrixStack = sCurrentMatrix;
}
-void Matrix_Push(void)
-{
+void Matrix_Push(void) {
Matrix_MtxFCopy(sCurrentMatrix + 1, sCurrentMatrix);
sCurrentMatrix++;
}
-void Matrix_Pull(void)
-{
+void Matrix_Pull(void) {
sCurrentMatrix--;
- if (sCurrentMatrix < sMatrixStack)
+ if (sCurrentMatrix < sMatrixStack) {
__assert("Matrix_now >= Matrix_stack", "../sys_matrix.c", 176);
+ }
}
-void Matrix_Get(MtxF* dest)
-{
+void Matrix_Get(MtxF* dest) {
Matrix_MtxFCopy(dest, sCurrentMatrix);
}
-void Matrix_Put(MtxF* src)
-{
+void Matrix_Put(MtxF* src) {
Matrix_MtxFCopy(sCurrentMatrix, src);
}
-MtxF* Matrix_GetCurrent(void)
-{
+MtxF* Matrix_GetCurrent(void) {
return sCurrentMatrix;
}
-void Matrix_Mult(MtxF* mf, u8 mode)
-{
+void Matrix_Mult(MtxF* mf, u8 mode) {
MtxF* cmf = Matrix_GetCurrent();
- if (mode == MTXMODE_APPLY)
+ if (mode == MTXMODE_APPLY) {
func_800A6FA0(cmf, mf, cmf);
- else
+ } else {
Matrix_MtxFCopy(sCurrentMatrix, mf);
+ }
}
#ifdef NON_MATCHING
// minor ordering and regalloc differences
-void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode)
-{
+void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode) {
MtxF* cmf = sCurrentMatrix;
- if (mode == MTXMODE_APPLY)
- {
+ if (mode == MTXMODE_APPLY) {
cmf->wx += cmf->xx * x + cmf->yx * y + cmf->zx * z;
cmf->wy += cmf->xy * x + cmf->yy * y + cmf->zy * z;
cmf->wz += cmf->xz * x + cmf->yz * y + cmf->zz * z;
cmf->ww += cmf->xw * x + cmf->yw * y + cmf->zw * z;
- }
- else
- {
+ } else {
func_800A7A24(cmf, x, y, z);
}
}
@@ -85,12 +76,10 @@ void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode)
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_Translate.s")
#endif
-void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode)
-{
+void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode) {
MtxF* cmf = sCurrentMatrix;
- if (mode == MTXMODE_APPLY)
- {
+ if (mode == MTXMODE_APPLY) {
cmf->xx *= x;
cmf->xy *= x;
cmf->xz *= x;
@@ -103,25 +92,20 @@ void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode)
cmf->xw *= x;
cmf->yw *= y;
cmf->zw *= z;
- }
- else
- {
+ } else {
func_800A76A4(cmf, x, y, z);
}
}
-void Matrix_RotateX(f32 x, u8 mode)
-{
+void Matrix_RotateX(f32 x, u8 mode) {
MtxF* cmf;
f32 sin;
f32 cos;
f32 temp1;
f32 temp2;
- if (mode == MTXMODE_APPLY)
- {
- if (x != 0)
- {
+ if (mode == MTXMODE_APPLY) {
+ if (x != 0) {
cmf = sCurrentMatrix;
sin = sinf(x);
@@ -147,18 +131,13 @@ void Matrix_RotateX(f32 x, u8 mode)
cmf->yw = temp1 * cos + temp2 * sin;
cmf->zw = temp2 * cos - temp1 * sin;
}
- }
- else
- {
+ } else {
cmf = sCurrentMatrix;
- if (x != 0)
- {
+ if (x != 0) {
sin = sinf(x);
cos = cosf(x);
- }
- else
- {
+ } else {
sin = 0.0f;
cos = 1.0f;
}
@@ -182,18 +161,15 @@ void Matrix_RotateX(f32 x, u8 mode)
}
}
-void Matrix_RotateY(f32 y, u8 mode)
-{
+void Matrix_RotateY(f32 y, u8 mode) {
MtxF* cmf;
f32 sin;
f32 cos;
f32 temp1;
f32 temp2;
- if (mode == MTXMODE_APPLY)
- {
- if (y != 0)
- {
+ if (mode == MTXMODE_APPLY) {
+ if (y != 0) {
cmf = sCurrentMatrix;
sin = sinf(y);
@@ -219,18 +195,13 @@ void Matrix_RotateY(f32 y, u8 mode)
cmf->xw = temp1 * cos - temp2 * sin;
cmf->zw = temp1 * sin + temp2 * cos;
}
- }
- else
- {
+ } else {
cmf = sCurrentMatrix;
- if (y != 0)
- {
+ if (y != 0) {
sin = sinf(y);
cos = cosf(y);
- }
- else
- {
+ } else {
sin = 0.0f;
cos = 1.0f;
}
@@ -254,18 +225,15 @@ void Matrix_RotateY(f32 y, u8 mode)
}
}
-void Matrix_RotateZ(f32 z, u8 mode)
-{
+void Matrix_RotateZ(f32 z, u8 mode) {
MtxF* cmf;
f32 sin;
f32 cos;
f32 temp1;
f32 temp2;
- if (mode == MTXMODE_APPLY)
- {
- if (z != 0)
- {
+ if (mode == MTXMODE_APPLY) {
+ if (z != 0) {
cmf = sCurrentMatrix;
sin = sinf(z);
@@ -291,18 +259,13 @@ void Matrix_RotateZ(f32 z, u8 mode)
cmf->xw = temp1 * cos + temp2 * sin;
cmf->yw = temp2 * cos - temp1 * sin;
}
- }
- else
- {
+ } else {
cmf = sCurrentMatrix;
- if (z != 0)
- {
+ if (z != 0) {
sin = sinf(z);
cos = cosf(z);
- }
- else
- {
+ } else {
sin = 0.0f;
cos = 1.0f;
}
@@ -326,16 +289,14 @@ void Matrix_RotateZ(f32 z, u8 mode)
}
}
-void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
-{
+void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode) {
MtxF* cmf = sCurrentMatrix;
f32 temp1;
f32 temp2;
f32 sin;
f32 cos;
- if (mode == MTXMODE_APPLY)
- {
+ if (mode == MTXMODE_APPLY) {
sin = Math_Sins(z);
cos = Math_Coss(z);
@@ -359,8 +320,7 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
cmf->xw = temp1 * cos + temp2 * sin;
cmf->yw = temp2 * cos - temp1 * sin;
- if (y != 0)
- {
+ if (y != 0) {
sin = Math_Sins(y);
cos = Math_Coss(y);
@@ -385,8 +345,7 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
cmf->zw = temp1 * sin + temp2 * cos;
}
- if (x != 0)
- {
+ if (x != 0) {
sin = Math_Sins(x);
cos = Math_Coss(x);
@@ -410,15 +369,12 @@ void Matrix_RotateXYZ(s16 x, s16 y, s16 z, u8 mode)
cmf->yw = temp1 * cos + temp2 * sin;
cmf->zw = temp2 * cos - temp1 * sin;
}
- }
- else
- {
+ } else {
func_800A7704(cmf, x, y, z);
}
}
-void func_800D1340(Vec3f* arg0, Vec3s* arg1)
-{
+void func_800D1340(Vec3f* arg0, Vec3s* arg1) {
MtxF* cmf = sCurrentMatrix;
f32 sin;
f32 cos;
@@ -452,8 +408,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1)
cmf->xw = temp1 * cos + temp2 * sin;
cmf->yw = temp2 * cos - temp1 * sin;
- if (arg1->y != 0)
- {
+ if (arg1->y != 0) {
sin = Math_Sins(arg1->y);
cos = Math_Coss(arg1->y);
@@ -478,8 +433,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1)
cmf->zw = temp1 * sin + temp2 * cos;
}
- if (arg1->x != 0)
- {
+ if (arg1->x != 0) {
sin = Math_Sins(arg1->x);
cos = Math_Coss(arg1->x);
@@ -507,8 +461,7 @@ void func_800D1340(Vec3f* arg0, Vec3s* arg1)
#ifdef NON_MATCHING
// regalloc differences
-void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
-{
+void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec) {
MtxF* cmf = sCurrentMatrix;
f32 sp30;
f32 sp2C;
@@ -528,8 +481,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
cmf->zw = 0.0f;
cmf->ww = 1.0f;
- if (vec->x != 0)
- {
+ if (vec->x != 0) {
sp24 = Math_Sins(vec->x);
sp28 = Math_Coss(vec->x);
@@ -539,9 +491,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
cmf->yz = sp2C * sp24;
cmf->zx = sp30 * sp28;
cmf->yx = sp30 * sp24;
- }
- else
- {
+ } else {
cmf->zz = sp2C;
cmf->zx = sp30;
cmf->zy = 0.0f;
@@ -550,8 +500,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
cmf->yy = 1.0f;
}
- if (vec->z != 0)
- {
+ if (vec->z != 0) {
sp24 = Math_Sins(vec->z);
sp28 = Math_Coss(vec->z);
@@ -568,9 +517,7 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
sp2C = cmf->yy;
cmf->xy = sp2C * sp24;
cmf->yy = sp2C * sp28;
- }
- else
- {
+ } else {
cmf->xy = 0.0f;
}
}
@@ -580,74 +527,73 @@ void func_800D1694(f32 x, f32 y, f32 z, Vec3s* vec)
#ifdef NON_MATCHING
// mostly regalloc differences
-Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest)
-{
+Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) {
u16* m1 = (u16*)&dest->m[0][0];
u16* m2 = (u16*)&dest->m[2][0];
s32 temp;
temp = src->xx * 65536.0f;
- m1[0] = (temp >> 0x10) & 0xFFFF;;
+ m1[0] = (temp >> 0x10) & 0xFFFF;
m2[0] = temp & 0xFFFF;
temp = src->xy * 65536.0f;
- m1[1] = (temp >> 0x10) & 0xFFFF;;
+ m1[1] = (temp >> 0x10) & 0xFFFF;
m2[1] = temp & 0xFFFF;
temp = src->xz * 65536.0f;
- m1[2] = (temp >> 0x10) & 0xFFFF;;
+ m1[2] = (temp >> 0x10) & 0xFFFF;
m2[2] = temp & 0xFFFF;
temp = src->xw * 65536.0f;
- m1[3] = (temp >> 0x10) & 0xFFFF;;
+ m1[3] = (temp >> 0x10) & 0xFFFF;
m2[3] = temp & 0xFFFF;
temp = src->yx * 65536.0f;
- m1[4] = (temp >> 0x10) & 0xFFFF;;
+ m1[4] = (temp >> 0x10) & 0xFFFF;
m2[4] = temp & 0xFFFF;
temp = src->yy * 65536.0f;
- m1[5] = (temp >> 0x10) & 0xFFFF;;
+ m1[5] = (temp >> 0x10) & 0xFFFF;
m2[5] = temp & 0xFFFF;
temp = src->yz * 65536.0f;
- m1[6] = (temp >> 0x10) & 0xFFFF;;
+ m1[6] = (temp >> 0x10) & 0xFFFF;
m2[6] = temp & 0xFFFF;
temp = src->yw * 65536.0f;
- m1[7] = (temp >> 0x10) & 0xFFFF;;
+ m1[7] = (temp >> 0x10) & 0xFFFF;
m2[7] = temp & 0xFFFF;
temp = src->zx * 65536.0f;
- m1[8] = (temp >> 0x10) & 0xFFFF;;
+ m1[8] = (temp >> 0x10) & 0xFFFF;
m2[8] = temp & 0xFFFF;
temp = src->zy * 65536.0f;
- m1[9] = (temp >> 0x10) & 0xFFFF;;
+ m1[9] = (temp >> 0x10) & 0xFFFF;
m2[9] = temp & 0xFFFF;
temp = src->zz * 65536.0f;
- m1[10] = (temp >> 0x10) & 0xFFFF;;
+ m1[10] = (temp >> 0x10) & 0xFFFF;
m2[10] = temp & 0xFFFF;
temp = src->zw * 65536.0f;
- m1[11] = (temp >> 0x10) & 0xFFFF;;
+ m1[11] = (temp >> 0x10) & 0xFFFF;
m2[11] = temp & 0xFFFF;
temp = src->wx * 65536.0f;
- m1[12] = (temp >> 0x10) & 0xFFFF;;
+ m1[12] = (temp >> 0x10) & 0xFFFF;
m2[12] = temp & 0xFFFF;
temp = src->wy * 65536.0f;
- m1[13] = (temp >> 0x10) & 0xFFFF;;
+ m1[13] = (temp >> 0x10) & 0xFFFF;
m2[13] = temp & 0xFFFF;
temp = src->wz * 65536.0f;
- m1[14] = (temp >> 0x10) & 0xFFFF;;
+ m1[14] = (temp >> 0x10) & 0xFFFF;
m2[14] = temp & 0xFFFF;
temp = src->ww * 65536.0f;
- m1[15] = (temp >> 0x10) & 0xFFFF;;
+ m1[15] = (temp >> 0x10) & 0xFFFF;
m2[15] = temp & 0xFFFF;
return dest;
@@ -656,23 +602,19 @@ Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest)
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/Matrix_MtxFToMtx.s")
#endif
-Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line)
-{
+Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line) {
return Matrix_MtxFToMtx(Matrix_CheckFloats(sCurrentMatrix, file, line), dest);
}
-Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line)
-{
+Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line) {
return Matrix_ToMtx(Graph_Alloc(gfxCtx, sizeof(Mtx)), file, line);
}
-Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx)
-{
+Mtx* Matrix_MtxFToNewMtx(MtxF* src, GraphicsContext* gfxCtx) {
return Matrix_MtxFToMtx(src, Graph_Alloc(gfxCtx, sizeof(Mtx)));
}
-void Matrix_MultVec3f(Vec3f* src, Vec3f* dest)
-{
+void Matrix_MultVec3f(Vec3f* src, Vec3f* dest) {
MtxF* cmf = sCurrentMatrix;
dest->x = cmf->wx + (cmf->xx * src->x + cmf->yx * src->y + cmf->zx * src->z);
@@ -680,8 +622,7 @@ void Matrix_MultVec3f(Vec3f* src, Vec3f* dest)
dest->z = cmf->wz + (cmf->xz * src->x + cmf->yz * src->y + cmf->zz * src->z);
}
-void Matrix_MtxFCopy(MtxF* dest, MtxF* src)
-{
+void Matrix_MtxFCopy(MtxF* dest, MtxF* src) {
dest->xx = src->xx;
dest->xy = src->xy;
dest->xz = src->xz;
@@ -716,8 +657,7 @@ void Matrix_MtxFCopy(MtxF* dest, MtxF* src)
dest->ww = src->ww;
}
-void Matrix_MtxToMtxF(Mtx* src, MtxF* dest)
-{
+void Matrix_MtxToMtxF(Mtx* src, MtxF* dest) {
u16* m1 = (u16*)&src->m[0][0];
u16* m2 = (u16*)&src->m[2][0];
@@ -739,15 +679,13 @@ void Matrix_MtxToMtxF(Mtx* src, MtxF* dest)
dest->ww = ((m1[15] << 0x10) | m2[15]) * (1 / 65536.0f);
}
-void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf)
-{
+void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf) {
dest->x = mf->wx + (mf->xx * src->x + mf->yx * src->y + mf->zx * src->z);
dest->y = mf->wy + (mf->xy * src->x + mf->yy * src->y + mf->zy * src->z);
dest->z = mf->wz + (mf->xz * src->x + mf->yz * src->y + mf->zz * src->z);
}
-void Matrix_Reverse(MtxF* mf)
-{
+void Matrix_Reverse(MtxF* mf) {
f32 temp;
temp = mf->xy;
@@ -764,8 +702,7 @@ void Matrix_Reverse(MtxF* mf)
}
#ifdef NON_MATCHING
-void func_800D1FD4(MtxF* mf)
-{
+void func_800D1FD4(MtxF* mf) {
MtxF* cmf = sCurrentMatrix;
f32 temp;
@@ -790,12 +727,10 @@ void func_800D1FD4(MtxF* mf)
#ifdef NON_MATCHING
// same differences as func_800D2264
-void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag)
-{
+void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag) {
vec->x = Math_atan2f(-mf->zy, sqrtf(SQ(mf->zx) + SQ(mf->zz))) * (32768 / M_PI);
- if ((vec->x == 0x4000) || (vec->x == -0x4000))
- {
+ if ((vec->x == 0x4000) || (vec->x == -0x4000)) {
vec->z = 0;
vec->y = Math_atan2f(-mf->xz, mf->xx) * (32768 / M_PI);
return;
@@ -806,8 +741,9 @@ void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag)
if (!flag)
vec->z = Math_atan2f(mf->xy, mf->yy) * (32768 / M_PI);
else
- vec->z = Math_atan2f(mf->xy / sqrtf(SQ(mf->xx) + SQ(mf->xz) + SQ(mf->xy)),
- mf->yy / sqrtf(SQ(mf->yx) + SQ(mf->yz) + SQ(mf->yy))) * (32768 / M_PI);
+ vec->z = Math_atan2f(mf->xy / sqrtf(SQ(mf->xx) + SQ(mf->xz) + SQ(mf->xy)),
+ mf->yy / sqrtf(SQ(mf->yx) + SQ(mf->yz) + SQ(mf->yy))) *
+ (32768 / M_PI);
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D20CC.s")
@@ -815,12 +751,10 @@ void func_800D20CC(MtxF* mf, Vec3s* vec, s32 flag)
#ifdef NON_MATCHING
// same differences as func_800D20CC
-void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag)
-{
+void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag) {
vec->y = Math_atan2f(-mf->xz, sqrtf(SQ(mf->xx) + SQ(mf->xy))) * (32768 / M_PI);
- if ((vec->y == 0x4000) || (vec->y == -0x4000))
- {
+ if ((vec->y == 0x4000) || (vec->y == -0x4000)) {
vec->x = 0;
vec->z = Math_atan2f(-mf->yx, mf->yy) * (32768 / M_PI);
return;
@@ -831,8 +765,9 @@ void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag)
if (!flag)
vec->x = Math_atan2f(mf->yz, mf->zz) * (32768 / M_PI);
else
- vec->x = Math_atan2f(mf->yz / sqrtf(SQ(mf->yx) + SQ(mf->yy) + SQ(mf->yz)),
- mf->zz / sqrtf(SQ(mf->zx) + SQ(mf->zy) + SQ(mf->zz))) * (32768 / M_PI);
+ vec->x = Math_atan2f(mf->yz / sqrtf(SQ(mf->yx) + SQ(mf->yy) + SQ(mf->yz)),
+ mf->zz / sqrtf(SQ(mf->zx) + SQ(mf->zy) + SQ(mf->zz))) *
+ (32768 / M_PI);
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D2264.s")
@@ -840,8 +775,7 @@ void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag)
#ifdef NON_MATCHING
// regalloc differences
-void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
-{
+void func_800D23FC(f32 f, Vec3f* vec, u8 mode) {
MtxF* cmf;
f32 sin;
f32 cos;
@@ -851,10 +785,8 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
f32 temp3;
f32 temp4;
- if (mode == MTXMODE_APPLY)
- {
- if (f != 0)
- {
+ if (mode == MTXMODE_APPLY) {
+ if (f != 0) {
cmf = sCurrentMatrix;
sin = sinf(f);
@@ -884,13 +816,10 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
cmf->yz = temp2 * cos + vec->y * temp4 + sin * (temp3 * vec->x - temp1 * vec->z);
cmf->zz = temp3 * cos + vec->z * temp4 + sin * (temp1 * vec->y - temp2 * vec->x);
}
- }
- else
- {
+ } else {
cmf = sCurrentMatrix;
- if (f != 0)
- {
+ if (f != 0) {
sin = sinf(f);
cos = cosf(f);
rCos = 1.0f - cos;
@@ -921,9 +850,7 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
cmf->wy = 0.0f;
cmf->wz = 0.0f;
cmf->ww = 1.0f;
- }
- else
- {
+ } else {
cmf->xy = 0.0f;
cmf->xz = 0.0f;
cmf->xw = 0.0f;
@@ -947,17 +874,16 @@ void func_800D23FC(f32 f, Vec3f* vec, u8 mode)
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_matrix/func_800D23FC.s")
#endif
-MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line)
-{
+MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line) {
s32 i, j;
- for (i = 0; i < 4; i++)
- {
- for (j = 0; j < 4; j++)
- {
- if (!(-32768.0f <= mf->mf[i][j]) || !(mf->mf[i][j] < 32768.0f))
- {
- osSyncPrintf("%s %d: [%s] =\n/ %12.6f %12.6f %12.6f %12.6f \\\n| %12.6f %12.6f %12.6f %12.6f |\n| %12.6f %12.6f %12.6f %12.6f |\n\\ %12.6f %12.6f %12.6f %12.6f /\n", file, line, "mf", mf->xx, mf->yx, mf->zx, mf->wx, mf->xy, mf->yy, mf->zy, mf->wy, mf->xz, mf->yz, mf->zz, mf->wz, mf->xw, mf->yw, mf->zw, mf->ww);
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ if (!(-32768.0f <= mf->mf[i][j]) || !(mf->mf[i][j] < 32768.0f)) {
+ osSyncPrintf("%s %d: [%s] =\n/ %12.6f %12.6f %12.6f %12.6f \\\n| %12.6f %12.6f %12.6f %12.6f |\n| "
+ "%12.6f %12.6f %12.6f %12.6f |\n\\ %12.6f %12.6f %12.6f %12.6f /\n",
+ file, line, "mf", mf->xx, mf->yx, mf->zx, mf->wx, mf->xy, mf->yy, mf->zy, mf->wy, mf->xz,
+ mf->yz, mf->zz, mf->wz, mf->xw, mf->yw, mf->zw, mf->ww);
Fault_AddHungupAndCrash(file, line);
}
}
@@ -966,8 +892,7 @@ MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line)
return mf;
}
-void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
-{
+void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
mf->xy = 0.0f;
mf->xz = 0.0f;
mf->xw = 0.0f;
@@ -986,16 +911,14 @@ void func_800D2A34(MtxF* mf, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
mf->ww = 1.0f;
}
-void func_800D2A98(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
-{
+void func_800D2A98(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
MtxF mf;
func_800D2A34(&mf, arg1, arg2, arg3, arg4);
func_801064E0(&mf, mtx);
}
-void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
-{
+void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4) {
u16* m1 = (u16*)&mtx->m[0][0];
u16* m2 = (u16*)&mtx->m[2][0];
u32 temp;
@@ -1047,8 +970,7 @@ void func_800D2AE4(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4)
m2[15] = 0;
}
-void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6)
-{
+void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) {
u16* m1 = (u16*)&mtx->m[0][0];
u16* m2 = (u16*)&mtx->m[2][0];
u32 temp;
@@ -1102,8 +1024,7 @@ void func_800D2BD0(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f
#ifdef NON_MATCHING
// minor ordering and regalloc differences
-void func_800D2CEC(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6)
-{
+void func_800D2CEC(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) {
u16* m1 = (u16*)&mtx->m[0][0];
u16* m2 = (u16*)&mtx->m[2][0];
u32 temp;
diff --git a/src/code/sys_ucode.c b/src/code/sys_ucode.c
index 0bd169090..f23c7239a 100644
--- a/src/code/sys_ucode.c
+++ b/src/code/sys_ucode.c
@@ -1,21 +1,17 @@
#include <global.h>
-u32 SysUcode_GetUCodeBoot()
-{
+u32 SysUcode_GetUCodeBoot() {
return &D_80009320;
}
-u32 SysUcode_GetUcodeBootSize()
-{
+u32 SysUcode_GetUcodeBootSize() {
return (u32)&D_800093F0 - (u32)&D_80009320;
}
-u32 SysUcode_GetUcode()
-{
+u32 SysUcode_GetUcode() {
return D_8012DBA0;
}
-u32 SysUcode_GetUcodeData()
-{
+u32 SysUcode_GetUcodeData() {
return D_8012DBA4;
}
diff --git a/src/code/system_malloc.c b/src/code/system_malloc.c
index d7c91bbf3..3c75b6065 100644
--- a/src/code/system_malloc.c
+++ b/src/code/system_malloc.c
@@ -1,131 +1,112 @@
#include <global.h>
-#define LOG_SEVERITY_NOLOG 0
-#define LOG_SEVERITY_ERROR 2
-#define LOG_SEVERITY_VERBOSE 3
+#define LOG_SEVERITY_NOLOG 0
+#define LOG_SEVERITY_ERROR 2
+#define LOG_SEVERITY_VERBOSE 3
s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
Arena gSystemArena;
-void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action)
-{
- if (!ptr)
- {
- if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR)
- {
+void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
+ if (!ptr) {
+ if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) {
//"%s: %u bytes %s failed\n"
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
__osDisplayArena(&gSystemArena);
return;
}
- }
- else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE)
- {
+ } else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
//"%s: %u bytes %s succeeded\n"
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
}
}
-void* SystemArena_Malloc(u32 size)
-{
+void* SystemArena_Malloc(u32 size) {
void* ptr;
ptr = __osMalloc(&gSystemArena, size);
- SystemArena_CheckPointer(ptr, size, "malloc", "確保"); //Secure
+ SystemArena_CheckPointer(ptr, size, "malloc", "確保"); // Secure
return ptr;
}
-void* SystemArena_MallocDebug(u32 size, const char* file, s32 line)
-{
+void* SystemArena_MallocDebug(u32 size, const char* file, s32 line) {
void* ptr;
ptr = __osMallocDebug(&gSystemArena, size, file, line);
- SystemArena_CheckPointer(ptr, size, "malloc_DEBUG", "確保"); //Secure
+ SystemArena_CheckPointer(ptr, size, "malloc_DEBUG", "確保"); // Secure
return ptr;
}
-void* SystemArena_MallocR(u32 size)
-{
+void* SystemArena_MallocR(u32 size) {
void* ptr;
ptr = __osMallocR(&gSystemArena, size);
- SystemArena_CheckPointer(ptr, size, "malloc_r", "確保"); //Secure
+ SystemArena_CheckPointer(ptr, size, "malloc_r", "確保"); // Secure
return ptr;
}
-void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line)
-{
+void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line) {
void* ptr;
ptr = __osMallocRDebug(&gSystemArena, size, file, line);
- SystemArena_CheckPointer(ptr, size, "malloc_r_DEBUG", "確保"); //Secure
+ SystemArena_CheckPointer(ptr, size, "malloc_r_DEBUG", "確保"); // Secure
return ptr;
}
-void* SystemArena_Realloc(void* ptr, u32 newSize)
-{
+void* SystemArena_Realloc(void* ptr, u32 newSize) {
ptr = __osRealloc(&gSystemArena, ptr, newSize);
SystemArena_CheckPointer(ptr, newSize, "realloc", "再確保"); // Re-securing
return ptr;
}
-void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line)
-{
+void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
ptr = __osReallocDebug(&gSystemArena, ptr, newSize, file, line);
SystemArena_CheckPointer(ptr, newSize, "realloc_DEBUG", "再確保"); // Re-securing
return ptr;
}
-void SystemArena_Free(void* ptr)
-{
+void SystemArena_Free(void* ptr) {
__osFree(&gSystemArena, ptr);
}
-void SystemArena_FreeDebug(void* ptr, const char* file, s32 line)
-{
+void SystemArena_FreeDebug(void* ptr, const char* file, s32 line) {
__osFreeDebug(&gSystemArena, ptr, file, line);
}
-void* SystemArena_Calloc(u32 num, u32 size)
-{
+void* SystemArena_Calloc(u32 num, u32 size) {
void* ret;
u32 n;
- n = num*size;
+ n = num * size;
ret = __osMalloc(&gSystemArena, n);
- if (ret)
+ if (ret) {
bzero(ret, n);
+ }
SystemArena_CheckPointer(ret, n, "calloc", "確保");
return ret;
}
-void SystemArena_Display()
-{
- //System heap display
+void SystemArena_Display() {
+ // System heap display
osSyncPrintf("システムヒープ表示\n");
__osDisplayArena(&gSystemArena);
}
-void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc)
-{
+void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
ArenaImpl_GetSizes(&gSystemArena, outMaxFree, outFree, outAlloc);
}
-void SystemArena_Check()
-{
+void SystemArena_Check() {
__osCheckArena(&gSystemArena);
}
-void SystemArena_Init(void* start, u32 size)
-{
+void SystemArena_Init(void* start, u32 size) {
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocInit(&gSystemArena, start, size);
}
-void SystemArena_Cleanup()
-{
+void SystemArena_Cleanup() {
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocCleanup(&gSystemArena);
}
-u8 SystemArena_IsInitalized()
-{
+u8 SystemArena_IsInitalized() {
return __osMallocIsInitalized(&gSystemArena);
}
diff --git a/src/code/title_setup.c b/src/code/title_setup.c
index b0c3e76f9..827987d33 100644
--- a/src/code/title_setup.c
+++ b/src/code/title_setup.c
@@ -1,21 +1,17 @@
#include <global.h>
-void TitleSetup_InitImpl(GameState* gameState)
-{
- //Zelda common data initalization
+void TitleSetup_InitImpl(GameState* gameState) {
+ // Zelda common data initalization
osSyncPrintf("ゼルダ共通データ初期化\n");
SaveContext_Init();
gameState->running = false;
SET_NEXT_GAMESTATE(gameState, Title_Init, TitleContext);
}
-void TitleSetup_Destroy(GameState* gameState)
-{
-
+void TitleSetup_Destroy(GameState* gameState) {
}
-void TitleSetup_Init(GameState* gameState)
-{
+void TitleSetup_Init(GameState* gameState) {
gameState->destroy = TitleSetup_Destroy;
TitleSetup_InitImpl(gameState);
-} \ No newline at end of file
+}
diff --git a/src/code/z_DLF.c b/src/code/z_DLF.c
index 2117a771a..ab09cbac5 100644
--- a/src/code/z_DLF.c
+++ b/src/code/z_DLF.c
@@ -2,109 +2,110 @@
#include <global.h>
#include <vt.h>
-void Overlay_LoadGameState(GameStateOverlay* overlayEntry)
-{
- if (overlayEntry->loadedRamAddr != NULL)
- {
+void Overlay_LoadGameState(GameStateOverlay* overlayEntry) {
+ if (overlayEntry->loadedRamAddr != NULL) {
// Translates to: "ALREADY LINKED"
osSyncPrintf("既にリンクされています\n");
return;
}
- if (overlayEntry->vramStart == 0)
+ if (overlayEntry->vramStart == 0) {
overlayEntry->unk_28 = 0;
- else
- {
+ } else {
overlayEntry->loadedRamAddr = Overlay_AllocateAndLoad(overlayEntry->vromStart, overlayEntry->vromEnd,
overlayEntry->vramStart, overlayEntry->vramEnd);
- if (overlayEntry->loadedRamAddr == NULL)
- {
+ if (overlayEntry->loadedRamAddr == NULL) {
// Translates to: "LOADING FAILED"
osSyncPrintf("ロードに失敗しました\n");
return;
}
osSyncPrintf(VT_FGCOL(GREEN));
- osSyncPrintf("OVL(d):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n",
- overlayEntry->vramStart, overlayEntry->vramEnd,
+ osSyncPrintf("OVL(d):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", overlayEntry->vramStart, overlayEntry->vramEnd,
overlayEntry->loadedRamAddr,
(u32)overlayEntry->loadedRamAddr + (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart,
- (u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr,
- "");
+ (u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr, "");
osSyncPrintf(VT_RST);
- if (overlayEntry->unk_14 != NULL)
+ if (overlayEntry->unk_14 != NULL) {
overlayEntry->unk_14 = (void*)((u32)overlayEntry->unk_14 -
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
- else
+ } else {
overlayEntry->unk_14 = NULL;
+ }
- if (overlayEntry->init != NULL)
+ if (overlayEntry->init != NULL) {
overlayEntry->init = (void*)((u32)overlayEntry->init -
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
- else
+ } else {
overlayEntry->init = NULL;
+ }
- if (overlayEntry->destroy != NULL)
+ if (overlayEntry->destroy != NULL) {
overlayEntry->destroy = (void*)((u32)overlayEntry->destroy -
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
- else
+ } else {
overlayEntry->destroy = NULL;
+ }
- if (overlayEntry->unk_20 != NULL)
+ if (overlayEntry->unk_20 != NULL) {
overlayEntry->unk_20 = (void*)((u32)overlayEntry->unk_20 -
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
- else
+ } else {
overlayEntry->unk_20 = NULL;
+ }
- if (overlayEntry->unk_24 != NULL)
+ if (overlayEntry->unk_24 != NULL) {
overlayEntry->unk_24 = (void*)((u32)overlayEntry->unk_24 -
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
- else
+ } else {
overlayEntry->unk_24 = NULL;
+ }
overlayEntry->unk_28 = 0;
}
}
-void Overlay_FreeGameState(GameStateOverlay* overlayEntry)
-{
- if (overlayEntry->loadedRamAddr != NULL)
- {
+void Overlay_FreeGameState(GameStateOverlay* overlayEntry) {
+ if (overlayEntry->loadedRamAddr != NULL) {
s32 temp = overlayEntry->unk_28 != 0 ? -1 : 0;
- if (temp == 0)
- {
- if (overlayEntry->unk_14 != NULL)
+ if (temp == 0) {
+ if (overlayEntry->unk_14 != NULL) {
overlayEntry->unk_14 = (void*)((u32)overlayEntry->unk_14 +
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
- else
+ } else {
overlayEntry->unk_14 = NULL;
+ }
- if (overlayEntry->init != NULL)
+ if (overlayEntry->init != NULL) {
overlayEntry->init = (void*)((u32)overlayEntry->init +
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
- else
+ } else {
overlayEntry->init = NULL;
+ }
- if (overlayEntry->destroy != NULL)
+ if (overlayEntry->destroy != NULL) {
overlayEntry->destroy = (void*)((u32)overlayEntry->destroy +
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
- else
+ } else {
overlayEntry->destroy = NULL;
+ }
- if (overlayEntry->unk_20 != NULL)
+ if (overlayEntry->unk_20 != NULL) {
overlayEntry->unk_20 = (void*)((u32)overlayEntry->unk_20 +
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
- else
+ } else {
overlayEntry->unk_20 = NULL;
+ }
- if (overlayEntry->unk_24 != NULL)
+ if (overlayEntry->unk_24 != NULL) {
overlayEntry->unk_24 = (void*)((u32)overlayEntry->unk_24 +
(s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr));
- else
+ } else {
overlayEntry->unk_24 = NULL;
+ }
SystemArena_FreeDebug(overlayEntry->loadedRamAddr, "../z_DLF.c", 149);
overlayEntry->loadedRamAddr = NULL;
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index 958cc4dad..be598da4a 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -2,57 +2,54 @@
#include <global.h>
#include <vt.h>
-void ActorShape_Init(ActorShape* shape, f32 arg1, void* shadowDrawFunc, f32 arg3)
-{
+void ActorShape_Init(ActorShape* shape, f32 arg1, void* shadowDrawFunc, f32 arg3) {
shape->unk_08 = arg1;
shape->shadowDrawFunc = shadowDrawFunc;
shape->unk_10 = arg3;
shape->unk_14 = -1;
}
-void func_8002B200(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx, u32 dlist, Color_RGBA8* color)
-{
+void func_8002B200(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx, u32 dlist, Color_RGBA8* color) {
f32 temp1;
f32 temp2;
MtxF sp60;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
- if (actor->floorPoly != NULL)
- {
+ if (actor->floorPoly != NULL) {
temp1 = actor->posRot.pos.y - actor->unk_80;
- if (temp1 >= -50.0f && temp1 < 500.0f)
- {
+ if (temp1 >= -50.0f && temp1 < 500.0f) {
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 1553);
gfxCtx->polyOpa.p = func_80093774(gfxCtx->polyOpa.p, 0x2C);
- gDPSetCombineLERP(gfxCtx->polyOpa.p++,
- 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0,
- 0, 0, 0, COMBINED, 0, 0, 0, COMBINED);
+ gDPSetCombineLERP(gfxCtx->polyOpa.p++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0,
+ 0, COMBINED);
temp1 = (temp1 < 0.0f) ? 0.0f : ((temp1 > 150.0f) ? 150.0f : temp1);
temp2 = 1.0f - (temp1 * (1.f / 350));
- if (color != NULL)
+ if (color != NULL) {
gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, color->r, color->g, color->b,
(u32)(actor->shape.unk_14 * temp2) & 0xFF);
- else
- gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, 0, 0, 0,
- (u32)(actor->shape.unk_14 * temp2) & 0xFF);
+ } else {
+ gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, 0, 0, 0, (u32)(actor->shape.unk_14 * temp2) & 0xFF);
+ }
func_80038A28(actor->floorPoly, actor->posRot.pos.x, actor->unk_80, actor->posRot.pos.z, &sp60);
Matrix_Put(&sp60);
- if (dlist != (u32)&D_04049210)
+ if (dlist != (u32)&D_04049210) {
Matrix_RotateY(actor->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY);
+ }
temp2 = (1.0f - (temp1 * (1.f / 350))) * actor->shape.unk_10;
Matrix_Scale(actor->scale.x * temp2, 1.0f, actor->scale.z * temp2, MTXMODE_APPLY);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1588), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1588),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, dlist);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 1594);
@@ -60,25 +57,21 @@ void func_8002B200(Actor* actor, LightMapper* lightMapper, GlobalContext* global
}
}
-void ActorShadow_DrawFunc_Circle(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx)
-{
+void ActorShadow_DrawFunc_Circle(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) {
func_8002B200(actor, lightMapper, globalCtx, &D_04049210, NULL);
}
Color_RGBA8 D_80115F80 = { 0xFF, 0xFF, 0xFF, 0xFF };
-void ActorShadow_DrawFunc_WhiteCircle(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx)
-{
+void ActorShadow_DrawFunc_WhiteCircle(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) {
func_8002B200(actor, lightMapper, globalCtx, &D_04049210, &D_80115F80);
}
-void ActorShadow_DrawFunc_Squiggly(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx)
-{
+void ActorShadow_DrawFunc_Squiggly(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) {
func_8002B200(actor, lightMapper, globalCtx, &D_04049AD0, NULL);
}
-void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6)
-{
+void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3, f32 arg4, f32 arg5, f32 arg6) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
f32 sp58;
Gfx* gfxArr[7];
@@ -95,7 +88,8 @@ void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3,
Matrix_RotateY(sp58, MTXMODE_APPLY);
Matrix_Scale(arg5, 1.0f, arg5 * arg6, MTXMODE_APPLY);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1687), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 1687),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_04048180);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 1693);
@@ -103,8 +97,7 @@ void func_8002B66C(GlobalContext* globalCtx, Light* light, MtxF* arg2, s32 arg3,
#ifdef NON_MATCHING
// this function still needs a lot of work
-void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx)
-{
+void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, GlobalContext* globalCtx) {
GraphicsContext* gfxCtx;
MtxF spE8;
Vec2f spE0;
@@ -129,8 +122,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa
temp_f20 = actor->posRot.pos.y - actor->unk_80;
- if (temp_f20 > 20.0f)
- {
+ if (temp_f20 > 20.0f) {
temp_10 = actor->shape.unk_10;
actor->shape.unk_10 *= 0.3f;
temp_14 = actor->shape.unk_14;
@@ -140,8 +132,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa
actor->shape.unk_14 = temp_14;
}
- if (temp_f20 < 200.0f)
- {
+ if (temp_f20 < 200.0f) {
spAC = &spE0.x;
gfxCtx = globalCtx->state.gfxCtx;
temp_s6 = lightMapper->numLights - 2;
@@ -153,8 +144,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa
phi_s7 = &actor->unk_CC;
- for (index = 0; index < 2; index++)
- {
+ for (index = 0; index < 2; index++) {
phi_s7->y += 50.0f;
*spAC = func_800BFCB8(globalCtx, &spE8, phi_s7);
phi_s7->y -= 50.0f;
@@ -163,8 +153,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa
phi_f2 = phi_s7->y - *spAC;
- if ((phi_f2 >= -1.0f) && (phi_f2 < 500.0f))
- {
+ if ((phi_f2 >= -1.0f) && (phi_f2 < 500.0f)) {
phi_s0 = lightMapper->lights;
if (phi_f2 <= 0.0f)
@@ -183,13 +172,10 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa
phi_s2 = 0;
- for (phi_s1 = 0; phi_s1 < temp_s6; phi_s1++)
- {
- if (phi_s0->l.dir[1] > 0)
- {
+ for (phi_s1 = 0; phi_s1 < temp_s6; phi_s1++) {
+ if (phi_s0->l.dir[1] > 0) {
temp_lo = ABS(phi_s0->l.dir[1]) * ((phi_s0->l.col[0] + phi_s0->l.col[1]) + phi_s0->l.col[2]);
- if (temp_lo > 0)
- {
+ if (temp_lo > 0) {
func_8002B66C(globalCtx, phi_s0, &spE8, temp_lo, temp_f24, temp_f22_2, temp_f20_2);
phi_s2 += temp_lo;
}
@@ -197,11 +183,10 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa
phi_s0++;
}
- for (phi_s1 = 0; phi_s1 < 2; phi_s1++)
- {
- if (phi_s0->l.dir[1] > 0)
- {
- temp_a3 = (ABS(phi_s0->l.dir[1]) * ((phi_s0->l.col[0] + phi_s0->l.col[1]) + phi_s0->l.col[2])) - (phi_s2 * 8);
+ for (phi_s1 = 0; phi_s1 < 2; phi_s1++) {
+ if (phi_s0->l.dir[1] > 0) {
+ temp_a3 = (ABS(phi_s0->l.dir[1]) * ((phi_s0->l.col[0] + phi_s0->l.col[1]) + phi_s0->l.col[2])) -
+ (phi_s2 * 8);
if (temp_a3 > 0)
func_8002B66C(globalCtx, phi_s0, &spE8, temp_a3, temp_f24, temp_f22_2, temp_f20_2);
}
@@ -215,8 +200,7 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa
if (!(actor->bgCheckFlags & 1))
actor->shape.unk_15 = 0;
- else if (actor->shape.unk_15 == 3)
- {
+ else if (actor->shape.unk_15 == 3) {
temp_f0 = actor->unk_CC.y - actor->unk_D8.y;
if ((spE0.x + temp_f0) < (spE0.y - temp_f0))
actor->shape.unk_15 = 2;
@@ -231,28 +215,25 @@ void ActorShadow_DrawFunc_Teardrop(Actor* actor, LightMapper* lightMapper, Globa
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/ActorShadow_DrawFunc_Teardrop.s")
#endif
-void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, UNK_PTR arg3, s32 arg4, UNK_PTR arg5)
-{
- if (arg1 == arg2)
+void func_8002BDB0(Actor* actor, s32 arg1, s32 arg2, UNK_PTR arg3, s32 arg4, UNK_PTR arg5) {
+ if (arg1 == arg2) {
Matrix_MultVec3f(arg3, &actor->unk_CC);
- else if (arg1 == arg4)
+ } else if (arg1 == arg4) {
Matrix_MultVec3f(arg5, &actor->unk_D8);
+ }
}
-void func_8002BE04(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, f32* arg3)
-{
+void func_8002BE04(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, f32* arg3) {
func_800A6E10(&globalCtx->mf_11D60, arg1, arg2, arg3);
*arg3 = (*arg3 < 1.0f) ? 1.0f : (1.0f / *arg3);
}
-typedef struct
-{
+typedef struct {
/* 0x00 */ Color_RGBA8 inner;
/* 0x04 */ Color_RGBA8 outer;
} NaviColor; // size = 0x8
-NaviColor sNaviColorList[] =
-{
+NaviColor sNaviColorList[] = {
{ { 0x00, 0xFF, 0x00, 0xFF }, { 0x00, 0xFF, 0x00, 0x00 } },
{ { 0x00, 0xFF, 0x00, 0xFF }, { 0x00, 0xFF, 0x00, 0x00 } },
{ { 0xFF, 0xFF, 0xFF, 0xFF }, { 0x00, 0x00, 0xFF, 0x00 } },
@@ -269,21 +250,18 @@ NaviColor sNaviColorList[] =
};
// unused
-Gfx D_80115FF0[] =
-{
+Gfx D_80115FF0[] = {
gsSPEndDisplayList(),
};
-void func_8002BE64(TargetContext* targetCtx, s32 index, f32 arg2, f32 arg3, f32 arg4)
-{
+void func_8002BE64(TargetContext* targetCtx, s32 index, f32 arg2, f32 arg3, f32 arg4) {
targetCtx->arr_50[index].pos.x = arg2;
targetCtx->arr_50[index].pos.y = arg3;
targetCtx->arr_50[index].pos.z = arg4;
targetCtx->arr_50[index].unk_0C = targetCtx->unk_44;
}
-void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globalCtx)
-{
+void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globalCtx) {
TargetContextEntry* entry;
NaviColor* naviColor;
s32 i;
@@ -295,8 +273,7 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globa
naviColor = &sNaviColorList[actorType];
entry = &targetCtx->arr_50[0];
- for (i = 0; i < ARRAY_COUNT(targetCtx->arr_50); i++)
- {
+ for (i = 0; i < ARRAY_COUNT(targetCtx->arr_50); i++) {
func_8002BE64(targetCtx, i, 0.0f, 0.0f, 0.0f);
entry->color.r = naviColor->inner.r;
entry->color.g = naviColor->inner.g;
@@ -305,8 +282,7 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorType, GlobalContext* globa
}
}
-void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorType, GlobalContext* globalCtx)
-{
+void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorType, GlobalContext* globalCtx) {
NaviColor* naviColor = &sNaviColorList[actorType];
targetCtx->naviRefPos.x = actor->posRot2.pos.x;
targetCtx->naviRefPos.y = actor->posRot2.pos.y + (actor->unk_4C * actor->scale.y);
@@ -321,8 +297,7 @@ void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorType, Global
targetCtx->naviOuter.a = naviColor->outer.a;
}
-void func_8002C0C0(TargetContext* targetCtx, Actor* actor, GlobalContext* globalCtx)
-{
+void func_8002C0C0(TargetContext* targetCtx, Actor* actor, GlobalContext* globalCtx) {
targetCtx->arrowPointedActor = NULL;
targetCtx->targetedActor = NULL;
targetCtx->unk_40 = 0.0f;
@@ -336,8 +311,7 @@ void func_8002C0C0(TargetContext* targetCtx, Actor* actor, GlobalContext* global
#ifdef NON_MATCHING
// this function still needs some work
-void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx)
-{
+void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) {
Actor* actor;
Player* player;
GraphicsContext* gfxCtx;
@@ -356,10 +330,9 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx)
Vec3f* vec;
gfxCtx = globalCtx->state.gfxCtx;
- func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 2029);
+ func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 2029);
- if (targetCtx->unk_48 != 0)
- {
+ if (targetCtx->unk_48 != 0) {
player = PLAYER;
spCE = 0xFF;
@@ -370,13 +343,10 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx)
else
spB8 = 3;
- if (targetCtx->targetedActor != NULL)
- {
+ if (targetCtx->targetedActor != NULL) {
Math_Vec3f_Copy(&targetCtx->targetCenterPos, &targetCtx->targetedActor->posRot2.pos);
var1 = (500.0f - targetCtx->unk_44) / 420.0f;
- }
- else
- {
+ } else {
targetCtx->unk_48 -= 0x78;
if (targetCtx->unk_48 < 0)
targetCtx->unk_48 = 0;
@@ -399,16 +369,13 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx)
func_8002BE64(targetCtx, targetCtx->unk_4C, spBC.x, spBC.y, spBC.z);
- if ((!(player->stateFlags1 & 0x40)) || (targetCtx->targetedActor != player->unk_664))
- {
+ if ((!(player->stateFlags1 & 0x40)) || (targetCtx->targetedActor != player->unk_664)) {
gfxCtx->overlay.p = func_80093774(gfxCtx->overlay.p, 0x39);
- for (spB0 = 0, spAC = targetCtx->unk_4C; spB0 < spB8; spB0++)
- {
+ for (spB0 = 0, spAC = targetCtx->unk_4C; spB0 < spB8; spB0++) {
entry = &targetCtx->arr_50[spAC];
- if (entry->unk_0C < 500.0f)
- {
+ if (entry->unk_0C < 500.0f) {
if (entry->unk_0C <= 120.0f)
var2 = 0.15f;
else
@@ -417,17 +384,17 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx)
Matrix_Translate(entry->pos.x, entry->pos.y, 0.0f, MTXMODE_NEW);
Matrix_Scale(var2, 0.15f, 1.0f, MTXMODE_APPLY);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- entry->color.r, entry->color.g, entry->color.b, (u8)spCE);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, entry->color.r, entry->color.g, entry->color.b,
+ (u8)spCE);
Matrix_RotateZ((targetCtx->unk_4B & 0x7F) * (M_PI / 64), MTXMODE_APPLY);
- for (i = 0; i < 4; i++)
- {
+ for (i = 0; i < 4; i++) {
Matrix_RotateZ(M_PI / 2, MTXMODE_APPLY);
Matrix_Push();
Matrix_Translate(entry->unk_0C, entry->unk_0C, 0.0f, MTXMODE_APPLY);
- gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 2116), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 2116),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->overlay.p++, &D_0404D450);
Matrix_Pull();
}
@@ -442,25 +409,19 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx)
}
actor = targetCtx->unk_94;
- if ((actor != NULL) && !(actor->flags & 0x8000000))
- {
+ if ((actor != NULL) && !(actor->flags & 0x8000000)) {
NaviColor* naviColor = &sNaviColorList[actor->type];
gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0x7);
- Matrix_Translate(actor->posRot2.pos.x,
- actor->posRot2.pos.y + (actor->unk_4C * actor->scale.y) + 17.0f,
- actor->posRot2.pos.z,
- MTXMODE_NEW);
+ Matrix_Translate(actor->posRot2.pos.x, actor->posRot2.pos.y + (actor->unk_4C * actor->scale.y) + 17.0f,
+ actor->posRot2.pos.z, MTXMODE_NEW);
Matrix_RotateY((f32)((u16)(globalCtx->gameplayFrames * 3000)) * (M_PI / 32768), MTXMODE_APPLY);
- Matrix_Scale((iREG(27) + 35) / 1000.0f,
- (iREG(28) + 60) / 1000.0f,
- (iREG(29) + 50) / 1000.0f,
- MTXMODE_APPLY);
-
- gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0,
- naviColor->inner.r, naviColor->inner.g, naviColor->inner.b, 0xFF);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 2153), G_MTX_MODELVIEW | G_MTX_LOAD);
+ Matrix_Scale((iREG(27) + 35) / 1000.0f, (iREG(28) + 60) / 1000.0f, (iREG(29) + 50) / 1000.0f, MTXMODE_APPLY);
+
+ gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, naviColor->inner.r, naviColor->inner.g, naviColor->inner.b, 0xFF);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 2153),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_0400CB70);
}
@@ -470,8 +431,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_8002C124.s")
#endif
-void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, GlobalContext* globalCtx)
-{
+void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, GlobalContext* globalCtx) {
s32 pad;
Actor* unkActor;
s32 actorType;
@@ -487,39 +447,37 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl
unkActor = NULL;
- if ((player->unk_664 != NULL) && (player->unk_84B[player->unk_846] == 2))
+ if ((player->unk_664 != NULL) && (player->unk_84B[player->unk_846] == 2)) {
targetCtx->unk_94 = NULL;
- else
- {
+ } else {
func_80032AF0(globalCtx, &globalCtx->actorCtx, &unkActor, player);
targetCtx->unk_94 = unkActor;
}
- if (targetCtx->unk_8C != NULL)
- {
+ if (targetCtx->unk_8C != NULL) {
unkActor = targetCtx->unk_8C;
targetCtx->unk_8C = NULL;
- }
- else if (actorArg != NULL)
+ } else if (actorArg != NULL) {
unkActor = actorArg;
+ }
- if (unkActor != NULL)
+ if (unkActor != NULL) {
actorType = unkActor->type;
- else
+ } else {
actorType = player->actor.type;
+ }
- if ((unkActor != targetCtx->arrowPointedActor) || (actorType != targetCtx->activeType))
- {
+ if ((unkActor != targetCtx->arrowPointedActor) || (actorType != targetCtx->activeType)) {
targetCtx->arrowPointedActor = unkActor;
targetCtx->activeType = actorType;
targetCtx->unk_40 = 1.0f;
}
- if (unkActor == NULL)
+ if (unkActor == NULL) {
unkActor = &player->actor;
+ }
- if (Math_ApproxF(&targetCtx->unk_40, 0.0f, 0.25f) == 0)
- {
+ if (Math_ApproxF(&targetCtx->unk_40, 0.0f, 0.25f) == 0) {
temp1 = 0.25f / targetCtx->unk_40;
temp2 = unkActor->posRot.pos.x - targetCtx->naviRefPos.x;
temp3 = (unkActor->posRot.pos.y + (unkActor->unk_4C * unkActor->scale.y)) - targetCtx->naviRefPos.y;
@@ -527,26 +485,25 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl
targetCtx->naviRefPos.x += temp2 * temp1;
targetCtx->naviRefPos.y += temp3 * temp1;
targetCtx->naviRefPos.z += temp4 * temp1;
- }
- else
+ } else {
func_8002BF60(targetCtx, unkActor, actorType, globalCtx);
+ }
- if ((actorArg != NULL) && (targetCtx->unk_4B == 0))
- {
+ if ((actorArg != NULL) && (targetCtx->unk_4B == 0)) {
func_8002BE04(globalCtx, &actorArg->posRot2.pos, &sp50, &sp4C);
- if (((sp50.z <= 0.0f) || (1.0f <= fabsf(sp50.x * sp4C))) || (1.0f <= fabsf(sp50.y * sp4C)))
+ if (((sp50.z <= 0.0f) || (1.0f <= fabsf(sp50.x * sp4C))) || (1.0f <= fabsf(sp50.y * sp4C))) {
actorArg = NULL;
+ }
}
- if (actorArg != NULL)
- {
- if (actorArg != targetCtx->targetedActor)
- {
+ if (actorArg != NULL) {
+ if (actorArg != targetCtx->targetedActor) {
func_8002BE98(targetCtx, actorArg->type, globalCtx);
targetCtx->targetedActor = actorArg;
- if (actorArg->id == ACTOR_EN_BOOM)
+ if (actorArg->id == ACTOR_EN_BOOM) {
targetCtx->unk_48 = 0;
+ }
lockOnSfxId = ((actorArg->flags & 5) == 5) ? NA_SE_SY_LOCK_ON : NA_SE_SY_LOCK_ON_HUMAN;
func_80078884(lockOnSfxId);
@@ -556,21 +513,17 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl
targetCtx->targetCenterPos.y = actorArg->posRot.pos.y - (actorArg->shape.unk_08 * actorArg->scale.y);
targetCtx->targetCenterPos.z = actorArg->posRot.pos.z;
- if (targetCtx->unk_4B == 0)
- {
+ if (targetCtx->unk_4B == 0) {
temp5 = (500.0f - targetCtx->unk_44) * 3.0f;
temp6 = (temp5 < 30.0f) ? 30.0f : ((100.0f < temp5) ? 100.0f : temp5);
- if (Math_ApproxF(&targetCtx->unk_44, 80.0f, temp6) != 0)
+ if (Math_ApproxF(&targetCtx->unk_44, 80.0f, temp6) != 0) {
targetCtx->unk_4B++;
- }
- else
- {
+ }
+ } else {
targetCtx->unk_4B = (targetCtx->unk_4B + 3) | 0x80;
targetCtx->unk_44 = 120.0f;
}
- }
- else
- {
+ } else {
targetCtx->targetedActor = NULL;
Math_ApproxF(&targetCtx->unk_44, 500.0f, 80.0f);
}
@@ -579,166 +532,155 @@ void func_8002C7BC(TargetContext* targetCtx, Player* player, Actor* actorArg, Gl
/**
* Tests if current scene switch flag is set.
*/
-s32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag)
-{
- if (flag < 0x20)
+s32 Flags_GetSwitch(GlobalContext* globalCtx, s32 flag) {
+ if (flag < 0x20) {
return globalCtx->actorCtx.flags.swch & (1 << flag);
- else
+ } else {
return globalCtx->actorCtx.flags.tempSwch & (1 << flag);
+ }
}
/**
* Sets current scene switch flag.
*/
-void Flags_SetSwitch(GlobalContext* globalCtx, s32 flag)
-{
- if (flag < 0x20)
+void Flags_SetSwitch(GlobalContext* globalCtx, s32 flag) {
+ if (flag < 0x20) {
globalCtx->actorCtx.flags.swch |= (1 << flag);
- else
+ } else {
globalCtx->actorCtx.flags.tempSwch |= (1 << flag);
+ }
}
/**
* Unsets current scene switch flag.
*/
-void Flags_UnsetSwitch(GlobalContext* globalCtx, s32 flag)
-{
- if (flag < 0x20)
+void Flags_UnsetSwitch(GlobalContext* globalCtx, s32 flag) {
+ if (flag < 0x20) {
globalCtx->actorCtx.flags.swch &= ~(1 << flag);
- else
+ } else {
globalCtx->actorCtx.flags.tempSwch &= ~(1 << flag);
+ }
}
/**
* Tests if current scene unknown flag is set.
*/
-s32 Flags_GetUnknown(GlobalContext* globalCtx, s32 flag)
-{
- if (flag < 0x20)
+s32 Flags_GetUnknown(GlobalContext* globalCtx, s32 flag) {
+ if (flag < 0x20) {
return globalCtx->actorCtx.flags.unk0 & (1 << flag);
- else
+ } else {
return globalCtx->actorCtx.flags.unk1 & (1 << flag);
+ }
}
/**
* Sets current scene unknown flag.
*/
-void Flags_SetUnknown(GlobalContext* globalCtx, s32 flag)
-{
- if (flag < 0x20)
+void Flags_SetUnknown(GlobalContext* globalCtx, s32 flag) {
+ if (flag < 0x20) {
globalCtx->actorCtx.flags.unk0 |= (1 << flag);
- else
+ } else {
globalCtx->actorCtx.flags.unk1 |= (1 << flag);
+ }
}
/**
* Unsets current scene unknown flag.
*/
-void Flags_UnsetUnknown(GlobalContext* globalCtx, s32 flag)
-{
- if (flag < 0x20)
+void Flags_UnsetUnknown(GlobalContext* globalCtx, s32 flag) {
+ if (flag < 0x20) {
globalCtx->actorCtx.flags.unk0 &= ~(1 << flag);
- else
+ } else {
globalCtx->actorCtx.flags.unk1 &= ~(1 << flag);
+ }
}
/**
* Tests if current scene chest flag is set.
*/
-s32 Flags_GetTreasure(GlobalContext* globalCtx, s32 flag)
-{
+s32 Flags_GetTreasure(GlobalContext* globalCtx, s32 flag) {
return globalCtx->actorCtx.flags.chest & (1 << flag);
}
/**
* Sets current scene chest flag.
*/
-void Flags_SetTreasure(GlobalContext* globalCtx, s32 flag)
-{
+void Flags_SetTreasure(GlobalContext* globalCtx, s32 flag) {
globalCtx->actorCtx.flags.chest |= (1 << flag);
}
/**
* Tests if current scene clear flag is set.
*/
-s32 Flags_GetClear(GlobalContext* globalCtx, s32 flag)
-{
+s32 Flags_GetClear(GlobalContext* globalCtx, s32 flag) {
return globalCtx->actorCtx.flags.clear & (1 << flag);
}
/**
* Sets current scene clear flag.
*/
-void Flags_SetClear(GlobalContext* globalCtx, s32 flag)
-{
+void Flags_SetClear(GlobalContext* globalCtx, s32 flag) {
globalCtx->actorCtx.flags.clear |= (1 << flag);
}
/**
* Unsets current scene clear flag.
*/
-void Flags_UnsetClear(GlobalContext* globalCtx, s32 flag)
-{
+void Flags_UnsetClear(GlobalContext* globalCtx, s32 flag) {
globalCtx->actorCtx.flags.clear &= ~(1 << flag);
}
/**
* Tests if current scene temp clear flag is set.
*/
-s32 Flags_GetTempClear(GlobalContext* globalCtx, s32 flag)
-{
+s32 Flags_GetTempClear(GlobalContext* globalCtx, s32 flag) {
return globalCtx->actorCtx.flags.tempClear & (1 << flag);
}
/**
* Sets current scene temp clear flag.
*/
-void Flags_SetTempClear(GlobalContext* globalCtx, s32 flag)
-{
+void Flags_SetTempClear(GlobalContext* globalCtx, s32 flag) {
globalCtx->actorCtx.flags.tempClear |= 1 << flag;
}
/**
* Unsets current scene temp clear flag.
*/
-void Flags_UnsetTempClear(GlobalContext* globalCtx, s32 flag)
-{
+void Flags_UnsetTempClear(GlobalContext* globalCtx, s32 flag) {
globalCtx->actorCtx.flags.tempClear &= ~(1 << flag);
}
/**
* Tests if current scene collectible flag is set.
*/
-s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag)
-{
- if (flag < 0x20)
+s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag) {
+ if (flag < 0x20) {
return globalCtx->actorCtx.flags.collect & (1 << flag);
- else
+ } else {
return globalCtx->actorCtx.flags.tempCollect & (1 << flag);
+ }
}
/**
* Sets current scene collectible flag.
*/
-void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag)
-{
- if (flag != 0)
- {
- if (flag < 0x20)
+void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag) {
+ if (flag != 0) {
+ if (flag < 0x20) {
globalCtx->actorCtx.flags.collect |= 1 << flag;
- else
+ } else {
globalCtx->actorCtx.flags.tempCollect |= 1 << flag;
+ }
}
}
-void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx)
-{
+void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
titleCtx->delayA = titleCtx->delayB = titleCtx->unk_E = titleCtx->unk_C = 0;
}
-void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture,
- s16 arg3, s16 arg4, u8 arg5, u8 arg6)
-{
+void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s16 arg3, s16 arg4,
+ u8 arg5, u8 arg6) {
titleCtx->texture = texture;
titleCtx->unk_4 = arg3;
titleCtx->unk_6 = arg4;
@@ -748,14 +690,14 @@ void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx
titleCtx->delayB = 0;
}
-void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture,
- s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7)
-{
+void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s32 arg3, s32 arg4,
+ s32 arg5, s32 arg6, s32 arg7) {
Scene* loadedScene = globalCtx->loadedScene;
u32 size = loadedScene->titleVromEnd - loadedScene->titleVromStart;
- if ((size != 0) && (size <= 0x3000))
+ if ((size != 0) && (size <= 0x3000)) {
DmaMgr_SendRequest1(texture, loadedScene->titleVromStart, size, "../z_actor.c", 2765);
+ }
titleCtx->texture = texture;
titleCtx->unk_4 = arg3;
@@ -766,17 +708,12 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt
titleCtx->delayB = arg7;
}
-void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx)
-{
- if (DECR(titleCtx->delayB) == 0)
- {
- if (DECR(titleCtx->delayA) == 0)
- {
+void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
+ if (DECR(titleCtx->delayB) == 0) {
+ if (DECR(titleCtx->delayA) == 0) {
Math_ApproxS(&titleCtx->unk_C, 0, 30);
Math_ApproxS(&titleCtx->unk_E, 0, 70);
- }
- else
- {
+ } else {
Math_ApproxS(&titleCtx->unk_C, 255, 10);
Math_ApproxS(&titleCtx->unk_E, 255, 20);
}
@@ -785,8 +722,7 @@ void TitleCard_Update(GlobalContext* globalCtx, TitleCardContext* titleCtx)
#ifdef NON_MATCHING
// major ordering and stack usage differences
-void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx)
-{
+void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
s32 spCC;
s32 spC8;
s32 unk1;
@@ -799,8 +735,7 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx)
Gfx* gfxArr[4];
s32 sp38;
- if (titleCtx->unk_C != 0)
- {
+ if (titleCtx->unk_C != 0) {
spCC = titleCtx->unk_8;
spC8 = titleCtx->unk_9;
spC0 = (titleCtx->unk_4 * 4) - (spCC * 2);
@@ -819,41 +754,25 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx)
gfxCtx->overlay.p = func_80093808(gfxCtx->overlay.p);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- (u8)titleCtx->unk_E, (u8)titleCtx->unk_E,
- (u8)titleCtx->unk_E, (u8)titleCtx->unk_C);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, (u8)titleCtx->unk_E, (u8)titleCtx->unk_E, (u8)titleCtx->unk_E,
+ (u8)titleCtx->unk_C);
- gDPLoadTextureBlock(gfxCtx->overlay.p++,
- titleCtx->texture + spB0,
- G_IM_FMT_IA,
- G_IM_SIZ_8b,
- spCC, spC8,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
- G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock(gfxCtx->overlay.p++, titleCtx->texture + spB0, G_IM_FMT_IA, G_IM_SIZ_8b, spCC, spC8, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
+ G_TX_NOLOD);
- gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB8,
- ((sp38 * 2) + spC0) - 4, spB8 - 1, G_TX_RENDERTILE,
- 0, 0, 1024, 1024);
+ gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB8, ((sp38 * 2) + spC0) - 4, spB8 - 1, G_TX_RENDERTILE, 0, 0,
+ 1024, 1024);
spC8 = titleCtx->unk_9 - spC8;
- if (spC8 > 0)
- {
- gDPLoadTextureBlock(gfxCtx->overlay.p++,
- titleCtx->texture + spB0 + 0x1000,
- G_IM_FMT_IA,
- G_IM_SIZ_8b,
- spCC, spC8,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
+ if (spC8 > 0) {
+ gDPLoadTextureBlock(gfxCtx->overlay.p++, titleCtx->texture + spB0 + 0x1000, G_IM_FMT_IA, G_IM_SIZ_8b, spCC,
+ spC8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
- gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB4,
- ((sp38 * 2) + spC0) - 4, spB4 - 1, G_TX_RENDERTILE,
- 0, 0, 1024, 1024);
+ gSPTextureRectangle(gfxCtx->overlay.p++, spC0, spB4, ((sp38 * 2) + spC0) - 4, spB4 - 1, G_TX_RENDERTILE, 0,
+ 0, 1024, 1024);
}
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 2880);
@@ -863,11 +782,8 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/TitleCard_Draw.s")
#endif
-s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx)
-{
- if ((globalCtx->actorCtx.titleCtx.delayB != 0) ||
- (globalCtx->actorCtx.titleCtx.unk_C != 0))
- {
+s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx) {
+ if ((globalCtx->actorCtx.titleCtx.delayB != 0) || (globalCtx->actorCtx.titleCtx.unk_C != 0)) {
titleCtx->delayA = 0;
titleCtx->delayB = 0;
return 0;
@@ -876,20 +792,17 @@ s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx)
return 1;
}
-void Actor_Kill(Actor* actor)
-{
+void Actor_Kill(Actor* actor) {
actor->draw = NULL;
actor->update = NULL;
actor->flags &= ~0x1;
}
-void Actor_InitPosRot(Actor* actor)
-{
+void Actor_InitPosRot(Actor* actor) {
actor->posRot = actor->initPosRot;
}
-void Actor_SetHeight(Actor* actor, f32 offset)
-{
+void Actor_SetHeight(Actor* actor, f32 offset) {
actor->posRot2.pos.x = actor->posRot.pos.x;
actor->posRot2.pos.y = actor->posRot.pos.y + offset;
actor->posRot2.pos.z = actor->posRot.pos.z;
@@ -899,30 +812,25 @@ void Actor_SetHeight(Actor* actor, f32 offset)
actor->posRot2.rot.z = actor->posRot.rot.z;
}
-void func_8002D5F4(Actor* actor)
-{
+void func_8002D5F4(Actor* actor) {
actor->posRot.rot = actor->shape.rot;
}
-void func_8002D610(Actor* actor)
-{
+void func_8002D610(Actor* actor) {
actor->shape.rot = actor->posRot.rot;
}
-void Actor_SetScale(Actor* actor, f32 scale)
-{
+void Actor_SetScale(Actor* actor, f32 scale) {
actor->scale.z = scale;
actor->scale.y = scale;
actor->scale.x = scale;
}
-void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor)
-{
+void Actor_SetObjectDependency(GlobalContext* globalCtx, Actor* actor) {
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[actor->objBankIndex].segment);
}
-void Actor_Init(Actor* actor, GlobalContext* globalCtx)
-{
+void Actor_Init(Actor* actor, GlobalContext* globalCtx) {
Actor_InitPosRot(actor);
func_8002D610(actor);
Actor_SetHeight(actor, 0.0f);
@@ -938,26 +846,21 @@ void Actor_Init(Actor* actor, GlobalContext* globalCtx)
func_80061E48(&actor->sub_98);
actor->floorPolySource = 0x32;
ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f);
- if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex))
- {
+ if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) {
Actor_SetObjectDependency(globalCtx, actor);
actor->init(actor, globalCtx);
actor->init = NULL;
}
}
-void Actor_Destroy(Actor* actor, GlobalContext* globalCtx)
-{
+void Actor_Destroy(Actor* actor, GlobalContext* globalCtx) {
ActorOverlay* overlayEntry;
char* name;
- if (actor->destroy != NULL)
- {
+ if (actor->destroy != NULL) {
actor->destroy(actor, globalCtx);
actor->destroy = NULL;
- }
- else
- {
+ } else {
overlayEntry = actor->overlayEntry;
name = overlayEntry->name != NULL ? overlayEntry->name : "";
@@ -966,52 +869,46 @@ void Actor_Destroy(Actor* actor, GlobalContext* globalCtx)
}
}
-void func_8002D7EC(Actor* actor)
-{
+void func_8002D7EC(Actor* actor) {
f32 speedRate = R_UPDATE_RATE * 0.5f;
actor->posRot.pos.x += (actor->velocity.x * speedRate) + actor->sub_98.displacement.x;
actor->posRot.pos.y += (actor->velocity.y * speedRate) + actor->sub_98.displacement.y;
actor->posRot.pos.z += (actor->velocity.z * speedRate) + actor->sub_98.displacement.z;
}
-void func_8002D868(Actor* actor)
-{
+void func_8002D868(Actor* actor) {
actor->velocity.x = Math_Sins(actor->posRot.rot.y) * actor->speedXZ;
actor->velocity.z = Math_Coss(actor->posRot.rot.y) * actor->speedXZ;
actor->velocity.y += actor->gravity;
- if (actor->velocity.y < actor->minVelocityY)
+ if (actor->velocity.y < actor->minVelocityY) {
actor->velocity.y = actor->minVelocityY;
+ }
}
-void Actor_MoveForward(Actor* actor)
-{
+void Actor_MoveForward(Actor* actor) {
func_8002D868(actor);
func_8002D7EC(actor);
}
-void func_8002D908(Actor* actor)
-{
+void func_8002D908(Actor* actor) {
f32 sp24 = Math_Coss(actor->posRot.rot.x) * actor->speedXZ;
actor->velocity.x = Math_Sins(actor->posRot.rot.y) * sp24;
actor->velocity.y = Math_Sins(actor->posRot.rot.x) * actor->speedXZ;
actor->velocity.z = Math_Coss(actor->posRot.rot.y) * sp24;
}
-void func_8002D97C(Actor* actor)
-{
+void func_8002D97C(Actor* actor) {
func_8002D908(actor);
func_8002D7EC(actor);
}
-void func_8002D9A4(Actor* actor, f32 arg1)
-{
+void func_8002D9A4(Actor* actor, f32 arg1) {
actor->speedXZ = Math_Coss(actor->posRot.rot.x) * arg1;
actor->velocity.y = -Math_Sins(actor->posRot.rot.x) * arg1;
}
-void func_8002D9F8(Actor* actor, UNK_PTR arg1)
-{
+void func_8002D9F8(Actor* actor, UNK_PTR arg1) {
Vec3f sp1C;
func_800A54FC(arg1, &sp1C, actor->shape.rot.y, actor);
actor->posRot.pos.x += sp1C.x * actor->scale.x;
@@ -1019,58 +916,47 @@ void func_8002D9F8(Actor* actor, UNK_PTR arg1)
actor->posRot.pos.z += sp1C.z * actor->scale.z;
}
-s16 func_8002DA78(Actor* actorA, Actor* actorB)
-{
+s16 func_8002DA78(Actor* actorA, Actor* actorB) {
return Math_Vec3f_Yaw(&actorA->posRot.pos, &actorB->posRot.pos);
}
-s16 func_8002DA9C(Actor* actorA, Actor* actorB)
-{
+s16 func_8002DA9C(Actor* actorA, Actor* actorB) {
return Math_Vec3f_Yaw(&actorA->posRot2.pos, &actorB->posRot2.pos);
}
-s16 func_8002DAC0(Actor* actor, Vec3f* arg1)
-{
+s16 func_8002DAC0(Actor* actor, Vec3f* arg1) {
return Math_Vec3f_Yaw(&actor->posRot.pos, arg1);
}
-s16 func_8002DAE0(Actor* actorA, Actor* actorB)
-{
+s16 func_8002DAE0(Actor* actorA, Actor* actorB) {
return Math_Vec3f_Pitch(&actorA->posRot.pos, &actorB->posRot.pos);
}
-s16 func_8002DB04(Actor* actorA, Actor* actorB)
-{
+s16 func_8002DB04(Actor* actorA, Actor* actorB) {
return Math_Vec3f_Pitch(&actorA->posRot2.pos, &actorB->posRot2.pos);
}
-s16 func_8002DB28(Actor* actor, Vec3f* arg1)
-{
+s16 func_8002DB28(Actor* actor, Vec3f* arg1) {
return Math_Vec3f_Pitch(&actor->posRot.pos, arg1);
}
-f32 func_8002DB48(Actor* actorA, Actor* actorB)
-{
+f32 func_8002DB48(Actor* actorA, Actor* actorB) {
return Math_Vec3f_DistXYZ(&actorA->posRot.pos, &actorB->posRot.pos);
}
-f32 func_8002DB6C(Actor* actor, Vec3f* arg1)
-{
+f32 func_8002DB6C(Actor* actor, Vec3f* arg1) {
return Math_Vec3f_DistXYZ(&actor->posRot.pos, arg1);
}
-f32 func_8002DB8C(Actor* actorA, Actor* actorB)
-{
+f32 func_8002DB8C(Actor* actorA, Actor* actorB) {
return Math_Vec3f_DistXZ(&actorA->posRot.pos, &actorB->posRot.pos);
}
-f32 func_8002DBB0(Actor* actor, Vec3f* arg1)
-{
+f32 func_8002DBB0(Actor* actor, Vec3f* arg1) {
return Math_Vec3f_DistXZ(&actor->posRot.pos, arg1);
}
-void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2)
-{
+void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) {
f32 cosRot2Y;
f32 sinRot2Y;
f32 deltaX;
@@ -1086,72 +972,64 @@ void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2)
result->y = arg2->y - actor->posRot.pos.y;
}
-f32 Actor_HeightDiff(Actor* actorA, Actor* actorB)
-{
+f32 Actor_HeightDiff(Actor* actorA, Actor* actorB) {
return actorB->posRot.pos.y - actorA->posRot.pos.y;
}
-f32 func_8002DC84(Player* player)
-{
+f32 func_8002DC84(Player* player) {
f32 offset = (player->stateFlags1 & 0x800000) ? 32.0f : 0.0f;
- if (LINK_IS_ADULT)
+ if (LINK_IS_ADULT) {
return offset + 68.0f;
- else
+ } else {
return offset + 44.0f;
+ }
}
-f32 func_8002DCE4(Player* player)
-{
- if (player->stateFlags1 & 0x800000)
+f32 func_8002DCE4(Player* player) {
+ if (player->stateFlags1 & 0x800000) {
return 8.0f;
- else if (player->stateFlags1 & 0x8000000)
+ } else if (player->stateFlags1 & 0x8000000) {
return (R_RUN_SPEED_LIMIT / 100.0f) * 0.6f;
- else
+ } else {
return R_RUN_SPEED_LIMIT / 100.0f;
+ }
}
-s32 func_8002DD6C(Player* player)
-{
+s32 func_8002DD6C(Player* player) {
return player->stateFlags1 & 0x8;
}
-s32 func_8002DD78(Player* player)
-{
+s32 func_8002DD78(Player* player) {
return func_8002DD6C(player) && player->unk_834;
}
-s32 func_8002DDA8(GlobalContext* globalCtx)
-{
+s32 func_8002DDA8(GlobalContext* globalCtx) {
Player* player = PLAYER;
return (player->stateFlags1 & 0x800) || func_8002DD78(player);
}
-s32 func_8002DDE4(GlobalContext* globalCtx)
-{
+s32 func_8002DDE4(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->stateFlags2 & 0x8;
}
-s32 func_8002DDF4(GlobalContext* globalCtx)
-{
+s32 func_8002DDF4(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->stateFlags2 & 0x1000;
}
-typedef struct
-{
- /* 0x000 */ Actor actor;
- /* 0x14C */ char unk_14C[0xB4];
- /* 0x200 */ Actor* unk_200;
- /* 0x204 */ f32 unk_204;
- /* 0x208 */ f32 unk_208;
- /* 0x20C */ f32 unk_20C;
- /* 0x210 */ s16 unk_210;
+typedef struct {
+ /* 0x000 */ Actor actor;
+ /* 0x14C */ char unk_14C[0xB4];
+ /* 0x200 */ Actor* unk_200;
+ /* 0x204 */ f32 unk_204;
+ /* 0x208 */ f32 unk_208;
+ /* 0x20C */ f32 unk_20C;
+ /* 0x210 */ s16 unk_210;
} ActorArmsHook;
-void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB)
-{
+void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB) {
ActorArmsHook* hookActor;
hookActor = (ActorArmsHook*)Actor_Find(&globalCtx->actorCtx, 0x0066, ACTORTYPE_ITEMACTION);
@@ -1163,31 +1041,27 @@ void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB)
actorA->flags &= ~0x2000;
}
-void func_8002DE74(GlobalContext* globalCtx, Player* player)
-{
- if ((globalCtx->roomCtx.curRoom.unk_03 != 4) && func_800C0CB8(globalCtx))
+void func_8002DE74(GlobalContext* globalCtx, Player* player) {
+ if ((globalCtx->roomCtx.curRoom.unk_03 != 4) && func_800C0CB8(globalCtx)) {
func_8005A77C(func_800C04A4(globalCtx, 0), 6);
+ }
}
-void func_8002DECC(GlobalContext* globalCtx, Player* player, Actor* actor)
-{
+void func_8002DECC(GlobalContext* globalCtx, Player* player, Actor* actor) {
player->rideActor = actor;
player->stateFlags1 |= 0x800000;
actor->attachedB = &player->actor;
}
-s32 func_8002DEEC(Player* player)
-{
+s32 func_8002DEEC(Player* player) {
return (player->stateFlags1 & 0x20000080) || player->action;
}
-void func_8002DF18(GlobalContext* globalCtx, ActorContext* actorCtx)
-{
+void func_8002DF18(GlobalContext* globalCtx, ActorContext* actorCtx) {
func_8006DC68(globalCtx, actorCtx);
}
-u32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 newAction)
-{
+u32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 newAction) {
Player* player = PLAYER;
player->action = newAction;
player->unk_448 = actor;
@@ -1196,8 +1070,7 @@ u32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 newAction)
return 1;
}
-s32 func_8002DF54(GlobalContext* globalCtx, Actor* actor, u8 arg2)
-{
+s32 func_8002DF54(GlobalContext* globalCtx, Actor* actor, u8 arg2) {
Player* player = PLAYER;
func_8002DF38(globalCtx, actor, arg2);
player->unk_46A = 1;
@@ -1205,96 +1078,91 @@ s32 func_8002DF54(GlobalContext* globalCtx, Actor* actor, u8 arg2)
return 1;
}
-void func_8002DF90(DynaPolyActor* dynaActor)
-{
+void func_8002DF90(DynaPolyActor* dynaActor) {
dynaActor->unk_154 = 0.0f;
dynaActor->unk_150 = 0.0f;
}
-void func_8002DFA4(DynaPolyActor* dynaActor, f32 arg1, s16 arg2)
-{
+void func_8002DFA4(DynaPolyActor* dynaActor, f32 arg1, s16 arg2) {
dynaActor->unk_150 += arg1;
dynaActor->unk_158 = arg2;
}
-s32 func_8002DFC8(Actor* actor, s16 arg1, GlobalContext* globalCtx)
-{
+s32 func_8002DFC8(Actor* actor, s16 arg1, GlobalContext* globalCtx) {
Player* player = PLAYER;
s16 var = (s16)(actor->rotTowardsLinkY + 0x8000) - player->actor.shape.rot.y;
- if (ABS(var) < arg1)
+ if (ABS(var) < arg1) {
return 1;
+ }
return 0;
}
-s32 func_8002E020(Actor* actorA, Actor* actorB, s16 arg2)
-{
+s32 func_8002E020(Actor* actorA, Actor* actorB, s16 arg2) {
s16 var = (s16)(func_8002DA78(actorA, actorB) + 0x8000) - actorB->shape.rot.y;
- if (ABS(var) < arg2)
+ if (ABS(var) < arg2) {
return 1;
+ }
return 0;
}
-s32 func_8002E084(Actor* actor, s16 arg1)
-{
+s32 func_8002E084(Actor* actor, s16 arg1) {
s16 var = actor->rotTowardsLinkY - actor->shape.rot.y;
- if (ABS(var) < arg1)
+ if (ABS(var) < arg1) {
return 1;
+ }
return 0;
}
-s32 func_8002E0D0(Actor* actorA, Actor* actorB, s16 arg2)
-{
+s32 func_8002E0D0(Actor* actorA, Actor* actorB, s16 arg2) {
s16 var = func_8002DA78(actorA, actorB) - actorA->shape.rot.y;
- if (ABS(var) < arg2)
+ if (ABS(var) < arg2) {
return 1;
+ }
return 0;
}
-s32 func_8002E12C(Actor* actor, f32 arg1, s16 arg2)
-{
+s32 func_8002E12C(Actor* actor, f32 arg1, s16 arg2) {
s16 var = actor->rotTowardsLinkY - actor->shape.rot.y;
- if (ABS(var) < arg2)
- {
+ if (ABS(var) < arg2) {
f32 xyzDistanceFromLink = sqrtf(SQ(actor->xzDistanceFromLink) + SQ(actor->yDistanceFromLink));
- if (xyzDistanceFromLink < arg1)
+ if (xyzDistanceFromLink < arg1) {
return 1;
+ }
}
return 0;
}
-s32 func_8002E1A8(Actor* actorA, Actor* actorB, f32 arg2, s16 arg3)
-{
- if (func_8002DB48(actorA, actorB) < arg2)
- {
+s32 func_8002E1A8(Actor* actorA, Actor* actorB, f32 arg2, s16 arg3) {
+ if (func_8002DB48(actorA, actorB) < arg2) {
s16 var = func_8002DA78(actorA, actorB) - actorA->shape.rot.y;
- if (ABS(var) < arg3)
+ if (ABS(var) < arg3) {
return 1;
+ }
}
return 0;
}
-s32 func_8002E234(Actor* actor, f32 arg1, s32 arg2)
-{
- if ((actor->bgCheckFlags & 0x1) && (arg1 < -11.0f))
- {
+s32 func_8002E234(Actor* actor, f32 arg1, s32 arg2) {
+ if ((actor->bgCheckFlags & 0x1) && (arg1 < -11.0f)) {
actor->bgCheckFlags &= ~0x1;
actor->bgCheckFlags |= 0x4;
- if ((actor->velocity.y < 0.0f) && (arg2 & 0x10))
+ if ((actor->velocity.y < 0.0f) && (arg2 & 0x10)) {
actor->velocity.y = 0.0f;
+ }
return 0;
}
@@ -1305,8 +1173,7 @@ s32 func_8002E234(Actor* actor, f32 arg1, s32 arg2)
UNK_TYPE D_8015BBA0;
u32 D_8015BBA4;
-s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3)
-{
+s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3) {
f32 sp34;
u32 sp30;
@@ -1315,25 +1182,22 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3)
actor->unk_80 = func_8003CA0C(globalCtx, &globalCtx->colCtx, &actor->floorPoly, &sp30, actor, arg2);
actor->bgCheckFlags &= ~0x0086;
- if (actor->unk_80 <= -32000.0f)
+ if (actor->unk_80 <= -32000.0f) {
return func_8002E234(actor, -32000.0f, arg3);
+ }
sp34 = actor->unk_80 - actor->posRot.pos.y;
actor->floorPolySource = sp30;
- if (sp34 >= 0.0f)
- {
+ if (sp34 >= 0.0f) {
actor->bgCheckFlags |= 0x80;
- if (actor->bgCheckFlags & 0x10)
- {
- if (sp30 != D_8015BBA4)
- {
- if (sp34 > 15.0f)
+ if (actor->bgCheckFlags & 0x10) {
+ if (sp30 != D_8015BBA4) {
+ if (sp34 > 15.0f) {
actor->bgCheckFlags |= 0x100;
- }
- else
- {
+ }
+ } else {
actor->posRot.pos.x = actor->pos4.x;
actor->posRot.pos.z = actor->pos4.z;
}
@@ -1341,23 +1205,22 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3)
actor->posRot.pos.y = actor->unk_80;
- if (actor->velocity.y <= 0.0f)
- {
- if (!(actor->bgCheckFlags & 0x1))
+ if (actor->velocity.y <= 0.0f) {
+ if (!(actor->bgCheckFlags & 0x1)) {
actor->bgCheckFlags |= 0x2;
- else if ((arg3 & 0x8) && (actor->gravity < 0.0f))
+ } else if ((arg3 & 0x8) && (actor->gravity < 0.0f)) {
actor->velocity.y = -4.0f;
- else
+ } else {
actor->velocity.y = 0.0f;
+ }
actor->bgCheckFlags |= 0x1;
func_80043334(&globalCtx->colCtx, actor, actor->floorPolySource);
}
- }
- else
- {
- if ((actor->bgCheckFlags & 0x1) && (sp34 >= -11.0f))
+ } else {
+ if ((actor->bgCheckFlags & 0x1) && (sp34 >= -11.0f)) {
func_80043334(&globalCtx->colCtx, actor, actor->floorPolySource);
+ }
return func_8002E234(actor, sp34, arg3);
}
@@ -1365,8 +1228,7 @@ s32 func_8002E2AC(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, s32 arg3)
return 1;
}
-void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5)
-{
+void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f32 arg4, s32 arg5) {
f32 sp74;
s32 pad;
Vec3f sp64;
@@ -1379,58 +1241,50 @@ void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f
sp74 = actor->posRot.pos.y - actor->pos4.y;
- if ((actor->floorPolySource != 0x32) && (actor->bgCheckFlags & 1))
+ if ((actor->floorPolySource != 0x32) && (actor->bgCheckFlags & 1)) {
func_800433A4(&globalCtx->colCtx, actor->floorPolySource, actor);
+ }
- if (arg5 & 1)
- {
- if ((!(arg5 & 0x80) && func_8003D52C(&globalCtx->colCtx, &sp64, &actor->posRot.pos,
- &actor->pos4, arg3, &actor->wallPoly, &sp60, actor, arg2)) ||
- ((arg5 & 0x80) && func_8003D594(&globalCtx->colCtx, &sp64, &actor->posRot.pos,
- &actor->pos4, arg3, &actor->wallPoly, &sp60, actor, arg2)))
- {
+ if (arg5 & 1) {
+ if ((!(arg5 & 0x80) && func_8003D52C(&globalCtx->colCtx, &sp64, &actor->posRot.pos, &actor->pos4, arg3,
+ &actor->wallPoly, &sp60, actor, arg2)) ||
+ ((arg5 & 0x80) && func_8003D594(&globalCtx->colCtx, &sp64, &actor->posRot.pos, &actor->pos4, arg3,
+ &actor->wallPoly, &sp60, actor, arg2))) {
sp5C = actor->wallPoly;
Math_Vec3f_Copy(&actor->posRot.pos, &sp64);
actor->unk_7E = atan2s(sp5C->norm.z, sp5C->norm.x);
actor->bgCheckFlags |= 8;
actor->wallPolySource = sp60;
- }
- else
+ } else {
actor->bgCheckFlags &= ~8;
+ }
}
sp64.x = actor->posRot.pos.x;
sp64.z = actor->posRot.pos.z;
- if (arg5 & 2)
- {
+ if (arg5 & 2) {
sp64.y = actor->pos4.y + 10.0f;
- if (func_8003D7A0(&globalCtx->colCtx, &sp58, &sp64, (arg4 + sp74) - 10.0f, &D_8015BBA0, &D_8015BBA4, actor))
- {
+ if (func_8003D7A0(&globalCtx->colCtx, &sp58, &sp64, (arg4 + sp74) - 10.0f, &D_8015BBA0, &D_8015BBA4, actor)) {
actor->bgCheckFlags |= 0x10;
actor->posRot.pos.y = (sp58 + sp74) - 10.0f;
- }
- else
+ } else {
actor->bgCheckFlags &= ~0x10;
+ }
}
- if (arg5 & 4)
- {
+ if (arg5 & 4) {
sp64.y = actor->pos4.y;
func_8002E2AC(globalCtx, actor, &sp64, arg5);
sp50 = actor->posRot.pos.y;
- if (func_8004213C(globalCtx, &globalCtx->colCtx, actor->posRot.pos.x, actor->posRot.pos.z, &sp50, &sp54))
- {
+ if (func_8004213C(globalCtx, &globalCtx->colCtx, actor->posRot.pos.x, actor->posRot.pos.z, &sp50, &sp54)) {
actor->unk_84 = sp50 - actor->posRot.pos.y;
- if (actor->unk_84 < 0.0f)
+ if (actor->unk_84 < 0.0f) {
actor->bgCheckFlags &= ~0x60;
- else
- {
- if (!(actor->bgCheckFlags & 0x20))
- {
+ } else {
+ if (!(actor->bgCheckFlags & 0x20)) {
actor->bgCheckFlags |= 0x40;
- if (!(arg5 & 0x40))
- {
+ if (!(arg5 & 0x40)) {
sp44.x = actor->posRot.pos.x;
sp44.y = sp50;
sp44.z = actor->posRot.pos.z;
@@ -1441,9 +1295,7 @@ void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f
}
actor->bgCheckFlags |= 0x20;
}
- }
- else
- {
+ } else {
actor->bgCheckFlags &= ~0x60;
actor->unk_84 = -32000.0f;
}
@@ -1452,8 +1304,7 @@ void func_8002E4B4(GlobalContext* globalCtx, Actor* actor, f32 arg2, f32 arg3, f
s32 D_8015BBA8[16];
-Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx, Gfx* gfx, Hilite** hilite)
-{
+Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx, Gfx* gfx, Hilite** hilite) {
Gfx* lookAt;
f32 correctedEyeX;
@@ -1463,20 +1314,15 @@ Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext*
*hilite = Graph_Alloc(gfxCtx, sizeof(Hilite));
- if (HREG(80) == 6)
+ if (HREG(80) == 6) {
osSyncPrintf("z_actor.c 3529 eye=[%f(%f) %f %f] object=[%f %f %f] light_direction=[%f %f %f]\n",
- (f64)correctedEyeX, (f64)eye->x, (f64)eye->y, (f64)eye->z,
- (f64)object->x, (f64)object->y, (f64) object->z,
- (f64)lightDir->x, (f64)lightDir->y, (f64)lightDir->z);
+ (f64)correctedEyeX, (f64)eye->x, (f64)eye->y, (f64)eye->z, (f64)object->x, (f64)object->y,
+ (f64)object->z, (f64)lightDir->x, (f64)lightDir->y, (f64)lightDir->z);
+ }
func_800ABE74(correctedEyeX, eye->y, eye->z);
- func_80103A70(&D_8015BBA8, lookAt, *hilite,
- correctedEyeX, eye->y, eye->z,
- object->x, object->y, object->z,
- 0.0f, 1.0f, 0.0f,
- lightDir->x, lightDir->y, lightDir->z,
- lightDir->x, lightDir->y, lightDir->z,
- 0x10, 0x10);
+ func_80103A70(&D_8015BBA8, lookAt, *hilite, correctedEyeX, eye->y, eye->z, object->x, object->y, object->z, 0.0f,
+ 1.0f, 0.0f, lightDir->x, lightDir->y, lightDir->z, lightDir->x, lightDir->y, lightDir->z, 0x10, 0x10);
gSPLookAt(gfx++, lookAt);
gDPSetHilite1Tile(gfx++, 1, *hilite, 0x10, 0x10);
@@ -1484,8 +1330,7 @@ Gfx* func_8002E830(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext*
return gfx;
}
-Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx)
-{
+Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx) {
Hilite* hilite;
Gfx* gfxArr[5];
@@ -1496,8 +1341,7 @@ Hilite* func_8002EABC(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContex
return hilite;
}
-Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx)
-{
+Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContext* gfxCtx) {
Hilite* hilite;
Gfx* gfxArr[5];
@@ -1508,8 +1352,7 @@ Hilite* func_8002EB44(Vec3f* object, Vec3f* eye, Vec3f* lightDir, GraphicsContex
return hilite;
}
-void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag)
-{
+void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag) {
Hilite* hilite;
Vec3f lightDir;
Gfx* displayListHead;
@@ -1521,14 +1364,14 @@ void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag)
lightDir.y = globalCtx->unk_10A4F;
lightDir.z = globalCtx->unk_10A50;
- if (HREG(80) == 6)
- osSyncPrintf("z_actor.c 3637 game_play->view.eye=[%f(%f) %f %f]\n",
- (f64)globalCtx->view.eye.x, (f64)globalCtx->view.eye.y, (f64)globalCtx->view.eye.z);
+ if (HREG(80) == 6) {
+ osSyncPrintf("z_actor.c 3637 game_play->view.eye=[%f(%f) %f %f]\n", (f64)globalCtx->view.eye.x,
+ (f64)globalCtx->view.eye.y, (f64)globalCtx->view.eye.z);
+ }
hilite = func_8002EABC(&actor->posRot.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
- if (flag != 0)
- {
+ if (flag != 0) {
displayList = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Gfx));
displayListHead = displayList;
@@ -1543,8 +1386,7 @@ void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag)
}
}
-void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag)
-{
+void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) {
Hilite* hilite;
Vec3f lightDir;
Gfx* displayListHead;
@@ -1558,8 +1400,7 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag)
hilite = func_8002EB44(&actor->posRot.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
- if (flag != 0)
- {
+ if (flag != 0) {
displayList = Graph_Alloc(globalCtx->state.gfxCtx, 2 * sizeof(Gfx));
displayListHead = displayList;
@@ -1574,22 +1415,19 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag)
}
}
-PosRot* func_8002EEE4(PosRot* arg0, Actor* actor)
-{
+PosRot* func_8002EEE4(PosRot* arg0, Actor* actor) {
*arg0 = actor->posRot2;
return arg0;
}
-PosRot* func_8002EF14(PosRot* arg0, Actor* actor)
-{
+PosRot* func_8002EF14(PosRot* arg0, Actor* actor) {
*arg0 = actor->posRot;
return arg0;
}
-PosRot* func_8002EF44(PosRot* arg0, Actor* actor)
-{
+PosRot* func_8002EF44(PosRot* arg0, Actor* actor) {
PosRot sp1C;
Math_Vec3f_Copy(&sp1C.pos, &actor->posRot.pos);
@@ -1601,16 +1439,14 @@ PosRot* func_8002EF44(PosRot* arg0, Actor* actor)
#ifdef NON_MATCHING
// single regalloc difference
-f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2)
-{
+f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) {
s16 var;
s16 abs_var;
var = (s16)(actor->rotTowardsLinkY - 0x8000) - arg2;
abs_var = ABS(var);
- if (player->unk_664 != NULL)
- {
+ if (player->unk_664 != NULL) {
if ((abs_var > 0x4000) || (actor->flags & 0x8000000))
return FLT_MAX;
else
@@ -1627,48 +1463,38 @@ extern f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_8002EFC0.s")
#endif
-typedef struct
-{
+typedef struct {
f32 unk_0, unk_4;
} struct_80115FF8; // size = 0x8
-struct_80115FF8 D_80115FF8[] =
-{
- { 4900.0f, 0.5f },
- { 28900.0f, 0.6666667f },
- { 78400.0f, 0.05f },
- { 122500.0f, 0.6666667f },
- { 490000.0f, 0.6666667f },
- { 1000000.0f, 0.6666667f },
- { 10000.0f, 0.94905096f },
- { 19600.0f, 0.85714287f },
- { 57600.0f, 0.41666666f },
- { 78400.0f, 0.001f },
+struct_80115FF8 D_80115FF8[] = {
+ { 4900.0f, 0.5f }, { 28900.0f, 0.6666667f }, { 78400.0f, 0.05f }, { 122500.0f, 0.6666667f },
+ { 490000.0f, 0.6666667f }, { 1000000.0f, 0.6666667f }, { 10000.0f, 0.94905096f }, { 19600.0f, 0.85714287f },
+ { 57600.0f, 0.41666666f }, { 78400.0f, 0.001f },
};
-u32 func_8002F090(Actor* actor, f32 arg1)
-{
+u32 func_8002F090(Actor* actor, f32 arg1) {
return arg1 < D_80115FF8[actor->unk_1F].unk_0;
}
-s32 func_8002F0C8(Actor* actor, Player* player, s32 flag)
-{
+s32 func_8002F0C8(Actor* actor, Player* player, s32 flag) {
s16 var;
s16 abs_var;
f32 dist;
- if ((actor->update == NULL) || !(actor->flags & 1))
+ if ((actor->update == NULL) || !(actor->flags & 1)) {
return 1;
+ }
- if (!flag)
- {
+ if (!flag) {
var = (s16)(actor->rotTowardsLinkY - 0x8000) - player->actor.shape.rot.y;
abs_var = ABS(var);
- if ((player->unk_664 == NULL) && (abs_var > 0x2AAA))
+ if ((player->unk_664 == NULL) && (abs_var > 0x2AAA)) {
dist = FLT_MAX;
- else
+ } else {
dist = actor->waterSurfaceDist;
+ }
return !func_8002F090(actor, D_80115FF8[actor->unk_1F].unk_4 * dist);
}
@@ -1676,10 +1502,8 @@ s32 func_8002F0C8(Actor* actor, Player* player, s32 flag)
return 0;
}
-u32 func_8002F194(Actor* actor, GlobalContext* globalCtx)
-{
- if (actor->flags & 0x100)
- {
+u32 func_8002F194(Actor* actor, GlobalContext* globalCtx) {
+ if (actor->flags & 0x100) {
actor->flags &= ~0x100;
return 1;
}
@@ -1687,18 +1511,16 @@ u32 func_8002F194(Actor* actor, GlobalContext* globalCtx)
return 0;
}
-s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u32 arg4)
-{
+s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u32 arg4) {
Player* player = PLAYER;
// This is convoluted but it seems like it must be a single if statement to match
- if ((player->actor.flags & 0x100) ||
- ((arg4 != 0) && func_8008E988(globalCtx)) ||
+ if ((player->actor.flags & 0x100) || ((arg4 != 0) && func_8008E988(globalCtx)) ||
((actor->unk_10C == 0) &&
- ((arg3 < fabsf(actor->yDistanceFromLink)) ||
- (player->unk_698 < actor->xzDistanceFromLink) ||
- (arg2 < actor->xzDistanceFromLink))))
+ ((arg3 < fabsf(actor->yDistanceFromLink)) || (player->unk_698 < actor->xzDistanceFromLink) ||
+ (arg2 < actor->xzDistanceFromLink)))) {
return 0;
+ }
player->unk_694 = actor;
player->unk_698 = actor->xzDistanceFromLink;
@@ -1707,38 +1529,33 @@ s32 func_8002F1C4(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, u3
return 1;
}
-s32 func_8002F298(Actor* actor, GlobalContext* globalCtx, f32 arg2, u32 arg3)
-{
+s32 func_8002F298(Actor* actor, GlobalContext* globalCtx, f32 arg2, u32 arg3) {
return func_8002F1C4(actor, globalCtx, arg2, arg2, arg3);
}
-s32 func_8002F2CC(Actor* actor, GlobalContext* globalCtx, f32 arg2)
-{
+s32 func_8002F2CC(Actor* actor, GlobalContext* globalCtx, f32 arg2) {
return func_8002F298(actor, globalCtx, arg2, 0);
}
-s32 func_8002F2F4(Actor* actor, GlobalContext* globalCtx)
-{
+s32 func_8002F2F4(Actor* actor, GlobalContext* globalCtx) {
f32 var1 = 50.0f + actor->sub_98.unk_10;
return func_8002F2CC(actor, globalCtx, var1);
}
-u32 func_8002F334(Actor* actor, GlobalContext* globalCtx)
-{
- if (func_8010BDBC(&globalCtx->msgCtx) == 2)
+u32 func_8002F334(Actor* actor, GlobalContext* globalCtx) {
+ if (func_8010BDBC(&globalCtx->msgCtx) == 2) {
return 1;
- else
+ } else {
return 0;
+ }
}
-s8 func_8002F368(GlobalContext* globalCtx)
-{
+s8 func_8002F368(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->exchangeItemId;
}
-void func_8002F374(GlobalContext* globalCtx, Actor* actor, s16* arg2, s16* arg3)
-{
+void func_8002F374(GlobalContext* globalCtx, Actor* actor, s16* arg2, s16* arg3) {
Vec3f sp1C;
f32 sp18;
@@ -1747,31 +1564,26 @@ void func_8002F374(GlobalContext* globalCtx, Actor* actor, s16* arg2, s16* arg3)
*arg3 = sp1C.y * sp18 * -120.0f + 120.0f;
}
-u32 func_8002F410(Actor* actor, GlobalContext* globalCtx)
-{
- if (actor->attachedA != NULL)
+u32 func_8002F410(Actor* actor, GlobalContext* globalCtx) {
+ if (actor->attachedA != NULL) {
return 1;
- else
+ } else {
return 0;
+ }
}
-s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange)
-{
+s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzRange, f32 yRange) {
Player* player = PLAYER;
s16 var;
s32 abs_var;
- if (!(player->stateFlags1 & 0x3C7080) && func_8008F29C(player) < 0)
- {
+ if (!(player->stateFlags1 & 0x3C7080) && func_8008F29C(player) < 0) {
if ((((player->heldActor != NULL) || (actor == player->unk_694)) && (getItemId > 0) && (getItemId < 0x7E)) ||
- (!(player->stateFlags1 & 0x20000800)))
- {
- if ((actor->xzDistanceFromLink < xzRange) && (fabsf(actor->yDistanceFromLink) < yRange))
- {
+ (!(player->stateFlags1 & 0x20000800))) {
+ if ((actor->xzDistanceFromLink < xzRange) && (fabsf(actor->yDistanceFromLink) < yRange)) {
var = actor->rotTowardsLinkY - player->actor.shape.rot.y;
abs_var = ABS(var);
- if ((getItemId != 0) || (player->getItemDirection < abs_var))
- {
+ if ((getItemId != 0) || (player->getItemDirection < abs_var)) {
player->getItemId = getItemId;
player->interactRangeActor = actor;
player->getItemDirection = abs_var;
@@ -1784,30 +1596,26 @@ s32 func_8002F434(Actor* actor, GlobalContext* globalCtx, s32 getItemId, f32 xzR
return 0;
}
-void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId)
-{
+void func_8002F554(Actor* actor, GlobalContext* globalCtx, s32 getItemId) {
func_8002F434(actor, globalCtx, getItemId, 50.0f, 10.0f);
}
-void func_8002F580(Actor* actor, GlobalContext* globalCtx)
-{
+void func_8002F580(Actor* actor, GlobalContext* globalCtx) {
func_8002F554(actor, globalCtx, 0);
}
-u32 func_8002F5A0(Actor* actor, GlobalContext* globalCtx)
-{
- if (actor->attachedA == NULL)
+u32 func_8002F5A0(Actor* actor, GlobalContext* globalCtx) {
+ if (actor->attachedA == NULL) {
return 1;
- else
+ } else {
return 0;
+ }
}
-void func_8002F5C4(Actor* actorA, Actor* actorB, GlobalContext* globalCtx)
-{
+void func_8002F5C4(Actor* actorA, Actor* actorB, GlobalContext* globalCtx) {
Actor* actorAttachedA = actorA->attachedA;
- if (actorAttachedA->id == ACTOR_PLAYER)
- {
+ if (actorAttachedA->id == ACTOR_PLAYER) {
Player* player = (Player*)actorAttachedA;
player->heldActor = actorB;
player->interactRangeActor = actorB;
@@ -1818,28 +1626,26 @@ void func_8002F5C4(Actor* actorA, Actor* actorB, GlobalContext* globalCtx)
actorA->attachedA = NULL;
}
-void func_8002F5F0(Actor* actor, GlobalContext* globalCtx)
-{
+void func_8002F5F0(Actor* actor, GlobalContext* globalCtx) {
Player* player = PLAYER;
- if (actor->waterSurfaceDist < player->unk_6A4)
+ if (actor->waterSurfaceDist < player->unk_6A4) {
player->unk_6A4 = actor->waterSurfaceDist;
+ }
}
-u32 func_8002F618(GlobalContext* globalCtx, Actor* actor)
-{
- if (actor->attachedB != NULL)
+u32 func_8002F618(GlobalContext* globalCtx, Actor* actor) {
+ if (actor->attachedB != NULL) {
return 1;
- else
+ } else {
return 0;
+ }
}
-u32 func_8002F63C(GlobalContext* globalCtx, Actor* actor, s32 arg2)
-{
+u32 func_8002F63C(GlobalContext* globalCtx, Actor* actor, s32 arg2) {
Player* player = PLAYER;
- if (!(player->stateFlags1 & 0x003C7880))
- {
+ if (!(player->stateFlags1 & 0x003C7880)) {
player->rideActor = actor;
player->unk_43C = arg2;
return 1;
@@ -1848,16 +1654,15 @@ u32 func_8002F63C(GlobalContext* globalCtx, Actor* actor, s32 arg2)
return 0;
}
-u32 func_8002F674(GlobalContext* globalCtx, Actor* actor)
-{
- if (actor->attachedB == NULL)
+u32 func_8002F674(GlobalContext* globalCtx, Actor* actor) {
+ if (actor->attachedB == NULL) {
return 1;
- else
+ } else {
return 0;
+ }
}
-void func_8002F698(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6)
-{
+void func_8002F698(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6) {
Player* player = PLAYER;
player->unk_8A0 = arg6;
player->unk_8A1 = arg5;
@@ -1866,97 +1671,84 @@ void func_8002F698(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 a
player->unk_8A8 = arg4;
}
-void func_8002F6D4(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5)
-{
+void func_8002F6D4(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5) {
func_8002F698(globalCtx, arg1, arg2, arg3, arg4, 2, arg5);
}
-void func_8002F71C(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4)
-{
+void func_8002F71C(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4) {
func_8002F6D4(globalCtx, arg1, arg2, arg3, arg4, 0);
}
-void func_8002F758(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5)
-{
+void func_8002F758(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4, u32 arg5) {
func_8002F698(globalCtx, arg1, arg2, arg3, arg4, 1, arg5);
}
-void func_8002F7A0(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4)
-{
+void func_8002F7A0(GlobalContext* globalCtx, u32 arg1, f32 arg2, s16 arg3, f32 arg4) {
func_8002F758(globalCtx, arg1, arg2, arg3, arg4, 0);
}
-void func_8002F7DC(Actor* actor, u16 sfxId)
-{
+void func_8002F7DC(Actor* actor, u16 sfxId) {
Audio_PlaySoundGeneral(sfxId, &actor->unk_E4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
-void Audio_PlayActorSound2(Actor* actor, u16 sfxId)
-{
+void Audio_PlayActorSound2(Actor* actor, u16 sfxId) {
func_80078914(&actor->unk_E4, sfxId);
}
-void func_8002F850(GlobalContext* globalCtx, Actor* actor)
-{
+void func_8002F850(GlobalContext* globalCtx, Actor* actor) {
s32 sfxId;
- if (actor->bgCheckFlags & 0x20)
- {
- if (actor->unk_84 < 20.0f)
+ if (actor->bgCheckFlags & 0x20) {
+ if (actor->unk_84 < 20.0f) {
sfxId = NA_SE_PL_WALK_WATER0;
- else
+ } else {
sfxId = NA_SE_PL_WALK_WATER1;
- }
- else
+ }
+ } else {
sfxId = func_80041F34(&globalCtx->colCtx, actor->floorPoly, actor->floorPolySource, actor);
+ }
func_80078914(&actor->unk_E4, NA_SE_EV_BOMB_BOUND);
func_80078914(&actor->unk_E4, sfxId + 0x800);
}
-void func_8002F8F0(Actor* actor, u16 sfxId)
-{
+void func_8002F8F0(Actor* actor, u16 sfxId) {
actor->soundEffect = sfxId;
actor->flags |= 0x80000;
actor->flags &= ~0x10300000;
}
-void func_8002F91C(Actor* actor, u16 sfxId)
-{
+void func_8002F91C(Actor* actor, u16 sfxId) {
actor->soundEffect = sfxId;
actor->flags |= 0x100000;
actor->flags &= ~0x10280000;
}
-void func_8002F948(Actor* actor, u16 sfxId)
-{
+void func_8002F948(Actor* actor, u16 sfxId) {
actor->soundEffect = sfxId;
actor->flags |= 0x200000;
actor->flags &= ~0x10180000;
}
-void func_8002F974(Actor* actor, u16 sfxId)
-{
+void func_8002F974(Actor* actor, u16 sfxId) {
actor->flags &= ~0x10380000;
actor->soundEffect = sfxId;
}
-void func_8002F994(Actor* actor, s32 sfxId)
-{
+void func_8002F994(Actor* actor, s32 sfxId) {
actor->flags |= 0x10000000;
actor->flags &= ~0x00380000;
- if (sfxId < NA_SE_PL_LAND_GRASS)
+ if (sfxId < NA_SE_PL_LAND_GRASS) {
actor->soundEffect = NA_SE_PL_WALK_DIRT;
- else if (sfxId < NA_SE_PL_DIVE_BUBBLE)
+ } else if (sfxId < NA_SE_PL_DIVE_BUBBLE) {
actor->soundEffect = NA_SE_PL_WALK_CONCRETE;
- else
+ } else {
actor->soundEffect = NA_SE_PL_WALK_SAND;
+ }
}
-s32 func_8002F9EC(GlobalContext* globalCtx, Actor* actor, UNK_TYPE arg2, UNK_TYPE arg3, UNK_TYPE arg4)
-{
- if (func_80041D4C(&globalCtx->colCtx, arg2, arg3) == 8)
- {
+s32 func_8002F9EC(GlobalContext* globalCtx, Actor* actor, UNK_TYPE arg2, UNK_TYPE arg3, UNK_TYPE arg4) {
+ if (func_80041D4C(&globalCtx->colCtx, arg2, arg3) == 8) {
globalCtx->unk_11D30[0] = 1;
func_8005DFAC(globalCtx, 0, arg4);
Audio_PlayActorSound2(actor, NA_SE_IT_WALL_HIT_BUYO);
@@ -1972,12 +1764,10 @@ z_Light* D_8015BC10;
s32 D_8015BC14;
f32 D_8015BC18;
-void func_8002FA60(GlobalContext* globalCtx)
-{
+void func_8002FA60(GlobalContext* globalCtx) {
Vec3f lightPos;
- if (gSaveContext.fw.set)
- {
+ if (gSaveContext.fw.set) {
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0x28;
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = gSaveContext.fw.pos_x;
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = gSaveContext.fw.pos_y;
@@ -1988,9 +1778,7 @@ void func_8002FA60(GlobalContext* globalCtx)
gSaveContext.respawn[RESPAWN_MODE_TOP].room_index = gSaveContext.fw.room_index;
gSaveContext.respawn[RESPAWN_MODE_TOP].temp_swch_flags = gSaveContext.fw.temp_swch_flags;
gSaveContext.respawn[RESPAWN_MODE_TOP].temp_collect_flags = gSaveContext.fw.temp_collect_flags;
- }
- else
- {
+ } else {
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0;
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = 0.0f;
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = 0.0f;
@@ -2015,8 +1803,7 @@ Color_RGB8 D_80116064 = { 0x64, 0xC8, 0x00 };
#ifdef NON_MATCHING
// this function still needs a lot of work
-void func_8002FBAC(GlobalContext* globalCtx)
-{
+void func_8002FBAC(GlobalContext* globalCtx) {
GraphicsContext* gfxCtx;
Gfx* gfxArr[6];
Vec3f lightPos;
@@ -2042,8 +1829,7 @@ void func_8002FBAC(GlobalContext* globalCtx)
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 5308);
- if (gSaveContext.respawn[RESPAWN_MODE_TOP].data != 0)
- {
+ if (gSaveContext.respawn[RESPAWN_MODE_TOP].data != 0) {
if (LINK_IS_ADULT)
spD8 = 80.0f;
else
@@ -2054,39 +1840,34 @@ void func_8002FBAC(GlobalContext* globalCtx)
temp_a3 = gSaveContext.respawn[RESPAWN_MODE_TOP].data - 0x28;
- if (temp_a3 < 0)
- {
+ if (temp_a3 < 0) {
gSaveContext.respawn[RESPAWN_MODE_TOP].data++;
spD4 = ABS(gSaveContext.respawn[RESPAWN_MODE_TOP].data) * 0.025f;
D_8015BC14 = 60;
D_8015BC18 = 1.0f;
- }
- else if (D_8015BC14 != 0)
- {
+ } else if (D_8015BC14 != 0) {
D_8015BC14--;
- }
- else if (D_8015BC18 > 0.0f)
- {
+ } else if (D_8015BC18 > 0.0f) {
spC0 = D_8015BC18;
temp_ret = Math_Vec3f_DistXYZAndStoreDiff(&gSaveContext.respawn[RESPAWN_MODE_DOWN].pos,
- &gSaveContext.respawn[RESPAWN_MODE_TOP].pos,
- &spB4);
+ &gSaveContext.respawn[RESPAWN_MODE_TOP].pos, &spB4);
- if (temp_ret < 20.0f)
- {
+ if (temp_ret < 20.0f) {
D_8015BC18 = 0.0f;
- Math_Vec3f_Copy(&gSaveContext.respawn[RESPAWN_MODE_TOP].pos, &gSaveContext.respawn[RESPAWN_MODE_DOWN].pos);
- }
- else
- {
+ Math_Vec3f_Copy(&gSaveContext.respawn[RESPAWN_MODE_TOP].pos,
+ &gSaveContext.respawn[RESPAWN_MODE_DOWN].pos);
+ } else {
sp9C = (1.0f / D_8015BC18) * temp_ret;
phi_f14 = 20.0f / sp9C;
phi_f14 = (phi_f14 < 0.05f) ? 0.05f : phi_f14;
Math_ApproxF(&D_8015BC18, 0.0f, phi_f14);
temp_f2 = ((D_8015BC18 / spC0) * temp_ret) / temp_ret;
- gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.x + (spB4.x * temp_f2);
- gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.y + (spB4.y * temp_f2);
- gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z = gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.z + (spB4.z * temp_f2);
+ gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x =
+ gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.x + (spB4.x * temp_f2);
+ gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y =
+ gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.y + (spB4.y * temp_f2);
+ gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z =
+ gSaveContext.respawn[RESPAWN_MODE_DOWN].pos.z + (spB4.z * temp_f2);
temp_f12 = sp9C * 0.5f;
temp_f14 = temp_ret - temp_f12;
spD8 += sqrtf((temp_f12 * temp_f12) - (temp_f14 * temp_f14)) * 0.2f;
@@ -2099,21 +1880,17 @@ void func_8002FBAC(GlobalContext* globalCtx)
func_80028BB0(globalCtx, &spA4, &D_80116048, &D_80116054, &D_80116060, &D_80116064, 1000, 0x10);
- if (D_8015BC18 == 0.0f)
- {
+ if (D_8015BC18 == 0.0f) {
gSaveContext.respawn[RESPAWN_MODE_TOP] = gSaveContext.respawn[RESPAWN_MODE_DOWN];
gSaveContext.respawn[RESPAWN_MODE_TOP].player_params = 0x06FF;
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0x28;
}
gSaveContext.respawn[RESPAWN_MODE_TOP].pos = gSaveContext.respawn[RESPAWN_MODE_TOP].pos;
- }
- else if (temp_a3 > 0)
- {
+ } else if (temp_a3 > 0) {
temp_f12 = temp_a3 * 0.1f;
- if (temp_f12 < 1.0f)
- {
+ if (temp_f12 < 1.0f) {
sp7C.x = globalCtx->view.eye.x;
sp7C.y = globalCtx->view.eye.y - spD8;
sp7C.z = globalCtx->view.eye.z;
@@ -2129,14 +1906,11 @@ void func_8002FBAC(GlobalContext* globalCtx)
spD0 = 0xFF - (((temp_a3 * 0x10) - temp_a3) * 2);
- if (spD0 < 0)
- {
+ if (spD0 < 0) {
gSaveContext.fw.set = 0;
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0;
spD0 = 0;
- }
- else
- {
+ } else {
gSaveContext.respawn[RESPAWN_MODE_TOP].data++;
}
@@ -2145,33 +1919,33 @@ void func_8002FBAC(GlobalContext* globalCtx)
if ((globalCtx->csCtx.state == 0) &&
(gSaveContext.respawn[RESPAWN_MODE_TOP].entrance_index == gSaveContext.entrance_index) &&
- (globalCtx->roomCtx.curRoom.num == gSaveContext.respawn[RESPAWN_MODE_TOP].room_index))
- {
+ (globalCtx->roomCtx.curRoom.num == gSaveContext.respawn[RESPAWN_MODE_TOP].room_index)) {
gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 0x19);
Matrix_Translate(gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x,
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y + spD8,
- gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z,
- MTXMODE_NEW);
+ gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z, MTXMODE_NEW);
Matrix_Scale(0.025f * spD4, 0.025f * spD4, 0.025f * spD4, MTXMODE_APPLY);
Matrix_Mult(&globalCtx->mf_11D60, MTXMODE_APPLY);
Matrix_Push();
gDPPipeSync(gfxCtx->polyXlu.p++);
- gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0xFF, 0xFF, 0xC8, spD0);
+ gDPSetPrimColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0xFF, 0xFF, 0xC8, spD0);
gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x64, 0xC8, 0x00, 0xFF);
phi_f10 = (globalCtx->gameplayFrames * 1500) & 0xFFFF;
Matrix_RotateZ((phi_f10 * M_PI) / 32768.0f, MTXMODE_APPLY);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 5458), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 5458),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_04010130);
Matrix_Pull();
phi_f6 = ~((globalCtx->gameplayFrames * 1200) & 0xFFFF);
Matrix_RotateZ((phi_f6 * M_PI) / 32768.0f, MTXMODE_APPLY);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 5463), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 5463),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_04010130);
}
@@ -2179,7 +1953,8 @@ void func_8002FBAC(GlobalContext* globalCtx)
lightPos.y = gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y + spD8;
lightPos.z = gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z;
- Lights_InitType0PositionalLight(&D_8015BC00, lightPos.x, lightPos.y, lightPos.z, 0xFF, 0xFF, 0xFF, 500.0f * spD4);
+ Lights_InitType0PositionalLight(&D_8015BC00, lightPos.x, lightPos.y, lightPos.z, 0xFF, 0xFF, 0xFF,
+ 500.0f * spD4);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 5474);
}
@@ -2188,22 +1963,18 @@ void func_8002FBAC(GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_8002FBAC.s")
#endif
-void func_80030488(GlobalContext* globalCtx)
-{
+void func_80030488(GlobalContext* globalCtx) {
Lights_Remove(globalCtx, &globalCtx->lightCtx, D_8015BC10);
}
-void func_800304B0(GlobalContext* globalCtx)
-{
- if (globalCtx->actorCtx.unk_03 != 0)
- {
+void func_800304B0(GlobalContext* globalCtx) {
+ if (globalCtx->actorCtx.unk_03 != 0) {
globalCtx->actorCtx.unk_03 = 0;
func_800876C8(globalCtx);
}
}
-void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorEntry)
-{
+void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorEntry) {
ActorOverlay* overlayEntry;
SaveSceneFlags* saveSceneFlags;
s32 i;
@@ -2217,8 +1988,7 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry*
Matrix_MtxFCopy(&globalCtx->mf_11D60, &gMtxFClear);
overlayEntry = &gActorOverlayTable[0];
- for (i = 0; i < ARRAY_COUNT(gActorOverlayTable); i++)
- {
+ for (i = 0; i < ARRAY_COUNT(gActorOverlayTable); i++) {
overlayEntry->loadedRamAddr = NULL;
overlayEntry->nbLoaded = 0;
overlayEntry++;
@@ -2238,24 +2008,12 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry*
func_8002FA60(globalCtx);
}
-u32 D_80116068[] =
-{
- 0x100000C0,
- 0x100000C0,
- 0x00000000,
- 0x100004C0,
- 0x00000080,
- 0x300000C0,
- 0x10000080,
- 0x00000000,
- 0x300000C0,
- 0x100004C0,
- 0x00000000,
- 0x100000C0,
+u32 D_80116068[] = {
+ 0x100000C0, 0x100000C0, 0x00000000, 0x100004C0, 0x00000080, 0x300000C0,
+ 0x10000080, 0x00000000, 0x300000C0, 0x100004C0, 0x00000000, 0x100000C0,
};
-void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx)
-{
+void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) {
Actor* refActor;
Actor* actor;
Player* player;
@@ -2268,91 +2026,79 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx)
player = PLAYER;
- if (0)
- {
+ if (0) {
// This assert is optimized out but it exists due to its presence in rodata
- if (gMaxProfile != ACTOR_DLF_MAX)
+ if (gMaxProfile != ACTOR_DLF_MAX) {
__assert("MaxProfile == ACTOR_DLF_MAX", "../z_actor.c", UNK_LINE);
+ }
}
sp74 = NULL;
unkFlag = 0;
- if (globalCtx->nbSetupActors != 0)
- {
+ if (globalCtx->nbSetupActors != 0) {
actorEntry = &globalCtx->setupActorList[0];
- for (i = 0; i < globalCtx->nbSetupActors; i++)
+ for (i = 0; i < globalCtx->nbSetupActors; i++) {
Actor_SpawnEntry(&globalCtx->actorCtx, actorEntry++, globalCtx);
+ }
globalCtx->nbSetupActors = 0;
}
- if (actorCtx->unk_02 != 0)
+ if (actorCtx->unk_02 != 0) {
actorCtx->unk_02--;
+ }
- if (KREG(0) == -100)
- {
+ if (KREG(0) == -100) {
refActor = &PLAYER->actor;
KREG(0) = 0;
- Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG,
- refActor->posRot.pos.x, refActor->posRot.pos.y + 100.0f, refActor->posRot.pos.z,
- 0, 0, 0, 1);
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, refActor->posRot.pos.x,
+ refActor->posRot.pos.y + 100.0f, refActor->posRot.pos.z, 0, 0, 0, 1);
}
sp80 = &D_80116068[0];
- if (player->stateFlags2 & 0x8000000)
+ if (player->stateFlags2 & 0x8000000) {
unkFlag = 0x2000000;
+ }
- if ((player->stateFlags1 & 0x40) && ((player->actor.textId & 0xFF00) != 0x600))
+ if ((player->stateFlags1 & 0x40) && ((player->actor.textId & 0xFF00) != 0x600)) {
sp74 = player->unk_694;
+ }
- for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, sp80++)
- {
+ for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, sp80++) {
unkCondition = (*sp80 & player->stateFlags1);
actor = actorCtx->actorList[i].first;
- while (actor != NULL)
- {
- if (actor->posRot.pos.y < -25000.0f)
+ while (actor != NULL) {
+ if (actor->posRot.pos.y < -25000.0f) {
actor->posRot.pos.y = -25000.0f;
+ }
actor->soundEffect = 0;
- if (actor->init != NULL)
- {
- if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex))
- {
+ if (actor->init != NULL) {
+ if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) {
Actor_SetObjectDependency(globalCtx, actor);
actor->init(actor, globalCtx);
actor->init = NULL;
}
actor = actor->next;
- }
- else if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex))
- {
+ } else if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) {
Actor_Kill(actor);
actor = actor->next;
- }
- else if ((unkFlag && !(actor->flags & unkFlag)) ||
- (!unkFlag && unkCondition &&
- (sp74 != actor) && (actor != player->unk_68C) &&
- (actor != player->heldActor) && (&player->actor != actor->attachedA)))
- {
+ } else if ((unkFlag && !(actor->flags & unkFlag)) ||
+ (!unkFlag && unkCondition && (sp74 != actor) && (actor != player->unk_68C) &&
+ (actor != player->heldActor) && (&player->actor != actor->attachedA))) {
func_80061E8C(&actor->sub_98);
actor = actor->next;
- }
- else if (actor->update == NULL)
- {
- if (!actor->activelyDrawn)
+ } else if (actor->update == NULL) {
+ if (!actor->activelyDrawn) {
actor = Actor_Delete(&globalCtx->actorCtx, actor, globalCtx);
- else
- {
+ } else {
Actor_Destroy(actor, globalCtx);
actor = actor->next;
}
- }
- else
- {
+ } else {
Math_Vec3f_Copy(&actor->pos4, &actor->posRot.pos);
actor->xzDistanceFromLink = func_8002DB8C(actor, &player->actor);
actor->yDistanceFromLink = Actor_HeightDiff(actor, &player->actor);
@@ -2361,19 +2107,21 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx)
actor->rotTowardsLinkY = func_8002DA78(actor, &player->actor);
actor->flags &= ~0x1000000;
- if ((DECR(actor->freeze) == 0) && (actor->flags & 0x50))
- {
- if (actor == player->unk_664)
+ if ((DECR(actor->freeze) == 0) && (actor->flags & 0x50)) {
+ if (actor == player->unk_664) {
actor->unk_10C = 1;
- else
+ } else {
actor->unk_10C = 0;
+ }
- if ((actor->unk_10D != 0) && (player->unk_664 == NULL))
+ if ((actor->unk_10D != 0) && (player->unk_664 == NULL)) {
actor->unk_10D = 0;
+ }
Actor_SetObjectDependency(globalCtx, actor);
- if (actor->unk_114 != 0)
+ if (actor->unk_114 != 0) {
actor->unk_114--;
+ }
actor->update(actor, globalCtx);
func_8003F8EC(globalCtx, &globalCtx->colCtx.dyna, actor);
}
@@ -2384,23 +2132,21 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx)
}
}
- if (i == ACTORTYPE_BG)
+ if (i == ACTORTYPE_BG) {
func_8003F984(globalCtx, &globalCtx->colCtx.dyna);
+ }
}
actor = player->unk_664;
- if ((actor != NULL) && (actor->update == NULL))
- {
+ if ((actor != NULL) && (actor->update == NULL)) {
actor = NULL;
func_8008EDF0(player);
}
- if ((actor == NULL) || (player->unk_66C < 5))
- {
+ if ((actor == NULL) || (player->unk_66C < 5)) {
actor = NULL;
- if (actorCtx->targetCtx.unk_4B != 0)
- {
+ if (actorCtx->targetCtx.unk_4B != 0) {
actorCtx->targetCtx.unk_4B = 0;
func_80078884(NA_SE_SY_LOCK_OFF);
}
@@ -2411,13 +2157,11 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx)
func_8003FB64(globalCtx, &globalCtx->colCtx.dyna);
}
-void Actor_FaultPrint(Actor* actor, char* command)
-{
+void Actor_FaultPrint(Actor* actor, char* command) {
ActorOverlay* overlayEntry;
char* name;
- if ((actor == NULL) || (actor->overlayEntry == NULL))
- {
+ if ((actor == NULL) || (actor->overlayEntry == NULL)) {
FaultDrawer_SetCursor(48, 24);
FaultDrawer_Printf("ACTOR NAME is NULL");
}
@@ -2428,16 +2172,16 @@ void Actor_FaultPrint(Actor* actor, char* command)
// Translates to: "ACTOR NAME(%08x:%s)"
osSyncPrintf("アクターの名前(%08x:%s)\n", actor, name);
- if (command != NULL)
+ if (command != NULL) {
// Translates to: "COMMAND:%s"
osSyncPrintf("コメント:%s\n", command);
+ }
FaultDrawer_SetCursor(48, 24);
FaultDrawer_Printf("ACTOR NAME %08x:%s", actor, name);
}
-void Actor_Draw(GlobalContext* globalCtx, Actor* actor)
-{
+void Actor_Draw(GlobalContext* globalCtx, Actor* actor) {
FaultClient faultClient;
LightMapper* lightMapper;
GraphicsContext* gfxCtx;
@@ -2455,20 +2199,14 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor)
func_8007A474(lightMapper, globalCtx->lightCtx.lightsHead, (actor->flags & 0x400000) ? NULL : &actor->posRot.pos);
func_80079EFC(lightMapper, globalCtx->state.gfxCtx);
- if (actor->flags & 0x1000)
- {
+ if (actor->flags & 0x1000) {
camera = &globalCtx->cameraCtx.activeCameras[0];
func_800D1694(actor->posRot.pos.x + camera->unk_80.x,
- actor->posRot.pos.y + (f32)((actor->shape.unk_08 * actor->scale.y) + camera->unk_80.y),
- actor->posRot.pos.z + camera->unk_80.z,
- &actor->shape.rot);
- }
- else
- {
- func_800D1694(actor->posRot.pos.x,
- actor->posRot.pos.y + (actor->shape.unk_08 * actor->scale.y),
- actor->posRot.pos.z,
- &actor->shape.rot);
+ actor->posRot.pos.y + (f32)((actor->shape.unk_08 * actor->scale.y) + camera->unk_80.y),
+ actor->posRot.pos.z + camera->unk_80.z, &actor->shape.rot);
+ } else {
+ func_800D1694(actor->posRot.pos.x, actor->posRot.pos.y + (actor->shape.unk_08 * actor->scale.y),
+ actor->posRot.pos.z, &actor->shape.rot);
}
Matrix_Scale(actor->scale.x, actor->scale.y, actor->scale.z, MTXMODE_APPLY);
@@ -2477,70 +2215,64 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor)
gSPSegment(gfxCtx->polyOpa.p++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment);
gSPSegment(gfxCtx->polyXlu.p++, 0x06, globalCtx->objectCtx.status[actor->objBankIndex].segment);
- if (actor->unk_114 != 0)
- {
+ if (actor->unk_114 != 0) {
// Must be inline data to match
Color_RGBA8 sp2C = { 0x00, 0x00, 0x00, 0xFF };
- if (actor->unk_112 & 0x8000)
+ if (actor->unk_112 & 0x8000) {
sp2C.r = sp2C.g = sp2C.b = ((actor->unk_112 & 0x1F00) >> 5) | 7;
- else if (actor->unk_112 & 0x4000)
+ } else if (actor->unk_112 & 0x4000) {
sp2C.r = ((actor->unk_112 & 0x1F00) >> 5) | 7;
- else
+ } else {
sp2C.b = ((actor->unk_112 & 0x1F00) >> 5) | 7;
+ }
- if (actor->unk_112 & 0x2000)
+ if (actor->unk_112 & 0x2000) {
func_80026860(globalCtx, &sp2C, actor->unk_114, actor->unk_112 & 0xFF);
- else
+ } else {
func_80026400(globalCtx, &sp2C, actor->unk_114, actor->unk_112 & 0xFF);
+ }
}
actor->draw(actor, globalCtx);
- if (actor->unk_114 != 0)
- {
- if (actor->unk_112 & 0x2000)
+ if (actor->unk_114 != 0) {
+ if (actor->unk_112 & 0x2000) {
func_80026A6C(globalCtx);
- else
+ } else {
func_80026608(globalCtx);
+ }
}
- if (actor->shape.shadowDrawFunc != NULL)
+ if (actor->shape.shadowDrawFunc != NULL) {
actor->shape.shadowDrawFunc(actor, lightMapper, globalCtx);
+ }
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 6119);
Fault_RemoveClient(&faultClient);
}
-void func_80030ED8(Actor* actor)
-{
- if (actor->flags & 0x80000)
+void func_80030ED8(Actor* actor) {
+ if (actor->flags & 0x80000) {
Audio_PlaySoundGeneral(actor->soundEffect, &actor->unk_E4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- else if (actor->flags & 0x100000)
+ } else if (actor->flags & 0x100000) {
func_80078884(actor->soundEffect);
- else if (actor->flags & 0x200000)
+ } else if (actor->flags & 0x200000) {
func_800788CC(actor->soundEffect);
- else if (actor->flags & 0x10000000)
+ } else if (actor->flags & 0x10000000) {
func_800F4C58(&D_801333D4, 0x2021, (s8)(actor->soundEffect - 1));
- else
+ } else {
func_80078914(&actor->unk_E4, actor->soundEffect);
+ }
}
-void func_80030FA8(GraphicsContext* gfxCtx)
-{
+void func_80030FA8(GraphicsContext* gfxCtx) {
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, gfxCtx, "../z_actor.c", 6161);
- gDPLoadTextureBlock(gfxCtx->polyXlu.p++,
- &D_0401E370,
- G_IM_FMT_I,
- G_IM_SIZ_8b,
- 64, 64,
- 0,
- G_TX_MIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_CLAMP,
- 6, 6,
- G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock(gfxCtx->polyXlu.p++, &D_0401E370, G_IM_FMT_I, G_IM_SIZ_8b, 64, 64, 0, G_TX_MIRROR | G_TX_CLAMP,
+ G_TX_MIRROR | G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD);
gDPSetTileSize(gfxCtx->polyXlu.p++, G_TX_RENDERTILE, 384, 224, 892, 732);
gSPTextureRectangle(gfxCtx->polyXlu.p++, 0, 0, 1280, 960, G_TX_RENDERTILE, 2240, 1600, 576, 597);
@@ -2549,8 +2281,7 @@ void func_80030FA8(GraphicsContext* gfxCtx)
func_800C6B54(gfxArr, gfxCtx, "../z_actor.c", 6183);
}
-void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invisibleActors)
-{
+void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invisibleActors) {
Actor** invisibleActor;
GraphicsContext* gfxCtx;
s32 i;
@@ -2565,26 +2296,21 @@ void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invi
gDPPipeSync(gfxCtx->polyXlu.p++);
- if (globalCtx->roomCtx.curRoom.showInvisActors == 0)
- {
+ if (globalCtx->roomCtx.curRoom.showInvisActors == 0) {
gDPSetOtherMode(gfxCtx->polyXlu.p++,
- G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP |
- G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PRIM | Z_UPD | G_RM_CLD_SURF | G_RM_CLD_SURF2);
gDPSetCombineMode(gfxCtx->polyXlu.p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, 0xFF, 0x00, 0x00, 0xFF);
- }
- else
- {
+ } else {
gDPSetOtherMode(gfxCtx->polyXlu.p++,
- G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP |
- G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
- G_AC_THRESHOLD | G_ZS_PRIM | Z_UPD |
- IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL |
- GBL_c1(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA) |
- GBL_c2(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA));
- gDPSetCombineLERP(gfxCtx->polyXlu.p++,
- PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0, PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0,
+ G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_THRESHOLD | G_ZS_PRIM | Z_UPD | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL |
+ GBL_c1(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA) |
+ GBL_c2(G_BL_CLR_BL, G_BL_0, G_BL_CLR_MEM, G_BL_1MA));
+ gDPSetCombineLERP(gfxCtx->polyXlu.p++, PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0, PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0,
PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0, PRIMITIVE, TEXEL0, PRIM_LOD_FRAC, 0);
gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0xFF, 0x4A, 0x4A, 0x4A, 0x4A);
}
@@ -2597,8 +2323,7 @@ void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invi
gDma1p(gfxCtx->polyOpa.p++, G_NOOP, "魔法のメガネ 見えないActor表示 START", nbInvisibleActors, 2);
invisibleActor = &invisibleActors[0];
- for (i = 0; i < nbInvisibleActors; i++)
- {
+ for (i = 0; i < nbInvisibleActors; i++) {
// Translates to: "MAGIC LENS INVISIBLE ACTOR DISPLAY"
gDma1p(gfxCtx->polyOpa.p++, G_NOOP, "魔法のメガネ 見えないActor表示", i, 2);
Actor_Draw(globalCtx, *(invisibleActor++));
@@ -2607,16 +2332,15 @@ void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invi
// Translates to: "MAGIC LENS INVISIBLE ACTOR DISPLAY END"
gDma1p(gfxCtx->polyOpa.p++, G_NOOP, "魔法のメガネ 見えないActor表示 END", nbInvisibleActors, 2);
- if (globalCtx->roomCtx.curRoom.showInvisActors != 0)
- {
+ if (globalCtx->roomCtx.curRoom.showInvisActors != 0) {
// Translates to: "BLUE SPECTACLES (EXTERIOR)"
gDma1p(gfxCtx->polyOpa.p++, G_NOOP, "青い眼鏡(外側)", 0, 2);
gDPPipeSync(gfxCtx->polyXlu.p++);
gDPSetOtherMode(gfxCtx->polyXlu.p++,
- G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP |
- G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PRIM | G_RM_CLD_SURF | G_RM_CLD_SURF2);
gDPSetCombineMode(gfxCtx->polyXlu.p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, 0xFF, 0x00, 0x00, 0xFF);
@@ -2633,30 +2357,26 @@ void func_8003115C(GlobalContext* globalCtx, s32 nbInvisibleActors, Actor** invi
func_800C6B54(gfxArr, gfxCtx, "../z_actor.c", 6284);
}
-s32 func_800314B0(GlobalContext* globalCtx, Actor* actor)
-{
+s32 func_800314B0(GlobalContext* globalCtx, Actor* actor) {
return func_800314D4(globalCtx, actor, &actor->unk_E4, actor->unk_F0);
}
-s32 func_800314D4(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3)
-{
+s32 func_800314D4(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3) {
f32 var;
- if ((arg2->z > -actor->unk_F8) && (arg2->z < (actor->unk_F4 + actor->unk_F8)))
- {
+ if ((arg2->z > -actor->unk_F8) && (arg2->z < (actor->unk_F4 + actor->unk_F8))) {
var = (arg3 < 1.0f) ? 1.0f : 1.0f / arg3;
- if ((((fabsf(arg2->x) - actor->unk_F8) * var) < 1.0f) &&
- (((arg2->y + actor->unk_FC) * var) > -1.0f) &&
- (((arg2->y - actor->unk_F8) * var) < 1.0f))
+ if ((((fabsf(arg2->x) - actor->unk_F8) * var) < 1.0f) && (((arg2->y + actor->unk_FC) * var) > -1.0f) &&
+ (((arg2->y - actor->unk_F8) * var) < 1.0f)) {
return 1;
+ }
}
return 0;
}
-void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx)
-{
+void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx) {
s32 invisibleActorCounter;
Actor* invisibleActors[INVISIBLE_ACTOR_MAX];
ActorListEntry* actorListEntry;
@@ -2667,18 +2387,16 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx)
ActorOverlay* overlayEntry;
char* actorName;
- gfxCtx = globalCtx->state.gfxCtx;
+ gfxCtx = globalCtx->state.gfxCtx;
invisibleActorCounter = 0;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 6336);
actorListEntry = &actorCtx->actorList[0];
- for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, actorListEntry++)
- {
+ for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++, actorListEntry++) {
actor = actorListEntry->first;
- while (actor != NULL)
- {
+ while (actor != NULL) {
overlayEntry = actor->overlayEntry;
actorName = overlayEntry->name != NULL ? overlayEntry->name : "";
@@ -2687,55 +2405,38 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx)
HREG(66) = i;
- if ((HREG(64) != 1) ||
- ((HREG(65) != -1) && (HREG(65) != HREG(66))) ||
- (HREG(68) == 0))
- {
+ if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(68) == 0)) {
func_800A6E10(&globalCtx->mf_11D60, &actor->posRot.pos, &actor->unk_E4, &actor->unk_F0);
}
- if ((HREG(64) != 1) ||
- ((HREG(65) != -1) && (HREG(65) != HREG(66))) ||
- (HREG(69) == 0))
- {
- if (actor->soundEffect != 0)
+ if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(69) == 0)) {
+ if (actor->soundEffect != 0) {
func_80030ED8(actor);
+ }
}
- if ((HREG(64) != 1) ||
- ((HREG(65) != -1) && (HREG(65) != HREG(66))) ||
- (HREG(70) == 0))
- {
- if (func_800314B0(globalCtx, actor))
+ if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(70) == 0)) {
+ if (func_800314B0(globalCtx, actor)) {
actor->flags |= 0x40;
- else
+ } else {
actor->flags &= ~0x40;
+ }
}
actor->activelyDrawn = 0;
- if ((HREG(64) != 1) ||
- ((HREG(65) != -1) && (HREG(65) != HREG(66))) ||
- (HREG(71) == 0))
- {
- if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & 0x60))
- {
+ if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(71) == 0)) {
+ if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & 0x60)) {
if ((actor->flags & 0x80) &&
- ((globalCtx->roomCtx.curRoom.showInvisActors == 0) ||
- (globalCtx->actorCtx.unk_03 != 0) ||
- (actor->room != globalCtx->roomCtx.curRoom.num)))
- {
- if (invisibleActorCounter >= INVISIBLE_ACTOR_MAX)
+ ((globalCtx->roomCtx.curRoom.showInvisActors == 0) || (globalCtx->actorCtx.unk_03 != 0) ||
+ (actor->room != globalCtx->roomCtx.curRoom.num))) {
+ if (invisibleActorCounter >= INVISIBLE_ACTOR_MAX) {
__assert("invisible_actor_counter < INVISIBLE_ACTOR_MAX", "../z_actor.c", 6464);
+ }
invisibleActors[invisibleActorCounter] = actor;
invisibleActorCounter++;
- }
- else
- {
- if ((HREG(64) != 1) ||
- ((HREG(65) != -1) && (HREG(65) != HREG(66))) ||
- (HREG(72) == 0))
- {
+ } else {
+ if ((HREG(64) != 1) || ((HREG(65) != -1) && (HREG(65) != HREG(66))) || (HREG(72) == 0)) {
Actor_Draw(globalCtx, actor);
actor->activelyDrawn = 1;
}
@@ -2747,48 +2448,50 @@ void func_800315AC(GlobalContext* globalCtx, ActorContext* actorCtx)
}
}
- if ((HREG(64) != 1) || (HREG(73) != 0))
+ if ((HREG(64) != 1) || (HREG(73) != 0)) {
func_80026E74(globalCtx->state.gfxCtx);
+ }
- if ((HREG(64) != 1) || (HREG(74) != 0))
+ if ((HREG(64) != 1) || (HREG(74) != 0)) {
func_80027BDC(globalCtx);
+ }
- if ((HREG(64) != 1) || (HREG(72) != 0))
- {
- if (globalCtx->actorCtx.unk_03 != 0)
- {
+ if ((HREG(64) != 1) || (HREG(72) != 0)) {
+ if (globalCtx->actorCtx.unk_03 != 0) {
func_8003115C(globalCtx, invisibleActorCounter, invisibleActors);
- if ((globalCtx->csCtx.state != 0) || func_8008E988(globalCtx))
+ if ((globalCtx->csCtx.state != 0) || func_8008E988(globalCtx)) {
func_800304B0(globalCtx);
+ }
}
}
func_8002FBAC(globalCtx);
- if (IREG(32) == 0)
+ if (IREG(32) == 0) {
func_8007ABBC(globalCtx);
+ }
- if ((HREG(64) != 1) || (HREG(75) != 0))
+ if ((HREG(64) != 1) || (HREG(75) != 0)) {
TitleCard_Draw(globalCtx, &actorCtx->titleCtx);
+ }
- if ((HREG(64) != 1) || (HREG(76) != 0))
+ if ((HREG(64) != 1) || (HREG(76) != 0)) {
func_8005D62C(globalCtx, &globalCtx->sub_11E60);
+ }
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 6563);
}
-void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx)
-{
+void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx) {
Actor* actor;
s32 i;
- for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++)
- {
+ for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) {
actor = actorCtx->actorList[i].first;
- while (actor != NULL)
- {
- if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex))
+ while (actor != NULL) {
+ if (!Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) {
Actor_Kill(actor);
+ }
actor = actor->next;
}
}
@@ -2796,47 +2499,38 @@ void func_80031A28(GlobalContext* globalCtx, ActorContext* actorCtx)
u8 sEnemyActorTypes[] = { ACTORTYPE_ENEMY, ACTORTYPE_BOSS };
-void Actor_FreezeAllEnemies(GlobalContext* globalCtx, ActorContext* actorCtx, s32 freezeValue)
-{
+void Actor_FreezeAllEnemies(GlobalContext* globalCtx, ActorContext* actorCtx, s32 freezeValue) {
Actor* actor;
s32 i;
- for (i = 0; i < ARRAY_COUNT(sEnemyActorTypes); i++)
- {
+ for (i = 0; i < ARRAY_COUNT(sEnemyActorTypes); i++) {
actor = actorCtx->actorList[sEnemyActorTypes[i]].first;
- while (actor != NULL)
- {
+ while (actor != NULL) {
actor->freeze = freezeValue;
actor = actor->next;
}
}
}
-void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx)
-{
+void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx) {
Actor* actor;
s32 i;
- for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++)
- {
+ for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) {
actor = actorCtx->actorList[i].first;
- while (actor != NULL)
- {
- if ((actor->room >= 0) &&
- (actor->room != globalCtx->roomCtx.curRoom.num) &&
- (actor->room != globalCtx->roomCtx.prevRoom.num))
- {
- if (!actor->activelyDrawn)
+ while (actor != NULL) {
+ if ((actor->room >= 0) && (actor->room != globalCtx->roomCtx.curRoom.num) &&
+ (actor->room != globalCtx->roomCtx.prevRoom.num)) {
+ if (!actor->activelyDrawn) {
actor = Actor_Delete(actorCtx, actor, globalCtx);
- else
- {
+ } else {
Actor_Kill(actor);
Actor_Destroy(actor, globalCtx);
actor = actor->next;
}
- }
- else
+ } else {
actor = actor->next;
+ }
}
}
@@ -2846,27 +2540,24 @@ void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx)
globalCtx->msgCtx.unk_E3F4 = 0;
}
-void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx)
-{
+void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) {
Actor* actor;
s32 i;
- for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++)
- {
+ for (i = 0; i < ARRAY_COUNT(actorCtx->actorList); i++) {
actor = actorCtx->actorList[i].first;
- while (actor != NULL)
- {
+ while (actor != NULL) {
Actor_Delete(actorCtx, actor, globalCtx);
actor = actorCtx->actorList[i].first;
}
}
- if (HREG(20) != 0)
+ if (HREG(20) != 0) {
// Translates to: "ABSOLUTE MAGIC FIELD DEALLOCATION"
osSyncPrintf("絶対魔法領域解放\n");
+ }
- if (actorCtx->absoluteSpace != NULL)
- {
+ if (actorCtx->absoluteSpace != NULL) {
ZeldaArena_FreeDebug(actorCtx->absoluteSpace, "../z_actor.c", 6731);
actorCtx->absoluteSpace = NULL;
}
@@ -2880,8 +2571,7 @@ void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx)
* Adds a given actor instance at the front of the actor list of the specified type.
* Also sets the actor instance as being of that type.
*/
-void Actor_AddToTypeList(ActorContext* actorCtx, Actor* actorToAdd, u8 actorType)
-{
+void Actor_AddToTypeList(ActorContext* actorCtx, Actor* actorToAdd, u8 actorType) {
Actor* prevFirstActor;
actorToAdd->type = actorType;
@@ -2890,8 +2580,9 @@ void Actor_AddToTypeList(ActorContext* actorCtx, Actor* actorToAdd, u8 actorType
actorCtx->actorList[actorType].length++;
prevFirstActor = actorCtx->actorList[actorType].first;
- if (prevFirstActor != NULL)
+ if (prevFirstActor != NULL) {
prevFirstActor->prev = actorToAdd;
+ }
actorCtx->actorList[actorType].first = actorToAdd;
actorToAdd->next = prevFirstActor;
@@ -2901,81 +2592,75 @@ void Actor_AddToTypeList(ActorContext* actorCtx, Actor* actorToAdd, u8 actorType
* Removes a given actor instance from its actor list.
* Also sets the temp clear flag of the current room if the actor removed was the last enemy loaded.
*/
-Actor* Actor_RemoveFromTypeList(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actorToRemove)
-{
+Actor* Actor_RemoveFromTypeList(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actorToRemove) {
Actor* newFirstActor;
actorCtx->total--;
actorCtx->actorList[actorToRemove->type].length--;
- if (actorToRemove->prev != NULL)
+ if (actorToRemove->prev != NULL) {
actorToRemove->prev->next = actorToRemove->next;
- else
+ } else {
actorCtx->actorList[actorToRemove->type].first = actorToRemove->next;
+ }
newFirstActor = actorToRemove->next;
- if (newFirstActor != NULL)
+ if (newFirstActor != NULL) {
newFirstActor->prev = actorToRemove->prev;
+ }
actorToRemove->next = NULL;
actorToRemove->prev = NULL;
- if ((actorToRemove->room == globalCtx->roomCtx.curRoom.num) &&
- (actorToRemove->type == ACTORTYPE_ENEMY) &&
- (actorCtx->actorList[ACTORTYPE_ENEMY].length == 0))
- {
+ if ((actorToRemove->room == globalCtx->roomCtx.curRoom.num) && (actorToRemove->type == ACTORTYPE_ENEMY) &&
+ (actorCtx->actorList[ACTORTYPE_ENEMY].length == 0)) {
Flags_SetTempClear(globalCtx, globalCtx->roomCtx.curRoom.num);
}
return newFirstActor;
}
-void Actor_FreeOverlay(ActorOverlay* actorOverlay)
-{
+void Actor_FreeOverlay(ActorOverlay* actorOverlay) {
osSyncPrintf(VT_FGCOL(CYAN));
- if (actorOverlay->nbLoaded == 0)
- {
- if (HREG(20) != 0)
+ if (actorOverlay->nbLoaded == 0) {
+ if (HREG(20) != 0) {
// Translates to: "ACTOR CLIENT IS NOW 0"
osSyncPrintf("アクタークライアントが0になりました\n");
+ }
- if (actorOverlay->loadedRamAddr != NULL)
- {
- if (actorOverlay->allocType & ALLOCTYPE_PERMANENT)
- {
- if (HREG(20) != 0)
+ if (actorOverlay->loadedRamAddr != NULL) {
+ if (actorOverlay->allocType & ALLOCTYPE_PERMANENT) {
+ if (HREG(20) != 0) {
// Translates to: "OVERLAY WILL NOT BE DEALLOCATED"
osSyncPrintf("オーバーレイ解放しません\n");
- }
- else if (actorOverlay->allocType & ALLOCTYPE_ABSOLUTE)
- {
- if (HREG(20) != 0)
+ }
+ } else if (actorOverlay->allocType & ALLOCTYPE_ABSOLUTE) {
+ if (HREG(20) != 0) {
// Translates to: "ABSOLUTE MAGIC FIELD RESERVED, SO DEALLOCATION WILL NOT OCCUR"
osSyncPrintf("絶対魔法領域確保なので解放しません\n");
+ }
actorOverlay->loadedRamAddr = NULL;
- }
- else
- {
- if (HREG(20) != 0)
+ } else {
+ if (HREG(20) != 0) {
// Translates to: "OVERLAY DEALLOCATED"
osSyncPrintf("オーバーレイ解放します\n");
+ }
ZeldaArena_FreeDebug(actorOverlay->loadedRamAddr, "../z_actor.c", 6834);
actorOverlay->loadedRamAddr = NULL;
}
}
- }
- else if (HREG(20) != 0)
+ } else if (HREG(20) != 0) {
// Translates to: "%d OF ACTOR CLIENT REMAINS"
osSyncPrintf("アクタークライアントはあと %d 残っています\n", actorOverlay->nbLoaded);
+ }
osSyncPrintf(VT_RST);
}
-Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId,
- f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params)
-{
+Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, f32 posX, f32 posY, f32 posZ,
+ s16 rotX, s16 rotY, s16 rotZ, s16 params) {
s32 pad;
Actor* actor;
ActorInit* actorInit;
@@ -2987,132 +2672,126 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
overlayEntry = &gActorOverlayTable[actorId];
- if (actorId >= ACTOR_DLF_MAX)
+ if (actorId >= ACTOR_DLF_MAX) {
__assert("profile < ACTOR_DLF_MAX", "../z_actor.c", 6883);
+ }
name = overlayEntry->name != NULL ? overlayEntry->name : "";
overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart;
- if (HREG(20) != 0)
+ if (HREG(20) != 0) {
// Translates to: "ACTOR CLASS ADDITION [%d:%s]"
osSyncPrintf("アクタークラス追加 [%d:%s]\n", actorId, name);
+ }
- if (actorCtx->total > ACTOR_NUMBER_MAX)
- {
+ if (actorCtx->total > ACTOR_NUMBER_MAX) {
// Translates to: "Actor SET NUMBER EXCEEDED"
osSyncPrintf(VT_COL(YELLOW, BLACK) "Actorセット数オーバー\n" VT_RST);
return NULL;
}
- if (overlayEntry->vramStart == 0)
- {
- if (HREG(20) != 0)
+ if (overlayEntry->vramStart == 0) {
+ if (HREG(20) != 0) {
// Translates to: "NOT AN OVERLAY"
osSyncPrintf("オーバーレイではありません\n");
+ }
actorInit = overlayEntry->initInfo;
- }
- else
- {
- if (overlayEntry->loadedRamAddr != NULL)
- {
- if (HREG(20) != 0)
+ } else {
+ if (overlayEntry->loadedRamAddr != NULL) {
+ if (HREG(20) != 0) {
// Translates to: "ALREADY LOADED"
osSyncPrintf("既にロードされています\n");
- }
- else
- {
- if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE)
- {
- if (overlaySize > AM_FIELD_SIZE)
+ }
+ } else {
+ if (overlayEntry->allocType & ALLOCTYPE_ABSOLUTE) {
+ if (overlaySize > AM_FIELD_SIZE) {
__assert("actor_segsize <= AM_FIELD_SIZE", "../z_actor.c", 6934);
+ }
- if (actorCtx->absoluteSpace == NULL)
- {
+ if (actorCtx->absoluteSpace == NULL) {
// Translates to: "AMF: ABSOLUTE MAGIC FIELD"
actorCtx->absoluteSpace = ZeldaArena_MallocRDebug(AM_FIELD_SIZE, "AMF:絶対魔法領域", 0);
- if (HREG(20) != 0)
+ if (HREG(20) != 0) {
// Translates to: "ABSOLUTE MAGIC FIELD RESERVATION - %d BYTES RESERVED"
osSyncPrintf("絶対魔法領域確保 %d バイト確保\n", AM_FIELD_SIZE);
+ }
}
overlayEntry->loadedRamAddr = actorCtx->absoluteSpace;
- }
- else if (overlayEntry->allocType & ALLOCTYPE_PERMANENT)
+ } else if (overlayEntry->allocType & ALLOCTYPE_PERMANENT) {
overlayEntry->loadedRamAddr = ZeldaArena_MallocRDebug(overlaySize, name, 0);
- else
+ } else {
overlayEntry->loadedRamAddr = ZeldaArena_MallocDebug(overlaySize, name, 0);
+ }
- if (overlayEntry->loadedRamAddr == NULL)
- {
+ if (overlayEntry->loadedRamAddr == NULL) {
// Translates to: "CANNOT RESERVE ACTOR PROGRAM MEMORY"
osSyncPrintf(VT_COL(RED, WHITE) "Actorプログラムメモリが確保できません\n" VT_RST);
return NULL;
}
- Overlay_Load(overlayEntry->vromStart, overlayEntry->vromEnd,
- overlayEntry->vramStart, overlayEntry->vramEnd,
- overlayEntry->loadedRamAddr);
+ Overlay_Load(overlayEntry->vromStart, overlayEntry->vromEnd, overlayEntry->vramStart, overlayEntry->vramEnd,
+ overlayEntry->loadedRamAddr);
osSyncPrintf(VT_FGCOL(GREEN));
- osSyncPrintf("OVL(a):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n",
- overlayEntry->vramStart, overlayEntry->vramEnd,
- overlayEntry->loadedRamAddr,
+ osSyncPrintf("OVL(a):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", overlayEntry->vramStart,
+ overlayEntry->vramEnd, overlayEntry->loadedRamAddr,
(u32)overlayEntry->loadedRamAddr + (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart,
- (u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr,
- name);
+ (u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr, name);
osSyncPrintf(VT_RST);
overlayEntry->nbLoaded = 0;
}
- actorInit = (ActorInit*)((u32)(overlayEntry->initInfo != NULL ?
- (ActorInit*)((u32)overlayEntry->initInfo - (s32)((u32)overlayEntry->vramStart - (u32)overlayEntry->loadedRamAddr)) :
- NULL));
+ actorInit =
+ (ActorInit*)((u32)(overlayEntry->initInfo != NULL
+ ? (ActorInit*)((u32)overlayEntry->initInfo - (s32)((u32)overlayEntry->vramStart -
+ (u32)overlayEntry->loadedRamAddr))
+ : NULL));
}
objBankIndex = Object_GetIndex(&globalCtx->objectCtx, actorInit->objectId);
if ((objBankIndex < 0) ||
- ((actorInit->type == ACTORTYPE_ENEMY) && (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num))))
- {
+ ((actorInit->type == ACTORTYPE_ENEMY) && (Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num)))) {
// Translates to: "NO DATA BANK!! <DATA BANK=%d> (profilep->bank=%d)"
- osSyncPrintf(VT_COL(RED, WHITE) "データバンク無し!!<データバンク=%d>(profilep->bank=%d)\n" VT_RST, objBankIndex, actorInit->objectId);
+ osSyncPrintf(VT_COL(RED, WHITE) "データバンク無し!!<データバンク=%d>(profilep->bank=%d)\n" VT_RST,
+ objBankIndex, actorInit->objectId);
Actor_FreeOverlay(overlayEntry);
return NULL;
}
actor = ZeldaArena_MallocDebug(actorInit->instanceSize, name, 1);
- if (actor == NULL)
- {
+ if (actor == NULL) {
// Translates to: "ACTOR CLASS CANNOT BE RESERVED! %s <SIZE=%d BYTES>"
- osSyncPrintf(VT_COL(RED, WHITE) "Actorクラス確保できません! %s <サイズ=%dバイト>\n", VT_RST, name, actorInit->instanceSize);
+ osSyncPrintf(VT_COL(RED, WHITE) "Actorクラス確保できません! %s <サイズ=%dバイト>\n", VT_RST, name,
+ actorInit->instanceSize);
Actor_FreeOverlay(overlayEntry);
return NULL;
}
- if (overlayEntry->nbLoaded >= 255)
+ if (overlayEntry->nbLoaded >= 255) {
__assert("actor_dlftbl->clients < 255", "../z_actor.c", 7031);
+ }
overlayEntry->nbLoaded++;
- if (HREG(20) != 0)
+ if (HREG(20) != 0) {
// Translates to: "ACTOR CLIENT No. %d"
osSyncPrintf("アクタークライアントは %d 個目です\n", overlayEntry->nbLoaded);
+ }
Lib_MemSet(actor, actorInit->instanceSize, 0);
actor->overlayEntry = overlayEntry;
actor->id = actorInit->id;
actor->flags = actorInit->flags;
- if (actorInit->id == ACTOR_EN_PART)
- {
+ if (actorInit->id == ACTOR_EN_PART) {
actor->objBankIndex = rotZ;
rotZ = 0;
- }
- else
- {
+ } else {
actor->objBankIndex = objBankIndex;
}
@@ -3138,26 +2817,24 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId
return actor;
}
-Actor* Actor_SpawnAttached(ActorContext* actorCtx, Actor* attachedTo, GlobalContext* globalCtx, s16 actorId,
- f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params)
-{
- Actor* spawnedActor = Actor_Spawn(actorCtx, globalCtx, actorId,
- posX, posY, posZ,
- rotX, rotY, rotZ, params);
- if (spawnedActor == NULL)
+Actor* Actor_SpawnAttached(ActorContext* actorCtx, Actor* attachedTo, GlobalContext* globalCtx, s16 actorId, f32 posX,
+ f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params) {
+ Actor* spawnedActor = Actor_Spawn(actorCtx, globalCtx, actorId, posX, posY, posZ, rotX, rotY, rotZ, params);
+ if (spawnedActor == NULL) {
return NULL;
+ }
attachedTo->attachedB = spawnedActor;
spawnedActor->attachedA = attachedTo;
- if (spawnedActor->room >= 0)
+ if (spawnedActor->room >= 0) {
spawnedActor->room = attachedTo->room;
+ }
return spawnedActor;
}
-void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCtx)
-{
+void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCtx) {
TransitionActorEntry* transitionActor;
u8 nbTransitionActors;
s32 i;
@@ -3165,20 +2842,16 @@ void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCt
transitionActor = globalCtx->transitionActorList;
nbTransitionActors = globalCtx->nbTransitionActors;
- for (i = 0; i < nbTransitionActors; i++)
- {
- if (transitionActor->id >= 0)
- {
+ for (i = 0; i < nbTransitionActors; i++) {
+ if (transitionActor->id >= 0) {
if (((transitionActor->frontRoom >= 0) &&
((transitionActor->frontRoom == globalCtx->roomCtx.curRoom.num) ||
(transitionActor->frontRoom == globalCtx->roomCtx.prevRoom.num))) ||
((transitionActor->backRoom >= 0) &&
((transitionActor->backRoom == globalCtx->roomCtx.curRoom.num) ||
- (transitionActor->backRoom == globalCtx->roomCtx.prevRoom.num))))
- {
- Actor_Spawn(actorCtx, globalCtx, (s16)(transitionActor->id & 0x1FFF),
- transitionActor->pos.x, transitionActor->pos.y, transitionActor->pos.z,
- 0, transitionActor->rotY, 0,
+ (transitionActor->backRoom == globalCtx->roomCtx.prevRoom.num)))) {
+ Actor_Spawn(actorCtx, globalCtx, (s16)(transitionActor->id & 0x1FFF), transitionActor->pos.x,
+ transitionActor->pos.y, transitionActor->pos.z, 0, transitionActor->rotY, 0,
(i << 0xA) + transitionActor->params);
transitionActor->id = -transitionActor->id;
@@ -3189,16 +2862,12 @@ void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCt
}
}
-Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx)
-{
- return Actor_Spawn(actorCtx, globalCtx, actorEntry->id,
- actorEntry->pos.x, actorEntry->pos.y, actorEntry->pos.z,
- actorEntry->rot.x, actorEntry->rot.y, actorEntry->rot.z,
- actorEntry->params);
+Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx) {
+ return Actor_Spawn(actorCtx, globalCtx, actorEntry->id, actorEntry->pos.x, actorEntry->pos.y, actorEntry->pos.z,
+ actorEntry->rot.x, actorEntry->rot.y, actorEntry->rot.z, actorEntry->params);
}
-Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx)
-{
+Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx) {
char* name;
Player* player;
Actor* newFirstActor;
@@ -3209,24 +2878,27 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
overlayEntry = actor->overlayEntry;
name = overlayEntry->name != NULL ? overlayEntry->name : "";
- if (HREG(20) != 0)
+ if (HREG(20) != 0) {
// Translates to: "ACTOR CLASS DELETED [%s]"
osSyncPrintf("アクタークラス削除 [%s]\n", name);
+ }
- if ((player != NULL) && (actor == player->unk_664))
- {
+ if ((player != NULL) && (actor == player->unk_664)) {
func_8008EDF0(player);
func_8005A444(func_800C04A4(globalCtx, func_800C030C(globalCtx)), 0);
}
- if (actor == actorCtx->targetCtx.arrowPointedActor)
+ if (actor == actorCtx->targetCtx.arrowPointedActor) {
actorCtx->targetCtx.arrowPointedActor = NULL;
+ }
- if (actor == actorCtx->targetCtx.unk_8C)
+ if (actor == actorCtx->targetCtx.unk_8C) {
actorCtx->targetCtx.unk_8C = NULL;
+ }
- if (actor == actorCtx->targetCtx.unk_90)
+ if (actor == actorCtx->targetCtx.unk_90) {
actorCtx->targetCtx.unk_90 = NULL;
+ }
func_800F89E8(&actor->unk_E4);
Actor_Destroy(actor, globalCtx);
@@ -3235,19 +2907,19 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
ZeldaArena_FreeDebug(actor, "../z_actor.c", 7242);
- if (overlayEntry->vramStart == 0)
- {
- if (HREG(20) != 0)
+ if (overlayEntry->vramStart == 0) {
+ if (HREG(20) != 0) {
// Translates to: "NOT AN OVERLAY"
osSyncPrintf("オーバーレイではありません\n");
- }
- else
- {
- if (overlayEntry->loadedRamAddr == NULL)
+ }
+ } else {
+ if (overlayEntry->loadedRamAddr == NULL) {
__assert("actor_dlftbl->allocp != NULL", "../z_actor.c", 7251);
+ }
- if (overlayEntry->nbLoaded <= 0)
+ if (overlayEntry->nbLoaded <= 0) {
__assert("actor_dlftbl->clients > 0", "../z_actor.c", 7252);
+ }
overlayEntry->nbLoaded--;
Actor_FreeOverlay(overlayEntry);
@@ -3256,8 +2928,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
return newFirstActor;
}
-s32 func_80032880(GlobalContext* globalCtx, Actor* actor)
-{
+s32 func_80032880(GlobalContext* globalCtx, Actor* actor) {
s16 sp1E;
s16 sp1C;
@@ -3273,49 +2944,37 @@ f32 D_8015BBF4;
s32 D_8015BBF8;
s16 D_8015BBFC;
-void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* player, u32 actorType)
-{
+void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* player, u32 actorType) {
f32 var;
Actor* actor;
Actor* sp84;
- CollisionPoly *sp80;
+ CollisionPoly* sp80;
UNK_TYPE sp7C;
Vec3f sp70;
actor = actorCtx->actorList[actorType].first;
sp84 = player->unk_664;
- while (actor != NULL)
- {
- if ((actor->update != NULL) && ((Player*)actor != player) && ((actor->flags & 1) == 1))
- {
- if ((actorType == ACTORTYPE_ENEMY) && ((actor->flags & 5) == 5) &&
- (actor->waterSurfaceDist < 250000.0f) && (actor->waterSurfaceDist < D_8015BBF4))
- {
- actorCtx->targetCtx.unk_90 = actor;
- D_8015BBF4 = actor->waterSurfaceDist;
+ while (actor != NULL) {
+ if ((actor->update != NULL) && ((Player*)actor != player) && ((actor->flags & 1) == 1)) {
+ if ((actorType == ACTORTYPE_ENEMY) && ((actor->flags & 5) == 5) && (actor->waterSurfaceDist < 250000.0f) &&
+ (actor->waterSurfaceDist < D_8015BBF4)) {
+ actorCtx->targetCtx.unk_90 = actor;
+ D_8015BBF4 = actor->waterSurfaceDist;
}
- if (actor != sp84)
- {
+ if (actor != sp84) {
var = func_8002EFC0(actor, player, D_8015BBFC);
- if ((var < D_8015BBF0) &&
- func_8002F090(actor, var) &&
- func_80032880(globalCtx, actor) &&
- (!func_8003DD6C(&globalCtx->colCtx, &player->actor.posRot2.pos,
- &actor->posRot2.pos, &sp70, &sp80, 1, 1, 1, 1, &sp7C) ||
- func_80042048(&globalCtx->colCtx, sp80, sp7C)))
- {
- if (actor->unk_10D != 0)
- {
- if (actor->unk_10D < D_8015BBF8)
- {
+ if ((var < D_8015BBF0) && func_8002F090(actor, var) && func_80032880(globalCtx, actor) &&
+ (!func_8003DD6C(&globalCtx->colCtx, &player->actor.posRot2.pos, &actor->posRot2.pos, &sp70, &sp80,
+ 1, 1, 1, 1, &sp7C) ||
+ func_80042048(&globalCtx->colCtx, sp80, sp7C))) {
+ if (actor->unk_10D != 0) {
+ if (actor->unk_10D < D_8015BBF8) {
D_8015BBEC = actor;
D_8015BBF8 = actor->unk_10D;
}
- }
- else
- {
+ } else {
D_8015BBE8 = actor;
D_8015BBF0 = var;
}
@@ -3327,24 +2986,12 @@ void func_800328D4(GlobalContext* globalCtx, ActorContext* actorCtx, Player* pla
}
}
-u8 D_801160A0[] =
-{
- ACTORTYPE_BOSS,
- ACTORTYPE_ENEMY,
- ACTORTYPE_BG,
- ACTORTYPE_EXPLOSIVES,
- ACTORTYPE_NPC,
- ACTORTYPE_ITEMACTION,
- ACTORTYPE_CHEST,
- ACTORTYPE_SWITCH,
- ACTORTYPE_PROP,
- ACTORTYPE_MISC,
- ACTORTYPE_DOOR,
- ACTORTYPE_SWITCH,
+u8 D_801160A0[] = {
+ ACTORTYPE_BOSS, ACTORTYPE_ENEMY, ACTORTYPE_BG, ACTORTYPE_EXPLOSIVES, ACTORTYPE_NPC, ACTORTYPE_ITEMACTION,
+ ACTORTYPE_CHEST, ACTORTYPE_SWITCH, ACTORTYPE_PROP, ACTORTYPE_MISC, ACTORTYPE_DOOR, ACTORTYPE_SWITCH,
};
-Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player)
-{
+Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player) {
s32 i;
u8* entry;
@@ -3352,33 +2999,30 @@ Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** a
D_8015BBF0 = D_8015BBF4 = FLT_MAX;
D_8015BBF8 = 0x7FFFFFFF;
- if (!func_8008E988(globalCtx))
- {
+ if (!func_8008E988(globalCtx)) {
entry = &D_801160A0[0];
actorCtx->targetCtx.unk_90 = NULL;
D_8015BBFC = player->actor.shape.rot.y;
- for (i = 0; i < 3; i++)
- {
+ for (i = 0; i < 3; i++) {
func_800328D4(globalCtx, actorCtx, player, *entry);
entry++;
}
- if (D_8015BBE8 == NULL)
- {
- for (i; i < ARRAY_COUNT(D_801160A0); i++)
- {
+ if (D_8015BBE8 == NULL) {
+ for (i; i < ARRAY_COUNT(D_801160A0); i++) {
func_800328D4(globalCtx, actorCtx, player, *entry);
entry++;
}
}
}
- if (D_8015BBE8 == 0)
+ if (D_8015BBE8 == 0) {
*actorPtr = D_8015BBEC;
- else
+ } else {
*actorPtr = D_8015BBE8;
+ }
return *actorPtr;
}
@@ -3386,84 +3030,77 @@ Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** a
/**
* Finds the first actor instance of a specified id and type if there is one.
*/
-Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType)
-{
+Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType) {
Actor* actor = actorCtx->actorList[actorType].first;
- while (actor != NULL)
- {
- if (actorId == actor->id)
+ while (actor != NULL) {
+ if (actorId == actor->id) {
return actor;
+ }
actor = actor->next;
}
return NULL;
}
-void func_80032C7C(GlobalContext* globalCtx, Actor* actor)
-{
+void func_80032C7C(GlobalContext* globalCtx, Actor* actor) {
globalCtx->actorCtx.unk_00 = 5;
Audio_PlaySoundAtPosition(globalCtx, &actor->posRot.pos, 0x14, NA_SE_EN_LAST_DAMAGE);
}
-s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3)
-{
- if (DECR(arg0[1]) == 0)
+s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) {
+ if (DECR(arg0[1]) == 0) {
arg0[1] = Math_Rand_S16Offset(arg1, arg2);
+ }
- if ((arg0[1] - arg3) > 0)
+ if ((arg0[1] - arg3) > 0) {
arg0[0] = 0;
- else if (((arg0[1] - arg3) > -2) || (arg0[1] < 2))
+ } else if (((arg0[1] - arg3) > -2) || (arg0[1] < 2)) {
arg0[0] = 1;
- else
+ } else {
arg0[0] = 2;
+ }
return arg0[0];
}
-s16 func_80032D60(s16* arg0, s16 arg1, s16 arg2, s16 arg3)
-{
- if (DECR(arg0[1]) == 0)
- {
+s16 func_80032D60(s16* arg0, s16 arg1, s16 arg2, s16 arg3) {
+ if (DECR(arg0[1]) == 0) {
arg0[1] = Math_Rand_S16Offset(arg1, arg2);
arg0[0]++;
- if ((arg0[0] % 3) == 0)
+ if ((arg0[0] % 3) == 0) {
arg0[0] = (s32)(Math_Rand_ZeroOne() * arg3) * 3;
+ }
}
return arg0[0];
}
-typedef struct
-{
+typedef struct {
/* 0x00 */ MtxF* unk_00;
/* 0x04 */ s16* unk_04;
- /* 0x08 */ s16 unk_08;
+ /* 0x08 */ s16 unk_08;
/* 0x0A */ char unk_0A[0x02];
/* 0x0C */ s32* unk_0C;
- /* 0x10 */ s32 unk_10;
- /* 0x14 */ s32 unk_14;
+ /* 0x10 */ s32 unk_10;
+ /* 0x14 */ s32 unk_14;
} struct_80032E24;
-void func_80032E24(struct_80032E24* arg0, s32 arg1, GlobalContext* globalCtx)
-{
+void func_80032E24(struct_80032E24* arg0, s32 arg1, GlobalContext* globalCtx) {
u32 sp28;
u32 sp24;
u32 sp20;
sp28 = (arg1 * sizeof(*arg0->unk_00)) + sizeof(*arg0->unk_00);
arg0->unk_00 = ZeldaArena_MallocDebug(sp28, "../z_actor.c", 7540);
- if (arg0->unk_00 != NULL)
- {
+ if (arg0->unk_00 != NULL) {
sp24 = (arg1 * sizeof(*arg0->unk_0C)) + sizeof(*arg0->unk_0C);
arg0->unk_0C = ZeldaArena_MallocDebug(sp24, "../z_actor.c", 7543);
- if (arg0->unk_0C != NULL)
- {
+ if (arg0->unk_0C != NULL) {
sp20 = (arg1 * sizeof(*arg0->unk_04)) + sizeof(*arg0->unk_04);
arg0->unk_04 = ZeldaArena_MallocDebug(sp20, "../z_actor.c", 7546);
- if (arg0->unk_04 != NULL)
- {
+ if (arg0->unk_04 != NULL) {
Lib_MemSet(arg0->unk_00, sp28, 0);
Lib_MemSet(arg0->unk_0C, sp24, 0);
Lib_MemSet(arg0->unk_04, sp20, 0);
@@ -3473,35 +3110,35 @@ void func_80032E24(struct_80032E24* arg0, s32 arg1, GlobalContext* globalCtx)
}
}
- if (arg0->unk_00 != NULL)
+ if (arg0->unk_00 != NULL) {
ZeldaArena_FreeDebug(arg0->unk_00, "../z_actor.c", 7558);
+ }
- if (arg0->unk_0C != NULL)
+ if (arg0->unk_0C != NULL) {
ZeldaArena_FreeDebug(arg0->unk_0C, "../z_actor.c", 7561);
+ }
- if (arg0->unk_04 != NULL)
+ if (arg0->unk_04 != NULL) {
ZeldaArena_FreeDebug(arg0->unk_04, "../z_actor.c", 7564);
+ }
}
-void func_80032F54(struct_80032E24* arg0, s32 arg1, s32 arg2, s32 arg3, u32 arg4, s32* arg5, s16 arg6)
-{
+void func_80032F54(struct_80032E24* arg0, s32 arg1, s32 arg2, s32 arg3, u32 arg4, s32* arg5, s16 arg6) {
GlobalContext* globalCtx = func_80026B00();
- if ((globalCtx->actorCtx.unk_00 == 0) && (arg0->unk_10 > 0))
- {
- if ((arg1 >= arg2) && (arg3 >= arg1) && (*arg5 != 0))
- {
+ if ((globalCtx->actorCtx.unk_00 == 0) && (arg0->unk_10 > 0)) {
+ if ((arg1 >= arg2) && (arg3 >= arg1) && (*arg5 != 0)) {
arg0->unk_0C[arg0->unk_10] = *arg5;
Matrix_Get(&arg0->unk_00[arg0->unk_10]);
arg0->unk_04[arg0->unk_10] = arg6;
arg0->unk_10++;
}
- if (arg1 != arg0->unk_14)
+ if (arg1 != arg0->unk_14) {
arg0->unk_08++;
+ }
- if (arg0->unk_08 >= arg4)
- {
+ if (arg0->unk_08 >= arg4) {
arg0->unk_08 = arg0->unk_10 - 1;
arg0->unk_10 = -1;
}
@@ -3510,45 +3147,41 @@ void func_80032F54(struct_80032E24* arg0, s32 arg1, s32 arg2, s32 arg3, u32 arg4
arg0->unk_14 = arg1;
}
-typedef struct
-{
- /* 0x000 */ Actor actor;
- /* 0x14C */ u8 unk_14C;
- /* 0x14E */ s16 unk_14E;
- /* 0x150 */ s32 unk_150;
- /* 0x154 */ f32 unk_154;
- /* 0x158 */ f32 unk_158;
+typedef struct {
+ /* 0x000 */ Actor actor;
+ /* 0x14C */ u8 unk_14C;
+ /* 0x14E */ s16 unk_14E;
+ /* 0x150 */ s32 unk_150;
+ /* 0x154 */ f32 unk_154;
+ /* 0x158 */ f32 unk_158;
} ActorEnPart;
-s32 func_8003305C(Actor* actor, struct_80032E24* arg1, GlobalContext* globalCtx, s16 params)
-{
+s32 func_8003305C(Actor* actor, struct_80032E24* arg1, GlobalContext* globalCtx, s16 params) {
ActorEnPart* spawnedEnPart;
MtxF* mtx;
s16 objBankIndex;
- if (arg1->unk_10 != -1)
+ if (arg1->unk_10 != -1) {
return 0;
+ }
- while (arg1->unk_08 > 0)
- {
+ while (arg1->unk_08 > 0) {
Matrix_Put(&arg1->unk_00[arg1->unk_08]);
Matrix_Scale(1.0f / actor->scale.x, 1.0f / actor->scale.y, 1.0f / actor->scale.z, MTXMODE_APPLY);
Matrix_Get(&arg1->unk_00[arg1->unk_08]);
- if (1) // Necessary to match
- {
- if (arg1->unk_04[arg1->unk_08] >= 0)
+ if (1) { // Necessary to match
+ if (arg1->unk_04[arg1->unk_08] >= 0) {
objBankIndex = arg1->unk_04[arg1->unk_08];
- else
+ } else {
objBankIndex = actor->objBankIndex;
+ }
}
mtx = &arg1->unk_00[arg1->unk_08];
spawnedEnPart = (ActorEnPart*)Actor_SpawnAttached(&globalCtx->actorCtx, actor, globalCtx, ACTOR_EN_PART,
- mtx->wx, mtx->wy, mtx->wz,
- 0, 0, objBankIndex, params);
- if (spawnedEnPart != NULL)
- {
+ mtx->wx, mtx->wy, mtx->wz, 0, 0, objBankIndex, params);
+ if (spawnedEnPart != NULL) {
func_800D20CC(&arg1->unk_00[arg1->unk_08], &spawnedEnPart->actor.shape.rot, 0);
spawnedEnPart->unk_150 = arg1->unk_0C[arg1->unk_08];
spawnedEnPart->actor.scale = actor->scale;
@@ -3565,8 +3198,8 @@ s32 func_8003305C(Actor* actor, struct_80032E24* arg1, GlobalContext* globalCtx,
return 1;
}
-void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 arg5, s16 arg6, s16 arg7, u8 arg8)
-{
+void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 arg5, s16 arg6,
+ s16 arg7, u8 arg8) {
Vec3f sp9C;
Vec3f sp90 = { 0.0f, 0.0f, 0.0f };
Vec3f sp84 = { 0.0f, 0.3f, 0.0f };
@@ -3577,26 +3210,25 @@ void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3
sp9C.y = actor->unk_80;
sp84.y += (Math_Rand_ZeroOne() - 0.5f) * 0.2f;
- for (i = arg4; i >= 0; i--)
- {
+ for (i = arg4; i >= 0; i--) {
sp9C.x = (func_800CA720(var) * arg3) + arg2->x;
sp9C.z = (func_800CA774(var) * arg3) + arg2->z;
sp84.x = (Math_Rand_ZeroOne() - 0.5f) * arg5;
sp84.z = (Math_Rand_ZeroOne() - 0.5f) * arg5;
- if (arg6 == 0)
+ if (arg6 == 0) {
func_8002857C(globalCtx, &sp9C, &sp90, &sp84);
- else if (arg8 != 0)
+ } else if (arg8 != 0) {
func_800286CC(globalCtx, &sp9C, &sp90, &sp84, arg6, arg7);
- else
+ } else {
func_8002865C(globalCtx, &sp9C, &sp90, &sp84, arg6, arg7);
+ }
var += 6.28f / (arg4 + 1.0f);
}
}
-void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 arg5, u8 arg6)
-{
+void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 arg5, u8 arg6) {
Vec3f sp94;
Vec3f sp88 = { 0.0f, 0.0f, 0.0f };
Vec3f sp7C = { 0.0f, 0.3f, 0.0f };
@@ -3604,8 +3236,7 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1
u32 var2;
s32 i;
- for (i = arg3; i >= 0; i--)
- {
+ for (i = arg3; i >= 0; i--) {
sp94.x = arg1->x + ((Math_Rand_ZeroOne() - 0.5f) * arg2);
sp94.y = arg1->y + ((Math_Rand_ZeroOne() - 0.5f) * arg2);
sp94.z = arg1->z + ((Math_Rand_ZeroOne() - 0.5f) * arg2);
@@ -3613,17 +3244,16 @@ void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s1
var = (s16)((Math_Rand_ZeroOne() * arg4) * 0.2f) + arg4;
var2 = arg6;
- if (var2 != 0)
+ if (var2 != 0) {
func_800286CC(globalCtx, &sp94, &sp88, &sp7C, var, arg5);
- else
+ } else {
func_8002865C(globalCtx, &sp94, &sp88, &sp7C, var, arg5);
+ }
}
}
-Actor* func_80033640(GlobalContext* globalCtx, Collider* collider)
-{
- if ((collider->collideFlags & 0x2) && (collider->ac->type == ACTORTYPE_EXPLOSIVES))
- {
+Actor* func_80033640(GlobalContext* globalCtx, Collider* collider) {
+ if ((collider->collideFlags & 0x2) && (collider->ac->type == ACTORTYPE_EXPLOSIVES)) {
collider->collideFlags &= ~0x2;
return collider->ac;
}
@@ -3631,22 +3261,18 @@ Actor* func_80033640(GlobalContext* globalCtx, Collider* collider)
return NULL;
}
-Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor)
-{
+Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor) {
Actor* actor = globalCtx->actorCtx.actorList[ACTORTYPE_EXPLOSIVES].first;
- while (actor != NULL)
- {
- if ((actor == explosiveActor) || (actor->params != 1))
- {
+ while (actor != NULL) {
+ if ((actor == explosiveActor) || (actor->params != 1)) {
actor = actor->next;
- }
- else
- {
- if (func_8002DB48(explosiveActor, actor) <= (actor->shape.rot.z * 10) + 80.0f)
+ } else {
+ if (func_8002DB48(explosiveActor, actor) <= (actor->shape.rot.z * 10) + 80.0f) {
return actor;
- else
+ } else {
actor = actor->next;
+ }
}
}
@@ -3657,21 +3283,18 @@ Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor)
* Dynamically changes the type of a given actor instance.
* This is done by moving it to the corresponding type list and setting its type variable accordingly.
*/
-void Actor_ChangeType(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorType)
-{
+void Actor_ChangeType(GlobalContext* globalCtx, ActorContext* actorCtx, Actor* actor, u8 actorType) {
Actor_RemoveFromTypeList(globalCtx, actorCtx, actor);
Actor_AddToTypeList(actorCtx, actor, actorType);
}
-typedef struct
-{
- /* 0x000 */ Actor actor;
- /* 0x14C */ char unk_14C[0xC4];
- /* 0x210 */ s16 unk_210;
+typedef struct {
+ /* 0x000 */ Actor actor;
+ /* 0x14C */ char unk_14C[0xC4];
+ /* 0x210 */ s16 unk_210;
} Actor_80033780;
-Actor_80033780* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg2)
-{
+Actor_80033780* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg2) {
Actor_80033780* itemActor;
Vec3f spA8;
f32 deltaX;
@@ -3682,19 +3305,15 @@ Actor_80033780* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg
Actor* actor;
actor = globalCtx->actorCtx.actorList[ACTORTYPE_ITEMACTION].first;
- while (actor != NULL)
- {
- if (((actor->id != ACTOR_ARMS_HOOK) && (actor->id != ACTOR_EN_ARROW)) || (actor == refActor))
+ while (actor != NULL) {
+ if (((actor->id != ACTOR_ARMS_HOOK) && (actor->id != ACTOR_EN_ARROW)) || (actor == refActor)) {
actor = actor->next;
- else
- {
+ } else {
itemActor = (Actor_80033780*)actor;
- if ((arg2 < Math_Vec3f_DistXYZ(&refActor->posRot.pos, &itemActor->actor.posRot.pos)) || (itemActor->unk_210 == 0))
- {
+ if ((arg2 < Math_Vec3f_DistXYZ(&refActor->posRot.pos, &itemActor->actor.posRot.pos)) ||
+ (itemActor->unk_210 == 0)) {
actor = actor->next;
- }
- else
- {
+ } else {
deltaX = Math_Sins(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f);
deltaY = itemActor->actor.velocity.y + (itemActor->actor.gravity * 10.0f);
deltaZ = Math_Coss(itemActor->actor.posRot.rot.y) * (itemActor->actor.speedXZ * 10.0f);
@@ -3703,11 +3322,12 @@ Actor_80033780* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg
spA8.y = itemActor->actor.posRot.pos.y + deltaY;
spA8.z = itemActor->actor.posRot.pos.z + deltaZ;
- if (func_80062ECC(refActor->sub_98.unk_10, refActor->sub_98.unk_12, 0.0f,
- &refActor->posRot.pos, &itemActor->actor.posRot.pos, &spA8, &sp90, &sp84))
+ if (func_80062ECC(refActor->sub_98.unk_10, refActor->sub_98.unk_12, 0.0f, &refActor->posRot.pos,
+ &itemActor->actor.posRot.pos, &spA8, &sp90, &sp84)) {
return itemActor;
- else
+ } else {
actor = actor->next;
+ }
}
}
}
@@ -3718,12 +3338,10 @@ Actor_80033780* func_80033780(GlobalContext* globalCtx, Actor* refActor, f32 arg
/**
* Sets the actor's text id with a dynamic prefix based on the current scene.
*/
-void Actor_SetTextWithPrefix(GlobalContext* globalCtx, Actor* actor, s16 baseTextId)
-{
+void Actor_SetTextWithPrefix(GlobalContext* globalCtx, Actor* actor, s16 baseTextId) {
s16 prefix;
- switch (globalCtx->sceneNum)
- {
+ switch (globalCtx->sceneNum) {
case SCENE_YDAN:
case SCENE_YDAN_BOSS:
case SCENE_MORIBOSSROOM:
@@ -3797,8 +3415,7 @@ void Actor_SetTextWithPrefix(GlobalContext* globalCtx, Actor* actor, s16 baseTex
actor->textId = prefix | baseTextId;
}
-s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3)
-{
+s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3) {
s16 ret;
s16 sp44;
f32 sp40;
@@ -3820,36 +3437,32 @@ s16 func_800339B8(Actor* actor, GlobalContext* globalCtx, f32 arg2, s16 arg3)
return ret;
}
-s32 func_80033A84(GlobalContext* globalCtx, Actor* actor)
-{
+s32 func_80033A84(GlobalContext* globalCtx, Actor* actor) {
Player* player = PLAYER;
- if ((player->stateFlags1 & 0x10) && (actor->unk_10C != 0))
+ if ((player->stateFlags1 & 0x10) && (actor->unk_10C != 0)) {
return 1;
- else
+ } else {
return 0;
+ }
}
-s32 func_80033AB8(GlobalContext* globalCtx, Actor* actor)
-{
+s32 func_80033AB8(GlobalContext* globalCtx, Actor* actor) {
Player* player = PLAYER;
- if ((player->stateFlags1 & 0x10) && (actor->unk_10C == 0))
+ if ((player->stateFlags1 & 0x10) && (actor->unk_10C == 0)) {
return 1;
- else
+ } else {
return 0;
+ }
}
-f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5)
-{
+f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) {
f32 ret = 0.0f;
- if (arg4 <= Math_Vec3f_DistXYZ(arg0, arg1))
- {
+ if (arg4 <= Math_Vec3f_DistXYZ(arg0, arg1)) {
ret = Math_SmoothScaleMaxMinF(&arg1->x, arg0->x, arg2, arg3, 0.0f);
ret += Math_SmoothScaleMaxMinF(&arg1->y, arg0->y, arg2, arg3, 0.0f);
ret += Math_SmoothScaleMaxMinF(&arg1->z, arg0->z, arg2, arg3, 0.0f);
- }
- else if (arg5 < Math_Vec3f_DistXYZ(arg0, arg1))
- {
+ } else if (arg5 < Math_Vec3f_DistXYZ(arg0, arg1)) {
ret = Math_SmoothScaleMaxMinF(&arg1->x, arg0->x, arg2, arg3, 0.0f);
ret += Math_SmoothScaleMaxMinF(&arg1->y, arg0->y, arg2, arg3, 0.0f);
ret += Math_SmoothScaleMaxMinF(&arg1->z, arg0->z, arg2, arg3, 0.0f);
@@ -3858,8 +3471,7 @@ f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar
return ret;
}
-void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx)
-{
+void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx) {
MtxF sp60;
f32 var;
Vec3f sp50;
@@ -3869,7 +3481,7 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx)
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8120);
- if (0) ; // Necessary to match
+ if (0) {} // Necessary to match
gfxCtx->polyOpa.p = func_80093774(gfxCtx->polyOpa.p, 0x2C);
@@ -3881,60 +3493,55 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx)
var = func_8003C8EC(globalCtx, &globalCtx->colCtx, &sp4C, &sp50);
- if (sp4C != NULL)
- {
+ if (sp4C != NULL) {
func_80038A28(sp4C, arg0->x, var, arg0->z, &sp60);
Matrix_Put(&sp60);
- }
- else
+ } else {
Matrix_Translate(arg0->x, arg0->y, arg0->z, MTXMODE_NEW);
+ }
Matrix_Scale(arg1->x, 1.0f, arg1->z, MTXMODE_APPLY);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8149), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8149),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_04049210);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8155);
}
-void func_80033DB8(GlobalContext* globalCtx, s16 arg1, s16 arg2)
-{
+void func_80033DB8(GlobalContext* globalCtx, s16 arg1, s16 arg2) {
s16 var = func_80092F88(&globalCtx->cameraCtx.activeCameras[0], 3);
func_80092DAC(var, 20000);
func_80092E70(var, arg1, 0, 0, 0);
func_80092DF0(var, arg2);
}
-void func_80033E1C(GlobalContext* globalCtx, s16 arg1, s16 arg2, s16 arg3)
-{
+void func_80033E1C(GlobalContext* globalCtx, s16 arg1, s16 arg2, s16 arg3) {
s16 var = func_80092F88(&globalCtx->cameraCtx.activeCameras[0], 3);
func_80092DAC(var, arg3);
func_80092E70(var, arg1, 0, 0, 0);
func_80092DF0(var, arg2);
}
-void func_80033E88(Actor* actor, GlobalContext* globalCtx, s16 arg2, s16 arg3)
-{
- if (arg2 >= 5)
+void func_80033E88(Actor* actor, GlobalContext* globalCtx, s16 arg2, s16 arg3) {
+ if (arg2 >= 5) {
func_800AA000(actor->waterSurfaceDist, 0xFF, 0x14, 0x96);
- else
+ } else {
func_800AA000(actor->waterSurfaceDist, 0xB4, 0x14, 0x64);
+ }
func_80033DB8(globalCtx, arg2, arg3);
}
-f32 Math_Rand_ZeroFloat(f32 f)
-{
+f32 Math_Rand_ZeroFloat(f32 f) {
return Math_Rand_ZeroOne() * f;
}
-f32 Math_Rand_CenteredFloat(f32 f)
-{
+f32 Math_Rand_CenteredFloat(f32 f) {
return (Math_Rand_ZeroOne() - 0.5f) * f;
}
-typedef struct
-{
+typedef struct {
/* 0x00 */ f32 unk_00;
/* 0x04 */ f32 unk_04;
/* 0x08 */ f32 unk_08;
@@ -3944,15 +3551,13 @@ typedef struct
/* 0x18 */ u32 unk_18;
} struct_801160DC; // size = 0x1C
-struct_801160DC D_801160DC[3] =
-{
- { 0.54f, 6000.0f, 5000.0f, 1.0f, 0.0f, 0x050011F0, 0x05001100 },
- { 0.644f, 12000.0f, 8000.0f, 1.0f, 0.0f, 0x06001530, 0x06001400 },
- { 0.64000005f, 8500.0f, 8000.0f, 1.75f, 0.1f, 0x050011F0, 0x05001100 },
+struct_801160DC D_801160DC[3] = {
+ { 0.54f, 6000.0f, 5000.0f, 1.0f, 0.0f, 0x050011F0, 0x05001100 },
+ { 0.644f, 12000.0f, 8000.0f, 1.0f, 0.0f, 0x06001530, 0x06001400 },
+ { 0.64000005f, 8500.0f, 8000.0f, 1.75f, 0.1f, 0x050011F0, 0x05001100 },
};
-void func_80033F54(GlobalContext* globalCtx, s32 arg1, s32 arg2)
-{
+void func_80033F54(GlobalContext* globalCtx, s32 arg1, s32 arg2) {
struct_801160DC* entry;
s32 i;
MtxF spB0;
@@ -3975,22 +3580,24 @@ void func_80033F54(GlobalContext* globalCtx, s32 arg1, s32 arg2)
temp1 = sinf(entry->unk_00 - var) * -(10 - arg1) * 0.1f * entry->unk_04;
temp2 = cosf(entry->unk_00 - var) * (10 - arg1) * 0.1f * entry->unk_04;
- for (i = 0; i < 4; i++)
- {
+ for (i = 0; i < 4; i++) {
Matrix_Put(&spB0);
Matrix_RotateZ(var, MTXMODE_APPLY);
Matrix_Translate(temp1, temp2, 0.0f, MTXMODE_APPLY);
- if (entry->unk_0C != 1.0f)
+ if (entry->unk_0C != 1.0f) {
Matrix_Scale(entry->unk_0C, entry->unk_0C, entry->unk_0C, MTXMODE_APPLY);
+ }
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8299), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8299),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, entry->unk_14);
- if (i % 2)
+ if (i % 2) {
temp3 = entry->unk_00 + entry->unk_00;
- else
+ } else {
temp3 = M_PI - (entry->unk_00 + entry->unk_00);
+ }
var += temp3;
}
@@ -3998,28 +3605,27 @@ void func_80033F54(GlobalContext* globalCtx, s32 arg1, s32 arg2)
Matrix_Put(&spB0);
Matrix_Scale(arg1 * 0.1f, arg1 * 0.1f, arg1 * 0.1f, MTXMODE_APPLY);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8314), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 8314),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, entry->unk_18);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8319);
}
-void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1)
-{
+void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1) {
func_80062D60(globalCtx, arg1);
}
-void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4)
-{
- if ((arg1 == 0x8000) && !(arg2 & 0x8000))
+void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4) {
+ if ((arg1 == 0x8000) && !(arg2 & 0x8000)) {
Audio_PlayActorSound2(actor, NA_SE_EN_LIGHT_ARROW_HIT);
+ }
actor->unk_112 = arg1 | arg3 | ((arg2 & 0xF8) << 5) | arg4;
actor->unk_114 = arg4;
}
-Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx)
-{
+Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) {
Vec3f lightDir;
lightDir.x = globalCtx->unk_10A4E;
@@ -4029,8 +3635,7 @@ Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx)
return func_8002EABC(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
}
-Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx)
-{
+Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx) {
Vec3f lightDir;
lightDir.x = globalCtx->unk_10A4E;
@@ -4040,91 +3645,87 @@ Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx)
return func_8002EB44(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
}
-s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*), s16 (*unkFunc2)(GlobalContext*, Actor*))
-{
+s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*),
+ s16 (*unkFunc2)(GlobalContext*, Actor*)) {
s16 sp26;
s16 sp24;
- if (func_8002F194(actor, globalCtx))
- {
+ if (func_8002F194(actor, globalCtx)) {
*arg2 = 1;
return 1;
}
- if (*arg2 != 0)
- {
+ if (*arg2 != 0) {
*arg2 = unkFunc2(globalCtx, actor);
return 0;
}
func_8002F374(globalCtx, actor, &sp26, &sp24);
- if ((sp26 < 0) || (sp26 > 0x140) || (sp24 < 0) || (sp24 > 0xF0))
+ if ((sp26 < 0) || (sp26 > 0x140) || (sp24 < 0) || (sp24 > 0xF0)) {
return 0;
+ }
- if (!func_8002F2CC(actor, globalCtx, arg3))
+ if (!func_8002F2CC(actor, globalCtx, arg3)) {
return 0;
+ }
actor->textId = unkFunc1(globalCtx, actor);
return 0;
}
-typedef struct
-{
- /* 0x00 */ s16 unk_00;
- /* 0x02 */ s16 unk_02;
- /* 0x04 */ s16 unk_04;
- /* 0x06 */ s16 unk_06;
- /* 0x08 */ s16 unk_08;
- /* 0x0A */ s16 unk_0A;
+typedef struct {
+ /* 0x00 */ s16 unk_00;
+ /* 0x02 */ s16 unk_02;
+ /* 0x04 */ s16 unk_04;
+ /* 0x06 */ s16 unk_06;
+ /* 0x08 */ s16 unk_08;
+ /* 0x0A */ s16 unk_0A;
/* 0x0C */ char unk_0C[0x2];
- /* 0x0E */ s16 unk_0E;
- /* 0x10 */ s16 unk_10;
+ /* 0x0E */ s16 unk_0E;
+ /* 0x10 */ s16 unk_10;
/* 0x12 */ char unk_12[0x2];
- /* 0x14 */ f32 unk_14;
+ /* 0x14 */ f32 unk_14;
/* 0x18 */ Vec3f unk_18;
} struct_80034A14_arg1;
-typedef struct
-{
- /* 0x00 */ s16 unk_00;
- /* 0x02 */ s16 unk_02;
- /* 0x04 */ s16 unk_04;
- /* 0x06 */ s16 unk_06;
- /* 0x08 */ s16 unk_08;
- /* 0x0A */ s16 unk_0A;
- /* 0x0C */ u8 unk_0C;
+typedef struct {
+ /* 0x00 */ s16 unk_00;
+ /* 0x02 */ s16 unk_02;
+ /* 0x04 */ s16 unk_04;
+ /* 0x06 */ s16 unk_06;
+ /* 0x08 */ s16 unk_08;
+ /* 0x0A */ s16 unk_0A;
+ /* 0x0C */ u8 unk_0C;
} struct_80116130_0; // size = 0x10
-typedef struct
-{
+typedef struct {
/* 0x00 */ struct_80116130_0 sub_00;
- /* 0x10 */ f32 unk_10;
- /* 0x14 */ s16 unk_14;
+ /* 0x10 */ f32 unk_10;
+ /* 0x14 */ s16 unk_14;
} struct_80116130; // size = 0x18
-struct_80116130 D_80116130[13] =
-{
+struct_80116130 D_80116130[13] = {
{ { 0x2AA8, 0xF1C8, 0x18E2, 0x1554, 0x0000, 0x0000, 1 }, 170.0f, 0x3FFC },
{ { 0x2AA8, 0xEAAC, 0x1554, 0x1554, 0xF8E4, 0x0E38, 1 }, 170.0f, 0x3FFC },
{ { 0x31C4, 0xE390, 0x0E38, 0x0E38, 0xF1C8, 0x071C, 1 }, 170.0f, 0x3FFC },
{ { 0x1554, 0xF1C8, 0x0000, 0x071C, 0xF8E4, 0x0000, 1 }, 170.0f, 0x3FFC },
{ { 0x2AA8, 0xF8E4, 0x071C, 0x0E38, 0xD558, 0x2AA8, 1 }, 170.0f, 0x3FFC },
{ { 0x0000, 0xE390, 0x2AA8, 0x3FFC, 0xF1C8, 0x0E38, 1 }, 170.0f, 0x3FFC },
- { { 0x2AA8, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 },
- { { 0x2AA8, 0xF1C8, 0x0000, 0x0E38, 0x0000, 0x1C70, 1 }, 0.0f, 0x0000 },
- { { 0x2AA8, 0xF1C8, 0xF1C8, 0x0000, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 },
- { { 0x071C, 0xF1C8, 0x0E38, 0x1C70, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 },
- { { 0x0E38, 0xF1C8, 0x0000, 0x1C70, 0x0000, 0x0E38, 1 }, 0.0f, 0x0000 },
- { { 0x2AA8, 0xE390, 0x1C70, 0x0E38, 0xF1C8, 0x0E38, 1 }, 0.0f, 0x0000 },
- { { 0x18E2, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 },
+ { { 0x2AA8, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 },
+ { { 0x2AA8, 0xF1C8, 0x0000, 0x0E38, 0x0000, 0x1C70, 1 }, 0.0f, 0x0000 },
+ { { 0x2AA8, 0xF1C8, 0xF1C8, 0x0000, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 },
+ { { 0x071C, 0xF1C8, 0x0E38, 0x1C70, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 },
+ { { 0x0E38, 0xF1C8, 0x0000, 0x1C70, 0x0000, 0x0E38, 1 }, 0.0f, 0x0000 },
+ { { 0x2AA8, 0xE390, 0x1C70, 0x0E38, 0xF1C8, 0x0E38, 1 }, 0.0f, 0x0000 },
+ { { 0x18E2, 0xF1C8, 0x0E38, 0x0E38, 0x0000, 0x0000, 1 }, 0.0f, 0x0000 },
};
#ifdef NON_MATCHING
// this function still needs a lot of work
-void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7, u8 arg8)
-{
+void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7,
+ u8 arg8) {
s16 sp46;
s16 sp44;
s16 temp1;
@@ -4166,25 +3767,24 @@ void func_800344BC(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3,
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_800344BC.s")
#endif
-s16 func_800347E8(s16 arg0)
-{
+s16 func_800347E8(s16 arg0) {
return D_80116130[arg0].unk_14;
}
-s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3, s16 arg4)
-{
+s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3, s16 arg4) {
s32 pad;
s16 var;
s16 abs_var;
- if (arg4 != 0)
+ if (arg4 != 0) {
return arg4;
+ }
- if (arg1->unk_00 != 0)
+ if (arg1->unk_00 != 0) {
return 4;
+ }
- if (arg2 < Math_Vec3f_DistXYZ(&actor->posRot.pos, &arg1->unk_18))
- {
+ if (arg2 < Math_Vec3f_DistXYZ(&actor->posRot.pos, &arg1->unk_18)) {
arg1->unk_04 = 0;
arg1->unk_06 = 0;
return 1;
@@ -4192,18 +3792,17 @@ s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3,
var = Math_Vec3f_Yaw(&actor->posRot.pos, &arg1->unk_18);
abs_var = ABS((s16)((f32)var - actor->shape.rot.y));
- if (arg3 >= abs_var)
- {
+ if (arg3 >= abs_var) {
arg1->unk_04 = 0;
arg1->unk_06 = 0;
return 2;
}
- if (DECR(arg1->unk_04) != 0)
+ if (DECR(arg1->unk_04) != 0) {
return arg1->unk_02;
+ }
- switch (arg1->unk_06)
- {
+ switch (arg1->unk_06) {
case 0:
case 2:
arg1->unk_04 = Math_Rand_S16Offset(30, 30);
@@ -4218,16 +3817,14 @@ s16 func_80034810(Actor* actor, struct_80034A14_arg1* arg1, f32 arg2, s16 arg3,
return 4;
}
-void func_80034A14(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3)
-{
+void func_80034A14(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3) {
struct_80116130_0 sp38;
arg1->unk_02 = func_80034810(actor, arg1, D_80116130[arg2].unk_10, D_80116130[arg2].unk_14, arg3);
sp38 = D_80116130[arg2].sub_00;
- switch (arg1->unk_02)
- {
+ switch (arg1->unk_02) {
case 1:
sp38.unk_00 = 0;
sp38.unk_04 = 0;
@@ -4240,12 +3837,11 @@ void func_80034A14(Actor* actor, struct_80034A14_arg1* arg1, s16 arg2, s16 arg3)
sp38.unk_0C = 0;
}
- func_800344BC(actor, arg1, sp38.unk_00, sp38.unk_04, sp38.unk_02,
- sp38.unk_06, sp38.unk_0A, sp38.unk_08, sp38.unk_0C);
+ func_800344BC(actor, arg1, sp38.unk_00, sp38.unk_04, sp38.unk_02, sp38.unk_06, sp38.unk_0A, sp38.unk_08,
+ sp38.unk_0C);
}
-Gfx* func_80034B28(GraphicsContext* gfxCtx)
-{
+Gfx* func_80034B28(GraphicsContext* gfxCtx) {
Gfx* displayList;
displayList = Graph_Alloc(gfxCtx, sizeof(Gfx));
@@ -4256,8 +3852,7 @@ Gfx* func_80034B28(GraphicsContext* gfxCtx)
#ifdef NON_MATCHING
// doesn't generate the 2 useless move instructions before returning
-Gfx* func_80034B54(GraphicsContext* gfxCtx)
-{
+Gfx* func_80034B54(GraphicsContext* gfxCtx) {
Gfx* displayList;
Gfx* displayListHead;
@@ -4265,10 +3860,10 @@ Gfx* func_80034B54(GraphicsContext* gfxCtx)
displayListHead = displayList;
gDPSetRenderMode(displayListHead++,
- AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
- GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA),
- AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
- GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
+ GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA),
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
+ GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
gSPEndDisplayList(displayListHead);
@@ -4278,8 +3873,8 @@ Gfx* func_80034B54(GraphicsContext* gfxCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_80034B54.s")
#endif
-void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha)
-{
+void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor,
+ s16 alpha) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4];
@@ -4292,14 +3887,14 @@ void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc
gDPPipeSync(gfxCtx->polyOpa.p++);
gSPSegment(gfxCtx->polyOpa.p++, 0x0C, func_80034B28(globalCtx->state.gfxCtx));
- gfxCtx->polyOpa.p = func_800A273C(globalCtx, skelAnime->limbIndex, skelAnime->actorDrawTbl,
- skelAnime->dListCount, unkFunc1, unkFunc2, actor, gfxCtx->polyOpa.p);
+ gfxCtx->polyOpa.p = func_800A273C(globalCtx, skelAnime->limbIndex, skelAnime->actorDrawTbl, skelAnime->dListCount,
+ unkFunc1, unkFunc2, actor, gfxCtx->polyOpa.p);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8860);
}
-void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha)
-{
+void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor,
+ s16 alpha) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4];
@@ -4311,29 +3906,26 @@ void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc
gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x00, 0x00, 0x00, alpha);
gSPSegment(gfxCtx->polyXlu.p++, 0x0C, func_80034B54(globalCtx->state.gfxCtx));
- gfxCtx->polyXlu.p = func_800A273C(globalCtx, skelAnime->limbIndex, skelAnime->actorDrawTbl,
- skelAnime->dListCount, unkFunc1, unkFunc2, actor, gfxCtx->polyXlu.p);
+ gfxCtx->polyXlu.p = func_800A273C(globalCtx, skelAnime->limbIndex, skelAnime->actorDrawTbl, skelAnime->dListCount,
+ unkFunc1, unkFunc2, actor, gfxCtx->polyXlu.p);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_actor.c", 8904);
}
-s16 func_80034DD4(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3)
-{
+s16 func_80034DD4(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) {
Player* player = PLAYER;
f32 var;
- if ((globalCtx->csCtx.state != 0) || (D_8011D394 != 0))
+ if ((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) {
var = Math_Vec3f_DistXYZ(&actor->posRot.pos, &globalCtx->view.eye) * 0.25f;
- else
+ } else {
var = Math_Vec3f_DistXYZ(&actor->posRot.pos, &player->actor.posRot.pos);
+ }
- if (arg3 < var)
- {
+ if (arg3 < var) {
actor->flags &= ~1;
Math_SmoothScaleMaxMinS(&arg2, 0, 6, 0x14, 1);
- }
- else
- {
+ } else {
actor->flags |= 1;
Math_SmoothScaleMaxMinS(&arg2, 0xFF, 6, 0x14, 1);
}
@@ -4341,67 +3933,53 @@ s16 func_80034DD4(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3)
return arg2;
}
-void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2)
-{
+void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2) {
f32 frameCount;
arg1 += arg2;
- if (arg1->frameCount > 0.0f)
+ if (arg1->frameCount > 0.0f) {
frameCount = arg1->frameCount;
- else
+ } else {
frameCount = SkelAnime_GetFrameCount(arg1->animation);
+ }
- SkelAnime_ChangeAnimation(skelAnime, arg1->animation, arg1->playbackSpeed,
- arg1->unk_08, frameCount, arg1->unk_10, arg1->transitionRate);
+ SkelAnime_ChangeAnimation(skelAnime, arg1->animation, arg1->playbackSpeed, arg1->unk_08, frameCount, arg1->unk_10,
+ arg1->transitionRate);
}
-void func_80034F54(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3)
-{
+void func_80034F54(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3) {
u32 frames = globalCtx->gameplayFrames;
s32 i;
- for (i = 0; i < arg3; i++)
- {
+ for (i = 0; i < arg3; i++) {
arg1[i] = (0x814 + 50 * i) * frames;
arg2[i] = (0x940 + 50 * i) * frames;
}
}
-void Actor_Noop(Actor* actor, GlobalContext* globalCtx)
-{
-
+void Actor_Noop(Actor* actor, GlobalContext* globalCtx) {
}
-s32 func_80035124(Actor* actor, GlobalContext* globalCtx)
-{
+s32 func_80035124(Actor* actor, GlobalContext* globalCtx) {
s32 ret = 0;
- switch (actor->params)
- {
+ switch (actor->params) {
case 0:
- if (func_8002F410(actor, globalCtx))
- {
+ if (func_8002F410(actor, globalCtx)) {
actor->params = 1;
- }
- else if (!(actor->bgCheckFlags & 1))
- {
+ } else if (!(actor->bgCheckFlags & 1)) {
Actor_MoveForward(actor);
Math_SmoothScaleMaxMinF(&actor->speedXZ, 0.0f, 1.0f, 0.1f, 0.0f);
- }
- else if ((actor->bgCheckFlags & 2) && (actor->velocity.y < -4.0f))
- {
+ } else if ((actor->bgCheckFlags & 2) && (actor->velocity.y < -4.0f)) {
ret = 1;
- }
- else
- {
+ } else {
actor->shape.rot.x = actor->shape.rot.z = 0;
func_8002F580(actor, globalCtx);
}
break;
case 1:
- if (func_8002F5A0(actor, globalCtx))
- {
+ if (func_8002F5A0(actor, globalCtx)) {
actor->params = 0;
}
break;
@@ -4414,8 +3992,7 @@ s32 func_80035124(Actor* actor, GlobalContext* globalCtx)
#include "z_cheap_proc.c"
-u8 func_800353E8(GlobalContext* globalCtx)
-{
+u8 func_800353E8(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->unk_845;
}
@@ -4424,30 +4001,25 @@ u8 func_800353E8(GlobalContext* globalCtx)
* Finds the first actor instance of a specified id and type within a given range from an actor if there is one.
* If the id provided is -1, this will look for any actor of the specified type rather than a specific id.
*/
-Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range)
-{
+Actor* Actor_FindNearby(GlobalContext* globalCtx, Actor* refActor, s16 actorId, u8 actorType, f32 range) {
Actor* actor = globalCtx->actorCtx.actorList[actorType].first;
- while (actor != NULL)
- {
- if (actor == refActor || ((actorId != -1) && (actorId != actor->id)))
- {
+ while (actor != NULL) {
+ if (actor == refActor || ((actorId != -1) && (actorId != actor->id))) {
actor = actor->next;
- }
- else
- {
- if (func_8002DB48(refActor, actor) <= range)
+ } else {
+ if (func_8002DB48(refActor, actor) <= range) {
return actor;
- else
+ } else {
actor = actor->next;
+ }
}
}
return NULL;
}
-s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5)
-{
+s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s16 arg4, s16 arg5) {
Player* player = PLAYER;
s16 var1;
s16 var2;
@@ -4455,15 +4027,15 @@ s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s
var1 = (s16)(actor->rotTowardsLinkY + 0x8000) - player->actor.shape.rot.y;
var2 = actor->rotTowardsLinkY - arg5;
- if ((actor->xzDistanceFromLink <= range) && (player->swordState != 0) &&
- (arg4 >= ABS(var1)) && (arg3 >= ABS(var2)))
+ if ((actor->xzDistanceFromLink <= range) && (player->swordState != 0) && (arg4 >= ABS(var1)) &&
+ (arg3 >= ABS(var2))) {
return 1;
- else
+ } else {
return 0;
+ }
}
-void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3)
-{
+void func_8003555C(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3) {
Color_RGB8 color1;
Color_RGB8 color2;
@@ -4482,150 +4054,107 @@ Vec3f D_80116268 = { 0.0f, -1.5f, 0.0f };
Vec3f D_80116274 = { 0.0f, -0.2f, 0.0f };
// unused
-Gfx D_80116280[] =
-{
- gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG |
- CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
- GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA),
- AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG |
- CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
- GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)),
+Gfx D_80116280[] = {
+ gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
+ GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA),
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
+ GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)),
gsDPSetAlphaCompare(G_AC_THRESHOLD),
gsSPEndDisplayList(),
};
-void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1)
-{
+void func_800355B8(GlobalContext* globalCtx, Vec3f* arg1) {
func_8003555C(globalCtx, arg1, &D_80116268, &D_80116274);
}
-u8 func_800355E4(GlobalContext* globalCtx, ColliderCylinderInit* colCylinderInit)
-{
+u8 func_800355E4(GlobalContext* globalCtx, ColliderCylinderInit* colCylinderInit) {
Player* player = PLAYER;
- if ((colCylinderInit->inner.toucherDamage & 0x08) && (player->swordState != 0) && (player->swordAnimation == 0x16))
+ if ((colCylinderInit->inner.toucherDamage & 0x08) && (player->swordState != 0) &&
+ (player->swordAnimation == 0x16)) {
return 1;
- else
+ } else {
return 0;
+ }
}
-u8 Actor_ApplyDamage(Actor* actor)
-{
- if (actor->sub_98.damage >= actor->sub_98.health)
+u8 Actor_ApplyDamage(Actor* actor) {
+ if (actor->sub_98.damage >= actor->sub_98.health) {
actor->sub_98.health = 0;
- else
+ } else {
actor->sub_98.health -= actor->sub_98.damage;
+ }
return actor->sub_98.health;
}
-void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag)
-{
- if (colBody->colliding == NULL)
- {
+void func_80035650(Actor* actor, ColliderBody* colBody, s32 freezeFlag) {
+ if (colBody->colliding == NULL) {
actor->unk_116 = 0x00;
- }
- else if (freezeFlag && (colBody->colliding->toucher.flags & 0x10060000))
- {
+ } else if (freezeFlag && (colBody->colliding->toucher.flags & 0x10060000)) {
actor->freeze = colBody->colliding->toucher.damage;
actor->unk_116 = 0x00;
- }
- else if (colBody->colliding->toucher.flags & 0x0800)
- {
+ } else if (colBody->colliding->toucher.flags & 0x0800) {
actor->unk_116 = 0x01;
- }
- else if (colBody->colliding->toucher.flags & 0x1000)
- {
+ } else if (colBody->colliding->toucher.flags & 0x1000) {
actor->unk_116 = 0x02;
- }
- else if (colBody->colliding->toucher.flags & 0x4000)
- {
+ } else if (colBody->colliding->toucher.flags & 0x4000) {
actor->unk_116 = 0x04;
- }
- else if (colBody->colliding->toucher.flags & 0x8000)
- {
+ } else if (colBody->colliding->toucher.flags & 0x8000) {
actor->unk_116 = 0x08;
- }
- else if ((colBody->colliding->toucher.flags << 0xF) < 0)
- {
+ } else if ((colBody->colliding->toucher.flags << 0xF) < 0) {
actor->unk_116 = 0x10;
- }
- else if (colBody->colliding->toucher.flags & 0x2000)
- {
+ } else if (colBody->colliding->toucher.flags & 0x2000) {
actor->unk_116 = 0x20;
- }
- else if ((colBody->colliding->toucher.flags << 0xC) < 0)
- {
- if (freezeFlag)
+ } else if ((colBody->colliding->toucher.flags << 0xC) < 0) {
+ if (freezeFlag) {
actor->freeze = colBody->colliding->toucher.damage;
+ }
actor->unk_116 = 0x40;
- }
- else
- {
+ } else {
actor->unk_116 = 0x00;
}
}
-void func_8003573C(Actor* actor, ColliderBody* colBody, s32 freezeFlag)
-{
+void func_8003573C(Actor* actor, ColliderBody* colBody, s32 freezeFlag) {
ColliderBody* curColBody;
s32 flag;
s32 i;
actor->unk_116 = 0x00;
- for (i = colBody->unk_18 - 1; i >= 0; i--)
- {
+ for (i = colBody->unk_18 - 1; i >= 0; i--) {
curColBody = &colBody->colBuf[i].c;
- if (curColBody->colliding == NULL)
- {
+ if (curColBody->colliding == NULL) {
flag = 0x00;
- }
- else if (freezeFlag && (curColBody->colliding->toucher.flags & 0x10060000))
- {
+ } else if (freezeFlag && (curColBody->colliding->toucher.flags & 0x10060000)) {
actor->freeze = curColBody->colliding->toucher.damage;
flag = 0x00;
- }
- else if (curColBody->colliding->toucher.flags & 0x0800)
- {
+ } else if (curColBody->colliding->toucher.flags & 0x0800) {
flag = 0x01;
- }
- else if (curColBody->colliding->toucher.flags & 0x1000)
- {
+ } else if (curColBody->colliding->toucher.flags & 0x1000) {
flag = 0x02;
- }
- else if (curColBody->colliding->toucher.flags & 0x4000)
- {
+ } else if (curColBody->colliding->toucher.flags & 0x4000) {
flag = 0x04;
- }
- else if (curColBody->colliding->toucher.flags & 0x8000)
- {
+ } else if (curColBody->colliding->toucher.flags & 0x8000) {
flag = 0x08;
- }
- else if (curColBody->colliding->toucher.flags & 0x10000)
- {
+ } else if (curColBody->colliding->toucher.flags & 0x10000) {
flag = 0x10;
- }
- else if (curColBody->colliding->toucher.flags & 0x2000)
- {
+ } else if (curColBody->colliding->toucher.flags & 0x2000) {
flag = 0x20;
- }
- else if (curColBody->colliding->toucher.flags & 0x80000)
- {
- if (freezeFlag)
+ } else if (curColBody->colliding->toucher.flags & 0x80000) {
+ if (freezeFlag) {
actor->freeze = curColBody->colliding->toucher.damage;
+ }
flag = 0x40;
- }
- else
- {
+ } else {
flag = 0x00;
}
actor->unk_116 |= flag;
}
}
-void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3)
-{
+void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3) {
f32 dx = arg1->x - arg0->x;
f32 dz = arg1->z - arg0->z;
f32 dy = arg3 ? (arg1->y - arg0->y) : (arg0->y - arg1->y);
@@ -4637,17 +4166,14 @@ void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3)
/**
* Spawns En_Part (Dissipating Flames) actor attached to the given actor.
*/
-ActorEnPart* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, Vec3f* arg3, s32 arg4,
- s32 unused, GlobalContext* globalCtx, s16 params, s32 arg8)
-{
+ActorEnPart* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, Vec3f* arg3, s32 arg4, s32 unused,
+ GlobalContext* globalCtx, s16 params, s32 arg8) {
ActorEnPart* spawnedEnPart;
spawnedEnPart = (ActorEnPart*)Actor_SpawnAttached(&globalCtx->actorCtx, actor, globalCtx, ACTOR_EN_PART,
- spawnPos->x, spawnPos->y, spawnPos->z,
- spawnRot->x, spawnRot->y, actor->objBankIndex,
- params);
- if (spawnedEnPart != NULL)
- {
+ spawnPos->x, spawnPos->y, spawnPos->z, spawnRot->x, spawnRot->y,
+ actor->objBankIndex, params);
+ if (spawnedEnPart != NULL) {
spawnedEnPart->actor.scale = actor->scale;
spawnedEnPart->actor.speedXZ = arg3->x;
spawnedEnPart->unk_150 = arg8;
@@ -4661,8 +4187,7 @@ ActorEnPart* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, Vec3f
return NULL;
}
-void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2)
-{
+void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2) {
f32 sp44;
f32 sp40;
f32 sp3C;
@@ -4675,8 +4200,7 @@ void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2)
CollisionPoly* floorPoly;
s32 pad;
- if (actor->floorPoly != NULL)
- {
+ if (actor->floorPoly != NULL) {
floorPoly = actor->floorPoly;
sp44 = floorPoly->norm.x * (1.f / 32767);
sp40 = floorPoly->norm.y * (1.f / 32767);
@@ -4694,8 +4218,7 @@ void func_800359B8(Actor* actor, s16 arg1, Vec3s* arg2)
}
}
-void func_80035B18(GlobalContext* globalCtx, Actor* actor, u16 textId)
-{
+void func_80035B18(GlobalContext* globalCtx, Actor* actor, u16 textId) {
func_8010B720(globalCtx, textId);
actor->textId = textId;
}
@@ -4703,496 +4226,458 @@ void func_80035B18(GlobalContext* globalCtx, Actor* actor, u16 textId)
/**
* Tests if event_chk_inf flag is set.
*/
-s32 Flags_GetEventChkInf(s32 flag)
-{
+s32 Flags_GetEventChkInf(s32 flag) {
return gSaveContext.event_chk_inf[flag >> 4] & (1 << (flag & 0xF));
}
/**
* Sets event_chk_inf flag.
*/
-void Flags_SetEventChkInf(s32 flag)
-{
+void Flags_SetEventChkInf(s32 flag) {
gSaveContext.event_chk_inf[flag >> 4] |= (1 << (flag & 0xF));
}
/**
* Tests if inf_table flag is set.
*/
-s32 Flags_GetInfTable(s32 flag)
-{
+s32 Flags_GetInfTable(s32 flag) {
return gSaveContext.inf_table[flag >> 4] & (1 << (flag & 0xF));
}
/**
* Sets inf_table flag.
*/
-void Flags_SetInfTable(s32 flag)
-{
+void Flags_SetInfTable(s32 flag) {
gSaveContext.inf_table[flag >> 4] |= (1 << (flag & 0xF));
}
-u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1)
-{
+u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) {
u16 retTextId = 0;
- switch(arg1)
- {
+ switch (arg1) {
case 0:
- if (Flags_GetEventChkInf(0x9))
- {
- if (Flags_GetInfTable(0x5))
+ if (Flags_GetEventChkInf(0x9)) {
+ if (Flags_GetInfTable(0x5)) {
retTextId = 0x1048;
- else
+ } else {
retTextId = 0x1047;
- }
- else
- {
- if (Flags_GetEventChkInf(0x2))
- {
- if (Flags_GetInfTable(0x3))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x2)) {
+ if (Flags_GetInfTable(0x3)) {
retTextId = 0x1032;
- else
+ } else {
retTextId = 0x1031;
- }
- else
- {
- if (Flags_GetInfTable(0x0))
- {
- if (Flags_GetInfTable(0x1))
+ }
+ } else {
+ if (Flags_GetInfTable(0x0)) {
+ if (Flags_GetInfTable(0x1)) {
retTextId = 0x1003;
- else
+ } else {
retTextId = 0x1002;
- }
- else
+ }
+ } else {
retTextId = 0x1001;
+ }
}
}
break;
case 1:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
- {
- if (Flags_GetInfTable(0x10))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
+ if (Flags_GetInfTable(0x10)) {
retTextId = 0x1046;
- else
+ } else {
retTextId = 0x1045;
- }
- else
- {
- if (Flags_GetEventChkInf(0x3))
- {
- if (Flags_GetInfTable(0xE))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x3)) {
+ if (Flags_GetInfTable(0xE)) {
retTextId = 0x1034;
- else
+ } else {
retTextId = 0x1033;
- }
- else
- {
- if (Flags_GetInfTable(0xC))
+ }
+ } else {
+ if (Flags_GetInfTable(0xC)) {
retTextId = 0x1030;
- else
+ } else {
retTextId = 0x102F;
+ }
}
}
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
- {
- if (Flags_GetInfTable(0x19))
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
+ if (Flags_GetInfTable(0x19)) {
retTextId = 0x1071;
- else
+ } else {
retTextId = 0x1070;
- }
- else
- {
- if (Flags_GetEventChkInf(0xB))
- {
- if (Flags_GetInfTable(0x17))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0xB)) {
+ if (Flags_GetInfTable(0x17)) {
retTextId = 0x1068;
- else
+ } else {
retTextId = 0x1067;
- }
- else
- {
- if (Flags_GetInfTable(0x15))
+ }
+ } else {
+ if (Flags_GetInfTable(0x15)) {
retTextId = 0x1061;
- else
+ } else {
retTextId = 0x1060;
+ }
}
}
}
break;
case 2:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x1042;
- else
+ } else {
retTextId = 0x1004;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x1072;
- else if (Flags_GetInfTable(0x41))
+ } else if (Flags_GetInfTable(0x41)) {
retTextId = 0x1055;
- else
+ } else {
retTextId = 0x1056;
+ }
}
break;
case 3:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x1043;
- else
- {
- if (Flags_GetInfTable(0x1E))
+ } else {
+ if (Flags_GetInfTable(0x1E)) {
retTextId = 0x1006;
- else
+ } else {
retTextId = 0x1005;
+ }
}
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x1073;
- else
+ } else {
retTextId = 0x105A;
+ }
}
break;
case 4:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x1042;
- else
+ } else {
retTextId = 0x1007;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x1072;
- else if (Flags_GetInfTable(0x47))
+ } else if (Flags_GetInfTable(0x47)) {
retTextId = 0x105E;
- else
+ } else {
retTextId = 0x105D;
+ }
}
break;
case 5:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x1044;
- else if (Flags_GetInfTable(0x22))
+ } else if (Flags_GetInfTable(0x22)) {
retTextId = 0x1009;
- else
+ } else {
retTextId = 0x1008;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x1075;
- else
+ } else {
retTextId = 0x105B;
+ }
}
break;
case 6:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x1042;
- else if (Flags_GetInfTable(0x24))
+ } else if (Flags_GetInfTable(0x24)) {
retTextId = 0x100B;
- else
+ } else {
retTextId = 0x100A;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x1056;
- else
+ } else {
retTextId = 0x105F;
+ }
}
break;
case 7:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x1043;
- else if (Flags_GetInfTable(0x26))
+ } else if (Flags_GetInfTable(0x26)) {
retTextId = 0x100D;
- else
+ } else {
retTextId = 0x100C;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x1057;
- else
+ } else {
retTextId = 0x1057;
+ }
}
break;
case 8:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x1043;
- else if (Flags_GetInfTable(0x28))
+ } else if (Flags_GetInfTable(0x28)) {
retTextId = 0x1019;
- else
+ } else {
retTextId = 0x100E;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x1077;
- else if (Flags_GetInfTable(0x51))
+ } else if (Flags_GetInfTable(0x51)) {
retTextId = 0x1058;
- else
+ } else {
retTextId = 0x1059;
+ }
}
break;
case 9:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x1049;
- else
+ } else {
retTextId = 0x1035;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x1079;
- else
+ } else {
retTextId = 0x104e;
+ }
}
break;
case 10:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x104A;
- else
+ } else {
retTextId = 0x1038;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x1079;
- else if (Flags_GetInfTable(0x59))
+ } else if (Flags_GetInfTable(0x59)) {
retTextId = 0x1050;
- else
+ } else {
retTextId = 0x104F;
+ }
}
break;
case 11:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x104B;
- else
+ } else {
retTextId = 0x103C;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x107b;
- else
+ } else {
retTextId = 0x1051;
+ }
}
break;
case 12:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x104C;
- else
+ } else {
retTextId = 0x103D;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x107C;
- else
+ } else {
retTextId = 0x1052;
+ }
}
break;
case 13:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x9))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x9)) {
retTextId = 0x104D;
- else
+ } else {
retTextId = 0x103E;
- }
- else
- {
- if (Flags_GetEventChkInf(0x5C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x106E;
- else if (Flags_GetInfTable(0x61))
+ } else if (Flags_GetInfTable(0x61)) {
retTextId = 0x1053;
- else
+ } else {
retTextId = 0x1054;
+ }
}
break;
case 15:
- if (Flags_GetEventChkInf(0x5C))
+ if (Flags_GetEventChkInf(0x5C)) {
retTextId = 0x1078;
- else if (Flags_GetInfTable(0x66))
+ } else if (Flags_GetInfTable(0x66)) {
retTextId = 0x1066;
- else
+ } else {
retTextId = 0x1062;
+ }
break;
case 16:
- if (globalCtx->sceneNum == SCENE_SPOT15)
+ if (globalCtx->sceneNum == SCENE_SPOT15) {
retTextId = 0x7002;
- else if (Flags_GetInfTable(0x6A))
+ } else if (Flags_GetInfTable(0x6A)) {
retTextId = 0x7004;
- else if ((gSaveContext.day_time >= 0x4000) && (gSaveContext.day_time < 0xC556))
+ } else if ((gSaveContext.day_time >= 0x4000) && (gSaveContext.day_time < 0xC556)) {
retTextId = 0x7002;
- else
+ } else {
retTextId = 0x7003;
+ }
break;
case 17:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
- {
- if (Flags_GetInfTable(0x6c))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
+ if (Flags_GetInfTable(0x6c)) {
retTextId = 0x7008;
- else
+ } else {
retTextId = 0x7007;
- }
- else
+ }
+ } else {
retTextId = 0;
+ }
break;
case 19:
retTextId = 0x702D;
break;
case 18:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x7006;
- else
- {
- if (Flags_GetEventChkInf(0x12))
- {
- if (Flags_GetInfTable(0x71))
+ } else {
+ if (Flags_GetEventChkInf(0x12)) {
+ if (Flags_GetInfTable(0x71)) {
retTextId = 0x7072;
- else
+ } else {
retTextId = 0x7071;
- }
- else
+ }
+ } else {
retTextId = 0x7029;
+ }
}
break;
case 20:
case 21:
- if (Flags_GetEventChkInf(0x42))
+ if (Flags_GetEventChkInf(0x42)) {
retTextId = 0x2012;
- else if (Flags_GetEventChkInf(0x41))
- {
- if (Flags_GetInfTable(0x76))
+ } else if (Flags_GetEventChkInf(0x41)) {
+ if (Flags_GetInfTable(0x76)) {
retTextId = 0x2011;
- else
+ } else {
retTextId = 0x2010;
- }
- else if (Flags_GetEventChkInf(0x40))
+ }
+ } else if (Flags_GetEventChkInf(0x40)) {
retTextId = 0x200F;
- else
+ } else {
retTextId = 0x200E;
+ }
break;
case 24:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x7044;
- else
+ } else {
retTextId = 0x7015;
+ }
break;
case 25:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x7045;
- else
- {
+ } else {
Flags_GetInfTable(0xC2);
retTextId = 0x7016;
}
break;
case 26:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x7046;
- else
- {
+ } else {
Flags_GetInfTable(0xc2);
retTextId = 0x7018;
}
break;
case 27:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x7047;
- else if (Flags_GetEventChkInf(0x14))
+ } else if (Flags_GetEventChkInf(0x14)) {
retTextId = 0x701A;
- else if (Flags_GetEventChkInf(0x11))
- {
- if (Flags_GetInfTable(0xC6))
+ } else if (Flags_GetEventChkInf(0x11)) {
+ if (Flags_GetInfTable(0xC6)) {
retTextId = 0x701C;
- else
+ } else {
retTextId = 0x701B;
- }
- else
+ }
+ } else {
retTextId = 0x701A;
+ }
break;
case 28:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x7048;
- else
- {
+ } else {
Flags_GetInfTable(0xca);
retTextId = 0x701D;
}
break;
case 29:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x7049;
- else
- {
+ } else {
Flags_GetInfTable(0xcc);
retTextId = 0x701F;
}
break;
case 30:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x704A;
- else
- {
+ } else {
Flags_GetInfTable(0xCE);
retTextId = 0x7021;
}
break;
case 31:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x704B;
- else
- {
+ } else {
Flags_GetInfTable(0xD0);
retTextId = 0x7023;
}
break;
case 32:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x704C;
- else
- {
+ } else {
Flags_GetInfTable(0xD2);
retTextId = 0x7025;
}
break;
case 33:
- if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x9) && Flags_GetEventChkInf(0x25) && Flags_GetEventChkInf(0x37)) {
retTextId = 0x704D;
- else
- {
+ } else {
Flags_GetInfTable(0xD4);
retTextId = 0x7027;
}
@@ -5202,213 +4687,212 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1)
retTextId = 0x403C;
break;
case 35:
- if (Flags_GetInfTable(0xD8))
+ if (Flags_GetInfTable(0xD8)) {
retTextId = 0x5029;
- else
+ } else {
retTextId = 0x5028;
+ }
break;
case 37:
retTextId = 0x5002;
break;
case 38:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x25))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x25)) {
retTextId = 0x3027;
- else if (Flags_GetEventChkInf(0x23))
+ } else if (Flags_GetEventChkInf(0x23)) {
retTextId = 0x3021;
- else if (Flags_GetInfTable(0xE0))
+ } else if (Flags_GetInfTable(0xE0)) {
retTextId = 0x302A;
- else
+ } else {
retTextId = 0x3008;
- }
- else
- {
- if (Flags_GetEventChkInf(0x20))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x20)) {
retTextId = 0x4043;
- else
+ } else {
retTextId = 0x302A;
+ }
}
break;
case 39:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x25))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x25)) {
retTextId = 0x3027;
- else if (Flags_GetEventChkInf(0x23))
+ } else if (Flags_GetEventChkInf(0x23)) {
retTextId = 0x3026;
- else
+ } else {
retTextId = 0x3009;
- }
- else
- {
- if (Flags_GetEventChkInf(0x2A))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x2A)) {
retTextId = 0x4043;
- else
+ } else {
retTextId = 0x302A;
+ }
}
break;
case 40:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x25))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x25)) {
retTextId = 0x3027;
- else if (Flags_GetEventChkInf(0x23))
+ } else if (Flags_GetEventChkInf(0x23)) {
retTextId = 0x3026;
- else if (Flags_GetInfTable(0xEB))
+ } else if (Flags_GetInfTable(0xEB)) {
retTextId = 0x302B;
- else
+ } else {
retTextId = 0x300A;
- }
- else
- {
- if (Flags_GetEventChkInf(0x2B))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x2B)) {
retTextId = 0x4043;
- else
+ } else {
retTextId = 0x302A;
+ }
}
break;
case 41:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x25))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x25)) {
retTextId = 0x3027;
- else if (Flags_GetInfTable(0xF0))
+ } else if (Flags_GetInfTable(0xF0)) {
retTextId = 0x3015;
- else
+ } else {
retTextId = 0x3014;
- }
- else
- {
- if (Flags_GetEventChkInf(0x2C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x2C)) {
retTextId = 0x4043;
- else
+ } else {
retTextId = 0x302A;
+ }
}
break;
case 42:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x25))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x25)) {
retTextId = 0x3027;
- else if (Flags_GetInfTable(0xF4))
+ } else if (Flags_GetInfTable(0xF4)) {
retTextId = 0x3017;
- else
+ } else {
retTextId = 0x3016;
- }
- else
- {
- if (Flags_GetEventChkInf(0x2C))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x2C)) {
retTextId = 0x4043;
- else
+ } else {
retTextId = 0x302A;
+ }
}
break;
case 43:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x25))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x25)) {
retTextId = 0x3027;
- else if (Flags_GetInfTable(0xF8))
+ } else if (Flags_GetInfTable(0xF8)) {
retTextId = 0x3019;
- else
+ } else {
retTextId = 0x3018;
- }
- else
- {
- if (Flags_GetEventChkInf(0x2D))
+ }
+ } else {
+ if (Flags_GetEventChkInf(0x2D)) {
retTextId = 0x4043;
- else
+ } else {
retTextId = 0x302A;
+ }
}
break;
case 48:
- if (Flags_GetEventChkInf(0x25))
+ if (Flags_GetEventChkInf(0x25)) {
retTextId = 0x3029;
- else if (Flags_GetEventChkInf(0x20) && Flags_GetEventChkInf(0x21))
+ } else if (Flags_GetEventChkInf(0x20) && Flags_GetEventChkInf(0x21)) {
retTextId = 0x301B;
- else
+ } else {
retTextId = 0x301A;
+ }
break;
case 49:
- if (Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x37)) {
retTextId = 0x402D;
- else if (Flags_GetEventChkInf(0x30))
+ } else if (Flags_GetEventChkInf(0x30)) {
retTextId = 0x4007;
- else
+ } else {
retTextId = 0x4006;
+ }
break;
case 50:
- if (Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x37)) {
retTextId = 0x402E;
- else if (Flags_GetEventChkInf(0x30))
- {
- if (Flags_GetInfTable(0x124))
+ } else if (Flags_GetEventChkInf(0x30)) {
+ if (Flags_GetInfTable(0x124)) {
retTextId = 0x4009;
- else
+ } else {
retTextId = 0x4008;
- }
- else
+ }
+ } else {
retTextId = 0x4006;
+ }
break;
case 51:
- if (Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x37)) {
retTextId = 0x402D;
- else if (Flags_GetEventChkInf(0x31))
- {
- if (Flags_GetInfTable(0x12A))
+ } else if (Flags_GetEventChkInf(0x31)) {
+ if (Flags_GetInfTable(0x12A)) {
retTextId = 0x400B;
- else
+ } else {
retTextId = 0x402F;
- }
- else if (Flags_GetEventChkInf(0x30))
+ }
+ } else if (Flags_GetEventChkInf(0x30)) {
retTextId = 0x400A;
- else
+ } else {
retTextId = 0x4006;
+ }
break;
case 52:
- if (Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x37)) {
retTextId = 0x402E;
- else if (Flags_GetEventChkInf(0x30))
+ } else if (Flags_GetEventChkInf(0x30)) {
retTextId = 0x400C;
- else
+ } else {
retTextId = 0x4006;
+ }
break;
case 53:
- if (Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x37)) {
retTextId = 0x402D;
- else if (Flags_GetEventChkInf(0x33))
+ } else if (Flags_GetEventChkInf(0x33)) {
retTextId = 0x4010;
- else if (Flags_GetEventChkInf(0x30))
+ } else if (Flags_GetEventChkInf(0x30)) {
retTextId = 0x400F;
- else
+ } else {
retTextId = 0x4006;
+ }
break;
case 54:
- if (Flags_GetEventChkInf(0x37))
+ if (Flags_GetEventChkInf(0x37)) {
retTextId = 0x402E;
- else if (Flags_GetEventChkInf(0x30))
+ } else if (Flags_GetEventChkInf(0x30)) {
retTextId = 0x4011;
- else
+ } else {
retTextId = 0x4006;
+ }
break;
case 55:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x37))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x37)) {
retTextId = 0x402B;
- else if (Flags_GetEventChkInf(0x31))
- {
- if (Flags_GetInfTable(0x138))
+ } else if (Flags_GetEventChkInf(0x31)) {
+ if (Flags_GetInfTable(0x138)) {
retTextId = 0x401C;
- else
+ } else {
retTextId = 0x401B;
- }
- else
+ }
+ } else {
retTextId = 0x401A;
- }
- else
+ }
+ } else {
retTextId = 0;
+ }
break;
case 58:
retTextId = 0x500F;
@@ -5420,79 +4904,77 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1)
retTextId = 0x5012;
break;
case 61:
- if (Flags_GetInfTable(0x166))
+ if (Flags_GetInfTable(0x166)) {
retTextId = 0x5001;
- else
+ } else {
retTextId = 0x5000;
+ }
break;
case 62:
retTextId = 0x5012;
break;
case 63:
- if (Flags_GetInfTable(0x16A))
+ if (Flags_GetInfTable(0x16A)) {
retTextId = 0x5001;
- else
+ } else {
retTextId = 0x5000;
+ }
break;
case 71:
- if (Flags_GetEventChkInf(0x16))
+ if (Flags_GetEventChkInf(0x16)) {
retTextId = 0x2049;
- else if (Flags_GetEventChkInf(0x15))
+ } else if (Flags_GetEventChkInf(0x15)) {
retTextId = 0x2048;
- else if (Flags_GetEventChkInf(0x14))
+ } else if (Flags_GetEventChkInf(0x14)) {
retTextId = 0x2047;
- else if (Flags_GetEventChkInf(0x12) && !Flags_GetEventChkInf(0x14))
+ } else if (Flags_GetEventChkInf(0x12) && !Flags_GetEventChkInf(0x14)) {
retTextId = 0x2044;
- else if (Flags_GetEventChkInf(0x10))
- {
- if (Flags_GetEventChkInf(0x11))
+ } else if (Flags_GetEventChkInf(0x10)) {
+ if (Flags_GetEventChkInf(0x11)) {
retTextId = 0x2043;
- else
+ } else {
retTextId = 0x2042;
- }
- else
+ }
+ } else {
retTextId = 0x2041;
+ }
break;
case 72:
- if (LINK_IS_CHILD)
- {
- if (Flags_GetEventChkInf(0x14))
+ if (LINK_IS_CHILD) {
+ if (Flags_GetEventChkInf(0x14)) {
retTextId = 0x2040;
- else if (Flags_GetInfTable(0x94))
+ } else if (Flags_GetInfTable(0x94)) {
retTextId = 0x2040;
- else
+ } else {
retTextId = 0x203F;
- }
- else
- {
- if (!Flags_GetEventChkInf(0x18))
- {
- if (gSaveContext.night_flag)
+ }
+ } else {
+ if (!Flags_GetEventChkInf(0x18)) {
+ if (gSaveContext.night_flag) {
retTextId = 0x204E;
- else if (Flags_GetInfTable(0x9A))
+ } else if (Flags_GetInfTable(0x9A)) {
retTextId = 0x2031;
- else
+ } else {
retTextId = 0x2030;
- }
- else
+ }
+ } else {
retTextId = 0;
+ }
}
break;
}
- if (retTextId == 0)
+ if (retTextId == 0) {
retTextId = 1;
+ }
return retTextId;
}
-void func_80036E50(u16 textId, s16 arg1)
-{
- switch (arg1)
- {
+void func_80036E50(u16 textId, s16 arg1) {
+ switch (arg1) {
case 0:
- switch (textId)
- {
+ switch (textId) {
case 0x1001:
Flags_SetInfTable(0x0);
return;
@@ -5509,14 +4991,14 @@ void func_80036E50(u16 textId, s16 arg1)
}
return;
case 1:
- switch (textId)
- {
+ switch (textId) {
case 0x102F:
Flags_SetEventChkInf(0x2);
Flags_SetInfTable(0xC);
return;
case 0x1033:
- Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
+ Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0,
+ &D_801333E8);
Flags_SetEventChkInf(0x4);
Flags_SetInfTable(0xE);
return;
@@ -5536,132 +5018,160 @@ void func_80036E50(u16 textId, s16 arg1)
}
return;
case 2:
- if (textId == 0x1056)
+ if (textId == 0x1056) {
Flags_SetInfTable(0x41);
+ }
return;
case 3:
- if (textId == 0x1005)
+ if (textId == 0x1005) {
Flags_SetInfTable(0x1E);
+ }
return;
case 4:
- if (textId == 0x105D)
+ if (textId == 0x105D) {
Flags_SetInfTable(0x47);
+ }
return;
case 5:
- if (textId == 0x1008)
+ if (textId == 0x1008) {
Flags_SetInfTable(0x22);
+ }
return;
case 6:
- if (textId == 0x100A)
+ if (textId == 0x100A) {
Flags_SetInfTable(0x24);
+ }
return;
case 7:
- if (textId == 0x100C)
+ if (textId == 0x100C) {
Flags_SetInfTable(0x26);
+ }
return;
case 8:
- if (textId == 0x100E)
+ if (textId == 0x100E) {
Flags_SetInfTable(0x28);
- if (textId == 0x1059)
+ }
+ if (textId == 0x1059) {
Flags_SetInfTable(0x51);
+ }
return;
case 10:
- if (textId == 0x104F)
+ if (textId == 0x104F) {
Flags_SetInfTable(0x59);
+ }
return;
case 13:
- if (textId == 0x1054)
+ if (textId == 0x1054) {
Flags_SetInfTable(0x61);
+ }
return;
case 15:
- if (textId == 0x1062)
+ if (textId == 0x1062) {
Flags_SetInfTable(0x66);
+ }
return;
case 16:
- if (textId == 0x7002)
+ if (textId == 0x7002) {
Flags_SetInfTable(0x6A);
- if (textId == 0x7003)
+ }
+ if (textId == 0x7003) {
Flags_SetInfTable(0x6A);
+ }
return;
case 17:
- if (textId == 0x7007)
+ if (textId == 0x7007) {
Flags_SetInfTable(0x6C);
+ }
return;
case 18:
- if (textId == 0x7071)
+ if (textId == 0x7071) {
Flags_SetInfTable(0x71);
+ }
return;
case 20:
case 21:
- if (textId == 0x2010)
+ if (textId == 0x2010) {
Flags_SetInfTable(0x76);
+ }
return;
case 25:
- if (textId == 0x7016)
+ if (textId == 0x7016) {
Flags_SetInfTable(0xC2);
+ }
return;
case 26:
- if (textId == 0x7018)
+ if (textId == 0x7018) {
Flags_SetInfTable(0xC4);
+ }
return;
case 28:
- if (textId == 0x701D)
+ if (textId == 0x701D) {
Flags_SetInfTable(0xCA);
+ }
return;
case 29:
- if (textId == 0x701F)
+ if (textId == 0x701F) {
Flags_SetInfTable(0xCC);
+ }
return;
case 30:
- if (textId == 0x7021)
+ if (textId == 0x7021) {
Flags_SetInfTable(0xCE);
+ }
return;
case 31:
- if (textId == 0x7023)
+ if (textId == 0x7023) {
Flags_SetInfTable(0xD0);
+ }
return;
case 32:
- if (textId == 0x7025)
+ if (textId == 0x7025) {
Flags_SetInfTable(0xD2);
+ }
return;
case 33:
- if (textId == 0x7027)
+ if (textId == 0x7027) {
Flags_SetInfTable(0xD4);
+ }
return;
case 34:
- if (textId == 0x403c)
+ if (textId == 0x403c) {
Flags_SetInfTable(0xD6);
+ }
return;
case 35:
- if (textId == 0x5028)
+ if (textId == 0x5028) {
Flags_SetInfTable(0xD8);
+ }
return;
case 38:
- if (textId == 0x3008)
+ if (textId == 0x3008) {
Flags_SetInfTable(0xE0);
+ }
return;
case 40:
- if (textId == 0x300B)
+ if (textId == 0x300B) {
Flags_SetInfTable(0xEB);
+ }
return;
case 41:
- if (textId == 0x3014)
+ if (textId == 0x3014) {
Flags_SetInfTable(0xF0);
+ }
return;
case 42:
- if (textId == 0x3016)
+ if (textId == 0x3016) {
Flags_SetInfTable(0xF4);
+ }
return;
case 43:
- if (textId == 0x3018)
- {
+ if (textId == 0x3018) {
Flags_SetEventChkInf(0x20);
Flags_SetInfTable(0xF8);
}
return;
case 48:
- if (textId == 0x3020)
- {
+ if (textId == 0x3020) {
Flags_SetEventChkInf(0x22);
Flags_SetInfTable(0x113);
}
@@ -5670,136 +5180,140 @@ void func_80036E50(u16 textId, s16 arg1)
case 52:
case 53:
case 54:
- if (textId == 0x4006)
+ if (textId == 0x4006) {
Flags_SetEventChkInf(0x30);
+ }
return;
case 50:
- if (textId == 0x4006)
+ if (textId == 0x4006) {
Flags_SetEventChkInf(0x30);
- if (textId == 0x4008)
+ }
+ if (textId == 0x4008) {
Flags_SetInfTable(0x124);
+ }
return;
case 51:
- if (textId == 0x4006)
+ if (textId == 0x4006) {
Flags_SetEventChkInf(0x30);
- if (textId == 0x400A)
+ }
+ if (textId == 0x400A) {
Flags_SetEventChkInf(0x32);
- if (textId == 0x402F)
+ }
+ if (textId == 0x402F) {
Flags_SetInfTable(0x12A);
+ }
return;
case 55:
- if (textId == 0x401B)
- {
+ if (textId == 0x401B) {
Flags_SetEventChkInf(0x33);
Flags_SetInfTable(0x138);
}
return;
case 61:
- if (textId == 0x5000)
+ if (textId == 0x5000) {
Flags_SetInfTable(0x166);
+ }
return;
case 63:
- if (textId == 0x5013)
+ if (textId == 0x5013) {
Flags_SetInfTable(0x16A);
+ }
return;
case 71:
- if (textId == 0x2041)
+ if (textId == 0x2041) {
Flags_SetEventChkInf(0x10);
- if (textId == 0x2044)
+ }
+ if (textId == 0x2044) {
Flags_SetEventChkInf(0x12);
- if (textId == 0x2047)
+ }
+ if (textId == 0x2047) {
Flags_SetEventChkInf(0x15);
- if (textId == 0x2048)
+ }
+ if (textId == 0x2048) {
Flags_SetEventChkInf(0x16);
+ }
return;
case 72:
return;
}
}
-s32 func_800374E0(GlobalContext* globalCtx, Actor* actor, u16 textId)
-{
+s32 func_800374E0(GlobalContext* globalCtx, Actor* actor, u16 textId) {
MessageContext* msgCtx = &globalCtx->msgCtx;
s32 ret = 1;
- switch (textId)
- {
+ switch (textId) {
case 0x1035:
- if (msgCtx->choiceIndex == 0)
- {
- if (Flags_GetInfTable(0x2A))
+ if (msgCtx->choiceIndex == 0) {
+ if (Flags_GetInfTable(0x2A)) {
func_80035B18(globalCtx, actor, 0x1036);
- else
+ } else {
func_80035B18(globalCtx, actor, 0x1041);
+ }
}
- if (msgCtx->choiceIndex == 1)
- {
- if (Flags_GetInfTable(0x2B))
+ if (msgCtx->choiceIndex == 1) {
+ if (Flags_GetInfTable(0x2B)) {
func_80035B18(globalCtx, actor, 0x1037);
- else
+ } else {
func_80035B18(globalCtx, actor, 0x1041);
+ }
}
ret = 0;
break;
case 0x1038:
- if (msgCtx->choiceIndex == 0)
- {
- if (Flags_GetInfTable(0x2E))
+ if (msgCtx->choiceIndex == 0) {
+ if (Flags_GetInfTable(0x2E)) {
func_80035B18(globalCtx, actor, 0x1039);
- else
+ } else {
func_80035B18(globalCtx, actor, 0x1041);
+ }
}
- if (msgCtx->choiceIndex == 1)
- {
- if (Flags_GetInfTable(0x2F))
+ if (msgCtx->choiceIndex == 1) {
+ if (Flags_GetInfTable(0x2F)) {
func_80035B18(globalCtx, actor, 0x103A);
- else
+ } else {
func_80035B18(globalCtx, actor, 0x1041);
+ }
}
- if (msgCtx->choiceIndex == 2)
- {
- if (Flags_GetInfTable(0x30))
+ if (msgCtx->choiceIndex == 2) {
+ if (Flags_GetInfTable(0x30)) {
func_80035B18(globalCtx, actor, 0x103B);
- else
+ } else {
func_80035B18(globalCtx, actor, 0x1041);
+ }
}
ret = 0;
break;
case 0x103E:
- if (msgCtx->choiceIndex == 0)
+ if (msgCtx->choiceIndex == 0) {
func_80035B18(globalCtx, actor, 0x103F);
- if (msgCtx->choiceIndex == 1)
+ }
+ if (msgCtx->choiceIndex == 1) {
func_80035B18(globalCtx, actor, 0x1040);
+ }
ret = 0;
break;
case 0x1041:
- if (msgCtx->unk_E2FA == 0x1035)
- {
- if (msgCtx->choiceIndex == 0)
- {
+ if (msgCtx->unk_E2FA == 0x1035) {
+ if (msgCtx->choiceIndex == 0) {
func_80035B18(globalCtx, actor, 0x1036);
Flags_SetInfTable(0x2A);
}
- if (msgCtx->choiceIndex == 1)
- {
+ if (msgCtx->choiceIndex == 1) {
func_80035B18(globalCtx, actor, 0x1037);
Flags_SetInfTable(0x2B);
}
}
- if (msgCtx->unk_E2FA == 0x1038)
- {
- if (msgCtx->choiceIndex == 0)
- {
+ if (msgCtx->unk_E2FA == 0x1038) {
+ if (msgCtx->choiceIndex == 0) {
func_80035B18(globalCtx, actor, 0x1039);
Flags_SetInfTable(0x2E);
}
- if (msgCtx->choiceIndex == 1)
- {
+ if (msgCtx->choiceIndex == 1) {
func_80035B18(globalCtx, actor, 0x103A);
Flags_SetInfTable(0x2F);
}
- if (msgCtx->choiceIndex == 2)
- {
+ if (msgCtx->choiceIndex == 2) {
func_80035B18(globalCtx, actor, 0x103B);
Flags_SetInfTable(0x30);
}
@@ -5807,81 +5321,88 @@ s32 func_800374E0(GlobalContext* globalCtx, Actor* actor, u16 textId)
ret = 0;
break;
case 0x1062:
- if (msgCtx->choiceIndex == 0)
+ if (msgCtx->choiceIndex == 0) {
func_80035B18(globalCtx, actor, 0x1063);
- if (msgCtx->choiceIndex == 1)
+ }
+ if (msgCtx->choiceIndex == 1) {
func_80035B18(globalCtx, actor, 0x1064);
+ }
ret = 0;
break;
case 0x2030:
case 0x2031:
- if (msgCtx->choiceIndex == 0)
- {
- if (gSaveContext.rupees >= 10)
- {
+ if (msgCtx->choiceIndex == 0) {
+ if (gSaveContext.rupees >= 10) {
func_80035B18(globalCtx, actor, 0x2034);
Rupees_ChangeBy(-10);
- }
- else
+ } else {
func_80035B18(globalCtx, actor, 0x2032);
+ }
}
- if (msgCtx->choiceIndex == 1)
+ if (msgCtx->choiceIndex == 1) {
func_80035B18(globalCtx, actor, 0x2032);
+ }
Flags_SetInfTable(0x9A);
ret = 0;
break;
case 0x2036:
case 0x2037:
- if (msgCtx->choiceIndex == 0)
+ if (msgCtx->choiceIndex == 0) {
func_80035B18(globalCtx, actor, 0x201F);
- if (msgCtx->choiceIndex == 1)
+ }
+ if (msgCtx->choiceIndex == 1) {
func_80035B18(globalCtx, actor, 0x205A);
+ }
ret = 0;
break;
case 0x2038:
- if (msgCtx->choiceIndex == 0)
+ if (msgCtx->choiceIndex == 0) {
break;
- if (msgCtx->choiceIndex == 1)
+ }
+ if (msgCtx->choiceIndex == 1) {
func_80035B18(globalCtx, actor, 0x205A);
+ }
ret = 0;
break;
case 0x2034:
- if (msgCtx->choiceIndex != 0)
+ if (msgCtx->choiceIndex != 0) {
break;
+ }
func_80035B18(globalCtx, actor, 0x2035);
ret = 0;
break;
case 0x2043:
- if (Flags_GetEventChkInf(0x12))
+ if (Flags_GetEventChkInf(0x12)) {
break;
+ }
func_80035B18(globalCtx, actor, 0x2044);
ret = 0;
break;
case 0x205A:
break;
case 0x300A:
- if (msgCtx->choiceIndex == 0)
- {
- if (Flags_GetEventChkInf(0x22))
+ if (msgCtx->choiceIndex == 0) {
+ if (Flags_GetEventChkInf(0x22)) {
func_80035B18(globalCtx, actor, 0x300B);
- else
+ } else {
func_80035B18(globalCtx, actor, 0x300C);
+ }
}
- if (msgCtx->choiceIndex == 1)
+ if (msgCtx->choiceIndex == 1) {
func_80035B18(globalCtx, actor, 0x300D);
+ }
ret = 0;
break;
case 0x301B:
- if (msgCtx->choiceIndex == 0)
- {
+ if (msgCtx->choiceIndex == 0) {
func_80035B18(globalCtx, actor, 0x301D);
}
- if (msgCtx->choiceIndex == 1)
- {
- if (Flags_GetInfTable(0x113))
+ if (msgCtx->choiceIndex == 1) {
+ if (Flags_GetInfTable(0x113)) {
func_80035B18(globalCtx, actor, 0x301F);
- else
+ } else {
func_80035B18(globalCtx, actor, 0x301E);
+ }
}
ret = 0;
break;
@@ -5890,10 +5411,12 @@ s32 func_800374E0(GlobalContext* globalCtx, Actor* actor, u16 textId)
ret = 0;
break;
case 0x400C:
- if (msgCtx->choiceIndex == 0)
+ if (msgCtx->choiceIndex == 0) {
func_80035B18(globalCtx, actor, 0x400D);
- if (msgCtx->choiceIndex == 1)
+ }
+ if (msgCtx->choiceIndex == 1) {
func_80035B18(globalCtx, actor, 0x400E);
+ }
ret = 0;
break;
case 0x7007:
@@ -5913,37 +5436,31 @@ s32 func_800374E0(GlobalContext* globalCtx, Actor* actor, u16 textId)
return ret;
}
-u16 func_80037C30(GlobalContext* globalCtx, s16 arg1)
-{
+u16 func_80037C30(GlobalContext* globalCtx, s16 arg1) {
return func_80035BFC(globalCtx, arg1);
}
-s32 func_80037C5C(GlobalContext* globalCtx, s16 arg1, u16 textId)
-{
+s32 func_80037C5C(GlobalContext* globalCtx, s16 arg1, u16 textId) {
func_80036E50(textId, arg1);
return 0;
}
-s32 func_80037C94(GlobalContext* globalCtx, Actor* actor, s32 arg2)
-{
+s32 func_80037C94(GlobalContext* globalCtx, Actor* actor, s32 arg2) {
return func_800374E0(globalCtx, actor, actor->textId);
}
-s32 func_80037CB8(GlobalContext* globalCtx, Actor* actor, s16 arg2)
-{
+s32 func_80037CB8(GlobalContext* globalCtx, Actor* actor, s16 arg2) {
MessageContext* msgCtx = &globalCtx->msgCtx;
s32 ret = 0;
- switch (func_8010BDBC(msgCtx))
- {
+ switch (func_8010BDBC(msgCtx)) {
case 2:
func_80037C5C(globalCtx, arg2, actor->textId);
ret = 1;
break;
case 4:
case 5:
- if (func_80106BC8(globalCtx) && func_80037C94(globalCtx, actor, arg2))
- {
+ if (func_80106BC8(globalCtx) && func_80037C94(globalCtx, actor, arg2)) {
Audio_PlaySoundGeneral(NA_SE_SY_CANCEL, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
msgCtx->msgMode = 0x36;
ret = 1;
@@ -5954,58 +5471,57 @@ s32 func_80037CB8(GlobalContext* globalCtx, Actor* actor, s16 arg2)
return ret;
}
-s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3)
-{
+s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3) {
s16 var;
s16 sp2C;
s16 sp2A;
s16 abs_var;
- if (func_8002F194(actor, globalCtx))
- {
+ if (func_8002F194(actor, globalCtx)) {
*arg3 = 1;
return 1;
}
- if (*arg3 == 1)
- {
- if (func_80037CB8(globalCtx, actor, arg2))
+ if (*arg3 == 1) {
+ if (func_80037CB8(globalCtx, actor, arg2)) {
*arg3 = 0;
+ }
return 0;
}
func_8002F374(globalCtx, actor, &sp2C, &sp2A);
- if (0) ; // Necessary to match
+ if (0) {} // Necessary to match
- if ((sp2C < 0) || (sp2C > 320) || (sp2A < 0) || (sp2A > 240))
+ if ((sp2C < 0) || (sp2C > 320) || (sp2A < 0) || (sp2A > 240)) {
return 0;
+ }
var = actor->rotTowardsLinkY - actor->shape.rot.y;
abs_var = ABS(var);
- if (abs_var >= 0x4300)
+ if (abs_var >= 0x4300) {
return 0;
+ }
- if ((actor->waterSurfaceDist > 25600.0f) && (actor->unk_10C == 0))
+ if ((actor->waterSurfaceDist > 25600.0f) && (actor->unk_10C == 0)) {
return 0;
+ }
- if (actor->waterSurfaceDist <= 6400.0f)
- {
- if (func_8002F2CC(actor, globalCtx, 80.0f))
+ if (actor->waterSurfaceDist <= 6400.0f) {
+ if (func_8002F2CC(actor, globalCtx, 80.0f)) {
actor->textId = func_80037C30(globalCtx, arg2);
- }
- else
- {
- if (func_8002F2F4(actor, globalCtx))
+ }
+ } else {
+ if (func_8002F2F4(actor, globalCtx)) {
actor->textId = func_80037C30(globalCtx, arg2);
+ }
}
return 0;
}
-s32 func_80037F30(Vec3s* arg0, Vec3s* arg1)
-{
+s32 func_80037F30(Vec3s* arg0, Vec3s* arg1) {
Math_SmoothScaleMaxMinS(&arg0->y, 0, 6, 6200, 100);
Math_SmoothScaleMaxMinS(&arg0->x, 0, 6, 6200, 100);
Math_SmoothScaleMaxMinS(&arg1->y, 0, 6, 6200, 100);
@@ -6013,8 +5529,7 @@ s32 func_80037F30(Vec3s* arg0, Vec3s* arg1)
return 1;
}
-s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3)
-{
+s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3) {
s16 sp36;
s16 sp34;
s16 var;
@@ -6028,8 +5543,9 @@ s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3)
var = Math_SmoothScaleMaxMinS(&arg2->y, sp34, 6, 2000, 1);
arg2->y = (arg2->y < -8000) ? -8000 : ((arg2->y > 8000) ? 8000 : arg2->y);
- if (var && (ABS(arg2->y) < 8000))
+ if (var && (ABS(arg2->y) < 8000)) {
return 0;
+ }
Math_SmoothScaleMaxMinS(&arg3->y, sp34 - arg2->y, 4, 2000, 1);
arg3->y = (arg3->y < -12000) ? -12000 : ((arg3->y > 12000) ? 12000 : arg3->y);
@@ -6037,8 +5553,7 @@ s32 func_80037FC8(Actor* actor, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3)
return 1;
}
-s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, f32 arg4)
-{
+s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, f32 arg4) {
Player* player = PLAYER;
s32 pad;
Vec3f sp2C;
@@ -6048,29 +5563,27 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar
actor->posRot2.pos = actor->posRot.pos;
actor->posRot2.pos.y += arg4;
- if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)))
- {
+ if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))) {
var = actor->rotTowardsLinkY - actor->shape.rot.y;
abs_var = ABS(var);
- if (abs_var >= 0x4300)
- {
+ if (abs_var >= 0x4300) {
func_80037F30(arg2, arg3);
return 0;
}
}
- if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))
+ if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)) {
sp2C = globalCtx->view.eye;
- else
+ } else {
sp2C = player->actor.posRot2.pos;
+ }
func_80037FC8(actor, &sp2C, arg2, arg3);
return 1;
}
-s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, Vec3f arg4)
-{
+s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, Vec3f arg4) {
Player* player = PLAYER;
s32 pad;
Vec3f sp24;
@@ -6079,21 +5592,20 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar
actor->posRot2.pos = arg4;
- if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)))
- {
+ if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))) {
var = actor->rotTowardsLinkY - actor->shape.rot.y;
abs_var = ABS(var);
- if (abs_var >= 0x4300)
- {
+ if (abs_var >= 0x4300) {
func_80037F30(arg2, arg3);
return 0;
}
}
- if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))
+ if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)) {
sp24 = globalCtx->view.eye;
- else
+ } else {
sp24 = player->actor.posRot2.pos;
+ }
func_80037FC8(actor, &sp24, arg2, arg3);
diff --git a/src/code/z_actor_dlftbls.c b/src/code/z_actor_dlftbls.c
index 2a15f876d..29a18cf99 100644
--- a/src/code/z_actor_dlftbls.c
+++ b/src/code/z_actor_dlftbls.c
@@ -2,24 +2,19 @@
#include <global.h>
#include <initvars.h>
-#define ACTOR_OVERLAY(name, allocType) \
- { \
- (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, \
- _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, \
- NULL, &name##_InitVars, #name, allocType, 0 \
+#define ACTOR_OVERLAY(name, allocType) \
+ { \
+ (u32) _ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \
+ _ovl_##name##SegmentEnd, NULL, &name##_InitVars, #name, allocType, 0 \
}
-#define ACTOR_OVERLAY_INTERNAL(name, allocType) \
- { \
- 0, 0, \
- NULL, NULL, \
- NULL, &name##_InitVars, #name, allocType, 0 \
- }
+#define ACTOR_OVERLAY_INTERNAL(name, allocType) \
+ { 0, 0, NULL, NULL, NULL, &name##_InitVars, #name, allocType, 0 }
-#define ACTOR_OVERLAY_UNSET { 0 }
+#define ACTOR_OVERLAY_UNSET \
+ { 0 }
-ActorOverlay gActorOverlayTable[] =
-{
+ActorOverlay gActorOverlayTable[] = {
ACTOR_OVERLAY_INTERNAL(Player, ALLOCTYPE_NORMAL),
ACTOR_OVERLAY_UNSET,
ACTOR_OVERLAY(En_Test, ALLOCTYPE_NORMAL),
@@ -497,26 +492,21 @@ s32 gMaxProfile = 0;
static FaultClient sFaultClient;
-void ActorOverlayTable_LogPrint(void)
-{
+void ActorOverlayTable_LogPrint(void) {
ActorOverlay* overlayEntry;
u32 i;
osSyncPrintf("actor_dlftbls %u\n", gMaxProfile);
osSyncPrintf("RomStart RomEnd SegStart SegEnd allocp profile segname\n");
- for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++)
- {
- osSyncPrintf("%08x %08x %08x %08x %08x %08x %s\n",
- overlayEntry->vromStart, overlayEntry->vromEnd,
- overlayEntry->vramStart, overlayEntry->vramEnd,
- overlayEntry->loadedRamAddr, &overlayEntry->initInfo->id,
- overlayEntry->name != NULL ? overlayEntry->name : "?");
+ for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++) {
+ osSyncPrintf("%08x %08x %08x %08x %08x %08x %s\n", overlayEntry->vromStart, overlayEntry->vromEnd,
+ overlayEntry->vramStart, overlayEntry->vramEnd, overlayEntry->loadedRamAddr,
+ &overlayEntry->initInfo->id, overlayEntry->name != NULL ? overlayEntry->name : "?");
}
}
-void ActorOverlayTable_FaultPrint(void* arg0, void* arg1)
-{
+void ActorOverlayTable_FaultPrint(void* arg0, void* arg1) {
ActorOverlay* overlayEntry;
u32 overlaySize;
s32 i;
@@ -526,26 +516,22 @@ void ActorOverlayTable_FaultPrint(void* arg0, void* arg1)
FaultDrawer_Printf("actor_dlftbls %u\n", gMaxProfile);
FaultDrawer_Printf("No. RamStart- RamEnd cn Name\n");
- for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++)
- {
+ for (i = 0, overlayEntry = &gActorOverlayTable[0]; i < gMaxProfile; i++, overlayEntry++) {
overlaySize = (u32)overlayEntry->vramEnd - (u32)overlayEntry->vramStart;
- if (overlayEntry->loadedRamAddr != NULL)
- {
- FaultDrawer_Printf("%3d %08x-%08x %3d %s\n",
- i, overlayEntry->loadedRamAddr, (u32)overlayEntry->loadedRamAddr + overlaySize,
- overlayEntry->nbLoaded, overlayEntry->name != NULL ? overlayEntry->name : "");
+ if (overlayEntry->loadedRamAddr != NULL) {
+ FaultDrawer_Printf("%3d %08x-%08x %3d %s\n", i, overlayEntry->loadedRamAddr,
+ (u32)overlayEntry->loadedRamAddr + overlaySize, overlayEntry->nbLoaded,
+ overlayEntry->name != NULL ? overlayEntry->name : "");
}
}
}
-void ActorOverlayTable_Init(void)
-{
+void ActorOverlayTable_Init(void) {
gMaxProfile = ACTOR_DLF_MAX;
Fault_AddClient(&sFaultClient, ActorOverlayTable_FaultPrint, NULL, NULL);
}
-void ActorOverlayTable_Cleanup(void)
-{
+void ActorOverlayTable_Cleanup(void) {
Fault_RemoveClient(&sFaultClient);
gMaxProfile = 0;
}
diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c
index d36b154c8..12c66c975 100644
--- a/src/code/z_bgcheck.c
+++ b/src/code/z_bgcheck.c
@@ -3,47 +3,41 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038600.s")
-void func_80038708(s16* puParm1, s16* puParm2, u16 uParm3)
-{
- *puParm1 = *puParm2;
- puParm1[1] = uParm3;
+void func_80038708(s16* puParm1, s16* puParm2, u16 uParm3) {
+ *puParm1 = *puParm2;
+ puParm1[1] = uParm3;
}
-void func_8003871C(u16* puParm1)
-{
- *puParm1 = 0xFFFF;
+void func_8003871C(u16* puParm1) {
+ *puParm1 = 0xFFFF;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038728.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038780.s")
-void func_800387FC(u32 uParm1, u32* puParm2)
-{
- *puParm2 = 0;
- puParm2[1] = 0;
+void func_800387FC(u32 uParm1, u32* puParm2) {
+ *puParm2 = 0;
+ puParm2[1] = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003880C.s")
-void func_80038870(int iParm1)
-{
- *(u32*)(iParm1 + 4) = 0;
+void func_80038870(int iParm1) {
+ *(u32*)(iParm1 + 4) = 0;
}
-u32 func_80038878(s32 iParm1)
-{
- u32 uVar1;
-
- uVar1 = *(u32*)(iParm1 + 4) & 0xffff;
- *(int *)(iParm1 + 4) = *(u32*)(iParm1 + 4) + 1;
-
- if (*(int *)(iParm1 + 8) <= (int)uVar1)
- {
- return 0xffff;
- }
-
- return uVar1;
+u32 func_80038878(s32 iParm1) {
+ u32 uVar1;
+
+ uVar1 = *(u32*)(iParm1 + 4) & 0xffff;
+ *(int*)(iParm1 + 4) = *(u32*)(iParm1 + 4) + 1;
+
+ if (*(int*)(iParm1 + 8) <= (int)uVar1) {
+ return 0xffff;
+ }
+
+ return uVar1;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800388A8.s")
@@ -56,7 +50,6 @@ u32 func_80038878(s32 iParm1)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038A28.s")
-
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038B7C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80038BE0.s")
@@ -175,12 +168,11 @@ u32 func_80038878(s32 iParm1)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E214.s")
-void func_8003E398(u16* puParm1)
-{
- *puParm1 = 0;
- puParm1[1] = 0;
- *(u32*)(puParm1 + 2) = 0;
- *(u32*)(puParm1 + 4) = 0;
+void func_8003E398(u16* puParm1) {
+ *puParm1 = 0;
+ puParm1[1] = 0;
+ *(u32*)(puParm1 + 2) = 0;
+ *(u32*)(puParm1 + 4) = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E3AC.s")
@@ -195,15 +187,12 @@ void func_8003E398(u16* puParm1)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E688.s")
-void func_8003E6C4(u16* puParm1)
-{
- *puParm1 = 0;
- func_8003E688();
+void func_8003E6C4(u16* puParm1) {
+ *puParm1 = 0;
+ func_8003E688();
}
-
-void func_8003E6E4(u16* a0)
-{
+void func_8003E6E4(u16* a0) {
*a0 = 0;
}
@@ -211,21 +200,17 @@ void func_8003E6E4(u16* a0)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E750.s")
-void func_8003E804(int iParm1)
-{
- func_8003E5B4(iParm1 + 0x14, iParm1 + 0x34);
+void func_8003E804(int iParm1) {
+ func_8003E5B4(iParm1 + 0x14, iParm1 + 0x34);
}
-
-void func_8003E82C(u32* a0)
-{
+void func_8003E82C(u32* a0) {
*a0 = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E834.s")
-void func_8003E888(u32* a0)
-{
+void func_8003E888(u32* a0) {
*a0 = 0;
}
@@ -235,8 +220,7 @@ void func_8003E888(u32* a0)
/*
NON-MATCHING
-void func_8003E8EC(u32 uParm1, u32* iParm2)
-{
+void func_8003E8EC(u32 uParm1, u32* iParm2) {
iParm2[0x06] = iParm2[0x0E];
iParm2[0x05] = iParm2[0x0D];
iParm2[0x07] = iParm2[0x0F];
@@ -246,30 +230,28 @@ void func_8003E8EC(u32 uParm1, u32* iParm2)
iParm2[0x0B] = iParm2[0x13];
iParm2[0x0C] = iParm2[0x14];
-
+
//int i;
- //for (i = 0; i < 4; i++)
- //{
+ //for (i = 0; i < 4; i++) {
//iParm2[0x06 + (i * 2)] = iParm2[0x0E + (i * 2)];
//iParm2[0x07 + (i * 2)] = iParm2[0x0D + (i * 2)];
//}
}
*/
-u32 func_8003E934(int iParm1)
-{
- if (!((-1 < iParm1) && (iParm1 < 0x32)))
- return 0;
+u32 func_8003E934(int iParm1) {
+ if (!((-1 < iParm1) && (iParm1 < 0x32))) {
+ return 0;
+ }
- return 1;
+ return 1;
}
-void func_8003E954(u32 uParm1, u8* puParm2)
-{
- *puParm2 = 1;
- func_8003E82C(puParm2 + 0x13f0);
- func_8003E888(puParm2 + 0x13f4);
- func_800387FC(uParm1, puParm2 + 0x13f8);
+void func_8003E954(u32 uParm1, u8* puParm2) {
+ *puParm2 = 1;
+ func_8003E82C(puParm2 + 0x13f0);
+ func_8003E888(puParm2 + 0x13f4);
+ func_800387FC(uParm1, puParm2 + 0x13f8);
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8003E9A0.s")
@@ -323,19 +305,16 @@ void func_8003E954(u32 uParm1, u8* puParm2)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800418D0.s")
#ifdef NON_MATCHING
-void func_80041978(int iParm1, int iParm2)
-{
- u8* puVar1;
-
- puVar1 = *(u8 **)(iParm1 + 8);
- if (puVar1 < puVar1 + iParm2)
- {
- *puVar1 = 0;
- while (puVar1++ < (u8*)(*(int *)(iParm1 + 8) + iParm2))
- {
- *puVar1 = 0;
+void func_80041978(int iParm1, int iParm2) {
+ u8* puVar1;
+
+ puVar1 = *(u8**)(iParm1 + 8);
+ if (puVar1 < puVar1 + iParm2) {
+ *puVar1 = 0;
+ while (puVar1++ < (u8*)(*(int*)(iParm1 + 8) + iParm2)) {
+ *puVar1 = 0;
+ }
}
- }
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041978.s")
@@ -343,12 +322,11 @@ void func_80041978(int iParm1, int iParm2)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800419B0.s")
-u32 func_80041A28(CollisionContext *a0, u32 a1, u32 a2)
-{
- u32 uVar1;
-
- uVar1 = func_800419B0(a0, a1, a2, 0);
- return uVar1 & 0xff;
+u32 func_80041A28(CollisionContext* a0, u32 a1, u32 a2) {
+ u32 uVar1;
+
+ uVar1 = func_800419B0(a0, a1, a2, 0);
+ return uVar1 & 0xff;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041A4C.s")
@@ -365,12 +343,11 @@ u32 func_80041A28(CollisionContext *a0, u32 a1, u32 a2)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041D4C.s")
-u32 func_80041D94(u32 a0, u32 a1, u32 a2)
-{
- u32 uVar1;
-
- uVar1 = func_800419B0(a0, a1, a2, 0);
- return uVar1 >> 0x15 & 0x1f;
+u32 func_80041D94(u32 a0, u32 a1, u32 a2) {
+ u32 uVar1;
+
+ uVar1 = func_800419B0(a0, a1, a2, 0);
+ return uVar1 >> 0x15 & 0x1f;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041DB8.s")
@@ -385,12 +362,11 @@ u32 func_80041D94(u32 a0, u32 a1, u32 a2)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041EEC.s")
-u32 func_80041F10(u32 a0, u32 a1, u32 a2)
-{
- u32 uVar1;
-
- uVar1 = func_800419B0(a0, a1, a2, 1);
- return uVar1 & 0xf;
+u32 func_80041F10(u32 a0, u32 a1, u32 a2) {
+ u32 uVar1;
+
+ uVar1 = func_800419B0(a0, a1, a2, 1);
+ return uVar1 & 0xf;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80041F34.s")
@@ -409,29 +385,28 @@ u32 func_80041F10(u32 a0, u32 a1, u32 a2)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_800420E4.s")
-u32 func_80042108(u32 a0, u32 a1, u32 a2)
-{
- u32 result;
- s32 var1;
+u32 func_80042108(u32 a0, u32 a1, u32 a2) {
+ u32 result;
+ s32 var1;
- var1 = func_800419B0(a0, a1, a2, 1);
+ var1 = func_800419B0(a0, a1, a2, 1);
- if (var1 << 4 < 0)
- result = 1;
- else
- result = 0;
+ if (var1 << 4 < 0) {
+ result = 1;
+ } else {
+ result = 0;
+ }
- return result;
+ return result;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_8004213C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042244.s")
-u8 func_80042538(CollisionContext *colCtx, s32 iParm2)
-{
+u8 func_80042538(CollisionContext* colCtx, s32 iParm2) {
u32 var1 = *(u32*)(iParm2 + 0xc);
- return var1;
+ return var1;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042548.s")
@@ -451,4 +426,3 @@ u8 func_80042538(CollisionContext *colCtx, s32 iParm2)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042EF8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_bgcheck/func_80042FC4.s")
-
diff --git a/src/code/z_camera.c b/src/code/z_camera.c
index aba96fe44..d7b0108d5 100644
--- a/src/code/z_camera.c
+++ b/src/code/z_camera.c
@@ -2,20 +2,19 @@
#include <global.h>
#include <vt.h>
-// Non-matchings functions marked with CLOSE are either a matter of regalloc or stack size and can possibly be fixed with the permutator.
+// Non-matchings functions marked with CLOSE are either a matter of regalloc or stack size and can possibly be fixed
+// with the permutator.
-typedef struct
-{
+typedef struct {
Vec3f unk_00;
Vec3f unk_0C;
- CollisionPoly *unk_18;
+ CollisionPoly* unk_18;
char unk_1C[0x8];
s32 unk_24;
} struct_80043D18;
// names for this struct's values come from a debug function, may want to rename
-typedef struct
-{
+typedef struct {
s8 code;
s8 z;
u16 T;
@@ -23,88 +22,77 @@ typedef struct
Vec3s pos;
} SplineData; // originally called SplinedatZ
-
// 47 lines
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800437F0.s")
// had an attempt at this but didn't get very close
-f32 func_8004389C(f32 a, f32 b, f32 c, f32 d)
-{
- f32 temp1 = a - b;
- f32 temp2;
- f32 ret;
-
- if (fabsf(temp1) >= d)
- {
- temp2 = temp1 * c;
- ret = b + temp2;
- }
- else
- ret = a;
-
- return ret;
+f32 func_8004389C(f32 a, f32 b, f32 c, f32 d) {
+ f32 temp1 = a - b;
+ f32 temp2;
+ f32 ret;
+
+ if (fabsf(temp1) >= d) {
+ temp2 = temp1 * c;
+ ret = b + temp2;
+ } else {
+ ret = a;
+ }
+
+ return ret;
}
-f32 func_800438DC(f32 a, f32 b, f32 c, f32 d)
-{
- f32 temp1 = a - b;
- f32 temp2;
- f32 ret;
-
- if (fabsf(temp1) >= d)
- {
- temp2 = temp1 * c;
- ret = b + temp2;
- }
- else
- ret = b;
-
- return ret;
+f32 func_800438DC(f32 a, f32 b, f32 c, f32 d) {
+ f32 temp1 = a - b;
+ f32 temp2;
+ f32 ret;
+
+ if (fabsf(temp1) >= d) {
+ temp2 = temp1 * c;
+ ret = b + temp2;
+ } else {
+ ret = b;
+ }
+
+ return ret;
}
-s16 func_8004391C(s16 a, s16 b, f32 c, s16 d)
-{
- s16 temp1 = a - b;
- s16 temp2;
- s32 ret;
-
- if (ABS(temp1) >= d)
- {
- temp2 = temp1 * c + 0.5f;
- ret = b + temp2;
- }
- else
- ret = a;
-
- return ret;
+s16 func_8004391C(s16 a, s16 b, f32 c, s16 d) {
+ s16 temp1 = a - b;
+ s16 temp2;
+ s32 ret;
+
+ if (ABS(temp1) >= d) {
+ temp2 = temp1 * c + 0.5f;
+ ret = b + temp2;
+ } else {
+ ret = a;
+ }
+
+ return ret;
}
-s16 func_800439AC(s16 a, s16 b, f32 c, s16 d)
-{
- s16 temp1 = a - b;
- s16 temp2;
- s32 ret;
-
- if (ABS(temp1) >= d)
- {
- temp2 = temp1 * c + 0.5f;
- ret = b + temp2;
- }
- else
- ret = b;
-
- return ret;
+s16 func_800439AC(s16 a, s16 b, f32 c, s16 d) {
+ s16 temp1 = a - b;
+ s16 temp2;
+ s32 ret;
+
+ if (ABS(temp1) >= d) {
+ temp2 = temp1 * c + 0.5f;
+ ret = b + temp2;
+ } else {
+ ret = b;
+ }
+
+ return ret;
}
-void func_80043A3C(Vec3f *a, Vec3f *b, f32 c, f32 d, f32 e)
-{
+void func_80043A3C(Vec3f* a, Vec3f* b, f32 c, f32 d, f32 e) {
b->x = func_8004389C(a->x, b->x, d, e);
b->y = func_8004389C(a->y, b->y, c, e);
b->z = func_8004389C(a->z, b->z, d, e);
}
-void func_80043ABC(Camera *camera)
-{
+void func_80043ABC(Camera* camera) {
camera->unk_C0.z = 100.0f;
camera->unk_C0.y = OREG(7);
camera->unk_C0.x = OREG(6);
@@ -113,8 +101,7 @@ void func_80043ABC(Camera *camera)
camera->unk_CC.z = OREG(4) * 0.01f;
}
-void func_80043B60(Camera *camera)
-{
+void func_80043B60(Camera* camera) {
camera->unk_C0.x = OREG(27);
camera->unk_C0.z = OREG(27);
camera->unk_C0.y = OREG(27);
@@ -123,8 +110,7 @@ void func_80043B60(Camera *camera)
camera->unk_CC.z = 0.001f;
}
-Vec3f *func_80043BC4(Vec3f *a, Vec3s *b)
-{
+Vec3f* func_80043BC4(Vec3f* a, Vec3s* b) {
Vec3f sp4;
sp4.x = b->x;
@@ -135,21 +121,19 @@ Vec3f *func_80043BC4(Vec3f *a, Vec3s *b)
return a;
}
-Vec3f *func_80043C28(Vec3f *a, Vec3f *b, struct_80045714 *c)
-{
+Vec3f* func_80043C28(Vec3f* a, Vec3f* b, struct_80045714* c) {
Vec3f sp24, sp18;
func_8007C25C(&sp18, c);
sp24.x = b->x + sp18.x;
sp24.y = b->y + sp18.y;
sp24.z = b->z + sp18.z;
-
+
*a = sp24;
return a;
}
-Vec3f *func_80043CAC(Vec3f *a, Vec3f *b, Vec3f *c, f32 d)
-{
+Vec3f* func_80043CAC(Vec3f* a, Vec3f* b, Vec3f* c, f32 d) {
Vec3f sp4;
sp4.x = b->x + (c->x * d);
@@ -160,12 +144,11 @@ Vec3f *func_80043CAC(Vec3f *a, Vec3f *b, Vec3f *c, f32 d)
return a;
}
-s32 func_80043D18(Camera *camera, Vec3f *b, struct_80043D18 *c)
-{
- CollisionContext *colCtx;
+s32 func_80043D18(Camera* camera, Vec3f* b, struct_80043D18* c) {
+ CollisionContext* colCtx;
Vec3f sp68, sp5C, sp50;
f32 temp_ret;
- CollisionPoly *sp48;
+ CollisionPoly* sp48;
s32 sp44;
struct_80045714 sp3C;
@@ -173,47 +156,44 @@ s32 func_80043D18(Camera *camera, Vec3f *b, struct_80043D18 *c)
func_8007C490(&sp3C, b, &c->unk_00);
sp3C.unk_00 += 8.0f;
func_80043C28(&sp5C, b, &sp3C);
-
- if (func_8003DD6C(colCtx, b, &sp5C, &sp68, &c->unk_18, 1, 1, 1, -1, &c->unk_24) == 0)
- {
+
+ if (func_8003DD6C(colCtx, b, &sp5C, &sp68, &c->unk_18, 1, 1, 1, -1, &c->unk_24) == 0) {
func_8007C0F8(&sp50, b, &c->unk_00);
-
+
c->unk_0C.x = -sp50.x;
c->unk_0C.y = -sp50.y;
c->unk_0C.z = -sp50.z;
-
+
sp68 = c->unk_00;
sp68.y += 5.0f;
temp_ret = func_8003CCA4(colCtx, &sp48, &sp44, &sp68);
-
- if ((c->unk_00.y - temp_ret) > 5.0f)
- {
+
+ if ((c->unk_00.y - temp_ret) > 5.0f) {
c->unk_00.x += c->unk_0C.x;
c->unk_00.y += c->unk_0C.y;
c->unk_00.z += c->unk_0C.z;
return 0;
}
-
+
c->unk_18 = sp48;
sp68.y = temp_ret + 1.0f;
c->unk_24 = sp44;
}
-
+
c->unk_0C.x = c->unk_18->norm.x * (1.f / 32767);
c->unk_0C.y = c->unk_18->norm.y * (1.f / 32767);
c->unk_0C.z = c->unk_18->norm.z * (1.f / 32767);
c->unk_00.x = c->unk_0C.x + sp68.x;
c->unk_00.y = c->unk_0C.y + sp68.y;
c->unk_00.z = c->unk_0C.z + sp68.z;
-
+
return sp44 + 1;
}
-void func_80043F34(Camera *camera, Vec3f *b, Vec3f *c)
-{
+void func_80043F34(Camera* camera, Vec3f* b, Vec3f* c) {
struct_80043D18 sp20;
Vec3s unused;
-
+
sp20.unk_00 = *c;
func_80043D18(camera, b, &sp20);
*c = sp20.unk_00;
@@ -222,11 +202,10 @@ void func_80043F34(Camera *camera, Vec3f *b, Vec3f *c)
// 242 lines
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80043F94.s")
-void func_80044340(Camera *camera, Vec3f *b, Vec3f *c)
-{
+void func_80044340(Camera* camera, Vec3f* b, Vec3f* c) {
struct_80043D18 sp20;
Vec3s unused;
-
+
sp20.unk_00 = *c;
func_80043F94(camera, b, &sp20);
*c = sp20.unk_00;
@@ -236,17 +215,15 @@ f32 func_80038B7C();
#ifdef NON_MATCHING
// ordering
-s32 func_800443A0(Camera *camera, Vec3f *b, Vec3f *c)
-{
+s32 func_800443A0(Camera* camera, Vec3f* b, Vec3f* c) {
s32 sp4C;
Vec3f sp40;
s32 sp3C;
s32 sp38;
- CollisionPoly *sp34;
-
+ CollisionPoly* sp34;
+
sp34 = NULL; // this is moved to the top when it should be done in the middle of the function args being loaded
- if (func_8003DD6C(&camera->globalCtx->colCtx, b, c, &sp40, &sp34, 1, 1, 1, 0, &sp38) != 0)
- {
+ if (func_8003DD6C(&camera->globalCtx->colCtx, b, c, &sp40, &sp34, 1, 1, 1, 0, &sp38) != 0) {
if (func_80038B7C(sp34, b) < 0.0f)
return 1;
}
@@ -256,21 +233,17 @@ s32 func_800443A0(Camera *camera, Vec3f *b, Vec3f *c)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800443A0.s")
#endif
-f32 func_8003C940(CollisionContext *, CollisionPoly **, s32 *, Vec3f *);
-f32 func_80044434(Camera *camera, Vec3f *b, Vec3f *c, s32 *d)
-{
+f32 func_8003C940(CollisionContext*, CollisionPoly**, s32*, Vec3f*);
+f32 func_80044434(Camera* camera, Vec3f* b, Vec3f* c, s32* d) {
s32 sp2C; // unused
- CollisionPoly *sp28;
+ CollisionPoly* sp28;
f32 temp_ret = func_8003C940(&camera->globalCtx->colCtx, &sp28, d, c);
-
- if (temp_ret == -32000.0f)
- {
+
+ if (temp_ret == -32000.0f) {
b->x = 0.0f;
b->z = 0.0f;
b->y = 1.0f;
- }
- else
- {
+ } else {
b->x = sp28->norm.x * (1.f / 32767);
b->y = sp28->norm.y * (1.f / 32767);
b->z = sp28->norm.z * (1.f / 32767);
@@ -279,32 +252,28 @@ f32 func_80044434(Camera *camera, Vec3f *b, Vec3f *c, s32 *d)
return temp_ret;
}
-void func_80044510(Camera *camera, Vec3f *b)
-{
+void func_80044510(Camera* camera, Vec3f* b) {
Vec3f sp2C, sp20;
s32 sp1C;
sp2C = *b;
sp2C.y += 80.0f;
-
+
func_80044434(camera, &sp20, &sp2C, &sp1C);
}
// 125 lines (loop)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80044568.s")
-s16 func_80044740(Camera *camera, s32 b)
-{
+s16 func_80044740(Camera* camera, s32 b) {
return func_80041A4C(&camera->globalCtx->colCtx, b, 50);
}
-void func_8004476C(Camera *camera)
-{
+void func_8004476C(Camera* camera) {
func_80041C10(&camera->globalCtx->colCtx, camera->unk_148, 50);
}
-s32 func_8004479C(Camera *camera, s32 *b, Vec3f *c)
-{
+s32 func_8004479C(Camera* camera, s32* b, Vec3f* c) {
s32 temp_ret;
PosRot sp20;
s32 ret;
@@ -312,77 +281,74 @@ s32 func_8004479C(Camera *camera, s32 *b, Vec3f *c)
func_8002EF44(&sp20, &camera->player->actor);
temp_ret = func_80041A28(&camera->globalCtx->colCtx, c, *b);
- if (func_80041A4C(&camera->globalCtx->colCtx, temp_ret, *b) == 0)
+ if (func_80041A4C(&camera->globalCtx->colCtx, temp_ret, *b) == 0) {
ret = -1;
- else
+ } else {
ret = temp_ret;
+ }
return ret;
}
-s32 func_8004481C(Camera *camera, s16 *arg1)
-{
- CollisionPoly *sp44;
+s32 func_8004481C(Camera* camera, s16* arg1) {
+ CollisionPoly* sp44;
s32 sp40; // unused
s32 sp3C;
PosRot sp28;
func_8002EF44(&sp28, &camera->player->actor);
sp28.pos.y += func_8002DC84(camera->player);
- if (func_8003C940(&camera->globalCtx->colCtx, &sp44, &sp3C, &sp28.pos) == -32000.0f)
- {
+ if (func_8003C940(&camera->globalCtx->colCtx, &sp44, &sp3C, &sp28.pos) == -32000.0f) {
return 0;
}
*arg1 = func_80041B80(&camera->globalCtx->colCtx, sp44, sp3C);
return func_80041C98(&camera->globalCtx->colCtx, sp44, sp3C);
}
-s32 func_800448CC(Camera *camera, f32 *b)
-{
+s32 func_800448CC(Camera* camera, f32* b) {
PosRot sp34;
s32 sp30;
s32 temp_ret;
func_8002EF44(&sp34, &camera->player->actor);
*b = sp34.pos.y;
-
- if (func_8004213C(camera->globalCtx, &camera->globalCtx->colCtx, sp34.pos.x, sp34.pos.z, b, &sp30) == 0)
- {
+
+ if (func_8004213C(camera->globalCtx, &camera->globalCtx->colCtx, sp34.pos.x, sp34.pos.z, b, &sp30) == 0) {
*b = -32000.0f;
return -1;
}
- if (!(camera->player->stateFlags1 & 0x8000000))
- {
+ if (!(camera->player->stateFlags1 & 0x8000000)) {
*b = -32000.0f;
return -1;
}
-
+
temp_ret = func_80042538(&camera->globalCtx->colCtx, sp30);
- if ((temp_ret <= 0) || (func_80042548(&camera->globalCtx->colCtx, sp30) <= 0))
+ if ((temp_ret <= 0) || (func_80042548(&camera->globalCtx->colCtx, sp30) <= 0)) {
return -2;
-
+ }
+
return temp_ret;
}
-f32 func_800449AC(Camera *camera, Vec3f *b, s32 *arg2)
-{
+f32 func_800449AC(Camera* camera, Vec3f* b, s32* arg2) {
PosRot sp2C;
f32 sp28;
s32 sp24;
func_8002EF44(&sp2C, &camera->player->actor);
sp28 = sp2C.pos.y;
-
- if (func_8004213C(camera->globalCtx, &camera->globalCtx->colCtx, b->x, b->z, &sp28, &sp24) == 0)
+
+ if (func_8004213C(camera->globalCtx, &camera->globalCtx->colCtx, b->x, b->z, &sp28, &sp24) == 0) {
return -32000.f;
- if (sp28 < b->y)
+ }
+ if (sp28 < b->y) {
return -32000.f;
+ }
*arg2 = func_8004259C(&camera->globalCtx->colCtx, sp24);
return sp28;
}
-s16 func_80044A74(Vec3f *a, Vec3f *b)
-{
+s16 func_80044A74(Vec3f* a, Vec3f* b) {
return Math_atan2f(b->x - a->x, b->z - a->z) * (180 / M_PI) * (32767.5f / 180) + 0.5f;
}
@@ -392,17 +358,17 @@ s16 func_80044A74(Vec3f *a, Vec3f *b)
// 143 lines (extremely confusing)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80044E68.s")
-f32 func_800450A4(Camera *camera, f32 b)
-{
+f32 func_800450A4(Camera* camera, f32 b) {
f32 ret;
-
- if (camera->unk_100 < (OREG(41) * 0.01f))
+
+ if (camera->unk_100 < (OREG(41) * 0.01f)) {
ret = OREG(41) * 0.01f;
- else if (b <= camera->unk_100)
+ } else if (b <= camera->unk_100) {
ret = b;
- else
+ } else {
ret = OREG(42) * 0.01f * camera->unk_100;
-
+ }
+
return ret;
}
@@ -415,17 +381,15 @@ f32 func_800450A4(Camera *camera, f32 b)
// 76 lines (unknown types)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80045350.s")
-void *func_8004545C(Vec3f *a, s32 b, s32 c, struct_80043D18 *d, struct_80043D18 *e)
-{
+void* func_8004545C(Vec3f* a, s32 b, s32 c, struct_80043D18* d, struct_80043D18* e) {
Vec3f sp24;
- if (func_800427B4(d->unk_18, e->unk_18, b, c, &sp24) == 0)
- {
+ if (func_800427B4(d->unk_18, e->unk_18, b, c, &sp24) == 0) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "camera: corner check no cross point %x %x\n" VT_RST, d, e);
*a = d->unk_00;
return a;
}
-
+
*a = sp24;
return a;
}
@@ -435,8 +399,7 @@ void *func_8004545C(Vec3f *a, s32 b, s32 c, struct_80043D18 *d, struct_80043D18
#ifdef NON_MATCHING
// CLOSE: stack is 4 bytes too big
-f32 func_80045714(Vec3f *a, s16 b, s16 c, f32 arg3)
-{
+f32 func_80045714(Vec3f* a, s16 b, s16 c, f32 arg3) {
struct_80045714 sp1C;
f32 sp18;
@@ -446,128 +409,124 @@ f32 func_80045714(Vec3f *a, s16 b, s16 c, f32 arg3)
return Math_Coss(b - c) * (sp18 * arg3);
}
#else
-f32 func_80045714(Vec3f *a, s16 b, s16 c, f32 arg3);
+f32 func_80045714(Vec3f* a, s16 b, s16 c, f32 arg3);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80045714.s")
#endif
f32 func_8007C0A8(f32, f32);
-s32 func_800457A8(Camera *camera, struct_80045714 *b, f32 c, s16 d)
-{
+s32 func_800457A8(Camera* camera, struct_80045714* b, f32 c, s16 d) {
f32 unused;
Vec3f sp50;
Vec3f sp44;
s32 unused2;
- PosRot *sp2C;
+ PosRot* sp2C;
f32 temp_ret;
-
+
temp_ret = func_8002DC84(camera->player);
sp50.x = 0.f;
sp50.z = 0.f;
sp50.y = temp_ret + c;
-
+
sp2C = &camera->unk_94;
- if (d != 0)
- {
+ if (d != 0) {
sp50.y -= func_8007C0A8(func_80045714(&camera->unk_108, sp2C->rot.y, b->unk_06, OREG(9)), temp_ret);
}
func_80043A3C(&sp50, &camera->unk_E4, camera->unk_CC.y, camera->unk_CC.x, 0.1f);
-
+
sp44.x = sp2C->pos.x + camera->unk_E4.x;
sp44.y = sp2C->pos.y + camera->unk_E4.y;
sp44.z = sp2C->pos.z + camera->unk_E4.z;
func_80043A3C(&sp44, &camera->unk_50, camera->unk_100, camera->unk_100, 0.2f);
-
+
return 1;
}
-f32 func_8007C028(Vec3f *, Vec3f *);
+f32 func_8007C028(Vec3f*, Vec3f*);
#ifdef NON_MATCHING
// CLOSE: regalloc
-s32 func_800458D4(Camera *camera, struct_80045714 *b, f32 c, f32 *d, s16 e)
-{
+s32 func_800458D4(Camera* camera, struct_80045714* b, f32 c, f32* d, s16 e) {
f32 phi_f2;
Vec3f sp60;
Vec3f sp54;
f32 temp_ret;
- PosRot *temp_s1;
+ PosRot* temp_s1;
f32 sp48;
s32 pad[2];
sp60.y = func_8002DC84(camera->player) + c;
sp60.x = 0.0f;
sp60.z = 0.0f;
-
+
temp_s1 = &camera->unk_94;
if (e != 0)
sp60.y -= func_80045714(&camera->unk_108, temp_s1->rot.y, b->unk_06, OREG(9));
-
+
sp48 = temp_s1->pos.y - *d;
temp_ret = Math_atan2f(sp48, func_8007C028(&camera->unk_50, &camera->unk_5C)); // f2 and f14 are swapped
-
+
if (OREG(32) * (M_PI / 180) < temp_ret)
phi_f2 = 1.0f - sinf(temp_ret - OREG(32) * (M_PI / 180));
else if (OREG(33) * (M_PI / 180) > temp_ret)
phi_f2 = 1.0f - sinf(OREG(33) * (M_PI / 180) - temp_ret);
else
phi_f2 = 1.0f;
-
+
sp60.y -= sp48 * phi_f2;
func_80043A3C(&sp60, &camera->unk_E4, OREG(29) * 0.01f, OREG(30) * 0.01f, 0.1f);
-
+
sp54.x = temp_s1->pos.x + camera->unk_E4.x;
sp54.y = temp_s1->pos.y + camera->unk_E4.y;
sp54.z = temp_s1->pos.z + camera->unk_E4.z;
func_80043A3C(&sp54, &camera->unk_50, camera->unk_100, camera->unk_100, 0.2f);
-
+
return 1;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800458D4.s")
#endif
-s32 func_80045B08(Camera *camera, struct_80045714 *b, f32 c, s16 d)
-{
+s32 func_80045B08(Camera* camera, struct_80045714* b, f32 c, s16 d) {
f32 phi_f2;
Vec3f sp48;
Vec3f sp3C;
f32 sp38; // unused
f32 temp_ret;
- PosRot *temp_s1;
+ PosRot* temp_s1;
sp48.y = func_8002DC84(camera->player) + c;
sp48.x = 0.0f;
sp48.z = 0.0f;
-
- temp_ret = Math_Sins((s32) d);
+
+ temp_ret = Math_Sins((s32)d);
temp_s1 = &camera->unk_94;
-
- if (temp_ret < 0.0f)
+
+ if (temp_ret < 0.0f) {
phi_f2 = Math_Coss(temp_s1->rot.y - b->unk_06);
- else
+ } else {
phi_f2 = -Math_Coss(temp_s1->rot.y - b->unk_06);
-
+ }
+
sp48.y -= temp_ret * phi_f2 * OREG(9);
func_80043A3C(&sp48, &camera->unk_E4, camera->unk_CC.y, camera->unk_CC.x, 0.1f);
-
+
sp3C.x = temp_s1->pos.x + camera->unk_E4.x;
sp3C.y = temp_s1->pos.y + camera->unk_E4.y;
sp3C.z = temp_s1->pos.z + camera->unk_E4.z;
func_80043A3C(&sp3C, &camera->unk_50, camera->unk_100, camera->unk_100, 0.2f);
-
+
return 1;
}
#ifdef NON_MATCHING
// someone who's not me can have fun with this function
-s32 func_80045C74(Camera *camera, struct_80045714 *b, f32 c, f32 *d, s16 arg4)
-{
+s32 func_80045C74(Camera* camera, struct_80045714* b, f32 c, f32* d, s16 arg4) {
Vec3f sp70;
Vec3f sp64;
f32 sp54;
- PosRot *sp3C;
+ PosRot* sp3C;
f32 temp;
f32 temp_f2;
f32 temp_ret_3;
@@ -577,72 +536,61 @@ s32 func_80045C74(Camera *camera, struct_80045714 *b, f32 c, f32 *d, s16 arg4)
sp70.y = func_8002DC84(camera->player) + c;
sp70.x = 0.0f;
sp70.z = 0.0f;
-
- if (PREG(76) != 0)
- {
- if (arg4 != 0)
- {
+
+ if (PREG(76) != 0) {
+ if (arg4 != 0) {
sp70.y -= func_80045714(&camera->unk_108, sp3C->rot.y, b->unk_06, OREG(9));
}
}
-
+
sp3C = &camera->unk_94;
-
- if ((sp3C->pos.y == camera->unk_104) || (camera->player->actor.gravity > -0.1f) || (camera->player->stateFlags1 & 0x200000))
- {
+
+ if ((sp3C->pos.y == camera->unk_104) || (camera->player->actor.gravity > -0.1f) ||
+ (camera->player->stateFlags1 & 0x200000)) {
*d = func_8004389C(sp3C->pos.y, *d, OREG(43) * 0.01f, 0.1f);
sp70.y -= sp3C->pos.y - *d;
func_80043A3C(&sp70, &camera->unk_E4, camera->unk_CC.y, camera->unk_CC.x, 0.1f);
- }
- else
- {
+ } else {
temp = sp3C->pos.y - *d;
- if (PREG(75) == 0)
- {
+ if (PREG(75) == 0) {
sp54 = func_8007C028(&camera->unk_50, &camera->unk_5C);
Math_atan2f(temp, sp54);
temp_f2 = Math_tanf(camera->unk_FC * 0.4f * (M_PI / 180)) * sp54;
-
- if (temp > temp_f2)
- {
+
+ if (temp > temp_f2) {
*d += temp - temp_f2;
phi_f20 = temp_f2;
- }
- else
- {
+ } else {
phi_f20 = temp;
- if (temp < -temp_f2)
- {
+ if (temp < -temp_f2) {
*d += temp + temp_f2;
phi_f20 = -temp_f2;
}
}
sp70.y -= phi_f20;
- }
- else
- {
+ } else {
temp_ret_3 = Math_atan2f(temp, func_8007C028(&camera->unk_50, &camera->unk_5C));
-
+
if (OREG(32) * (M_PI / 180) < temp_ret_3)
phi_f16 = 1.0f - sinf(temp_ret_3 - OREG(32) * (M_PI / 180));
else if (temp_ret_3 < OREG(33) * (M_PI / 180))
phi_f16 = 1.0f - sinf(OREG(33) * (M_PI / 180) - temp_ret_3);
else
phi_f16 = 1.0f;
-
+
sp70.y -= temp * phi_f16;
}
-
+
func_80043A3C(&sp70, &camera->unk_E4, OREG(29) * 0.01f, OREG(30) * 0.01f, 0.1f);
camera->unk_CC.y = OREG(29) * 0.01f;
camera->unk_CC.x = OREG(30) * 0.01f;
}
-
+
sp64.x = sp3C->pos.x + camera->unk_E4.x;
sp64.y = sp3C->pos.y + camera->unk_E4.y;
sp64.z = sp3C->pos.z + camera->unk_E4.z;
func_80043A3C(&sp64, &camera->unk_50, camera->unk_100, camera->unk_100, 0.2f);
-
+
return 1;
}
#else
@@ -652,141 +600,123 @@ s32 func_80045C74(Camera *camera, struct_80045714 *b, f32 c, f32 *d, s16 arg4)
// 421 lines
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800460A8.s")
-s32 func_800466F8(Camera *camera, struct_80045714 *b, f32 c, f32 *d, s16 e)
-{
+s32 func_800466F8(Camera* camera, struct_80045714* b, f32 c, f32* d, s16 e) {
s32 phi_v0;
Vec3f sp60;
Vec3f sp54;
f32 sp50; // unused
f32 sp4C; // unused
f32 sp48; // I doubt this is a Vec3f
- Player *sp44;
+ Player* sp44;
PosRot sp30;
sp48 = func_8002DC84(camera->player);
sp44 = camera->player;
func_8002EF44(&sp30, sp44->rideActor);
-
- if ((*(s32 *)((s32)(sp44->rideActor) + 0x1F0) & 4) != 0) // actors aren't this big, is rideActor a different type?
+
+ if ((*(s32*)((s32)(sp44->rideActor) + 0x1F0) & 4) != 0) { // actors aren't this big, is rideActor a different type?
phi_v0 = 1;
- else
+ } else {
phi_v0 = 0;
-
- if (phi_v0 != 0)
- {
+ }
+
+ if (phi_v0 != 0) {
sp30.pos.y -= 49.f;
*d = func_8004389C(sp30.pos.y, *d, 0.1f, 0.2f);
camera->unk_100 = func_8004389C(0.4f, camera->unk_100, 0.2f, 0.02f);
- }
- else
- {
+ } else {
*d = func_8004389C(sp30.pos.y, *d, 0.5f, 0.2f);
}
-
+
sp60.x = 0.0f;
sp60.z = 0.0f;
sp60.y = sp48 + c;
-
- if (e != 0)
+
+ if (e != 0) {
sp60.y -= func_80045714(&camera->unk_108, camera->unk_94.rot.y, b->unk_06, OREG(9));
-
+ }
+
func_80043A3C(&sp60, &camera->unk_E4, camera->unk_CC.y, camera->unk_CC.x, 0.1f);
-
+
sp54.x = camera->unk_E4.x + sp30.pos.x;
sp54.y = camera->unk_E4.y + sp30.pos.y;
sp54.z = camera->unk_E4.z + sp30.pos.z;
func_80043A3C(&sp54, &camera->unk_50, camera->unk_100, camera->unk_100, 0.2f);
-
+
return 1;
}
-void func_800468CC(Camera *camera, f32 b, f32 c, f32 d)
-{
+void func_800468CC(Camera* camera, f32 b, f32 c, f32 d) {
f32 sp1C;
f32 phi_f12;
- if (b < c)
- {
+ if (b < c) {
sp1C = c;
phi_f12 = OREG(6);
- }
- else if (d < b)
- {
+ } else if (d < b) {
sp1C = d;
phi_f12 = OREG(6);
- }
- else
- {
+ } else {
sp1C = b;
phi_f12 = 1.0f;
}
-
+
camera->unk_C0.x = func_8004389C(phi_f12, camera->unk_C0.x, OREG(25) * 0.01f, 0.1f);
func_8004389C(sp1C, camera->unk_DC, 1.f / camera->unk_C0.x, 0.2f);
}
-void func_800469C0(Camera *camera, f32 b, f32 c, f32 d, s16 e)
-{
+void func_800469C0(Camera* camera, f32 b, f32 c, f32 d, s16 e) {
f32 sp1C;
f32 phi_f12;
- if (b < c)
- {
+ if (b < c) {
sp1C = c;
-
- if (e != 0)
+
+ if (e != 0) {
phi_f12 = OREG(6) * 0.5f;
- else
+ } else {
phi_f12 = OREG(6);
- }
- else if (d < b)
- {
+ }
+ } else if (d < b) {
sp1C = d;
-
- if (e != 0)
+
+ if (e != 0) {
phi_f12 = OREG(6) * 0.5f;
- else
+ } else {
phi_f12 = OREG(6);
- }
- else
- {
+ }
+ } else {
sp1C = b;
-
- if (e != 0)
+
+ if (e != 0) {
phi_f12 = OREG(6);
- else
+ } else {
phi_f12 = 1.0f;
+ }
}
-
+
camera->unk_C0.x = func_8004389C(phi_f12, camera->unk_C0.x, OREG(25) * 0.01f, 0.1f);
func_8004389C(sp1C, camera->unk_DC, 1.f / camera->unk_C0.x, 0.2f);
}
#ifdef NON_MATCHING
// lots of regalloc and stack issues, but that's it
-void func_80046B44(Camera *camera, s16 b, s16 c, s16 d)
-{
+void func_80046B44(Camera* camera, s16 b, s16 c, s16 d) {
s16 sp1C;
s16 phi_v1;
s16 phi_v0;
f32 phi_a2;
phi_v1 = ABS(b);
- if (d > 0)
- {
+ if (d > 0) {
phi_v0 = Math_Coss(d) * d;
- }
- else
- {
+ } else {
phi_v0 = d;
}
sp1C = c - phi_v0;
- if (ABS(sp1C) < phi_v1)
- {
+ if (ABS(sp1C) < phi_v1) {
phi_a2 = (1.0f / camera->unk_C0.y) * 3.0f;
- }
- else
- {
+ } else {
phi_a2 = (1.0f / camera->unk_C0.y) * func_800437F0(0.8f, 1.0f - phi_v0 * (1.0f / OREG(5)));
}
func_8004391C(sp1C, b, phi_a2, 0xa);
@@ -797,33 +727,28 @@ void func_80046B44(Camera *camera, s16 b, s16 c, s16 d)
#ifdef NON_MATCHING
// stack, regalloc, tiny bit of ordering
-s16 func_80046CB4(Camera *camera, s16 b, s16 c, f32 d, f32 e)
-{
+s16 func_80046CB4(Camera* camera, s16 b, s16 c, f32 d, f32 e) {
f32 sp34;
s16 sp1C;
f32 temp_ret;
f32 phi_f14;
- s16 temp;
+ s16 temp;
- if (camera->unk_D8 > 0.001f)
- {
- temp = b - 0x7fff; // this is probably some kind of cast that I'm too stupid to know
+ if (camera->unk_D8 > 0.001f) {
+ temp = b - 0x7fff; // this is probably some kind of cast that I'm too stupid to know
sp1C = c - temp;
phi_f14 = (s16)(sp1C - 0x7fff) * 0.00003051851f;
- }
- else
- {
- temp = b - 0x7fff;
+ } else {
+ temp = b - 0x7fff;
sp1C = c - temp;
phi_f14 = OREG(48) * 0.01f;
}
temp_ret = func_800437F0(d, phi_f14);
sp34 = ((1.0f - temp_ret) * e) + temp_ret;
- if (sp34 < 0.0f)
- {
+ if (sp34 < 0.0f) {
sp34 = 0.0f;
}
- // ordering stuff here
+ // ordering stuff here
return (s16)((sp1C * sp34) * (1.0f / camera->unk_C0.z) * func_800437F0(0.5f, camera->unk_E0)) + b;
}
#else
@@ -833,8 +758,7 @@ s16 func_80046CB4(Camera *camera, s16 b, s16 c, f32 d, f32 e)
// 364 lines
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80046E20.s")
-s32 func_80047394(Camera *camera)
-{
+s32 func_80047394(Camera* camera) {
return 1;
}
@@ -847,13 +771,11 @@ s32 func_80047394(Camera *camera)
// Very long function (1,444 lines), 1 jtbl
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80052E0C.s")
-void Camera_DebugPrintSplineArray(char* name, s16 length, SplineData splines[])
-{
+void Camera_DebugPrintSplineArray(char* name, s16 length, SplineData splines[]) {
s32 i;
-
+
osSyncPrintf("static SplinedatZ %s[] = {\n", name);
- for (i = 0; i < length; i++)
- {
+ for (i = 0; i < length; i++) {
osSyncPrintf(" /* key frame %2d */ {\n", i);
osSyncPrintf(" /* code */ %d,\n", splines[i].code);
osSyncPrintf(" /* z */ %d,\n", splines[i].z);
@@ -865,8 +787,7 @@ void Camera_DebugPrintSplineArray(char* name, s16 length, SplineData splines[])
osSyncPrintf("};\n\n");
}
-void Camera_Vec3fCopy(Vec3f *src, Vec3f *dst)
-{
+void Camera_Vec3fCopy(Vec3f* src, Vec3f* dst) {
dst->x = src->x;
dst->y = src->y;
dst->z = src->z;
@@ -878,19 +799,14 @@ void Camera_Vec3fCopy(Vec3f *src, Vec3f *dst)
// 225 lines
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80057C6C.s")
-s32 func_8005AD40(Camera *camera, s32 a, s16 b, f32 c, s16 d, s16 e, s16 f);
+s32 func_8005AD40(Camera* camera, s32 a, s16 b, f32 c, s16 d, s16 e, s16 f);
-void func_80057FC4(Camera *camera)
-{
- if (camera != &camera->globalCtx->cameraCtx.activeCameras[0])
- {
+void func_80057FC4(Camera* camera) {
+ if (camera != &camera->globalCtx->cameraCtx.activeCameras[0]) {
camera->unk_154 = camera->unk_142 = 33;
camera->unk_14C &= ~0x4;
- }
- else if (camera->globalCtx->roomCtx.curRoom.mesh->polygon.type != 1)
- {
- switch (camera->globalCtx->roomCtx.curRoom.unk_03)
- {
+ } else if (camera->globalCtx->roomCtx.curRoom.mesh->polygon.type != 1) {
+ switch (camera->globalCtx->roomCtx.curRoom.unk_03) {
case 1:
func_8005AD40(camera, 0, -99, 0, 0, 18, 10);
camera->unk_154 = camera->unk_142 = 3;
@@ -907,17 +823,14 @@ void func_80057FC4(Camera *camera)
camera->unk_14C |= 4;
break;
}
- }
- else
- {
+ } else {
osSyncPrintf("camera: room type: prerender\n");
camera->unk_154 = camera->unk_142 = 33;
camera->unk_14C &= ~0x4;
}
}
-void Camera_Stub80058140(Camera *camera)
-{
+void Camera_Stub80058140(Camera* camera) {
}
// 135 lines (has lwl/lwr)
@@ -932,13 +845,13 @@ void Camera_Stub80058140(Camera *camera)
// 296 lines
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800588B4.s")
-s32 func_80058CF8(Camera *camera)
-{
+s32 func_80058CF8(Camera* camera) {
camera->unk_152 &= ~1;
-
- if (camera->globalCtx->roomCtx.curRoom.unk_02 == 3)
+
+ if (camera->globalCtx->roomCtx.curRoom.unk_02 == 3) {
camera->unk_152 |= 1;
-
+ }
+
return 1;
}
@@ -951,49 +864,47 @@ s32 func_80058CF8(Camera *camera)
// Long function, 866 lines (lots of debug symbols)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800591EC.s")
-void func_80059EC8(Camera *camera)
-{
- Camera *sp24 = camera->globalCtx->cameraCtx.activeCameraPtrs[0];
- Player *player = (Player *)camera->globalCtx->actorCtx.actorList[2].first;
-
- if (camera->unk_160 == 0)
- {
+void func_80059EC8(Camera* camera) {
+ Camera* sp24 = camera->globalCtx->cameraCtx.activeCameraPtrs[0];
+ Player* player = (Player*)camera->globalCtx->actorCtx.actorList[2].first;
+
+ if (camera->unk_160 == 0) {
func_800C0314(camera->globalCtx, camera->unk_162, 7);
-
- if ((camera->unk_162 == 0) && (camera->unk_168 != 0))
- {
+
+ if ((camera->unk_162 == 0) && (camera->unk_168 != 0)) {
player->actor.freeze = 0;
player->stateFlags1 &= ~0x20000000;
-
- if (player->action != 0)
- {
+
+ if (player->action != 0) {
func_8002DF54(camera->globalCtx, &player->actor, 7);
osSyncPrintf("camera: player demo end!!\n");
}
-
+
sp24->unk_14C |= 8;
}
- if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_14E]->unk_162 == camera->unk_164)
+ if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_14E]->unk_162 == camera->unk_164) {
camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_14E]->unk_162 = camera->unk_162;
-
- if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E == camera->unk_164)
+ }
+
+ if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E == camera->unk_164) {
camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E = camera->unk_14E;
+ }
- if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_164 == 0)
+ if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_164 == 0) {
camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_15E = 0;
-
+ }
+
camera->unk_162 = 0;
camera->unk_14E = camera->unk_162;
camera->unk_160 = -1;
camera->globalCtx->unk_10B05 = 0;
-
+
func_800C0384(camera->globalCtx, camera->unk_164);
}
}
-s32 func_8005A02C(Camera *camera)
-{
+s32 func_8005A02C(Camera* camera) {
camera->unk_14C |= 0xC;
camera->unk_14C &= ~(0x1000 | 0x8);
return 1;
@@ -1002,8 +913,7 @@ s32 func_8005A02C(Camera *camera)
// 275 lines (has 2 jtbls)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_8005A04C.s")
-void func_8005A444(Camera *camera, s16 b)
-{
+void func_8005A444(Camera* camera, s16 b) {
func_8005A04C(camera, b, 0);
}
@@ -1013,8 +923,7 @@ void func_8005A444(Camera *camera, s16 b)
// 154 lines (unknown arrays)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_8005A548.s")
-s32 func_8005A77C(Camera *camera, s16 b)
-{
+s32 func_8005A77C(Camera* camera, s16 b) {
return func_8005A548(camera, b, 0);
}
@@ -1036,95 +945,83 @@ s32 func_8005A77C(Camera *camera, s16 b)
// 118 lines (has 1 jtbl)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_8005AA90.s")
-s32 func_8005AC48(Camera *camera, s16 b)
-{
+s32 func_8005AC48(Camera* camera, s16 b) {
camera->unk_14C = b;
return 1;
}
-s32 func_8005AC60(Camera *camera)
-{
+s32 func_8005AC60(Camera* camera) {
camera->unk_15E = 0;
return 1;
}
-s32 func_8005AC6C(Camera *camera, s32 b, s32 c, Player *d, s16 e)
-{
+s32 func_8005AC6C(Camera* camera, s32 b, s32 c, Player* d, s16 e) {
PosRot sp24;
camera->unk_124 = b;
camera->unk_128 = c;
camera->unk_12C = e;
-
- if (camera->unk_12C != 0)
- {
+
+ if (camera->unk_12C != 0) {
camera->player = d;
func_8002EF44(&sp24, &d->actor);
camera->unk_94 = sp24;
-
+
camera->unk_156 = -1;
camera->unk_D8 = 0.0f;
camera->unk_E0 = 0.0f;
}
-
+
return 1;
}
-s16 func_8005ACFC(Camera *camera, s16 b)
-{
+s16 func_8005ACFC(Camera* camera, s16 b) {
camera->unk_14C |= b;
return camera->unk_14C;
}
-s16 func_8005AD1C(Camera *camera, s16 b)
-{
+s16 func_8005AD1C(Camera* camera, s16 b) {
camera->unk_14C &= ~b;
return camera->unk_14C;
}
-s32 func_8005AD40(Camera *camera, s32 a, s16 b, f32 c, s16 d, s16 e, s16 f)
-{
- if ((camera->unk_142 == 43) || (camera->unk_142 == 29))
+s32 func_8005AD40(Camera* camera, s32 a, s16 b, f32 c, s16 d, s16 e, s16 f) {
+ if ((camera->unk_142 == 43) || (camera->unk_142 == 29)) {
return 0;
-
+ }
+
camera->unk_00 = a;
camera->unk_06 = d;
camera->unk_08 = e;
camera->unk_0A = f;
camera->unk_04 = b;
-
- if (b == -99)
- {
+
+ if (b == -99) {
func_80045128(camera, camera->unk_144);
return -99;
}
-
- if (b == -1)
- {
+
+ if (b == -1) {
func_8005A77C(camera, 29);
osSyncPrintf(".... change default door camera (set %d)\n", 29);
- }
- else
- {
+ } else {
s32 ret = func_80044740(camera, b);
camera->unk_14A |= 0x40;
-
- if (func_8005A77C(camera, ret) >= 0)
- {
+
+ if (func_8005A77C(camera, ret) >= 0) {
camera->unk_148 = b;
camera->unk_14A |= 4;
}
-
+
// this is likely important for labelling unk_148 and unk_142
osSyncPrintf("....change door camera ID %d (set %d)\n", camera->unk_148, camera->unk_142);
}
-
+
func_80045128(camera, camera->unk_144);
return -1;
}
-s32 func_8005AE64(Camera *camera, Camera *otherCamera)
-{
+s32 func_8005AE64(Camera* camera, Camera* otherCamera) {
s32 unused;
Vec3f sp30;
@@ -1133,7 +1030,7 @@ s32 func_8005AE64(Camera *camera, Camera *otherCamera)
camera->unk_E4.z = 0.0f;
camera->unk_100 = 0.1f;
camera->unk_50 = otherCamera->unk_50;
-
+
sp30 = otherCamera->unk_5C;
camera->unk_74 = sp30;
camera->unk_5C = sp30;
@@ -1142,9 +1039,8 @@ s32 func_8005AE64(Camera *camera, Camera *otherCamera)
camera->unk_FC = otherCamera->unk_FC;
camera->unk_15A = otherCamera->unk_15A;
func_80043B60(camera);
-
- if (camera->player != NULL)
- {
+
+ if (camera->player != NULL) {
func_8002EF14(&camera->unk_94, &camera->player->actor);
camera->unk_E4.x = camera->unk_50.x - camera->unk_94.pos.x;
camera->unk_E4.y = camera->unk_50.y - camera->unk_94.pos.y;
@@ -1156,39 +1052,40 @@ s32 func_8005AE64(Camera *camera, Camera *otherCamera)
return 1;
}
-s32 func_8005AFA8()
-{
+s32 func_8005AFA8() {
return D_8011D394;
}
-Vec3f *func_8005AFB4(Vec3f *dst, Camera *camera)
-{
+Vec3f* func_8005AFB4(Vec3f* dst, Camera* camera) {
*dst = camera->unk_80;
return dst;
}
-void Camera_SetCameraData(Camera *camera, s16 b, s32 c, s32 d, s16 e, s16 f) // Unused
-{
- if (b & 0x1)
+// Unused
+void Camera_SetCameraData(Camera* camera, s16 b, s32 c, s32 d, s16 e, s16 f) {
+ if (b & 0x1) {
camera->unk_124 = c;
-
- if (b & 0x2)
+ }
+
+ if (b & 0x2) {
camera->unk_128 = d;
-
- if (b & 0x4)
+ }
+
+ if (b & 0x4) {
camera->unk_12C = e;
-
- if (b & 0x8)
+ }
+
+ if (b & 0x8) {
camera->unk_12E = f;
-
- if (b & 0x10)
+ }
+
+ if (b & 0x10) {
osSyncPrintf(VT_COL(RED, WHITE) "camera: setCameraData: last argument not alive!\n" VT_RST, b);
+ }
}
-s32 func_8005B044()
-{
- if (QREG(0) == 0)
- {
+s32 func_8005B044() {
+ if (QREG(0) == 0) {
QREG(2) = 1;
QREG(10) = -1;
QREG(11) = 100;
@@ -1217,25 +1114,22 @@ s32 func_8005B044()
QREG(57) = 30;
QREG(58) = 0;
}
-
+
QREG(65) = 50;
return 1;
}
-s32 func_8005B198()
-{
+s32 func_8005B198() {
return D_8011D3AC;
}
-s16 func_8005B1A4(Camera *camera)
-{
+s16 func_8005B1A4(Camera* camera) {
camera->unk_14C |= 0x8;
-
- if ((camera->unk_164 == 0) && (camera->globalCtx->cameraCtx.unk_5C0 != 0))
- {
+
+ if ((camera->unk_164 == 0) && (camera->globalCtx->cameraCtx.unk_5C0 != 0)) {
camera->globalCtx->cameraCtx.activeCameraPtrs[camera->globalCtx->cameraCtx.unk_5C0]->unk_14C |= 0x8;
return camera->globalCtx->cameraCtx.unk_5C0;
}
-
+
return camera->unk_164;
}
diff --git a/src/code/z_cheap_proc.c b/src/code/z_cheap_proc.c
index 48fd9b32a..4b9abb220 100644
--- a/src/code/z_cheap_proc.c
+++ b/src/code/z_cheap_proc.c
@@ -1,29 +1,29 @@
#include <ultra64.h>
#include <global.h>
-void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist)
-{
+void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 214);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 216), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 216),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, dlist);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 219);
}
-void Draw_DListXlu(GlobalContext* globalCtx, u32 dlist)
-{
+void Draw_DListXlu(GlobalContext* globalCtx, u32 dlist) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 228);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 230), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_cheap_proc.c", 230),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, dlist);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_cheap_proc.c", 233);
diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c
index 116059b18..b8a70550d 100644
--- a/src/code/z_collision_check.c
+++ b/src/code/z_collision_check.c
@@ -7,15 +7,13 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B65C.s")
-s32 func_8005B6A0(GlobalContext* globalCtx, Collider* collision)
-{
+s32 func_8005B6A0(GlobalContext* globalCtx, Collider* collision) {
return 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B6B0.s")
-s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src)
-{
+s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src) {
collision->actor = actor;
collision->unk_14 = src->unk_00;
collision->colliderFlags = src->colliderFlags;
@@ -26,8 +24,7 @@ s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, C
return 1;
}
-s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src)
-{
+s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderBodyInfo* src) {
collision->actor = actor;
collision->unk_14 = src->unk_00;
collision->colliderFlags = src->colliderFlags;
@@ -38,20 +35,17 @@ s32 func_8005B72C(GlobalContext* globalCtx, Collider* collision, Actor* actor, C
return 1;
}
-void func_8005B76C(GlobalContext* globalCtx, Collider* collision)
-{
+void func_8005B76C(GlobalContext* globalCtx, Collider* collision) {
collision->at = NULL;
collision->colliderFlags &= ~0x6;
}
-void func_8005B784(GlobalContext* globalCtx, Collider* collision)
-{
+void func_8005B784(GlobalContext* globalCtx, Collider* collision) {
collision->ac = NULL;
collision->collideFlags &= ~0x82;
}
-void func_8005B79C(GlobalContext* globalCtx, Collider* collision)
-{
+void func_8005B79C(GlobalContext* globalCtx, Collider* collision) {
collision->ot = NULL;
collision->maskA &= ~0x2;
collision->maskB &= ~0x1;
@@ -59,22 +53,18 @@ void func_8005B79C(GlobalContext* globalCtx, Collider* collision)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B7C0.s")
-s32 func_8005B7E4(GlobalContext* globalCtx, ColliderTouch* touch)
-{
+s32 func_8005B7E4(GlobalContext* globalCtx, ColliderTouch* touch) {
return 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B7F4.s")
-void func_8005B818(GlobalContext* globalCtx, ColliderBody* body)
-{
-
+void func_8005B818(GlobalContext* globalCtx, ColliderBody* body) {
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B824.s")
-s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump)
-{
+s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump) {
return 1;
}
@@ -82,15 +72,13 @@ s32 func_8005B850(GlobalContext* globalCtx, ColliderBump* bump)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B884.s")
-s32 func_8005B904(GlobalContext* globalCtx, ColliderBody* body)
-{
+s32 func_8005B904(GlobalContext* globalCtx, ColliderBody* body) {
func_8005B7E4(globalCtx, &body->toucher);
func_8005B850(globalCtx, &body->bumper);
return 1;
}
-s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfoInner* bodyInfoInner)
-{
+s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfoInner* bodyInfoInner) {
body->flags = bodyInfoInner->bodyFlags;
func_8005B7F4(globalCtx, &body->toucher, &bodyInfoInner->toucherMask);
func_8005B860(globalCtx, &body->bumper, &bodyInfoInner->bumperMask);
@@ -100,8 +88,7 @@ s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInfo
return 1;
}
-void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body)
-{
+void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body) {
body->unk_18 = 0;
body->unk_20 = 0;
body->toucherFlags &= ~0x2;
@@ -109,8 +96,7 @@ void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body)
func_8005B818(globalCtx, body);
}
-void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body)
-{
+void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body) {
body->bumper.unk_0A = 0;
body->bumperFlags &= ~0x2;
body->bumperFlags &= ~0x80;
@@ -120,15 +106,13 @@ void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body)
body->bumper.unk_06 = body->bumper.unk_0A;
}
-void func_8005BA1C(GlobalContext* globalCtx, ColliderBody* body)
-{
+void func_8005BA1C(GlobalContext* globalCtx, ColliderBody* body) {
body->flags2 &= ~0x2;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005BA30.s")
-s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1)
-{
+s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1) {
return 1;
}
@@ -158,73 +142,64 @@ s32 func_8005BA74(UNK_TYPE arg0, UNK_TYPE arg1)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C2BC.s")
-s32 func_8005C318(GlobalContext* globalCtx, ColliderDimensions* dim)
-{
+s32 func_8005C318(GlobalContext* globalCtx, ColliderDimensions* dim) {
return 1;
}
-s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDimensions* src)
-{
+s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDimensions* src) {
*dest = *src;
return 1;
}
-s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision)
-{
+s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
func_8005B65C(globalCtx, &collision->base);
func_8005B884(globalCtx, &collision->body);
func_8005C2BC(globalCtx, &collision->dim);
return 1;
}
-s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision)
-{
+s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
func_8005B6A0(globalCtx, &collision->base);
func_8005B904(globalCtx, &collision->body);
func_8005C318(globalCtx, &collision->dim);
return 1;
}
-s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* src)
-{
+s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* src) {
func_8005B6B0(globalCtx, &collision->base, &src->body);
func_8005B93C(globalCtx, &collision->body, &src->inner);
func_8005C328(globalCtx, &collision->dim, &src->dim);
return 1;
}
-s32 func_8005C450(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
-{
+s32 func_8005C450(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) {
func_8005B6EC(globalCtx, &collision->base, actor, &src->body);
func_8005B93C(globalCtx, &collision->body, &src->inner);
func_8005C328(globalCtx, &collision->dim, &src->dim);
return 1;
}
-s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
-{
+s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor,
+ ColliderCylinderInit* src) {
func_8005B72C(globalCtx, &collision->base, actor, &src->body);
func_8005B93C(globalCtx, &collision->body, &src->inner);
func_8005C328(globalCtx, &collision->dim, &src->dim);
return 1;
}
-s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision)
-{
+s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
func_8005B76C(globalCtx, &collision->base);
func_8005B9B0(globalCtx, &collision->body);
return 1;
}
-s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision)
-{
+s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
func_8005B784(globalCtx, &collision->base);
func_8005B9E8(globalCtx, &collision->body);
return 1;
}
-s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision)
-{
+s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
func_8005B79C(globalCtx, &collision->base);
func_8005BA1C(globalCtx, &collision->body);
return 1;
@@ -232,8 +207,7 @@ s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C5B0.s")
-s32 func_8005C5F8(UNK_TYPE arg0, UNK_TYPE arg1)
-{
+s32 func_8005C5F8(UNK_TYPE arg0, UNK_TYPE arg1) {
return 1;
}
@@ -269,55 +243,48 @@ s32 func_8005CEB4(GlobalContext* globalCtx, ColliderDimensions* dim) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005CF90.s")
-s32 func_8005D018(GlobalContext* globalCtx, ColliderCylinderMain* collision)
-{
+s32 func_8005D018(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
func_8005B65C(globalCtx, &collision->base);
func_8005B884(globalCtx, &collision->body);
func_8005CE6C(globalCtx, &collision->dim);
return 1;
}
-s32 func_8005D060(GlobalContext* globalCtx, ColliderCylinderMain* collision)
-{
+s32 func_8005D060(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
func_8005B6A0(globalCtx, &collision->base);
func_8005B904(globalCtx, &collision->body);
func_8005CEB4(globalCtx, &collision->dim);
return 1;
}
-s32 func_8005D0A8(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
-{
+s32 func_8005D0A8(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) {
func_8005B6EC(globalCtx, &collision->base, actor, &src->body);
func_8005B93C(globalCtx, &collision->body, &src->inner);
func_8005CF90(globalCtx, &collision->dim, &src->dim);
return 1;
}
-s32 func_8005D104(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src)
-{
+s32 func_8005D104(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) {
func_8005B72C(globalCtx, &collision->base, actor, &src->body);
func_8005B93C(globalCtx, &collision->body, &src->inner);
func_8005CF90(globalCtx, &collision->dim, &src->dim);
return 1;
}
-s32 func_8005D160(GlobalContext* globalCtx, ColliderCylinderMain* collision)
-{
+s32 func_8005D160(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
func_8005B76C(globalCtx, &collision->base);
func_8005B9B0(globalCtx, &collision->body);
func_8005CEC4(globalCtx, &collision->dim);
return 1;
}
-s32 func_8005D1A8(GlobalContext* globalCtx, ColliderCylinderMain* collision)
-{
+s32 func_8005D1A8(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
func_8005B784(globalCtx, &collision->base);
func_8005B9E8(globalCtx, &collision->body);
return 1;
}
-s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision)
-{
+s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
func_8005B79C(globalCtx, &collision->base);
func_8005BA1C(globalCtx, &collision->body);
return 1;
@@ -331,9 +298,7 @@ s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D3BC.s")
-void func_8005D400(UNK_TYPE arg0, UNK_TYPE arg1)
-{
-
+void func_8005D400(UNK_TYPE arg0, UNK_TYPE arg1) {
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D40C.s")
diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c
index 0625a2b54..cb5739477 100644
--- a/src/code/z_common_data.c
+++ b/src/code/z_common_data.c
@@ -1,8 +1,7 @@
#include <ultra64.h>
#include <global.h>
-void SaveContext_Init(void)
-{
+void SaveContext_Init(void) {
bzero(&gSaveContext, sizeof(gSaveContext));
D_8015FA88 = 0;
D_8015FA8C = 0;
@@ -18,4 +17,3 @@ void SaveContext_Init(void)
gSaveContext.transition_type = 0xFF;
gSaveContext.unk_13EE = 50;
}
-
diff --git a/src/code/z_construct.c b/src/code/z_construct.c
index 5555ed40f..59c6e11a4 100644
--- a/src/code/z_construct.c
+++ b/src/code/z_construct.c
@@ -1,15 +1,13 @@
-#include <ultra64.h>
+#include <ultra64.h>
#include <global.h>
-void func_80110990(GlobalContext* globalCtx)
-{
+void func_80110990(GlobalContext* globalCtx) {
func_80080F44(globalCtx);
}
#ifdef NON_MATCHING
// regalloc, stack usage and minor ordering differences
-void func_801109B0(GlobalContext* globalCtx)
-{
+void func_801109B0(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
s32 parameterStart;
s32 parameterSize;
@@ -32,9 +30,9 @@ void func_801109B0(GlobalContext* globalCtx)
interfaceCtx->unk_228 = XREG(95);
interfaceCtx->minimapAlpha = 0;
interfaceCtx->unk_260 = 0;
- interfaceCtx->unk_244 = interfaceCtx->aAlpha = interfaceCtx->bAlpha =
- interfaceCtx->cLeftAlpha = interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha =
- interfaceCtx->healthAlpha = interfaceCtx->startAlpha = interfaceCtx->magicAlpha = 0;
+ interfaceCtx->unk_244 = interfaceCtx->aAlpha = interfaceCtx->bAlpha = interfaceCtx->cLeftAlpha =
+ interfaceCtx->cDownAlpha = interfaceCtx->cRightAlpha = interfaceCtx->healthAlpha = interfaceCtx->startAlpha =
+ interfaceCtx->magicAlpha = 0;
parameterStart = _parameter_staticSegmentRomStart;
parameterSize = _parameter_staticSegmentRomEnd - parameterStart;
@@ -48,7 +46,7 @@ void func_801109B0(GlobalContext* globalCtx)
if (interfaceCtx->parameterSegment == NULL)
__assert("parameter->parameterSegment != NULL", "../z_construct.c", 161);
-
+
DmaMgr_SendRequest1(interfaceCtx->parameterSegment, parameterStart, parameterSize, "../z_construct.c", 162);
interfaceCtx->do_actionSegment = Game_Alloc(&globalCtx->state, 0x480, "../z_construct.c", 166);
@@ -69,7 +67,8 @@ void func_801109B0(GlobalContext* globalCtx)
else
do_actionOffset = 0x5700;
- DmaMgr_SendRequest1(interfaceCtx->do_actionSegment, do_actionStart + do_actionOffset, 0x300, "../z_construct.c", 174);
+ DmaMgr_SendRequest1(interfaceCtx->do_actionSegment, do_actionStart + do_actionOffset, 0x300, "../z_construct.c",
+ 174);
if (gSaveContext.language == 0)
do_actionOffset = 0x480;
@@ -78,7 +77,8 @@ void func_801109B0(GlobalContext* globalCtx)
else
do_actionOffset = 0x5B80;
- DmaMgr_SendRequest1((void*)((u32)interfaceCtx->do_actionSegment + 0x300), do_actionStart + do_actionOffset, 0x180, "../z_construct.c", 178);
+ DmaMgr_SendRequest1((void*)((u32)interfaceCtx->do_actionSegment + 0x300), do_actionStart + do_actionOffset, 0x180,
+ "../z_construct.c", 178);
interfaceCtx->icon_itemSegment = Game_Alloc(&globalCtx->state, 0x4000, "../z_construct.c", 190);
@@ -89,45 +89,42 @@ void func_801109B0(GlobalContext* globalCtx)
if (interfaceCtx->icon_itemSegment == NULL)
__assert("parameter->icon_itemSegment != NULL", "../z_construct.c", 193);
- osSyncPrintf("Register_Item[%x, %x, %x, %x]\n",
- gSaveContext.equips.button_items[0], gSaveContext.equips.button_items[1],
- gSaveContext.equips.button_items[2], gSaveContext.equips.button_items[3]);
+ osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.button_items[0],
+ gSaveContext.equips.button_items[1], gSaveContext.equips.button_items[2],
+ gSaveContext.equips.button_items[3]);
if (gSaveContext.equips.button_items[0] < 0xF0)
DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment,
- _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80,
- 0x1000, "../z_construct.c", 198);
+ _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000,
+ "../z_construct.c", 198);
else if (gSaveContext.equips.button_items[0] != 0xFF)
DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment,
- _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80,
- 0x1000, "../z_construct.c", 203);
+ _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000,
+ "../z_construct.c", 203);
if (gSaveContext.equips.button_items[1] < 0xF0)
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x1000),
- _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[1] * 0x80,
- 0x1000, "../z_construct.c", 209);
+ _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[1] * 0x80, 0x1000,
+ "../z_construct.c", 209);
if (gSaveContext.equips.button_items[2] < 0xF0)
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x2000),
- _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[2] * 0x80,
- 0x1000, "../z_construct.c", 214);
+ _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[2] * 0x80, 0x1000,
+ "../z_construct.c", 214);
if (gSaveContext.equips.button_items[3] < 0xF0)
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x3000),
- _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[3] * 0x80,
- 0x1000, "../z_construct.c", 219);
+ _icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[3] * 0x80, 0x1000,
+ "../z_construct.c", 219);
osSyncPrintf("EVENT=%d\n", gSaveContext.timer_1_state);
- if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8) ||
- (gSaveContext.timer_2_state == 4) || (gSaveContext.timer_2_state == 10))
- {
+ if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8) || (gSaveContext.timer_2_state == 4) ||
+ (gSaveContext.timer_2_state == 10)) {
osSyncPrintf("restart_flag=%d\n", gSaveContext.respawn_flag);
- if ((gSaveContext.respawn_flag == -1) || (gSaveContext.respawn_flag == 1))
- {
- if (gSaveContext.timer_1_state == 4)
- {
+ if ((gSaveContext.respawn_flag == -1) || (gSaveContext.respawn_flag == 1)) {
+ if (gSaveContext.timer_1_state == 4) {
gSaveContext.timer_1_state = 1;
gSaveContext.timer_x[0] = 140;
gSaveContext.timer_y[0] = 80;
@@ -147,8 +144,7 @@ void func_801109B0(GlobalContext* globalCtx)
gSaveContext.timer_y[temp] = 46;
}
- if ((gSaveContext.timer_1_state >= 11) && (gSaveContext.timer_1_state < 16))
- {
+ if ((gSaveContext.timer_1_state >= 11) && (gSaveContext.timer_1_state < 16)) {
gSaveContext.timer_1_state = 0;
// Translates to: "Timer Stop!!!!!!!!!!!!!!!!!!!!!!"
osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timer_1_state);
@@ -179,8 +175,7 @@ void func_801109B0(GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_construct/func_801109B0.s")
#endif
-void func_80110F68(GlobalContext* globalCtx)
-{
+void func_80110F68(GlobalContext* globalCtx) {
MessageContext* msgCtx = &globalCtx->msgCtx;
s32 pad;
@@ -202,16 +197,16 @@ void func_80110F68(GlobalContext* globalCtx)
// Translates to: "Textbox game_alloc=%x"
osSyncPrintf("吹き出しgame_alloc=%x\n", 0x2200);
- if (msgCtx->textboxSegment == NULL)
+ if (msgCtx->textboxSegment == NULL) {
__assert("message->fukidashiSegment != NULL", "../z_construct.c", 352);
+ }
func_8006EF10(&globalCtx->msgCtx.unk_128);
YREG(31) = 0;
}
-void func_80111070(void)
-{
+void func_80111070(void) {
YREG(8) = 0xA;
YREG(14) = 0;
YREG(15) = 0;
@@ -526,8 +521,7 @@ void func_80111070(void)
WREG(94) = 3;
WREG(95) = 6;
- if (gSaveContext.game_mode == 0)
- {
+ if (gSaveContext.game_mode == 0) {
VREG(0) = 0x34;
VREG(1) = 0x24;
VREG(2) = 0xD6;
@@ -618,7 +612,6 @@ void func_80111070(void)
VREG(92) = -0x3F;
}
-void func_80112098(GlobalContext* globalCtx)
-{
+void func_80112098(GlobalContext* globalCtx) {
func_80111070();
}
diff --git a/src/code/z_debug.c b/src/code/z_debug.c
index 451443a6b..e0c1c4f9f 100644
--- a/src/code/z_debug.c
+++ b/src/code/z_debug.c
@@ -5,73 +5,43 @@
#include <regs.h>
#include <PR/os_cont.h>
-typedef struct
-{
+typedef struct {
u8 x;
u8 y;
u8 colorId;
char text[0x15];
} PrintTextBuffer;
-typedef struct
-{
+typedef struct {
u16 push;
u16 held;
} InputCombo;
-GameInfo* gGameInfo;
-int D_8015FA94; //no known symbols
+GameInfo* gGameInfo;
+int D_8015FA94; // no known symbols
PrintTextBuffer D_8015FA98[0x16];
-s16 D_8011E0B0 = 0; //PrintTextBuffer index
+s16 D_8011E0B0 = 0; // PrintTextBuffer index
Color_RGBA8 printTextColors[] = {
- { 0xFF, 0xFF, 0x20, 0xC0 },
- { 0xFF, 0x96, 0x80, 0xC0 },
- { 0x80, 0x60, 0x00, 0x40 },
- { 0xC0, 0x80, 0x10, 0x80 },
- { 0xFF, 0xC0, 0x20, 0x80 },
- { 0xE6, 0xE6, 0xDC, 0x40 },
- { 0x80, 0x96, 0xFF, 0x80 },
- { 0x80, 0xFF, 0x20, 0x80 },
+ { 0xFF, 0xFF, 0x20, 0xC0 }, { 0xFF, 0x96, 0x80, 0xC0 }, { 0x80, 0x60, 0x00, 0x40 }, { 0xC0, 0x80, 0x10, 0x80 },
+ { 0xFF, 0xC0, 0x20, 0x80 }, { 0xE6, 0xE6, 0xDC, 0x40 }, { 0x80, 0x96, 0xFF, 0x80 }, { 0x80, 0xFF, 0x20, 0x80 },
};
InputCombo inputCombos[REG_GROUPS] = {
- { L_TRIG, U_CBUTTONS },
- { L_TRIG, L_CBUTTONS },
- { L_TRIG, D_CBUTTONS },
- { L_TRIG, A_BUTTON },
- { R_TRIG, D_CBUTTONS },
- { L_TRIG, R_CBUTTONS },
- { L_TRIG, R_TRIG },
- { L_TRIG, L_JPAD },
- { L_TRIG, R_JPAD },
- { L_TRIG, U_JPAD },
- { L_TRIG, B_BUTTON },
- { L_TRIG, Z_TRIG },
- { L_TRIG, D_JPAD },
- { R_TRIG, A_BUTTON },
- { R_TRIG, B_BUTTON },
- { R_TRIG, Z_TRIG },
- { R_TRIG, L_TRIG },
- { R_TRIG, U_CBUTTONS },
- { R_TRIG, R_CBUTTONS },
- { R_TRIG, L_JPAD },
- { R_TRIG, L_CBUTTONS },
- { R_TRIG, START_BUTTON },
- { L_TRIG, START_BUTTON },
- { R_TRIG, R_JPAD },
- { R_TRIG, U_JPAD },
- { START_BUTTON, R_TRIG },
- { START_BUTTON, A_BUTTON },
- { START_BUTTON, B_BUTTON },
+ { L_TRIG, U_CBUTTONS }, { L_TRIG, L_CBUTTONS }, { L_TRIG, D_CBUTTONS }, { L_TRIG, A_BUTTON },
+ { R_TRIG, D_CBUTTONS }, { L_TRIG, R_CBUTTONS }, { L_TRIG, R_TRIG }, { L_TRIG, L_JPAD },
+ { L_TRIG, R_JPAD }, { L_TRIG, U_JPAD }, { L_TRIG, B_BUTTON }, { L_TRIG, Z_TRIG },
+ { L_TRIG, D_JPAD }, { R_TRIG, A_BUTTON }, { R_TRIG, B_BUTTON }, { R_TRIG, Z_TRIG },
+ { R_TRIG, L_TRIG }, { R_TRIG, U_CBUTTONS }, { R_TRIG, R_CBUTTONS }, { R_TRIG, L_JPAD },
+ { R_TRIG, L_CBUTTONS }, { R_TRIG, START_BUTTON }, { L_TRIG, START_BUTTON }, { R_TRIG, R_JPAD },
+ { R_TRIG, U_JPAD }, { START_BUTTON, R_TRIG }, { START_BUTTON, A_BUTTON }, { START_BUTTON, B_BUTTON },
{ START_BUTTON, R_CBUTTONS },
};
char regChar[] = " SOPQMYDUIZCNKXcsiWAVHGmnBdkb";
-//initialize GameInfo
-void func_800636C0()
-{
+// initialize GameInfo
+void func_800636C0() {
s32 i;
gGameInfo = (GameInfo*)SystemArena_MallocDebug(sizeof(GameInfo), "../z_debug.c", 260);
@@ -80,26 +50,22 @@ void func_800636C0()
gGameInfo->regCur = 0;
gGameInfo->dpadLast = 0;
gGameInfo->repeat = 0;
- for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++)
- {
+ for (i = 0; i < ARRAY_COUNT(gGameInfo->data); i++) {
gGameInfo->data[i] = 0;
}
}
-//Called when free movement is active.
-//8011D394 to enable camera debugger
-void func_8006375C(s32 arg0, s32 arg1, float* d_80855320)
-{
-
+// Called when free movement is active.
+// 8011D394 to enable camera debugger
+void func_8006375C(s32 arg0, s32 arg1, float* d_80855320) {
}
-#ifdef NON_MATCHING //regalloc
-//Copy Camera Debugger Text
-void func_8006376C(u8 x, u8 y, u8 colorId, const char* text)
-{
+#ifdef NON_MATCHING // regalloc
+// Copy Camera Debugger Text
+void func_8006376C(u8 x, u8 y, u8 colorId, const char* text) {
PrintTextBuffer* buf;
char* bufText;
- s16 i; //v1
+ s16 i; // v1
buf = &D_8015FA98[D_8011E0B0];
if (D_8011E0B0 < 0x16) {
@@ -112,9 +78,11 @@ void func_8006376C(u8 x, u8 y, u8 colorId, const char* text)
bufText = buf->text + 1;
if (*buf->text = *text++) {
- do if (i++ > 0x14) {
- break;
- } while (*bufText++ = *text++);
+ do
+ if (i++ > 0x14) {
+ break;
+ }
+ while (*bufText++ = *text++);
}
*bufText = '\0';
@@ -124,34 +92,31 @@ void func_8006376C(u8 x, u8 y, u8 colorId, const char* text)
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_debug/func_8006376C.s")
-#endif
+#endif
-//Draw Text
-void func_80063828(GfxPrint* gfxPrint)
-{
+// Draw Text
+void func_80063828(GfxPrint* gfxPrint) {
s32 i;
Color_RGBA8* color;
PrintTextBuffer* buffer;
char* text;
i = 0;
- if (D_8011E0B0 > 0)
- {
- do
- {
+ if (D_8011E0B0 > 0) {
+ do {
buffer = &D_8015FA98[i];
text = buffer->text;
color = &printTextColors[buffer->colorId];
GfxPrint_SetColor(gfxPrint, color->r, color->g, color->b, color->a);
GfxPrint_SetPos(gfxPrint, buffer->x, buffer->y);
- GfxPrint_Printf(gfxPrint, "%s", text);
+ GfxPrint_Printf(gfxPrint, "%s", text);
i += 1;
} while (i < D_8011E0B0);
}
}
-//Edit REG
+// Edit REG
void func_8006390C(Input* input) {
s32 dpad;
@@ -162,18 +127,14 @@ void func_8006390C(Input* input) {
regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE;
dpad = input->raw.pad & 0xF00;
- if (!~(input->raw.pad | ~L_TRIG) ||
- !~(input->raw.pad | ~R_TRIG) ||
- !~(input->raw.pad | ~START_BUTTON)) {
+ if (!~(input->raw.pad | ~L_TRIG) || !~(input->raw.pad | ~R_TRIG) || !~(input->raw.pad | ~START_BUTTON)) {
input_combo = inputCombos;
- for (i = 0; i < REG_GROUPS; i++)
- {
- if (~(~input_combo->push | input->raw.pad) ||
- ~(~input_combo->held | input->padPressed)) {
+ for (i = 0; i < REG_GROUPS; i++) {
+ if (~(~input_combo->push | input->raw.pad) || ~(~input_combo->held | input->padPressed)) {
input_combo++;
- }
- else
+ } else {
break;
+ }
}
if (i < REG_GROUPS) {
@@ -184,10 +145,8 @@ void func_8006390C(Input* input) {
gGameInfo->regGroup = i;
gGameInfo->regPage = 0;
}
- }
- else {
- switch (gGameInfo->regPage - 1)
- {
+ } else {
+ switch (gGameInfo->regPage - 1) {
case 0:
case 1:
case 2:
@@ -195,80 +154,73 @@ void func_8006390C(Input* input) {
case 4:
case 5:
- if (dpad == gGameInfo->dpadLast) {
- gGameInfo->repeat--;
- if (gGameInfo->repeat < 0) {
- gGameInfo->repeat = 1;
+ if (dpad == gGameInfo->dpadLast) {
+ gGameInfo->repeat--;
+ if (gGameInfo->repeat < 0) {
+ gGameInfo->repeat = 1;
+ } else {
+ dpad ^= gGameInfo->dpadLast;
+ }
+ } else {
+ gGameInfo->repeat = 0x10;
+ gGameInfo->dpadLast = dpad;
}
- else {
- dpad ^= gGameInfo->dpadLast;
- }
- }
- else {
- gGameInfo->repeat = 0x10;
- gGameInfo->dpadLast = dpad;
- }
- increment =
- (dpad & R_JPAD) ? (
- !~(input->raw.pad | ~(A_BUTTON | B_BUTTON)) ? 1000 :
- !~(input->raw.pad | ~A_BUTTON) ? 100 :
- !~(input->raw.pad | ~B_BUTTON) ? 10 : 1) :
- (dpad & L_JPAD) ? (
- !~(input->raw.pad | ~(A_BUTTON | B_BUTTON)) ? -1000 :
- !~(input->raw.pad | ~A_BUTTON) ? -100 :
- !~(input->raw.pad | ~B_BUTTON) ? -10 : -1) :
- 0;
-
- gGameInfo->data[gGameInfo->regCur + regGroup] += increment;
- if (dpad & U_JPAD) {
- gGameInfo->regCur--;
- if (gGameInfo->regCur < 0) {
- gGameInfo->regCur = REG_PER_PAGE - 1;
+ increment = (dpad & R_JPAD)
+ ? (!~(input->raw.pad | ~(A_BUTTON | B_BUTTON))
+ ? 1000
+ : !~(input->raw.pad | ~A_BUTTON) ? 100 : !~(input->raw.pad | ~B_BUTTON) ? 10 : 1)
+ : (dpad & L_JPAD) ? (!~(input->raw.pad | ~(A_BUTTON | B_BUTTON))
+ ? -1000
+ : !~(input->raw.pad | ~A_BUTTON)
+ ? -100
+ : !~(input->raw.pad | ~B_BUTTON) ? -10 : -1)
+ : 0;
+
+ gGameInfo->data[gGameInfo->regCur + regGroup] += increment;
+ if (dpad & U_JPAD) {
+ gGameInfo->regCur--;
+ if (gGameInfo->regCur < 0) {
+ gGameInfo->regCur = REG_PER_PAGE - 1;
+ }
+ } else if (dpad & D_JPAD) {
+ gGameInfo->regCur++;
+ if (gGameInfo->regCur >= REG_PER_PAGE) {
+ gGameInfo->regCur = 0;
+ }
}
- }
- else if (dpad & D_JPAD) {
- gGameInfo->regCur++;
- if (gGameInfo->regCur >= REG_PER_PAGE) {
- gGameInfo->regCur = 0;
+ if (iREG(0)) {
+ iREG(0) = 0;
+ func_800AA000(0, iREG(1), iREG(2), iREG(3));
}
- }
- if (iREG(0)) {
- iREG(0) = 0;
- func_800AA000(0, iREG(1), iREG(2), iREG(3));
- }
}
}
}
-//Draw Memory Viewer
-void func_80063C04(GfxPrint* gfxPrint)
-{
+// Draw Memory Viewer
+void func_80063C04(GfxPrint* gfxPrint) {
s32 i;
s32 page;
s32 regGroup;
- s32 test; //removing affects stack
+ s32 test; // removing affects stack
char name[3];
page = (gGameInfo->regPage * REG_PER_PAGE) - REG_PER_PAGE;
regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE;
- //set up register name string
+ // set up register name string
name[0] = 'R';
- name[1] = regChar[gGameInfo->regGroup]; //r_group type char
+ name[1] = regChar[gGameInfo->regGroup]; // r_group type char
name[2] = '\0';
GfxPrint_SetColor(gfxPrint, 0, 0x80, 0x80, 0x80);
- for (i = 0; i != REG_PER_PAGE; i++)
- {
- if (i == gGameInfo->regCur)
- {
+ for (i = 0; i != REG_PER_PAGE; i++) {
+ if (i == gGameInfo->regCur) {
GfxPrint_SetColor(gfxPrint, 0, 0xff, 0xff, 0xff);
}
GfxPrint_SetPos(gfxPrint, 3, i + 5);
GfxPrint_Printf(gfxPrint, "%s%02d%6d", &name, page + i, gGameInfo->data[i + regGroup]);
- if (i == gGameInfo->regCur)
- {
+ if (i == gGameInfo->regCur) {
GfxPrint_SetColor(gfxPrint, 0, 0x80, 0x80, 0x80);
}
}
@@ -281,7 +233,7 @@ void func_80063D7C(GraphicsContext* gfxCtx) {
void* unk2[6];
GfxPrint gfxPrint;
void* unk[2];
- Gfx* dlFrame[4]; //stores state of GfxCtx next ptrs
+ Gfx* dlFrame[4]; // stores state of GfxCtx next ptrs
func_800C6AC4(&dlFrame, gfxCtx, "../z_debug.c", 628);
GfxPrint_Ctor(&gfxPrint);
@@ -303,7 +255,7 @@ void func_80063D7C(GraphicsContext* gfxCtx) {
gSPEndDisplayList(sp7C++);
func_800C6C28(sp78, sp7C);
gfxCtx->polyOpa.p = sp7C;
- if (0);
+ if (0) {}
func_800C6B54(&dlFrame, gfxCtx, "../z_debug.c", 664);
GfxPrint_Dtor(&gfxPrint);
}
diff --git a/src/code/z_debug_display.c b/src/code/z_debug_display.c
index e961e9c74..e27afafeb 100644
--- a/src/code/z_debug_display.c
+++ b/src/code/z_debug_display.c
@@ -1,25 +1,22 @@
#include <ultra64.h>
#include <global.h>
-typedef struct
-{
+typedef struct {
/* 0x00 */ s16 drawType; // indicates which draw function to use when displaying the object
- /* 0x04 */ u32 drawArg; // segment address (display list or texture) passed to the draw funciton when called
-} DebugDispObjectInfo; // size = 0x8
+ /* 0x04 */ u32 drawArg; // segment address (display list or texture) passed to the draw funciton when called
+} DebugDispObjectInfo; // size = 0x8
typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, u32, GlobalContext*);
static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx);
static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx);
-static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] =
-{
+static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] = {
DebugDisplay_DrawSpriteI8,
DebugDisplay_DrawPolygon,
};
-static DebugDispObjectInfo sDebugObjectInfoTable[] =
-{
+static DebugDispObjectInfo sDebugObjectInfoTable[] = {
{ 0, 0x040035F0 }, // Circle
{ 0, 0x040038F0 }, // Cross
{ 0, 0x040036F0 }, // Ball
@@ -32,15 +29,13 @@ static Lights1 sDebugObjectLights = gdSPDefLights1(0x80, 0x80, 0x80, 0xFF, 0xFF,
static DebugDispObject* sDebugObjectListHead;
-void DebugDisplay_Init(void)
-{
+void DebugDisplay_Init(void) {
sDebugObjectListHead = NULL;
}
-DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ,
- f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha,
- s16 type, GraphicsContext* gfxCtx)
-{
+DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX,
+ f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type,
+ GraphicsContext* gfxCtx) {
DebugDispObject* prevHead = sDebugObjectListHead;
sDebugObjectListHead = Graph_Alloc(gfxCtx, sizeof(DebugDispObject));
@@ -64,21 +59,18 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX,
return sDebugObjectListHead;
}
-void DebugDisplay_DrawObjects(GlobalContext* globalCtx)
-{
+void DebugDisplay_DrawObjects(GlobalContext* globalCtx) {
DebugDispObject* dispObj = sDebugObjectListHead;
DebugDispObjectInfo* objInfo;
- while (dispObj != NULL)
- {
+ while (dispObj != NULL) {
objInfo = &sDebugObjectInfoTable[dispObj->type];
sDebugObjectDrawFuncTable[objInfo->drawType](dispObj, objInfo->drawArg, globalCtx);
dispObj = dispObj->next;
}
}
-static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx)
-{
+static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4];
@@ -93,24 +85,17 @@ static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, Glo
Matrix_Mult(&globalCtx->mf_11DA0, MTXMODE_APPLY);
Matrix_RotateXYZ(dispObj->rot.x, dispObj->rot.y, dispObj->rot.z, MTXMODE_APPLY);
- gDPLoadTextureBlock(gfxCtx->polyXlu.p++,
- texture,
- G_IM_FMT_I,
- G_IM_SIZ_8b,
- 16, 16,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
- G_TX_NOLOD, G_TX_NOLOD);
-
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 189), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gDPLoadTextureBlock(gfxCtx->polyXlu.p++, texture, G_IM_FMT_I, G_IM_SIZ_8b, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
+
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 189),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_04004298);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_debug_display.c", 192);
}
-static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx)
-{
+static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4];
@@ -124,7 +109,8 @@ static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, Global
func_800D1694(dispObj->pos.x, dispObj->pos.y, dispObj->pos.z, &dispObj->rot);
Matrix_Scale(dispObj->scale.x, dispObj->scale.y, dispObj->scale.z, MTXMODE_APPLY);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 228), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_debug_display.c", 228),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, dlist);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_debug_display.c", 231);
diff --git a/src/code/z_demo.c b/src/code/z_demo.c
index c24ab06ad..bbc125e26 100644
--- a/src/code/z_demo.c
+++ b/src/code/z_demo.c
@@ -13,70 +13,34 @@ void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx);
void func_80068D84(GlobalContext* globalCtx, CutsceneContext* csCtx);
void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx);
-CutsceneStateHandler sCsStateHandlers1[] =
-{
- func_80064720,
- func_80064760,
- func_80064720,
- func_80068D84,
- func_80064720,
+CutsceneStateHandler sCsStateHandlers1[] = {
+ func_80064720, func_80064760, func_80064720, func_80068D84, func_80064720,
};
-CutsceneStateHandler sCsStateHandlers2[] =
-{
- func_80064720,
- func_800647C0,
- func_80068C3C,
- func_80068DC0,
- func_80068C3C,
+CutsceneStateHandler sCsStateHandlers2[] = {
+ func_80064720, func_800647C0, func_80068C3C, func_80068DC0, func_80068C3C,
};
u8 sTitleCsState = 0;
// TODO: use symbols for these cutscene locations once scenes and rooms are in C
-EntranceCutscene sEntranceCutsceneTable[] =
-{
- { 0x0185, 2, 0xA0, 0x02013AA0 },
- { 0x013D, 2, 0xA1, 0x02007EA0 },
- { 0x00DB, 2, 0xA3, 0x0200A540 },
- { 0x0108, 2, 0xA4, 0x02003D70 },
- { 0x0138, 1, 0xA5, 0x02003F40 },
- { 0x014D, 2, 0xA6, 0x02008400 },
- { 0x0053, 2, 0xA7, 0x0200CE00 },
- { 0x0000, 2, 0xA8, 0x0200B650 },
- { 0x028A, 0, 0x18, 0x0200F9E0 },
- { 0x0292, 0, 0x18, 0x0200FF00 },
- { 0x028E, 0, 0x18, 0x02010550 },
- { 0x0476, 0, 0x18, 0x02010B30 },
- { 0x050F, 1, 0xA9, 0x0200BB80 },
- { 0x0102, 2, 0xB1, 0x02007A30 },
- { 0x0117, 2, 0xB2, 0x020031E0 },
- { 0x0129, 2, 0xB3, 0x02006490 },
- { 0x0157, 2, 0xB4, 0x02005BD0 },
- { 0x0028, 2, 0xB5, 0x02015600 },
- { 0x00E4, 2, 0xB6, 0x020070C0 },
- { 0x0225, 2, 0xB7, 0x02004A80 },
- { 0x0123, 2, 0xB8, 0x02007990 },
- { 0x0147, 2, 0xB9, 0x020076D0 },
- { 0x0138, 0, 0xBA, 0x02004280 },
- { 0x0574, 2, 0x5A, 0x020028E0 },
- { 0x0538, 2, 0xBB, 0x0201E790 },
- { 0x053C, 2, 0xBC, 0x0201EF70 },
- { 0x0540, 2, 0xBD, 0x02021380 },
- { 0x0544, 2, 0xBE, 0x0201E3E0 },
- { 0x0548, 2, 0xBF, 0x0201DF90 },
- { 0x054C, 2, 0xAD, 0x0201EB40 },
- { 0x008D, 0, 0xC0, 0x02002BB0 },
- { 0x03B4, 0, 0xC7, 0x020055C0 },
- { 0x0246, 2, 0xB9, 0x020076D0 },
+EntranceCutscene sEntranceCutsceneTable[] = {
+ { 0x0185, 2, 0xA0, 0x02013AA0 }, { 0x013D, 2, 0xA1, 0x02007EA0 }, { 0x00DB, 2, 0xA3, 0x0200A540 },
+ { 0x0108, 2, 0xA4, 0x02003D70 }, { 0x0138, 1, 0xA5, 0x02003F40 }, { 0x014D, 2, 0xA6, 0x02008400 },
+ { 0x0053, 2, 0xA7, 0x0200CE00 }, { 0x0000, 2, 0xA8, 0x0200B650 }, { 0x028A, 0, 0x18, 0x0200F9E0 },
+ { 0x0292, 0, 0x18, 0x0200FF00 }, { 0x028E, 0, 0x18, 0x02010550 }, { 0x0476, 0, 0x18, 0x02010B30 },
+ { 0x050F, 1, 0xA9, 0x0200BB80 }, { 0x0102, 2, 0xB1, 0x02007A30 }, { 0x0117, 2, 0xB2, 0x020031E0 },
+ { 0x0129, 2, 0xB3, 0x02006490 }, { 0x0157, 2, 0xB4, 0x02005BD0 }, { 0x0028, 2, 0xB5, 0x02015600 },
+ { 0x00E4, 2, 0xB6, 0x020070C0 }, { 0x0225, 2, 0xB7, 0x02004A80 }, { 0x0123, 2, 0xB8, 0x02007990 },
+ { 0x0147, 2, 0xB9, 0x020076D0 }, { 0x0138, 0, 0xBA, 0x02004280 }, { 0x0574, 2, 0x5A, 0x020028E0 },
+ { 0x0538, 2, 0xBB, 0x0201E790 }, { 0x053C, 2, 0xBC, 0x0201EF70 }, { 0x0540, 2, 0xBD, 0x02021380 },
+ { 0x0544, 2, 0xBE, 0x0201E3E0 }, { 0x0548, 2, 0xBF, 0x0201DF90 }, { 0x054C, 2, 0xAD, 0x0201EB40 },
+ { 0x008D, 0, 0xC0, 0x02002BB0 }, { 0x03B4, 0, 0xC7, 0x020055C0 }, { 0x0246, 2, 0xB9, 0x020076D0 },
{ 0x05E8, 2, 0xC6, 0x0200C9D0 },
};
// Unused, seems to be an early list of dungeon entrance cutscene locations
-u32 D_8011E304[] =
-{
- 0x0200B650, 0x02015600, 0x02014F80, 0x02003F80, 0x02000330, 0x0201DA50
-};
+u32 D_8011E304[] = { 0x0200B650, 0x02015600, 0x02014F80, 0x02003F80, 0x02000330, 0x0201DA50 };
u16 D_8015FCC0;
u16 D_8015FCC2;
@@ -84,14 +48,13 @@ u16 D_8015FCC4;
s16 D_8015FCC6;
u8 D_8015FCC8;
s16 D_8015FCCA;
-u16 D_8015FCCC; // only written to, never read
+u16 D_8015FCCC; // only written to, never read
s8 D_8015FCD0[20]; // unreferenced
-u8 D_8015FCE4; // only written to, never read
+u8 D_8015FCE4; // only written to, never read
void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void Cutscene_DrawDebugInfo(GlobalContext* globalCtx, Gfx** dlist, CutsceneContext* csCtx)
-{
+void Cutscene_DrawDebugInfo(GlobalContext* globalCtx, Gfx** dlist, CutsceneContext* csCtx) {
u8 pad[0x1C];
GfxPrint printer;
u8 pad2[8];
@@ -110,47 +73,42 @@ void Cutscene_DrawDebugInfo(GlobalContext* globalCtx, Gfx** dlist, CutsceneConte
GfxPrint_Dtor(&printer);
}
-void func_8006450C(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
+void func_8006450C(GlobalContext* globalCtx, CutsceneContext* csCtx) {
csCtx->state = CS_STATE_IDLE;
csCtx->unk_0C = 0.0f;
}
-void func_80064520(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
+void func_80064520(GlobalContext* globalCtx, CutsceneContext* csCtx) {
csCtx->state = CS_STATE_SKIPPABLE_INIT;
csCtx->linkAction = NULL;
}
-void func_80064534(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
- if (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC)
+void func_80064534(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ if (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC) {
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
+ }
}
-void func_80064558(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
- if (gSaveContext.cutscene_index < 0xFFF0)
+void func_80064558(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ if (gSaveContext.cutscene_index < 0xFFF0) {
sCsStateHandlers1[csCtx->state](globalCtx, csCtx);
+ }
}
#ifdef NON_MATCHING
// minor ordering and regalloc differences
-void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
+void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
CutsceneStateHandler handler;
if (!~(globalCtx->state.input[0].padPressed | -0x201) && (csCtx->state == CS_STATE_IDLE) &&
- (gSaveContext.scene_setup_index >= 4))
- {
+ (gSaveContext.scene_setup_index >= 4)) {
D_8015FCC8 = 0;
gSaveContext.cutscene_index = 0xFFFD;
gSaveContext.cutscene_trigger = 1;
}
if (!~(globalCtx->state.input[0].padPressed | -0x801) && (csCtx->state == CS_STATE_IDLE) &&
- (gSaveContext.scene_setup_index >= 4) && (D_8011D394 == 0))
- {
+ (gSaveContext.scene_setup_index >= 4) && (D_8011D394 == 0)) {
D_8015FCC8 = 1;
gSaveContext.cutscene_index = 0xFFFD;
gSaveContext.cutscene_trigger = 1;
@@ -159,16 +117,14 @@ void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx)
if ((gSaveContext.cutscene_trigger != 0) && (globalCtx->sceneLoadFlag == 0x14))
gSaveContext.cutscene_trigger = 0;
- if ((gSaveContext.cutscene_trigger != 0) && (csCtx->state == CS_STATE_IDLE))
- {
+ if ((gSaveContext.cutscene_trigger != 0) && (csCtx->state == CS_STATE_IDLE)) {
// Translates to: "CUTSCENE START REQUEST ANNOUNCEMENT!"
osSyncPrintf("\nデモ開始要求 発令!");
gSaveContext.cutscene_index = 0xFFFD;
gSaveContext.cutscene_trigger = 1;
}
- if (gSaveContext.cutscene_index >= 0xFFF0)
- {
+ if (gSaveContext.cutscene_index >= 0xFFF0) {
func_80068ECC(globalCtx, csCtx);
handler = sCsStateHandlers2[csCtx->state];
handler(globalCtx, csCtx);
@@ -178,36 +134,29 @@ void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800645A0.s")
#endif
-void func_80064720(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
-
+void func_80064720(GlobalContext* globalCtx, CutsceneContext* csCtx) {
}
-u32 func_8006472C(GlobalContext* globalCtx, CutsceneContext* csCtx, f32 target)
-{
+u32 func_8006472C(GlobalContext* globalCtx, CutsceneContext* csCtx, f32 target) {
return Math_ApproxF(&csCtx->unk_0C, target, 0.1f);
}
-void func_80064760(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
+void func_80064760(GlobalContext* globalCtx, CutsceneContext* csCtx) {
Interface_ChangeAlpha(1);
func_800B3840(0x20);
- if (func_8006472C(globalCtx, csCtx, 1.0f))
- {
+ if (func_8006472C(globalCtx, csCtx, 1.0f)) {
func_800F68BC(1);
csCtx->state++;
}
}
-void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
+void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
func_80068C3C(globalCtx, csCtx);
Interface_ChangeAlpha(1);
func_800B3840(0x20);
- if (func_8006472C(globalCtx, csCtx, 1.0f))
- {
+ if (func_8006472C(globalCtx, csCtx, 1.0f)) {
func_800F68BC(1);
csCtx->state++;
}
@@ -216,16 +165,14 @@ void func_800647C0(GlobalContext* globalCtx, CutsceneContext* csCtx)
// Command 3: Misc. Actions
#ifdef NON_MATCHING
// regalloc and minor ordering differences
-void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd)
-{
+void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
Player* player = PLAYER;
f32 temp;
u8 sp3F;
sp3F = 0;
- if ((csCtx->frames < cmd->startFrame) ||
- (csCtx->frames >= cmd->endFrame) && (cmd->endFrame != cmd->startFrame))
+ if ((csCtx->frames < cmd->startFrame) || (csCtx->frames >= cmd->endFrame) && (cmd->endFrame != cmd->startFrame))
return;
temp = func_8006F93C(cmd->endFrame - 1, cmd->startFrame, csCtx->frames);
@@ -233,27 +180,23 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
if (csCtx->frames == cmd->startFrame)
sp3F = 1;
- switch (cmd->base)
- {
+ switch (cmd->base) {
case 1:
- if (sp3F != 0)
- {
+ if (sp3F != 0) {
func_800F6D58(0xE, 4, 0x3F);
func_800F6D58(0xE, 1, 1);
globalCtx->unk_10B12[0] = 0x14;
}
break;
case 2:
- if (sp3F != 0)
- {
+ if (sp3F != 0) {
func_800F6D58(0xF, 0, 0);
func_800753C4(globalCtx, 3);
D_8015FD70 = 1;
}
break;
case 3:
- if (sp3F != 0)
- {
+ if (sp3F != 0) {
func_8006C3D0(globalCtx, 0);
if (gSaveContext.entrance_index == 0x0053)
func_8006C3D0(globalCtx, 2);
@@ -264,8 +207,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
globalCtx->unk_10AC4 += 0x23;
break;
case 7:
- if (sp3F != 0)
- {
+ if (sp3F != 0) {
globalCtx->unk_10A3D = 1;
globalCtx->gloomySky = 1;
globalCtx->unk_10A3C = 0;
@@ -295,8 +237,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
globalCtx->unk_11D30[0] = 0;
break;
case 12:
- if (sp3F != 0)
- {
+ if (sp3F != 0) {
if (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC)
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
}
@@ -313,12 +254,11 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
break;
case 15:
if (sp3F != 0)
- TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->unk_1B0,
- 0xA0, 0x78, 0x90, 0x18, 0x14);
+ TitleCard_InitPlaceName(globalCtx, &globalCtx->actorCtx.titleCtx, player->unk_1B0, 0xA0, 0x78, 0x90,
+ 0x18, 0x14);
break;
case 16:
- if (sp3F != 0)
- {
+ if (sp3F != 0) {
D_8015FCCA = func_80092F88(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 6);
func_80092DAC(D_8015FCCA, 0x7FFF);
func_80092E70(D_8015FCCA, 4, 0, 1000, 0);
@@ -334,8 +274,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
globalCtx->gloomySkyEvent = 2;
if (gSaveContext.day_time < 0x4AAB)
gSaveContext.day_time += 30;
- if (globalCtx->unk_10B12[1] == 0)
- {
+ if (globalCtx->unk_10B12[1] == 0) {
D_8011FB30 = 0;
func_800F6D58(14, 1, 0);
}
@@ -370,8 +309,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
gSaveContext.day_time = 0xCAAA;
break;
case 26:
- if ((gSaveContext.day_time < 0x3000) || (gSaveContext.day_time >= 0x4555))
- {
+ if ((gSaveContext.day_time < 0x3000) || (gSaveContext.day_time >= 0x4555)) {
if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time < 0xAAAB))
globalCtx->unk_10AE3 = 1;
else if ((gSaveContext.day_time >= 0xAAAB) && (gSaveContext.day_time < 0xC556))
@@ -381,19 +319,14 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
}
break;
case 27:
- if (globalCtx->state.frames & 8)
- {
- if (globalCtx->unk_10AB0[0] < 40)
- {
+ if (globalCtx->state.frames & 8) {
+ if (globalCtx->unk_10AB0[0] < 40) {
globalCtx->unk_10AB0[0] += 2;
globalCtx->unk_10AB0[4] -= 3;
globalCtx->unk_10AB0[5] -= 3;
}
- }
- else
- {
- if (globalCtx->unk_10AB0[0] > 2)
- {
+ } else {
+ if (globalCtx->unk_10AB0[0] > 2) {
globalCtx->unk_10AB0[0] -= 2;
globalCtx->unk_10AB0[4] += 3;
globalCtx->unk_10AB0[5] += 3;
@@ -437,62 +370,57 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
#endif
// Command 4: Set Environment Lighting
-void Cutscene_Command_SetLighting(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdEnvLighting* cmd)
-{
- if (csCtx->frames == cmd->startFrame)
- {
+void Cutscene_Command_SetLighting(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdEnvLighting* cmd) {
+ if (csCtx->frames == cmd->startFrame) {
globalCtx->unk_10AE3 = cmd->setting - 1;
globalCtx->unk_10AFC = 1.0f;
}
}
// Command 0x56: Play Background Music
-void Cutscene_Command_PlayBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd)
-{
- if (csCtx->frames == cmd->startFrame)
+void Cutscene_Command_PlayBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd) {
+ if (csCtx->frames == cmd->startFrame) {
func_800F595C(cmd->sequence - 1);
+ }
}
// Command 0x57: Stop Background Music
-void Cutscene_Command_StopBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd)
-{
- if (csCtx->frames == cmd->startFrame)
+void Cutscene_Command_StopBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd) {
+ if (csCtx->frames == cmd->startFrame) {
func_800F59E8(cmd->sequence - 1);
+ }
}
// Command 0x7C: Fade Background Music over duration
-void Cutscene_Command_FadeBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicFade* cmd)
-{
+void Cutscene_Command_FadeBGM(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicFade* cmd) {
u8 var1;
- if ((csCtx->frames == cmd->startFrame) && (csCtx->frames < cmd->endFrame))
- {
+ if ((csCtx->frames == cmd->startFrame) && (csCtx->frames < cmd->endFrame)) {
var1 = cmd->endFrame - cmd->startFrame;
- if (cmd->type == 3)
+ if (cmd->type == 3) {
Audio_SetBGM(var1 << 0x10 | 0x110000FF);
- else
+ } else {
Audio_SetBGM(var1 << 0x10 | 0x100000FF);
+ }
}
}
// Command 9: ?
-void Cutscene_Command_09(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdUnknown9* cmd)
-{
- if (csCtx->frames == cmd->startFrame)
+void Cutscene_Command_09(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdUnknown9* cmd) {
+ if (csCtx->frames == cmd->startFrame) {
func_800AA000(0.0f, cmd->unk_06, cmd->unk_07, cmd->unk_08);
+ }
}
// Command 0x8C: Set Time of Day & Environment Time
#ifdef NON_MATCHING
// regalloc differences
-void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTime* cmd)
-{
+void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTime* cmd) {
s16 temp1;
s16 temp2;
- if (csCtx->frames == cmd->startFrame)
- {
+ if (csCtx->frames == cmd->startFrame) {
temp1 = (cmd->hour * 60.0f) / 0.021972656f;
temp2 = (cmd->minute + 1) / 0.021972656f;
gSaveContext.environment_time = gSaveContext.day_time = temp1 + temp2;
@@ -503,25 +431,22 @@ void func_80065134(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTim
#endif
// Command 0x3E8: Code Execution (& Terminates Cutscene?)
-void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd)
-{
+void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
Player* player = PLAYER;
s32 temp = 0;
- if ((gSaveContext.game_mode != 0) && (gSaveContext.game_mode != 3) &&
- (globalCtx->sceneNum != SCENE_SPOT00) && (csCtx->frames > 20) &&
- (!~(globalCtx->state.input[0].padPressed | 0xFFFF7FFF) ||
- !~(globalCtx->state.input[0].padPressed | -0x4001) ||
+ if ((gSaveContext.game_mode != 0) && (gSaveContext.game_mode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) &&
+ (csCtx->frames > 20) &&
+ (!~(globalCtx->state.input[0].padPressed | 0xFFFF7FFF) || !~(globalCtx->state.input[0].padPressed | -0x4001) ||
!~(globalCtx->state.input[0].padPressed | -0x1001)) &&
- (gSaveContext.file_num != 0xFEDC) && (globalCtx->sceneLoadFlag == 0))
- {
+ (gSaveContext.file_num != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) {
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
temp = 1;
}
if ((csCtx->frames == cmd->startFrame) || (temp != 0) ||
- ((csCtx->frames > 20) && (!~(globalCtx->state.input[0].padPressed | -0x1001)) && (gSaveContext.file_num != 0xFEDC)))
- {
+ ((csCtx->frames > 20) && (!~(globalCtx->state.input[0].padPressed | -0x1001)) &&
+ (gSaveContext.file_num != 0xFEDC))) {
csCtx->state = CS_STATE_UNSKIPPABLE_EXEC;
func_800F68BC(0);
gSaveContext.unk_1410 = 1;
@@ -529,13 +454,13 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
// Translates to: "FUTURE FORK DESIGNATION=No. [%d]"
osSyncPrintf("\n分岐先指定!!=[%d]番", cmd->base);
- if ((gSaveContext.game_mode != 0) && (csCtx->frames != cmd->startFrame))
+ if ((gSaveContext.game_mode != 0) && (csCtx->frames != cmd->startFrame)) {
gSaveContext.unk_13E7 = 1;
+ }
gSaveContext.cutscene_index = 0;
- switch (cmd->base)
- {
+ switch (cmd->base) {
case 1:
globalCtx->nextEntranceIndex = 0x00A0;
gSaveContext.cutscene_index = 0xFFF1;
@@ -581,22 +506,19 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
case 8:
gSaveContext.fw.set = 0;
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0;
- if (!(gSaveContext.event_chk_inf[4] & 0x20))
- {
+ if (!(gSaveContext.event_chk_inf[4] & 0x20)) {
gSaveContext.event_chk_inf[4] |= 0x20;
globalCtx->nextEntranceIndex = 0x00A0;
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.cutscene_index = 0xFFF3;
globalCtx->fadeOutTransition = 0xB;
- }
- else
- {
- if (gSaveContext.scene_setup_index < 4)
- {
- if (LINK_IS_CHILD)
+ } else {
+ if (gSaveContext.scene_setup_index < 4) {
+ if (LINK_IS_CHILD) {
globalCtx->linkAgeOnLoad = 0;
- else
+ } else {
globalCtx->linkAgeOnLoad = 1;
+ }
}
globalCtx->nextEntranceIndex = 0x02CA;
globalCtx->sceneLoadFlag = 0x14;
@@ -1037,19 +959,14 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
globalCtx->fadeOutTransition = 3;
break;
case 95:
- if ((gSaveContext.event_chk_inf[4] & 0x100) &&
- (gSaveContext.event_chk_inf[4] & 0x200) &&
- (gSaveContext.event_chk_inf[4] & 0x400))
- {
+ if ((gSaveContext.event_chk_inf[4] & 0x100) && (gSaveContext.event_chk_inf[4] & 0x200) &&
+ (gSaveContext.event_chk_inf[4] & 0x400)) {
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.cutscene_index = 0xFFF3;
globalCtx->fadeOutTransition = 2;
- }
- else
- {
- switch (gSaveContext.scene_setup_index)
- {
+ } else {
+ switch (gSaveContext.scene_setup_index) {
case 8:
globalCtx->nextEntranceIndex = 0x00FC;
globalCtx->sceneLoadFlag = 0x14;
@@ -1070,15 +987,12 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
}
break;
case 96:
- if (gBitFlags[4] & gSaveContext.quest_items)
- {
+ if (gBitFlags[4] & gSaveContext.quest_items) {
globalCtx->nextEntranceIndex = 0x006B;
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.cutscene_index = 0xFFF1;
globalCtx->fadeOutTransition = 5;
- }
- else
- {
+ } else {
gSaveContext.event_chk_inf[12] |= 0x100;
globalCtx->nextEntranceIndex = 0x0610;
globalCtx->sceneLoadFlag = 0x14;
@@ -1087,15 +1001,12 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
}
break;
case 97:
- if (gBitFlags[3] & gSaveContext.quest_items)
- {
+ if (gBitFlags[3] & gSaveContext.quest_items) {
globalCtx->nextEntranceIndex = 0x006B;
globalCtx->sceneLoadFlag = 0x14;
gSaveContext.cutscene_index = 0xFFF1;
globalCtx->fadeOutTransition = 5;
- }
- else
- {
+ } else {
globalCtx->nextEntranceIndex = 0x0580;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeOutTransition = 3;
@@ -1138,8 +1049,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
globalCtx->fadeOutTransition = 2;
break;
case 104:
- switch (sTitleCsState)
- {
+ switch (sTitleCsState) {
case 0:
globalCtx->nextEntranceIndex = 0x008D;
globalCtx->sceneLoadFlag = 0x14;
@@ -1206,16 +1116,13 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
break;
case 113:
if (Flags_GetEventChkInf(0xBB) && Flags_GetEventChkInf(0xBC) && Flags_GetEventChkInf(0xBD) &&
- Flags_GetEventChkInf(0xBE) && Flags_GetEventChkInf(0xBF) && Flags_GetEventChkInf(0xAD))
- {
+ Flags_GetEventChkInf(0xBE) && Flags_GetEventChkInf(0xBF) && Flags_GetEventChkInf(0xAD)) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&D_0201DA50);
globalCtx->csCtx.frames = 0;
gSaveContext.cutscene_trigger = 1;
gSaveContext.cutscene_index = 0xFFFF;
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
- }
- else
- {
+ } else {
gSaveContext.cutscene_index = 0xFFFF;
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
}
@@ -1232,14 +1139,11 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
gSaveContext.transition_type = 2;
break;
case 116:
- if (gSaveContext.event_chk_inf[12] & 0x100)
- {
+ if (gSaveContext.event_chk_inf[12] & 0x100) {
globalCtx->nextEntranceIndex = 0x0580;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeOutTransition = 3;
- }
- else
- {
+ } else {
globalCtx->nextEntranceIndex = 0x0610;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeOutTransition = 3;
@@ -1273,67 +1177,68 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
}
// Command 0x2D: Transition Effects
-void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd)
-{
+void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
f32 temp;
- if ((csCtx->frames >= cmd->startFrame) && (csCtx->frames <= cmd->endFrame))
- {
+ if ((csCtx->frames >= cmd->startFrame) && (csCtx->frames <= cmd->endFrame)) {
globalCtx->unk_10B05 = 1;
temp = func_8006F93C(cmd->endFrame, cmd->startFrame, csCtx->frames);
- switch (cmd->base)
- {
+ switch (cmd->base) {
case 1:
case 5:
globalCtx->unk_10B06[0] = 0xA0;
globalCtx->unk_10B06[1] = 0xA0;
globalCtx->unk_10B06[2] = 0xA0;
- if (cmd->base == 1)
- {
+ if (cmd->base == 1) {
globalCtx->unk_10B06[3] = 255.0f * temp;
- if ((temp == 0.0f) && (gSaveContext.entrance_index == 0x006B))
- Audio_PlaySoundGeneral(NA_SE_SY_WHITE_OUT_S, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- else if ((temp == 0.0f) &&
- ((gSaveContext.entrance_index == 0x0053) ||
- (gSaveContext.entrance_index == 0x0138) ||
- (gSaveContext.entrance_index == 0x0371)))
- Audio_PlaySoundGeneral(NA_SE_EV_WHITE_OUT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- else if ((temp == 0.0f) && (globalCtx->sceneNum == SCENE_GANONTIKA))
+ if ((temp == 0.0f) && (gSaveContext.entrance_index == 0x006B)) {
+ Audio_PlaySoundGeneral(NA_SE_SY_WHITE_OUT_S, &D_801333D4, 4, &D_801333E0, &D_801333E0,
+ &D_801333E8);
+ } else if ((temp == 0.0f) &&
+ ((gSaveContext.entrance_index == 0x0053) || (gSaveContext.entrance_index == 0x0138) ||
+ (gSaveContext.entrance_index == 0x0371))) {
+ Audio_PlaySoundGeneral(NA_SE_EV_WHITE_OUT, &D_801333D4, 4, &D_801333E0, &D_801333E0,
+ &D_801333E8);
+ } else if ((temp == 0.0f) && (globalCtx->sceneNum == SCENE_GANONTIKA)) {
func_800788CC(NA_SE_EV_WHITE_OUT);
- }
- else
+ }
+ } else {
globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f;
+ }
break;
case 2:
case 6:
globalCtx->unk_10B06[0] = 0;
globalCtx->unk_10B06[1] = 0;
globalCtx->unk_10B06[2] = 0xFF;
- if (cmd->base == 2)
+ if (cmd->base == 2) {
globalCtx->unk_10B06[3] = 255.0f * temp;
- else
+ } else {
globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f;
+ }
break;
case 3:
case 7:
globalCtx->unk_10B06[0] = 0xFF;
globalCtx->unk_10B06[1] = 0;
globalCtx->unk_10B06[2] = 0;
- if (cmd->base == 3)
+ if (cmd->base == 3) {
globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f;
- else
+ } else {
globalCtx->unk_10B06[3] = 255.0f * temp;
+ }
break;
case 4:
case 8:
globalCtx->unk_10B06[0] = 0;
globalCtx->unk_10B06[1] = 0xFF;
globalCtx->unk_10B06[2] = 0;
- if (cmd->base == 4)
+ if (cmd->base == 4) {
globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f;
- else
+ } else {
globalCtx->unk_10B06[3] = 255.0f * temp;
+ }
break;
case 9:
gSaveContext.unk_1410 = 1;
@@ -1343,10 +1248,11 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs
globalCtx->unk_10B06[0] = 0;
globalCtx->unk_10B06[1] = 0;
globalCtx->unk_10B06[2] = 0;
- if (cmd->base == 10)
+ if (cmd->base == 10) {
globalCtx->unk_10B06[3] = (1.0f - temp) * 255.0f;
- else
+ } else {
globalCtx->unk_10B06[3] = 255.0f * temp;
+ }
break;
case 12:
gSaveContext.unk_1410 = 255.0f - (155.0f * temp);
@@ -1362,8 +1268,7 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs
}
// Command 0x1 & 0x5: Camera Positions
-s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink)
-{
+s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink) {
s32 shouldContinue = 1;
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
s32 size;
@@ -1372,15 +1277,12 @@ s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext*
size = 8;
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
- ((csCtx->unk_18 < cmdBase->startFrame) || (csCtx->unk_18 >= 0xF000)))
- {
+ ((csCtx->unk_18 < cmdBase->startFrame) || (csCtx->unk_18 >= 0xF000))) {
csCtx->unk_1B = 1;
csCtx->cameraPosition = (CutsceneCameraPoint*)cmd;
- if (csCtx->unk_1A != 0)
- {
+ if (csCtx->unk_1A != 0) {
csCtx->unk_18 = cmdBase->startFrame;
- if (D_8015FCC8 != 0)
- {
+ if (D_8015FCC8 != 0) {
func_800C0874(globalCtx, csCtx->unk_16, 0x25);
func_800C0314(globalCtx, D_8015FCC6, 1);
func_800C0314(globalCtx, csCtx->unk_16, 7);
@@ -1391,10 +1293,10 @@ s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext*
}
}
- while (shouldContinue)
- {
- if (((CutsceneCameraPoint*)cmd)->continueFlag == -1)
- shouldContinue = 0;
+ while (shouldContinue) {
+ if (((CutsceneCameraPoint*)cmd)->continueFlag == -1) {
+ shouldContinue = 0;
+ }
cmd += 0x10;
size += 0x10;
}
@@ -1403,8 +1305,7 @@ s32 Cutscene_Command_CameraPositions(GlobalContext* globalCtx, CutsceneContext*
}
// Command 0x2 & 0x6: Camera Focus Points
-s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink)
-{
+s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink) {
s32 shouldContinue = 1;
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
s32 size;
@@ -1413,15 +1314,12 @@ s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCt
size = 8;
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
- ((D_8015FCC0 < cmdBase->startFrame) || (D_8015FCC0 >= 0xF000)))
- {
+ ((D_8015FCC0 < cmdBase->startFrame) || (D_8015FCC0 >= 0xF000))) {
csCtx->unk_1A = 1;
csCtx->cameraFocus = (CutsceneCameraPoint*)cmd;
- if (csCtx->unk_1B != 0)
- {
+ if (csCtx->unk_1B != 0) {
D_8015FCC0 = cmdBase->startFrame;
- if (D_8015FCC8 != 0)
- {
+ if (D_8015FCC8 != 0) {
func_800C0874(globalCtx, csCtx->unk_16, 0x25);
func_800C0314(globalCtx, D_8015FCC6, 1);
func_800C0314(globalCtx, csCtx->unk_16, 7);
@@ -1432,10 +1330,10 @@ s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCt
}
}
- while (shouldContinue)
- {
- if (((CutsceneCameraPoint*)cmd)->continueFlag == -1)
- shouldContinue = 0;
+ while (shouldContinue) {
+ if (((CutsceneCameraPoint*)cmd)->continueFlag == -1) {
+ shouldContinue = 0;
+ }
cmd += 0x10;
size += 0x10;
}
@@ -1444,8 +1342,7 @@ s32 Cutscene_Command_CameraFocus(GlobalContext* globalCtx, CutsceneContext* csCt
}
// Command 0x7: ? (Related to camera positons)
-s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 unused)
-{
+s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 unused) {
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
s32 size;
Vec3f sp3C;
@@ -1457,15 +1354,12 @@ s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm
size = 8;
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
- ((D_8015FCC2 < cmdBase->startFrame) || (D_8015FCC2 >= 0xF000)))
- {
+ ((D_8015FCC2 < cmdBase->startFrame) || (D_8015FCC2 >= 0xF000))) {
csCtx->unk_1B = 1;
csCtx->cameraPosition = (CutsceneCameraPoint*)cmd;
- if (csCtx->unk_1A != 0)
- {
+ if (csCtx->unk_1A != 0) {
D_8015FCC2 = cmdBase->startFrame;
- if (D_8015FCC8 != 0)
- {
+ if (D_8015FCC8 != 0) {
sp2C = func_800C04A4(globalCtx, csCtx->unk_16);
sp2C->player = NULL;
func_800C0314(globalCtx, 0, 1);
@@ -1491,8 +1385,7 @@ s32 Cutscene_Command_07(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm
}
// Command 0x8: ? (Related to camera focus points)
-s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 unused)
-{
+s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cmd, u8 unused) {
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
s32 size;
Vec3f sp3C;
@@ -1504,15 +1397,12 @@ s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm
size = 8;
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
- ((D_8015FCC4 < cmdBase->startFrame) || (D_8015FCC4 >= 0xF000)))
- {
+ ((D_8015FCC4 < cmdBase->startFrame) || (D_8015FCC4 >= 0xF000))) {
csCtx->unk_1A = 1;
csCtx->cameraFocus = (CutsceneCameraPoint*)cmd;
- if (csCtx->unk_1B != 0)
- {
+ if (csCtx->unk_1B != 0) {
D_8015FCC4 = cmdBase->startFrame;
- if (D_8015FCC8 != 0)
- {
+ if (D_8015FCC8 != 0) {
sp2C = func_800C04A4(globalCtx, csCtx->unk_16);
sp2C->player = NULL;
func_800C0314(globalCtx, 0, 1);
@@ -1536,81 +1426,70 @@ s32 Cutscene_Command_08(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cm
}
// Command 0x13: Textbox
-void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdTextbox* cmd)
-{
+void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdTextbox* cmd) {
u8 dialogState;
s16 originalCsFrames;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
- {
- if (cmd->type != 2)
- {
- if (D_8011E1C0 != cmd->base)
- {
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
+ if (cmd->type != 2) {
+ if (D_8011E1C0 != cmd->base) {
D_8011E1C0 = cmd->base;
- if ((cmd->type == 3) && (gBitFlags[20] & gSaveContext.quest_items))
+ if ((cmd->type == 3) && (gBitFlags[20] & gSaveContext.quest_items)) {
func_8010B680(globalCtx, cmd->textId1, 0);
- else if ((cmd->type == 4) && (gBitFlags[19] & gSaveContext.quest_items))
+ } else if ((cmd->type == 4) && (gBitFlags[19] & gSaveContext.quest_items)) {
func_8010B680(globalCtx, cmd->textId1, 0);
- else
+ } else {
func_8010B680(globalCtx, cmd->base, 0);
+ }
return;
}
- }
- else
- {
- if (D_8011E1C4 != cmd->base)
- {
+ } else {
+ if (D_8011E1C4 != cmd->base) {
D_8011E1C4 = cmd->base;
func_8010BD58(globalCtx, cmd->base);
return;
}
}
- if (csCtx->frames >= cmd->endFrame)
- {
+ if (csCtx->frames >= cmd->endFrame) {
originalCsFrames = csCtx->frames;
dialogState = func_8010BDBC(&globalCtx->msgCtx);
- if ((dialogState != 2) && (dialogState != 0) && (dialogState != 7) && (dialogState != 8))
- {
+ if ((dialogState != 2) && (dialogState != 0) && (dialogState != 7) && (dialogState != 8)) {
csCtx->frames--;
- if ((dialogState == 4) && (func_80106BC8(globalCtx) != 0))
- {
- if (globalCtx->msgCtx.choiceIndex == 0)
- {
- if (cmd->textId1 != 0xFFFF)
+ if ((dialogState == 4) && (func_80106BC8(globalCtx) != 0)) {
+ if (globalCtx->msgCtx.choiceIndex == 0) {
+ if (cmd->textId1 != 0xFFFF) {
func_8010B720(globalCtx, cmd->textId1);
- else
+ } else {
csCtx->frames++;
- }
- else
- {
- if (cmd->textId2 != 0xFFFF)
+ }
+ } else {
+ if (cmd->textId2 != 0xFFFF) {
func_8010B720(globalCtx, cmd->textId2);
- else
+ } else {
csCtx->frames++;
+ }
}
}
- if (dialogState == 9)
- {
- if (cmd->textId1 != 0xFFFF)
+ if (dialogState == 9) {
+ if (cmd->textId1 != 0xFFFF) {
func_8010B720(globalCtx, cmd->textId1);
- else
+ } else {
csCtx->frames++;
+ }
}
- if (dialogState == 5)
- {
- if (func_80106BC8(globalCtx) != 0)
+ if (dialogState == 5) {
+ if (func_80106BC8(globalCtx) != 0) {
func_8010BD58(globalCtx, cmd->base);
+ }
}
}
- if (csCtx->frames == originalCsFrames)
- {
+ if (csCtx->frames == originalCsFrames) {
Interface_ChangeAlpha(1);
D_8011E1C0 = 0;
D_8011E1C4 = 0;
@@ -1619,8 +1498,7 @@ void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx,
}
}
-void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cutscenePtr)
-{
+void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cutscenePtr) {
s16 i;
s32 totalEntries;
s32 cmdType;
@@ -1634,33 +1512,29 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
MemCopy(&cutsceneEndFrame, cutscenePtr, 4);
cutscenePtr += 4;
- if ((cutsceneEndFrame < csCtx->frames) && (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC))
- {
+ if ((cutsceneEndFrame < csCtx->frames) && (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC)) {
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
return;
}
- if (!~(globalCtx->state.input[0].padPressed | -0x101))
- {
+ if (!~(globalCtx->state.input[0].padPressed | -0x101)) {
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
return;
}
- for (i = 0; i < totalEntries; i++)
- {
+ for (i = 0; i < totalEntries; i++) {
MemCopy(&cmdType, cutscenePtr, 4);
cutscenePtr += 4;
- if (cmdType == -1)
+ if (cmdType == -1) {
return;
+ }
- switch (cmdType)
- {
+ switch (cmdType) {
case CS_CMD_MISC:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
func_80064824(globalCtx, csCtx, (void*)cutscenePtr);
cutscenePtr += 0x30;
}
@@ -1668,8 +1542,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case CS_CMD_SET_LIGHTING:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
Cutscene_Command_SetLighting(globalCtx, csCtx, (void*)cutscenePtr);
cutscenePtr += 0x30;
}
@@ -1677,8 +1550,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case CS_CMD_PLAYBGM:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
Cutscene_Command_PlayBGM(globalCtx, csCtx, (void*)cutscenePtr);
cutscenePtr += 0x30;
}
@@ -1686,8 +1558,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case CS_CMD_STOPBGM:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
Cutscene_Command_StopBGM(globalCtx, csCtx, (void*)cutscenePtr);
cutscenePtr += 0x30;
}
@@ -1695,8 +1566,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case CS_CMD_FADEBGM:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
Cutscene_Command_FadeBGM(globalCtx, csCtx, (void*)cutscenePtr);
cutscenePtr += 0x30;
}
@@ -1704,8 +1574,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case CS_CMD_09:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
Cutscene_Command_09(globalCtx, csCtx, (void*)cutscenePtr);
cutscenePtr += 0xC;
}
@@ -1713,8 +1582,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case CS_CMD_SETTIME:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
func_80065134(globalCtx, csCtx, (void*)cutscenePtr);
cutscenePtr += 0xC;
}
@@ -1722,11 +1590,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case CS_CMD_SET_ACTOR_ACTION_0:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->linkAction = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
@@ -1750,11 +1618,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case 144:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->actorActions[0] = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
@@ -1778,11 +1646,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case 141:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->actorActions[1] = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
@@ -1802,11 +1670,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case 132:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->actorActions[2] = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
@@ -1825,11 +1693,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case 133:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->actorActions[3] = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
@@ -1844,11 +1712,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case 135:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->actorActions[4] = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
@@ -1861,11 +1729,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case 136:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->actorActions[5] = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
@@ -1879,11 +1747,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case 137:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->actorActions[6] = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
@@ -1896,33 +1764,33 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case 142:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->actorActions[7] = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
case 62:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->actorActions[8] = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
case CS_CMD_SET_ACTOR_ACTION_10:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame))
+ if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
csCtx->actorActions[9] = (void*)cutscenePtr;
+ }
cutscenePtr += 0x30;
}
break;
@@ -1952,11 +1820,11 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
case CS_CMD_TEXTBOX:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
- {
+ for (j = 0; j < cmdEntries; j++) {
cmd = (CsCmdBase*)cutscenePtr;
- if (cmd->base != 0xFFFF)
+ if (cmd->base != 0xFFFF) {
Cutscene_Command_Textbox(globalCtx, csCtx, (void*)cutscenePtr);
+ }
cutscenePtr += 0xC;
}
break;
@@ -1968,28 +1836,26 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
default:
MemCopy(&cmdEntries, cutscenePtr, 4);
cutscenePtr += 4;
- for (j = 0; j < cmdEntries; j++)
+ for (j = 0; j < cmdEntries; j++) {
cutscenePtr += 0x30;
+ }
break;
}
}
}
-void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
+void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx) {
Gfx* displayList;
Gfx* prevDisplayList;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
- if (0) ; // Necessary to match
+ if (0) {} // Necessary to match
- if (gSaveContext.cutscene_index >= 0xFFF0)
- {
- if (0) ; // Also necessary to match
+ if (gSaveContext.cutscene_index >= 0xFFF0) {
+ if (0) {} // Also necessary to match
- if (BREG(0) != 0)
- {
+ if (BREG(0) != 0) {
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_demo.c", 4101);
@@ -2005,42 +1871,38 @@ void func_80068C3C(GlobalContext* globalCtx, CutsceneContext* csCtx)
}
csCtx->frames++;
- if (dREG(95) != 0)
+ if (dREG(95) != 0) {
Cutscene_ProcessCommands(globalCtx, csCtx, D_8012D1F0);
- else
+ } else {
Cutscene_ProcessCommands(globalCtx, csCtx, globalCtx->csCtx.segment);
+ }
}
}
-void func_80068D84(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
- if (func_8006472C(globalCtx, csCtx, 0.0f))
- {
+void func_80068D84(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ if (func_8006472C(globalCtx, csCtx, 0.0f)) {
func_800F68BC(0);
csCtx->state = CS_STATE_IDLE;
}
}
-void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
+void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
s16 i;
- if (func_8006472C(globalCtx, csCtx, 0.0f))
- {
+ if (func_8006472C(globalCtx, csCtx, 0.0f)) {
csCtx->linkAction = NULL;
- for (i = 0; i < 10; i++)
+ for (i = 0; i < 10; i++) {
csCtx->actorActions[i] = NULL;
+ }
// Translates to: "RIGHT HERE, HUH"
osSyncPrintf("\n\n\n\n\nやっぱりここかいな");
gSaveContext.cutscene_index = 0;
gSaveContext.game_mode = 0;
- if (D_8015FCC8 != 0)
- {
- switch (gSaveContext.entrance_index)
- {
+ if (D_8015FCC8 != 0) {
+ switch (gSaveContext.entrance_index) {
case 0x028A:
case 0x028E:
case 0x0292:
@@ -2058,15 +1920,14 @@ void func_80068DC0(GlobalContext* globalCtx, CutsceneContext* csCtx)
}
}
-void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx)
-{
+void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) {
u8 i;
- if ((gSaveContext.cutscene_trigger != 0) && (csCtx->state == CS_STATE_IDLE) && !func_8008E988(globalCtx))
+ if ((gSaveContext.cutscene_trigger != 0) && (csCtx->state == CS_STATE_IDLE) && !func_8008E988(globalCtx)) {
gSaveContext.cutscene_index = 0xFFFD;
+ }
- if ((gSaveContext.cutscene_index >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE))
- {
+ if ((gSaveContext.cutscene_index >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE)) {
func_8006C438(globalCtx, 0);
D_8011E1C0 = 0;
@@ -2074,13 +1935,13 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx)
csCtx->unk_12 = 0;
csCtx->linkAction = NULL;
- for (i = 0; i < 10; i++)
+ for (i = 0; i < 10; i++) {
csCtx->actorActions[i] = NULL;
+ }
csCtx->state++;
- if (csCtx->state == CS_STATE_SKIPPABLE_INIT)
- {
+ if (csCtx->state == CS_STATE_SKIPPABLE_INIT) {
func_800F68BC(1);
csCtx->frames = 0xFFFF;
@@ -2092,11 +1953,11 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx)
csCtx->unk_1B = 0;
D_8015FCC6 = globalCtx->cameraCtx.unk_5C0;
- if (D_8015FCC8 != 0)
+ if (D_8015FCC8 != 0) {
csCtx->unk_14_all = func_800C0230(globalCtx);
+ }
- if (gSaveContext.cutscene_trigger == 0)
- {
+ if (gSaveContext.cutscene_trigger == 0) {
Interface_ChangeAlpha(1);
func_800B3840(0x20);
func_800B38A4(0x20);
@@ -2110,41 +1971,39 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx)
}
}
-void func_80069048(GlobalContext* globalCtx)
-{
+void func_80069048(GlobalContext* globalCtx) {
s16 i;
D_8015FCCC = 0;
- for (i = 0; i < 20; i++) ; // Empty Loop
+ for (i = 0; i < 20; i++) {
+ ; // Empty Loop
+ }
D_8015FCE4 = 0;
}
-void func_8006907C(GlobalContext* globalCtx)
-{
- if (D_8015FCCC != 0)
+void func_8006907C(GlobalContext* globalCtx) {
+ if (D_8015FCCC != 0) {
D_8015FCCC = 0;
+ }
}
-void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx)
-{
+void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx) {
EntranceCutscene* entranceCutscene;
u8 requiredAge;
s16 i;
- for (i = 0; i < ARRAY_COUNT(sEntranceCutsceneTable); i++)
- {
+ for (i = 0; i < ARRAY_COUNT(sEntranceCutsceneTable); i++) {
entranceCutscene = &sEntranceCutsceneTable[i];
requiredAge = entranceCutscene->ageRestriction;
- if (requiredAge == 2)
+ if (requiredAge == 2) {
requiredAge = gSaveContext.link_age;
+ }
if ((gSaveContext.entrance_index == entranceCutscene->entrance) &&
(!Flags_GetEventChkInf(entranceCutscene->flag) || (entranceCutscene->flag == 0x18)) &&
- (gSaveContext.cutscene_index < 0xFFF0) &&
- ((u8)gSaveContext.link_age == requiredAge) &&
- (gSaveContext.respawn_flag <= 0))
- {
+ (gSaveContext.cutscene_index < 0xFFF0) && ((u8)gSaveContext.link_age == requiredAge) &&
+ (gSaveContext.respawn_flag <= 0)) {
Flags_SetEventChkInf(entranceCutscene->flag);
Cutscene_SetSegment(globalCtx, entranceCutscene->segAddr);
gSaveContext.cutscene_trigger = 2;
@@ -2156,42 +2015,31 @@ void Cutscene_HandleEntranceTriggers(GlobalContext* globalCtx)
#ifdef NON_MATCHING
// regalloc differences
-void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx)
-{
+void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) {
osSyncPrintf("\ngame_info.mode=[%d] restart_flag", gSaveContext.respawn_flag);
- if ((gSaveContext.game_mode == 0) && (gSaveContext.respawn_flag <= 0) && (gSaveContext.cutscene_index < 0xFFF0))
- {
- if ((gSaveContext.entrance_index == 0x01E1) && !Flags_GetEventChkInf(0xAC))
- {
+ if ((gSaveContext.game_mode == 0) && (gSaveContext.respawn_flag <= 0) && (gSaveContext.cutscene_index < 0xFFF0)) {
+ if ((gSaveContext.entrance_index == 0x01E1) && !Flags_GetEventChkInf(0xAC)) {
Flags_SetEventChkInf(0xAC);
gSaveContext.entrance_index = 0x0123;
gSaveContext.cutscene_index = 0xFFF0;
- }
- else if ((gSaveContext.entrance_index == 0x00DB) && LINK_IS_ADULT &&
- (gSaveContext.event_chk_inf[4] & 0x0100) && (gSaveContext.event_chk_inf[4] & 0x0200) &&
- (gSaveContext.event_chk_inf[4] & 0x0400) && !Flags_GetEventChkInf(0xAA))
- {
+ } else if ((gSaveContext.entrance_index == 0x00DB) && LINK_IS_ADULT &&
+ (gSaveContext.event_chk_inf[4] & 0x0100) && (gSaveContext.event_chk_inf[4] & 0x0200) &&
+ (gSaveContext.event_chk_inf[4] & 0x0400) && !Flags_GetEventChkInf(0xAA)) {
Flags_SetEventChkInf(0xAA);
gSaveContext.cutscene_index = 0xFFF0;
- }
- else if ((gSaveContext.entrance_index == 0x05E0) && !Flags_GetEventChkInf(0xC1))
- {
+ } else if ((gSaveContext.entrance_index == 0x05E0) && !Flags_GetEventChkInf(0xC1)) {
Flags_SetEventChkInf(0xC1);
Item_Give(globalCtx, ITEM_OCARINA_FAIRY);
gSaveContext.entrance_index = 0x011E;
gSaveContext.cutscene_index = 0xFFF0;
- }
- else if ((gBitFlags[3] & gSaveContext.quest_items) && (gBitFlags[4] & gSaveContext.quest_items) &&
- LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) &&
- (gEntranceTable[gSaveContext.entrance_index].scene == 67))
- {
+ } else if ((gBitFlags[3] & gSaveContext.quest_items) && (gBitFlags[4] & gSaveContext.quest_items) &&
+ LINK_IS_ADULT && !Flags_GetEventChkInf(0xC4) &&
+ (gEntranceTable[gSaveContext.entrance_index].scene == 67)) {
Flags_SetEventChkInf(0xC4);
gSaveContext.entrance_index = 0x0053;
gSaveContext.cutscene_index = 0xFFF8;
- }
- else if (!Flags_GetEventChkInf(0xC7) && (gEntranceTable[gSaveContext.entrance_index].scene == 79))
- {
+ } else if (!Flags_GetEventChkInf(0xC7) && (gEntranceTable[gSaveContext.entrance_index].scene == 79)) {
Flags_SetEventChkInf(0xC7);
gSaveContext.entrance_index = 0x0517;
gSaveContext.cutscene_index = 0xFFF0;
@@ -2202,10 +2050,10 @@ void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/Cutscene_HandleConditionalTriggers.s")
#endif
-void Cutscene_SetSegment(GlobalContext* globalCtx, u32 segment)
-{
- if (SEGMENT_NUMBER(segment) != 0)
+void Cutscene_SetSegment(GlobalContext* globalCtx, u32 segment) {
+ if (SEGMENT_NUMBER(segment) != 0) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(segment);
- else
+ } else {
globalCtx->csCtx.segment = (void*)segment;
+ }
}
diff --git a/src/code/z_draw.c b/src/code/z_draw.c
index 9bc4bbd7a..383ed1b4d 100644
--- a/src/code/z_draw.c
+++ b/src/code/z_draw.c
@@ -29,15 +29,13 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId);
static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId);
static void func_8006B870(GlobalContext* globalCtx, s16 drawId);
-typedef struct
-{
- /* 0x00 */ void (*drawFunc)(GlobalContext*, s16);
- /* 0x04 */ u32 dlists[8];
+typedef struct {
+ /* 0x00 */ void (*drawFunc)(GlobalContext*, s16);
+ /* 0x04 */ u32 dlists[8];
} DrawItemTableEntry; // size = 0x24
// TODO: use symbols for these dlists once objects are in C
-static DrawItemTableEntry sDrawItemTable[] =
-{
+static DrawItemTableEntry sDrawItemTable[] = {
{ func_8006AAA8, { 0x06000670, 0x06000750 } },
{ func_8006A9CC, { 0x06000800 } },
{ func_8006ABEC, { 0x06000A80, 0x06000AE0 } },
@@ -71,8 +69,10 @@ static DrawItemTableEntry sDrawItemTable[] =
{ func_8006A9CC, { 0x06000EE0 } },
{ func_8006A9CC, { 0x060009A0 } },
{ func_8006A9CC, { 0x06000B70 } },
- { func_8006B870, { 0x06001850, 0x06001750, 0x06001790, 0x060019A0, 0x060017B0, 0x06001A28, 0x060017D0, 0x06001AD8 } },
- { func_8006B870, { 0x06001850, 0x06001770, 0x060017F0, 0x060019A0, 0x06001810, 0x06001A28, 0x06001830, 0x06001AD8 } },
+ { func_8006B870,
+ { 0x06001850, 0x06001750, 0x06001790, 0x060019A0, 0x060017B0, 0x06001A28, 0x060017D0, 0x06001AD8 } },
+ { func_8006B870,
+ { 0x06001850, 0x06001770, 0x060017F0, 0x060019A0, 0x06001810, 0x06001A28, 0x06001830, 0x06001AD8 } },
{ func_8006A9CC, { 0x06000F60 } },
{ func_8006A9CC, { 0x06000340 } },
{ func_8006A9CC, { 0x06000B90 } },
@@ -161,88 +161,90 @@ static DrawItemTableEntry sDrawItemTable[] =
* Draw "Get Item" Model
* Calls the corresponding draw function for the given draw ID
*/
-void func_800694A0(GlobalContext* globalCtx, s16 drawId)
-{
+void func_800694A0(GlobalContext* globalCtx, s16 drawId) {
sDrawItemTable[drawId].drawFunc(globalCtx, drawId);
}
// All remaining functions in this file are draw functions referenced in the table and called by the function above
-static void func_800694E4(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_800694E4(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 556);
func_80093BA8(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 560), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 560),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 565);
}
-static void func_800695C0(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_800695C0(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 572);
gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 5);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 576), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 576),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 581);
}
-static void func_8006969C(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006969C(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 588);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 592), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 592),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 16, 32,
- 1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 8), 16, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
+ 0 * (globalCtx->state.frames * 0), 16, 32, 1, 1 * (globalCtx->state.frames * 1),
+ 1 * -(globalCtx->state.frames * 8), 16, 32));
Matrix_Push();
Matrix_Translate(-8.0f, -2.0f, 0.0f, MTXMODE_APPLY);
func_800D1FD4(&globalCtx->mf_11DA0);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 615), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 615),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
Matrix_Pull();
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 621);
}
-static void func_80069880(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_80069880(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 628);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 632), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 632),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 641), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 641),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 16, 32,
- 1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 6), 16, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
+ 0 * (globalCtx->state.frames * 0), 16, 32, 1, 1 * (globalCtx->state.frames * 1),
+ 1 * -(globalCtx->state.frames * 6), 16, 32));
Matrix_Push();
func_800D1FD4(&globalCtx->mf_11DA0);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 656), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 656),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
Matrix_Pull();
@@ -250,35 +252,36 @@ static void func_80069880(GlobalContext* globalCtx, s16 drawId)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 663);
}
-static void func_80069AC8(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_80069AC8(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 670);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 674), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 674),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 683), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 683),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 32, 32,
- 1, 1 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 6), 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
+ 0 * (globalCtx->state.frames * 0), 32, 32, 1, 1 * (globalCtx->state.frames * 1),
+ 1 * -(globalCtx->state.frames * 6), 32, 32));
Matrix_Push();
func_800D1FD4(&globalCtx->mf_11DA0);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 698), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 698),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
Matrix_Pull();
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 704);
}
-static void func_80069CF0(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_80069CF0(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -286,77 +289,80 @@ static void func_80069CF0(GlobalContext* globalCtx, s16 drawId)
func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0 * (globalCtx->state.frames * 0) % 256, 1 * (globalCtx->state.frames * 2) % 256, 64, 64,
- 1, 0 * (globalCtx->state.frames * 0) % 128, 1 * (globalCtx->state.frames * 1) % 128, 32, 32));
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 723), G_MTX_MODELVIEW | G_MTX_LOAD);
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0) % 256,
+ 1 * (globalCtx->state.frames * 2) % 256, 64, 64, 1,
+ 0 * (globalCtx->state.frames * 0) % 128, 1 * (globalCtx->state.frames * 1) % 128, 32,
+ 32));
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 723),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 730), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 730),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
-
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 735);
}
-static void func_80069EB0(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_80069EB0(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 742);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 746), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 746),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0 * (globalCtx->state.frames * 0), 1 * -(globalCtx->state.frames * 5), 32, 32,
- 1, 0 * (globalCtx->state.frames * 0), 0 * (globalCtx->state.frames * 0), 32, 64));
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 760), G_MTX_MODELVIEW | G_MTX_LOAD);
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
+ 1 * -(globalCtx->state.frames * 5), 32, 32, 1, 0 * (globalCtx->state.frames * 0),
+ 0 * (globalCtx->state.frames * 0), 32, 64));
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 760),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 765);
}
-static void func_8006A060(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006A060(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 772);
func_80093BA8(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 776), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 776),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 783);
}
-static void func_8006A158(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006A158(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 811);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 815), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 815),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
gfxCtx->polyXlu.p = func_80093774(gfxCtx->polyXlu.p, 5);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 822), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 822),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 827);
}
-static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -364,25 +370,26 @@ static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId)
func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, -1 * (globalCtx->state.frames * 1), 1 * (globalCtx->state.frames * 1), 32, 32,
- 1, -1 * (globalCtx->state.frames * 1), 1 * (globalCtx->state.frames * 1), 32, 32));
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 845), G_MTX_MODELVIEW | G_MTX_LOAD);
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, -1 * (globalCtx->state.frames * 1),
+ 1 * (globalCtx->state.frames * 1), 32, 32, 1, -1 * (globalCtx->state.frames * 1),
+ 1 * (globalCtx->state.frames * 1), 32, 32));
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 845),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[3]);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 855), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 855),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[4]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[5]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 861);
}
-static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -390,17 +397,17 @@ static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId)
func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 1 * (globalCtx->state.frames * 1), 0 * (globalCtx->state.frames * 1), 32, 32,
- 1, 0 * (globalCtx->state.frames * 1), 0 * (globalCtx->state.frames * 1), 32, 32));
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 878), G_MTX_MODELVIEW | G_MTX_LOAD);
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 1),
+ 0 * (globalCtx->state.frames * 1), 32, 32, 1, 0 * (globalCtx->state.frames * 1),
+ 0 * (globalCtx->state.frames * 1), 32, 32));
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 878),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 883);
}
-static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -408,17 +415,17 @@ static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId)
func_80093D18(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 1 * (globalCtx->state.frames * 6), 1 * (globalCtx->state.frames * 6), 32, 32,
- 1, 1 * (globalCtx->state.frames * 6), 1 * (globalCtx->state.frames * 6), 32, 32));
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 901), G_MTX_MODELVIEW | G_MTX_LOAD);
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 6),
+ 1 * (globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 6),
+ 1 * (globalCtx->state.frames * 6), 32, 32));
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 901),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 906);
}
-static void func_8006A73C(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006A73C(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -426,17 +433,17 @@ static void func_8006A73C(GlobalContext* globalCtx, s16 drawId)
func_80093D84(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 3), 32, 32,
- 1, 0 * (globalCtx->state.frames * 1), 1 * -(globalCtx->state.frames * 2), 32, 32));
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 924), G_MTX_MODELVIEW | G_MTX_LOAD);
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 1),
+ 1 * -(globalCtx->state.frames * 3), 32, 32, 1, 0 * (globalCtx->state.frames * 1),
+ 1 * -(globalCtx->state.frames * 2), 32, 32));
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 924),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 929);
}
-static void func_8006A88C(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006A88C(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -444,100 +451,103 @@ static void func_8006A88C(GlobalContext* globalCtx, s16 drawId)
func_80093D84(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0 * (globalCtx->state.frames * 0), 1 * (globalCtx->state.frames * 1), 32, 32,
- 1, 0 * (globalCtx->state.frames * 0), 1 * (globalCtx->state.frames * 1), 32, 32));
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 947), G_MTX_MODELVIEW | G_MTX_LOAD);
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0 * (globalCtx->state.frames * 0),
+ 1 * (globalCtx->state.frames * 1), 32, 32, 1, 0 * (globalCtx->state.frames * 0),
+ 1 * (globalCtx->state.frames * 1), 32, 32));
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 947),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 952);
}
-static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 959);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 963), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 963),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 968);
}
-static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 975);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 979), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 979),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 986), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 986),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 991);
}
-static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 998);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1002), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1002),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1008);
}
-static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1015);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1019), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1019),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1027), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1027),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1032);
}
-static void func_8006AE40(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006AE40(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1039);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1043), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1043),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1050), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1050),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1056);
}
-static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -545,10 +555,11 @@ static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId)
func_80093D84(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 1 * (globalCtx->state.frames * 2), 1 * -(globalCtx->state.frames * 6), 32, 32,
- 1, 1 * (globalCtx->state.frames * 1), -1 * (globalCtx->state.frames * 2), 32, 32));
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1074), G_MTX_MODELVIEW | G_MTX_LOAD);
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 2),
+ 1 * -(globalCtx->state.frames * 6), 32, 32, 1, 1 * (globalCtx->state.frames * 1),
+ -1 * (globalCtx->state.frames * 2), 32, 32));
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1074),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
@@ -556,15 +567,15 @@ static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1081);
}
-static void func_8006B124(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006B124(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1088);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1092), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1092),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]);
@@ -573,28 +584,28 @@ static void func_8006B124(GlobalContext* globalCtx, s16 drawId)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1100);
}
-static void func_8006B24C(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006B24C(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1108);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1112), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1112),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1120), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1120),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1126);
}
-static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -603,20 +614,21 @@ static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId)
Matrix_Scale(0.7f, 0.7f, 0.7f, MTXMODE_APPLY);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1140), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1140),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1148), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1148),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1154);
}
-static void func_8006B54C(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -624,10 +636,11 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId)
func_80093D84(globalCtx->state.gfxCtx);
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 1 * (globalCtx->state.frames * 2), -1 * (globalCtx->state.frames * 2), 64, 64,
- 1, 1 * (globalCtx->state.frames * 4), 1 * -(globalCtx->state.frames * 4), 32, 32));
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1173), G_MTX_MODELVIEW | G_MTX_LOAD);
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 1 * (globalCtx->state.frames * 2),
+ -1 * (globalCtx->state.frames * 2), 64, 64, 1, 1 * (globalCtx->state.frames * 4),
+ 1 * -(globalCtx->state.frames * 4), 32, 32));
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1173),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[1]);
@@ -636,20 +649,21 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1181);
}
-static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1188);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1192), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1192),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
func_80093D84(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1200), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1200),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[2]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[3]);
gSPDisplayList(gfxCtx->polyXlu.p++, sDrawItemTable[drawId].dlists[4]);
@@ -657,8 +671,7 @@ static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1207);
}
-static void func_8006B870(GlobalContext* globalCtx, s16 drawId)
-{
+static void func_8006B870(GlobalContext* globalCtx, s16 drawId) {
u32 pad;
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4];
@@ -666,7 +679,8 @@ static void func_8006B870(GlobalContext* globalCtx, s16 drawId)
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_draw.c", 1214);
func_80093D18(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1218), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_draw.c", 1218),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[1]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[0]);
gSPDisplayList(gfxCtx->polyOpa.p++, sDrawItemTable[drawId].dlists[2]);
diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c
index eb7b016dc..56fbb6b3e 100644
--- a/src/code/z_eff_blure.c
+++ b/src/code/z_eff_blure.c
@@ -9,8 +9,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_80020A50.s")
-void func_80020F60(u32 unused, GraphicsContext* gfxCtx)
-{
+void func_80020F60(u32 unused, GraphicsContext* gfxCtx) {
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, gfxCtx, D_80135180, 809);
@@ -29,4 +28,3 @@ void func_80020F60(u32 unused, GraphicsContext* gfxCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_800224F4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_blure/func_80022A10.s")
-
diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c
index fd85f4abb..d3f2591f8 100644
--- a/src/code/z_eff_shield_particle.c
+++ b/src/code/z_eff_shield_particle.c
@@ -8,4 +8,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_shield_particle/func_8002389C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_shield_particle/func_800245BC.s")
-
diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c
index f24a7f3ab..5f7c2a65f 100644
--- a/src/code/z_eff_spark.c
+++ b/src/code/z_eff_spark.c
@@ -3,12 +3,9 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80024B00.s")
-void func_80024F0C(UNK_TYPE arg0)
-{
-
+void func_80024F0C(UNK_TYPE arg0) {
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80024F14.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_spark/func_80025000.s")
-
diff --git a/src/code/z_eff_ss_dead.c b/src/code/z_eff_ss_dead.c
index c3228d70b..f203e81e4 100644
--- a/src/code/z_eff_ss_dead.c
+++ b/src/code/z_eff_ss_dead.c
@@ -12,4 +12,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_ss_dead/func_80026860.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eff_ss_dead/func_80026A6C.s")
-
diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c
index 833994f81..34b264bf4 100644
--- a/src/code/z_effect_soft_sprite.c
+++ b/src/code/z_effect_soft_sprite.c
@@ -7,8 +7,7 @@ void Effect_SS_Delete(LoadedParticleEntry* particle);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_800272B0.s")
-void Effect_SS_Clear(GlobalContext* globalCtx)
-{
+void Effect_SS_Clear(GlobalContext* globalCtx) {
u32 i;
LoadedParticleEntry* iter;
ParticleOverlay* iter2;
@@ -18,35 +17,36 @@ void Effect_SS_Clear(GlobalContext* globalCtx)
EffectSS2Info.searchIndex = 0;
EffectSS2Info.size = 0;
- for (iter = EffectSS2Info.data_table; iter < EffectSS2Info.data_table + EffectSS2Info.size; iter++)
+ for (iter = EffectSS2Info.data_table; iter < EffectSS2Info.data_table + EffectSS2Info.size; iter++) {
Effect_SS_Delete(iter);
+ }
// Free memory from loaded particle overlays
iter2 = &sParticleOverlayTable[0];
- for (i = 0; i < ARRAY_COUNT(sParticleOverlayTable); i++)
- {
+ for (i = 0; i < ARRAY_COUNT(sParticleOverlayTable); i++) {
addr = iter2->loadedRamAddr;
- if (addr != NULL)
+ if (addr != NULL) {
ZeldaArena_FreeDebug(addr, D_801357DC, 337);
+ }
(iter2++)->loadedRamAddr = NULL;
}
}
-void Effect_SS_Delete(LoadedParticleEntry* particle)
-{
- if (particle->flags & 2)
+void Effect_SS_Delete(LoadedParticleEntry* particle) {
+ if (particle->flags & 2) {
func_800F89E8(particle);
+ }
- if (particle->flags & 4)
+ if (particle->flags & 4) {
func_800F89E8(&particle->unk_2C);
+ }
Effect_SS_ResetEntry(particle);
}
-void Effect_SS_ResetEntry(LoadedParticleEntry* particle)
-{
+void Effect_SS_ResetEntry(LoadedParticleEntry* particle) {
u32 i;
particle->type = 0x25;
@@ -70,8 +70,9 @@ void Effect_SS_ResetEntry(LoadedParticleEntry* particle)
particle->unk_38 = 0;
particle->unk_3C = 0;
- for (i = 0; i != 13; i++)
+ for (i = 0; i != 13; i++) {
particle->unk_40[i] = 0;
+ }
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_800275D0.s")
@@ -80,12 +81,10 @@ void Effect_SS_ResetEntry(LoadedParticleEntry* particle)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_80027798.s")
-void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index)
-{
+void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index) {
LoadedParticleEntry* particle = &EffectSS2Info.data_table[index];
- if (particle->update != NULL)
- {
+ if (particle->update != NULL) {
particle->velocity.x += particle->acceleration.x;
particle->velocity.y += particle->acceleration.y;
particle->velocity.z += particle->acceleration.z;
@@ -98,47 +97,43 @@ void Effect_SS_UpdateParticle(GlobalContext* globalCtx, s32 index)
}
}
-void Effect_SS_UpdateAllParticles(GlobalContext* globalCtx)
-{
+void Effect_SS_UpdateAllParticles(GlobalContext* globalCtx) {
s32 i;
- for (i = 0; i < EffectSS2Info.size; i++)
- {
- if (EffectSS2Info.data_table[i].life > -1)
- {
+ for (i = 0; i < EffectSS2Info.size; i++) {
+ if (EffectSS2Info.data_table[i].life > -1) {
EffectSS2Info.data_table[i].life--;
- if (EffectSS2Info.data_table[i].life < 0)
+ if (EffectSS2Info.data_table[i].life < 0) {
Effect_SS_Delete(&EffectSS2Info.data_table[i]);
+ }
}
- if (EffectSS2Info.data_table[i].life > -1)
+ if (EffectSS2Info.data_table[i].life > -1) {
Effect_SS_UpdateParticle(globalCtx, i);
+ }
}
}
-void Effect_SS_DrawParticle(GlobalContext* globalCtx, s32 index)
-{
+void Effect_SS_DrawParticle(GlobalContext* globalCtx, s32 index) {
LoadedParticleEntry* particle = &EffectSS2Info.data_table[index];
- if (particle->draw != NULL)
+ if (particle->draw != NULL) {
particle->draw(globalCtx, index, particle);
+ }
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite/func_80027BDC.s")
-s16 func_80027DD4(s16 arg0, s16 arg1, s32 arg2)
-{
- s16 ret = !arg2 ? arg1 : (arg0 + (s32) ((f32) (arg1 - arg0) / arg2));
+s16 func_80027DD4(s16 arg0, s16 arg1, s32 arg2) {
+ s16 ret = !arg2 ? arg1 : (arg0 + (s32)((f32)(arg1 - arg0) / arg2));
return ret;
}
-s16 func_80027E34(s16 a0, s16 a1, f32 a2)
-{
+s16 func_80027E34(s16 a0, s16 a1, f32 a2) {
return (a1 - a0) * a2 + a0;
}
-u8 func_80027E84(u8 a0, u8 a1, f32 a2)
-{
+u8 func_80027E84(u8 a0, u8 a1, f32 a2) {
return a2 * ((f32)a1 - (f32)a0) + a0;
}
diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c
index a385667ee..847e25e2f 100644
--- a/src/code/z_effect_soft_sprite_old_init.c
+++ b/src/code/z_effect_soft_sprite_old_init.c
@@ -164,4 +164,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002A9F4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_effect_soft_sprite_old_init/func_8002AA44.s")
-
diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c
index 02bc0a16e..ea67ceb05 100644
--- a/src/code/z_en_a_keep.c
+++ b/src/code/z_en_a_keep.c
@@ -1,8 +1,7 @@
#include <ultra64.h>
#include <global.h>
-typedef enum
-{
+typedef enum {
/* 0x00 */ A_OBJ_BLOCK_SMALL,
/* 0x01 */ A_OBJ_BLOCK_LARGE,
/* 0x02 */ A_OBJ_BLOCK_HUGE,
@@ -17,23 +16,22 @@ typedef enum
/* 0x0B */ A_OBJ_KNOB
} AObjType;
-typedef struct
-{
+typedef struct {
/* 0x000 */ Actor actor;
- /* 0x14C */ u32 dynaPolyId;
- /* 0x150 */ f32 unk_150;
- /* 0x154 */ f32 unk_154;
- /* 0x158 */ s16 unk_158;
- /* 0x15C */ u32 unk_15C;
- /* 0x160 */ u8 unk_160;
+ /* 0x14C */ u32 dynaPolyId;
+ /* 0x150 */ f32 unk_150;
+ /* 0x154 */ f32 unk_154;
+ /* 0x158 */ s16 unk_158;
+ /* 0x15C */ u32 unk_15C;
+ /* 0x160 */ u8 unk_160;
/* 0x164 */ ActorFunc updateFunc;
- /* 0x168 */ s32 unk_168;
- /* 0x16C */ s16 textId;
- /* 0x16E */ s16 unk_16E;
- /* 0x170 */ s16 unk_170;
- /* 0x172 */ s16 unk_172;
- /* 0x174 */ s16 unk_174;
- /* 0x178 */ f32 unk_178;
+ /* 0x168 */ s32 unk_168;
+ /* 0x16C */ s16 textId;
+ /* 0x16E */ s16 unk_16E;
+ /* 0x170 */ s16 unk_170;
+ /* 0x172 */ s16 unk_172;
+ /* 0x174 */ s16 unk_174;
+ /* 0x178 */ f32 unk_178;
/* 0x17C */ ColliderCylinderMain cylinderCollider;
} ActorEnAObj; // size = 0x1C8
@@ -54,15 +52,13 @@ extern ColliderCylinderInit D_80115440;
extern u32 D_8011546C[];
extern u32 D_80115484[];
-void En_A_Obj_SetNewUpdate(ActorEnAObj* this, ActorFunc newUpdateFunc)
-{
+void En_A_Obj_SetNewUpdate(ActorEnAObj* this, ActorFunc newUpdateFunc) {
this->updateFunc = newUpdateFunc;
}
#ifdef NON_MATCHING
// minor ordering and regalloc differences
-void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
-{
+void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx) {
u32 sp34;
s16 type;
s16 initialParams;
@@ -77,8 +73,7 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
this->textId = (initialParams >> 8) & 0xFF;
this->actor.params = type;
- switch (type & 0xFFFF)
- {
+ switch (type & 0xFFFF) {
case A_OBJ_BLOCK_SMALL:
Actor_SetScale(&this->actor, 0.025f);
break;
@@ -112,8 +107,7 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
params = this->actor.params;
this->actor.posRot2.pos = this->actor.posRot.pos;
- switch (params)
- {
+ switch (params) {
case A_OBJ_BLOCK_LARGE:
case A_OBJ_BLOCK_HUGE:
this->dynaPolyId = 1;
@@ -159,12 +153,11 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
func_8001D234(this, params);
break;
}
-
+
if (this->actor.params < 5)
this->actor.sub_98.mass = 0xFF;
- if (this->dynaPolyId != -1)
- {
+ if (this->dynaPolyId != -1) {
DynaPolyInfo_Alloc(D_8011546C[this->dynaPolyId], &sp34);
this->dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, &globalCtx->colCtx.dyna, &this->actor, sp34);
}
@@ -173,51 +166,44 @@ void En_A_Obj_Init(ActorEnAObj* this, GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_en_a_keep/En_A_Obj_Init.s")
#endif
-void En_A_Obj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx)
-{
+void En_A_Obj_Destroy(ActorEnAObj* this, GlobalContext* globalCtx) {
ColliderCylinderMain* cylinderCollider = &this->cylinderCollider;
DynaPolyInfo_Free(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId);
- switch (this->actor.params)
- {
+ switch (this->actor.params) {
case A_OBJ_SIGNPOST_OBLONG:
case A_OBJ_SIGNPOST_ARROW:
ActorCollider_FreeCylinder(globalCtx, cylinderCollider);
}
}
-void func_8001D204(ActorEnAObj* this, GlobalContext* globalCtx)
-{
- if (func_8002F334(&this->actor, globalCtx))
+void func_8001D204(ActorEnAObj* this, GlobalContext* globalCtx) {
+ if (func_8002F334(&this->actor, globalCtx)) {
func_8001D234(this, this->actor.params);
+ }
}
-void func_8001D234(ActorEnAObj* this, s16 params)
-{
+void func_8001D234(ActorEnAObj* this, s16 params) {
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D25C);
}
-void func_8001D25C(ActorEnAObj* this, GlobalContext* globalCtx)
-{
+void func_8001D25C(ActorEnAObj* this, GlobalContext* globalCtx) {
s16 var;
- if (this->actor.textId != 0)
- {
+ if (this->actor.textId != 0) {
var = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
- if ((ABS(var) < 0x2800) ||
- ((this->actor.params == 0xA) && (ABS(var) > 0x5800)))
- {
- if (func_8002F194(&this->actor, globalCtx))
+ if ((ABS(var) < 0x2800) || ((this->actor.params == 0xA) && (ABS(var) > 0x5800))) {
+ if (func_8002F194(&this->actor, globalCtx)) {
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D204);
- else
+ } else {
func_8002F2F4(&this->actor, globalCtx);
+ }
}
}
}
-void func_8001D310(ActorEnAObj* this, s16 params)
-{
+void func_8001D310(ActorEnAObj* this, s16 params) {
this->unk_16E = 0;
this->unk_168 = 10;
this->actor.posRot.rot.y = 0;
@@ -225,41 +211,34 @@ void func_8001D310(ActorEnAObj* this, s16 params)
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D360);
}
-void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx)
-{
- if (this->unk_16E == 0)
- {
- if (this->unk_160 != 0)
- {
+void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx) {
+ if (this->unk_16E == 0) {
+ if (this->unk_160 != 0) {
this->unk_16E++;
this->unk_170 = 20;
- if ((s16)(this->actor.rotTowardsLinkY + 0x4000) < 0)
+ if ((s16)(this->actor.rotTowardsLinkY + 0x4000) < 0) {
this->unk_174 = -1000;
- else
+ } else {
this->unk_174 = 1000;
+ }
- if (this->actor.rotTowardsLinkY < 0)
+ if (this->actor.rotTowardsLinkY < 0) {
this->unk_172 = -this->unk_174;
- else
+ } else {
this->unk_172 = this->unk_174;
+ }
}
- }
- else
- {
- if (this->unk_168 != 0)
- {
+ } else {
+ if (this->unk_168 != 0) {
this->unk_168--;
- }
- else
- {
+ } else {
this->actor.shape.rot.y += this->unk_172;
this->actor.shape.rot.x += this->unk_174;
this->unk_170--;
this->actor.gravity = -1.0f;
- if (this->unk_170 == 0)
- {
+ if (this->unk_170 == 0) {
this->actor.posRot.pos = this->actor.initPosRot.pos;
this->unk_16E = 0;
this->unk_168 = 10;
@@ -271,82 +250,74 @@ void func_8001D360(ActorEnAObj* this, GlobalContext* globalCtx)
}
}
-void func_8001D480(ActorEnAObj* this, s16 params)
-{
+void func_8001D480(ActorEnAObj* this, s16 params) {
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D4A8);
}
-void func_8001D4A8(ActorEnAObj* this, GlobalContext* globalCtx)
-{
+void func_8001D4A8(ActorEnAObj* this, GlobalContext* globalCtx) {
Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f);
this->actor.shape.rot.x = this->actor.shape.rot.x + (this->actor.posRot.rot.x >> 1);
this->actor.shape.rot.z = this->actor.shape.rot.z + (this->actor.posRot.rot.z >> 1);
- if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 0x8))
- {
- if (1) // Necessary to match
+ if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 0x8)) {
+ if (1) { // Necessary to match
this->actor.posRot.rot.y = ((this->actor.unk_7E - this->actor.posRot.rot.y) + this->actor.unk_7E) - 0x8000;
+ }
this->actor.bgCheckFlags &= ~0x8;
}
- if (this->actor.bgCheckFlags & 0x2)
- {
- if (this->actor.velocity.y < -8.0f)
- {
+ if (this->actor.bgCheckFlags & 0x2) {
+ if (this->actor.velocity.y < -8.0f) {
this->actor.velocity.y *= -0.6f;
this->actor.speedXZ *= 0.6f;
this->actor.bgCheckFlags &= ~0x3;
- }
- else
+ } else {
Actor_Kill(&this->actor);
+ }
}
}
-void func_8001D5C8(ActorEnAObj* this, s16 params)
-{
+void func_8001D5C8(ActorEnAObj* this, s16 params) {
this->actor.unk_FC = 1200.0f;
this->actor.unk_F8 = 720.0f;
En_A_Obj_SetNewUpdate(this, (ActorFunc)func_8001D608);
}
-void func_8001D608(ActorEnAObj* this, GlobalContext* globalCtx)
-{
+void func_8001D608(ActorEnAObj* this, GlobalContext* globalCtx) {
this->actor.speedXZ += this->unk_150;
this->actor.posRot.rot.y = this->unk_158;
- this->actor.speedXZ = (this->actor.speedXZ < -2.5f) ? -2.5f :
- ((this->actor.speedXZ > 2.5f) ? 2.5f :
- this->actor.speedXZ);
+ this->actor.speedXZ =
+ (this->actor.speedXZ < -2.5f) ? -2.5f : ((this->actor.speedXZ > 2.5f) ? 2.5f : this->actor.speedXZ);
Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f);
- if (this->actor.speedXZ != 0.0f)
+ if (this->actor.speedXZ != 0.0f) {
Audio_PlayActorSound2(&this->actor, 0x200A);
+ }
this->unk_154 = 0.0f;
this->unk_150 = 0.0f;
}
-void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx)
-{
+void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx) {
ColliderCylinderMain* cylinderCollider;
this->updateFunc(this, globalCtx);
Actor_MoveForward(&this->actor);
- if (this->actor.gravity != 0.0f)
- {
- if (this->actor.params != A_OBJ_KNOB)
+ if (this->actor.gravity != 0.0f) {
+ if (this->actor.params != A_OBJ_KNOB) {
func_8002E4B4(globalCtx, &this->actor, 5.0f, 40.0f, 0.0f, 0x1D);
- else
+ } else {
func_8002E4B4(globalCtx, &this->actor, 5.0f, 20.0f, 0.0f, 0x1D);
+ }
}
this->actor.posRot2.pos = this->actor.posRot.pos;
this->actor.posRot2.pos.y += this->unk_178;
- switch (this->actor.params)
- {
+ switch (this->actor.params) {
case A_OBJ_SIGNPOST_OBLONG:
case A_OBJ_SIGNPOST_ARROW:
cylinderCollider = &this->cylinderCollider;
@@ -355,8 +326,7 @@ void En_A_Obj_Update(ActorEnAObj* this, GlobalContext* globalCtx)
}
}
-void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx)
-{
+void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx) {
s32 type = this->actor.params;
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4];
@@ -365,13 +335,16 @@ void En_A_Obj_Draw(ActorEnAObj* this, GlobalContext* globalCtx)
func_80093D18(globalCtx->state.gfxCtx);
- if (type > A_OBJ_KNOB)
+ if (type > A_OBJ_KNOB) {
type = A_OBJ_KNOB;
+ }
- if (this->actor.params == A_OBJ_KNOB)
+ if (this->actor.params == A_OBJ_KNOB) {
gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 1, 0x3C, 0x3C, 0x3C, 0x32);
+ }
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_a_keep.c", 712),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, D_80115484[type]);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_a_keep.c", 715);
diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c
index 3ce4c4b75..1945c75ff 100644
--- a/src/code/z_en_item00.c
+++ b/src/code/z_en_item00.c
@@ -1,8 +1,7 @@
#include <ultra64.h>
#include <global.h>
-typedef enum
-{
+typedef enum {
/* 0x00 */ DROP_RUPEE_GREEN,
/* 0x01 */ DROP_RUPEE_BLUE,
/* 0x02 */ DROP_RUPEE_RED,
@@ -31,8 +30,7 @@ typedef enum
/* 0x19 */ DROP_BOMBS_SPECIAL
} DropType;
-typedef struct
-{
+typedef struct {
/* 0x000 */ Actor actor;
/* 0x14C */ ActorFunc updateFunc;
/* 0x150 */ s16 collectibleFlag;
@@ -65,15 +63,13 @@ extern u8 D_80115664[];
// Internal Actor Functions
-void En_Item00_SetNewUpdate(ActorEnItem00* this, ActorFunc newUpdateFunc)
-{
+void En_Item00_SetNewUpdate(ActorEnItem00* this, ActorFunc newUpdateFunc) {
this->updateFunc = newUpdateFunc;
}
#ifdef NON_MATCHING
// Very close to matching, just a single ordering issue
-void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx) {
s32 pad1;
s32 pad2;
f32 sp34;
@@ -91,8 +87,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
this->actor.params = this->actor.params & 0x00FF;
- if (Flags_GetCollectible(globalCtx, this->collectibleFlag))
- {
+ if (Flags_GetCollectible(globalCtx, this->collectibleFlag)) {
Actor_Kill(&this->actor);
return;
}
@@ -103,8 +98,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
this->unk_158 = 1;
- switch (this->actor.params)
- {
+ switch (this->actor.params) {
case DROP_RUPEE_GREEN:
case DROP_RUPEE_BLUE:
case DROP_RUPEE_RED:
@@ -216,8 +210,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
this->unk_152 = 0;
// MISMATCH: minor ordering issues here
- if (!spawnParam8000)
- {
+ if (!spawnParam8000) {
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8);
this->unk_15A = -1;
return;
@@ -230,8 +223,7 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
this->actor.velocity.y = 0.0f;
this->actor.gravity = 0.0f;
- switch (this->actor.params)
- {
+ switch (this->actor.params) {
case DROP_RUPEE_GREEN:
Item_Give(globalCtx, ITEM_RUPEE_GREEN);
break;
@@ -307,147 +299,131 @@ void En_Item00_Init(ActorEnItem00* this, GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_en_item00/En_Item00_Init.s")
#endif
-void En_Item00_Destroy(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void En_Item00_Destroy(ActorEnItem00* this, GlobalContext* globalCtx) {
ColliderCylinderMain* cylinderCollider = &this->cylinderCollider;
ActorCollider_FreeCylinder(globalCtx, cylinderCollider);
}
-void func_8001DFC8(ActorEnItem00* this, GlobalContext* globalCtx)
-{
- if ((this->actor.params <= DROP_RUPEE_RED) ||
- ((this->actor.params == DROP_HEART) && (this->unk_15A < 0)) ||
- (this->actor.params == DROP_HEART_PIECE))
- {
+void func_8001DFC8(ActorEnItem00* this, GlobalContext* globalCtx) {
+ if ((this->actor.params <= DROP_RUPEE_RED) || ((this->actor.params == DROP_HEART) && (this->unk_15A < 0)) ||
+ (this->actor.params == DROP_HEART_PIECE)) {
this->actor.shape.rot.y += 960;
- }
- else
- {
- if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL))
- {
- if (this->unk_15A == -1)
- {
- if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500))
+ } else {
+ if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL)) {
+ if (this->unk_15A == -1) {
+ if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, this->actor.posRot.rot.x - 0x4000, 2, 3000,
+ 1500)) {
this->unk_15A = -2;
- }
- else
- {
- if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000, 1500))
+ }
+ } else {
+ if (!Math_SmoothScaleMaxMinS(&this->actor.shape.rot.x, -this->actor.posRot.rot.x - 0x4000, 2, 3000,
+ 1500)) {
this->unk_15A = -1;
+ }
}
Math_SmoothScaleMaxMinS(&this->actor.posRot.rot.x, 0, 2, 2500, 500);
}
}
- if (this->actor.params == DROP_HEART_PIECE)
+ if (this->actor.params == DROP_HEART_PIECE) {
this->actor.shape.unk_08 = Math_Sins(this->actor.shape.rot.y) * 150.0f + 850.0f;
+ }
Math_SmoothScaleMaxMinF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f);
- if (this->unk_154 == 0)
- if ((this->actor.params != DROP_SMALL_KEY) &&
- (this->actor.params != DROP_HEART_PIECE) &&
- (this->actor.params != DROP_HEART_CONTAINER))
- {
+ if (this->unk_154 == 0) {
+ if ((this->actor.params != DROP_SMALL_KEY) && (this->actor.params != DROP_HEART_PIECE) &&
+ (this->actor.params != DROP_HEART_CONTAINER)) {
this->unk_154 = -1;
}
+ }
- if (this->unk_15A == 0)
- if ((this->actor.params != DROP_SMALL_KEY) &&
- (this->actor.params != DROP_HEART_PIECE) &&
- (this->actor.params != DROP_HEART_CONTAINER))
- {
+ if (this->unk_15A == 0) {
+ if ((this->actor.params != DROP_SMALL_KEY) && (this->actor.params != DROP_HEART_PIECE) &&
+ (this->actor.params != DROP_HEART_CONTAINER)) {
Actor_Kill(&this->actor);
}
+ }
- if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 0x0001))
+ if ((this->actor.gravity != 0.0f) && !(this->actor.bgCheckFlags & 0x0001)) {
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001E1C8);
+ }
}
-void func_8001E1C8(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void func_8001E1C8(ActorEnItem00* this, GlobalContext* globalCtx) {
f32 originalVelocity;
Vec3f pos;
- if (this->actor.params <= DROP_RUPEE_RED)
+ if (this->actor.params <= DROP_RUPEE_RED) {
this->actor.shape.rot.y += 960;
+ }
- if (globalCtx->gameplayFrames & 1)
- {
+ if (globalCtx->gameplayFrames & 1) {
pos.x = this->actor.posRot.pos.x + Math_Rand_CenteredFloat(10.0f);
pos.y = this->actor.posRot.pos.y + Math_Rand_CenteredFloat(10.0f);
pos.z = this->actor.posRot.pos.z + Math_Rand_CenteredFloat(10.0f);
func_80028B74(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514);
}
- if (this->actor.bgCheckFlags & 0x0003)
- {
+ if (this->actor.bgCheckFlags & 0x0003) {
originalVelocity = this->actor.velocity.y;
- if (originalVelocity > -2.0f)
- {
+ if (originalVelocity > -2.0f) {
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8);
this->actor.velocity.y = 0.0f;
- }
- else
- {
+ } else {
this->actor.velocity.y = originalVelocity * -0.8f;
this->actor.bgCheckFlags = this->actor.bgCheckFlags & 0xFFFE;
}
}
}
-void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx) {
s32 pad;
Vec3f pos;
s32 var1;
this->unk_15A++;
- if (this->actor.params == DROP_HEART)
- {
- if (this->actor.velocity.y < 0.0f)
- {
+ if (this->actor.params == DROP_HEART) {
+ if (this->actor.velocity.y < 0.0f) {
this->actor.speedXZ = 0.0f;
this->actor.gravity = -0.4f;
- if (this->actor.velocity.y < -1.5f)
+ if (this->actor.velocity.y < -1.5f) {
this->actor.velocity.y = -1.5f;
- this->actor.initPosRot.rot.z += (s16) ((this->actor.velocity.y + 3.0f) * 1000.0f);
- this->actor.posRot.pos.x += Math_Coss(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
- this->actor.posRot.pos.z += Math_Sins(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
+ }
+ this->actor.initPosRot.rot.z += (s16)((this->actor.velocity.y + 3.0f) * 1000.0f);
+ this->actor.posRot.pos.x +=
+ Math_Coss(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
+ this->actor.posRot.pos.z +=
+ Math_Sins(this->actor.rotTowardsLinkY) * (-3.0f * Math_Coss(this->actor.initPosRot.rot.z));
}
}
- if (this->actor.params <= DROP_RUPEE_RED)
- {
+ if (this->actor.params <= DROP_RUPEE_RED) {
this->actor.shape.rot.y += 960;
- }
- else if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL))
- {
+ } else if ((this->actor.params >= DROP_SHIELD_DEKU) && (this->actor.params != DROP_BOMBS_SPECIAL)) {
this->actor.posRot.rot.x -= 700;
this->actor.shape.rot.y += 400;
this->actor.shape.rot.x = this->actor.posRot.rot.x - 0x4000;
}
- if (this->actor.velocity.y <= 2.0f)
- {
+ if (this->actor.velocity.y <= 2.0f) {
var1 = (u16)this->actor.shape.rot.z + 10000;
- if (var1 < 65535)
+ if (var1 < 65535) {
this->actor.shape.rot.z += 10000;
- else
+ } else {
this->actor.shape.rot.z = -1;
+ }
}
- if (!(globalCtx->gameplayFrames & 1))
- {
+ if (!(globalCtx->gameplayFrames & 1)) {
pos.x = this->actor.posRot.pos.x + (Math_Rand_ZeroOne() - 0.5f) * 10.0f;
pos.y = this->actor.posRot.pos.y + (Math_Rand_ZeroOne() - 0.5f) * 10.0f;
pos.z = this->actor.posRot.pos.z + (Math_Rand_ZeroOne() - 0.5f) * 10.0f;
func_80028B74(globalCtx, &pos, &D_80115518, &D_80115524, &D_80115510, &D_80115514);
}
- if (this->actor.bgCheckFlags & 0x0003)
- {
+ if (this->actor.bgCheckFlags & 0x0003) {
En_Item00_SetNewUpdate(this, (ActorFunc)func_8001DFC8);
this->actor.shape.rot.z = 0;
this->actor.velocity.y = 0.0f;
@@ -455,40 +431,36 @@ void func_8001E304(ActorEnItem00* this, GlobalContext* globalCtx)
}
}
-void func_8001E5C8(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void func_8001E5C8(ActorEnItem00* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
- if (this->unk_152 != 0)
- {
- if (!func_8002F410(&this->actor, globalCtx))
- {
+ if (this->unk_152 != 0) {
+ if (!func_8002F410(&this->actor, globalCtx)) {
func_8002F434(&this->actor, globalCtx, this->unk_152, 50.0f, 80.0f);
this->unk_15A++;
- }
- else
- {
+ } else {
this->unk_152 = 0;
}
}
- if (this->unk_15A == 0)
- {
+ if (this->unk_15A == 0) {
Actor_Kill(&this->actor);
return;
}
this->actor.posRot.pos = player->actor.posRot.pos;
- if (this->actor.params <= DROP_RUPEE_RED)
+ if (this->actor.params <= DROP_RUPEE_RED) {
this->actor.shape.rot.y += 960;
- else if (this->actor.params == DROP_HEART)
+ } else if (this->actor.params == DROP_HEART) {
this->actor.shape.rot.y = 0;
+ }
this->actor.posRot.pos.y += 40.0f + Math_Sins(this->unk_15A * 15000) * (this->unk_15A * 0.3f);
- if LINK_IS_ADULT
- this->actor.posRot.pos.y += 20.0f;
+ if
+ LINK_IS_ADULT
+ this->actor.posRot.pos.y += 20.0f;
}
extern s32 D_80157D90;
@@ -497,8 +469,7 @@ extern s16 D_80157D94;
#ifdef NON_MATCHING
// Almost matching, just a few minor ordering issues
-void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx) {
s32 pad1;
s32 pad2;
s32 sp3C;
@@ -521,44 +492,34 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
this->actor.scale.z = this->actor.scale.x;
this->actor.scale.y = this->actor.scale.x;
- if (this->actor.gravity)
- {
- if (this->actor.bgCheckFlags & 0x0003)
- {
+ if (this->actor.gravity) {
+ if (this->actor.bgCheckFlags & 0x0003) {
// Separate symbols seem to be used here for 0x80157D90 since the loads and stores are completely separate
- if (D_80157D90 != globalCtx->gameplayFrames)
- {
+ if (D_80157D90 != globalCtx->gameplayFrames) {
D_80157D90_ = globalCtx->gameplayFrames;
D_80157D94 = 0;
- for (i = 0; i < 50; i++)
- {
- if (globalCtx->colCtx.dyna.flags[i] & 1)
- {
+ for (i = 0; i < 50; i++) {
+ if (globalCtx->colCtx.dyna.flags[i] & 1) {
dynaActor = globalCtx->colCtx.dyna.actorMeshArr[i].actor;
if ((dynaActor != NULL) && (dynaActor->update != NULL) &&
((dynaActor->posRot.pos.x != dynaActor->pos4.x) ||
(dynaActor->posRot.pos.y != dynaActor->pos4.y) ||
- (dynaActor->posRot.pos.z != dynaActor->pos4.z)))
- {
+ (dynaActor->posRot.pos.z != dynaActor->pos4.z))) {
D_80157D94++;
break;
}
}
}
}
- }
- else
- {
+ } else {
sp3A = 1;
Actor_MoveForward(&this->actor);
}
- if (sp3A || D_80157D94)
- {
+ if (sp3A || D_80157D94) {
func_8002E4B4(globalCtx, &this->actor, 10.0f, 15.0f, 15.0f, 0x1D);
- if (this->actor.unk_80 <= -10000.0f)
- {
+ if (this->actor.unk_80 <= -10000.0f) {
Actor_Kill(&this->actor);
return;
}
@@ -569,8 +530,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
Actor_CollisionCheck_SetAC(globalCtx, &globalCtx->sub_11E60, &this->cylinderCollider);
if ((this->actor.params == DROP_SHIELD_DEKU) || (this->actor.params == DROP_SHIELD_HYLIAN) ||
- (this->actor.params == DROP_TUNIC_ZORA) || (this->actor.params == DROP_TUNIC_GORON))
- {
+ (this->actor.params == DROP_TUNIC_ZORA) || (this->actor.params == DROP_TUNIC_GORON)) {
f32 newUnkBC = Math_Coss(this->actor.shape.rot.x) * 37.0f;
this->actor.shape.unk_08 = newUnkBC;
if (newUnkBC >= 0.0f)
@@ -583,8 +543,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
return;
// MISMATCH: The first function argument is loaded too early here
- if (!((this->actor.xzDistanceFromLink <= 30.0f) &&
- (this->actor.yDistanceFromLink >= -50.0f) &&
+ if (!((this->actor.xzDistanceFromLink <= 30.0f) && (this->actor.yDistanceFromLink >= -50.0f) &&
(this->actor.yDistanceFromLink <= 50.0f)))
if (!func_8002F410(&this->actor, globalCtx))
return;
@@ -592,8 +551,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
if (globalCtx->unk_10A20 != 0)
return;
- switch (this->actor.params)
- {
+ switch (this->actor.params) {
case DROP_RUPEE_GREEN:
Item_Give(globalCtx, ITEM_RUPEE_GREEN);
break;
@@ -675,8 +633,7 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
if ((sp3C != 0) && !func_8002F410(&this->actor, globalCtx))
func_8002F554(&this->actor, globalCtx, sp3C);
- switch (this->actor.params)
- {
+ switch (this->actor.params) {
case DROP_HEART_PIECE:
case DROP_HEART_CONTAINER:
case DROP_SMALL_KEY:
@@ -684,29 +641,22 @@ void En_Item00_Update(ActorEnItem00* this, GlobalContext* globalCtx)
case DROP_SHIELD_HYLIAN:
case DROP_TUNIC_ZORA:
case DROP_TUNIC_GORON:
- if (func_8002F410(&this->actor, globalCtx))
- {
+ if (func_8002F410(&this->actor, globalCtx)) {
Flags_SetCollectible(globalCtx, this->collectibleFlag);
Actor_Kill(&this->actor);
}
return;
}
- if ((this->actor.params <= DROP_RUPEE_RED) || (this->actor.params == DROP_RUPEE_ORANGE))
- {
+ if ((this->actor.params <= DROP_RUPEE_RED) || (this->actor.params == DROP_RUPEE_ORANGE)) {
Audio_PlaySoundGeneral(NA_SE_SY_GET_RUPY, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- }
- else if (sp3C != 0)
- {
- if (func_8002F410(&this->actor, globalCtx))
- {
+ } else if (sp3C != 0) {
+ if (func_8002F410(&this->actor, globalCtx)) {
Flags_SetCollectible(globalCtx, this->collectibleFlag);
Actor_Kill(&this->actor);
}
return;
- }
- else
- {
+ } else {
Audio_PlaySoundGeneral(NA_SE_SY_GET_ITEM, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
@@ -734,15 +684,12 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx);
void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx);
void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx);
-void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx) {
s32 pad;
f32 unkFloat;
- if (!(this->unk_156 & this->unk_158))
- {
- switch (this->actor.params)
- {
+ if (!(this->unk_156 & this->unk_158)) {
+ switch (this->actor.params) {
case DROP_RUPEE_GREEN:
case DROP_RUPEE_BLUE:
case DROP_RUPEE_RED:
@@ -757,20 +704,15 @@ void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx)
func_8001F1F4(this, globalCtx);
break;
case DROP_HEART:
- if (this->unk_15A < 0)
- {
- if (this->unk_15A == -1)
- {
+ if (this->unk_15A < 0) {
+ if (this->unk_15A == -1) {
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
- if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex))
- {
+ if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
this->actor.objBankIndex = bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
this->unk_15A = -2;
}
- }
- else
- {
+ } else {
unkFloat = 16.0f;
Matrix_Scale(unkFloat, unkFloat, unkFloat, MTXMODE_APPLY);
func_800694A0(globalCtx, 0x08);
@@ -813,8 +755,7 @@ void En_Item00_Draw(ActorEnItem00* this, GlobalContext* globalCtx)
/**
* Draw Function used for Rupee types of En_Item00.
*/
-void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
s32 iconNb;
Gfx* gfxArr[5];
@@ -824,15 +765,16 @@ void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx)
func_80093D18(globalCtx->state.gfxCtx);
func_8002EBCC(&this->actor, globalCtx, 0);
- if (1) // Necessary to match
- {
- if (this->actor.params <= DROP_RUPEE_RED)
+ if (1) { // Necessary to match
+ if (this->actor.params <= DROP_RUPEE_RED) {
iconNb = this->actor.params;
- else
+ } else {
iconNb = this->actor.params - 0x10;
+ }
}
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1562), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1562),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_80115530[iconNb]));
@@ -844,8 +786,7 @@ void func_8001EF30(ActorEnItem00* this, GlobalContext* globalCtx)
/**
* Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...).
*/
-void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx) {
s32 iconNb;
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4];
@@ -856,16 +797,18 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx)
gfxCtx->polyOpa.p = func_800BC8A0(globalCtx, gfxCtx->polyOpa.p);
- if (this->actor.params == DROP_BOMBS_SPECIAL)
+ if (this->actor.params == DROP_BOMBS_SPECIAL) {
iconNb = 1;
- else if (this->actor.params >= DROP_ARROWS_SMALL)
+ } else if (this->actor.params >= DROP_ARROWS_SMALL) {
iconNb -= 3;
+ }
gfxCtx->polyOpa.p = func_800946E4(gfxCtx->polyOpa.p);
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_80115544[iconNb]));
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1607), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1607),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0403F070);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1611);
@@ -874,8 +817,7 @@ void func_8001F080(ActorEnItem00* this, GlobalContext* globalCtx)
/**
* Draw Function used for the Heart Container type of En_Item00.
*/
-void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -883,12 +825,14 @@ void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx)
func_80093D18(globalCtx->state.gfxCtx);
func_8002EBCC(&this->actor, globalCtx, 0);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1634), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1634),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, &D_0403BBA0);
func_80093D84(globalCtx->state.gfxCtx);
func_8002ED80(&this->actor, globalCtx, 0);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1644), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1644),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_0403BCD8);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1647);
@@ -897,8 +841,7 @@ void func_8001F1F4(ActorEnItem00* this, GlobalContext* globalCtx)
/**
* Draw Function used for the Piece of Heart type of En_Item00.
*/
-void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx)
-{
+void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -906,7 +849,8 @@ void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx)
func_80093D84(globalCtx->state.gfxCtx);
func_8002ED80(&this->actor, globalCtx, 0);
- gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1670), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_item00.c", 1670),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyXlu.p++, &D_0403B030);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_en_item00.c", 1673);
@@ -916,38 +860,39 @@ void func_8001F334(ActorEnItem00* this, GlobalContext* globalCtx)
* Converts a given drop type ID based on link's current age, health and owned items.
* Returns a new drop type ID or -1 to cancel the drop.
*/
-s16 func_8001F404(s16 dropId)
-{
- if (LINK_IS_ADULT)
- {
- if (dropId == DROP_SEEDS)
+s16 func_8001F404(s16 dropId) {
+ if (LINK_IS_ADULT) {
+ if (dropId == DROP_SEEDS) {
dropId = DROP_ARROWS_SMALL;
- else if (dropId == DROP_STICK)
+ } else if (dropId == DROP_STICK) {
dropId = DROP_RUPEE_GREEN;
- }
- else
- {
- if (dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE)
+ }
+ } else {
+ if (dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) {
dropId = DROP_SEEDS;
+ }
}
// This is convoluted but it seems like it must be a single condition to match
+ // clang-format off
if (((dropId == DROP_BOMBS_A || dropId == DROP_BOMBS_SPECIAL || dropId == DROP_BOMBS_B) && INV_CONTENT(ITEM_BOMB) == ITEM_NONE) ||
((dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) && INV_CONTENT(ITEM_BOW) == ITEM_NONE) ||
((dropId == DROP_MAGIC_LARGE || dropId == DROP_MAGIC_SMALL) && gSaveContext.magic_level == 0) ||
- ((dropId == DROP_SEEDS) && INV_CONTENT(ITEM_SLINGSHOT) == ITEM_NONE))
+ ((dropId == DROP_SEEDS) && INV_CONTENT(ITEM_SLINGSHOT) == ITEM_NONE)) {
return -1;
+ }
+ // clang-format on
- if (dropId == DROP_HEART && gSaveContext.health_capacity == gSaveContext.health)
+ if (dropId == DROP_HEART && gSaveContext.health_capacity == gSaveContext.health) {
return DROP_RUPEE_GREEN;
+ }
return dropId;
}
// External functions used by other actors to drop collectibles, which usually results in spawning an En_Item00 actor.
-Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params)
-{
+Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) {
s32 pad[2];
ActorEnItem00* spawnedActor = NULL;
s16 param4000 = params & 0x4000;
@@ -956,26 +901,21 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param
params = params & 0x3FFF;
- if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000)
- {
+ if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000) {
// TODO: Prevent the cast to ActorEnItem00 here since this is a different actor (En_Elf)
- spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF,
- spawnPos->x, spawnPos->y + 40.0f, spawnPos->z,
- 0, 0, 0, 0x0002);
+ spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x,
+ spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, 0x0002);
func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28);
- }
- else
- {
- if (!param8000)
+ } else {
+ if (!param8000) {
params = func_8001F404(params & 0x00FF);
+ }
- if (params != -1)
- {
- spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
- spawnPos->x, spawnPos->y, spawnPos->z,
- 0, 0, 0, params | param8000 | param3F00);
- if ((spawnedActor != NULL) && !param8000)
- {
+ if (params != -1) {
+ spawnedActor =
+ (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y,
+ spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
+ if ((spawnedActor != NULL) && !param8000) {
spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f;
spawnedActor->actor.speedXZ = 2.0f;
spawnedActor->actor.gravity = -0.9f;
@@ -985,8 +925,7 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param
spawnedActor->unk_15A = 220;
if ((spawnedActor->actor.params != DROP_SMALL_KEY) &&
(spawnedActor->actor.params != DROP_HEART_PIECE) &&
- (spawnedActor->actor.params != DROP_HEART_CONTAINER))
- {
+ (spawnedActor->actor.params != DROP_HEART_CONTAINER)) {
spawnedActor->actor.room = -1;
}
spawnedActor->actor.flags |= 0x0010;
@@ -994,11 +933,10 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param
}
}
- return (Actor*) spawnedActor;
+ return (Actor*)spawnedActor;
}
-Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params)
-{
+Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) {
ActorEnItem00* spawnedActor = NULL;
s32 pad;
s16 param4000 = params & 0x4000;
@@ -1007,24 +945,18 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 para
params = params & 0x3FFF;
- if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000)
- {
+ if (((params & 0x00FF) == DROP_FLEXIBLE) && !param4000) {
// TODO: Prevent the cast to ActorEnItem00 here since this is a different actor (En_Elf)
- spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF,
- spawnPos->x, spawnPos->y + 40.0f, spawnPos->z,
- 0, 0, 0, 0x0002);
+ spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x,
+ spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0, 0x0002);
func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28);
- }
- else
- {
+ } else {
params = func_8001F404(params & 0x00FF);
- if (params != -1)
- {
- spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
- spawnPos->x, spawnPos->y, spawnPos->z,
- 0, 0, 0, params | param8000 | param3F00);
- if ((spawnedActor != NULL) && !param8000)
- {
+ if (params != -1) {
+ spawnedActor =
+ (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y,
+ spawnPos->z, 0, 0, 0, params | param8000 | param3F00);
+ if ((spawnedActor != NULL) && !param8000) {
spawnedActor->actor.velocity.y = 0.0f;
spawnedActor->actor.speedXZ = 0.0f;
spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f;
@@ -1034,11 +966,10 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 para
}
}
- return (Actor*) spawnedActor;
+ return (Actor*)spawnedActor;
}
-void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params)
-{
+void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params) {
s32 pad;
ActorEnItem00* spawnedActor;
s16 dropQuantity;
@@ -1050,133 +981,93 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
param8000 = params & 0x8000;
params = params & 0x7FFF;
- if (fromActor != NULL)
- {
- if (fromActor->unk_116)
- {
- if (fromActor->unk_116 & 0x01)
- {
+ if (fromActor != NULL) {
+ if (fromActor->unk_116) {
+ if (fromActor->unk_116 & 0x01) {
params = 1 * 0x10;
dropTableIndex = 0xB;
- }
- else if (fromActor->unk_116 & 0x02)
- {
+ } else if (fromActor->unk_116 & 0x02) {
params = 1 * 0x10;
dropTableIndex = 0x6;
- }
- else if (fromActor->unk_116 & 0x04)
- {
+ } else if (fromActor->unk_116 & 0x04) {
params = 6 * 0x10;
dropTableIndex = 0x9;
- }
- else if (fromActor->unk_116 & 0x08)
- {
+ } else if (fromActor->unk_116 & 0x08) {
params = 3 * 0x10;
dropTableIndex = 0xB;
- }
- else if (fromActor->unk_116 & 0x10)
- {
+ } else if (fromActor->unk_116 & 0x10) {
params = 6 * 0x10;
dropTableIndex = 0xC;
- }
- else if (fromActor->unk_116 & 0x20)
- {
+ } else if (fromActor->unk_116 & 0x20) {
params = 0 * 0x10;
dropTableIndex = 0x0;
- }
- else if (fromActor->unk_116 & 0x40)
- {
+ } else if (fromActor->unk_116 & 0x40) {
params = 0 * 0x10;
dropTableIndex = 0x1;
}
}
- if (fromActor->unk_116 & 0x20)
+ if (fromActor->unk_116 & 0x20) {
dropId = DROP_RUPEE_PURPLE;
- else
+ } else {
dropId = D_80115574[params + dropTableIndex];
- }
- else
+ }
+ } else {
dropId = D_80115574[params + dropTableIndex];
+ }
- if (dropId == DROP_FLEXIBLE)
- {
- if (gSaveContext.health <= 0x10) // 1 heart or less
- {
- Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF,
- spawnPos->x, spawnPos->y + 40.0f, spawnPos->z,
- 0, 0, 0, 0x0002);
+ if (dropId == DROP_FLEXIBLE) {
+ if (gSaveContext.health <= 0x10) { // 1 heart or less
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0,
+ 0, 0, 0x0002);
func_8002A9F4(globalCtx, spawnPos, 0x28E7, 1, 1, 0x28);
return;
- }
- else if (gSaveContext.health <= 0x30) // 3 hearts or less
- {
+ } else if (gSaveContext.health <= 0x30) { // 3 hearts or less
params = 0xB * 0x10;
dropTableIndex = 0x0;
dropId = DROP_HEART;
- }
- else if (gSaveContext.health <= 0x50) // 5 hearts or less
- {
+ } else if (gSaveContext.health <= 0x50) { // 5 hearts or less
params = 0xA * 0x10;
dropTableIndex = 0x0;
dropId = DROP_HEART;
- }
- else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic == 0)) // Empty magic meter
- {
+ } else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic == 0)) { // Empty magic meter
params = 0xA * 0x10;
dropTableIndex = 0x0;
dropId = DROP_MAGIC_LARGE;
- }
- else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic <= (gSaveContext.magic_level >> 1))) // Half magic or less
- {
+ } else if ((gSaveContext.magic_level != 0) &&
+ (gSaveContext.magic <= (gSaveContext.magic_level >> 1))) { // Half magic or less
params = 0xA * 0x10;
dropTableIndex = 0x0;
dropId = DROP_MAGIC_SMALL;
- }
- else if (LINK_IS_CHILD && (AMMO(ITEM_SLINGSHOT) < 6)) // Child and less then 6 deku seeds
- {
+ } else if (LINK_IS_CHILD && (AMMO(ITEM_SLINGSHOT) < 6)) { // Child and less then 6 deku seeds
params = 0xA * 0x10;
dropTableIndex = 0x0;
dropId = DROP_SEEDS;
- }
- else if (LINK_IS_ADULT && (AMMO(ITEM_BOW) < 6)) // Adult and less than 6 arrows
- {
+ } else if (LINK_IS_ADULT && (AMMO(ITEM_BOW) < 6)) { // Adult and less than 6 arrows
params = 0xA * 0x10;
dropTableIndex = 0x0;
dropId = DROP_ARROWS_MEDIUM;
- }
- else if (AMMO(ITEM_BOMB) < 6) // Less than 6 bombs
- {
+ } else if (AMMO(ITEM_BOMB) < 6) { // Less than 6 bombs
params = 0xD * 0x10;
dropTableIndex = 0x0;
dropId = DROP_BOMBS_A;
- }
- else if (gSaveContext.rupees < 11) // Less than 11 Rupees
- {
+ } else if (gSaveContext.rupees < 11) { // Less than 11 Rupees
params = 0xA * 0x10;
dropTableIndex = 0x0;
dropId = DROP_RUPEE_RED;
- }
- else
- {
+ } else {
return;
}
}
- if (dropId != 0xFF)
- {
+ if (dropId != 0xFF) {
dropQuantity = D_80115664[params + dropTableIndex];
- while (dropQuantity > 0)
- {
- if (!param8000)
- {
+ while (dropQuantity > 0) {
+ if (!param8000) {
dropId = func_8001F404(dropId);
- if (dropId != 0xFF)
- {
- spawnedActor = (ActorEnItem00*) Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
- spawnPos->x, spawnPos->y, spawnPos->z,
- 0, 0, 0, dropId);
- if ((spawnedActor != NULL) && (dropId != 0xFF))
- {
+ if (dropId != 0xFF) {
+ spawnedActor = (ActorEnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
+ spawnPos->x, spawnPos->y, spawnPos->z, 0, 0, 0, dropId);
+ if ((spawnedActor != NULL) && (dropId != 0xFF)) {
spawnedActor->actor.velocity.y = 8.0f;
spawnedActor->actor.speedXZ = 2.0f;
spawnedActor->actor.gravity = -0.9f;
@@ -1186,16 +1077,13 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
spawnedActor->actor.flags |= 0x0010;
if ((spawnedActor->actor.params != DROP_SMALL_KEY) &&
(spawnedActor->actor.params != DROP_HEART_PIECE) &&
- (spawnedActor->actor.params != DROP_HEART_CONTAINER))
- {
+ (spawnedActor->actor.params != DROP_HEART_CONTAINER)) {
spawnedActor->actor.room = -1;
}
spawnedActor->unk_15A = 220;
}
}
- }
- else
- {
+ } else {
Item_DropCollectible(globalCtx, spawnPos, params | 0x8000);
}
dropQuantity--;
diff --git a/src/code/z_fbdemo.c b/src/code/z_fbdemo.c
index 803562036..e2b6f3cef 100644
--- a/src/code/z_fbdemo.c
+++ b/src/code/z_fbdemo.c
@@ -18,4 +18,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_800B23E8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fbdemo/func_800B23F0.s")
-
diff --git a/src/code/z_fcurve_data_skelanime.c b/src/code/z_fcurve_data_skelanime.c
index bb9c5e8cd..8feea0af9 100644
--- a/src/code/z_fcurve_data_skelanime.c
+++ b/src/code/z_fcurve_data_skelanime.c
@@ -14,4 +14,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_8006CBAC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_fcurve_data_skelanime/func_8006CF6C.s")
-
diff --git a/src/code/z_horse.c b/src/code/z_horse.c
index 69a0e6f3a..13f6382f5 100644
--- a/src/code/z_horse.c
+++ b/src/code/z_horse.c
@@ -2,22 +2,20 @@
#include <global.h>
#include <vt.h>
-s32 func_8006CFC0(s32 scene)
-{
+s32 func_8006CFC0(s32 scene) {
s32 validScenes[] = { SCENE_SPOT00, SCENE_SPOT06, SCENE_SPOT09, SCENE_SPOT12, SCENE_SPOT20 };
s32 i;
- for (i = 0; i < ARRAY_COUNT(validScenes); i++)
- {
- if (scene == validScenes[i])
+ for (i = 0; i < ARRAY_COUNT(validScenes); i++) {
+ if (scene == validScenes[i]) {
return 1;
+ }
}
return 0;
}
-void func_8006D074(GlobalContext* globalCtx)
-{
+void func_8006D074(GlobalContext* globalCtx) {
gSaveContext.horse_data.scene = SCENE_SPOT00;
gSaveContext.horse_data.pos.x = -1840;
gSaveContext.horse_data.pos.y = 72;
@@ -25,10 +23,8 @@ void func_8006D074(GlobalContext* globalCtx)
gSaveContext.horse_data.angle = -27353;
}
-void func_8006D0AC(GlobalContext* globalCtx)
-{
- if (gSaveContext.horse_data.scene == SCENE_SPOT06)
- {
+void func_8006D0AC(GlobalContext* globalCtx) {
+ if (gSaveContext.horse_data.scene == SCENE_SPOT06) {
gSaveContext.horse_data.scene = SCENE_SPOT06;
gSaveContext.horse_data.pos.x = -2065;
gSaveContext.horse_data.pos.y = -863;
@@ -37,147 +33,126 @@ void func_8006D0AC(GlobalContext* globalCtx)
}
}
-typedef struct
-{
- /* 0x00 */ s16 scene;
+typedef struct {
+ /* 0x00 */ s16 scene;
/* 0x02 */ Vec3s pos;
- /* 0x08 */ s16 angle;
- /* 0x0A */ s16 type;
+ /* 0x08 */ s16 angle;
+ /* 0x0A */ s16 type;
} HorseSpawn;
-void func_8006D0EC(GlobalContext* globalCtx, Player* player)
-{
+void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
s32 i;
- HorseSpawn horseSpawns[] =
- {
- { 81, 0xFE34, 0x0064, 0x19F0, 0, 2 },
- { 87, 0xF877, 0xFBFF, 0x0300, 0, 2 },
- { 90, 0x0A06, 0xFEFD, 0x02FF, 0, 2 },
- { 93, 0xFEB8, 0x000A, 0x03B9, 0, 2 },
+ HorseSpawn horseSpawns[] = {
+ { 81, 0xFE34, 0x0064, 0x19F0, 0, 2 }, { 87, 0xF877, 0xFBFF, 0x0300, 0, 2 },
+ { 90, 0x0A06, 0xFEFD, 0x02FF, 0, 2 }, { 93, 0xFEB8, 0x000A, 0x03B9, 0, 2 },
{ 99, 0x03A0, 0x0000, 0xF718, 0, 2 },
};
- if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)))
- {
- player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- player->actor.posRot.pos.x, player->actor.posRot.pos.y, player->actor.posRot.pos.z,
- player->actor.shape.rot.x, player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
- if (player->rideActor == NULL)
+ if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) {
+ player->rideActor =
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.posRot.pos.x,
+ player->actor.posRot.pos.y, player->actor.posRot.pos.z, player->actor.shape.rot.x,
+ player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
+ if (player->rideActor == NULL) {
__assert("player->ride.actor != NULL", "../z_horse.c", 343);
+ }
func_8002DECC(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
gSaveContext.horse_data.scene = globalCtx->sceneNum;
- if (globalCtx->sceneNum == SCENE_SPOT12)
+ if (globalCtx->sceneNum == SCENE_SPOT12) {
player->rideActor->room = -1;
- }
- else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigame_state == 3))
- {
+ }
+ } else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigame_state == 3)) {
Actor* horseActor;
gSaveContext.minigame_state = 0;
- horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- 3586.0f, 1413.0f, -402.0f,
- 0, 0x4000, 0, 1);
+ horseActor =
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1);
horseActor->room = -1;
- }
- else if ((gSaveContext.entrance_index == 1230) && (gSaveContext.event_chk_inf[1] & 0x100))
- {
+ } else if ((gSaveContext.entrance_index == 1230) && (gSaveContext.event_chk_inf[1] & 0x100)) {
Actor* horseActor;
- horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- -25.0f, 0.0f, -1600.0f,
- 0, -0x4000, 0, 1);
- if (horseActor == NULL)
+ horseActor =
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
+ if (horseActor == NULL) {
__assert("horse_actor != NULL", "../z_horse.c", 389);
- }
- else if ((globalCtx->sceneNum == gSaveContext.horse_data.scene) && (Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0))
- {
+ }
+ } else if ((globalCtx->sceneNum == gSaveContext.horse_data.scene) &&
+ (Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) {
// Translates to: "SET BY EXISTENCE OF HORSE %d %d %d"
- osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horse_data.scene, Flags_GetEventChkInf(0x18), DREG(1));
+ osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horse_data.scene, Flags_GetEventChkInf(0x18),
+ DREG(1));
- if (func_8006CFC0(gSaveContext.horse_data.scene))
- {
+ if (func_8006CFC0(gSaveContext.horse_data.scene)) {
Actor* horseActor;
- horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- gSaveContext.horse_data.pos.x, gSaveContext.horse_data.pos.y, gSaveContext.horse_data.pos.z,
- 0, gSaveContext.horse_data.angle, 0, 1);
- if (horseActor == NULL)
+ horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, gSaveContext.horse_data.pos.x,
+ gSaveContext.horse_data.pos.y, gSaveContext.horse_data.pos.z, 0,
+ gSaveContext.horse_data.angle, 0, 1);
+ if (horseActor == NULL) {
__assert("horse_actor != NULL", "../z_horse.c", 414);
+ }
- if (globalCtx->sceneNum == SCENE_SPOT12)
+ if (globalCtx->sceneNum == SCENE_SPOT12) {
horseActor->room = -1;
- }
- else
- {
+ }
+ } else {
osSyncPrintf(VT_COL(RED, WHITE));
// Translates to: "Horse_SetNormal():%d SET SPOT IS NO GOOD."
osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene);
osSyncPrintf(VT_RST);
func_8006D074(globalCtx);
}
- }
- else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0))
- {
+ } else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) {
Actor* horseActor;
- horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- 0.0f, 0.0f, -500.0f,
- 0, 0, 0, 1);
- if (horseActor == 0)
+ horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1);
+ if (horseActor == 0) {
__assert("horse_actor != NULL", "../z_horse.c", 443);
- }
- else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))
- {
- for (i = 0; i < ARRAY_COUNT(horseSpawns); i++)
- {
+ }
+ } else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) {
+ for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) {
HorseSpawn* horseSpawn = &horseSpawns[i];
- if (horseSpawn->scene == globalCtx->sceneNum)
- {
+ if (horseSpawn->scene == globalCtx->sceneNum) {
Actor* horseActor;
- horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- horseSpawn->pos.x, horseSpawn->pos.y, horseSpawn->pos.z,
- 0, horseSpawn->angle, 0, horseSpawn->type);
- if (horseActor == NULL)
+ horseActor =
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y,
+ horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type);
+ if (horseActor == NULL) {
__assert("horse_actor != NULL", "../z_horse.c", 466);
+ }
- if (globalCtx->sceneNum == SCENE_SPOT12)
+ if (globalCtx->sceneNum == SCENE_SPOT12) {
horseActor->room = -1;
+ }
break;
}
}
- }
- else if (!Flags_GetEventChkInf(0x18))
- {
- if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) &&(gSaveContext.night_flag != 0))
- Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- 0.0f, 0.0f, -60.0f,
- 0, 0x7360, 0, 1);
+ } else if (!Flags_GetEventChkInf(0x18)) {
+ if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.night_flag != 0)) {
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1);
+ }
}
}
-typedef struct
-{
- /* 0x00 */ s16 scene;
- /* 0x04 */ s32 cutsceneIndex;
+typedef struct {
+ /* 0x00 */ s16 scene;
+ /* 0x04 */ s32 cutsceneIndex;
/* 0x08 */ Vec3s pos;
- /* 0x0E */ s16 angle;
- /* 0x10 */ s16 type;
+ /* 0x0E */ s16 angle;
+ /* 0x10 */ s16 type;
} struct_8011F9B8;
#ifdef NON_MATCHING
// regalloc differences
-void func_8006D684(GlobalContext* globalCtx, Player* player)
-{
+void func_8006D684(GlobalContext* globalCtx, Player* player) {
s32 pad;
s32 i;
Vec3s spawnPos;
if ((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E ||
gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) &&
- (gSaveContext.respawn_flag == 0))
- {
- Vec3s spawnPositions[] =
- {
+ (gSaveContext.respawn_flag == 0)) {
+ Vec3s spawnPositions[] = {
{ 0xF46F, 0x0139, 0x1E14 },
{ 0xF894, 0x0139, 0x1B67 },
{ 0xF035, 0x0139, 0x1B15 },
@@ -193,22 +168,18 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
else
spawnPos = spawnPositions[3];
- player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- spawnPos.x, spawnPos.y, spawnPos.z,
- 0, player->actor.posRot.rot.y, 0, 7);
+ player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
+ spawnPos.z, 0, player->actor.posRot.rot.y, 0, 7);
if (player->rideActor == NULL)
__assert("player->ride.actor != NULL", "../z_horse.c", 561);
func_8002DECC(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
gSaveContext.horse_data.scene = globalCtx->sceneNum;
- }
- else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
- (Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0))
- {
- player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- 894.0f, 0.0f, -2084.0f,
- 0, -0x7FFF, 0, 5);
+ } else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
+ (Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) {
+ player->rideActor =
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5);
if (player->rideActor == NULL)
__assert("player->ride.actor != NULL", "../z_horse.c", 582);
@@ -218,45 +189,33 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
if (globalCtx->sceneNum == SCENE_SPOT12)
player->rideActor->room = -1;
- }
- else
- {
- static struct_8011F9B8 D_8011F9B8[] =
- {
- { 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 },
- { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
- { 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 },
- { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
- { 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 },
- { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
- { 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
- { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
+ } else {
+ static struct_8011F9B8 D_8011F9B8[] = {
+ { 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
+ { 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
+ { 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
+ { 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
};
- for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++)
- {
- if ((globalCtx->sceneNum == D_8011F9B8[i].scene) && (gSaveContext.cutscene_index == D_8011F9B8[i].cutsceneIndex))
- {
- if (D_8011F9B8[i].type == 7)
- {
- if ((globalCtx->sceneNum == 99) && (gSaveContext.cutscene_index == 0xFFF1))
- {
+ for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) {
+ if ((globalCtx->sceneNum == D_8011F9B8[i].scene) &&
+ (gSaveContext.cutscene_index == D_8011F9B8[i].cutsceneIndex)) {
+ if (D_8011F9B8[i].type == 7) {
+ if ((globalCtx->sceneNum == 99) && (gSaveContext.cutscene_index == 0xFFF1)) {
D_8011F9B8[i].pos.x = player->actor.posRot.pos.x;
D_8011F9B8[i].pos.y = player->actor.posRot.pos.y;
D_8011F9B8[i].pos.z = player->actor.posRot.pos.z;
}
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z,
- 0, player->actor.posRot.rot.y, 0, D_8011F9B8[i].type);
+ D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
+ player->actor.posRot.rot.y, 0, D_8011F9B8[i].type);
if (player->rideActor == NULL)
__assert("player->ride.actor != NULL", "../z_horse.c", 628);
func_8002DECC(globalCtx, player, player->rideActor);
func_8002DE74(globalCtx, player);
- }
- else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8))
- {
+ } else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8)) {
Vec3f sp54;
s32 temp;
s32 pad2;
@@ -266,8 +225,8 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
temp = 0x8000;
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z,
- 0, D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
+ D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
+ D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
if (player->rideActor == NULL)
__assert("player->ride.actor != NULL", "../z_horse.c", 667);
@@ -285,12 +244,10 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
sp54.z = player->actor.posRot.pos.z;
func_800C04D8(globalCtx, globalCtx->cameraCtx.unk_5C0, &player->actor.posRot, &sp54);
- }
- else
- {
- Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
- D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z,
- 0, D_8011F9B8[i].angle, 0, D_8011F9B8[i].type);
+ } else {
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x,
+ D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0,
+ D_8011F9B8[i].type);
}
break;
}
@@ -298,33 +255,24 @@ void func_8006D684(GlobalContext* globalCtx, Player* player)
}
}
#else
-Vec3s D_8011F9A0[] =
-{
+Vec3s D_8011F9A0[] = {
{ 0xF46F, 0x0139, 0x1E14 },
{ 0xF894, 0x0139, 0x1B67 },
{ 0xF035, 0x0139, 0x1B15 },
{ 0xF6F7, 0x0139, 0x1766 },
};
-struct_8011F9B8 D_8011F9B8[] =
-{
- { 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 },
- { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
- { 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 },
- { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
- { 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 },
- { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
- { 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
- { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
+struct_8011F9B8 D_8011F9B8[] = {
+ { 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
+ { 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
+ { 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
+ { 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
};
#pragma GLOBAL_ASM("asm/non_matchings/code/z_horse/func_8006D684.s")
#endif
-void func_8006DC68(GlobalContext* globalCtx, Player* player)
-{
- if (LINK_IS_ADULT)
- {
- if (!func_8006CFC0(gSaveContext.horse_data.scene))
- {
+void func_8006DC68(GlobalContext* globalCtx, Player* player) {
+ if (LINK_IS_ADULT) {
+ if (!func_8006CFC0(gSaveContext.horse_data.scene)) {
osSyncPrintf(VT_COL(RED, WHITE));
// Translates to: "Horse_Set_Check():%d SET SPOT IS NO GOOD."
osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene);
@@ -332,35 +280,31 @@ void func_8006DC68(GlobalContext* globalCtx, Player* player)
func_8006D074(globalCtx);
}
- if (func_8006CFC0(globalCtx->sceneNum))
- {
+ if (func_8006CFC0(globalCtx->sceneNum)) {
if ((gSaveContext.scene_setup_index > 3) ||
((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E ||
gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) &&
(gSaveContext.respawn_flag == 0)) ||
((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
- !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)))
- {
+ !Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) {
func_8006D684(globalCtx, player);
- }
- else
- {
+ } else {
func_8006D0EC(globalCtx, player);
}
}
}
}
-void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2)
-{
+void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) {
s16 x = Math_Vec3f_Yaw(&actor->posRot.pos, arg1) - actor->posRot.rot.y;
- if (x > arg2)
+ if (x > arg2) {
actor->posRot.rot.y += arg2;
- else if (x < -arg2)
+ } else if (x < -arg2) {
actor->posRot.rot.y -= arg2;
- else
+ } else {
actor->posRot.rot.y += x;
+ }
actor->shape.rot.y = actor->posRot.rot.y;
}
diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c
index 93fe90b27..5031ad823 100644
--- a/src/code/z_jpeg.c
+++ b/src/code/z_jpeg.c
@@ -10,4 +10,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_8006E0EC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_jpeg/func_8006E418.s")
-
diff --git a/src/code/z_kaleido_manager.c b/src/code/z_kaleido_manager.c
index ad5761ec7..519639a15 100644
--- a/src/code/z_kaleido_manager.c
+++ b/src/code/z_kaleido_manager.c
@@ -1,15 +1,13 @@
#include <global.h>
#include <vt.h>
-#define KALEIDO_OVERLAY(name) \
- { \
- NULL, (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, \
- _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, \
- 0, #name, \
+#define KALEIDO_OVERLAY(name) \
+ { \
+ NULL, (u32)_ovl_##name##SegmentRomStart, (u32)_ovl_##name##SegmentRomEnd, _ovl_##name##SegmentStart, \
+ _ovl_##name##SegmentEnd, 0, #name, \
}
-KaleidoManagerOvl gKaleidoMgrOverlayTable[] =
-{
+KaleidoManagerOvl gKaleidoMgrOverlayTable[] = {
KALEIDO_OVERLAY(kaleido_scope),
KALEIDO_OVERLAY(player_actor),
};
@@ -18,22 +16,21 @@ void* sKaleidoAreaPtr = NULL;
KaleidoManagerOvl* gKaleidoMgrCurOvl = NULL;
u32 D_8012D1E0 = 0;
-void KaleidoManager_LoadOvl(KaleidoManagerOvl* ovl)
-{
+void KaleidoManager_LoadOvl(KaleidoManagerOvl* ovl) {
LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, "../z_kaleido_manager.c", 99);
ovl->loadedRamAddr = sKaleidoAreaPtr;
Overlay_Load(ovl->vromStart, ovl->vromEnd, ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr);
osSyncPrintf(VT_FGCOL(GREEN));
- osSyncPrintf("OVL(k):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr, ((u32)ovl->loadedRamAddr + ovl->vramEnd) - (u32)ovl->vramStart, (u32)ovl->vramStart - (u32)ovl->loadedRamAddr, ovl->name);
+ osSyncPrintf("OVL(k):Seg:%08x-%08x Ram:%08x-%08x Off:%08x %s\n", ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr,
+ ((u32)ovl->loadedRamAddr + ovl->vramEnd) - (u32)ovl->vramStart,
+ (u32)ovl->vramStart - (u32)ovl->loadedRamAddr, ovl->name);
osSyncPrintf(VT_RST);
ovl->off = (u32)ovl->loadedRamAddr - (u32)ovl->vramStart;
gKaleidoMgrCurOvl = ovl;
}
-void KaleidoManager_ClearOvl(KaleidoManagerOvl* ovl)
-{
- if (ovl->loadedRamAddr)
- {
+void KaleidoManager_ClearOvl(KaleidoManagerOvl* ovl) {
+ if (ovl->loadedRamAddr) {
ovl->off = 0;
bzero(ovl->loadedRamAddr, ovl->vramEnd - (u32)ovl->vramStart);
ovl->loadedRamAddr = NULL;
@@ -41,18 +38,17 @@ void KaleidoManager_ClearOvl(KaleidoManagerOvl* ovl)
}
}
-void KaleidoManager_Init(GlobalContext* globalCtx)
-{
+void KaleidoManager_Init(GlobalContext* globalCtx) {
s32 largestOvl;
s32 vramSize;
u32 idx;
largestOvl = 0;
- for (idx = 0; idx < ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++)
- {
+ for (idx = 0; idx < ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++) {
vramSize = gKaleidoMgrOverlayTable[idx].vramEnd - (u32)gKaleidoMgrOverlayTable[idx].vramStart;
- if (largestOvl < vramSize)
+ if (largestOvl < vramSize) {
largestOvl = vramSize;
+ }
}
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("KaleidoArea の最大サイズは %d バイトを確保します\n", largestOvl);
@@ -64,46 +60,41 @@ void KaleidoManager_Init(GlobalContext* globalCtx)
osSyncPrintf(VT_RST);
gKaleidoMgrCurOvl = 0;
}
-void KaleidoManager_Destroy()
-{
- if (gKaleidoMgrCurOvl)
- {
+void KaleidoManager_Destroy() {
+ if (gKaleidoMgrCurOvl) {
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
gKaleidoMgrCurOvl = NULL;
}
sKaleidoAreaPtr = NULL;
}
-//NOTE: this function looks messed up and probably doesn't work like how the devs wanted it to work
-void* KaleidoManager_GetRamAddr(void* vram)
-{
+// NOTE: this function looks messed up and probably doesn't work like how the devs wanted it to work
+void* KaleidoManager_GetRamAddr(void* vram) {
KaleidoManagerOvl* iter;
KaleidoManagerOvl* ovl;
u32 idx;
iter = gKaleidoMgrCurOvl;
ovl = iter;
- if (!ovl)
- {
+ if (!ovl) {
iter = &gKaleidoMgrOverlayTable[0];
- for (idx = 0; idx != ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++)
- {
- if ((u32)vram >= (u32)iter->vramStart && (u32)iter->vramEnd >= (u32)vram)
- {
+ for (idx = 0; idx != ARRAY_COUNT(gKaleidoMgrOverlayTable); idx++) {
+ if ((u32)vram >= (u32)iter->vramStart && (u32)iter->vramEnd >= (u32)vram) {
KaleidoManager_LoadOvl(iter);
ovl = iter;
goto KaleidoManager_GetRamAddr_end;
}
- //BUG: devs probably forgot iter++ here
+ // BUG: devs probably forgot iter++ here
}
-
- osSyncPrintf("異常\n"); //Abnormal
+
+ osSyncPrintf("異常\n"); // Abnormal
return NULL;
}
KaleidoManager_GetRamAddr_end:
- if (!ovl || (u32)vram < (u32)ovl->vramStart || (u32)vram >= (u32)ovl->vramEnd)
+ if (!ovl || (u32)vram < (u32)ovl->vramStart || (u32)vram >= (u32)ovl->vramEnd) {
return NULL;
+ }
return (void*)((u32)vram + ovl->off);
}
diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c
index 7932415df..a722beff9 100644
--- a/src/code/z_kaleido_scope_call.c
+++ b/src/code/z_kaleido_scope_call.c
@@ -7,34 +7,30 @@ float D_80161398;
u32 D_8016139C;
void* D_801613A0;
-extern void func_80826CB4(GlobalContext*); //KaleidoScope_Update
-extern void func_808262B8(GlobalContext*); //KaleidoScope_Draw
+extern void func_80826CB4(GlobalContext*); // KaleidoScope_Update
+extern void func_808262B8(GlobalContext*); // KaleidoScope_Draw
-void KaleidoScopeCall_LoadPlayer()
-{
- if ((u32)gKaleidoMgrCurOvl != (u32)&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR])
- {
- if (gKaleidoMgrCurOvl)
- {
+void KaleidoScopeCall_LoadPlayer() {
+ if ((u32)gKaleidoMgrCurOvl != (u32)&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR]) {
+ if (gKaleidoMgrCurOvl) {
osSyncPrintf(VT_FGCOL(GREEN));
- osSyncPrintf("カレイド領域 強制排除\n"); //Kaleido area forced exclusion
+ osSyncPrintf("カレイド領域 強制排除\n"); // Kaleido area forced exclusion
osSyncPrintf(VT_RST);
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
}
osSyncPrintf(VT_FGCOL(GREEN));
- osSyncPrintf("プレイヤーアクター搬入\n"); //Player actor import
+ osSyncPrintf("プレイヤーアクター搬入\n"); // Player actor import
osSyncPrintf(VT_RST);
KaleidoManager_LoadOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_PLAYER_ACTOR]);
}
}
-void KaleidoScopeCall_Init(GlobalContext* globalCtx)
-{
- //Kaleidoscope replacement construct
+void KaleidoScopeCall_Init(GlobalContext* globalCtx) {
+ // Kaleidoscope replacement construct
osSyncPrintf("カレイド・スコープ入れ替え コンストラクト \n");
sKaleidoScopeUpdateFunc = KaleidoManager_GetRamAddr(func_80826CB4);
sKaleidoScopeDrawFunc = KaleidoManager_GetRamAddr(func_808262B8);
- //Note : the line numbers suggests there was a macro (see logutils.c)
+ // Note : the line numbers suggests there was a macro (see logutils.c)
LogUtils_LogThreadId("../z_kaleido_scope_call.c", 98);
osSyncPrintf("kaleido_scope_move = %08x\n", func_80826CB4);
LogUtils_LogThreadId("../z_kaleido_scope_call.c", 99);
@@ -46,28 +42,23 @@ void KaleidoScopeCall_Init(GlobalContext* globalCtx)
func_8006ECF4(globalCtx);
}
-void KaleidoScopeCall_Destroy(GlobalContext* globalCtx)
-{
- //Kaleidoscope replacement
+void KaleidoScopeCall_Destroy(GlobalContext* globalCtx) {
+ // Kaleidoscope replacement
osSyncPrintf("カレイド・スコープ入れ替え デストラクト \n");
func_8006EE48(globalCtx);
}
-//regalloc
+// regalloc
#ifdef NON_MATCHING
-void KaleidoScopeCall_Update(GlobalContext* globalCtx)
-{
+void KaleidoScopeCall_Update(GlobalContext* globalCtx) {
u32 pad;
PauseContext* pauseCtx;
-
+
pauseCtx = &globalCtx->pauseCtx;
- if (pauseCtx->state != 0 || pauseCtx->flag != 0)
- {
- if (pauseCtx->state == 1)
- {
- if (func_800B38FC() == 0)
- {
+ if (pauseCtx->state != 0 || pauseCtx->flag != 0) {
+ if (pauseCtx->state == 1) {
+ if (func_800B38FC() == 0) {
HREG(80) = 7;
HREG(82) = 3;
R_PAUSE_MENU_MODE = 1;
@@ -75,45 +66,35 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx)
pauseCtx->unk_1EC = 0;
pauseCtx->state++;
}
- }
- else if (pauseCtx->state == 8)
- {
+ } else if (pauseCtx->state == 8) {
HREG(80) = 7;
HREG(82) = 3;
R_PAUSE_MENU_MODE = 1;
pauseCtx->unk_1E4 = 0;
pauseCtx->unk_1EC = 0;
pauseCtx->state++;
- }
- else if (pauseCtx->state == 2 || pauseCtx->state == 9)
- {
+ } else if (pauseCtx->state == 2 || pauseCtx->state == 9) {
osSyncPrintf("R_PAUSE_MENU_MODE=%d\n", R_PAUSE_MENU_MODE);
if (R_PAUSE_MENU_MODE >= 3)
pauseCtx->state++;
- }
- else if (pauseCtx->state != 0)
- {
- if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] != gKaleidoMgrCurOvl)
- {
- if (gKaleidoMgrCurOvl)
- {
+ } else if (pauseCtx->state != 0) {
+ if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] != gKaleidoMgrCurOvl) {
+ if (gKaleidoMgrCurOvl) {
osSyncPrintf(VT_FGCOL(GREEN));
- osSyncPrintf("カレイド領域 プレイヤー 強制排除\n"); //Kaleid Zone Player Forced Elimination
+ osSyncPrintf("カレイド領域 プレイヤー 強制排除\n"); // Kaleid Zone Player Forced Elimination
osSyncPrintf(VT_RST);
KaleidoManager_ClearOvl(gKaleidoMgrCurOvl);
}
osSyncPrintf(VT_FGCOL(GREEN));
- osSyncPrintf("カレイド領域 カレイドスコープ搬入\n"); //Kaleid area Kaleidoscope loading
+ osSyncPrintf("カレイド領域 カレイドスコープ搬入\n"); // Kaleid area Kaleidoscope loading
osSyncPrintf(VT_RST);
KaleidoManager_LoadOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]);
}
- if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] == gKaleidoMgrCurOvl)
- {
+ if (&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE] == gKaleidoMgrCurOvl) {
sKaleidoScopeUpdateFunc(globalCtx);
- if (globalCtx->pauseCtx.state == 0 && globalCtx->pauseCtx.flag == 0)
- {
+ if (globalCtx->pauseCtx.state == 0 && globalCtx->pauseCtx.flag == 0) {
osSyncPrintf(VT_FGCOL(GREEN));
- osSyncPrintf("カレイド領域 カレイドスコープ排出\n"); //Kaleid area Kaleidoscope emission
+ osSyncPrintf("カレイド領域 カレイドスコープ排出\n"); // Kaleid area Kaleidoscope emission
osSyncPrintf(VT_RST);
KaleidoManager_ClearOvl(&gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE]);
KaleidoScopeCall_LoadPlayer();
@@ -126,18 +107,16 @@ void KaleidoScopeCall_Update(GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kaleido_scope_call/KaleidoScopeCall_Update.s")
#endif
-void KaleidoScopeCall_Draw(GlobalContext* globalCtx)
-{
- KaleidoManagerOvl *kaleidoScopeOvl;
+void KaleidoScopeCall_Draw(GlobalContext* globalCtx) {
+ KaleidoManagerOvl* kaleidoScopeOvl;
- if (R_PAUSE_MENU_MODE >= 3)
- {
- if ((globalCtx->pauseCtx.state >= 4 && globalCtx->pauseCtx.state < 8) || (globalCtx->pauseCtx.state >= 11 && globalCtx->pauseCtx.state < 19))
- {
+ if (R_PAUSE_MENU_MODE >= 3) {
+ if ((globalCtx->pauseCtx.state >= 4 && globalCtx->pauseCtx.state < 8) ||
+ (globalCtx->pauseCtx.state >= 11 && globalCtx->pauseCtx.state < 19)) {
kaleidoScopeOvl = &gKaleidoMgrOverlayTable[KALEIDO_OVL_KALEIDO_SCOPE];
- if (gKaleidoMgrCurOvl == kaleidoScopeOvl)
+ if (gKaleidoMgrCurOvl == kaleidoScopeOvl) {
sKaleidoScopeDrawFunc(globalCtx);
+ }
}
}
-
}
diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c
index fb58245bd..fc2c0b1e8 100644
--- a/src/code/z_kanfont.c
+++ b/src/code/z_kanfont.c
@@ -6,4 +6,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kanfont/func_8006EEBC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kanfont/func_8006EF10.s")
-
diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c
index 94f8bf6dc..7caa221e5 100644
--- a/src/code/z_kankyo.c
+++ b/src/code/z_kankyo.c
@@ -31,8 +31,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_80073A5C.s")
-f32 func_800746DC()
-{
+f32 func_800746DC() {
return Math_Rand_ZeroOne() - 0.5f;
}
@@ -70,23 +69,19 @@ f32 func_800746DC()
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800773A8.s")
-s32 func_800775CC()
-{
+s32 func_800775CC() {
return gSaveContext.unk_18;
}
-void func_800775D8()
-{
+void func_800775D8() {
gSaveContext.unk_18 = 0;
}
-s32 func_800775E4()
-{
+s32 func_800775E4() {
return gSaveContext.unk_14;
}
-void func_800775F0(u16 arg0)
-{
+void func_800775F0(u16 arg0) {
gSaveContext.unk_140E = arg0;
}
@@ -97,4 +92,3 @@ void func_800775F0(u16 arg0)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_80077684.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800776E4.s")
-
diff --git a/src/code/z_lib.c b/src/code/z_lib.c
index a7411c53d..c76e400c8 100644
--- a/src/code/z_lib.c
+++ b/src/code/z_lib.c
@@ -1,109 +1,94 @@
#include <ultra64.h>
#include <global.h>
-void Lib_MemSet(u8* dest, size_t size, u8 val)
-{
+void Lib_MemSet(u8* dest, size_t size, u8 val) {
u32 i = 0;
// TODO: Convert this to while/for if possible
- if (i == size) return;
+ if (i == size) {
+ return;
+ }
do {
*dest++ = val;
i++;
} while (i != size);
}
-f32 Math_Coss(s16 angle)
-{
+f32 Math_Coss(s16 angle) {
return coss(angle) * (1.0f / 32767);
}
-f32 Math_Sins(s16 angle)
-{
+f32 Math_Sins(s16 angle) {
return sins(angle) * (1.0f / 32767);
}
-s32 Math_ApproxUpdateScaledS(s16* pValue, s16 target, s16 step)
-{
+s32 Math_ApproxUpdateScaledS(s16* pValue, s16 target, s16 step) {
f32 updateScale;
- if (step != 0)
- {
+ if (step != 0) {
updateScale = R_UPDATE_RATE * 0.5f;
- if ((s16)(*pValue - target) > 0)
+ if ((s16)(*pValue - target) > 0) {
step = -step;
+ }
*pValue += (s16)(step * updateScale);
- if (((s16)(*pValue - target) * step) >= 0)
- {
+ if (((s16)(*pValue - target) * step) >= 0) {
*pValue = target;
return 1;
}
- }
- else if (target == *pValue)
- {
+ } else if (target == *pValue) {
return 1;
}
return 0;
}
-s32 Math_ApproxS(s16* pValue, s16 target, s16 step)
-{
- if (step != 0)
- {
- if (target < *pValue)
+s32 Math_ApproxS(s16* pValue, s16 target, s16 step) {
+ if (step != 0) {
+ if (target < *pValue) {
step = -step;
+ }
*pValue += step;
- if (((*pValue - target) * step) >= 0)
- {
+ if (((*pValue - target) * step) >= 0) {
*pValue = target;
return 1;
}
- }
- else if (target == *pValue)
- {
+ } else if (target == *pValue) {
return 1;
}
return 0;
}
-s32 Math_ApproxF(f32* pValue, f32 target, f32 step)
-{
- if (step != 0.0f)
- {
- if (target < *pValue)
+s32 Math_ApproxF(f32* pValue, f32 target, f32 step) {
+ if (step != 0.0f) {
+ if (target < *pValue) {
step = -step;
+ }
*pValue += step;
- if (((*pValue - target) * step) >= 0)
- {
+ if (((*pValue - target) * step) >= 0) {
*pValue = target;
return 1;
}
- }
- else if (target == *pValue)
- {
+ } else if (target == *pValue) {
return 1;
}
return 0;
}
-s32 func_80077A90(s16* pValue, s16 target, s16 step)
-{
+s32 func_80077A90(s16* pValue, s16 target, s16 step) {
s16 orig = *pValue;
*pValue += step;
- if (((s16)(*pValue - target) * (s16)(orig - target)) <= 0)
- {
+ if (((s16)(*pValue - target) * (s16)(orig - target)) <= 0) {
*pValue = target;
return 1;
}
@@ -111,14 +96,12 @@ s32 func_80077A90(s16* pValue, s16 target, s16 step)
return 0;
}
-s32 func_80077AF8(s16* pValue, s16 target, s16 step)
-{
+s32 func_80077AF8(s16* pValue, s16 target, s16 step) {
s16 orig = *pValue;
*pValue += step;
- if (((*pValue - target) * ((s16)orig - target)) <= 0)
- {
+ if (((*pValue - target) * ((s16)orig - target)) <= 0) {
*pValue = target;
return 1;
}
@@ -126,50 +109,41 @@ s32 func_80077AF8(s16* pValue, s16 target, s16 step)
return 0;
}
-s32 func_80077B58(s16* pValue, s16 target, s16 step)
-{
+s32 func_80077B58(s16* pValue, s16 target, s16 step) {
s32 phi_v0 = target - *pValue;
- if (phi_v0 < 0)
+ if (phi_v0 < 0) {
step = -step;
+ }
- if (phi_v0 >= 0x8000)
- {
+ if (phi_v0 >= 0x8000) {
step = -step;
phi_v0 = 0xFFFF0001 - -phi_v0;
- }
- else if (phi_v0 <= -0x8000)
- {
+ } else if (phi_v0 <= -0x8000) {
phi_v0 += 0xFFFF;
step = -step;
}
- if (step != 0)
- {
+ if (step != 0) {
*pValue += step;
- if ((phi_v0 * step) <= 0)
- {
+ if ((phi_v0 * step) <= 0) {
*pValue = target;
return 1;
}
- }
- else if (target == *pValue)
- {
+ } else if (target == *pValue) {
return 1;
}
return 0;
}
-s32 func_80077C1C(f32* pValue, f32 target, f32 step)
-{
+s32 func_80077C1C(f32* pValue, f32 target, f32 step) {
f32 orig = *pValue;
*pValue += step;
- if (((*pValue - target) * (orig - target)) <= 0)
- {
+ if (((*pValue - target) * (orig - target)) <= 0) {
*pValue = target;
return 1;
}
@@ -177,40 +151,34 @@ s32 func_80077C1C(f32* pValue, f32 target, f32 step)
return 0;
}
-s32 func_80077C6C(f32* pValue, f32 target, f32 incrStep, f32 decrStep)
-{
+s32 func_80077C6C(f32* pValue, f32 target, f32 incrStep, f32 decrStep) {
f32 step = (target >= *pValue) ? incrStep : decrStep;
- if (step != 0.0f)
- {
- if (target < *pValue)
+ if (step != 0.0f) {
+ if (target < *pValue) {
step = -step;
+ }
*pValue += step;
- if (((*pValue - target) * step) >= 0)
- {
+ if (((*pValue - target) * step) >= 0) {
*pValue = target;
return 1;
}
- }
- else if (target == *pValue)
- {
+ } else if (target == *pValue) {
return 1;
}
return 0;
}
-typedef struct
-{
+typedef struct {
/* 0x00 */ char unk_00[0x14];
- /* 0x14 */ s8 unk_14;
- /* 0x14 */ s8 unk_15;
+ /* 0x14 */ s8 unk_14;
+ /* 0x14 */ s8 unk_15;
} struct_80077D10;
-void func_80077D10(f32* arg0, s16* arg1, struct_80077D10* arg2)
-{
+void func_80077D10(f32* arg0, s16* arg1, struct_80077D10* arg2) {
f32 var1 = arg2->unk_14;
f32 var2 = arg2->unk_15;
@@ -220,60 +188,51 @@ void func_80077D10(f32* arg0, s16* arg1, struct_80077D10* arg2)
*arg1 = atan2s(var2, -var1);
}
-s16 Math_Rand_S16Offset(s16 base, s16 range)
-{
+s16 Math_Rand_S16Offset(s16 base, s16 range) {
return (s16)(Math_Rand_ZeroOne() * range) + base;
}
-s16 Math_Rand_S16OffsetStride(s16 base, s16 stride, s16 range)
-{
+s16 Math_Rand_S16OffsetStride(s16 base, s16 stride, s16 range) {
return (s16)(Math_Rand_ZeroOne() * range) * stride + base;
}
-void Math_Vec3f_Copy(Vec3f* dest, Vec3f* src)
-{
+void Math_Vec3f_Copy(Vec3f* dest, Vec3f* src) {
dest->x = src->x;
dest->y = src->y;
dest->z = src->z;
}
-void Math_Vec3s_ToVec3f(Vec3f* dest, Vec3s* src)
-{
+void Math_Vec3s_ToVec3f(Vec3f* dest, Vec3s* src) {
dest->x = src->x;
dest->y = src->y;
dest->z = src->z;
}
-void Math_Vec3f_Sum(Vec3f* a, Vec3f* b, Vec3f* dest)
-{
+void Math_Vec3f_Sum(Vec3f* a, Vec3f* b, Vec3f* dest) {
dest->x = a->x + b->x;
dest->y = a->y + b->y;
dest->z = a->z + b->z;
}
-void Math_Vec3f_Diff(Vec3f* a, Vec3f* b, Vec3f* dest)
-{
+void Math_Vec3f_Diff(Vec3f* a, Vec3f* b, Vec3f* dest) {
dest->x = a->x - b->x;
dest->y = a->y - b->y;
dest->z = a->z - b->z;
}
-void Math_Vec3s_DiffToVec3f(Vec3f* dest, Vec3s* a, Vec3s* b)
-{
+void Math_Vec3s_DiffToVec3f(Vec3f* dest, Vec3s* a, Vec3s* b) {
dest->x = a->x - b->x;
dest->y = a->y - b->y;
dest->z = a->z - b->z;
}
-void Math_Vec3f_Scale(Vec3f* vec, f32 scaleF)
-{
+void Math_Vec3f_Scale(Vec3f* vec, f32 scaleF) {
vec->x *= scaleF;
vec->y *= scaleF;
vec->z *= scaleF;
}
-f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b)
-{
+f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b) {
f32 dx = b->x - a->x;
f32 dy = b->y - a->y;
f32 dz = b->z - a->z;
@@ -281,8 +240,7 @@ f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b)
return sqrtf(SQ(dx) + SQ(dy) + SQ(dz));
}
-f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest)
-{
+f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest) {
dest->x = b->x - a->x;
dest->y = b->y - a->y;
dest->z = b->z - a->z;
@@ -290,29 +248,25 @@ f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest)
return sqrtf(SQ(dest->x) + SQ(dest->y) + SQ(dest->z));
}
-f32 Math_Vec3f_DistXZ(Vec3f* a, Vec3f* b)
-{
+f32 Math_Vec3f_DistXZ(Vec3f* a, Vec3f* b) {
f32 dx = b->x - a->x;
f32 dz = b->z - a->z;
return sqrtf(SQ(dx) + SQ(dz));
}
-f32 Math_Vec3f_DiffY(Vec3f* a, Vec3f* b)
-{
+f32 Math_Vec3f_DiffY(Vec3f* a, Vec3f* b) {
return b->y - a->y;
}
-s16 Math_Vec3f_Yaw(Vec3f* a, Vec3f* b)
-{
+s16 Math_Vec3f_Yaw(Vec3f* a, Vec3f* b) {
f32 dx = b->x - a->x;
f32 dz = b->z - a->z;
return atan2s(dz, dx);
}
-s16 Math_Vec3f_Pitch(Vec3f* a, Vec3f* b)
-{
+s16 Math_Vec3f_Pitch(Vec3f* a, Vec3f* b) {
return atan2s(Math_Vec3f_DistXZ(a, b), a->y - b->y);
}
@@ -328,69 +282,51 @@ void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain);
void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain);
void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain);
-void (*sInitChainHandlers[])(u8* ptr, InitChainEntry* ichain) =
-{
- IChain_Apply_u8,
- IChain_Apply_s8,
- IChain_Apply_u16,
- IChain_Apply_s16,
- IChain_Apply_u32,
- IChain_Apply_s32,
- IChain_Apply_f32,
- IChain_Apply_f32div1000,
- IChain_Apply_Vec3f,
- IChain_Apply_Vec3fdiv1000,
- IChain_Apply_Vec3s,
+void (*sInitChainHandlers[])(u8* ptr, InitChainEntry* ichain) = {
+ IChain_Apply_u8, IChain_Apply_s8, IChain_Apply_u16, IChain_Apply_s16,
+ IChain_Apply_u32, IChain_Apply_s32, IChain_Apply_f32, IChain_Apply_f32div1000,
+ IChain_Apply_Vec3f, IChain_Apply_Vec3fdiv1000, IChain_Apply_Vec3s,
};
-void Actor_ProcessInitChain(Actor* actor, InitChainEntry* ichain)
-{
- do sInitChainHandlers[ichain->type]((u8*)actor, ichain);
- while ((ichain++)->cont);
+void Actor_ProcessInitChain(Actor* actor, InitChainEntry* ichain) {
+ do {
+ sInitChainHandlers[ichain->type]((u8*)actor, ichain);
+ } while ((ichain++)->cont);
}
-void IChain_Apply_u8(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_u8(u8* ptr, InitChainEntry* ichain) {
*(u8*)(ptr + ichain->offset) = ichain->value;
}
-void IChain_Apply_s8(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_s8(u8* ptr, InitChainEntry* ichain) {
*(s8*)(ptr + ichain->offset) = ichain->value;
}
-void IChain_Apply_u16(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_u16(u8* ptr, InitChainEntry* ichain) {
*(u16*)(ptr + ichain->offset) = ichain->value;
}
-void IChain_Apply_s16(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_s16(u8* ptr, InitChainEntry* ichain) {
*(s16*)(ptr + ichain->offset) = ichain->value;
}
-void IChain_Apply_u32(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_u32(u8* ptr, InitChainEntry* ichain) {
*(u32*)(ptr + ichain->offset) = ichain->value;
}
-void IChain_Apply_s32(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_s32(u8* ptr, InitChainEntry* ichain) {
*(s32*)(ptr + ichain->offset) = ichain->value;
}
-void IChain_Apply_f32(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_f32(u8* ptr, InitChainEntry* ichain) {
*(f32*)(ptr + ichain->offset) = ichain->value;
}
-void IChain_Apply_f32div1000(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_f32div1000(u8* ptr, InitChainEntry* ichain) {
*(f32*)(ptr + ichain->offset) = ichain->value / 1000.0f;
}
-void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain) {
Vec3f* vec;
f32 val;
@@ -402,8 +338,7 @@ void IChain_Apply_Vec3f(u8* ptr, InitChainEntry* ichain)
vec->x = val;
}
-void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain) {
Vec3f* vec;
f32 val;
@@ -416,8 +351,7 @@ void IChain_Apply_Vec3fdiv1000(u8* ptr, InitChainEntry* ichain)
vec->x = val;
}
-void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain)
-{
+void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain) {
Vec3s* vec;
s16 val;
@@ -429,40 +363,37 @@ void IChain_Apply_Vec3s(u8* ptr, InitChainEntry* ichain)
vec->x = val;
}
-f32 Math_SmoothScaleMaxMinF(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep)
-{
+f32 Math_SmoothScaleMaxMinF(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep) {
f32 var;
- if (*pValue != target)
- {
+ if (*pValue != target) {
var = (target - *pValue) * scale;
- if ((var >= minStep) || (var <= -minStep))
- {
- if (var > maxStep)
+ if ((var >= minStep) || (var <= -minStep)) {
+ if (var > maxStep) {
var = maxStep;
+ }
- if (var < -maxStep)
+ if (var < -maxStep) {
var = -maxStep;
+ }
*pValue += var;
- }
- else
- {
- if (var < minStep)
- {
+ } else {
+ if (var < minStep) {
*pValue += minStep;
var = minStep;
- if (target < *pValue)
+ if (target < *pValue) {
*pValue = target;
+ }
}
- if (var > -minStep)
- {
+ if (var > -minStep) {
*pValue += -minStep;
- if (*pValue < target)
+ if (*pValue < target) {
*pValue = target;
+ }
}
}
}
@@ -470,128 +401,123 @@ f32 Math_SmoothScaleMaxMinF(f32* pValue, f32 target, f32 scale, f32 maxStep, f32
return fabsf(target - *pValue);
}
-void Math_SmoothScaleMaxF(f32* pValue, f32 target, f32 scale, f32 maxStep)
-{
+void Math_SmoothScaleMaxF(f32* pValue, f32 target, f32 scale, f32 maxStep) {
f32 step;
- if (*pValue != target)
- {
+ if (*pValue != target) {
step = (target - *pValue) * scale;
- if (step > maxStep)
+ if (step > maxStep) {
step = maxStep;
- else if (step < -maxStep)
+ } else if (step < -maxStep) {
step = -maxStep;
+ }
*pValue += step;
}
}
-void Math_SmoothDownscaleMaxF(f32* pValue, f32 scale, f32 maxStep)
-{
+void Math_SmoothDownscaleMaxF(f32* pValue, f32 scale, f32 maxStep) {
f32 step;
step = *pValue * scale;
- if (step > maxStep)
+ if (step > maxStep) {
step = maxStep;
- else if (step < -maxStep)
+ } else if (step < -maxStep) {
step = -maxStep;
+ }
*pValue -= step;
}
-f32 func_800784D8(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep)
-{
+f32 func_800784D8(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep) {
f32 step;
f32 baseStep;
step = 0.0f;
baseStep = target - *pValue;
- if (*pValue != target)
- {
- if (baseStep > 180.0f)
+ if (*pValue != target) {
+ if (baseStep > 180.0f) {
baseStep = -(360.0f - baseStep);
- else if (baseStep < -180.0f)
+ } else if (baseStep < -180.0f) {
baseStep = 360.0f + baseStep;
+ }
step = baseStep * scale;
- if ((step >= minStep) || (step <= -minStep))
- {
- if (step > maxStep)
+ if ((step >= minStep) || (step <= -minStep)) {
+ if (step > maxStep) {
step = maxStep;
+ }
- if (step < -maxStep)
+ if (step < -maxStep) {
step = -maxStep;
+ }
*pValue += step;
- }
- else
- {
- if (step < minStep)
- {
+ } else {
+ if (step < minStep) {
step = minStep;
*pValue += step;
- if (*pValue > target)
+ if (*pValue > target) {
*pValue = target;
+ }
}
- if (step > -minStep)
- {
+ if (step > -minStep) {
step = -minStep;
*pValue += step;
- if (*pValue < target)
+ if (*pValue < target) {
*pValue = target;
+ }
}
}
}
- if (*pValue >= 360.0f)
+ if (*pValue >= 360.0f) {
*pValue -= 360.0f;
+ }
- if (*pValue < 0.0f)
+ if (*pValue < 0.0f) {
*pValue += 360.0f;
+ }
return step;
}
-s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep, s16 minStep)
-{
+s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep, s16 minStep) {
s16 step = 0;
s16 diff = (target - *pValue);
s32 baseStep = diff / invScale;
- if (*pValue != target)
- {
+ if (*pValue != target) {
step = baseStep;
- if ((step > minStep) || (step < -minStep))
- {
- if (step > maxStep)
+ if ((step > minStep) || (step < -minStep)) {
+ if (step > maxStep) {
step = maxStep;
+ }
- if (step < -maxStep)
+ if (step < -maxStep) {
step = -maxStep;
+ }
*pValue += step;
- }
- else
- {
- if (diff >= 0)
- {
+ } else {
+ if (diff >= 0) {
*pValue += minStep;
- if ((s16)(target - *pValue) <= 0)
+ if ((s16)(target - *pValue) <= 0) {
*pValue = target;
- }
- else
- {
+ }
+ } else {
*pValue -= minStep;
- if ((s16)(target - *pValue) >= 0)
+ if ((s16)(target - *pValue) >= 0) {
*pValue = target;
+ }
}
}
}
@@ -599,39 +525,35 @@ s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep,
return diff;
}
-void Math_SmoothScaleMaxS(s16* pValue, s16 target, s16 invScale, s16 maxStep)
-{
+void Math_SmoothScaleMaxS(s16* pValue, s16 target, s16 invScale, s16 maxStep) {
s16 step = target - *pValue;
step /= invScale;
- if (step > maxStep)
+ if (step > maxStep) {
*pValue += maxStep;
- else if (step < -maxStep)
+ } else if (step < -maxStep) {
*pValue -= maxStep;
- else
+ } else {
*pValue += step;
+ }
}
-void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src)
-{
+void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src) {
dst->r = src->r;
dst->g = src->g;
dst->b = src->b;
dst->a = src->a;
}
-void func_80078884(u16 sfxId)
-{
+void func_80078884(u16 sfxId) {
Audio_PlaySoundGeneral(sfxId, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
-void func_800788CC(u16 sfxId)
-{
+void func_800788CC(u16 sfxId) {
Audio_PlaySoundGeneral(sfxId, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
-void func_80078914(Vec3f* arg0, u16 sfxId)
-{
+void func_80078914(Vec3f* arg0, u16 sfxId) {
Audio_PlaySoundGeneral(sfxId, arg0, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c
index f67235c4a..b69ac8b34 100644
--- a/src/code/z_lifemeter.c
+++ b/src/code/z_lifemeter.c
@@ -17,8 +17,7 @@ s16 D_8015FDC8[3];
s16 D_8015FDD0[6];
s16 D_8015FDE0[6];
-void Health_InitData(GlobalContext* globalCtx)
-{
+void Health_InitData(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
interfaceCtx->unk_228 = 0x140;
@@ -50,28 +49,22 @@ void Health_InitData(GlobalContext* globalCtx)
#ifdef NON_MATCHING
// this function still needs some work
-void Health_UpdateData(GlobalContext* globalCtx)
-{
+void Health_UpdateData(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
f32 temp_f0 = interfaceCtx->unk_1FE * 0.1f;
s16 temp1, temp2, temp3;
- if (0) ;
+ if (0) {}
- if (interfaceCtx->unk_200 != 0)
- {
+ if (interfaceCtx->unk_200 != 0) {
interfaceCtx->unk_1FE--;
- if (interfaceCtx->unk_1FE <= 0)
- {
+ if (interfaceCtx->unk_1FE <= 0) {
interfaceCtx->unk_1FE = 0;
interfaceCtx->unk_200 = 0;
}
- }
- else
- {
+ } else {
interfaceCtx->unk_1FE++;
- if (interfaceCtx->unk_1FE >= 10)
- {
+ if (interfaceCtx->unk_1FE >= 10) {
interfaceCtx->unk_1FE = 10;
interfaceCtx->unk_200 = 1;
}
@@ -153,21 +146,18 @@ void Health_UpdateData(GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lifemeter/Health_UpdateData.s")
#endif
-s32 func_80078E18(GlobalContext* globalCtx)
-{
+s32 func_80078E18(GlobalContext* globalCtx) {
gSaveContext.health = globalCtx->interfaceCtx.unk_226;
return 1;
}
-s32 func_80078E34(GlobalContext* globalCtx)
-{
+s32 func_80078E34(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
interfaceCtx->unk_228 = 0x140;
interfaceCtx->unk_226 += 0x10;
- if (interfaceCtx->unk_226 >= gSaveContext.health)
- {
+ if (interfaceCtx->unk_226 >= gSaveContext.health) {
interfaceCtx->unk_226 = gSaveContext.health;
return 1;
}
@@ -175,21 +165,16 @@ s32 func_80078E34(GlobalContext* globalCtx)
return 0;
}
-s32 func_80078E84(GlobalContext* globalCtx)
-{
+s32 func_80078E84(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
- if (interfaceCtx->unk_228 != 0)
- {
+ if (interfaceCtx->unk_228 != 0) {
interfaceCtx->unk_228--;
- }
- else
- {
+ } else {
interfaceCtx->unk_228 = 0x140;
interfaceCtx->unk_226 -= 0x10;
- if (interfaceCtx->unk_226 <= 0)
- {
+ if (interfaceCtx->unk_226 <= 0) {
interfaceCtx->unk_226 = 0;
globalCtx->unk_11D58(globalCtx, -(gSaveContext.health + 1));
return 1;
@@ -199,8 +184,7 @@ s32 func_80078E84(GlobalContext* globalCtx)
return 0;
}
-void Interface_DrawHealth(GlobalContext* globalCtx)
-{
+void Interface_DrawHealth(GlobalContext* globalCtx) {
s32 pad[5];
u8* heartBgImg;
u32 curColorSet;
@@ -226,184 +210,127 @@ void Interface_DrawHealth(GlobalContext* globalCtx)
func_800C6AC4(gfxArr, gfxCtx, "../z_lifemeter.c", 353);
- if (!(gSaveContext.health % 0x10))
+ if (!(gSaveContext.health % 0x10)) {
fullHeartCount--;
+ }
curColorSet = -1;
offsetY = 0.0f;
offsetX = 0.0f;
- for (i = 0; i < totalHeartCount; i++)
- {
- if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne))
- {
- if (i < fullHeartCount)
- {
- if (curColorSet != 0)
- {
+ for (i = 0; i < totalHeartCount; i++) {
+ if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) {
+ if (i < fullHeartCount) {
+ if (curColorSet != 0) {
curColorSet = 0;
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2],
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2],
interfaceCtx->unk_20E[4], interfaceCtx->healthAlpha);
- gDPSetEnvColor(gfxCtx->overlay.p++,
- interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2],
+ gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2],
interfaceCtx->unk_21A[4], 0xFF);
}
- }
- else if (i == fullHeartCount)
- {
- if (curColorSet != 1)
- {
+ } else if (i == fullHeartCount) {
+ if (curColorSet != 1) {
curColorSet = 1;
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- interfaceCtx->unk_202[0], interfaceCtx->unk_202[1],
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_202[0], interfaceCtx->unk_202[1],
interfaceCtx->unk_202[2], interfaceCtx->healthAlpha);
- gDPSetEnvColor(gfxCtx->overlay.p++,
- interfaceCtx->unk_208[0], interfaceCtx->unk_208[1],
+ gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_208[0], interfaceCtx->unk_208[1],
interfaceCtx->unk_208[2], 0xFF);
}
- }
- else if (i > fullHeartCount)
- {
- if (curColorSet != 2)
- {
+ } else if (i > fullHeartCount) {
+ if (curColorSet != 2) {
curColorSet = 2;
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2],
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_20E[0], interfaceCtx->unk_20E[2],
interfaceCtx->unk_20E[4], interfaceCtx->healthAlpha);
- gDPSetEnvColor(gfxCtx->overlay.p++,
- interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2],
+ gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_21A[0], interfaceCtx->unk_21A[2],
interfaceCtx->unk_21A[4], 0xFF);
}
- }
- else
- {
- if (curColorSet != 3)
- {
+ } else {
+ if (curColorSet != 3) {
curColorSet = 3;
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- interfaceCtx->unk_20E[1], interfaceCtx->unk_20E[3],
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, interfaceCtx->unk_20E[1], interfaceCtx->unk_20E[3],
interfaceCtx->unk_20E[5], interfaceCtx->healthAlpha);
- gDPSetEnvColor(gfxCtx->overlay.p++,
- interfaceCtx->unk_21A[1], interfaceCtx->unk_21A[3],
+ gDPSetEnvColor(gfxCtx->overlay.p++, interfaceCtx->unk_21A[1], interfaceCtx->unk_21A[3],
interfaceCtx->unk_21A[5], 0xFF);
}
}
- if (i < fullHeartCount)
+ if (i < fullHeartCount) {
heartBgImg = D_02000400;
- else if (i == fullHeartCount)
+ } else if (i == fullHeartCount) {
heartBgImg = D_8011FFB0[curHeartFraction];
- else
+ } else {
heartBgImg = D_02000000;
- }
- else
- {
- if (i < fullHeartCount)
- {
- if (curColorSet != 4)
- {
+ }
+ } else {
+ if (i < fullHeartCount) {
+ if (curColorSet != 4) {
curColorSet = 4;
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- D_8015FDD0[0], D_8015FDD0[1],
- D_8015FDD0[2], interfaceCtx->healthAlpha);
- gDPSetEnvColor(gfxCtx->overlay.p++,
- D_8015FDE0[0], D_8015FDE0[1],
- D_8015FDE0[2], 0xFF);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDD0[0], D_8015FDD0[1], D_8015FDD0[2],
+ interfaceCtx->healthAlpha);
+ gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDE0[0], D_8015FDE0[1], D_8015FDE0[2], 0xFF);
}
- }
- else if (i == fullHeartCount)
- {
- if (curColorSet != 5)
- {
+ } else if (i == fullHeartCount) {
+ if (curColorSet != 5) {
curColorSet = 5;
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- D_8015FDC0[0], D_8015FDC0[1],
- D_8015FDC0[2], interfaceCtx->healthAlpha);
- gDPSetEnvColor(gfxCtx->overlay.p++,
- D_8015FDC8[0], D_8015FDC8[1],
- D_8015FDC8[2], 0xFF);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDC0[0], D_8015FDC0[1], D_8015FDC0[2],
+ interfaceCtx->healthAlpha);
+ gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDC8[0], D_8015FDC8[1], D_8015FDC8[2], 0xFF);
}
- }
- else if (i > fullHeartCount)
- {
- if (curColorSet != 6)
- {
+ } else if (i > fullHeartCount) {
+ if (curColorSet != 6) {
curColorSet = 6;
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- D_8015FDD0[0], D_8015FDD0[1],
- D_8015FDD0[2], interfaceCtx->healthAlpha);
- gDPSetEnvColor(gfxCtx->overlay.p++,
- D_8015FDE0[0], D_8015FDE0[1],
- D_8015FDE0[2], 0xFF);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDD0[0], D_8015FDD0[1], D_8015FDD0[2],
+ interfaceCtx->healthAlpha);
+ gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDE0[0], D_8015FDE0[1], D_8015FDE0[2], 0xFF);
}
- }
- else
- {
- if (curColorSet != 7)
- {
+ } else {
+ if (curColorSet != 7) {
curColorSet = 7;
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- D_8015FDD0[3], D_8015FDD0[4],
- D_8015FDD0[5], interfaceCtx->healthAlpha);
- gDPSetEnvColor(gfxCtx->overlay.p++,
- D_8015FDE0[3], D_8015FDE0[4],
- D_8015FDE0[5], 0xFF);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, D_8015FDD0[3], D_8015FDD0[4], D_8015FDD0[5],
+ interfaceCtx->healthAlpha);
+ gDPSetEnvColor(gfxCtx->overlay.p++, D_8015FDE0[3], D_8015FDE0[4], D_8015FDE0[5], 0xFF);
}
}
- if (i < fullHeartCount)
+ if (i < fullHeartCount) {
heartBgImg = D_02000900;
- else if (i == fullHeartCount)
+ } else if (i == fullHeartCount) {
heartBgImg = D_8011FFF0[curHeartFraction];
- else
+ } else {
heartBgImg = D_02000500;
+ }
}
- if (curBgImgLoaded != heartBgImg)
- {
+ if (curBgImgLoaded != heartBgImg) {
curBgImgLoaded = heartBgImg;
- gDPLoadTextureBlock(gfxCtx->overlay.p++,
- heartBgImg,
- G_IM_FMT_IA,
- G_IM_SIZ_8b,
- 16, 16,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
+ gDPLoadTextureBlock(gfxCtx->overlay.p++, heartBgImg, G_IM_FMT_IA, G_IM_SIZ_8b, 16, 16, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
}
- if (i != fullHeartCount)
- {
- if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne))
- {
- if (curCombineModeSet != 1)
- {
+ if (i != fullHeartCount) {
+ if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) {
+ if (curCombineModeSet != 1) {
curCombineModeSet = 1;
func_80094520(gfxCtx);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0,
+ PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE,
+ 0);
}
- }
- else
- {
- if (curCombineModeSet != 3)
- {
+ } else {
+ if (curCombineModeSet != 3) {
curCombineModeSet = 3;
func_80094520(gfxCtx);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0,
- ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0,
+ PRIMITIVE, 0, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
}
}
@@ -414,40 +341,28 @@ void Interface_DrawHealth(GlobalContext* globalCtx)
temp4 *= 1024.0f;
temp1 = 8.0f;
temp1 *= 0.68f;
- gSPTextureRectangle(gfxCtx->overlay.p++,
- (s32)((temp2 - temp1) * 4), (s32)((temp3 - temp1) * 4),
- (s32)((temp2 + temp1) * 4), (s32)((temp3 + temp1) * 4),
- G_TX_RENDERTILE,
- 0, 0,
+ gSPTextureRectangle(gfxCtx->overlay.p++, (s32)((temp2 - temp1) * 4), (s32)((temp3 - temp1) * 4),
+ (s32)((temp2 + temp1) * 4), (s32)((temp3 + temp1) * 4), G_TX_RENDERTILE, 0, 0,
(s32)temp4, (s32)temp4);
- }
- else
- {
- if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne))
- {
- if (curCombineModeSet != 2)
- {
+ } else {
+ if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) {
+ if (curCombineModeSet != 2) {
curCombineModeSet = 2;
func_80094A14(gfxCtx);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0,
+ PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE,
+ 0);
}
- }
- else
- {
- if (curCombineModeSet != 4)
- {
+ } else {
+ if (curCombineModeSet != 4) {
curCombineModeSet = 4;
func_80094A14(gfxCtx);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0,
- ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0,
+ PRIMITIVE, 0, ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
}
}
- if (1)
- {
+ if (1) {
Mtx* matrix = Graph_Alloc(gfxCtx, sizeof(Mtx));
func_800D2CEC(matrix, 1.0f - (0.32f * sp144), 1.0f - (0.32f * sp144), 1.0f - (0.32f * sp144),
-130.0f + offsetX, 94.5f - offsetY, 0.0f);
@@ -458,8 +373,7 @@ void Interface_DrawHealth(GlobalContext* globalCtx)
}
offsetX += 10.0f;
- if (i == 9)
- {
+ if (i == 9) {
offsetY += 10.0f;
offsetX = 0.0f;
}
@@ -470,50 +384,44 @@ void Interface_DrawHealth(GlobalContext* globalCtx)
u32 Health_IsCritical(void);
-void Health_HandleCriticalAlarm(GlobalContext* globalCtx)
-{
+void Health_HandleCriticalAlarm(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
- if (interfaceCtx->unk_22C != 0)
- {
+ if (interfaceCtx->unk_22C != 0) {
interfaceCtx->unk_22A--;
- if (interfaceCtx->unk_22A <= 0)
- {
+ if (interfaceCtx->unk_22A <= 0) {
interfaceCtx->unk_22A = 0;
interfaceCtx->unk_22C = 0;
- if (!func_8008E988(globalCtx) && (globalCtx->pauseCtx.state == 0) &&
- (globalCtx->pauseCtx.flag == 0) && Health_IsCritical() && !func_800BFC84(globalCtx))
- {
+ if (!func_8008E988(globalCtx) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
+ Health_IsCritical() && !func_800BFC84(globalCtx)) {
func_80078884(NA_SE_SY_HITPOINT_ALARM);
}
}
- }
- else
- {
+ } else {
interfaceCtx->unk_22A++;
- if (interfaceCtx->unk_22A >= 10)
- {
+ if (interfaceCtx->unk_22A >= 10) {
interfaceCtx->unk_22A = 10;
interfaceCtx->unk_22C = 1;
}
}
}
-u32 Health_IsCritical(void)
-{
+u32 Health_IsCritical(void) {
s32 var;
- if (gSaveContext.health_capacity <= 0x50)
+ if (gSaveContext.health_capacity <= 0x50) {
var = 0x10;
- else if (gSaveContext.health_capacity <= 0xA0)
+ } else if (gSaveContext.health_capacity <= 0xA0) {
var = 0x18;
- else if (gSaveContext.health_capacity <= 0xF0)
+ } else if (gSaveContext.health_capacity <= 0xF0) {
var = 0x20;
- else
+ } else {
var = 0x2C;
+ }
- if ((var >= gSaveContext.health) && (gSaveContext.health > 0))
+ if ((var >= gSaveContext.health) && (gSaveContext.health > 0)) {
return 1;
- else
+ } else {
return 0;
+ }
}
diff --git a/src/code/z_lights.c b/src/code/z_lights.c
index af6dbad51..46e61fa25 100644
--- a/src/code/z_lights.c
+++ b/src/code/z_lights.c
@@ -3,8 +3,8 @@
extern LightsList sLightsList;
-void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius, u32 type)
-{
+void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
+ s16 radius, u32 type) {
info->type = type;
info->params.posX = posX;
info->params.posY = posY;
@@ -12,26 +12,24 @@ void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s
Lights_SetPositionalLightColorAndRadius(info, red, green, blue, radius);
}
-void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius)
-{
+void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
+ s16 radius) {
Lights_InitPositionalLight(info, posX, posY, posZ, red, green, blue, radius, 0);
}
-void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius)
-{
+void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
+ s16 radius) {
Lights_InitPositionalLight(info, posX, posY, posZ, red, green, blue, radius, 2);
}
-void Lights_SetPositionalLightColorAndRadius(LightInfoPositional* info, u8 red, u8 green, u8 blue, s16 radius)
-{
+void Lights_SetPositionalLightColorAndRadius(LightInfoPositional* info, u8 red, u8 green, u8 blue, s16 radius) {
info->params.red = red;
info->params.green = green;
info->params.blue = blue;
info->params.radius = radius;
}
-void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dirZ, u8 red, u8 green, u8 blue)
-{
+void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dirZ, u8 red, u8 green, u8 blue) {
info->type = 1;
info->params.dirX = dirX;
info->params.dirY = dirY;
@@ -41,8 +39,7 @@ void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dir
info->params.blue = blue;
}
-void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue)
-{
+void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue) {
mapper->ambient.l.col[0] = red;
mapper->ambient.l.colc[0] = red;
mapper->ambient.l.col[1] = green;
@@ -54,22 +51,20 @@ void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_80079EFC.s")
-Light* Lights_MapperGetNextFreeSlot(LightMapper* mapper)
-{
- if (6 < mapper->numLights)
+Light* Lights_MapperGetNextFreeSlot(LightMapper* mapper) {
+ if (6 < mapper->numLights) {
return NULL;
+ }
return &mapper->lights[mapper->numLights++];
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007A084.s")
-void func_8007A40C(LightMapper* mapper, LightInfoDirectionalParams* params, GlobalContext* globalCtx)
-{
+void func_8007A40C(LightMapper* mapper, LightInfoDirectionalParams* params, GlobalContext* globalCtx) {
Light* light = Lights_MapperGetNextFreeSlot(mapper);
- if (light != NULL)
- {
+ if (light != NULL) {
light->l.col[0] = light->l.colc[0] = params->red;
light->l.col[1] = light->l.colc[1] = params->green;
light->l.col[2] = light->l.colc[2] = params->blue;
@@ -81,25 +76,21 @@ void func_8007A40C(LightMapper* mapper, LightInfoDirectionalParams* params, Glob
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007A474.s")
-z_Light* Lights_FindFreeSlot()
-{
+z_Light* Lights_FindFreeSlot() {
z_Light* ret;
- if (0x1F < sLightsList.numOccupied)
+ if (0x1F < sLightsList.numOccupied) {
return NULL;
+ }
ret = &sLightsList.lights[sLightsList.nextFree];
- while (ret->info != NULL)
- {
+ while (ret->info != NULL) {
sLightsList.nextFree++;
- if (sLightsList.nextFree < 0x20)
- {
+ if (sLightsList.nextFree < 0x20) {
ret++;
- }
- else
- {
+ } else {
sLightsList.nextFree = 0;
ret = &sLightsList.lights[0];
}
@@ -112,36 +103,32 @@ z_Light* Lights_FindFreeSlot()
#ifdef NON_MATCHING
// single ordering difference
-void Lights_Free(z_Light* light)
-{
- if (light != NULL)
- {
+void Lights_Free(z_Light* light) {
+ if (light != NULL) {
sLightsList.numOccupied--;
light->info = NULL;
- sLightsList.nextFree = (light - sLightsList.lights) / sizeof(z_Light); //! @bug Due to pointer arithmetic, the division is unnecessary
+ sLightsList.nextFree = (light - sLightsList.lights) /
+ sizeof(z_Light); //! @bug Due to pointer arithmetic, the division is unnecessary
}
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/Lights_Free.s")
#endif
-void func_8007A614(GlobalContext* globalCtx, LightingContext* lightCtx)
-{
+void func_8007A614(GlobalContext* globalCtx, LightingContext* lightCtx) {
Lights_ClearHead(globalCtx, lightCtx);
Lights_SetAmbientColor(lightCtx, 0x50, 0x50, 0x50);
func_8007A698(lightCtx, 0, 0, 0, 0x3e4, 0x3200);
bzero(&sLightsList, sizeof(sLightsList));
}
-void Lights_SetAmbientColor(LightingContext* lightCtx, u8 red, u8 green, u8 blue)
-{
+void Lights_SetAmbientColor(LightingContext* lightCtx, u8 red, u8 green, u8 blue) {
lightCtx->ambientRed = red;
lightCtx->ambientGreen = green;
lightCtx->ambientBlue = blue;
}
-void func_8007A698(LightingContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 arg4, s16 arg5)
-{
+void func_8007A698(LightingContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 arg4, s16 arg5) {
lightCtx->unk_07 = arg1;
lightCtx->unk_08 = arg2;
lightCtx->unk_09 = arg3;
@@ -149,38 +136,33 @@ void func_8007A698(LightingContext* lightCtx, u8 arg1, u8 arg2, u8 arg3, s16 arg
lightCtx->unk_0C = arg5;
}
-LightMapper* Lights_CreateMapper(LightingContext* lightCtx, GraphicsContext* gfxCtx)
-{
+LightMapper* Lights_CreateMapper(LightingContext* lightCtx, GraphicsContext* gfxCtx) {
return func_8007A960(gfxCtx, lightCtx->ambientRed, lightCtx->ambientGreen, lightCtx->ambientBlue);
}
-void Lights_ClearHead(GlobalContext* globalCtx, LightingContext* lightCtx)
-{
+void Lights_ClearHead(GlobalContext* globalCtx, LightingContext* lightCtx) {
lightCtx->lightsHead = NULL;
}
-void Lights_RemoveAll(GlobalContext* globalCtx, LightingContext* lightCtx)
-{
- while (lightCtx->lightsHead != NULL)
- {
+void Lights_RemoveAll(GlobalContext* globalCtx, LightingContext* lightCtx) {
+ while (lightCtx->lightsHead != NULL) {
Lights_Remove(globalCtx, lightCtx, lightCtx->lightsHead);
lightCtx->lightsHead = lightCtx->lightsHead->next;
}
}
-z_Light* Lights_Insert(GlobalContext* globalCtx, LightingContext* lightCtx, LightInfo* info)
-{
+z_Light* Lights_Insert(GlobalContext* globalCtx, LightingContext* lightCtx, LightInfo* info) {
z_Light* light;
light = Lights_FindFreeSlot();
- if (light != NULL)
- {
+ if (light != NULL) {
light->info = info;
light->prev = NULL;
light->next = lightCtx->lightsHead;
- if (lightCtx->lightsHead != NULL)
+ if (lightCtx->lightsHead != NULL) {
lightCtx->lightsHead->prev = light;
+ }
lightCtx->lightsHead = light;
}
@@ -188,17 +170,17 @@ z_Light* Lights_Insert(GlobalContext* globalCtx, LightingContext* lightCtx, Ligh
return light;
}
-void Lights_Remove(GlobalContext* globalCtx, LightingContext* lightCtx, z_Light* light)
-{
- if (light != NULL)
- {
- if (light->prev != NULL)
+void Lights_Remove(GlobalContext* globalCtx, LightingContext* lightCtx, z_Light* light) {
+ if (light != NULL) {
+ if (light->prev != NULL) {
light->prev->next = light->next;
- else
+ } else {
lightCtx->lightsHead = light->next;
+ }
- if (light->next != NULL)
+ if (light->next != NULL) {
light->next->prev = light->prev;
+ }
Lights_Free(light);
}
@@ -211,4 +193,3 @@ void Lights_Remove(GlobalContext* globalCtx, LightingContext* lightCtx, z_Light*
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007A9B4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_lights/func_8007ABBC.s")
-
diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c
index 10a328c49..fd82cca8f 100644
--- a/src/code/z_malloc.c
+++ b/src/code/z_malloc.c
@@ -1,131 +1,112 @@
#include <global.h>
-#define LOG_SEVERITY_NOLOG 0
-#define LOG_SEVERITY_ERROR 2
-#define LOG_SEVERITY_VERBOSE 3
+#define LOG_SEVERITY_NOLOG 0
+#define LOG_SEVERITY_ERROR 2
+#define LOG_SEVERITY_VERBOSE 3
s32 gZeldaArenaLogSeverity = LOG_SEVERITY_ERROR;
Arena sZeldaArena;
-void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action)
-{
- if (!ptr)
- {
- if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR)
- {
+void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
+ if (!ptr) {
+ if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) {
//"%s: %u bytes %s failed\n"
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
- __osDisplayArena(&sZeldaArena);
+ __osDisplayArena(&sZeldaArena);
return;
}
- }
- else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE)
- {
+ } else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
//"%s: %u bytes %s succeeded\n"
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
}
}
-void* ZeldaArena_Malloc(u32 size)
-{
+void* ZeldaArena_Malloc(u32 size) {
void* ptr;
ptr = __osMalloc(&sZeldaArena, size);
- ZeldaArena_CheckPointer(ptr, size, "zelda_malloc", "確保"); //Secure
+ ZeldaArena_CheckPointer(ptr, size, "zelda_malloc", "確保"); // Secure
return ptr;
}
-void* ZeldaArena_MallocDebug(u32 size, const char* file, s32 line)
-{
+void* ZeldaArena_MallocDebug(u32 size, const char* file, s32 line) {
void* ptr;
ptr = __osMallocDebug(&sZeldaArena, size, file, line);
- ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_DEBUG", "確保"); //Secure
+ ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_DEBUG", "確保"); // Secure
return ptr;
}
-void* ZeldaArena_MallocR(u32 size)
-{
+void* ZeldaArena_MallocR(u32 size) {
void* ptr;
ptr = __osMallocR(&sZeldaArena, size);
- ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r", "確保"); //Secure
+ ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r", "確保"); // Secure
return ptr;
}
-void* ZeldaArena_MallocRDebug(u32 size, const char* file, s32 line)
-{
+void* ZeldaArena_MallocRDebug(u32 size, const char* file, s32 line) {
void* ptr;
ptr = __osMallocRDebug(&sZeldaArena, size, file, line);
- ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r_DEBUG", "確保"); //Secure
+ ZeldaArena_CheckPointer(ptr, size, "zelda_malloc_r_DEBUG", "確保"); // Secure
return ptr;
}
-void* ZeldaArena_Realloc(void* ptr, u32 newSize)
-{
+void* ZeldaArena_Realloc(void* ptr, u32 newSize) {
ptr = __osRealloc(&sZeldaArena, ptr, newSize);
ZeldaArena_CheckPointer(ptr, newSize, "zelda_realloc", "再確保"); // Re-securing
return ptr;
}
-void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line)
-{
+void* ZeldaArena_ReallocDebug(void* ptr, u32 newSize, const char* file, s32 line) {
ptr = __osReallocDebug(&sZeldaArena, ptr, newSize, file, line);
ZeldaArena_CheckPointer(ptr, newSize, "zelda_realloc_DEBUG", "再確保"); // Re-securing
return ptr;
}
-void ZeldaArena_Free(void* ptr)
-{
+void ZeldaArena_Free(void* ptr) {
__osFree(&sZeldaArena, ptr);
}
-void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line)
-{
+void ZeldaArena_FreeDebug(void* ptr, const char* file, s32 line) {
__osFreeDebug(&sZeldaArena, ptr, file, line);
}
-void* ZeldaArena_Calloc(u32 num, u32 size)
-{
+void* ZeldaArena_Calloc(u32 num, u32 size) {
void* ret;
u32 n;
-
- n = num*size;
+
+ n = num * size;
ret = __osMalloc(&sZeldaArena, n);
- if (ret)
+ if (ret) {
bzero(ret, n);
+ }
ZeldaArena_CheckPointer(ret, n, "zelda_calloc", "確保");
return ret;
}
-void ZeldaArena_Display()
-{
- //Zelda heap display
+void ZeldaArena_Display() {
+ // Zelda heap display
osSyncPrintf("ゼルダヒープ表示\n");
__osDisplayArena(&sZeldaArena);
}
-void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc)
-{
+void ZeldaArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
ArenaImpl_GetSizes(&sZeldaArena, outMaxFree, outFree, outAlloc);
}
-void ZeldaArena_Check()
-{
+void ZeldaArena_Check() {
__osCheckArena(&sZeldaArena);
}
-void ZeldaArena_Init(void* start, u32 size)
-{
+void ZeldaArena_Init(void* start, u32 size) {
gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocInit(&sZeldaArena, start, size);
}
-void ZeldaArena_Cleanup()
-{
+void ZeldaArena_Cleanup() {
gZeldaArenaLogSeverity = LOG_SEVERITY_NOLOG;
__osMallocCleanup(&sZeldaArena);
}
-u8 ZeldaArena_IsInitalized()
-{
+u8 ZeldaArena_IsInitalized() {
return __osMallocIsInitalized(&sZeldaArena);
}
diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c
index 7498ffe7f..b740bba3c 100644
--- a/src/code/z_map_exp.c
+++ b/src/code/z_map_exp.c
@@ -22,4 +22,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_exp/func_80082248.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_map_exp/func_8008226C.s")
-
diff --git a/src/code/z_map_mark.c b/src/code/z_map_mark.c
index bd1187cf8..2c9343591 100644
--- a/src/code/z_map_mark.c
+++ b/src/code/z_map_mark.c
@@ -2,8 +2,7 @@
#include <global.h>
#include <vt.h>
-typedef struct
-{
+typedef struct {
/* 0x00 */ void* texture;
/* 0x04 */ u32 imageFormat;
/* 0x08 */ u32 imageSize;
@@ -15,76 +14,69 @@ typedef struct
/* 0x20 */ u32 dtdy;
} MapMarkInfo; // size = 0x24
-typedef struct
-{
+typedef struct {
/* 0x00 */ void* loadedRamAddr; // original name: "allocp"
- /* 0x04 */ u32 vromStart;
- /* 0x08 */ u32 vromEnd;
- /* 0x0C */ u32 vramStart;
- /* 0x10 */ u32 vramEnd;
- /* 0x14 */ u32 vramTable;
+ /* 0x04 */ u32 vromStart;
+ /* 0x08 */ u32 vromEnd;
+ /* 0x0C */ u32 vramStart;
+ /* 0x10 */ u32 vramEnd;
+ /* 0x14 */ u32 vramTable;
} MapMarkDataOverlay; // size = 0x18
-static u32 sBaseImageSizes[] = { 0, 1, 2, 3 };
+static u32 sBaseImageSizes[] = { 0, 1, 2, 3 };
static u32 sLoadBlockImageSizes[] = { 2, 2, 2, 3 };
-static u32 sIncrImageSizes[] = { 3, 1, 0, 0 };
-static u32 sShiftImageSizes[] = { 2, 1, 0, 0 };
-static u32 sBytesImageSizes[] = { 0, 1, 2, 4 };
+static u32 sIncrImageSizes[] = { 3, 1, 0, 0 };
+static u32 sShiftImageSizes[] = { 2, 1, 0, 0 };
+static u32 sBytesImageSizes[] = { 0, 1, 2, 4 };
static u32 sLineBytesImageSizes[] = { 0, 1, 2, 2 };
-#define G_IM_SIZ_MARK sBaseImageSizes[markInfo->imageSize]
-#define G_IM_SIZ_MARK_LOAD_BLOCK sLoadBlockImageSizes[markInfo->imageSize]
-#define G_IM_SIZ_MARK_INCR sIncrImageSizes[markInfo->imageSize]
-#define G_IM_SIZ_MARK_SHIFT sShiftImageSizes[markInfo->imageSize]
-#define G_IM_SIZ_MARK_BYTES sBytesImageSizes[markInfo->imageSize]
-#define G_IM_SIZ_MARK_LINE_BYTES sLineBytesImageSizes[markInfo->imageSize]
+#define G_IM_SIZ_MARK sBaseImageSizes[markInfo->imageSize]
+#define G_IM_SIZ_MARK_LOAD_BLOCK sLoadBlockImageSizes[markInfo->imageSize]
+#define G_IM_SIZ_MARK_INCR sIncrImageSizes[markInfo->imageSize]
+#define G_IM_SIZ_MARK_SHIFT sShiftImageSizes[markInfo->imageSize]
+#define G_IM_SIZ_MARK_BYTES sBytesImageSizes[markInfo->imageSize]
+#define G_IM_SIZ_MARK_LINE_BYTES sLineBytesImageSizes[markInfo->imageSize]
-static MapMarkInfo sMapMarkInfoTable[] =
-{
+static MapMarkInfo sMapMarkInfoTable[] = {
{ D_02002580, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 32, 32, 1024, 1024 }, // Chest Icon
- { D_02002900, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1024, 1024 }, // Boss Skull Icon
+ { D_02002900, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1024, 1024 }, // Boss Skull Icon
};
-static MapMarkDataOverlay sMapMarkDataOvl =
-{
+static MapMarkDataOverlay sMapMarkDataOvl = {
NULL,
(u32)_ovl_map_mark_dataSegmentRomStart,
(u32)_ovl_map_mark_dataSegmentRomEnd,
(u32)_ovl_map_mark_dataSegmentStart,
(u32)_ovl_map_mark_dataSegmentEnd,
- (u32)gMapMarkDataTable
+ (u32)gMapMarkDataTable,
};
static MapMarksData** sLoadedMarkDataTable;
extern u8** D_8015FFD0;
-void MapMark_Init(GlobalContext* globalCtx)
-{
+void MapMark_Init(GlobalContext* globalCtx) {
MapMarkDataOverlay* overlay = &sMapMarkDataOvl;
u32 overlaySize = overlay->vramEnd - overlay->vramStart;
overlay->loadedRamAddr = Game_Alloc(&globalCtx->state, overlaySize, "../z_map_mark.c", 235);
LogUtils_CheckNullPointer("dlftbl->allocp", overlay->loadedRamAddr, "../z_map_mark.c", 236);
- Overlay_Load(overlay->vromStart, overlay->vromEnd,
- overlay->vramStart, overlay->vramEnd,
- overlay->loadedRamAddr);
+ Overlay_Load(overlay->vromStart, overlay->vromEnd, overlay->vramStart, overlay->vramEnd, overlay->loadedRamAddr);
sLoadedMarkDataTable = gMapMarkDataTable;
- sLoadedMarkDataTable = (void*)(s32)((overlay->vramTable != 0) ?
- (void*)(overlay->vramTable - (s32)(overlay->vramStart - (s32)overlay->loadedRamAddr)) :
- NULL);
+ sLoadedMarkDataTable =
+ (void*)(s32)((overlay->vramTable != 0)
+ ? (void*)(overlay->vramTable - (s32)(overlay->vramStart - (s32)overlay->loadedRamAddr))
+ : NULL);
}
-void MapMark_ClearPointers(GlobalContext* globalCtx)
-{
+void MapMark_ClearPointers(GlobalContext* globalCtx) {
sMapMarkDataOvl.loadedRamAddr = NULL;
sLoadedMarkDataTable = NULL;
}
-void MapMark_Draw(GlobalContext* globalCtx)
-{
+void MapMark_Draw(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx;
MapMarkData* mapMarkData;
MapMarkPoint* markPoint;
@@ -99,11 +91,10 @@ void MapMark_Draw(GlobalContext* globalCtx)
dungeonId = gSaveContext.dungeon_index;
interfaceCtx = &globalCtx->interfaceCtx;
- if ((D_8015FFD0 != NULL) && (globalCtx->interfaceCtx.roomNum >= D_8015FFD0[7][dungeonId]))
- {
+ if ((D_8015FFD0 != NULL) && (globalCtx->interfaceCtx.roomNum >= D_8015FFD0[7][dungeonId])) {
// Translates to: "ROOM NUMBER EXCEEDED, YIKES %d/%d MapMarkDraw PROCESSING INTERRUPTED"
- osSyncPrintf(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n", VT_RST,
- globalCtx->interfaceCtx.roomNum, D_8015FFD0[7][dungeonId]);
+ osSyncPrintf(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n",
+ VT_RST, globalCtx->interfaceCtx.roomNum, D_8015FFD0[7][dungeonId]);
return;
}
@@ -112,10 +103,10 @@ void MapMark_Draw(GlobalContext* globalCtx)
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_map_mark.c", 303);
- while (1)
- {
- if (mapMarkData->markType == -1)
+ while (1) {
+ if (mapMarkData->markType == -1) {
break;
+ }
gDPPipeSync(gfxCtx->overlay.p++);
gDPSetTextureLUT(gfxCtx->overlay.p++, G_TT_NONE);
@@ -123,31 +114,20 @@ void MapMark_Draw(GlobalContext* globalCtx)
gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, interfaceCtx->minimapAlpha);
markPoint = &mapMarkData->points[0];
- for (i = 0; i < mapMarkData->count; i++)
- {
- if ((mapMarkData->markType != 0) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag))
- {
+ for (i = 0; i < mapMarkData->count; i++) {
+ if ((mapMarkData->markType != 0) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) {
markInfo = &sMapMarkInfoTable[mapMarkData->markType];
gDPPipeSync(gfxCtx->overlay.p++);
- gDPLoadTextureBlock(gfxCtx->overlay.p++,
- markInfo->texture,
- markInfo->imageFormat,
- G_IM_SIZ_MARK,
- markInfo->textureWidth, markInfo->textureHeight,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
- G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock(gfxCtx->overlay.p++, markInfo->texture, markInfo->imageFormat, G_IM_SIZ_MARK,
+ markInfo->textureWidth, markInfo->textureHeight, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
rectLeft = (GREG(94) + markPoint->x + 204) << 2;
rectTop = (GREG(95) + markPoint->y + 140) << 2;
- gSPTextureRectangle(gfxCtx->overlay.p++,
- rectLeft, rectTop,
- markInfo->rectWidth + rectLeft, rectTop + markInfo->rectHeight,
- G_TX_RENDERTILE,
- 0, 0,
- markInfo->dsdx, markInfo->dtdy);
+ gSPTextureRectangle(gfxCtx->overlay.p++, rectLeft, rectTop, markInfo->rectWidth + rectLeft,
+ rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx,
+ markInfo->dtdy);
}
markPoint++;
}
@@ -157,10 +137,8 @@ void MapMark_Draw(GlobalContext* globalCtx)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_map_mark.c", 339);
}
-void MapMark_DrawConditionally(GlobalContext* globalCtx)
-{
- switch (globalCtx->sceneNum)
- {
+void MapMark_DrawConditionally(GlobalContext* globalCtx) {
+ switch (globalCtx->sceneNum) {
case SCENE_YDAN:
case SCENE_DDAN:
case SCENE_BDAN:
diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c
index cb490341f..970f8bc24 100644
--- a/src/code/z_message_PAL.c
+++ b/src/code/z_message_PAL.c
@@ -82,4 +82,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_80110460.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message_PAL/func_801104C8.s")
-
diff --git a/src/code/z_moji.c b/src/code/z_moji.c
index 754e8a1b6..05a7a282c 100644
--- a/src/code/z_moji.c
+++ b/src/code/z_moji.c
@@ -11,107 +11,96 @@ s32 D_80120124 = 0;
UNK_TYPE D_8015FFC0;
UNK_TYPE D_8015FFC4;
-void func_8007B910(u32 red, u32 green, u32 blue, u32 alpha)
-{
+void func_8007B910(u32 red, u32 green, u32 blue, u32 alpha) {
sFontColorRed = red;
sFontColorGreen = green;
sFontColorBlue = blue;
sFontColorAlpha = alpha;
}
-void func_8007B934(s32 arg0, s32 arg1)
-{
- if (arg0 > 39)
+void func_8007B934(s32 arg0, s32 arg1) {
+ if (arg0 > 39) {
D_80120120 = 39 * 8;
- else if (arg0 < 0)
+ } else if (arg0 < 0) {
D_80120120 = 0;
- else
+ } else {
D_80120120 = arg0 * 8;
+ }
- if (arg1 > 29)
+ if (arg1 > 29) {
D_80120124 = 29 * 8;
- else if (arg1 < 0)
+ } else if (arg1 < 0) {
D_80120124 = 0;
- else
+ } else {
D_80120124 = arg1 * 8;
+ }
}
-void func_8007B9A4(GraphicsContext* gfxCtx, u8 arg1)
-{
+void func_8007B9A4(GraphicsContext* gfxCtx, u8 arg1) {
Gfx* gfxArr[7];
func_800C6AC4(gfxArr, gfxCtx, "../z_moji.c", 86);
- if ((u32)gLetterTLUT & 0xF)
+ if ((u32)gLetterTLUT & 0xF) {
osSyncPrintf("moji_tlut --> %X\n", gLetterTLUT);
+ }
- if (D_8015FFC0 != (arg1 & 3))
- {
+ if (D_8015FFC0 != (arg1 & 3)) {
gDPLoadTLUT(gfxCtx->polyOpa.p++, 16, 256, &gLetterTLUT[arg1 & 3]);
D_8015FFC0 = arg1 & 3;
}
- gSPTextureRectangle(gfxCtx->polyOpa.p++,
- D_80120120 << 2, D_80120124 << 2,
- (D_80120120 + 8) << 2, (D_80120124 + 8) << 2,
- G_TX_RENDERTILE,
- (u16)(arg1 & 4) * 64, (u16)(arg1 >> 3) * 256,
- 1024, 1024);
+ gSPTextureRectangle(gfxCtx->polyOpa.p++, D_80120120 << 2, D_80120124 << 2, (D_80120120 + 8) << 2,
+ (D_80120124 + 8) << 2, G_TX_RENDERTILE, (u16)(arg1 & 4) * 64, (u16)(arg1 >> 3) * 256, 1024,
+ 1024);
func_800C6B54(gfxArr, gfxCtx, "../z_moji.c", 123);
}
-void func_8007BBA8(GraphicsContext* gfxCtx, u8* arg1)
-{
+void func_8007BBA8(GraphicsContext* gfxCtx, u8* arg1) {
s32 i;
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, gfxCtx, "../z_moji.c", 137);
- if ((u32)gFontFF & 0xF)
+ if ((u32)gFontFF & 0xF) {
osSyncPrintf("font_ff --> %X\n", gFontFF);
+ }
gDPPipeSync(gfxCtx->polyOpa.p++);
- gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0,
- sFontColorRed, sFontColorGreen,
- sFontColorBlue, sFontColorAlpha);
+ gDPSetPrimColor(gfxCtx->polyOpa.p++, 0, 0, sFontColorRed, sFontColorGreen, sFontColorBlue, sFontColorAlpha);
gDPSetTextureImage(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_16b, 1, (s32)gFontFF);
- gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_16b,
- 0, 0, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gfxCtx->polyOpa.p++);
gDPLoadBlock(gfxCtx->polyOpa.p++, G_TX_LOADTILE, 0, 0, 511, 2048);
gDPPipeSync(gfxCtx->polyOpa.p++);
- gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_4b,
- 1, 0, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->polyOpa.p++, G_IM_FMT_CI, G_IM_SIZ_4b, 1, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPSetTileSize(gfxCtx->polyOpa.p++, G_TX_RENDERTILE, 0, 0, 60, 508);
D_8015FFC0 = -1;
- for (i = 0; arg1[i] != 0; i++)
- {
- switch (arg1[i])
- {
+ for (i = 0; arg1[i] != 0; i++) {
+ switch (arg1[i]) {
case 9:
D_80120120 = (((D_80120120 / 8) / 8) + 1) * 8 * 8;
- if (D_80120120 >= 320)
- {
+ if (D_80120120 >= 320) {
D_80120120 = 0;
D_80120124 += 8;
- if (D_80120124 >= 240)
+ if (D_80120124 >= 240) {
D_80120124 = 0;
+ }
}
break;
case 10:
case 13:
D_80120120 = 0;
D_80120124 += 8;
- if (D_80120124 >= 240)
+ if (D_80120124 >= 240) {
D_80120124 = 0;
+ }
break;
default:
func_8007B9A4(gfxCtx, arg1[i]);
diff --git a/src/code/z_msgevent.c b/src/code/z_msgevent.c
index 3282d0342..8995189f7 100644
--- a/src/code/z_msgevent.c
+++ b/src/code/z_msgevent.c
@@ -2,8 +2,7 @@
#include <global.h>
#include <sched.h>
-void MsgEvent_SendNullTask()
-{
+void MsgEvent_SendNullTask() {
u32 pad[4];
OSScTask task;
OSMesgQueue queue;
diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c
index 639d87869..faf7ca6b7 100644
--- a/src/code/z_onepointdemo.c
+++ b/src/code/z_onepointdemo.c
@@ -1,8 +1,7 @@
#include <ultra64.h>
#include <global.h>
-typedef struct
-{
+typedef struct {
/* 0x00 */ u32 unk_00;
/* 0x04 */ u32 unk_04;
/* 0x08 */ s16 unk_08;
@@ -13,29 +12,26 @@ typedef struct
#pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_8007C704.s")
-void func_8007C76C(f32* pfParm1, s16 *puParm2)
-{
- puParm2[0] = pfParm1[0];
- puParm2[1] = pfParm1[1];
- puParm2[2] = pfParm1[2];
+void func_8007C76C(f32* pfParm1, s16* puParm2) {
+ puParm2[0] = pfParm1[0];
+ puParm2[1] = pfParm1[1];
+ puParm2[2] = pfParm1[2];
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_8007C7A8.s")
-void func_8007C7F8(u32 uParm1, u32 uParm2)
-{
- u8 auStack4[4];
- u8 auStack8[4];
-
- func_8003C940(uParm1, auStack4, auStack8, uParm2);
+void func_8007C7F8(u32 uParm1, u32 uParm2) {
+ u8 auStack4[4];
+ u8 auStack8[4];
+
+ func_8003C940(uParm1, auStack4, auStack8, uParm2);
}
-void func_8007C820(struct_8007C820* puParm1, s16 uParm2, s16 uParm3, u32 uParm4, u32 param_5)
-{
- puParm1->unk_00 = uParm4;
- puParm1->unk_04 = param_5;
- puParm1->unk_08 = uParm2;
- puParm1->unk_0A = uParm3;
+void func_8007C820(struct_8007C820* puParm1, s16 uParm2, s16 uParm3, u32 uParm4, u32 param_5) {
+ puParm1->unk_00 = uParm4;
+ puParm1->unk_04 = param_5;
+ puParm1->unk_08 = uParm2;
+ puParm1->unk_0A = uParm3;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_8007C850.s")
@@ -52,18 +48,15 @@ void func_8007C820(struct_8007C820* puParm1, s16 uParm2, s16 uParm3, u32 uParm4,
#pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_800806BC.s")
-void func_8008070C()
-{
+void func_8008070C() {
D_80120130 = 0;
}
-void func_80080718()
-{
+void func_80080718() {
D_80120130 = 1;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_onepointdemo/func_80080728.s")
-void func_80080788(UNK_TYPE arg0, UNK_TYPE arg1)
-{
+void func_80080788(UNK_TYPE arg0, UNK_TYPE arg1) {
}
diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c
index 5b9a3abf9..91c70d609 100644
--- a/src/code/z_parameter.c
+++ b/src/code/z_parameter.c
@@ -2,117 +2,115 @@
#include <global.h>
#include <vt.h>
-typedef struct
-{
+typedef struct {
/* 0x00 */ u8 scene;
/* 0x01 */ u8 flags1;
/* 0x02 */ u8 flags2;
/* 0x03 */ u8 flags3;
} RestrictionFlags;
-RestrictionFlags sRestrictionFlags[] =
-{
- { SCENE_SPOT00, 0x00, 0x00, 0x10 },
- { SCENE_SPOT01, 0x00, 0x00, 0x10 },
- { SCENE_SPOT02, 0x00, 0x00, 0x10 },
- { SCENE_SPOT03, 0x00, 0x00, 0x10 },
- { SCENE_SPOT04, 0x00, 0x00, 0x10 },
- { SCENE_SPOT05, 0x00, 0x00, 0x10 },
- { SCENE_SPOT06, 0x00, 0x00, 0x10 },
- { SCENE_SPOT07, 0x00, 0x00, 0x10 },
- { SCENE_SPOT08, 0x00, 0x00, 0x10 },
- { SCENE_SPOT09, 0x00, 0x00, 0x10 },
- { SCENE_SPOT10, 0x00, 0x00, 0x10 },
- { SCENE_SPOT11, 0x00, 0x00, 0x10 },
- { SCENE_SPOT12, 0x00, 0x00, 0x10 },
- { SCENE_SPOT13, 0x00, 0x00, 0x10 },
- { SCENE_SPOT15, 0x00, 0x00, 0x10 },
- { SCENE_GANON_TOU, 0x00, 0x00, 0x10 },
- { SCENE_SPOT16, 0x00, 0x00, 0x10 },
- { SCENE_SPOT17, 0x00, 0x00, 0x10 },
- { SCENE_SPOT18, 0x00, 0x00, 0x10 },
- { SCENE_SPOT20, 0x00, 0x00, 0x10 },
- { SCENE_TOKINOMA, 0x00, 0x10, 0x15 },
- { SCENE_KENJYANOMA, 0xA2, 0xAA, 0xAA },
- { SCENE_SYATEKIJYOU, 0x11, 0x55, 0x55 },
- { SCENE_HAIRAL_NIWA, 0x11, 0x55, 0x55 },
- { SCENE_HAIRAL_NIWA_N, 0x11, 0x55, 0x55 },
- { SCENE_HAKAANA, 0x00, 0x00, 0xD0 },
- { SCENE_HAKAANA2, 0x00, 0x00, 0xD0 },
- { SCENE_HAKAANA_OUKE, 0x00, 0x00, 0xD0 },
- { SCENE_DAIYOUSEI_IZUMI, 0x00, 0x00, 0x10 },
- { SCENE_YOUSEI_IZUMI_TATE, 0x00, 0x00, 0xD0 },
- { SCENE_YOUSEI_IZUMI_YOKO, 0x00, 0x00, 0x10 },
- { SCENE_GANON_FINAL, 0x00, 0x05, 0x50 },
- { SCENE_NAKANIWA, 0x00, 0x05, 0x54 },
- { SCENE_TURIBORI, 0x11, 0x55, 0x55 },
- { SCENE_BOWLING, 0x11, 0x55, 0x55 },
- { SCENE_SOUKO, 0x00, 0x10, 0x15 },
- { SCENE_MIHARIGOYA, 0x00, 0x10, 0x14 },
- { SCENE_MAHOUYA, 0x10, 0x15, 0x55 },
- { SCENE_TAKARAYA, 0x10, 0x15, 0x55 },
- { SCENE_KINSUTA, 0x00, 0x10, 0x15 },
- { SCENE_ENTRA, 0x00, 0x10, 0x15 },
- { SCENE_ENTRA_N, 0x00, 0x10, 0x15 },
- { SCENE_ENRUI, 0x00, 0x10, 0xD5 },
- { SCENE_MARKET_DAY, 0x00, 0x10, 0x15 },
- { SCENE_MARKET_NIGHT, 0x00, 0x10, 0x15 },
- { SCENE_MARKET_RUINS, 0x00, 0x10, 0xD5 },
- { SCENE_MARKET_ALLEY, 0x00, 0x10, 0x15 },
- { SCENE_MARKET_ALLEY_N, 0x00, 0x10, 0x15 },
- { SCENE_SHRINE, 0x00, 0x10, 0x15 },
- { SCENE_SHRINE_N, 0x00, 0x10, 0x15 },
- { SCENE_SHRINE_R, 0x00, 0x10, 0xD5 },
- { SCENE_LINK_HOME, 0x10, 0x10, 0x15 },
- { SCENE_KAKARIKO, 0x10, 0x10, 0x15 },
- { SCENE_KAKARIKO3, 0x10, 0x10, 0x15 },
- { SCENE_KOKIRI_HOME, 0x10, 0x10, 0x15 },
- { SCENE_KOKIRI_HOME3, 0x10, 0x10, 0x15 },
- { SCENE_KOKIRI_HOME4, 0x10, 0x10, 0x15 },
- { SCENE_KOKIRI_HOME5, 0x10, 0x10, 0x15 },
- { SCENE_MALON_STABLE, 0x10, 0x10, 0x15 },
- { SCENE_HUT, 0x10, 0x10, 0x15 },
- { SCENE_IMPA, 0x10, 0x10, 0x15 },
- { SCENE_LABO, 0x10, 0x10, 0x15 },
- { SCENE_HYLIA_LABO, 0x00, 0x10, 0x15 },
- { SCENE_TENT, 0x10, 0x10, 0x15 },
- { SCENE_SHOP1, 0x10, 0x10, 0x15 },
- { SCENE_KOKIRI_SHOP, 0x10, 0x10, 0x15 },
- { SCENE_GOLON, 0x10, 0x10, 0x15 },
- { SCENE_ZOORA, 0x10, 0x10, 0x15 },
- { SCENE_DRAG, 0x10, 0x10, 0x15 },
- { SCENE_ALLEY_SHOP, 0x10, 0x10, 0x15 },
- { SCENE_NIGHT_SHOP, 0x10, 0x10, 0x15 },
- { SCENE_FACE_SHOP, 0x10, 0x10, 0x15 },
- { SCENE_MEN, 0x00, 0x03, 0x10 },
- { SCENE_YDAN, 0x00, 0x00, 0x00 },
- { SCENE_YDAN_BOSS, 0x00, 0x45, 0x50 },
- { SCENE_DDAN, 0x00, 0x00, 0x00 },
- { SCENE_DDAN_BOSS, 0x00, 0x45, 0x50 },
- { SCENE_BDAN, 0x00, 0x00, 0x00 },
- { SCENE_BDAN_BOSS, 0x00, 0x45, 0x50 },
- { SCENE_BMORI1, 0x00, 0x00, 0x00 },
- { SCENE_MORIBOSSROOM, 0x00, 0x45, 0x50 },
- { SCENE_HAKADANCH, 0x00, 0x00, 0x00 },
- { SCENE_HAKADAN, 0x00, 0x00, 0x00 },
- { SCENE_HAKADAN_BS, 0x00, 0x45, 0x50 },
- { SCENE_HIDAN, 0x00, 0x00, 0x00 },
- { SCENE_FIRE_BS, 0x00, 0x45, 0x50 },
- { SCENE_MIZUSIN, 0x00, 0x00, 0x00 },
- { SCENE_MIZUSIN_BS, 0x00, 0x45, 0x50 },
- { SCENE_JYASINZOU, 0x00, 0x00, 0x00 },
- { SCENE_JYASINBOSS, 0x00, 0x45, 0x50 },
- { SCENE_GANON, 0x00, 0x00, 0x00 },
- { SCENE_GANON_BOSS, 0x00, 0x45, 0x50 },
- { SCENE_ICE_DOUKUTO, 0x00, 0x00, 0xC0 },
- { SCENE_HAKASITARELAY, 0x00, 0x03, 0x14 },
- { SCENE_GANONTIKA, 0x00, 0x03, 0x10 },
- { SCENE_GANON_DEMO, 0x00, 0x45, 0x50 },
- { SCENE_GANON_SONOGO, 0x00, 0x05, 0x50 },
- { SCENE_GANONTIKA_SONOGO, 0x00, 0x05, 0x50 },
- { SCENE_GERUDOWAY, 0x00, 0x00, 0x10 },
- { SCENE_KAKUSIANA, 0x00, 0x00, 0xD0 },
- { 0xFF, 0x00, 0x00, 0x00 },
+RestrictionFlags sRestrictionFlags[] = {
+ { SCENE_SPOT00, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT01, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT02, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT03, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT04, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT05, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT06, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT07, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT08, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT09, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT10, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT11, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT12, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT13, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT15, 0x00, 0x00, 0x10 },
+ { SCENE_GANON_TOU, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT16, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT17, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT18, 0x00, 0x00, 0x10 },
+ { SCENE_SPOT20, 0x00, 0x00, 0x10 },
+ { SCENE_TOKINOMA, 0x00, 0x10, 0x15 },
+ { SCENE_KENJYANOMA, 0xA2, 0xAA, 0xAA },
+ { SCENE_SYATEKIJYOU, 0x11, 0x55, 0x55 },
+ { SCENE_HAIRAL_NIWA, 0x11, 0x55, 0x55 },
+ { SCENE_HAIRAL_NIWA_N, 0x11, 0x55, 0x55 },
+ { SCENE_HAKAANA, 0x00, 0x00, 0xD0 },
+ { SCENE_HAKAANA2, 0x00, 0x00, 0xD0 },
+ { SCENE_HAKAANA_OUKE, 0x00, 0x00, 0xD0 },
+ { SCENE_DAIYOUSEI_IZUMI, 0x00, 0x00, 0x10 },
+ { SCENE_YOUSEI_IZUMI_TATE, 0x00, 0x00, 0xD0 },
+ { SCENE_YOUSEI_IZUMI_YOKO, 0x00, 0x00, 0x10 },
+ { SCENE_GANON_FINAL, 0x00, 0x05, 0x50 },
+ { SCENE_NAKANIWA, 0x00, 0x05, 0x54 },
+ { SCENE_TURIBORI, 0x11, 0x55, 0x55 },
+ { SCENE_BOWLING, 0x11, 0x55, 0x55 },
+ { SCENE_SOUKO, 0x00, 0x10, 0x15 },
+ { SCENE_MIHARIGOYA, 0x00, 0x10, 0x14 },
+ { SCENE_MAHOUYA, 0x10, 0x15, 0x55 },
+ { SCENE_TAKARAYA, 0x10, 0x15, 0x55 },
+ { SCENE_KINSUTA, 0x00, 0x10, 0x15 },
+ { SCENE_ENTRA, 0x00, 0x10, 0x15 },
+ { SCENE_ENTRA_N, 0x00, 0x10, 0x15 },
+ { SCENE_ENRUI, 0x00, 0x10, 0xD5 },
+ { SCENE_MARKET_DAY, 0x00, 0x10, 0x15 },
+ { SCENE_MARKET_NIGHT, 0x00, 0x10, 0x15 },
+ { SCENE_MARKET_RUINS, 0x00, 0x10, 0xD5 },
+ { SCENE_MARKET_ALLEY, 0x00, 0x10, 0x15 },
+ { SCENE_MARKET_ALLEY_N, 0x00, 0x10, 0x15 },
+ { SCENE_SHRINE, 0x00, 0x10, 0x15 },
+ { SCENE_SHRINE_N, 0x00, 0x10, 0x15 },
+ { SCENE_SHRINE_R, 0x00, 0x10, 0xD5 },
+ { SCENE_LINK_HOME, 0x10, 0x10, 0x15 },
+ { SCENE_KAKARIKO, 0x10, 0x10, 0x15 },
+ { SCENE_KAKARIKO3, 0x10, 0x10, 0x15 },
+ { SCENE_KOKIRI_HOME, 0x10, 0x10, 0x15 },
+ { SCENE_KOKIRI_HOME3, 0x10, 0x10, 0x15 },
+ { SCENE_KOKIRI_HOME4, 0x10, 0x10, 0x15 },
+ { SCENE_KOKIRI_HOME5, 0x10, 0x10, 0x15 },
+ { SCENE_MALON_STABLE, 0x10, 0x10, 0x15 },
+ { SCENE_HUT, 0x10, 0x10, 0x15 },
+ { SCENE_IMPA, 0x10, 0x10, 0x15 },
+ { SCENE_LABO, 0x10, 0x10, 0x15 },
+ { SCENE_HYLIA_LABO, 0x00, 0x10, 0x15 },
+ { SCENE_TENT, 0x10, 0x10, 0x15 },
+ { SCENE_SHOP1, 0x10, 0x10, 0x15 },
+ { SCENE_KOKIRI_SHOP, 0x10, 0x10, 0x15 },
+ { SCENE_GOLON, 0x10, 0x10, 0x15 },
+ { SCENE_ZOORA, 0x10, 0x10, 0x15 },
+ { SCENE_DRAG, 0x10, 0x10, 0x15 },
+ { SCENE_ALLEY_SHOP, 0x10, 0x10, 0x15 },
+ { SCENE_NIGHT_SHOP, 0x10, 0x10, 0x15 },
+ { SCENE_FACE_SHOP, 0x10, 0x10, 0x15 },
+ { SCENE_MEN, 0x00, 0x03, 0x10 },
+ { SCENE_YDAN, 0x00, 0x00, 0x00 },
+ { SCENE_YDAN_BOSS, 0x00, 0x45, 0x50 },
+ { SCENE_DDAN, 0x00, 0x00, 0x00 },
+ { SCENE_DDAN_BOSS, 0x00, 0x45, 0x50 },
+ { SCENE_BDAN, 0x00, 0x00, 0x00 },
+ { SCENE_BDAN_BOSS, 0x00, 0x45, 0x50 },
+ { SCENE_BMORI1, 0x00, 0x00, 0x00 },
+ { SCENE_MORIBOSSROOM, 0x00, 0x45, 0x50 },
+ { SCENE_HAKADANCH, 0x00, 0x00, 0x00 },
+ { SCENE_HAKADAN, 0x00, 0x00, 0x00 },
+ { SCENE_HAKADAN_BS, 0x00, 0x45, 0x50 },
+ { SCENE_HIDAN, 0x00, 0x00, 0x00 },
+ { SCENE_FIRE_BS, 0x00, 0x45, 0x50 },
+ { SCENE_MIZUSIN, 0x00, 0x00, 0x00 },
+ { SCENE_MIZUSIN_BS, 0x00, 0x45, 0x50 },
+ { SCENE_JYASINZOU, 0x00, 0x00, 0x00 },
+ { SCENE_JYASINBOSS, 0x00, 0x45, 0x50 },
+ { SCENE_GANON, 0x00, 0x00, 0x00 },
+ { SCENE_GANON_BOSS, 0x00, 0x45, 0x50 },
+ { SCENE_ICE_DOUKUTO, 0x00, 0x00, 0xC0 },
+ { SCENE_HAKASITARELAY, 0x00, 0x03, 0x14 },
+ { SCENE_GANONTIKA, 0x00, 0x03, 0x10 },
+ { SCENE_GANON_DEMO, 0x00, 0x45, 0x50 },
+ { SCENE_GANON_SONOGO, 0x00, 0x05, 0x50 },
+ { SCENE_GANONTIKA_SONOGO, 0x00, 0x05, 0x50 },
+ { SCENE_GERUDOWAY, 0x00, 0x00, 0x10 },
+ { SCENE_KAKUSIANA, 0x00, 0x00, 0xD0 },
+ { 0xFF, 0x00, 0x00, 0x00 },
};
s16 sHBAScoreTier = 0;
@@ -128,249 +126,264 @@ s16 sMagicBorderR = 0xFF;
s16 sMagicBorderG = 0xFF;
s16 sMagicBorderB = 0xFF;
-s16 sExtraItemBases[] =
-{
- ITEM_STICK, ITEM_STICK, ITEM_NUT, ITEM_NUT, ITEM_BOMB, ITEM_BOMB,
- ITEM_BOMB, ITEM_BOMB, ITEM_BOW, ITEM_BOW, ITEM_BOW, ITEM_SEEDS,
- ITEM_BOMBCHU, ITEM_BOMBCHU, ITEM_STICK, ITEM_STICK, ITEM_NUT, ITEM_NUT,
+s16 sExtraItemBases[] = {
+ ITEM_STICK, ITEM_STICK, ITEM_NUT, ITEM_NUT, ITEM_BOMB, ITEM_BOMB, ITEM_BOMB, ITEM_BOMB, ITEM_BOW,
+ ITEM_BOW, ITEM_BOW, ITEM_SEEDS, ITEM_BOMBCHU, ITEM_BOMBCHU, ITEM_STICK, ITEM_STICK, ITEM_NUT, ITEM_NUT,
};
s16 D_80125A58 = 0;
s16 D_80125A5C = 0;
-Gfx sSetupDL_80125A60[] =
-{
+Gfx sSetupDL_80125A60[] = {
gsDPPipeSync(),
- gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING |
- G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_SHADING_SMOOTH | G_LOD),
- gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP |
- G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_1PRIMITIVE,
+ gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
+ G_TEXTURE_GEN_LINEAR | G_SHADING_SMOOTH | G_LOD),
+ gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_1PRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
gsDPSetCombineLERP(0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE),
gsSPEndDisplayList(),
};
// original name: "alpha_change"
-void Interface_ChangeAlpha(u16 alphaType)
-{
- if (alphaType != gSaveContext.unk_13EA)
- {
+void Interface_ChangeAlpha(u16 alphaType) {
+ if (alphaType != gSaveContext.unk_13EA) {
osSyncPrintf("ALPHAーTYPE=%d LAST_TIME_TYPE=%d\n", alphaType, gSaveContext.unk_13EE);
gSaveContext.unk_13EA = gSaveContext.unk_13E8 = alphaType;
gSaveContext.unk_13EC = 1;
}
}
-void func_80082644(GlobalContext* globalCtx, s16 alpha)
-{
+void func_80082644(GlobalContext* globalCtx, s16 alpha) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
- if (gSaveContext.button_status[0] == BTN_DISABLED)
- {
- if (interfaceCtx->bAlpha != 0x46)
+ if (gSaveContext.button_status[0] == BTN_DISABLED) {
+ if (interfaceCtx->bAlpha != 0x46) {
interfaceCtx->bAlpha = 0x46;
- }
- else
- {
- if (interfaceCtx->bAlpha != 0xFF)
+ }
+ } else {
+ if (interfaceCtx->bAlpha != 0xFF) {
interfaceCtx->bAlpha = alpha;
+ }
}
- if (gSaveContext.button_status[1] == BTN_DISABLED)
- {
- if (interfaceCtx->cLeftAlpha != 0x46)
+ if (gSaveContext.button_status[1] == BTN_DISABLED) {
+ if (interfaceCtx->cLeftAlpha != 0x46) {
interfaceCtx->cLeftAlpha = 0x46;
- }
- else
- {
- if (interfaceCtx->cLeftAlpha != 0xFF)
+ }
+ } else {
+ if (interfaceCtx->cLeftAlpha != 0xFF) {
interfaceCtx->cLeftAlpha = alpha;
+ }
}
- if (gSaveContext.button_status[2] == BTN_DISABLED)
- {
- if (interfaceCtx->cDownAlpha != 0x46)
+ if (gSaveContext.button_status[2] == BTN_DISABLED) {
+ if (interfaceCtx->cDownAlpha != 0x46) {
interfaceCtx->cDownAlpha = 0x46;
- }
- else
- {
- if (interfaceCtx->cDownAlpha != 0xFF)
+ }
+ } else {
+ if (interfaceCtx->cDownAlpha != 0xFF) {
interfaceCtx->cDownAlpha = alpha;
+ }
}
- if (gSaveContext.button_status[3] == BTN_DISABLED)
- {
- if (interfaceCtx->cRightAlpha != 0x46)
+ if (gSaveContext.button_status[3] == BTN_DISABLED) {
+ if (interfaceCtx->cRightAlpha != 0x46) {
interfaceCtx->cRightAlpha = 0x46;
- }
- else
- {
- if (interfaceCtx->cRightAlpha != 0xFF)
+ }
+ } else {
+ if (interfaceCtx->cRightAlpha != 0xFF) {
interfaceCtx->cRightAlpha = alpha;
+ }
}
- if (gSaveContext.button_status[4] == BTN_DISABLED)
- {
- if (interfaceCtx->aAlpha != 0x46)
+ if (gSaveContext.button_status[4] == BTN_DISABLED) {
+ if (interfaceCtx->aAlpha != 0x46) {
interfaceCtx->aAlpha = 0x46;
- }
- else
- {
- if (interfaceCtx->aAlpha != 0xFF)
+ }
+ } else {
+ if (interfaceCtx->aAlpha != 0xFF) {
interfaceCtx->aAlpha = alpha;
+ }
}
}
-void func_8008277C(GlobalContext* globalCtx, s16 maxAlpha, s16 alpha)
-{
+void func_8008277C(GlobalContext* globalCtx, s16 maxAlpha, s16 alpha) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
- if (gSaveContext.unk_13E7 != 0)
- {
+ if (gSaveContext.unk_13E7 != 0) {
func_80082644(globalCtx, alpha);
return;
}
- if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha))
+ if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) {
interfaceCtx->bAlpha = maxAlpha;
+ }
- if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha))
+ if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) {
interfaceCtx->aAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha))
+ if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) {
interfaceCtx->cLeftAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha))
+ if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) {
interfaceCtx->cDownAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha))
+ if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) {
interfaceCtx->cRightAlpha = maxAlpha;
+ }
}
-void func_80082850(GlobalContext* globalCtx, s16 maxAlpha)
-{
+void func_80082850(GlobalContext* globalCtx, s16 maxAlpha) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
s16 alpha;
alpha = 0xFF - maxAlpha;
- switch (gSaveContext.unk_13E8)
- {
+ switch (gSaveContext.unk_13E8) {
case 1:
case 2:
case 8:
osSyncPrintf("a_alpha=%d, c_alpha=%d → ", interfaceCtx->aAlpha, interfaceCtx->cLeftAlpha);
- if (gSaveContext.unk_13E8 == 8)
- {
- if (interfaceCtx->bAlpha != 0xFF)
+ if (gSaveContext.unk_13E8 == 8) {
+ if (interfaceCtx->bAlpha != 0xFF) {
interfaceCtx->bAlpha = alpha;
- }
- else
- {
- if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha))
+ }
+ } else {
+ if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) {
interfaceCtx->bAlpha = maxAlpha;
+ }
}
- if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha))
+ if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) {
interfaceCtx->aAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha))
+ if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) {
interfaceCtx->cLeftAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha))
+ if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) {
interfaceCtx->cDownAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha))
+ if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) {
interfaceCtx->cRightAlpha = maxAlpha;
+ }
- if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha))
+ if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) {
interfaceCtx->healthAlpha = maxAlpha;
+ }
- if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha))
+ if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) {
interfaceCtx->magicAlpha = maxAlpha;
+ }
- if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha))
+ if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) {
interfaceCtx->minimapAlpha = maxAlpha;
+ }
osSyncPrintf("a_alpha=%d, c_alpha=%d\n", interfaceCtx->aAlpha, interfaceCtx->cLeftAlpha);
break;
case 3:
- if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha))
+ if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) {
interfaceCtx->aAlpha = maxAlpha;
+ }
func_8008277C(globalCtx, maxAlpha, alpha);
- if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha))
+ if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) {
interfaceCtx->magicAlpha = maxAlpha;
+ }
- if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha))
+ if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) {
interfaceCtx->minimapAlpha = maxAlpha;
+ }
- if (interfaceCtx->healthAlpha != 0xFF)
+ if (interfaceCtx->healthAlpha != 0xFF) {
interfaceCtx->healthAlpha = alpha;
+ }
break;
case 4:
- if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha))
+ if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) {
interfaceCtx->bAlpha = maxAlpha;
+ }
- if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha))
+ if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) {
interfaceCtx->aAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha))
+ if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) {
interfaceCtx->cLeftAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha))
+ if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) {
interfaceCtx->cDownAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha))
+ if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) {
interfaceCtx->cRightAlpha = maxAlpha;
+ }
- if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha))
+ if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) {
interfaceCtx->healthAlpha = maxAlpha;
+ }
- if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha))
+ if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) {
interfaceCtx->magicAlpha = maxAlpha;
+ }
- if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha))
+ if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) {
interfaceCtx->minimapAlpha = maxAlpha;
+ }
- if (interfaceCtx->aAlpha != 0xFF)
+ if (interfaceCtx->aAlpha != 0xFF) {
interfaceCtx->aAlpha = alpha;
+ }
break;
case 5:
func_8008277C(globalCtx, maxAlpha, alpha);
- if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha))
+ if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) {
interfaceCtx->minimapAlpha = maxAlpha;
+ }
- if (interfaceCtx->aAlpha != 0xFF)
+ if (interfaceCtx->aAlpha != 0xFF) {
interfaceCtx->aAlpha = alpha;
+ }
- if (interfaceCtx->healthAlpha != 0xFF)
+ if (interfaceCtx->healthAlpha != 0xFF) {
interfaceCtx->healthAlpha = alpha;
+ }
- if (interfaceCtx->magicAlpha != 0xFF)
+ if (interfaceCtx->magicAlpha != 0xFF) {
interfaceCtx->magicAlpha = alpha;
+ }
break;
case 6:
func_8008277C(globalCtx, maxAlpha, alpha);
- if (interfaceCtx->aAlpha != 0xFF)
+ if (interfaceCtx->aAlpha != 0xFF) {
interfaceCtx->aAlpha = alpha;
+ }
- if (interfaceCtx->healthAlpha != 0xFF)
+ if (interfaceCtx->healthAlpha != 0xFF) {
interfaceCtx->healthAlpha = alpha;
+ }
- if (interfaceCtx->magicAlpha != 0xFF)
+ if (interfaceCtx->magicAlpha != 0xFF) {
interfaceCtx->magicAlpha = alpha;
+ }
- switch (globalCtx->sceneNum)
- {
+ switch (globalCtx->sceneNum) {
case SCENE_SPOT00:
case SCENE_SPOT01:
case SCENE_SPOT02:
@@ -391,158 +404,199 @@ void func_80082850(GlobalContext* globalCtx, s16 maxAlpha)
case SCENE_SPOT18:
case SCENE_SPOT20:
case SCENE_GANON_TOU:
- if (interfaceCtx->minimapAlpha < 0xAA)
+ if (interfaceCtx->minimapAlpha < 0xAA) {
interfaceCtx->minimapAlpha = alpha;
- else
+ } else {
interfaceCtx->minimapAlpha = 0xAA;
+ }
break;
default:
- if (interfaceCtx->minimapAlpha != 0xFF)
+ if (interfaceCtx->minimapAlpha != 0xFF) {
interfaceCtx->minimapAlpha = alpha;
+ }
break;
}
break;
case 7:
- if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha))
+ if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) {
interfaceCtx->minimapAlpha = maxAlpha;
+ }
func_80082644(globalCtx, alpha);
- if (interfaceCtx->healthAlpha != 0xFF)
+ if (interfaceCtx->healthAlpha != 0xFF) {
interfaceCtx->healthAlpha = alpha;
+ }
- if (interfaceCtx->magicAlpha != 0xFF)
+ if (interfaceCtx->magicAlpha != 0xFF) {
interfaceCtx->magicAlpha = alpha;
+ }
break;
case 9:
- if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha))
+ if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) {
interfaceCtx->bAlpha = maxAlpha;
+ }
- if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha))
+ if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) {
interfaceCtx->aAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha))
+ if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) {
interfaceCtx->cLeftAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha))
+ if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) {
interfaceCtx->cDownAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha))
+ if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) {
interfaceCtx->cRightAlpha = maxAlpha;
+ }
- if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha))
+ if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) {
interfaceCtx->minimapAlpha = maxAlpha;
+ }
- if (interfaceCtx->healthAlpha != 0xFF)
+ if (interfaceCtx->healthAlpha != 0xFF) {
interfaceCtx->healthAlpha = alpha;
+ }
- if (interfaceCtx->magicAlpha != 0xFF)
+ if (interfaceCtx->magicAlpha != 0xFF) {
interfaceCtx->magicAlpha = alpha;
+ }
break;
case 10:
- if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha))
+ if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) {
interfaceCtx->aAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha))
+ if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) {
interfaceCtx->cLeftAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha))
+ if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) {
interfaceCtx->cDownAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha))
+ if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) {
interfaceCtx->cRightAlpha = maxAlpha;
+ }
- if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha))
+ if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) {
interfaceCtx->healthAlpha = maxAlpha;
+ }
- if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha))
+ if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) {
interfaceCtx->magicAlpha = maxAlpha;
+ }
- if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha))
+ if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) {
interfaceCtx->minimapAlpha = maxAlpha;
+ }
- if (interfaceCtx->bAlpha != 0xFF)
+ if (interfaceCtx->bAlpha != 0xFF) {
interfaceCtx->bAlpha = alpha;
+ }
break;
case 11:
- if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha))
+ if ((interfaceCtx->bAlpha != 0) && (interfaceCtx->bAlpha > maxAlpha)) {
interfaceCtx->bAlpha = maxAlpha;
+ }
- if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha))
+ if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) {
interfaceCtx->aAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha))
+ if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) {
interfaceCtx->cLeftAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha))
+ if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) {
interfaceCtx->cDownAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha))
+ if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) {
interfaceCtx->cRightAlpha = maxAlpha;
+ }
- if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha))
+ if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) {
interfaceCtx->minimapAlpha = maxAlpha;
+ }
- if ((interfaceCtx->magicAlpha!= 0) && (interfaceCtx->magicAlpha > maxAlpha))
+ if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) {
interfaceCtx->magicAlpha = maxAlpha;
+ }
- if (interfaceCtx->healthAlpha != 0xFF)
+ if (interfaceCtx->healthAlpha != 0xFF) {
interfaceCtx->healthAlpha = alpha;
+ }
break;
case 12:
- if (interfaceCtx->aAlpha != 0xFF)
+ if (interfaceCtx->aAlpha != 0xFF) {
interfaceCtx->aAlpha = alpha;
+ }
- if (interfaceCtx->bAlpha != 0xFF)
+ if (interfaceCtx->bAlpha != 0xFF) {
interfaceCtx->bAlpha = alpha;
+ }
- if (interfaceCtx->minimapAlpha != 0xFF)
+ if (interfaceCtx->minimapAlpha != 0xFF) {
interfaceCtx->minimapAlpha = alpha;
+ }
- if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha))
+ if ((interfaceCtx->cLeftAlpha != 0) && (interfaceCtx->cLeftAlpha > maxAlpha)) {
interfaceCtx->cLeftAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha))
+ if ((interfaceCtx->cDownAlpha != 0) && (interfaceCtx->cDownAlpha > maxAlpha)) {
interfaceCtx->cDownAlpha = maxAlpha;
+ }
- if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha))
+ if ((interfaceCtx->cRightAlpha != 0) && (interfaceCtx->cRightAlpha > maxAlpha)) {
interfaceCtx->cRightAlpha = maxAlpha;
+ }
- if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha))
+ if ((interfaceCtx->magicAlpha != 0) && (interfaceCtx->magicAlpha > maxAlpha)) {
interfaceCtx->magicAlpha = maxAlpha;
+ }
- if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha))
+ if ((interfaceCtx->healthAlpha != 0) && (interfaceCtx->healthAlpha > maxAlpha)) {
interfaceCtx->healthAlpha = maxAlpha;
+ }
break;
case 13:
func_8008277C(globalCtx, maxAlpha, alpha);
- if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha))
+ if ((interfaceCtx->minimapAlpha != 0) && (interfaceCtx->minimapAlpha > maxAlpha)) {
interfaceCtx->minimapAlpha = maxAlpha;
+ }
- if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha))
+ if ((interfaceCtx->aAlpha != 0) && (interfaceCtx->aAlpha > maxAlpha)) {
interfaceCtx->aAlpha = maxAlpha;
+ }
- if (interfaceCtx->healthAlpha != 0xFF)
+ if (interfaceCtx->healthAlpha != 0xFF) {
interfaceCtx->healthAlpha = alpha;
+ }
- if (interfaceCtx->magicAlpha != 0xFF)
+ if (interfaceCtx->magicAlpha != 0xFF) {
interfaceCtx->magicAlpha = alpha;
+ }
break;
}
- if ((globalCtx->roomCtx.curRoom.unk_03 == 1) && (interfaceCtx->minimapAlpha >= 0xFF))
+ if ((globalCtx->roomCtx.curRoom.unk_03 == 1) && (interfaceCtx->minimapAlpha >= 0xFF)) {
interfaceCtx->minimapAlpha = 0xFF;
+ }
}
-void func_80083108(GlobalContext* globalCtx)
-{
+void func_80083108(GlobalContext* globalCtx) {
MessageContext* msgCtx = &globalCtx->msgCtx;
Player* player = PLAYER;
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
@@ -552,86 +606,72 @@ void func_80083108(GlobalContext* globalCtx)
sp28 = 0;
if ((gSaveContext.cutscene_index < 0xFFF0) ||
- ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.cutscene_index == 0xFFF0)))
- {
+ ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.cutscene_index == 0xFFF0))) {
gSaveContext.unk_13E7 = 0;
if ((player->stateFlags1 & 0x00800000) || (globalCtx->unk_11E5C >= 2) ||
- ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)))
- {
- if (gSaveContext.equips.button_items[0] != ITEM_NONE)
- {
+ ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) {
+ if (gSaveContext.equips.button_items[0] != ITEM_NONE) {
gSaveContext.unk_13E7 = 1;
- if (gSaveContext.button_status[0] == BTN_DISABLED)
- {
- gSaveContext.button_status[0] = gSaveContext.button_status[1] =
- gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_ENABLED;
+ if (gSaveContext.button_status[0] == BTN_DISABLED) {
+ gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] =
+ gSaveContext.button_status[3] = BTN_ENABLED;
}
if ((gSaveContext.equips.button_items[0] != ITEM_SLINGSHOT) &&
(gSaveContext.equips.button_items[0] != ITEM_BOW) &&
(gSaveContext.equips.button_items[0] != ITEM_BOMBCHU) &&
- (gSaveContext.equips.button_items[0] != ITEM_NONE))
- {
+ (gSaveContext.equips.button_items[0] != ITEM_NONE)) {
gSaveContext.button_status[0] = gSaveContext.equips.button_items[0];
- if ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))
- {
+ if ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) {
gSaveContext.equips.button_items[0] = ITEM_BOMBCHU;
Interface_LoadItemIcon1(globalCtx, 0);
- }
- else
- {
+ } else {
gSaveContext.equips.button_items[0] = ITEM_BOW;
- if (globalCtx->unk_11E5C >= 2)
- {
- if (LINK_AGE_IN_YEARS == YEARS_CHILD)
+ if (globalCtx->unk_11E5C >= 2) {
+ if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
gSaveContext.equips.button_items[0] = ITEM_SLINGSHOT;
+ }
Interface_LoadItemIcon1(globalCtx, 0);
- }
- else
- {
- if (gSaveContext.items[SLOT_BOW] == ITEM_NONE)
+ } else {
+ if (gSaveContext.items[SLOT_BOW] == ITEM_NONE) {
gSaveContext.equips.button_items[0] = ITEM_NONE;
- else
+ } else {
Interface_LoadItemIcon1(globalCtx, 0);
+ }
}
}
- gSaveContext.button_status[1] = gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_DISABLED;
+ gSaveContext.button_status[1] = gSaveContext.button_status[2] = gSaveContext.button_status[3] =
+ BTN_DISABLED;
Interface_ChangeAlpha(6);
}
- if (globalCtx->unk_1241B != 0)
+ if (globalCtx->unk_1241B != 0) {
Interface_ChangeAlpha(1);
- else if (gSaveContext.minigame_state == 1)
+ } else if (gSaveContext.minigame_state == 1) {
Interface_ChangeAlpha(8);
- else if (globalCtx->unk_11E5C >= 2)
+ } else if (globalCtx->unk_11E5C >= 2) {
Interface_ChangeAlpha(8);
- else if ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))
+ } else if ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) {
Interface_ChangeAlpha(8);
- else if (player->stateFlags1 & 0x00800000)
+ } else if (player->stateFlags1 & 0x00800000) {
Interface_ChangeAlpha(12);
- }
- else
- {
- if (player->stateFlags1 & 0x00800000)
+ }
+ } else {
+ if (player->stateFlags1 & 0x00800000) {
Interface_ChangeAlpha(12);
+ }
}
- }
- else if (globalCtx->sceneNum == SCENE_KENJYANOMA)
- {
+ } else if (globalCtx->sceneNum == SCENE_KENJYANOMA) {
Interface_ChangeAlpha(1);
- }
- else if (globalCtx->sceneNum == SCENE_TURIBORI)
- {
+ } else if (globalCtx->sceneNum == SCENE_TURIBORI) {
gSaveContext.unk_13E7 = 2;
- if (globalCtx->interfaceCtx.unk_260 != 0)
- {
- if (gSaveContext.equips.button_items[0] != ITEM_FISHING_POLE)
- {
+ if (globalCtx->interfaceCtx.unk_260 != 0) {
+ if (gSaveContext.equips.button_items[0] != ITEM_FISHING_POLE) {
gSaveContext.button_status[0] = gSaveContext.equips.button_items[0];
gSaveContext.equips.button_items[0] = ITEM_FISHING_POLE;
gSaveContext.unk_13EA = 0;
@@ -639,78 +679,69 @@ void func_80083108(GlobalContext* globalCtx)
Interface_ChangeAlpha(12);
}
- if (gSaveContext.unk_13EA != 12)
+ if (gSaveContext.unk_13EA != 12) {
Interface_ChangeAlpha(12);
- }
- else if (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE)
- {
+ }
+ } else if (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE) {
gSaveContext.equips.button_items[0] = gSaveContext.button_status[0];
gSaveContext.unk_13EA = 0;
- if (gSaveContext.equips.button_items[0] != ITEM_NONE)
+ if (gSaveContext.equips.button_items[0] != ITEM_NONE) {
Interface_LoadItemIcon1(globalCtx, 0);
+ }
- gSaveContext.button_status[0] = gSaveContext.button_status[1] =
- gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_DISABLED;
+ gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] =
+ gSaveContext.button_status[3] = BTN_DISABLED;
Interface_ChangeAlpha(50);
- }
- else
- {
- if (gSaveContext.button_status[0] == BTN_ENABLED)
+ } else {
+ if (gSaveContext.button_status[0] == BTN_ENABLED) {
gSaveContext.unk_13EA = 0;
+ }
- gSaveContext.button_status[0] = gSaveContext.button_status[1] =
- gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_DISABLED;
+ gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] =
+ gSaveContext.button_status[3] = BTN_DISABLED;
Interface_ChangeAlpha(50);
}
- }
- else if (msgCtx->msgMode == 0)
- {
- if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5))
- {
- if (gSaveContext.button_status[0] != BTN_DISABLED)
+ } else if (msgCtx->msgMode == 0) {
+ if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) {
+ if (gSaveContext.button_status[0] != BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[0] = BTN_DISABLED;
- for (i = 1; i < 4; i++)
- {
- if (func_8008F2F8(globalCtx) == 2)
- {
+ for (i = 1; i < 4; i++) {
+ if (func_8008F2F8(globalCtx) == 2) {
if ((gSaveContext.equips.button_items[i] != ITEM_HOOKSHOT) &&
- (gSaveContext.equips.button_items[i] != ITEM_LONGSHOT))
- {
- if (gSaveContext.button_status[i] == BTN_ENABLED)
+ (gSaveContext.equips.button_items[i] != ITEM_LONGSHOT)) {
+ if (gSaveContext.button_status[i] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_DISABLED;
- }
- else
- {
- if (gSaveContext.button_status[i] == BTN_DISABLED)
+ } else {
+ if (gSaveContext.button_status[i] == BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_ENABLED;
}
- }
- else
- {
- if (gSaveContext.button_status[i] == BTN_ENABLED)
+ } else {
+ if (gSaveContext.button_status[i] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_DISABLED;
}
}
- if (sp28)
+ if (sp28) {
gSaveContext.unk_13EA = 0;
+ }
Interface_ChangeAlpha(50);
- }
- else if ((player->stateFlags1 & 0x00200000) || (player->stateFlags2 & 0x00040000))
- {
- if (gSaveContext.button_status[0] != BTN_DISABLED)
- {
+ } else if ((player->stateFlags1 & 0x00200000) || (player->stateFlags2 & 0x00040000)) {
+ if (gSaveContext.button_status[0] != BTN_DISABLED) {
gSaveContext.button_status[0] = BTN_DISABLED;
gSaveContext.button_status[1] = BTN_DISABLED;
gSaveContext.button_status[2] = BTN_DISABLED;
@@ -718,341 +749,278 @@ void func_80083108(GlobalContext* globalCtx)
gSaveContext.unk_13EA = 0;
Interface_ChangeAlpha(50);
}
- }
- else if ((gSaveContext.event_inf[0] & 0xF) == 1)
- {
- if (player->stateFlags1 & 0x00800000)
- {
+ } else if ((gSaveContext.event_inf[0] & 0xF) == 1) {
+ if (player->stateFlags1 & 0x00800000) {
if ((gSaveContext.equips.button_items[0] != ITEM_NONE) &&
- (gSaveContext.equips.button_items[0] != ITEM_BOW))
- {
- if (gSaveContext.items[SLOT_BOW] == ITEM_NONE)
- {
+ (gSaveContext.equips.button_items[0] != ITEM_BOW)) {
+ if (gSaveContext.items[SLOT_BOW] == ITEM_NONE) {
gSaveContext.equips.button_items[0] = ITEM_NONE;
- }
- else
- {
+ } else {
gSaveContext.equips.button_items[0] = ITEM_BOW;
sp28 = 1;
}
}
- }
- else do
- {
- sp28 = 1;
+ } else {
+ do {
+ sp28 = 1;
- if ((gSaveContext.equips.button_items[0] == ITEM_NONE) ||
- (gSaveContext.equips.button_items[0] == ITEM_BOW))
- {
+ if ((gSaveContext.equips.button_items[0] == ITEM_NONE) ||
+ (gSaveContext.equips.button_items[0] == ITEM_BOW)) {
- if ((gSaveContext.equips.button_items[0] != ITEM_SWORD_KOKIRI) &&
- (gSaveContext.equips.button_items[0] != ITEM_SWORD_MASTER) &&
- (gSaveContext.equips.button_items[0] != ITEM_SWORD_BGS) &&
- (gSaveContext.equips.button_items[0] != ITEM_SWORD_KNIFE))
- {
- gSaveContext.equips.button_items[0] = gSaveContext.button_status[0];
- }
- else
- {
- gSaveContext.button_status[0] = gSaveContext.equips.button_items[0];
+ if ((gSaveContext.equips.button_items[0] != ITEM_SWORD_KOKIRI) &&
+ (gSaveContext.equips.button_items[0] != ITEM_SWORD_MASTER) &&
+ (gSaveContext.equips.button_items[0] != ITEM_SWORD_BGS) &&
+ (gSaveContext.equips.button_items[0] != ITEM_SWORD_KNIFE)) {
+ gSaveContext.equips.button_items[0] = gSaveContext.button_status[0];
+ } else {
+ gSaveContext.button_status[0] = gSaveContext.equips.button_items[0];
+ }
}
- }
- } while (0); // Necessary to match
+ } while (0); // Necessary to match
+ }
- if (sp28)
- {
+ if (sp28) {
Interface_LoadItemIcon1(globalCtx, 0);
sp28 = 0;
}
- for (i = 1; i < 4; i++)
- {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] != ITEM_OCARINA_FAIRY) &&
- (gSaveContext.equips.button_items[i] != ITEM_OCARINA_TIME))
- {
- if (gSaveContext.button_status[i] == BTN_ENABLED)
+ (gSaveContext.equips.button_items[i] != ITEM_OCARINA_TIME)) {
+ if (gSaveContext.button_status[i] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_DISABLED;
- }
- else
- {
- if (gSaveContext.button_status[i] == BTN_DISABLED)
+ } else {
+ if (gSaveContext.button_status[i] == BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_ENABLED;
}
}
- if (sp28)
+ if (sp28) {
gSaveContext.unk_13EA = 0;
+ }
Interface_ChangeAlpha(50);
- }
- else
- {
- if (interfaceCtx->restrictions.bButton == 0)
- {
+ } else {
+ if (interfaceCtx->restrictions.bButton == 0) {
if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) ||
(gSaveContext.equips.button_items[0] == ITEM_BOW) ||
(gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) ||
- (gSaveContext.equips.button_items[0] == ITEM_NONE))
- {
- if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0))
- {
+ (gSaveContext.equips.button_items[0] == ITEM_NONE)) {
+ if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) {
gSaveContext.equips.button_items[0] = gSaveContext.button_status[0];
sp28 = 1;
- if (gSaveContext.equips.button_items[0] != ITEM_NONE)
+ if (gSaveContext.equips.button_items[0] != ITEM_NONE) {
Interface_LoadItemIcon1(globalCtx, 0);
+ }
}
- }
- else if ((gSaveContext.button_status[0] & 0xFF) == BTN_DISABLED)
- {
+ } else if ((gSaveContext.button_status[0] & 0xFF) == BTN_DISABLED) {
sp28 = 1;
if (((gSaveContext.button_status[0] & 0xFF) == BTN_DISABLED) ||
- ((gSaveContext.button_status[0] & 0xFF) == BTN_ENABLED))
- {
+ ((gSaveContext.button_status[0] & 0xFF) == BTN_ENABLED)) {
gSaveContext.button_status[0] = BTN_ENABLED;
- }
- else
- {
+ } else {
gSaveContext.equips.button_items[0] = gSaveContext.button_status[0] & 0xFF;
}
}
- }
- else if (interfaceCtx->restrictions.bButton == 1)
- {
+ } else if (interfaceCtx->restrictions.bButton == 1) {
if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) ||
(gSaveContext.equips.button_items[0] == ITEM_BOW) ||
(gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) ||
- (gSaveContext.equips.button_items[0] == ITEM_NONE))
- {
- if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0))
- {
+ (gSaveContext.equips.button_items[0] == ITEM_NONE)) {
+ if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) {
gSaveContext.equips.button_items[0] = gSaveContext.button_status[0];
sp28 = 1;
- if (gSaveContext.equips.button_items[0] != ITEM_NONE)
+ if (gSaveContext.equips.button_items[0] != ITEM_NONE) {
Interface_LoadItemIcon1(globalCtx, 0);
+ }
}
- }
- else
- {
- if (gSaveContext.button_status[0] == BTN_ENABLED)
+ } else {
+ if (gSaveContext.button_status[0] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[0] = BTN_DISABLED;
}
}
- if (interfaceCtx->restrictions.bottles != 0)
- {
- for (i = 1; i < 4; i++)
- {
+ if (interfaceCtx->restrictions.bottles != 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) &&
- (gSaveContext.equips.button_items[i] <= ITEM_POE))
- {
- if (gSaveContext.button_status[i] == BTN_ENABLED)
+ (gSaveContext.equips.button_items[i] <= ITEM_POE)) {
+ if (gSaveContext.button_status[i] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_DISABLED;
}
}
- }
- else if (interfaceCtx->restrictions.bottles == 0)
- {
- for (i = 1; i < 4; i++)
- {
+ } else if (interfaceCtx->restrictions.bottles == 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) &&
- (gSaveContext.equips.button_items[i] <= ITEM_POE))
- {
- if (gSaveContext.button_status[i] == BTN_DISABLED)
+ (gSaveContext.equips.button_items[i] <= ITEM_POE)) {
+ if (gSaveContext.button_status[i] == BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_ENABLED;
}
}
}
- if (interfaceCtx->restrictions.tradeItems != 0)
- {
- for (i = 1; i < 4; i++)
- {
+ if (interfaceCtx->restrictions.tradeItems != 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) &&
- (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))
- {
- if (gSaveContext.button_status[i] == BTN_ENABLED)
+ (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)) {
+ if (gSaveContext.button_status[i] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_DISABLED;
}
}
- }
- else if (interfaceCtx->restrictions.tradeItems == 0)
- {
- for (i = 1; i < 4; i++)
- {
+ } else if (interfaceCtx->restrictions.tradeItems == 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) &&
- (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))
- {
- if (gSaveContext.button_status[i] == BTN_DISABLED)
+ (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)) {
+ if (gSaveContext.button_status[i] == BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_ENABLED;
}
}
}
- if (interfaceCtx->restrictions.hookshot != 0)
- {
- for (i = 1; i < 4; i++)
- {
+ if (interfaceCtx->restrictions.hookshot != 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT) ||
- (gSaveContext.equips.button_items[i] == ITEM_LONGSHOT))
- {
- if (gSaveContext.button_status[i] == BTN_ENABLED)
+ (gSaveContext.equips.button_items[i] == ITEM_LONGSHOT)) {
+ if (gSaveContext.button_status[i] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_DISABLED;
}
}
- }
- else if (interfaceCtx->restrictions.hookshot == 0)
- {
- for (i = 1; i < 4; i++)
- {
+ } else if (interfaceCtx->restrictions.hookshot == 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT) ||
- (gSaveContext.equips.button_items[i] == ITEM_LONGSHOT))
- {
- if (gSaveContext.button_status[i] == BTN_DISABLED)
+ (gSaveContext.equips.button_items[i] == ITEM_LONGSHOT)) {
+ if (gSaveContext.button_status[i] == BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_ENABLED;
}
}
}
- if (interfaceCtx->restrictions.ocarina != 0)
- {
- for (i = 1; i < 4; i++)
- {
+ if (interfaceCtx->restrictions.ocarina != 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY) ||
- (gSaveContext.equips.button_items[i] == ITEM_OCARINA_TIME))
- {
- if (gSaveContext.button_status[i] == BTN_ENABLED)
+ (gSaveContext.equips.button_items[i] == ITEM_OCARINA_TIME)) {
+ if (gSaveContext.button_status[i] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_DISABLED;
}
}
- }
- else if (interfaceCtx->restrictions.ocarina == 0)
- {
- for (i = 1; i < 4; i++)
- {
+ } else if (interfaceCtx->restrictions.ocarina == 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY) ||
- (gSaveContext.equips.button_items[i] == ITEM_OCARINA_TIME))
- {
- if (gSaveContext.button_status[i] == BTN_DISABLED)
+ (gSaveContext.equips.button_items[i] == ITEM_OCARINA_TIME)) {
+ if (gSaveContext.button_status[i] == BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_ENABLED;
}
}
}
- if (interfaceCtx->restrictions.farores != 0)
- {
- for (i = 1; i < 4; i++)
- {
- if (gSaveContext.equips.button_items[i] == ITEM_FARORES_WIND)
- {
- if (gSaveContext.button_status[i] == BTN_ENABLED)
+ if (interfaceCtx->restrictions.farores != 0) {
+ for (i = 1; i < 4; i++) {
+ if (gSaveContext.equips.button_items[i] == ITEM_FARORES_WIND) {
+ if (gSaveContext.button_status[i] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_DISABLED;
osSyncPrintf("***(i=%d)*** ", i);
}
}
- }
- else if (interfaceCtx->restrictions.farores == 0)
- {
- for (i = 1; i < 4; i++)
- {
- if (gSaveContext.equips.button_items[i] == ITEM_FARORES_WIND)
- {
- if (gSaveContext.button_status[i] == BTN_DISABLED)
+ } else if (interfaceCtx->restrictions.farores == 0) {
+ for (i = 1; i < 4; i++) {
+ if (gSaveContext.equips.button_items[i] == ITEM_FARORES_WIND) {
+ if (gSaveContext.button_status[i] == BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_ENABLED;
}
}
}
- if (interfaceCtx->restrictions.dinsNayrus != 0)
- {
- for (i = 1; i < 4; i++)
- {
+ if (interfaceCtx->restrictions.dinsNayrus != 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] == ITEM_DINS_FIRE) ||
- (gSaveContext.equips.button_items[i] == ITEM_NAYRUS_LOVE))
- {
- if (gSaveContext.button_status[i] == BTN_ENABLED)
+ (gSaveContext.equips.button_items[i] == ITEM_NAYRUS_LOVE)) {
+ if (gSaveContext.button_status[i] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_DISABLED;
}
}
- }
- else if (interfaceCtx->restrictions.dinsNayrus == 0)
- {
- for (i = 1; i < 4; i++)
- {
+ } else if (interfaceCtx->restrictions.dinsNayrus == 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] == ITEM_DINS_FIRE) ||
- (gSaveContext.equips.button_items[i] == ITEM_NAYRUS_LOVE))
- {
- if (gSaveContext.button_status[i] == BTN_DISABLED)
+ (gSaveContext.equips.button_items[i] == ITEM_NAYRUS_LOVE)) {
+ if (gSaveContext.button_status[i] == BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_ENABLED;
}
}
}
- if (interfaceCtx->restrictions.all != 0)
- {
- for (i = 1; i < 4; i++)
- {
+ if (interfaceCtx->restrictions.all != 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] != ITEM_OCARINA_FAIRY) &&
(gSaveContext.equips.button_items[i] != ITEM_OCARINA_TIME) &&
!((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) &&
(gSaveContext.equips.button_items[i] <= ITEM_POE)) &&
!((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) &&
- (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)))
- {
+ (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) {
if ((globalCtx->sceneNum != SCENE_TAKARAYA) ||
- (gSaveContext.equips.button_items[i] != ITEM_LENS))
- {
- if (gSaveContext.button_status[i] == BTN_ENABLED)
+ (gSaveContext.equips.button_items[i] != ITEM_LENS)) {
+ if (gSaveContext.button_status[i] == BTN_ENABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_DISABLED;
- }
- else
- {
- if (gSaveContext.button_status[i] == BTN_DISABLED)
+ } else {
+ if (gSaveContext.button_status[i] == BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_ENABLED;
}
}
}
- }
- else if (interfaceCtx->restrictions.all == 0)
- {
- for (i = 1; i < 4; i++)
- {
+ } else if (interfaceCtx->restrictions.all == 0) {
+ for (i = 1; i < 4; i++) {
if ((gSaveContext.equips.button_items[i] != ITEM_DINS_FIRE) &&
(gSaveContext.equips.button_items[i] != ITEM_HOOKSHOT) &&
(gSaveContext.equips.button_items[i] != ITEM_LONGSHOT) &&
@@ -1063,10 +1031,10 @@ void func_80083108(GlobalContext* globalCtx)
!((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) &&
(gSaveContext.equips.button_items[i] <= ITEM_POE)) &&
!((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) &&
- (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)))
- {
- if (gSaveContext.button_status[i] == BTN_DISABLED)
+ (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) {
+ if (gSaveContext.button_status[i] == BTN_DISABLED) {
sp28 = 1;
+ }
gSaveContext.button_status[i] = BTN_ENABLED;
}
@@ -1076,44 +1044,39 @@ void func_80083108(GlobalContext* globalCtx)
}
}
- if (sp28)
- {
+ if (sp28) {
gSaveContext.unk_13EA = 0;
- if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_1241B == 0))
- {
+ if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_1241B == 0)) {
Interface_ChangeAlpha(50);
osSyncPrintf("???????? alpha_change( 50 ); ?????\n");
- }
- else
- {
+ } else {
osSyncPrintf("game_play->fade_direction || game_play->fbdemo_wipe_modem");
}
}
}
-void Interface_SetSceneRestrictions(GlobalContext* globalCtx)
-{
+void Interface_SetSceneRestrictions(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
s16 i;
u8 currentScene;
+ // clang-format off
interfaceCtx->restrictions.hGauge = interfaceCtx->restrictions.bButton =
interfaceCtx->restrictions.aButton = interfaceCtx->restrictions.bottles =
- interfaceCtx->restrictions.tradeItems = interfaceCtx->restrictions.hookshot =
+ interfaceCtx->restrictions.tradeItems = interfaceCtx->restrictions.hookshot =
interfaceCtx->restrictions.ocarina = interfaceCtx->restrictions.warpSongs =
interfaceCtx->restrictions.sunsSong = interfaceCtx->restrictions.farores =
interfaceCtx->restrictions.dinsNayrus = interfaceCtx->restrictions.all = 0;
+ // clang-format on
i = 0;
// Translates to: "Data settings related to button display scene_data_ID=%d\n"
osSyncPrintf("ボタン表示関係データ設定 scene_data_ID=%d\n", globalCtx->sceneNum);
- do
- {
+ do {
currentScene = (u8)globalCtx->sceneNum;
- if (sRestrictionFlags[i].scene == currentScene)
- {
+ if (sRestrictionFlags[i].scene == currentScene) {
interfaceCtx->restrictions.hGauge = (sRestrictionFlags[i].flags1 & 0xC0) >> 6;
interfaceCtx->restrictions.bButton = (sRestrictionFlags[i].flags1 & 0x30) >> 4;
interfaceCtx->restrictions.aButton = (sRestrictionFlags[i].flags1 & 0x0C) >> 2;
@@ -1128,104 +1091,74 @@ void Interface_SetSceneRestrictions(GlobalContext* globalCtx)
interfaceCtx->restrictions.all = (sRestrictionFlags[i].flags3 & 0x03) >> 0;
osSyncPrintf(VT_FGCOL(YELLOW));
- osSyncPrintf("parameter->button_status = %x,%x,%x\n",
- sRestrictionFlags[i].flags1, sRestrictionFlags[i].flags2, sRestrictionFlags[i].flags3);
- osSyncPrintf("h_gage=%d, b_button=%d, a_button=%d, c_bottle=%d\n",
- interfaceCtx->restrictions.hGauge, interfaceCtx->restrictions.bButton,
- interfaceCtx->restrictions.aButton, interfaceCtx->restrictions.bottles);
- osSyncPrintf("c_warasibe=%d, c_hook=%d, c_ocarina=%d, c_warp=%d\n",
- interfaceCtx->restrictions.tradeItems, interfaceCtx->restrictions.hookshot,
- interfaceCtx->restrictions.ocarina, interfaceCtx->restrictions.warpSongs);
- osSyncPrintf("c_sunmoon=%d, m_wind=%d, m_magic=%d, another=%d\n",
- interfaceCtx->restrictions.sunsSong, interfaceCtx->restrictions.farores,
- interfaceCtx->restrictions.dinsNayrus, interfaceCtx->restrictions.all);
+ osSyncPrintf("parameter->button_status = %x,%x,%x\n", sRestrictionFlags[i].flags1,
+ sRestrictionFlags[i].flags2, sRestrictionFlags[i].flags3);
+ osSyncPrintf("h_gage=%d, b_button=%d, a_button=%d, c_bottle=%d\n", interfaceCtx->restrictions.hGauge,
+ interfaceCtx->restrictions.bButton, interfaceCtx->restrictions.aButton,
+ interfaceCtx->restrictions.bottles);
+ osSyncPrintf("c_warasibe=%d, c_hook=%d, c_ocarina=%d, c_warp=%d\n", interfaceCtx->restrictions.tradeItems,
+ interfaceCtx->restrictions.hookshot, interfaceCtx->restrictions.ocarina,
+ interfaceCtx->restrictions.warpSongs);
+ osSyncPrintf("c_sunmoon=%d, m_wind=%d, m_magic=%d, another=%d\n", interfaceCtx->restrictions.sunsSong,
+ interfaceCtx->restrictions.farores, interfaceCtx->restrictions.dinsNayrus,
+ interfaceCtx->restrictions.all);
osSyncPrintf(VT_RST);
return;
}
i++;
- }
- while (sRestrictionFlags[i].scene != 0xFF);
+ } while (sRestrictionFlags[i].scene != 0xFF);
}
-Gfx* Draw_TextureIA8(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight,
- s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy)
-{
- gDPLoadTextureBlock(displayListHead++,
- texture,
- G_IM_FMT_IA,
- G_IM_SIZ_8b,
- textureWidth, textureHeight,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
- G_TX_NOLOD, G_TX_NOLOD);
-
- gSPTextureRectangle(displayListHead++,
- rectLeft * 4, rectTop * 4,
- (rectLeft + rectWidth) * 4, (rectTop + rectHeight) * 4,
- G_TX_RENDERTILE,
- 0, 0,
- dsdx, dtdy);
+Gfx* Draw_TextureIA8(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, s16 rectLeft,
+ s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy) {
+ gDPLoadTextureBlock(displayListHead++, texture, G_IM_FMT_IA, G_IM_SIZ_8b, textureWidth, textureHeight, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
+ G_TX_NOLOD);
+
+ gSPTextureRectangle(displayListHead++, rectLeft * 4, rectTop * 4, (rectLeft + rectWidth) * 4,
+ (rectTop + rectHeight) * 4, G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
return displayListHead;
}
-Gfx* Draw_TextureI8(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight,
- s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy)
-{
- gDPLoadTextureBlock(displayListHead++,
- texture,
- G_IM_FMT_I,
- G_IM_SIZ_8b,
- textureWidth, textureHeight,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
- G_TX_NOLOD, G_TX_NOLOD);
-
- gSPTextureRectangle(displayListHead++,
- rectLeft * 4, rectTop * 4,
- (rectLeft + rectWidth) * 4, (rectTop + rectHeight) * 4,
- G_TX_RENDERTILE,
- 0, 0,
- dsdx, dtdy);
+Gfx* Draw_TextureI8(Gfx* displayListHead, void* texture, s16 textureWidth, s16 textureHeight, s16 rectLeft, s16 rectTop,
+ s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy) {
+ gDPLoadTextureBlock(displayListHead++, texture, G_IM_FMT_I, G_IM_SIZ_8b, textureWidth, textureHeight, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
+ G_TX_NOLOD);
+
+ gSPTextureRectangle(displayListHead++, rectLeft * 4, rectTop * 4, (rectLeft + rectWidth) * 4,
+ (rectTop + rectHeight) * 4, G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
return displayListHead;
}
#ifdef NON_MATCHING
// regalloc differences
-void Inventory_SwapAgeEquipment(void)
-{
+void Inventory_SwapAgeEquipment(void) {
s16 i;
u16 temp;
- if (LINK_AGE_IN_YEARS == YEARS_CHILD)
- {
- for (i = 0; i < 4; i++)
- {
+ if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
+ for (i = 0; i < 4; i++) {
if (i != 0)
gSaveContext.child_equips.button_items[i] = gSaveContext.equips.button_items[i];
else
gSaveContext.child_equips.button_items[i] = ITEM_SWORD_KOKIRI;
if (i != 0)
- gSaveContext.child_equips.c_button_slots[i-1] = gSaveContext.equips.c_button_slots[i-1];
+ gSaveContext.child_equips.c_button_slots[i - 1] = gSaveContext.equips.c_button_slots[i - 1];
}
gSaveContext.child_equips.equipment = gSaveContext.equips.equipment;
- if (gSaveContext.adult_equips.button_items[0] == ITEM_NONE)
- {
+ if (gSaveContext.adult_equips.button_items[0] == ITEM_NONE) {
gSaveContext.equips.button_items[0] = ITEM_SWORD_MASTER;
- if (gSaveContext.items[SLOT_NUT] != ITEM_NONE)
- {
+ if (gSaveContext.items[SLOT_NUT] != ITEM_NONE) {
gSaveContext.equips.button_items[1] = ITEM_NUT;
gSaveContext.equips.c_button_slots[0] = SLOT_NUT;
- }
- else
- {
+ } else {
gSaveContext.equips.c_button_slots[0] = SLOT_NONE;
gSaveContext.equips.button_items[1] = ITEM_NONE;
}
@@ -1235,57 +1168,47 @@ void Inventory_SwapAgeEquipment(void)
gSaveContext.equips.c_button_slots[2] = SLOT_OCARINA;
gSaveContext.equips.equipment = 0x1122;
gSaveContext.equips.button_items[3] = gSaveContext.items[SLOT_OCARINA];
- }
- else
- {
- for (i = 0; i < 4; i++)
- {
+ } else {
+ for (i = 0; i < 4; i++) {
gSaveContext.equips.button_items[i] = gSaveContext.adult_equips.button_items[i];
if (i != 0)
- gSaveContext.equips.c_button_slots[i-1] = gSaveContext.adult_equips.c_button_slots[i-1];
+ gSaveContext.equips.c_button_slots[i - 1] = gSaveContext.adult_equips.c_button_slots[i - 1];
if (((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) &&
(gSaveContext.equips.button_items[i] <= ITEM_POE)) ||
((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) &&
- (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)))
- {
- osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.c_button_slots[i-1]);
- gSaveContext.equips.button_items[i] = gSaveContext.items[gSaveContext.equips.c_button_slots[i-1]];
+ (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) {
+ osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.c_button_slots[i - 1]);
+ gSaveContext.equips.button_items[i] = gSaveContext.items[gSaveContext.equips.c_button_slots[i - 1]];
}
}
gSaveContext.equips.equipment = gSaveContext.adult_equips.equipment;
}
- }
- else
- {
- for (i = 0; i < 4; i++)
- {
+ } else {
+ for (i = 0; i < 4; i++) {
gSaveContext.adult_equips.button_items[i] = gSaveContext.equips.button_items[i];
if (i != 0)
- gSaveContext.adult_equips.c_button_slots[i-1] = gSaveContext.equips.c_button_slots[i-1];
+ gSaveContext.adult_equips.c_button_slots[i - 1] = gSaveContext.equips.c_button_slots[i - 1];
}
gSaveContext.adult_equips.equipment = gSaveContext.equips.equipment;
- if (gSaveContext.child_equips.button_items[0] != ITEM_NONE)
- {
- for (i = 0; i < 4; i++)
- {
+ if (gSaveContext.child_equips.button_items[0] != ITEM_NONE) {
+ for (i = 0; i < 4; i++) {
gSaveContext.equips.button_items[i] = gSaveContext.child_equips.button_items[i];
if (i != 0)
- gSaveContext.equips.c_button_slots[i-1] = gSaveContext.child_equips.c_button_slots[i-1];
+ gSaveContext.equips.c_button_slots[i - 1] = gSaveContext.child_equips.c_button_slots[i - 1];
if (((gSaveContext.equips.button_items[i] >= ITEM_BOTTLE) &&
(gSaveContext.equips.button_items[i] <= ITEM_POE)) ||
((gSaveContext.equips.button_items[i] >= ITEM_WEIRD_EGG) &&
- (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK)))
- {
- osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.c_button_slots[i-1]);
- gSaveContext.equips.button_items[i] = gSaveContext.items[gSaveContext.equips.c_button_slots[i-1]];
+ (gSaveContext.equips.button_items[i] <= ITEM_CLAIM_CHECK))) {
+ osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.c_button_slots[i - 1]);
+ gSaveContext.equips.button_items[i] = gSaveContext.items[gSaveContext.equips.c_button_slots[i - 1]];
}
}
@@ -1296,8 +1219,7 @@ void Inventory_SwapAgeEquipment(void)
}
temp = gEquipMasks[EQUIP_SHIELD] & gSaveContext.equips.equipment;
- if (temp != 0)
- {
+ if (temp != 0) {
temp >>= gEquipShifts[EQUIP_SHIELD];
if (!(gBitFlags[temp + 3] & gSaveContext.equipment))
gSaveContext.equips.equipment &= gEquipNegMasks[EQUIP_SHIELD];
@@ -1307,8 +1229,7 @@ void Inventory_SwapAgeEquipment(void)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Inventory_SwapAgeEquipment.s")
#endif
-void Interface_InitHorsebackArchery(GlobalContext* globalCtx)
-{
+void Interface_InitHorsebackArchery(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
gSaveContext.minigame_state = 1;
@@ -1317,21 +1238,20 @@ void Interface_InitHorsebackArchery(GlobalContext* globalCtx)
interfaceCtx->hbaAmmo = 20;
}
-void func_800849EC(GlobalContext* globalCtx)
-{
+void func_800849EC(GlobalContext* globalCtx) {
gSaveContext.equipment |= gBitFlags[2] << gEquipShifts[0];
gSaveContext.equipment ^= 8 << gEquipShifts[0];
- if (gBitFlags[3] & gSaveContext.equipment)
+ if (gBitFlags[3] & gSaveContext.equipment) {
gSaveContext.equips.button_items[0] = ITEM_SWORD_KNIFE;
- else
+ } else {
gSaveContext.equips.button_items[0] = ITEM_SWORD_BGS;
+ }
Interface_LoadItemIcon1(globalCtx, 0);
}
-void Interface_LoadItemIcon1(GlobalContext* globalCtx, u16 button)
-{
+void Interface_LoadItemIcon1(GlobalContext* globalCtx, u16 button) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
@@ -1341,8 +1261,7 @@ void Interface_LoadItemIcon1(GlobalContext* globalCtx, u16 button)
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
}
-void Interface_LoadItemIcon2(GlobalContext* globalCtx, u16 button)
-{
+void Interface_LoadItemIcon2(GlobalContext* globalCtx, u16 button) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
@@ -1352,42 +1271,33 @@ void Interface_LoadItemIcon2(GlobalContext* globalCtx, u16 button)
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
}
-void func_80084BF4(GlobalContext* globalCtx, u16 flag)
-{
- if (flag)
- {
+void func_80084BF4(GlobalContext* globalCtx, u16 flag) {
+ if (flag) {
if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) ||
(gSaveContext.equips.button_items[0] == ITEM_BOW) ||
(gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) ||
(gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE) ||
- (gSaveContext.button_status[0] == BTN_DISABLED))
- {
+ (gSaveContext.button_status[0] == BTN_DISABLED)) {
if ((gSaveContext.equips.button_items[0] == ITEM_SLINGSHOT) ||
(gSaveContext.equips.button_items[0] == ITEM_BOW) ||
(gSaveContext.equips.button_items[0] == ITEM_BOMBCHU) ||
- (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE))
- {
+ (gSaveContext.equips.button_items[0] == ITEM_FISHING_POLE)) {
gSaveContext.equips.button_items[0] = gSaveContext.button_status[0];
Interface_LoadItemIcon1(globalCtx, 0);
}
- }
- else if (gSaveContext.equips.button_items[0] == ITEM_NONE)
- {
- if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0))
- {
+ } else if (gSaveContext.equips.button_items[0] == ITEM_NONE) {
+ if ((gSaveContext.equips.button_items[0] != ITEM_NONE) || (gSaveContext.inf_table[29] == 0)) {
gSaveContext.equips.button_items[0] = gSaveContext.button_status[0];
Interface_LoadItemIcon1(globalCtx, 0);
}
}
- gSaveContext.button_status[0] = gSaveContext.button_status[1] =
- gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_ENABLED;
+ gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] =
+ gSaveContext.button_status[3] = BTN_ENABLED;
Interface_ChangeAlpha(7);
- }
- else
- {
- gSaveContext.button_status[0] = gSaveContext.button_status[1] =
- gSaveContext.button_status[2] = gSaveContext.button_status[3] = BTN_ENABLED;
+ } else {
+ gSaveContext.button_status[0] = gSaveContext.button_status[1] = gSaveContext.button_status[2] =
+ gSaveContext.button_status[3] = BTN_ENABLED;
func_80083108(globalCtx);
}
}
@@ -1396,8 +1306,7 @@ s16 sAmmoRefillCounts[] = { 5, 10, 20, 30, 5, 10, 30, 0, 5, 20, 1, 5, 20, 50, 20
#ifdef NON_MATCHING
// regalloc, minor ordering and stack usage differences
-u8 Item_Give(GlobalContext* globalCtx, u8 item)
-{
+u8 Item_Give(GlobalContext* globalCtx, u8 item) {
s16 i;
s16 slot;
s16 oldItem;
@@ -1413,8 +1322,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item)
osSyncPrintf("item_get_setting=%d pt=%d z=%x\n", item, slot, gSaveContext.items[slot]);
osSyncPrintf(VT_RST);
- if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT))
- {
+ if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT)) {
gSaveContext.quest_items |= gBitFlags[item - ITEM_MEDALLION_FOREST];
osSyncPrintf(VT_FGCOL(YELLOW));
@@ -1426,23 +1334,19 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item)
func_8006D0AC(globalCtx);
return ITEM_NONE;
- }
- else if ((item >= ITEM_SONG_MINUET) && (item <= ITEM_SONG_STORMS))
- {
+ } else if ((item >= ITEM_SONG_MINUET) && (item <= ITEM_SONG_STORMS)) {
gSaveContext.quest_items |= gBitFlags[item - ITEM_SONG_MINUET + 6];
osSyncPrintf(VT_FGCOL(YELLOW));
// Translates to: "Musical scores = %x"
osSyncPrintf("楽譜 = %x\n", gSaveContext.quest_items);
// Translates to: "Musical scores = %x (%x) (%x)"
- osSyncPrintf("楽譜 = %x (%x) (%x)\n", gSaveContext.quest_items,
- gBitFlags[item - ITEM_SONG_MINUET + 6], gBitFlags[item - ITEM_SONG_MINUET]);
+ osSyncPrintf("楽譜 = %x (%x) (%x)\n", gSaveContext.quest_items, gBitFlags[item - ITEM_SONG_MINUET + 6],
+ gBitFlags[item - ITEM_SONG_MINUET]);
osSyncPrintf(VT_RST);
return ITEM_NONE;
- }
- else if ((item >= ITEM_KOKIRI_EMERALD) && (item <= ITEM_ZORA_SAPPHIRE))
- {
+ } else if ((item >= ITEM_KOKIRI_EMERALD) && (item <= ITEM_ZORA_SAPPHIRE)) {
gSaveContext.quest_items |= gBitFlags[item - ITEM_KOKIRI_EMERALD + 18];
osSyncPrintf(VT_FGCOL(YELLOW));
@@ -1451,9 +1355,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item)
osSyncPrintf(VT_RST);
return ITEM_NONE;
- }
- else if ((item == ITEM_STONE_OF_AGONY) || (item == ITEM_GERUDO_CARD))
- {
+ } else if ((item == ITEM_STONE_OF_AGONY) || (item == ITEM_GERUDO_CARD)) {
gSaveContext.quest_items |= gBitFlags[item - ITEM_STONE_OF_AGONY + 21];
osSyncPrintf(VT_FGCOL(YELLOW));
@@ -1462,9 +1364,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item)
osSyncPrintf(VT_RST);
return ITEM_NONE;
- }
- else if (item == ITEM_SKULL_TOKEN)
- {
+ } else if (item == ITEM_SKULL_TOKEN) {
gSaveContext.quest_items |= gBitFlags[item - ITEM_SKULL_TOKEN + 23];
gSaveContext.gs_tokens++;
@@ -1474,27 +1374,20 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item)
osSyncPrintf(VT_RST);
return ITEM_NONE;
- }
- else if ((item >= ITEM_SWORD_KOKIRI) && (item <= ITEM_SWORD_BGS))
- {
+ } else if ((item >= ITEM_SWORD_KOKIRI) && (item <= ITEM_SWORD_BGS)) {
gSaveContext.equipment |= gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD];
- if (item == ITEM_SWORD_BGS)
- {
+ if (item == ITEM_SWORD_BGS) {
gSaveContext.bgs_hits_left = 8;
- if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF)
- {
+ if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF) {
gSaveContext.equipment ^= 8 << gEquipShifts[EQUIP_SWORD];
- if (gSaveContext.equips.button_items[0] == ITEM_SWORD_KNIFE)
- {
+ if (gSaveContext.equips.button_items[0] == ITEM_SWORD_KNIFE) {
gSaveContext.equips.button_items[0] = ITEM_SWORD_BGS;
Interface_LoadItemIcon1(globalCtx, 0);
}
}
- }
- else if (item == ITEM_SWORD_MASTER)
- {
+ } else if (item == ITEM_SWORD_MASTER) {
gSaveContext.equips.button_items[0] = ITEM_SWORD_MASTER;
gSaveContext.equips.equipment &= 0xFFF0;
gSaveContext.equips.equipment |= 0x0002;
@@ -1502,251 +1395,168 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item)
}
return ITEM_NONE;
- }
- else if ((item >= ITEM_SHIELD_DEKU) && (item <= ITEM_SHIELD_MIRROR))
- {
+ } else if ((item >= ITEM_SHIELD_DEKU) && (item <= ITEM_SHIELD_MIRROR)) {
gSaveContext.equipment |= (gBitFlags[item - ITEM_SHIELD_DEKU] << gEquipShifts[EQUIP_SHIELD]);
return ITEM_NONE;
- }
- else if ((item >= ITEM_TUNIC_KOKIRI) && (item <= ITEM_TUNIC_ZORA))
- {
+ } else if ((item >= ITEM_TUNIC_KOKIRI) && (item <= ITEM_TUNIC_ZORA)) {
gSaveContext.equipment |= (gBitFlags[item - ITEM_TUNIC_KOKIRI] << gEquipShifts[EQUIP_TUNIC]);
return ITEM_NONE;
- }
- else if ((item >= ITEM_BOOTS_KOKIRI) && (item <= ITEM_BOOTS_HOVER))
- {
+ } else if ((item >= ITEM_BOOTS_KOKIRI) && (item <= ITEM_BOOTS_HOVER)) {
gSaveContext.equipment |= (gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]);
return ITEM_NONE;
- }
- else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP))
- {
+ } else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) {
gSaveContext.dungeon_items[gSaveContext.dungeon_index] |= gBitFlags[item - ITEM_KEY_BOSS];
return ITEM_NONE;
- }
- else if (item == ITEM_KEY_SMALL)
- {
- if (gSaveContext.dungeon_keys[gSaveContext.dungeon_index] < 0)
- {
+ } else if (item == ITEM_KEY_SMALL) {
+ if (gSaveContext.dungeon_keys[gSaveContext.dungeon_index] < 0) {
gSaveContext.dungeon_keys[gSaveContext.dungeon_index] = 1;
return ITEM_NONE;
- }
- else
- {
+ } else {
gSaveContext.dungeon_keys[gSaveContext.dungeon_index]++;
return ITEM_NONE;
}
- }
- else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW))
- {
- if (CUR_UPG_VALUE(UPG_QUIVER) == 0)
- {
+ } else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW)) {
+ if (CUR_UPG_VALUE(UPG_QUIVER) == 0) {
Inventory_ChangeUpgrade(UPG_QUIVER, 1);
INV_CONTENT(ITEM_BOW) = ITEM_BOW;
AMMO(ITEM_BOW) = CAPACITY(UPG_QUIVER, 1);
return ITEM_NONE;
- }
- else
- {
+ } else {
AMMO(ITEM_BOW)++;
if (AMMO(ITEM_BOW) > CUR_CAPACITY(UPG_QUIVER))
AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER);
}
- }
- else if (item == ITEM_QUIVER_40)
- {
+ } else if (item == ITEM_QUIVER_40) {
Inventory_ChangeUpgrade(UPG_QUIVER, 2);
AMMO(ITEM_BOW) = CAPACITY(UPG_QUIVER, 2);
return ITEM_NONE;
- }
- else if (item == ITEM_QUIVER_50)
- {
+ } else if (item == ITEM_QUIVER_50) {
Inventory_ChangeUpgrade(UPG_QUIVER, 3);
AMMO(ITEM_BOW) = CAPACITY(UPG_QUIVER, 3);
return ITEM_NONE;
- }
- else if (item == ITEM_BULLET_BAG_40)
- {
+ } else if (item == ITEM_BULLET_BAG_40) {
Inventory_ChangeUpgrade(UPG_BULLET_BAG, 2);
AMMO(ITEM_SLINGSHOT) = CAPACITY(UPG_BULLET_BAG, 2);
return ITEM_NONE;
- }
- else if (item == ITEM_BULLET_BAG_50)
- {
+ } else if (item == ITEM_BULLET_BAG_50) {
Inventory_ChangeUpgrade(UPG_BULLET_BAG, 3);
AMMO(ITEM_SLINGSHOT) = CAPACITY(UPG_BULLET_BAG, 3);
return ITEM_NONE;
- }
- else if (item == ITEM_BOMB_BAG_20)
- {
- if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0)
- {
+ } else if (item == ITEM_BOMB_BAG_20) {
+ if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) {
Inventory_ChangeUpgrade(UPG_BOMB_BAG, 1);
INV_CONTENT(ITEM_BOMB) = ITEM_BOMB;
AMMO(ITEM_BOMB) = CAPACITY(UPG_BOMB_BAG, 1);
return ITEM_NONE;
- }
- else
- {
+ } else {
AMMO(ITEM_BOMB)++;
if (AMMO(ITEM_BOMB) > CUR_CAPACITY(UPG_BOMB_BAG))
AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG);
}
- }
- else if (item == ITEM_BOMB_BAG_30)
- {
+ } else if (item == ITEM_BOMB_BAG_30) {
Inventory_ChangeUpgrade(UPG_BOMB_BAG, 2);
AMMO(ITEM_BOMB) = CAPACITY(UPG_BOMB_BAG, 2);
return ITEM_NONE;
- }
- else if (item == ITEM_BOMB_BAG_40)
- {
+ } else if (item == ITEM_BOMB_BAG_40) {
Inventory_ChangeUpgrade(UPG_BOMB_BAG, 3);
AMMO(ITEM_BOMB) = CAPACITY(UPG_BOMB_BAG, 3);
return ITEM_NONE;
- }
- else if (item == ITEM_BRACELET)
- {
+ } else if (item == ITEM_BRACELET) {
Inventory_ChangeUpgrade(UPG_STRENGTH, 1);
return ITEM_NONE;
- }
- else if (item == ITEM_GAUNTLETS_SILVER)
- {
+ } else if (item == ITEM_GAUNTLETS_SILVER) {
Inventory_ChangeUpgrade(UPG_STRENGTH, 2);
return ITEM_NONE;
- }
- else if (item == ITEM_GAUNTLETS_GOLD)
- {
+ } else if (item == ITEM_GAUNTLETS_GOLD) {
Inventory_ChangeUpgrade(UPG_STRENGTH, 3);
return ITEM_NONE;
- }
- else if (item == ITEM_SCALE_SILVER)
- {
+ } else if (item == ITEM_SCALE_SILVER) {
Inventory_ChangeUpgrade(UPG_SCALE, 1);
return ITEM_NONE;
- }
- else if (item == ITEM_SCALE_GOLDEN)
- {
+ } else if (item == ITEM_SCALE_GOLDEN) {
Inventory_ChangeUpgrade(UPG_SCALE, 2);
return ITEM_NONE;
- }
- else if (item == ITEM_WALLET_ADULT)
- {
+ } else if (item == ITEM_WALLET_ADULT) {
Inventory_ChangeUpgrade(UPG_WALLET, 1);
return ITEM_NONE;
- }
- else if (item == ITEM_WALLET_GIANT)
- {
+ } else if (item == ITEM_WALLET_GIANT) {
Inventory_ChangeUpgrade(UPG_WALLET, 2);
return ITEM_NONE;
- }
- else if (item == ITEM_STICK_UPGRADE_20)
- {
+ } else if (item == ITEM_STICK_UPGRADE_20) {
if (gSaveContext.items[slot] == ITEM_NONE)
INV_CONTENT(ITEM_STICK) = ITEM_STICK;
Inventory_ChangeUpgrade(UPG_STICKS, 2);
AMMO(ITEM_STICK) = CAPACITY(UPG_STICKS, 2);
return ITEM_NONE;
- }
- else if (item == ITEM_STICK_UPGRADE_30)
- {
+ } else if (item == ITEM_STICK_UPGRADE_30) {
if (gSaveContext.items[slot] == ITEM_NONE)
INV_CONTENT(ITEM_STICK) = ITEM_STICK;
Inventory_ChangeUpgrade(UPG_STICKS, 3);
AMMO(ITEM_STICK) = CAPACITY(UPG_STICKS, 3);
return ITEM_NONE;
- }
- else if (item == ITEM_NUT_UPGRADE_30)
- {
+ } else if (item == ITEM_NUT_UPGRADE_30) {
if (gSaveContext.items[slot] == ITEM_NONE)
INV_CONTENT(ITEM_NUT) = ITEM_NUT;
Inventory_ChangeUpgrade(UPG_NUTS, 2);
AMMO(ITEM_NUT) = CAPACITY(UPG_NUTS, 2);
return ITEM_NONE;
- }
- else if (item == ITEM_NUT_UPGRADE_40)
- {
+ } else if (item == ITEM_NUT_UPGRADE_40) {
if (gSaveContext.items[slot] == ITEM_NONE)
INV_CONTENT(ITEM_NUT) = ITEM_NUT;
Inventory_ChangeUpgrade(UPG_NUTS, 3);
AMMO(ITEM_NUT) = CAPACITY(UPG_NUTS, 3);
return ITEM_NONE;
- }
- else if (item == ITEM_LONGSHOT)
- {
+ } else if (item == ITEM_LONGSHOT) {
INV_CONTENT(item) = item;
- for (i = 1; i < 4; i++)
- {
- if (gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT)
- {
+ for (i = 1; i < 4; i++) {
+ if (gSaveContext.equips.button_items[i] == ITEM_HOOKSHOT) {
gSaveContext.equips.button_items[i] = ITEM_LONGSHOT;
Interface_LoadItemIcon1(globalCtx, i);
}
}
return ITEM_NONE;
- }
- else if (item == ITEM_STICK)
- {
- if (gSaveContext.items[slot] == ITEM_NONE)
- {
+ } else if (item == ITEM_STICK) {
+ if (gSaveContext.items[slot] == ITEM_NONE) {
Inventory_ChangeUpgrade(UPG_STICKS, 1);
AMMO(ITEM_STICK) = 1;
- }
- else
- {
+ } else {
AMMO(ITEM_STICK)++;
if (AMMO(ITEM_STICK) > CUR_CAPACITY(UPG_STICKS))
AMMO(ITEM_STICK) = CUR_CAPACITY(UPG_STICKS);
}
- }
- else if ((item == ITEM_STICKS_5) || (item == ITEM_STICKS_10))
- {
- if (gSaveContext.items[slot] == ITEM_NONE)
- {
+ } else if ((item == ITEM_STICKS_5) || (item == ITEM_STICKS_10)) {
+ if (gSaveContext.items[slot] == ITEM_NONE) {
Inventory_ChangeUpgrade(UPG_STICKS, 1);
AMMO(ITEM_STICK) = sAmmoRefillCounts[item - ITEM_STICKS_5];
- }
- else
- {
+ } else {
AMMO(ITEM_STICK) += sAmmoRefillCounts[item - ITEM_STICKS_5];
if (AMMO(ITEM_STICK) > CUR_CAPACITY(UPG_STICKS))
AMMO(ITEM_STICK) = CUR_CAPACITY(UPG_STICKS);
}
item = ITEM_STICK;
- }
- else if (item == ITEM_NUT)
- {
- if (gSaveContext.items[slot] == ITEM_NONE)
- {
+ } else if (item == ITEM_NUT) {
+ if (gSaveContext.items[slot] == ITEM_NONE) {
Inventory_ChangeUpgrade(UPG_NUTS, 1);
AMMO(ITEM_NUT) = ITEM_NUT;
- }
- else
- {
+ } else {
AMMO(ITEM_NUT)++;
if (AMMO(ITEM_NUT) > CUR_CAPACITY(UPG_NUTS))
AMMO(ITEM_NUT) = CUR_CAPACITY(UPG_NUTS);
}
- }
- else if ((item == ITEM_NUTS_5) || (item == ITEM_NUTS_10))
- {
- if (gSaveContext.items[slot] == ITEM_NONE)
- {
+ } else if ((item == ITEM_NUTS_5) || (item == ITEM_NUTS_10)) {
+ if (gSaveContext.items[slot] == ITEM_NONE) {
Inventory_ChangeUpgrade(UPG_NUTS, 1);
AMMO(ITEM_NUT) += sAmmoRefillCounts[item - ITEM_NUTS_5];
// Translates to: "Deku Nuts %d(%d)=%d BS_count=%d"
- osSyncPrintf("デクの実 %d(%d)=%d BS_count=%d\n",
- item, ITEM_NUTS_5, item - ITEM_NUTS_5, sAmmoRefillCounts[item - ITEM_NUTS_5]);
- }
- else
- {
+ osSyncPrintf("デクの実 %d(%d)=%d BS_count=%d\n", item, ITEM_NUTS_5, item - ITEM_NUTS_5,
+ sAmmoRefillCounts[item - ITEM_NUTS_5]);
+ } else {
AMMO(ITEM_NUT) += sAmmoRefillCounts[item - ITEM_NUTS_5];
if (AMMO(ITEM_NUT) > CUR_CAPACITY(UPG_NUTS))
AMMO(ITEM_NUT) = CUR_CAPACITY(UPG_NUTS);
}
item = ITEM_NUT;
- }
- else if (item == ITEM_BOMB)
- {
+ } else if (item == ITEM_BOMB) {
// Translates to: "Bomb Bomb Bomb Bomb Bomb Bomb Bomb"
osSyncPrintf(" 爆弾 爆弾 爆弾 爆弾 爆弾 爆弾 爆弾 \n");
bombCount = AMMO(ITEM_BOMB) + 1;
@@ -1754,49 +1564,35 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item)
if (bombCount > CUR_CAPACITY(UPG_BOMB_BAG))
AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG);
return ITEM_NONE;
- }
- else if ((item >= ITEM_BOMBS_5) && (item <= ITEM_BOMBS_30))
- {
+ } else if ((item >= ITEM_BOMBS_5) && (item <= ITEM_BOMBS_30)) {
bombCount = AMMO(ITEM_BOMB) + sAmmoRefillCounts[item - ITEM_BOMBS_5];
AMMO(ITEM_BOMB) = bombCount;
if (bombCount > CUR_CAPACITY(UPG_BOMB_BAG))
AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG);
return ITEM_NONE;
- }
- else if (item == ITEM_BOMBCHU)
- {
- if (gSaveContext.items[slot] == ITEM_NONE)
- {
+ } else if (item == ITEM_BOMBCHU) {
+ if (gSaveContext.items[slot] == ITEM_NONE) {
INV_CONTENT(ITEM_BOMBCHU) = ITEM_BOMBCHU;
AMMO(ITEM_BOMBCHU) = 10;
return ITEM_NONE;
- }
- else
- {
+ } else {
AMMO(ITEM_BOMBCHU) += 10;
if (AMMO(ITEM_BOMBCHU) > 50)
AMMO(ITEM_BOMBCHU) = 50;
return ITEM_NONE;
}
- }
- else if ((item == ITEM_BOMBCHUS_5) || (item == ITEM_BOMBCHUS_20))
- {
- if (gSaveContext.items[slot] == ITEM_NONE)
- {
+ } else if ((item == ITEM_BOMBCHUS_5) || (item == ITEM_BOMBCHUS_20)) {
+ if (gSaveContext.items[slot] == ITEM_NONE) {
INV_CONTENT(ITEM_BOMBCHU) = ITEM_BOMBCHU;
AMMO(ITEM_BOMBCHU) += sAmmoRefillCounts[item - ITEM_BOMBCHUS_5 + 8];
return ITEM_NONE;
- }
- else
- {
+ } else {
AMMO(ITEM_BOMBCHU) += sAmmoRefillCounts[item - ITEM_BOMBCHUS_5 + 8];
if (AMMO(ITEM_BOMBCHU) > 50)
AMMO(ITEM_BOMBCHU) = 50;
return ITEM_NONE;
}
- }
- else if ((item >= ITEM_ARROWS_SMALL) && (item <= ITEM_ARROWS_LARGE))
- {
+ } else if ((item >= ITEM_ARROWS_SMALL) && (item <= ITEM_ARROWS_LARGE)) {
AMMO(ITEM_BOW) += sAmmoRefillCounts[item - ITEM_ARROWS_SMALL + 4];
if ((AMMO(ITEM_BOW) >= CUR_CAPACITY(UPG_QUIVER)) || (AMMO(ITEM_BOW) < 0))
@@ -1805,178 +1601,128 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item)
osSyncPrintf("%d本 Item_MaxGet=%d\n", AMMO(ITEM_BOW), CUR_CAPACITY(UPG_QUIVER));
return ITEM_BOW;
- }
- else if (item == ITEM_SLINGSHOT)
- {
+ } else if (item == ITEM_SLINGSHOT) {
Inventory_ChangeUpgrade(UPG_BULLET_BAG, 1);
INV_CONTENT(ITEM_SLINGSHOT) = ITEM_SLINGSHOT;
AMMO(ITEM_SLINGSHOT) = 30;
return ITEM_NONE;
- }
- else if (item == ITEM_SEEDS)
- {
+ } else if (item == ITEM_SEEDS) {
AMMO(ITEM_SLINGSHOT) += 5;
if (AMMO(ITEM_SLINGSHOT) >= CUR_CAPACITY(UPG_BULLET_BAG))
AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG);
- if (!(gSaveContext.item_get_inf[1] & 8))
- {
+ if (!(gSaveContext.item_get_inf[1] & 8)) {
gSaveContext.item_get_inf[1] |= 8;
return ITEM_NONE;
}
return ITEM_SEEDS;
- }
- else if (item == ITEM_SEEDS_30)
- {
+ } else if (item == ITEM_SEEDS_30) {
AMMO(ITEM_SLINGSHOT) += 30;
if (AMMO(ITEM_SLINGSHOT) >= CUR_CAPACITY(UPG_BULLET_BAG))
AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG);
- if (!(gSaveContext.item_get_inf[1] & 8))
- {
+ if (!(gSaveContext.item_get_inf[1] & 8)) {
gSaveContext.item_get_inf[1] |= 8;
return ITEM_NONE;
}
return ITEM_SEEDS;
- }
- else if (item == ITEM_OCARINA_FAIRY)
- {
+ } else if (item == ITEM_OCARINA_FAIRY) {
INV_CONTENT(ITEM_OCARINA_FAIRY) = ITEM_OCARINA_FAIRY;
return ITEM_NONE;
- }
- else if (item == ITEM_OCARINA_TIME)
- {
+ } else if (item == ITEM_OCARINA_TIME) {
INV_CONTENT(ITEM_OCARINA_TIME) = ITEM_OCARINA_TIME;
- for (i = 1; i < 4; i++)
- {
- if (gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY)
- {
+ for (i = 1; i < 4; i++) {
+ if (gSaveContext.equips.button_items[i] == ITEM_OCARINA_FAIRY) {
gSaveContext.equips.button_items[i] = ITEM_OCARINA_TIME;
Interface_LoadItemIcon1(globalCtx, i);
}
}
return ITEM_NONE;
- }
- else if (item == ITEM_BEAN)
- {
- if (gSaveContext.items[slot] == ITEM_NONE)
- {
+ } else if (item == ITEM_BEAN) {
+ if (gSaveContext.items[slot] == ITEM_NONE) {
INV_CONTENT(item) = item;
AMMO(ITEM_BEAN) = 1;
BEANS_BOUGHT = 1;
- }
- else
- {
+ } else {
AMMO(ITEM_BEAN)++;
BEANS_BOUGHT++;
}
return ITEM_NONE;
- }
- else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE))
- {
+ } else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE)) {
gSaveContext.quest_items += 0x10000000;
return ITEM_NONE;
- }
- else if (item == ITEM_HEART_CONTAINER)
- {
+ } else if (item == ITEM_HEART_CONTAINER) {
gSaveContext.health_capacity += 0x10;
gSaveContext.health += 0x10;
return ITEM_NONE;
- }
- else if (item == ITEM_HEART)
- {
+ } else if (item == ITEM_HEART) {
// Translates to: "Recovery Heart"
osSyncPrintf("回復ハート回復ハート回復ハート\n");
Health_ChangeBy(globalCtx, 0x10);
return item;
- }
- else if (item == ITEM_MAGIC_SMALL)
- {
+ } else if (item == ITEM_MAGIC_SMALL) {
if (gSaveContext.unk_13F0 != 10)
func_80087680(globalCtx);
func_80087708(globalCtx, 12, 5);
- if (!(gSaveContext.inf_table[25] & 0x100))
- {
+ if (!(gSaveContext.inf_table[25] & 0x100)) {
gSaveContext.inf_table[25] |= 0x100;
return ITEM_NONE;
}
return item;
- }
- else if (item == ITEM_MAGIC_LARGE)
- {
+ } else if (item == ITEM_MAGIC_LARGE) {
if (gSaveContext.unk_13F0 != 10)
func_80087680(globalCtx);
func_80087708(globalCtx, 24, 5);
- if (!(gSaveContext.inf_table[25] & 0x100))
- {
+ if (!(gSaveContext.inf_table[25] & 0x100)) {
gSaveContext.inf_table[25] |= 0x100;
return ITEM_NONE;
}
return item;
- }
- else if ((item >= ITEM_RUPEE_GREEN) && (item <= ITEM_INVALID_8))
- {
+ } else if ((item >= ITEM_RUPEE_GREEN) && (item <= ITEM_INVALID_8)) {
Rupees_ChangeBy(sAmmoRefillCounts[item - ITEM_RUPEE_GREEN + 10]);
return ITEM_NONE;
- }
- else if (item == ITEM_BOTTLE)
- {
- for (i = 0; i < 4; i++)
- {
- if (gSaveContext.items[SLOT(item) + i] == ITEM_NONE)
- {
+ } else if (item == ITEM_BOTTLE) {
+ for (i = 0; i < 4; i++) {
+ if (gSaveContext.items[SLOT(item) + i] == ITEM_NONE) {
gSaveContext.items[SLOT(item) + i] = item;
return ITEM_NONE;
}
}
- }
- else if (((item >= ITEM_POTION_RED) && (item <= ITEM_POE)) || (item == ITEM_MILK))
- {
+ } else if (((item >= ITEM_POTION_RED) && (item <= ITEM_POE)) || (item == ITEM_MILK)) {
bottleSlot = SLOT(item);
- if ((item != ITEM_MILK_BOTTLE) && (item != ITEM_LETTER_RUTO))
- {
- if (item == ITEM_MILK)
- {
+ if ((item != ITEM_MILK_BOTTLE) && (item != ITEM_LETTER_RUTO)) {
+ if (item == ITEM_MILK) {
item = ITEM_MILK_BOTTLE;
bottleSlot = SLOT(item);
}
- for (i = 0; i < 4; i++)
- {
- if (gSaveContext.items[bottleSlot + i] == ITEM_BOTTLE)
- {
+ for (i = 0; i < 4; i++) {
+ if (gSaveContext.items[bottleSlot + i] == ITEM_BOTTLE) {
// Translates to: "Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d Empty Bottle=%d Content=%d"
osSyncPrintf("Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d 空瓶=%d 中味=%d\n",
- gSaveContext.equips.c_button_slots[0],
- gSaveContext.equips.c_button_slots[1],
- gSaveContext.equips.c_button_slots[2],
- bottleSlot + i, item);
+ gSaveContext.equips.c_button_slots[0], gSaveContext.equips.c_button_slots[1],
+ gSaveContext.equips.c_button_slots[2], bottleSlot + i, item);
- if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[0])
- {
+ if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[0]) {
gSaveContext.equips.button_items[1] = item;
Interface_LoadItemIcon2(globalCtx, 1);
gSaveContext.button_status[1] = BTN_ENABLED;
- }
- else if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[1])
- {
+ } else if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[1]) {
gSaveContext.equips.button_items[2] = item;
Interface_LoadItemIcon2(globalCtx, 2);
gSaveContext.button_status[2] = BTN_ENABLED;
- }
- else if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[2])
- {
+ } else if ((bottleSlot + i) == gSaveContext.equips.c_button_slots[2]) {
gSaveContext.equips.button_items[3] = item;
Interface_LoadItemIcon1(globalCtx, 3);
gSaveContext.button_status[3] = BTN_ENABLED;
@@ -1986,40 +1732,28 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item)
return ITEM_NONE;
}
}
- }
- else
- {
- for (i = 0; i < 4; i++)
- {
- if (gSaveContext.items[bottleSlot + i] == ITEM_NONE)
- {
+ } else {
+ for (i = 0; i < 4; i++) {
+ if (gSaveContext.items[bottleSlot + i] == ITEM_NONE) {
gSaveContext.items[bottleSlot + i] = item;
return ITEM_NONE;
}
}
}
- }
- else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK))
- {
+ } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) {
if (item == ITEM_SAW)
gSaveContext.item_get_inf[1] |= 0x8000;
prevTradeItem = INV_CONTENT(item);
INV_CONTENT(item) = item;
- if (prevTradeItem != ITEM_NONE)
- {
- for (i = 1; i < 4; i++)
- {
- if (prevTradeItem == gSaveContext.equips.button_items[i])
- {
- if (item != ITEM_SOLD_OUT)
- {
+ if (prevTradeItem != ITEM_NONE) {
+ for (i = 1; i < 4; i++) {
+ if (prevTradeItem == gSaveContext.equips.button_items[i]) {
+ if (item != ITEM_SOLD_OUT) {
gSaveContext.equips.button_items[i] = item;
Interface_LoadItemIcon1(globalCtx, i);
- }
- else
- {
+ } else {
gSaveContext.equips.button_items[i] = ITEM_NONE;
}
return ITEM_NONE;
@@ -2040,222 +1774,166 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Item_Give.s")
#endif
-u8 Item_CheckObtainability(u8 item)
-{
+u8 Item_CheckObtainability(u8 item) {
s16 i;
s16 slot;
s32 bottleSlot;
slot = SLOT(item);
- if (item >= ITEM_STICKS_5)
+ if (item >= ITEM_STICKS_5) {
slot = SLOT(sExtraItemBases[item - ITEM_STICKS_5]);
+ }
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("item_get_non_setting=%d pt=%d z=%x\n", item, slot, gSaveContext.items[slot]);
osSyncPrintf(VT_RST);
- if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT))
- {
+ if ((item >= ITEM_MEDALLION_FOREST) && (item <= ITEM_MEDALLION_LIGHT)) {
return ITEM_NONE;
- }
- else if ((item >= ITEM_KOKIRI_EMERALD) && (item <= ITEM_SKULL_TOKEN))
- {
+ } else if ((item >= ITEM_KOKIRI_EMERALD) && (item <= ITEM_SKULL_TOKEN)) {
return ITEM_NONE;
- }
- else if ((item >= ITEM_SWORD_KOKIRI) && (item <= ITEM_SWORD_BGS))
- {
- if (item == ITEM_SWORD_BGS)
+ } else if ((item >= ITEM_SWORD_KOKIRI) && (item <= ITEM_SWORD_BGS)) {
+ if (item == ITEM_SWORD_BGS) {
return ITEM_NONE;
- else if ((gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD]) & gSaveContext.equipment)
+ } else if ((gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD]) & gSaveContext.equipment) {
return item;
- else
+ } else {
return ITEM_NONE;
- }
- else if ((item >= ITEM_SHIELD_DEKU) && (item <= ITEM_SHIELD_MIRROR))
- {
- if ((gBitFlags[item - ITEM_SHIELD_DEKU] << gEquipShifts[EQUIP_SHIELD]) & gSaveContext.equipment)
+ }
+ } else if ((item >= ITEM_SHIELD_DEKU) && (item <= ITEM_SHIELD_MIRROR)) {
+ if ((gBitFlags[item - ITEM_SHIELD_DEKU] << gEquipShifts[EQUIP_SHIELD]) & gSaveContext.equipment) {
return item;
- else
+ } else {
return ITEM_NONE;
- }
- else if ((item >= ITEM_TUNIC_KOKIRI) && (item <= ITEM_TUNIC_ZORA))
- {
- if ((gBitFlags[item - ITEM_TUNIC_KOKIRI] << gEquipShifts[EQUIP_TUNIC]) & gSaveContext.equipment)
+ }
+ } else if ((item >= ITEM_TUNIC_KOKIRI) && (item <= ITEM_TUNIC_ZORA)) {
+ if ((gBitFlags[item - ITEM_TUNIC_KOKIRI] << gEquipShifts[EQUIP_TUNIC]) & gSaveContext.equipment) {
return item;
- else
+ } else {
return ITEM_NONE;
- }
- else if ((item >= ITEM_BOOTS_KOKIRI) && (item <= ITEM_BOOTS_HOVER))
- {
- if ((gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]) & gSaveContext.equipment)
+ }
+ } else if ((item >= ITEM_BOOTS_KOKIRI) && (item <= ITEM_BOOTS_HOVER)) {
+ if ((gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]) & gSaveContext.equipment) {
return item;
- else
+ } else {
return ITEM_NONE;
- }
- else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP))
- {
+ }
+ } else if ((item == ITEM_KEY_BOSS) || (item == ITEM_COMPASS) || (item == ITEM_DUNGEON_MAP)) {
return ITEM_NONE;
- }
- else if (item == ITEM_KEY_SMALL)
- {
+ } else if (item == ITEM_KEY_SMALL) {
return ITEM_NONE;
- }
- else if ((item >= ITEM_SLINGSHOT) && (item <= ITEM_BOMBCHU))
- {
+ } else if ((item >= ITEM_SLINGSHOT) && (item <= ITEM_BOMBCHU)) {
return ITEM_NONE;
- }
- else if ((item == ITEM_BOMBCHUS_5) || (item == ITEM_BOMBCHUS_20))
- {
+ } else if ((item == ITEM_BOMBCHUS_5) || (item == ITEM_BOMBCHUS_20)) {
return ITEM_NONE;
- }
- else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW))
- {
- if (CUR_UPG_VALUE(UPG_QUIVER) == 0)
+ } else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW)) {
+ if (CUR_UPG_VALUE(UPG_QUIVER) == 0) {
return ITEM_NONE;
- else
+ } else {
return 0;
- }
- else if ((item == ITEM_QUIVER_40) || (item == ITEM_QUIVER_50))
- {
+ }
+ } else if ((item == ITEM_QUIVER_40) || (item == ITEM_QUIVER_50)) {
return ITEM_NONE;
- }
- else if ((item == ITEM_BULLET_BAG_40) || (item == ITEM_BULLET_BAG_50))
- {
+ } else if ((item == ITEM_BULLET_BAG_40) || (item == ITEM_BULLET_BAG_50)) {
return ITEM_NONE;
- }
- else if ((item == ITEM_BOMB_BAG_20) || (item == ITEM_BOMB))
- {
- if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0)
+ } else if ((item == ITEM_BOMB_BAG_20) || (item == ITEM_BOMB)) {
+ if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) {
return ITEM_NONE;
- else
+ } else {
return 0;
- }
- else if ((item >= ITEM_STICK_UPGRADE_20) && (item <= ITEM_NUT_UPGRADE_40))
- {
+ }
+ } else if ((item >= ITEM_STICK_UPGRADE_20) && (item <= ITEM_NUT_UPGRADE_40)) {
return ITEM_NONE;
- }
- else if ((item >= ITEM_BOMB_BAG_30) && (item <= ITEM_WALLET_GIANT))
- {
+ } else if ((item >= ITEM_BOMB_BAG_30) && (item <= ITEM_WALLET_GIANT)) {
return ITEM_NONE;
- }
- else if (item == ITEM_LONGSHOT)
- {
+ } else if (item == ITEM_LONGSHOT) {
return ITEM_NONE;
- }
- else if ((item == ITEM_SEEDS) || (item == ITEM_SEEDS_30))
- {
- if (!(gSaveContext.item_get_inf[1] & 0x8))
+ } else if ((item == ITEM_SEEDS) || (item == ITEM_SEEDS_30)) {
+ if (!(gSaveContext.item_get_inf[1] & 0x8)) {
return ITEM_NONE;
- else
+ } else {
return ITEM_SEEDS;
- }
- else if (item == ITEM_BEAN)
- {
+ }
+ } else if (item == ITEM_BEAN) {
return ITEM_NONE;
- }
- else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE))
- {
+ } else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE)) {
return ITEM_NONE;
- }
- else if (item == ITEM_HEART_CONTAINER)
- {
+ } else if (item == ITEM_HEART_CONTAINER) {
return ITEM_NONE;
- }
- else if (item == ITEM_HEART)
- {
+ } else if (item == ITEM_HEART) {
return ITEM_HEART;
- }
- else if ((item == ITEM_MAGIC_SMALL) || (item == ITEM_MAGIC_LARGE))
- {
+ } else if ((item == ITEM_MAGIC_SMALL) || (item == ITEM_MAGIC_LARGE)) {
// Translates to: "Magic Pot Get_Inf_Table( 25, 0x0100)=%d"
osSyncPrintf("魔法の壷 Get_Inf_Table( 25, 0x0100)=%d\n", gSaveContext.inf_table[25] & 0x100);
- if (!(gSaveContext.inf_table[25] & 0x100))
+ if (!(gSaveContext.inf_table[25] & 0x100)) {
return ITEM_NONE;
- else
+ } else {
return item;
- }
- else if ((item >= ITEM_RUPEE_GREEN) && (item <= ITEM_INVALID_8))
- {
+ }
+ } else if ((item >= ITEM_RUPEE_GREEN) && (item <= ITEM_INVALID_8)) {
return ITEM_NONE;
- }
- else if (item == ITEM_BOTTLE)
- {
+ } else if (item == ITEM_BOTTLE) {
return ITEM_NONE;
- }
- else if (((item >= ITEM_POTION_RED) && (item <= ITEM_POE)) || (item == ITEM_MILK))
- {
+ } else if (((item >= ITEM_POTION_RED) && (item <= ITEM_POE)) || (item == ITEM_MILK)) {
bottleSlot = SLOT(item);
- if ((item != ITEM_MILK_BOTTLE) && (item != ITEM_LETTER_RUTO))
- {
- if (item == ITEM_MILK)
- {
+ if ((item != ITEM_MILK_BOTTLE) && (item != ITEM_LETTER_RUTO)) {
+ if (item == ITEM_MILK) {
item = ITEM_MILK_BOTTLE;
bottleSlot = SLOT(item);
}
- for (i = 0; i < 4; i++)
- {
- if (gSaveContext.items[bottleSlot + i] == ITEM_BOTTLE)
+ for (i = 0; i < 4; i++) {
+ if (gSaveContext.items[bottleSlot + i] == ITEM_BOTTLE) {
return ITEM_NONE;
+ }
}
- }
- else
- {
- for (i = 0; i < 4; i++)
- {
- if (gSaveContext.items[bottleSlot + i] == ITEM_NONE)
+ } else {
+ for (i = 0; i < 4; i++) {
+ if (gSaveContext.items[bottleSlot + i] == ITEM_NONE) {
return ITEM_NONE;
+ }
}
}
- }
- else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK))
- {
+ } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) {
return ITEM_NONE;
}
return gSaveContext.items[slot];
}
-void Inventory_DeleteItem(u16 item, u16 invSlot)
-{
+void Inventory_DeleteItem(u16 item, u16 invSlot) {
s16 i;
- if (item == ITEM_BEAN)
+ if (item == ITEM_BEAN) {
BEANS_BOUGHT = 0; // Beans bought
+ }
gSaveContext.items[invSlot] = ITEM_NONE;
osSyncPrintf("\nItem_Register(%d)\n", invSlot, gSaveContext.items[invSlot]);
- for (i = 1; i < 4; i++)
- {
- if (gSaveContext.equips.button_items[i] == item)
- {
+ for (i = 1; i < 4; i++) {
+ if (gSaveContext.equips.button_items[i] == item) {
gSaveContext.equips.button_items[i] = ITEM_NONE;
- gSaveContext.equips.c_button_slots[i-1] = SLOT_NONE;
+ gSaveContext.equips.c_button_slots[i - 1] = SLOT_NONE;
}
}
}
#ifdef NON_MATCHING
// regalloc differences
-s32 Inventory_ReplaceItem(GlobalContext* globalCtx, u16 oldItem, u16 newItem)
-{
+s32 Inventory_ReplaceItem(GlobalContext* globalCtx, u16 oldItem, u16 newItem) {
s16 i;
s16 j;
- for (i = 0; i < ARRAY_COUNT(gSaveContext.items); i++)
- {
- if (gSaveContext.items[i] == oldItem)
- {
+ for (i = 0; i < ARRAY_COUNT(gSaveContext.items); i++) {
+ if (gSaveContext.items[i] == oldItem) {
gSaveContext.items[i] = newItem;
// Translates to: "Item Purge (%d)"
osSyncPrintf("アイテム消去(%d)", i);
- for (j = 1; j < 4; j++)
- {
- if (gSaveContext.equips.button_items[j] == oldItem)
- {
+ for (j = 1; j < 4; j++) {
+ if (gSaveContext.equips.button_items[j] == oldItem) {
gSaveContext.equips.button_items[j] = newItem;
Interface_LoadItemIcon1(globalCtx, j);
break;
@@ -2271,54 +1949,54 @@ s32 Inventory_ReplaceItem(GlobalContext* globalCtx, u16 oldItem, u16 newItem)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Inventory_ReplaceItem.s")
#endif
-s32 Inventory_HasEmptyBottle(void)
-{
+s32 Inventory_HasEmptyBottle(void) {
u8* items = gSaveContext.items;
- if (items[SLOT_BOTTLE_1] == ITEM_BOTTLE)
+ if (items[SLOT_BOTTLE_1] == ITEM_BOTTLE) {
return 1;
- else if (items[SLOT_BOTTLE_2] == ITEM_BOTTLE)
+ } else if (items[SLOT_BOTTLE_2] == ITEM_BOTTLE) {
return 1;
- else if (items[SLOT_BOTTLE_3] == ITEM_BOTTLE)
+ } else if (items[SLOT_BOTTLE_3] == ITEM_BOTTLE) {
return 1;
- else if (items[SLOT_BOTTLE_4] == ITEM_BOTTLE)
+ } else if (items[SLOT_BOTTLE_4] == ITEM_BOTTLE) {
return 1;
- else
+ } else {
return 0;
+ }
}
-s32 Inventory_HasSpecificBottle(u8 bottleItem)
-{
+s32 Inventory_HasSpecificBottle(u8 bottleItem) {
u8* items = gSaveContext.items;
- if (items[SLOT_BOTTLE_1] == bottleItem)
+ if (items[SLOT_BOTTLE_1] == bottleItem) {
return 1;
- else if (items[SLOT_BOTTLE_2] == bottleItem)
+ } else if (items[SLOT_BOTTLE_2] == bottleItem) {
return 1;
- else if (items[SLOT_BOTTLE_3] == bottleItem)
+ } else if (items[SLOT_BOTTLE_3] == bottleItem) {
return 1;
- else if (items[SLOT_BOTTLE_4] == bottleItem)
+ } else if (items[SLOT_BOTTLE_4] == bottleItem) {
return 1;
- else
+ } else {
return 0;
+ }
}
#ifdef NON_MATCHING
// save context pointer isn't reused after Interface_LoadItemIcon1 when it should be
-void Inventory_UpdateBottleItem(GlobalContext* globalCtx, u8 item, u8 cButton)
-{
- osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n",
- item, cButton, gSaveContext.equips.c_button_slots[cButton-1],
- gSaveContext.items[gSaveContext.equips.c_button_slots[cButton-1]]);
+void Inventory_UpdateBottleItem(GlobalContext* globalCtx, u8 item, u8 cButton) {
+ osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, cButton,
+ gSaveContext.equips.c_button_slots[cButton - 1],
+ gSaveContext.items[gSaveContext.equips.c_button_slots[cButton - 1]]);
// Special case to only empty half of a Lon Lon Milk Bottle
- if ((gSaveContext.items[gSaveContext.equips.c_button_slots[cButton-1]] == ITEM_MILK_BOTTLE) && (item == ITEM_BOTTLE))
+ if ((gSaveContext.items[gSaveContext.equips.c_button_slots[cButton - 1]] == ITEM_MILK_BOTTLE) &&
+ (item == ITEM_BOTTLE))
item = ITEM_MILK_HALF;
- gSaveContext.items[gSaveContext.equips.c_button_slots[cButton-1]] = item;
+ gSaveContext.items[gSaveContext.equips.c_button_slots[cButton - 1]] = item;
gSaveContext.equips.button_items[cButton] = item;
- if (1) ; // Improves codegen but may not be necessary
+ if (1) {} // Improves codegen but may not be necessary
Interface_LoadItemIcon1(globalCtx, cButton);
@@ -2331,25 +2009,20 @@ void Inventory_UpdateBottleItem(GlobalContext* globalCtx, u8 item, u8 cButton)
#ifdef NON_MATCHING
// mostly regalloc, minor ordering, and stack usage differences
-s32 Inventory_ConsumeFairy(GlobalContext* globalCtx)
-{
+s32 Inventory_ConsumeFairy(GlobalContext* globalCtx) {
s32 bottleSlot;
s16 i;
s16 j;
bottleSlot = SLOT(ITEM_FAIRY);
- for (i = 0; i < 4; i++)
- {
- if (gSaveContext.items[bottleSlot + i] == ITEM_FAIRY)
- {
- for (j = 1; j < 4; j++)
- {
- if (gSaveContext.equips.button_items[j] == ITEM_FAIRY)
- {
+ for (i = 0; i < 4; i++) {
+ if (gSaveContext.items[bottleSlot + i] == ITEM_FAIRY) {
+ for (j = 1; j < 4; j++) {
+ if (gSaveContext.equips.button_items[j] == ITEM_FAIRY) {
gSaveContext.equips.button_items[j] = ITEM_BOTTLE;
Interface_LoadItemIcon1(globalCtx, j);
- bottleSlot = gSaveContext.equips.c_button_slots[j-1];
+ bottleSlot = gSaveContext.equips.c_button_slots[j - 1];
break;
}
}
@@ -2366,12 +2039,10 @@ s32 Inventory_ConsumeFairy(GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Inventory_ConsumeFairy.s")
#endif
-void func_80086D5C(s32* buf, u16 size)
-{
+void func_80086D5C(s32* buf, u16 size) {
u16 i;
- for (i = 0; i < size; i++)
- {
+ for (i = 0; i < size; i++) {
buf[i] = 0;
}
}
@@ -2380,8 +2051,7 @@ u32 sDoActionTextures[] = { 0x07000000, 0x07000180 };
#ifdef NON_MATCHING
// 0x80000000 is reused in the 2 *_TO_VIRTUAL macros when it shouldn't
-void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 arg2)
-{
+void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 arg2) {
if (action >= 0x1D)
action = 0x0A;
@@ -2391,16 +2061,13 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 a
if (gSaveContext.language == 2)
action += 0x1D;
- if ((action != 0x0A) && (action != 0x27) && (action != 0x44))
- {
+ if ((action != 0x0A) && (action != 0x27) && (action != 0x44)) {
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, (u32)interfaceCtx->do_actionSegment + (arg2 * 0x180),
- (u32)_do_action_staticSegmentRomStart + (action * 0x180),
- 0x180, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
+ (u32)_do_action_staticSegmentRomStart + (action * 0x180), 0x180, 0,
+ &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2145);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
- }
- else
- {
+ } else {
gSegments[7] = PHYSICAL_TO_VIRTUAL(interfaceCtx->do_actionSegment);
func_80086D5C(SEGMENTED_TO_VIRTUAL(sDoActionTextures[arg2]), 0x180 / 4);
}
@@ -2410,78 +2077,73 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 a
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_LoadActionLabel.s")
#endif
-void Interface_SetDoAction(GlobalContext* globalCtx, u16 action)
-{
+void Interface_SetDoAction(GlobalContext* globalCtx, u16 action) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
PauseContext* pauseCtx = &globalCtx->pauseCtx;
- if (interfaceCtx->unk_1F0 != action)
- {
+ if (interfaceCtx->unk_1F0 != action) {
interfaceCtx->unk_1F0 = action;
interfaceCtx->unk_1EC = 1;
interfaceCtx->unk_1F4 = 0.0f;
Interface_LoadActionLabel(interfaceCtx, action, 1);
- if (pauseCtx->state != 0)
+ if (pauseCtx->state != 0) {
interfaceCtx->unk_1EC = 3;
+ }
}
}
-void Interface_SetNaviCall(GlobalContext* globalCtx, u16 naviCallState)
-{
+void Interface_SetNaviCall(GlobalContext* globalCtx, u16 naviCallState) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
- if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) &&
- !interfaceCtx->naviCalling &&
- (globalCtx->csCtx.state == 0))
- {
+ if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) && !interfaceCtx->naviCalling &&
+ (globalCtx->csCtx.state == 0)) {
// clang-format off
// NOLINTNEXTLINE
if (naviCallState == 0x1E) Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &D_801333D4, 4,
&D_801333E0, &D_801333E0, &D_801333E8);
// clang-format on
- if (naviCallState == 0x1D)
+ if (naviCallState == 0x1D) {
func_800F4524(&D_801333D4, NA_SE_VO_NA_HELLO_2, 32);
+ }
interfaceCtx->naviCalling = 1;
sCUpInvisible = 0;
sCUpTimer = 10;
- }
- else if ((naviCallState == 0x1F) &&
- interfaceCtx->naviCalling)
- {
+ } else if ((naviCallState == 0x1F) && interfaceCtx->naviCalling) {
interfaceCtx->naviCalling = 0;
}
}
-void Interface_LoadActionLabelB(GlobalContext* globalCtx, u16 action)
-{
+void Interface_LoadActionLabelB(GlobalContext* globalCtx, u16 action) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
- if (gSaveContext.language != 0)
+ if (gSaveContext.language != 0) {
action += 0x1D;
+ }
- if (gSaveContext.language == 2)
+ if (gSaveContext.language == 2) {
action += 0x1D;
+ }
interfaceCtx->unk_1FC = action;
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, (u32)interfaceCtx->do_actionSegment + 0x180,
- (u32)_do_action_staticSegmentRomStart + (action * 0x180),
- 0x180, 0, &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228);
+ (u32)_do_action_staticSegmentRomStart + (action * 0x180), 0x180, 0, &interfaceCtx->loadQueue,
+ NULL, "../z_parameter.c", 2228);
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
interfaceCtx->unk_1FA = 1;
}
-s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange)
-{
+s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) {
u16 heartCount;
u16 healthLevel;
// Translates to: "***** Fluctuation=%d (now=%d, max=%d) ***"
- osSyncPrintf("***** 増減=%d (now=%d, max=%d) ***", healthChange, gSaveContext.health, gSaveContext.health_capacity);
+ osSyncPrintf("***** 増減=%d (now=%d, max=%d) ***", healthChange, gSaveContext.health,
+ gSaveContext.health_capacity);
// clang-format off
// NOLINTNEXTLINE
@@ -2496,107 +2158,95 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange)
gSaveContext.health += healthChange;
- if (gSaveContext.health > gSaveContext.health_capacity)
+ if (gSaveContext.health > gSaveContext.health_capacity) {
gSaveContext.health = gSaveContext.health_capacity;
+ }
heartCount = gSaveContext.health % 0x10;
healthLevel = heartCount;
- if (heartCount != 0)
- {
- if (heartCount > 10)
+ if (heartCount != 0) {
+ if (heartCount > 10) {
healthLevel = 3;
- else if (heartCount > 5)
+ } else if (heartCount > 5) {
healthLevel = 2;
- else
+ } else {
healthLevel = 1;
+ }
}
// Translates to: "Life=%d *** %d ******"
osSyncPrintf(" ライフ=%d *** %d ******\n", gSaveContext.health, healthLevel);
- if (gSaveContext.health <= 0)
- {
+ if (gSaveContext.health <= 0) {
gSaveContext.health = 0;
return 0;
- }
- else
- {
+ } else {
return 1;
}
}
-void Health_GiveHearts(s16 hearts)
-{
+void Health_GiveHearts(s16 hearts) {
gSaveContext.health_capacity += hearts * 0x10;
}
-void Rupees_ChangeBy(s16 rupeeChange)
-{
+void Rupees_ChangeBy(s16 rupeeChange) {
gSaveContext.rupee_accumulator += rupeeChange;
}
-void Inventory_ChangeAmmo(s16 item, s16 ammoChange)
-{
+void Inventory_ChangeAmmo(s16 item, s16 ammoChange) {
// Translates to: "Item = (%d) Amount = (%d + %d)"
osSyncPrintf("アイテム = (%d) 数 = (%d + %d) ", item, AMMO(item), ammoChange);
- if (item == ITEM_STICK)
- {
+ if (item == ITEM_STICK) {
AMMO(ITEM_STICK) += ammoChange;
- if (AMMO(ITEM_STICK) >= CUR_CAPACITY(UPG_STICKS))
+ if (AMMO(ITEM_STICK) >= CUR_CAPACITY(UPG_STICKS)) {
AMMO(ITEM_STICK) = CUR_CAPACITY(UPG_STICKS);
- else if (AMMO(ITEM_STICK) < 0)
+ } else if (AMMO(ITEM_STICK) < 0) {
AMMO(ITEM_STICK) = 0;
- }
- else if (item == ITEM_NUT)
- {
+ }
+ } else if (item == ITEM_NUT) {
AMMO(ITEM_NUT) += ammoChange;
- if (AMMO(ITEM_NUT) >= CUR_CAPACITY(UPG_NUTS))
+ if (AMMO(ITEM_NUT) >= CUR_CAPACITY(UPG_NUTS)) {
AMMO(ITEM_NUT) = CUR_CAPACITY(UPG_NUTS);
- else if (AMMO(ITEM_NUT) < 0)
+ } else if (AMMO(ITEM_NUT) < 0) {
AMMO(ITEM_NUT) = 0;
- }
- else if (item == ITEM_BOMBCHU)
- {
+ }
+ } else if (item == ITEM_BOMBCHU) {
AMMO(ITEM_BOMBCHU) += ammoChange;
- if (AMMO(ITEM_BOMBCHU) >= 50)
+ if (AMMO(ITEM_BOMBCHU) >= 50) {
AMMO(ITEM_BOMBCHU) = 50;
- else if (AMMO(ITEM_BOMBCHU) < 0)
+ } else if (AMMO(ITEM_BOMBCHU) < 0) {
AMMO(ITEM_BOMBCHU) = 0;
- }
- else if (item == ITEM_BOW)
- {
+ }
+ } else if (item == ITEM_BOW) {
AMMO(ITEM_BOW) += ammoChange;
- if (AMMO(ITEM_BOW) >= CUR_CAPACITY(UPG_QUIVER))
+ if (AMMO(ITEM_BOW) >= CUR_CAPACITY(UPG_QUIVER)) {
AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER);
- else if (AMMO(ITEM_BOW) < 0)
+ } else if (AMMO(ITEM_BOW) < 0) {
AMMO(ITEM_BOW) = 0;
- }
- else if ((item == ITEM_SLINGSHOT) || (item == ITEM_SEEDS))
- {
+ }
+ } else if ((item == ITEM_SLINGSHOT) || (item == ITEM_SEEDS)) {
AMMO(ITEM_SLINGSHOT) += ammoChange;
- if (AMMO(ITEM_SLINGSHOT) >= CUR_CAPACITY(UPG_BULLET_BAG))
+ if (AMMO(ITEM_SLINGSHOT) >= CUR_CAPACITY(UPG_BULLET_BAG)) {
AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG);
- else if (AMMO(ITEM_SLINGSHOT) < 0)
+ } else if (AMMO(ITEM_SLINGSHOT) < 0) {
AMMO(ITEM_SLINGSHOT) = 0;
- }
- else if (item == ITEM_BOMB)
- {
+ }
+ } else if (item == ITEM_BOMB) {
AMMO(ITEM_BOMB) += ammoChange;
- if (AMMO(ITEM_BOMB) >= CUR_CAPACITY(UPG_BOMB_BAG))
+ if (AMMO(ITEM_BOMB) >= CUR_CAPACITY(UPG_BOMB_BAG)) {
AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG);
- else if (AMMO(ITEM_BOMB) < 0)
+ } else if (AMMO(ITEM_BOMB) < 0) {
AMMO(ITEM_BOMB) = 0;
- }
- else if (item == ITEM_BEAN)
- {
+ }
+ } else if (item == ITEM_BEAN) {
AMMO(ITEM_BEAN) += ammoChange;
}
@@ -2604,109 +2254,96 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange)
osSyncPrintf("合計 = (%d)\n", AMMO(item));
}
-void func_80087680(GlobalContext* globalCtx)
-{
- if (gSaveContext.magic_acquired)
- {
+void func_80087680(GlobalContext* globalCtx) {
+ if (gSaveContext.magic_acquired) {
gSaveContext.unk_13F2 = gSaveContext.unk_13F0;
gSaveContext.unk_13F6 = (gSaveContext.double_magic * 0x30) + 0x30;
gSaveContext.unk_13F0 = 9;
}
}
-void func_800876C8(GlobalContext* globalCtx)
-{
- if ((gSaveContext.unk_13F0 != 8) && (gSaveContext.unk_13F0 != 9))
- {
- if (gSaveContext.unk_13F0 == 10)
+void func_800876C8(GlobalContext* globalCtx) {
+ if ((gSaveContext.unk_13F0 != 8) && (gSaveContext.unk_13F0 != 9)) {
+ if (gSaveContext.unk_13F0 == 10) {
gSaveContext.unk_13F2 = gSaveContext.unk_13F0;
+ }
gSaveContext.unk_13F0 = 5;
}
}
-s32 func_80087708(GlobalContext* globalCtx, s16 arg1, s16 arg2)
-{
- if (!gSaveContext.magic_acquired)
+s32 func_80087708(GlobalContext* globalCtx, s16 arg1, s16 arg2) {
+ if (!gSaveContext.magic_acquired) {
return 0;
+ }
- if ((arg2 != 5) && (gSaveContext.magic - arg1) < 0)
- {
- if (gSaveContext.unk_13F4 != 0)
+ if ((arg2 != 5) && (gSaveContext.magic - arg1) < 0) {
+ if (gSaveContext.unk_13F4 != 0) {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
+ }
return 0;
}
- switch (arg2)
- {
+ switch (arg2) {
case 0:
case 2:
- if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7))
- {
- if (gSaveContext.unk_13F0 == 7)
+ if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) {
+ if (gSaveContext.unk_13F0 == 7) {
globalCtx->actorCtx.unk_03 = 0;
+ }
gSaveContext.unk_13F8 = gSaveContext.magic - arg1;
gSaveContext.unk_13F0 = 1;
return 1;
- }
- else
- {
+ } else {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
return 0;
}
case 1:
- if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7))
- {
- if (gSaveContext.unk_13F0 == 7)
+ if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) {
+ if (gSaveContext.unk_13F0 == 7) {
globalCtx->actorCtx.unk_03 = 0;
+ }
gSaveContext.unk_13F8 = gSaveContext.magic - arg1;
gSaveContext.unk_13F0 = 6;
return 1;
- }
- else
- {
+ } else {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
return 0;
}
case 3:
- if (gSaveContext.unk_13F0 == 0)
- {
- if (gSaveContext.magic != 0)
- {
+ if (gSaveContext.unk_13F0 == 0) {
+ if (gSaveContext.magic != 0) {
globalCtx->interfaceCtx.unk_230 = 80;
gSaveContext.unk_13F0 = 7;
return 1;
- }
- else
+ } else {
return 0;
- }
- else
- {
- if (gSaveContext.unk_13F0 == 7)
+ }
+ } else {
+ if (gSaveContext.unk_13F0 == 7) {
return 1;
- else
+ } else {
return 0;
+ }
}
case 4:
- if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7))
- {
- if (gSaveContext.unk_13F0 == 7)
+ if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) {
+ if (gSaveContext.unk_13F0 == 7) {
globalCtx->actorCtx.unk_03 = 0;
+ }
gSaveContext.unk_13F8 = gSaveContext.magic - arg1;
gSaveContext.unk_13F0 = 4;
return 1;
- }
- else
- {
+ } else {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
return 0;
}
case 5:
- if (gSaveContext.unk_13F4 >= gSaveContext.magic)
- {
+ if (gSaveContext.unk_13F4 >= gSaveContext.magic) {
gSaveContext.unk_13F8 = gSaveContext.magic + arg1;
- if (gSaveContext.unk_13F8 >= gSaveContext.unk_13F4)
+ if (gSaveContext.unk_13F8 >= gSaveContext.unk_13F4) {
gSaveContext.unk_13F8 = gSaveContext.unk_13F4;
+ }
gSaveContext.unk_13F0 = 10;
return 1;
@@ -2719,10 +2356,8 @@ s32 func_80087708(GlobalContext* globalCtx, s16 arg1, s16 arg2)
#ifdef NON_MATCHING
// this function still needs some work
-void Interface_UpdateMagicBar(GlobalContext* globalCtx)
-{
- static s16 sMagicBorderColors[][3] =
- {
+void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
+ static s16 sMagicBorderColors[][3] = {
{ 0xFF, 0xFF, 0xFF },
{ 0x96, 0x96, 0x96 },
{ 0xFF, 0xFF, 0x96 },
@@ -2734,27 +2369,20 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx)
s16* color;
s16 maxMagic;
- switch (gSaveContext.unk_13F0)
- {
+ switch (gSaveContext.unk_13F0) {
case 8:
maxMagic = gSaveContext.magic_level * 0x30;
- if (gSaveContext.unk_13F4 != maxMagic)
- {
- if (gSaveContext.unk_13F4 < maxMagic)
- {
+ if (gSaveContext.unk_13F4 != maxMagic) {
+ if (gSaveContext.unk_13F4 < maxMagic) {
gSaveContext.unk_13F4 += 8;
if (gSaveContext.unk_13F4 > maxMagic)
gSaveContext.unk_13F4 = maxMagic;
- }
- else
- {
+ } else {
gSaveContext.unk_13F4 -= 8;
if (gSaveContext.unk_13F4 <= maxMagic)
gSaveContext.unk_13F4 = maxMagic;
}
- }
- else
- {
+ } else {
gSaveContext.unk_13F0 = 9;
}
break;
@@ -2766,8 +2394,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx)
// Translates to: "Storage MAGIC_NOW=%d (%d)"
osSyncPrintf("蓄電 MAGIC_NOW=%d (%d)\n", gSaveContext.magic, gSaveContext.unk_13F6);
- if (gSaveContext.magic >= gSaveContext.unk_13F6)
- {
+ if (gSaveContext.magic >= gSaveContext.unk_13F6) {
gSaveContext.magic = gSaveContext.unk_13F6;
gSaveContext.unk_13F0 = gSaveContext.unk_13F2;
gSaveContext.unk_13F2 = 0;
@@ -2779,16 +2406,13 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx)
break;
case 2:
gSaveContext.magic -= 2;
- if (gSaveContext.magic <= 0)
- {
+ if (gSaveContext.magic <= 0) {
gSaveContext.magic = 0;
gSaveContext.unk_13F0 = 3;
sMagicBorderB = 0xFF;
sMagicBorderG = 0xFF;
sMagicBorderR = 0xFF;
- }
- else if (gSaveContext.magic == gSaveContext.unk_13F8)
- {
+ } else if (gSaveContext.magic == gSaveContext.unk_13F8) {
gSaveContext.unk_13F0 = 3;
sMagicBorderB = 0xFF;
sMagicBorderG = 0xFF;
@@ -2815,8 +2439,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx)
sMagicBorderB += ABS(sMagicBorderB - color[2]) / sMagicBorderRatio;
sMagicBorderRatio--;
- if (sMagicBorderRatio == 0)
- {
+ if (sMagicBorderRatio == 0) {
sMagicBorderR = color[0];
sMagicBorderG = color[1];
sMagicBorderB = color[2];
@@ -2833,32 +2456,24 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx)
gSaveContext.unk_13F0 = 0;
break;
case 7:
- if ((globalCtx->pauseCtx.state == 0) &&
- (globalCtx->pauseCtx.flag == 0) &&
- (globalCtx->msgCtx.msgMode == 0) &&
- (globalCtx->unk_10A20 == 0) &&
- (globalCtx->sceneLoadFlag == 0) &&
- (globalCtx->unk_1241B == 0) &&
- (func_800BFC84(globalCtx) == 0))
- {
- if ((gSaveContext.magic == 0) ||
- ((func_8008F2F8(globalCtx) >= 2) &&
- (func_8008F2F8(globalCtx) < 5)) ||
+ if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
+ (globalCtx->msgCtx.msgMode == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->sceneLoadFlag == 0) &&
+ (globalCtx->unk_1241B == 0) && (func_800BFC84(globalCtx) == 0)) {
+ if ((gSaveContext.magic == 0) || ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) ||
((gSaveContext.equips.button_items[1] != ITEM_LENS) &&
(gSaveContext.equips.button_items[2] != ITEM_LENS) &&
(gSaveContext.equips.button_items[3] != ITEM_LENS)) ||
- (globalCtx->actorCtx.unk_03 == 0))
- {
+ (globalCtx->actorCtx.unk_03 == 0)) {
globalCtx->actorCtx.unk_03 = 0;
- Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
+ Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &D_801333D4, 4, &D_801333E0, &D_801333E0,
+ &D_801333E8);
gSaveContext.unk_13F0 = 0;
sMagicBorderR = sMagicBorderG = sMagicBorderB = 0xFF;
break;
}
globalCtx->interfaceCtx.unk_230--;
- if (globalCtx->interfaceCtx.unk_230 == 0)
- {
+ if (globalCtx->interfaceCtx.unk_230 == 0) {
gSaveContext.magic--;
globalCtx->interfaceCtx.unk_230 = 80;
}
@@ -2882,8 +2497,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx)
sMagicBorderB += ABS(sMagicBorderB - color[2]) / sMagicBorderRatio;
sMagicBorderRatio--;
- if (sMagicBorderRatio == 0)
- {
+ if (sMagicBorderRatio == 0) {
sMagicBorderR = color[0];
sMagicBorderG = color[1];
sMagicBorderB = color[2];
@@ -2896,8 +2510,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx)
case 10:
gSaveContext.magic += 4;
Audio_PlaySoundGeneral(0x401F, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- if (gSaveContext.magic >= gSaveContext.unk_13F8)
- {
+ if (gSaveContext.magic >= gSaveContext.unk_13F8) {
gSaveContext.magic = gSaveContext.unk_13F8;
gSaveContext.unk_13F0 = gSaveContext.unk_13F2;
gSaveContext.unk_13F2 = 0;
@@ -2909,8 +2522,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx)
}
}
#else
-s16 sMagicBorderColors[][3] =
-{
+s16 sMagicBorderColors[][3] = {
{ 0xFF, 0xFF, 0xFF },
{ 0x96, 0x96, 0x96 },
{ 0xFF, 0xFF, 0x96 },
@@ -2923,8 +2535,7 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_UpdateMagicBar.s")
#endif
-void Interface_DrawMagicBar(GlobalContext* globalCtx)
-{
+void Interface_DrawMagicBar(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
s16 magicBarY;
GraphicsContext* gfxCtx;
@@ -2933,180 +2544,131 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx)
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 2650);
- if (gSaveContext.magic_level != 0)
- {
- if (gSaveContext.health_capacity > 0xA0)
+ if (gSaveContext.magic_level != 0) {
+ if (gSaveContext.health_capacity > 0xA0) {
magicBarY = R_MAGIC_BAR_LARGE_Y;
- else
+ } else {
magicBarY = R_MAGIC_BAR_SMALL_Y;
+ }
func_80094520(globalCtx->state.gfxCtx);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, sMagicBorderR, sMagicBorderG, sMagicBorderB, interfaceCtx->magicAlpha);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, sMagicBorderR, sMagicBorderG, sMagicBorderB,
+ interfaceCtx->magicAlpha);
gDPSetEnvColor(gfxCtx->overlay.p++, 0x64, 0x32, 0x32, 0xFF);
- gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p,
- D_020038C0,
- 8, 16,
- R_MAGIC_BAR_X, magicBarY,
- 8, 16,
- 1024, 1024);
+ gfxCtx->overlay.p =
+ Draw_TextureIA8(gfxCtx->overlay.p, D_020038C0, 8, 16, R_MAGIC_BAR_X, magicBarY, 8, 16, 1024, 1024);
- gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p,
- D_02003940,
- 24, 16,
- R_MAGIC_BAR_X + 8, magicBarY,
- gSaveContext.unk_13F4, 16,
- 1024, 1024);
+ gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, D_02003940, 24, 16, R_MAGIC_BAR_X + 8, magicBarY,
+ gSaveContext.unk_13F4, 16, 1024, 1024);
gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, D_020038C0);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b,
- 0, 0, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_MIRROR | G_TX_WRAP, 3, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMASK, G_TX_NOLOD, G_TX_MIRROR | G_TX_WRAP, 3, G_TX_NOLOD);
gDPLoadSync(gfxCtx->overlay.p++);
gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 63, 2048);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_8b,
- 1, 0, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_MIRROR | G_TX_WRAP, 3, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_8b, 1, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMASK, G_TX_NOLOD, G_TX_MIRROR | G_TX_WRAP, 3, G_TX_NOLOD);
gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 28, 60);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- ((R_MAGIC_BAR_X + gSaveContext.unk_13F4) + 8) << 2, magicBarY << 2,
- ((R_MAGIC_BAR_X + gSaveContext.unk_13F4) + 16) << 2, (magicBarY + 16) << 2,
- G_TX_RENDERTILE,
- 256, 0,
- 1024, 1024);
+ gSPTextureRectangle(gfxCtx->overlay.p++, ((R_MAGIC_BAR_X + gSaveContext.unk_13F4) + 8) << 2, magicBarY << 2,
+ ((R_MAGIC_BAR_X + gSaveContext.unk_13F4) + 16) << 2, (magicBarY + 16) << 2, G_TX_RENDERTILE,
+ 256, 0, 1024, 1024);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE,
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE);
gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0xFF);
- if (gSaveContext.unk_13F0 == 4)
- {
+ if (gSaveContext.unk_13F0 == 4) {
// Yellow part of the bar being used when casting a spell
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFA, 0xFA, 0x00, interfaceCtx->magicAlpha);
- gDPLoadMultiBlock_4b(gfxCtx->overlay.p++,
- D_02003AC0,
- 0,
- G_TX_RENDERTILE,
- G_IM_FMT_I,
- 16, 16,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
+ gDPLoadMultiBlock_4b(gfxCtx->overlay.p++, D_02003AC0, 0, G_TX_RENDERTILE, G_IM_FMT_I, 16, 16, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2,
- (R_MAGIC_FILL_X + gSaveContext.magic) << 2, (magicBarY + 10) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- 1024, 1024);
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2,
+ (R_MAGIC_FILL_X + gSaveContext.magic) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, 0,
+ 0, 1024, 1024);
// Fill the rest of the bar with the normal magic color
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1),
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1),
R_MAGIC_FILL_COLOR(2), interfaceCtx->magicAlpha);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2,
- (R_MAGIC_FILL_X + gSaveContext.unk_13F8) << 2, (magicBarY + 10) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- 1024, 1024);
- }
- else
- {
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2,
+ (R_MAGIC_FILL_X + gSaveContext.unk_13F8) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE,
+ 0, 0, 1024, 1024);
+ } else {
// Fill the whole bar with the normal magic color
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1),
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1),
R_MAGIC_FILL_COLOR(2), interfaceCtx->magicAlpha);
- gDPLoadMultiBlock_4b(gfxCtx->overlay.p++,
- D_02003AC0,
- 0,
- G_TX_RENDERTILE,
- G_IM_FMT_I,
- 16, 16,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
+ gDPLoadMultiBlock_4b(gfxCtx->overlay.p++, D_02003AC0, 0, G_TX_RENDERTILE, G_IM_FMT_I, 16, 16, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2,
- (R_MAGIC_FILL_X + gSaveContext.magic) << 2, (magicBarY + 10) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- 1024, 1024);
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_MAGIC_FILL_X << 2, (magicBarY + 3) << 2,
+ (R_MAGIC_FILL_X + gSaveContext.magic) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, 0,
+ 0, 1024, 1024);
}
}
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 2731);
}
-void func_80088AA0(s16 arg0)
-{
+void func_80088AA0(s16 arg0) {
gSaveContext.timer_x[1] = 140;
gSaveContext.timer_y[1] = 80;
D_80125A5C = 0;
gSaveContext.timer_2_value = arg0;
- if (arg0 != 0)
+ if (arg0 != 0) {
gSaveContext.timer_2_state = 1;
- else
+ } else {
gSaveContext.timer_2_state = 7;
+ }
}
-void func_80088AF0(GlobalContext* globalCtx)
-{
- if (gSaveContext.timer_2_state != 0)
- {
- if (gSaveContext.event_inf[1] & 1)
+void func_80088AF0(GlobalContext* globalCtx) {
+ if (gSaveContext.timer_2_state != 0) {
+ if (gSaveContext.event_inf[1] & 1) {
gSaveContext.timer_2_value = 239;
- else
+ } else {
gSaveContext.timer_2_value = 1;
+ }
}
}
-void func_80088B34(s16 arg0)
-{
+void func_80088B34(s16 arg0) {
gSaveContext.timer_x[0] = 140;
gSaveContext.timer_y[0] = 80;
D_80125A5C = 0;
gSaveContext.timer_1_value = arg0;
- if (arg0 != 0)
+ if (arg0 != 0) {
gSaveContext.timer_1_state = 5;
- else
+ } else {
gSaveContext.timer_1_state = 11;
+ }
}
-void Interface_DrawActionLabel(GraphicsContext* gfxCtx, void* texture)
-{
+void Interface_DrawActionLabel(GraphicsContext* gfxCtx, void* texture) {
Gfx* gfxArr[5];
func_800C6AC4(gfxArr, gfxCtx, "../z_parameter.c", 2820);
gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, texture);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b,
- 0, 0, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gfxCtx->overlay.p++);
gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 191, 683);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b,
- 3, 0, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, 3, 0, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 188, 60);
gSP1Quadrangle(gfxCtx->overlay.p++, 0, 2, 3, 1, 0);
@@ -3120,8 +2682,7 @@ s16 sStartButtonLeftPos[] = { 132, 130, 130 };
#ifdef NON_MATCHING
// regalloc and ordering differences
-void Interface_DrawItemButtons(GlobalContext* globalCtx)
-{
+void Interface_DrawItemButtons(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
Player* player = PLAYER;
f32 temp;
@@ -3138,169 +2699,117 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx)
// B Button Color & Texture
// Also loads the Item Button Texture reused by other buttons afterwards
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_B_BTN_COLOR(0), R_B_BTN_COLOR(1),
- R_B_BTN_COLOR(2), interfaceCtx->bAlpha);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0,
+ TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_B_BTN_COLOR(0), R_B_BTN_COLOR(1), R_B_BTN_COLOR(2),
+ interfaceCtx->bAlpha);
gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0xFF);
- gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p,
- &D_02000A00[0],
- 32, 32,
- R_ITEM_BTN_X(0), R_ITEM_BTN_Y(0),
- R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_WIDTH(0),
- R_ITEM_BTN_DD(0) * 2, R_ITEM_BTN_DD(0) * 2);
+ gfxCtx->overlay.p =
+ Draw_TextureIA8(gfxCtx->overlay.p, &D_02000A00[0], 32, 32, R_ITEM_BTN_X(0), R_ITEM_BTN_Y(0),
+ R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_DD(0) * 2, R_ITEM_BTN_DD(0) * 2);
// C-Left Button Color & Texture
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_C_BTN_COLOR(0), R_C_BTN_COLOR(1),
- R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_ITEM_BTN_X(1) << 2,
- R_ITEM_BTN_Y(1) << 2,
- (R_ITEM_BTN_X(1) + R_ITEM_BTN_WIDTH(1)) << 2,
- (R_ITEM_BTN_Y(1) + R_ITEM_BTN_WIDTH(1)) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- R_ITEM_BTN_DD(1) * 2,
- R_ITEM_BTN_DD(1) * 2);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2),
+ interfaceCtx->cLeftAlpha);
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_ITEM_BTN_X(1) << 2, R_ITEM_BTN_Y(1) << 2,
+ (R_ITEM_BTN_X(1) + R_ITEM_BTN_WIDTH(1)) << 2, (R_ITEM_BTN_Y(1) + R_ITEM_BTN_WIDTH(1)) << 2,
+ G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(1) * 2, R_ITEM_BTN_DD(1) * 2);
// C-Down Button Color & Texture
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_C_BTN_COLOR(0), R_C_BTN_COLOR(1),
- R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_ITEM_BTN_X(2) << 2,
- R_ITEM_BTN_Y(2) << 2,
- (R_ITEM_BTN_X(2) + R_ITEM_BTN_WIDTH(2)) << 2,
- (R_ITEM_BTN_Y(2) + R_ITEM_BTN_WIDTH(2)) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- R_ITEM_BTN_DD(2) * 2,
- R_ITEM_BTN_DD(2) * 2);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2),
+ interfaceCtx->cDownAlpha);
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_ITEM_BTN_X(2) << 2, R_ITEM_BTN_Y(2) << 2,
+ (R_ITEM_BTN_X(2) + R_ITEM_BTN_WIDTH(2)) << 2, (R_ITEM_BTN_Y(2) + R_ITEM_BTN_WIDTH(2)) << 2,
+ G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(2) * 2, R_ITEM_BTN_DD(2) * 2);
// C-Right Button Color & Texture
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_C_BTN_COLOR(0), R_C_BTN_COLOR(1),
- R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_ITEM_BTN_X(3) << 2,
- R_ITEM_BTN_Y(3) << 2,
- (R_ITEM_BTN_X(3) + R_ITEM_BTN_WIDTH(3)) << 2,
- (R_ITEM_BTN_Y(3) + R_ITEM_BTN_WIDTH(3)) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- R_ITEM_BTN_DD(3) * 2,
- R_ITEM_BTN_DD(3) * 2);
-
- if ((globalCtx->pauseCtx.state < 8) || (globalCtx->pauseCtx.state >= 18))
- {
- if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0))
- {
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2),
+ interfaceCtx->cRightAlpha);
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_ITEM_BTN_X(3) << 2, R_ITEM_BTN_Y(3) << 2,
+ (R_ITEM_BTN_X(3) + R_ITEM_BTN_WIDTH(3)) << 2, (R_ITEM_BTN_Y(3) + R_ITEM_BTN_WIDTH(3)) << 2,
+ G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) * 2, R_ITEM_BTN_DD(3) * 2);
+
+ if ((globalCtx->pauseCtx.state < 8) || (globalCtx->pauseCtx.state >= 18)) {
+ if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.flag != 0)) {
// Start Button Texture, Color & Label
gDPPipeSync(gfxCtx->overlay.p++);
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x78, 0x78, 0x78, interfaceCtx->startAlpha);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- sStartButtonLeftPos[gSaveContext.language] << 2, 156,
- (sStartButtonLeftPos[gSaveContext.language] + 22) << 2, 68,
- G_TX_RENDERTILE,
- 0, 0,
- 1462, 1462);
+ gSPTextureRectangle(gfxCtx->overlay.p++, sStartButtonLeftPos[gSaveContext.language] << 2, 156,
+ (sStartButtonLeftPos[gSaveContext.language] + 22) << 2, 68, G_TX_RENDERTILE, 0, 0, 1462,
+ 1462);
gDPPipeSync(gfxCtx->overlay.p++);
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->startAlpha);
gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0x00);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
-
- gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, (u32)interfaceCtx->do_actionSegment + 0x300);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b,
- 0, 0, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
+ PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
+
+ gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1,
+ (u32)interfaceCtx->do_actionSegment + 0x300);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPLoadSync(gfxCtx->overlay.p++);
gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 191, 683);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b,
- 3, 0, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, 3, 0, G_TX_RENDERTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 48, 16);
temp = R_START_LABEL_DD(gSaveContext.language) / 100.0f;
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_START_LABEL_X(gSaveContext.language) << 2,
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_START_LABEL_X(gSaveContext.language) << 2,
R_START_LABEL_Y(gSaveContext.language) << 2,
(R_START_LABEL_X(gSaveContext.language) + (s16)(16 / temp)) << 2,
- (R_START_LABEL_Y(gSaveContext.language) + (s16)(48 / temp)) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- (s16)(1024 / temp),
- (s16)(1024 / temp));
+ (R_START_LABEL_Y(gSaveContext.language) + (s16)(48 / temp)) << 2, G_TX_RENDERTILE, 0, 0,
+ (s16)(1024 / temp), (s16)(1024 / temp));
}
}
- if (interfaceCtx->naviCalling && (globalCtx->pauseCtx.state == 0) &&
- (globalCtx->pauseCtx.flag == 0) && (globalCtx->csCtx.state == 0))
- {
- if (!sCUpInvisible)
- {
+ if (interfaceCtx->naviCalling && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
+ (globalCtx->csCtx.state == 0)) {
+ if (!sCUpInvisible) {
// C-Up Button Texture, Color & Label (Navi Text)
gDPPipeSync(gfxCtx->overlay.p++);
if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5))
cUpAlpha = 0;
- else if ((player->stateFlags2 & 0x00200000) || (func_8008F2F8(globalCtx) == 4) || (player->stateFlags2 & 0x00040000))
+ else if ((player->stateFlags2 & 0x00200000) || (func_8008F2F8(globalCtx) == 4) ||
+ (player->stateFlags2 & 0x00040000))
cUpAlpha = 0x46;
else
cUpAlpha = interfaceCtx->healthAlpha;
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_C_BTN_COLOR(0), R_C_BTN_COLOR(1),
- R_C_BTN_COLOR(2), cUpAlpha);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_C_UP_BTN_X << 2, R_C_UP_BTN_Y << 2,
- (R_C_UP_BTN_X + 16) << 2, (R_C_UP_BTN_Y + 16) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- 2048, 2048);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), cUpAlpha);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0,
+ PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_C_UP_BTN_X << 2, R_C_UP_BTN_Y << 2, (R_C_UP_BTN_X + 16) << 2,
+ (R_C_UP_BTN_Y + 16) << 2, G_TX_RENDERTILE, 0, 0, 2048, 2048);
gDPPipeSync(gfxCtx->overlay.p++);
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, cUpAlpha);
gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0x00);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
- gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, sCUpLabelTextures[gSaveContext.language]);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b,
- 0, 0, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1,
+ sCUpLabelTextures[gSaveContext.language]);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPLoadSync(gfxCtx->overlay.p++);
gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 63, 1024);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b,
- 2, 0, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, 2, 0, G_TX_RENDERTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 124, 28);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_C_UP_ICON_X << 2, R_C_UP_ICON_Y << 2,
- (R_C_UP_ICON_X + 8) << 2, (R_C_UP_ICON_Y + 32) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- 1024, 1024);
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_C_UP_ICON_X << 2, R_C_UP_ICON_Y << 2, (R_C_UP_ICON_X + 8) << 2,
+ (R_C_UP_ICON_Y + 32) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024);
}
sCUpTimer--;
- if (sCUpTimer == 0)
- {
+ if (sCUpTimer == 0) {
sCUpTimer = 10;
sCUpInvisible ^= 1;
}
@@ -3309,29 +2818,21 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx)
gDPPipeSync(gfxCtx->overlay.p++);
// Empty C Button Arrows
- for (i = 1; i < 4; i++)
- {
- if (gSaveContext.equips.button_items[i] > 0xF0)
- {
+ for (i = 1; i < 4; i++) {
+ if (gSaveContext.equips.button_items[i] > 0xF0) {
if (i == 1)
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_C_BTN_COLOR(0), R_C_BTN_COLOR(1),
- R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2),
+ interfaceCtx->cLeftAlpha);
else if (i == 2)
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_C_BTN_COLOR(0), R_C_BTN_COLOR(1),
- R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2),
+ interfaceCtx->cDownAlpha);
else
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_C_BTN_COLOR(0), R_C_BTN_COLOR(1),
- R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha);
-
- gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p,
- &D_02000A00[i + 1],
- 0x20, 0x20,
- R_ITEM_BTN_X(i), R_ITEM_BTN_Y(i),
- R_ITEM_BTN_WIDTH(i), R_ITEM_BTN_WIDTH(i),
- R_ITEM_BTN_DD(i) * 2, R_ITEM_BTN_DD(i) * 2);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2),
+ interfaceCtx->cRightAlpha);
+
+ gfxCtx->overlay.p =
+ Draw_TextureIA8(gfxCtx->overlay.p, &D_02000A00[i + 1], 0x20, 0x20, R_ITEM_BTN_X(i), R_ITEM_BTN_Y(i),
+ R_ITEM_BTN_WIDTH(i), R_ITEM_BTN_WIDTH(i), R_ITEM_BTN_DD(i) * 2, R_ITEM_BTN_DD(i) * 2);
}
}
@@ -3342,39 +2843,25 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_DrawItemButtons.s")
#endif
-void Interface_DrawItemIconTexture(GlobalContext* globalCtx, void* texture, s16 button)
-{
+void Interface_DrawItemIconTexture(GlobalContext* globalCtx, void* texture, s16 button) {
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 3079);
- gDPLoadTextureBlock(gfxCtx->overlay.p++,
- texture,
- G_IM_FMT_RGBA,
- G_IM_SIZ_32b,
- 32, 32,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
- G_TX_NOLOD, G_TX_NOLOD);
-
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_ITEM_ICON_X(button) << 2,
- R_ITEM_ICON_Y(button) << 2,
+ gDPLoadTextureBlock(gfxCtx->overlay.p++, texture, G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
+
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_ITEM_ICON_X(button) << 2, R_ITEM_ICON_Y(button) << 2,
(R_ITEM_ICON_X(button) + R_ITEM_ICON_WIDTH(button)) << 2,
- (R_ITEM_ICON_Y(button) + R_ITEM_ICON_WIDTH(button)) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- R_ITEM_ICON_DD(button) * 2,
- R_ITEM_ICON_DD(button) * 2);
+ (R_ITEM_ICON_Y(button) + R_ITEM_ICON_WIDTH(button)) << 2, G_TX_RENDERTILE, 0, 0,
+ R_ITEM_ICON_DD(button) * 2, R_ITEM_ICON_DD(button) * 2);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 3094);
}
-void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha)
-{
+void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha) {
s16 item;
s16 ammo;
GraphicsContext* gfxCtx;
@@ -3386,70 +2873,56 @@ void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha)
item = gSaveContext.equips.button_items[button];
- if ((item == ITEM_STICK) || (item == ITEM_NUT) ||
- (item == ITEM_BOMB) || (item == ITEM_BOW) ||
- ((item >= ITEM_BOW_ARROW_FIRE) && (item <= ITEM_BOW_ARROW_LIGHT)) ||
- (item == ITEM_SLINGSHOT) || (item == ITEM_BOMBCHU) || (item == ITEM_BEAN))
- {
- if ((item >= ITEM_BOW_ARROW_FIRE) && (item <= ITEM_BOW_ARROW_LIGHT))
+ if ((item == ITEM_STICK) || (item == ITEM_NUT) || (item == ITEM_BOMB) || (item == ITEM_BOW) ||
+ ((item >= ITEM_BOW_ARROW_FIRE) && (item <= ITEM_BOW_ARROW_LIGHT)) || (item == ITEM_SLINGSHOT) ||
+ (item == ITEM_BOMBCHU) || (item == ITEM_BEAN)) {
+ if ((item >= ITEM_BOW_ARROW_FIRE) && (item <= ITEM_BOW_ARROW_LIGHT)) {
item = ITEM_BOW;
+ }
ammo = AMMO(item);
gDPPipeSync(gfxCtx->overlay.p++);
- if ((button == 0) && (gSaveContext.minigame_state == 1))
- {
+ if ((button == 0) && (gSaveContext.minigame_state == 1)) {
ammo = globalCtx->interfaceCtx.hbaAmmo;
- }
- else if ((button == 0) && (globalCtx->unk_11E5C >= 2))
- {
+ } else if ((button == 0) && (globalCtx->unk_11E5C >= 2)) {
ammo = globalCtx->unk_11E5C - 1;
- }
- else if ((button == 0) && (globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))
- {
+ } else if ((button == 0) && (globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)) {
ammo = globalCtx->bombchuBowlingAmmo;
- if (ammo < 0)
+ if (ammo < 0) {
ammo = 0;
- }
- else if (((item == ITEM_BOW) && (AMMO(item) == CUR_CAPACITY(UPG_QUIVER))) ||
- ((item == ITEM_BOMB) && (AMMO(item) == CUR_CAPACITY(UPG_BOMB_BAG))) ||
- ((item == ITEM_SLINGSHOT) && (AMMO(item) == CUR_CAPACITY(UPG_BULLET_BAG))) ||
- ((item == ITEM_STICK) && (AMMO(item) == CUR_CAPACITY(UPG_STICKS))) ||
- ((item == ITEM_NUT) && (AMMO(item) == CUR_CAPACITY(UPG_NUTS))) ||
- ((item == ITEM_BOMBCHU) && (ammo == 50)) ||
- ((item == ITEM_BEAN) && (ammo == 15)))
- {
+ }
+ } else if (((item == ITEM_BOW) && (AMMO(item) == CUR_CAPACITY(UPG_QUIVER))) ||
+ ((item == ITEM_BOMB) && (AMMO(item) == CUR_CAPACITY(UPG_BOMB_BAG))) ||
+ ((item == ITEM_SLINGSHOT) && (AMMO(item) == CUR_CAPACITY(UPG_BULLET_BAG))) ||
+ ((item == ITEM_STICK) && (AMMO(item) == CUR_CAPACITY(UPG_STICKS))) ||
+ ((item == ITEM_NUT) && (AMMO(item) == CUR_CAPACITY(UPG_NUTS))) ||
+ ((item == ITEM_BOMBCHU) && (ammo == 50)) || ((item == ITEM_BEAN) && (ammo == 15))) {
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x78, 0xFF, 0x00, alpha);
}
- if (ammo == 0)
+ if (ammo == 0) {
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x64, 0x64, 0x64, alpha);
+ }
- for (i = 0; ammo >= 10; i++)
+ for (i = 0; ammo >= 10; i++) {
ammo -= 10;
+ }
+
+ if (i != 0) {
+ gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, &D_020035C0[i], 8, 8, R_ITEM_AMMO_X(button),
+ R_ITEM_AMMO_Y(button), 8, 8, 1024, 1024);
+ }
- if (i != 0)
- gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p,
- &D_020035C0[i],
- 8, 8,
- R_ITEM_AMMO_X(button), R_ITEM_AMMO_Y(button),
- 8, 8,
- 1024, 1024);
-
- gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p,
- &D_020035C0[ammo],
- 8, 8,
- R_ITEM_AMMO_X(button) + 6, R_ITEM_AMMO_Y(button),
- 8, 8,
- 1024, 1024);
+ gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, &D_020035C0[ammo], 8, 8, R_ITEM_AMMO_X(button) + 6,
+ R_ITEM_AMMO_Y(button), 8, 8, 1024, 1024);
}
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 3158);
}
-void Interface_DrawActionButton(GlobalContext* globalCtx)
-{
+void Interface_DrawActionButton(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3461,33 +2934,28 @@ void Interface_DrawActionButton(GlobalContext* globalCtx)
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
- if (1) ; // Necessary to match
+ if (1) {} // Necessary to match
- gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3177), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3177),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPVertex(gfxCtx->overlay.p++, interfaceCtx->vtx_128, 4, 0);
- gDPLoadTextureBlock(gfxCtx->overlay.p++,
- &D_02000A00[0],
- G_IM_FMT_IA,
- G_IM_SIZ_8b,
- 32, 32,
- 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMASK, G_TX_NOMASK,
- G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock(gfxCtx->overlay.p++, &D_02000A00[0], G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
+ G_TX_NOLOD);
gSP1Quadrangle(gfxCtx->overlay.p++, 0, 2, 3, 1, 0);
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_parameter.c", 3187);
}
-void Interface_InitVertices(GlobalContext* globalCtx)
-{
+void Interface_InitVertices(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
s16 i;
interfaceCtx->vtx_128 = Graph_Alloc(globalCtx->state.gfxCtx, 8 * sizeof(Vtx));
+ // clang-format off
interfaceCtx->vtx_128[0].v.ob[0] =
interfaceCtx->vtx_128[2].v.ob[0] = -14;
interfaceCtx->vtx_128[1].v.ob[0] =
@@ -3508,8 +2976,7 @@ void Interface_InitVertices(GlobalContext* globalCtx)
interfaceCtx->vtx_128[6].v.ob[1] =
interfaceCtx->vtx_128[7].v.ob[1] = interfaceCtx->vtx_128[4].v.ob[1] - XREG(28);
- for (i = 0; i < 8; i += 4)
- {
+ for (i = 0; i < 8; i += 4) {
interfaceCtx->vtx_128[i].v.ob[2] = interfaceCtx->vtx_128[i+1].v.ob[2] =
interfaceCtx->vtx_128[i+2].v.ob[2] = interfaceCtx->vtx_128[i+3].v.ob[2] = 0;
@@ -3561,10 +3028,10 @@ void Interface_InitVertices(GlobalContext* globalCtx)
interfaceCtx->vtx_12C[2].v.cn[2] = interfaceCtx->vtx_12C[3].v.cn[2] =
interfaceCtx->vtx_12C[0].v.cn[3] = interfaceCtx->vtx_12C[1].v.cn[3] =
interfaceCtx->vtx_12C[2].v.cn[3] = interfaceCtx->vtx_12C[3].v.cn[3] = 0xFF;
+ // clang-format on
}
-void func_8008A8B8(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3, s32 arg4)
-{
+void func_8008A8B8(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3, s32 arg4) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
Vec3f sp40;
Vec3f sp34;
@@ -3585,8 +3052,7 @@ void func_8008A8B8(GlobalContext* globalCtx, s32 arg1, s32 arg2, s32 arg3, s32 a
func_800AB560(&interfaceCtx->view);
}
-void func_8008A994(InterfaceContext* interfaceCtx)
-{
+void func_8008A994(InterfaceContext* interfaceCtx) {
s32 sp18[4];
// clang-format off
@@ -3606,13 +3072,8 @@ s16 sTimerDigitLeftPos[] = { 16, 25, 34, 42, 51 };
s16 sDigitWidth[] = { 9, 9, 8, 9, 9 };
// unused, most likely colors
-s16 D_80125B1C[][3] =
-{
- { 0x00, 0x96, 0x00 },
- { 0x64, 0xFF, 0x00 },
- { 0xFF, 0xFF, 0xFF },
- { 0x00, 0x00, 0x00 },
- { 0xFF, 0xFF, 0xFF },
+s16 D_80125B1C[][3] = {
+ { 0x00, 0x96, 0x00 }, { 0x64, 0xFF, 0x00 }, { 0xFF, 0xFF, 0xFF }, { 0x00, 0x00, 0x00 }, { 0xFF, 0xFF, 0xFF },
};
s16 sRupeeDigitsFirst[] = { 1, 0, 0 };
@@ -3620,14 +3081,13 @@ s16 sRupeeDigitsCount[] = { 2, 3, 3 };
s16 sSpoilingItemEntrances[] = { 0x01AD, 0x0153, 0x0153 };
-u16 D_80125B54 = 0xC220; // unused
-u16 D_80125B58 = 0xC20C; // unused
+u16 D_80125B54 = 0xC220; // unused
+u16 D_80125B58 = 0xC20C; // unused
s16 D_80125B5C[] = { 91, 91 }; // unused
#ifdef NON_MATCHING
// mostly regalloc, minor ordering and stack usage differences
-void Interface_Draw(GlobalContext* globalCtx)
-{
+void Interface_Draw(GlobalContext* globalCtx) {
static s16 D_8015FFE0;
static s16 D_8015FFE2;
static s16 D_8015FFE4;
@@ -3655,8 +3115,7 @@ void Interface_Draw(GlobalContext* globalCtx)
gSPSegment(gfxCtx->overlay.p++, 0x08, interfaceCtx->icon_itemSegment);
gSPSegment(gfxCtx->overlay.p++, 0x0B, interfaceCtx->mapSegment);
- if (pauseCtx->flag == 0)
- {
+ if (pauseCtx->flag == 0) {
Interface_InitVertices(globalCtx);
func_8008A994(interfaceCtx);
Interface_DrawHealth(globalCtx);
@@ -3666,15 +3125,9 @@ void Interface_Draw(GlobalContext* globalCtx)
// Rupee Icon
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xC8, 0xFF, 0x64, interfaceCtx->magicAlpha);
gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x50, 0x00, 0xFF);
- gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p,
- D_02001F00,
- 16, 16,
- 26, 206,
- 16, 16,
- 1024, 1024);
-
- switch (globalCtx->sceneNum)
- {
+ gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, D_02001F00, 16, 16, 26, 206, 16, 16, 1024, 1024);
+
+ switch (globalCtx->sceneNum) {
case SCENE_BMORI1:
case SCENE_HIDAN:
case SCENE_MIZUSIN:
@@ -3689,53 +3142,38 @@ void Interface_Draw(GlobalContext* globalCtx)
case SCENE_GANON_SONOGO:
case SCENE_GANONTIKA_SONOGO:
case SCENE_TAKARAYA:
- if (gSaveContext.dungeon_keys[gSaveContext.dungeon_index] >= 0)
- {
+ if (gSaveContext.dungeon_keys[gSaveContext.dungeon_index] >= 0) {
// Small Key Icon
gDPPipeSync(gfxCtx->overlay.p++);
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xC8, 0xE6, 0xFF, interfaceCtx->magicAlpha);
gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x14, 0xFF);
- gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p,
- D_02001E00,
- 16, 16,
- 26, 190,
- 16, 16,
- 1024, 1024);
+ gfxCtx->overlay.p =
+ Draw_TextureIA8(gfxCtx->overlay.p, D_02001E00, 16, 16, 26, 190, 16, 16, 1024, 1024);
// Small Key Counter
gDPPipeSync(gfxCtx->overlay.p++);
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->magicAlpha);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0,
- 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0,
+ PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
interfaceCtx->counterDigits[2] = 0;
interfaceCtx->counterDigits[3] = gSaveContext.dungeon_keys[gSaveContext.dungeon_index];
- while (interfaceCtx->counterDigits[3] >= 10)
- {
+ while (interfaceCtx->counterDigits[3] >= 10) {
interfaceCtx->counterDigits[2]++;
interfaceCtx->counterDigits[3] -= 10;
}
phi_s2 = 42;
- if (interfaceCtx->counterDigits[2] != 0)
- {
- gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p,
- &D_02003040[interfaceCtx->counterDigits[2]],
- 8, 16,
- phi_s2, 190,
- 8, 16,
- 1024, 1024);
+ if (interfaceCtx->counterDigits[2] != 0) {
+ gfxCtx->overlay.p =
+ Draw_TextureI8(gfxCtx->overlay.p, &D_02003040[interfaceCtx->counterDigits[2]], 8, 16,
+ phi_s2, 190, 8, 16, 1024, 1024);
phi_s2 = 50;
}
- gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p,
- &D_02003040[interfaceCtx->counterDigits[3]],
- 8, 16,
- phi_s2, 190,
- 8, 16,
- 1024, 1024);
+ gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, &D_02003040[interfaceCtx->counterDigits[3]],
+ 8, 16, phi_s2, 190, 8, 16, 1024, 1024);
}
phi_s2 = 42;
@@ -3757,9 +3195,8 @@ void Interface_Draw(GlobalContext* globalCtx)
else
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x64, 0x64, 0x64, interfaceCtx->magicAlpha);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0,
- 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0,
+ 0, PRIMITIVE, 0);
interfaceCtx->counterDigits[0] = interfaceCtx->counterDigits[1] = 0;
interfaceCtx->counterDigits[2] = gSaveContext.rupees;
@@ -3767,14 +3204,12 @@ void Interface_Draw(GlobalContext* globalCtx)
if ((interfaceCtx->counterDigits[2] >= 10000) || (interfaceCtx->counterDigits[2] < 0))
interfaceCtx->counterDigits[2] &= 0xDDD;
- while (interfaceCtx->counterDigits[2] >= 100)
- {
+ while (interfaceCtx->counterDigits[2] >= 100) {
interfaceCtx->counterDigits[2] -= 100;
interfaceCtx->counterDigits[0]++;
}
- while (interfaceCtx->counterDigits[2] >= 10)
- {
+ while (interfaceCtx->counterDigits[2] >= 10) {
interfaceCtx->counterDigits[2] -= 10;
interfaceCtx->counterDigits[1]++;
}
@@ -3782,14 +3217,9 @@ void Interface_Draw(GlobalContext* globalCtx)
phi_s0 = sRupeeDigitsFirst[CUR_UPG_VALUE(UPG_WALLET)];
phi_s1 = sRupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)];
- for (phi_s3 = 0; phi_s3 < phi_s1; phi_s3++, phi_s0++, phi_s2 += 8)
- {
- gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p,
- &D_02003040[interfaceCtx->counterDigits[phi_s0]],
- 8, 16,
- phi_s2, 206,
- 8, 16,
- 1024, 1024);
+ for (phi_s3 = 0; phi_s3 < phi_s1; phi_s3++, phi_s0++, phi_s2 += 8) {
+ gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, &D_02003040[interfaceCtx->counterDigits[phi_s0]], 8,
+ 16, phi_s2, 206, 8, 16, 1024, 1024);
}
Interface_DrawMagicBar(globalCtx);
@@ -3804,138 +3234,113 @@ void Interface_Draw(GlobalContext* globalCtx)
gDPPipeSync(gfxCtx->overlay.p++);
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->bAlpha);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE,
+ 0, TEXEL0, 0, PRIMITIVE, 0);
- if (interfaceCtx->unk_1FA == 0)
- {
+ if (interfaceCtx->unk_1FA == 0) {
// B Button Icon & possibly Ammo Count
- if (gSaveContext.equips.button_items[0] != ITEM_NONE)
- {
+ if (gSaveContext.equips.button_items[0] != ITEM_NONE) {
Interface_DrawItemIconTexture(globalCtx, (void*)(u32)interfaceCtx->icon_itemSegment, 0);
if ((player->stateFlags1 & 0x00800000) || (globalCtx->unk_11E5C >= 2) ||
- ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)))
- {
+ ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) {
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0,
+ PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE,
+ 0);
Interface_DrawAmmoCount(globalCtx, 0, interfaceCtx->bAlpha);
}
}
- }
- else
- {
+ } else {
// B Button Do Action Label
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->bAlpha);
- gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, (u32)interfaceCtx->do_actionSegment + 0x180);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b,
- 0, 0x0000, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1,
+ (u32)interfaceCtx->do_actionSegment + 0x180);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPLoadSync(gfxCtx->overlay.p++);
gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 191, 683);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b,
- 3, 0x0000, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_4b, 3, 0x0000, G_TX_RENDERTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 188, 60);
R_B_LABEL_DD = 1024.0f / (WREG(37 + gSaveContext.language) / 100.0f);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- R_B_LABEL_X(gSaveContext.language) << 2, R_B_LABEL_Y(gSaveContext.language) << 2,
- (R_B_LABEL_X(gSaveContext.language) + 48) << 2, R_B_LABEL_Y(gSaveContext.language) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- R_B_LABEL_DD, R_B_LABEL_DD);
+ gSPTextureRectangle(gfxCtx->overlay.p++, R_B_LABEL_X(gSaveContext.language) << 2,
+ R_B_LABEL_Y(gSaveContext.language) << 2, (R_B_LABEL_X(gSaveContext.language) + 48) << 2,
+ R_B_LABEL_Y(gSaveContext.language) << 2, G_TX_RENDERTILE, 0, 0, R_B_LABEL_DD,
+ R_B_LABEL_DD);
}
gDPPipeSync(gfxCtx->overlay.p++);
// C-Left Button Icon & Ammo Count
- if (gSaveContext.equips.button_items[1] < 0xF0)
- {
+ if (gSaveContext.equips.button_items[1] < 0xF0) {
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->cLeftAlpha);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0,
+ PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x1000), 1);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
+ PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
Interface_DrawAmmoCount(globalCtx, 1, interfaceCtx->cLeftAlpha);
}
gDPPipeSync(gfxCtx->overlay.p++);
// C-Down Button Icon & Ammo Count
- if (gSaveContext.equips.button_items[2] < 0xF0)
- {
+ if (gSaveContext.equips.button_items[2] < 0xF0) {
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->cDownAlpha);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0,
+ PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x2000), 2);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
+ PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
Interface_DrawAmmoCount(globalCtx, 2, interfaceCtx->cDownAlpha);
}
gDPPipeSync(gfxCtx->overlay.p++);
// C-Right Button Icon & Ammo Count
- if (gSaveContext.equips.button_items[3] < 0xF0)
- {
+ if (gSaveContext.equips.button_items[3] < 0xF0) {
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->cRightAlpha);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0,
+ PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
Interface_DrawItemIconTexture(globalCtx, (void*)((u32)interfaceCtx->icon_itemSegment + 0x3000), 3);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
+ PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
Interface_DrawAmmoCount(globalCtx, 3, interfaceCtx->cRightAlpha);
}
// A Button
func_80094A14(globalCtx->state.gfxCtx);
- func_8008A8B8(globalCtx,
- R_A_BTN_Y, R_A_BTN_Y + 45,
- R_A_BTN_X, R_A_BTN_X + 45);
+ func_8008A8B8(globalCtx, R_A_BTN_Y, R_A_BTN_Y + 45, R_A_BTN_X, R_A_BTN_X + 45);
gSPClearGeometryMode(gfxCtx->overlay.p++, G_CULL_BOTH);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- R_A_BTN_COLOR(0), R_A_BTN_COLOR(1),
- R_A_BTN_COLOR(2), interfaceCtx->aAlpha);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE,
+ 0, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, R_A_BTN_COLOR(0), R_A_BTN_COLOR(1), R_A_BTN_COLOR(2),
+ interfaceCtx->aAlpha);
Interface_DrawActionButton(globalCtx);
gDPPipeSync(gfxCtx->overlay.p++);
- func_8008A8B8(globalCtx,
- R_A_ICON_Y, R_A_ICON_Y + 45,
- R_A_ICON_X, R_A_ICON_X + 45);
+ func_8008A8B8(globalCtx, R_A_ICON_Y, R_A_ICON_Y + 45, R_A_ICON_X, R_A_ICON_X + 45);
gSPSetGeometryMode(gfxCtx->overlay.p++, G_CULL_BACK);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
+ gDPSetCombineLERP(gfxCtx->overlay.p++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->aAlpha);
gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0x00);
Matrix_Translate(0.0f, 0.0f, WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW);
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
- gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3701), G_MTX_MODELVIEW | G_MTX_LOAD);
+ gSPMatrix(gfxCtx->overlay.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3701),
+ G_MTX_MODELVIEW | G_MTX_LOAD);
gSPVertex(gfxCtx->overlay.p++, &interfaceCtx->vtx_128[4], 4, 0);
if ((interfaceCtx->unk_1EC < 2) || (interfaceCtx->unk_1EC == 3))
@@ -3947,71 +3352,66 @@ void Interface_Draw(GlobalContext* globalCtx)
func_8008A994(interfaceCtx);
- if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 3))
- {
+ if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 3)) {
// Inventory Equip Effects
gSPSegment(gfxCtx->overlay.p++, 0x08, pauseCtx->unk_128);
func_80094A14(globalCtx->state.gfxCtx);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0,
+ PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
gSPMatrix(gfxCtx->overlay.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
pauseCtx->vtx_168[16].v.ob[0] = pauseCtx->vtx_168[18].v.ob[0] = pauseCtx->unk_254 / 10;
- pauseCtx->vtx_168[17].v.ob[0] = pauseCtx->vtx_168[19].v.ob[0] = pauseCtx->vtx_168[16].v.ob[0] + WREG(90) / 10;
+ pauseCtx->vtx_168[17].v.ob[0] = pauseCtx->vtx_168[19].v.ob[0] =
+ pauseCtx->vtx_168[16].v.ob[0] + WREG(90) / 10;
pauseCtx->vtx_168[16].v.ob[1] = pauseCtx->vtx_168[17].v.ob[1] = pauseCtx->unk_256 / 10;
- pauseCtx->vtx_168[18].v.ob[1] = pauseCtx->vtx_168[19].v.ob[1] = pauseCtx->vtx_168[16].v.ob[1] - WREG(90) / 10;
+ pauseCtx->vtx_168[18].v.ob[1] = pauseCtx->vtx_168[19].v.ob[1] =
+ pauseCtx->vtx_168[16].v.ob[1] - WREG(90) / 10;
- if (pauseCtx->unk_24E < 0xBF)
- {
+ if (pauseCtx->unk_24E < 0xBF) {
// Normal Equip (icon goes from the inventory slot to the C button when equipping it)
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, pauseCtx->unk_258);
gSPVertex(gfxCtx->overlay.p++, &pauseCtx->vtx_168[16], 4, 0);
gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 1, gItemIcons[pauseCtx->unk_24E]);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b,
- 0, 0x0000, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0, 0x0000, G_TX_LOADTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPLoadSync(gfxCtx->overlay.p++);
gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 1023, 128);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b,
- 8, 0x0000, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 8, 0x0000, G_TX_RENDERTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 124, 124);
- }
- else
- {
+ } else {
// Magic Arrow Equip Effect
phi_s3_2 = pauseCtx->unk_24E - 0xBF;
- gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0,
- sMagicArrowEffectsR[phi_s3_2], sMagicArrowEffectsG[phi_s3_2],
+ gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, sMagicArrowEffectsR[phi_s3_2], sMagicArrowEffectsG[phi_s3_2],
sMagicArrowEffectsB[phi_s3_2], pauseCtx->unk_258);
- if ((pauseCtx->unk_258 > 0) && (pauseCtx->unk_258 < 0xFF))
- {
+ if ((pauseCtx->unk_258 > 0) && (pauseCtx->unk_258 < 0xFF)) {
phi_s3_2 = (pauseCtx->unk_258 / 8) / 2;
- pauseCtx->vtx_168[16].v.ob[0] = pauseCtx->vtx_168[18].v.ob[0] = pauseCtx->vtx_168[16].v.ob[0] - phi_s3_2;
- pauseCtx->vtx_168[17].v.ob[0] = pauseCtx->vtx_168[19].v.ob[0] = pauseCtx->vtx_168[16].v.ob[0] + phi_s3_2 * 2 + 32;
- pauseCtx->vtx_168[16].v.ob[1] = pauseCtx->vtx_168[17].v.ob[1] = pauseCtx->vtx_168[16].v.ob[1] + phi_s3_2;
- pauseCtx->vtx_168[18].v.ob[1] = pauseCtx->vtx_168[19].v.ob[1] = pauseCtx->vtx_168[16].v.ob[1] - phi_s3_2 * 2 - 32;
+ pauseCtx->vtx_168[16].v.ob[0] = pauseCtx->vtx_168[18].v.ob[0] =
+ pauseCtx->vtx_168[16].v.ob[0] - phi_s3_2;
+ pauseCtx->vtx_168[17].v.ob[0] = pauseCtx->vtx_168[19].v.ob[0] =
+ pauseCtx->vtx_168[16].v.ob[0] + phi_s3_2 * 2 + 32;
+ pauseCtx->vtx_168[16].v.ob[1] = pauseCtx->vtx_168[17].v.ob[1] =
+ pauseCtx->vtx_168[16].v.ob[1] + phi_s3_2;
+ pauseCtx->vtx_168[18].v.ob[1] = pauseCtx->vtx_168[19].v.ob[1] =
+ pauseCtx->vtx_168[16].v.ob[1] - phi_s3_2 * 2 - 32;
}
gSPVertex(gfxCtx->overlay.p++, &pauseCtx->vtx_168[16], 4, 0);
gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, D_080895C0);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b,
- 0, 0x0000, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPLoadSync(gfxCtx->overlay.p++);
gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 511, 512);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_8b,
- 4, 0x0000, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_IA, G_IM_SIZ_8b, 4, 0x0000, G_TX_RENDERTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 124, 124);
}
@@ -4020,108 +3420,82 @@ void Interface_Draw(GlobalContext* globalCtx)
func_80094520(globalCtx->state.gfxCtx);
- if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0))
- {
- if (gSaveContext.minigame_state != 1)
- {
+ if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) {
+ if (gSaveContext.minigame_state != 1) {
// Carrots rendering if the action corresponds to riding a horse
- if (interfaceCtx->unk_1EE == 8)
- {
+ if (interfaceCtx->unk_1EE == 8) {
// Load Carrot Icon
gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 1, &D_02002100);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b,
- 0, 0x0000, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 0, 0x0000, G_TX_LOADTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMASK, G_TX_NOLOD);
gDPLoadSync(gfxCtx->overlay.p++);
gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 255, 256);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b,
- 4, 0x0000, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_32b, 4, 0x0000, G_TX_RENDERTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP,
+ G_TX_NOMASK, G_TX_NOLOD);
gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 60, 60);
// Draw 6 carrots
phi_s1 = ZREG(14);
- for (phi_s3 = 1; phi_s3 < 7; phi_s3++)
- {
+ for (phi_s3 = 1; phi_s3 < 7; phi_s3++) {
// Carrot Color (based on availability)
if ((interfaceCtx->unk_23A == 0) || (interfaceCtx->unk_23A < phi_s3))
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x00, 0x96, 0xFF, interfaceCtx->aAlpha);
else
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->aAlpha);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- phi_s1 << 2, ZREG(15) << 2,
- (phi_s1 + 16) << 2, (ZREG(15) + 16) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- 1024, 1024);
+ gSPTextureRectangle(gfxCtx->overlay.p++, phi_s1 << 2, ZREG(15) << 2, (phi_s1 + 16) << 2,
+ (ZREG(15) + 16) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024);
phi_s1 += 16;
}
}
- }
- else
- {
+ } else {
// Score for the Horseback Archery
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, interfaceCtx->bAlpha);
// Target Icon
gDPSetTextureImage(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, D_02002600);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b,
- 0, 0x0000, G_TX_LOADTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPLoadSync(gfxCtx->overlay.p++);
gDPLoadBlock(gfxCtx->overlay.p++, G_TX_LOADTILE, 0, 0, 383, 342);
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b,
- 6, 0x0000, G_TX_RENDERTILE, 0,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD,
- G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
+ gDPSetTile(gfxCtx->overlay.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 6, 0x0000, G_TX_RENDERTILE, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
+ G_TX_NOLOD);
gDPSetTileSize(gfxCtx->overlay.p++, G_TX_RENDERTILE, 0, 0, 92, 60);
- gSPTextureRectangle(gfxCtx->overlay.p++,
- (WREG(32) + 28) << 2, ZREG(15) << 2,
- (WREG(32) + 52) << 2, (ZREG(15) + 16) << 2,
- G_TX_RENDERTILE,
- 0, 0,
- 1024, 1024);
+ gSPTextureRectangle(gfxCtx->overlay.p++, (WREG(32) + 28) << 2, ZREG(15) << 2, (WREG(32) + 52) << 2,
+ (ZREG(15) + 16) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024);
// Score Counter
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0,
- 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
+ TEXEL0, 0, PRIMITIVE, 0);
phi_s0 = 0;
phi_s1 = WREG(32) + 6 * 9;
- for (phi_s3 = 0; phi_s3 < 4; phi_s3++)
- {
- if (sHBAScoreDigits[phi_s3] != 0 || (phi_s0 != 0) || (phi_s3 >= 3))
- {
- gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p,
- &D_02003040[sHBAScoreDigits[phi_s3]],
- 8, 16,
- phi_s1, ZREG(15) - 2,
- sDigitWidth[0], VREG(42),
- VREG(43) * 2, VREG(43) * 2);
+ for (phi_s3 = 0; phi_s3 < 4; phi_s3++) {
+ if (sHBAScoreDigits[phi_s3] != 0 || (phi_s0 != 0) || (phi_s3 >= 3)) {
+ gfxCtx->overlay.p =
+ Draw_TextureI8(gfxCtx->overlay.p, &D_02003040[sHBAScoreDigits[phi_s3]], 8, 16, phi_s1,
+ ZREG(15) - 2, sDigitWidth[0], VREG(42), VREG(43) * 2, VREG(43) * 2);
phi_s1 += 9;
phi_s0++;
}
}
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0,
- TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0,
+ PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0);
}
}
- if ((gSaveContext.timer_2_state == 5) && (func_8010BDBC(&globalCtx->msgCtx) == 5))
- {
+ if ((gSaveContext.timer_2_state == 5) && (func_8010BDBC(&globalCtx->msgCtx) == 5)) {
// Trade quest timer reached 0
gSaveContext.cutscene_index = 0;
globalCtx->sceneLoadFlag = 0x14;
@@ -4132,8 +3506,7 @@ void Interface_Draw(GlobalContext* globalCtx)
if ((gSaveContext.equips.button_items[0] != ITEM_SWORD_KOKIRI) &&
(gSaveContext.equips.button_items[0] != ITEM_SWORD_MASTER) &&
(gSaveContext.equips.button_items[0] != ITEM_SWORD_BGS) &&
- (gSaveContext.equips.button_items[0] != ITEM_SWORD_KNIFE))
- {
+ (gSaveContext.equips.button_items[0] != ITEM_SWORD_KNIFE)) {
if (gSaveContext.button_status[0] != BTN_ENABLED)
gSaveContext.equips.button_items[0] = gSaveContext.button_status[0];
else
@@ -4141,19 +3514,15 @@ void Interface_Draw(GlobalContext* globalCtx)
}
// Revert any spoiling trade quest items
- for (phi_s3 = 0; phi_s3 < ARRAY_COUNT(gSpoilingItems); phi_s3++)
- {
- if (INV_CONTENT(ITEM_POCKET_EGG) == gSpoilingItems[phi_s3])
- {
+ for (phi_s3 = 0; phi_s3 < ARRAY_COUNT(gSpoilingItems); phi_s3++) {
+ if (INV_CONTENT(ITEM_POCKET_EGG) == gSpoilingItems[phi_s3]) {
gSaveContext.event_inf[0] &= 0x7F80;
osSyncPrintf("EVENT_INF=%x\n", gSaveContext.event_inf[0]);
globalCtx->nextEntranceIndex = sSpoilingItemEntrances[phi_s3];
INV_CONTENT(gSpoilingItemReverts[phi_s3]) = gSpoilingItemReverts[phi_s3];
- for (phi_s0 = 1; phi_s0 < 4; phi_s0++)
- {
- if (gSaveContext.equips.button_items[phi_s0] == gSpoilingItems[phi_s3])
- {
+ for (phi_s0 = 1; phi_s0 < 4; phi_s0++) {
+ if (gSaveContext.equips.button_items[phi_s0] == gSpoilingItems[phi_s3]) {
gSaveContext.equips.button_items[phi_s0] = gSpoilingItemReverts[phi_s3];
Interface_LoadItemIcon1(globalCtx, phi_s0);
}
@@ -4162,21 +3531,13 @@ void Interface_Draw(GlobalContext* globalCtx)
}
}
- if ((globalCtx->pauseCtx.state == 0) &&
- (globalCtx->pauseCtx.flag == 0) &&
- (globalCtx->unk_10A20 == 0) &&
- (msgCtx->msgMode == 0) &&
- !(player->stateFlags2 & 0x01000000) &&
- (globalCtx->sceneLoadFlag == 0) &&
- (globalCtx->unk_1241B == 0) &&
- (func_800BFC84(globalCtx) == 0) &&
- (gSaveContext.minigame_state != 1) &&
+ if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (globalCtx->unk_10A20 == 0) &&
+ (msgCtx->msgMode == 0) && !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) &&
+ (globalCtx->unk_1241B == 0) && (func_800BFC84(globalCtx) == 0) && (gSaveContext.minigame_state != 1) &&
(globalCtx->unk_11E5C < 2) &&
- !((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38)))
- {
+ !((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) {
sp274 = 0;
- switch (gSaveContext.timer_1_state)
- {
+ switch (gSaveContext.timer_1_state) {
case 1:
gSaveContext.timer_1_state = 2;
gSaveContext.timer_1_value = gSaveContext.health >> 1;
@@ -4184,8 +3545,7 @@ void Interface_Draw(GlobalContext* globalCtx)
break;
case 2:
D_8015FFE2--;
- if (D_8015FFE2 == 0)
- {
+ if (D_8015FFE2 == 0) {
gSaveContext.timer_1_state = 3;
D_8015FFE2 = 20;
}
@@ -4201,8 +3561,7 @@ void Interface_Draw(GlobalContext* globalCtx)
case 6:
case 12:
D_8015FFE2--;
- if (D_8015FFE2 == 0)
- {
+ if (D_8015FFE2 == 0) {
D_8015FFE2 = 20;
if (gSaveContext.timer_1_state == 6)
gSaveContext.timer_1_state = 7;
@@ -4222,8 +3581,7 @@ void Interface_Draw(GlobalContext* globalCtx)
gSaveContext.timer_y[0] -= phi_s3;
D_8015FFE2--;
- if (D_8015FFE2 == 0)
- {
+ if (D_8015FFE2 == 0) {
gSaveContext.timer_x[0] = 26;
D_8015FFE2 = 20;
@@ -4239,47 +3597,39 @@ void Interface_Draw(GlobalContext* globalCtx)
}
case 4:
case 8:
- if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8))
- {
+ if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8)) {
if (gSaveContext.health_capacity > 0xA0)
gSaveContext.timer_y[0] = 54;
else
gSaveContext.timer_y[0] = 46;
}
- if ((gSaveContext.timer_1_state >= 3) && (msgCtx->unk_E300 == 0))
- {
+ if ((gSaveContext.timer_1_state >= 3) && (msgCtx->unk_E300 == 0)) {
D_8015FFE0--;
- if (D_8015FFE0 == 0)
- {
+ if (D_8015FFE0 == 0) {
if (gSaveContext.timer_1_value != 0)
gSaveContext.timer_1_value--;
D_8015FFE0 = 20;
- if (gSaveContext.timer_1_value == 0)
- {
+ if (gSaveContext.timer_1_value == 0) {
gSaveContext.timer_1_state = 10;
- if (D_80125A5C != 0)
- {
+ if (D_80125A5C != 0) {
gSaveContext.health = 0;
globalCtx->unk_11D58(globalCtx, -(gSaveContext.health + 2));
}
D_80125A5C = 0;
- }
- else if (gSaveContext.timer_1_value > 60)
- {
+ } else if (gSaveContext.timer_1_value > 60) {
if (sTimerDigits[4] == 1)
- Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- }
- else if (gSaveContext.timer_1_value >= 11)
- {
+ Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0,
+ &D_801333E0, &D_801333E8);
+ } else if (gSaveContext.timer_1_value >= 11) {
if (sTimerDigits[4] & 1)
- Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- }
- else
- {
- Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
+ Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0,
+ &D_801333E0, &D_801333E8);
+ } else {
+ Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, &D_801333E0,
+ &D_801333E0, &D_801333E8);
}
}
}
@@ -4295,8 +3645,7 @@ void Interface_Draw(GlobalContext* globalCtx)
gSaveContext.timer_y[0] -= phi_s3;
D_8015FFE2--;
- if (D_8015FFE2 == 0)
- {
+ if (D_8015FFE2 == 0) {
gSaveContext.timer_x[0] = 26;
D_8015FFE2 = 20;
@@ -4308,37 +3657,31 @@ void Interface_Draw(GlobalContext* globalCtx)
gSaveContext.timer_1_state = 14;
}
case 14:
- if (gSaveContext.timer_1_state == 14)
- {
+ if (gSaveContext.timer_1_state == 14) {
if (gSaveContext.health_capacity > 0xA0)
gSaveContext.timer_y[0] = 54;
else
gSaveContext.timer_y[0] = 46;
}
- if (gSaveContext.timer_1_state >= 3)
- {
+ if (gSaveContext.timer_1_state >= 3) {
D_8015FFE0--;
- if (D_8015FFE0 == 0)
- {
+ if (D_8015FFE0 == 0) {
gSaveContext.timer_1_value++;
D_8015FFE0 = 20;
- if (gSaveContext.timer_1_value == 3599)
- {
+ if (gSaveContext.timer_1_value == 3599) {
gSaveContext.timer_1_state = 15;
D_8015FFE2 = 40;
- }
- else
- {
- Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
+ } else {
+ Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0,
+ &D_801333E0, &D_801333E8);
}
}
}
break;
case 10:
- if (gSaveContext.timer_2_state != 0)
- {
+ if (gSaveContext.timer_2_state != 0) {
gSaveContext.timer_x[1] = 140;
gSaveContext.timer_y[1] = 80;
D_8015FFE4 = D_8015FFE6 = 20;
@@ -4349,9 +3692,7 @@ void Interface_Draw(GlobalContext* globalCtx)
gSaveContext.timer_2_state = 8;
gSaveContext.timer_1_state = 0;
- }
- else
- {
+ } else {
gSaveContext.timer_1_state = 0;
}
break;
@@ -4359,8 +3700,7 @@ void Interface_Draw(GlobalContext* globalCtx)
break;
default:
sp274 = 1;
- switch (gSaveContext.timer_2_state)
- {
+ switch (gSaveContext.timer_2_state) {
case 1:
case 7:
gSaveContext.timer_x[1] = 140;
@@ -4374,8 +3714,7 @@ void Interface_Draw(GlobalContext* globalCtx)
case 2:
case 8:
D_8015FFE6--;
- if (D_8015FFE6 == 0)
- {
+ if (D_8015FFE6 == 0) {
D_8015FFE6 = 20;
if (gSaveContext.timer_2_state == 2)
gSaveContext.timer_2_state = 3;
@@ -4398,8 +3737,7 @@ void Interface_Draw(GlobalContext* globalCtx)
gSaveContext.timer_y[1] -= phi_s3;
D_8015FFE6--;
- if (D_8015FFE6 == 0)
- {
+ if (D_8015FFE6 == 0) {
gSaveContext.timer_x[1] = 26;
D_8015FFE6 = 20;
@@ -4415,70 +3753,54 @@ void Interface_Draw(GlobalContext* globalCtx)
}
case 4:
case 10:
- if ((gSaveContext.timer_2_state == 4) || (gSaveContext.timer_2_state == 10))
- {
+ if ((gSaveContext.timer_2_state == 4) || (gSaveContext.timer_2_state == 10)) {
if (gSaveContext.health_capacity > 0xA0)
gSaveContext.timer_y[1] = 54;
else
gSaveContext.timer_y[1] = 46;
}
- if (gSaveContext.timer_2_state >= 3)
- {
+ if (gSaveContext.timer_2_state >= 3) {
D_8015FFE4--;
- if (D_8015FFE4 == 0)
- {
+ if (D_8015FFE4 == 0) {
D_8015FFE4 = 20;
- if (gSaveContext.timer_2_state == 4)
- {
+ if (gSaveContext.timer_2_state == 4) {
gSaveContext.timer_2_value--;
osSyncPrintf("TOTAL_EVENT_TM=%d\n", gSaveContext.timer_2_value);
- if (gSaveContext.timer_2_value <= 0)
- {
+ if (gSaveContext.timer_2_value <= 0) {
if (!Flags_GetSwitch(globalCtx, 0x37) ||
((globalCtx->sceneNum != SCENE_GANON_DEMO) &&
(globalCtx->sceneNum != SCENE_GANON_FINAL) &&
(globalCtx->sceneNum != SCENE_GANON_SONOGO) &&
- (globalCtx->sceneNum != SCENE_GANONTIKA_SONOGO)))
- {
+ (globalCtx->sceneNum != SCENE_GANONTIKA_SONOGO))) {
gSaveContext.timer_2_state = 5;
gSaveContext.cutscene_index = 0;
D_8015FFE6 = 40;
func_8010B680(globalCtx, 0x71B0, 0);
func_8002DF54(globalCtx, 0, 8);
- }
- else
- {
+ } else {
gSaveContext.timer_2_state = 6;
D_8015FFE6 = 40;
}
- }
- else
- {
- if (gSaveContext.timer_2_value > 60)
- {
+ } else {
+ if (gSaveContext.timer_2_value > 60) {
if (sTimerDigits[4] == 1)
- Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- }
- else if (gSaveContext.timer_2_value > 10)
- {
+ Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4,
+ &D_801333E0, &D_801333E0, &D_801333E8);
+ } else if (gSaveContext.timer_2_value > 10) {
if (sTimerDigits[4] & 1)
- Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- }
- else
- {
- Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
+ Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4,
+ &D_801333E0, &D_801333E0, &D_801333E8);
+ } else {
+ Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_E, &D_801333D4, 4,
+ &D_801333E0, &D_801333E0, &D_801333E8);
}
}
- }
- else
- {
+ } else {
gSaveContext.timer_2_value++;
- if (gSaveContext.event_inf[1] & 1)
- {
- if (gSaveContext.timer_2_value == 240)
- {
+ if (gSaveContext.event_inf[1] & 1) {
+ if (gSaveContext.timer_2_value == 240) {
func_8010B680(globalCtx, 0x6083, 0);
gSaveContext.timer_2_state = 0;
gSaveContext.event_inf[1] &= ~1;
@@ -4486,9 +3808,9 @@ void Interface_Draw(GlobalContext* globalCtx)
}
}
- if ((gSaveContext.timer_2_value % 60) == 0)
- {
- Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
+ if ((gSaveContext.timer_2_value % 60) == 0) {
+ Audio_PlaySoundGeneral(NA_SE_SY_WARNING_COUNT_N, &D_801333D4, 4, &D_801333E0,
+ &D_801333E0, &D_801333E8);
}
}
}
@@ -4498,12 +3820,11 @@ void Interface_Draw(GlobalContext* globalCtx)
if (D_8015FFE6 == 0)
gSaveContext.timer_2_state = 0;
break;
- }
+ }
}
if (((gSaveContext.timer_1_state != 0) && (gSaveContext.timer_1_state != 10)) ||
- (gSaveContext.timer_2_state != 0))
- {
+ (gSaveContext.timer_2_state != 0)) {
sTimerDigits[0] = sTimerDigits[1] = sTimerDigits[3] = 0;
sTimerDigits[2] = 10; // digit 10 is used as ':' (colon)
@@ -4512,19 +3833,16 @@ void Interface_Draw(GlobalContext* globalCtx)
else
sTimerDigits[4] = gSaveContext.timer_2_value;
- while (sTimerDigits[4] >= 60)
- {
+ while (sTimerDigits[4] >= 60) {
sTimerDigits[1]++;
- if (sTimerDigits[1] >= 10)
- {
+ if (sTimerDigits[1] >= 10) {
sTimerDigits[1] -= 10;
sTimerDigits[0]++;
}
sTimerDigits[4] -= 60;
}
- while (sTimerDigits[4] >= 10)
- {
+ while (sTimerDigits[4] >= 10) {
sTimerDigits[4] -= 10;
sTimerDigits[3]++;
}
@@ -4533,43 +3851,30 @@ void Interface_Draw(GlobalContext* globalCtx)
gDPPipeSync(gfxCtx->overlay.p++);
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
gDPSetEnvColor(gfxCtx->overlay.p++, 0x00, 0x00, 0x00, 0x00);
- gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p,
- D_02002000,
- 16, 16,
- gSaveContext.timer_x[sp274],
- gSaveContext.timer_y[sp274] + 2,
- 16, 16,
- 1024, 1024);
+ gfxCtx->overlay.p = Draw_TextureIA8(gfxCtx->overlay.p, D_02002000, 16, 16, gSaveContext.timer_x[sp274],
+ gSaveContext.timer_y[sp274] + 2, 16, 16, 1024, 1024);
// Timer Counter
gDPPipeSync(gfxCtx->overlay.p++);
- gDPSetCombineLERP(gfxCtx->overlay.p++,
- 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0,
- 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
+ gDPSetCombineLERP(gfxCtx->overlay.p++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE,
+ TEXEL0, 0, PRIMITIVE, 0);
- if (gSaveContext.timer_1_state != 0)
- {
+ if (gSaveContext.timer_1_state != 0) {
if ((gSaveContext.timer_1_value < 10) && (gSaveContext.timer_1_state < 11))
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0x32, 0x00, 0xFF);
else
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
- }
- else
- {
+ } else {
if ((gSaveContext.timer_2_value < 10) && (gSaveContext.timer_2_state < 6))
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0x32, 0x00, 0xFF);
else
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0xFF, 0xFF, 0x00, 0xFF);
}
- for (phi_s3 = 0; phi_s3 < 5; phi_s3++)
- {
- gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p,
- &D_02003040[sTimerDigits[phi_s3]],
- 8, 16,
+ for (phi_s3 = 0; phi_s3 < 5; phi_s3++) {
+ gfxCtx->overlay.p = Draw_TextureI8(gfxCtx->overlay.p, &D_02003040[sTimerDigits[phi_s3]], 8, 16,
gSaveContext.timer_x[sp274] + sTimerDigitLeftPos[phi_s3],
- gSaveContext.timer_y[sp274],
- sDigitWidth[phi_s3], VREG(42),
+ gSaveContext.timer_y[sp274], sDigitWidth[phi_s3], VREG(42),
VREG(43) * 2, VREG(43) * 2);
}
}
@@ -4579,8 +3884,7 @@ void Interface_Draw(GlobalContext* globalCtx)
if (pauseCtx->flag == 3)
func_8002AAB0(globalCtx);
- if (interfaceCtx->unk_244 != 0)
- {
+ if (interfaceCtx->unk_244 != 0) {
gDPPipeSync(gfxCtx->overlay.p++);
gSPDisplayList(gfxCtx->overlay.p++, sSetupDL_80125A60);
gDPSetPrimColor(gfxCtx->overlay.p++, 0, 0, 0x00, 0x00, 0x00, interfaceCtx->unk_244);
@@ -4600,52 +3904,40 @@ s16 sTimerDigits[5];
#ifdef NON_MATCHING
// regalloc and minor ordering differences
-void Interface_Update(GlobalContext* globalCtx)
-{
+void Interface_Update(GlobalContext* globalCtx) {
static u8 D_80125B60 = 0;
static s16 D_80125B64 = 0;
MessageContext* msgCtx = &globalCtx->msgCtx;
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
Player* player = PLAYER;
- s16 alpha; // sp+0x3A
+ s16 alpha; // sp+0x3A
s16 alpha1; // sp+0x38
u16 action;
Input* input = &globalCtx->state.input[2];
- if (!~(input->padPressed | -0x201))
- {
+ if (!~(input->padPressed | -0x201)) {
gSaveContext.language = 0;
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
- }
- else if (!~(input->padPressed | -0x801))
- {
+ } else if (!~(input->padPressed | -0x801)) {
gSaveContext.language = 1;
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
- }
- else if (!~(input->padPressed | -0x101))
- {
+ } else if (!~(input->padPressed | -0x101)) {
gSaveContext.language = 2;
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);
}
- if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0))
- {
+ if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0)) {
if ((gSaveContext.minigame_state == 1) || (gSaveContext.scene_setup_index < 4) ||
- ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.scene_setup_index == 4)))
- {
- if ((msgCtx->msgMode == 0) ||
- ((msgCtx->msgMode != 0) && (globalCtx->sceneNum == SCENE_BOWLING)))
- {
- if (globalCtx->unk_10A20 == 0)
- {
+ ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.scene_setup_index == 4))) {
+ if ((msgCtx->msgMode == 0) || ((msgCtx->msgMode != 0) && (globalCtx->sceneNum == SCENE_BOWLING))) {
+ if (globalCtx->unk_10A20 == 0) {
func_80083108(globalCtx);
}
}
}
}
- switch (gSaveContext.unk_13E8)
- {
+ switch (gSaveContext.unk_13E8) {
case 1:
case 2:
case 3:
@@ -4687,8 +3979,7 @@ void Interface_Update(GlobalContext* globalCtx)
if (interfaceCtx->magicAlpha != 0xFF)
interfaceCtx->magicAlpha = alpha1;
- switch (globalCtx->sceneNum)
- {
+ switch (globalCtx->sceneNum) {
case SCENE_SPOT00:
case SCENE_SPOT01:
case SCENE_SPOT02:
@@ -4735,8 +4026,7 @@ void Interface_Update(GlobalContext* globalCtx)
func_8008226C(globalCtx);
- if (gSaveContext.health_accumulator != 0)
- {
+ if (gSaveContext.health_accumulator != 0) {
gSaveContext.health_accumulator -= 4;
gSaveContext.health += 4;
@@ -4745,10 +4035,10 @@ void Interface_Update(GlobalContext* globalCtx)
osSyncPrintf("now_life=%d max_life=%d\n", gSaveContext.health, gSaveContext.health_capacity);
- if (gSaveContext.health >= gSaveContext.health_capacity)
- {
+ if (gSaveContext.health >= gSaveContext.health_capacity) {
gSaveContext.health = gSaveContext.health_capacity;
- osSyncPrintf("S_Private.now_life=%d S_Private.max_life=%d\n", gSaveContext.health, gSaveContext.health_capacity);
+ osSyncPrintf("S_Private.now_life=%d S_Private.max_life=%d\n", gSaveContext.health,
+ gSaveContext.health_capacity);
gSaveContext.health_accumulator = 0;
}
}
@@ -4756,57 +4046,36 @@ void Interface_Update(GlobalContext* globalCtx)
Health_HandleCriticalAlarm(globalCtx);
D_80125A58 = func_8008F2F8(globalCtx);
- if (D_80125A58 == 1)
- {
- if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 2)
- {
+ if (D_80125A58 == 1) {
+ if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 2) {
D_80125A58 = 0;
}
- }
- else if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5))
- {
- if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 3)
- {
+ } else if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) {
+ if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 3) {
D_80125A58 = 0;
}
}
Health_UpdateData(globalCtx);
- if ((gSaveContext.timer_1_state >= 3) &&
- (globalCtx->pauseCtx.state == 0) &&
- (globalCtx->pauseCtx.flag == 0) &&
- (msgCtx->msgMode == 0) &&
- !(player->stateFlags2 & 0x01000000) &&
- (globalCtx->sceneLoadFlag == 0) &&
- (globalCtx->unk_1241B == 0) &&
- (func_800BFC84(globalCtx) == 0))
- {
-
- }
+ if ((gSaveContext.timer_1_state >= 3) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
+ (msgCtx->msgMode == 0) && !(player->stateFlags2 & 0x01000000) && (globalCtx->sceneLoadFlag == 0) &&
+ (globalCtx->unk_1241B == 0) && (func_800BFC84(globalCtx) == 0)) {}
- if (gSaveContext.rupee_accumulator != 0)
- {
- if (gSaveContext.rupee_accumulator > 0)
- {
- if (gSaveContext.rupees < CUR_CAPACITY(UPG_WALLET))
- {
+ if (gSaveContext.rupee_accumulator != 0) {
+ if (gSaveContext.rupee_accumulator > 0) {
+ if (gSaveContext.rupees < CUR_CAPACITY(UPG_WALLET)) {
gSaveContext.rupee_accumulator--;
gSaveContext.rupees++;
Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- }
- else
- {
+ } else {
// Translates to: "Rupee Amount MAX = %d"
osSyncPrintf("ルピー数MAX = %d\n", CUR_CAPACITY(UPG_WALLET));
gSaveContext.rupees = CUR_CAPACITY(UPG_WALLET);
gSaveContext.rupee_accumulator = 0;
}
- }
- else if (gSaveContext.rupees != 0)
- {
- if (gSaveContext.rupee_accumulator <= -50)
- {
+ } else if (gSaveContext.rupees != 0) {
+ if (gSaveContext.rupee_accumulator <= -50) {
gSaveContext.rupee_accumulator += 10;
gSaveContext.rupees -= 10;
@@ -4814,34 +4083,27 @@ void Interface_Update(GlobalContext* globalCtx)
gSaveContext.rupees = 0;
Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
- }
- else
- {
+ } else {
gSaveContext.rupee_accumulator++;
gSaveContext.rupees--;
Audio_PlaySoundGeneral(NA_SE_SY_RUPY_COUNT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
- }
- else
- {
+ } else {
gSaveContext.rupee_accumulator = 0;
}
}
- switch (interfaceCtx->unk_1EC)
- {
+ switch (interfaceCtx->unk_1EC) {
case 1:
interfaceCtx->unk_1F4 = interfaceCtx->unk_1F4 + (31400.0f / WREG(5));
- if (interfaceCtx->unk_1F4 >= 15700.0f)
- {
+ if (interfaceCtx->unk_1F4 >= 15700.0f) {
interfaceCtx->unk_1F4 = -15700.0f;
interfaceCtx->unk_1EC = 2;
}
break;
case 2:
interfaceCtx->unk_1F4 = interfaceCtx->unk_1F4 + (31400.0f / WREG(5));
- if (interfaceCtx->unk_1F4 >= 0.0f)
- {
+ if (interfaceCtx->unk_1F4 >= 0.0f) {
interfaceCtx->unk_1F4 = 0.0f;
interfaceCtx->unk_1EC = 0;
interfaceCtx->unk_1EE = interfaceCtx->unk_1F0;
@@ -4853,16 +4115,14 @@ void Interface_Update(GlobalContext* globalCtx)
break;
case 3:
interfaceCtx->unk_1F4 = interfaceCtx->unk_1F4 + (31400.0f / WREG(5));
- if (interfaceCtx->unk_1F4 >= 15700.0f)
- {
+ if (interfaceCtx->unk_1F4 >= 15700.0f) {
interfaceCtx->unk_1F4 = -15700.0f;
interfaceCtx->unk_1EC = 2;
}
break;
case 4:
interfaceCtx->unk_1F4 = interfaceCtx->unk_1F4 + (31400.0f / WREG(5));
- if (interfaceCtx->unk_1F4 >= 0.0f)
- {
+ if (interfaceCtx->unk_1F4 >= 0.0f) {
interfaceCtx->unk_1F4 = 0.0f;
interfaceCtx->unk_1EC = 0;
interfaceCtx->unk_1EE = interfaceCtx->unk_1F0;
@@ -4878,10 +4138,8 @@ void Interface_Update(GlobalContext* globalCtx)
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) && (msgCtx->msgMode == 0) &&
(globalCtx->sceneLoadFlag == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->unk_1241B == 0) &&
- ((globalCtx->csCtx.state == 0) || (func_8008E988(globalCtx) == 0)))
- {
- if ((gSaveContext.magic_acquired != 0) && (gSaveContext.magic_level == 0))
- {
+ ((globalCtx->csCtx.state == 0) || (func_8008E988(globalCtx) == 0))) {
+ if ((gSaveContext.magic_acquired != 0) && (gSaveContext.magic_level == 0)) {
gSaveContext.magic_level = gSaveContext.double_magic + 1;
gSaveContext.unk_13F0 = 8;
osSyncPrintf(VT_FGCOL(YELLOW));
@@ -4897,38 +4155,27 @@ void Interface_Update(GlobalContext* globalCtx)
Interface_UpdateMagicBar(globalCtx);
}
- if (gSaveContext.timer_1_state == 0)
- {
- if (((D_80125A58 == 1) || (D_80125A58 == 2) || (D_80125A58 == 4)) &&
- ((gSaveContext.health >> 1) != 0))
- {
+ if (gSaveContext.timer_1_state == 0) {
+ if (((D_80125A58 == 1) || (D_80125A58 == 2) || (D_80125A58 == 4)) && ((gSaveContext.health >> 1) != 0)) {
gSaveContext.timer_1_state = 1;
gSaveContext.timer_x[0] = 140;
gSaveContext.timer_y[0] = 80;
D_80125A5C = 1;
}
- }
- else
- {
- if (((D_80125A58 == 0) || (D_80125A58 == 3)) &&
- (gSaveContext.timer_1_state < 5))
- {
+ } else {
+ if (((D_80125A58 == 0) || (D_80125A58 == 3)) && (gSaveContext.timer_1_state < 5)) {
gSaveContext.timer_1_state = 0;
}
}
- if (gSaveContext.minigame_state == 1)
- {
+ if (gSaveContext.minigame_state == 1) {
gSaveContext.minigame_score += interfaceCtx->unk_23C;
interfaceCtx->unk_23C = 0;
- if (sHBAScoreTier == 0)
- {
+ if (sHBAScoreTier == 0) {
if (gSaveContext.minigame_score >= 1000)
sHBAScoreTier++;
- }
- else if (sHBAScoreTier == 1)
- {
+ } else if (sHBAScoreTier == 1) {
if (gSaveContext.minigame_score >= 1500)
sHBAScoreTier++;
}
@@ -4938,34 +4185,28 @@ void Interface_Update(GlobalContext* globalCtx)
sHBAScoreDigits[2] = 0;
sHBAScoreDigits[3] = gSaveContext.minigame_score;
- while (sHBAScoreDigits[3] >= 1000)
- {
+ while (sHBAScoreDigits[3] >= 1000) {
sHBAScoreDigits[0]++;
sHBAScoreDigits[3] -= 1000;
}
- while (sHBAScoreDigits[3] >= 100)
- {
+ while (sHBAScoreDigits[3] >= 100) {
sHBAScoreDigits[1]++;
sHBAScoreDigits[3] -= 100;
}
- while (sHBAScoreDigits[3] >= 10)
- {
+ while (sHBAScoreDigits[3] >= 10) {
sHBAScoreDigits[2]++;
sHBAScoreDigits[3] -= 10;
}
}
- if (gSaveContext.unk_1422 != 0)
- {
+ if (gSaveContext.unk_1422 != 0) {
if ((msgCtx->unk_E3F0 != 0x31) && (gSaveContext.unk_1422 == 1))
globalCtx->msgCtx.unk_E3EE = 4;
- if (globalCtx->unk_10A26 != 0)
- {
- if (gSaveContext.unk_1422 != 2)
- {
+ if (globalCtx->unk_10A26 != 0) {
+ if (gSaveContext.unk_1422 != 2) {
D_80125B60 = 0;
if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time <= 0xC001))
D_80125B60 = 1;
@@ -4973,39 +4214,29 @@ void Interface_Update(GlobalContext* globalCtx)
gSaveContext.unk_1422 = 2;
D_80125B64 = D_8011FB40;
D_8011FB40 = 400;
- }
- else if ((D_80125B60 == 0) && (gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time <= 0xC001))
- {
+ } else if ((D_80125B60 == 0) && (gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time <= 0xC001)) {
gSaveContext.unk_1422 = 0;
D_8011FB40 = D_80125B64;
globalCtx->msgCtx.unk_E3EE = 4;
- }
- else if (gSaveContext.day_time > 0xC001)
- {
+ } else if (gSaveContext.day_time > 0xC001) {
gSaveContext.unk_1422 = 0;
D_8011FB40 = D_80125B64;
globalCtx->msgCtx.unk_E3EE = 4;
}
- }
- else if ((globalCtx->roomCtx.curRoom.unk_03 != 1) && (interfaceCtx->restrictions.sunsSong != 3))
- {
- if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time < 0xC001))
- {
+ } else if ((globalCtx->roomCtx.curRoom.unk_03 != 1) && (interfaceCtx->restrictions.sunsSong != 3)) {
+ if ((gSaveContext.day_time >= 0x4555) && (gSaveContext.day_time < 0xC001)) {
gSaveContext.next_day_time = 0;
globalCtx->fadeOutTransition = 4;
gSaveContext.transition_type = 2;
globalCtx->unk_11DE9 = 1;
- }
- else
- {
+ } else {
gSaveContext.next_day_time = 0x8001;
globalCtx->fadeOutTransition = 5;
gSaveContext.transition_type = 3;
globalCtx->unk_11DE9 = 1;
}
- if (globalCtx->sceneNum == SCENE_SPOT13)
- {
+ if (globalCtx->sceneNum == SCENE_SPOT13) {
globalCtx->fadeOutTransition = 0xE;
gSaveContext.transition_type = 0xE;
}
@@ -5017,9 +4248,7 @@ void Interface_Update(GlobalContext* globalCtx)
func_800F6964(30);
gSaveContext.seq_index = 0xFF;
gSaveContext.night_sfx = 0xFF;
- }
- else
- {
+ } else {
gSaveContext.unk_1422 = 3;
}
}
diff --git a/src/code/z_play.c b/src/code/z_play.c
index 96378ada9..8494f9b99 100644
--- a/src/code/z_play.c
+++ b/src/code/z_play.c
@@ -1,39 +1,33 @@
#include <ultra64.h>
#include <global.h>
-void func_800BC450(GlobalContext* globalCtx)
-{
- func_8005A7A8(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0],
- globalCtx->unk_1242B - 1, globalCtx);
+void func_800BC450(GlobalContext* globalCtx) {
+ func_8005A7A8(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], globalCtx->unk_1242B - 1,
+ globalCtx);
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC490.s")
-s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1)
-{
+s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1) {
return arg1 == globalCtx->unk_1242B;
}
-void func_800BC590(GlobalContext* globalCtx)
-{
+void func_800BC590(GlobalContext* globalCtx) {
osSyncPrintf("Game_play_shop_pr_vr_switch_set()\n");
- if (YREG(15) == 0x10)
- {
+ if (YREG(15) == 0x10) {
globalCtx->unk_1242B = 2;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC5E0.s")
-void func_800BC88C(GlobalContext* globalCtx)
-{
+void func_800BC88C(GlobalContext* globalCtx) {
globalCtx->unk_123F0 = -1;
}
-Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* a1)
-{
- func_80093708(a1, globalCtx->lightCtx.unk_07, globalCtx->lightCtx.unk_08,
- globalCtx->lightCtx.unk_09, 0, globalCtx->lightCtx.unk_0A, 1000);
+Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* a1) {
+ func_80093708(a1, globalCtx->lightCtx.unk_07, globalCtx->lightCtx.unk_08, globalCtx->lightCtx.unk_09, 0,
+ globalCtx->lightCtx.unk_0A, 1000);
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BC8EC.s")
@@ -48,8 +42,7 @@ Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* a1)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFAE4.s")
-s32 func_800BFC84(GlobalContext* globalCtx)
-{
+s32 func_800BFC84(GlobalContext* globalCtx) {
return globalCtx->csCtx.state != 0 || func_8008E988(globalCtx) != 0;
}
@@ -59,8 +52,7 @@ s32 func_800BFC84(GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800BFEC4.s")
-void func_800BFF0C(GlobalContext* globalCtx, s32 a1)
-{
+void func_800BFF0C(GlobalContext* globalCtx, s32 a1) {
globalCtx->curSpawn = a1;
globalCtx->linkActorEntry = NULL;
globalCtx->unk_11DFC = NULL;
@@ -85,8 +77,7 @@ void func_800BFF0C(GlobalContext* globalCtx, s32 a1)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0230.s")
-s16 func_800C030C(GlobalContext* globalCtx)
-{
+s16 func_800C030C(GlobalContext* globalCtx) {
return globalCtx->cameraCtx.unk_5C0;
}
@@ -120,8 +111,7 @@ s16 func_800C030C(GlobalContext* globalCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0AF4.s")
-void func_800C0B60(GlobalContext* globalCtx)
-{
+void func_800C0B60(GlobalContext* globalCtx) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].temp_swch_flags = globalCtx->actorCtx.flags.tempSwch;
gSaveContext.respawn[RESPAWN_MODE_DOWN].temp_collect_flags = globalCtx->actorCtx.flags.tempCollect;
gSaveContext.respawn_flag = 1;
@@ -130,48 +120,35 @@ void func_800C0B60(GlobalContext* globalCtx)
globalCtx->fadeOutTransition = 2;
}
-void func_800C0BB4(GlobalContext* globalCtx)
-{
+void func_800C0BB4(GlobalContext* globalCtx) {
gSaveContext.respawn_flag = -1;
globalCtx->sceneLoadFlag = 0x14;
- if (globalCtx->sceneNum == SCENE_GANON_SONOGO ||
- globalCtx->sceneNum == SCENE_GANON_FINAL ||
- globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO ||
- globalCtx->sceneNum == SCENE_GANON_DEMO)
- {
+ if (globalCtx->sceneNum == SCENE_GANON_SONOGO || globalCtx->sceneNum == SCENE_GANON_FINAL ||
+ globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO || globalCtx->sceneNum == SCENE_GANON_DEMO) {
globalCtx->nextEntranceIndex = 0x043F;
Item_Give(globalCtx, ITEM_SWORD_MASTER);
- }
- else if (gSaveContext.entrance_index == 0x028A ||
- gSaveContext.entrance_index == 0x028E ||
- gSaveContext.entrance_index == 0x0292 ||
- gSaveContext.entrance_index == 0x0476)
- {
+ } else if (gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E ||
+ gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) {
globalCtx->nextEntranceIndex = 0x01F9;
- }
- else
- {
+ } else {
globalCtx->nextEntranceIndex = gSaveContext.entrance_index;
}
globalCtx->fadeOutTransition = 2;
}
-void func_800C0C88(GlobalContext* globalCtx)
-{
+void func_800C0C88(GlobalContext* globalCtx) {
func_800C0AF4(globalCtx, 0, 0xDFF);
func_800C0BB4(globalCtx);
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0CB8.s")
-s32 func_800C0D28(GlobalContext* globalCtx)
-{
+s32 func_800C0D28(GlobalContext* globalCtx) {
return globalCtx->unk_7B8 != 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0D34.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_800C0DB4.s")
-
diff --git a/src/code/z_player_call.c b/src/code/z_player_call.c
index 3adf3bc21..cf525ff24 100644
--- a/src/code/z_player_call.c
+++ b/src/code/z_player_call.c
@@ -15,8 +15,7 @@ void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx);
void PlayerCall_Update(Player* player, GlobalContext* globalCtx);
void PlayerCall_Draw(Player* player, GlobalContext* globalCtx);
-const ActorInit Player_InitVars =
-{
+const ActorInit Player_InitVars = {
ACTOR_PLAYER,
ACTORTYPE_PLAYER,
0,
@@ -29,35 +28,30 @@ const ActorInit Player_InitVars =
(ActorFunc)PlayerCall_Draw,
};
-void PlayerCall_InitFuncPtrs()
-{
+void PlayerCall_InitFuncPtrs() {
sPlayerCallInitFunc = KaleidoManager_GetRamAddr(func_80846CD8);
sPlayerCallDestroyFunc = KaleidoManager_GetRamAddr(func_8084AB54);
sPlayerCallUpdateFunc = KaleidoManager_GetRamAddr(func_80849EA8);
sPlayerCallDrawFunc = KaleidoManager_GetRamAddr(func_8084A5C4);
}
-void PlayerCall_Init(Player* player, GlobalContext* globalCtx)
-{
+void PlayerCall_Init(Player* player, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
PlayerCall_InitFuncPtrs();
sPlayerCallInitFunc(player, globalCtx);
}
-void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx)
-{
+void PlayerCall_Destroy(Player* player, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallDestroyFunc(player, globalCtx);
}
-void PlayerCall_Update(Player* player, GlobalContext* globalCtx)
-{
+void PlayerCall_Update(Player* player, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallUpdateFunc(player, globalCtx);
}
-void PlayerCall_Draw(Player* player, GlobalContext* globalCtx)
-{
+void PlayerCall_Draw(Player* player, GlobalContext* globalCtx) {
KaleidoScopeCall_LoadPlayer();
sPlayerCallDrawFunc(player, globalCtx);
}
diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c
index 06d2741ff..4ddb530fe 100644
--- a/src/code/z_player_lib.c
+++ b/src/code/z_player_lib.c
@@ -3,33 +3,22 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008E750.s")
-UNK_TYPE func_8008E8DC(GlobalContext* globalCtx, Player* player)
-{
- return (
- player->stateFlags1 & 0x20000080 ||
- player->action ||
- globalCtx->sceneLoadFlag == 0x14 ||
- player->stateFlags1 & 1 ||
- player->unk_692 & 0x80 ||
- gSaveContext.unk_13F0 &&
- func_8008F0D8(player, player->unk_154) >= 0
- );
-
-}
-
-UNK_TYPE func_8008E988(GlobalContext* globalCtx)
-{
+UNK_TYPE func_8008E8DC(GlobalContext* globalCtx, Player* player) {
+ return (player->stateFlags1 & 0x20000080 || player->action || globalCtx->sceneLoadFlag == 0x14 ||
+ player->stateFlags1 & 1 || player->unk_692 & 0x80 ||
+ gSaveContext.unk_13F0 && func_8008F0D8(player, player->unk_154) >= 0);
+}
+
+UNK_TYPE func_8008E988(GlobalContext* globalCtx) {
Player* player = PLAYER;
return func_8008E8DC(globalCtx, player) || player->unk_6AD == 4;
}
-UNK_TYPE func_8008E9C4(Player* player)
-{
+UNK_TYPE func_8008E9C4(Player* player) {
return player->stateFlags1 & 0x10;
}
-UNK_TYPE func_8008E9D0(Player* player)
-{
+UNK_TYPE func_8008E9D0(Player* player) {
return LINK_IS_CHILD && player->currentShield == 2;
}
@@ -41,8 +30,7 @@ UNK_TYPE func_8008E9D0(Player* player)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008EC04.s")
-void func_8008EC70(Player* player)
-{
+void func_8008EC70(Player* player) {
player->unk_154 = player->unk_151;
func_8008EC04(player, func_8008E9F8(player, player->unk_151));
player->unk_6AD = 0;
@@ -50,19 +38,16 @@ void func_8008EC70(Player* player)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008ECAC.s")
-void func_8008ED9C(GlobalContext* globalCtx, Player* player, UNK_TYPE item, UNK_TYPE arg2)
-{
+void func_8008ED9C(GlobalContext* globalCtx, Player* player, UNK_TYPE item, UNK_TYPE arg2) {
Inventory_UpdateBottleItem(globalCtx, item, player->unk_150);
- if (item != ITEM_BOTTLE)
- {
+ if (item != ITEM_BOTTLE) {
player->unk_152 = item;
player->unk_151 = arg2;
}
player->unk_154 = arg2;
}
-void func_8008EDF0(Player* player)
-{
+void func_8008EDF0(Player* player) {
player->unk_664 = NULL;
player->stateFlags2 &= ~0x2000;
}
@@ -71,8 +56,7 @@ void func_8008EDF0(Player* player)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008EEAC.s")
-UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1)
-{
+UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1) {
globalCtx->unk_11E5C = (arg1 + 1);
return 1;
}
@@ -81,69 +65,56 @@ UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008F034.s")
-u8 func_8008F080(GlobalContext* globalCtx)
-{
+u8 func_8008F080(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->currentMask;
}
-void func_8008F08C(GlobalContext* globalCtx)
-{
+void func_8008F08C(GlobalContext* globalCtx) {
Player* player = PLAYER;
player->currentMask = 0;
}
-UNK_TYPE func_8008F098(GlobalContext* globalCtx)
-{
+UNK_TYPE func_8008F098(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->currentShield == 3;
}
-UNK_TYPE func_8008F0AC(GlobalContext* globalCtx)
-{
+UNK_TYPE func_8008F0AC(GlobalContext* globalCtx) {
Player* player = PLAYER;
return player->unk_15D == 0xa && player->currentShield == 3;
}
-s32 func_8008F0D8(Player* player, UNK_TYPE arg1)
-{
+s32 func_8008F0D8(Player* player, UNK_TYPE arg1) {
s32 temp_v0 = arg1 - 0x15;
- if (temp_v0 >= 0 && temp_v0 < 6)
- {
+ if (temp_v0 >= 0 && temp_v0 < 6) {
return temp_v0;
}
return -1;
}
-UNK_TYPE func_8008F104(Player* player)
-{
+UNK_TYPE func_8008F104(Player* player) {
return player->unk_151 == 0x10 || player->unk_151 == 0x11;
}
-UNK_TYPE func_8008F128(Player* player)
-{
+UNK_TYPE func_8008F128(Player* player) {
return func_8008F104(player) && player->heldActor == NULL;
}
-s32 func_8008F158(UNK_TYPE arg0)
-{
+s32 func_8008F158(UNK_TYPE arg0) {
s32 temp_v0 = arg0 - 2;
- if (temp_v0 > 0 && temp_v0 < 6)
- {
+ if (temp_v0 > 0 && temp_v0 < 6) {
return temp_v0;
}
return 0;
}
-void func_8008F180(Player* player)
-{
+void func_8008F180(Player* player) {
func_8008F158(player->unk_151);
}
-UNK_TYPE func_8008F1A0(Player* player)
-{
- if (player->unk_151 >= 5 && player->unk_151 < 8)
- {
+UNK_TYPE func_8008F1A0(Player* player) {
+ if (player->unk_151 >= 5 && player->unk_151 < 8) {
return 1;
}
return 0;
@@ -151,33 +122,27 @@ UNK_TYPE func_8008F1A0(Player* player)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008F1CC.s")
-s32 func_8008F224(Player* player, UNK_TYPE arg1)
-{
+s32 func_8008F224(Player* player, UNK_TYPE arg1) {
s32 temp_v0 = arg1 - 0x1E;
- if (temp_v0 >= 0 && temp_v0 < 0xD)
- {
+ if (temp_v0 >= 0 && temp_v0 < 0xD) {
return temp_v0;
}
return -1;
}
-void func_8008F250(Player* player)
-{
+void func_8008F250(Player* player) {
func_8008F224(player, player->unk_151);
}
-s32 func_8008F270(Player* player, UNK_TYPE arg1)
-{
+s32 func_8008F270(Player* player, UNK_TYPE arg1) {
s32 temp_v0 = arg1 - 0x12;
- if (temp_v0 >= 0 && temp_v0 < 2)
- {
+ if (temp_v0 >= 0 && temp_v0 < 2) {
return temp_v0;
}
return -1;
}
-s32 func_8008F29C(Player* player)
-{
+s32 func_8008F29C(Player* player) {
return func_8008F270(player, player->unk_151);
}
diff --git a/src/code/z_prenmi.c b/src/code/z_prenmi.c
index 1ea813704..26482f38e 100644
--- a/src/code/z_prenmi.c
+++ b/src/code/z_prenmi.c
@@ -2,23 +2,20 @@
#include <global.h>
#include <vt.h>
-void func_80092320(PreNMIContext* prenmiCtx)
-{
+void func_80092320(PreNMIContext* prenmiCtx) {
prenmiCtx->state.running = false;
prenmiCtx->state.init = NULL;
prenmiCtx->state.size = 0;
}
-void PreNMI_Update(PreNMIContext* prenmiCtx)
-{
+void PreNMI_Update(PreNMIContext* prenmiCtx) {
osSyncPrintf(VT_COL(YELLOW, BLACK) "prenmi_move\n" VT_RST);
// Strings existing only in rodata
("../z_prenmi.c");
("(int)volume = %d\n");
- if (prenmiCtx->timer == 0)
- {
+ if (prenmiCtx->timer == 0) {
ViConfig_UpdateVi(1);
func_80092320(prenmiCtx);
return;
@@ -27,8 +24,7 @@ void PreNMI_Update(PreNMIContext* prenmiCtx)
prenmiCtx->timer--;
}
-void PreNMI_Draw(PreNMIContext* prenmiCtx)
-{
+void PreNMI_Draw(PreNMIContext* prenmiCtx) {
GraphicsContext* gfxCtx = prenmiCtx->state.gfxCtx;
Gfx* gfxArr[5];
@@ -45,21 +41,17 @@ void PreNMI_Draw(PreNMIContext* prenmiCtx)
func_800C6B54(gfxArr, gfxCtx, "../z_prenmi.c", 112);
}
-void PreNMI_Main(PreNMIContext* prenmiCtx)
-{
+void PreNMI_Main(PreNMIContext* prenmiCtx) {
PreNMI_Update(prenmiCtx);
PreNMI_Draw(prenmiCtx);
prenmiCtx->state.unk_A0 = 1;
}
-void PreNMI_Destroy(PreNMIContext* prenmiCtx)
-{
-
+void PreNMI_Destroy(PreNMIContext* prenmiCtx) {
}
-void PreNMI_Init(PreNMIContext* prenmiCtx)
-{
+void PreNMI_Init(PreNMIContext* prenmiCtx) {
prenmiCtx->state.main = PreNMI_Main;
prenmiCtx->state.destroy = PreNMI_Destroy;
prenmiCtx->timer = 30;
diff --git a/src/code/z_prenmi_buff.c b/src/code/z_prenmi_buff.c
index 5616e3b79..9c5924bc9 100644
--- a/src/code/z_prenmi_buff.c
+++ b/src/code/z_prenmi_buff.c
@@ -1,20 +1,15 @@
#include <ultra64.h>
#include <global.h>
-#define COLD_RESET 0
-#define NMI 1
+#define COLD_RESET 0
+#define NMI 1
-
-void PreNmiBuff_Init(PreNmiBuff* this)
-{
+void PreNmiBuff_Init(PreNmiBuff* this) {
this->resetting = false;
- if (osResetType == COLD_RESET)
- {
+ if (osResetType == COLD_RESET) {
this->resetCount = 0;
this->duration = 0;
- }
- else
- {
+ } else {
this->resetCount++;
this->duration += this->resetTime;
}
@@ -22,14 +17,11 @@ void PreNmiBuff_Init(PreNmiBuff* this)
this->resetTime = 0;
}
-
-void PreNmiBuff_SetReset(PreNmiBuff* this)
-{
+void PreNmiBuff_SetReset(PreNmiBuff* this) {
this->resetting = true;
this->resetTime = osGetTime();
}
-u32 PreNmiBuff_IsResetting(PreNmiBuff* this)
-{
+u32 PreNmiBuff_IsResetting(PreNmiBuff* this) {
return this->resetting;
}
diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c
index 27d750315..4aa711e00 100644
--- a/src/code/z_rcp.c
+++ b/src/code/z_rcp.c
@@ -133,29 +133,25 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80094E54.s")
-Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y)
-{
+Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y) {
return Draw_TexScroll(gfxCtx, x, y, 0, 0);
}
-Gfx* Draw_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height)
-{
+Gfx* Draw_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height) {
Gfx* displayList = Graph_Alloc(gfxCtx, 3 * sizeof(Gfx));
x %= 2048;
y %= 2048;
gDPTileSync(displayList);
- gDPSetTileSize(displayList+1, 0, x, y,
- (x+((width-1)<<2)), (y+((height-1)<<2)));
- gSPEndDisplayList(displayList+2);
+ gDPSetTileSize(displayList + 1, 0, x, y, (x + ((width - 1) << 2)), (y + ((height - 1) << 2)));
+ gSPEndDisplayList(displayList + 2);
return displayList;
}
-Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1,
- s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2)
-{
+Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2,
+ u32 y2, s32 width2, s32 height2) {
Gfx* displayList = Graph_Alloc(gfxCtx, 5 * sizeof(Gfx));
x1 %= 2048;
@@ -164,20 +160,16 @@ Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 w
y2 %= 2048;
gDPTileSync(displayList);
- gDPSetTileSize(displayList+1, tile1, x1, y1,
- (x1+((width1-1)<<2)), (y1+((height1-1)<<2)));
- gDPTileSync(displayList+2);
- gDPSetTileSize(displayList+3, tile2, x2, y2,
- (x2+((width2-1)<<2)), (y2+((height2-1)<<2)));
- gSPEndDisplayList(displayList+4);
+ gDPSetTileSize(displayList + 1, tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2)));
+ gDPTileSync(displayList + 2);
+ gDPSetTileSize(displayList + 3, tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2)));
+ gSPEndDisplayList(displayList + 4);
return displayList;
}
-Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1,
- s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2,
- s32 red, s32 green, s32 blue, s32 alpha)
-{
+Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2,
+ u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha) {
Gfx* displayList = Graph_Alloc(gfxCtx, 6 * sizeof(Gfx));
x1 %= 2048;
@@ -186,13 +178,11 @@ Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y
y2 %= 2048;
gDPTileSync(displayList);
- gDPSetTileSize(displayList+1, tile1, x1, y1,
- (x1+((width1-1)<<2)), (y1+((height1-1)<<2)));
- gDPTileSync(displayList+2);
- gDPSetTileSize(displayList+3, tile2, x2, y2,
- (x2+((width2-1)<<2)), (y2+((height2-1)<<2)));
- gDPSetEnvColor(displayList+4, red, green, blue, alpha);
- gSPEndDisplayList(displayList+5);
+ gDPSetTileSize(displayList + 1, tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2)));
+ gDPTileSync(displayList + 2);
+ gDPSetTileSize(displayList + 3, tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2)));
+ gDPSetEnvColor(displayList + 4, red, green, blue, alpha);
+ gSPEndDisplayList(displayList + 5);
return displayList;
}
@@ -202,4 +192,3 @@ Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80095248.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_rcp/func_80095974.s")
-
diff --git a/src/code/z_room.c b/src/code/z_room.c
index 79c0d2bf6..f9973bfea 100644
--- a/src/code/z_room.c
+++ b/src/code/z_room.c
@@ -9,14 +9,13 @@ void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags);
Vec3f D_801270A0 = { 0.0f, 0.0f, 0.0f };
// unused
-Gfx D_801270B0[] =
-{
+Gfx D_801270B0[] = {
gsDPPipeSync(),
gsSPClearGeometryMode(G_ZBUFFER | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, SHADE, 0, 0, 0, SHADE, 0, 0, 0, SHADE),
- gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP |
- G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE,
+ gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
+ G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE,
G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2),
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, 320, 240),
@@ -24,21 +23,17 @@ Gfx D_801270B0[] =
gsSPEndDisplayList(),
};
-void (*sRoomDrawHandlers[])(GlobalContext* globalCtx, Room* room, u32 flags) =
-{
+void (*sRoomDrawHandlers[])(GlobalContext* globalCtx, Room* room, u32 flags) = {
func_80095AB4,
func_80096F6C,
func_80095D04,
};
-void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3)
-{
-
+void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3) {
}
// Room Draw Polygon Type 0
-void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags)
-{
+void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags) {
s32 i;
PolygonType0* polygon0;
PolygonDlist* polygonDlist;
@@ -48,16 +43,14 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags)
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_room.c", 193);
- if (flags & 1)
- {
+ if (flags & 1) {
func_800342EC(&D_801270A0, globalCtx);
gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment);
func_80093C80(globalCtx);
gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
}
- if (flags & 2)
- {
+ if (flags & 2) {
func_8003435C(&D_801270A0, globalCtx);
gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment);
func_80093D84(globalCtx->state.gfxCtx);
@@ -66,13 +59,14 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags)
polygon0 = &room->mesh->polygon0;
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon0->start);
- for (i = 0; i < polygon0->num; i++)
- {
- if ((flags & 1) && (polygonDlist->opa != NULL))
+ for (i = 0; i < polygon0->num; i++) {
+ if ((flags & 1) && (polygonDlist->opa != NULL)) {
gSPDisplayList(gfxCtx->polyOpa.p++, polygonDlist->opa);
+ }
- if ((flags & 2) && (polygonDlist->xlu != NULL))
+ if ((flags & 2) && (polygonDlist->xlu != NULL)) {
gSPDisplayList(gfxCtx->polyXlu.p++, polygonDlist->xlu);
+ }
polygonDlist++;
}
@@ -82,10 +76,9 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags)
#define SHAPE_SORT_MAX 64
-typedef struct struct_80095D04
-{
+typedef struct struct_80095D04 {
/* 0x00 */ PolygonDlist2* unk_00;
- /* 0x04 */ f32 unk_04;
+ /* 0x04 */ f32 unk_04;
/* 0x08 */ struct struct_80095D04* unk_08;
/* 0x0C */ struct struct_80095D04* unk_0C;
} struct_80095D04; // size = 0x10
@@ -93,8 +86,7 @@ typedef struct struct_80095D04
// Room Draw Polygon Type 2
#ifdef NON_MATCHING
// this function still needs some work
-void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
-{
+void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
PolygonType2* polygon2;
PolygonDlist2* polygonDlist;
struct_80095D04 spB8[SHAPE_SORT_MAX];
@@ -120,16 +112,14 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(sp5C, globalCtx->state.gfxCtx, "../z_room.c", 287);
- if (flags & 1)
- {
+ if (flags & 1) {
func_800342EC(&D_801270A0, globalCtx);
gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment);
func_80093C80(globalCtx);
gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
}
- if (flags & 2)
- {
+ if (flags & 2) {
func_8003435C(&D_801270A0, globalCtx);
gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment);
func_80093D84(globalCtx->state.gfxCtx);
@@ -143,46 +133,36 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
__assert("polygon2->num <= SHAPE_SORT_MAX", "../z_room.c", 317);
sp78 = polygonDlist;
- for (sp9C = 0; sp9C < polygon2->num; sp9C++)
- {
+ for (sp9C = 0; sp9C < polygon2->num; sp9C++) {
sp90.x = polygonDlist->pos.x;
sp90.y = polygonDlist->pos.y;
sp90.z = polygonDlist->pos.z;
func_800A6E10(&globalCtx->mf_11D60, &sp90, &sp84, &sp80);
temp_f0 = polygonDlist->unk_06;
- if (-temp_f0 < sp84.z)
- {
+ if (-temp_f0 < sp84.z) {
temp_f2 = sp84.z - temp_f0;
- if (temp_f2 < globalCtx->lightCtx.unk_0C)
- {
+ if (temp_f2 < globalCtx->lightCtx.unk_0C) {
spA4->unk_00 = polygonDlist;
spA4->unk_04 = temp_f2;
phi_v0 = spB4;
- if (spB4 == 0)
- {
+ if (spB4 == 0) {
spB0 = spA4;
spB4 = spA4;
spA4->unk_0C = NULL;
spA4->unk_08 = NULL;
- }
- else
- {
- do
- {
+ } else {
+ do {
if (spA4->unk_04 < phi_v0->unk_04)
break;
phi_v0 = phi_v0->unk_0C;
} while (phi_v0 != NULL);
- if (phi_v0 == NULL)
- {
+ if (phi_v0 == NULL) {
spA4->unk_08 = spB0;
spA4->unk_0C = NULL;
spB0->unk_0C = spA4;
spB0 = spA4;
- }
- else
- {
+ } else {
phi_a0 = phi_v0->unk_08;
spA4->unk_08 = phi_a0;
if (phi_a0 == NULL)
@@ -190,7 +170,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
else
phi_a0->unk_0C = spA4;
phi_v0->unk_08 = spA4;
- spA4->unk_0C = (void *) phi_v0;
+ spA4->unk_0C = (void*)phi_v0;
}
}
spA4 = spA4++;
@@ -202,32 +182,25 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
iREG(87) = polygon2->num;
sp9C = 1;
- while (spB4 != NULL)
- {
+ while (spB4 != NULL) {
phi_s0 = spB4->unk_00;
- if (iREG(86) != 0)
- {
+ if (iREG(86) != 0) {
phi_v1 = 0;
- while (phi_v1 < polygon2->num)
- {
+ while (phi_v1 < polygon2->num) {
if (phi_s0 == sp78)
break;
phi_v1++;
sp78++;
}
- if (((iREG(86) == 1) && (iREG(89) > sp9C)) ||
- ((iREG(86) == 2) && (iREG(89) == sp9C)))
- {
+ if (((iREG(86) == 1) && (iREG(89) > sp9C)) || ((iREG(86) == 2) && (iREG(89) == sp9C))) {
if ((flags & 1) && (phi_s0->opa != NULL))
gSPDisplayList(gfxCtx->polyOpa.p++, phi_s0->opa);
if ((flags & 2) && (phi_s0->xlu != NULL))
gSPDisplayList(gfxCtx->polyXlu.p++, phi_s0->xlu);
}
- }
- else
- {
+ } else {
if ((flags & 1) && (phi_s0->opa != NULL))
gSPDisplayList(gfxCtx->polyOpa.p++, phi_s0->opa);
@@ -251,14 +224,12 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags)
#ifdef NON_MATCHING
// long multiplication by 64 doesn't quite match
-s32 func_80096238(void* data)
-{
+s32 func_80096238(void* data) {
OSTime timeBefore;
OSTime timeAfter;
OSTime time;
- if (*(u32*)data == JPEG_MARKER)
- {
+ if (*(u32*)data == JPEG_MARKER) {
// Translates to: "EXPANDING JPEG DATA"
osSyncPrintf("JPEGデータを展開します\n");
// Translates to: "JPEG DATA ADDRESS %08x"
@@ -267,8 +238,7 @@ s32 func_80096238(void* data)
osSyncPrintf("ワークバッファアドレス(Zバッファ)%08x\n", gZBuffer);
timeBefore = osGetTime();
- if (!func_8006E418(data, gZBuffer, gGfxSPTaskOutputBuffer, sizeof(gGfxSPTaskOutputBuffer)))
- {
+ if (!func_8006E418(data, gZBuffer, gGfxSPTaskOutputBuffer, sizeof(gGfxSPTaskOutputBuffer))) {
timeAfter = osGetTime();
time = ((timeAfter - timeBefore) * 64) / 3000;
@@ -280,9 +250,7 @@ s32 func_80096238(void* data)
osSyncPrintf("元のバッファのサイズが150キロバイト無いと暴走するでしょう。\n");
bcopy(gZBuffer, data, sizeof(gZBuffer));
- }
- else
- {
+ } else {
// Translates to: "FAILURE! WHY IS IT 〜"
osSyncPrintf("失敗!なんで〜\n");
}
@@ -296,8 +264,8 @@ s32 func_80096238(void* data)
#ifdef NON_MATCHING
// pointer arithmetic doesn't quite match
-void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0, u16 tlutCount, f32 frameX, f32 frameY)
-{
+void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0,
+ u16 tlutCount, f32 frameX, f32 frameY) {
Gfx* displayListHead;
uObjBg* bg;
@@ -305,7 +273,7 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh
func_80096238(SEGMENTED_TO_VIRTUAL(source));
displayListHead++;
- gSPBranchList(displayListHead, displayListHead+5);
+ gSPBranchList(displayListHead, displayListHead + 5);
bg = (void*)displayListHead;
bg->b.imageX = 0;
bg->b.imageW = width * 4;
@@ -320,45 +288,36 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh
bg->b.imagePal = 0;
bg->b.imageFlip = 0;
- if (fmt == G_IM_FMT_CI)
- {
- displayListHead = (void*)(bg+1);
+ if (fmt == G_IM_FMT_CI) {
+ displayListHead = (void*)(bg + 1);
gDPLoadTLUT(displayListHead++, tlutCount, 256, tlut);
- }
- else
- {
- displayListHead = (void*)(bg+1);
+ } else {
+ displayListHead = (void*)(bg + 1);
gDPPipeSync(displayListHead++);
}
- if ((fmt == G_IM_FMT_RGBA) && (SREG(26) == 0))
- {
+ if ((fmt == G_IM_FMT_RGBA) && (SREG(26) == 0)) {
bg->b.frameW = width * 4;
bg->b.frameH = height * 4;
func_80104B00(bg);
gDPSetOtherMode(displayListHead++,
- mode0 | G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT |
- G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE,
+ mode0 | G_AD_PATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_CONV | G_TF_POINT | G_TT_NONE |
+ G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE,
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2);
gSPBgRectCopy(displayListHead++, bg);
- }
- else
- {
+ } else {
bg->s.frameW = width * 4;
bg->s.frameH = height * 4;
bg->s.scaleW = 1024;
bg->s.scaleH = 1024;
bg->s.imageYorig = bg->b.imageY;
gDPSetOtherMode(displayListHead++,
- mode0 | G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT |
- G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
- G_AC_THRESHOLD | G_ZS_PIXEL | AA_EN |
- CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | ALPHA_CVG_SEL |
- GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA) |
- GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA));
- gDPSetCombineLERP(displayListHead++,
- 0, 0, 0, TEXEL0, 0, 0, 0, 1,
- 0, 0, 0, TEXEL0, 0, 0, 0, 1);
+ mode0 | G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE |
+ G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
+ G_AC_THRESHOLD | G_ZS_PIXEL | AA_EN | CVG_DST_CLAMP | ZMODE_OPA | CVG_X_ALPHA | ALPHA_CVG_SEL |
+ GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA) |
+ GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_BL, G_BL_1MA));
+ gDPSetCombineLERP(displayListHead++, 0, 0, 0, TEXEL0, 0, 0, 0, 1, 0, 0, 0, TEXEL0, 0, 0, 0, 1);
gSPObjRenderMode(displayListHead++, 0x0C); // unknown object render mode?
gSPBgRect1Cyc(displayListHead++, bg);
}
@@ -367,13 +326,13 @@ void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 heigh
*displayList = displayListHead;
}
#else
-void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0, u16 tlutCount, f32 frameX, f32 frameY);
+void func_8009638C(Gfx** displayList, u32 source, u32 tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 mode0,
+ u16 tlutCount, f32 frameX, f32 frameY);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_room/func_8009638C.s")
#endif
// Room Draw Polygon Type 1 - Single Format
-void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags)
-{
+void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
Camera* camera;
Gfx* spA8;
PolygonType1* polygon1;
@@ -396,33 +355,27 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags)
sp94 = (flags & 1) && polygonDlist->opa && !(SREG(25) & 2);
sp90 = (flags & 2) && polygonDlist->xlu && !(SREG(25) & 4);
- if (sp94 || sp98)
- {
+ if (sp94 || sp98) {
gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment);
- if (sp94)
- {
+ if (sp94) {
func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, polygonDlist->opa);
}
- if (sp98)
- {
+ if (sp98) {
// gSPLoadUcodeL(gfxCtx->polyOpa.p++, rspS2DEX)?
gSPLoadUcodeEx(gfxCtx->polyOpa.p++, D_00113070, D_001579A0, 0x800);
- if (1)
- {
+ if (1) {
Vec3f sp60;
spA8 = gfxCtx->polyOpa.p;
func_8005AFB4(&sp60, camera);
- func_8009638C(&spA8, polygon1->single.source, polygon1->single.tlut,
- polygon1->single.width, polygon1->single.height,
- polygon1->single.fmt, polygon1->single.siz,
+ func_8009638C(&spA8, polygon1->single.source, polygon1->single.tlut, polygon1->single.width,
+ polygon1->single.height, polygon1->single.fmt, polygon1->single.siz,
polygon1->single.mode0, polygon1->single.tlutCount,
- (sp60.x + sp60.z) * 1.2f + sp60.y * 0.6f,
- sp60.y * 2.4f + (sp60.x + sp60.z) * 0.3f);
+ (sp60.x + sp60.z) * 1.2f + sp60.y * 0.6f, sp60.y * 2.4f + (sp60.x + sp60.z) * 0.3f);
gfxCtx->polyOpa.p = spA8;
}
@@ -431,8 +384,7 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags)
}
}
- if (sp90)
- {
+ if (sp90) {
gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment);
func_80093D84(globalCtx->state.gfxCtx);
gSPMatrix(gfxCtx->polyXlu.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
@@ -442,16 +394,14 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_room.c", 691);
}
-typedef struct
-{
+typedef struct {
char unk_00[0x0E];
- s16 unk_0E;
+ s16 unk_0E;
} struct_80041C10_ret;
extern struct_80041C10_ret* func_80041C10(CollisionContext*, s32, s32);
-BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx)
-{
+BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
Camera* camera;
s32 camId;
s16 camId2;
@@ -462,17 +412,18 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx)
camera = globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0];
camId = camera->unk_148;
camId2 = func_80041C10(&globalCtx->colCtx, camId, 50)->unk_0E;
- if (camId2 >= 0)
+ if (camId2 >= 0) {
camId = camId2;
+ }
player = PLAYER;
player->actor.params = (player->actor.params & 0xFF00) | camId;
bgImage = SEGMENTED_TO_VIRTUAL(polygon1->multi.list);
- for (i = 0; i < polygon1->multi.count; i++)
- {
- if (bgImage->id == camId)
+ for (i = 0; i < polygon1->multi.count; i++) {
+ if (bgImage->id == camId) {
return bgImage;
+ }
bgImage++;
}
@@ -486,8 +437,7 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx)
// Room Draw Polygon Type 1 - Multi Format
#ifdef NON_MATCHING
// regalloc differences
-void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags)
-{
+void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
Camera* camera;
Gfx* spA8;
BgImage* bgImage;
@@ -512,33 +462,26 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags)
sp90 = (flags & 1) && polygonDlist->opa && !(SREG(25) & 2);
sp8C = (flags & 2) && polygonDlist->xlu && !(SREG(25) & 4);
- if (sp90 || sp94)
- {
+ if (sp90 || sp94) {
gSPSegment(gfxCtx->polyOpa.p++, 0x03, room->segment);
- if (sp90)
- {
+ if (sp90) {
func_80093D18(globalCtx->state.gfxCtx);
gSPMatrix(gfxCtx->polyOpa.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
gSPDisplayList(gfxCtx->polyOpa.p++, polygonDlist->opa);
}
- if (sp94)
- {
+ if (sp94) {
// gSPLoadUcodeL(gfxCtx->polyOpa.p++, rspS2DEX)?
gSPLoadUcodeEx(gfxCtx->polyOpa.p++, D_00113070, D_001579A0, 0x800);
- if (1)
- {
+ if (1) {
Vec3f sp5C;
spA8 = gfxCtx->polyOpa.p;
func_8005AFB4(&sp5C, camera);
- func_8009638C(&spA8, bgImage->source, bgImage->tlut,
- bgImage->width, bgImage->height,
- bgImage->fmt, bgImage->siz,
- bgImage->mode0, bgImage->tlutCount,
- (sp5C.x + sp5C.z) * 1.2f + sp5C.y * 0.6f,
- sp5C.y * 2.4f + (sp5C.x + sp5C.z) * 0.3f);
+ func_8009638C(&spA8, bgImage->source, bgImage->tlut, bgImage->width, bgImage->height, bgImage->fmt,
+ bgImage->siz, bgImage->mode0, bgImage->tlutCount,
+ (sp5C.x + sp5C.z) * 1.2f + sp5C.y * 0.6f, sp5C.y * 2.4f + (sp5C.x + sp5C.z) * 0.3f);
gfxCtx->polyOpa.p = spA8;
}
@@ -547,8 +490,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags)
}
}
- if (sp8C)
- {
+ if (sp8C) {
gSPSegment(gfxCtx->polyXlu.p++, 0x03, room->segment);
func_80093D84(globalCtx->state.gfxCtx);
gSPMatrix(gfxCtx->polyXlu.p++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
@@ -562,28 +504,26 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags)
#endif
// Room Draw Polygon Type 1
-void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags)
-{
+void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags) {
PolygonType1* polygon1 = &room->mesh->polygon1;
- if (polygon1->format == 1)
+ if (polygon1->format == 1) {
func_80096680(globalCtx, room, flags);
- else if (polygon1->format == 2)
+ } else if (polygon1->format == 2) {
func_80096B6C(globalCtx, room, flags);
- else
+ } else {
LogUtils_HungupThread("../z_room.c", 841);
+ }
}
-void func_80096FD4(GlobalContext* globalCtx, Room* room)
-{
+void func_80096FD4(GlobalContext* globalCtx, Room* room) {
room->num = -1;
room->segment = NULL;
}
#ifdef NON_MATCHING
// regalloc differences
-u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx)
-{
+u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
RomFile* roomList;
TransitionActorEntry* transitionActor;
s32 i, j;
@@ -598,30 +538,27 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx)
maxRoomSize = 0;
roomList = globalCtx->roomList;
- for (i = 0; i < globalCtx->nbRooms; i++)
- {
+ for (i = 0; i < globalCtx->nbRooms; i++) {
roomSize = roomList[i].vromEnd - roomList[i].vromStart;
osSyncPrintf("ROOM%d size=%d\n", i, roomSize);
if (maxRoomSize < roomSize)
maxRoomSize = roomSize;
}
- if (globalCtx->nbTransitionActors != 0)
- {
+ if (globalCtx->nbTransitionActors != 0) {
j = 0;
roomList = globalCtx->roomList;
transitionActor = &globalCtx->transitionActorList[0];
LogUtils_LogThreadId("../z_room.c", 912);
osSyncPrintf("game_play->room_rom_address.num = %d\n", globalCtx->nbRooms);
- for (j = 0; j < globalCtx->nbTransitionActors; j++)
- {
+ for (j = 0; j < globalCtx->nbTransitionActors; j++) {
frontRoom = transitionActor->frontRoom;
backRoom = transitionActor->backRoom;
frontRoomSize = (frontRoom < 0) ? 0 : roomList[frontRoom].vromEnd - roomList[frontRoom].vromStart;
backRoomSize = (backRoom < 0) ? 0 : roomList[backRoom].vromEnd - roomList[backRoom].vromStart;
cumulRoomSize = (frontRoom != backRoom) ? frontRoomSize + backRoomSize : frontRoomSize;
- osSyncPrintf("DOOR%d=<%d> ROOM1=<%d, %d> ROOM2=<%d, %d>\n",
- j, cumulRoomSize, frontRoom, frontRoomSize, backRoom, backRoomSize);
+ osSyncPrintf("DOOR%d=<%d> ROOM1=<%d, %d> ROOM2=<%d, %d>\n", j, cumulRoomSize, frontRoom, frontRoomSize,
+ backRoom, backRoomSize);
if (maxRoomSize < cumulRoomSize)
maxRoomSize = cumulRoomSize;
transitionActor++;
@@ -642,7 +579,7 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx)
roomCtx->status = 0;
if (gSaveContext.respawn_flag > 0)
- nextRoomNum = gSaveContext.respawn[gSaveContext.respawn_flag-1].room_index;
+ nextRoomNum = gSaveContext.respawn[gSaveContext.respawn_flag - 1].room_index;
else
nextRoomNum = globalCtx->setupEntranceList[globalCtx->curSpawn].room;
func_8009728C(globalCtx, roomCtx, nextRoomNum);
@@ -653,30 +590,29 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_room/func_80096FE8.s")
#endif
-s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum)
-{
+s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum) {
u32 size;
- if (0) ; // Necessary to match
+ if (0) {} // Necessary to match
- if (roomCtx->status == 0)
- {
+ if (roomCtx->status == 0) {
roomCtx->prevRoom = roomCtx->curRoom;
roomCtx->curRoom.num = roomNum;
roomCtx->curRoom.segment = NULL;
roomCtx->status = 1;
- if (roomNum >= globalCtx->nbRooms)
+ if (roomNum >= globalCtx->nbRooms) {
__assert("read_room_ID < game_play->room_rom_address.num", "../z_room.c", 1009);
+ }
size = globalCtx->roomList[roomNum].vromEnd - globalCtx->roomList[roomNum].vromStart;
roomCtx->unk_34 = (void*)ALIGN16((s32)roomCtx->bufPtrs[roomCtx->unk_30] - ((size + 8) * roomCtx->unk_30 + 7));
- if (0) ; // Also necessary to match
+ if (0) {} // Also necessary to match
osCreateMesgQueue(&roomCtx->loadQueue, &roomCtx->loadMsg, 1);
- DmaMgr_SendRequest2(&roomCtx->dmaRequest, roomCtx->unk_34, globalCtx->roomList[roomNum].vromStart, size,
- 0, &roomCtx->loadQueue, NULL, "../z_room.c", 1036);
+ DmaMgr_SendRequest2(&roomCtx->dmaRequest, roomCtx->unk_34, globalCtx->roomList[roomNum].vromStart, size, 0,
+ &roomCtx->loadQueue, NULL, "../z_room.c", 1036);
roomCtx->unk_30 ^= 1;
return 1;
@@ -685,12 +621,9 @@ s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum)
return 0;
}
-s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx)
-{
- if (roomCtx->status == 1)
- {
- if (!osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK))
- {
+s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) {
+ if (roomCtx->status == 1) {
+ if (!osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK)) {
roomCtx->status = 0;
roomCtx->curRoom.segment = roomCtx->unk_34;
gSegments[3] = PHYSICAL_TO_VIRTUAL2(roomCtx->unk_34);
@@ -708,25 +641,24 @@ s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx)
return 1;
}
-void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags)
-{
- if (room->segment != NULL)
- {
+void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
+ if (room->segment != NULL) {
gSegments[3] = PHYSICAL_TO_VIRTUAL(room->segment);
- if (room->mesh->polygon.type >= ARRAY_COUNTU(sRoomDrawHandlers))
+ if (room->mesh->polygon.type >= ARRAY_COUNTU(sRoomDrawHandlers)) {
__assert("this->ground_shape->polygon.type < number(Room_Draw_Proc)", "../z_room.c", 1125);
+ }
sRoomDrawHandlers[room->mesh->polygon.type](globalCtx, room, flags);
}
}
-void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx)
-{
+void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx) {
roomCtx->prevRoom.num = -1;
roomCtx->prevRoom.segment = NULL;
func_80031B14(globalCtx, &globalCtx->actorCtx);
Actor_SpawnTransitionActors(globalCtx, &globalCtx->actorCtx);
func_80080E04(globalCtx, roomCtx->curRoom.num);
- if (!((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_SPOT20)))
+ if (!((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_SPOT20))) {
func_800807A0(globalCtx);
+ }
func_800F66C0(globalCtx->roomCtx.curRoom.echo);
}
diff --git a/src/code/z_sample.c b/src/code/z_sample.c
index 9aaf1db51..cbd934701 100644
--- a/src/code/z_sample.c
+++ b/src/code/z_sample.c
@@ -2,10 +2,8 @@
#include <global.h>
#include <PR/os_cont.h>
-void Sample_Calc(SampleContext* this)
-{
- if (!~(this->state.input[0].padPressed | ~START_BUTTON))
- {
+void Sample_Calc(SampleContext* this) {
+ if (!~(this->state.input[0].padPressed | ~START_BUTTON)) {
SET_NEXT_GAMESTATE(&this->state, func_800BCA64, GlobalContext);
this->state.running = false;
}
@@ -13,8 +11,7 @@ void Sample_Calc(SampleContext* this)
// very close from matching, the only difference is the place of "mtx" in the stack
#ifdef NON_MATCHING
-void Sample_Draw(SampleContext* this)
-{
+void Sample_Draw(SampleContext* this) {
u32 pad;
GraphicsContext* gfxCtx = this->state.gfxCtx;
View* view = &this->view;
@@ -49,19 +46,15 @@ void Sample_Draw(SampleContext* this)
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/Sample_Draw.s")
#endif
-void Sample_Update(SampleContext* this)
-{
+void Sample_Update(SampleContext* this) {
Sample_Draw(this);
Sample_Calc(this);
}
-void Sample_Destroy(SampleContext* this)
-{
-
+void Sample_Destroy(SampleContext* this) {
}
-void Sample_SetupView(SampleContext* this)
-{
+void Sample_SetupView(SampleContext* this) {
View* view;
GraphicsContext* gfxCtx;
u32 v0[4];
@@ -94,16 +87,14 @@ void Sample_SetupView(SampleContext* this)
func_800AA358(view, &v1, &v2, &v3);
}
-void Sample_LoadTitleStatic(SampleContext* this)
-{
+void Sample_LoadTitleStatic(SampleContext* this) {
u32 size = _title_staticSegmentRomEnd - _title_staticSegmentRomStart;
-
+
this->staticSegment = Game_Alloc(&this->state, size, "../z_sample.c", 163);
DmaMgr_SendRequest1(this->staticSegment, _title_staticSegmentRomStart, size, "../z_sample.c", 164);
}
-void Sample_Init(SampleContext* this)
-{
+void Sample_Init(SampleContext* this) {
this->state.main = Sample_Update;
this->state.destroy = Sample_Destroy;
R_UPDATE_RATE = 1;
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index 2bd552296..c8c97459c 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -4,26 +4,31 @@
RomFile sNaviMsgFiles[];
-s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId)
-{
+s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId) {
u32 size;
objectCtx->status[objectCtx->num].id = objectId;
size = gObjectTable[objectId].vromEnd - gObjectTable[objectId].vromStart;
- osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n",
- objectId, (f64)(size / 1024.0f), objectCtx->status[objectCtx->num].segment);
+ osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", objectId, (f64)(size / 1024.0f),
+ objectCtx->status[objectCtx->num].segment);
- osSyncPrintf("num=%d adrs=%x end=%x\n",
- objectCtx->num, (s32)objectCtx->status[objectCtx->num].segment + size, objectCtx->spaceEnd);
+ osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (s32)objectCtx->status[objectCtx->num].segment + size,
+ objectCtx->spaceEnd);
- if (!((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) && (((s32)objectCtx->status[objectCtx->num].segment + size) < (s32)objectCtx->spaceEnd)))
- __assert("this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment", "../z_scene.c", 142);
+ if (!((objectCtx->num < OBJECT_EXCHANGE_BANK_MAX) &&
+ (((s32)objectCtx->status[objectCtx->num].segment + size) < (s32)objectCtx->spaceEnd))) {
+ __assert("this->num < OBJECT_EXCHANGE_BANK_MAX && (this->status[this->num].Segment + size) < this->endSegment",
+ "../z_scene.c", 142);
+ }
- DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size, "../z_scene.c", 145);
+ DmaMgr_SendRequest1(objectCtx->status[objectCtx->num].segment, gObjectTable[objectId].vromStart, size,
+ "../z_scene.c", 145);
- if (objectCtx->num < OBJECT_EXCHANGE_BANK_MAX - 1)
- objectCtx->status[objectCtx->num + 1].segment = (void*)ALIGN16((s32)objectCtx->status[objectCtx->num].segment + size);
+ if (objectCtx->num < OBJECT_EXCHANGE_BANK_MAX - 1) {
+ objectCtx->status[objectCtx->num + 1].segment =
+ (void*)ALIGN16((s32)objectCtx->status[objectCtx->num].segment + size);
+ }
objectCtx->num++;
objectCtx->unk_09 = objectCtx->num;
@@ -31,35 +36,33 @@ s32 Object_Spawn(ObjectContext* objectCtx, s16 objectId)
return objectCtx->num - 1;
}
-void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx)
-{
+void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx) {
GlobalContext* globalCtx2 = globalCtx; // Needs to be a new variable to match (possibly a sub struct?)
u32 spaceSize;
s32 i;
- if (globalCtx2->sceneNum == SCENE_SPOT00)
+ if (globalCtx2->sceneNum == SCENE_SPOT00) {
spaceSize = 1024000;
- else if (globalCtx2->sceneNum == SCENE_GANON_DEMO)
- {
- if (gSaveContext.scene_setup_index != 4)
+ } else if (globalCtx2->sceneNum == SCENE_GANON_DEMO) {
+ if (gSaveContext.scene_setup_index != 4) {
spaceSize = 1177600;
- else
+ } else {
spaceSize = 1024000;
- }
- else if (globalCtx2->sceneNum == SCENE_JYASINBOSS)
+ }
+ } else if (globalCtx2->sceneNum == SCENE_JYASINBOSS) {
spaceSize = 1075200;
- else if (globalCtx2->sceneNum == SCENE_KENJYANOMA)
+ } else if (globalCtx2->sceneNum == SCENE_KENJYANOMA) {
spaceSize = 1075200;
- else if (globalCtx2->sceneNum == SCENE_GANON_BOSS)
+ } else if (globalCtx2->sceneNum == SCENE_GANON_BOSS) {
spaceSize = 1075200;
- else
+ } else {
spaceSize = 1024000;
+ }
objectCtx->num = objectCtx->unk_09 = 0;
objectCtx->mainKeepIndex = objectCtx->subKeepIndex = 0;
- for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++)
- {
+ for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++) {
objectCtx->status[i].id = 0;
}
@@ -68,37 +71,32 @@ void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx)
osSyncPrintf("オブジェクト入れ替えバンク情報 %8.3fKB\n", (f64)(spaceSize / 1024.0f));
osSyncPrintf(VT_RST);
- objectCtx->spaceStart = objectCtx->status[0].segment = Game_Alloc(&globalCtx->state, spaceSize, "../z_scene.c", 219);
+ objectCtx->spaceStart = objectCtx->status[0].segment =
+ Game_Alloc(&globalCtx->state, spaceSize, "../z_scene.c", 219);
objectCtx->spaceEnd = (void*)((s32)objectCtx->spaceStart + spaceSize);
objectCtx->mainKeepIndex = Object_Spawn(objectCtx, OBJECT_GAMEPLAY_KEEP);
gSegments[4] = PHYSICAL_TO_VIRTUAL(objectCtx->status[objectCtx->mainKeepIndex].segment);
}
-void Object_UpdateBank(ObjectContext* objectCtx)
-{
+void Object_UpdateBank(ObjectContext* objectCtx) {
s32 i;
ObjectStatus* status;
RomFile* objectFile;
u32 size;
status = &objectCtx->status[0];
- for (i = 0; i < objectCtx->num; i++)
- {
- if (status->id < 0)
- {
- if (status->dmaRequest.vromAddr == 0)
- {
+ for (i = 0; i < objectCtx->num; i++) {
+ if (status->id < 0) {
+ if (status->dmaRequest.vromAddr == 0) {
osCreateMesgQueue(&status->loadQueue, &status->loadMsg, 1);
objectFile = &gObjectTable[-status->id];
size = objectFile->vromEnd - objectFile->vromStart;
- osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n",
- i, (f64)(size / 1024.0f), status->segment);
- DmaMgr_SendRequest2(&status->dmaRequest, status->segment, objectFile->vromStart, size,
- 0, &status->loadQueue, NULL, "../z_scene.c", 266);
- }
- else if (!osRecvMesg(&status->loadQueue, NULL, OS_MESG_NOBLOCK))
- {
+ osSyncPrintf("OBJECT EXCHANGE BANK-%2d SIZE %8.3fK SEG=%08x\n", i, (f64)(size / 1024.0f),
+ status->segment);
+ DmaMgr_SendRequest2(&status->dmaRequest, status->segment, objectFile->vromStart, size, 0,
+ &status->loadQueue, NULL, "../z_scene.c", 266);
+ } else if (!osRecvMesg(&status->loadQueue, NULL, OS_MESG_NOBLOCK)) {
status->id = -status->id;
}
}
@@ -106,47 +104,43 @@ void Object_UpdateBank(ObjectContext* objectCtx)
}
}
-s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId)
-{
+s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) {
s32 i;
- for (i = 0; i < objectCtx->num; i++)
- {
- if (ABS(objectCtx->status[i].id) == objectId)
+ for (i = 0; i < objectCtx->num; i++) {
+ if (ABS(objectCtx->status[i].id) == objectId) {
return i;
+ }
}
return -1;
}
-s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex)
-{
- if (objectCtx->status[bankIndex].id > 0)
+s32 Object_IsLoaded(ObjectContext* objectCtx, s32 bankIndex) {
+ if (objectCtx->status[bankIndex].id > 0) {
return 1;
- else
+ } else {
return 0;
+ }
}
-void func_800981B8(ObjectContext* objectCtx)
-{
+void func_800981B8(ObjectContext* objectCtx) {
s32 i;
s32 id;
u32 size;
- for (i = 0; i < objectCtx->num; i++)
- {
+ for (i = 0; i < objectCtx->num; i++) {
id = objectCtx->status[i].id;
size = gObjectTable[id].vromEnd - gObjectTable[id].vromStart;
- osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n",
- objectCtx->status[i].id, (f64)(size / 1024.0f), objectCtx->status[i].segment);
- osSyncPrintf("num=%d adrs=%x end=%x\n",
- objectCtx->num, (s32)objectCtx->status[i].segment + size, objectCtx->spaceEnd);
+ osSyncPrintf("OBJECT[%d] SIZE %fK SEG=%x\n", objectCtx->status[i].id, (f64)(size / 1024.0f),
+ objectCtx->status[i].segment);
+ osSyncPrintf("num=%d adrs=%x end=%x\n", objectCtx->num, (s32)objectCtx->status[i].segment + size,
+ objectCtx->spaceEnd);
DmaMgr_SendRequest1(objectCtx->status[i].segment, gObjectTable[id].vromStart, size, "../z_scene.c", 342);
}
}
-void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId)
-{
+void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) {
ObjectStatus* status = &objectCtx->status[bankIndex];
RomFile* objectFile = &gObjectTable[objectId];
u32 size;
@@ -156,14 +150,15 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId)
status->dmaRequest.vromAddr = 0;
size = objectFile->vromEnd - objectFile->vromStart;
- osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n",
- bankIndex, objectId, (f64)(size / 1024.0f));
+ osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n", bankIndex, objectId, (f64)(size / 1024.0f));
- if (1) // Necessary to match
+ if (1) { // Necessary to match
nextPtr = (void*)ALIGN16((s32)status->segment + size);
+ }
- if (nextPtr >= objectCtx->spaceEnd)
+ if (nextPtr >= objectCtx->spaceEnd) {
__assert("nextptr < this->endSegment", "../z_scene.c", 381);
+ }
// Translates to: "OBJECT EXCHANGE FREE SIZE=%08x"
osSyncPrintf("オブジェクト入れ替え空きサイズ=%08x\n", (s32)objectCtx->spaceEnd - (s32)nextPtr);
@@ -171,25 +166,21 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId)
return nextPtr;
}
-s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd)
-{
+s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd) {
u32 cmdCode;
- while (1)
- {
+ while (1) {
cmdCode = sceneCmd->base.code;
- osSyncPrintf("*** Scene_Word = { code=%d, data1=%02x, data2=%04x } ***\n",
- cmdCode, sceneCmd->base.data1, sceneCmd->base.data2);
+ osSyncPrintf("*** Scene_Word = { code=%d, data1=%02x, data2=%04x } ***\n", cmdCode, sceneCmd->base.data1,
+ sceneCmd->base.data2);
- if (cmdCode == 0x14)
+ if (cmdCode == 0x14) {
break;
+ }
- if (cmdCode <= 0x19)
- {
+ if (cmdCode <= 0x19) {
gSceneCmdHandlers[cmdCode](globalCtx, sceneCmd);
- }
- else
- {
+ } else {
osSyncPrintf(VT_FGCOL(RED));
// Translates to: "code VARIABLE IS ABNORMAL"
osSyncPrintf("code の値が異常です\n");
@@ -205,8 +196,7 @@ s32 Scene_ExecuteCommands(GlobalContext* globalCtx, SceneCmd* sceneCmd)
// Scene Command 0x00: Link Spawn List
#ifdef NON_MATCHING
// regalloc differences
-void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd) {
ActorEntry* linkEntry = (ActorEntry*)SEGMENTED_TO_VIRTUAL(cmd->spawnList.segment) +
globalCtx->setupEntranceList[globalCtx->curSpawn].spawn;
s16 linkObjectId;
@@ -227,21 +217,18 @@ void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd);
#endif
// Scene Command 0x01: Actor List
-void func_800985DC(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_800985DC(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->nbSetupActors = cmd->actorList.num;
globalCtx->setupActorList = SEGMENTED_TO_VIRTUAL(cmd->actorList.segment);
}
// Scene Command 0x02: Cutscene Camera List
-void func_80098630(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098630(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->unk_11DFC = SEGMENTED_TO_VIRTUAL(cmd->csCameraList.segment);
}
// Scene Command 0x03: Collision Header
-void func_80098674(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098674(GlobalContext* globalCtx, SceneCmd* cmd) {
CollisionHeader* colHeader;
colHeader = SEGMENTED_TO_VIRTUAL(cmd->colHeader.segment);
@@ -256,34 +243,30 @@ void func_80098674(GlobalContext* globalCtx, SceneCmd* cmd)
}
// Scene Command 0x04: Room List
-void func_800987A4(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_800987A4(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->nbRooms = cmd->roomList.num;
globalCtx->roomList = SEGMENTED_TO_VIRTUAL(cmd->roomList.segment);
}
// Scene Command 0x06: Entrance List
-void func_800987F8(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_800987F8(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupEntranceList = SEGMENTED_TO_VIRTUAL(cmd->entranceList.segment);
}
// Scene Command 0x07: Special Files
-void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd)
-{
- if (cmd->specialFiles.keepObjectId != 0)
- {
+void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd) {
+ if (cmd->specialFiles.keepObjectId != 0) {
globalCtx->objectCtx.subKeepIndex = Object_Spawn(&globalCtx->objectCtx, cmd->specialFiles.keepObjectId);
gSegments[5] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment);
}
- if (cmd->specialFiles.naviMsgNum != 0)
+ if (cmd->specialFiles.naviMsgNum != 0) {
globalCtx->naviMsgSegment = func_800BFE5C(globalCtx, &sNaviMsgFiles[cmd->specialFiles.naviMsgNum - 1]);
+ }
}
// Scene Command 0x08: Room Behavior
-void func_80098904(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098904(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->roomCtx.curRoom.unk_03 = cmd->roomBehavior.gpFlag1;
globalCtx->roomCtx.curRoom.unk_02 = cmd->roomBehavior.gpFlag2 & 0xFF;
globalCtx->roomCtx.curRoom.showInvisActors = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
@@ -291,16 +274,14 @@ void func_80098904(GlobalContext* globalCtx, SceneCmd* cmd)
}
// Scene Command 0x0A: Mesh Header
-void func_80098958(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098958(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->roomCtx.curRoom.mesh = SEGMENTED_TO_VIRTUAL(cmd->mesh.segment);
}
// Scene Command 0x0B: Object List
#ifdef NON_MATCHING
// this function still needs some work
-void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd) {
s32 i, j, k;
s16* objectEntry;
ObjectStatus* status;
@@ -313,21 +294,16 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd)
k = 0;
status = status2;
i = globalCtx->objectCtx.unk_09;
- while (i < globalCtx->objectCtx.num)
- {
- if (status->id != *objectEntry)
- {
+ while (i < globalCtx->objectCtx.num) {
+ if (status->id != *objectEntry) {
status3 = status2;
- for (j = i; j < globalCtx->objectCtx.num; j++)
- {
+ for (j = i; j < globalCtx->objectCtx.num; j++) {
status3->id = 0;
status3++;
}
globalCtx->objectCtx.num = i;
func_80031A28(globalCtx, &globalCtx->actorCtx);
- }
- else
- {
+ } else {
i++;
status++;
k++;
@@ -339,8 +315,7 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd)
if (cmd->objectList.num > OBJECT_EXCHANGE_BANK_MAX)
__assert("scene_info->object_bank.num <= OBJECT_EXCHANGE_BANK_MAX", "../z_scene.c", 705);
- while (k < cmd->objectList.num)
- {
+ while (k < cmd->objectList.num) {
nextPtr = func_800982FC(&globalCtx->objectCtx, i, *objectEntry);
if (i < OBJECT_EXCHANGE_BANK_MAX - 1)
globalCtx->objectCtx.status[i + 1].segment = nextPtr;
@@ -357,75 +332,69 @@ void func_8009899C(GlobalContext* globalCtx, SceneCmd* cmd);
#endif
// Scene Command 0x0C: Light List
-void func_80098B74(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098B74(GlobalContext* globalCtx, SceneCmd* cmd) {
s32 i;
LightInfo* lightInfo;
lightInfo = SEGMENTED_TO_VIRTUAL(cmd->lightList.segment);
- for (i = 0; i < cmd->lightList.num; i++)
- {
+ for (i = 0; i < cmd->lightList.num; i++) {
Lights_Insert(globalCtx, &globalCtx->lightCtx, lightInfo);
lightInfo++;
}
}
// Scene Command 0x0D: Path List
-void func_80098C24(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098C24(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupPathList = SEGMENTED_TO_VIRTUAL(cmd->pathList.segment);
}
// Scene Command 0x0E: Transition Actor List
-void func_80098C68(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098C68(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->nbTransitionActors = cmd->transiActorList.num;
globalCtx->transitionActorList = SEGMENTED_TO_VIRTUAL(cmd->transiActorList.segment);
}
-void func_80098CBC(GlobalContext* globalCtx, u8* nbTransitionActors)
-{
+void func_80098CBC(GlobalContext* globalCtx, u8* nbTransitionActors) {
*nbTransitionActors = 0;
}
// Scene Command 0x0F: Light Setting List
-void func_80098CC8(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098CC8(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->nbLightSettings = cmd->lightSettingList.num;
globalCtx->lightSettingsList = SEGMENTED_TO_VIRTUAL(cmd->lightSettingList.segment);
}
// Scene Command 0x11: Skybox Settings
-void func_80098D1C(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098D1C(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->skyboxId = cmd->skyboxSettings.skyboxId;
globalCtx->gloomySky = globalCtx->unk_10A3C = cmd->skyboxSettings.unk_05;
globalCtx->unk_10A42 = cmd->skyboxSettings.unk_06;
}
// Scene Command 0x12: Skybox Disables
-void func_80098D5C(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098D5C(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->skyDisabled = cmd->skyboxDisables.unk_04;
globalCtx->sunMoonDisabled = cmd->skyboxDisables.unk_05;
}
// Scene Command 0x10: Time Settings
-void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd) {
u32 dayTime;
- if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF))
+ if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF)) {
gSaveContext.environment_time = gSaveContext.day_time =
((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f;
+ }
- if (cmd->timeSettings.unk_06 != 0xFF)
+ if (cmd->timeSettings.unk_06 != 0xFF) {
globalCtx->unk_10A26 = cmd->timeSettings.unk_06;
- else
+ } else {
globalCtx->unk_10A26 = 0;
+ }
- if (gSaveContext.unk_1422 == 0)
+ if (gSaveContext.unk_1422 == 0) {
D_8011FB40 = globalCtx->unk_10A26;
+ }
dayTime = gSaveContext.day_time;
globalCtx->unk_10A28 = -(Math_Sins(dayTime - 0x8000) * 120.0f) * 25.0f;
@@ -435,23 +404,22 @@ void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd)
globalCtx->unk_10A30 = (Math_Coss(dayTime - 0x8000) * 20.0f) * 25.0f;
if (((globalCtx->unk_10A26 == 0) && (gSaveContext.cutscene_index < 0xFFF0)) ||
- (gSaveContext.entrance_index == 0x0604))
- {
+ (gSaveContext.entrance_index == 0x0604)) {
gSaveContext.environment_time = gSaveContext.day_time;
- if ((gSaveContext.environment_time >= 0x2AAC) && (gSaveContext.environment_time < 0x4555))
+ if ((gSaveContext.environment_time >= 0x2AAC) && (gSaveContext.environment_time < 0x4555)) {
gSaveContext.environment_time = 0x3556;
- else if ((gSaveContext.environment_time >= 0x4555) && (gSaveContext.environment_time < 0x5556))
+ } else if ((gSaveContext.environment_time >= 0x4555) && (gSaveContext.environment_time < 0x5556)) {
gSaveContext.environment_time = 0x5556;
- else if ((gSaveContext.environment_time >= 0xAAAB) && (gSaveContext.environment_time < 0xB556))
+ } else if ((gSaveContext.environment_time >= 0xAAAB) && (gSaveContext.environment_time < 0xB556)) {
gSaveContext.environment_time = 0xB556;
- else if ((gSaveContext.environment_time >= 0xC001) && (gSaveContext.environment_time < 0xCAAC))
+ } else if ((gSaveContext.environment_time >= 0xC001) && (gSaveContext.environment_time < 0xCAAC)) {
gSaveContext.environment_time = 0xCAAC;
+ }
}
}
// Scene Command 0x05: Wind Settings
-void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd) {
s8 temp1 = cmd->windSettings.unk_04;
s8 temp2 = cmd->windSettings.unk_05;
s8 temp3 = cmd->windSettings.unk_06;
@@ -463,38 +431,33 @@ void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd)
}
// Scene Command 0x13: Exit List
-void func_800990F0(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_800990F0(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupExitList = SEGMENTED_TO_VIRTUAL(cmd->exitList.segment);
}
// Scene Command 0x09: Undefined
-void func_80099134(GlobalContext* globalCtx, SceneCmd* cmd)
-{
-
+void func_80099134(GlobalContext* globalCtx, SceneCmd* cmd) {
}
// Scene Command 0x15: Sound Settings
-void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->soundCtx.musicSeq = cmd->soundSettings.musicSeq;
globalCtx->soundCtx.nighttimeSFX = cmd->soundSettings.nighttimeSFX;
- if (gSaveContext.seq_index == 0xFF)
+ if (gSaveContext.seq_index == 0xFF) {
Audio_SetBGM(cmd->soundSettings.bgmId | 0xF0000000);
+ }
}
// Scene Command 0x16: Echo Setting
-void func_8009918C(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_8009918C(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->roomCtx.curRoom.echo = cmd->echoSettings.echo;
}
// Scene Command 0x18: Alternate Headers
#ifdef NON_MATCHING
// minor ordering and regalloc differences
-void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) {
SceneCmd** altHeaders;
SceneCmd* altHeader;
@@ -502,31 +465,25 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd)
osSyncPrintf("\n[ZU]sceneset time =[%X]", gSaveContext.cutscene_index);
osSyncPrintf("\n[ZU]sceneset counter=[%X]", gSaveContext.scene_setup_index);
- if (gSaveContext.scene_setup_index != 0)
- {
+ if (gSaveContext.scene_setup_index != 0) {
altHeaders = SEGMENTED_TO_VIRTUAL(cmd->altHeaders.segment);
altHeader = altHeaders[gSaveContext.scene_setup_index - 1];
- if (altHeader != NULL)
- {
+ if (altHeader != NULL) {
Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader));
(cmd + 1)->base.code = 0x14;
- }
- else
- {
+ } else {
// Translates to: "COUGHH! THERE IS NO SPECIFIED DATAAAAA!"
osSyncPrintf("\nげぼはっ! 指定されたデータがないでええっす!");
- if (gSaveContext.scene_setup_index == 3)
- {
+ if (gSaveContext.scene_setup_index == 3) {
altHeaders = SEGMENTED_TO_VIRTUAL(cmd->altHeaders.segment);
altHeader = altHeaders[gSaveContext.scene_setup_index - 2];
// Translates to: "USING ADULT DAY DATA THERE!"
osSyncPrintf("\nそこで、大人の昼データを使用するでええっす!!");
- if (altHeader != NULL)
- {
+ if (altHeader != NULL) {
Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader));
(cmd + 1)->base.code = 0x14;
}
@@ -540,73 +497,47 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd);
#endif
// Scene Command 0x17: Cutscene Data
-void func_8009934C(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_8009934C(GlobalContext* globalCtx, SceneCmd* cmd) {
osSyncPrintf("\ngame_play->demo_play.data=[%x]", globalCtx->csCtx.segment);
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(cmd->cutsceneData.segment);
}
// Scene Command 0x19: Misc. Settings (Camera & World Map Area)
-void func_800993C0(GlobalContext* globalCtx, SceneCmd* cmd)
-{
+void func_800993C0(GlobalContext* globalCtx, SceneCmd* cmd) {
YREG(15) = cmd->miscSettings.cameraMovement;
gSaveContext.world_map_area = cmd->miscSettings.area;
- if ((globalCtx->sceneNum == SCENE_SHOP1) || (globalCtx->sceneNum == SCENE_SYATEKIJYOU))
- {
- if (LINK_AGE_IN_YEARS == YEARS_ADULT)
- {
+ if ((globalCtx->sceneNum == SCENE_SHOP1) || (globalCtx->sceneNum == SCENE_SYATEKIJYOU)) {
+ if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
gSaveContext.world_map_area = 1;
}
}
if (((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_GANON_TOU)) ||
- ((globalCtx->sceneNum >= SCENE_ENTRA) && (globalCtx->sceneNum <= SCENE_SHRINE_R)))
- {
- if (gSaveContext.cutscene_index < 0xFFF0)
- {
+ ((globalCtx->sceneNum >= SCENE_ENTRA) && (globalCtx->sceneNum <= SCENE_SHRINE_R))) {
+ if (gSaveContext.cutscene_index < 0xFFF0) {
gSaveContext.world_map_area_data |= gBitFlags[gSaveContext.world_map_area];
- osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.world_map_area_data, gSaveContext.world_map_area);
+ osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.world_map_area_data,
+ gSaveContext.world_map_area);
}
}
}
-void (*gSceneCmdHandlers[])(GlobalContext*, SceneCmd*) =
-{
- func_80098508,
- func_800985DC,
- func_80098630,
- func_80098674,
- func_800987A4,
- func_80099090,
- func_800987F8,
- func_8009883C,
- func_80098904,
- func_80099134,
- func_80098958,
- func_8009899C,
- func_80098B74,
- func_80098C24,
- func_80098C68,
- func_80098CC8,
- func_80098D80,
- func_80098D1C,
- func_80098D5C,
- func_800990F0,
- NULL,
- func_80099140,
- func_8009918C,
- func_8009934C,
- func_800991A0,
- func_800993C0,
+void (*gSceneCmdHandlers[])(GlobalContext*, SceneCmd*) = {
+ func_80098508, func_800985DC, func_80098630, func_80098674, func_800987A4, func_80099090, func_800987F8,
+ func_8009883C, func_80098904, func_80099134, func_80098958, func_8009899C, func_80098B74, func_80098C24,
+ func_80098C68, func_80098CC8, func_80098D80, func_80098D1C, func_80098D5C, func_800990F0, NULL,
+ func_80099140, func_8009918C, func_8009934C, func_800991A0, func_800993C0,
};
-#define ROM_FILE(name) { (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomEnd }
-#define ROM_FILE_EMPTY(name) { (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomStart }
-#define ROM_FILE_UNSET { 0 }
+#define ROM_FILE(name) \
+ { (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd }
+#define ROM_FILE_EMPTY(name) \
+ { (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomStart }
+#define ROM_FILE_UNSET \
+ { 0 }
-RomFile sNaviMsgFiles[] =
-{
+RomFile sNaviMsgFiles[] = {
ROM_FILE(elf_message_field),
ROM_FILE(elf_message_ydan),
ROM_FILE_UNSET,
@@ -616,8 +547,7 @@ s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD };
u32 gObjectTableSize = 402;
-RomFile gObjectTable[] =
-{
+RomFile gObjectTable[] = {
ROM_FILE_UNSET,
ROM_FILE(gameplay_keep),
ROM_FILE(gameplay_field_keep),
diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c
index 54d69eb8c..86d79168f 100644
--- a/src/code/z_scene_table.c
+++ b/src/code/z_scene_table.c
@@ -1,1582 +1,538 @@
#include <ultra64.h>
#include <global.h>
-EntranceInfo gEntranceTable[] =
-{
- { 0x00, 0x00, 0, 1, 0x02, 0x02 },
- { 0x00, 0x00, 0, 1, 0x02, 0x02 },
- { 0x00, 0x00, 0, 1, 0x02, 0x02 },
- { 0x00, 0x00, 0, 1, 0x02, 0x02 },
- { 0x01, 0x00, 0, 1, 0x02, 0x02 },
- { 0x01, 0x00, 0, 1, 0x02, 0x02 },
- { 0x01, 0x00, 0, 1, 0x02, 0x02 },
- { 0x01, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x14, 0x00, 1, 1, 0x02, 0x02 },
- { 0x14, 0x00, 1, 1, 0x02, 0x02 },
- { 0x14, 0x00, 1, 1, 0x02, 0x02 },
- { 0x14, 0x00, 1, 1, 0x02, 0x02 },
- { 0x05, 0x00, 0, 1, 0x02, 0x02 },
- { 0x05, 0x00, 0, 1, 0x02, 0x02 },
- { 0x05, 0x00, 0, 1, 0x02, 0x02 },
- { 0x05, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6E, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6E, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6E, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6E, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6C, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6C, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6C, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6C, 0x00, 0, 1, 0x02, 0x02 },
- { 0x68, 0x00, 0, 1, 0x02, 0x02 },
- { 0x68, 0x00, 0, 1, 0x02, 0x02 },
- { 0x68, 0x00, 0, 1, 0x02, 0x02 },
- { 0x68, 0x00, 0, 1, 0x02, 0x02 },
- { 0x69, 0x00, 0, 1, 0x02, 0x02 },
- { 0x69, 0x00, 0, 1, 0x02, 0x02 },
- { 0x69, 0x00, 0, 1, 0x02, 0x02 },
- { 0x69, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x02, 0x00, 0, 1, 0x02, 0x02 },
- { 0x02, 0x00, 0, 1, 0x02, 0x02 },
- { 0x02, 0x00, 0, 1, 0x02, 0x02 },
- { 0x02, 0x00, 0, 1, 0x02, 0x02 },
- { 0x02, 0x00, 0, 1, 0x02, 0x02 },
- { 0x41, 0x00, 0, 1, 0x02, 0x26 },
- { 0x41, 0x00, 0, 1, 0x02, 0x26 },
- { 0x41, 0x00, 0, 1, 0x02, 0x26 },
- { 0x41, 0x00, 0, 1, 0x02, 0x26 },
- { 0x41, 0x00, 0, 1, 0x02, 0x02 },
- { 0x41, 0x00, 0, 1, 0x02, 0x02 },
- { 0x1B, 0x00, 1, 1, 0x03, 0x03 },
- { 0x1C, 0x00, 1, 1, 0x02, 0x02 },
- { 0x1D, 0x00, 1, 1, 0x03, 0x03 },
- { 0x1D, 0x00, 1, 1, 0x02, 0x02 },
- { 0x07, 0x00, 0, 1, 0x02, 0x02 },
- { 0x07, 0x00, 0, 1, 0x02, 0x02 },
- { 0x07, 0x00, 0, 1, 0x02, 0x02 },
- { 0x07, 0x00, 0, 1, 0x02, 0x02 },
- { 0x42, 0x00, 0, 1, 0x04, 0x20 },
- { 0x42, 0x00, 0, 1, 0x04, 0x20 },
- { 0x42, 0x00, 0, 1, 0x04, 0x20 },
- { 0x42, 0x00, 0, 1, 0x04, 0x20 },
- { 0x3E, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x00, 0, 1, 0x02, 0x02 },
- { 0x38, 0x00, 0, 1, 0x04, 0x20 },
- { 0x38, 0x00, 0, 1, 0x04, 0x20 },
- { 0x38, 0x00, 0, 1, 0x04, 0x20 },
- { 0x38, 0x00, 0, 1, 0x04, 0x20 },
- { 0x6A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x6A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x40, 0x00, 0, 1, 0x02, 0x26 },
- { 0x40, 0x00, 0, 1, 0x02, 0x26 },
- { 0x40, 0x00, 0, 1, 0x02, 0x26 },
- { 0x40, 0x00, 0, 1, 0x02, 0x26 },
- { 0x4C, 0x00, 0, 1, 0x04, 0x20 },
- { 0x4C, 0x00, 0, 1, 0x04, 0x20 },
- { 0x4C, 0x00, 0, 1, 0x04, 0x20 },
- { 0x4C, 0x00, 0, 1, 0x04, 0x20 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x0B, 0x0B },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x43, 0x00, 0, 1, 0x02, 0x02 },
- { 0x10, 0x00, 0, 1, 0x04, 0x20 },
- { 0x10, 0x00, 0, 1, 0x04, 0x20 },
- { 0x10, 0x00, 0, 1, 0x04, 0x20 },
- { 0x10, 0x00, 0, 1, 0x04, 0x20 },
- { 0x1E, 0x03, 1, 1, 0x03, 0x03 },
- { 0x1F, 0x03, 1, 1, 0x02, 0x02 },
- { 0x1E, 0x03, 1, 1, 0x02, 0x02 },
- { 0x1F, 0x03, 1, 1, 0x02, 0x02 },
- { 0x44, 0x00, 0, 1, 0x07, 0x07 },
- { 0x44, 0x00, 0, 1, 0x07, 0x07 },
- { 0x44, 0x00, 0, 1, 0x07, 0x07 },
- { 0x44, 0x00, 0, 1, 0x07, 0x07 },
- { 0x44, 0x00, 0, 1, 0x0D, 0x02 },
- { 0x44, 0x00, 0, 1, 0x0D, 0x02 },
- { 0x44, 0x00, 0, 1, 0x03, 0x03 },
- { 0x4E, 0x00, 0, 1, 0x04, 0x20 },
- { 0x4E, 0x00, 0, 1, 0x04, 0x20 },
- { 0x4E, 0x00, 0, 1, 0x04, 0x20 },
- { 0x4E, 0x00, 0, 1, 0x04, 0x20 },
- { 0x6B, 0x00, 0, 1, 0x22, 0x22 },
- { 0x6B, 0x00, 0, 1, 0x22, 0x22 },
- { 0x6B, 0x00, 0, 1, 0x22, 0x22 },
- { 0x6B, 0x00, 0, 1, 0x22, 0x22 },
- { 0x45, 0x00, 0, 1, 0x22, 0x04 },
- { 0x46, 0x00, 0, 1, 0x22, 0x04 },
- { 0x45, 0x00, 0, 1, 0x22, 0x04 },
- { 0x46, 0x00, 0, 1, 0x22, 0x04 },
- { 0x4D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x4D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x4D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x4D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x06, 0x00, 0, 1, 0x02, 0x02 },
- { 0x06, 0x00, 0, 1, 0x02, 0x02 },
- { 0x06, 0x00, 0, 1, 0x02, 0x02 },
- { 0x06, 0x00, 0, 1, 0x02, 0x02 },
- { 0x06, 0x00, 0, 1, 0x02, 0x02 },
- { 0x06, 0x00, 0, 1, 0x02, 0x02 },
- { 0x09, 0x00, 0, 1, 0x02, 0x02 },
- { 0x09, 0x00, 0, 1, 0x02, 0x02 },
- { 0x09, 0x00, 0, 1, 0x02, 0x02 },
- { 0x09, 0x00, 0, 1, 0x02, 0x02 },
- { 0x09, 0x00, 0, 1, 0x02, 0x02 },
- { 0x17, 0x00, 1, 1, 0x02, 0x02 },
- { 0x17, 0x00, 1, 1, 0x02, 0x02 },
- { 0x17, 0x00, 1, 1, 0x02, 0x02 },
- { 0x17, 0x00, 1, 1, 0x02, 0x02 },
- { 0x17, 0x00, 0, 1, 0x02, 0x02 },
- { 0x17, 0x00, 0, 1, 0x02, 0x02 },
- { 0x17, 0x00, 0, 1, 0x02, 0x02 },
- { 0x65, 0x00, 0, 1, 0x02, 0x02 },
- { 0x65, 0x00, 0, 1, 0x02, 0x02 },
- { 0x65, 0x00, 0, 1, 0x02, 0x02 },
- { 0x65, 0x00, 0, 1, 0x02, 0x02 },
- { 0x08, 0x00, 0, 1, 0x04, 0x04 },
- { 0x08, 0x00, 0, 1, 0x04, 0x04 },
- { 0x08, 0x00, 0, 1, 0x04, 0x04 },
- { 0x08, 0x00, 0, 1, 0x04, 0x04 },
- { 0x27, 0x00, 0, 1, 0x04, 0x04 },
- { 0x27, 0x00, 0, 1, 0x04, 0x04 },
- { 0x27, 0x00, 0, 1, 0x04, 0x04 },
- { 0x27, 0x00, 0, 1, 0x04, 0x04 },
- { 0x47, 0x00, 0, 1, 0x03, 0x03 },
- { 0x47, 0x00, 0, 1, 0x03, 0x03 },
- { 0x47, 0x00, 0, 1, 0x03, 0x03 },
- { 0x47, 0x00, 0, 1, 0x03, 0x03 },
- { 0x47, 0x00, 0, 1, 0x0A, 0x0A },
- { 0x47, 0x00, 0, 1, 0x02, 0x0A },
- { 0x47, 0x00, 1, 1, 0x0A, 0x0A },
- { 0x47, 0x00, 0, 1, 0x0B, 0x0B },
- { 0x47, 0x00, 0, 1, 0x03, 0x03 },
- { 0x47, 0x00, 0, 1, 0x02, 0x02 },
- { 0x47, 0x00, 0, 1, 0x02, 0x02 },
- { 0x47, 0x00, 0, 1, 0x03, 0x03 },
- { 0x47, 0x00, 0, 1, 0x03, 0x03 },
- { 0x1E, 0x00, 1, 1, 0x03, 0x03 },
- { 0x1F, 0x00, 1, 1, 0x02, 0x02 },
- { 0x1E, 0x00, 1, 1, 0x02, 0x02 },
- { 0x1F, 0x00, 1, 1, 0x02, 0x02 },
- { 0x20, 0x00, 1, 1, 0x03, 0x03 },
- { 0x21, 0x00, 1, 1, 0x02, 0x02 },
- { 0x22, 0x00, 1, 1, 0x02, 0x02 },
- { 0x22, 0x00, 1, 1, 0x02, 0x02 },
- { 0x20, 0x00, 0, 1, 0x08, 0x08 },
- { 0x67, 0x00, 0, 1, 0x02, 0x02 },
- { 0x2C, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2C, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2C, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2C, 0x00, 0, 1, 0x04, 0x20 },
- { 0x34, 0x00, 0, 1, 0x04, 0x04 },
- { 0x34, 0x00, 0, 1, 0x04, 0x04 },
- { 0x34, 0x00, 0, 1, 0x04, 0x04 },
- { 0x34, 0x00, 0, 1, 0x04, 0x04 },
- { 0x34, 0x00, 0, 1, 0x04, 0x02 },
- { 0x34, 0x00, 0, 1, 0x10, 0x10 },
- { 0x2D, 0x00, 0, 1, 0x04, 0x04 },
- { 0x2D, 0x00, 0, 1, 0x04, 0x04 },
- { 0x2D, 0x00, 0, 1, 0x04, 0x04 },
- { 0x2D, 0x00, 0, 1, 0x04, 0x04 },
- { 0x01, 0x01, 1, 0, 0x02, 0x02 },
- { 0x01, 0x01, 1, 0, 0x02, 0x02 },
- { 0x01, 0x01, 1, 0, 0x02, 0x02 },
- { 0x01, 0x01, 1, 0, 0x02, 0x02 },
- { 0x26, 0x00, 0, 1, 0x04, 0x04 },
- { 0x26, 0x00, 0, 1, 0x04, 0x04 },
- { 0x26, 0x00, 0, 1, 0x04, 0x04 },
- { 0x26, 0x00, 0, 1, 0x04, 0x04 },
- { 0x51, 0x00, 0, 1, 0x03, 0x03 },
- { 0x51, 0x00, 0, 1, 0x02, 0x02 },
- { 0x51, 0x00, 0, 1, 0x03, 0x03 },
- { 0x51, 0x00, 0, 1, 0x02, 0x02 },
- { 0x51, 0x00, 0, 1, 0x04, 0x02 },
- { 0x51, 0x00, 0, 1, 0x21, 0x21 },
- { 0x51, 0x00, 0, 1, 0x21, 0x21 },
- { 0x51, 0x00, 0, 1, 0x23, 0x23 },
- { 0x51, 0x00, 0, 1, 0x03, 0x03 },
- { 0x51, 0x00, 1, 1, 0x02, 0x02 },
- { 0x51, 0x00, 0, 1, 0x23, 0x23 },
- { 0x51, 0x00, 0, 1, 0x03, 0x03 },
- { 0x51, 0x00, 0, 1, 0x29, 0x29 },
- { 0x51, 0x00, 1, 1, 0x03, 0x03 },
- { 0x52, 0x00, 0, 1, 0x03, 0x03 },
- { 0x52, 0x00, 0, 1, 0x02, 0x02 },
- { 0x52, 0x00, 0, 1, 0x03, 0x03 },
- { 0x52, 0x00, 0, 1, 0x02, 0x02 },
- { 0x52, 0x00, 0, 1, 0x26, 0x26 },
- { 0x52, 0x00, 0, 1, 0x21, 0x21 },
- { 0x52, 0x00, 1, 1, 0x21, 0x21 },
- { 0x52, 0x00, 0, 1, 0x21, 0x21 },
- { 0x52, 0x00, 1, 1, 0x02, 0x02 },
- { 0x53, 0x00, 0, 1, 0x03, 0x03 },
- { 0x53, 0x00, 0, 1, 0x02, 0x02 },
- { 0x53, 0x00, 0, 1, 0x03, 0x03 },
- { 0x53, 0x00, 0, 1, 0x02, 0x02 },
- { 0x53, 0x00, 0, 1, 0x04, 0x02 },
- { 0x53, 0x00, 1, 1, 0x02, 0x02 },
- { 0x54, 0x00, 1, 1, 0x03, 0x03 },
- { 0x54, 0x00, 1, 1, 0x02, 0x02 },
- { 0x54, 0x00, 1, 1, 0x03, 0x03 },
- { 0x54, 0x00, 1, 1, 0x02, 0x02 },
- { 0x55, 0x00, 0, 1, 0x03, 0x03 },
- { 0x55, 0x00, 0, 1, 0x02, 0x02 },
- { 0x55, 0x00, 0, 1, 0x03, 0x03 },
- { 0x55, 0x00, 0, 1, 0x02, 0x02 },
- { 0x55, 0x00, 1, 1, 0x0A, 0x0A },
- { 0x55, 0x00, 0, 1, 0x0A, 0x0A },
- { 0x55, 0x00, 1, 1, 0x0A, 0x0A },
- { 0x55, 0x00, 0, 1, 0x0D, 0x0A },
- { 0x55, 0x00, 0, 1, 0x0A, 0x0A },
- { 0x55, 0x00, 0, 1, 0x0A, 0x0A },
- { 0x55, 0x00, 1, 1, 0x02, 0x02 },
- { 0x55, 0x00, 1, 1, 0x02, 0x02 },
- { 0x55, 0x00, 1, 1, 0x02, 0x02 },
- { 0x55, 0x00, 1, 1, 0x02, 0x02 },
- { 0x56, 0x00, 1, 1, 0x02, 0x02 },
- { 0x56, 0x00, 1, 1, 0x02, 0x02 },
- { 0x56, 0x00, 1, 1, 0x02, 0x02 },
- { 0x56, 0x00, 1, 1, 0x02, 0x02 },
- { 0x56, 0x00, 0, 1, 0x03, 0x03 },
- { 0x56, 0x00, 0, 1, 0x00, 0x00 },
- { 0x57, 0x00, 1, 1, 0x03, 0x03 },
- { 0x57, 0x00, 1, 1, 0x02, 0x02 },
- { 0x57, 0x00, 1, 1, 0x03, 0x03 },
- { 0x57, 0x00, 1, 1, 0x02, 0x02 },
- { 0x57, 0x00, 0, 1, 0x03, 0x03 },
- { 0x57, 0x00, 1, 1, 0x02, 0x02 },
- { 0x58, 0x00, 0, 1, 0x02, 0x02 },
- { 0x58, 0x00, 0, 1, 0x02, 0x02 },
- { 0x58, 0x00, 0, 1, 0x02, 0x02 },
- { 0x58, 0x00, 0, 1, 0x02, 0x02 },
- { 0x58, 0x00, 1, 1, 0x02, 0x02 },
- { 0x58, 0x00, 1, 1, 0x02, 0x02 },
- { 0x59, 0x00, 0, 1, 0x03, 0x03 },
- { 0x59, 0x00, 0, 1, 0x02, 0x02 },
- { 0x59, 0x00, 0, 1, 0x03, 0x03 },
- { 0x59, 0x00, 0, 1, 0x02, 0x02 },
- { 0x59, 0x00, 0, 1, 0x0D, 0x00 },
- { 0x59, 0x00, 0, 1, 0x02, 0x02 },
- { 0x59, 0x00, 1, 1, 0x02, 0x02 },
- { 0x59, 0x00, 0, 1, 0x02, 0x02 },
- { 0x59, 0x00, 1, 1, 0x02, 0x02 },
- { 0x5A, 0x00, 0, 1, 0x03, 0x03 },
- { 0x5A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x5A, 0x00, 0, 1, 0x03, 0x03 },
- { 0x5A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x5A, 0x00, 1, 1, 0x0C, 0x0A },
- { 0x5A, 0x00, 1, 1, 0x0A, 0x0A },
- { 0x5A, 0x00, 1, 1, 0x02, 0x02 },
- { 0x5B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x5C, 0x00, 1, 1, 0x0F, 0x0F },
- { 0x5C, 0x00, 1, 1, 0x0F, 0x0F },
- { 0x5C, 0x00, 1, 1, 0x0F, 0x0F },
- { 0x5C, 0x00, 1, 1, 0x0F, 0x0F },
- { 0x5C, 0x00, 1, 1, 0x02, 0x02 },
- { 0x5C, 0x00, 1, 1, 0x0F, 0x0F },
- { 0x5D, 0x00, 1, 1, 0x03, 0x03 },
- { 0x5D, 0x00, 1, 1, 0x02, 0x02 },
- { 0x5D, 0x00, 1, 1, 0x03, 0x03 },
- { 0x5D, 0x00, 1, 1, 0x02, 0x02 },
- { 0x5D, 0x00, 1, 1, 0x21, 0x21 },
- { 0x5D, 0x00, 1, 1, 0x02, 0x02 },
- { 0x5D, 0x00, 1, 1, 0x02, 0x02 },
- { 0x5E, 0x00, 1, 1, 0x0E, 0x0E },
- { 0x5E, 0x00, 1, 1, 0x0E, 0x0E },
- { 0x5E, 0x00, 1, 1, 0x0E, 0x0E },
- { 0x5E, 0x00, 1, 1, 0x0E, 0x0E },
- { 0x0E, 0x01, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x01, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x01, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x01, 1, 1, 0x02, 0x02 },
- { 0x5F, 0x00, 0, 1, 0x03, 0x03 },
- { 0x5F, 0x00, 0, 1, 0x02, 0x02 },
- { 0x64, 0x00, 0, 1, 0x02, 0x02 },
- { 0x64, 0x00, 0, 1, 0x02, 0x02 },
- { 0x64, 0x00, 0, 1, 0x04, 0x02 },
- { 0x60, 0x00, 0, 1, 0x03, 0x03 },
- { 0x60, 0x00, 0, 1, 0x02, 0x02 },
- { 0x60, 0x00, 0, 1, 0x03, 0x03 },
- { 0x60, 0x00, 0, 1, 0x02, 0x02 },
- { 0x60, 0x00, 1, 1, 0x0A, 0x0A },
- { 0x60, 0x00, 0, 1, 0x03, 0x03 },
- { 0x60, 0x00, 0, 1, 0x02, 0x02 },
- { 0x60, 0x00, 1, 1, 0x02, 0x02 },
- { 0x60, 0x00, 1, 1, 0x03, 0x03 },
- { 0x60, 0x00, 1, 1, 0x03, 0x03 },
- { 0x61, 0x00, 0, 1, 0x02, 0x02 },
- { 0x61, 0x00, 0, 1, 0x02, 0x02 },
- { 0x61, 0x00, 0, 1, 0x02, 0x02 },
- { 0x61, 0x00, 0, 1, 0x02, 0x02 },
- { 0x61, 0x00, 0, 1, 0x03, 0x03 },
- { 0x61, 0x00, 0, 1, 0x02, 0x02 },
- { 0x62, 0x00, 0, 1, 0x02, 0x02 },
- { 0x62, 0x00, 0, 1, 0x02, 0x02 },
- { 0x62, 0x00, 0, 1, 0x02, 0x02 },
- { 0x62, 0x00, 0, 1, 0x02, 0x02 },
- { 0x62, 0x00, 0, 1, 0x02, 0x02 },
- { 0x62, 0x00, 1, 1, 0x02, 0x02 },
- { 0x58, 0x03, 0, 1, 0x00, 0x00 },
- { 0x58, 0x03, 0, 1, 0x00, 0x00 },
- { 0x58, 0x03, 0, 1, 0x00, 0x00 },
- { 0x58, 0x03, 0, 1, 0x00, 0x00 },
- { 0x63, 0x00, 0, 1, 0x03, 0x03 },
- { 0x63, 0x00, 0, 1, 0x02, 0x02 },
- { 0x63, 0x00, 0, 1, 0x03, 0x03 },
- { 0x63, 0x00, 0, 1, 0x02, 0x02 },
- { 0x63, 0x00, 0, 1, 0x20, 0x20 },
- { 0x63, 0x00, 0, 1, 0x2A, 0x2A },
- { 0x63, 0x00, 1, 1, 0x02, 0x02 },
- { 0x63, 0x00, 1, 1, 0x02, 0x02 },
- { 0x63, 0x00, 1, 1, 0x02, 0x02 },
- { 0x63, 0x00, 1, 1, 0x02, 0x02 },
- { 0x63, 0x00, 1, 1, 0x02, 0x02 },
- { 0x63, 0x00, 1, 1, 0x02, 0x02 },
- { 0x63, 0x00, 1, 1, 0x02, 0x02 },
- { 0x63, 0x00, 1, 1, 0x02, 0x02 },
- { 0x04, 0x00, 0, 1, 0x02, 0x02 },
- { 0x04, 0x00, 0, 1, 0x02, 0x02 },
- { 0x04, 0x00, 0, 1, 0x02, 0x02 },
- { 0x04, 0x00, 0, 1, 0x02, 0x02 },
- { 0x03, 0x00, 0, 1, 0x02, 0x02 },
- { 0x03, 0x00, 0, 1, 0x02, 0x02 },
- { 0x03, 0x00, 0, 1, 0x02, 0x02 },
- { 0x03, 0x00, 0, 1, 0x02, 0x02 },
- { 0x42, 0x01, 0, 1, 0x04, 0x20 },
- { 0x42, 0x01, 0, 1, 0x04, 0x20 },
- { 0x42, 0x01, 0, 1, 0x04, 0x20 },
- { 0x42, 0x01, 0, 1, 0x04, 0x20 },
- { 0x23, 0x00, 0, 1, 0x03, 0x03 },
- { 0x24, 0x00, 0, 1, 0x02, 0x02 },
- { 0x25, 0x00, 0, 1, 0x02, 0x02 },
- { 0x25, 0x00, 0, 1, 0x02, 0x02 },
- { 0x04, 0x01, 1, 1, 0x02, 0x02 },
- { 0x04, 0x01, 1, 1, 0x02, 0x02 },
- { 0x04, 0x01, 1, 1, 0x02, 0x02 },
- { 0x04, 0x01, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x00, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x00, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x00, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x00, 1, 1, 0x02, 0x02 },
- { 0x51, 0x01, 0, 1, 0x03, 0x03 },
- { 0x51, 0x01, 0, 1, 0x02, 0x02 },
- { 0x51, 0x01, 0, 1, 0x03, 0x03 },
- { 0x51, 0x01, 0, 1, 0x02, 0x02 },
- { 0x51, 0x02, 1, 1, 0x03, 0x03 },
- { 0x51, 0x02, 1, 1, 0x02, 0x02 },
- { 0x51, 0x02, 1, 1, 0x03, 0x03 },
- { 0x51, 0x02, 1, 1, 0x02, 0x02 },
- { 0x51, 0x03, 0, 1, 0x02, 0x02 },
- { 0x51, 0x03, 0, 1, 0x02, 0x02 },
- { 0x51, 0x03, 0, 1, 0x02, 0x02 },
- { 0x51, 0x03, 0, 1, 0x02, 0x02 },
- { 0x51, 0x04, 1, 1, 0x03, 0x03 },
- { 0x51, 0x04, 1, 1, 0x02, 0x02 },
- { 0x51, 0x04, 1, 1, 0x03, 0x03 },
- { 0x51, 0x04, 1, 1, 0x02, 0x02 },
- { 0x51, 0x05, 0, 1, 0x03, 0x03 },
- { 0x51, 0x05, 0, 1, 0x02, 0x02 },
- { 0x51, 0x05, 0, 1, 0x03, 0x03 },
- { 0x51, 0x05, 0, 1, 0x02, 0x02 },
- { 0x52, 0x01, 0, 1, 0x03, 0x03 },
- { 0x52, 0x01, 0, 1, 0x02, 0x02 },
- { 0x52, 0x01, 0, 1, 0x03, 0x03 },
- { 0x52, 0x01, 0, 1, 0x02, 0x02 },
- { 0x52, 0x02, 0, 1, 0x03, 0x03 },
- { 0x52, 0x02, 0, 1, 0x02, 0x02 },
- { 0x52, 0x02, 0, 1, 0x03, 0x03 },
- { 0x52, 0x02, 0, 1, 0x02, 0x02 },
- { 0x54, 0x01, 1, 1, 0x03, 0x03 },
- { 0x54, 0x01, 1, 1, 0x03, 0x03 },
- { 0x54, 0x01, 1, 1, 0x03, 0x03 },
- { 0x54, 0x01, 1, 1, 0x03, 0x03 },
- { 0x54, 0x02, 0, 1, 0x03, 0x03 },
- { 0x54, 0x02, 0, 1, 0x02, 0x02 },
- { 0x54, 0x02, 0, 1, 0x03, 0x03 },
- { 0x54, 0x02, 0, 1, 0x02, 0x02 },
- { 0x58, 0x01, 0, 1, 0x02, 0x02 },
- { 0x58, 0x01, 0, 1, 0x02, 0x02 },
- { 0x58, 0x01, 0, 1, 0x02, 0x02 },
- { 0x58, 0x01, 0, 1, 0x02, 0x02 },
- { 0x5A, 0x01, 0, 1, 0x03, 0x03 },
- { 0x5A, 0x01, 0, 1, 0x02, 0x02 },
- { 0x5A, 0x01, 0, 1, 0x03, 0x03 },
- { 0x5A, 0x01, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x01, 1, 1, 0x02, 0x02 },
- { 0x5B, 0x01, 1, 1, 0x02, 0x02 },
- { 0x5B, 0x01, 1, 1, 0x02, 0x02 },
- { 0x5B, 0x01, 1, 1, 0x02, 0x02 },
- { 0x5B, 0x02, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x02, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x02, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x02, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x03, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x03, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x03, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x03, 0, 1, 0x02, 0x02 },
- { 0x0E, 0x02, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x02, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x02, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x02, 1, 1, 0x02, 0x02 },
- { 0x60, 0x01, 0, 1, 0x03, 0x03 },
- { 0x60, 0x01, 0, 1, 0x02, 0x02 },
- { 0x60, 0x01, 0, 1, 0x03, 0x03 },
- { 0x60, 0x01, 0, 1, 0x02, 0x02 },
- { 0x60, 0x02, 0, 1, 0x03, 0x03 },
- { 0x60, 0x02, 0, 1, 0x02, 0x02 },
- { 0x60, 0x02, 0, 1, 0x03, 0x03 },
- { 0x60, 0x02, 0, 1, 0x02, 0x02 },
- { 0x62, 0x01, 0, 1, 0x02, 0x02 },
- { 0x62, 0x01, 0, 1, 0x02, 0x02 },
- { 0x62, 0x01, 0, 1, 0x02, 0x02 },
- { 0x62, 0x01, 0, 1, 0x02, 0x02 },
- { 0x38, 0x01, 0, 1, 0x04, 0x20 },
- { 0x38, 0x01, 0, 1, 0x04, 0x20 },
- { 0x38, 0x01, 0, 1, 0x04, 0x20 },
- { 0x38, 0x01, 0, 1, 0x04, 0x20 },
- { 0x1A, 0x05, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x05, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x05, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x05, 1, 1, 0x02, 0x02 },
- { 0x20, 0x08, 0, 1, 0x04, 0x02 },
- { 0x21, 0x08, 0, 1, 0x04, 0x02 },
- { 0x22, 0x08, 0, 1, 0x04, 0x02 },
- { 0x22, 0x08, 0, 1, 0x04, 0x02 },
- { 0x20, 0x09, 0, 1, 0x04, 0x02 },
- { 0x21, 0x09, 0, 1, 0x04, 0x02 },
- { 0x22, 0x09, 0, 1, 0x04, 0x02 },
- { 0x22, 0x09, 0, 1, 0x04, 0x02 },
- { 0x20, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x21, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x22, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x22, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x54, 0x03, 1, 1, 0x03, 0x03 },
- { 0x54, 0x03, 1, 1, 0x02, 0x02 },
- { 0x54, 0x03, 1, 1, 0x03, 0x03 },
- { 0x54, 0x03, 1, 1, 0x02, 0x02 },
- { 0x54, 0x04, 0, 1, 0x2C, 0x2C },
- { 0x54, 0x04, 0, 1, 0x2C, 0x2C },
- { 0x54, 0x04, 0, 1, 0x2C, 0x2C },
- { 0x54, 0x04, 0, 1, 0x2C, 0x2C },
- { 0x5C, 0x01, 0, 1, 0x03, 0x03 },
- { 0x5C, 0x01, 0, 1, 0x02, 0x02 },
- { 0x5C, 0x01, 0, 1, 0x03, 0x03 },
- { 0x5C, 0x01, 0, 1, 0x02, 0x02 },
- { 0x5C, 0x02, 0, 0, 0x03, 0x03 },
- { 0x5C, 0x02, 0, 0, 0x02, 0x02 },
- { 0x5C, 0x02, 0, 0, 0x03, 0x03 },
- { 0x5C, 0x02, 0, 0, 0x02, 0x02 },
- { 0x5C, 0x03, 0, 0, 0x03, 0x03 },
- { 0x5C, 0x03, 0, 0, 0x02, 0x02 },
- { 0x5C, 0x03, 0, 0, 0x03, 0x03 },
- { 0x5C, 0x03, 0, 0, 0x02, 0x02 },
- { 0x5C, 0x04, 0, 1, 0x02, 0x02 },
- { 0x5C, 0x04, 0, 1, 0x02, 0x02 },
- { 0x5C, 0x04, 0, 1, 0x02, 0x02 },
- { 0x5C, 0x04, 0, 1, 0x02, 0x02 },
- { 0x5C, 0x05, 0, 1, 0x03, 0x03 },
- { 0x5C, 0x05, 0, 1, 0x02, 0x02 },
- { 0x5C, 0x05, 0, 1, 0x03, 0x03 },
- { 0x5C, 0x05, 0, 1, 0x02, 0x02 },
- { 0x5C, 0x06, 1, 0, 0x0F, 0x0F },
- { 0x5C, 0x06, 1, 0, 0x0F, 0x0F },
- { 0x5C, 0x06, 1, 0, 0x0F, 0x0F },
- { 0x5C, 0x06, 1, 0, 0x0F, 0x0F },
- { 0x51, 0x06, 0, 1, 0x03, 0x03 },
- { 0x51, 0x06, 0, 1, 0x02, 0x02 },
- { 0x51, 0x06, 0, 1, 0x03, 0x03 },
- { 0x51, 0x06, 0, 1, 0x02, 0x02 },
- { 0x51, 0x07, 0, 1, 0x03, 0x03 },
- { 0x51, 0x07, 0, 1, 0x02, 0x02 },
- { 0x51, 0x07, 0, 1, 0x03, 0x03 },
- { 0x51, 0x07, 0, 1, 0x02, 0x02 },
- { 0x52, 0x03, 0, 1, 0x04, 0x02 },
- { 0x52, 0x03, 0, 1, 0x04, 0x02 },
- { 0x52, 0x03, 0, 1, 0x04, 0x02 },
- { 0x52, 0x03, 0, 1, 0x04, 0x02 },
- { 0x53, 0x01, 0, 1, 0x02, 0x02 },
- { 0x53, 0x01, 0, 1, 0x02, 0x02 },
- { 0x53, 0x01, 0, 1, 0x02, 0x02 },
- { 0x53, 0x01, 0, 1, 0x02, 0x02 },
- { 0x55, 0x01, 0, 1, 0x03, 0x03 },
- { 0x55, 0x01, 0, 1, 0x02, 0x02 },
- { 0x55, 0x01, 0, 1, 0x03, 0x03 },
- { 0x55, 0x01, 0, 1, 0x02, 0x02 },
- { 0x55, 0x02, 0, 1, 0x02, 0x02 },
- { 0x55, 0x02, 0, 1, 0x02, 0x02 },
- { 0x55, 0x02, 0, 1, 0x02, 0x02 },
- { 0x55, 0x02, 0, 1, 0x02, 0x02 },
- { 0x55, 0x03, 0, 1, 0x04, 0x04 },
- { 0x55, 0x03, 0, 1, 0x04, 0x04 },
- { 0x55, 0x03, 0, 1, 0x04, 0x04 },
- { 0x55, 0x03, 0, 1, 0x04, 0x04 },
- { 0x56, 0x01, 0, 1, 0x12, 0x12 },
- { 0x56, 0x01, 0, 1, 0x02, 0x02 },
- { 0x56, 0x01, 0, 1, 0x12, 0x12 },
- { 0x56, 0x01, 0, 1, 0x02, 0x02 },
- { 0x57, 0x01, 0, 1, 0x03, 0x03 },
- { 0x57, 0x01, 0, 1, 0x02, 0x02 },
- { 0x57, 0x01, 0, 1, 0x03, 0x03 },
- { 0x57, 0x01, 0, 1, 0x02, 0x02 },
- { 0x57, 0x02, 0, 1, 0x13, 0x13 },
- { 0x57, 0x02, 0, 1, 0x02, 0x02 },
- { 0x57, 0x02, 0, 1, 0x13, 0x13 },
- { 0x57, 0x02, 0, 1, 0x02, 0x02 },
- { 0x59, 0x01, 0, 1, 0x02, 0x02 },
- { 0x59, 0x01, 0, 1, 0x02, 0x02 },
- { 0x59, 0x01, 0, 1, 0x02, 0x02 },
- { 0x59, 0x01, 0, 1, 0x02, 0x02 },
- { 0x59, 0x02, 0, 1, 0x03, 0x03 },
- { 0x59, 0x02, 0, 1, 0x02, 0x02 },
- { 0x59, 0x02, 0, 1, 0x03, 0x03 },
- { 0x59, 0x02, 0, 1, 0x02, 0x02 },
- { 0x5A, 0x02, 1, 1, 0x03, 0x03 },
- { 0x5A, 0x02, 1, 1, 0x02, 0x02 },
- { 0x5A, 0x02, 1, 1, 0x03, 0x03 },
- { 0x5A, 0x02, 1, 1, 0x02, 0x02 },
- { 0x5A, 0x03, 1, 1, 0x03, 0x03 },
- { 0x5A, 0x03, 1, 1, 0x02, 0x02 },
- { 0x5A, 0x03, 1, 1, 0x03, 0x03 },
- { 0x5A, 0x03, 1, 1, 0x02, 0x02 },
- { 0x5D, 0x01, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x01, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x01, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x01, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x02, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x02, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x02, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x02, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x03, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x03, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x03, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x03, 0, 1, 0x02, 0x02 },
- { 0x5F, 0x01, 0, 1, 0x03, 0x03 },
- { 0x5F, 0x01, 0, 1, 0x02, 0x02 },
- { 0x64, 0x01, 0, 1, 0x05, 0x05 },
- { 0x64, 0x01, 0, 1, 0x05, 0x05 },
- { 0x5F, 0x01, 0, 1, 0x00, 0x00 },
- { 0x60, 0x03, 0, 1, 0x03, 0x03 },
- { 0x60, 0x03, 0, 1, 0x02, 0x02 },
- { 0x60, 0x03, 0, 1, 0x03, 0x03 },
- { 0x60, 0x03, 0, 1, 0x02, 0x02 },
- { 0x61, 0x01, 0, 1, 0x02, 0x02 },
- { 0x61, 0x01, 0, 1, 0x02, 0x02 },
- { 0x61, 0x01, 0, 1, 0x02, 0x02 },
- { 0x61, 0x01, 0, 1, 0x02, 0x02 },
- { 0x61, 0x02, 0, 1, 0x02, 0x02 },
- { 0x61, 0x02, 0, 1, 0x02, 0x02 },
- { 0x61, 0x02, 0, 1, 0x02, 0x02 },
- { 0x61, 0x02, 0, 1, 0x02, 0x02 },
- { 0x03, 0x01, 1, 1, 0x02, 0x02 },
- { 0x03, 0x01, 1, 1, 0x02, 0x02 },
- { 0x03, 0x01, 1, 1, 0x02, 0x02 },
- { 0x03, 0x01, 1, 1, 0x02, 0x02 },
- { 0x00, 0x01, 1, 0, 0x02, 0x02 },
- { 0x00, 0x01, 1, 0, 0x02, 0x02 },
- { 0x00, 0x01, 1, 0, 0x02, 0x02 },
- { 0x00, 0x01, 1, 0, 0x02, 0x02 },
- { 0x0E, 0x03, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x03, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x03, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x03, 1, 1, 0x02, 0x02 },
- { 0x20, 0x01, 0, 1, 0x03, 0x03 },
- { 0x21, 0x01, 0, 1, 0x02, 0x02 },
- { 0x22, 0x01, 0, 1, 0x02, 0x02 },
- { 0x22, 0x01, 0, 1, 0x02, 0x02 },
- { 0x20, 0x02, 0, 1, 0x03, 0x03 },
- { 0x21, 0x02, 0, 1, 0x02, 0x02 },
- { 0x22, 0x02, 0, 1, 0x02, 0x02 },
- { 0x22, 0x02, 0, 1, 0x02, 0x02 },
- { 0x20, 0x03, 1, 1, 0x03, 0x03 },
- { 0x21, 0x03, 1, 1, 0x02, 0x02 },
- { 0x22, 0x03, 1, 1, 0x02, 0x02 },
- { 0x22, 0x03, 1, 1, 0x02, 0x02 },
- { 0x55, 0x04, 0, 0, 0x04, 0x04 },
- { 0x55, 0x04, 0, 0, 0x04, 0x04 },
- { 0x55, 0x04, 0, 0, 0x04, 0x04 },
- { 0x55, 0x04, 0, 0, 0x04, 0x04 },
- { 0x55, 0x05, 0, 0, 0x04, 0x04 },
- { 0x55, 0x05, 0, 0, 0x04, 0x04 },
- { 0x55, 0x05, 0, 0, 0x04, 0x04 },
- { 0x55, 0x05, 0, 0, 0x04, 0x04 },
- { 0x1B, 0x02, 0, 0, 0x02, 0x02 },
- { 0x1C, 0x02, 0, 0, 0x02, 0x02 },
- { 0x1D, 0x02, 0, 0, 0x02, 0x02 },
- { 0x1D, 0x02, 0, 0, 0x02, 0x02 },
- { 0x34, 0x01, 0, 1, 0x04, 0x04 },
- { 0x34, 0x01, 0, 1, 0x04, 0x04 },
- { 0x34, 0x01, 0, 1, 0x04, 0x04 },
- { 0x34, 0x01, 0, 1, 0x04, 0x04 },
- { 0x1B, 0x01, 0, 1, 0x03, 0x03 },
- { 0x1C, 0x01, 0, 1, 0x02, 0x02 },
- { 0x1D, 0x01, 0, 1, 0x02, 0x02 },
- { 0x1D, 0x01, 0, 1, 0x02, 0x02 },
- { 0x51, 0x08, 1, 1, 0x03, 0x03 },
- { 0x51, 0x08, 1, 1, 0x02, 0x02 },
- { 0x51, 0x08, 1, 1, 0x03, 0x03 },
- { 0x51, 0x08, 1, 1, 0x02, 0x02 },
- { 0x51, 0x09, 0, 1, 0x03, 0x03 },
- { 0x51, 0x09, 0, 1, 0x03, 0x03 },
- { 0x51, 0x09, 0, 1, 0x03, 0x03 },
- { 0x51, 0x09, 0, 1, 0x03, 0x03 },
- { 0x51, 0x0A, 0, 1, 0x03, 0x03 },
- { 0x51, 0x0A, 0, 1, 0x03, 0x03 },
- { 0x51, 0x0A, 0, 1, 0x03, 0x03 },
- { 0x51, 0x0A, 0, 1, 0x03, 0x03 },
- { 0x55, 0x06, 0, 1, 0x02, 0x02 },
- { 0x55, 0x06, 0, 1, 0x02, 0x02 },
- { 0x55, 0x06, 0, 1, 0x02, 0x02 },
- { 0x55, 0x06, 0, 1, 0x02, 0x02 },
- { 0x51, 0x0B, 0, 1, 0x05, 0x05 },
- { 0x51, 0x0B, 0, 1, 0x04, 0x02 },
- { 0x51, 0x0B, 0, 1, 0x05, 0x05 },
- { 0x51, 0x0B, 0, 1, 0x04, 0x02 },
- { 0x51, 0x0C, 0, 1, 0x05, 0x05 },
- { 0x51, 0x0C, 0, 1, 0x04, 0x02 },
- { 0x51, 0x0C, 0, 1, 0x05, 0x05 },
- { 0x51, 0x0C, 0, 1, 0x04, 0x02 },
- { 0x51, 0x0D, 0, 1, 0x05, 0x05 },
- { 0x51, 0x0D, 0, 1, 0x04, 0x02 },
- { 0x51, 0x0D, 0, 1, 0x05, 0x05 },
- { 0x51, 0x0D, 0, 1, 0x04, 0x02 },
- { 0x45, 0x01, 0, 1, 0x03, 0x03 },
- { 0x46, 0x01, 0, 1, 0x02, 0x02 },
- { 0x45, 0x01, 0, 1, 0x03, 0x03 },
- { 0x46, 0x01, 0, 1, 0x02, 0x02 },
- { 0x1E, 0x01, 1, 1, 0x03, 0x03 },
- { 0x1F, 0x01, 1, 1, 0x02, 0x02 },
- { 0x1E, 0x01, 1, 1, 0x02, 0x02 },
- { 0x1F, 0x01, 1, 1, 0x02, 0x02 },
- { 0x20, 0x04, 1, 1, 0x03, 0x03 },
- { 0x21, 0x04, 1, 1, 0x02, 0x02 },
- { 0x22, 0x04, 1, 1, 0x02, 0x02 },
- { 0x22, 0x04, 1, 1, 0x02, 0x02 },
- { 0x20, 0x05, 0, 1, 0x04, 0x02 },
- { 0x21, 0x05, 0, 1, 0x04, 0x02 },
- { 0x22, 0x05, 0, 1, 0x04, 0x02 },
- { 0x22, 0x05, 0, 1, 0x04, 0x02 },
- { 0x52, 0x04, 0, 1, 0x02, 0x02 },
- { 0x52, 0x04, 0, 1, 0x02, 0x02 },
- { 0x52, 0x04, 0, 1, 0x02, 0x02 },
- { 0x52, 0x04, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x04, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x04, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x04, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x04, 0, 1, 0x02, 0x02 },
- { 0x63, 0x01, 0, 0, 0x03, 0x03 },
- { 0x63, 0x01, 0, 0, 0x02, 0x02 },
- { 0x63, 0x01, 0, 0, 0x03, 0x03 },
- { 0x63, 0x01, 0, 0, 0x02, 0x02 },
- { 0x07, 0x01, 0, 1, 0x02, 0x02 },
- { 0x07, 0x01, 0, 1, 0x02, 0x02 },
- { 0x07, 0x01, 0, 1, 0x02, 0x02 },
- { 0x07, 0x01, 0, 1, 0x02, 0x02 },
- { 0x07, 0x02, 1, 1, 0x02, 0x02 },
- { 0x07, 0x02, 1, 1, 0x02, 0x02 },
- { 0x07, 0x02, 1, 1, 0x02, 0x02 },
- { 0x07, 0x02, 1, 1, 0x02, 0x02 },
- { 0x5D, 0x05, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x05, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x05, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x05, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x06, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x06, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x06, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x06, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x07, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x07, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x07, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x07, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x08, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x08, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x08, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x08, 0, 1, 0x02, 0x02 },
- { 0x43, 0x02, 0, 1, 0x0A, 0x0A },
- { 0x43, 0x02, 0, 1, 0x0A, 0x0A },
- { 0x43, 0x02, 0, 1, 0x0A, 0x0A },
- { 0x43, 0x02, 0, 1, 0x0A, 0x0A },
- { 0x44, 0x01, 0, 1, 0x02, 0x02 },
- { 0x44, 0x01, 0, 1, 0x02, 0x02 },
- { 0x44, 0x01, 0, 1, 0x02, 0x02 },
- { 0x44, 0x01, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x09, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x09, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x09, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x09, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x0A, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x0A, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x0A, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x0A, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x0B, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x0B, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x0B, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x0B, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x0C, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x0C, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x0C, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x0C, 0, 1, 0x02, 0x02 },
- { 0x63, 0x02, 0, 1, 0x03, 0x03 },
- { 0x63, 0x02, 0, 1, 0x02, 0x02 },
- { 0x63, 0x02, 0, 1, 0x03, 0x03 },
- { 0x63, 0x02, 0, 1, 0x02, 0x02 },
- { 0x63, 0x03, 0, 1, 0x03, 0x03 },
- { 0x63, 0x03, 0, 1, 0x02, 0x02 },
- { 0x63, 0x03, 0, 1, 0x03, 0x03 },
- { 0x63, 0x03, 0, 1, 0x02, 0x02 },
- { 0x42, 0x00, 0, 1, 0x02, 0x02 },
- { 0x42, 0x00, 0, 1, 0x02, 0x02 },
- { 0x42, 0x00, 0, 1, 0x02, 0x02 },
- { 0x42, 0x00, 0, 1, 0x02, 0x02 },
- { 0x56, 0x00, 0, 1, 0x02, 0x02 },
- { 0x47, 0x00, 0, 1, 0x02, 0x02 },
- { 0x42, 0x00, 0, 1, 0x02, 0x02 },
- { 0x42, 0x00, 0, 1, 0x02, 0x02 },
- { 0x42, 0x00, 0, 1, 0x02, 0x02 },
- { 0x42, 0x00, 0, 1, 0x02, 0x02 },
- { 0x42, 0x00, 0, 1, 0x02, 0x02 },
- { 0x06, 0x01, 1, 1, 0x02, 0x02 },
- { 0x06, 0x01, 1, 1, 0x02, 0x02 },
- { 0x06, 0x01, 1, 1, 0x02, 0x02 },
- { 0x06, 0x01, 1, 1, 0x02, 0x02 },
- { 0x36, 0x00, 0, 1, 0x04, 0x20 },
- { 0x36, 0x00, 0, 1, 0x04, 0x20 },
- { 0x36, 0x00, 0, 1, 0x04, 0x20 },
- { 0x36, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2A, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2A, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2A, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2A, 0x00, 0, 1, 0x04, 0x20 },
- { 0x13, 0x00, 1, 1, 0x02, 0x02 },
- { 0x13, 0x00, 1, 1, 0x02, 0x02 },
- { 0x13, 0x00, 1, 1, 0x02, 0x02 },
- { 0x13, 0x00, 1, 1, 0x02, 0x02 },
- { 0x15, 0x00, 1, 1, 0x02, 0x02 },
- { 0x15, 0x00, 1, 1, 0x02, 0x02 },
- { 0x15, 0x00, 1, 1, 0x02, 0x02 },
- { 0x15, 0x00, 1, 1, 0x02, 0x02 },
- { 0x57, 0x06, 0, 1, 0x04, 0x02 },
- { 0x57, 0x06, 0, 1, 0x04, 0x02 },
- { 0x57, 0x06, 0, 1, 0x04, 0x02 },
- { 0x57, 0x06, 0, 1, 0x04, 0x02 },
- { 0x3A, 0x00, 0, 1, 0x02, 0x20 },
- { 0x3A, 0x00, 0, 1, 0x02, 0x20 },
- { 0x3A, 0x00, 0, 1, 0x02, 0x20 },
- { 0x3A, 0x00, 0, 1, 0x02, 0x20 },
- { 0x51, 0x0E, 1, 1, 0x03, 0x03 },
- { 0x51, 0x0E, 1, 1, 0x03, 0x03 },
- { 0x51, 0x0E, 1, 1, 0x03, 0x03 },
- { 0x51, 0x0E, 1, 1, 0x03, 0x03 },
- { 0x3B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3F, 0x00, 0, 1, 0x02, 0x26 },
- { 0x3F, 0x00, 0, 1, 0x02, 0x26 },
- { 0x3F, 0x00, 0, 1, 0x02, 0x26 },
- { 0x3F, 0x00, 0, 1, 0x02, 0x26 },
- { 0x43, 0x03, 0, 1, 0x02, 0x02 },
- { 0x43, 0x03, 0, 1, 0x02, 0x02 },
- { 0x43, 0x03, 0, 1, 0x02, 0x02 },
- { 0x43, 0x03, 0, 1, 0x02, 0x02 },
- { 0x43, 0x04, 0, 1, 0x02, 0x02 },
- { 0x43, 0x04, 0, 1, 0x02, 0x02 },
- { 0x43, 0x04, 0, 1, 0x02, 0x02 },
- { 0x43, 0x04, 0, 1, 0x02, 0x02 },
- { 0x58, 0x04, 0, 1, 0x2C, 0x2C },
- { 0x58, 0x04, 0, 1, 0x2C, 0x2C },
- { 0x58, 0x04, 0, 1, 0x2C, 0x2C },
- { 0x58, 0x04, 0, 1, 0x2C, 0x2C },
- { 0x1A, 0x02, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x02, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x02, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x02, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x03, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x03, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x03, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x03, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x04, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x04, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x04, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x04, 1, 1, 0x02, 0x02 },
- { 0x55, 0x07, 0, 0, 0x04, 0x04 },
- { 0x55, 0x07, 0, 0, 0x04, 0x04 },
- { 0x55, 0x07, 0, 0, 0x04, 0x04 },
- { 0x55, 0x07, 0, 0, 0x04, 0x04 },
- { 0x55, 0x08, 0, 0, 0x04, 0x04 },
- { 0x55, 0x08, 0, 0, 0x04, 0x04 },
- { 0x55, 0x08, 0, 0, 0x04, 0x04 },
- { 0x55, 0x08, 0, 0, 0x04, 0x04 },
- { 0x5F, 0x02, 0, 1, 0x02, 0x02 },
- { 0x5F, 0x02, 0, 1, 0x02, 0x02 },
- { 0x64, 0x02, 0, 1, 0x02, 0x02 },
- { 0x64, 0x02, 0, 1, 0x02, 0x02 },
- { 0x5F, 0x02, 0, 1, 0x00, 0x00 },
- { 0x52, 0x05, 0, 1, 0x04, 0x02 },
- { 0x52, 0x05, 0, 1, 0x04, 0x02 },
- { 0x52, 0x05, 0, 1, 0x04, 0x02 },
- { 0x52, 0x05, 0, 1, 0x04, 0x02 },
- { 0x52, 0x06, 0, 1, 0x04, 0x02 },
- { 0x52, 0x06, 0, 1, 0x04, 0x02 },
- { 0x52, 0x06, 0, 1, 0x04, 0x02 },
- { 0x52, 0x06, 0, 1, 0x04, 0x02 },
- { 0x52, 0x07, 0, 1, 0x04, 0x02 },
- { 0x52, 0x07, 0, 1, 0x04, 0x02 },
- { 0x52, 0x07, 0, 1, 0x04, 0x02 },
- { 0x52, 0x07, 0, 1, 0x04, 0x02 },
- { 0x52, 0x08, 0, 1, 0x04, 0x02 },
- { 0x52, 0x08, 0, 1, 0x04, 0x02 },
- { 0x52, 0x08, 0, 1, 0x04, 0x02 },
- { 0x52, 0x08, 0, 1, 0x04, 0x02 },
- { 0x53, 0x02, 0, 1, 0x04, 0x02 },
- { 0x53, 0x02, 0, 1, 0x04, 0x02 },
- { 0x53, 0x02, 0, 1, 0x04, 0x02 },
- { 0x53, 0x02, 0, 1, 0x04, 0x02 },
- { 0x53, 0x03, 0, 1, 0x03, 0x03 },
- { 0x53, 0x03, 0, 1, 0x03, 0x03 },
- { 0x53, 0x03, 0, 1, 0x03, 0x03 },
- { 0x53, 0x03, 0, 1, 0x03, 0x03 },
- { 0x53, 0x04, 0, 1, 0x03, 0x03 },
- { 0x53, 0x04, 0, 1, 0x03, 0x03 },
- { 0x53, 0x04, 0, 1, 0x03, 0x03 },
- { 0x53, 0x04, 0, 1, 0x03, 0x03 },
- { 0x53, 0x05, 0, 1, 0x03, 0x03 },
- { 0x53, 0x05, 0, 1, 0x03, 0x03 },
- { 0x53, 0x05, 0, 1, 0x03, 0x03 },
- { 0x53, 0x05, 0, 1, 0x03, 0x03 },
- { 0x5E, 0x01, 1, 1, 0x0E, 0x0E },
- { 0x5E, 0x01, 1, 1, 0x0E, 0x0E },
- { 0x5E, 0x01, 1, 1, 0x0E, 0x0E },
- { 0x5E, 0x01, 1, 1, 0x0E, 0x0E },
- { 0x5E, 0x02, 0, 1, 0x0E, 0x0E },
- { 0x5E, 0x02, 0, 1, 0x0E, 0x0E },
- { 0x5E, 0x02, 0, 1, 0x0E, 0x0E },
- { 0x5E, 0x02, 0, 1, 0x0E, 0x0E },
- { 0x3C, 0x00, 0, 1, 0x03, 0x03 },
- { 0x3C, 0x00, 0, 1, 0x03, 0x03 },
- { 0x3C, 0x00, 0, 1, 0x03, 0x03 },
- { 0x3C, 0x00, 0, 1, 0x03, 0x03 },
- { 0x3D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x00, 0, 1, 0x02, 0x02 },
- { 0x63, 0x04, 0, 1, 0x04, 0x02 },
- { 0x63, 0x04, 0, 1, 0x04, 0x02 },
- { 0x63, 0x04, 0, 1, 0x04, 0x02 },
- { 0x63, 0x04, 0, 1, 0x04, 0x02 },
- { 0x2E, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2E, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2E, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2E, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2F, 0x00, 0, 1, 0x04, 0x04 },
- { 0x2F, 0x00, 0, 1, 0x04, 0x04 },
- { 0x2F, 0x00, 0, 1, 0x04, 0x04 },
- { 0x2F, 0x00, 0, 1, 0x04, 0x04 },
- { 0x30, 0x00, 0, 0, 0x04, 0x20 },
- { 0x30, 0x00, 0, 0, 0x04, 0x20 },
- { 0x30, 0x00, 0, 1, 0x04, 0x20 },
- { 0x30, 0x00, 0, 1, 0x04, 0x20 },
- { 0x31, 0x00, 0, 1, 0x04, 0x20 },
- { 0x31, 0x00, 0, 1, 0x04, 0x20 },
- { 0x31, 0x00, 0, 1, 0x04, 0x20 },
- { 0x31, 0x00, 0, 1, 0x04, 0x20 },
- { 0x1E, 0x04, 0, 1, 0x04, 0x02 },
- { 0x1F, 0x04, 0, 1, 0x04, 0x02 },
- { 0x1E, 0x04, 0, 1, 0x04, 0x02 },
- { 0x1F, 0x04, 0, 1, 0x04, 0x02 },
- { 0x32, 0x00, 0, 1, 0x02, 0x02 },
- { 0x32, 0x00, 0, 1, 0x02, 0x02 },
- { 0x32, 0x00, 0, 1, 0x02, 0x02 },
- { 0x32, 0x00, 0, 1, 0x02, 0x02 },
- { 0x59, 0x05, 0, 1, 0x03, 0x03 },
- { 0x59, 0x05, 0, 1, 0x03, 0x03 },
- { 0x59, 0x05, 0, 1, 0x03, 0x03 },
- { 0x59, 0x05, 0, 1, 0x03, 0x03 },
- { 0x35, 0x00, 0, 1, 0x04, 0x02 },
- { 0x35, 0x00, 0, 1, 0x04, 0x02 },
- { 0x35, 0x00, 0, 1, 0x04, 0x02 },
- { 0x35, 0x00, 0, 1, 0x04, 0x02 },
- { 0x37, 0x00, 0, 1, 0x04, 0x20 },
- { 0x37, 0x00, 0, 1, 0x04, 0x20 },
- { 0x37, 0x00, 0, 1, 0x04, 0x20 },
- { 0x37, 0x00, 0, 1, 0x04, 0x20 },
- { 0x39, 0x00, 0, 1, 0x04, 0x04 },
- { 0x39, 0x00, 0, 1, 0x04, 0x04 },
- { 0x39, 0x00, 0, 1, 0x04, 0x04 },
- { 0x39, 0x00, 0, 1, 0x04, 0x04 },
- { 0x5D, 0x0D, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x0D, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x0D, 0, 1, 0x03, 0x03 },
- { 0x5D, 0x0D, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x0E, 0, 1, 0x03, 0x05 },
- { 0x5D, 0x0E, 0, 1, 0x02, 0x04 },
- { 0x5D, 0x0E, 0, 1, 0x03, 0x05 },
- { 0x5D, 0x0E, 0, 1, 0x02, 0x04 },
- { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F },
- { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F },
- { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F },
- { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F },
- { 0x5D, 0x10, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x10, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x10, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x10, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x11, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x11, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x11, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x11, 0, 1, 0x02, 0x02 },
- { 0x20, 0x06, 0, 1, 0x04, 0x02 },
- { 0x21, 0x06, 0, 1, 0x04, 0x02 },
- { 0x22, 0x06, 0, 1, 0x04, 0x02 },
- { 0x22, 0x06, 0, 1, 0x04, 0x02 },
- { 0x20, 0x07, 0, 1, 0x04, 0x02 },
- { 0x21, 0x07, 0, 1, 0x04, 0x02 },
- { 0x22, 0x07, 0, 1, 0x04, 0x02 },
- { 0x22, 0x07, 0, 1, 0x04, 0x02 },
- { 0x1E, 0x02, 0, 1, 0x04, 0x02 },
- { 0x1F, 0x02, 0, 1, 0x04, 0x02 },
- { 0x1E, 0x02, 0, 1, 0x03, 0x03 },
- { 0x1F, 0x02, 0, 1, 0x02, 0x02 },
- { 0x58, 0x02, 0, 1, 0x02, 0x02 },
- { 0x58, 0x02, 0, 1, 0x02, 0x02 },
- { 0x58, 0x02, 0, 1, 0x02, 0x02 },
- { 0x58, 0x02, 0, 1, 0x02, 0x02 },
- { 0x57, 0x03, 0, 1, 0x03, 0x03 },
- { 0x57, 0x03, 0, 1, 0x03, 0x03 },
- { 0x57, 0x03, 0, 1, 0x03, 0x03 },
- { 0x57, 0x03, 0, 1, 0x03, 0x03 },
- { 0x57, 0x04, 0, 1, 0x04, 0x02 },
- { 0x57, 0x04, 0, 1, 0x04, 0x02 },
- { 0x57, 0x04, 0, 1, 0x04, 0x02 },
- { 0x57, 0x04, 0, 1, 0x04, 0x02 },
- { 0x5A, 0x04, 0, 1, 0x04, 0x02 },
- { 0x5A, 0x04, 0, 1, 0x04, 0x02 },
- { 0x5A, 0x04, 0, 1, 0x04, 0x02 },
- { 0x5A, 0x04, 0, 1, 0x04, 0x02 },
- { 0x59, 0x03, 0, 1, 0x03, 0x03 },
- { 0x59, 0x03, 0, 1, 0x02, 0x02 },
- { 0x59, 0x03, 0, 1, 0x03, 0x03 },
- { 0x59, 0x03, 0, 1, 0x02, 0x02 },
- { 0x59, 0x04, 0, 1, 0x02, 0x02 },
- { 0x59, 0x04, 0, 1, 0x02, 0x02 },
- { 0x59, 0x04, 0, 1, 0x02, 0x02 },
- { 0x59, 0x04, 0, 1, 0x02, 0x02 },
- { 0x0E, 0x04, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x04, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x04, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x04, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x05, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x05, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x05, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x05, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x06, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x06, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x06, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x06, 1, 1, 0x02, 0x02 },
- { 0x30, 0x01, 0, 0, 0x04, 0x20 },
- { 0x30, 0x01, 0, 0, 0x04, 0x20 },
- { 0x30, 0x01, 0, 1, 0x04, 0x20 },
- { 0x30, 0x01, 0, 1, 0x04, 0x20 },
- { 0x30, 0x02, 0, 0, 0x04, 0x20 },
- { 0x30, 0x02, 0, 0, 0x04, 0x20 },
- { 0x30, 0x02, 0, 1, 0x04, 0x20 },
- { 0x30, 0x02, 0, 1, 0x04, 0x20 },
- { 0x06, 0x02, 0, 0, 0x02, 0x02 },
- { 0x06, 0x02, 0, 0, 0x02, 0x02 },
- { 0x06, 0x02, 0, 0, 0x02, 0x02 },
- { 0x06, 0x02, 0, 0, 0x02, 0x02 },
- { 0x06, 0x03, 0, 0, 0x02, 0x02 },
- { 0x06, 0x03, 0, 0, 0x02, 0x02 },
- { 0x06, 0x03, 0, 0, 0x02, 0x02 },
- { 0x06, 0x03, 0, 0, 0x02, 0x02 },
- { 0x06, 0x04, 0, 1, 0x02, 0x02 },
- { 0x06, 0x04, 0, 1, 0x02, 0x02 },
- { 0x06, 0x04, 0, 1, 0x02, 0x02 },
- { 0x06, 0x04, 0, 1, 0x02, 0x02 },
- { 0x62, 0x02, 0, 1, 0x04, 0x02 },
- { 0x62, 0x02, 0, 1, 0x04, 0x02 },
- { 0x62, 0x02, 0, 1, 0x04, 0x02 },
- { 0x62, 0x02, 0, 1, 0x04, 0x02 },
- { 0x4A, 0x00, 0, 1, 0x03, 0x03 },
- { 0x4A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x4A, 0x00, 0, 1, 0x03, 0x03 },
- { 0x4A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x4A, 0x00, 0, 1, 0x03, 0x03 },
- { 0x4A, 0x00, 0, 1, 0x03, 0x03 },
- { 0x4A, 0x00, 0, 1, 0x03, 0x03 },
- { 0x02, 0x01, 1, 1, 0x02, 0x02 },
- { 0x02, 0x01, 1, 1, 0x02, 0x02 },
- { 0x02, 0x01, 1, 1, 0x02, 0x02 },
- { 0x02, 0x01, 1, 1, 0x02, 0x02 },
- { 0x12, 0x00, 1, 0, 0x02, 0x02 },
- { 0x12, 0x00, 1, 0, 0x02, 0x02 },
- { 0x12, 0x00, 1, 0, 0x02, 0x02 },
- { 0x12, 0x00, 1, 0, 0x02, 0x02 },
- { 0x11, 0x00, 1, 0, 0x02, 0x02 },
- { 0x11, 0x00, 1, 0, 0x02, 0x02 },
- { 0x11, 0x00, 1, 0, 0x02, 0x02 },
- { 0x11, 0x00, 1, 0, 0x02, 0x02 },
- { 0x18, 0x00, 1, 1, 0x02, 0x02 },
- { 0x18, 0x00, 1, 1, 0x02, 0x02 },
- { 0x18, 0x00, 1, 1, 0x02, 0x02 },
- { 0x18, 0x00, 1, 1, 0x02, 0x02 },
- { 0x16, 0x00, 1, 1, 0x02, 0x02 },
- { 0x16, 0x00, 1, 1, 0x02, 0x02 },
- { 0x16, 0x00, 1, 1, 0x02, 0x02 },
- { 0x16, 0x00, 1, 1, 0x02, 0x02 },
- { 0x0A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0A, 0x00, 0, 1, 0x02, 0x02 },
- { 0x19, 0x00, 1, 1, 0x02, 0x02 },
- { 0x19, 0x00, 1, 1, 0x02, 0x02 },
- { 0x19, 0x00, 1, 1, 0x02, 0x02 },
- { 0x19, 0x00, 1, 1, 0x02, 0x02 },
- { 0x05, 0x01, 1, 1, 0x03, 0x02 },
- { 0x05, 0x01, 1, 1, 0x02, 0x02 },
- { 0x05, 0x01, 1, 1, 0x03, 0x02 },
- { 0x05, 0x01, 1, 1, 0x02, 0x02 },
- { 0x0A, 0x01, 1, 1, 0x02, 0x02 },
- { 0x0A, 0x01, 1, 1, 0x02, 0x02 },
- { 0x0A, 0x01, 1, 1, 0x02, 0x02 },
- { 0x0A, 0x01, 1, 1, 0x02, 0x02 },
- { 0x0A, 0x02, 0, 1, 0x02, 0x02 },
- { 0x0A, 0x02, 0, 1, 0x02, 0x02 },
- { 0x0A, 0x02, 0, 1, 0x02, 0x02 },
- { 0x0A, 0x02, 0, 1, 0x02, 0x02 },
- { 0x63, 0x05, 0, 1, 0x04, 0x02 },
- { 0x63, 0x05, 0, 1, 0x04, 0x02 },
- { 0x63, 0x05, 0, 1, 0x04, 0x02 },
- { 0x63, 0x05, 0, 1, 0x04, 0x02 },
- { 0x28, 0x00, 0, 1, 0x04, 0x04 },
- { 0x28, 0x00, 0, 1, 0x04, 0x04 },
- { 0x28, 0x00, 0, 1, 0x04, 0x04 },
- { 0x28, 0x00, 0, 1, 0x04, 0x04 },
- { 0x29, 0x00, 0, 1, 0x04, 0x04 },
- { 0x29, 0x00, 0, 1, 0x04, 0x04 },
- { 0x29, 0x00, 0, 1, 0x04, 0x04 },
- { 0x29, 0x00, 0, 1, 0x04, 0x04 },
- { 0x2B, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2B, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2B, 0x00, 0, 1, 0x04, 0x20 },
- { 0x2B, 0x00, 0, 1, 0x04, 0x20 },
- { 0x1A, 0x00, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x00, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x00, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x00, 1, 1, 0x02, 0x02 },
- { 0x55, 0x09, 0, 0, 0x04, 0x04 },
- { 0x55, 0x09, 0, 0, 0x04, 0x04 },
- { 0x55, 0x09, 0, 0, 0x04, 0x04 },
- { 0x55, 0x09, 0, 0, 0x04, 0x04 },
- { 0x55, 0x0A, 0, 0, 0x04, 0x04 },
- { 0x55, 0x0A, 0, 0, 0x04, 0x04 },
- { 0x55, 0x0A, 0, 0, 0x04, 0x04 },
- { 0x55, 0x0A, 0, 0, 0x04, 0x04 },
- { 0x52, 0x09, 0, 1, 0x04, 0x04 },
- { 0x52, 0x09, 0, 1, 0x04, 0x04 },
- { 0x52, 0x09, 0, 1, 0x04, 0x04 },
- { 0x52, 0x09, 0, 1, 0x04, 0x04 },
- { 0x48, 0x00, 0, 1, 0x02, 0x26 },
- { 0x48, 0x00, 0, 1, 0x02, 0x26 },
- { 0x48, 0x00, 0, 1, 0x02, 0x26 },
- { 0x48, 0x00, 0, 1, 0x02, 0x26 },
- { 0x48, 0x01, 0, 1, 0x04, 0x20 },
- { 0x48, 0x01, 0, 1, 0x04, 0x20 },
- { 0x48, 0x01, 0, 1, 0x04, 0x20 },
- { 0x48, 0x01, 0, 1, 0x04, 0x20 },
- { 0x55, 0x0B, 0, 1, 0x04, 0x02 },
- { 0x55, 0x0B, 0, 1, 0x04, 0x02 },
- { 0x55, 0x0B, 0, 1, 0x04, 0x02 },
- { 0x55, 0x0B, 0, 1, 0x04, 0x02 },
- { 0x60, 0x04, 0, 1, 0x02, 0x02 },
- { 0x60, 0x04, 0, 1, 0x02, 0x02 },
- { 0x60, 0x04, 0, 1, 0x02, 0x02 },
- { 0x60, 0x04, 0, 1, 0x02, 0x02 },
- { 0x49, 0x00, 0, 1, 0x02, 0x20 },
- { 0x49, 0x00, 0, 1, 0x02, 0x20 },
- { 0x49, 0x00, 0, 1, 0x02, 0x20 },
- { 0x49, 0x00, 0, 1, 0x02, 0x20 },
- { 0x52, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x52, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x52, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x52, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
- { 0x23, 0x01, 0, 1, 0x04, 0x02 },
- { 0x24, 0x01, 0, 1, 0x04, 0x02 },
- { 0x25, 0x01, 0, 1, 0x04, 0x02 },
- { 0x25, 0x01, 0, 1, 0x04, 0x02 },
- { 0x51, 0x0F, 0, 1, 0x05, 0x05 },
- { 0x51, 0x0F, 0, 1, 0x04, 0x02 },
- { 0x51, 0x0F, 0, 1, 0x05, 0x05 },
- { 0x51, 0x0F, 0, 1, 0x04, 0x02 },
- { 0x60, 0x05, 0, 1, 0x04, 0x02 },
- { 0x60, 0x05, 0, 1, 0x04, 0x02 },
- { 0x60, 0x05, 0, 1, 0x04, 0x02 },
- { 0x60, 0x05, 0, 1, 0x04, 0x02 },
- { 0x5F, 0x04, 0, 1, 0x03, 0x03 },
- { 0x5F, 0x04, 0, 1, 0x02, 0x02 },
- { 0x64, 0x04, 0, 1, 0x02, 0x02 },
- { 0x64, 0x04, 0, 1, 0x02, 0x02 },
- { 0x61, 0x03, 0, 1, 0x02, 0x02 },
- { 0x61, 0x03, 0, 1, 0x02, 0x02 },
- { 0x61, 0x03, 0, 1, 0x02, 0x02 },
- { 0x61, 0x03, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x00, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x01, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x01, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x01, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x01, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x02, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x02, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x02, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x02, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x03, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x03, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x03, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x03, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x04, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x04, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x04, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x04, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x05, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x05, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x05, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x05, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x06, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x06, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x06, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x06, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x07, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x07, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x07, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x07, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x08, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x08, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x08, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x08, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x09, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x09, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x09, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x09, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0A, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0A, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0A, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0A, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0B, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0B, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0B, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0B, 0, 1, 0x02, 0x02 },
- { 0x0E, 0x07, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x07, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x07, 1, 1, 0x02, 0x02 },
- { 0x0E, 0x07, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x01, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x01, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x01, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x01, 1, 1, 0x02, 0x02 },
- { 0x3B, 0x01, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x01, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x01, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x01, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x02, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x04, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x04, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x04, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x04, 0, 1, 0x02, 0x02 },
- { 0x63, 0x06, 0, 0, 0x02, 0x26 },
- { 0x63, 0x06, 0, 0, 0x02, 0x26 },
- { 0x63, 0x06, 0, 0, 0x02, 0x26 },
- { 0x63, 0x06, 0, 0, 0x02, 0x26 },
- { 0x63, 0x07, 0, 0, 0x2E, 0x2E },
- { 0x63, 0x07, 0, 0, 0x2E, 0x2E },
- { 0x63, 0x07, 0, 0, 0x2E, 0x2E },
- { 0x63, 0x07, 0, 0, 0x2E, 0x2E },
- { 0x5B, 0x05, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x05, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x05, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x05, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x06, 0, 1, 0x2C, 0x2C },
- { 0x5B, 0x06, 0, 1, 0x2C, 0x2C },
- { 0x5B, 0x06, 0, 1, 0x2C, 0x2C },
- { 0x5B, 0x06, 0, 1, 0x2C, 0x2C },
- { 0x5B, 0x07, 0, 1, 0x2C, 0x2C },
- { 0x5B, 0x07, 0, 1, 0x2C, 0x2C },
- { 0x5B, 0x07, 0, 1, 0x2C, 0x2C },
- { 0x5B, 0x07, 0, 1, 0x2C, 0x2C },
- { 0x5B, 0x08, 0, 0, 0x02, 0x02 },
- { 0x5B, 0x08, 0, 0, 0x02, 0x02 },
- { 0x5B, 0x08, 0, 0, 0x02, 0x02 },
- { 0x5B, 0x08, 0, 0, 0x02, 0x02 },
- { 0x62, 0x03, 0, 1, 0x2C, 0x2C },
- { 0x62, 0x03, 0, 1, 0x2C, 0x2C },
- { 0x62, 0x03, 0, 1, 0x2C, 0x2C },
- { 0x62, 0x03, 0, 1, 0x2C, 0x2C },
- { 0x57, 0x05, 0, 1, 0x02, 0x02 },
- { 0x57, 0x05, 0, 1, 0x02, 0x02 },
- { 0x57, 0x05, 0, 1, 0x02, 0x02 },
- { 0x57, 0x05, 0, 1, 0x02, 0x02 },
- { 0x07, 0x03, 0, 1, 0x02, 0x02 },
- { 0x07, 0x03, 0, 1, 0x02, 0x02 },
- { 0x07, 0x03, 0, 1, 0x02, 0x02 },
- { 0x07, 0x03, 0, 1, 0x02, 0x02 },
- { 0x52, 0x0B, 0, 1, 0x04, 0x02 },
- { 0x52, 0x0B, 0, 1, 0x04, 0x02 },
- { 0x52, 0x0B, 0, 1, 0x04, 0x02 },
- { 0x52, 0x0B, 0, 1, 0x04, 0x02 },
- { 0x3B, 0x03, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x03, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x03, 0, 1, 0x02, 0x02 },
- { 0x3B, 0x03, 0, 1, 0x02, 0x02 },
- { 0x61, 0x04, 0, 1, 0x02, 0x02 },
- { 0x61, 0x04, 0, 1, 0x02, 0x02 },
- { 0x61, 0x04, 0, 1, 0x02, 0x02 },
- { 0x61, 0x04, 0, 1, 0x02, 0x02 },
- { 0x5F, 0x03, 0, 1, 0x03, 0x03 },
- { 0x5F, 0x03, 0, 1, 0x02, 0x02 },
- { 0x64, 0x03, 0, 1, 0x02, 0x02 },
- { 0x64, 0x03, 0, 1, 0x02, 0x02 },
- { 0x5F, 0x03, 0, 1, 0x00, 0x00 },
- { 0x52, 0x0C, 0, 1, 0x04, 0x02 },
- { 0x52, 0x0C, 0, 1, 0x04, 0x02 },
- { 0x52, 0x0C, 0, 1, 0x04, 0x02 },
- { 0x52, 0x0C, 0, 1, 0x04, 0x02 },
- { 0x48, 0x02, 1, 1, 0x04, 0x20 },
- { 0x48, 0x02, 1, 1, 0x04, 0x20 },
- { 0x48, 0x02, 1, 1, 0x04, 0x20 },
- { 0x48, 0x02, 1, 1, 0x04, 0x20 },
- { 0x4B, 0x00, 0, 1, 0x04, 0x20 },
- { 0x4B, 0x00, 0, 1, 0x04, 0x20 },
- { 0x4B, 0x00, 0, 1, 0x04, 0x20 },
- { 0x4B, 0x00, 0, 1, 0x04, 0x20 },
- { 0x53, 0x06, 0, 1, 0x03, 0x03 },
- { 0x53, 0x06, 0, 1, 0x03, 0x03 },
- { 0x53, 0x06, 0, 1, 0x03, 0x03 },
- { 0x53, 0x06, 0, 1, 0x03, 0x03 },
- { 0x51, 0x10, 0, 1, 0x0B, 0x0B },
- { 0x51, 0x10, 0, 1, 0x0B, 0x0B },
- { 0x51, 0x10, 0, 1, 0x0B, 0x0B },
- { 0x51, 0x10, 0, 1, 0x0B, 0x0B },
- { 0x52, 0x0D, 0, 1, 0x03, 0x03 },
- { 0x52, 0x0D, 0, 1, 0x02, 0x02 },
- { 0x52, 0x0D, 0, 1, 0x03, 0x03 },
- { 0x52, 0x0D, 0, 1, 0x02, 0x02 },
- { 0x4F, 0x00, 0, 1, 0x03, 0x03 },
- { 0x4F, 0x00, 0, 1, 0x03, 0x03 },
- { 0x4F, 0x00, 0, 1, 0x03, 0x03 },
- { 0x4F, 0x00, 0, 1, 0x03, 0x03 },
- { 0x4F, 0x00, 0, 1, 0x03, 0x03 },
- { 0x1A, 0x06, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x06, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x06, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x06, 1, 1, 0x02, 0x02 },
- { 0x66, 0x00, 0, 1, 0x02, 0x02 },
- { 0x66, 0x00, 0, 1, 0x02, 0x02 },
- { 0x66, 0x00, 0, 1, 0x02, 0x02 },
- { 0x66, 0x00, 0, 1, 0x02, 0x02 },
- { 0x1A, 0x07, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x07, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x07, 1, 1, 0x02, 0x02 },
- { 0x1A, 0x07, 1, 1, 0x02, 0x02 },
- { 0x32, 0x01, 0, 1, 0x02, 0x02 },
- { 0x32, 0x01, 0, 1, 0x02, 0x02 },
- { 0x32, 0x01, 0, 1, 0x02, 0x02 },
- { 0x32, 0x01, 0, 1, 0x02, 0x02 },
- { 0x2C, 0x01, 0, 1, 0x04, 0x20 },
- { 0x2C, 0x01, 0, 1, 0x04, 0x20 },
- { 0x2C, 0x01, 0, 1, 0x04, 0x20 },
- { 0x2C, 0x01, 0, 1, 0x04, 0x20 },
- { 0x33, 0x00, 0, 1, 0x04, 0x20 },
- { 0x33, 0x00, 0, 1, 0x04, 0x20 },
- { 0x33, 0x00, 0, 1, 0x04, 0x20 },
- { 0x33, 0x00, 0, 1, 0x04, 0x20 },
- { 0x0D, 0x01, 0, 0, 0x04, 0x02 },
- { 0x0D, 0x01, 0, 0, 0x04, 0x02 },
- { 0x0D, 0x01, 0, 0, 0x04, 0x02 },
- { 0x0D, 0x01, 0, 0, 0x04, 0x02 },
- { 0x0D, 0x02, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x02, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x02, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x02, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x03, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x03, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x03, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x03, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x04, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x04, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x04, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x04, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x05, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x05, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x05, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x05, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x06, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x06, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x06, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x06, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x07, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x07, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x07, 0, 1, 0x04, 0x02 },
- { 0x0D, 0x07, 0, 1, 0x04, 0x02 },
- { 0x50, 0x00, 0, 1, 0x04, 0x20 },
- { 0x50, 0x00, 0, 1, 0x04, 0x20 },
- { 0x50, 0x00, 0, 1, 0x04, 0x20 },
- { 0x50, 0x00, 0, 1, 0x04, 0x20 },
- { 0x52, 0x0E, 0, 1, 0x03, 0x03 },
- { 0x52, 0x0E, 0, 1, 0x02, 0x02 },
- { 0x52, 0x0E, 0, 1, 0x03, 0x03 },
- { 0x52, 0x0E, 0, 1, 0x02, 0x02 },
- { 0x63, 0x08, 0, 0, 0x20, 0x20 },
- { 0x63, 0x08, 0, 0, 0x20, 0x20 },
- { 0x63, 0x08, 0, 0, 0x20, 0x20 },
- { 0x63, 0x08, 0, 0, 0x20, 0x20 },
- { 0x63, 0x09, 0, 0, 0x02, 0x02 },
- { 0x63, 0x09, 0, 0, 0x02, 0x02 },
- { 0x63, 0x09, 0, 0, 0x02, 0x02 },
- { 0x63, 0x09, 0, 0, 0x02, 0x02 },
- { 0x57, 0x07, 0, 1, 0x2C, 0x2C },
- { 0x57, 0x07, 0, 1, 0x2C, 0x2C },
- { 0x57, 0x07, 0, 1, 0x2C, 0x2C },
- { 0x57, 0x07, 0, 1, 0x2C, 0x2C },
- { 0x61, 0x05, 0, 1, 0x02, 0x02 },
- { 0x61, 0x05, 0, 1, 0x02, 0x02 },
- { 0x61, 0x05, 0, 1, 0x02, 0x02 },
- { 0x61, 0x05, 0, 1, 0x02, 0x02 },
- { 0x53, 0x07, 0, 1, 0x03, 0x03 },
- { 0x53, 0x07, 0, 1, 0x03, 0x03 },
- { 0x53, 0x07, 0, 1, 0x03, 0x03 },
- { 0x53, 0x07, 0, 1, 0x03, 0x03 },
- { 0x0F, 0x00, 1, 1, 0x02, 0x02 },
- { 0x0F, 0x00, 1, 1, 0x02, 0x02 },
- { 0x0F, 0x00, 1, 1, 0x02, 0x02 },
- { 0x0F, 0x00, 1, 1, 0x02, 0x02 },
- { 0x0C, 0x0C, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0C, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0C, 0, 1, 0x02, 0x02 },
- { 0x0C, 0x0C, 0, 1, 0x02, 0x02 },
- { 0x41, 0x01, 0, 1, 0x02, 0x02 },
- { 0x41, 0x01, 0, 1, 0x02, 0x02 },
- { 0x41, 0x01, 0, 1, 0x02, 0x02 },
- { 0x41, 0x01, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x01, 0, 1, 0x04, 0x04 },
- { 0x3D, 0x01, 0, 1, 0x04, 0x04 },
- { 0x3D, 0x01, 0, 1, 0x04, 0x04 },
- { 0x3D, 0x01, 0, 1, 0x04, 0x04 },
- { 0x5C, 0x07, 0, 1, 0x03, 0x03 },
- { 0x5C, 0x07, 0, 1, 0x02, 0x02 },
- { 0x5C, 0x07, 0, 1, 0x03, 0x03 },
- { 0x5C, 0x07, 0, 1, 0x02, 0x02 },
- { 0x53, 0x08, 0, 1, 0x03, 0x03 },
- { 0x53, 0x08, 0, 1, 0x03, 0x03 },
- { 0x53, 0x08, 0, 1, 0x03, 0x03 },
- { 0x53, 0x08, 0, 1, 0x03, 0x03 },
- { 0x03, 0x02, 0, 1, 0x02, 0x02 },
- { 0x03, 0x02, 0, 1, 0x02, 0x02 },
- { 0x03, 0x02, 0, 1, 0x02, 0x02 },
- { 0x03, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3D, 0x02, 0, 1, 0x02, 0x02 },
- { 0x43, 0x05, 0, 1, 0x02, 0x02 },
- { 0x43, 0x05, 0, 1, 0x02, 0x02 },
- { 0x43, 0x05, 0, 1, 0x02, 0x02 },
- { 0x43, 0x05, 0, 1, 0x02, 0x02 },
- { 0x43, 0x06, 0, 1, 0x02, 0x02 },
- { 0x43, 0x06, 0, 1, 0x02, 0x02 },
- { 0x43, 0x06, 0, 1, 0x02, 0x02 },
- { 0x43, 0x06, 0, 1, 0x02, 0x02 },
- { 0x51, 0x11, 0, 1, 0x03, 0x03 },
- { 0x51, 0x11, 0, 1, 0x02, 0x02 },
- { 0x51, 0x11, 0, 1, 0x03, 0x03 },
- { 0x51, 0x11, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x01, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x01, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x01, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x01, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x02, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x03, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x03, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x03, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x03, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x04, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x04, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x04, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x04, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x05, 0, 1, 0x02, 0x03 },
- { 0x3E, 0x05, 0, 1, 0x02, 0x03 },
- { 0x3E, 0x05, 0, 1, 0x02, 0x03 },
- { 0x3E, 0x05, 0, 1, 0x02, 0x03 },
- { 0x3E, 0x06, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x06, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x06, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x06, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x07, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x07, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x07, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x07, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x08, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x08, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x08, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x08, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x09, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x09, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x09, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x09, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0A, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0A, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0A, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0A, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0B, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0B, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0B, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0B, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0C, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0C, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0C, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0C, 0, 1, 0x02, 0x02 },
- { 0x37, 0x01, 0, 1, 0x04, 0x20 },
- { 0x37, 0x01, 0, 1, 0x04, 0x20 },
- { 0x37, 0x01, 0, 1, 0x04, 0x20 },
- { 0x37, 0x01, 0, 1, 0x04, 0x20 },
- { 0x08, 0x01, 0, 1, 0x04, 0x04 },
- { 0x08, 0x01, 0, 1, 0x04, 0x04 },
- { 0x08, 0x01, 0, 1, 0x04, 0x04 },
- { 0x08, 0x01, 0, 1, 0x04, 0x04 },
- { 0x4C, 0x01, 0, 1, 0x04, 0x20 },
- { 0x4C, 0x01, 0, 1, 0x04, 0x20 },
- { 0x4C, 0x01, 0, 1, 0x04, 0x20 },
- { 0x4C, 0x01, 0, 1, 0x04, 0x20 },
- { 0x63, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x63, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x63, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x63, 0x0A, 0, 1, 0x04, 0x02 },
- { 0x09, 0x01, 0, 1, 0x02, 0x02 },
- { 0x09, 0x01, 0, 1, 0x02, 0x02 },
- { 0x09, 0x01, 0, 1, 0x02, 0x02 },
- { 0x09, 0x01, 0, 1, 0x02, 0x02 },
- { 0x52, 0x0F, 0, 1, 0x03, 0x03 },
- { 0x52, 0x0F, 0, 1, 0x02, 0x02 },
- { 0x52, 0x0F, 0, 1, 0x03, 0x03 },
- { 0x52, 0x0F, 0, 1, 0x02, 0x02 },
- { 0x5B, 0x09, 0, 0, 0x02, 0x02 },
- { 0x5B, 0x09, 0, 0, 0x02, 0x02 },
- { 0x5B, 0x09, 0, 0, 0x02, 0x02 },
- { 0x5B, 0x09, 0, 0, 0x02, 0x02 },
- { 0x4C, 0x02, 0, 1, 0x04, 0x20 },
- { 0x4C, 0x02, 0, 1, 0x04, 0x20 },
- { 0x4C, 0x02, 0, 1, 0x04, 0x20 },
- { 0x4C, 0x02, 0, 1, 0x04, 0x20 },
- { 0x55, 0x0C, 0, 1, 0x04, 0x02 },
- { 0x55, 0x0C, 0, 1, 0x04, 0x02 },
- { 0x55, 0x0C, 0, 1, 0x04, 0x02 },
- { 0x55, 0x0C, 0, 1, 0x04, 0x02 },
- { 0x17, 0x02, 1, 1, 0x02, 0x02 },
- { 0x17, 0x02, 1, 1, 0x02, 0x02 },
- { 0x17, 0x02, 1, 1, 0x02, 0x02 },
- { 0x17, 0x02, 1, 1, 0x02, 0x02 },
- { 0x4A, 0x01, 0, 0, 0x03, 0x03 },
- { 0x4A, 0x01, 0, 0, 0x02, 0x02 },
- { 0x4A, 0x01, 0, 0, 0x03, 0x03 },
- { 0x4A, 0x01, 0, 0, 0x02, 0x02 },
- { 0x43, 0x07, 0, 1, 0x02, 0x02 },
- { 0x43, 0x07, 0, 1, 0x02, 0x02 },
- { 0x43, 0x07, 0, 1, 0x02, 0x02 },
- { 0x43, 0x07, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x12, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x12, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x12, 0, 1, 0x02, 0x02 },
- { 0x5D, 0x12, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0D, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0D, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0D, 0, 1, 0x02, 0x02 },
- { 0x3E, 0x0D, 0, 1, 0x02, 0x02 },
- { 0x56, 0x02, 0, 1, 0x12, 0x12 },
- { 0x56, 0x02, 0, 1, 0x02, 0x02 },
- { 0x56, 0x02, 0, 1, 0x12, 0x12 },
- { 0x56, 0x02, 0, 1, 0x02, 0x02 },
- { 0x57, 0x08, 0, 1, 0x02, 0x02 },
- { 0x57, 0x08, 0, 1, 0x02, 0x02 },
- { 0x57, 0x08, 0, 1, 0x02, 0x02 },
- { 0x57, 0x08, 0, 1, 0x02, 0x02 },
- { 0x56, 0x03, 0, 1, 0x03, 0x03 },
- { 0x56, 0x03, 0, 1, 0x03, 0x03 },
- { 0x56, 0x03, 0, 1, 0x03, 0x03 },
- { 0x56, 0x03, 0, 1, 0x03, 0x03 },
- { 0x57, 0x09, 0, 1, 0x03, 0x03 },
- { 0x57, 0x09, 0, 1, 0x03, 0x03 },
- { 0x57, 0x09, 0, 1, 0x03, 0x03 },
- { 0x57, 0x09, 0, 1, 0x03, 0x03 },
- { 0x5C, 0x08, 0, 1, 0x03, 0x03 },
- { 0x5C, 0x08, 0, 1, 0x03, 0x03 },
- { 0x5C, 0x08, 0, 1, 0x03, 0x03 },
- { 0x5C, 0x08, 0, 1, 0x03, 0x03 },
+EntranceInfo gEntranceTable[] = {
+ { 0x00, 0x00, 0, 1, 0x02, 0x02 }, { 0x00, 0x00, 0, 1, 0x02, 0x02 }, { 0x00, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x00, 0x00, 0, 1, 0x02, 0x02 }, { 0x01, 0x00, 0, 1, 0x02, 0x02 }, { 0x01, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x01, 0x00, 0, 1, 0x02, 0x02 }, { 0x01, 0x00, 0, 1, 0x02, 0x02 }, { 0x0B, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, { 0x0B, 0x00, 0, 1, 0x02, 0x02 }, { 0x0B, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x14, 0x00, 1, 1, 0x02, 0x02 }, { 0x14, 0x00, 1, 1, 0x02, 0x02 }, { 0x14, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x14, 0x00, 1, 1, 0x02, 0x02 }, { 0x05, 0x00, 0, 1, 0x02, 0x02 }, { 0x05, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x05, 0x00, 0, 1, 0x02, 0x02 }, { 0x05, 0x00, 0, 1, 0x02, 0x02 }, { 0x6E, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, { 0x6E, 0x00, 0, 1, 0x02, 0x02 }, { 0x6E, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, { 0x6C, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x6C, 0x00, 0, 1, 0x02, 0x02 }, { 0x68, 0x00, 0, 1, 0x02, 0x02 }, { 0x68, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x68, 0x00, 0, 1, 0x02, 0x02 }, { 0x68, 0x00, 0, 1, 0x02, 0x02 }, { 0x69, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x69, 0x00, 0, 1, 0x02, 0x02 }, { 0x69, 0x00, 0, 1, 0x02, 0x02 }, { 0x69, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, { 0x6D, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x6D, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x02, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 }, { 0x02, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x41, 0x00, 0, 1, 0x02, 0x26 }, { 0x41, 0x00, 0, 1, 0x02, 0x26 }, { 0x41, 0x00, 0, 1, 0x02, 0x26 },
+ { 0x41, 0x00, 0, 1, 0x02, 0x26 }, { 0x41, 0x00, 0, 1, 0x02, 0x02 }, { 0x41, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x1B, 0x00, 1, 1, 0x03, 0x03 }, { 0x1C, 0x00, 1, 1, 0x02, 0x02 }, { 0x1D, 0x00, 1, 1, 0x03, 0x03 },
+ { 0x1D, 0x00, 1, 1, 0x02, 0x02 }, { 0x07, 0x00, 0, 1, 0x02, 0x02 }, { 0x07, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x07, 0x00, 0, 1, 0x02, 0x02 }, { 0x07, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x42, 0x00, 0, 1, 0x04, 0x20 }, { 0x42, 0x00, 0, 1, 0x04, 0x20 }, { 0x42, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, { 0x3E, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x00, 0, 1, 0x02, 0x02 }, { 0x38, 0x00, 0, 1, 0x04, 0x20 }, { 0x38, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x38, 0x00, 0, 1, 0x04, 0x20 }, { 0x38, 0x00, 0, 1, 0x04, 0x20 }, { 0x6A, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, { 0x6A, 0x00, 0, 1, 0x02, 0x02 }, { 0x6A, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x40, 0x00, 0, 1, 0x02, 0x26 }, { 0x40, 0x00, 0, 1, 0x02, 0x26 }, { 0x40, 0x00, 0, 1, 0x02, 0x26 },
+ { 0x40, 0x00, 0, 1, 0x02, 0x26 }, { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, { 0x4C, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, { 0x4C, 0x00, 0, 1, 0x04, 0x20 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x0B, 0x0B }, { 0x43, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 }, { 0x43, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x10, 0x00, 0, 1, 0x04, 0x20 }, { 0x10, 0x00, 0, 1, 0x04, 0x20 }, { 0x10, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x10, 0x00, 0, 1, 0x04, 0x20 }, { 0x1E, 0x03, 1, 1, 0x03, 0x03 }, { 0x1F, 0x03, 1, 1, 0x02, 0x02 },
+ { 0x1E, 0x03, 1, 1, 0x02, 0x02 }, { 0x1F, 0x03, 1, 1, 0x02, 0x02 }, { 0x44, 0x00, 0, 1, 0x07, 0x07 },
+ { 0x44, 0x00, 0, 1, 0x07, 0x07 }, { 0x44, 0x00, 0, 1, 0x07, 0x07 }, { 0x44, 0x00, 0, 1, 0x07, 0x07 },
+ { 0x44, 0x00, 0, 1, 0x0D, 0x02 }, { 0x44, 0x00, 0, 1, 0x0D, 0x02 }, { 0x44, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, { 0x4E, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x4E, 0x00, 0, 1, 0x04, 0x20 }, { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, { 0x6B, 0x00, 0, 1, 0x22, 0x22 },
+ { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, { 0x6B, 0x00, 0, 1, 0x22, 0x22 }, { 0x45, 0x00, 0, 1, 0x22, 0x04 },
+ { 0x46, 0x00, 0, 1, 0x22, 0x04 }, { 0x45, 0x00, 0, 1, 0x22, 0x04 }, { 0x46, 0x00, 0, 1, 0x22, 0x04 },
+ { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, { 0x4D, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x4D, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x06, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x09, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 }, { 0x09, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x17, 0x00, 1, 1, 0x02, 0x02 }, { 0x17, 0x00, 1, 1, 0x02, 0x02 }, { 0x17, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x17, 0x00, 1, 1, 0x02, 0x02 }, { 0x17, 0x00, 0, 1, 0x02, 0x02 }, { 0x17, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x17, 0x00, 0, 1, 0x02, 0x02 }, { 0x65, 0x00, 0, 1, 0x02, 0x02 }, { 0x65, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x65, 0x00, 0, 1, 0x02, 0x02 }, { 0x65, 0x00, 0, 1, 0x02, 0x02 }, { 0x08, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x08, 0x00, 0, 1, 0x04, 0x04 }, { 0x08, 0x00, 0, 1, 0x04, 0x04 }, { 0x08, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x27, 0x00, 0, 1, 0x04, 0x04 }, { 0x27, 0x00, 0, 1, 0x04, 0x04 }, { 0x27, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x27, 0x00, 0, 1, 0x04, 0x04 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x0A, 0x0A },
+ { 0x47, 0x00, 0, 1, 0x02, 0x0A }, { 0x47, 0x00, 1, 1, 0x0A, 0x0A }, { 0x47, 0x00, 0, 1, 0x0B, 0x0B },
+ { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x02, 0x02 }, { 0x47, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x47, 0x00, 0, 1, 0x03, 0x03 }, { 0x1E, 0x00, 1, 1, 0x03, 0x03 },
+ { 0x1F, 0x00, 1, 1, 0x02, 0x02 }, { 0x1E, 0x00, 1, 1, 0x02, 0x02 }, { 0x1F, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x20, 0x00, 1, 1, 0x03, 0x03 }, { 0x21, 0x00, 1, 1, 0x02, 0x02 }, { 0x22, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x22, 0x00, 1, 1, 0x02, 0x02 }, { 0x20, 0x00, 0, 1, 0x08, 0x08 }, { 0x67, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, { 0x2C, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x2C, 0x00, 0, 1, 0x04, 0x20 }, { 0x34, 0x00, 0, 1, 0x04, 0x04 }, { 0x34, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x34, 0x00, 0, 1, 0x04, 0x04 }, { 0x34, 0x00, 0, 1, 0x04, 0x04 }, { 0x34, 0x00, 0, 1, 0x04, 0x02 },
+ { 0x34, 0x00, 0, 1, 0x10, 0x10 }, { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, { 0x2D, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, { 0x2D, 0x00, 0, 1, 0x04, 0x04 }, { 0x01, 0x01, 1, 0, 0x02, 0x02 },
+ { 0x01, 0x01, 1, 0, 0x02, 0x02 }, { 0x01, 0x01, 1, 0, 0x02, 0x02 }, { 0x01, 0x01, 1, 0, 0x02, 0x02 },
+ { 0x26, 0x00, 0, 1, 0x04, 0x04 }, { 0x26, 0x00, 0, 1, 0x04, 0x04 }, { 0x26, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x26, 0x00, 0, 1, 0x04, 0x04 }, { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 0, 1, 0x02, 0x02 }, { 0x51, 0x00, 0, 1, 0x04, 0x02 },
+ { 0x51, 0x00, 0, 1, 0x21, 0x21 }, { 0x51, 0x00, 0, 1, 0x21, 0x21 }, { 0x51, 0x00, 0, 1, 0x23, 0x23 },
+ { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 1, 1, 0x02, 0x02 }, { 0x51, 0x00, 0, 1, 0x23, 0x23 },
+ { 0x51, 0x00, 0, 1, 0x03, 0x03 }, { 0x51, 0x00, 0, 1, 0x29, 0x29 }, { 0x51, 0x00, 1, 1, 0x03, 0x03 },
+ { 0x52, 0x00, 0, 1, 0x03, 0x03 }, { 0x52, 0x00, 0, 1, 0x02, 0x02 }, { 0x52, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x52, 0x00, 0, 1, 0x02, 0x02 }, { 0x52, 0x00, 0, 1, 0x26, 0x26 }, { 0x52, 0x00, 0, 1, 0x21, 0x21 },
+ { 0x52, 0x00, 1, 1, 0x21, 0x21 }, { 0x52, 0x00, 0, 1, 0x21, 0x21 }, { 0x52, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x53, 0x00, 0, 1, 0x03, 0x03 }, { 0x53, 0x00, 0, 1, 0x02, 0x02 }, { 0x53, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x53, 0x00, 0, 1, 0x02, 0x02 }, { 0x53, 0x00, 0, 1, 0x04, 0x02 }, { 0x53, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x54, 0x00, 1, 1, 0x03, 0x03 }, { 0x54, 0x00, 1, 1, 0x02, 0x02 }, { 0x54, 0x00, 1, 1, 0x03, 0x03 },
+ { 0x54, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x00, 0, 1, 0x03, 0x03 }, { 0x55, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x55, 0x00, 0, 1, 0x03, 0x03 }, { 0x55, 0x00, 0, 1, 0x02, 0x02 }, { 0x55, 0x00, 1, 1, 0x0A, 0x0A },
+ { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, { 0x55, 0x00, 1, 1, 0x0A, 0x0A }, { 0x55, 0x00, 0, 1, 0x0D, 0x0A },
+ { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, { 0x55, 0x00, 0, 1, 0x0A, 0x0A }, { 0x55, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x55, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x56, 0x00, 1, 1, 0x02, 0x02 }, { 0x56, 0x00, 1, 1, 0x02, 0x02 }, { 0x56, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x56, 0x00, 1, 1, 0x02, 0x02 }, { 0x56, 0x00, 0, 1, 0x03, 0x03 }, { 0x56, 0x00, 0, 1, 0x00, 0x00 },
+ { 0x57, 0x00, 1, 1, 0x03, 0x03 }, { 0x57, 0x00, 1, 1, 0x02, 0x02 }, { 0x57, 0x00, 1, 1, 0x03, 0x03 },
+ { 0x57, 0x00, 1, 1, 0x02, 0x02 }, { 0x57, 0x00, 0, 1, 0x03, 0x03 }, { 0x57, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x58, 0x00, 0, 1, 0x02, 0x02 }, { 0x58, 0x00, 0, 1, 0x02, 0x02 }, { 0x58, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x58, 0x00, 0, 1, 0x02, 0x02 }, { 0x58, 0x00, 1, 1, 0x02, 0x02 }, { 0x58, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x59, 0x00, 0, 1, 0x03, 0x03 }, { 0x59, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x59, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x00, 0, 1, 0x0D, 0x00 }, { 0x59, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x59, 0x00, 1, 1, 0x02, 0x02 }, { 0x59, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x5A, 0x00, 0, 1, 0x03, 0x03 }, { 0x5A, 0x00, 0, 1, 0x02, 0x02 }, { 0x5A, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x5A, 0x00, 0, 1, 0x02, 0x02 }, { 0x5A, 0x00, 1, 1, 0x0C, 0x0A }, { 0x5A, 0x00, 1, 1, 0x0A, 0x0A },
+ { 0x5A, 0x00, 1, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 }, { 0x5B, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, { 0x5C, 0x00, 1, 1, 0x0F, 0x0F },
+ { 0x5C, 0x00, 1, 1, 0x0F, 0x0F }, { 0x5C, 0x00, 1, 1, 0x02, 0x02 }, { 0x5C, 0x00, 1, 1, 0x0F, 0x0F },
+ { 0x5D, 0x00, 1, 1, 0x03, 0x03 }, { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, { 0x5D, 0x00, 1, 1, 0x03, 0x03 },
+ { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, { 0x5D, 0x00, 1, 1, 0x21, 0x21 }, { 0x5D, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x5D, 0x00, 1, 1, 0x02, 0x02 }, { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x00, 1, 1, 0x0E, 0x0E },
+ { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x00, 1, 1, 0x0E, 0x0E }, { 0x0E, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, { 0x0E, 0x01, 1, 1, 0x02, 0x02 }, { 0x0E, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x5F, 0x00, 0, 1, 0x03, 0x03 }, { 0x5F, 0x00, 0, 1, 0x02, 0x02 }, { 0x64, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x64, 0x00, 0, 1, 0x02, 0x02 }, { 0x64, 0x00, 0, 1, 0x04, 0x02 }, { 0x60, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x60, 0x00, 0, 1, 0x02, 0x02 }, { 0x60, 0x00, 0, 1, 0x03, 0x03 }, { 0x60, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x60, 0x00, 1, 1, 0x0A, 0x0A }, { 0x60, 0x00, 0, 1, 0x03, 0x03 }, { 0x60, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x60, 0x00, 1, 1, 0x02, 0x02 }, { 0x60, 0x00, 1, 1, 0x03, 0x03 }, { 0x60, 0x00, 1, 1, 0x03, 0x03 },
+ { 0x61, 0x00, 0, 1, 0x02, 0x02 }, { 0x61, 0x00, 0, 1, 0x02, 0x02 }, { 0x61, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x61, 0x00, 0, 1, 0x02, 0x02 }, { 0x61, 0x00, 0, 1, 0x03, 0x03 }, { 0x61, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 0, 1, 0x02, 0x02 }, { 0x62, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x58, 0x03, 0, 1, 0x00, 0x00 }, { 0x58, 0x03, 0, 1, 0x00, 0x00 }, { 0x58, 0x03, 0, 1, 0x00, 0x00 },
+ { 0x58, 0x03, 0, 1, 0x00, 0x00 }, { 0x63, 0x00, 0, 1, 0x03, 0x03 }, { 0x63, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x63, 0x00, 0, 1, 0x03, 0x03 }, { 0x63, 0x00, 0, 1, 0x02, 0x02 }, { 0x63, 0x00, 0, 1, 0x20, 0x20 },
+ { 0x63, 0x00, 0, 1, 0x2A, 0x2A }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 }, { 0x63, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x04, 0x00, 0, 1, 0x02, 0x02 }, { 0x04, 0x00, 0, 1, 0x02, 0x02 }, { 0x04, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x04, 0x00, 0, 1, 0x02, 0x02 }, { 0x03, 0x00, 0, 1, 0x02, 0x02 }, { 0x03, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x03, 0x00, 0, 1, 0x02, 0x02 }, { 0x03, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x01, 0, 1, 0x04, 0x20 },
+ { 0x42, 0x01, 0, 1, 0x04, 0x20 }, { 0x42, 0x01, 0, 1, 0x04, 0x20 }, { 0x42, 0x01, 0, 1, 0x04, 0x20 },
+ { 0x23, 0x00, 0, 1, 0x03, 0x03 }, { 0x24, 0x00, 0, 1, 0x02, 0x02 }, { 0x25, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x25, 0x00, 0, 1, 0x02, 0x02 }, { 0x04, 0x01, 1, 1, 0x02, 0x02 }, { 0x04, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x04, 0x01, 1, 1, 0x02, 0x02 }, { 0x04, 0x01, 1, 1, 0x02, 0x02 }, { 0x0E, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, { 0x0E, 0x00, 1, 1, 0x02, 0x02 }, { 0x0E, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x51, 0x01, 0, 1, 0x03, 0x03 }, { 0x51, 0x01, 0, 1, 0x02, 0x02 }, { 0x51, 0x01, 0, 1, 0x03, 0x03 },
+ { 0x51, 0x01, 0, 1, 0x02, 0x02 }, { 0x51, 0x02, 1, 1, 0x03, 0x03 }, { 0x51, 0x02, 1, 1, 0x02, 0x02 },
+ { 0x51, 0x02, 1, 1, 0x03, 0x03 }, { 0x51, 0x02, 1, 1, 0x02, 0x02 }, { 0x51, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x51, 0x03, 0, 1, 0x02, 0x02 }, { 0x51, 0x03, 0, 1, 0x02, 0x02 }, { 0x51, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x51, 0x04, 1, 1, 0x03, 0x03 }, { 0x51, 0x04, 1, 1, 0x02, 0x02 }, { 0x51, 0x04, 1, 1, 0x03, 0x03 },
+ { 0x51, 0x04, 1, 1, 0x02, 0x02 }, { 0x51, 0x05, 0, 1, 0x03, 0x03 }, { 0x51, 0x05, 0, 1, 0x02, 0x02 },
+ { 0x51, 0x05, 0, 1, 0x03, 0x03 }, { 0x51, 0x05, 0, 1, 0x02, 0x02 }, { 0x52, 0x01, 0, 1, 0x03, 0x03 },
+ { 0x52, 0x01, 0, 1, 0x02, 0x02 }, { 0x52, 0x01, 0, 1, 0x03, 0x03 }, { 0x52, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x52, 0x02, 0, 1, 0x03, 0x03 }, { 0x52, 0x02, 0, 1, 0x02, 0x02 }, { 0x52, 0x02, 0, 1, 0x03, 0x03 },
+ { 0x52, 0x02, 0, 1, 0x02, 0x02 }, { 0x54, 0x01, 1, 1, 0x03, 0x03 }, { 0x54, 0x01, 1, 1, 0x03, 0x03 },
+ { 0x54, 0x01, 1, 1, 0x03, 0x03 }, { 0x54, 0x01, 1, 1, 0x03, 0x03 }, { 0x54, 0x02, 0, 1, 0x03, 0x03 },
+ { 0x54, 0x02, 0, 1, 0x02, 0x02 }, { 0x54, 0x02, 0, 1, 0x03, 0x03 }, { 0x54, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x58, 0x01, 0, 1, 0x02, 0x02 }, { 0x58, 0x01, 0, 1, 0x02, 0x02 }, { 0x58, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x58, 0x01, 0, 1, 0x02, 0x02 }, { 0x5A, 0x01, 0, 1, 0x03, 0x03 }, { 0x5A, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x5A, 0x01, 0, 1, 0x03, 0x03 }, { 0x5A, 0x01, 0, 1, 0x02, 0x02 }, { 0x5B, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, { 0x5B, 0x01, 1, 1, 0x02, 0x02 }, { 0x5B, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x5B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, { 0x5B, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, { 0x5B, 0x03, 0, 1, 0x02, 0x02 }, { 0x0E, 0x02, 1, 1, 0x02, 0x02 },
+ { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, { 0x0E, 0x02, 1, 1, 0x02, 0x02 }, { 0x0E, 0x02, 1, 1, 0x02, 0x02 },
+ { 0x60, 0x01, 0, 1, 0x03, 0x03 }, { 0x60, 0x01, 0, 1, 0x02, 0x02 }, { 0x60, 0x01, 0, 1, 0x03, 0x03 },
+ { 0x60, 0x01, 0, 1, 0x02, 0x02 }, { 0x60, 0x02, 0, 1, 0x03, 0x03 }, { 0x60, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x60, 0x02, 0, 1, 0x03, 0x03 }, { 0x60, 0x02, 0, 1, 0x02, 0x02 }, { 0x62, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x62, 0x01, 0, 1, 0x02, 0x02 }, { 0x62, 0x01, 0, 1, 0x02, 0x02 }, { 0x62, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x38, 0x01, 0, 1, 0x04, 0x20 }, { 0x38, 0x01, 0, 1, 0x04, 0x20 }, { 0x38, 0x01, 0, 1, 0x04, 0x20 },
+ { 0x38, 0x01, 0, 1, 0x04, 0x20 }, { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, { 0x1A, 0x05, 1, 1, 0x02, 0x02 },
+ { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, { 0x1A, 0x05, 1, 1, 0x02, 0x02 }, { 0x20, 0x08, 0, 1, 0x04, 0x02 },
+ { 0x21, 0x08, 0, 1, 0x04, 0x02 }, { 0x22, 0x08, 0, 1, 0x04, 0x02 }, { 0x22, 0x08, 0, 1, 0x04, 0x02 },
+ { 0x20, 0x09, 0, 1, 0x04, 0x02 }, { 0x21, 0x09, 0, 1, 0x04, 0x02 }, { 0x22, 0x09, 0, 1, 0x04, 0x02 },
+ { 0x22, 0x09, 0, 1, 0x04, 0x02 }, { 0x20, 0x0A, 0, 1, 0x04, 0x02 }, { 0x21, 0x0A, 0, 1, 0x04, 0x02 },
+ { 0x22, 0x0A, 0, 1, 0x04, 0x02 }, { 0x22, 0x0A, 0, 1, 0x04, 0x02 }, { 0x54, 0x03, 1, 1, 0x03, 0x03 },
+ { 0x54, 0x03, 1, 1, 0x02, 0x02 }, { 0x54, 0x03, 1, 1, 0x03, 0x03 }, { 0x54, 0x03, 1, 1, 0x02, 0x02 },
+ { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, { 0x54, 0x04, 0, 1, 0x2C, 0x2C },
+ { 0x54, 0x04, 0, 1, 0x2C, 0x2C }, { 0x5C, 0x01, 0, 1, 0x03, 0x03 }, { 0x5C, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x5C, 0x01, 0, 1, 0x03, 0x03 }, { 0x5C, 0x01, 0, 1, 0x02, 0x02 }, { 0x5C, 0x02, 0, 0, 0x03, 0x03 },
+ { 0x5C, 0x02, 0, 0, 0x02, 0x02 }, { 0x5C, 0x02, 0, 0, 0x03, 0x03 }, { 0x5C, 0x02, 0, 0, 0x02, 0x02 },
+ { 0x5C, 0x03, 0, 0, 0x03, 0x03 }, { 0x5C, 0x03, 0, 0, 0x02, 0x02 }, { 0x5C, 0x03, 0, 0, 0x03, 0x03 },
+ { 0x5C, 0x03, 0, 0, 0x02, 0x02 }, { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, { 0x5C, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, { 0x5C, 0x04, 0, 1, 0x02, 0x02 }, { 0x5C, 0x05, 0, 1, 0x03, 0x03 },
+ { 0x5C, 0x05, 0, 1, 0x02, 0x02 }, { 0x5C, 0x05, 0, 1, 0x03, 0x03 }, { 0x5C, 0x05, 0, 1, 0x02, 0x02 },
+ { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, { 0x5C, 0x06, 1, 0, 0x0F, 0x0F },
+ { 0x5C, 0x06, 1, 0, 0x0F, 0x0F }, { 0x51, 0x06, 0, 1, 0x03, 0x03 }, { 0x51, 0x06, 0, 1, 0x02, 0x02 },
+ { 0x51, 0x06, 0, 1, 0x03, 0x03 }, { 0x51, 0x06, 0, 1, 0x02, 0x02 }, { 0x51, 0x07, 0, 1, 0x03, 0x03 },
+ { 0x51, 0x07, 0, 1, 0x02, 0x02 }, { 0x51, 0x07, 0, 1, 0x03, 0x03 }, { 0x51, 0x07, 0, 1, 0x02, 0x02 },
+ { 0x52, 0x03, 0, 1, 0x04, 0x02 }, { 0x52, 0x03, 0, 1, 0x04, 0x02 }, { 0x52, 0x03, 0, 1, 0x04, 0x02 },
+ { 0x52, 0x03, 0, 1, 0x04, 0x02 }, { 0x53, 0x01, 0, 1, 0x02, 0x02 }, { 0x53, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x53, 0x01, 0, 1, 0x02, 0x02 }, { 0x53, 0x01, 0, 1, 0x02, 0x02 }, { 0x55, 0x01, 0, 1, 0x03, 0x03 },
+ { 0x55, 0x01, 0, 1, 0x02, 0x02 }, { 0x55, 0x01, 0, 1, 0x03, 0x03 }, { 0x55, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x55, 0x02, 0, 1, 0x02, 0x02 }, { 0x55, 0x02, 0, 1, 0x02, 0x02 }, { 0x55, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x55, 0x02, 0, 1, 0x02, 0x02 }, { 0x55, 0x03, 0, 1, 0x04, 0x04 }, { 0x55, 0x03, 0, 1, 0x04, 0x04 },
+ { 0x55, 0x03, 0, 1, 0x04, 0x04 }, { 0x55, 0x03, 0, 1, 0x04, 0x04 }, { 0x56, 0x01, 0, 1, 0x12, 0x12 },
+ { 0x56, 0x01, 0, 1, 0x02, 0x02 }, { 0x56, 0x01, 0, 1, 0x12, 0x12 }, { 0x56, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x57, 0x01, 0, 1, 0x03, 0x03 }, { 0x57, 0x01, 0, 1, 0x02, 0x02 }, { 0x57, 0x01, 0, 1, 0x03, 0x03 },
+ { 0x57, 0x01, 0, 1, 0x02, 0x02 }, { 0x57, 0x02, 0, 1, 0x13, 0x13 }, { 0x57, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x57, 0x02, 0, 1, 0x13, 0x13 }, { 0x57, 0x02, 0, 1, 0x02, 0x02 }, { 0x59, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x59, 0x01, 0, 1, 0x02, 0x02 }, { 0x59, 0x01, 0, 1, 0x02, 0x02 }, { 0x59, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x59, 0x02, 0, 1, 0x03, 0x03 }, { 0x59, 0x02, 0, 1, 0x02, 0x02 }, { 0x59, 0x02, 0, 1, 0x03, 0x03 },
+ { 0x59, 0x02, 0, 1, 0x02, 0x02 }, { 0x5A, 0x02, 1, 1, 0x03, 0x03 }, { 0x5A, 0x02, 1, 1, 0x02, 0x02 },
+ { 0x5A, 0x02, 1, 1, 0x03, 0x03 }, { 0x5A, 0x02, 1, 1, 0x02, 0x02 }, { 0x5A, 0x03, 1, 1, 0x03, 0x03 },
+ { 0x5A, 0x03, 1, 1, 0x02, 0x02 }, { 0x5A, 0x03, 1, 1, 0x03, 0x03 }, { 0x5A, 0x03, 1, 1, 0x02, 0x02 },
+ { 0x5D, 0x01, 0, 1, 0x03, 0x03 }, { 0x5D, 0x01, 0, 1, 0x02, 0x02 }, { 0x5D, 0x01, 0, 1, 0x03, 0x03 },
+ { 0x5D, 0x01, 0, 1, 0x02, 0x02 }, { 0x5D, 0x02, 0, 1, 0x03, 0x03 }, { 0x5D, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x02, 0, 1, 0x03, 0x03 }, { 0x5D, 0x02, 0, 1, 0x02, 0x02 }, { 0x5D, 0x03, 0, 1, 0x03, 0x03 },
+ { 0x5D, 0x03, 0, 1, 0x02, 0x02 }, { 0x5D, 0x03, 0, 1, 0x03, 0x03 }, { 0x5D, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x5F, 0x01, 0, 1, 0x03, 0x03 }, { 0x5F, 0x01, 0, 1, 0x02, 0x02 }, { 0x64, 0x01, 0, 1, 0x05, 0x05 },
+ { 0x64, 0x01, 0, 1, 0x05, 0x05 }, { 0x5F, 0x01, 0, 1, 0x00, 0x00 }, { 0x60, 0x03, 0, 1, 0x03, 0x03 },
+ { 0x60, 0x03, 0, 1, 0x02, 0x02 }, { 0x60, 0x03, 0, 1, 0x03, 0x03 }, { 0x60, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x61, 0x01, 0, 1, 0x02, 0x02 }, { 0x61, 0x01, 0, 1, 0x02, 0x02 }, { 0x61, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x61, 0x01, 0, 1, 0x02, 0x02 }, { 0x61, 0x02, 0, 1, 0x02, 0x02 }, { 0x61, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x61, 0x02, 0, 1, 0x02, 0x02 }, { 0x61, 0x02, 0, 1, 0x02, 0x02 }, { 0x03, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x03, 0x01, 1, 1, 0x02, 0x02 }, { 0x03, 0x01, 1, 1, 0x02, 0x02 }, { 0x03, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x00, 0x01, 1, 0, 0x02, 0x02 }, { 0x00, 0x01, 1, 0, 0x02, 0x02 }, { 0x00, 0x01, 1, 0, 0x02, 0x02 },
+ { 0x00, 0x01, 1, 0, 0x02, 0x02 }, { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, { 0x0E, 0x03, 1, 1, 0x02, 0x02 },
+ { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, { 0x0E, 0x03, 1, 1, 0x02, 0x02 }, { 0x20, 0x01, 0, 1, 0x03, 0x03 },
+ { 0x21, 0x01, 0, 1, 0x02, 0x02 }, { 0x22, 0x01, 0, 1, 0x02, 0x02 }, { 0x22, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x20, 0x02, 0, 1, 0x03, 0x03 }, { 0x21, 0x02, 0, 1, 0x02, 0x02 }, { 0x22, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x22, 0x02, 0, 1, 0x02, 0x02 }, { 0x20, 0x03, 1, 1, 0x03, 0x03 }, { 0x21, 0x03, 1, 1, 0x02, 0x02 },
+ { 0x22, 0x03, 1, 1, 0x02, 0x02 }, { 0x22, 0x03, 1, 1, 0x02, 0x02 }, { 0x55, 0x04, 0, 0, 0x04, 0x04 },
+ { 0x55, 0x04, 0, 0, 0x04, 0x04 }, { 0x55, 0x04, 0, 0, 0x04, 0x04 }, { 0x55, 0x04, 0, 0, 0x04, 0x04 },
+ { 0x55, 0x05, 0, 0, 0x04, 0x04 }, { 0x55, 0x05, 0, 0, 0x04, 0x04 }, { 0x55, 0x05, 0, 0, 0x04, 0x04 },
+ { 0x55, 0x05, 0, 0, 0x04, 0x04 }, { 0x1B, 0x02, 0, 0, 0x02, 0x02 }, { 0x1C, 0x02, 0, 0, 0x02, 0x02 },
+ { 0x1D, 0x02, 0, 0, 0x02, 0x02 }, { 0x1D, 0x02, 0, 0, 0x02, 0x02 }, { 0x34, 0x01, 0, 1, 0x04, 0x04 },
+ { 0x34, 0x01, 0, 1, 0x04, 0x04 }, { 0x34, 0x01, 0, 1, 0x04, 0x04 }, { 0x34, 0x01, 0, 1, 0x04, 0x04 },
+ { 0x1B, 0x01, 0, 1, 0x03, 0x03 }, { 0x1C, 0x01, 0, 1, 0x02, 0x02 }, { 0x1D, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x1D, 0x01, 0, 1, 0x02, 0x02 }, { 0x51, 0x08, 1, 1, 0x03, 0x03 }, { 0x51, 0x08, 1, 1, 0x02, 0x02 },
+ { 0x51, 0x08, 1, 1, 0x03, 0x03 }, { 0x51, 0x08, 1, 1, 0x02, 0x02 }, { 0x51, 0x09, 0, 1, 0x03, 0x03 },
+ { 0x51, 0x09, 0, 1, 0x03, 0x03 }, { 0x51, 0x09, 0, 1, 0x03, 0x03 }, { 0x51, 0x09, 0, 1, 0x03, 0x03 },
+ { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, { 0x51, 0x0A, 0, 1, 0x03, 0x03 },
+ { 0x51, 0x0A, 0, 1, 0x03, 0x03 }, { 0x55, 0x06, 0, 1, 0x02, 0x02 }, { 0x55, 0x06, 0, 1, 0x02, 0x02 },
+ { 0x55, 0x06, 0, 1, 0x02, 0x02 }, { 0x55, 0x06, 0, 1, 0x02, 0x02 }, { 0x51, 0x0B, 0, 1, 0x05, 0x05 },
+ { 0x51, 0x0B, 0, 1, 0x04, 0x02 }, { 0x51, 0x0B, 0, 1, 0x05, 0x05 }, { 0x51, 0x0B, 0, 1, 0x04, 0x02 },
+ { 0x51, 0x0C, 0, 1, 0x05, 0x05 }, { 0x51, 0x0C, 0, 1, 0x04, 0x02 }, { 0x51, 0x0C, 0, 1, 0x05, 0x05 },
+ { 0x51, 0x0C, 0, 1, 0x04, 0x02 }, { 0x51, 0x0D, 0, 1, 0x05, 0x05 }, { 0x51, 0x0D, 0, 1, 0x04, 0x02 },
+ { 0x51, 0x0D, 0, 1, 0x05, 0x05 }, { 0x51, 0x0D, 0, 1, 0x04, 0x02 }, { 0x45, 0x01, 0, 1, 0x03, 0x03 },
+ { 0x46, 0x01, 0, 1, 0x02, 0x02 }, { 0x45, 0x01, 0, 1, 0x03, 0x03 }, { 0x46, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x1E, 0x01, 1, 1, 0x03, 0x03 }, { 0x1F, 0x01, 1, 1, 0x02, 0x02 }, { 0x1E, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x1F, 0x01, 1, 1, 0x02, 0x02 }, { 0x20, 0x04, 1, 1, 0x03, 0x03 }, { 0x21, 0x04, 1, 1, 0x02, 0x02 },
+ { 0x22, 0x04, 1, 1, 0x02, 0x02 }, { 0x22, 0x04, 1, 1, 0x02, 0x02 }, { 0x20, 0x05, 0, 1, 0x04, 0x02 },
+ { 0x21, 0x05, 0, 1, 0x04, 0x02 }, { 0x22, 0x05, 0, 1, 0x04, 0x02 }, { 0x22, 0x05, 0, 1, 0x04, 0x02 },
+ { 0x52, 0x04, 0, 1, 0x02, 0x02 }, { 0x52, 0x04, 0, 1, 0x02, 0x02 }, { 0x52, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x52, 0x04, 0, 1, 0x02, 0x02 }, { 0x5D, 0x04, 0, 1, 0x03, 0x03 }, { 0x5D, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x04, 0, 1, 0x03, 0x03 }, { 0x5D, 0x04, 0, 1, 0x02, 0x02 }, { 0x63, 0x01, 0, 0, 0x03, 0x03 },
+ { 0x63, 0x01, 0, 0, 0x02, 0x02 }, { 0x63, 0x01, 0, 0, 0x03, 0x03 }, { 0x63, 0x01, 0, 0, 0x02, 0x02 },
+ { 0x07, 0x01, 0, 1, 0x02, 0x02 }, { 0x07, 0x01, 0, 1, 0x02, 0x02 }, { 0x07, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x07, 0x01, 0, 1, 0x02, 0x02 }, { 0x07, 0x02, 1, 1, 0x02, 0x02 }, { 0x07, 0x02, 1, 1, 0x02, 0x02 },
+ { 0x07, 0x02, 1, 1, 0x02, 0x02 }, { 0x07, 0x02, 1, 1, 0x02, 0x02 }, { 0x5D, 0x05, 0, 1, 0x03, 0x03 },
+ { 0x5D, 0x05, 0, 1, 0x02, 0x02 }, { 0x5D, 0x05, 0, 1, 0x03, 0x03 }, { 0x5D, 0x05, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x06, 0, 1, 0x03, 0x03 }, { 0x5D, 0x06, 0, 1, 0x02, 0x02 }, { 0x5D, 0x06, 0, 1, 0x03, 0x03 },
+ { 0x5D, 0x06, 0, 1, 0x02, 0x02 }, { 0x5D, 0x07, 0, 1, 0x03, 0x03 }, { 0x5D, 0x07, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x07, 0, 1, 0x03, 0x03 }, { 0x5D, 0x07, 0, 1, 0x02, 0x02 }, { 0x5D, 0x08, 0, 1, 0x03, 0x03 },
+ { 0x5D, 0x08, 0, 1, 0x02, 0x02 }, { 0x5D, 0x08, 0, 1, 0x03, 0x03 }, { 0x5D, 0x08, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, { 0x43, 0x02, 0, 1, 0x0A, 0x0A },
+ { 0x43, 0x02, 0, 1, 0x0A, 0x0A }, { 0x44, 0x01, 0, 1, 0x02, 0x02 }, { 0x44, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x44, 0x01, 0, 1, 0x02, 0x02 }, { 0x44, 0x01, 0, 1, 0x02, 0x02 }, { 0x5D, 0x09, 0, 1, 0x03, 0x03 },
+ { 0x5D, 0x09, 0, 1, 0x02, 0x02 }, { 0x5D, 0x09, 0, 1, 0x03, 0x03 }, { 0x5D, 0x09, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x0A, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0A, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0A, 0, 1, 0x03, 0x03 },
+ { 0x5D, 0x0A, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0B, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0B, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x0B, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0B, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0C, 0, 1, 0x03, 0x03 },
+ { 0x5D, 0x0C, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0C, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0C, 0, 1, 0x02, 0x02 },
+ { 0x63, 0x02, 0, 1, 0x03, 0x03 }, { 0x63, 0x02, 0, 1, 0x02, 0x02 }, { 0x63, 0x02, 0, 1, 0x03, 0x03 },
+ { 0x63, 0x02, 0, 1, 0x02, 0x02 }, { 0x63, 0x03, 0, 1, 0x03, 0x03 }, { 0x63, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x63, 0x03, 0, 1, 0x03, 0x03 }, { 0x63, 0x03, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x56, 0x00, 0, 1, 0x02, 0x02 }, { 0x47, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x42, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x42, 0x00, 0, 1, 0x02, 0x02 }, { 0x06, 0x01, 1, 1, 0x02, 0x02 }, { 0x06, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x06, 0x01, 1, 1, 0x02, 0x02 }, { 0x06, 0x01, 1, 1, 0x02, 0x02 }, { 0x36, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x36, 0x00, 0, 1, 0x04, 0x20 }, { 0x36, 0x00, 0, 1, 0x04, 0x20 }, { 0x36, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, { 0x2A, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x2A, 0x00, 0, 1, 0x04, 0x20 }, { 0x13, 0x00, 1, 1, 0x02, 0x02 }, { 0x13, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x13, 0x00, 1, 1, 0x02, 0x02 }, { 0x13, 0x00, 1, 1, 0x02, 0x02 }, { 0x15, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x15, 0x00, 1, 1, 0x02, 0x02 }, { 0x15, 0x00, 1, 1, 0x02, 0x02 }, { 0x15, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x57, 0x06, 0, 1, 0x04, 0x02 }, { 0x57, 0x06, 0, 1, 0x04, 0x02 }, { 0x57, 0x06, 0, 1, 0x04, 0x02 },
+ { 0x57, 0x06, 0, 1, 0x04, 0x02 }, { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, { 0x3A, 0x00, 0, 1, 0x02, 0x20 },
+ { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, { 0x3A, 0x00, 0, 1, 0x02, 0x20 }, { 0x51, 0x0E, 1, 1, 0x03, 0x03 },
+ { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, { 0x51, 0x0E, 1, 1, 0x03, 0x03 }, { 0x51, 0x0E, 1, 1, 0x03, 0x03 },
+ { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3B, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x3B, 0x00, 0, 1, 0x02, 0x02 }, { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, { 0x3F, 0x00, 0, 1, 0x02, 0x26 },
+ { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, { 0x3F, 0x00, 0, 1, 0x02, 0x26 }, { 0x43, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x03, 0, 1, 0x02, 0x02 }, { 0x43, 0x03, 0, 1, 0x02, 0x02 }, { 0x43, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x04, 0, 1, 0x02, 0x02 }, { 0x43, 0x04, 0, 1, 0x02, 0x02 }, { 0x43, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x04, 0, 1, 0x02, 0x02 }, { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, { 0x58, 0x04, 0, 1, 0x2C, 0x2C },
+ { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, { 0x58, 0x04, 0, 1, 0x2C, 0x2C }, { 0x1A, 0x02, 1, 1, 0x02, 0x02 },
+ { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, { 0x1A, 0x02, 1, 1, 0x02, 0x02 }, { 0x1A, 0x02, 1, 1, 0x02, 0x02 },
+ { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, { 0x1A, 0x03, 1, 1, 0x02, 0x02 },
+ { 0x1A, 0x03, 1, 1, 0x02, 0x02 }, { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, { 0x1A, 0x04, 1, 1, 0x02, 0x02 },
+ { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, { 0x1A, 0x04, 1, 1, 0x02, 0x02 }, { 0x55, 0x07, 0, 0, 0x04, 0x04 },
+ { 0x55, 0x07, 0, 0, 0x04, 0x04 }, { 0x55, 0x07, 0, 0, 0x04, 0x04 }, { 0x55, 0x07, 0, 0, 0x04, 0x04 },
+ { 0x55, 0x08, 0, 0, 0x04, 0x04 }, { 0x55, 0x08, 0, 0, 0x04, 0x04 }, { 0x55, 0x08, 0, 0, 0x04, 0x04 },
+ { 0x55, 0x08, 0, 0, 0x04, 0x04 }, { 0x5F, 0x02, 0, 1, 0x02, 0x02 }, { 0x5F, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x64, 0x02, 0, 1, 0x02, 0x02 }, { 0x64, 0x02, 0, 1, 0x02, 0x02 }, { 0x5F, 0x02, 0, 1, 0x00, 0x00 },
+ { 0x52, 0x05, 0, 1, 0x04, 0x02 }, { 0x52, 0x05, 0, 1, 0x04, 0x02 }, { 0x52, 0x05, 0, 1, 0x04, 0x02 },
+ { 0x52, 0x05, 0, 1, 0x04, 0x02 }, { 0x52, 0x06, 0, 1, 0x04, 0x02 }, { 0x52, 0x06, 0, 1, 0x04, 0x02 },
+ { 0x52, 0x06, 0, 1, 0x04, 0x02 }, { 0x52, 0x06, 0, 1, 0x04, 0x02 }, { 0x52, 0x07, 0, 1, 0x04, 0x02 },
+ { 0x52, 0x07, 0, 1, 0x04, 0x02 }, { 0x52, 0x07, 0, 1, 0x04, 0x02 }, { 0x52, 0x07, 0, 1, 0x04, 0x02 },
+ { 0x52, 0x08, 0, 1, 0x04, 0x02 }, { 0x52, 0x08, 0, 1, 0x04, 0x02 }, { 0x52, 0x08, 0, 1, 0x04, 0x02 },
+ { 0x52, 0x08, 0, 1, 0x04, 0x02 }, { 0x53, 0x02, 0, 1, 0x04, 0x02 }, { 0x53, 0x02, 0, 1, 0x04, 0x02 },
+ { 0x53, 0x02, 0, 1, 0x04, 0x02 }, { 0x53, 0x02, 0, 1, 0x04, 0x02 }, { 0x53, 0x03, 0, 1, 0x03, 0x03 },
+ { 0x53, 0x03, 0, 1, 0x03, 0x03 }, { 0x53, 0x03, 0, 1, 0x03, 0x03 }, { 0x53, 0x03, 0, 1, 0x03, 0x03 },
+ { 0x53, 0x04, 0, 1, 0x03, 0x03 }, { 0x53, 0x04, 0, 1, 0x03, 0x03 }, { 0x53, 0x04, 0, 1, 0x03, 0x03 },
+ { 0x53, 0x04, 0, 1, 0x03, 0x03 }, { 0x53, 0x05, 0, 1, 0x03, 0x03 }, { 0x53, 0x05, 0, 1, 0x03, 0x03 },
+ { 0x53, 0x05, 0, 1, 0x03, 0x03 }, { 0x53, 0x05, 0, 1, 0x03, 0x03 }, { 0x5E, 0x01, 1, 1, 0x0E, 0x0E },
+ { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x01, 1, 1, 0x0E, 0x0E }, { 0x5E, 0x01, 1, 1, 0x0E, 0x0E },
+ { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, { 0x5E, 0x02, 0, 1, 0x0E, 0x0E },
+ { 0x5E, 0x02, 0, 1, 0x0E, 0x0E }, { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, { 0x3C, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, { 0x3C, 0x00, 0, 1, 0x03, 0x03 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 }, { 0x3D, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x63, 0x04, 0, 1, 0x04, 0x02 }, { 0x63, 0x04, 0, 1, 0x04, 0x02 }, { 0x63, 0x04, 0, 1, 0x04, 0x02 },
+ { 0x63, 0x04, 0, 1, 0x04, 0x02 }, { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, { 0x2E, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, { 0x2E, 0x00, 0, 1, 0x04, 0x20 }, { 0x2F, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, { 0x2F, 0x00, 0, 1, 0x04, 0x04 }, { 0x2F, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x30, 0x00, 0, 0, 0x04, 0x20 }, { 0x30, 0x00, 0, 0, 0x04, 0x20 }, { 0x30, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x30, 0x00, 0, 1, 0x04, 0x20 }, { 0x31, 0x00, 0, 1, 0x04, 0x20 }, { 0x31, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x31, 0x00, 0, 1, 0x04, 0x20 }, { 0x31, 0x00, 0, 1, 0x04, 0x20 }, { 0x1E, 0x04, 0, 1, 0x04, 0x02 },
+ { 0x1F, 0x04, 0, 1, 0x04, 0x02 }, { 0x1E, 0x04, 0, 1, 0x04, 0x02 }, { 0x1F, 0x04, 0, 1, 0x04, 0x02 },
+ { 0x32, 0x00, 0, 1, 0x02, 0x02 }, { 0x32, 0x00, 0, 1, 0x02, 0x02 }, { 0x32, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x32, 0x00, 0, 1, 0x02, 0x02 }, { 0x59, 0x05, 0, 1, 0x03, 0x03 }, { 0x59, 0x05, 0, 1, 0x03, 0x03 },
+ { 0x59, 0x05, 0, 1, 0x03, 0x03 }, { 0x59, 0x05, 0, 1, 0x03, 0x03 }, { 0x35, 0x00, 0, 1, 0x04, 0x02 },
+ { 0x35, 0x00, 0, 1, 0x04, 0x02 }, { 0x35, 0x00, 0, 1, 0x04, 0x02 }, { 0x35, 0x00, 0, 1, 0x04, 0x02 },
+ { 0x37, 0x00, 0, 1, 0x04, 0x20 }, { 0x37, 0x00, 0, 1, 0x04, 0x20 }, { 0x37, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x37, 0x00, 0, 1, 0x04, 0x20 }, { 0x39, 0x00, 0, 1, 0x04, 0x04 }, { 0x39, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x39, 0x00, 0, 1, 0x04, 0x04 }, { 0x39, 0x00, 0, 1, 0x04, 0x04 }, { 0x5D, 0x0D, 0, 1, 0x03, 0x03 },
+ { 0x5D, 0x0D, 0, 1, 0x02, 0x02 }, { 0x5D, 0x0D, 0, 1, 0x03, 0x03 }, { 0x5D, 0x0D, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x0E, 0, 1, 0x03, 0x05 }, { 0x5D, 0x0E, 0, 1, 0x02, 0x04 }, { 0x5D, 0x0E, 0, 1, 0x03, 0x05 },
+ { 0x5D, 0x0E, 0, 1, 0x02, 0x04 }, { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F },
+ { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, { 0x5D, 0x0F, 1, 1, 0x0F, 0x0F }, { 0x5D, 0x10, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, { 0x5D, 0x10, 0, 1, 0x02, 0x02 }, { 0x5D, 0x10, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, { 0x5D, 0x11, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x11, 0, 1, 0x02, 0x02 }, { 0x20, 0x06, 0, 1, 0x04, 0x02 }, { 0x21, 0x06, 0, 1, 0x04, 0x02 },
+ { 0x22, 0x06, 0, 1, 0x04, 0x02 }, { 0x22, 0x06, 0, 1, 0x04, 0x02 }, { 0x20, 0x07, 0, 1, 0x04, 0x02 },
+ { 0x21, 0x07, 0, 1, 0x04, 0x02 }, { 0x22, 0x07, 0, 1, 0x04, 0x02 }, { 0x22, 0x07, 0, 1, 0x04, 0x02 },
+ { 0x1E, 0x02, 0, 1, 0x04, 0x02 }, { 0x1F, 0x02, 0, 1, 0x04, 0x02 }, { 0x1E, 0x02, 0, 1, 0x03, 0x03 },
+ { 0x1F, 0x02, 0, 1, 0x02, 0x02 }, { 0x58, 0x02, 0, 1, 0x02, 0x02 }, { 0x58, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x58, 0x02, 0, 1, 0x02, 0x02 }, { 0x58, 0x02, 0, 1, 0x02, 0x02 }, { 0x57, 0x03, 0, 1, 0x03, 0x03 },
+ { 0x57, 0x03, 0, 1, 0x03, 0x03 }, { 0x57, 0x03, 0, 1, 0x03, 0x03 }, { 0x57, 0x03, 0, 1, 0x03, 0x03 },
+ { 0x57, 0x04, 0, 1, 0x04, 0x02 }, { 0x57, 0x04, 0, 1, 0x04, 0x02 }, { 0x57, 0x04, 0, 1, 0x04, 0x02 },
+ { 0x57, 0x04, 0, 1, 0x04, 0x02 }, { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, { 0x5A, 0x04, 0, 1, 0x04, 0x02 },
+ { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, { 0x5A, 0x04, 0, 1, 0x04, 0x02 }, { 0x59, 0x03, 0, 1, 0x03, 0x03 },
+ { 0x59, 0x03, 0, 1, 0x02, 0x02 }, { 0x59, 0x03, 0, 1, 0x03, 0x03 }, { 0x59, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x59, 0x04, 0, 1, 0x02, 0x02 }, { 0x59, 0x04, 0, 1, 0x02, 0x02 }, { 0x59, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x59, 0x04, 0, 1, 0x02, 0x02 }, { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, { 0x0E, 0x04, 1, 1, 0x02, 0x02 },
+ { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, { 0x0E, 0x04, 1, 1, 0x02, 0x02 }, { 0x0E, 0x05, 1, 1, 0x02, 0x02 },
+ { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, { 0x0E, 0x05, 1, 1, 0x02, 0x02 }, { 0x0E, 0x05, 1, 1, 0x02, 0x02 },
+ { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, { 0x0E, 0x06, 1, 1, 0x02, 0x02 },
+ { 0x0E, 0x06, 1, 1, 0x02, 0x02 }, { 0x30, 0x01, 0, 0, 0x04, 0x20 }, { 0x30, 0x01, 0, 0, 0x04, 0x20 },
+ { 0x30, 0x01, 0, 1, 0x04, 0x20 }, { 0x30, 0x01, 0, 1, 0x04, 0x20 }, { 0x30, 0x02, 0, 0, 0x04, 0x20 },
+ { 0x30, 0x02, 0, 0, 0x04, 0x20 }, { 0x30, 0x02, 0, 1, 0x04, 0x20 }, { 0x30, 0x02, 0, 1, 0x04, 0x20 },
+ { 0x06, 0x02, 0, 0, 0x02, 0x02 }, { 0x06, 0x02, 0, 0, 0x02, 0x02 }, { 0x06, 0x02, 0, 0, 0x02, 0x02 },
+ { 0x06, 0x02, 0, 0, 0x02, 0x02 }, { 0x06, 0x03, 0, 0, 0x02, 0x02 }, { 0x06, 0x03, 0, 0, 0x02, 0x02 },
+ { 0x06, 0x03, 0, 0, 0x02, 0x02 }, { 0x06, 0x03, 0, 0, 0x02, 0x02 }, { 0x06, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x06, 0x04, 0, 1, 0x02, 0x02 }, { 0x06, 0x04, 0, 1, 0x02, 0x02 }, { 0x06, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x62, 0x02, 0, 1, 0x04, 0x02 }, { 0x62, 0x02, 0, 1, 0x04, 0x02 }, { 0x62, 0x02, 0, 1, 0x04, 0x02 },
+ { 0x62, 0x02, 0, 1, 0x04, 0x02 }, { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x4A, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x4A, 0x00, 0, 1, 0x02, 0x02 }, { 0x4A, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x4A, 0x00, 0, 1, 0x03, 0x03 }, { 0x02, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x02, 0x01, 1, 1, 0x02, 0x02 }, { 0x02, 0x01, 1, 1, 0x02, 0x02 }, { 0x02, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x12, 0x00, 1, 0, 0x02, 0x02 }, { 0x12, 0x00, 1, 0, 0x02, 0x02 }, { 0x12, 0x00, 1, 0, 0x02, 0x02 },
+ { 0x12, 0x00, 1, 0, 0x02, 0x02 }, { 0x11, 0x00, 1, 0, 0x02, 0x02 }, { 0x11, 0x00, 1, 0, 0x02, 0x02 },
+ { 0x11, 0x00, 1, 0, 0x02, 0x02 }, { 0x11, 0x00, 1, 0, 0x02, 0x02 }, { 0x18, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x18, 0x00, 1, 1, 0x02, 0x02 }, { 0x18, 0x00, 1, 1, 0x02, 0x02 }, { 0x18, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x16, 0x00, 1, 1, 0x02, 0x02 }, { 0x16, 0x00, 1, 1, 0x02, 0x02 }, { 0x16, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x16, 0x00, 1, 1, 0x02, 0x02 }, { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, { 0x0A, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, { 0x0A, 0x00, 0, 1, 0x02, 0x02 }, { 0x19, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x19, 0x00, 1, 1, 0x02, 0x02 }, { 0x19, 0x00, 1, 1, 0x02, 0x02 }, { 0x19, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x05, 0x01, 1, 1, 0x03, 0x02 }, { 0x05, 0x01, 1, 1, 0x02, 0x02 }, { 0x05, 0x01, 1, 1, 0x03, 0x02 },
+ { 0x05, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x01, 1, 1, 0x02, 0x02 }, { 0x0A, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, { 0x0A, 0x02, 0, 1, 0x02, 0x02 }, { 0x0A, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x63, 0x05, 0, 1, 0x04, 0x02 }, { 0x63, 0x05, 0, 1, 0x04, 0x02 }, { 0x63, 0x05, 0, 1, 0x04, 0x02 },
+ { 0x63, 0x05, 0, 1, 0x04, 0x02 }, { 0x28, 0x00, 0, 1, 0x04, 0x04 }, { 0x28, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x28, 0x00, 0, 1, 0x04, 0x04 }, { 0x28, 0x00, 0, 1, 0x04, 0x04 }, { 0x29, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x29, 0x00, 0, 1, 0x04, 0x04 }, { 0x29, 0x00, 0, 1, 0x04, 0x04 }, { 0x29, 0x00, 0, 1, 0x04, 0x04 },
+ { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, { 0x2B, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x2B, 0x00, 0, 1, 0x04, 0x20 }, { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, { 0x1A, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, { 0x1A, 0x00, 1, 1, 0x02, 0x02 }, { 0x55, 0x09, 0, 0, 0x04, 0x04 },
+ { 0x55, 0x09, 0, 0, 0x04, 0x04 }, { 0x55, 0x09, 0, 0, 0x04, 0x04 }, { 0x55, 0x09, 0, 0, 0x04, 0x04 },
+ { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, { 0x55, 0x0A, 0, 0, 0x04, 0x04 },
+ { 0x55, 0x0A, 0, 0, 0x04, 0x04 }, { 0x52, 0x09, 0, 1, 0x04, 0x04 }, { 0x52, 0x09, 0, 1, 0x04, 0x04 },
+ { 0x52, 0x09, 0, 1, 0x04, 0x04 }, { 0x52, 0x09, 0, 1, 0x04, 0x04 }, { 0x48, 0x00, 0, 1, 0x02, 0x26 },
+ { 0x48, 0x00, 0, 1, 0x02, 0x26 }, { 0x48, 0x00, 0, 1, 0x02, 0x26 }, { 0x48, 0x00, 0, 1, 0x02, 0x26 },
+ { 0x48, 0x01, 0, 1, 0x04, 0x20 }, { 0x48, 0x01, 0, 1, 0x04, 0x20 }, { 0x48, 0x01, 0, 1, 0x04, 0x20 },
+ { 0x48, 0x01, 0, 1, 0x04, 0x20 }, { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, { 0x55, 0x0B, 0, 1, 0x04, 0x02 },
+ { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, { 0x55, 0x0B, 0, 1, 0x04, 0x02 }, { 0x60, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x60, 0x04, 0, 1, 0x02, 0x02 }, { 0x60, 0x04, 0, 1, 0x02, 0x02 }, { 0x60, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x49, 0x00, 0, 1, 0x02, 0x20 }, { 0x49, 0x00, 0, 1, 0x02, 0x20 }, { 0x49, 0x00, 0, 1, 0x02, 0x20 },
+ { 0x49, 0x00, 0, 1, 0x02, 0x20 }, { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, { 0x52, 0x0A, 0, 1, 0x04, 0x02 },
+ { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, { 0x52, 0x0A, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x0D, 0x00, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x00, 0, 1, 0x04, 0x02 }, { 0x23, 0x01, 0, 1, 0x04, 0x02 }, { 0x24, 0x01, 0, 1, 0x04, 0x02 },
+ { 0x25, 0x01, 0, 1, 0x04, 0x02 }, { 0x25, 0x01, 0, 1, 0x04, 0x02 }, { 0x51, 0x0F, 0, 1, 0x05, 0x05 },
+ { 0x51, 0x0F, 0, 1, 0x04, 0x02 }, { 0x51, 0x0F, 0, 1, 0x05, 0x05 }, { 0x51, 0x0F, 0, 1, 0x04, 0x02 },
+ { 0x60, 0x05, 0, 1, 0x04, 0x02 }, { 0x60, 0x05, 0, 1, 0x04, 0x02 }, { 0x60, 0x05, 0, 1, 0x04, 0x02 },
+ { 0x60, 0x05, 0, 1, 0x04, 0x02 }, { 0x5F, 0x04, 0, 1, 0x03, 0x03 }, { 0x5F, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x64, 0x04, 0, 1, 0x02, 0x02 }, { 0x64, 0x04, 0, 1, 0x02, 0x02 }, { 0x61, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x61, 0x03, 0, 1, 0x02, 0x02 }, { 0x61, 0x03, 0, 1, 0x02, 0x02 }, { 0x61, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, { 0x0C, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x00, 0, 1, 0x02, 0x02 }, { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, { 0x0C, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, { 0x0C, 0x01, 0, 1, 0x02, 0x02 }, { 0x0C, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, { 0x0C, 0x02, 0, 1, 0x02, 0x02 }, { 0x0C, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, { 0x0C, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x03, 0, 1, 0x02, 0x02 }, { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, { 0x0C, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, { 0x0C, 0x04, 0, 1, 0x02, 0x02 }, { 0x0C, 0x05, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, { 0x0C, 0x05, 0, 1, 0x02, 0x02 }, { 0x0C, 0x05, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, { 0x0C, 0x06, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x06, 0, 1, 0x02, 0x02 }, { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, { 0x0C, 0x07, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, { 0x0C, 0x07, 0, 1, 0x02, 0x02 }, { 0x0C, 0x08, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, { 0x0C, 0x08, 0, 1, 0x02, 0x02 }, { 0x0C, 0x08, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, { 0x0C, 0x09, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x09, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0A, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0A, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0B, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0B, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0B, 0, 1, 0x02, 0x02 },
+ { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, { 0x0E, 0x07, 1, 1, 0x02, 0x02 },
+ { 0x0E, 0x07, 1, 1, 0x02, 0x02 }, { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, { 0x1A, 0x01, 1, 1, 0x02, 0x02 },
+ { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, { 0x1A, 0x01, 1, 1, 0x02, 0x02 }, { 0x3B, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, { 0x3B, 0x01, 0, 1, 0x02, 0x02 }, { 0x3B, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, { 0x3B, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x3B, 0x02, 0, 1, 0x02, 0x02 }, { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, { 0x5B, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, { 0x5B, 0x04, 0, 1, 0x02, 0x02 }, { 0x63, 0x06, 0, 0, 0x02, 0x26 },
+ { 0x63, 0x06, 0, 0, 0x02, 0x26 }, { 0x63, 0x06, 0, 0, 0x02, 0x26 }, { 0x63, 0x06, 0, 0, 0x02, 0x26 },
+ { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, { 0x63, 0x07, 0, 0, 0x2E, 0x2E },
+ { 0x63, 0x07, 0, 0, 0x2E, 0x2E }, { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, { 0x5B, 0x05, 0, 1, 0x02, 0x02 },
+ { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, { 0x5B, 0x05, 0, 1, 0x02, 0x02 }, { 0x5B, 0x06, 0, 1, 0x2C, 0x2C },
+ { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x06, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x06, 0, 1, 0x2C, 0x2C },
+ { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x07, 0, 1, 0x2C, 0x2C },
+ { 0x5B, 0x07, 0, 1, 0x2C, 0x2C }, { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, { 0x5B, 0x08, 0, 0, 0x02, 0x02 },
+ { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, { 0x5B, 0x08, 0, 0, 0x02, 0x02 }, { 0x62, 0x03, 0, 1, 0x2C, 0x2C },
+ { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, { 0x62, 0x03, 0, 1, 0x2C, 0x2C }, { 0x62, 0x03, 0, 1, 0x2C, 0x2C },
+ { 0x57, 0x05, 0, 1, 0x02, 0x02 }, { 0x57, 0x05, 0, 1, 0x02, 0x02 }, { 0x57, 0x05, 0, 1, 0x02, 0x02 },
+ { 0x57, 0x05, 0, 1, 0x02, 0x02 }, { 0x07, 0x03, 0, 1, 0x02, 0x02 }, { 0x07, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x07, 0x03, 0, 1, 0x02, 0x02 }, { 0x07, 0x03, 0, 1, 0x02, 0x02 }, { 0x52, 0x0B, 0, 1, 0x04, 0x02 },
+ { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, { 0x52, 0x0B, 0, 1, 0x04, 0x02 }, { 0x52, 0x0B, 0, 1, 0x04, 0x02 },
+ { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, { 0x3B, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x3B, 0x03, 0, 1, 0x02, 0x02 }, { 0x61, 0x04, 0, 1, 0x02, 0x02 }, { 0x61, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x61, 0x04, 0, 1, 0x02, 0x02 }, { 0x61, 0x04, 0, 1, 0x02, 0x02 }, { 0x5F, 0x03, 0, 1, 0x03, 0x03 },
+ { 0x5F, 0x03, 0, 1, 0x02, 0x02 }, { 0x64, 0x03, 0, 1, 0x02, 0x02 }, { 0x64, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x5F, 0x03, 0, 1, 0x00, 0x00 }, { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, { 0x52, 0x0C, 0, 1, 0x04, 0x02 },
+ { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, { 0x52, 0x0C, 0, 1, 0x04, 0x02 }, { 0x48, 0x02, 1, 1, 0x04, 0x20 },
+ { 0x48, 0x02, 1, 1, 0x04, 0x20 }, { 0x48, 0x02, 1, 1, 0x04, 0x20 }, { 0x48, 0x02, 1, 1, 0x04, 0x20 },
+ { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, { 0x4B, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x4B, 0x00, 0, 1, 0x04, 0x20 }, { 0x53, 0x06, 0, 1, 0x03, 0x03 }, { 0x53, 0x06, 0, 1, 0x03, 0x03 },
+ { 0x53, 0x06, 0, 1, 0x03, 0x03 }, { 0x53, 0x06, 0, 1, 0x03, 0x03 }, { 0x51, 0x10, 0, 1, 0x0B, 0x0B },
+ { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, { 0x51, 0x10, 0, 1, 0x0B, 0x0B }, { 0x51, 0x10, 0, 1, 0x0B, 0x0B },
+ { 0x52, 0x0D, 0, 1, 0x03, 0x03 }, { 0x52, 0x0D, 0, 1, 0x02, 0x02 }, { 0x52, 0x0D, 0, 1, 0x03, 0x03 },
+ { 0x52, 0x0D, 0, 1, 0x02, 0x02 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 }, { 0x4F, 0x00, 0, 1, 0x03, 0x03 },
+ { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, { 0x1A, 0x06, 1, 1, 0x02, 0x02 },
+ { 0x1A, 0x06, 1, 1, 0x02, 0x02 }, { 0x66, 0x00, 0, 1, 0x02, 0x02 }, { 0x66, 0x00, 0, 1, 0x02, 0x02 },
+ { 0x66, 0x00, 0, 1, 0x02, 0x02 }, { 0x66, 0x00, 0, 1, 0x02, 0x02 }, { 0x1A, 0x07, 1, 1, 0x02, 0x02 },
+ { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, { 0x1A, 0x07, 1, 1, 0x02, 0x02 }, { 0x1A, 0x07, 1, 1, 0x02, 0x02 },
+ { 0x32, 0x01, 0, 1, 0x02, 0x02 }, { 0x32, 0x01, 0, 1, 0x02, 0x02 }, { 0x32, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x32, 0x01, 0, 1, 0x02, 0x02 }, { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, { 0x2C, 0x01, 0, 1, 0x04, 0x20 },
+ { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, { 0x2C, 0x01, 0, 1, 0x04, 0x20 }, { 0x33, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x33, 0x00, 0, 1, 0x04, 0x20 }, { 0x33, 0x00, 0, 1, 0x04, 0x20 }, { 0x33, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, { 0x0D, 0x01, 0, 0, 0x04, 0x02 },
+ { 0x0D, 0x01, 0, 0, 0x04, 0x02 }, { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, { 0x0D, 0x02, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, { 0x0D, 0x02, 0, 1, 0x04, 0x02 }, { 0x0D, 0x03, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, { 0x0D, 0x03, 0, 1, 0x04, 0x02 }, { 0x0D, 0x03, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, { 0x0D, 0x04, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x04, 0, 1, 0x04, 0x02 }, { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, { 0x0D, 0x05, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, { 0x0D, 0x05, 0, 1, 0x04, 0x02 }, { 0x0D, 0x06, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, { 0x0D, 0x06, 0, 1, 0x04, 0x02 }, { 0x0D, 0x06, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, { 0x0D, 0x07, 0, 1, 0x04, 0x02 },
+ { 0x0D, 0x07, 0, 1, 0x04, 0x02 }, { 0x50, 0x00, 0, 1, 0x04, 0x20 }, { 0x50, 0x00, 0, 1, 0x04, 0x20 },
+ { 0x50, 0x00, 0, 1, 0x04, 0x20 }, { 0x50, 0x00, 0, 1, 0x04, 0x20 }, { 0x52, 0x0E, 0, 1, 0x03, 0x03 },
+ { 0x52, 0x0E, 0, 1, 0x02, 0x02 }, { 0x52, 0x0E, 0, 1, 0x03, 0x03 }, { 0x52, 0x0E, 0, 1, 0x02, 0x02 },
+ { 0x63, 0x08, 0, 0, 0x20, 0x20 }, { 0x63, 0x08, 0, 0, 0x20, 0x20 }, { 0x63, 0x08, 0, 0, 0x20, 0x20 },
+ { 0x63, 0x08, 0, 0, 0x20, 0x20 }, { 0x63, 0x09, 0, 0, 0x02, 0x02 }, { 0x63, 0x09, 0, 0, 0x02, 0x02 },
+ { 0x63, 0x09, 0, 0, 0x02, 0x02 }, { 0x63, 0x09, 0, 0, 0x02, 0x02 }, { 0x57, 0x07, 0, 1, 0x2C, 0x2C },
+ { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, { 0x57, 0x07, 0, 1, 0x2C, 0x2C }, { 0x57, 0x07, 0, 1, 0x2C, 0x2C },
+ { 0x61, 0x05, 0, 1, 0x02, 0x02 }, { 0x61, 0x05, 0, 1, 0x02, 0x02 }, { 0x61, 0x05, 0, 1, 0x02, 0x02 },
+ { 0x61, 0x05, 0, 1, 0x02, 0x02 }, { 0x53, 0x07, 0, 1, 0x03, 0x03 }, { 0x53, 0x07, 0, 1, 0x03, 0x03 },
+ { 0x53, 0x07, 0, 1, 0x03, 0x03 }, { 0x53, 0x07, 0, 1, 0x03, 0x03 }, { 0x0F, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, { 0x0F, 0x00, 1, 1, 0x02, 0x02 }, { 0x0F, 0x00, 1, 1, 0x02, 0x02 },
+ { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, { 0x0C, 0x0C, 0, 1, 0x02, 0x02 },
+ { 0x0C, 0x0C, 0, 1, 0x02, 0x02 }, { 0x41, 0x01, 0, 1, 0x02, 0x02 }, { 0x41, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x41, 0x01, 0, 1, 0x02, 0x02 }, { 0x41, 0x01, 0, 1, 0x02, 0x02 }, { 0x3D, 0x01, 0, 1, 0x04, 0x04 },
+ { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, { 0x3D, 0x01, 0, 1, 0x04, 0x04 }, { 0x3D, 0x01, 0, 1, 0x04, 0x04 },
+ { 0x5C, 0x07, 0, 1, 0x03, 0x03 }, { 0x5C, 0x07, 0, 1, 0x02, 0x02 }, { 0x5C, 0x07, 0, 1, 0x03, 0x03 },
+ { 0x5C, 0x07, 0, 1, 0x02, 0x02 }, { 0x53, 0x08, 0, 1, 0x03, 0x03 }, { 0x53, 0x08, 0, 1, 0x03, 0x03 },
+ { 0x53, 0x08, 0, 1, 0x03, 0x03 }, { 0x53, 0x08, 0, 1, 0x03, 0x03 }, { 0x03, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x03, 0x02, 0, 1, 0x02, 0x02 }, { 0x03, 0x02, 0, 1, 0x02, 0x02 }, { 0x03, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, { 0x3D, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x3D, 0x02, 0, 1, 0x02, 0x02 }, { 0x43, 0x05, 0, 1, 0x02, 0x02 }, { 0x43, 0x05, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x05, 0, 1, 0x02, 0x02 }, { 0x43, 0x05, 0, 1, 0x02, 0x02 }, { 0x43, 0x06, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x06, 0, 1, 0x02, 0x02 }, { 0x43, 0x06, 0, 1, 0x02, 0x02 }, { 0x43, 0x06, 0, 1, 0x02, 0x02 },
+ { 0x51, 0x11, 0, 1, 0x03, 0x03 }, { 0x51, 0x11, 0, 1, 0x02, 0x02 }, { 0x51, 0x11, 0, 1, 0x03, 0x03 },
+ { 0x51, 0x11, 0, 1, 0x02, 0x02 }, { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, { 0x3E, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, { 0x3E, 0x01, 0, 1, 0x02, 0x02 }, { 0x3E, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, { 0x3E, 0x02, 0, 1, 0x02, 0x02 }, { 0x3E, 0x02, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, { 0x3E, 0x03, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x03, 0, 1, 0x02, 0x02 }, { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, { 0x3E, 0x04, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, { 0x3E, 0x04, 0, 1, 0x02, 0x02 }, { 0x3E, 0x05, 0, 1, 0x02, 0x03 },
+ { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, { 0x3E, 0x05, 0, 1, 0x02, 0x03 }, { 0x3E, 0x05, 0, 1, 0x02, 0x03 },
+ { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, { 0x3E, 0x06, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x06, 0, 1, 0x02, 0x02 }, { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, { 0x3E, 0x07, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, { 0x3E, 0x07, 0, 1, 0x02, 0x02 }, { 0x3E, 0x08, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, { 0x3E, 0x08, 0, 1, 0x02, 0x02 }, { 0x3E, 0x08, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, { 0x3E, 0x09, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x09, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0A, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0A, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0B, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0B, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0B, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0C, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x0C, 0, 1, 0x02, 0x02 }, { 0x37, 0x01, 0, 1, 0x04, 0x20 }, { 0x37, 0x01, 0, 1, 0x04, 0x20 },
+ { 0x37, 0x01, 0, 1, 0x04, 0x20 }, { 0x37, 0x01, 0, 1, 0x04, 0x20 }, { 0x08, 0x01, 0, 1, 0x04, 0x04 },
+ { 0x08, 0x01, 0, 1, 0x04, 0x04 }, { 0x08, 0x01, 0, 1, 0x04, 0x04 }, { 0x08, 0x01, 0, 1, 0x04, 0x04 },
+ { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, { 0x4C, 0x01, 0, 1, 0x04, 0x20 },
+ { 0x4C, 0x01, 0, 1, 0x04, 0x20 }, { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, { 0x63, 0x0A, 0, 1, 0x04, 0x02 },
+ { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, { 0x63, 0x0A, 0, 1, 0x04, 0x02 }, { 0x09, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x09, 0x01, 0, 1, 0x02, 0x02 }, { 0x09, 0x01, 0, 1, 0x02, 0x02 }, { 0x09, 0x01, 0, 1, 0x02, 0x02 },
+ { 0x52, 0x0F, 0, 1, 0x03, 0x03 }, { 0x52, 0x0F, 0, 1, 0x02, 0x02 }, { 0x52, 0x0F, 0, 1, 0x03, 0x03 },
+ { 0x52, 0x0F, 0, 1, 0x02, 0x02 }, { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, { 0x5B, 0x09, 0, 0, 0x02, 0x02 },
+ { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, { 0x5B, 0x09, 0, 0, 0x02, 0x02 }, { 0x4C, 0x02, 0, 1, 0x04, 0x20 },
+ { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, { 0x4C, 0x02, 0, 1, 0x04, 0x20 }, { 0x4C, 0x02, 0, 1, 0x04, 0x20 },
+ { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, { 0x55, 0x0C, 0, 1, 0x04, 0x02 },
+ { 0x55, 0x0C, 0, 1, 0x04, 0x02 }, { 0x17, 0x02, 1, 1, 0x02, 0x02 }, { 0x17, 0x02, 1, 1, 0x02, 0x02 },
+ { 0x17, 0x02, 1, 1, 0x02, 0x02 }, { 0x17, 0x02, 1, 1, 0x02, 0x02 }, { 0x4A, 0x01, 0, 0, 0x03, 0x03 },
+ { 0x4A, 0x01, 0, 0, 0x02, 0x02 }, { 0x4A, 0x01, 0, 0, 0x03, 0x03 }, { 0x4A, 0x01, 0, 0, 0x02, 0x02 },
+ { 0x43, 0x07, 0, 1, 0x02, 0x02 }, { 0x43, 0x07, 0, 1, 0x02, 0x02 }, { 0x43, 0x07, 0, 1, 0x02, 0x02 },
+ { 0x43, 0x07, 0, 1, 0x02, 0x02 }, { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, { 0x5D, 0x12, 0, 1, 0x02, 0x02 },
+ { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, { 0x5D, 0x12, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0D, 0, 1, 0x02, 0x02 },
+ { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0D, 0, 1, 0x02, 0x02 }, { 0x3E, 0x0D, 0, 1, 0x02, 0x02 },
+ { 0x56, 0x02, 0, 1, 0x12, 0x12 }, { 0x56, 0x02, 0, 1, 0x02, 0x02 }, { 0x56, 0x02, 0, 1, 0x12, 0x12 },
+ { 0x56, 0x02, 0, 1, 0x02, 0x02 }, { 0x57, 0x08, 0, 1, 0x02, 0x02 }, { 0x57, 0x08, 0, 1, 0x02, 0x02 },
+ { 0x57, 0x08, 0, 1, 0x02, 0x02 }, { 0x57, 0x08, 0, 1, 0x02, 0x02 }, { 0x56, 0x03, 0, 1, 0x03, 0x03 },
+ { 0x56, 0x03, 0, 1, 0x03, 0x03 }, { 0x56, 0x03, 0, 1, 0x03, 0x03 }, { 0x56, 0x03, 0, 1, 0x03, 0x03 },
+ { 0x57, 0x09, 0, 1, 0x03, 0x03 }, { 0x57, 0x09, 0, 1, 0x03, 0x03 }, { 0x57, 0x09, 0, 1, 0x03, 0x03 },
+ { 0x57, 0x09, 0, 1, 0x03, 0x03 }, { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, { 0x5C, 0x08, 0, 1, 0x03, 0x03 },
+ { 0x5C, 0x08, 0, 1, 0x03, 0x03 }, { 0x5C, 0x08, 0, 1, 0x03, 0x03 },
};
-#define TITLED_SCENE(name, title, unk_10, config, unk_12) \
-{ \
- (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomEnd, \
- (u32)_##title##SegmentRomStart, (u32)_##title##SegmentRomEnd, \
- unk_10, config, unk_12 \
-}
+#define TITLED_SCENE(name, title, unk_10, config, unk_12) \
+ { \
+ (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd, (u32)_##title##SegmentRomStart, \
+ (u32)_##title##SegmentRomEnd, unk_10, config, unk_12 \
+ }
#define UNTITLED_SCENE(name, unk_10, config, unk_12) \
-{ \
- (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomEnd, \
- 0, 0, \
- unk_10, config, unk_12 \
-}
+ { (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd, 0, 0, unk_10, config, unk_12 }
-Scene gSceneTable[] =
-{
+Scene gSceneTable[] = {
TITLED_SCENE(ydan_scene, g_pn_06, 1, 19, 2),
TITLED_SCENE(ddan_scene, g_pn_08, 1, 20, 3),
TITLED_SCENE(bdan_scene, g_pn_07, 1, 21, 4),
@@ -1689,8 +645,7 @@ Scene gSceneTable[] =
UNTITLED_SCENE(testroom_scene, 0, 0, 0),
};
-Gfx sDefaultDisplayList[] =
-{
+Gfx sDefaultDisplayList[] = {
gsSPSegment(0x08, D_80127098),
gsSPSegment(0x09, D_80127098),
gsSPSegment(0x0A, D_80127098),
@@ -1704,31 +659,28 @@ Gfx sDefaultDisplayList[] =
};
// Computes next entrance index based on age and day time to set the fade out transition
-void func_800994A0(GlobalContext* globalCtx)
-{
+void func_800994A0(GlobalContext* globalCtx) {
s16 computedEntranceIndex;
- if (gSaveContext.night_flag)
- {
- if (LINK_IS_CHILD)
+ if (gSaveContext.night_flag) {
+ if (LINK_IS_CHILD) {
computedEntranceIndex = globalCtx->nextEntranceIndex + 1;
- else
+ } else {
computedEntranceIndex = globalCtx->nextEntranceIndex + 3;
- }
- else
- {
- if (LINK_IS_CHILD)
+ }
+ } else {
+ if (LINK_IS_CHILD) {
computedEntranceIndex = globalCtx->nextEntranceIndex;
- else
+ } else {
computedEntranceIndex = globalCtx->nextEntranceIndex + 2;
+ }
}
globalCtx->fadeOutTransition = gEntranceTable[computedEntranceIndex].fadeOutTransition;
}
// Scene Draw Config 0
-void func_80099550(GlobalContext* globalCtx)
-{
+void func_80099550(GlobalContext* globalCtx) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
Gfx* gfxArr[4];
@@ -1743,8 +695,7 @@ void func_80099550(GlobalContext* globalCtx)
u32 D_8012A2F8[] = { 0x0200BA18, 0x0200CA18 };
// Scene Draw Config 19
-void func_800995DC(GlobalContext* globalCtx)
-{
+void func_800995DC(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -1755,9 +706,8 @@ void func_800995DC(GlobalContext* globalCtx)
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 4763);
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - (gameplayFrames % 128), (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - (gameplayFrames % 128), (gameplayFrames * 1) % 128,
+ 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyXlu.p++);
gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80);
@@ -1770,8 +720,7 @@ void func_800995DC(GlobalContext* globalCtx)
}
// Scene Draw Config 28
-void func_80099760(GlobalContext* globalCtx)
-{
+void func_80099760(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -1781,9 +730,8 @@ void func_80099760(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 2) % 256, 0, 64, 32,
- 1, 0, (gameplayFrames * 2) % 128, 64, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 2) % 256, 0, 64, 32, 1, 0,
+ (gameplayFrames * 2) % 128, 64, 32));
gDPPipeSync(gfxCtx->polyXlu.p++);
gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80);
@@ -1795,8 +743,7 @@ u32 D_8012A300[] = { 0x02012378, 0x02013378 };
u32 D_8012A308[] = { 0x02011F78, 0x02014778, 0x02014378, 0x02013F78, 0x02014B78, 0x02013B78, 0x02012F78, 0x02012B78 };
// Scene Draw Config 20
-void func_80099878(GlobalContext* globalCtx)
-{
+void func_80099878(GlobalContext* globalCtx) {
u32 gameplayFrames;
s32 pad;
Gfx* displayListHead;
@@ -1812,13 +759,11 @@ void func_80099878(GlobalContext* globalCtx)
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A300[gSaveContext.night_flag]));
gSPSegment(gfxCtx->polyOpa.p++, 0x09, SEGMENTED_TO_VIRTUAL(D_8012A308[(s32)(gameplayFrames & 14) >> 1]));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 1) % 256, 0, 64, 32,
- 1, 0, (gameplayFrames * 1) % 128, 64, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 256, 0, 64, 32, 1, 0,
+ (gameplayFrames * 1) % 128, 64, 32));
gSPSegment(gfxCtx->polyOpa.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 1) % 128, 32, 32,
- 1, 0, (gameplayFrames * 2) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 128, 32, 32, 1, 0,
+ (gameplayFrames * 2) % 128, 32, 32));
{ s32 pad2[2]; } // Necessary to match stack usage
@@ -1841,8 +786,7 @@ void func_80099878(GlobalContext* globalCtx)
}
// Scene Draw Config 30
-void func_80099BD8(GlobalContext* globalCtx)
-{
+void func_80099BD8(GlobalContext* globalCtx) {
f32 temp;
Gfx* displayListHead;
GraphicsContext* gfxCtx;
@@ -1857,15 +801,13 @@ void func_80099BD8(GlobalContext* globalCtx)
gSPSegment(gfxCtx->polyXlu.p++, 0x08, displayListHead);
gSPSegment(gfxCtx->polyOpa.p++, 0x08, displayListHead);
- gDPSetPrimColor(displayListHead++, 0, 0,
- 0xFF - (u8)(185.0f * temp), 0xFF - (u8)(145.0f * temp),
+ gDPSetPrimColor(displayListHead++, 0, 0, 0xFF - (u8)(185.0f * temp), 0xFF - (u8)(145.0f * temp),
0xFF - (u8)(105.0f * temp), 0xFF);
gSPEndDisplayList(displayListHead++);
gSPSegment(gfxCtx->polyXlu.p++, 0x09, displayListHead);
gSPSegment(gfxCtx->polyOpa.p++, 0x09, displayListHead);
- gDPSetPrimColor(displayListHead++, 0, 0,
- 0x4C + (u8)(6.0f * temp), 0x4C + (u8)(34.0f * temp),
+ gDPSetPrimColor(displayListHead++, 0, 0, 0x4C + (u8)(6.0f * temp), 0x4C + (u8)(34.0f * temp),
0x4C + (u8)(74.0f * temp), 0xFF);
gSPEndDisplayList(displayListHead++);
@@ -1877,8 +819,7 @@ void func_80099BD8(GlobalContext* globalCtx)
gSPSegment(gfxCtx->polyOpa.p++, 0x0B, displayListHead);
gSPSegment(gfxCtx->polyXlu.p++, 0x0B, displayListHead);
- gDPSetPrimColor(displayListHead++, 0, 0,
- 0x59 + (u8)(166.0f * temp), 0x59 + (u8)(166.0f * temp),
+ gDPSetPrimColor(displayListHead++, 0, 0, 0x59 + (u8)(166.0f * temp), 0x59 + (u8)(166.0f * temp),
0x59 + (u8)(166.0f * temp), 0xFF);
gDPPipeSync(displayListHead++);
gDPSetEnvColor(displayListHead++, 0, 0, 0, globalCtx->unk_11D30[0]);
@@ -1886,8 +827,7 @@ void func_80099BD8(GlobalContext* globalCtx)
gSPSegment(gfxCtx->polyOpa.p++, 0x0C, displayListHead);
gSPSegment(gfxCtx->polyXlu.p++, 0x0C, displayListHead);
- gDPSetPrimColor(displayListHead++, 0, 0,
- 0xFF + (u8)(179.0f * temp), 0xFF + (u8)(179.0f * temp),
+ gDPSetPrimColor(displayListHead++, 0, 0, 0xFF + (u8)(179.0f * temp), 0xFF + (u8)(179.0f * temp),
0xFF + (u8)(179.0f * temp), 0xFF);
gDPPipeSync(displayListHead++);
gDPSetEnvColor(displayListHead++, 0, 0, 0, globalCtx->unk_11D30[0]);
@@ -1901,8 +841,7 @@ void func_80099BD8(GlobalContext* globalCtx)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 5145);
- if (gSaveContext.scene_setup_index == 5)
- {
+ if (gSaveContext.scene_setup_index == 5) {
D_8015FCF0 = 1;
D_8015FCF8.x = -20.0f;
D_8015FCF8.y = 1220.0f;
@@ -1914,8 +853,7 @@ void func_80099BD8(GlobalContext* globalCtx)
}
// Scene Draw Config 31
-void func_8009A45C(GlobalContext* globalCtx)
-{
+void func_8009A45C(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -1925,27 +863,20 @@ void func_8009A45C(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 1) % 64, 256, 16));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 64, 256, 16));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - (gameplayFrames % 128), (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
- gSPSegment(gfxCtx->polyOpa.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 0, 32, 32,
- 1, 0, 127 - (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - (gameplayFrames % 128), (gameplayFrames * 1) % 128,
+ 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ gSPSegment(
+ gfxCtx->polyOpa.p++, 0x0A,
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 32, 1, 0, 127 - (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyOpa.p++, 0x0B,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x0C,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 50) % 2048, 8, 512,
- 1, 0, (gameplayFrames * 60) % 2048, 8, 512));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 50) % 2048, 8, 512, 1, 0,
+ (gameplayFrames * 60) % 2048, 8, 512));
gSPSegment(gfxCtx->polyOpa.p++, 0x0D,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 0, 32, 64,
- 1, 0, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0, (gameplayFrames * 1) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyXlu.p++);
gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80);
@@ -1957,8 +888,7 @@ void func_8009A45C(GlobalContext* globalCtx)
}
// Scene Draw Config 32
-void func_8009A798(GlobalContext* globalCtx)
-{
+void func_8009A798(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -1968,20 +898,17 @@ void func_8009A798(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 2) % 256, 64, 64));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 2) % 256, 64, 64));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
gSPSegment(gfxCtx->polyOpa.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - (gameplayFrames * 1) % 128, (gameplayFrames * 1) % 256, 32, 64,
- 1, 0, 0, 32, 128));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - (gameplayFrames * 1) % 128,
+ (gameplayFrames * 1) % 256, 32, 64, 1, 0, 0, 32, 128));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -1993,8 +920,7 @@ void func_8009A798(GlobalContext* globalCtx)
}
// Scene Draw Config 33
-void func_8009A9DC(GlobalContext* globalCtx)
-{
+void func_8009A9DC(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2004,13 +930,11 @@ void func_8009A9DC(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 256, 32, 64,
- 1, gameplayFrames % 128, (gameplayFrames * 3) % 256, 32, 64));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 256, 32,
+ 64, 1, gameplayFrames % 128, (gameplayFrames * 3) % 256, 32, 64));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2022,8 +946,7 @@ void func_8009A9DC(GlobalContext* globalCtx)
}
// Scene Draw Config 48
-void func_8009AB98(GlobalContext* globalCtx)
-{
+void func_8009AB98(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2032,9 +955,7 @@ void func_8009AB98(GlobalContext* globalCtx)
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 5317);
gameplayFrames = globalCtx->gameplayFrames;
- gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, gameplayFrames % 64, 256, 16));
+ gSPSegment(gfxCtx->polyXlu.p++, 0x08, Draw_TexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames % 64, 256, 16));
gDPPipeSync(gfxCtx->polyXlu.p++);
gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2046,8 +967,7 @@ void func_8009AB98(GlobalContext* globalCtx)
}
// Scene Draw Config 39
-void func_8009ACA8(GlobalContext* globalCtx)
-{
+void func_8009ACA8(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2057,12 +977,9 @@ void func_8009ACA8(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
- gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, gameplayFrames % 64, 256, 16));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
+ gSPSegment(gfxCtx->polyXlu.p++, 0x09, Draw_TexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames % 64, 256, 16));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2074,8 +991,7 @@ void func_8009ACA8(GlobalContext* globalCtx)
}
// Scene Draw Config 24
-void func_8009AE30(GlobalContext* globalCtx)
-{
+void func_8009AE30(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2085,16 +1001,15 @@ void func_8009AE30(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
- if (globalCtx->sceneNum == SCENE_HAKADAN_BS)
+ if (globalCtx->sceneNum == SCENE_HAKADAN_BS) {
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 2) % 128, 0, 32, 32,
- 1, (gameplayFrames * 2) % 128, 0, 32, 32));
- else
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 2) % 128, 0, 32, 32, 1,
+ (gameplayFrames * 2) % 128, 0, 32, 32));
+ } else {
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 2) % 128, 0, 32, 32,
- 1, (gameplayFrames * 2) % 128, 0, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 2) % 128, 0, 32, 32, 1,
+ (gameplayFrames * 2) % 128, 0, 32, 32));
+ }
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2108,8 +1023,7 @@ void func_8009AE30(GlobalContext* globalCtx)
u32 D_8012A328[] = { 0x0200BD20, 0x0200B920 };
// Scene Draw Config 40
-void func_8009AFE0(GlobalContext* globalCtx)
-{
+void func_8009AFE0(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2119,8 +1033,7 @@ void func_8009AFE0(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 3) % 128, 32, 32));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 3) % 128, 32, 32));
{ s32 pad[2]; } // Necessary to match stack usage
@@ -2132,8 +1045,7 @@ void func_8009AFE0(GlobalContext* globalCtx)
u32 D_8012A330[] = { 0x02014C30, 0x02015830 };
// Scene Draw Config 23
-void func_8009B0FC(GlobalContext* globalCtx)
-{
+void func_8009B0FC(GlobalContext* globalCtx) {
u32 gameplayFrames;
s32 spB0;
s32 spAC;
@@ -2143,7 +1055,7 @@ void func_8009B0FC(GlobalContext* globalCtx)
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 5535);
- if (1) ; // Necessary to match
+ if (1) {} // Necessary to match
spB0 = (globalCtx->unk_11D30[1] >> 8) & 0xFF;
spAC = globalCtx->unk_11D30[1] & 0xFF;
@@ -2151,81 +1063,56 @@ void func_8009B0FC(GlobalContext* globalCtx)
gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A330[gSaveContext.night_flag]));
- if (spB0 == 1)
+ if (spB0 == 1) {
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 1, 0, 32, 32,
- 1, 0, 0, 32, 32,
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32,
0, 0, 0, spAC));
- else if (spB0 < 1)
+ } else if (spB0 < 1) {
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 1, 0, 32, 32,
- 1, 0, 0, 32, 32,
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32,
0, 0, 0, 0xFF));
- else
+ } else {
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 1, 0, 32, 32,
- 1, 0, 0, 32, 32,
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32,
0, 0, 0, 0xA0));
+ }
- if (spB0 == 2)
+ if (spB0 == 2) {
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 1, 0, 32, 32,
- 1, 0, 0, 32, 32,
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32,
0, 0, 0, spAC));
- else if (spB0 < 2)
+ } else if (spB0 < 2) {
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 1, 0, 32, 32,
- 1, 0, 0, 32, 32,
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32,
0, 0, 0, 0xFF));
- else
+ } else {
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 1, 0, 32, 32,
- 1, 0, 0, 32, 32,
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32,
0, 0, 0, 0xA0));
+ }
- if (spB0 != 0)
- {
+ if (spB0 != 0) {
gSPSegment(gfxCtx->polyOpa.p++, 0x0A,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 1, 0, 32, 32,
- 1, 0, 0, 32, 32,
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32,
0, 0, 0, 0xA0));
gSPSegment(gfxCtx->polyOpa.p++, 0x0B,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 3, 0, 32, 32,
- 1, 0, 0, 32, 32,
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 3, 0, 32, 32, 1, 0, 0, 32, 32,
0, 0, 0, 0xB4));
- }
- else
- {
+ } else {
gSPSegment(gfxCtx->polyOpa.p++, 0x0A,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 1) % 128, 0, 32, 32,
- 1, 0, 0, 32, 32,
- 0, 0, 0, 0xA0 + (s32)((spAC / 200.0f) * 95.0f)));
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 128, 0, 32, 32, 1, 0, 0,
+ 32, 32, 0, 0, 0, 0xA0 + (s32)((spAC / 200.0f) * 95.0f)));
gSPSegment(gfxCtx->polyOpa.p++, 0x0B,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 3, 0, 32, 32,
- 1, 0, 0, 32, 32,
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 3, 0, 32, 32, 1, 0, 0, 32, 32,
0, 0, 0, 0xB9 + (s32)((spAC / 200.0f) * 70.0f)));
}
gSPSegment(gfxCtx->polyXlu.p++, 0x0C,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 1, gameplayFrames * 1, 32, 32,
- 1, 0, 127 - (gameplayFrames * 1), 32, 32,
- 0, 0, 0, 0x80));
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, gameplayFrames * 1, 32, 32, 1,
+ 0, 127 - (gameplayFrames * 1), 32, 32, 0, 0, 0, 0x80));
gSPSegment(gfxCtx->polyXlu.p++, 0x0D,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 4, 0, 32, 32,
- 1, gameplayFrames * 4, 0, 32, 32,
- 0, 0, 0, 0x80));
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames * 4, 0, 32, 32, 1,
+ gameplayFrames * 4, 0, 32, 32, 0, 0, 0, 0x80));
{ s32 pad[2]; } // Necessary to match stack usage
@@ -2233,8 +1120,7 @@ void func_8009B0FC(GlobalContext* globalCtx)
}
// Scene Draw Config 29
-void func_8009B86C(GlobalContext* globalCtx)
-{
+void func_8009B86C(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2244,9 +1130,7 @@ void func_8009B86C(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, gameplayFrames * 1, 0, 32, 32,
- 1, 0, 0, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames * 1, 0, 32, 32, 1, 0, 0, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, globalCtx->unk_11D30[0]);
@@ -2258,8 +1142,7 @@ void func_8009B86C(GlobalContext* globalCtx)
}
// Scene Draw Config 34
-void func_8009B9BC(GlobalContext* globalCtx)
-{
+void func_8009B9BC(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2268,9 +1151,7 @@ void func_8009B9BC(GlobalContext* globalCtx)
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 5822);
gameplayFrames = globalCtx->gameplayFrames;
- gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, gameplayFrames % 64, 4, 16));
+ gSPSegment(gfxCtx->polyOpa.p++, 0x08, Draw_TexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames % 64, 4, 16));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2279,8 +1160,7 @@ void func_8009B9BC(GlobalContext* globalCtx)
}
// Scene Draw Config 35
-void func_8009BAA4(GlobalContext* globalCtx)
-{
+void func_8009BAA4(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2290,14 +1170,13 @@ void func_8009BAA4(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
- if (globalCtx->sceneNum == SCENE_HAIRAL_NIWA)
+ if (globalCtx->sceneNum == SCENE_HAIRAL_NIWA) {
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 10) % 256, 32, 64));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 10) % 256, 32, 64));
+ }
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2309,14 +1188,13 @@ void func_8009BAA4(GlobalContext* globalCtx)
}
// Scene Draw Config 36
-void func_8009BC44(GlobalContext* globalCtx)
-{
+void func_8009BC44(GlobalContext* globalCtx) {
u32 gameplayFrames;
s8 sp83;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
- if (1) ; // Necessary to match
+ if (1) {} // Necessary to match
sp83 = coss((globalCtx->gameplayFrames * 1500) & 0xFFFF) >> 8;
@@ -2325,21 +1203,18 @@ void func_8009BC44(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
- if (globalCtx->sceneNum == SCENE_GANON_TOU)
- {
+ if (globalCtx->sceneNum == SCENE_GANON_TOU) {
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 1) % 256, 64, 64));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 256, 64, 64));
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 255 - (gameplayFrames * 1) % 256, 64, 64,
- 1, 0, (gameplayFrames * 1) % 256, 64, 64));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 255 - (gameplayFrames * 1) % 256, 64, 64, 1, 0,
+ (gameplayFrames * 1) % 256, 64, 64));
}
gSPSegment(gfxCtx->polyOpa.p++, 0x0B,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 255 - (gameplayFrames * 1) % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, (gameplayFrames * 1) % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 255 - (gameplayFrames * 1) % 128,
+ (gameplayFrames * 1) % 128, 32, 32, 1, (gameplayFrames * 1) % 128,
+ (gameplayFrames * 1) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2357,20 +1232,17 @@ void func_8009BC44(GlobalContext* globalCtx)
// Screen Shake for Ganon's Tower Collapse
#ifdef NON_MATCHING
// regalloc differences
-void func_8009BEEC(GlobalContext* globalCtx)
-{
+void func_8009BEEC(GlobalContext* globalCtx) {
s32 var;
- if (globalCtx->gameplayFrames % 128 == 13)
- {
+ if (globalCtx->gameplayFrames % 128 == 13) {
var = func_80092F88(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 2);
func_80092DAC(var, 10000);
func_80092E70(var, 4, 0, 0, 0);
func_80092DF0(var, 127);
}
- if ((globalCtx->gameplayFrames % 64 == 0) && (Math_Rand_ZeroOne() > 0.6f))
- {
+ if ((globalCtx->gameplayFrames % 64 == 0) && (Math_Rand_ZeroOne() > 0.6f)) {
var = func_80092F88(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 3);
func_80092DAC(var, 32000.0f + (Math_Rand_ZeroOne() * 3000.0f));
func_80092E70(var, 10.0f - (Math_Rand_ZeroOne() * 9.0f), 0, 0, 0);
@@ -2383,14 +1255,13 @@ void func_8009BEEC(GlobalContext* globalCtx);
#endif
// Scene Draw Config 38
-void func_8009C0AC(GlobalContext* globalCtx)
-{
+void func_8009C0AC(GlobalContext* globalCtx) {
u32 gameplayFrames;
s8 sp7B;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
- if (1) ; // Necessary to match
+ if (1) {} // Necessary to match
sp7B = coss((globalCtx->gameplayFrames * 1500) & 0xFFFF) >> 8;
@@ -2399,17 +1270,14 @@ void func_8009C0AC(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 1) % 512, 64, 128,
- 1, 0, 511 - (gameplayFrames * 1) % 512, 64, 128));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 512, 64, 128, 1, 0,
+ 511 - (gameplayFrames * 1) % 512, 64, 128));
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 1) % 256, 32, 64,
- 1, 0, 255 - (gameplayFrames * 1) % 256, 32, 64));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 256, 32, 64, 1, 0,
+ 255 - (gameplayFrames * 1) % 256, 32, 64));
gSPSegment(gfxCtx->polyXlu.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 20) % 2048, 16, 512,
- 1, 0, (gameplayFrames * 30) % 2048, 16, 512));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 20) % 2048, 16, 512, 1, 0,
+ (gameplayFrames * 30) % 2048, 16, 512));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2423,13 +1291,9 @@ void func_8009C0AC(GlobalContext* globalCtx)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6004);
- if (Flags_GetSwitch(globalCtx, 0x37))
- {
- if ((globalCtx->sceneNum == SCENE_GANON_DEMO) ||
- (globalCtx->sceneNum == SCENE_GANON_FINAL) ||
- (globalCtx->sceneNum == SCENE_GANON_SONOGO) ||
- (globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO))
- {
+ if (Flags_GetSwitch(globalCtx, 0x37)) {
+ if ((globalCtx->sceneNum == SCENE_GANON_DEMO) || (globalCtx->sceneNum == SCENE_GANON_FINAL) ||
+ (globalCtx->sceneNum == SCENE_GANON_SONOGO) || (globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO)) {
func_8009BEEC(globalCtx);
}
}
@@ -2438,13 +1302,12 @@ void func_8009C0AC(GlobalContext* globalCtx)
u32 D_8012A338[] = { 0x0200FAC0, 0x0200F8C0 };
// Scene Draw Config 37
-void func_8009C3EC(GlobalContext* globalCtx)
-{
+void func_8009C3EC(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
- if (0) ; // Necessary to match
+ if (0) {} // Necessary to match
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6042);
@@ -2452,13 +1315,11 @@ void func_8009C3EC(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A338[gSaveContext.night_flag]));
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
{ s32 pad[2]; } // Necessary to match stack usage
@@ -2472,8 +1333,7 @@ void func_8009C3EC(GlobalContext* globalCtx)
}
// Scene Draw Config 42
-void func_8009C608(GlobalContext* globalCtx)
-{
+void func_8009C608(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2483,20 +1343,16 @@ void func_8009C608(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 1) % 64, 256, 16));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 64, 256, 16));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 60) % 2048, 8, 512,
- 1, 0, (gameplayFrames * 50) % 2048, 8, 512));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 60) % 2048, 8, 512, 1, 0,
+ (gameplayFrames * 50) % 2048, 8, 512));
gSPSegment(gfxCtx->polyOpa.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - (gameplayFrames * 1) % 128, 0, 32, 32,
- 1, (gameplayFrames * 1) % 128, 0, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - (gameplayFrames * 1) % 128, 0, 32, 32, 1,
+ (gameplayFrames * 1) % 128, 0, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x0B,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 1023 - (gameplayFrames * 6) % 1024, 16, 256,
- 1, 0, 1023 - (gameplayFrames * 3) % 1024, 16, 256));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 1023 - (gameplayFrames * 6) % 1024, 16, 256, 1, 0,
+ 1023 - (gameplayFrames * 3) % 1024, 16, 256));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2508,8 +1364,7 @@ void func_8009C608(GlobalContext* globalCtx)
}
// Scene Draw Config 43
-void func_8009C8B8(GlobalContext* globalCtx)
-{
+void func_8009C8B8(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2519,16 +1374,12 @@ void func_8009C8B8(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 0, 32, 32,
- 1, 0, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 32, 1, 0, (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, 255 - (gameplayFrames * 10) % 256, 32, 64));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, 255 - (gameplayFrames * 10) % 256, 32, 64));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2540,8 +1391,7 @@ void func_8009C8B8(GlobalContext* globalCtx)
}
// Scene Draw Config 47
-void func_8009CAC0(GlobalContext* globalCtx)
-{
+void func_8009CAC0(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2551,9 +1401,8 @@ void func_8009CAC0(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2567,13 +1416,12 @@ void func_8009CAC0(GlobalContext* globalCtx)
u32 D_8012A340[] = { 0x0200F8C0, 0x020100C0 };
// Scene Draw Config 27
-void func_8009CC00(GlobalContext* globalCtx)
-{
+void func_8009CC00(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
- if (0) ; // Necessary to match
+ if (0) {} // Necessary to match
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6290);
@@ -2581,13 +1429,11 @@ void func_8009CC00(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A340[gSaveContext.night_flag]));
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
{ s32 pad[2]; } // Necessary to match stack usage
@@ -2600,10 +1446,8 @@ void func_8009CC00(GlobalContext* globalCtx)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6320);
}
-Gfx* Draw_TwoTexScrollPrimColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1,
- s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2,
- s32 red, s32 green, s32 blue, s32 alpha)
-{
+Gfx* Draw_TwoTexScrollPrimColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2,
+ u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha) {
Gfx* displayList = Graph_Alloc(gfxCtx, 10 * sizeof(Gfx));
x1 %= 2048;
@@ -2612,20 +1456,17 @@ Gfx* Draw_TwoTexScrollPrimColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32
y2 %= 2048;
gDPTileSync(displayList);
- gDPSetTileSize(displayList+1, tile1, x1, y1,
- (x1+((width1-1)<<2)), (y1+((height1-1)<<2)));
- gDPTileSync(displayList+2);
- gDPSetTileSize(displayList+3, tile2, x2, y2,
- (x2+((width2-1)<<2)), (y2+((height2-1)<<2)));
- gDPSetPrimColor(displayList+4, 0, 0, red, green, blue, alpha);
- gSPEndDisplayList(displayList+5);
+ gDPSetTileSize(displayList + 1, tile1, x1, y1, (x1 + ((width1 - 1) << 2)), (y1 + ((height1 - 1) << 2)));
+ gDPTileSync(displayList + 2);
+ gDPSetTileSize(displayList + 3, tile2, x2, y2, (x2 + ((width2 - 1) << 2)), (y2 + ((height2 - 1) << 2)));
+ gDPSetPrimColor(displayList + 4, 0, 0, red, green, blue, alpha);
+ gSPEndDisplayList(displayList + 5);
return displayList;
}
// Scene Draw Config 50
-void func_8009CF84(GlobalContext* globalCtx)
-{
+void func_8009CF84(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2635,10 +1476,10 @@ void func_8009CF84(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScrollPrimColor(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 0xFF, 0xFF, 0xFF, globalCtx->unk_11D30[0] + 127));
+ Draw_TwoTexScrollPrimColor(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128,
+ (gameplayFrames * 1) % 128, 32, 32, 1, gameplayFrames % 128,
+ (gameplayFrames * 1) % 128, 32, 32, 0xFF, 0xFF, 0xFF,
+ globalCtx->unk_11D30[0] + 127));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2650,8 +1491,7 @@ void func_8009CF84(GlobalContext* globalCtx)
}
// Scene Draw Config 41
-void func_8009D0E8(GlobalContext* globalCtx)
-{
+void func_8009D0E8(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2661,18 +1501,14 @@ void func_8009D0E8(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 127 - (gameplayFrames * 4) % 128, 0, 32, 32));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 127 - (gameplayFrames * 4) % 128, 0, 32, 32));
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 5) % 64, 16, 16));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 5) % 64, 16, 16));
gSPSegment(gfxCtx->polyOpa.p++, 0x0A,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, 63 - (gameplayFrames * 2) % 64, 16, 16));
- gSPSegment(gfxCtx->polyXlu.p++, 0x0B,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 127 - (gameplayFrames * 3) % 128, 32, 32,
- 1, 0, 0, 32, 32));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, 63 - (gameplayFrames * 2) % 64, 16, 16));
+ gSPSegment(
+ gfxCtx->polyXlu.p++, 0x0B,
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 127 - (gameplayFrames * 3) % 128, 32, 32, 1, 0, 0, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2686,8 +1522,7 @@ void func_8009D0E8(GlobalContext* globalCtx)
u32 D_8012A348[] = { 0x02005210, 0x02005010 };
// Scene Draw Config 44
-void func_8009D31C(GlobalContext* globalCtx)
-{
+void func_8009D31C(GlobalContext* globalCtx) {
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
s32 pad[2];
@@ -2710,8 +1545,7 @@ u32 D_8012A350[] = { 0x02006550, 0x02003550 };
u32 D_8012A358[] = { 0x02002350, 0x02001350 };
// Scene Draw Config 45
-void func_8009D438(GlobalContext* globalCtx)
-{
+void func_8009D438(GlobalContext* globalCtx) {
s32 var;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2719,10 +1553,11 @@ void func_8009D438(GlobalContext* globalCtx)
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6560);
- if (LINK_IS_ADULT)
+ if (LINK_IS_ADULT) {
var = 1;
- else
+ } else {
var = gSaveContext.night_flag;
+ }
gSPSegment(gfxCtx->polyOpa.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A358[var]));
gSPSegment(gfxCtx->polyOpa.p++, 0x09, SEGMENTED_TO_VIRTUAL(D_8012A350[var]));
@@ -2737,8 +1572,7 @@ void func_8009D438(GlobalContext* globalCtx)
}
// Scene Draw Config 46
-void func_8009D5B4(GlobalContext* globalCtx)
-{
+void func_8009D5B4(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2748,12 +1582,10 @@ void func_8009D5B4(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 3) % 128, 32, 32));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 3) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 1023 - (gameplayFrames * 3) % 1024, 16, 256,
- 1, 0, 1023 - (gameplayFrames * 6) % 1024, 16, 256));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 1023 - (gameplayFrames * 3) % 1024, 16, 256, 1, 0,
+ 1023 - (gameplayFrames * 6) % 1024, 16, 256));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2767,13 +1599,12 @@ void func_8009D5B4(GlobalContext* globalCtx)
u32 D_8012A360[] = { 0x02014D90, 0x02014590 };
// Scene Draw Config 22
-void func_8009D758(GlobalContext* globalCtx)
-{
+void func_8009D758(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
- if (0) ; // Necessary to match
+ if (0) {} // Necessary to match
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 6640);
@@ -2781,13 +1612,11 @@ void func_8009D758(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08, SEGMENTED_TO_VIRTUAL(D_8012A360[gSaveContext.night_flag]));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyOpa.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
{ s32 pad[2]; } // Necessary to match stack usage
@@ -2803,8 +1632,7 @@ void func_8009D758(GlobalContext* globalCtx)
u32 D_8012A368[] = { 0x02018920, 0x02018020 };
// Scene Draw Config 25
-void func_8009D974(GlobalContext* globalCtx)
-{
+void func_8009D974(GlobalContext* globalCtx) {
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
s32 pad[2];
@@ -2818,8 +1646,7 @@ void func_8009D974(GlobalContext* globalCtx)
}
// Scene Draw Config 1
-void func_8009DA30(GlobalContext* globalCtx)
-{
+void func_8009DA30(GlobalContext* globalCtx) {
u32 gameplayFrames;
Gfx* displayListHead;
GraphicsContext* gfxCtx;
@@ -2832,13 +1659,11 @@ void func_8009DA30(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128,
+ 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2848,21 +1673,17 @@ void func_8009DA30(GlobalContext* globalCtx)
gSPSegment(gfxCtx->polyXlu.p++, 0x0A, displayListHead);
- if ((gSaveContext.day_time >= 0x4AAC) && (gSaveContext.day_time <= 0xC555))
- {
+ if ((gSaveContext.day_time >= 0x4AAC) && (gSaveContext.day_time <= 0xC555)) {
gSPEndDisplayList(displayListHead);
- }
- else
- {
- if (gSaveContext.day_time > 0xC555)
- {
- if (globalCtx->unk_11D30[0] != 255)
+ } else {
+ if (gSaveContext.day_time > 0xC555) {
+ if (globalCtx->unk_11D30[0] != 255) {
Math_ApproxS(&globalCtx->unk_11D30[0], 255, 5);
- }
- else if (gSaveContext.day_time >= 0x4000)
- {
- if (globalCtx->unk_11D30[0] != 0)
+ }
+ } else if (gSaveContext.day_time >= 0x4000) {
+ if (globalCtx->unk_11D30[0] != 0) {
Math_ApproxS(&globalCtx->unk_11D30[0], 0, 10);
+ }
}
gDPSetPrimColor(displayListHead++, 0, 0, 0xFF, 0xFF, 0xFF, globalCtx->unk_11D30[0]);
@@ -2876,8 +1697,7 @@ void func_8009DA30(GlobalContext* globalCtx)
u32 D_8012A370[] = { 0x02015B50, 0x02016B50 };
// Scene Draw Config 2
-void func_8009DD5C(GlobalContext* globalCtx)
-{
+void func_8009DD5C(GlobalContext* globalCtx) {
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
s32 pad[2];
@@ -2897,8 +1717,7 @@ void func_8009DD5C(GlobalContext* globalCtx)
}
// Scene Draw Config 3
-void func_8009DE78(GlobalContext* globalCtx)
-{
+void func_8009DE78(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2908,17 +1727,14 @@ void func_8009DE78(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 6) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 6) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 6) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 6) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2930,8 +1746,7 @@ void func_8009DE78(GlobalContext* globalCtx)
}
// Scene Draw Config 4
-void func_8009E0B8(GlobalContext* globalCtx)
-{
+void func_8009E0B8(GlobalContext* globalCtx) {
u32 gameplayFrames;
u8 spA3;
u16 spA0;
@@ -2949,13 +1764,11 @@ void func_8009E0B8(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128,
+ 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -2963,12 +1776,13 @@ void func_8009E0B8(GlobalContext* globalCtx)
gDPPipeSync(gfxCtx->polyXlu.p++);
gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80);
- if (gSaveContext.scene_setup_index == 4)
+ if (gSaveContext.scene_setup_index == 4) {
spA3 = 255 - (u8)globalCtx->unk_11D30[0];
- else if (gSaveContext.scene_setup_index == 6)
+ } else if (gSaveContext.scene_setup_index == 6) {
spA0 = globalCtx->unk_11D30[0] + 500;
- else if (((gSaveContext.scene_setup_index < 4) || LINK_IS_ADULT) && (gSaveContext.event_chk_inf[0] & 0x80))
+ } else if (((gSaveContext.scene_setup_index < 4) || LINK_IS_ADULT) && (gSaveContext.event_chk_inf[0] & 0x80)) {
spA0 = 2150;
+ }
gSPSegment(gfxCtx->polyOpa.p++, 0x0A, displayListHead);
gDPPipeSync(displayListHead++);
@@ -2982,16 +1796,14 @@ void func_8009E0B8(GlobalContext* globalCtx)
gSPEndDisplayList(displayListHead);
gSPSegment(gfxCtx->polyOpa.p++, 0x0C,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (s16)(-globalCtx->unk_11D30[0] * 0.02f), 32, 16,
- 1, 0, (s16)(-globalCtx->unk_11D30[0] * 0.02f), 32, 16));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (s16)(-globalCtx->unk_11D30[0] * 0.02f), 32, 16, 1, 0,
+ (s16)(-globalCtx->unk_11D30[0] * 0.02f), 32, 16));
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 7044);
}
// Scene Draw Config 5
-void func_8009E54C(GlobalContext* globalCtx)
-{
+void func_8009E54C(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -2999,21 +1811,17 @@ void func_8009E54C(GlobalContext* globalCtx)
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 7058);
- if ((gSaveContext.scene_setup_index > 3) ||
- (LINK_IS_ADULT && !(gSaveContext.event_chk_inf[6] & 0x200)))
+ if ((gSaveContext.scene_setup_index > 3) || (LINK_IS_ADULT && !(gSaveContext.event_chk_inf[6] & 0x200))) {
globalCtx->unk_11D30[0] = 87;
+ }
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, gameplayFrames, gameplayFrames, 32, 32,
- 1, 0, 0, 32, 32,
- 0, 0, 0, globalCtx->unk_11D30[0] + 0xA8));
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, gameplayFrames, gameplayFrames, 32, 32, 1, 0, 0,
+ 32, 32, 0, 0, 0, globalCtx->unk_11D30[0] + 0xA8));
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx,
- 0, -gameplayFrames, -gameplayFrames, 32, 32,
- 1, 0, 0, 16, 64,
- 0, 0, 0, globalCtx->unk_11D30[0] + 0xA8));
+ Draw_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, -gameplayFrames, -gameplayFrames, 32, 32, 1, 0, 0,
+ 16, 64, 0, 0, 0, globalCtx->unk_11D30[0] + 0xA8));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0xFF, 0xFF, 0xFF, 0x80);
@@ -3024,8 +1832,7 @@ void func_8009E54C(GlobalContext* globalCtx)
u32 D_8012A378[] = { 0x02008F98, 0x02008FD8 };
// Scene Draw Config 6
-void func_8009E730(GlobalContext* globalCtx)
-{
+void func_8009E730(GlobalContext* globalCtx) {
u32 gameplayFrames;
u32 var;
GraphicsContext* gfxCtx;
@@ -3036,12 +1843,11 @@ void func_8009E730(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
var = 127 - (gameplayFrames * 1) % 128;
- if (LINK_IS_ADULT)
+ if (LINK_IS_ADULT) {
var = 0;
+ }
gSPSegment(gfxCtx->polyOpa.p++, 0x0C,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 0, 64, 32,
- 1, 0, var, 64, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 64, 32, 1, 0, var, 64, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -3054,8 +1860,7 @@ void func_8009E730(GlobalContext* globalCtx)
}
// Scene Draw Config 7
-void func_8009E8C0(GlobalContext* globalCtx)
-{
+void func_8009E8C0(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3065,17 +1870,13 @@ void func_8009E8C0(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 1) % 128, 0, 32, 32,
- 1, 0, 0, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 1) % 128, 0, 32, 32, 1, 0, 0, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 255 - (gameplayFrames * 2) % 256, 64, 64,
- 1, 0, 255 - (gameplayFrames * 2) % 256, 64, 64));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 255 - (gameplayFrames * 2) % 256, 64, 64, 1, 0,
+ 255 - (gameplayFrames * 2) % 256, 64, 64));
gSPSegment(gfxCtx->polyXlu.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 1) % 128, 32, 32,
- 1, 0, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 128, 32, 32, 1, 0,
+ (gameplayFrames * 1) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -3087,8 +1888,7 @@ void func_8009E8C0(GlobalContext* globalCtx)
}
// Scene Draw Config 8
-void func_8009EAD8(GlobalContext* globalCtx)
-{
+void func_8009EAD8(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3098,29 +1898,23 @@ void func_8009EAD8(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 3) % 1024, 32, 256,
- 1, 0, (gameplayFrames * 3) % 1024, 32, 256));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 3) % 1024, 32, 256, 1, 0,
+ (gameplayFrames * 3) % 1024, 32, 256));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 1) % 256, 64, 64,
- 1, 0, (gameplayFrames * 1) % 256, 64, 64));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 256, 64, 64, 1, 0,
+ (gameplayFrames * 1) % 256, 64, 64));
gSPSegment(gfxCtx->polyXlu.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 2) % 128, 32, 32,
- 1, 0, (gameplayFrames * 2) % 128, 32, 32));
- gSPSegment(gfxCtx->polyOpa.p++, 0x0B,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 0, 32, 32,
- 1, 0, 127 - (gameplayFrames * 3) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 2) % 128, 32, 32, 1, 0,
+ (gameplayFrames * 2) % 128, 32, 32));
+ gSPSegment(
+ gfxCtx->polyOpa.p++, 0x0B,
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 32, 1, 0, 127 - (gameplayFrames * 3) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x0C,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 1) % 128, 32, 32,
- 1, 0, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 128, 32, 32, 1, 0,
+ (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x0D,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, (gameplayFrames * 1) % 64, 16, 16,
- 1, 0, (gameplayFrames * 1) % 64, 16, 16));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (gameplayFrames * 1) % 64, 16, 16, 1, 0,
+ (gameplayFrames * 1) % 64, 16, 16));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -3132,25 +1926,22 @@ void func_8009EAD8(GlobalContext* globalCtx)
}
// Scene Draw Config 9
-void func_8009EE44(GlobalContext* globalCtx)
-{
+void func_8009EE44(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
- if (0) ; // Necessary to match
+ if (0) {} // Necessary to match
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 7274);
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, gameplayFrames % 128, 0, 32, 16,
- 1, gameplayFrames % 128, 0, 32, 16));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames % 128, 0, 32, 16, 1, gameplayFrames % 128,
+ 0, 32, 16));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, gameplayFrames % 128, 32, 32,
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, gameplayFrames % 128, 32, 32,
1, gameplayFrames % 128, gameplayFrames % 128, 32, 32));
gDPPipeSync(gfxCtx->polyXlu.p++);
@@ -3159,10 +1950,8 @@ void func_8009EE44(GlobalContext* globalCtx)
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
- if ((globalCtx->unk_11D30[0] == 0) && (INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO))
- {
- if (globalCtx->unk_11D30[1] == 50)
- {
+ if ((globalCtx->unk_11D30[0] == 0) && (INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO)) {
+ if (globalCtx->unk_11D30[1] == 50) {
func_8002F7DC(&PLAYER->actor, NA_SE_EV_CHICKEN_CRY_M);
globalCtx->unk_11D30[0] = 1;
}
@@ -3173,8 +1962,7 @@ void func_8009EE44(GlobalContext* globalCtx)
}
// Scene Draw Config 10
-void func_8009F074(GlobalContext* globalCtx)
-{
+void func_8009F074(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3184,9 +1972,7 @@ void func_8009F074(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 0, 32, 32,
- 1, 0, 127 - gameplayFrames % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 32, 32, 1, 0, 127 - gameplayFrames % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -3200,8 +1986,7 @@ void func_8009F074(GlobalContext* globalCtx)
u32 D_8012A380[] = { 0x02009678, 0x0200DE78 };
// Scene Draw Config 11
-void func_8009F1B4(GlobalContext* globalCtx)
-{
+void func_8009F1B4(GlobalContext* globalCtx) {
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
s32 pad[2];
@@ -3215,8 +2000,7 @@ void func_8009F1B4(GlobalContext* globalCtx)
}
// Scene Draw Config 12
-void func_8009F270(GlobalContext* globalCtx)
-{
+void func_8009F270(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3226,13 +2010,11 @@ void func_8009F270(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, gameplayFrames % 128, 32, 32,
- 1, 0, gameplayFrames % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, gameplayFrames % 128, 32, 32, 1, 0,
+ gameplayFrames % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, gameplayFrames % 128, 32, 32,
- 1, 0, gameplayFrames % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, gameplayFrames % 128, 32, 32, 1, 0,
+ gameplayFrames % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -3244,8 +2026,7 @@ void func_8009F270(GlobalContext* globalCtx)
}
// Scene Draw Config 13
-void func_8009F40C(GlobalContext* globalCtx)
-{
+void func_8009F40C(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3255,13 +2036,11 @@ void func_8009F40C(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 10) % 128,
+ 32, 32, 1, gameplayFrames % 128, (gameplayFrames * 10) % 128, 32, 32));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 3) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 3) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -3273,8 +2052,7 @@ void func_8009F40C(GlobalContext* globalCtx)
}
// Scene Draw Config 14
-void func_8009F5D4(GlobalContext* globalCtx)
-{
+void func_8009F5D4(GlobalContext* globalCtx) {
Gfx* displayListHead;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3286,21 +2064,17 @@ void func_8009F5D4(GlobalContext* globalCtx)
gSPSegment(gfxCtx->polyXlu.p++, 0x08, displayListHead);
- if ((gSaveContext.day_time >= 0x4AAC) && (gSaveContext.day_time <= 0xC000))
- {
+ if ((gSaveContext.day_time >= 0x4AAC) && (gSaveContext.day_time <= 0xC000)) {
gSPEndDisplayList(displayListHead);
- }
- else
- {
- if (gSaveContext.day_time > 0xC000)
- {
- if (globalCtx->unk_11D30[0] != 255)
+ } else {
+ if (gSaveContext.day_time > 0xC000) {
+ if (globalCtx->unk_11D30[0] != 255) {
Math_ApproxS(&globalCtx->unk_11D30[0], 255, 5);
- }
- else if (gSaveContext.day_time >= 0x4000)
- {
- if (globalCtx->unk_11D30[0] != 0)
+ }
+ } else if (gSaveContext.day_time >= 0x4000) {
+ if (globalCtx->unk_11D30[0] != 0) {
Math_ApproxS(&globalCtx->unk_11D30[0], 0, 10);
+ }
}
gDPSetPrimColor(displayListHead++, 0, 0, 0xFF, 0xFF, 0xFF, globalCtx->unk_11D30[0]);
@@ -3318,8 +2092,7 @@ void func_8009F5D4(GlobalContext* globalCtx)
}
// Scene Draw Config 15
-void func_8009F7D4(GlobalContext* globalCtx)
-{
+void func_8009F7D4(GlobalContext* globalCtx) {
s8 sp6F;
s8 sp6E;
u32 gameplayFrames;
@@ -3337,9 +2110,8 @@ void func_8009F7D4(GlobalContext* globalCtx)
sp6E = (sp6E >> 1) + 192;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, gameplayFrames % 128, 32, 32,
- 1, 0, gameplayFrames % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, gameplayFrames % 128, 32, 32, 1, 0,
+ gameplayFrames % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, sp6F, sp6E, 0xFF, 0x80);
@@ -3353,8 +2125,7 @@ void func_8009F7D4(GlobalContext* globalCtx)
u32 D_8012A388[] = { 0x02009808, 0x02008FC8 };
// Scene Draw Config 16
-void func_8009F9D0(GlobalContext* globalCtx)
-{
+void func_8009F9D0(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3364,9 +2135,8 @@ void func_8009F9D0(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 127 - gameplayFrames % 128, 32, 32,
- 1, gameplayFrames % 128, 0, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 127 - gameplayFrames % 128, 32, 32, 1,
+ gameplayFrames % 128, 0, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -3384,8 +2154,7 @@ void func_8009F9D0(GlobalContext* globalCtx)
u32 D_8012A390[] = { 0x020081E0, 0x0200FBE0 };
// Scene Draw Config 17
-void func_8009FB74(GlobalContext* globalCtx)
-{
+void func_8009FB74(GlobalContext* globalCtx) {
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
s32 pad[2];
@@ -3405,8 +2174,7 @@ void func_8009FB74(GlobalContext* globalCtx)
}
// Scene Draw Config 18
-void func_8009FC90(GlobalContext* globalCtx)
-{
+void func_8009FC90(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3416,13 +2184,12 @@ void func_8009FC90(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 127 - gameplayFrames % 128, 32, 32,
- 1, 127 - gameplayFrames % 128, 0, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 127 - gameplayFrames % 128, 32, 32, 1,
+ 127 - gameplayFrames % 128, 0, 32, 32));
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 3) % 128, 127 - (gameplayFrames * 6) % 128, 32, 32,
- 1, (gameplayFrames * 6) % 128, 127 - (gameplayFrames * 3) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 3) % 128,
+ 127 - (gameplayFrames * 6) % 128, 32, 32, 1, (gameplayFrames * 6) % 128,
+ 127 - (gameplayFrames * 3) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x40);
@@ -3438,8 +2205,7 @@ f32 D_8012A398 = 0.0f;
// Scene Draw Config 21
#ifdef NON_MATCHING
// regalloc differences and single equivalent instruction difference
-void func_8009FE58(GlobalContext* globalCtx)
-{
+void func_8009FE58(GlobalContext* globalCtx) {
static s16 D_8012A39C = 538;
static s16 D_8012A3A0 = 4272;
u32 gameplayFrames;
@@ -3451,22 +2217,17 @@ void func_8009FE58(GlobalContext* globalCtx)
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 7712);
gameplayFrames = globalCtx->gameplayFrames;
- if (globalCtx->sceneNum == SCENE_BDAN)
- {
+ if (globalCtx->sceneNum == SCENE_BDAN) {
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, gameplayFrames % 128, (gameplayFrames * 2) % 128, 32, 32,
- 1, 127 - gameplayFrames % 128, (gameplayFrames * 2) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames % 128, (gameplayFrames * 2) % 128, 32,
+ 32, 1, 127 - gameplayFrames % 128, (gameplayFrames * 2) % 128, 32, 32));
gSPSegment(gfxCtx->polyOpa.p++, 0x0B,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 0, 255 - (gameplayFrames * 4) % 256, 32, 64,
- 1, 0, 255 - (gameplayFrames * 4) % 256, 32, 64));
- }
- else
- {
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 255 - (gameplayFrames * 4) % 256, 32, 64, 1, 0,
+ 255 - (gameplayFrames * 4) % 256, 32, 64));
+ } else {
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- (127 - (gameplayFrames * 1)) % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TexScroll(globalCtx->state.gfxCtx, (127 - (gameplayFrames * 1)) % 128,
+ (gameplayFrames * 1) % 128, 32, 32));
}
gDPPipeSync(gfxCtx->polyOpa.p++);
@@ -3475,43 +2236,32 @@ void func_8009FE58(GlobalContext* globalCtx)
gDPPipeSync(gfxCtx->polyXlu.p++);
gDPSetEnvColor(gfxCtx->polyXlu.p++, 0x80, 0x80, 0x80, 0x80);
- if (func_800C0D28(globalCtx) != 1)
- {
+ if (func_800C0D28(globalCtx) != 1) {
D_8012A39C += 1820;
D_8012A3A0 += 1820;
temp = 0.020000001f;
- func_800AA76C(&globalCtx->view,
- Math_Coss(D_8012A39C) * (0.00009587531f * temp),
- Math_Sins(D_8012A39C) * (0.00009587531f * temp),
- Math_Sins(D_8012A3A0) * (0.00009587531f * temp));
- func_800AA78C(&globalCtx->view,
- 1.0f + (Math_Sins(D_8012A3A0) * (0.79999995f * temp)),
+ func_800AA76C(&globalCtx->view, Math_Coss(D_8012A39C) * (0.00009587531f * temp),
+ Math_Sins(D_8012A39C) * (0.00009587531f * temp), Math_Sins(D_8012A3A0) * (0.00009587531f * temp));
+ func_800AA78C(&globalCtx->view, 1.0f + (Math_Sins(D_8012A3A0) * (0.79999995f * temp)),
1.0f + (Math_Coss(D_8012A3A0) * (0.39999998f * temp)),
1.0f + (Math_Coss(D_8012A39C) * (1 * temp)));
func_800AA7AC(&globalCtx->view, 0.95f);
- switch (globalCtx->unk_11D30[0])
- {
+ switch (globalCtx->unk_11D30[0]) {
case 0:
break;
case 1:
- if (globalCtx->unk_11D30[1] < 1200)
- {
+ if (globalCtx->unk_11D30[1] < 1200) {
globalCtx->unk_11D30[1] += 200;
- }
- else
- {
+ } else {
globalCtx->unk_11D30[0]++;
}
break;
case 2:
- if (globalCtx->unk_11D30[1] > 0)
- {
+ if (globalCtx->unk_11D30[1] > 0) {
globalCtx->unk_11D30[1] -= 30;
- }
- else
- {
+ } else {
globalCtx->unk_11D30[1] = 0;
globalCtx->unk_11D30[0] = 0;
}
@@ -3538,8 +2288,7 @@ void func_8009FE58(GlobalContext* globalCtx);
#endif
// Scene Draw Config 26
-void func_800A0334(GlobalContext* globalCtx)
-{
+void func_800A0334(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3549,17 +2298,14 @@ void func_800A0334(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyXlu.p++, 0x08,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 512, 32, 128,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 512, 32, 128));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 512, 32,
+ 128, 1, gameplayFrames % 128, (gameplayFrames * 1) % 512, 32, 128));
gSPSegment(gfxCtx->polyXlu.p++, 0x09,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gSPSegment(gfxCtx->polyOpa.p++, 0x0A,
- Draw_TwoTexScroll(globalCtx->state.gfxCtx,
- 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32,
- 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
+ Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 127 - gameplayFrames % 128, (gameplayFrames * 1) % 128, 32,
+ 32, 1, gameplayFrames % 128, (gameplayFrames * 1) % 128, 32, 32));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -3571,20 +2317,17 @@ void func_800A0334(GlobalContext* globalCtx)
}
// Scene Draw Config 52
-void func_800A055C(GlobalContext* globalCtx)
-{
+void func_800A055C(GlobalContext* globalCtx) {
func_8009BEEC(globalCtx);
}
// Scene Draw Config 51
-void func_800A057C(GlobalContext* globalCtx)
-{
+void func_800A057C(GlobalContext* globalCtx) {
func_8009BEEC(globalCtx);
}
// Scene Draw Config 49
-void func_800A059C(GlobalContext* globalCtx)
-{
+void func_800A059C(GlobalContext* globalCtx) {
u32 gameplayFrames;
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
@@ -3594,11 +2337,9 @@ void func_800A059C(GlobalContext* globalCtx)
gameplayFrames = globalCtx->gameplayFrames;
gSPSegment(gfxCtx->polyOpa.p++, 0x08,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 127 - (gameplayFrames * 2) % 128, 0, 32, 64));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 127 - (gameplayFrames * 2) % 128, 0, 32, 64));
gSPSegment(gfxCtx->polyOpa.p++, 0x09,
- Draw_TexScroll(globalCtx->state.gfxCtx,
- 0, (gameplayFrames * 2) % 512, 128, 128));
+ Draw_TexScroll(globalCtx->state.gfxCtx, 0, (gameplayFrames * 2) % 512, 128, 128));
gDPPipeSync(gfxCtx->polyOpa.p++);
gDPSetEnvColor(gfxCtx->polyOpa.p++, 0x80, 0x80, 0x80, 0x80);
@@ -3609,72 +2350,23 @@ void func_800A059C(GlobalContext* globalCtx)
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 7910);
}
-void (*sSceneDrawHandlers[])(GlobalContext*) =
-{
- func_80099550,
- func_8009DA30,
- func_8009DD5C,
- func_8009DE78,
- func_8009E0B8,
- func_8009E54C,
- func_8009E730,
- func_8009E8C0,
- func_8009EAD8,
- func_8009EE44,
- func_8009F074,
- func_8009F1B4,
- func_8009F270,
- func_8009F40C,
- func_8009F5D4,
- func_8009F7D4,
- func_8009F9D0,
- func_8009FB74,
- func_8009FC90,
- func_800995DC,
- func_80099878,
- func_8009FE58,
- func_8009D758,
- func_8009B0FC,
- func_8009AE30,
- func_8009D974,
- func_800A0334,
- func_8009CC00,
- func_80099760,
- func_8009B86C,
- func_80099BD8,
- func_8009A45C,
- func_8009A798,
- func_8009A9DC,
- func_8009B9BC,
- func_8009BAA4,
- func_8009BC44,
- func_8009C3EC,
- func_8009C0AC,
- func_8009ACA8,
- func_8009AFE0,
- func_8009D0E8,
- func_8009C608,
- func_8009C8B8,
- func_8009D31C,
- func_8009D438,
- func_8009D5B4,
- func_8009CAC0,
- func_8009AB98,
- func_800A059C,
- func_8009CF84,
- func_800A057C,
- func_800A055C,
+void (*sSceneDrawHandlers[])(GlobalContext*) = {
+ func_80099550, func_8009DA30, func_8009DD5C, func_8009DE78, func_8009E0B8, func_8009E54C, func_8009E730,
+ func_8009E8C0, func_8009EAD8, func_8009EE44, func_8009F074, func_8009F1B4, func_8009F270, func_8009F40C,
+ func_8009F5D4, func_8009F7D4, func_8009F9D0, func_8009FB74, func_8009FC90, func_800995DC, func_80099878,
+ func_8009FE58, func_8009D758, func_8009B0FC, func_8009AE30, func_8009D974, func_800A0334, func_8009CC00,
+ func_80099760, func_8009B86C, func_80099BD8, func_8009A45C, func_8009A798, func_8009A9DC, func_8009B9BC,
+ func_8009BAA4, func_8009BC44, func_8009C3EC, func_8009C0AC, func_8009ACA8, func_8009AFE0, func_8009D0E8,
+ func_8009C608, func_8009C8B8, func_8009D31C, func_8009D438, func_8009D5B4, func_8009CAC0, func_8009AB98,
+ func_800A059C, func_8009CF84, func_800A057C, func_800A055C,
};
-void Scene_Draw(GlobalContext* globalCtx)
-{
+void Scene_Draw(GlobalContext* globalCtx) {
GraphicsContext* gfxCtx;
Gfx* gfxArr[4];
- if (HREG(80) == 0x11)
- {
- if (HREG(95) != 0x11)
- {
+ if (HREG(80) == 0x11) {
+ if (HREG(95) != 0x11) {
HREG(95) = 0x11;
HREG(81) = 1;
HREG(82) = 1;
@@ -3694,17 +2386,17 @@ void Scene_Draw(GlobalContext* globalCtx)
gfxCtx = globalCtx->state.gfxCtx;
func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 8104);
- if (HREG(81) == 1)
- {
+ if (HREG(81) == 1) {
gSPDisplayList(gfxCtx->polyOpa.p++, sDefaultDisplayList);
gSPDisplayList(gfxCtx->polyXlu.p++, sDefaultDisplayList);
}
func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_scene_table.c", 8109);
- if (HREG(82) == 1)
+ if (HREG(82) == 1) {
sSceneDrawHandlers[globalCtx->sceneConfig](globalCtx);
- }
- else
+ }
+ } else {
sSceneDrawHandlers[globalCtx->sceneConfig](globalCtx);
+ }
}
diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c
index 9b51b29cb..d43e77dfe 100644
--- a/src/code/z_skelanime.c
+++ b/src/code/z_skelanime.c
@@ -174,4 +174,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skelanime/func_800A56F0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skelanime/func_800A5774.s")
-
diff --git a/src/code/z_skin.c b/src/code/z_skin.c
index 617a633c1..ca907bb17 100644
--- a/src/code/z_skin.c
+++ b/src/code/z_skin.c
@@ -20,4 +20,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin/func_800A63CC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin/func_800A6408.s")
-
diff --git a/src/code/z_skin_awb.c b/src/code/z_skin_awb.c
index aaffdcadb..4e4530025 100644
--- a/src/code/z_skin_awb.c
+++ b/src/code/z_skin_awb.c
@@ -10,4 +10,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_awb/func_800A698C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_awb/func_800A6AC4.s")
-
diff --git a/src/code/z_skin_matrix.c b/src/code/z_skin_matrix.c
index 2c7a215fe..27d703f30 100644
--- a/src/code/z_skin_matrix.c
+++ b/src/code/z_skin_matrix.c
@@ -40,4 +40,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_matrix/func_800A7EC0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_skin_matrix/func_800A8030.s")
-
diff --git a/src/code/z_sram.c b/src/code/z_sram.c
index dd9578f0e..0f2bcaa64 100644
--- a/src/code/z_sram.c
+++ b/src/code/z_sram.c
@@ -24,4 +24,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sram/func_800A9CD4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sram/func_800A9D28.s")
-
diff --git a/src/code/z_view.c b/src/code/z_view.c
index 84eb4770d..defbbb8cf 100644
--- a/src/code/z_view.c
+++ b/src/code/z_view.c
@@ -60,4 +60,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AB9EC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800ABE74.s")
-
diff --git a/src/code/z_vimode.c b/src/code/z_vimode.c
index e15d619ac..1fa3ba452 100644
--- a/src/code/z_vimode.c
+++ b/src/code/z_vimode.c
@@ -16,4 +16,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vimode/func_800ACA98.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vimode/func_800ACAF8.s")
-
diff --git a/src/code/z_vismono.c b/src/code/z_vismono.c
index 75956af41..239e81ce0 100644
--- a/src/code/z_vismono.c
+++ b/src/code/z_vismono.c
@@ -12,4 +12,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vismono/func_800AD5C0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vismono/func_800AD870.s")
-
diff --git a/src/code/z_vr_box.c b/src/code/z_vr_box.c
index c468b4b29..8008c6aca 100644
--- a/src/code/z_vr_box.c
+++ b/src/code/z_vr_box.c
@@ -12,4 +12,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box/func_800AF218.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box/func_800B0E50.s")
-
diff --git a/src/code/z_vr_box_draw.c b/src/code/z_vr_box_draw.c
index 6af1a46ea..4161c4615 100644
--- a/src/code/z_vr_box_draw.c
+++ b/src/code/z_vr_box_draw.c
@@ -6,4 +6,3 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box_draw/func_800B10C4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_vr_box_draw/func_800B1744.s")
-