mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
3 funcz
This commit is contained in:
parent
dff0e55b98
commit
c567c6f83f
@ -1,14 +0,0 @@
|
|||||||
.set noat # allow manual use of $at
|
|
||||||
.set noreorder # don't insert nops after branches
|
|
||||||
|
|
||||||
.include "include/macro.inc"
|
|
||||||
|
|
||||||
glabel has_full_fp
|
|
||||||
/* 08382C 800EA37C 3C038011 */ lui $v1, 0x8011
|
|
||||||
/* 083830 800EA380 2463F290 */ addiu $v1, $v1, -0xd70
|
|
||||||
/* 083834 800EA384 80620006 */ lb $v0, 6($v1)
|
|
||||||
/* 083838 800EA388 80630005 */ lb $v1, 5($v1)
|
|
||||||
/* 08383C 800EA38C 00431026 */ xor $v0, $v0, $v1
|
|
||||||
/* 083840 800EA390 03E00008 */ jr $ra
|
|
||||||
/* 083844 800EA394 2C420001 */ sltiu $v0, $v0, 1
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
.set noat # allow manual use of $at
|
|
||||||
.set noreorder # don't insert nops after branches
|
|
||||||
|
|
||||||
.include "include/macro.inc"
|
|
||||||
|
|
||||||
glabel has_full_hp
|
|
||||||
/* 083810 800EA360 3C038011 */ lui $v1, 0x8011
|
|
||||||
/* 083814 800EA364 2463F290 */ addiu $v1, $v1, -0xd70
|
|
||||||
/* 083818 800EA368 80620003 */ lb $v0, 3($v1)
|
|
||||||
/* 08381C 800EA36C 80630002 */ lb $v1, 2($v1)
|
|
||||||
/* 083820 800EA370 00431026 */ xor $v0, $v0, $v1
|
|
||||||
/* 083824 800EA374 03E00008 */ jr $ra
|
|
||||||
/* 083828 800EA378 2C420001 */ sltiu $v0, $v0, 1
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
.set noat # allow manual use of $at
|
|
||||||
.set noreorder # don't insert nops after branches
|
|
||||||
|
|
||||||
.include "include/macro.inc"
|
|
||||||
|
|
||||||
glabel is_partner_ability_active
|
|
||||||
/* 083568 800EA0B8 03E00008 */ jr $ra
|
|
||||||
/* 08356C 800EA0BC 0000102D */ daddu $v0, $zero, $zero
|
|
||||||
|
|
@ -39,6 +39,27 @@ typedef struct {
|
|||||||
/* 0x168 */ s32 unk_168;
|
/* 0x168 */ s32 unk_168;
|
||||||
} game_status;
|
} game_status;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/* 0x000 */ s8 bootsLevel;
|
||||||
|
/* 0x001 */ s8 hammerLevel;
|
||||||
|
/* 0x002 */ s8 curHP;
|
||||||
|
/* 0x003 */ s8 curMaxHP;
|
||||||
|
/* 0x004 */ s8 hardMaxHP;
|
||||||
|
/* 0x005 */ s8 curFP;
|
||||||
|
/* 0x006 */ s8 curMaxFP;
|
||||||
|
/* 0x007 */ s8 hardMaxFP;
|
||||||
|
/* 0x008 */ s8 maxBP;
|
||||||
|
/* 0x009 */ s8 level;
|
||||||
|
/* 0x00A */ s8 hasActionCommands;
|
||||||
|
/* 0x00B */ char unk_0B[0x1];
|
||||||
|
/* 0x00C */ s16 coins;
|
||||||
|
/* 0x00E */ s8 fortressKeyCount;
|
||||||
|
/* 0x00F */ s8 starPieces;
|
||||||
|
/* 0x010 */ s8 starPoints;
|
||||||
|
/* 0x011 */ char unk_11[0x1];
|
||||||
|
/* 0x012 */ s8 currentPartner;
|
||||||
|
} player_data;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0x00 */ char unk_00[0xC];
|
/* 0x00 */ char unk_00[0xC];
|
||||||
/* 0x0C */ s32* ptrReadPos;
|
/* 0x0C */ s32* ptrReadPos;
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "ultra64.h"
|
#include "ultra64.h"
|
||||||
#include "common_structs.h"
|
#include "common_structs.h"
|
||||||
|
|
||||||
|
extern player_data gPlayerData;
|
||||||
extern game_status* gGameStatusPtr[1];
|
extern game_status* gGameStatusPtr[1];
|
||||||
extern s16* D_80151328;
|
extern s16* D_80151328;
|
||||||
|
|
||||||
|
@ -106,7 +106,9 @@ INCLUDE_ASM(code_80850_len_3060, reset_status_menu);
|
|||||||
|
|
||||||
INCLUDE_ASM(code_80850_len_3060, is_ability_active);
|
INCLUDE_ASM(code_80850_len_3060, is_ability_active);
|
||||||
|
|
||||||
INCLUDE_ASM(code_80850_len_3060, is_partner_ability_active);
|
s32 is_partner_ability_active(void) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(code_80850_len_3060, add_coins);
|
INCLUDE_ASM(code_80850_len_3060, add_coins);
|
||||||
|
|
||||||
@ -126,13 +128,38 @@ INCLUDE_ASM(code_80850_len_3060, recover_hp);
|
|||||||
|
|
||||||
INCLUDE_ASM(code_80850_len_3060, subtract_hp);
|
INCLUDE_ASM(code_80850_len_3060, subtract_hp);
|
||||||
|
|
||||||
INCLUDE_ASM(code_80850_len_3060, has_full_hp);
|
s8 has_full_hp(void) {
|
||||||
|
player_data* playerData = &gPlayerData;
|
||||||
|
|
||||||
INCLUDE_ASM(code_80850_len_3060, has_full_fp);
|
return playerData->curMaxHP == playerData->curHP;
|
||||||
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(code_80850_len_3060, add_fortress_keys);
|
s8 has_full_fp(void) {
|
||||||
|
player_data* playerData = &gPlayerData;
|
||||||
|
|
||||||
|
return playerData->curMaxFP == playerData->curFP;
|
||||||
|
}
|
||||||
|
|
||||||
|
s8 add_fortress_keys(s32 amt) {
|
||||||
|
player_data* playerData = &gPlayerData;
|
||||||
|
|
||||||
|
playerData->fortressKeyCount += amt;
|
||||||
|
return playerData->fortressKeyCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
s8 subtract_fortress_keys(s32 amt) {
|
||||||
|
player_data* playerData = &gPlayerData;
|
||||||
|
//player_data* new_var = playerData;
|
||||||
|
|
||||||
|
playerData->fortressKeyCount -= amt;
|
||||||
|
if (playerData->fortressKeyCount < 0) {
|
||||||
|
playerData->fortressKeyCount = 0;
|
||||||
|
}
|
||||||
|
return playerData->fortressKeyCount;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
INCLUDE_ASM(code_80850_len_3060, subtract_fortress_keys);
|
INCLUDE_ASM(code_80850_len_3060, subtract_fortress_keys);
|
||||||
|
|
||||||
INCLUDE_ASM(code_80850_len_3060, get_fortress_key_count);
|
INCLUDE_ASM(code_80850_len_3060, get_fortress_key_count);
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
gGameStatusPtr = 0x8007419C;
|
gGameStatusPtr = 0x8007419C;
|
||||||
|
gPlayerData = 0x8010F290;
|
||||||
|
|
||||||
D_000759B0 = 0x000759B0;
|
D_000759B0 = 0x000759B0;
|
||||||
D_000759B0_end = 0x000A5DD0;
|
D_000759B0_end = 0x000A5DD0;
|
||||||
|
Loading…
Reference in New Issue
Block a user