Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
cd_reader.c File Reference
#include "engine/game.h"
#include <libgs.h>
#include <libetc.h>
#include <libsnd.h>
Include dependency graph for cd_reader.c:

Go to the source code of this file.

Functions

s32 cdCheckSector (void)
 Checks that the sector just read is the next one.
 
void cdReadyCallback (s32 status, u_char *result)
 The CdReadyCallback: copies each sector as it arrives, pauses at the end.
 
void cdSyncCallback (s32 status, u_char *result)
 The CdSyncCallback: Setloc, Setmode (double speed, whole sectors), ReadN, and CdlPause once the sectors are in.
 
s32 isCdReading (void)
 Whether the CD reader is busy.
 
void startCdRead (void)
 Starts the read readFile set up: seeks to its first sector.
 
void readFile (s32 file, s32 offset, s32 size, void *buffer, s32 *done)
 Starts reading size sectors (0: all) of a file into buffer; ignored while busy.
 

Variables

static u_char CD_MODE [8]
 -G8 unit: small variables defined here are reached through $gp
 
CdReader CD_READER
 The CD reader.
 

Function Documentation

◆ cdCheckSector()

s32 cdCheckSector ( void  )

Checks that the sector just read is the next one.

Definition at line 17 of file cd_reader.c.

Referenced by cdReadyCallback().

Here is the caller graph for this function:

◆ cdReadyCallback()

void cdReadyCallback ( s32  status,
u_char *  result 
)

The CdReadyCallback: copies each sector as it arrives, pauses at the end.

The two callbacks take the status as an int, not CdlCB's u_char, which GCC would truncate on entry (more code), so they are registered with a cast.

< Data Ready

Definition at line 34 of file cd_reader.c.

Referenced by cdSyncCallback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cdSyncCallback()

void cdSyncCallback ( s32  status,
u_char *  result 
)

The CdSyncCallback: Setloc, Setmode (double speed, whole sectors), ReadN, and CdlPause once the sectors are in.

< Error Detected

< Command Complete

< 0: normal speed 1: double speed

< 0: 2048 byte 1: 2340byte

Definition at line 54 of file cd_reader.c.

Referenced by startCdRead().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCdReading()

s32 isCdReading ( void  )

Whether the CD reader is busy.

Definition at line 95 of file cd_reader.c.

Referenced by readFile().

Here is the caller graph for this function:

◆ startCdRead()

void startCdRead ( void  )

Starts the read readFile set up: seeks to its first sector.

Definition at line 100 of file cd_reader.c.

Referenced by cdSyncCallback(), and readFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readFile()

void readFile ( s32  file,
s32  offset,
s32  size,
void *  buffer,
s32 *  done 
)

Starts reading size sectors (0: all) of a file into buffer; ignored while busy.

Definition at line 110 of file cd_reader.c.

Here is the call graph for this function:

Variable Documentation

◆ CD_MODE

u_char CD_MODE[8]
static

-G8 unit: small variables defined here are reached through $gp

Definition at line 7 of file cd_reader.c.

Referenced by cdSyncCallback().

◆ CD_READER

CdReader CD_READER
Initial value:
= {
0, 0, 0, 0, 0, ((void *)0) , {0}, 0, 0, 0, 0,
}
void readFile(s32 file, s32 offset, s32 size, void *buffer, s32 *done)
Starts reading size sectors (0: all) of a file into buffer; ignored while busy.
Definition cd_reader.c:110
s32 isCdReading(void)
Whether the CD reader is busy.
Definition cd_reader.c:95

The CD reader.

Definition at line 10 of file cd_reader.c.

Referenced by cdCheckSector(), cdReadyCallback(), cdSyncCallback(), FIELDSTG_requestTiles(), FIELDSTG_runMapStreamer(), FIELDSTG_seekStream(), isCdReading(), loadFile(), readFile(), showField(), startCdRead(), updateFileCache(), and waitToRequestBattleFiles().