64-bit early draft - no audio yet

This commit is contained in:
Emil Lenngren 2022-05-15 01:19:02 +02:00
parent 247360cbf0
commit 92c8ecb726
29 changed files with 853 additions and 169 deletions

View file

@ -84,6 +84,7 @@ void AudioMgr_Unlock(AudioMgr* audioMgr) {
}
void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedContext* sched, IrqMgr* irqMgr) {
return; // OTRTODO64
AudioPlayer_Init();
memset(audioMgr,0, sizeof(AudioMgr));

View file

@ -7,6 +7,8 @@ u8 D_8012D200[] = {
void func_800C3C20(void) {
s32 i;
return; // OTRTODO64
for (i = 0; (i < ARRAY_COUNT(D_8012D200)) & 0xFFFFFFFF; i++) {
Audio_StopSfxByBank(D_8012D200[i]);
}

View file

@ -3502,6 +3502,7 @@ void func_800F4A70(void);
void func_800F5CF8(void);
void func_800F3054(void) {
return; // OTRTODO64
if (func_800FAD34() == 0) {
sAudioUpdateTaskStart = gAudioContext.totalTaskCnt;
sAudioUpdateStartTime = osGetTime();
@ -4420,6 +4421,8 @@ void func_800F5918(void) {
void func_800F595C(u16 arg0) {
u8 arg0b = arg0 & 0xFF;
return; // OTRTODO60
if (sSeqFlags[arg0b] & 2) {
Audio_PlayFanfare(arg0);
} else if (sSeqFlags[arg0b] & 4) {
@ -4524,6 +4527,8 @@ void Audio_PlayFanfare(u16 seqId)
u8* sp1C;
u8* sp18;
return; // OTRTODO64
sp26 = func_800FA0B4(SEQ_PLAYER_FANFARE);
sp1C = func_800E5E84(sp26 & 0xFF, &sp20);
sp18 = func_800E5E84(seqId & 0xFF, &sp20);

View file

@ -579,6 +579,8 @@ void func_800F8884(u8 bankId, Vec3f* pos) {
u8 entryIndex = gSoundBanks[bankId][0].next;
u8 prevEntryIndex = 0;
return; // OTRTODO64
while (entryIndex != 0xFF) {
entry = &gSoundBanks[bankId][entryIndex];
if (entry->posX == &pos->x) {
@ -676,6 +678,7 @@ void Audio_StopSfxById(u32 sfxId) {
u8 entryIndex = gSoundBanks[SFX_BANK(sfxId)][0].next;
u8 prevEntryIndex = 0;
SoundBankEntry cmp;
return; // OTRTODO64
while (entryIndex != 0xFF) {
entry = &gSoundBanks[SFX_BANK(sfxId)][entryIndex];
@ -737,6 +740,7 @@ void func_800F8F88(void) {
u8 Audio_IsSfxPlaying(u32 sfxId)
{
return; // OTRTODO64
SoundBankEntry* entry;
u8 entryIndex = gSoundBanks[SFX_BANK(sfxId)][0].next;

View file

@ -1516,7 +1516,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis
if (globalCtx->sceneNum == SCENE_MALON_STABLE) {
// "/* BGCheck LonLon Size %dbyte */\n"
osSyncPrintf("/* BGCheck LonLonサイズ %dbyte */\n", 0x3520);
colCtx->memSize = 0x3520;
colCtx->memSize = 0x3520 * (sizeof(void*) / 4); // 64-bit build needs more memory
} else {
// "/* BGCheck Mini Size %dbyte */\n"
osSyncPrintf("/* BGCheck ミニサイズ %dbyte */\n", 0x4E20);

View file

@ -194,7 +194,7 @@ void Font_LoadOrderedFont(Font* font) {
size_t len;
size_t jj;
s32 fontStatic;
u32 fontBuf;
u8* fontBuf;
s32 codePointIndex;
s32 fontBufIndex;
s32 offset;

View file

@ -198,8 +198,8 @@ void Gameplay_Init(GameState* thisx) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
gGlobalCtx = globalCtx;
//globalCtx->state.gfxCtx = NULL;
u32 zAlloc;
u32 zAllocAligned;
uintptr_t zAlloc;
uintptr_t zAllocAligned;
size_t zAllocSize;
Player* player;
s32 playerStartCamId;

View file

@ -554,7 +554,7 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
roomCtx->bufPtrs[0] = GameState_Alloc(&globalCtx->state, maxRoomSize, "../z_room.c", 946);
// "Room buffer initial pointer=%08x"
osSyncPrintf("部屋バッファ開始ポインタ=%08x\n", roomCtx->bufPtrs[0]);
roomCtx->bufPtrs[1] = (void*)((s32)roomCtx->bufPtrs[0] + maxRoomSize);
roomCtx->bufPtrs[1] = (void*)((intptr_t)roomCtx->bufPtrs[0] + maxRoomSize);
// "Room buffer end pointer=%08x"
osSyncPrintf("部屋バッファ終了ポインタ=%08x\n", roomCtx->bufPtrs[1]);
osSyncPrintf(VT_RST);

View file

@ -61,6 +61,7 @@ void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx) {
for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++) {
objectCtx->status[i].id = OBJECT_INVALID;
objectCtx->status[i].segment = NULL;
}
osSyncPrintf(VT_FGCOL(GREEN));

View file

@ -857,7 +857,7 @@ void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader
animation = ResourceMgr_LoadAnimByName(animation);
LinkAnimationHeader* linkAnimHeader = SEGMENTED_TO_VIRTUAL(animation);
u32 ram = frameTable;
Vec3s* ram = frameTable;
osCreateMesgQueue(&entry->data.load.msgQueue, &entry->data.load.msg, 1);