Match dvd.c, not linking for now (links with patched 1.2.5)

Former-commit-id: d0ad5f5ef8
This commit is contained in:
Phillip Stephens 2022-09-15 18:17:42 -07:00
parent e5dd64ab55
commit 047ee1a32e
11 changed files with 1890 additions and 436 deletions

View File

@ -136,6 +136,8 @@ $(OS_FILES): MWCC_VERSION := 1.2.5
$(OS_FILES): CFLAGS := $(CFLAGS_BASE) $(OS_FILES): CFLAGS := $(CFLAGS_BASE)
$(CARD_FILES): MWCC_VERSION := 1.2.5 $(CARD_FILES): MWCC_VERSION := 1.2.5
$(CARD_FILES): CFLAGS := $(CFLAGS_BASE) $(CARD_FILES): CFLAGS := $(CFLAGS_BASE)
$(DVD_FILES): MWCC_VERSION := 1.2.5e
$(DVD_FILES): CFLAGS := $(CFLAGS_BASE)
$(DSP_FILES): MWCC_VERSION := 1.2.5 $(DSP_FILES): MWCC_VERSION := 1.2.5
$(DSP_FILES): CFLAGS := $(CFLAGS_BASE) $(DSP_FILES): CFLAGS := $(CFLAGS_BASE)
$(MUSYX_FILES): CFLAGS := $(CFLAGS_MUSYX) $(MUSYX_FILES): CFLAGS := $(CFLAGS_MUSYX)

View File

@ -95,7 +95,7 @@ sub_803b7534:
/* 803B7564 003B44C4 3C 60 80 57 */ lis r3, lbl_80569908@ha /* 803B7564 003B44C4 3C 60 80 57 */ lis r3, lbl_80569908@ha
/* 803B7568 003B44C8 38 63 99 08 */ addi r3, r3, lbl_80569908@l /* 803B7568 003B44C8 38 63 99 08 */ addi r3, r3, lbl_80569908@l
/* 803B756C 003B44CC 38 80 00 00 */ li r4, 0 /* 803B756C 003B44CC 38 80 00 00 */ li r4, 0
/* 803B7570 003B44D0 4B FB C8 4D */ bl sub_80373dbc /* 803B7570 003B44D0 4B FB C8 4D */ bl DVDStopStreamAtEndAsync
/* 803B7574 003B44D4 80 6D AF D8 */ lwz r3, lbl_805A9B98@sda21(r13) /* 803B7574 003B44D4 80 6D AF D8 */ lwz r3, lbl_805A9B98@sda21(r13)
/* 803B7578 003B44D8 38 00 00 01 */ li r0, 1 /* 803B7578 003B44D8 38 00 00 01 */ li r0, 1
/* 803B757C 003B44DC 90 0D AF E4 */ stw r0, lbl_805A9BA4@sda21(r13) /* 803B757C 003B44DC 90 0D AF E4 */ stw r0, lbl_805A9BA4@sda21(r13)
@ -129,7 +129,7 @@ sub_803b75b8:
/* 803B75DC 003B453C 3C 60 80 57 */ lis r3, lbl_80569938@ha /* 803B75DC 003B453C 3C 60 80 57 */ lis r3, lbl_80569938@ha
/* 803B75E0 003B4540 38 63 99 38 */ addi r3, r3, lbl_80569938@l /* 803B75E0 003B4540 38 63 99 38 */ addi r3, r3, lbl_80569938@l
/* 803B75E4 003B4544 38 80 00 00 */ li r4, 0 /* 803B75E4 003B4544 38 80 00 00 */ li r4, 0
/* 803B75E8 003B4548 4B FB C7 D5 */ bl sub_80373dbc /* 803B75E8 003B4548 4B FB C7 D5 */ bl DVDStopStreamAtEndAsync
/* 803B75EC 003B454C 80 6D AF D8 */ lwz r3, lbl_805A9B98@sda21(r13) /* 803B75EC 003B454C 80 6D AF D8 */ lwz r3, lbl_805A9B98@sda21(r13)
/* 803B75F0 003B4550 38 00 00 02 */ li r0, 2 /* 803B75F0 003B4550 38 00 00 02 */ li r0, 2
/* 803B75F4 003B4554 90 0D AF E4 */ stw r0, lbl_805A9BA4@sda21(r13) /* 803B75F4 003B4554 90 0D AF E4 */ stw r0, lbl_805A9BA4@sda21(r13)
@ -281,7 +281,7 @@ lbl_803B7808:
/* 803B780C 003B476C 3C 80 80 3B */ lis r4, sub_803b7518@ha /* 803B780C 003B476C 3C 80 80 3B */ lis r4, sub_803b7518@ha
/* 803B7810 003B4770 38 63 99 68 */ addi r3, r3, lbl_80569968@l /* 803B7810 003B4770 38 63 99 68 */ addi r3, r3, lbl_80569968@l
/* 803B7814 003B4774 38 84 75 18 */ addi r4, r4, sub_803b7518@l /* 803B7814 003B4774 38 84 75 18 */ addi r4, r4, sub_803b7518@l
/* 803B7818 003B4778 4B FB C6 61 */ bl sub_80373e78 /* 803B7818 003B4778 4B FB C6 61 */ bl DVDGetStreamErrorStatusAsync
lbl_803B781C: lbl_803B781C:
/* 803B781C 003B477C 80 01 00 0C */ lwz r0, 0xc(r1) /* 803B781C 003B477C 80 01 00 0C */ lwz r0, 0xc(r1)
/* 803B7820 003B4780 38 21 00 08 */ addi r1, r1, 8 /* 803B7820 003B4780 38 21 00 08 */ addi r1, r1, 8
@ -303,7 +303,7 @@ sub_803b782c:
/* 803B7854 003B47B4 3C 80 80 3B */ lis r4, sub_803b7630@ha /* 803B7854 003B47B4 3C 80 80 3B */ lis r4, sub_803b7630@ha
/* 803B7858 003B47B8 38 63 99 98 */ addi r3, r3, lbl_80569998@l /* 803B7858 003B47B8 38 63 99 98 */ addi r3, r3, lbl_80569998@l
/* 803B785C 003B47BC 38 84 76 30 */ addi r4, r4, sub_803b7630@l /* 803B785C 003B47BC 38 84 76 30 */ addi r4, r4, sub_803b7630@l
/* 803B7860 003B47C0 4B FB C6 D5 */ bl sub_80373f34 /* 803B7860 003B47C0 4B FB C6 D5 */ bl DVDGetStreamPlayAddrAsync
lbl_803B7864: lbl_803B7864:
/* 803B7864 003B47C4 80 01 00 0C */ lwz r0, 0xc(r1) /* 803B7864 003B47C4 80 01 00 0C */ lwz r0, 0xc(r1)
/* 803B7868 003B47C8 38 21 00 08 */ addi r1, r1, 8 /* 803B7868 003B47C8 38 21 00 08 */ addi r1, r1, 8

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,9 @@ lbl_805A97C0:
.global lbl_805A97C4 .global lbl_805A97C4
lbl_805A97C4: lbl_805A97C4:
.skip 0x4 .skip 0x4
.global __DVDThreadQueue
__DVDThreadQueue:
.skip 0x8
.section .sdata .section .sdata
.balign 8 .balign 8
@ -706,7 +709,7 @@ lbl_80371B3C:
/* 80371B4C 0036EAAC 38 7B 00 00 */ addi r3, r27, 0 /* 80371B4C 0036EAAC 38 7B 00 00 */ addi r3, r27, 0
/* 80371B50 0036EAB0 38 9C 00 00 */ addi r4, r28, 0 /* 80371B50 0036EAB0 38 9C 00 00 */ addi r4, r28, 0
/* 80371B54 0036EAB4 7C A0 EA 14 */ add r5, r0, r29 /* 80371B54 0036EAB4 7C A0 EA 14 */ add r5, r0, r29
/* 80371B58 0036EAB8 48 00 20 1D */ bl sub_80373b74 /* 80371B58 0036EAB8 48 00 20 1D */ bl DVDPrepareStreamAbsAsync
/* 80371B5C 0036EABC BB 61 00 24 */ lmw r27, 0x24(r1) /* 80371B5C 0036EABC BB 61 00 24 */ lmw r27, 0x24(r1)
/* 80371B60 0036EAC0 80 01 00 3C */ lwz r0, 0x3c(r1) /* 80371B60 0036EAC0 80 01 00 3C */ lwz r0, 0x3c(r1)
/* 80371B64 0036EAC4 38 21 00 38 */ addi r1, r1, 0x38 /* 80371B64 0036EAC4 38 21 00 38 */ addi r1, r1, 0x38

View File

@ -3980,9 +3980,9 @@ lbl_80005F80:
/* 80005F80 00002EE0 48 36 E9 15 */ bl DVDCheckDisk /* 80005F80 00002EE0 48 36 E9 15 */ bl DVDCheckDisk
/* 80005F84 00002EE4 2C 03 00 00 */ cmpwi r3, 0x0 /* 80005F84 00002EE4 2C 03 00 00 */ cmpwi r3, 0x0
/* 80005F88 00002EE8 41 82 00 4C */ beq lbl_80005FD4 /* 80005F88 00002EE8 41 82 00 4C */ beq lbl_80005FD4
/* 80005F8C 00002EEC 48 36 E7 9D */ bl sub_8037454c /* 80005F8C 00002EEC 48 36 E7 9D */ bl DVDCancelAll
/* 80005F90 00002EF0 38 61 00 08 */ addi r3, r1, 0x8 /* 80005F90 00002EF0 38 61 00 08 */ addi r3, r1, 0x8
/* 80005F94 00002EF4 48 36 DF 3D */ bl sub_80373cf4 /* 80005F94 00002EF4 48 36 DF 3D */ bl DVDCancelStream
/* 80005F98 00002EF8 88 0D A9 D0 */ lbz r0, lbl_805A9590@sda21(r13) /* 80005F98 00002EF8 88 0D A9 D0 */ lbz r0, lbl_805A9590@sda21(r13)
/* 80005F9C 00002EFC 28 00 00 00 */ cmplwi r0, 0x0 /* 80005F9C 00002EFC 28 00 00 00 */ cmplwi r0, 0x0
/* 80005FA0 00002F00 41 82 00 08 */ beq lbl_80005FA8 /* 80005FA0 00002F00 41 82 00 08 */ beq lbl_80005FA8
@ -4216,9 +4216,9 @@ lbl_80005F8C:
/* 80005F8C 00002EEC 48 36 E7 2D */ bl DVDCheckDisk /* 80005F8C 00002EEC 48 36 E7 2D */ bl DVDCheckDisk
/* 80005F90 00002EF0 2C 03 00 00 */ cmpwi r3, 0 /* 80005F90 00002EF0 2C 03 00 00 */ cmpwi r3, 0
/* 80005F94 00002EF4 41 82 00 24 */ beq lbl_80005FB8 /* 80005F94 00002EF4 41 82 00 24 */ beq lbl_80005FB8
/* 80005F98 00002EF8 48 36 E5 B5 */ bl sub_8037454c /* 80005F98 00002EF8 48 36 E5 B5 */ bl DVDCancelAll
/* 80005F9C 00002EFC 38 61 00 08 */ addi r3, r1, 8 /* 80005F9C 00002EFC 38 61 00 08 */ addi r3, r1, 8
/* 80005FA0 00002F00 48 36 DD 55 */ bl sub_80373cf4 /* 80005FA0 00002F00 48 36 DD 55 */ bl DVDCancelStream
/* 80005FA4 00002F04 38 60 00 00 */ li r3, 0 /* 80005FA4 00002F04 38 60 00 00 */ li r3, 0
/* 80005FA8 00002F08 38 80 00 00 */ li r4, 0 /* 80005FA8 00002F08 38 80 00 00 */ li r4, 0
/* 80005FAC 00002F0C 38 A0 00 00 */ li r5, 0 /* 80005FAC 00002F0C 38 A0 00 00 */ li r5, 0

46
include/dolphin/DVDPriv.h Normal file
View File

@ -0,0 +1,46 @@
#ifndef __DVDPRIV_H__
#define __DVDPRIV_H__
#include <dolphin/dvd.h>
#include <types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct DVDDriveInfo {
u16 revisionLevel;
u16 deviceCode;
u32 releaseDate;
u8 padding[24];
} DVDDriveInfo;
typedef struct DVDBB1 {
u32 appLoaderLength;
void* appLoaderFunc1;
void* appLoaderFunc2;
void* appLoaderFunc3;
} DVDBB1;
typedef struct DVDBB2 {
u32 bootFilePosition;
u32 FSTPosition;
u32 FSTLength;
u32 FSTMaxLength;
void* FSTAddress;
u32 userPosition;
u32 userLength;
u32 padding0;
} DVDBB2;
typedef void (*DVDOptionalCommandChecker)(DVDCommandBlock* block, void (*cb)(u32 intType));
typedef void (*DVDLowCallback)(u32 intType);
DVDCommandBlock* __DVDPopWaitingQueue();
DVDLowCallback DVDLowClearCallback();
#ifdef __cplusplus
}
#endif
#endif __DVDPRIV_H__

View File

@ -17,7 +17,29 @@ typedef struct DVDDiskID {
u8 padding[22]; // 0's are stored u8 padding[22]; // 0's are stored
} DVDDiskID; } DVDDiskID;
typedef struct DVDCommandBlock DVDCommandBlock;
typedef void (*DVDCBCallback)(s32 result, DVDCommandBlock* block);
struct DVDCommandBlock {
DVDCommandBlock* next;
DVDCommandBlock* prev;
u32 command;
s32 state;
u32 offset;
u32 length;
void* addr;
u32 currTransferSize;
u32 transferredSize;
DVDDiskID* id;
DVDCBCallback callback;
void* userData;
};
typedef struct DVDFileInfo DVDFileInfo;
void DVDSetAutoFatalMessaging(BOOL); void DVDSetAutoFatalMessaging(BOOL);
void DVDReset();
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -0,0 +1,6 @@
#ifndef __DVD_REGS_H__
#define __DVD_REGS_H__
vu32 __DIRegs[16] : 0xCC006000;
#endif // __DVD_REGS_H__

View File

@ -54,6 +54,7 @@ u32 __OSCoreClock AT_ADDRESS(OS_BASE_CACHED | 0x00FC); // sync with OSLoMem.h
OSTime OSGetTime(); OSTime OSGetTime();
void OSReport(const char* msg, ...); void OSReport(const char* msg, ...);
void OSPanic(const char* file, int line, const char* msg, ...);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -0,0 +1,16 @@
#ifndef __OSBOOTINFO_H__
#define __OSBOOTINFO_H__
typedef struct OSBootInfo {
DVDDiskID DVDDiskID;
u32 magic;
u32 version;
u32 memorySize;
u32 consoleType;
void* arenaLo;
void* arenaHi;
void* FSTLocation;
u32 FSTMaxLength;
} OSBootInfo;
#endif // __OSBOOTINFO_H__

1373
src/Dolphin/dvd/dvd.c Normal file

File diff suppressed because it is too large Load Diff