IsSaveVar123

This commit is contained in:
Ethan Roseman 2020-12-30 16:17:23 +09:00
parent efb9deb1cc
commit 3d9b3ea261
9 changed files with 19 additions and 104 deletions

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802183E0_6DE1A0
/* 6DE1A0 802183E0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 6DE1A4 802183E4 AFB00010 */ sw $s0, 0x10($sp)
/* 6DE1A8 802183E8 0080802D */ daddu $s0, $a0, $zero
/* 6DE1AC 802183EC 3C05F5DE */ lui $a1, 0xf5de
/* 6DE1B0 802183F0 34A501FB */ ori $a1, $a1, 0x1fb
/* 6DE1B4 802183F4 0000202D */ daddu $a0, $zero, $zero
/* 6DE1B8 802183F8 AFBF0014 */ sw $ra, 0x14($sp)
/* 6DE1BC 802183FC 0C0B1EAF */ jal get_variable
/* 6DE1C0 80218400 AE000084 */ sw $zero, 0x84($s0)
/* 6DE1C4 80218404 28420008 */ slti $v0, $v0, 8
/* 6DE1C8 80218408 14400002 */ bnez $v0, .L80218414
/* 6DE1CC 8021840C 24020001 */ addiu $v0, $zero, 1
/* 6DE1D0 80218410 AE020084 */ sw $v0, 0x84($s0)
.L80218414:
/* 6DE1D4 80218414 8FBF0014 */ lw $ra, 0x14($sp)
/* 6DE1D8 80218418 8FB00010 */ lw $s0, 0x10($sp)
/* 6DE1DC 8021841C 24020002 */ addiu $v0, $zero, 2
/* 6DE1E0 80218420 03E00008 */ jr $ra
/* 6DE1E4 80218424 27BD0018 */ addiu $sp, $sp, 0x18
/* 6DE1E8 80218428 00000000 */ nop
/* 6DE1EC 8021842C 00000000 */ nop

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218120_4D0310
/* 4D0310 80218120 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 4D0314 80218124 AFB00010 */ sw $s0, 0x10($sp)
/* 4D0318 80218128 0080802D */ daddu $s0, $a0, $zero
/* 4D031C 8021812C 3C05F5DE */ lui $a1, 0xf5de
/* 4D0320 80218130 34A501FB */ ori $a1, $a1, 0x1fb
/* 4D0324 80218134 0000202D */ daddu $a0, $zero, $zero
/* 4D0328 80218138 AFBF0014 */ sw $ra, 0x14($sp)
/* 4D032C 8021813C 0C0B1EAF */ jal get_variable
/* 4D0330 80218140 AE000084 */ sw $zero, 0x84($s0)
/* 4D0334 80218144 28420008 */ slti $v0, $v0, 8
/* 4D0338 80218148 14400002 */ bnez $v0, .L80218154
/* 4D033C 8021814C 24020001 */ addiu $v0, $zero, 1
/* 4D0340 80218150 AE020084 */ sw $v0, 0x84($s0)
.L80218154:
/* 4D0344 80218154 8FBF0014 */ lw $ra, 0x14($sp)
/* 4D0348 80218158 8FB00010 */ lw $s0, 0x10($sp)
/* 4D034C 8021815C 24020002 */ addiu $v0, $zero, 2
/* 4D0350 80218160 03E00008 */ jr $ra
/* 4D0354 80218164 27BD0018 */ addiu $sp, $sp, 0x18
/* 4D0358 80218168 00000000 */ nop
/* 4D035C 8021816C 00000000 */ nop

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218170_4D0360
/* 4D0360 80218170 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 4D0364 80218174 AFB00010 */ sw $s0, 0x10($sp)
/* 4D0368 80218178 0080802D */ daddu $s0, $a0, $zero
/* 4D036C 8021817C 3C05F5DE */ lui $a1, 0xf5de
/* 4D0370 80218180 34A501FB */ ori $a1, $a1, 0x1fb
/* 4D0374 80218184 0000202D */ daddu $a0, $zero, $zero
/* 4D0378 80218188 AFBF0014 */ sw $ra, 0x14($sp)
/* 4D037C 8021818C 0C0B1EAF */ jal get_variable
/* 4D0380 80218190 AE000084 */ sw $zero, 0x84($s0)
/* 4D0384 80218194 28420008 */ slti $v0, $v0, 8
/* 4D0388 80218198 14400002 */ bnez $v0, .L802181A4
/* 4D038C 8021819C 24020001 */ addiu $v0, $zero, 1
/* 4D0390 802181A0 AE020084 */ sw $v0, 0x84($s0)
.L802181A4:
/* 4D0394 802181A4 8FBF0014 */ lw $ra, 0x14($sp)
/* 4D0398 802181A8 8FB00010 */ lw $s0, 0x10($sp)
/* 4D039C 802181AC 24020002 */ addiu $v0, $zero, 2
/* 4D03A0 802181B0 03E00008 */ jr $ra
/* 4D03A4 802181B4 27BD0018 */ addiu $sp, $sp, 0x18
/* 4D03A8 802181B8 00000000 */ nop
/* 4D03AC 802181BC 00000000 */ nop

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802181C0_4D03B0
/* 4D03B0 802181C0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 4D03B4 802181C4 AFB00010 */ sw $s0, 0x10($sp)
/* 4D03B8 802181C8 0080802D */ daddu $s0, $a0, $zero
/* 4D03BC 802181CC 3C05F5DE */ lui $a1, 0xf5de
/* 4D03C0 802181D0 34A501FB */ ori $a1, $a1, 0x1fb
/* 4D03C4 802181D4 0000202D */ daddu $a0, $zero, $zero
/* 4D03C8 802181D8 AFBF0014 */ sw $ra, 0x14($sp)
/* 4D03CC 802181DC 0C0B1EAF */ jal get_variable
/* 4D03D0 802181E0 AE000084 */ sw $zero, 0x84($s0)
/* 4D03D4 802181E4 28420008 */ slti $v0, $v0, 8
/* 4D03D8 802181E8 14400002 */ bnez $v0, .L802181F4
/* 4D03DC 802181EC 24020001 */ addiu $v0, $zero, 1
/* 4D03E0 802181F0 AE020084 */ sw $v0, 0x84($s0)
.L802181F4:
/* 4D03E4 802181F4 8FBF0014 */ lw $ra, 0x14($sp)
/* 4D03E8 802181F8 8FB00010 */ lw $s0, 0x10($sp)
/* 4D03EC 802181FC 24020002 */ addiu $v0, $zero, 2
/* 4D03F0 80218200 03E00008 */ jr $ra
/* 4D03F4 80218204 27BD0018 */ addiu $sp, $sp, 0x18
/* 4D03F8 80218208 00000000 */ nop
/* 4D03FC 8021820C 00000000 */ nop

View File

@ -2,4 +2,4 @@
#define NAMESPACE b_area_dig
INCLUDE_ASM(s32, "battle/area_dig/6DE1A0", func_802183E0_6DE1A0);
#include "common/IsSaveVar123.inc.c"

View File

@ -2,4 +2,6 @@
#define NAMESPACE b_area_iwa
INCLUDE_ASM(s32, "battle/area_iwa/4D0310", func_80218120_4D0310);
#define NAMESPACE dup_b_area_iwa
#include "common/IsSaveVar123.inc.c"
#define NAMESPACE b_area_iwa

View File

@ -2,4 +2,6 @@
#define NAMESPACE b_area_iwa
INCLUDE_ASM(s32, "battle/area_iwa/4D0360", func_80218170_4D0360);
#define NAMESPACE dup2_b_area_iwa
#include "common/IsSaveVar123.inc.c"
#define NAMESPACE b_area_iwa

View File

@ -2,4 +2,4 @@
#define NAMESPACE b_area_iwa
INCLUDE_ASM(s32, "battle/area_iwa/4D03B0", func_802181C0_4D03B0);
#include "common/IsSaveVar123.inc.c"

View File

@ -0,0 +1,11 @@
#include "common.h"
#include "map.h"
ApiStatus N(IsSaveVar123)(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = 0;
if (get_variable(NULL, SI_SAVE_VAR(123)) >= 8) {
script->varTable[0] = 1;
}
return ApiStatus_DONE2;
}