diff --git a/asm/non_matchings/code/db_camera/func_800B8BA4.s b/asm/non_matchings/code/db_camera/func_800B8BA4.s index b0e462a405..c15d7c16f6 100644 --- a/asm/non_matchings/code/db_camera/func_800B8BA4.s +++ b/asm/non_matchings/code/db_camera/func_800B8BA4.s @@ -3,6 +3,7 @@ glabel func_800B8BA4 /* B2FD48 800B8BA8 03E00008 */ jr $ra /* B2FD4C 800B8BAC 8C4212EC */ lw $v0, %lo(D_801612EC)($v0) +glabel func_800B8BB0 /* B2FD50 800B8BB0 27BDFFB8 */ addiu $sp, $sp, -0x48 /* B2FD54 800B8BB4 AFB00020 */ sw $s0, 0x20($sp) /* B2FD58 800B8BB8 AFB50034 */ sw $s5, 0x34($sp) @@ -142,6 +143,7 @@ glabel func_800B8BA4 /* B2FF48 800B8DA8 03E00008 */ jr $ra /* B2FF4C 800B8DAC 27BD0048 */ addiu $sp, $sp, 0x48 +glabel func_800B8DB0 /* B2FF50 800B8DB0 27BDFFB0 */ addiu $sp, $sp, -0x50 /* B2FF54 800B8DB4 AFB3002C */ sw $s3, 0x2c($sp) /* B2FF58 800B8DB8 00809825 */ move $s3, $a0 @@ -246,6 +248,7 @@ glabel func_800B8BA4 /* B300C8 800B8F28 03E00008 */ jr $ra /* B300CC 800B8F2C 27BD0050 */ addiu $sp, $sp, 0x50 +glabel func_800B8F30 /* B300D0 800B8F30 27BDFFE8 */ addiu $sp, $sp, -0x18 /* B300D4 800B8F34 AFBF0014 */ sw $ra, 0x14($sp) /* B300D8 800B8F38 00803025 */ move $a2, $a0 diff --git a/asm/non_matchings/code/z_kankyo/func_8006F0D4.s b/asm/non_matchings/code/z_kankyo/func_8006F0D4.s index 8f792cd0cb..71f82606c9 100644 --- a/asm/non_matchings/code/z_kankyo/func_8006F0D4.s +++ b/asm/non_matchings/code/z_kankyo/func_8006F0D4.s @@ -4,9 +4,9 @@ glabel func_8006F0D4 /* AE627C 8006F0DC 000E71C0 */ sll $t6, $t6, 7 /* AE6280 8006F0E0 00047840 */ sll $t7, $a0, 1 /* AE6284 8006F0E4 01CFC021 */ addu $t8, $t6, $t7 -/* AE6288 8006F0E8 3C038017 */ lui $v1, %hi(D_801759C0) +/* AE6288 8006F0E8 3C038017 */ lui $v1, %hi(gZBuffer) /* AE628C 8006F0EC 00781821 */ addu $v1, $v1, $t8 -/* AE6290 8006F0F0 946359C0 */ lhu $v1, %lo(D_801759C0)($v1) +/* AE6290 8006F0F0 946359C0 */ lhu $v1, %lo(gZBuffer)($v1) /* AE6294 8006F0F4 03E00008 */ jr $ra /* AE6298 8006F0F8 3062FFFF */ andi $v0, $v1, 0xffff diff --git a/asm/non_matchings/code/z_lights/func_8007A9B4.s b/asm/non_matchings/code/z_lights/func_8007A9B4.s index 3f63b3f53e..3d98da878d 100644 --- a/asm/non_matchings/code/z_lights/func_8007A9B4.s +++ b/asm/non_matchings/code/z_lights/func_8007A9B4.s @@ -22,7 +22,7 @@ glabel func_8007A9B4 /* AF1B90 8007A9F0 F7B40018 */ sdc1 $f20, 0x18($sp) /* AF1B94 8007A9F4 AFA400A8 */ sw $a0, 0xa8($sp) /* AF1B98 8007A9F8 8C9107A8 */ lw $s1, 0x7a8($a0) -/* AF1B9C 8007A9FC 3C178017 */ lui $s7, %hi(D_801759C0) # $s7, 0x8017 +/* AF1B9C 8007A9FC 3C178017 */ lui $s7, %hi(gZBuffer) # $s7, 0x8017 /* AF1BA0 8007AA00 241E0001 */ li $fp, 1 /* AF1BA4 8007AA04 1220005C */ beqz $s1, .L8007AB78 /* AF1BA8 8007AA08 3C0142F0 */ li $at, 0x42F00000 # 0.000000 @@ -35,7 +35,7 @@ glabel func_8007A9B4 /* AF1BC4 8007AA24 4481B000 */ mtc1 $at, $f22 /* AF1BC8 8007AA28 3C013F80 */ li $at, 0x3F800000 # 0.000000 /* AF1BCC 8007AA2C 4481A000 */ mtc1 $at, $f20 -/* AF1BD0 8007AA30 26F759C0 */ addiu $s7, %lo(D_801759C0) # addiu $s7, $s7, 0x59c0 +/* AF1BD0 8007AA30 26F759C0 */ addiu $s7, %lo(gZBuffer) # addiu $s7, $s7, 0x59c0 /* AF1BD4 8007AA34 27B60084 */ addiu $s6, $sp, 0x84 /* AF1BD8 8007AA38 27B50088 */ addiu $s5, $sp, 0x88 /* AF1BDC 8007AA3C 27B40094 */ addiu $s4, $sp, 0x94 diff --git a/asm/non_matchings/code/z_play/Gameplay_Draw.s b/asm/non_matchings/code/z_play/Gameplay_Draw.s index 5f6be614c6..c8d80e5c36 100644 --- a/asm/non_matchings/code/z_play/Gameplay_Draw.s +++ b/asm/non_matchings/code/z_play/Gameplay_Draw.s @@ -357,8 +357,8 @@ glabel Gameplay_Draw .L800BF314: /* B364B4 800BF314 3C010001 */ lui $at, (0x00012124 >> 16) # lui $at, 1 /* B364B8 800BF318 34212124 */ ori $at, (0x00012124 & 0xFFFF) # ori $at, $at, 0x2124 -/* B364BC 800BF31C 3C0A8017 */ lui $t2, %hi(D_801759C0) # $t2, 0x8017 -/* B364C0 800BF320 254A59C0 */ addiu $t2, %lo(D_801759C0) # addiu $t2, $t2, 0x59c0 +/* B364BC 800BF31C 3C0A8017 */ lui $t2, %hi(gZBuffer) # $t2, 0x8017 +/* B364C0 800BF320 254A59C0 */ addiu $t2, %lo(gZBuffer) # addiu $t2, $t2, 0x59c0 /* B364C4 800BF324 02012021 */ addu $a0, $s0, $at /* B364C8 800BF328 8E2702DC */ lw $a3, 0x2dc($s1) /* B364CC 800BF32C AFA4003C */ sw $a0, 0x3c($sp) @@ -789,7 +789,7 @@ glabel Gameplay_Draw /* B36AD4 800BF934 24010001 */ li $at, 1 /* B36AD8 800BF938 3C0D8016 */ lui $t5, %hi(gTrnsnUnkState) # $t5, 0x8016 /* B36ADC 800BF93C 11610005 */ beq $t3, $at, .L800BF954 -/* B36AE0 800BF940 3C0F8017 */ lui $t7, %hi(D_801759C0) # $t7, 0x8017 +/* B36AE0 800BF940 3C0F8017 */ lui $t7, %hi(gZBuffer) # $t7, 0x8017 /* B36AE4 800BF944 8DAD1490 */ lw $t5, %lo(gTrnsnUnkState)($t5) /* B36AE8 800BF948 24010001 */ li $at, 1 /* B36AEC 800BF94C 55A10030 */ bnel $t5, $at, .L800BFA10 @@ -800,7 +800,7 @@ glabel Gameplay_Draw /* B36AFC 800BF95C 00300821 */ addu $at, $at, $s0 /* B36B00 800BF960 AFAC0070 */ sw $t4, 0x70($sp) /* B36B04 800BF964 8E2E02DC */ lw $t6, 0x2dc($s1) -/* B36B08 800BF968 25EF59C0 */ addiu $t7, %lo(D_801759C0) # addiu $t7, $t7, 0x59c0 +/* B36B08 800BF968 25EF59C0 */ addiu $t7, %lo(gZBuffer) # addiu $t7, $t7, 0x59c0 /* B36B0C 800BF96C 27A50070 */ addiu $a1, $sp, 0x70 /* B36B10 800BF970 AC2E2134 */ sw $t6, 0x2134($at) /* B36B14 800BF974 3C010001 */ lui $at, 1 diff --git a/asm/non_matchings/code/z_play/Gameplay_Update.s b/asm/non_matchings/code/z_play/Gameplay_Update.s index f43b45d4e5..9ba419c5dc 100644 --- a/asm/non_matchings/code/z_play/Gameplay_Update.s +++ b/asm/non_matchings/code/z_play/Gameplay_Update.s @@ -524,7 +524,7 @@ glabel Gameplay_Update /* B346C0 800BD520 0C02C7A1 */ jal TransitionUnk_Init /* B346C4 800BD524 24060007 */ li $a2, 7 /* B346C8 800BD528 14400007 */ bnez $v0, .L800BD548 -/* B346CC 800BD52C 3C0C8017 */ lui $t4, %hi(D_801759C0) # $t4, 0x8017 +/* B346CC 800BD52C 3C0C8017 */ lui $t4, %hi(gZBuffer) # $t4, 0x8017 /* B346D0 800BD530 3C048014 */ lui $a0, %hi(D_80144300) # $a0, 0x8014 /* B346D4 800BD534 0C00084C */ jal osSyncPrintf /* B346D8 800BD538 24844300 */ addiu $a0, %lo(D_80144300) # addiu $a0, $a0, 0x4300 @@ -532,7 +532,7 @@ glabel Gameplay_Update /* B346E0 800BD540 1000000E */ b .L800BD57C /* B346E4 800BD544 AC201490 */ sw $zero, %lo(gTrnsnUnkState)($at) .L800BD548: -/* B346E8 800BD548 258C59C0 */ addiu $t4, %lo(D_801759C0) # addiu $t4, $t4, 0x59c0 +/* B346E8 800BD548 258C59C0 */ addiu $t4, %lo(gZBuffer) # addiu $t4, $t4, 0x59c0 /* B346EC 800BD54C 3C018016 */ lui $at, %hi(sTrnsnUnk+0xdc) # $at, 0x8016 /* B346F0 800BD550 AC2C148C */ sw $t4, %lo(sTrnsnUnk+0xdc)($at) /* B346F4 800BD554 3C0F8016 */ lui $t7, %hi(gGameInfo) # $t7, 0x8016 diff --git a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s index 1b2ad0f661..08352e1b03 100644 --- a/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s +++ b/asm/non_matchings/overlays/actors/ovl_Demo_Kankyo/func_8098ABC0.s @@ -430,7 +430,7 @@ glabel func_8098ABC0 /* 0230C 8098B18C AC590000 */ sw $t9, 0x0000($v0) ## 00000000 /* 02310 8098B190 8629001C */ lh $t1, 0x001C($s1) ## 0000001C /* 02314 8098B194 3C0A8099 */ lui $t2, %hi(D_8098C31C) ## $t2 = 80990000 -/* 02318 8098B198 3C058016 */ lui $a1, %hi(D_801604C4) +/* 02318 8098B198 3C058016 */ lui $a1, %hi(gSaveContext+0x1397) /* 0231C 8098B19C 16A90019 */ bne $s5, $t1, .L8098B204 /* 02320 8098B1A0 254AC31C */ addiu $t2, $t2, %lo(D_8098C31C) ## $t2 = 8098C31C /* 02324 8098B1A4 8E6202D0 */ lw $v0, 0x02D0($s3) ## 000002D0 @@ -440,7 +440,7 @@ glabel func_8098ABC0 /* 02334 8098B1B4 AE6A02D0 */ sw $t2, 0x02D0($s3) ## 000002D0 /* 02338 8098B1B8 02412821 */ addu $a1, $s2, $at /* 0233C 8098B1BC AC4B0000 */ sw $t3, 0x0000($v0) ## 00000000 -/* 02340 8098B1C0 94AC04C4 */ lhu $t4, %lo(D_801604C4)($a1) +/* 02340 8098B1C0 94AC04C4 */ lhu $t4, 0x04C4($a1) /* 02344 8098B1C4 3C0E8099 */ lui $t6, %hi(D_8098C31C) ## $t6 = 80990000 /* 02348 8098B1C8 25CEC31C */ addiu $t6, $t6, %lo(D_8098C31C) ## $t6 = 8098C31C /* 0234C 8098B1CC 000C6880 */ sll $t5, $t4, 2 @@ -458,7 +458,7 @@ glabel func_8098ABC0 /* 0237C 8098B1FC 10000014 */ beq $zero, $zero, .L8098B250 /* 02380 8098B200 AC580004 */ sw $t8, 0x0004($v0) ## 00000004 .L8098B204: -/* 02384 8098B204 80A5F9F7 */ lb $a1, -0x0609($a1) ## 8015F9F7 +/* 02384 8098B204 80A5F9F7 */ lb $a1, %lo(gSaveContext+0x1397)($a1) /* 02388 8098B208 8E6202D0 */ lw $v0, 0x02D0($s3) ## 000002D0 /* 0238C 8098B20C 3C09FB00 */ lui $t1, 0xFB00 ## $t1 = FB000000 /* 02390 8098B210 0005C880 */ sll $t9, $a1, 2 diff --git a/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_8081D398.s b/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_8081D398.s index cba00d46c0..3f6415d951 100644 --- a/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_8081D398.s +++ b/asm/non_matchings/overlays/actors/ovl_kaleido_scope/func_8081D398.s @@ -569,8 +569,8 @@ glabel func_8081D398 /* 0A3F0 8081DC10 54610043 */ bnel $v1, $at, .L8081DD20 /* 0A3F4 8081DC14 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 /* 0A3F8 8081DC18 8E0F02C0 */ lw $t7, 0x02C0($s0) ## 000002C0 -/* 0A3FC 8081DC1C 3C190015 */ lui $t9, 0x0015 ## $t9 = 00150000 -/* 0A400 8081DC20 273979A0 */ addiu $t9, $t9, 0x79A0 ## $t9 = 001579A0 +/* 0A3FC 8081DC1C 3C190015 */ lui $t9, %hi(D_801579A0-0x80000000) +/* 0A400 8081DC20 273979A0 */ addiu $t9, %lo(D_801579A0-0x80000000) /* 0A404 8081DC24 AFAF01CC */ sw $t7, 0x01CC($sp) /* 0A408 8081DC28 25F80008 */ addiu $t8, $t7, 0x0008 ## $t8 = 0000000A /* 0A40C 8081DC2C AFB801CC */ sw $t8, 0x01CC($sp) @@ -578,8 +578,8 @@ glabel func_8081D398 /* 0A414 8081DC34 ADF20000 */ sw $s2, 0x0000($t7) ## 00000002 /* 0A418 8081DC38 ADF90004 */ sw $t9, 0x0004($t7) ## 00000006 /* 0A41C 8081DC3C 8FAF01CC */ lw $t7, 0x01CC($sp) -/* 0A420 8081DC40 3C180011 */ lui $t8, 0x0011 ## $t8 = 00110000 -/* 0A424 8081DC44 27183070 */ addiu $t8, $t8, 0x3070 ## $t8 = 00113070 +/* 0A420 8081DC40 3C180011 */ lui $t8, %hi(D_80113070-0x80000000) +/* 0A424 8081DC44 27183070 */ addiu $t8, %lo(D_80113070-0x80000000) /* 0A428 8081DC48 25EE0008 */ addiu $t6, $t7, 0x0008 ## $t6 = 0000000A /* 0A42C 8081DC4C AFAE01CC */ sw $t6, 0x01CC($sp) /* 0A430 8081DC50 3C13DD00 */ lui $s3, 0xDD00 ## $s3 = DD000000 diff --git a/data/db_camera.data.s b/data/db_camera.data.s index 39127bee3b..af2ce7e4ad 100644 --- a/data/db_camera.data.s +++ b/data/db_camera.data.s @@ -256,7 +256,9 @@ glabel D_8012D13C .incbin "baserom.z64", 0xBA42DC, 0x10 glabel D_8012D14C - .incbin "baserom.z64", 0xBA42EC, 0xC + .word func_800B8DB0 + .word func_800B8BB0 + .word func_800B8F30 glabel D_8012D158 .incbin "baserom.z64", 0xBA42F8, 0x18 diff --git a/data/z_kankyo.data.s b/data/z_kankyo.data.s index 1948c96360..27a94266e5 100644 --- a/data/z_kankyo.data.s +++ b/data/z_kankyo.data.s @@ -37,7 +37,42 @@ glabel D_8011FC1C .incbin "baserom.z64", 0xB96DBC, 0x120 glabel D_8011FD3C - .incbin "baserom.z64", 0xB96EDC, 0x90 + .word _vr_fine0_staticSegmentRomStart + .word _vr_fine0_staticSegmentRomEnd + .word _vr_fine0_pal_staticSegmentRomStart + .word _vr_fine0_pal_staticSegmentRomEnd + .word _vr_fine1_staticSegmentRomStart + .word _vr_fine1_staticSegmentRomEnd + .word _vr_fine1_pal_staticSegmentRomStart + .word _vr_fine1_pal_staticSegmentRomEnd + .word _vr_fine2_staticSegmentRomStart + .word _vr_fine2_staticSegmentRomEnd + .word _vr_fine2_pal_staticSegmentRomStart + .word _vr_fine2_pal_staticSegmentRomEnd + .word _vr_fine3_staticSegmentRomStart + .word _vr_fine3_staticSegmentRomEnd + .word _vr_fine3_pal_staticSegmentRomStart + .word _vr_fine3_pal_staticSegmentRomEnd + .word _vr_cloud0_staticSegmentRomStart + .word _vr_cloud0_staticSegmentRomEnd + .word _vr_cloud0_pal_staticSegmentRomStart + .word _vr_cloud0_pal_staticSegmentRomEnd + .word _vr_cloud1_staticSegmentRomStart + .word _vr_cloud1_staticSegmentRomEnd + .word _vr_cloud1_pal_staticSegmentRomStart + .word _vr_cloud1_pal_staticSegmentRomEnd + .word _vr_cloud2_staticSegmentRomStart + .word _vr_cloud2_staticSegmentRomEnd + .word _vr_cloud2_pal_staticSegmentRomStart + .word _vr_cloud2_pal_staticSegmentRomEnd + .word _vr_cloud3_staticSegmentRomStart + .word _vr_cloud3_staticSegmentRomEnd + .word _vr_cloud3_pal_staticSegmentRomStart + .word _vr_cloud3_pal_staticSegmentRomEnd + .word _vr_holy0_staticSegmentRomStart + .word _vr_holy0_staticSegmentRomEnd + .word _vr_holy0_pal_staticSegmentRomStart + .word _vr_holy0_pal_staticSegmentRomEnd glabel D_8011FDCC .incbin "baserom.z64", 0xB96F6C, 0x4 diff --git a/data/z_message_PAL.bss.s b/data/z_message_PAL.bss.s index 1fe2b7304d..6803e43157 100644 --- a/data/z_message_PAL.bss.s +++ b/data/z_message_PAL.bss.s @@ -50,5 +50,3 @@ glabel D_801759BC glabel D_801759BE .space 0x2 - -glabel D_801759C0 diff --git a/data/z_skin.bss.s b/data/z_skin.bss.s index 281b6ff2b7..b03f894d8b 100644 --- a/data/z_skin.bss.s +++ b/data/z_skin.bss.s @@ -10,7 +10,4 @@ .balign 16 glabel D_801600C0 - .space 0x404 - -glabel D_801604C4 - .space 0xB0C + .space 0xF10 diff --git a/data/z_text.data.s b/data/z_text.data.s index 3e6a88fcb6..221a7a1874 100644 --- a/data/z_text.data.s +++ b/data/z_text.data.s @@ -15,5 +15,19 @@ glabel gLetterTLUT .incbin "baserom.z64", 0xBA18E0, 0x80 glabel gFontFF - .incbin "baserom.z64", 0xBA1960, 0x430 + .incbin "baserom.z64", 0xBA1960, 0x400 +# Unused +glabel D_8012ABC0 + .word func_801067F0 # fmodf? + .word guScale + .word guRotate + .word guTranslate + .word GfxPrint_SetPos + .word GfxPrint_SetColor + .word GfxPrint_Printf + .word GfxPrint_SetPosPx + .word GfxPrint_Ctor + .word GfxPrint_Open + .word GfxPrint_Close + .word GfxPrint_Dtor diff --git a/include/segment_symbols.h b/include/segment_symbols.h index 1b527cd2fe..82aec4a79a 100644 --- a/include/segment_symbols.h +++ b/include/segment_symbols.h @@ -974,8 +974,22 @@ DECLARE_ROM_SEGMENT(z_select_static) DECLARE_ROM_SEGMENT(nintendo_rogo_static) DECLARE_ROM_SEGMENT(title_static) DECLARE_ROM_SEGMENT(parameter_static) +DECLARE_ROM_SEGMENT(vr_fine0_static) +DECLARE_ROM_SEGMENT(vr_fine0_pal_static) +DECLARE_ROM_SEGMENT(vr_fine1_static) +DECLARE_ROM_SEGMENT(vr_fine1_pal_static) +DECLARE_ROM_SEGMENT(vr_fine2_static) +DECLARE_ROM_SEGMENT(vr_fine2_pal_static) +DECLARE_ROM_SEGMENT(vr_fine3_static) +DECLARE_ROM_SEGMENT(vr_fine3_pal_static) +DECLARE_ROM_SEGMENT(vr_cloud0_static) +DECLARE_ROM_SEGMENT(vr_cloud0_pal_static) +DECLARE_ROM_SEGMENT(vr_cloud1_static) +DECLARE_ROM_SEGMENT(vr_cloud1_pal_static) DECLARE_ROM_SEGMENT(vr_cloud2_static) DECLARE_ROM_SEGMENT(vr_cloud2_pal_static) +DECLARE_ROM_SEGMENT(vr_cloud3_static) +DECLARE_ROM_SEGMENT(vr_cloud3_pal_static) DECLARE_ROM_SEGMENT(vr_holy0_static) DECLARE_ROM_SEGMENT(vr_holy0_pal_static) DECLARE_ROM_SEGMENT(vr_holy1_static) diff --git a/include/variables.h b/include/variables.h index 388ccad942..87278abbe1 100644 --- a/include/variables.h +++ b/include/variables.h @@ -3773,7 +3773,7 @@ extern pif_data_buffer_t pifMempakBuf; //extern ? D_801759BA; //extern ? D_801759BC; //extern ? D_801759BE; -extern u8 D_801759C0[]; // _codeSegmentEnd/_codeSegmentBssEnd or gZBuffer + extern u16 gZBuffer[SCREEN_WIDTH * SCREEN_HEIGHT]; // 0x25800 bytes extern u64 gGfxSPTaskOutputBuffer[0x3000]; // 0x18000 bytes extern u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE]; // 0xC00 bytes diff --git a/src/code/code_801067F0.c b/src/code/code_801067F0.c index 72f59a0510..b895ee360c 100644 --- a/src/code/code_801067F0.c +++ b/src/code/code_801067F0.c @@ -1,7 +1,7 @@ #include #include -// fmodf? unused +// fmodf? f32 func_801067F0(f32 arg0, f32 arg1) { s32 sp4;