DATEL: Make read sector function vram safe (#80)

* DATEL: Make read sector function vram safe

The platform code was performing reads in single byte units, breaking in case the destination buffer was in vram.
This caused issues with some games (e.g. Castelvania Order of Ecclesia), and also broke soft resetting.

* Halve wait timeout on sector read since we read 2 bytes at the time
This commit is contained in:
Edoardo Lolletti
2025-12-30 20:10:02 +01:00
committed by GitHub
parent 842dd8e63a
commit 992e2d1053
4 changed files with 30 additions and 11 deletions

View File

@@ -29,6 +29,16 @@ BEGIN_ASM_FUNC datel_readWriteSpiByte
cmp r0, #0
pop {r1-r3, pc}
@u16 datel_readWriteSpiShort();
BEGIN_ASM_FUNC datel_readSpiShort
push {r1-r7, lr}
bl datel_readSpiByte
movs r1, r0
bl datel_readSpiByte
lsls r0, #8
orrs r0, r1
pop {r1-r7, pc}
@u8 datel_readSpiByteTimeout(void);
BEGIN_ASM_FUNC datel_readSpiByteTimeout
push {r1-r4, lr}