rename curtain globals

This commit is contained in:
Alex Bates 2020-10-15 00:16:44 +01:00
parent 87e7d5bf7e
commit 0a2b3780a3
No known key found for this signature in database
GPG Key ID: 5E11C2DB78877706
5 changed files with 58 additions and 59 deletions

View File

@ -6,8 +6,8 @@ glabel render_curtains
/* 6E84 8002BA84 C420BA94 */ lwc1 $f0, -0x456c($at)
/* 6E88 8002BA88 27BDFF78 */ addiu $sp, $sp, -0x88
/* 6E8C 8002BA8C AFB20068 */ sw $s2, 0x68($sp)
/* 6E90 8002BA90 3C12800A */ lui $s2, %hi(D_8009BA90)
/* 6E94 8002BA94 2652BA90 */ addiu $s2, $s2, %lo(D_8009BA90)
/* 6E90 8002BA90 3C12800A */ lui $s2, %hi(gCurtainScale)
/* 6E94 8002BA94 2652BA90 */ addiu $s2, $s2, %lo(gCurtainScale)
/* 6E98 8002BA98 AFBF0078 */ sw $ra, 0x78($sp)
/* 6E9C 8002BA9C AFB50074 */ sw $s5, 0x74($sp)
/* 6EA0 8002BAA0 AFB40070 */ sw $s4, 0x70($sp)
@ -17,35 +17,35 @@ glabel render_curtains
/* 6EB0 8002BAB0 F7B40080 */ sdc1 $f20, 0x80($sp)
/* 6EB4 8002BAB4 C6440000 */ lwc1 $f4, ($s2)
/* 6EB8 8002BAB8 46040032 */ c.eq.s $f0, $f4
/* 6EBC 8002BABC 00000000 */ nop
/* 6EBC 8002BABC 00000000 */ nop
/* 6EC0 8002BAC0 4501000B */ bc1t .L8002BAF0
/* 6EC4 8002BAC4 00000000 */ nop
/* 6EC4 8002BAC4 00000000 */ nop
/* 6EC8 8002BAC8 46040001 */ sub.s $f0, $f0, $f4
/* 6ECC 8002BACC 3C018009 */ lui $at, 0x8009
/* 6ED0 8002BAD0 D4227E00 */ ldc1 $f2, 0x7e00($at)
/* 6ED4 8002BAD4 46000021 */ cvt.d.s $f0, $f0
/* 6ED8 8002BAD8 46220002 */ mul.d $f0, $f0, $f2
/* 6EDC 8002BADC 00000000 */ nop
/* 6EDC 8002BADC 00000000 */ nop
/* 6EE0 8002BAE0 460020A1 */ cvt.d.s $f2, $f4
/* 6EE4 8002BAE4 46201080 */ add.d $f2, $f2, $f0
/* 6EE8 8002BAE8 462010A0 */ cvt.s.d $f2, $f2
/* 6EEC 8002BAEC E6420000 */ swc1 $f2, ($s2)
.L8002BAF0:
/* 6EF0 8002BAF0 3C13800A */ lui $s3, %hi(D_8009BA98)
/* 6EF4 8002BAF4 2673BA98 */ addiu $s3, $s3, %lo(D_8009BA98)
/* 6EF0 8002BAF0 3C13800A */ lui $s3, %hi(gCurtainFade)
/* 6EF4 8002BAF4 2673BA98 */ addiu $s3, $s3, %lo(gCurtainFade)
/* 6EF8 8002BAF8 3C01800A */ lui $at, 0x800a
/* 6EFC 8002BAFC C420BA9C */ lwc1 $f0, -0x4564($at)
/* 6F00 8002BB00 C6640000 */ lwc1 $f4, ($s3)
/* 6F04 8002BB04 46040032 */ c.eq.s $f0, $f4
/* 6F08 8002BB08 00000000 */ nop
/* 6F08 8002BB08 00000000 */ nop
/* 6F0C 8002BB0C 4501000B */ bc1t .L8002BB3C
/* 6F10 8002BB10 00000000 */ nop
/* 6F10 8002BB10 00000000 */ nop
/* 6F14 8002BB14 46040001 */ sub.s $f0, $f0, $f4
/* 6F18 8002BB18 3C018009 */ lui $at, 0x8009
/* 6F1C 8002BB1C D4227E08 */ ldc1 $f2, 0x7e08($at)
/* 6F20 8002BB20 46000021 */ cvt.d.s $f0, $f0
/* 6F24 8002BB24 46220002 */ mul.d $f0, $f0, $f2
/* 6F28 8002BB28 00000000 */ nop
/* 6F28 8002BB28 00000000 */ nop
/* 6F2C 8002BB2C 460020A1 */ cvt.d.s $f2, $f4
/* 6F30 8002BB30 46201080 */ add.d $f2, $f2, $f0
/* 6F34 8002BB34 462010A0 */ cvt.s.d $f2, $f2
@ -56,7 +56,7 @@ glabel render_curtains
/* 6F44 8002BB44 D4227E10 */ ldc1 $f2, 0x7e10($at)
/* 6F48 8002BB48 46000021 */ cvt.d.s $f0, $f0
/* 6F4C 8002BB4C 4622003C */ c.lt.d $f0, $f2
/* 6F50 8002BB50 00000000 */ nop
/* 6F50 8002BB50 00000000 */ nop
/* 6F54 8002BB54 45000087 */ bc1f .L8002BD74
/* 6F58 8002BB58 3C03FF10 */ lui $v1, 0xff10
/* 6F5C 8002BB5C 3463013F */ ori $v1, $v1, 0x13f
@ -121,7 +121,7 @@ glabel render_curtains
/* 7048 8002BC48 AC640000 */ sw $a0, ($v1)
/* 704C 8002BC4C 46200120 */ cvt.s.d $f4, $f0
/* 7050 8002BC50 4614203C */ c.lt.s $f4, $f20
/* 7054 8002BC54 00000000 */ nop
/* 7054 8002BC54 00000000 */ nop
/* 7058 8002BC58 45000002 */ bc1f .L8002BC64
/* 705C 8002BC5C AC700004 */ sw $s0, 4($v1)
/* 7060 8002BC60 4600A106 */ mov.s $f4, $f20
@ -132,7 +132,7 @@ glabel render_curtains
/* 7070 8002BC70 44050000 */ mfc1 $a1, $f0
/* 7074 8002BC74 46002021 */ cvt.d.s $f0, $f4
/* 7078 8002BC78 46220002 */ mul.d $f0, $f0, $f2
/* 707C 8002BC7C 00000000 */ nop
/* 707C 8002BC7C 00000000 */ nop
/* 7080 8002BC80 27A40020 */ addiu $a0, $sp, 0x20
/* 7084 8002BC84 3C01C3A0 */ lui $at, 0xc3a0
/* 7088 8002BC88 44811000 */ mtc1 $at, $f2
@ -175,7 +175,7 @@ glabel render_curtains
/* 711C 8002BD1C AE220000 */ sw $v0, ($s1)
/* 7120 8002BD20 24020040 */ addiu $v0, $zero, 0x40
/* 7124 8002BD24 46001082 */ mul.s $f2, $f2, $f0
/* 7128 8002BD28 00000000 */ nop
/* 7128 8002BD28 00000000 */ nop
/* 712C 8002BD2C ACA20014 */ sw $v0, 0x14($a1)
/* 7130 8002BD30 24A20020 */ addiu $v0, $a1, 0x20
/* 7134 8002BD34 ACA40010 */ sw $a0, 0x10($a1)
@ -185,7 +185,7 @@ glabel render_curtains
/* 7144 8002BD44 ACA0001C */ sw $zero, 0x1c($a1)
/* 7148 8002BD48 4600018D */ trunc.w.s $f6, $f0
/* 714C 8002BD4C 44023000 */ mfc1 $v0, $f6
/* 7150 8002BD50 00000000 */ nop
/* 7150 8002BD50 00000000 */ nop
/* 7154 8002BD54 304200FF */ andi $v0, $v0, 0xff
/* 7158 8002BD58 00021E00 */ sll $v1, $v0, 0x18
/* 715C 8002BD5C 00022400 */ sll $a0, $v0, 0x10
@ -195,12 +195,12 @@ glabel render_curtains
/* 716C 8002BD6C 346300FF */ ori $v1, $v1, 0xff
/* 7170 8002BD70 ACA30004 */ sw $v1, 4($a1)
.L8002BD74:
/* 7174 8002BD74 3C02800A */ lui $v0, %hi(D_8009BAA0)
/* 7178 8002BD78 8C42BAA0 */ lw $v0, %lo(D_8009BAA0)($v0)
/* 7174 8002BD74 3C02800A */ lui $v0, %hi(gCurtainDrawCallback)
/* 7178 8002BD78 8C42BAA0 */ lw $v0, %lo(gCurtainDrawCallback)($v0)
/* 717C 8002BD7C 10400003 */ beqz $v0, .L8002BD8C
/* 7180 8002BD80 00000000 */ nop
/* 7180 8002BD80 00000000 */ nop
/* 7184 8002BD84 0040F809 */ jalr $v0
/* 7188 8002BD88 00000000 */ nop
/* 7188 8002BD88 00000000 */ nop
.L8002BD8C:
/* 718C 8002BD8C 3C108007 */ lui $s0, %hi(gGameStatusPtr)
/* 7190 8002BD90 2610419C */ addiu $s0, $s0, %lo(gGameStatusPtr)
@ -208,25 +208,25 @@ glabel render_curtains
/* 7198 8002BD98 90420073 */ lbu $v0, 0x73($v0)
/* 719C 8002BD9C 30420001 */ andi $v0, $v0, 1
/* 71A0 8002BDA0 14400044 */ bnez $v0, .L8002BEB4
/* 71A4 8002BDA4 00000000 */ nop
/* 71A4 8002BDA4 00000000 */ nop
/* 71A8 8002BDA8 0C00CD4A */ jal get_game_mode
/* 71AC 8002BDAC 00000000 */ nop
/* 71AC 8002BDAC 00000000 */ nop
/* 71B0 8002BDB0 00021400 */ sll $v0, $v0, 0x10
/* 71B4 8002BDB4 00021403 */ sra $v0, $v0, 0x10
/* 71B8 8002BDB8 24030010 */ addiu $v1, $zero, 0x10
/* 71BC 8002BDBC 1043000C */ beq $v0, $v1, .L8002BDF0
/* 71C0 8002BDC0 00000000 */ nop
/* 71C0 8002BDC0 00000000 */ nop
/* 71C4 8002BDC4 0C00CD4A */ jal get_game_mode
/* 71C8 8002BDC8 00000000 */ nop
/* 71C8 8002BDC8 00000000 */ nop
/* 71CC 8002BDCC 00021400 */ sll $v0, $v0, 0x10
/* 71D0 8002BDD0 00021403 */ sra $v0, $v0, 0x10
/* 71D4 8002BDD4 24030002 */ addiu $v1, $zero, 2
/* 71D8 8002BDD8 10430005 */ beq $v0, $v1, .L8002BDF0
/* 71DC 8002BDDC 00000000 */ nop
/* 71DC 8002BDDC 00000000 */ nop
/* 71E0 8002BDE0 8E020000 */ lw $v0, ($s0)
/* 71E4 8002BDE4 80420071 */ lb $v0, 0x71($v0)
/* 71E8 8002BDE8 10400032 */ beqz $v0, .L8002BEB4
/* 71EC 8002BDEC 00000000 */ nop
/* 71EC 8002BDEC 00000000 */ nop
.L8002BDF0:
/* 71F0 8002BDF0 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 71F4 8002BDF4 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)

View File

@ -112,13 +112,6 @@ extern u16 D_8009A6A2;
extern u16 D_8009A6A4;
extern u16 D_8009A6A6;
// curtains
extern f32 D_8009BA90;
extern f32 D_8009BA94; // curtain scale goal
extern f32 D_8009BA98;
extern f32 D_8009BA9C; // curtain fade goal
extern s32 D_8009BAA0; // curtain draw callback
extern s16 gCurrentDoorSoundsSet;
extern s32 D_800D9620;

View File

@ -1,11 +1,11 @@
#include "code_6e40_len_500.h"
void initialize_curtains(void) {
D_8009BAA0 = 0;
D_8009BA90 = 2.0f;
D_8009BA94 = 2.0f;
D_8009BA98 = 0;
D_8009BA9C = 0;
gCurtainDrawCallback = NULL;
gCurtainScale = 2.0f;
gCurtainScaleGoal = 2.0f;
gCurtainFade = 0.0f;
gCurtainFadeGoal = 0.0f;
}
void update_curtains(void) {
@ -13,24 +13,24 @@ void update_curtains(void) {
INCLUDE_ASM(s32, "code_6e40_len_500", render_curtains);
void set_curtain_scale_goal(f32 arg0) {
D_8009BA94 = arg0;
void set_curtain_scale_goal(f32 scale) {
gCurtainScaleGoal = scale;
}
void set_curtain_scale(f32 arg0) {
D_8009BA94 = arg0;
D_8009BA90 = arg0;
void set_curtain_scale(f32 scale) {
gCurtainScaleGoal = scale;
gCurtainScale = scale;
}
void set_curtain_draw_callback(s32 arg0) {
D_8009BAA0 = arg0;
void set_curtain_draw_callback(UNK_FUN_PTR(callback)) {
gCurtainDrawCallback = callback;
}
void set_curtain_fade_goal(f32 arg0) {
D_8009BA9C = arg0;
void set_curtain_fade_goal(f32 fade) {
gCurtainFadeGoal = fade;
}
void set_curtain_fade(f32 arg0) {
D_8009BA9C = arg0;
D_8009BA98 = arg0;
void set_curtain_fade(f32 fade) {
gCurtainFadeGoal = fade;
gCurtainFade = fade;
}

View File

@ -3,13 +3,19 @@
#include "common.h"
extern f32 gCurtainScale;
extern f32 gCurtainScaleGoal;
extern f32 gCurtainFade;
extern f32 gCurtainFadeGoal;
extern UNK_FUN_PTR(gCurtainDrawCallback);
void initialize_curtains(void);
void update_curtains(void);
// render_curtains
void set_curtain_scale_goal(f32 arg0);
void set_curtain_scale(f32 arg0);
void set_curtain_draw_callback(s32 arg0);
void set_curtain_fade_goal(f32 arg0);
void set_curtain_fade(f32 arg0);
void set_curtain_scale_goal(f32 scale);
void set_curtain_scale(f32 scale);
void set_curtain_draw_callback(UNK_FUN_PTR(callback));
void set_curtain_fade_goal(f32 fade);
void set_curtain_fade(f32 fade);
#endif

View File

@ -109,11 +109,11 @@ D_8009A6A2 = 0x8009A6A2;
D_8009A6A4 = 0x8009A6A4;
D_8009A6A6 = 0x8009A6A6;
D_8009BA90 = 0x8009BA90;
D_8009BA94 = 0x8009BA94;
D_8009BA98 = 0x8009BA98;
D_8009BA9C = 0x8009BA9C;
D_8009BAA0 = 0x8009BAA0;
gCurtainScale = 0x8009BA90;
gCurtainScaleGoal = 0x8009BA94;
gCurtainFade = 0x8009BA98;
gCurtainFadeGoal = 0x8009BA9C;
gCurtainDrawCallback = 0x8009BAA0;
D_800A0900 = 0x800A0900;
nuScStack = 0x800A65D0;