CDROM functions

cd_boot( void );

cd_getver( void );

Returns CDROM system card version number in BCD. (ie. Japanese Super System card = 0x0300, American Duo = 0x301)


cd_reset( void );

Reset the CDROM drive, and stop the motor


cd_pause( void );

Pause the CDROM drive during play of an audio track. Probably most useful if the player pauses the game in the middle of a level which is synchronized to music.


cd_unpause( void );

Continue the CDROM audio audio track after pause.


cd_fade( unsigned char type );

cd_playtrk( unsigned char start_track, unsigned char end_track, unsigned char mode );

Play one or more CDROM audio tracks in a few different modes. This will not play 'end' track, so 'end' >= 'start'+1. If you wish to play until end of disc (or if 'start' track is final track), then set 'end' to value 'CDPLAY_ENDOFDISC'.

Attempts to play data tracks will not play, and will return non-zero error code.

Valid modes        Meaning
-----------        -------
CDPLAY_MUTE        Plays audio without sound (muted)
CDPLAY_REPEAT      Plays audio, repeating when track(s) complete
CDPLAY_NORMAL      Plays audio only until completion of track(s)

cd_playmsf( unsigned char start_minute, unsigned char start_second, unsigned char start_frame, unsigned char end_minute, unsigned char end_second, unsigned char end_frame, unsigned char mode );

Play CDROM audio in a few different modes, as above. M/S/F = minute/second/frame indexing technique. (Note: there are 75 frames per second)

(See cd_playtrk() for valid values of 'mode')


cd_loadvram( unsigned char ovl_index, unsigned int sect_offset, unsigned int vramaddr, unsigned int bytes );

Read data from the CDROM directly into video RAM at address specified by 'vramaddr', for a length of 'bytes'. Note that 2 bytes are required to fill one VRAM word.

Read it from the overlay segment specified by 'ovl_index', with sector offset (ie. multiples of 2048 bytes) of 'sect_offset'.

Non-zero return values indicate errors.


cd_loaddata( unsigned char ovl_index, unsigned int sect_offset, unsigned char __far *buffer, unsigned int bytes );

Read data from the CDROM into area (or overlay 'const' or other data) specified by 'destaddr', for a length of 'bytes'.

Read it from the overlay segment specified by 'ovl_index', with sector offset (ie. multiples of 2048 bytes) of 'sect_offset'.

Non-zero return values indicate errors.


cd_loadbank( unsigned char ovl_index, unsigned int sect_offset, unsigned char bank, unsigned int sectors );

cd_status( unsigned char mode );

Checks the status of the CDROM device.

Valid Mode   Meaning           Return value & meaning
----------   -------           ----------------------
   0         Drive Busy Check   0     = Drive Not Busy
                                other = Drive Busy
   other     Drive Ready Check  0     = Drive Ready
                                other = Sub Error Code

Non-zero return values indicate errors.

Last updated