mirror of https://github.com/mgba-emu/mgba.git
GBA BIOS: Change fix for #1059 to break fewer games
This commit is contained in:
parent
eef3b5a57c
commit
a9ef7af3b1
|
@ -428,7 +428,7 @@ void GBASwi16(struct ARMCore* cpu, int immediate) {
|
|||
|
||||
switch (immediate) {
|
||||
case 0xF0: // Used for internal stall counting
|
||||
cpu->gprs[12] = gba->biosStall;
|
||||
cpu->gprs[11] = gba->biosStall;
|
||||
return;
|
||||
case 0xFA:
|
||||
GBAPrintFlush(gba);
|
||||
|
|
|
@ -9,17 +9,17 @@ const uint8_t hleBios[SIZE_BIOS] = {
|
|||
0x03, 0x10, 0xd0, 0xe5, 0xea, 0x00, 0x51, 0xe3, 0x4c, 0x01, 0x9f, 0x15,
|
||||
0x10, 0xff, 0x2f, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x29, 0xe1,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, 0xe3, 0x01, 0xd3, 0xa0, 0x03,
|
||||
0x20, 0xd0, 0x4d, 0x02, 0x10, 0x50, 0x2d, 0xe9, 0x02, 0x40, 0x5e, 0xe5,
|
||||
0xd4, 0xc0, 0xa0, 0xe3, 0x04, 0x41, 0x9c, 0xe7, 0xd2, 0xcf, 0xa0, 0xe3,
|
||||
0x04, 0x00, 0x5c, 0xe1, 0x00, 0xc0, 0x4f, 0xe1, 0x00, 0x10, 0x2d, 0xe9,
|
||||
0x80, 0xc0, 0x0c, 0xe2, 0x1f, 0xc0, 0x8c, 0xe3, 0x0c, 0xf0, 0x21, 0xe1,
|
||||
0x00, 0x00, 0xf0, 0x0f, 0x04, 0x40, 0x2d, 0xe9, 0x00, 0x00, 0x54, 0xe3,
|
||||
0x20, 0xd0, 0x4d, 0x02, 0x00, 0x58, 0x2d, 0xe9, 0x02, 0xc0, 0x5e, 0xe5,
|
||||
0xd4, 0xb0, 0xa0, 0xe3, 0x0c, 0xc1, 0x9b, 0xe7, 0xd2, 0xbf, 0xa0, 0xe3,
|
||||
0x0c, 0x00, 0x5b, 0xe1, 0x00, 0xb0, 0x4f, 0xe1, 0x00, 0x08, 0x2d, 0xe9,
|
||||
0x80, 0xb0, 0x0b, 0xe2, 0x1f, 0xb0, 0x8b, 0xe3, 0x0b, 0xf0, 0x21, 0xe1,
|
||||
0x00, 0x00, 0xf0, 0x0f, 0x04, 0x40, 0x2d, 0xe9, 0x00, 0x00, 0x5c, 0xe3,
|
||||
0x00, 0x00, 0xa0, 0xe1, 0x00, 0x00, 0xa0, 0xe1, 0x00, 0x00, 0xa0, 0xe1,
|
||||
0x00, 0x00, 0xa0, 0xe1, 0x00, 0x00, 0xa0, 0xe1, 0x00, 0x00, 0xa0, 0xe1,
|
||||
0x0f, 0xe0, 0xa0, 0xe1, 0x14, 0xff, 0x2f, 0x11, 0x00, 0x00, 0xa0, 0xe1,
|
||||
0x0f, 0xe0, 0xa0, 0x11, 0x1c, 0xff, 0x2f, 0x11, 0x00, 0x00, 0xa0, 0xe1,
|
||||
0x00, 0x00, 0xa0, 0xe1, 0x00, 0x00, 0xa0, 0xe1, 0x04, 0x40, 0xbd, 0xe8,
|
||||
0x93, 0xf0, 0x29, 0xe3, 0x00, 0x10, 0xbd, 0xe8, 0x0c, 0xf0, 0x69, 0xe1,
|
||||
0x10, 0x50, 0xbd, 0xe8, 0x0e, 0xf0, 0xb0, 0xe1, 0x00, 0x00, 0x00, 0x00,
|
||||
0x93, 0xf0, 0x29, 0xe3, 0x00, 0x08, 0xbd, 0xe8, 0x0b, 0xf0, 0x69, 0xe1,
|
||||
0x00, 0x58, 0xbd, 0xe8, 0x0e, 0xf0, 0xb0, 0xe1, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x20, 0xa0, 0xe3, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00,
|
||||
0xb0, 0x01, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, 0xb0, 0x01, 0x00, 0x00,
|
||||
0xcc, 0x01, 0x00, 0x00, 0xc4, 0x01, 0x00, 0x00, 0x48, 0x03, 0x00, 0x00,
|
||||
|
@ -73,5 +73,5 @@ const uint8_t hleBios[SIZE_BIOS] = {
|
|||
0x01, 0xa0, 0xa0, 0xe1, 0xfa, 0x07, 0xa0, 0xe8, 0xfa, 0x07, 0xa0, 0xe8,
|
||||
0xfa, 0x07, 0xa0, 0xe8, 0xfa, 0x07, 0xa0, 0xe8, 0x00, 0x10, 0xa0, 0xe3,
|
||||
0xf0, 0x07, 0xbd, 0xe8, 0x1e, 0xff, 0x2f, 0xe1, 0xb0, 0x01, 0x00, 0x00,
|
||||
0x04, 0xc0, 0x5c, 0xe2, 0xfd, 0xff, 0xff, 0x8a, 0x1e, 0xff, 0x2f, 0xe1
|
||||
0x04, 0xb0, 0x5b, 0xe2, 0xfd, 0xff, 0xff, 0x8a, 0x1e, 0xff, 0x2f, 0xe1
|
||||
};
|
||||
|
|
|
@ -31,36 +31,36 @@ swiBase:
|
|||
cmp sp, #0
|
||||
moveq sp, #0x04000000
|
||||
subeq sp, #0x20
|
||||
stmfd sp!, {r4, r12, lr}
|
||||
ldrb r4, [lr, #-2]
|
||||
mov r12, #swiTable
|
||||
ldr r4, [r12, r4, lsl #2]
|
||||
mov r12, #StallCall
|
||||
cmp r12, r4
|
||||
mrs r12, spsr
|
||||
stmfd sp!, {r12}
|
||||
and r12, #0x80
|
||||
orr r12, #0x1F
|
||||
msr cpsr_c, r12
|
||||
swieq 0xF00000 @ Special mGBA-internal call to load the stall count into r12
|
||||
stmfd sp!, {r11, r12, lr}
|
||||
ldrb r12, [lr, #-2]
|
||||
mov r11, #swiTable
|
||||
ldr r12, [r11, r12, lsl #2]
|
||||
mov r11, #StallCall
|
||||
cmp r11, r12
|
||||
mrs r11, spsr
|
||||
stmfd sp!, {r11}
|
||||
and r11, #0x80
|
||||
orr r11, #0x1F
|
||||
msr cpsr_c, r11
|
||||
swieq 0xF00000 @ Special mGBA-internal call to load the stall count into r11
|
||||
stmfd sp!, {r2, lr}
|
||||
cmp r4, #0
|
||||
cmp r12, #0
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
mov lr, pc
|
||||
bxne r4
|
||||
movne lr, pc
|
||||
bxne r12
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
ldmfd sp!, {r2, lr}
|
||||
msr cpsr, #0x93
|
||||
ldmfd sp!, {r12}
|
||||
msr spsr, r12
|
||||
ldmfd sp!, {r4, r12, lr}
|
||||
ldmfd sp!, {r11}
|
||||
msr spsr, r11
|
||||
ldmfd sp!, {r11, r12, lr}
|
||||
movs pc, lr
|
||||
.word 0
|
||||
.word 0xE3A02004
|
||||
|
@ -310,6 +310,6 @@ ArcTan:
|
|||
ArcTan2:
|
||||
|
||||
StallCall:
|
||||
subs r12, #4
|
||||
subs r11, #4
|
||||
bhi StallCall
|
||||
bx lr
|
||||
|
|
Loading…
Reference in New Issue