replace symbols with string literals and python script

This commit is contained in:
Julgodis
2021-01-28 19:03:51 +01:00
parent 6aa3fb4ff6
commit cf4bf3fc53
12 changed files with 450 additions and 71 deletions
+5 -8
View File
@@ -107,17 +107,11 @@ asm void* JKRAram::run(void) {
void JKRAram::checkOkAddress(u8* addr, u32 size, JKRAramBlock* block, u32 param_4) {
if (!IS_ALIGNED((u32)addr, 0x20) && !IS_ALIGNED(size, 0x20)) {
const char* file = lbl_8039D078;
const char* format = lbl_8039D078 + 0xc;
const char* arg1 = lbl_8039D078 + 0xc + 0x3;
JUTException_NS_panic_f(file, 0xdb, format, arg1);
JUTException_NS_panic_f("JKRAram.cpp", 0xdb, "%s", ":::address not 32Byte aligned.");
}
if (block && !IS_ALIGNED((u32)block->getAddress() + param_4, 0x20)) {
const char* file = lbl_8039D078;
const char* format = lbl_8039D078 + 0xc;
const char* arg1 = lbl_8039D078 + 0xc + 0x3;
JUTException_NS_panic_f(file, 0xe3, format, arg1);
JUTException_NS_panic_f("JKRAram.cpp", 0xe3, "%s", ":::address not 32Byte aligned.");
}
}
@@ -290,3 +284,6 @@ asm JSUList<12JKRAMCommand>::~JSUList<12JKRAMCommand>(void) {
#include "JSystem/JKernel/JKRAram/asm/func_802D2DF0.s"
}
#endif
const char* lbl_8039D0A6 = "bad aramSync\n";
const char* lbl_8039D0B4 = "\x00\x00\x00"; /* padding */
+5 -9
View File
@@ -24,15 +24,11 @@ JKRAMCommand* JKRAramPiece::orderAsync(int direction, u32 source, u32 destinatio
JKRAramBlock* block, JKRAMCommand::AsyncCallback callback) {
lock();
if (((source & 0x1f) != 0) || ((destination & 0x1f) != 0)) {
OSReport(lbl_8039D0B8, direction); // "direction = %x\n"
OSReport(lbl_8039D0B8 + 0x10, source); // "source = %x\n"
OSReport(lbl_8039D0B8 + 0x1D, destination); // "destination = %x\n"
OSReport(lbl_8039D0B8 + 0x2F, length); // "length = %x\n"
const char* filename = lbl_8039D0B8 + 0x3C; // "JKRAramPiece.cpp"§
const char* format = lbl_8039D0B8 + 0x3C + 0x11; // "%s"
const char* arg1 = lbl_8039D0B8 + 0x3C + 0x14; // "illegal address. abort."
JUTException_NS_panic_f(filename, 0x6c, format, arg1);
OSReport("direction = %x\n", direction);
OSReport("source = %x\n", source);
OSReport("destination = %x\n", destination);
OSReport("length = %x\n", length);
JUTException_NS_panic_f("JKRAramPiece.cpp", 0x6c, "%s", "illegal address. abort.");
}
Message* message = new (JKRHeap::getSystemHeap(), -4) Message();
+4 -4
View File
@@ -2,6 +2,8 @@
#include "JSystem/JKernel/JKRAramPiece/JKRAramPiece.h"
#include "global.h"
extern char lbl_8039D120[32];
JKRAramStream* JKRAramStream::create(long priority) {
if (!sAramStreamObject) {
sAramStreamObject = new (JKRGetSystemHeap(), 0) JKRAramStream(priority);
@@ -86,10 +88,7 @@ s32 JKRAramStream::writeToAram(JKRAramStreamCommand* command) {
heap->dump();
}
const char* file = lbl_8039D120; // "JKRAramStream.cpp";
const char* format = lbl_8039D120 + 0x12; // "%s";
const char* arg1 = lbl_8039D120 + 0x15; // ":::Cannot alloc memory\n";
JUTException_NS_panic_f(file, 0xac, format, arg1);
JUTException_NS_panic_f("JKRAramStream.cpp", 0xac, "%s", ":::Cannot alloc memory\n");
}
if (buffer) {
@@ -208,3 +207,4 @@ JKRAramStreamCommand::JKRAramStreamCommand() {
s32 JSURandomInputStream::getAvailable() const {
return getLength() - getPosition();
}
+3 -4
View File
@@ -336,10 +336,7 @@ void JKRHeap::copyMemory(void* dst, void* src, u32 size) {
}
void JKRHeap::JKRDefaultMemoryErrorRoutine(JKRHeap* heap, u32 size, int alignment) {
const char* filename = lbl_8039CAD8; // "JKRHeap.cpp"
const char* format = lbl_8039CAD8 + 12; // "%s"
const char* arg1 = lbl_8039CAD8 + 15; // "abort\n"
JUTException_NS_panic_f(filename, 0x33f, format, arg1);
JUTException_NS_panic_f("JKRHeap.cpp", 0x33f, "%s", "abort\n");
}
bool JKRHeap::setErrorFlag(bool errorFlag) {
@@ -437,3 +434,5 @@ u8 JKRHeap::do_changeGroupID(u8 newGroupID) {
u8 JKRHeap::do_getCurrentGroupId() const {
return 0;
}
const char* lbl_8039CAEE = "\x00"; /* padding */
+2
View File
@@ -282,3 +282,5 @@ void* JKRSolidHeap::do_getMaxFreeBlock(void) const {
s32 JKRSolidHeap::do_getTotalFreeSize(void) const {
return getFreeSize();
}
const char* lbl_8039CFA7 = ""; /* padding */
+7
View File
@@ -2,6 +2,13 @@
#include "JSystem/JKernel/JKRHeap/JKRHeap.h"
#include "global.h"
// lbl_80455FC0 JKRThread.o @934
static const u8 lbl_80455FC0[4] = {0x42, 0xc8, 0x0, 0x0};
// lbl_80455FC4 JKRThread.o @935
static const u8 lbl_80455FC4[4] = {0x44, 0x7a, 0x0, 0x0};
// lbl_80455FC8 JKRThread.o @937
static const u8 lbl_80455FC8[8] = {0x43, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
JKRThread::JKRThread(u32 stack_size, int message_count, int param_3) : mThreadListLink(this) {
mSwitchCount = 0;
mCost = 0;