From 1b7b5106e24d1bad0776c97696f834209e30d900 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Wed, 6 Dec 2023 00:03:53 -0800 Subject: FreeBIOS: Ensure upper 16 bits are cleared in the initial crc16 value. Fixes Castlevania: Dawn of Sorrow's checksumming which uses crc16 swi and has garbage in the upper 16 bits of r0. The official BIOS would seem to implicitly clear these upper 16 bits. --- freebios/bios_common.S | 3 +++ freebios/drastic_bios_arm7.bin | Bin 16384 -> 16384 bytes freebios/drastic_bios_arm9.bin | Bin 4096 -> 4096 bytes 3 files changed, 3 insertions(+) (limited to 'freebios') diff --git a/freebios/bios_common.S b/freebios/bios_common.S index 56d349e..308d67c 100755 --- a/freebios/bios_common.S +++ b/freebios/bios_common.S @@ -517,6 +517,9 @@ swi_get_crc16: mov const_0x1E, #0x1E adr crc_table_ptr, crc_table + bic crc_value, crc_value, #0xFF000000 + bic crc_value, crc_value, #0x00FF0000 + movs crc_length, crc_length, lsr #1 beq 1f diff --git a/freebios/drastic_bios_arm7.bin b/freebios/drastic_bios_arm7.bin index e586eb9..adffb53 100755 Binary files a/freebios/drastic_bios_arm7.bin and b/freebios/drastic_bios_arm7.bin differ diff --git a/freebios/drastic_bios_arm9.bin b/freebios/drastic_bios_arm9.bin index 51a8282..95c330d 100755 Binary files a/freebios/drastic_bios_arm9.bin and b/freebios/drastic_bios_arm9.bin differ -- cgit v1.2.3