mirror of https://github.com/zeldaret/tmc.git
parent
cf72e7b2d3
commit
299ca4abd6
|
|
@ -1232,8 +1232,8 @@ bool32 sub_080A5F24(void) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef union{
|
typedef union {
|
||||||
struct{
|
struct {
|
||||||
s32 v1;
|
s32 v1;
|
||||||
s32 v2;
|
s32 v2;
|
||||||
} values;
|
} values;
|
||||||
|
|
@ -1243,8 +1243,8 @@ typedef union{
|
||||||
void sub_080A5F48(Item item, u32 offset) {
|
void sub_080A5F48(Item item, u32 offset) {
|
||||||
// this funcitons signature allows the div function to return a u64 (2x 32 bit registers)
|
// this funcitons signature allows the div function to return a u64 (2x 32 bit registers)
|
||||||
// with the result in one register and the remainder in the other
|
// with the result in one register and the remainder in the other
|
||||||
typedef u64 DivRem (u32, u32);
|
typedef u64 DivRem(u32, u32);
|
||||||
|
|
||||||
s32 ammoCount;
|
s32 ammoCount;
|
||||||
s32 onesDigit;
|
s32 onesDigit;
|
||||||
s32 tensDigit;
|
s32 tensDigit;
|
||||||
|
|
@ -1260,7 +1260,7 @@ void sub_080A5F48(Item item, u32 offset) {
|
||||||
case ITEM_BOTTLE4:
|
case ITEM_BOTTLE4:
|
||||||
item = gSave.stats.bottles[item - ITEM_BOTTLE1];
|
item = gSave.stats.bottles[item - ITEM_BOTTLE1];
|
||||||
}
|
}
|
||||||
|
|
||||||
dest = OBJ_VRAM0 + (offset * 0x20);
|
dest = OBJ_VRAM0 + (offset * 0x20);
|
||||||
index = gSpriteAnimations_322[item]->index;
|
index = gSpriteAnimations_322[item]->index;
|
||||||
temp2 = &gMoreSpritePtrs[1][index * 2];
|
temp2 = &gMoreSpritePtrs[1][index * 2];
|
||||||
|
|
@ -1278,14 +1278,14 @@ void sub_080A5F48(Item item, u32 offset) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ammoCount < 0)
|
if (ammoCount < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ret.raw = ((DivRem*)Div)(ammoCount,10); // by casting to DivRem, we can recover the remainder from the Div call
|
ret.raw = ((DivRem*)Div)(ammoCount, 10); // by casting to DivRem, we can recover the remainder from the Div call
|
||||||
onesDigit = ret.values.v2;
|
onesDigit = ret.values.v2;
|
||||||
tensDigit = ret.values.v1;
|
tensDigit = ret.values.v1;
|
||||||
|
|
||||||
if (tensDigit >= 10)
|
if (tensDigit >= 10)
|
||||||
tensDigit = 9;
|
tensDigit = 9;
|
||||||
|
|
||||||
DmaCopy32(3, gUnk_085C4620 + tensDigit * 0x8, dest, 0x8 * 4);
|
DmaCopy32(3, gUnk_085C4620 + tensDigit * 0x8, dest, 0x8 * 4);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue