Skip to content

Commit

Permalink
- Adjust for libogc2 changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Extrems committed Dec 19, 2023
1 parent 75507f8 commit baa9e8c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ file_handle initial_GCLoader =

s32 deviceHandler_GCLoader_readFile(file_handle* file, void* buffer, u32 length) {
if(file->status == STATUS_MAPPED) {
s32 bytes_read = DVD_ReadPrio((dvdcmdblk*)file->other, buffer, length, file->offset, 2);
s32 bytes_read = DVD_ReadAbs((dvdcmdblk*)file->other, buffer, length, file->offset);
if(bytes_read > 0) file->offset += bytes_read;
return bytes_read;
}
Expand Down
48 changes: 24 additions & 24 deletions cube/swiss/source/devices/wode/wode.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ unsigned long OpenWode( void )
if(InitDVD() < 0)
return 0;

if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20, WODE_MAGIC, 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20, WODE_MAGIC) <= 0){
return 0;
}

Expand All @@ -78,14 +78,14 @@ unsigned long OpenWode( void )
void CloseWode( void )
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20, WODE_EXIT_REMOTE, 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20, WODE_EXIT_REMOTE) <= 0){
}
}
/*
unsigned long GetJoystick( void )
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_GET_JSTICK, 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_GET_JSTICK) <= 0){
printf ("Error -> GetJoystick\n");
ExitToWii();
}
Expand All @@ -96,23 +96,23 @@ unsigned long GetJoystick( void )
unsigned long GetNumPartitions( void )
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_GET_NUM_PARTS, 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_GET_NUM_PARTS) <= 0){
}
return *(unsigned long*)&dvdbuffer[0];
}

unsigned long GetNumISOsInSelectedPartition( int partition )
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_GET_NUM_ISOS(partition), 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_GET_NUM_ISOS(partition)) <= 0){
}
return *(unsigned long*)&dvdbuffer[0];
}

int GetPartitionInfo(unsigned long partition_idx, PartitionInfo_t* PartitionInfo)
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x80 , WODE_GET_PART(partition_idx), 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x80 , WODE_GET_PART(partition_idx)) <= 0){
}
memcpy(PartitionInfo->name,dvdbuffer,64);
PartitionInfo->NumISOs = *((unsigned long*)&dvdbuffer[64]);
Expand All @@ -124,7 +124,7 @@ int GetPartitionInfo(unsigned long partition_idx, PartitionInfo_t* PartitionInfo
int GetISOInfo(unsigned long partition_idx, unsigned long iso_idx, ISOInfo_t * ISOInfo)
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x80 , WODE_GET_ISO(partition_idx,iso_idx), 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x80 , WODE_GET_ISO(partition_idx,iso_idx)) <= 0){
}
memcpy(ISOInfo->name,dvdbuffer,64);
ISOInfo->iso_type = *((unsigned long*)&dvdbuffer[64]);
Expand All @@ -135,7 +135,7 @@ int GetISOInfo(unsigned long partition_idx, unsigned long iso_idx, ISOInfo_t * I
unsigned long GotoFlatMode( void )
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20, WODE_GOTO_FLAT_MODE, 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20, WODE_GOTO_FLAT_MODE) <= 0){
}
CloseWode();
return 0;
Expand All @@ -149,7 +149,7 @@ unsigned long GetMaxFavorites( void )
int GetFavoriteInfo(unsigned long index, FavoriteInfo_t * favoriteInfo)
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x80 , WODE_GET_FAVORITE_INFO(index), 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x80 , WODE_GET_FAVORITE_INFO(index)) <= 0){
ExitToWii();
}
Expand All @@ -170,7 +170,7 @@ int EraseFavorite(unsigned long idx)
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_ERASE_FAVORITE(idx), 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_ERASE_FAVORITE(idx)) <= 0){
printf ("Error -> EraseFavorite\n");
ExitToWii();
}
Expand All @@ -180,7 +180,7 @@ int EraseFavorite(unsigned long idx)
int GetNumFavorites( void )
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_GET_NUM_FAVORITES, 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_GET_NUM_FAVORITES) <= 0){
printf ("Error -> GetNumFavorites\n");
ExitToWii();
}
Expand All @@ -190,18 +190,18 @@ int GetNumFavorites( void )
int InsertFavorite(unsigned long IsoIndex)
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_SET_FAVORITE_FAVE(GetSelectedFavorite()), 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_SET_FAVORITE_FAVE(GetSelectedFavorite())) <= 0){
printf ("Error -> WODE_SET_FAVORITE_FAVE\n");
ExitToWii();
}
// 256 partitions should be enough
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_SET_FAVORITE_PART(GetSelectedPartition()), 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_SET_FAVORITE_PART(GetSelectedPartition())) <= 0){
printf ("Error -> WODE_SET_FAVORITE_PART\n");
ExitToWii();
}
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_SET_FAVORITE_ISO(IsoIndex), 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_SET_FAVORITE_ISO(IsoIndex)) <= 0){
printf ("Error -> WODE_SET_FAVORITE_PART\n");
ExitToWii();
}
Expand All @@ -217,32 +217,32 @@ unsigned long SaveSettings( void )
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_SET_REGION_HACK(MENU_GetRegion()), 2) <= 0){ //20
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_SET_REGION_HACK(MENU_GetRegion())) <= 0){ //20
printf ("Error -> SetRegion\n");
ExitToWii();
}
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_SET_UPDATE_BLOCK_HACK(MENU_GetBlockUpdates()), 2) <= 0){ //21
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_SET_UPDATE_BLOCK_HACK(MENU_GetBlockUpdates())) <= 0){ //21
printf ("Error -> SetBlockUpdates\n");
ExitToWii();
}
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_SET_AUTOBOOT_HACK(MENU_GetAutoStart()), 2) <= 0){ //22
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_SET_AUTOBOOT_HACK(MENU_GetAutoStart())) <= 0){ //22
printf ("Error -> SetAutoStart\n");
ExitToWii();
}
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_SET_RELOAD_HACK(MENU_GetAutoload()), 2) <= 0){ //23
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_SET_RELOAD_HACK(MENU_GetAutoload())) <= 0){ //23
printf ("Error -> SetWiiRegion\n");
ExitToWii();
}
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_SET_WII_REGION(MENU_GetWiiRegion()), 2) <= 0){ //24
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_SET_WII_REGION(MENU_GetWiiRegion())) <= 0){ //24
printf ("Error -> SetAutoload\n");
ExitToWii();
}
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_WRITE_SETTINGS, 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_WRITE_SETTINGS) <= 0){
printf ("Error -> Wite Settings\n");
ExitToWii();
}
Expand Down Expand Up @@ -270,7 +270,7 @@ unsigned long SaveSettings( void )
int GetSettings( s_user_settings * settings )
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_GET_SETTINGS, 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_GET_SETTINGS) <= 0){
ExitToWii();
return 0;
}
Expand All @@ -287,7 +287,7 @@ int GetSettings( s_user_settings * settings )
int GetVersions( device_versions * versions )
{
dvdcmdblk cmdblk;
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20 , WODE_GET_VERSIONS, 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20 , WODE_GET_VERSIONS) <= 0){
return 0;
}

Expand All @@ -312,9 +312,9 @@ void SetISO(unsigned long Partition, unsigned long Iso)
{
dvdcmdblk cmdblk;

if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20, WODE_LAUNCH_GAME_PART(Partition), 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20, WODE_LAUNCH_GAME_PART(Partition)) <= 0){
}
if(DVD_ReadPrio (&cmdblk, dvdbuffer, 0x20, WODE_LAUNCH_GAME_ISO(Iso), 2) <= 0){
if(DVD_ReadAbs (&cmdblk, dvdbuffer, 0x20, WODE_LAUNCH_GAME_ISO(Iso)) <= 0){
}
CloseWode();
}
Expand Down
3 changes: 2 additions & 1 deletion cube/swiss/source/nkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ static const dvddiskid NDDEMO = {
static const dvddiskid DATEL = {
.gamename = "DTLX",
.company = "01",
.streaming = true
.streaming = true,
.magic = DVD_MAGIC
};

static const struct {
Expand Down

0 comments on commit baa9e8c

Please sign in to comment.