Improve some equipment function matches based on saturn port (#340)

This commit is contained in:
sozud 2023-07-09 12:04:50 -07:00 committed by GitHub
parent f7896127ac
commit 31715f6993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 23 deletions

View File

@ -264,8 +264,8 @@ func_800FD5BC = 0x800FD570;
func_800FD664 = 0x800FD618;
GetEquipItemCategory = 0x800FD63C;
func_800FD6C4 = 0x800FD678;
func_800FD744 = 0x800FD6F8;
func_800FD760 = 0x800FD714;
GetEquipOrder = 0x800FD6F8;
GetEquipCount = 0x800FD714;
GetEquipmentName = 0x800FD730;
CheckEquipmentItemCount = 0x800FD774;
AddToInventory = 0x800FD828;

View File

@ -954,6 +954,8 @@ DrawConsumableCount = 0x800F8E18;
LoadWeaponPrg = 0x800FA8C4;
func_800FD39C = 0x800FD39C;
GetEquipItemCategory = 0x800FD688;
GetEquipOrder = 0x800FD744;
GetEquipCount = 0x800FD760;
GetEquipmentName = 0x800FD77C;
CheckEquipmentItemCount = 0x800FD7C0;
AddToInventory = 0x800FD874;

View File

@ -1077,8 +1077,8 @@ void func_800F8990(MenuContext* ctx, s32 x, s32 y) {
s32 idx;
new_var = &D_801375CC.equipTypeFilter;
sp20 = func_800FD744(*new_var);
equipsAmount = func_800FD760(*new_var);
sp20 = GetEquipOrder(*new_var);
equipsAmount = GetEquipCount(*new_var);
totalItemCount = func_800FD6C4(*new_var);
curX = 0;
curY = 0;
@ -1473,7 +1473,7 @@ void func_800FB160(s32 arg0, s32 arg1, s32 equipType) {
u8 swap;
u8* equipOrder;
equipOrder = func_800FD744(equipType);
equipOrder = GetEquipOrder(equipType);
swap = equipOrder[D_801375D8[arg0]];
equipOrder[D_801375D8[arg0]] = equipOrder[D_801375D8[arg1]];
equipOrder[D_801375D8[arg1]] = swap;

View File

@ -39,20 +39,18 @@ s32 func_800FD6C4(s32 equipTypeFilter) {
const u32 rodataPadding_jpt_800FD6E0 = 0;
u8* func_800FD744(s32 equipTypeFilter) {
u8* begin = g_Status.equipHandOrder;
if (equipTypeFilter != 0) {
begin += sizeof(g_Status.equipHandOrder);
u8* GetEquipOrder(s32 equipTypeFilter) {
if (equipTypeFilter == 0) {
return g_Status.equipHandOrder;
}
return begin;
return g_Status.equipBodyOrder;
}
u8* func_800FD760(s32 equipTypeFilter) {
s8* begin = &g_Status.equipHandCount;
if (equipTypeFilter != 0) {
begin += sizeof(g_Status.equipHandCount);
u8* GetEquipCount(s32 equipTypeFilter) {
if (equipTypeFilter == 0) {
return g_Status.equipHandCount;
}
return begin;
return g_Status.equipBodyCount;
}
const char* GetEquipmentName(s32 equipTypeFilter, s32 equipId) {
@ -98,8 +96,8 @@ void AddToInventory(u16 itemId, s32 itemCategory) {
long i;
s32 phi_a1;
s32 phi_a1_2;
u8* cursorY = func_800FD744(itemCategory);
u8* itemArray = func_800FD760(itemCategory);
u8* cursorY = GetEquipOrder(itemCategory);
u8* itemArray = GetEquipCount(itemCategory);
if (itemArray[itemId] < 99) {
temp_a1 = itemArray[itemId];
itemArray[itemId]++;

View File

@ -709,8 +709,8 @@ void func_800FAF44(s32);
s32 func_800FD4C0(s32 bossId, s32 action);
s32 func_800FD664(s32 arg0);
s32 func_800FD6C4(s32 equipTypeFilter);
u8* func_800FD744(s32 equipTypeFilter);
u8* func_800FD760(s32 equipTypeFilter);
u8* GetEquipOrder(s32 equipTypeFilter);
u8* GetEquipCount(s32 equipTypeFilter);
const char* GetEquipmentName(s32 equipTypeFilter, s32 equipId);
u32 CheckEquipmentItemCount(u32 itemId, u32 equipType);
void AddToInventory(u16 itemId, s32 itemCategory);

View File

@ -149,8 +149,7 @@ s32 func_800FD6C4(s32 equipTypeFilter) {
}
// SAT: func_0606F3D8
// same as PSX but better match?
u8* func_800FD744(s32 equipTypeFilter) {
u8* GetEquipOrder(s32 equipTypeFilter) {
if (equipTypeFilter == 0) {
return g_Status.equipHandOrder;
}
@ -158,8 +157,7 @@ u8* func_800FD744(s32 equipTypeFilter) {
}
// SAT: func_0606F3F8
// better match like above?
u8* func_800FD760(s32 equipTypeFilter) {
u8* GetEquipCount(s32 equipTypeFilter) {
if (equipTypeFilter == 0) {
return g_Status.equipHandCount;
}