pokeemerald/asm/pixel_buffer.s

823 lines
13 KiB
ArmAsm
Raw Normal View History

2016-09-03 08:11:29 +02:00
.include "asm/macros.s"
.syntax unified
.text
2015-11-30 08:17:50 +01:00
thumb_func_start BlitBitmapRect4BitWithoutColorKey
2016-09-03 04:51:16 +02:00
@ void BlitBitmapRect4BitWithoutColorKey(struct Bitmap *src, struct Bitmap *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height)
BlitBitmapRect4BitWithoutColorKey: @ 8002BDC
2015-10-06 14:46:30 +02:00
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x14
ldr r4, [sp, 0x2C]
ldr r5, [sp, 0x30]
ldr r6, [sp, 0x34]
ldr r7, [sp, 0x38]
lsls r2, 16
lsrs r2, 16
lsls r3, 16
lsrs r3, 16
lsls r4, 16
lsrs r4, 16
lsls r5, 16
lsrs r5, 16
lsls r6, 16
lsrs r6, 16
lsls r7, 16
lsrs r7, 16
str r4, [sp]
str r5, [sp, 0x4]
str r6, [sp, 0x8]
str r7, [sp, 0xC]
movs r4, 0xFF
str r4, [sp, 0x10]
2015-11-30 08:17:50 +01:00
bl BlitBitmapRect4Bit
2015-10-06 14:46:30 +02:00
add sp, 0x14
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
2015-11-30 08:17:50 +01:00
thumb_func_end BlitBitmapRect4BitWithoutColorKey
2015-10-06 14:46:30 +02:00
2015-11-30 08:17:50 +01:00
thumb_func_start BlitBitmapRect4Bit
2016-09-03 04:51:16 +02:00
@ void BlitBitmapRect4Bit(struct Bitmap *src, struct Bitmap *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u8 colorKey)
BlitBitmapRect4Bit: @ 8002C20
2015-10-06 14:46:30 +02:00
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x2C
str r0, [sp]
str r1, [sp, 0x4]
ldr r0, [sp, 0x4C]
ldr r1, [sp, 0x50]
ldr r4, [sp, 0x54]
ldr r5, [sp, 0x58]
ldr r6, [sp, 0x5C]
lsls r2, 16
lsrs r2, 16
str r2, [sp, 0x8]
lsls r3, 16
lsrs r7, r3, 16
lsls r0, 16
lsrs r0, 16
str r0, [sp, 0xC]
lsls r1, 16
lsrs r1, 16
mov r9, r1
lsls r4, 16
lsrs r4, 16
lsls r5, 16
lsrs r5, 16
lsls r6, 24
lsrs r6, 24
str r6, [sp, 0x10]
ldr r0, [sp, 0x4]
ldrh r3, [r0, 0x4]
ldr r1, [sp, 0xC]
subs r0, r3, r1
adds r2, r4
mov r8, r2
cmp r0, r4
2016-01-07 05:23:20 +01:00
bge _08002C74
2015-10-06 14:46:30 +02:00
ldr r2, [sp, 0x8]
adds r0, r2
mov r8, r0
2016-01-07 05:23:20 +01:00
_08002C74:
2015-10-06 14:46:30 +02:00
ldr r4, [sp, 0x4]
ldrh r0, [r4, 0x6]
mov r1, r9
subs r0, r1
adds r2, r5, r7
str r2, [sp, 0x14]
cmp r0, r5
2016-01-07 05:23:20 +01:00
bge _08002C88
2015-10-06 14:46:30 +02:00
adds r0, r7
str r0, [sp, 0x14]
2016-01-07 05:23:20 +01:00
_08002C88:
2015-10-06 14:46:30 +02:00
ldr r4, [sp]
ldrh r1, [r4, 0x4]
movs r2, 0x7
adds r0, r1, 0
ands r0, r2
adds r1, r0
asrs r1, 3
str r1, [sp, 0x18]
adds r0, r3, 0
ands r0, r2
adds r0, r3, r0
asrs r0, 3
str r0, [sp, 0x1C]
ldr r0, [sp, 0x10]
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08002D46
2015-10-06 14:46:30 +02:00
adds r3, r7, 0
mov r1, r9
ldr r2, [sp, 0x14]
cmp r3, r2
2016-01-07 05:23:20 +01:00
blt _08002CB4
b _08002DEE
_08002CB4:
2015-10-06 14:46:30 +02:00
ldr r5, [sp, 0x8]
ldr r6, [sp, 0xC]
adds r4, r3, 0x1
str r4, [sp, 0x24]
adds r0, r1, 0x1
str r0, [sp, 0x28]
cmp r5, r8
2016-01-07 05:23:20 +01:00
bge _08002D3A
2015-10-06 14:46:30 +02:00
movs r7, 0x3
asrs r0, r3, 3
ldr r2, [sp, 0x18]
muls r0, r2
lsls r0, 5
mov r10, r0
lsls r0, r3, 29
lsrs r0, 27
mov r9, r0
asrs r0, r1, 3
ldr r4, [sp, 0x1C]
muls r0, r4
lsls r0, 5
mov r12, r0
lsls r0, r1, 29
lsrs r3, r0, 27
2016-01-07 05:23:20 +01:00
_08002CE4:
2015-10-06 14:46:30 +02:00
asrs r0, r5, 1
ands r0, r7
ldr r2, [sp]
ldr r1, [r2]
adds r1, r0
asrs r0, r5, 3
lsls r0, 5
adds r1, r0
add r1, r10
mov r4, r9
adds r2, r1, r4
asrs r0, r6, 1
ands r0, r7
ldr r4, [sp, 0x4]
ldr r1, [r4]
adds r1, r0
asrs r0, r6, 3
lsls r0, 5
adds r1, r0
add r1, r12
adds r4, r1, r3
ldrb r2, [r2]
adds r0, r5, 0
movs r1, 0x1
ands r0, r1
lsls r0, 2
asrs r2, r0
movs r0, 0xF
ands r2, r0
adds r0, r6, 0
ands r0, r1
lsls r1, r0, 2
lsls r2, r1
movs r0, 0xF0
asrs r0, r1
ldrb r1, [r4]
ands r0, r1
orrs r2, r0
strb r2, [r4]
adds r5, 0x1
adds r6, 0x1
cmp r5, r8
2016-01-07 05:23:20 +01:00
blt _08002CE4
_08002D3A:
2015-10-06 14:46:30 +02:00
ldr r3, [sp, 0x24]
ldr r1, [sp, 0x28]
ldr r2, [sp, 0x14]
cmp r3, r2
2016-01-07 05:23:20 +01:00
blt _08002CB4
b _08002DEE
_08002D46:
2015-10-06 14:46:30 +02:00
adds r3, r7, 0
mov r1, r9
ldr r4, [sp, 0x14]
cmp r3, r4
2016-01-07 05:23:20 +01:00
bge _08002DEE
_08002D50:
2015-10-06 14:46:30 +02:00
ldr r5, [sp, 0x8]
ldr r6, [sp, 0xC]
adds r0, r3, 0x1
str r0, [sp, 0x24]
adds r2, r1, 0x1
str r2, [sp, 0x28]
cmp r5, r8
2016-01-07 05:23:20 +01:00
bge _08002DE4
2015-10-06 14:46:30 +02:00
movs r4, 0x3
mov r9, r4
asrs r0, r3, 3
ldr r2, [sp, 0x18]
muls r0, r2
lsls r0, 5
str r0, [sp, 0x20]
lsls r0, r3, 29
lsrs r0, 27
mov r10, r0
movs r3, 0x1
asrs r0, r1, 3
ldr r4, [sp, 0x1C]
muls r0, r4
lsls r0, 5
mov r12, r0
lsls r0, r1, 29
lsrs r7, r0, 27
2016-01-07 05:23:20 +01:00
_08002D84:
2015-10-06 14:46:30 +02:00
asrs r0, r5, 1
mov r1, r9
ands r0, r1
ldr r2, [sp]
ldr r1, [r2]
adds r1, r0
asrs r0, r5, 3
lsls r0, 5
adds r1, r0
ldr r4, [sp, 0x20]
adds r1, r4
mov r0, r10
adds r2, r1, r0
asrs r0, r6, 1
mov r1, r9
ands r0, r1
ldr r4, [sp, 0x4]
ldr r1, [r4]
adds r1, r0
asrs r0, r6, 3
lsls r0, 5
adds r1, r0
add r1, r12
adds r4, r1, r7
ldrb r2, [r2]
adds r0, r5, 0
ands r0, r3
lsls r0, 2
asrs r2, r0
movs r0, 0xF
ands r2, r0
ldr r0, [sp, 0x10]
cmp r2, r0
2016-01-07 05:23:20 +01:00
beq _08002DDC
2015-10-06 14:46:30 +02:00
adds r0, r6, 0
ands r0, r3
lsls r1, r0, 2
lsls r2, r1
movs r0, 0xF0
asrs r0, r1
ldrb r1, [r4]
ands r0, r1
orrs r2, r0
strb r2, [r4]
2016-01-07 05:23:20 +01:00
_08002DDC:
2015-10-06 14:46:30 +02:00
adds r5, 0x1
adds r6, 0x1
cmp r5, r8
2016-01-07 05:23:20 +01:00
blt _08002D84
_08002DE4:
2015-10-06 14:46:30 +02:00
ldr r3, [sp, 0x24]
ldr r1, [sp, 0x28]
ldr r2, [sp, 0x14]
cmp r3, r2
2016-01-07 05:23:20 +01:00
blt _08002D50
_08002DEE:
2015-10-06 14:46:30 +02:00
add sp, 0x2C
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
2015-11-30 08:17:50 +01:00
thumb_func_end BlitBitmapRect4Bit
2015-10-06 14:46:30 +02:00
2015-11-30 08:17:50 +01:00
thumb_func_start FillBitmapRect4Bit
2016-09-03 04:51:16 +02:00
@ void FillBitmapRect4Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue)
FillBitmapRect4Bit: @ 8002E00
2015-10-06 14:46:30 +02:00
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x8
mov r9, r0
ldr r0, [sp, 0x28]
ldr r4, [sp, 0x2C]
lsls r1, 16
lsrs r1, 16
str r1, [sp]
lsls r2, 16
lsrs r2, 16
adds r6, r2, 0
lsls r3, 16
lsrs r3, 16
lsls r0, 16
lsrs r0, 16
lsls r4, 24
lsrs r5, r4, 24
adds r4, r1, r3
mov r3, r9
ldrh r1, [r3, 0x4]
cmp r4, r1
2016-01-07 05:23:20 +01:00
ble _08002E36
2015-10-06 14:46:30 +02:00
adds r4, r1, 0
2016-01-07 05:23:20 +01:00
_08002E36:
2015-10-06 14:46:30 +02:00
adds r2, r0
mov r12, r2
mov r2, r9
ldrh r0, [r2, 0x6]
cmp r12, r0
2016-01-07 05:23:20 +01:00
ble _08002E44
2015-10-06 14:46:30 +02:00
mov r12, r0
2016-01-07 05:23:20 +01:00
_08002E44:
2015-10-06 14:46:30 +02:00
movs r0, 0x7
ands r0, r1
adds r0, r1, r0
asrs r0, 3
str r0, [sp, 0x4]
lsls r0, r5, 28
lsrs r0, 24
mov r8, r0
movs r3, 0xF
mov r10, r3
mov r0, r10
ands r0, r5
mov r10, r0
adds r1, r6, 0
cmp r1, r12
2016-01-07 05:23:20 +01:00
bge _08002EB6
_08002E64:
2015-10-06 14:46:30 +02:00
ldr r3, [sp]
adds r7, r1, 0x1
cmp r3, r4
2016-01-07 05:23:20 +01:00
bge _08002EB0
2015-10-06 14:46:30 +02:00
asrs r0, r1, 3
ldr r2, [sp, 0x4]
muls r0, r2
lsls r6, r0, 5
lsls r0, r1, 29
lsrs r5, r0, 27
2016-01-07 05:23:20 +01:00
_08002E78:
2015-10-06 14:46:30 +02:00
asrs r2, r3, 1
movs r0, 0x3
ands r2, r0
mov r0, r9
ldr r1, [r0]
adds r1, r2
asrs r0, r3, 3
lsls r0, 5
adds r1, r0
adds r1, r6
adds r2, r1, r5
lsls r0, r3, 31
cmp r0, 0
2016-01-07 05:23:20 +01:00
beq _08002E9E
2015-10-06 14:46:30 +02:00
ldrb r1, [r2]
movs r0, 0xF
ands r0, r1
mov r1, r8
2016-01-07 05:23:20 +01:00
b _08002EA6
_08002E9E:
2015-10-06 14:46:30 +02:00
ldrb r1, [r2]
movs r0, 0xF0
ands r0, r1
mov r1, r10
2016-01-07 05:23:20 +01:00
_08002EA6:
2015-10-06 14:46:30 +02:00
orrs r0, r1
strb r0, [r2]
adds r3, 0x1
cmp r3, r4
2016-01-07 05:23:20 +01:00
blt _08002E78
_08002EB0:
2015-10-06 14:46:30 +02:00
adds r1, r7, 0
cmp r1, r12
2016-01-07 05:23:20 +01:00
blt _08002E64
_08002EB6:
2015-10-06 14:46:30 +02:00
add sp, 0x8
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
2015-11-30 08:17:50 +01:00
thumb_func_end FillBitmapRect4Bit
2015-10-06 14:46:30 +02:00
2015-11-30 08:17:50 +01:00
thumb_func_start BlitBitmapRect4BitTo8Bit
2016-09-03 04:51:16 +02:00
@ void BlitBitmapRect4BitTo8Bit(struct Bitmap *src, struct Bitmap *dest, u16 srcX, u16 srcY, u16 destX, u16 destY, u16 width, u16 height, u8 colorKey, u8 paletteOffset)
BlitBitmapRect4BitTo8Bit: @ 8002EC8
2015-10-06 14:46:30 +02:00
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x3C
str r0, [sp]
str r1, [sp, 0x4]
ldr r0, [sp, 0x5C]
ldr r1, [sp, 0x60]
ldr r5, [sp, 0x64]
ldr r4, [sp, 0x68]
ldr r6, [sp, 0x6C]
ldr r7, [sp, 0x70]
mov r8, r7
lsls r2, 16
lsrs r2, 16
str r2, [sp, 0x8]
lsls r3, 16
lsrs r3, 16
lsls r0, 16
lsrs r0, 16
str r0, [sp, 0xC]
lsls r1, 16
lsrs r7, r1, 16
lsls r5, 16
lsrs r5, 16
lsls r4, 16
lsrs r4, 16
lsls r6, 24
lsrs r6, 24
str r6, [sp, 0x10]
mov r0, r8
lsls r0, 28
lsrs r0, 24
str r0, [sp, 0x14]
lsls r0, r6, 28
lsrs r0, 24
str r0, [sp, 0x28]
ldr r1, [sp, 0x4]
ldrh r0, [r1, 0x4]
ldr r2, [sp, 0xC]
subs r0, r2
ldr r1, [sp, 0x8]
adds r1, r5, r1
str r1, [sp, 0x18]
cmp r0, r5
2016-01-07 05:23:20 +01:00
bge _08002F2E
2015-10-06 14:46:30 +02:00
ldr r2, [sp, 0x8]
adds r0, r2
str r0, [sp, 0x18]
2016-01-07 05:23:20 +01:00
_08002F2E:
2015-10-06 14:46:30 +02:00
ldr r5, [sp, 0x4]
ldrh r1, [r5, 0x6]
subs r0, r1, r7
cmp r0, r4
2016-01-07 05:23:20 +01:00
bge _08002F40
2015-10-06 14:46:30 +02:00
adds r0, r3, r1
subs r0, r7
str r0, [sp, 0x1C]
2016-01-07 05:23:20 +01:00
b _08002F44
_08002F40:
2015-10-06 14:46:30 +02:00
adds r4, r3, r4
str r4, [sp, 0x1C]
2016-01-07 05:23:20 +01:00
_08002F44:
2015-10-06 14:46:30 +02:00
ldr r0, [sp]
ldrh r1, [r0, 0x4]
movs r2, 0x7
adds r0, r1, 0
ands r0, r2
adds r1, r0
asrs r1, 3
str r1, [sp, 0x20]
ldr r5, [sp, 0x4]
ldrh r1, [r5, 0x4]
adds r0, r1, 0
ands r0, r2
adds r1, r0
asrs r1, 3
str r1, [sp, 0x24]
ldr r0, [sp, 0x10]
cmp r0, 0xFF
2016-01-07 05:23:20 +01:00
bne _08003024
2015-10-06 14:46:30 +02:00
adds r2, r3, 0
adds r5, r7, 0
ldr r1, [sp, 0x1C]
cmp r2, r1
2016-01-07 05:23:20 +01:00
blt _08002F74
b _08003106
_08002F74:
2015-10-06 14:46:30 +02:00
ldr r3, [sp, 0x8]
lsrs r3, 1
str r3, [sp, 0x2C]
movs r0, 0x3
ands r3, r0
str r3, [sp, 0x2C]
ldr r7, [sp, 0x8]
lsrs r0, r7, 3
lsls r0, 5
str r0, [sp, 0x30]
2016-01-07 05:23:20 +01:00
_08002F88:
2015-10-06 14:46:30 +02:00
ldr r0, [sp]
ldr r1, [r0]
ldr r3, [sp, 0x2C]
adds r1, r3
ldr r7, [sp, 0x30]
adds r1, r7
asrs r0, r2, 3
ldr r3, [sp, 0x20]
muls r0, r3
lsls r0, 5
mov r8, r0
add r1, r8
lsls r0, r2, 29
lsrs r7, r0, 27
adds r6, r1, r7
ldr r3, [sp, 0x8]
ldr r4, [sp, 0xC]
adds r2, 0x1
mov r10, r2
adds r0, r5, 0x1
str r0, [sp, 0x38]
ldr r1, [sp, 0x18]
cmp r3, r1
2016-01-07 05:23:20 +01:00
bge _08003018
2015-10-06 14:46:30 +02:00
asrs r0, r5, 3
ldr r2, [sp, 0x24]
muls r0, r2
lsls r0, 6
mov r12, r0
lsls r0, r5, 29
lsrs r0, 26
mov r9, r0
2016-01-07 05:23:20 +01:00
_08002FC8:
2015-10-06 14:46:30 +02:00
movs r0, 0x7
ands r0, r4
ldr r5, [sp, 0x4]
ldr r1, [r5]
adds r1, r0
asrs r0, r4, 3
lsls r0, 6
adds r1, r0
add r1, r12
mov r0, r9
adds r5, r1, r0
movs r0, 0x1
ands r0, r3
cmp r0, 0
2016-01-07 05:23:20 +01:00
beq _08002FEC
2015-10-06 14:46:30 +02:00
ldrb r0, [r6]
lsrs r0, 4
2016-01-07 05:23:20 +01:00
b _08003008
_08002FEC:
2015-10-06 14:46:30 +02:00
asrs r2, r3, 1
movs r0, 0x3
ands r2, r0
ldr r0, [sp]
ldr r1, [r0]
adds r1, r2
asrs r0, r3, 3
lsls r0, 5
adds r1, r0
add r1, r8
adds r6, r1, r7
ldrb r1, [r6]
movs r0, 0xF
ands r0, r1
2016-01-07 05:23:20 +01:00
_08003008:
2015-10-06 14:46:30 +02:00
ldr r1, [sp, 0x14]
adds r0, r1, r0
strb r0, [r5]
adds r3, 0x1
adds r4, 0x1
ldr r2, [sp, 0x18]
cmp r3, r2
2016-01-07 05:23:20 +01:00
blt _08002FC8
_08003018:
2015-10-06 14:46:30 +02:00
mov r2, r10
ldr r5, [sp, 0x38]
ldr r3, [sp, 0x1C]
cmp r2, r3
2016-01-07 05:23:20 +01:00
blt _08002F88
b _08003106
_08003024:
2015-10-06 14:46:30 +02:00
adds r2, r3, 0
adds r5, r7, 0
ldr r7, [sp, 0x1C]
cmp r2, r7
2016-01-07 05:23:20 +01:00
bge _08003106
2015-10-06 14:46:30 +02:00
ldr r0, [sp, 0x8]
lsrs r0, 1
str r0, [sp, 0x34]
movs r0, 0x3
ldr r1, [sp, 0x34]
ands r1, r0
str r1, [sp, 0x34]
2016-01-07 05:23:20 +01:00
_0800303C:
2015-10-06 14:46:30 +02:00
ldr r3, [sp]
ldr r1, [r3]
ldr r7, [sp, 0x34]
adds r1, r7
ldr r3, [sp, 0x8]
lsrs r0, r3, 3
lsls r0, 5
adds r1, r0
asrs r0, r2, 3
ldr r7, [sp, 0x20]
muls r0, r7
lsls r0, 5
mov r8, r0
add r1, r8
lsls r0, r2, 29
lsrs r7, r0, 27
adds r6, r1, r7
ldr r4, [sp, 0xC]
adds r2, 0x1
mov r10, r2
adds r0, r5, 0x1
str r0, [sp, 0x38]
ldr r1, [sp, 0x18]
cmp r3, r1
2016-01-07 05:23:20 +01:00
bge _080030FC
2015-10-06 14:46:30 +02:00
asrs r0, r5, 3
ldr r2, [sp, 0x24]
muls r0, r2
lsls r0, 6
mov r9, r0
lsls r0, r5, 29
lsrs r0, 26
mov r12, r0
2016-01-07 05:23:20 +01:00
_0800307E:
2015-10-06 14:46:30 +02:00
movs r0, 0x1
ands r0, r3
cmp r0, 0
2016-01-07 05:23:20 +01:00
beq _080030B2
2015-10-06 14:46:30 +02:00
ldrb r2, [r6]
movs r0, 0xF0
ands r0, r2
ldr r5, [sp, 0x28]
cmp r0, r5
2016-01-07 05:23:20 +01:00
beq _080030F2
2015-10-06 14:46:30 +02:00
adds r0, r4, 0
movs r1, 0x7
ands r0, r1
ldr r5, [sp, 0x4]
ldr r1, [r5]
adds r1, r0
asrs r0, r4, 3
lsls r0, 6
adds r1, r0
add r1, r9
mov r0, r12
adds r5, r1, r0
lsrs r0, r2, 4
ldr r1, [sp, 0x14]
adds r0, r1, r0
2016-01-07 05:23:20 +01:00
b _080030F0
_080030B2:
2015-10-06 14:46:30 +02:00
asrs r2, r3, 1
movs r0, 0x3
ands r2, r0
ldr r5, [sp]
ldr r1, [r5]
adds r1, r2
asrs r0, r3, 3
lsls r0, 5
adds r1, r0
add r1, r8
adds r6, r1, r7
ldrb r0, [r6]
movs r2, 0xF
ands r2, r0
ldr r0, [sp, 0x10]
cmp r2, r0
2016-01-07 05:23:20 +01:00
beq _080030F2
2015-10-06 14:46:30 +02:00
adds r0, r4, 0
movs r1, 0x7
ands r0, r1
ldr r5, [sp, 0x4]
ldr r1, [r5]
adds r1, r0
asrs r0, r4, 3
lsls r0, 6
adds r1, r0
add r1, r9
mov r0, r12
adds r5, r1, r0
ldr r1, [sp, 0x14]
adds r0, r1, r2
2016-01-07 05:23:20 +01:00
_080030F0:
2015-10-06 14:46:30 +02:00
strb r0, [r5]
2016-01-07 05:23:20 +01:00
_080030F2:
2015-10-06 14:46:30 +02:00
adds r3, 0x1
adds r4, 0x1
ldr r2, [sp, 0x18]
cmp r3, r2
2016-01-07 05:23:20 +01:00
blt _0800307E
_080030FC:
2015-10-06 14:46:30 +02:00
mov r2, r10
ldr r5, [sp, 0x38]
ldr r3, [sp, 0x1C]
cmp r2, r3
2016-01-07 05:23:20 +01:00
blt _0800303C
_08003106:
2015-10-06 14:46:30 +02:00
add sp, 0x3C
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
2015-11-30 08:17:50 +01:00
thumb_func_end BlitBitmapRect4BitTo8Bit
2015-10-06 14:46:30 +02:00
2015-11-30 08:17:50 +01:00
thumb_func_start FillBitmapRect8Bit
2016-09-03 04:51:16 +02:00
@ void FillBitmapRect8Bit(struct Bitmap *surface, u16 x, u16 y, u16 width, u16 height, u8 fillValue)
FillBitmapRect8Bit: @ 8003118
2015-10-06 14:46:30 +02:00
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x8
mov r8, r0
ldr r0, [sp, 0x28]
ldr r4, [sp, 0x2C]
lsls r1, 16
lsrs r1, 16
mov r10, r1
lsls r2, 16
lsrs r2, 16
adds r6, r2, 0
lsls r3, 16
lsrs r3, 16
lsls r0, 16
lsrs r0, 16
lsls r4, 24
lsrs r4, 24
mov r9, r4
adds r5, r1, r3
mov r3, r8
ldrh r1, [r3, 0x4]
cmp r5, r1
2016-01-07 05:23:20 +01:00
ble _08003150
2015-10-06 14:46:30 +02:00
adds r5, r1, 0
2016-01-07 05:23:20 +01:00
_08003150:
2015-10-06 14:46:30 +02:00
adds r7, r2, r0
mov r2, r8
ldrh r0, [r2, 0x6]
cmp r7, r0
2016-01-07 05:23:20 +01:00
ble _0800315C
2015-10-06 14:46:30 +02:00
adds r7, r0, 0
2016-01-07 05:23:20 +01:00
_0800315C:
2015-10-06 14:46:30 +02:00
movs r0, 0x7
ands r0, r1
adds r0, r1, r0
asrs r0, 3
str r0, [sp]
adds r1, r6, 0
cmp r1, r7
2016-01-07 05:23:20 +01:00
bge _080031AC
_0800316C:
2015-10-06 14:46:30 +02:00
mov r3, r10
adds r6, r1, 0x1
str r6, [sp, 0x4]
cmp r3, r5
2016-01-07 05:23:20 +01:00
bge _080031A6
2015-10-06 14:46:30 +02:00
movs r0, 0x7
mov r12, r0
asrs r0, r1, 3
ldr r2, [sp]
muls r0, r2
lsls r4, r0, 6
lsls r0, r1, 29
lsrs r2, r0, 26
2016-01-07 05:23:20 +01:00
_08003186:
2015-10-06 14:46:30 +02:00
adds r0, r3, 0
mov r6, r12
ands r0, r6
mov r6, r8
ldr r1, [r6]
adds r1, r0
asrs r0, r3, 3
lsls r0, 6
adds r1, r0
adds r1, r4
adds r1, r2
mov r0, r9
strb r0, [r1]
adds r3, 0x1
cmp r3, r5
2016-01-07 05:23:20 +01:00
blt _08003186
_080031A6:
2015-10-06 14:46:30 +02:00
ldr r1, [sp, 0x4]
cmp r1, r7
2016-01-07 05:23:20 +01:00
blt _0800316C
_080031AC:
2015-10-06 14:46:30 +02:00
add sp, 0x8
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
2015-11-30 08:17:50 +01:00
thumb_func_end FillBitmapRect8Bit
2016-09-03 08:11:29 +02:00
.align 2, 0 @ Don't pad with nop.