From f89184d51fa4fb38c8d82a17de5d6525e6aa915e Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 31 Oct 2024 22:47:51 -0700 Subject: [PATCH] GBA BIOS: Fix locked BIOS read on boot --- src/gba/hle-bios.c | 4 ++-- src/gba/hle-bios.s | 5 +++-- src/gba/video.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gba/hle-bios.c b/src/gba/hle-bios.c index 841caf543..8f689fa7a 100644 --- a/src/gba/hle-bios.c +++ b/src/gba/hle-bios.c @@ -75,9 +75,9 @@ const uint8_t hleBios[GBA_SIZE_BIOS] = { 0xf0, 0x07, 0xbd, 0xe8, 0x1e, 0xff, 0x2f, 0xe1, 0xb0, 0x01, 0x00, 0x00, 0x04, 0xb0, 0x5b, 0xe2, 0xfd, 0xff, 0xff, 0x8a, 0x1e, 0xff, 0x2f, 0xe1, 0xc2, 0xe3, 0xa0, 0xe3, 0x03, 0x10, 0x5e, 0xe4, 0x00, 0x00, 0x51, 0xe3, - 0x00, 0x10, 0xa0, 0x13, 0x1e, 0xff, 0x2f, 0x11, 0x1c, 0xe0, 0x9f, 0xe5, + 0x00, 0x10, 0xa0, 0x13, 0x05, 0x00, 0x00, 0x1a, 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, 0x1a, 0xc0, 0xe0, 0x4e, 0xe2, 0x1e, 0xff, 0x2f, 0xe1, 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, diff --git a/src/gba/hle-bios.s b/src/gba/hle-bios.s index 07f827b26..aa77160c1 100644 --- a/src/gba/hle-bios.s +++ b/src/gba/hle-bios.s @@ -318,13 +318,14 @@ mov lr, #0x8000003 ldrb r1, [lr], #-3 cmp r1, #0 movne r1, #0 -bxne lr +bne 1f ldr lr, =0x20000C0 ldr r1, [lr] cmp r1, #0 mov r1, #0 -bxne lr +bne 1f sub lr, #0xC0 +1: bx lr .word 0 .word 0xE129F000 diff --git a/src/gba/video.c b/src/gba/video.c index 63e7115c1..749a29be0 100644 --- a/src/gba/video.c +++ b/src/gba/video.c @@ -70,7 +70,7 @@ void GBAVideoReset(struct GBAVideo* video) { } else { // TODO: Verify exact scanline on hardware video->vcount = 0x7E; - nextEvent = 117; + nextEvent = 120; } video->p->memory.io[GBA_REG(VCOUNT)] = video->vcount;