al - Audio Library Functions gDP - DP GBI Macros gdSP - General GBI Macros gSP - SP GBI Macros gt - Turbo Microcode RDP gu - Graphics Utilities Math - Math Functions nuSys - NuSystem os - N64 Operating System sp - Sprite Library Functions uh - Host to Target IO 64DD - N64 Disk Drive
|
osGbpakReadWriteSyntax#include <ultra64.h>
Explanation
Before calling osGbpakReadWrite(), 64GB Pak must be initialized by osGbpakInit(), the Game Boy ROM registration area must be read and the power turned on and the manufacturer code and game title must be checked by osGbpakReadId(). In addition, the connector must be checked by osGbpakCheckConnector(). The OSpfs structure pfs must be initialized by osGbpakInit(). Specify in "flag" either OS_READ or OS_WRITE. When OS_READ is specified, data is read from the Game Boy game pak, while OS_WRITE specifies writing data to the Game Boy game pak. Specify in "address" the value of the Game Boy game pak's CPU address (0x0000 ~ 0xbfff). The number of bytes to read or write is specifed by size. address and size must be multiples of 32. buffer is a pointer to the buffer in RDRAM where the read or write is performed. Caution is required when dealing with the returned values. This function cannot determine whether the Game Boy game pak has been pulled out, or whether Game Boy game paks have been exchanged. That is to say, a "0" (normal termination) is returned even if the Game Boy game pak has been removed during function operations. Before and after this function is called, osGbpakGetStatus() or osGbpakReadId() should be called for a status check. It should also be confirmed that the Game Boy cartridge has not been removed and reinserted. Return value is an error code. If the function terminates normally, a value of 0 is returned. If an error occurs, one of the following error codes is returned: PFS_ERR_NOPACK
PFS_ERR_CONTRFAIL
When the Game Boy cartridge is not accessed for some time after reading or writing with osGbpakReadWrite(), the Game Boy cartridge power should always be turned off using osGbpakPower(). See Also
|