jak-project/game/sce/libcdvd_ee.cpp

64 lines
1.2 KiB
C++
Raw Normal View History

2020-08-22 22:30:12 -04:00
/*!
* @file libcdvd_ee.cpp
* Stub implementation of the EE CD/DVD library
*/
#include "libcdvd_ee.h"
#include "common/util/Assert.h"
2020-08-22 22:30:12 -04:00
namespace ee {
namespace {
// CD/DVD media type set by sceCdMMode
int media_mode;
2020-08-26 01:21:33 -04:00
} // namespace
2020-08-22 22:30:12 -04:00
void LIBRARY_INIT_sceCd() {
media_mode = -1;
}
/*!
* Initialize the CD/DVD subsystem.
* init_mode should be SCECdINIT
*/
2020-08-26 01:21:33 -04:00
int sceCdInit(int init_mode) {
ASSERT(init_mode == SCECdINIT);
2020-08-26 01:21:33 -04:00
return 1; // Initialization was performed normally
2020-08-22 22:30:12 -04:00
}
/*!
* Tell the library if we are expecting a CD or DVD.
*/
int sceCdMmode(int media) {
media_mode = media;
2020-08-26 01:21:33 -04:00
return 1; // If successful, returns 1
2020-08-22 22:30:12 -04:00
}
/*!
* Is the drive ready for commands?
* Mode is a flag for non-blocking, otherwise block until ready.
*/
int sceCdDiskReady(int mode) {
(void)mode;
// always ready!
return SCECdComplete;
}
/*!
* What type of disk do we have?
*/
int sceCdGetDiskType() {
// if we set CD or DVD, return the appropriate PS2 game disk type.
2020-08-26 01:21:33 -04:00
switch (media_mode) {
2020-08-22 22:30:12 -04:00
case SCECdCD:
return SCECdPS2CD;
case SCECdDVD:
return SCECdPS2DVD;
default:
// unset/unknown media mode, so drive won't work.
return SCECdIllegalMedia;
}
}
} // namespace ee