From d1009a1680869fb611f34bd06b28fdaee41b580f Mon Sep 17 00:00:00 2001 From: Ry Date: Wed, 10 Aug 2022 18:12:14 -0700 Subject: [PATCH] Fix broken `ryfs_read` routine, bump version to 0.3.1 There were two issues here: First, ryfs_read_sector_loop was not setting the current sector to the next sector of the file being read. This had the effect of making it read the same sector over and over again. Second, the destination pointer for the `copy_memory_bytes` call wasn't being changed after each sector copy. --- main.asm | 2 +- ryfs.asm | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/main.asm b/main.asm index ea4477b..6b0d100 100644 --- a/main.asm +++ b/main.asm @@ -4,7 +4,7 @@ const FOX32ROM_VERSION_MAJOR: 0 const FOX32ROM_VERSION_MINOR: 3 -const FOX32ROM_VERSION_PATCH: 0 +const FOX32ROM_VERSION_PATCH: 1 const SYSTEM_STACK: 0x01FFF800 const BACKGROUND_COLOR: 0xFF674764 diff --git a/ryfs.asm b/ryfs.asm index 3622cf7..61157eb 100644 --- a/ryfs.asm +++ b/ryfs.asm @@ -199,7 +199,14 @@ ryfs_read_sector_loop: pop r1 pop r0 - dec r10 + ; this_sector = this_sector.next + mov r5, TEMP_SECTOR_BUF + add r5, 2 + movz.16 r5, [r5] + mov r4, r5 + + add r2, r11 + sub r10, r11 ifnz jmp ryfs_read_sector_loop ; file_struct.file_seek_offset += input r0