Working on burned DVD for gamecube

This commit is contained in:
2026-05-09 00:14:28 -05:00
parent bafbf2ec2f
commit d7f515575a
+9 -6
View File
@@ -10,8 +10,8 @@
#include "util/string.h"
#include "util/memory.h"
#define ISO_SECTOR_SIZE 2048u
#define ISO_PVD_SECTOR 16u
#define ASSET_DOLPHIN_DVD_SECTOR_SIZE 2048u
#define ASSET_DOLPHIN_DVD_PVD_SECTOR 16u
errorret_t assetInitDolphinDVD(void) {
DVD_Init();
@@ -19,7 +19,8 @@ errorret_t assetInitDolphinDVD(void) {
// ISO 9660 Primary Volume Descriptor is at sector 16.
u8 *pvd = (u8 *)assetDolphinDVDRead(
(s64)ISO_PVD_SECTOR * ISO_SECTOR_SIZE, ISO_SECTOR_SIZE
(s64)(ASSET_DOLPHIN_DVD_PVD_SECTOR * ASSET_DOLPHIN_DVD_SECTOR_SIZE),
ASSET_DOLPHIN_DVD_SECTOR_SIZE
);
if(!pvd) errorThrow("Failed to read ISO 9660 PVD.");
@@ -38,7 +39,7 @@ errorret_t assetInitDolphinDVD(void) {
memoryFree(pvd);
u8 *dir = (u8 *)assetDolphinDVDRead(
(s64)rootLBA * ISO_SECTOR_SIZE, rootSize
(s64)rootLBA * ASSET_DOLPHIN_DVD_SECTOR_SIZE, rootSize
);
if(!dir) errorThrow("Failed to read ISO 9660 root directory.");
@@ -51,7 +52,9 @@ errorret_t assetInitDolphinDVD(void) {
u8 recLen = dir[pos];
if(recLen == 0) {
// Sector padding — skip to the start of the next sector.
pos = (pos + (ISO_SECTOR_SIZE - 1u)) & ~(ISO_SECTOR_SIZE - 1u);
pos = (
pos + (ASSET_DOLPHIN_DVD_SECTOR_SIZE - 1u)
) & ~(ASSET_DOLPHIN_DVD_SECTOR_SIZE - 1u);
continue;
}
@@ -83,7 +86,7 @@ errorret_t assetInitDolphinDVD(void) {
if(!fileLBA) errorThrow("Failed to find asset file on ISO.");
u8 *data = (u8 *)assetDolphinDVDRead(
(s64)fileLBA * ISO_SECTOR_SIZE, fileSize
(s64)fileLBA * ASSET_DOLPHIN_DVD_SECTOR_SIZE, fileSize
);
if(!data) errorThrow("Failed to read asset file from ISO.");