-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
179 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef OSNANDBOOTINFO_H | ||
#define OSNANDBOOTINFO_H | ||
|
||
#include "revolution/types.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct { | ||
u32 CheckSum; | ||
u32 ArgOffset; | ||
u8 reserved[2]; | ||
u8 LastAppType; | ||
u8 ReturnType; | ||
u32 ArgValue; | ||
u8 padding[8]; | ||
u64 LastTitleId; | ||
u8 args[0x1000]; | ||
} OSNandbootInfo; | ||
|
||
typedef struct { | ||
u32 CheckSum; | ||
u32 ArgOffset; | ||
u8 reserved[2]; | ||
u8 LastAppType; | ||
u8 ReturnType; | ||
u32 ArgValue; | ||
u8 padding[8]; | ||
u64 LastTitleId; | ||
|
||
} OSNandbootInfoHeader; | ||
|
||
BOOL __OSCreateNandbootInfo(void); | ||
BOOL __OSWriteNandbootInfo(OSNandbootInfo *); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // OSNANDBOOTINFO_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#include "revolution/os/OSNandbootinfo.h" | ||
#include "revolution/nand.h" | ||
|
||
static u32 CheckSum(OSNandbootInfo* info) { | ||
u32 *ptr, i, sum; | ||
|
||
ptr = (u32*)&(info->ArgOffset); | ||
sum = 0; | ||
for (i = 0; i < (sizeof(OSNandbootInfo) - 4) / 4; i++) | ||
{ | ||
sum = sum + *ptr; | ||
ptr++; | ||
} | ||
|
||
return sum; | ||
} | ||
|
||
BOOL __OSCreateNandbootInfo(void) { | ||
NANDStatus status; | ||
s32 result; | ||
|
||
result = NANDPrivateGetStatus("/shared2/sys/NANDBOOTINFO", &status); | ||
if (result == 0 && status.permission == 0x3F) { | ||
return TRUE; | ||
} | ||
else if (result == 0 && status.permission != 0x3F) { | ||
result = NANDPrivateDelete("/shared2/sys/NANDBOOTINFO"); | ||
|
||
if (result != 0) { | ||
return FALSE; | ||
} | ||
} | ||
else if (result == -12) { | ||
|
||
} | ||
else { | ||
return FALSE; | ||
} | ||
|
||
result = NANDPrivateCreate("/shared2/sys/NANDBOOTINFO", 63, 0); | ||
|
||
if (result != 0) { | ||
return FALSE; | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
BOOL __OSWriteNandbootInfo(OSNandbootInfo *info) { | ||
NANDFileInfo fileInfo; | ||
s32 result; | ||
info->CheckSum = CheckSum(info); | ||
result = NANDPrivateOpen("/shared2/sys/NANDBOOTINFO", &fileInfo, 2); | ||
|
||
if (result == 0) { | ||
result = NANDWrite(&fileInfo, info, sizeof(OSNandbootInfo)); | ||
|
||
if (result != sizeof(OSNandbootInfo)) { | ||
NANDClose(&fileInfo); | ||
return FALSE; | ||
} | ||
|
||
result = NANDClose(&fileInfo); | ||
if (result != 0) { | ||
return FALSE; | ||
} | ||
} | ||
else { | ||
return FALSE; | ||
} | ||
|
||
return TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "nw4r/lyt/init.h" | ||
#include "revolution/os.h" | ||
#include "revolution/os/OSFastCast.h" | ||
|
||
namespace { | ||
const char* NW4R_LYT_Version_ = "<< NW4R - LYT \tfinal build: Jul 17 2007 12:25:23 (0x4199_60831) >>"; | ||
}; | ||
|
||
namespace nw4r { | ||
namespace lyt { | ||
void LytInit() { | ||
OSRegisterVersion(NW4R_LYT_Version_); | ||
OSInitFastCast(); | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include "nw4r/lyt/resourceAccessor.h" | ||
|
||
namespace nw4r { | ||
namespace lyt { | ||
ResourceAccessor::~ResourceAccessor() { | ||
|
||
} | ||
|
||
ResourceAccessor::ResourceAccessor() { | ||
|
||
} | ||
|
||
ut::Font* ResourceAccessor::GetFont(const char*) { | ||
return nullptr; | ||
} | ||
}; | ||
}; |