This will summarize an error-code given by the OS/sysmodules in few words.
Useful for debugging.
#define OS_H
u32 osConvertVirtToPhys(u32 vaddr);
+const char* osStrError(u32 error);
#endif
return vaddr - 0x07000000; // VRAM
return 0;
}
+
+const char* osStrError(u32 error) {
+ switch((error>>26) & 0x3F) {
+ case 0:
+ return "Success.";
+ case 1:
+ return "Nothing happened.";
+ case 2:
+ return "Would block.";
+ case 3:
+ return "Not enough resources.";
+ case 4:
+ return "Not found.";
+ case 5:
+ return "Invalid state.";
+ case 6:
+ return "Unsupported.";
+ case 7:
+ return "Invalid argument.";
+ case 8:
+ return "Wrong argument.";
+ case 9:
+ return "Interrupted.";
+ case 10:
+ return "Internal error.";
+ default:
+ return "Unknown.";
+ }
+}