diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | include/boot_variables.h | 6 | ||||
| -rw-r--r-- | include/code_variables.h | 2 | ||||
| -rw-r--r-- | include/idle.h | 4 | ||||
| -rw-r--r-- | include/viconfig.h | 7 | ||||
| -rw-r--r-- | linker_scripts/jp/symbol_addrs_boot.txt | 8 | ||||
| -rw-r--r-- | src/boot/boot_main.c | 5 | ||||
| -rw-r--r-- | src/boot/viconfig.c | 45 | ||||
| -rw-r--r-- | yamls/jp/boot.yaml | 8 |
9 files changed, 68 insertions, 19 deletions
@@ -253,7 +253,7 @@ extract: lib: $(MAKE) -C lib -diff-init: all +diff-init: uncompressed $(RM) -rf expected/ mkdir -p expected/ cp -r $(BUILD_DIR) expected/$(BUILD_DIR) diff --git a/include/boot_variables.h b/include/boot_variables.h index 65fd39a..577b212 100644 --- a/include/boot_variables.h +++ b/include/boot_variables.h @@ -12,7 +12,7 @@ // extern UNK_TYPE D_8003BBC4_jp; // extern UNK_TYPE D_FLT_8003BBC8_jp; // extern UNK_TYPE D_FLT_8003BBCC_jp; -// extern UNK_TYPE gCartHandle; +extern OSPiHandle* gCartHandle; // TODO: Determine where this goes // extern UNK_TYPE D_8003BBE0_jp; // extern UNK_TYPE D_8003BBF0_jp; // extern UNK_TYPE D_8003BC38_jp; @@ -248,8 +248,8 @@ // extern UNK_TYPE B_8003FE00_jp; // extern UNK_TYPE B_8003FEC8_jp; // extern UNK_TYPE B_8003FEE0_jp; -// extern UNK_TYPE B_8003FF30_jp; -// extern UNK_TYPE B_8003FF31_jp; +// extern UNK_TYPE gViConfigBlackNext; +// extern UNK_TYPE gViConfigBlack; // extern UNK_TYPE B_8003FF40_jp; // extern UNK_TYPE B_8003FF5C_jp; // extern UNK_TYPE B_8003FF60_jp; diff --git a/include/code_variables.h b/include/code_variables.h index b462c14..cd30616 100644 --- a/include/code_variables.h +++ b/include/code_variables.h @@ -816,7 +816,7 @@ // extern UNK_TYPE D_8010EF80_jp; // extern UNK_TYPE gamePT; // extern UNK_TYPE D_8010EFA0_jp; -// extern UNK_TYPE D_8010EFB0_jp; +extern vs32 D_8010EFB0_jp; // TODO: Determine where this goes // extern UNK_TYPE D_8010EFB8_jp; // extern UNK_TYPE D_8010EFC0_jp; // extern UNK_TYPE D_8010EFC8_jp; diff --git a/include/idle.h b/include/idle.h index f210ec3..fb4938d 100644 --- a/include/idle.h +++ b/include/idle.h @@ -5,6 +5,10 @@ extern OSViMode gViConfigMode; +extern u32 gViConfigFeatures; +extern f32 gViConfigXScale; +extern f32 gViConfigYScale; + void Idle_ThreadEntry(void* arg); #endif diff --git a/include/viconfig.h b/include/viconfig.h index ea6f726..b69d1cd 100644 --- a/include/viconfig.h +++ b/include/viconfig.h @@ -3,7 +3,10 @@ #include "ultra64.h" -// void func_800260A0_jp(); -// void func_800261F4_jp(); +void ViConfig_UpdateVi(u32 arg0); +void ViConfig_UpdateBlack(void); + +u8 gViConfigBlackNext; +u8 gViConfigBlack; #endif diff --git a/linker_scripts/jp/symbol_addrs_boot.txt b/linker_scripts/jp/symbol_addrs_boot.txt index c339e8e..da4ff6b 100644 --- a/linker_scripts/jp/symbol_addrs_boot.txt +++ b/linker_scripts/jp/symbol_addrs_boot.txt @@ -9,8 +9,8 @@ Main_ThreadEntry = 0x80025DF0; // type:func Idle_InitVideo = 0x80025E6C; // type:func Idle_ThreadEntry = 0x80025FD0; // type:func -func_800260A0_jp = 0x800260A0; // type:func -func_800261F4_jp = 0x800261F4; // type:func +ViConfig_UpdateVi = 0x800260A0; // type:func +ViConfig_UpdateBlack = 0x800261F4; // type:func func_80026240_jp = 0x80026240; // type:func func_8002628C_jp = 0x8002628C; // type:func @@ -519,8 +519,8 @@ sMainStackInfo = 0x8003FDE0; // sPiMgrCmdBuff = 0x8003FE00; // sPiMgrCmdQueue = 0x8003FEC8; // gViConfigMode = 0x8003FEE0; // -B_8003FF30_jp = 0x8003FF30; // type:u8 -B_8003FF31_jp = 0x8003FF31; // type:u8 +gViConfigBlackNext = 0x8003FF30; // type:u8 +gViConfigBlack = 0x8003FF31; // type:u8 B_8003FF40_jp = 0x8003FF40; // B_8003FF5C_jp = 0x8003FF5C; // type:u16 B_8003FF60_jp = 0x8003FF60; // diff --git a/src/boot/boot_main.c b/src/boot/boot_main.c index 6951860..3ccd5e6 100644 --- a/src/boot/boot_main.c +++ b/src/boot/boot_main.c @@ -1,5 +1,4 @@ -#include "libc/stdint.h" -#include "ultra64.h" +#include "global.h" #include "idle.h" #include "m_thread.h" @@ -7,8 +6,6 @@ #include "stack.h" #include "stackcheck.h" -extern OSPiHandle* gCartHandle; // TODO: Determine where this goes - STACK(sIdleStack, 0x400); StackEntry sIdleStackInfo; StackEntry sBootStackInfo; diff --git a/src/boot/viconfig.c b/src/boot/viconfig.c new file mode 100644 index 0000000..cb58def --- /dev/null +++ b/src/boot/viconfig.c @@ -0,0 +1,45 @@ +#include "global.h" +#include "idle.h" + +u8 gViConfigBlackNext; +u8 gViConfigBlack; + +void ViConfig_UpdateVi(u32 black) { + if ((black || (D_8010EFB0_jp == 0)) && ((black != gViConfigBlack) || (black != gViConfigBlackNext))) { + if (black) { + if (osTvType == OS_TV_PAL) { + osViSetMode(&osViModePalLan1); + } else { + osViSetMode(&osViModeNtscLan1); + } + + if (gViConfigYScale == 1.0f) { + osViBlack(1); + } else { + osViSetYScale(1.0f); + } + } else { + osViSetMode(&gViConfigMode); + + if (gViConfigFeatures != 0) { + osViSetSpecialFeatures(gViConfigFeatures); + } + + if (gViConfigXScale != 1.0f) { + osViSetXScale(gViConfigXScale); + } + + if (gViConfigYScale != 1.0f) { + osViSetYScale(gViConfigYScale); + } + } + gViConfigBlackNext = black; + } +} + +void ViConfig_UpdateBlack(void) { + if (gViConfigBlackNext != gViConfigBlack) { + osViBlack(gViConfigBlackNext); + gViConfigBlack = gViConfigBlackNext; + } +} diff --git a/yamls/jp/boot.yaml b/yamls/jp/boot.yaml index a4d6fd4..a998025 100644 --- a/yamls/jp/boot.yaml +++ b/yamls/jp/boot.yaml @@ -8,8 +8,7 @@ - [0x001060, c, boot/boot_main] - [0x0011F0, c, boot/idle] - - - [0x0014A0, asm, boot/viconfig] + - [0x0014A0, c, boot/viconfig] - [0x001640, asm, boot/001640] - [0x0017F0, asm, boot/z_std_dma] - [0x0022A0, asm, boot/yaz0] @@ -265,8 +264,9 @@ - [0x019D00, rodata, boot/build] - { start: 0x019D40, type: .bss, vram: 0x8003E940, name: boot/boot_main } - - { start: 0x019D40, type: .bss, vram: 0x8003F330, name: boot/idle} - - { start: 0x019D40, type: bss, vram: 0x8003FF30, name: boot/8003FF30} + - { start: 0x019D40, type: .bss, vram: 0x8003F330, name: boot/idle } + - { start: 0x019D40, type: .bss, vram: 0x8003FF30, name: boot/viconfig } + - { start: 0x019D40, type: bss, vram: 0x8003FF40, name: boot/8003FF40 } - { start: 0x019D40, type: bss, vram: 0x800419A0, name: boot/gfxprint } - { start: 0x019D40, type: bss, vram: 0x800419B0, name: boot/mathf } - { start: 0x019D40, type: bss, vram: 0x800419C0, name: boot/800419C0 } |
