Loading files: Difference between revisions
mNo edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
*An optional pad byte to align: | *An optional pad byte to align: | ||
*Destination address (32bit) | *Destination address (32bit) | ||
*Zero-terminated | |||
Example: | |||
<syntaxhighlight> | |||
file_list | |||
dc.b 'FILE1.SPR', $00 ; file name | |||
dc.b $02 ; bank | |||
dc.b $00 ; padding | |||
dc.l $00000000 ; destination | |||
dc.b 'FILE2.SPR', $00 ; file name | |||
dc.b $03 ; bank | |||
dc.b $00 ; padding | |||
dc.l $00000000 ; destination | |||
dc.b $00 ; End of list | |||
</syntaxhighlight> | |||
The destination memory is automatically chosen according to the file's extension. | The destination memory is automatically chosen according to the file's extension. | ||
Line 19: | Line 35: | ||
[[Category:CD systems]] | [[Category:CD systems]] | ||
[[Category:Code]] | [[Category:Code]] | ||
==Samurai Shodown RPG Loading== | |||
Once the bios has handled the initial IPL loading for this game all other loading is handled by the game itself and not the bios calls above. The IPL loads file 'EXT_SYS.PRG' to 0x132000 and all known future 'in game' loading is handled by code in this area. Why the games uses this instead of the bios is not currently known but it may be related to the bios not being able to handle the amount of files stored on the CD disc (3831) or to optimize loading of the many small files used by the game. | |||
This code will need investigating to obtain a full understanding of why it is used over the bios. There may also be other bios routines not related to loading used here too. |
Latest revision as of 04:10, 17 November 2024
BIOS calls BIOSF_LOADFILE ($C00552) and BIOSF_LOADFILEX ($C00564) are used to load files from the CD.
The BIOSF_LOADFILE call displays a loading animation, while BIOSF_LOADFILEX (better name ?) doesn't.
Register A0 needs to point to a block indicating:
- The filename, ended by a 0 byte
- The bank number (8bit)
- An optional pad byte to align:
- Destination address (32bit)
- Zero-terminated
Example:
file_list
dc.b 'FILE1.SPR', $00 ; file name
dc.b $02 ; bank
dc.b $00 ; padding
dc.l $00000000 ; destination
dc.b 'FILE2.SPR', $00 ; file name
dc.b $03 ; bank
dc.b $00 ; padding
dc.l $00000000 ; destination
dc.b $00 ; End of list
The destination memory is automatically chosen according to the file's extension.
Rules:
- SPR files have 1MiB banks. PCM files have 512KiB banks. Other types aren't banked.
- FIX files and PCM files need to have their destination address multiplied by 2.
BIOS RAM adresses for currently loaded sectors, total sectors ?...
Samurai Shodown RPG Loading
Once the bios has handled the initial IPL loading for this game all other loading is handled by the game itself and not the bios calls above. The IPL loads file 'EXT_SYS.PRG' to 0x132000 and all known future 'in game' loading is handled by code in this area. Why the games uses this instead of the bios is not currently known but it may be related to the bios not being able to handle the amount of files stored on the CD disc (3831) or to optimize loading of the many small files used by the game.
This code will need investigating to obtain a full understanding of why it is used over the bios. There may also be other bios routines not related to loading used here too.