2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CDVDFILE
|
|
|
|
#define _CDVDFILE
|
2022-04-10 00:17:06 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
2023-01-29 22:16:26 +00:00
|
|
|
#include "Kyoto/CDvdRequest.hpp"
|
2022-04-10 00:17:06 +00:00
|
|
|
|
2023-01-29 22:16:26 +00:00
|
|
|
#include "rstl/string.hpp"
|
|
|
|
|
|
|
|
enum ESeekOrigin {
|
|
|
|
kSO_Set,
|
|
|
|
kSO_Cur,
|
|
|
|
kSO_End
|
|
|
|
};
|
2022-10-16 20:20:36 +00:00
|
|
|
|
2023-01-13 00:05:25 +00:00
|
|
|
struct DVDFileInfo;
|
2022-04-10 00:17:06 +00:00
|
|
|
class CDvdFile {
|
|
|
|
public:
|
2022-10-16 20:20:36 +00:00
|
|
|
CDvdFile(const char* name);
|
|
|
|
~CDvdFile();
|
|
|
|
uint Length() { return x14_size; }
|
2023-01-29 22:16:26 +00:00
|
|
|
void HandleDVDInterrupt();
|
|
|
|
void HandleARAMInterrupt();
|
|
|
|
void PingARAMTransfer();
|
|
|
|
void TryARAMFile();
|
|
|
|
void PushARAMFileLoad();
|
|
|
|
void PopARAMFileLoad();
|
|
|
|
void StartARAMFileLoad();
|
|
|
|
void StallForARAMFile();
|
|
|
|
CDvdRequest* SyncRead(void* buf, uint len);
|
|
|
|
CDvdRequest* SyncSeekRead(void* buf, uint len, ESeekOrigin, int offset);
|
|
|
|
CDvdRequest* AsyncSeekRead(void* buf, uint len, ESeekOrigin, int offset);
|
|
|
|
void CloseFile();
|
|
|
|
void CalcFileOffset(int offset, ESeekOrigin origin);
|
|
|
|
void UpdateFilePos(int pos);
|
|
|
|
const int GetFileSize() const { return x14_size; }
|
2022-10-16 20:20:36 +00:00
|
|
|
|
2022-04-10 00:17:06 +00:00
|
|
|
static bool FileExists(const char*);
|
2023-01-13 00:05:25 +00:00
|
|
|
static void DVDARAMXferCallback(long, DVDFileInfo*);
|
2023-01-14 09:26:24 +00:00
|
|
|
static void ARAMARAMXferCallback(u32 addr);
|
2023-01-29 22:16:26 +00:00
|
|
|
static void internalCallback(s32, DVDFileInfo*);
|
2022-04-10 00:17:06 +00:00
|
|
|
private:
|
2023-01-29 22:16:26 +00:00
|
|
|
int x0_fileEntry;
|
|
|
|
void* x4_;
|
|
|
|
uchar x8_;
|
|
|
|
uchar x9_;
|
|
|
|
int xc_;
|
|
|
|
int x10_offset;
|
|
|
|
int x14_size;
|
|
|
|
rstl::string x18_filename;
|
2022-04-10 00:17:06 +00:00
|
|
|
};
|
2022-10-16 20:20:36 +00:00
|
|
|
CHECK_SIZEOF(CDvdFile, 0x28)
|
2022-04-10 00:17:06 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CDVDFILE
|