GBA BIOS: Add DACS compatibility to HLE BIOS (closes #2972)

This commit is contained in:
Vicki Pfau 2023-07-04 23:23:17 -07:00
parent 3f0d06e307
commit 44e074a15e
2 changed files with 42 additions and 5 deletions

View File

@ -3,9 +3,9 @@
#include <mgba/internal/gba/memory.h>
const uint8_t hleBios[GBA_SIZE_BIOS] = {
0xd3, 0x00, 0x00, 0xea, 0x66, 0x00, 0x00, 0xea, 0x0c, 0x00, 0x00, 0xea,
0xfe, 0xff, 0xff, 0xea, 0xfe, 0xff, 0xff, 0xea, 0x00, 0x00, 0xa0, 0xe1,
0x59, 0x00, 0x00, 0xea, 0xfe, 0xff, 0xff, 0xea, 0x00, 0x00, 0x00, 0x00,
0xd3, 0x00, 0x00, 0xea, 0xe1, 0x00, 0x00, 0xea, 0x0c, 0x00, 0x00, 0xea,
0xdf, 0x00, 0x00, 0xea, 0xde, 0x00, 0x00, 0xea, 0x00, 0x00, 0xa0, 0xe1,
0x59, 0x00, 0x00, 0xea, 0xdb, 0x00, 0x00, 0xea, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, 0xe3, 0x01, 0xd3, 0xa0, 0x03,
@ -78,5 +78,13 @@ const uint8_t hleBios[GBA_SIZE_BIOS] = {
0x00, 0x10, 0xa0, 0x13, 0x1e, 0xff, 0x2f, 0x11, 0x1c, 0xe0, 0x9f, 0xe5,
0x00, 0x10, 0x9e, 0xe5, 0x00, 0x00, 0x51, 0xe3, 0x00, 0x10, 0xa0, 0xe3,
0x1e, 0xff, 0x2f, 0x11, 0xc0, 0xe0, 0x4e, 0xe2, 0x1e, 0xff, 0x2f, 0xe1,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x29, 0xe1, 0xc0, 0x00, 0x00, 0x02
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x29, 0xe1, 0xc0, 0x00, 0x00, 0x02,
0x4c, 0xd0, 0x9f, 0xe5, 0x00, 0x50, 0x2d, 0xe9, 0x00, 0xc0, 0x4f, 0xe1,
0x00, 0xe0, 0x0f, 0xe1, 0x00, 0x50, 0x2d, 0xe9, 0x02, 0xe3, 0xa0, 0xe3,
0x9c, 0xc0, 0xde, 0xe5, 0xa5, 0x00, 0x5c, 0xe3, 0x04, 0x00, 0x00, 0x1a,
0xb4, 0xc0, 0xde, 0xe5, 0x80, 0x00, 0x1c, 0xe3, 0x04, 0xe0, 0x8f, 0xe2,
0x20, 0xf0, 0x9f, 0x15, 0x20, 0xf0, 0x9f, 0x05, 0x14, 0xd0, 0x9f, 0xe5,
0x10, 0xc0, 0x1d, 0xe5, 0x0c, 0xf0, 0x69, 0xe1, 0x00, 0x50, 0x3d, 0xe9,
0x04, 0xf0, 0x5e, 0xe2, 0x00, 0x00, 0x00, 0x00, 0x04, 0xe0, 0xa0, 0x03,
0xf0, 0x7f, 0x00, 0x03, 0x00, 0x20, 0xfe, 0x09, 0x00, 0xc0, 0xff, 0x09
};

View File

@ -123,7 +123,7 @@ subs pc, lr, #4
.word 0
.word 0xE55EC002
undefBase:
@ Padding for back compat
subs pc, lr, #4
.word 0
.word 0x03A0E004
@ -328,3 +328,32 @@ sub lr, #0xC0
bx lr
.word 0
.word 0xE129F000
.ltorg
undefBase:
pabtBase:
dabtBase:
fiqBase:
ldr sp, =0x03007FF0
stmdb sp!, {r12, lr}
mrs r12, spsr
mrs lr, cpsr
stmdb sp!, {r12, lr}
mov lr, #0x08000000
ldrb r12, [lr, #0x9C]
cmp r12, #0xA5
bne 1f
ldrb r12, [lr, #0xB4]
tst r12, #0x80
adr lr, 1f
ldrne pc, =0x09FE2000
ldreq pc, =0x09FFC000
1:
ldr sp, =0x03007FF0
ldr r12, [sp, #-0x10]
msr spsr, r12
ldmdb sp!, {r12, lr}
subs pc, lr, #4
.word 0
.word 0x03A0E004