osReadHost osReadHost (function)

osReadHost, osWriteHost, osTestHost

Transfers data between host memory and RDRAM


#include <ultra64.h> /* ultra64.h */
void osReadHost(void *vAddr, s32 nbytes);
void osWriteHost(void *vAddr, s32 nbytes);
s32 osTestHost(void);

* osTestHost routine is not supported.

* osAckRamromRead and osAckRamromWrite are used to form associations with uhReadRamrom and uhWriteRamrom, but there currently is no need to use them. (They are ignored.)


These routines are used to transfer data between the 64 game and the host application. These are written into the 64 program, and function paired with the uh** function, which is declared in <ultrahost.h> in the host-side application.

The osReadHost routine receives nbytes of data sent by uhWriteGame on the host side at the address vAddr in RDRAM.

The osWriteHost routine transfers nbytes of data from the address vAddr in RDRAM to uhReadGame on the host side.

For more precise synchronization, accurately match the numbers of bytes transferred in the paired functions osReadHost and uhWriteGame, and osWriteHost and uhReadGame.

When any of the functions is called, the corresponding host-side command is executed, and the thread at the call origin is blocked until the transfer is completed.

For example, if osReadHost is executed on the game side, the thread on the game side is interrupted until uhWriteGame is executed on the host side. Conversely, if uhWriteGame is executed, the program is blocked on the host side until osReadHost is executed on the game side.

Align the DRAM virtual address on 8 bytes (64 bit). Also make the transfer size nbytes a multiple of 4. (Due to a 4 bytes restriction on the host side)

Please be aware of the "endian" differences when data transferred from a host-side program on an Intel machine are to be used by a 64 program, or when data transferred from a 64 program are to be used by a host-side program on an Intel machine.


Because these use 64 development environmental functions, it is necessary to link to a debugging library when compiling. (-|**_d)

Restrictions in PARTNER

Add the PTN64 definition to the compile options in makefile. (-DPTN64)

osCreateViManager must be executed before using this routine in the PC version of PARTNER. This is a restriction since a timer is used inside the function.

See Also

See uhOpenGame regarding exact opening methods and how to use connections from the host.

uhOpenGame, uhCloseGame, uhReadGame, uhWriteGame, and osWriteHost

Revision History

1999/04/30 Changed format