2017-03-26 00:14:50 +00:00
|
|
|
//=============================================================================
|
|
|
|
// void print_string_hlight_pixels(WINDOW* window, char* str, int x,
|
|
|
|
// int y, bool highlight)
|
|
|
|
// In:
|
|
|
|
// r0: window
|
|
|
|
// r1: address of string to print
|
|
|
|
// r2: x (pixel)
|
|
|
|
// r3: y (pixel)
|
|
|
|
// sp: highlight
|
|
|
|
// Out:
|
|
|
|
// r0: number of characters printed
|
|
|
|
// r1: number of pixels printed
|
|
|
|
//=============================================================================
|
|
|
|
|
2017-03-29 05:19:51 +01:00
|
|
|
print_string_hlight_pixels:
|
2017-03-26 00:14:50 +00:00
|
|
|
// Copied from C96F0
|
|
|
|
// Basically it's the exact same subroutine, only in pixels instead of tiles
|
|
|
|
push {r4-r7,lr}
|
|
|
|
mov r7,r8
|
|
|
|
push {r7}
|
|
|
|
mov r6,r1
|
2017-03-29 05:19:51 +01:00
|
|
|
ldr r1,[sp,0x18]
|
|
|
|
lsl r1,r1,0x10
|
|
|
|
mov r7,0
|
|
|
|
ldr r5,=0x3005228
|
|
|
|
ldrh r4,[r5,0]
|
|
|
|
lsl r4,r4,0x10
|
|
|
|
asr r4,r4,0x1C
|
2017-03-26 00:14:50 +00:00
|
|
|
mov r8,r4
|
2017-03-29 05:19:51 +01:00
|
|
|
lsr r4,r1,0x10
|
2017-03-26 00:14:50 +00:00
|
|
|
mov r12,r4
|
2017-03-29 05:19:51 +01:00
|
|
|
asr r1,r1,0x10
|
2017-03-26 00:14:50 +00:00
|
|
|
add r1,r8
|
2017-03-29 05:19:51 +01:00
|
|
|
lsl r1,r1,0xC
|
|
|
|
strh r1,[r5,0]
|
|
|
|
ldrh r1,[r0,0x22]
|
|
|
|
lsl r1,r1,3
|
2017-03-26 00:14:50 +00:00
|
|
|
add r1,r1,r2
|
2017-03-29 05:19:51 +01:00
|
|
|
ldrh r2,[r0,0x24]
|
|
|
|
lsl r2,r2,3
|
2017-03-26 00:14:50 +00:00
|
|
|
add r2,r2,r3
|
|
|
|
mov r0,r6
|
2017-03-29 05:19:51 +01:00
|
|
|
bl print_string
|
2017-04-11 07:12:33 +01:00
|
|
|
lsr r1,r0,16
|
|
|
|
lsl r0,r0,16
|
|
|
|
lsr r7,r0,16
|
2017-03-29 05:19:51 +01:00
|
|
|
ldrh r0,[r5,0]
|
|
|
|
lsl r0,r0,0x10
|
|
|
|
asr r0,r0,0x1C
|
2017-03-26 00:14:50 +00:00
|
|
|
mov r4,r12
|
2017-03-29 05:19:51 +01:00
|
|
|
lsl r3,r4,0x10
|
|
|
|
asr r3,r3,0x10
|
2017-03-26 00:14:50 +00:00
|
|
|
sub r0,r0,r3
|
2017-03-29 05:19:51 +01:00
|
|
|
lsl r0,r0,0xC
|
|
|
|
strh r0,[r5,0]
|
|
|
|
lsl r0,r7,0x10
|
|
|
|
asr r0,r0,0x10
|
2017-03-26 00:14:50 +00:00
|
|
|
pop {r3}
|
|
|
|
mov r8,r3
|
|
|
|
pop {r4-r7}
|
|
|
|
pop {r2}
|
|
|
|
bx r2
|
2017-03-29 05:19:51 +01:00
|
|
|
.pool
|