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.
Cautions
Because these use 64 development environment 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 uhOpenGame for an example that shows how to correctly initiate and use a connection from the host.