Skip to content

Commit

Permalink
FreeBIOS: Ensure upper 16 bits are cleared in the initial crc16 value.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CasualPokePlayer authored and nadiaholmquist committed Dec 6, 2023
1 parent 090627b commit 1b7b510
Show file tree
Hide file tree
Showing 4 changed files with 347 additions and 344 deletions.
3 changes: 3 additions & 0 deletions freebios/bios_common.S
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file modified freebios/drastic_bios_arm7.bin
Binary file not shown.
Binary file modified freebios/drastic_bios_arm9.bin
Binary file not shown.
Loading

0 comments on commit 1b7b510

Please sign in to comment.