JKernel cleanup and DVD types (#59)

* JKRDecomp OK

* JKRFile and JKRDvdFile cleanup

* more DVD stuff and cleanup JKRDvdFile more

* formatting

* JKRHeap cleanup

* formatting

* JKRDisposer cleanup

* JKRAramBlock and JKRAramHeap cleanup

* fix merge error

* fixed comments

* forgot to save file...

* fix DVDCBcallback

Co-authored-by: Julgodis <>
This commit is contained in:
Jonathan Wase
2021-01-04 03:26:25 +01:00
committed by GitHub
parent 409257b111
commit 5217a4189e
13 changed files with 190 additions and 257 deletions
+13 -12
View File
@@ -20,7 +20,7 @@ typedef enum DVDState {
} DVDState;
}
class DVDDiskID {
struct DVDDiskID {
char game_name[4];
char company[2];
u8 disk_number;
@@ -30,10 +30,14 @@ class DVDDiskID {
u8 padding[22];
};
class DVDCommandBlock {
public:
struct DVDFileInfo;
struct DVDCommandBlock;
typedef void (*DVDCBCallback)(s32 result, DVDCommandBlock* block);
typedef void (*DVDCallback)(s32 result, DVDFileInfo* info);
struct DVDCommandBlock {
DVDCommandBlock* next;
DVDCommandBlock* previous;
DVDCommandBlock* prev;
u32 command;
s32 state;
u32 offset;
@@ -42,18 +46,15 @@ public:
u32 current_transfer_size;
u32 transferred_size;
DVDDiskID* disk_id;
u8 callback[4];
DVDCBCallback callback;
void* user_data;
};
// typedef void (*DVDCallback)(u32 result, DVDFileInfo *info);
class DVDFileInfo {
public:
struct DVDFileInfo {
DVDCommandBlock block;
u32 start_address;
u32 length;
u8 callback[4];
DVDCallback callback;
};
extern "C" {
@@ -62,8 +63,8 @@ s32 DVDClose(DVDFileInfo*);
void DVDReadPrio(DVDFileInfo*, void*, s32, s32, s32);
void DVDGetCurrentDiskID(void);
s32 DVDFastOpen(long, DVDFileInfo*);
int DVDGetCommandBlockStatus(DVDFileInfo*);
s32 DVDReadAsyncPrio(DVDFileInfo*, void*, long, long, void (*)(long, DVDFileInfo*), long);
int DVDGetCommandBlockStatus(DVDCommandBlock*);
s32 DVDReadAsyncPrio(DVDFileInfo*, void*, long, long, DVDCallback, long);
void DVDConvertPathToEntrynum(void);
DVDState DVDGetDriveStatus(void);
s32 DVDCheckDisk(void);