aboutsummaryrefslogtreecommitdiff
path: root/freebios
diff options
context:
space:
mode:
authorCasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com>2023-12-06 00:03:53 -0800
committerNadia Holmquist Pedersen <nadia@nhp.sh>2023-12-06 16:51:22 +0100
commit1b7b5106e24d1bad0776c97696f834209e30d900 (patch)
tree156bbe4a1861518c670ec92ad4507a2a48485729 /freebios
parent090627b3c19488e36677113e2f1ac16bdb4e2d05 (diff)
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.
Diffstat (limited to 'freebios')
-rwxr-xr-xfreebios/bios_common.S3
-rwxr-xr-xfreebios/drastic_bios_arm7.binbin16384 -> 16384 bytes
-rwxr-xr-xfreebios/drastic_bios_arm9.binbin4096 -> 4096 bytes
3 files changed, 3 insertions, 0 deletions
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
--- a/freebios/drastic_bios_arm7.bin
+++ b/freebios/drastic_bios_arm7.bin
Binary files differ
diff --git a/freebios/drastic_bios_arm9.bin b/freebios/drastic_bios_arm9.bin
index 51a8282..95c330d 100755
--- a/freebios/drastic_bios_arm9.bin
+++ b/freebios/drastic_bios_arm9.bin
Binary files differ