sovereignx/asm/multiboot.s

907 lines
14 KiB
ArmAsm
Raw Normal View History

2016-11-01 15:29:13 +00:00
.include "asm/macros.inc"
2016-11-01 17:08:48 +00:00
.include "constants/constants.inc"
2016-09-03 07:11:29 +01:00
.syntax unified
.text
2015-11-27 10:19:02 +00:00
thumb_func_start MultiBootInit
2016-09-03 03:51:16 +01:00
@ void MultiBootInit(MultiBootParam *mp)
MultiBootInit: @ 81BA6D0
2015-11-27 10:19:02 +00:00
adds r2, r0, 0
movs r1, 0
strb r1, [r2, 0x1E]
strb r1, [r2, 0x18]
strb r1, [r2, 0x1D]
adds r3, r2, 0
adds r3, 0x4A
movs r0, 0xF
strb r0, [r3]
adds r0, r2, 0
adds r0, 0x48
strb r1, [r0]
strh r1, [r2, 0x16]
ldr r0, =0x04000134
strh r1, [r0]
ldr r2, =0x04000128
ldr r3, =0x00002003
adds r0, r3, 0
strh r0, [r2]
ldr r0, =0x0400012a
strh r1, [r0]
bx lr
.pool
thumb_func_end MultiBootInit
thumb_func_start MultiBootMain
2016-09-03 03:51:16 +01:00
@ int MultiBootMain(MultiBootParam *mp)
MultiBootMain: @ 81BA70C
2015-11-27 10:19:02 +00:00
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
adds r7, r0, 0
bl MultiBootCheckComplete
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BA722
b _081BAAEA
_081BA722:
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
adds r0, 0x4A
ldrb r1, [r0]
mov r10, r0
cmp r1, 0xF
2016-01-07 04:23:20 +00:00
bls _081BA736
2015-11-27 10:19:02 +00:00
subs r0, r1, 0x1
mov r1, r10
strb r0, [r1]
2016-01-07 04:23:20 +00:00
b _081BAAEA
_081BA736:
2015-11-27 10:19:02 +00:00
adds r1, r7, 0
adds r1, 0x48
ldrb r0, [r1]
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BA760
2015-11-27 10:19:02 +00:00
movs r0, 0
strb r0, [r1]
ldr r0, =0x04000128
ldrh r0, [r0]
movs r5, 0xFC
ands r5, r0
cmp r5, 0x8
2016-01-07 04:23:20 +00:00
beq _081BA760
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
bl MultiBootInit
movs r0, 0x8
eors r0, r5
2016-01-07 04:23:20 +00:00
b _081BAAEC
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BA760:
2015-11-27 10:19:02 +00:00
ldrb r0, [r7, 0x18]
cmp r0, 0xDF
2016-01-07 04:23:20 +00:00
bls _081BA7B2
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
bl MultiBootHandShake
adds r5, r0, 0
cmp r5, 0
2016-01-07 04:23:20 +00:00
beq _081BA774
b _081BAAEC
_081BA774:
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
adds r0, 0x4B
ldrb r0, [r0]
cmp r0, 0x1
2016-01-07 04:23:20 +00:00
bne _081BA790
2015-11-27 10:19:02 +00:00
ldrb r0, [r7, 0x18]
cmp r0, 0xE1
2016-01-07 04:23:20 +00:00
bls _081BA790
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
bl MultiBootCheckComplete
cmp r0, 0
2016-01-07 04:23:20 +00:00
bne _081BA790
b _081BAADA
_081BA790:
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
bl MultiBootCheckComplete
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BA79C
b _081BAAEA
_081BA79C:
2015-11-27 10:19:02 +00:00
ldrh r0, [r7, 0x16]
cmp r0, 0
2016-01-07 04:23:20 +00:00
bne _081BA7AC
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
bl MultiBootInit
movs r0, 0x71
2016-01-07 04:23:20 +00:00
b _081BAAEC
_081BA7AC:
2015-11-27 10:19:02 +00:00
subs r0, 0x1
strh r0, [r7, 0x16]
2016-01-07 04:23:20 +00:00
b _081BAAEA
_081BA7B2:
2015-11-27 10:19:02 +00:00
ldrb r0, [r7, 0x18]
cmp r0, 0x2
2016-01-07 04:23:20 +00:00
bne _081BA7BA
b _081BA8F0
_081BA7BA:
2015-11-27 10:19:02 +00:00
cmp r0, 0x2
2016-01-07 04:23:20 +00:00
bgt _081BA7C8
2015-11-27 10:19:02 +00:00
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BA7D6
2015-11-27 10:19:02 +00:00
cmp r0, 0x1
2016-01-07 04:23:20 +00:00
beq _081BA892
b _081BAA28
_081BA7C8:
2015-11-27 10:19:02 +00:00
cmp r0, 0xD0
2016-01-07 04:23:20 +00:00
bne _081BA7CE
b _081BA93C
_081BA7CE:
2015-11-27 10:19:02 +00:00
cmp r0, 0xD1
2016-01-07 04:23:20 +00:00
bne _081BA7D4
b _081BA9D6
_081BA7D4:
b _081BAA28
_081BA7D6:
2015-11-27 10:19:02 +00:00
movs r3, 0xE
movs r5, 0x3
ldr r0, =0x04000120
ldrh r0, [r0, 0x6]
adds r1, r0, 0
ldr r0, =0x0000ffff
ldrb r2, [r7, 0x1E]
adds r6, r2, 0
cmp r1, r0
2016-01-07 04:23:20 +00:00
bne _081BA7FE
2015-11-27 10:19:02 +00:00
adds r4, r1, 0
ldr r1, =0x04000126
2016-01-07 04:23:20 +00:00
_081BA7EE:
2015-11-27 10:19:02 +00:00
asrs r3, 1
subs r1, 0x2
subs r5, 0x1
cmp r5, 0
2016-01-07 04:23:20 +00:00
beq _081BA7FE
2015-11-27 10:19:02 +00:00
ldrh r0, [r1]
cmp r0, r4
2016-01-07 04:23:20 +00:00
beq _081BA7EE
_081BA7FE:
2015-11-27 10:19:02 +00:00
movs r0, 0xE
ands r3, r0
strb r3, [r7, 0x1D]
movs r5, 0x3
ldr r0, =0x04000120
ldrh r0, [r0, 0x6]
adds r4, r0, 0
asrs r0, r2, 3
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BA82C
2015-11-27 10:19:02 +00:00
ldr r0, =0x00007208
2016-01-07 04:23:20 +00:00
b _081BA852
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BA82C:
2015-11-27 10:19:02 +00:00
subs r5, 0x1
cmp r5, 0
2016-01-07 04:23:20 +00:00
beq _081BA858
2015-11-27 10:19:02 +00:00
lsls r0, r5, 1
ldr r1, =0x04000120
adds r0, r1
ldrh r0, [r0]
adds r4, r0, 0
adds r0, r2, 0
asrs r0, r5
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BA82C
2015-11-27 10:19:02 +00:00
adds r0, r1, 0
lsls r0, r5
movs r1, 0xE4
lsls r1, 7
orrs r0, r1
2016-01-07 04:23:20 +00:00
_081BA852:
2015-11-27 10:19:02 +00:00
cmp r4, r0
2016-01-07 04:23:20 +00:00
beq _081BA82C
2015-11-27 10:19:02 +00:00
movs r3, 0
2016-01-07 04:23:20 +00:00
_081BA858:
2015-11-27 10:19:02 +00:00
adds r0, r3, 0
ands r0, r6
strb r0, [r7, 0x1E]
cmp r3, 0
2016-01-07 04:23:20 +00:00
bne _081BA868
2015-11-27 10:19:02 +00:00
movs r0, 0xF
mov r2, r10
strb r0, [r2]
2016-01-07 04:23:20 +00:00
_081BA868:
2015-11-27 10:19:02 +00:00
mov r1, r10
ldrb r0, [r1]
cmp r0, 0
2016-01-07 04:23:20 +00:00
bne _081BA884
2015-11-27 10:19:02 +00:00
ldrb r0, [r7, 0x1D]
ldrb r2, [r7, 0x1E]
cmp r0, r2
2016-01-07 04:23:20 +00:00
beq _081BA88A
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
bl MultiBootStartProbe
2016-01-07 04:23:20 +00:00
b _081BA892
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BA884:
2015-11-27 10:19:02 +00:00
subs r0, 0x1
mov r1, r10
strb r0, [r1]
2016-01-07 04:23:20 +00:00
_081BA88A:
2015-11-27 10:19:02 +00:00
ldrb r1, [r7, 0x1E]
movs r2, 0xC4
lsls r2, 7
2016-01-07 04:23:20 +00:00
b _081BA992
_081BA892:
2015-11-27 10:19:02 +00:00
adds r1, r7, 0
adds r1, 0x49
movs r0, 0
strb r0, [r1]
movs r5, 0x3
mov r12, r1
2016-11-01 18:35:16 +00:00
ldr r3, =gUnknown_0300129C
2016-01-07 04:23:20 +00:00
_081BA8A0:
2015-11-27 10:19:02 +00:00
lsls r0, r5, 1
ldr r2, =0x04000120
adds r0, r2
ldrh r0, [r0]
adds r4, r0, 0
asrs r0, r4, 8
subs r2, r5, 0x1
cmp r0, 0x72
2016-01-07 04:23:20 +00:00
bne _081BA8CA
2015-11-27 10:19:02 +00:00
lsls r0, r2, 1
adds r0, r3
strh r4, [r0]
movs r0, 0xFF
ands r4, r0
movs r0, 0x1
lsls r0, r5
cmp r4, r0
2016-01-07 04:23:20 +00:00
bne _081BA8CA
2015-11-27 10:19:02 +00:00
ldrb r0, [r1]
orrs r4, r0
strb r4, [r1]
2016-01-07 04:23:20 +00:00
_081BA8CA:
2015-11-27 10:19:02 +00:00
adds r5, r2, 0
cmp r5, 0
2016-01-07 04:23:20 +00:00
bne _081BA8A0
2015-11-27 10:19:02 +00:00
ldrb r0, [r7, 0x1D]
mov r1, r12
ldrb r1, [r1]
cmp r0, r1
2016-01-07 04:23:20 +00:00
bne _081BA88A
2015-11-27 10:19:02 +00:00
movs r0, 0x2
strb r0, [r7, 0x18]
mov r2, r12
ldrb r1, [r2]
movs r2, 0xC2
lsls r2, 7
2016-01-07 04:23:20 +00:00
b _081BA992
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BA8F0:
2015-11-27 10:19:02 +00:00
movs r5, 0x3
movs r0, 0x49
adds r0, r7
mov r12, r0
mov r4, r12
movs r6, 0x1
2016-11-01 18:35:16 +00:00
ldr r1, =gUnknown_0300129C
2015-11-27 10:19:02 +00:00
mov r9, r1
ldr r2, =0x04000120
mov r8, r2
2016-01-07 04:23:20 +00:00
_081BA904:
2015-11-27 10:19:02 +00:00
ldrb r3, [r4]
adds r0, r3, 0
asrs r0, r5
ands r0, r6
subs r2, r5, 0x1
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BA92A
2015-11-27 10:19:02 +00:00
lsls r0, r5, 1
add r0, r8
ldrh r1, [r0]
lsls r0, r2, 1
add r0, r9
ldrh r0, [r0]
cmp r1, r0
2016-01-07 04:23:20 +00:00
beq _081BA92A
2015-11-27 10:19:02 +00:00
adds r0, r6, 0
lsls r0, r5
eors r3, r0
strb r3, [r4]
2016-01-07 04:23:20 +00:00
_081BA92A:
2015-11-27 10:19:02 +00:00
adds r5, r2, 0
cmp r5, 0
2016-01-07 04:23:20 +00:00
bne _081BA904
b _081BAA90
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BA93C:
2015-11-27 10:19:02 +00:00
movs r3, 0x1
movs r5, 0x3
movs r0, 0x49
adds r0, r7
mov r12, r0
adds r6, r7, 0
adds r6, 0x19
2016-11-01 18:35:16 +00:00
ldr r1, =gUnknown_0300129C
2015-11-27 10:19:02 +00:00
mov r8, r1
2016-01-07 04:23:20 +00:00
_081BA94E:
2015-11-27 10:19:02 +00:00
lsls r0, r5, 1
ldr r2, =0x04000120
adds r0, r2
ldrh r0, [r0]
adds r4, r0, 0
subs r2, r5, 0x1
adds r0, r6, r2
strb r4, [r0]
mov r0, r12
ldrb r1, [r0]
asrs r1, r5
movs r0, 0x1
ands r1, r0
cmp r1, 0
2016-01-07 04:23:20 +00:00
beq _081BA982
2015-11-27 10:19:02 +00:00
asrs r0, r4, 8
subs r0, 0x72
cmp r0, 0x1
2016-01-07 04:23:20 +00:00
bls _081BA976
b _081BAAE0
_081BA976:
2015-11-27 10:19:02 +00:00
lsls r0, r2, 1
add r0, r8
ldrh r0, [r0]
cmp r4, r0
2016-01-07 04:23:20 +00:00
bne _081BA982
2015-11-27 10:19:02 +00:00
movs r3, 0
2016-01-07 04:23:20 +00:00
_081BA982:
2015-11-27 10:19:02 +00:00
adds r5, r2, 0
cmp r5, 0
2016-01-07 04:23:20 +00:00
bne _081BA94E
2015-11-27 10:19:02 +00:00
cmp r3, 0
2016-01-07 04:23:20 +00:00
bne _081BA9A8
2015-11-27 10:19:02 +00:00
ldrb r1, [r7, 0x1C]
movs r2, 0xC6
lsls r2, 7
2016-01-07 04:23:20 +00:00
_081BA992:
2015-11-27 10:19:02 +00:00
adds r0, r2, 0
orrs r1, r0
adds r0, r7, 0
bl MultiBootSend
2016-01-07 04:23:20 +00:00
b _081BAAEC
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BA9A8:
2015-11-27 10:19:02 +00:00
movs r0, 0xD1
strb r0, [r7, 0x18]
movs r3, 0x11
movs r5, 0x3
adds r1, r6, 0x2
2016-01-07 04:23:20 +00:00
_081BA9B2:
2015-11-27 10:19:02 +00:00
ldrb r0, [r1]
adds r3, r0
subs r1, 0x1
subs r5, 0x1
cmp r5, 0
2016-01-07 04:23:20 +00:00
bne _081BA9B2
2015-11-27 10:19:02 +00:00
strb r3, [r7, 0x14]
movs r0, 0xFF
ands r3, r0
movs r1, 0xC8
lsls r1, 7
adds r0, r1, 0
orrs r3, r0
adds r0, r7, 0
adds r1, r3, 0
bl MultiBootSend
2016-01-07 04:23:20 +00:00
b _081BAAEC
_081BA9D6:
2015-11-27 10:19:02 +00:00
movs r5, 0x3
movs r2, 0x49
ldrb r1, [r2, r7]
ldr r2, =0x04000126
movs r3, 0x1
2016-01-07 04:23:20 +00:00
_081BA9E0:
2015-11-27 10:19:02 +00:00
ldrh r0, [r2]
adds r4, r0, 0
adds r0, r1, 0
asrs r0, r5
ands r0, r3
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BA9F4
2015-11-27 10:19:02 +00:00
asrs r0, r4, 8
cmp r0, 0x73
2016-01-07 04:23:20 +00:00
bne _081BAAE0
_081BA9F4:
2015-11-27 10:19:02 +00:00
subs r2, 0x2
subs r5, 0x1
cmp r5, 0
2016-01-07 04:23:20 +00:00
bne _081BA9E0
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
bl MultiBoot
adds r5, r0, 0
cmp r5, 0
2016-01-07 04:23:20 +00:00
bne _081BAA18
2015-11-27 10:19:02 +00:00
movs r0, 0xE0
strb r0, [r7, 0x18]
adds r0, 0xB0
strh r0, [r7, 0x16]
2016-01-07 04:23:20 +00:00
b _081BAAEA
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BAA18:
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
bl MultiBootInit
movs r0, 0x1E
mov r1, r10
strb r0, [r1]
movs r0, 0x70
2016-01-07 04:23:20 +00:00
b _081BAAEC
_081BAA28:
2015-11-27 10:19:02 +00:00
movs r5, 0x3
movs r2, 0x49
adds r2, r7
mov r12, r2
mov r8, r12
movs r0, 0x1
mov r9, r0
2016-01-07 04:23:20 +00:00
_081BAA36:
2015-11-27 10:19:02 +00:00
mov r1, r8
ldrb r6, [r1]
adds r0, r6, 0
asrs r0, r5
mov r2, r9
ands r0, r2
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BAA70
2015-11-27 10:19:02 +00:00
lsls r0, r5, 1
ldr r1, =0x04000120
adds r0, r1
ldrh r0, [r0]
adds r4, r0, 0
asrs r2, r4, 8
ldrb r0, [r7, 0x18]
lsrs r0, 1
movs r1, 0x62
subs r1, r0
mov r3, r9
lsls r3, r5
cmp r2, r1
2016-01-07 04:23:20 +00:00
bne _081BAA6A
2015-11-27 10:19:02 +00:00
movs r0, 0xFF
ands r4, r0
cmp r4, r3
2016-01-07 04:23:20 +00:00
beq _081BAA70
_081BAA6A:
2015-11-27 10:19:02 +00:00
eors r6, r3
mov r2, r8
strb r6, [r2]
2016-01-07 04:23:20 +00:00
_081BAA70:
2015-11-27 10:19:02 +00:00
subs r5, 0x1
cmp r5, 0
2016-01-07 04:23:20 +00:00
bne _081BAA36
2015-11-27 10:19:02 +00:00
ldrb r0, [r7, 0x18]
cmp r0, 0xC4
2016-01-07 04:23:20 +00:00
bne _081BAA90
2015-11-27 10:19:02 +00:00
mov r0, r12
ldrb r1, [r0]
movs r0, 0xE
ands r0, r1
strb r0, [r7, 0x1E]
strb r5, [r7, 0x18]
2016-01-07 04:23:20 +00:00
b _081BA88A
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BAA90:
2015-11-27 10:19:02 +00:00
mov r1, r12
ldrb r0, [r1]
cmp r0, 0
2016-01-07 04:23:20 +00:00
bne _081BAAA2
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
bl MultiBootInit
movs r0, 0x50
2016-01-07 04:23:20 +00:00
b _081BAAEC
_081BAAA2:
2015-11-27 10:19:02 +00:00
ldrb r0, [r7, 0x18]
adds r0, 0x2
strb r0, [r7, 0x18]
lsls r0, 24
lsrs r0, 24
cmp r0, 0xC4
2016-01-07 04:23:20 +00:00
bne _081BAAB2
b _081BA88A
_081BAAB2:
2015-11-27 10:19:02 +00:00
ldrb r0, [r7, 0x18]
ldr r1, [r7, 0x28]
adds r0, r1
subs r1, r0, 0x3
ldrb r2, [r1]
lsls r2, 8
subs r0, 0x4
ldrb r1, [r0]
orrs r1, r2
adds r0, r7, 0
bl MultiBootSend
adds r5, r0, 0
cmp r5, 0
2016-01-07 04:23:20 +00:00
bne _081BAAEC
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
adds r0, 0x4B
ldrb r0, [r0]
cmp r0, 0x1
2016-01-07 04:23:20 +00:00
bne _081BAAEA
_081BAADA:
2015-11-27 10:19:02 +00:00
bl MultiBootWaitSendDone
2016-01-07 04:23:20 +00:00
b _081BA736
_081BAAE0:
2015-11-27 10:19:02 +00:00
adds r0, r7, 0
bl MultiBootInit
movs r0, 0x60
2016-01-07 04:23:20 +00:00
b _081BAAEC
_081BAAEA:
2015-11-27 10:19:02 +00:00
movs r0, 0
2016-01-07 04:23:20 +00:00
_081BAAEC:
2015-11-27 10:19:02 +00:00
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end MultiBootMain
thumb_func_start MultiBootSend
2016-09-03 03:51:16 +01:00
@ int MultiBootSend(MultiBootParam *mp, u16 data)
MultiBootSend: @ 81BAAFC
2015-11-27 10:19:02 +00:00
push {r4,lr}
adds r2, r0, 0
lsls r1, 16
lsrs r1, 16
ldr r3, =0x04000128
ldrh r0, [r3]
movs r4, 0x8C
ands r4, r0
cmp r4, 0x8
2016-01-07 04:23:20 +00:00
bne _081BAB34
2015-11-27 10:19:02 +00:00
ldr r0, =0x0400012a
strh r1, [r0]
ldr r1, =0x00002083
adds r0, r1, 0
strh r0, [r3]
adds r1, r2, 0
adds r1, 0x48
movs r0, 0x1
strb r0, [r1]
movs r0, 0
2016-01-07 04:23:20 +00:00
b _081BAB40
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BAB34:
2015-11-27 10:19:02 +00:00
adds r0, r2, 0
bl MultiBootInit
movs r0, 0x8
eors r4, r0
adds r0, r4, 0
2016-01-07 04:23:20 +00:00
_081BAB40:
2015-11-27 10:19:02 +00:00
pop {r4}
pop {r1}
bx r1
thumb_func_end MultiBootSend
thumb_func_start MultiBootStartProbe
2016-09-03 03:51:16 +01:00
@ void MultiBootStartProbe(MultiBootParam *mp)
MultiBootStartProbe: @ 81BAB48
2015-11-27 10:19:02 +00:00
push {lr}
adds r1, r0, 0
ldrb r0, [r1, 0x18]
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BAB5A
2015-11-27 10:19:02 +00:00
adds r0, r1, 0
bl MultiBootInit
2016-01-07 04:23:20 +00:00
b _081BAB66
_081BAB5A:
2015-11-27 10:19:02 +00:00
adds r2, r1, 0
adds r2, 0x4A
strb r0, [r2]
strb r0, [r1, 0x1E]
movs r0, 0x1
strb r0, [r1, 0x18]
2016-01-07 04:23:20 +00:00
_081BAB66:
2015-11-27 10:19:02 +00:00
pop {r0}
bx r0
thumb_func_end MultiBootStartProbe
thumb_func_start MultiBootStartMaster
2016-09-03 03:51:16 +01:00
@ void MultiBootStartMaster(MultiBootParam *mp, u8 *srcp, int length, u8 palette_color, s8 palette_speed)
MultiBootStartMaster: @ 81BAB6C
2015-11-27 10:19:02 +00:00
push {r4-r7,lr}
adds r4, r0, 0
adds r6, r1, 0
ldr r0, [sp, 0x14]
lsls r3, 24
lsrs r5, r3, 24
lsls r0, 24
lsrs r7, r0, 24
movs r3, 0
ldrb r0, [r4, 0x18]
cmp r0, 0
2016-01-07 04:23:20 +00:00
bne _081BABA8
2015-11-27 10:19:02 +00:00
ldrb r0, [r4, 0x1E]
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BABA8
2015-11-27 10:19:02 +00:00
adds r0, r4, 0
adds r0, 0x4A
ldrb r0, [r0]
cmp r0, 0
2016-01-07 04:23:20 +00:00
bne _081BABA8
2015-11-27 10:19:02 +00:00
str r6, [r4, 0x20]
adds r2, 0xF
movs r0, 0x10
negs r0, r0
ands r2, r0
subs r0, 0xF0
adds r1, r2, r0
ldr r0, =0x0003ff00
cmp r1, r0
2016-01-07 04:23:20 +00:00
bls _081BABB4
_081BABA8:
2015-11-27 10:19:02 +00:00
adds r0, r4, 0
bl MultiBootInit
2016-01-07 04:23:20 +00:00
b _081BAC28
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BABB4:
2015-11-27 10:19:02 +00:00
adds r0, r6, r2
str r0, [r4, 0x24]
lsls r1, r7, 24
movs r2, 0x80
lsls r2, 19
adds r0, r1, r2
asrs r0, 24
adds r2, r1, 0
cmp r0, 0x8
2016-01-07 04:23:20 +00:00
bhi _081BAC14
2015-11-27 10:19:02 +00:00
lsls r0, 2
2016-01-07 04:23:20 +00:00
ldr r1, =_081BABD8
2015-11-27 10:19:02 +00:00
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
2016-01-07 04:23:20 +00:00
_081BABD8:
.4byte _081BABFC
.4byte _081BABFC
.4byte _081BABFC
.4byte _081BABFC
.4byte _081BAC06
.4byte _081BAC0C
.4byte _081BAC0C
.4byte _081BAC0C
.4byte _081BAC0C
_081BABFC:
2015-11-27 10:19:02 +00:00
lsls r3, r5, 3
asrs r1, r2, 24
movs r0, 0x3
subs r0, r1
2016-01-07 04:23:20 +00:00
b _081BAC12
_081BAC06:
2015-11-27 10:19:02 +00:00
movs r0, 0x38
adds r3, r5, 0
2016-01-07 04:23:20 +00:00
b _081BAC12
_081BAC0C:
2015-11-27 10:19:02 +00:00
lsls r3, r5, 3
asrs r0, r2, 24
subs r0, 0x1
2016-01-07 04:23:20 +00:00
_081BAC12:
2015-11-27 10:19:02 +00:00
orrs r3, r0
2016-01-07 04:23:20 +00:00
_081BAC14:
2015-11-27 10:19:02 +00:00
movs r0, 0x3F
ands r3, r0
lsls r0, r3, 1
movs r2, 0x7F
negs r2, r2
adds r1, r2, 0
orrs r0, r1
strb r0, [r4, 0x1C]
movs r0, 0xD0
strb r0, [r4, 0x18]
2016-01-07 04:23:20 +00:00
_081BAC28:
2015-11-27 10:19:02 +00:00
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end MultiBootStartMaster
thumb_func_start MultiBootCheckComplete
2016-09-03 03:51:16 +01:00
@ s32 MultiBootCheckComplete(MultiBootParam *mp)
MultiBootCheckComplete: @ 81BAC30
2015-11-27 10:19:02 +00:00
push {lr}
ldrb r0, [r0, 0x18]
cmp r0, 0xE9
2016-01-07 04:23:20 +00:00
beq _081BAC3C
2015-11-27 10:19:02 +00:00
movs r0, 0
2016-01-07 04:23:20 +00:00
b _081BAC3E
_081BAC3C:
2015-11-27 10:19:02 +00:00
movs r0, 0x1
2016-01-07 04:23:20 +00:00
_081BAC3E:
2015-11-27 10:19:02 +00:00
pop {r1}
bx r1
thumb_func_end MultiBootCheckComplete
thumb_func_start MultiBootHandShake
2016-09-03 03:51:16 +01:00
@ int MultiBootHandShake(MultiBootParam *mp)
MultiBootHandShake: @ 81BAC44
2015-11-27 10:19:02 +00:00
push {r4-r6,lr}
adds r3, r0, 0
ldrb r0, [r3, 0x18]
cmp r0, 0xE0
2016-01-07 04:23:20 +00:00
beq _081BAC60
2015-11-27 10:19:02 +00:00
cmp r0, 0xE0
2016-01-07 04:23:20 +00:00
blt _081BAC70
2015-11-27 10:19:02 +00:00
cmp r0, 0xE8
2016-01-07 04:23:20 +00:00
bgt _081BAC70
2015-11-27 10:19:02 +00:00
cmp r0, 0xE7
2016-01-07 04:23:20 +00:00
blt _081BAC70
2015-11-27 10:19:02 +00:00
movs r4, 0x3
ldrb r5, [r3, 0x1E]
2016-01-07 04:23:20 +00:00
b _081BACD0
_081BAC60:
2015-11-27 10:19:02 +00:00
movs r1, 0
movs r0, 0xE1
strb r0, [r3, 0x18]
str r1, [r3, 0x4]
movs r0, 0x80
lsls r0, 13
str r0, [r3]
2016-01-07 04:23:20 +00:00
b _081BACC2
_081BAC70:
2015-11-27 10:19:02 +00:00
movs r4, 0x3
ldrb r5, [r3, 0x1E]
movs r6, 0x1
ldr r1, =0x04000126
2016-01-07 04:23:20 +00:00
_081BAC78:
2015-11-27 10:19:02 +00:00
ldrh r0, [r1]
adds r2, r0, 0
adds r0, r5, 0
asrs r0, r4
ands r0, r6
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BAC8C
2015-11-27 10:19:02 +00:00
ldr r0, [r3, 0x4]
cmp r2, r0
2016-01-07 04:23:20 +00:00
bne _081BAC60
_081BAC8C:
2015-11-27 10:19:02 +00:00
subs r1, 0x2
subs r4, 0x1
cmp r4, 0
2016-01-07 04:23:20 +00:00
bne _081BAC78
2015-11-27 10:19:02 +00:00
ldrb r0, [r3, 0x18]
adds r0, 0x1
strb r0, [r3, 0x18]
ldr r1, [r3]
ldrh r0, [r3]
str r0, [r3, 0x4]
cmp r1, 0
2016-01-07 04:23:20 +00:00
bne _081BACBA
2015-11-27 10:19:02 +00:00
ldr r0, [r3, 0x28]
adds r1, r0, 0
adds r1, 0xAC
ldrb r1, [r1]
adds r0, 0xAD
ldrb r0, [r0]
lsls r0, 8
orrs r1, r0
str r1, [r3, 0x4]
lsls r1, 5
str r1, [r3]
2016-01-07 04:23:20 +00:00
_081BACBA:
2015-11-27 10:19:02 +00:00
ldr r0, [r3]
lsrs r0, 5
str r0, [r3]
2016-01-07 04:23:20 +00:00
_081BACC0:
2015-11-27 10:19:02 +00:00
ldrh r1, [r3]
2016-01-07 04:23:20 +00:00
_081BACC2:
2015-11-27 10:19:02 +00:00
adds r0, r3, 0
bl MultiBootSend
2016-01-07 04:23:20 +00:00
b _081BAD28
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BACD0:
2015-11-27 10:19:02 +00:00
lsls r0, r4, 1
ldr r1, =0x04000120
adds r0, r1
ldrh r0, [r0]
adds r2, r0, 0
adds r0, r5, 0
asrs r0, r4
movs r1, 0x1
ands r0, r1
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BACEC
2015-11-27 10:19:02 +00:00
ldr r0, [r3, 0x4]
cmp r2, r0
2016-01-07 04:23:20 +00:00
bne _081BAD1C
_081BACEC:
2015-11-27 10:19:02 +00:00
subs r4, 0x1
cmp r4, 0
2016-01-07 04:23:20 +00:00
bne _081BACD0
2015-11-27 10:19:02 +00:00
ldrb r0, [r3, 0x18]
adds r0, 0x1
strb r0, [r3, 0x18]
lsls r0, 24
lsrs r0, 24
cmp r0, 0xE9
2016-01-07 04:23:20 +00:00
beq _081BAD26
2015-11-27 10:19:02 +00:00
ldr r0, [r3, 0x28]
adds r1, r0, 0
adds r1, 0xAE
ldrb r1, [r1]
adds r0, 0xAF
ldrb r0, [r0]
lsls r0, 8
orrs r1, r0
str r1, [r3]
str r1, [r3, 0x4]
2016-01-07 04:23:20 +00:00
b _081BACC0
2015-11-27 10:19:02 +00:00
.pool
2016-01-07 04:23:20 +00:00
_081BAD1C:
2015-11-27 10:19:02 +00:00
adds r0, r3, 0
bl MultiBootInit
movs r0, 0x71
2016-01-07 04:23:20 +00:00
b _081BAD28
_081BAD26:
2015-11-27 10:19:02 +00:00
movs r0, 0
2016-01-07 04:23:20 +00:00
_081BAD28:
2015-11-27 10:19:02 +00:00
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end MultiBootHandShake
thumb_func_start MultiBootWaitCycles
2016-09-03 03:51:16 +01:00
@ void MultiBootWaitCycles(u32 cycles)
MultiBootWaitCycles: @ 81BAD30
2015-11-27 10:19:02 +00:00
mov r2, pc
lsrs r2, 24
movs r1, 0xC
cmp r2, 0x2
2016-01-07 04:23:20 +00:00
beq _081BAD42
2015-11-27 10:19:02 +00:00
movs r1, 0xD
cmp r2, 0x8
2016-01-07 04:23:20 +00:00
beq _081BAD42
2015-11-27 10:19:02 +00:00
movs r1, 0x4
2016-01-07 04:23:20 +00:00
_081BAD42:
2015-11-27 10:19:02 +00:00
subs r0, r1
2016-01-07 04:23:20 +00:00
bgt _081BAD42
2015-11-27 10:19:02 +00:00
bx lr
thumb_func_end MultiBootWaitCycles
thumb_func_start MultiBootWaitSendDone
2016-09-03 03:51:16 +01:00
@ void MultiBootWaitSendDone(void)
MultiBootWaitSendDone: @ 81BAD48
2015-11-27 10:19:02 +00:00
push {r4,r5,lr}
movs r2, 0
ldr r3, =0x04000128
ldrh r1, [r3]
movs r0, 0x80
ands r0, r1
cmp r0, 0
2016-01-07 04:23:20 +00:00
beq _081BAD6C
2015-11-27 10:19:02 +00:00
ldr r5, =0x0000795c
movs r4, 0x80
2016-01-07 04:23:20 +00:00
_081BAD5C:
2015-11-27 10:19:02 +00:00
adds r2, 0x1
cmp r2, r5
2016-01-07 04:23:20 +00:00
bgt _081BAD6C
2015-11-27 10:19:02 +00:00
ldrh r1, [r3]
adds r0, r4, 0
ands r0, r1
cmp r0, 0
2016-01-07 04:23:20 +00:00
bne _081BAD5C
_081BAD6C:
2015-11-27 10:19:02 +00:00
movs r0, 0x96
lsls r0, 2
bl MultiBootWaitCycles
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end MultiBootWaitSendDone
2016-09-03 07:11:29 +01:00
.align 2, 0 @ Don't pad with nop.