Decomp ItemManager::SetShipPartCount

This commit is contained in:
Aetias
2024-02-18 11:40:14 +01:00
parent 90c42ba870
commit 2c46503ca1
6 changed files with 15 additions and 28 deletions
+4 -4
View File
@@ -895,7 +895,7 @@
.extern _ZNK11ItemManager19GetEquippedShipPartEj
.extern _ZN11ItemManager13EquipShipPartEjj
.extern _ZNK11ItemManager16GetShipPartCountEjj
.extern _ZN11ItemManager16SetShipPartCountEjjj
.extern _ZN11ItemManager16SetShipPartCountEjjc
.extern gItemManager
.extern _ZNK11ItemManager19GetEquippedShipPartEj
.extern _ZN11ItemManager13EquipShipPartEjj
@@ -927,16 +927,16 @@
.extern gItemManager
.extern _ZN11ItemManager10GiveRupeesEjj
.extern _ZNK11ItemManager16GetShipPartCountEjj
.extern _ZN11ItemManager16SetShipPartCountEjjj
.extern _ZN11ItemManager16SetShipPartCountEjjc
.extern gItemManager
.extern _ZN11ItemManager10GiveRupeesEjj
.extern _ZNK11ItemManager16GetTreasureCountEj
.extern _ZN11ItemManager16SetTreasureCountEjj
.extern gItemManager
.extern _ZNK11ItemManager16GetShipPartCountEjj
.extern _ZN11ItemManager16SetShipPartCountEjjj
.extern _ZN11ItemManager16SetShipPartCountEjjc
.extern _ZNK11ItemManager16GetShipPartCountEjj
.extern _ZN11ItemManager16SetShipPartCountEjjj
.extern _ZN11ItemManager16SetShipPartCountEjjc
.extern gItemManager
.extern gOverlayManager
.extern data_027e1058
+1 -1
View File
@@ -521,7 +521,7 @@
.extern func_ov09_02118028
.extern func_ov09_02118028
.extern _ZNK11ItemManager16GetShipPartCountEjj
.extern _ZN11ItemManager16SetShipPartCountEjjj
.extern _ZN11ItemManager16SetShipPartCountEjjc
.extern data_ov09_0211f52c
.extern gItemManager
.extern func_ov09_02113f40
-18
View File
@@ -3,24 +3,6 @@
.text
.global _ZN11ItemManager16SetShipPartCountEjjj
thumb_func_start _ZN11ItemManager16SetShipPartCountEjjj
_ZN11ItemManager16SetShipPartCountEjjj: ; 0x020ad900
push {r3, r4}
cmp r3, #0x63
ble _020ad908
mov r3, #0x63
_020ad908:
lsl r4, r1, #3
add r1, r1, r4
add r0, r0, r1
add r0, r0, r2
add r0, #0x48
strb r3, [r0]
pop {r3, r4}
bx lr
thumb_func_end _ZN11ItemManager16SetShipPartCountEjjj
.global _ZNK11ItemManager16GetTreasureCountEj
thumb_func_start _ZNK11ItemManager16GetTreasureCountEj
_ZNK11ItemManager16GetTreasureCountEj: ; 0x020ad918
+4 -4
View File
@@ -16982,7 +16982,7 @@ _0211c6d8:
add r1, r5, #0
mov r2, #0
mov r3, #1
bl _ZN11ItemManager16SetShipPartCountEjjj
bl _ZN11ItemManager16SetShipPartCountEjjc
_0211c6f2:
add r5, r5, #1
cmp r5, #8
@@ -17428,7 +17428,7 @@ func_ov09_0211c9a8: ; 0x0211c9a8
add r1, r5, #0
add r2, r4, #0
asr r3, r3, #0x18
bl _ZN11ItemManager16SetShipPartCountEjjj
bl _ZN11ItemManager16SetShipPartCountEjjc
pop {r4, r5, r6, pc}
nop
thumb_func_end func_ov09_0211c9a8
@@ -17496,7 +17496,7 @@ _0211ca3c:
ldr r0, [r0]
add r2, r4, #0
mov r3, #1
bl _ZN11ItemManager16SetShipPartCountEjjj
bl _ZN11ItemManager16SetShipPartCountEjjc
b _0211ca7c
_0211ca5c:
ldr r0, _0211caa8 ; =gItemManager
@@ -17512,7 +17512,7 @@ _0211ca5c:
add r1, r5, #0
add r2, r4, #0
asr r3, r3, #0x18
bl _ZN11ItemManager16SetShipPartCountEjjj
bl _ZN11ItemManager16SetShipPartCountEjjc
_0211ca7c:
ldr r0, _0211caac ; =data_ov09_0211f294
str r5, [r0]
+1 -1
View File
@@ -6182,7 +6182,7 @@ func_ov45_0218e010: ; 0x0218e010
sub r3, r3, #1
mov r3, r3, lsl #0x18
mov r3, r3, asr #0x18
blx _ZN11ItemManager16SetShipPartCountEjjj
blx _ZN11ItemManager16SetShipPartCountEjjc
ldmia sp!, {r4, r5, r6, pc}
.align 2, 0
arm_func_end func_ov45_0218e010
+5
View File
@@ -283,3 +283,8 @@ THUMB void ItemManager::EquipShipPart(ShipPart part, ShipType type) {
THUMB s8 ItemManager::GetShipPartCount(ShipPart part, ShipType type) const {
return this->mShipParts[part][type];
}
THUMB void ItemManager::SetShipPartCount(ShipPart part, ShipType type, s8 count) {
if (count > 99) count = 99;
this->mShipParts[part][type] = count;
}