1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Decompile 2 small files (code_8006BA00.c and code_8006C3A0.c) (#101)

* Decompile code_8006C3A0.c (handling "env" flags)

* Decompile code_8006BA00.c (handling sound sources)
This commit is contained in:
Roman971 2020-05-01 04:00:39 +02:00 committed by GitHub
parent d0ba37b148
commit 4932e93ba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 143 additions and 296 deletions

View file

@ -1,10 +1,34 @@
#include <ultra64.h>
#include <global.h>
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C3A0.s")
void Flags_UnsetAllEnv(GlobalContext* globalCtx) {
u8 i;
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C3D0.s")
for (i = 0; i < 20; i++) {
globalCtx->envFlags[i] = 0;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C438.s")
void Flags_SetEnv(GlobalContext* globalCtx, s16 flag) {
s16 index = flag / 16;
s16 bit = flag % 16;
s16 mask = 1 << bit;
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C4A4.s")
globalCtx->envFlags[index] |= mask;
}
void Flags_UnsetEnv(GlobalContext* globalCtx, s16 flag) {
s16 index = flag / 16;
s16 bit = flag % 16;
s16 mask = (1 << bit) ^ 0xFFFF;
globalCtx->envFlags[index] &= mask;
}
s32 Flags_GetEnv(GlobalContext* globalCtx, s16 flag) {
s16 index = flag / 16;
s16 bit = flag % 16;
s16 mask = 1 << bit;
return globalCtx->envFlags[index] & mask;
}