Load File From SD Card [Bushing / Segher]
#1
Load File From SD Card [Bushing / Segher]

This code loads the contents of a file located on the SD card into RAM. The steps below illustrate how to use the code:
1) The function takes two arguments. The first argument (r3) is a pointer to a string that contains the path to the file to read in. The second argument (r4) is a pointer to a buffer to write the full contents of the file to.
- An example string of a file that is located on the root of the SD card would be "name.ext".
- An example string of a file that is located in a directory on the root of the SD card would be "dir/name.ext".
2) Call the function at the address that corresponds to your game's region (NTSC-U = 0x802583E0, PAL = 0x80258700, NTSC-J = 0x802580A0, NTSC-K = 0x802584E0).
3) Upon completion of the function, one must check the return value (r3). A return value of zero indicates that the file contents were successfully loaded into RAM. A non-zero value indicates failure.
[Image: GiVNKqR.png]
Reply


Messages In This Thread
Load File From SD Card [Bushing / Segher] - by Star - 01-15-2020, 07:03 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)