diff --git a/fox32rom.def b/fox32rom.def index 987866f..218aadb 100644 --- a/fox32rom.def +++ b/fox32rom.def @@ -68,6 +68,7 @@ ryfs_read: jmp [0xF0045010] ryfs_read_whole_file: jmp [0xF0045014] ryfs_get_size: jmp [0xF0045018] ryfs_get_file_list: jmp [0xF004501C] +ryfs_tell: jmp [0xF0045020] ; memory copy/compare jump table copy_memory_bytes: jmp [0xF0046000] diff --git a/main.asm b/main.asm index 4837b8e..bff913a 100644 --- a/main.asm +++ b/main.asm @@ -3,8 +3,8 @@ org 0xF0000000 const FOX32ROM_VERSION_MAJOR: 0 -const FOX32ROM_VERSION_MINOR: 3 -const FOX32ROM_VERSION_PATCH: 3 +const FOX32ROM_VERSION_MINOR: 4 +const FOX32ROM_VERSION_PATCH: 0 const SYSTEM_STACK: 0x01FFF800 const BACKGROUND_COLOR: 0xFF674764 @@ -242,6 +242,7 @@ get_rom_version: data.32 ryfs_read_whole_file data.32 ryfs_get_size data.32 ryfs_get_file_list + data.32 ryfs_tell ; memory copy/compare jump table org.pad 0xF0046000 diff --git a/ryfs.asm b/ryfs.asm index feda4fc..9d58a7a 100644 --- a/ryfs.asm +++ b/ryfs.asm @@ -73,6 +73,17 @@ ryfs_seek: pop r1 ret +; get the seek offset of the specified file +; inputs: +; r0: pointer to file struct +; outputs: +; r0: byte offset +ryfs_tell: + add r0, 3 + mov r0, [r0] + + ret + ; read specified number of bytes into the specified buffer ; inputs: ; r0: number of bytes to read