mirror of
https://github.com/zeldaret/af.git
synced 2026-09-26 13:33:16 -04:00
main OK (#234)
* main OK * gSegments -> SegmentBaseAddress * newline * format
This commit is contained in:
@@ -291,7 +291,14 @@ setup:
|
||||
|
||||
extract:
|
||||
$(RM) -r asm/$(VERSION) assets/$(VERSION)
|
||||
$(CAT) yamls/$(VERSION)/header.yaml yamls/$(VERSION)/makerom.yaml yamls/$(VERSION)/boot.yaml yamls/$(VERSION)/code.yaml yamls/$(VERSION)/overlays.yaml yamls/$(VERSION)/assets.yaml > $(SPLAT_YAML)
|
||||
$(CAT) yamls/$(VERSION)/header.yaml \
|
||||
yamls/$(VERSION)/makerom.yaml \
|
||||
yamls/$(VERSION)/boot.yaml \
|
||||
yamls/$(VERSION)/code.yaml \
|
||||
yamls/$(VERSION)/buffers.yaml \
|
||||
yamls/$(VERSION)/overlays.yaml \
|
||||
yamls/$(VERSION)/assets.yaml \
|
||||
> $(SPLAT_YAML)
|
||||
$(SPLAT) $(SPLAT_FLAGS) $(SPLAT_YAML)
|
||||
|
||||
lib: $(ULTRALIB_LIB)
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ void func_800D85EC_jp(void);
|
||||
void func_800D8618_jp(void);
|
||||
// void func_800D8644_jp();
|
||||
// void func_800D8670_jp();
|
||||
// void func_800D87C0_jp();
|
||||
void func_800D87C0_jp(void*, OSPri);
|
||||
|
||||
#endif
|
||||
|
||||
+4
-3
@@ -2,11 +2,12 @@
|
||||
#define C_6FD190_H
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "libc/stdint.h"
|
||||
|
||||
// void func_800D94F0_jp();
|
||||
uintptr_t func_800D94F0_jp(void);
|
||||
// void func_800D9514_jp();
|
||||
// void func_800D9524_jp();
|
||||
// void func_800D955C_jp();
|
||||
void func_800D9524_jp(void);
|
||||
void func_800D955C_jp(s32);
|
||||
// void func_800D9618_jp();
|
||||
// void func_800D96A8_jp();
|
||||
// void func_800D96E8_jp();
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ typedef struct Audiomgr {
|
||||
// void func_800D25D0_jp();
|
||||
// void func_800D287C_jp();
|
||||
// void func_800D289C_jp();
|
||||
// void func_800D2AA0_jp();
|
||||
// void func_800D2AD0_jp();
|
||||
void func_800D2AA0_jp(void);
|
||||
void func_800D2AD0_jp(void* stack, OSPri pri, OSId id);
|
||||
// void func_800D2B94_jp();
|
||||
// void func_800D2BEC_jp();
|
||||
|
||||
|
||||
+12
-15
@@ -2,6 +2,8 @@
|
||||
#define CODE_VARIABLES_H
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "libu64/stackcheck.h"
|
||||
#include "stack.h"
|
||||
#include "unknown_structs.h"
|
||||
#include "z64math.h"
|
||||
|
||||
@@ -1930,17 +1932,17 @@ extern u8 D_80113854_jp;
|
||||
extern u8 B_80145370_jp;
|
||||
// extern UNK_TYPE B_80145390_jp;
|
||||
// extern UNK_TYPE B_80145610_jp;
|
||||
// extern UNK_TYPE graphThread;
|
||||
// extern UNK_TYPE B_801457E0_jp;
|
||||
// extern UNK_TYPE B_80145800_jp;
|
||||
// extern UNK_TYPE B_80145820_jp;
|
||||
// extern UNK_TYPE B_80145840_jp;
|
||||
// extern UNK_TYPE B_80145860_jp;
|
||||
// extern UNK_TYPE B_80145880_jp;
|
||||
// extern UNK_TYPE B_80145898_jp;
|
||||
// extern UNK_TYPE B_8014589C_jp;
|
||||
extern OSThread graphThread;
|
||||
extern StackEntry graphStackInfo;
|
||||
extern StackEntry schedStackInfo;
|
||||
extern StackEntry audioStackInfo;
|
||||
extern StackEntry padmgrStackInfo;
|
||||
extern StackEntry irqmgrStackInfo;
|
||||
extern OSMesgQueue l_serialMsgQ;
|
||||
extern OSMesg serialMsgBuf[1];
|
||||
extern size_t gSystemHeapSize;
|
||||
|
||||
extern uintptr_t gSegments[NUM_SEGMENTS];
|
||||
extern uintptr_t SegmentBaseAddress[NUM_SEGMENTS];
|
||||
|
||||
// extern UNK_TYPE B_80145D70_jp;
|
||||
// extern UNK_TYPE B_80145D80_jp;
|
||||
@@ -2070,11 +2072,6 @@ extern UNK_TYPE B_80145FFC_jp;
|
||||
// extern UNK_TYPE B_FLT_801462A0_jp;
|
||||
// extern UNK_TYPE Matrix_stack;
|
||||
// extern UNK_TYPE Matrix_now;
|
||||
// extern UNK_TYPE B_801462C0_jp;
|
||||
// extern UNK_TYPE B_80147AC0_jp;
|
||||
// extern UNK_TYPE B_801480C0_jp;
|
||||
// extern UNK_TYPE B_801488C0_jp;
|
||||
// extern UNK_TYPE B_80148DC0_jp;
|
||||
// extern UNK_TYPE B_80149310_jp;
|
||||
// extern UNK_TYPE B_80149328_jp;
|
||||
// extern UNK_TYPE B_80149368_jp;
|
||||
|
||||
+1
-1
@@ -17,6 +17,6 @@ void func_800D3E40_jp(struct GraphicsContext *gfxCtx);
|
||||
// void graph_task_set00();
|
||||
// void graph_draw_finish();
|
||||
// void graph_main();
|
||||
// void graph_proc();
|
||||
void graph_proc(void* arg);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,7 +10,7 @@ struct CommonData;
|
||||
// void func_8008ECC8_jp();
|
||||
// void func_8008ECF0_jp();
|
||||
// void func_8008ED14_jp();
|
||||
// void func_8008EE24_jp();
|
||||
void func_8008EE24_jp(void);
|
||||
// void func_8008EE5C_jp();
|
||||
// void func_8008EE6C_jp();
|
||||
// void func_8008EE7C_jp();
|
||||
|
||||
+14
-6
@@ -1,18 +1,26 @@
|
||||
#ifndef M_THREAD_H
|
||||
#define M_THREAD_H
|
||||
|
||||
#define M_THREAD_ID_IDLE 1
|
||||
#define M_THREAD_ID_FAULT 2
|
||||
#define M_THREAD_ID_MAIN 3
|
||||
#define M_THREAD_ID_DMAMGR 8
|
||||
#define M_THREAD_ID_IRQMGR 9
|
||||
#define M_THREAD_ID_IDLE 1
|
||||
#define M_THREAD_ID_FAULT 2
|
||||
#define M_THREAD_ID_MAIN 3
|
||||
#define M_THREAD_ID_GRAPH 4
|
||||
#define M_THREAD_ID_PADMGR 7
|
||||
#define M_THREAD_ID_DMAMGR 8
|
||||
#define M_THREAD_ID_IRQMGR 9
|
||||
#define M_THREAD_ID_AUDIOMGR 10
|
||||
|
||||
#define M_PRIORITY_GRAPH 8
|
||||
#define M_PRIORITY_DMAMGR_LOW 10 // Used when decompressing files
|
||||
#define M_PRIORITY_AUDIOMGR 11
|
||||
#define M_PRIORITY_IDLE 12
|
||||
#define M_PRIORITY_MAIN 12
|
||||
#define M_PRIORITY_MAIN_HIGH 13
|
||||
#define M_PRIORITY_PADMGR 15
|
||||
#define M_PRIORITY_DMAMGR 17
|
||||
#define M_PRIORITY_SCHED 16
|
||||
#define M_PRIORITY_IRQMGR 18
|
||||
#define M_PRIORITY_FAULT_CLIENT (OS_PRIORITY_APPMAX - 1)
|
||||
#define M_PRIORITY_FAULT OS_PRIORITY_APPMAX
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
||||
#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
#define SEGMENTED_TO_K0(addr) (void*)((gSegments[SEGMENT_NUMBER(addr)] + K0BASE) + SEGMENT_OFFSET(addr))
|
||||
#define SEGMENTED_TO_K0(addr) (void*)((SegmentBaseAddress[SEGMENT_NUMBER(addr)] + K0BASE) + SEGMENT_OFFSET(addr))
|
||||
|
||||
#define ABS(x) (((x) >= 0) ? (x): -(x))
|
||||
#define ABS_F(x) (((x) >= 0.0f) ? (x) : -(x))
|
||||
|
||||
+1
-2
@@ -6,7 +6,6 @@
|
||||
extern s32 ScreenHeight;
|
||||
extern s32 ScreenWidth;
|
||||
|
||||
// void func_800D64E0_jp();
|
||||
void func_800D66D0_jp(void* arg0);
|
||||
void mainproc(void* arg);
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ void padmgr_UnlockSerialMesgQ(OSMesgQueue*);
|
||||
void padmgr_RequestPadData(Input inputs[4], s32 arg1);
|
||||
void padmgr_ClearPadData(Input inputs[4]);
|
||||
// void padmgr_MainProc();
|
||||
// void padmgr_Init();
|
||||
void padmgr_Init(OSMesgQueue*, OSId, OSPri, void*);
|
||||
// void func_800D763C_jp();
|
||||
// void func_800D765C_jp();
|
||||
s32 padmgr_isConnectedAnyPak(s32 arg0);
|
||||
|
||||
@@ -60,10 +60,9 @@ DECLARE_SEGMENT(segment_027130);
|
||||
|
||||
DECLARE_SEGMENT(segment_13D9A0);
|
||||
|
||||
// DECLARE_SEGMENT();
|
||||
|
||||
DECLARE_SEGMENT(code);
|
||||
|
||||
DECLARE_SEGMENT(buffers);
|
||||
|
||||
// TODO: the rest of segments
|
||||
|
||||
|
||||
@@ -3,11 +3,6 @@
|
||||
|
||||
#include "ultra64.h"
|
||||
|
||||
// void func_800D9890_jp();
|
||||
// void func_800D98C0_jp();
|
||||
// void func_800D9900_jp();
|
||||
// void func_800D99F0_jp();
|
||||
// void func_800D9A6C_jp();
|
||||
// void func_800D9B44_jp();
|
||||
void Check_RegionIsSupported(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef SYS_STACKS_H
|
||||
#define SYS_STACKS_H
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "stack.h"
|
||||
|
||||
extern STACK(graphStack, 0x1800);
|
||||
extern STACK(schedStack, 0x600);
|
||||
extern STACK(audioStack, 0x800);
|
||||
extern STACK(padmgrStack, 0x500);
|
||||
extern STACK(irqmgrStack, 0x500);
|
||||
|
||||
#endif
|
||||
@@ -3496,7 +3496,7 @@ ListAlloc_Alloc = 0x800D63A4; // type:func
|
||||
ListAlloc_Free = 0x800D6410; // type:func
|
||||
ListAlloc_FreeAll = 0x800D6490; // type:func
|
||||
func_800D64E0_jp = 0x800D64E0; // type:func
|
||||
func_800D66D0_jp = 0x800D66D0; // type:func
|
||||
mainproc = 0x800D66D0; // type:func
|
||||
padmgr_LockSerialMesgQ = 0x800D6A10; // type:func
|
||||
padmgr_UnlockSerialMesgQ = 0x800D6A44; // type:func
|
||||
padmgr_LockContData = 0x800D6A74; // type:func
|
||||
@@ -6172,15 +6172,15 @@ B_80145610_jp = 0x80145610; //
|
||||
B_80145620_jp = 0x80145620; //
|
||||
l_lbRTC_Time = 0x80145628; //
|
||||
graphThread = 0x80145630; //
|
||||
B_801457E0_jp = 0x801457E0; //
|
||||
B_80145800_jp = 0x80145800; //
|
||||
B_80145820_jp = 0x80145820; //
|
||||
B_80145840_jp = 0x80145840; //
|
||||
B_80145860_jp = 0x80145860; //
|
||||
B_80145880_jp = 0x80145880; //
|
||||
B_80145898_jp = 0x80145898; //
|
||||
B_8014589C_jp = 0x8014589C; //
|
||||
gSegments = 0x801458A0; // size:0x40
|
||||
graphStackInfo = 0x801457E0; //
|
||||
schedStackInfo = 0x80145800; //
|
||||
audioStackInfo = 0x80145820; //
|
||||
padmgrStackInfo = 0x80145840; //
|
||||
irqmgrStackInfo = 0x80145860; //
|
||||
l_serialMsgQ = 0x80145880; //
|
||||
serialMsgBuf = 0x80145898; //
|
||||
gSystemHeapSize = 0x8014589C; //
|
||||
SegmentBaseAddress = 0x801458A0; // size:0x40
|
||||
padmgr_class = 0x801458E0; // size:0x480
|
||||
B_80145D70_jp = 0x80145D70; //
|
||||
B_80145D80_jp = 0x80145D80; //
|
||||
@@ -6310,11 +6310,11 @@ B_FLT_8014629C_jp = 0x8014629C; // type:f32
|
||||
B_FLT_801462A0_jp = 0x801462A0; // type:f32
|
||||
Matrix_stack = 0x801462B0; //
|
||||
Matrix_now = 0x801462B4; //
|
||||
B_801462C0_jp = 0x801462C0; //
|
||||
B_80147AC0_jp = 0x80147AC0; //
|
||||
B_801480C0_jp = 0x801480C0; //
|
||||
B_801488C0_jp = 0x801488C0; //
|
||||
B_80148DC0_jp = 0x80148DC0; //
|
||||
graphStack = 0x801462C0; //
|
||||
schedStack = 0x80147AC0; //
|
||||
audioStack = 0x801480C0; //
|
||||
padmgrStack = 0x801488C0; //
|
||||
irqmgrStack = 0x80148DC0; //
|
||||
zuruKeyCheck = 0x801492C0; //
|
||||
B_801492E0_jp = 0x801492E0; //
|
||||
B_801492F0_jp = 0x801492F0; //
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ void Main_ThreadEntry(void* arg) {
|
||||
DmaMgr_RequestSyncDebug(SEGMENT_VRAM_START(code), SEGMENT_ROM_START(code), SEGMENT_ROM_SIZE_ALT(code), "../idle.c",
|
||||
53);
|
||||
bzero(SEGMENT_BSS_START(code), SEGMENT_BSS_SIZE(code));
|
||||
func_800D66D0_jp(arg);
|
||||
mainproc(arg);
|
||||
DmaMgr_Stop();
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -718,13 +718,13 @@ void cKF_SkeletonInfo_R_init_reverse_setspeedandmorphandmode(SkeletonInfoR* skel
|
||||
void func_80053384_jp(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, UNK_PTR* arg6, UNK_PTR* arg7,
|
||||
UNK_PTR* arg8) {
|
||||
if (arg3 != 0) {
|
||||
gSegments[arg0] = (uintptr_t)OS_K0_TO_PHYSICAL(arg6);
|
||||
SegmentBaseAddress[arg0] = (uintptr_t)OS_K0_TO_PHYSICAL(arg6);
|
||||
}
|
||||
if (arg4 != 0) {
|
||||
gSegments[arg1] = (uintptr_t)OS_K0_TO_PHYSICAL(arg7);
|
||||
SegmentBaseAddress[arg1] = (uintptr_t)OS_K0_TO_PHYSICAL(arg7);
|
||||
}
|
||||
if (arg5 != 0) {
|
||||
gSegments[arg2] = (uintptr_t)OS_K0_TO_PHYSICAL(arg8);
|
||||
SegmentBaseAddress[arg2] = (uintptr_t)OS_K0_TO_PHYSICAL(arg8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -887,14 +887,14 @@ s32 cKF_SkeletonInfo_R_combine_play(SkeletonInfoR* skeletonInfo1, SkeletonInfoR*
|
||||
joint = (!IS_ZERO(skeletonInfo1->morphCounter)) ? (s16*)skeletonInfo1->morphTable : (s16*)skeletonInfo1->jointTable;
|
||||
|
||||
if (arg4 != 0) {
|
||||
sp44 = OS_PHYSICAL_TO_K0(gSegments[arg2]);
|
||||
gSegments[arg2] = (uintptr_t)OS_K0_TO_PHYSICAL(arg4);
|
||||
sp44 = OS_PHYSICAL_TO_K0(SegmentBaseAddress[arg2]);
|
||||
SegmentBaseAddress[arg2] = (uintptr_t)OS_K0_TO_PHYSICAL(arg4);
|
||||
cKF_SkeletonInfo_R_combine_work_set(&combine3, skeletonInfo1);
|
||||
}
|
||||
|
||||
if (arg5 != 0) {
|
||||
sp40 = OS_PHYSICAL_TO_K0(gSegments[arg3]);
|
||||
gSegments[arg3] = (uintptr_t)OS_K0_TO_PHYSICAL(arg5);
|
||||
sp40 = OS_PHYSICAL_TO_K0(SegmentBaseAddress[arg3]);
|
||||
SegmentBaseAddress[arg3] = (uintptr_t)OS_K0_TO_PHYSICAL(arg5);
|
||||
cKF_SkeletonInfo_R_combine_work_set(&combine2, skeletonInfo2);
|
||||
cKF_SkeletonInfo_R_combine_work_set(&combine1, skeletonInfo2);
|
||||
}
|
||||
@@ -965,18 +965,18 @@ void cKF_SkeletonInfo_R_T_combine_play(s32* arg0, s32* arg1, s32* arg2, Skeleton
|
||||
spAC = (!IS_ZERO(skeletonInfo1->morphCounter)) ? (s16*)skeletonInfo1->morphTable : (s16*)skeletonInfo1->jointTable;
|
||||
|
||||
if (arg9 != 0) {
|
||||
sp48 = OS_PHYSICAL_TO_K0(gSegments[arg6]);
|
||||
gSegments[arg6] = (uintptr_t)OS_K0_TO_PHYSICAL(arg9);
|
||||
sp48 = OS_PHYSICAL_TO_K0(SegmentBaseAddress[arg6]);
|
||||
SegmentBaseAddress[arg6] = (uintptr_t)OS_K0_TO_PHYSICAL(arg9);
|
||||
cKF_SkeletonInfo_R_combine_work_set(&sp4C, skeletonInfo1);
|
||||
}
|
||||
if (argA != 0) {
|
||||
sp44 = OS_PHYSICAL_TO_K0(gSegments[arg7]);
|
||||
gSegments[arg7] = (uintptr_t)OS_K0_TO_PHYSICAL(argA);
|
||||
sp44 = OS_PHYSICAL_TO_K0(SegmentBaseAddress[arg7]);
|
||||
SegmentBaseAddress[arg7] = (uintptr_t)OS_K0_TO_PHYSICAL(argA);
|
||||
cKF_SkeletonInfo_R_combine_work_set(&sp6C, skeletonInfo2);
|
||||
}
|
||||
if (argB != 0) {
|
||||
sp40 = OS_PHYSICAL_TO_K0(gSegments[arg8]);
|
||||
gSegments[arg8] = (uintptr_t)OS_K0_TO_PHYSICAL(argB);
|
||||
sp40 = OS_PHYSICAL_TO_K0(SegmentBaseAddress[arg8]);
|
||||
SegmentBaseAddress[arg8] = (uintptr_t)OS_K0_TO_PHYSICAL(argB);
|
||||
cKF_SkeletonInfo_R_combine_work_set(&sp8C, skeletonInfo3);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -192,7 +192,7 @@ void Actor_ct(Actor* actor, Game_Play* game_play) {
|
||||
Shape_Info_init(actor, 0.0f, NULL, 0.0f, 0.0f);
|
||||
|
||||
if (Actor_data_bank_dma_end_check(actor, game_play) == 1) {
|
||||
gSegments[6] = (uintptr_t)OS_K0_TO_PHYSICAL(temp_a0->status[actor->unk_026].segment);
|
||||
SegmentBaseAddress[6] = (uintptr_t)OS_K0_TO_PHYSICAL(temp_a0->status[actor->unk_026].segment);
|
||||
actor->ct(actor, game_play);
|
||||
actor->ct = NULL;
|
||||
}
|
||||
@@ -263,7 +263,7 @@ void Actor_draw(Game_Play* game_play, Actor* actor) {
|
||||
{
|
||||
void* segment = game_play->objectExchangeBank.status[(void)0, actor->unk_026].segment;
|
||||
|
||||
gSegments[6] = (uintptr_t)OS_PHYSICAL_TO_K0(segment);
|
||||
SegmentBaseAddress[6] = (uintptr_t)OS_PHYSICAL_TO_K0(segment);
|
||||
|
||||
gSPSegment(POLY_OPA_DISP++, 0x06, segment);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x06, segment);
|
||||
@@ -441,7 +441,7 @@ void Actor_info_call_actor(Game_Play* game_play, ActorInfo* actorInfo) {
|
||||
|
||||
if (actor->ct != NULL) {
|
||||
if (Actor_data_bank_dma_end_check(actor, game_play) == 1) {
|
||||
gSegments[6] =
|
||||
SegmentBaseAddress[6] =
|
||||
(uintptr_t)OS_K0_TO_PHYSICAL(game_play->objectExchangeBank.status[actor->unk_026].segment);
|
||||
|
||||
game_play->state.unk_9D = 0x98;
|
||||
@@ -478,7 +478,7 @@ void Actor_info_call_actor(Game_Play* game_play, ActorInfo* actorInfo) {
|
||||
|
||||
actor->flags &= ~ACTOR_FLAG_1000000;
|
||||
if ((actor->flags & (ACTOR_FLAG_40 | ACTOR_FLAG_10)) || (actor->part == ACTOR_PART_NPC)) {
|
||||
gSegments[6] =
|
||||
SegmentBaseAddress[6] =
|
||||
(uintptr_t)OS_K0_TO_PHYSICAL(game_play->objectExchangeBank.status[actor->unk_026].segment);
|
||||
game_play->state.unk_9D = 0xA1;
|
||||
actor->update(actor, game_play);
|
||||
@@ -833,9 +833,9 @@ Actor* Actor_info_make_actor(ActorInfo* actorInfo, Game_Play* game_play, s16 act
|
||||
{
|
||||
uintptr_t segmentTemp;
|
||||
|
||||
segmentTemp = gSegments[6];
|
||||
segmentTemp = SegmentBaseAddress[6];
|
||||
Actor_ct(sp68, game_play);
|
||||
gSegments[6] = segmentTemp;
|
||||
SegmentBaseAddress[6] = segmentTemp;
|
||||
}
|
||||
|
||||
return sp68;
|
||||
|
||||
+1
-1
@@ -448,7 +448,7 @@ void mSc_data_bank_ct(Game_Play* game_play, ObjectExchangeBank* objectExchangeBa
|
||||
objectExchangeBank->unk1810[0] = temp_v0;
|
||||
objectExchangeBank->unk1810[1] = temp_v0;
|
||||
func_800C5B74_jp(objectExchangeBank, GAMEPLAY_KEEP);
|
||||
gSegments[4] = (uintptr_t)OS_PHYSICAL_TO_K0(objectExchangeBank->status[0].segment);
|
||||
SegmentBaseAddress[4] = (uintptr_t)OS_PHYSICAL_TO_K0(objectExchangeBank->status[0].segment);
|
||||
}
|
||||
|
||||
void mSc_decide_exchange_bank(ObjectExchangeBank* objectExchangeBank) {
|
||||
|
||||
+112
-12
@@ -1,13 +1,36 @@
|
||||
#include "main.h"
|
||||
#include "zurumode.h"
|
||||
#include "fault.h"
|
||||
#include "code_variables.h"
|
||||
#include "macros.h"
|
||||
#include "game.h"
|
||||
#include "6FB340.h"
|
||||
#include "6FD190.h"
|
||||
#include "audioMgr.h"
|
||||
#include "graph.h"
|
||||
#include "m_debug.h"
|
||||
#include "code_variables.h"
|
||||
#include "fault.h"
|
||||
#include "game.h"
|
||||
#include "getcurrentms.h"
|
||||
#include "graph.h"
|
||||
#include "irqmgr.h"
|
||||
#include "libu64/stackcheck.h"
|
||||
#include "m_debug.h"
|
||||
#include "m_flashrom.h"
|
||||
#include "m_thread.h"
|
||||
#include "macros.h"
|
||||
#include "padmgr.h"
|
||||
#include "segment_symbols.h"
|
||||
#include "sys_initial_check.h"
|
||||
#include "sys_stacks.h"
|
||||
#include "system_heap.h"
|
||||
#include "zurumode.h"
|
||||
|
||||
OSThread graphThread;
|
||||
StackEntry graphStackInfo;
|
||||
StackEntry schedStackInfo;
|
||||
StackEntry audioStackInfo;
|
||||
StackEntry padmgrStackInfo;
|
||||
StackEntry irqmgrStackInfo;
|
||||
OSMesgQueue l_serialMsgQ;
|
||||
OSMesg serialMsgBuf[1];
|
||||
size_t gSystemHeapSize;
|
||||
|
||||
uintptr_t SegmentBaseAddress[NUM_SEGMENTS];
|
||||
|
||||
void func_800D64E0_jp(void) {
|
||||
u32 baseTime;
|
||||
@@ -35,8 +58,8 @@ void func_800D64E0_jp(void) {
|
||||
|
||||
if ((graphReg != 0) || (audioReg != 0)) {
|
||||
FaultDrawer_SetDrawerFB(osViGetCurrentFramebuffer(), SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
FaultDrawer_SetForeColor(65535);
|
||||
FaultDrawer_SetBackColor(32769);
|
||||
FaultDrawer_SetForeColor(GPACK_RGBA5551(255, 255, 255, 1));
|
||||
FaultDrawer_SetBackColor(GPACK_RGBA5551(128, 0, 0, 1));
|
||||
FaultDrawer_SetCharPad(0, 0);
|
||||
if (graphReg != 0) {
|
||||
unk9D = (game_class_p != NULL) ? game_class_p->unk_9D : 0;
|
||||
@@ -44,16 +67,93 @@ void func_800D64E0_jp(void) {
|
||||
unk9C = (game_class_p != NULL) ? game_class_p->unk_9C : 0;
|
||||
|
||||
FaultDrawer_DrawText(24, 16, "GRAPH INF.LOOP %2d %3d %3d %6lu", B_80145370_jp, unk9D, unk9C, graphTime);
|
||||
fault_DrawStackTrace(&graphThread, 0x20, 0x1A, 0xA);
|
||||
fault_DrawStackTrace(&graphThread, 32, 26, 10);
|
||||
}
|
||||
if (audioReg != 0) {
|
||||
FaultDrawer_DrawText(24, 126, "AUDIO INF.LOOP %2d %3d %6lu", audiomgr_class.unk_28A, D_80113854_jp,
|
||||
audioTime);
|
||||
fault_DrawStackTrace(&audiomgr_class.thread, 0x20, 0x88, 0xA);
|
||||
fault_DrawStackTrace(&audiomgr_class.thread, 32, 136, 10);
|
||||
}
|
||||
FaultDrawer_WritebackFBDCache();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/jp/nonmatchings/code/main/func_800D66D0_jp.s")
|
||||
void mainproc(void* arg) {
|
||||
IrqmgrClient client;
|
||||
OSMesgQueue irqMsgQueue;
|
||||
OSMesg irqMsgBuf[10];
|
||||
uintptr_t fb;
|
||||
uintptr_t sysHeap;
|
||||
s16* msg;
|
||||
|
||||
ScreenWidth = SCREEN_WIDTH;
|
||||
ScreenHeight = SCREEN_HEIGHT;
|
||||
|
||||
fault_Init();
|
||||
Check_RegionIsSupported();
|
||||
|
||||
fb = func_800D94F0_jp();
|
||||
sysHeap = (uintptr_t)SEGMENT_VRAM_END(buffers);
|
||||
gSystemHeapSize = fb - sysHeap;
|
||||
SystemHeap_Init((void*)sysHeap, gSystemHeapSize);
|
||||
|
||||
func_800D9524_jp();
|
||||
|
||||
func_800D955C_jp(0);
|
||||
func_800D955C_jp(1);
|
||||
func_800D955C_jp(2);
|
||||
func_800D955C_jp(3);
|
||||
|
||||
func_8008EE24_jp();
|
||||
|
||||
new_Debug_mode();
|
||||
SREG(0) = 0;
|
||||
|
||||
osCreateMesgQueue(&l_serialMsgQ, serialMsgBuf, ARRAY_COUNT(serialMsgBuf));
|
||||
osSetEventMesg(OS_EVENT_SI, &l_serialMsgQ, NULL);
|
||||
|
||||
osCreateMesgQueue(&irqMsgQueue, irqMsgBuf, ARRAY_COUNT(irqMsgBuf));
|
||||
StackCheck_Init(&irqmgrStackInfo, irqmgrStack, STACK_TOP(irqmgrStack), 0, 0x100, "irqmgr");
|
||||
CreateIRQManager(STACK_TOP(irqmgrStack), M_PRIORITY_IRQMGR, 1);
|
||||
|
||||
StackCheck_Init(&schedStackInfo, schedStack, STACK_TOP(schedStack), 0, 0x100, "sched");
|
||||
func_800D87C0_jp(STACK_TOP(schedStack), M_PRIORITY_SCHED);
|
||||
|
||||
irqmgr_AddClient(&client, &irqMsgQueue);
|
||||
|
||||
StackCheck_Init(&audioStackInfo, audioStack, STACK_TOP(audioStack), 0, 0x100, "audio");
|
||||
func_800D2AD0_jp(STACK_TOP(audioStack), M_PRIORITY_AUDIOMGR, M_THREAD_ID_AUDIOMGR);
|
||||
|
||||
StackCheck_Init(&padmgrStackInfo, padmgrStack, STACK_TOP(padmgrStack), 0, 0x100, "padmgr");
|
||||
padmgr_Init(&l_serialMsgQ, 7, M_PRIORITY_PADMGR, STACK_TOP(padmgrStack));
|
||||
|
||||
func_800D2AA0_jp();
|
||||
|
||||
StackCheck_Init(&graphStackInfo, &graphStack, STACK_TOP(graphStack), 0, 0x100, "graph");
|
||||
osCreateThread(&graphThread, M_THREAD_ID_GRAPH, graph_proc, arg, STACK_TOP(graphStack), M_PRIORITY_GRAPH);
|
||||
osStartThread(&graphThread);
|
||||
|
||||
osSetThreadPri(NULL, M_PRIORITY_MAIN_HIGH);
|
||||
|
||||
while (true) {
|
||||
msg = NULL;
|
||||
|
||||
while (irqMsgQueue.validCount != 0) {
|
||||
osRecvMesg(&irqMsgQueue, NULL, OS_MESG_NOBLOCK);
|
||||
}
|
||||
|
||||
osRecvMesg(&irqMsgQueue, (OSMesg*)&msg, OS_MESG_BLOCK);
|
||||
if (msg == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (*msg) {
|
||||
case OS_SC_RETRACE_MSG:
|
||||
if ((zurumode_flag != 0) && (fault_class.msgId == 0) && (D_8010F3E8_jp != 0)) {
|
||||
func_800D64E0_jp();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "sys_stacks.h"
|
||||
|
||||
STACK(graphStack, 0x1800);
|
||||
STACK(schedStack, 0x600);
|
||||
STACK(audioStack, 0x800);
|
||||
STACK(padmgrStack, 0x500);
|
||||
STACK(irqmgrStack, 0x500);
|
||||
@@ -186,7 +186,7 @@ void aDUM_actor_draw(UNUSED Actor* thisx, Game_Play* game_play) {
|
||||
|
||||
OPEN_POLY_OPA_DISP(gfxCtx);
|
||||
gSPSegment(__polyOpa++, 0x08, palette);
|
||||
gSegments[6] = (uintptr_t)OS_PHYSICAL_TO_K0(object);
|
||||
SegmentBaseAddress[6] = (uintptr_t)OS_PHYSICAL_TO_K0(object);
|
||||
gSPSegment(__polyOpa++, 0x06, object);
|
||||
|
||||
Matrix_translate(-6000.0f, 0.0f, -10000.0f, 1);
|
||||
|
||||
@@ -150,7 +150,7 @@ void aGOZ_actor_draw(Actor* thisx UNUSED, Game_Play* game_play) {
|
||||
|
||||
OPEN_SHADOW_DISP(gfxCtx);
|
||||
gSPSegment(__shadow_gfx++, G_MWO_SEGMENT_8, palette);
|
||||
gSegments[6] = (uintptr_t)OS_PHYSICAL_TO_K0(object);
|
||||
SegmentBaseAddress[6] = (uintptr_t)OS_PHYSICAL_TO_K0(object);
|
||||
gSPSegment(__shadow_gfx++, G_MWO_SEGMENT_6, object);
|
||||
gDPSetPrimColor(__shadow_gfx++, 0, 0x80, 255, 255, 255, 255);
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ void aKAG_actor_draw(Actor* thisx, Game_Play* game_play) {
|
||||
_texture_z_light_fog_prim(gfxCtx);
|
||||
OPEN_POLY_OPA_DISP(gfxCtx);
|
||||
gSPSegment(__polyOpa++, 0x08, palette);
|
||||
gSegments[6] = (uintptr_t)OS_PHYSICAL_TO_K0(object);
|
||||
SegmentBaseAddress[6] = (uintptr_t)OS_PHYSICAL_TO_K0(object);
|
||||
gSPSegment(__polyOpa++, 0x06, object);
|
||||
gSPMatrix(__polyOpa++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(__polyOpa++, model[this->structureActor.unk_2B4]);
|
||||
|
||||
@@ -44,7 +44,8 @@ ShadowData aKOI_shadow_data = { 8, aKOI_shadow_vtx_fix_flg_table, 60.0f, obj_e_k
|
||||
void aKOI_actor_ct(Actor* thisx, Game_Play* game_play UNUSED) {
|
||||
Koinobori* this = THIS;
|
||||
|
||||
gSegments[6] = OS_K0_TO_PHYSICAL(common_data.clip.structureClip->getObjectSegment(STRUCTURE_TYPE_KOINOBORI));
|
||||
SegmentBaseAddress[6] =
|
||||
OS_K0_TO_PHYSICAL(common_data.clip.structureClip->getObjectSegment(STRUCTURE_TYPE_KOINOBORI));
|
||||
cKF_SkeletonInfo_R_ct(&this->structureActor.skeletonInfo, &cKF_bs_r_obj_e_koinobori, 0,
|
||||
this->structureActor.jointTable, this->structureActor.morphTable);
|
||||
aKOI_set_bgOffset(this, 1);
|
||||
@@ -101,7 +102,8 @@ void aKOI_actor_move(Actor* thisx, Game_Play* game_play) {
|
||||
return;
|
||||
}
|
||||
|
||||
gSegments[6] = OS_K0_TO_PHYSICAL(common_data.clip.structureClip->getObjectSegment(STRUCTURE_TYPE_KOINOBORI));
|
||||
SegmentBaseAddress[6] =
|
||||
OS_K0_TO_PHYSICAL(common_data.clip.structureClip->getObjectSegment(STRUCTURE_TYPE_KOINOBORI));
|
||||
cKF_SkeletonInfo_R_play(&this->structureActor.skeletonInfo);
|
||||
((KoinoboriActionFunc)this->structureActor.process)(this, game_play);
|
||||
sAdo_OngenPos((uintptr_t)this, 0x35, &this->structureActor.actor.world.pos);
|
||||
@@ -137,7 +139,7 @@ void aKOI_actor_draw(Actor* thisx, Game_Play* game_play) {
|
||||
gSPSegment(__polyOpa++, 0x08, palette);
|
||||
gSPSegment(__polyOpa++, 0x09, Lib_SegmentedToVirtual(&obj_e_koinobori_b_pal));
|
||||
gSPSegment(__polyOpa++, 0x0A, Lib_SegmentedToVirtual(&aKOI_obj_e_koinobori_a_pal));
|
||||
gSegments[6] = OS_K0_TO_PHYSICAL(object);
|
||||
SegmentBaseAddress[6] = OS_K0_TO_PHYSICAL(object);
|
||||
gSPSegment(__polyOpa++, 0x06, object);
|
||||
CLOSE_POLY_OPA_DISP(gfxCtx);
|
||||
cKF_Si3_draw_R_SV(game_play, &this->structureActor.skeletonInfo, mtx, NULL, NULL, this);
|
||||
|
||||
@@ -145,7 +145,7 @@ void aMIK_actor_draw(UNUSED Actor* actor, Game_Play* play) {
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
OPEN_POLY_OPA_DISP(graph);
|
||||
gSPSegment(__polyOpa++, G_MWO_SEGMENT_8, pal);
|
||||
gSegments[6] = OS_K0_TO_PHYSICAL(obj);
|
||||
SegmentBaseAddress[6] = OS_K0_TO_PHYSICAL(obj);
|
||||
gSPSegment(__polyOpa++, G_MWO_SEGMENT_6, obj);
|
||||
|
||||
gSPMatrix(__polyOpa++, cur, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -121,7 +121,7 @@ void aRAD_actor_draw(UNUSED Actor* thisx, Game_Play* game_play) {
|
||||
_texture_z_light_fog_prim_npc(gfxCtx);
|
||||
OPEN_POLY_OPA_DISP(gfxCtx);
|
||||
gSPSegment(__polyOpa++, 0x08, palette);
|
||||
gSegments[6] = (uintptr_t)OS_PHYSICAL_TO_K0(object);
|
||||
SegmentBaseAddress[6] = (uintptr_t)OS_PHYSICAL_TO_K0(object);
|
||||
gSPSegment(__polyOpa++, 0x06, object);
|
||||
gSPMatrix(__polyOpa++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(__polyOpa++, &aRAD_model);
|
||||
|
||||
@@ -110,7 +110,7 @@ void aTAM_actor_draw(Actor* thisx, Game_Play* game_play) {
|
||||
|
||||
OPEN_POLY_OPA_DISP(gfxCtx);
|
||||
gSPSegment(__polyOpa++, 0x08, palette);
|
||||
gSegments[6] = (uintptr_t)OS_PHYSICAL_TO_K0(object);
|
||||
SegmentBaseAddress[6] = (uintptr_t)OS_PHYSICAL_TO_K0(object);
|
||||
gSPSegment(__polyOpa++, 0x06, object);
|
||||
Matrix_translate(0.0f, 0.0f, 4000.0f, 1);
|
||||
mtx = _Matrix_to_Mtx_new(gfxCtx);
|
||||
|
||||
@@ -52,7 +52,7 @@ void aTOU_actor_ct(Actor* thisx, Game_Play* game_play UNUSED) {
|
||||
static BaseSkeletonR* skl[] = { &cKF_bs_r_obj_s_toudai, &cKF_bs_r_obj_w_toudai };
|
||||
s32 type = (common_data.time.season == WINTER);
|
||||
|
||||
gSegments[6] = OS_K0_TO_PHYSICAL(common_data.clip.structureClip->getObjectSegment(STRUCTURE_TYPE_TOUDAI));
|
||||
SegmentBaseAddress[6] = OS_K0_TO_PHYSICAL(common_data.clip.structureClip->getObjectSegment(STRUCTURE_TYPE_TOUDAI));
|
||||
cKF_SkeletonInfo_R_ct(&this->structureActor.skeletonInfo, skl[type], NULL, this->structureActor.jointTable,
|
||||
this->structureActor.morphTable);
|
||||
aTOU_set_bgOffset(this, 1);
|
||||
@@ -190,7 +190,7 @@ void aTOU_setup_action(Toudai* this, s32 processIndex) {
|
||||
void aTOU_actor_move(Actor* thisx, Game_Play* game_play) {
|
||||
Toudai* this = THIS;
|
||||
|
||||
gSegments[6] = OS_K0_TO_PHYSICAL(common_data.clip.structureClip->getObjectSegment(STRUCTURE_TYPE_TOUDAI));
|
||||
SegmentBaseAddress[6] = OS_K0_TO_PHYSICAL(common_data.clip.structureClip->getObjectSegment(STRUCTURE_TYPE_TOUDAI));
|
||||
this->structureActor.unk_174 = cKF_SkeletonInfo_R_play(&this->structureActor.skeletonInfo);
|
||||
this->structureActor.unk_1E8 = this->structureActor.skeletonInfo.frameControl.currentFrame;
|
||||
((ToudaiActionFunc)this->structureActor.process)(this, game_play);
|
||||
@@ -276,7 +276,7 @@ void aTOU_actor_draw(Actor* thisx, Game_Play* game_play) {
|
||||
_texture_z_light_fog_prim_npc(gfxCtx);
|
||||
OPEN_POLY_OPA_DISP(gfxCtx);
|
||||
gSPSegment(__polyOpa++, 0x8, palette);
|
||||
gSegments[6] = OS_K0_TO_PHYSICAL(object);
|
||||
SegmentBaseAddress[6] = OS_K0_TO_PHYSICAL(object);
|
||||
gSPSegment(__polyOpa++, 0x6, object);
|
||||
CLOSE_POLY_OPA_DISP(gfxCtx);
|
||||
|
||||
|
||||
@@ -494,7 +494,7 @@ void aWeather_DrawWeatherPrv(Actor* thisx, Game_Play* play) {
|
||||
s32 i;
|
||||
|
||||
_texture_z_light_fog_prim_xlu(play->state.gfxCtx);
|
||||
gSegments[6] = OS_K0_TO_PHYSICAL(this->segment);
|
||||
SegmentBaseAddress[6] = OS_K0_TO_PHYSICAL(this->segment);
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
@@ -537,7 +537,7 @@ void aWeather_MoveWeatherPrv(Weather* this, Game_Play* play) {
|
||||
s32 i;
|
||||
|
||||
if ((this->currentProfile != NULL) && (priv != NULL) && (this->currentProfile->mv != NULL)) {
|
||||
gSegments[6] = OS_K0_TO_PHYSICAL(this->segment);
|
||||
SegmentBaseAddress[6] = OS_K0_TO_PHYSICAL(this->segment);
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ void func_80804930_jp(Game_CPEdit* edit) {
|
||||
SET_NEXT_GAMESTATE((Game*)edit, trademark_init, sizeof(Game_Trademark));
|
||||
}
|
||||
|
||||
gSegments[4] = OS_K0_TO_PHYSICAL(segment);
|
||||
SegmentBaseAddress[4] = OS_K0_TO_PHYSICAL(segment);
|
||||
|
||||
OPEN_DISPS(graph);
|
||||
|
||||
|
||||
@@ -482,8 +482,8 @@ void Game_play_move(Game_Play* game_play) {
|
||||
game_play->state.unk_9D = 0x8D;
|
||||
game_play->state.unk_9C = 1;
|
||||
Game_play_Reset_destiny();
|
||||
gSegments[4] = (uintptr_t)OS_K0_TO_PHYSICAL(p->status[0].segment);
|
||||
gSegments[2] = (uintptr_t)OS_K0_TO_PHYSICAL(game_play->unk_010C);
|
||||
SegmentBaseAddress[4] = (uintptr_t)OS_K0_TO_PHYSICAL(p->status[0].segment);
|
||||
SegmentBaseAddress[2] = (uintptr_t)OS_K0_TO_PHYSICAL(game_play->unk_010C);
|
||||
game_play->state.unk_9C = 2;
|
||||
|
||||
if (zurumode_flag >= 2) {
|
||||
@@ -536,8 +536,8 @@ void Game_play_move(Game_Play* game_play) {
|
||||
void func_80803810_jp(Game_Play* game_play, GraphicsContext* gfxCtx) {
|
||||
void* temp_v0 = game_play->objectExchangeBank.status[0].segment;
|
||||
|
||||
gSegments[4] = (uintptr_t)OS_K0_TO_PHYSICAL(temp_v0);
|
||||
gSegments[2] = (uintptr_t)OS_K0_TO_PHYSICAL(game_play->unk_010C);
|
||||
SegmentBaseAddress[4] = (uintptr_t)OS_K0_TO_PHYSICAL(temp_v0);
|
||||
SegmentBaseAddress[2] = (uintptr_t)OS_K0_TO_PHYSICAL(game_play->unk_010C);
|
||||
|
||||
OPEN_DISPS(gfxCtx);
|
||||
|
||||
@@ -861,7 +861,7 @@ void Gameplay_Scene_Read(Game_Play* game_play, s16 arg1) {
|
||||
game_play->unk_00E0 = arg1;
|
||||
game_play->unk_010C = func_80804138_jp(game_play, sp1C);
|
||||
sp1C->unk_13 = 0;
|
||||
gSegments[2] = (uintptr_t)OS_K0_TO_PHYSICAL(game_play->unk_010C);
|
||||
SegmentBaseAddress[2] = (uintptr_t)OS_K0_TO_PHYSICAL(game_play->unk_010C);
|
||||
Gameplay_Scene_Init(game_play);
|
||||
sAdo_RoomType(mPl_SceneNo2SoundRoomType(common_data.save.sceneNo));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
- name: buffers
|
||||
type: code
|
||||
start: 0x73F4D0
|
||||
vram: 0x801524C0
|
||||
follows_vram: code
|
||||
notdma: True
|
||||
bss_size: 0x42420
|
||||
subsegments:
|
||||
- { start: 0x73F4D0, type: bss, vram: 0x801524C0, name: buffers/801524C0}
|
||||
+3
-2
@@ -328,9 +328,10 @@
|
||||
- { start: 0x73F4D0, type: bss, vram: 0x80145060, name: code/80145060 }
|
||||
- { start: 0x73F4D0, type: .bss, vram: 0x80145390, name: code/irqmgr }
|
||||
- { start: 0x73F4D0, type: .bss, vram: 0x80145620, name: code/lb_rtc}
|
||||
- { start: 0x73F4D0, type: bss, vram: 0x80145630, name: code/80145630}
|
||||
- { start: 0x73F4D0, type: .bss, vram: 0x80145630, name: code/main}
|
||||
- { start: 0x73F4D0, type: bss, vram: 0x801458E0, name: code/801458E0}
|
||||
- { start: 0x73F4D0, type: .bss, vram: 0x801462B0, name: code/sys_matrix }
|
||||
- { start: 0x73F4D0, type: bss, vram: 0x801462C0, name: code/801462C0 }
|
||||
- { start: 0x73F4D0, type: .bss, vram: 0x801462C0, name: code/sys_stacks }
|
||||
- { start: 0x73F4D0, type: .bss, vram: 0x801492C0, name: code/zurumode }
|
||||
- { start: 0x73F4D0, type: bss, vram: 0x801492D0, name: code/801492D0 }
|
||||
- { start: 0x73F4D0, type: .bss, vram: 0x80152480, name: code/lbrtc/722570}
|
||||
|
||||
Reference in New Issue
Block a user