Add CDvdFile, match and link dvdfs

Former-commit-id: 112a7adec8
This commit is contained in:
Phillip Stephens
2023-01-12 16:05:25 -08:00
parent f5a0721ec0
commit 947259c900
5 changed files with 720 additions and 3 deletions
+2 -2
View File
@@ -654,7 +654,7 @@ LIBS = [
"Kyoto/DolphinCMemoryCardSys",
["Kyoto/Input/DolphinIController", True],
["Kyoto/Input/CDolphinController", True],
"Kyoto/DolphinCDvdFile",
["Kyoto/DolphinCDvdFile", False],
"Kyoto/Alloc/CMediumAllocPool",
["Kyoto/Alloc/CSmallAllocPool", True],
["Kyoto/Alloc/CGameAllocator", False],
@@ -752,7 +752,7 @@ LIBS = [
"host": False,
"objects": [
"Dolphin/dvd/dvdlow",
"Dolphin/dvd/dvdfs",
["Dolphin/dvd/dvdfs", True],
["Dolphin/dvd/dvd", False],
"Dolphin/dvd/dvdqueue",
"Dolphin/dvd/dvderror",
+4
View File
@@ -5,6 +5,7 @@
#include "Kyoto/IDvdRequest.hpp"
struct DVDFileInfo;
class CDvdFile {
public:
CDvdFile(const char* name);
@@ -15,6 +16,9 @@ public:
static bool FileExists(const char*);
static void DVDARAMXferCallback(long, DVDFileInfo*);
void HandleDVDInterrupt();
private:
uchar pad[0x14];
uint x14_size;
+41 -1
View File
@@ -7,6 +7,32 @@
extern "C" {
#endif
#define DVD_MIN_TRANSFER_SIZE 32
#define DVD_STATE_FATAL_ERROR -1
#define DVD_STATE_END 0
#define DVD_STATE_BUSY 1
#define DVD_STATE_WAITING 2
#define DVD_STATE_COVER_CLOSED 3
#define DVD_STATE_NO_DISK 4
#define DVD_STATE_COVER_OPEN 5
#define DVD_STATE_WRONG_DISK 6
#define DVD_STATE_MOTOR_STOPPED 7
#define DVD_STATE_PAUSING 8
#define DVD_STATE_IGNORED 9
#define DVD_STATE_CANCELED 10
#define DVD_STATE_RETRY 11
#define DVD_FILEINFO_READY 0
#define DVD_FILEINFO_BUSY 1
#define DVD_RESULT_GOOD 0
#define DVD_RESULT_FATAL_ERROR -1
#define DVD_RESULT_IGNORED -2
#define DVD_RESULT_CANCELED -3
#define DVD_AIS_SUCCESS 0x0
typedef struct DVDDiskID {
char gameName[4];
char company[2];
@@ -41,15 +67,29 @@ typedef struct DVDFileInfo DVDFileInfo;
typedef void (*DVDCallback)(s32 result, DVDFileInfo* fileInfo);
struct DVDFileInfo {
DVDCommandBlock cb;
u32 startAddr;
u32 length;
DVDCallback callback;
};
void DVDInit();
typedef struct {
u32 entryNum;
u32 location;
u32 next;
} DVDDir;
typedef struct {
u32 entryNum;
BOOL isDir;
char* name;
} DVDDirEntry;
void DVDInit();
BOOL DVDClose(DVDFileInfo* f);
void DVDSetAutoFatalMessaging(BOOL);
void DVDReset();
s32 DVDCancel(DVDCommandBlock* block);
BOOL DVDPrepareStreamAsync(DVDFileInfo* fInfo, u32 length, u32 offset, DVDCallback callback);
s32 DVDPrepareStream(DVDFileInfo* fInfo, u32 length, u32 offset);
File diff suppressed because it is too large Load Diff
+17
View File
@@ -0,0 +1,17 @@
#include "Kyoto/CDvdFile.hpp"
#include "dolphin/dvd.h"
#include "string.h"
const char* DecodeARAMFile(const char* filename) {
if (!strncmp(filename, "aram:", 5)) {
return filename + 5;
}
return filename;
}
void CDvdFile::DVDARAMXferCallback(s32 result, DVDFileInfo* info) {
DVDClose(info);
reinterpret_cast<CDvdFile*>(info->cb.userData)->HandleDVDInterrupt();
}