mirror of
https://github.com/pmret/papermario.git
synced 2024-11-09 12:32:38 +01:00
Merge remote-tracking branch 'origin/master' into si
This commit is contained in:
commit
56ef80de67
@ -1,26 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel does_script_exist
|
||||
/* 0E8B14 802C4164 0000282D */ daddu $a1, $zero, $zero
|
||||
/* 0E8B18 802C4168 3C03802E */ lui $v1, 0x802e
|
||||
/* 0E8B1C 802C416C 8C63A890 */ lw $v1, -0x5770($v1)
|
||||
.L802C4170:
|
||||
/* 0E8B20 802C4170 8C620000 */ lw $v0, ($v1)
|
||||
/* 0E8B24 802C4174 10400006 */ beqz $v0, .L802C4190
|
||||
/* 0E8B28 802C4178 24A50001 */ addiu $a1, $a1, 1
|
||||
/* 0E8B2C 802C417C 8C420144 */ lw $v0, 0x144($v0)
|
||||
/* 0E8B30 802C4180 14440004 */ bne $v0, $a0, .L802C4194
|
||||
/* 0E8B34 802C4184 28A20080 */ slti $v0, $a1, 0x80
|
||||
/* 0E8B38 802C4188 03E00008 */ jr $ra
|
||||
/* 0E8B3C 802C418C 24020001 */ addiu $v0, $zero, 1
|
||||
|
||||
.L802C4190:
|
||||
/* 0E8B40 802C4190 28A20080 */ slti $v0, $a1, 0x80
|
||||
.L802C4194:
|
||||
/* 0E8B44 802C4194 1440FFF6 */ bnez $v0, .L802C4170
|
||||
/* 0E8B48 802C4198 24630004 */ addiu $v1, $v1, 4
|
||||
/* 0E8B4C 802C419C 03E00008 */ jr $ra
|
||||
/* 0E8B50 802C41A0 0000102D */ daddu $v0, $zero, $zero
|
||||
|
@ -1,26 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel get_script_by_id
|
||||
/* 0E9158 802C47A8 0000302D */ daddu $a2, $zero, $zero
|
||||
/* 0E915C 802C47AC 3C05802E */ lui $a1, 0x802e
|
||||
/* 0E9160 802C47B0 8CA5A890 */ lw $a1, -0x5770($a1)
|
||||
.L802C47B4:
|
||||
/* 0E9164 802C47B4 8CA30000 */ lw $v1, ($a1)
|
||||
/* 0E9168 802C47B8 10600006 */ beqz $v1, .L802C47D4
|
||||
/* 0E916C 802C47BC 24C60001 */ addiu $a2, $a2, 1
|
||||
/* 0E9170 802C47C0 8C620144 */ lw $v0, 0x144($v1)
|
||||
/* 0E9174 802C47C4 14440004 */ bne $v0, $a0, .L802C47D8
|
||||
/* 0E9178 802C47C8 28C20080 */ slti $v0, $a2, 0x80
|
||||
/* 0E917C 802C47CC 03E00008 */ jr $ra
|
||||
/* 0E9180 802C47D0 0060102D */ daddu $v0, $v1, $zero
|
||||
|
||||
.L802C47D4:
|
||||
/* 0E9184 802C47D4 28C20080 */ slti $v0, $a2, 0x80
|
||||
.L802C47D8:
|
||||
/* 0E9188 802C47D8 1440FFF6 */ bnez $v0, .L802C47B4
|
||||
/* 0E918C 802C47DC 24A50004 */ addiu $a1, $a1, 4
|
||||
/* 0E9190 802C47E0 03E00008 */ jr $ra
|
||||
/* 0E9194 802C47E4 0000102D */ daddu $v0, $zero, $zero
|
||||
|
@ -1,12 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel get_script_by_index
|
||||
/* 0E9140 802C4790 3C02802E */ lui $v0, 0x802e
|
||||
/* 0E9144 802C4794 8C42A890 */ lw $v0, -0x5770($v0)
|
||||
/* 0E9148 802C4798 00042080 */ sll $a0, $a0, 2
|
||||
/* 0E914C 802C479C 00822021 */ addu $a0, $a0, $v0
|
||||
/* 0E9150 802C47A0 03E00008 */ jr $ra
|
||||
/* 0E9154 802C47A4 8C820000 */ lw $v0, ($a0)
|
||||
|
@ -1,28 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel kill_all_scripts
|
||||
/* 0E8AC4 802C4114 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 0E8AC8 802C4118 AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* 0E8ACC 802C411C 0000802D */ daddu $s0, $zero, $zero
|
||||
/* 0E8AD0 802C4120 AFBF0014 */ sw $ra, 0x14($sp)
|
||||
.L802C4124:
|
||||
/* 0E8AD4 802C4124 3C03802E */ lui $v1, 0x802e
|
||||
/* 0E8AD8 802C4128 8C63A890 */ lw $v1, -0x5770($v1)
|
||||
/* 0E8ADC 802C412C 00101080 */ sll $v0, $s0, 2
|
||||
/* 0E8AE0 802C4130 00431021 */ addu $v0, $v0, $v1
|
||||
/* 0E8AE4 802C4134 8C440000 */ lw $a0, ($v0)
|
||||
/* 0E8AE8 802C4138 10800003 */ beqz $a0, .L802C4148
|
||||
/* 0E8AEC 802C413C 26100001 */ addiu $s0, $s0, 1
|
||||
/* 0E8AF0 802C4140 0C0B0FCF */ jal kill_script
|
||||
/* 0E8AF4 802C4144 00000000 */ nop
|
||||
.L802C4148:
|
||||
/* 0E8AF8 802C4148 2A020080 */ slti $v0, $s0, 0x80
|
||||
/* 0E8AFC 802C414C 1440FFF5 */ bnez $v0, .L802C4124
|
||||
/* 0E8B00 802C4150 00000000 */ nop
|
||||
/* 0E8B04 802C4154 8FBF0014 */ lw $ra, 0x14($sp)
|
||||
/* 0E8B08 802C4158 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* 0E8B0C 802C415C 03E00008 */ jr $ra
|
||||
/* 0E8B10 802C4160 27BD0018 */ addiu $sp, $sp, 0x18
|
||||
|
@ -1,34 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel kill_script_by_ID
|
||||
/* 0E8A5C 802C40AC 27BDFFE0 */ addiu $sp, $sp, -0x20
|
||||
/* 0E8A60 802C40B0 AFB10014 */ sw $s1, 0x14($sp)
|
||||
/* 0E8A64 802C40B4 0080882D */ daddu $s1, $a0, $zero
|
||||
/* 0E8A68 802C40B8 AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* 0E8A6C 802C40BC 0000802D */ daddu $s0, $zero, $zero
|
||||
/* 0E8A70 802C40C0 AFBF0018 */ sw $ra, 0x18($sp)
|
||||
.L802C40C4:
|
||||
/* 0E8A74 802C40C4 3C03802E */ lui $v1, 0x802e
|
||||
/* 0E8A78 802C40C8 8C63A890 */ lw $v1, -0x5770($v1)
|
||||
/* 0E8A7C 802C40CC 00101080 */ sll $v0, $s0, 2
|
||||
/* 0E8A80 802C40D0 00431021 */ addu $v0, $v0, $v1
|
||||
/* 0E8A84 802C40D4 8C440000 */ lw $a0, ($v0)
|
||||
/* 0E8A88 802C40D8 10800006 */ beqz $a0, .L802C40F4
|
||||
/* 0E8A8C 802C40DC 26100001 */ addiu $s0, $s0, 1
|
||||
/* 0E8A90 802C40E0 8C820144 */ lw $v0, 0x144($a0)
|
||||
/* 0E8A94 802C40E4 14510003 */ bne $v0, $s1, .L802C40F4
|
||||
/* 0E8A98 802C40E8 00000000 */ nop
|
||||
/* 0E8A9C 802C40EC 0C0B0FCF */ jal kill_script
|
||||
/* 0E8AA0 802C40F0 00000000 */ nop
|
||||
.L802C40F4:
|
||||
/* 0E8AA4 802C40F4 2A020080 */ slti $v0, $s0, 0x80
|
||||
/* 0E8AA8 802C40F8 1440FFF2 */ bnez $v0, .L802C40C4
|
||||
/* 0E8AAC 802C40FC 00000000 */ nop
|
||||
/* 0E8AB0 802C4100 8FBF0018 */ lw $ra, 0x18($sp)
|
||||
/* 0E8AB4 802C4104 8FB10014 */ lw $s1, 0x14($sp)
|
||||
/* 0E8AB8 802C4108 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* 0E8ABC 802C410C 03E00008 */ jr $ra
|
||||
/* 0E8AC0 802C4110 27BD0020 */ addiu $sp, $sp, 0x20
|
||||
|
@ -1,16 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel func_80033540
|
||||
/* 00E940 80033540 3C03800A */ lui $v1, 0x800a
|
||||
/* 00E944 80033544 2463A650 */ addiu $v1, $v1, -0x59b0
|
||||
/* 00E948 80033548 8C620000 */ lw $v0, ($v1)
|
||||
/* 00E94C 8003354C 34420008 */ ori $v0, $v0, 8
|
||||
/* 00E950 80033550 AC620000 */ sw $v0, ($v1)
|
||||
/* 00E954 80033554 3C038007 */ lui $v1, 0x8007
|
||||
/* 00E958 80033558 8C63419C */ lw $v1, 0x419c($v1)
|
||||
/* 00E95C 8003355C 24020003 */ addiu $v0, $zero, 3
|
||||
/* 00E960 80033560 03E00008 */ jr $ra
|
||||
/* 00E964 80033564 A06200AC */ sb $v0, 0xac($v1)
|
||||
|
@ -1,26 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel func_80033788
|
||||
/* 00EB88 80033788 27BDFFD8 */ addiu $sp, $sp, -0x28
|
||||
/* 00EB8C 8003378C 240200FF */ addiu $v0, $zero, 0xff
|
||||
/* 00EB90 80033790 0000202D */ daddu $a0, $zero, $zero
|
||||
/* 00EB94 80033794 0080282D */ daddu $a1, $a0, $zero
|
||||
/* 00EB98 80033798 2406013F */ addiu $a2, $zero, 0x13f
|
||||
/* 00EB9C 8003379C 240700EF */ addiu $a3, $zero, 0xef
|
||||
/* 00EBA0 800337A0 AFBF0020 */ sw $ra, 0x20($sp)
|
||||
/* 00EBA4 800337A4 AFA00010 */ sw $zero, 0x10($sp)
|
||||
/* 00EBA8 800337A8 AFA00014 */ sw $zero, 0x14($sp)
|
||||
/* 00EBAC 800337AC AFA00018 */ sw $zero, 0x18($sp)
|
||||
/* 00EBB0 800337B0 0C00AAD7 */ jal func_8002AB5C
|
||||
/* 00EBB4 800337B4 AFA2001C */ sw $v0, 0x1c($sp)
|
||||
/* 00EBB8 800337B8 8FBF0020 */ lw $ra, 0x20($sp)
|
||||
/* 00EBBC 800337BC 03E00008 */ jr $ra
|
||||
/* 00EBC0 800337C0 27BD0028 */ addiu $sp, $sp, 0x28
|
||||
|
||||
/* 00EBC4 800337C4 00000000 */ nop
|
||||
/* 00EBC8 800337C8 00000000 */ nop
|
||||
/* 00EBCC 800337CC 00000000 */ nop
|
||||
|
||||
|
@ -1,37 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
|
||||
glabel MakeLerp
|
||||
/* 0F8F60 802D45B0 27BDFFE0 */ addiu $sp, $sp, -0x20
|
||||
/* 0F8F64 802D45B4 AFB10014 */ sw $s1, 0x14($sp)
|
||||
/* 0F8F68 802D45B8 0080882D */ daddu $s1, $a0, $zero
|
||||
/* 0F8F6C 802D45BC AFBF0018 */ sw $ra, 0x18($sp)
|
||||
/* 0F8F70 802D45C0 AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* 0F8F74 802D45C4 8E30000C */ lw $s0, 0xc($s1)
|
||||
/* 0F8F78 802D45C8 8E050000 */ lw $a1, ($s0)
|
||||
/* 0F8F7C 802D45CC 0C0B1EAF */ jal get_variable
|
||||
/* 0F8F80 802D45D0 26100004 */ addiu $s0, $s0, 4
|
||||
/* 0F8F84 802D45D4 AE2200B4 */ sw $v0, 0xb4($s1)
|
||||
/* 0F8F88 802D45D8 8E050000 */ lw $a1, ($s0)
|
||||
/* 0F8F8C 802D45DC 26100004 */ addiu $s0, $s0, 4
|
||||
/* 0F8F90 802D45E0 0C0B1EAF */ jal get_variable
|
||||
/* 0F8F94 802D45E4 0220202D */ daddu $a0, $s1, $zero
|
||||
/* 0F8F98 802D45E8 AE2200B8 */ sw $v0, 0xb8($s1)
|
||||
/* 0F8F9C 802D45EC 8E050000 */ lw $a1, ($s0)
|
||||
/* 0F8FA0 802D45F0 26100004 */ addiu $s0, $s0, 4
|
||||
/* 0F8FA4 802D45F4 0C0B1EAF */ jal get_variable
|
||||
/* 0F8FA8 802D45F8 0220202D */ daddu $a0, $s1, $zero
|
||||
/* 0F8FAC 802D45FC AE2200C0 */ sw $v0, 0xc0($s1)
|
||||
/* 0F8FB0 802D4600 8E050000 */ lw $a1, ($s0)
|
||||
/* 0F8FB4 802D4604 0C0B1EAF */ jal get_variable
|
||||
/* 0F8FB8 802D4608 0220202D */ daddu $a0, $s1, $zero
|
||||
/* 0F8FBC 802D460C AE2200B0 */ sw $v0, 0xb0($s1)
|
||||
/* 0F8FC0 802D4610 AE2000BC */ sw $zero, 0xbc($s1)
|
||||
/* 0F8FC4 802D4614 8FBF0018 */ lw $ra, 0x18($sp)
|
||||
/* 0F8FC8 802D4618 8FB10014 */ lw $s1, 0x14($sp)
|
||||
/* 0F8FCC 802D461C 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* 0F8FD0 802D4620 24020002 */ addiu $v0, $zero, 2
|
||||
/* 0F8FD4 802D4624 03E00008 */ jr $ra
|
||||
/* 0F8FD8 802D4628 27BD0020 */ addiu $sp, $sp, 0x20
|
||||
|
@ -10,6 +10,11 @@ extern player_data gPlayerData;
|
||||
extern player_status gPlayerStatus;
|
||||
extern game_status* gGameStatusPtr[1];
|
||||
extern item_table_entry gItemTable[364];
|
||||
|
||||
extern script_context* gWorldScriptList[128];
|
||||
extern script_context* gBattleScriptList[128];
|
||||
extern script_context** gCurrentScriptListPtr[128];
|
||||
|
||||
extern s8 D_800A0900;
|
||||
extern s16* D_80151328;
|
||||
extern s16 D_8010CD10;
|
||||
|
@ -26,11 +26,43 @@ INCLUDE_ASM(code_e79b0_len_1920, func_802C3EE4);
|
||||
|
||||
INCLUDE_ASM(code_e79b0_len_1920, kill_script);
|
||||
|
||||
INCLUDE_ASM(code_e79b0_len_1920, kill_script_by_ID);
|
||||
void* kill_script_by_ID(s32 id) {
|
||||
s32 i;
|
||||
script_context* scriptContextPtr;
|
||||
|
||||
INCLUDE_ASM(code_e79b0_len_1920, kill_all_scripts);
|
||||
for (i=0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
|
||||
scriptContextPtr = (*gCurrentScriptListPtr)[i];
|
||||
if (scriptContextPtr != NULL && scriptContextPtr->uniqueID == id) {
|
||||
kill_script(scriptContextPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_e79b0_len_1920, does_script_exist);
|
||||
s32 kill_all_scripts(void) {
|
||||
s32 i;
|
||||
script_context* scriptContextPtr;
|
||||
|
||||
for(i=0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
|
||||
scriptContextPtr = (*gCurrentScriptListPtr)[i];
|
||||
if (scriptContextPtr != NULL) {
|
||||
kill_script(scriptContextPtr);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
s32 does_script_exist(s32 id) {
|
||||
s32 i;
|
||||
script_context* scriptContextPtr;
|
||||
|
||||
for(i=0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
|
||||
scriptContextPtr = (*gCurrentScriptListPtr)[i];
|
||||
if (scriptContextPtr != NULL && scriptContextPtr->uniqueID == id) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_e79b0_len_1920, does_script_exist_by_ref);
|
||||
|
||||
@ -68,9 +100,25 @@ INCLUDE_ASM(code_e79b0_len_1920, suspend_group_others);
|
||||
|
||||
INCLUDE_ASM(code_e79b0_len_1920, resume_group_others);
|
||||
|
||||
INCLUDE_ASM(code_e79b0_len_1920, get_script_by_index);
|
||||
script_context* get_script_by_index(s32 index) {
|
||||
return (*gCurrentScriptListPtr)[index];
|
||||
}
|
||||
|
||||
script_context* get_script_by_id(s32 id) {
|
||||
s32 i;
|
||||
script_context* scriptContextPtr;
|
||||
|
||||
for (i=0; i < ARRAY_COUNT(gCurrentScriptListPtr); i++) {
|
||||
if ((*gCurrentScriptListPtr)[i] != NULL) {
|
||||
scriptContextPtr = (*gCurrentScriptListPtr)[i];
|
||||
if (scriptContextPtr->uniqueID == id) {
|
||||
return scriptContextPtr;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_e79b0_len_1920, get_script_by_id);
|
||||
|
||||
INCLUDE_ASM(code_e79b0_len_1920, set_script_flags);
|
||||
|
||||
|
@ -1,7 +1,12 @@
|
||||
#include "common.h"
|
||||
|
||||
INCLUDE_ASM(code_e940_len_290, func_80033540);
|
||||
void func_80033540(void) {
|
||||
D_8009A650[0] |= 8;
|
||||
(*gGameStatusPtr)->unk_AC = 3;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_e940_len_290, func_80033568);
|
||||
|
||||
INCLUDE_ASM(code_e940_len_290, func_80033788);
|
||||
void func_80033788(void) {
|
||||
func_8002AB5C(0, 0, 0x13F, 0xEF, 0, 0, 0, 0xFF);
|
||||
}
|
||||
|
@ -1,6 +1,22 @@
|
||||
#include "common.h"
|
||||
|
||||
INCLUDE_ASM(code_f8f60_len_1560, MakeLerp);
|
||||
s32 MakeLerp(script_context* script, s32 initialCall) {
|
||||
s32* ptrReadPos = script->ptrReadPos;
|
||||
s32* ptrNextPos = *ptrReadPos++;
|
||||
s32* ptrNextPos2;
|
||||
s32* ptrNextPos3;
|
||||
s32* ptrNextPos4;
|
||||
|
||||
script->varTable[12] = get_variable(script, ptrNextPos);
|
||||
ptrNextPos2 = *ptrReadPos++;
|
||||
script->varTable[13] = get_variable(script, ptrNextPos2);
|
||||
ptrNextPos3 = *ptrReadPos++;
|
||||
script->varTable[15] = get_variable(script, ptrNextPos3);
|
||||
ptrNextPos4 = *ptrReadPos++;
|
||||
script->varTable[11] = get_variable(script, ptrNextPos4);
|
||||
script->varTable[14] = 0;
|
||||
return 2;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_f8f60_len_1560, UpdateLerp);
|
||||
|
||||
|
@ -3,6 +3,9 @@ gUIStatus = 0x8010EF58;
|
||||
gPlayerData = 0x8010F290;
|
||||
gPlayerStatus = 0x8010EFC8;
|
||||
gItemTable = 0x800878E0;
|
||||
gWorldScriptList = 0x802DA490;
|
||||
gBattleScriptList = 0x802DA690;
|
||||
gCurrentScriptListPtr = 0x802DA890;
|
||||
D_80147574 = 0x80147574;
|
||||
|
||||
gMapTransitionAlpha = 0x800A0940;
|
||||
|
Loading…
Reference in New Issue
Block a user