fox32rom: Add %x support to draw_format_str

main
Ry 2022-04-01 16:12:33 -07:00
parent 16399b2f27
commit 0c889859de
1 changed files with 12 additions and 0 deletions

View File

@ -139,6 +139,10 @@ draw_format_str_generic_found_format_specifier:
cmp.8 [r0], 'u'
ifz call draw_format_str_generic_unsigned_decimal
; hex
cmp.8 [r0], 'x'
ifz call draw_format_str_generic_hex
inc r0
jmp draw_format_str_generic_loop
draw_format_str_generic_percent_sign:
@ -166,6 +170,14 @@ draw_format_str_generic_unsigned_decimal:
pop r0
inc r16
ret
draw_format_str_generic_hex:
call draw_format_str_generic_get_parameter
push r0
mov r0, r17
call draw_hex_generic
pop r0
inc r16
ret
draw_format_str_generic_get_parameter:
; load the correct format parameter into r17
; this is messy, but i don't know of any other way to do this at the moment