2022-10-09 01:13:17 -04:00
|
|
|
#ifndef _CDVDFILE
|
|
|
|
|
#define _CDVDFILE
|
2022-04-09 20:17:06 -04:00
|
|
|
|
2023-01-29 14:16:26 -08:00
|
|
|
#include "Kyoto/CDvdRequest.hpp"
|
2023-02-01 00:13:54 -08:00
|
|
|
#include "types.h"
|
2022-04-09 20:17:06 -04:00
|
|
|
|
2023-02-01 00:13:54 -08:00
|
|
|
#include "rstl/auto_ptr.hpp"
|
|
|
|
|
#include "rstl/reserved_vector.hpp"
|
|
|
|
|
#include "rstl/single_ptr.hpp"
|
2023-01-29 14:16:26 -08:00
|
|
|
#include "rstl/string.hpp"
|
|
|
|
|
|
2023-02-01 00:13:54 -08:00
|
|
|
enum ESeekOrigin { kSO_Set, kSO_Cur, kSO_End };
|
2022-10-16 14:20:36 -06:00
|
|
|
|
2023-02-01 00:13:54 -08:00
|
|
|
|
|
|
|
|
class CDvdFile;
|
|
|
|
|
struct CDvdFileARAM;
|
2023-01-12 16:05:25 -08:00
|
|
|
struct DVDFileInfo;
|
2022-04-09 20:17:06 -04:00
|
|
|
class CDvdFile {
|
|
|
|
|
public:
|
2022-10-16 14:20:36 -06:00
|
|
|
CDvdFile(const char* name);
|
|
|
|
|
~CDvdFile();
|
|
|
|
|
uint Length() { return x14_size; }
|
2023-01-12 16:05:25 -08:00
|
|
|
void HandleDVDInterrupt();
|
2023-01-14 01:26:24 -08:00
|
|
|
void HandleARAMInterrupt();
|
2023-01-29 14:16:26 -08:00
|
|
|
void PingARAMTransfer();
|
|
|
|
|
void TryARAMFile();
|
|
|
|
|
void PushARAMFileLoad();
|
|
|
|
|
void PopARAMFileLoad();
|
2023-02-01 00:13:54 -08:00
|
|
|
bool IsARAMFileLoaded();
|
2023-01-29 14:16:26 -08:00
|
|
|
void StartARAMFileLoad();
|
|
|
|
|
void StallForARAMFile();
|
|
|
|
|
CDvdRequest* SyncRead(void* buf, uint len);
|
2023-10-11 15:35:05 -07:00
|
|
|
void SyncSeekRead(void* buf, uint len, ESeekOrigin, int offset);
|
2023-01-29 14:16:26 -08:00
|
|
|
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; }
|
2023-01-12 16:05:25 -08:00
|
|
|
|
2023-01-29 14:16:26 -08:00
|
|
|
static bool FileExists(const char*);
|
|
|
|
|
static void DVDARAMXferCallback(long, DVDFileInfo*);
|
|
|
|
|
static void ARAMARAMXferCallback(u32 addr);
|
|
|
|
|
static void internalCallback(s32, DVDFileInfo*);
|
2023-02-01 00:13:54 -08:00
|
|
|
|
2022-04-09 20:17:06 -04:00
|
|
|
private:
|
2023-01-29 14:16:26 -08:00
|
|
|
int x0_fileEntry;
|
2023-02-01 00:13:54 -08:00
|
|
|
uchar* x4_;
|
|
|
|
|
bool x8_;
|
|
|
|
|
bool x9_;
|
|
|
|
|
rstl::single_ptr< CDvdFileARAM > xc_;
|
2023-01-29 14:16:26 -08:00
|
|
|
int x10_offset;
|
|
|
|
|
int x14_size;
|
|
|
|
|
rstl::string x18_filename;
|
2022-04-09 20:17:06 -04:00
|
|
|
};
|
2022-10-16 14:20:36 -06:00
|
|
|
CHECK_SIZEOF(CDvdFile, 0x28)
|
2022-04-09 20:17:06 -04:00
|
|
|
|
2022-10-09 01:13:17 -04:00
|
|
|
#endif // _CDVDFILE
|