Access completion check [important]
GFS_NwCdRead does not complete until data transfer is completed or access is interrupted (except for access to CDDA files), so do not wait for it to complete. Note that an endless loop occurs when GFS_NwExecOne is completed as in the previous manual example.
If GFS_NwFread is not prefetched with GFS_NwCdRead, you can check completion by the same procedure as the previous version.
When pre-reading from the CD, use GFS_NwGetStat to monitor the number of transferred bytes and check for completion. An example is shown below.
GfsHn gfs;
Sint32 fid, stat, nbyte;
Uint32 buf[10*2048/4];
gfs = GFS_Open(fid);
GFS_NwCdRead(gfs, 100);
for (i = 0; i <10; ++ i) {
GFS_NwFread(gfs, 10, buf, 10*2048);
while (GFS_NwExecOne(gfs) != GFS_SVR_COMPLETE) {
GFS_NwGetStat(gfs, &stat, &nbyte);
/ * Check if the number of bytes specified by GFS_NwFread has been read * /
if (nbyte> = 10 * 2048) {
break;
}
user (); / * Application processing * /
}
}