Skip to content

Commit 30301d0

Browse files
committed
Small changes to asmFontDrawMessageMtxHandleCommand
1 parent 1a9bd39 commit 30301d0

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed
Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
.global asmFontDrawMessageMtxHandleCommand
22

3-
#ifdef TTYD_US
4-
AddressToJumpTo = 0x80075D84
5-
#elif defined TTYD_JP
6-
AddressToJumpTo = 0x80074AC0
7-
#elif defined TTYD_EU
8-
AddressToJumpTo = 0x80077040
9-
#endif
10-
113
asmFontDrawMessageMtxHandleCommand:
124
# Restore the original instruction
135
mr %r24,%r0
@@ -20,20 +12,15 @@ addi %r3,%sp,0x180 # command # -> 0x170 + 0x10
2012
addi %r4,%sp,0x100 # commandValueString # -> 0xF0 + 0x10
2113
bl fontDrawMessageMtxHandleCommand
2214

23-
# Check the returned value
24-
cmpwi %r3,0 # False
25-
2615
lwz %r0,0x14(%sp)
2716
mtlr %r0
2817
addi %sp,%sp,0x10
29-
bne- jumpPastOtherCommands
3018

31-
# r3 is needed, so restore the original value for it
19+
# Check the returned value
20+
cmpwi %r3,0 # False
21+
22+
# r3 is needed if False is returned, so restore the original value for it
3223
addi %r3,%sp,0x170
33-
blr
24+
beqlr+
3425

35-
jumpPastOtherCommands:
36-
lis %r3,AddressToJumpTo@h
37-
ori %r3,%r3,AddressToJumpTo@l
38-
mtctr %r3
39-
bctr
26+
b (FontDrawMessageMtx + 0x45C) # 0x45C offset is the same for all retail versions

ttyd-tools/rel/source/draw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void drawIconFromItem(int32_t posX, int32_t posY, int16_t itemNum, float scale)
280280
}
281281
}
282282

283-
return drawIcon(posX, posY, iconNum, scale);
283+
drawIcon(posX, posY, iconNum, scale);
284284
}
285285

286286
// Set width to a negative value to not have a width limit

0 commit comments

Comments
 (0)