mirror of
https://github.com/pmret/papermario.git
synced 2024-11-18 08:52:40 +01:00
3 more!
This commit is contained in:
parent
c2b92e63f9
commit
9ffef56c43
@ -1,22 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
.include "include/macro.inc"
|
||||
|
||||
glabel get_item_count
|
||||
/* 080A9C 800E75EC 0000202D */ daddu $a0, $zero, $zero
|
||||
/* 080AA0 800E75F0 0080282D */ daddu $a1, $a0, $zero
|
||||
/* 080AA4 800E75F4 3C038011 */ lui $v1, 0x8011
|
||||
/* 080AA8 800E75F8 2463F290 */ addiu $v1, $v1, -0xd70
|
||||
.L800E75FC:
|
||||
/* 080AAC 800E75FC 846201B4 */ lh $v0, 0x1b4($v1)
|
||||
/* 080AB0 800E7600 54400001 */ bnezl $v0, .L800E7608
|
||||
/* 080AB4 800E7604 24A50001 */ addiu $a1, $a1, 1
|
||||
.L800E7608:
|
||||
/* 080AB8 800E7608 24840001 */ addiu $a0, $a0, 1
|
||||
/* 080ABC 800E760C 2882000A */ slti $v0, $a0, 0xa
|
||||
/* 080AC0 800E7610 1440FFFA */ bnez $v0, .L800E75FC
|
||||
/* 080AC4 800E7614 24630002 */ addiu $v1, $v1, 2
|
||||
/* 080AC8 800E7618 03E00008 */ jr $ra
|
||||
/* 080ACC 800E761C 00A0102D */ daddu $v0, $a1, $zero
|
||||
|
@ -1,16 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
.include "include/macro.inc"
|
||||
|
||||
glabel get_item_empty_count
|
||||
/* 080AD0 800E7620 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 080AD4 800E7624 AFBF0010 */ sw $ra, 0x10($sp)
|
||||
/* 080AD8 800E7628 0C039D7B */ jal get_item_count
|
||||
/* 080ADC 800E762C 00000000 */ nop
|
||||
/* 080AE0 800E7630 2403000A */ addiu $v1, $zero, 0xa
|
||||
/* 080AE4 800E7634 8FBF0010 */ lw $ra, 0x10($sp)
|
||||
/* 080AE8 800E7638 00621023 */ subu $v0, $v1, $v0
|
||||
/* 080AEC 800E763C 03E00008 */ jr $ra
|
||||
/* 080AF0 800E7640 27BD0018 */ addiu $sp, $sp, 0x18
|
||||
|
@ -1,22 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
.include "include/macro.inc"
|
||||
|
||||
glabel get_stored_count
|
||||
/* 080CC4 800E7814 0000202D */ daddu $a0, $zero, $zero
|
||||
/* 080CC8 800E7818 0080282D */ daddu $a1, $a0, $zero
|
||||
/* 080CCC 800E781C 3C038011 */ lui $v1, 0x8011
|
||||
/* 080CD0 800E7820 2463F290 */ addiu $v1, $v1, -0xd70
|
||||
.L800E7824:
|
||||
/* 080CD4 800E7824 846201C8 */ lh $v0, 0x1c8($v1)
|
||||
/* 080CD8 800E7828 54400001 */ bnezl $v0, .L800E7830
|
||||
/* 080CDC 800E782C 24A50001 */ addiu $a1, $a1, 1
|
||||
.L800E7830:
|
||||
/* 080CE0 800E7830 24840001 */ addiu $a0, $a0, 1
|
||||
/* 080CE4 800E7834 28820020 */ slti $v0, $a0, 0x20
|
||||
/* 080CE8 800E7838 1440FFFA */ bnez $v0, .L800E7824
|
||||
/* 080CEC 800E783C 24630002 */ addiu $v1, $v1, 2
|
||||
/* 080CF0 800E7840 03E00008 */ jr $ra
|
||||
/* 080CF4 800E7844 00A0102D */ daddu $v0, $a1, $zero
|
||||
|
@ -117,6 +117,64 @@ typedef struct {
|
||||
/* 0x33E */ char unk_33E[0x2];
|
||||
} player_data; // size = 0x340
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 hpIconIndex;
|
||||
/* 0x04 */ s32 heartIconIndex;
|
||||
/* 0x08 */ s32 fpIconIndex;
|
||||
/* 0x0C */ s32 flowerIconIndex;
|
||||
/* 0x10 */ s32 coinIconIndex;
|
||||
/* 0x14 */ s32 coinIconIndex2;
|
||||
/* 0x18 */ s32 starpointsIconIndex;
|
||||
/* 0x1C */ s32 starpointsIconIndex2;
|
||||
/* 0x20 */ s32 iconIndex8;
|
||||
/* 0x24 */ s32 iconIndex9;
|
||||
/* 0x28 */ s32 iconIndexA;
|
||||
/* 0x2C */ s32 iconIndexB;
|
||||
/* 0x30 */ s32 iconIndexC;
|
||||
/* 0x34 */ s16 drawPosX; /* overall x-offset for whole UI */
|
||||
/* 0x36 */ s16 drawPosY; /* modulated as it appears, goes away */
|
||||
/* 0x38 */ s16 showTimer;
|
||||
/* 0x3A */ s8 hidden;
|
||||
/* 0x3B */ s8 unk_3B;
|
||||
/* 0x3C */ s8 unk_3C;
|
||||
/* 0x3D */ s8 displayHP;
|
||||
/* 0x3E */ s8 displayFP;
|
||||
/* 0x3F */ char unk_3F;
|
||||
/* 0x40 */ s16 displayCounts;
|
||||
/* 0x42 */ s16 displayStarpoints;
|
||||
/* 0x44 */ s8 igonreChanges; /* set != 0 to prevent automatic opening from HP/FP changes */
|
||||
/* 0x45 */ s8 unk_45;
|
||||
/* 0x46 */ s8 unk_46;
|
||||
/* 0x47 */ s8 disabled; /* set != 0 for menu to be disabled completely */
|
||||
/* 0x48 */ s16 displaySP;
|
||||
/* 0x4A */ s8 hpBlinking;
|
||||
/* 0x4B */ s8 hpBlinkCounter;
|
||||
/* 0x4C */ s8 hpBlinkTimer;
|
||||
/* 0x4D */ s8 fpBlinking;
|
||||
/* 0x4E */ s8 fpBlinkCounter;
|
||||
/* 0x4F */ s8 fpBlinkTimer;
|
||||
/* 0x50 */ s8 spBlinking;
|
||||
/* 0x51 */ s8 spBlinkCounter;
|
||||
/* 0x52 */ s8 starpointsBlinking;
|
||||
/* 0x53 */ s8 starpointsBlinkCounter;
|
||||
/* 0x54 */ s8 coinsBlinking;
|
||||
/* 0x55 */ s8 coinsBlinkCounter;
|
||||
/* 0x56 */ s8 coinsBlinkTimer;
|
||||
/* 0x57 */ s8 unk_57;
|
||||
/* 0x58 */ s8 unk_58;
|
||||
/* 0x59 */ s8 unk_59;
|
||||
/* 0x5A */ s8 spBarsToBlink; /* how many sp bars to blink */
|
||||
/* 0x5B */ char unk_5B;
|
||||
/* 0x5C */ s32 iconIndex10;
|
||||
/* 0x60 */ s32 iconIndex11;
|
||||
/* 0x64 */ s32 iconIndex12;
|
||||
/* 0x68 */ s32 iconIndex13;
|
||||
/* 0x6C */ s8 unk_6C;
|
||||
/* 0x6D */ s8 unk_6D;
|
||||
/* 0x6E */ s8 unk_6E;
|
||||
/* 0x6F */ char unk_6F;
|
||||
} ui_status; // size = 0x70
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ char unk_00[0xC];
|
||||
/* 0x0C */ s32* ptrReadPos;
|
||||
|
@ -4,4 +4,7 @@
|
||||
#define INCLUDE_ASM(FOLDER, NAME, ARGS...) \
|
||||
__attribute__((naked)) NAME(ARGS) { __asm__( ".include \"asm/nonmatchings/"#FOLDER"/"#NAME".s\"\n.set reorder"); }
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
||||
#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "ultra64.h"
|
||||
#include "common_structs.h"
|
||||
|
||||
extern ui_status gUIStatus;
|
||||
extern player_data gPlayerData;
|
||||
extern game_status* gGameStatusPtr[1];
|
||||
extern s16* D_80151328;
|
||||
|
@ -12,13 +12,13 @@ s32 add_item(s32 itemID) {
|
||||
|
||||
sort_items();
|
||||
|
||||
for(i = 0; i < 10; i++) {
|
||||
for(i = 0; i < ARRAY_COUNT(gPlayerData.invItems); i++) {
|
||||
if (playerData->invItems[i] == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 10) {
|
||||
if (i == ARRAY_COUNT(gPlayerData.invItems)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -26,9 +26,23 @@ s32 add_item(s32 itemID) {
|
||||
return i;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_80850_len_3060, get_item_count);
|
||||
s32 get_item_count(void) {
|
||||
player_data *playerData = &gPlayerData;
|
||||
s32 i = 0;
|
||||
s32 sum = 0;
|
||||
|
||||
INCLUDE_ASM(code_80850_len_3060, get_item_empty_count);
|
||||
for (i; i < ARRAY_COUNT(gPlayerData.invItems); i++) {
|
||||
if (playerData->invItems[i] != 0) {
|
||||
sum++;
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
s32 get_item_empty_count(void) {
|
||||
return ARRAY_COUNT(gPlayerData.invItems) - get_item_count();
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_80850_len_3060, find_item);
|
||||
|
||||
@ -36,12 +50,41 @@ INCLUDE_ASM(code_80850_len_3060, sort_items);
|
||||
|
||||
INCLUDE_ASM(code_80850_len_3060, add_badge);
|
||||
|
||||
INCLUDE_ASM(code_80850_len_3060, store_item);
|
||||
s32 store_item(s32 itemID) {
|
||||
player_data *playerData = &gPlayerData;
|
||||
s32 i;
|
||||
|
||||
INCLUDE_ASM(code_80850_len_3060, get_stored_count);
|
||||
for (i = 0; i < ARRAY_COUNT(gPlayerData.storedItems); i++) {
|
||||
if (playerData->storedItems[i] == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == ARRAY_COUNT(gPlayerData.storedItems)) {
|
||||
return -1;
|
||||
} else {
|
||||
playerData->storedItems[i] = itemID;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
s32 get_stored_count(void) {
|
||||
player_data *playerData = &gPlayerData;
|
||||
s32 i = 0;
|
||||
s32 sum = 0;
|
||||
|
||||
for (i; i < ARRAY_COUNT(gPlayerData.storedItems); i++) {
|
||||
if (playerData->storedItems[i] != 0) {
|
||||
sum++;
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
s32 get_stored_empty_count(void) {
|
||||
return 32 - get_stored_count();
|
||||
return ARRAY_COUNT(gPlayerData.storedItems) - get_stored_count();
|
||||
}
|
||||
|
||||
INCLUDE_ASM(code_80850_len_3060, enforce_hpfp_limits);
|
||||
@ -210,32 +253,6 @@ void set_max_SP(s8 newMaxSP) {
|
||||
|
||||
INCLUDE_ASM(code_80850_len_3060, add_SP);
|
||||
|
||||
/*u16 add_SP(s32 arg0) {
|
||||
player_data* playerData = &gPlayerData;
|
||||
s16 temp_v0_2;
|
||||
s8 temp_v1;
|
||||
u16 temp_v0;
|
||||
s32 phi_v1;
|
||||
|
||||
(void *)0x8010EF58->unk57 = (u8)1;
|
||||
(void *)0x8010EF58->unk58 = (u8)0x3C;
|
||||
phi_v1 = playerData->specialBarsFilled;
|
||||
if (playerData->specialBarsFilled < 0) {
|
||||
phi_v1 = playerData->specialBarsFilled + 31;
|
||||
}
|
||||
(void *)0x8010EF58->unk59 = (s8) (phi_v1 >> 5);
|
||||
playerData->specialBarsFilled += arg0;
|
||||
|
||||
temp_v1 = playerData->maxStarPower;
|
||||
playerData->specialBarsFilled = temp_v1;
|
||||
if (temp_v1 >= arg0) {
|
||||
|
||||
}
|
||||
temp_v0 = playerData->specialBarsFilled;
|
||||
(void *)0x8010EF58->unk48 = temp_v0;
|
||||
return temp_v0;
|
||||
}*/
|
||||
|
||||
s32 recover_fp(s32 amt) {
|
||||
player_data* playerData = &gPlayerData;
|
||||
s32 newFP = playerData->curFP;
|
||||
|
@ -1,4 +1,5 @@
|
||||
gGameStatusPtr = 0x8007419C;
|
||||
gUIStatus = 0x8010EF58;
|
||||
gPlayerData = 0x8010F290;
|
||||
|
||||
D_000759B0 = 0x000759B0;
|
||||
|
Loading…
Reference in New Issue
Block a user