From 5a9dc2dff24d0f6531a2fe95466b50d58613834a Mon Sep 17 00:00:00 2001 From: koopthekoopa Date: Wed, 5 Jun 2024 10:26:37 +0100 Subject: [PATCH] revamp the build system "a bit" --- .gitignore | 5 +- Makefile | 65 +++++++++---------- README.md | 9 +-- .../iplRso.s => 43U/system/IplRsoSystem.s} | 2 +- .../43U => 43U/system}/RIPL_BoardRecord.s | 0 .../43U => 43U/system}/iplBs2Manager.s | 2 +- asm/{system/43U => 43U/system}/iplCdbBackup.s | 0 .../43U => 43U/system}/iplCdbManager.s | 0 .../43U => 43U/system}/iplCdbWrapper.s | 0 .../43U => 43U/system}/iplChannelManager.s | 0 .../43U => 43U/system}/iplChannelRsoThread.s | 0 .../system}/iplChannelScriptManager.s | 0 .../43U => 43U/system}/iplController.s | 0 .../43U => 43U/system}/iplDialogWindow.s | 32 ++++----- .../43U => 43U/system}/iplErrorHandler.s | 2 +- asm/{system/43U => 43U/system}/iplException.s | 0 asm/{system/43U => 43U/system}/iplFramework.s | 0 .../43U => 43U/system}/iplHomeButtonMenu.s | 8 +-- asm/{system/43U => 43U/system}/iplKeyboard.s | 0 asm/{system/43U => 43U/system}/iplMessage.s | 0 .../43U => 43U/system}/iplMessageManager.s | 0 asm/{system/43U => 43U/system}/iplNand.s | 2 +- .../43U => 43U/system}/iplNandManager.s | 0 asm/{system/43U => 43U/system}/iplNandMeta.s | 0 .../43U => 43U/system}/iplNandSDWorker.s | 0 .../43U => 43U/system}/iplNandShared.s | 0 asm/{system/43U => 43U/system}/iplNandWall.s | 0 .../43U => 43U/system}/iplNandWrapper.s | 0 asm/{system/43U => 43U/system}/iplNigaoe.s | 0 .../43U => 43U/system}/iplNigaoeManager.s | 0 .../43U => 43U/system}/iplNwc24Manager.s | 0 .../43U => 43U/system}/iplPlayTimeLog.s | 0 asm/{system/43U => 43U/system}/iplPointer.s | 0 .../43U => 43U/system}/iplPointerCore.s | 2 +- .../43U => 43U/system}/iplPostmanManager.s | 0 .../43U => 43U/system}/iplResetHandler.s | 0 .../43U => 43U/system}/iplSDVFWorker.s | 0 .../43U => 43U/system}/iplSaveDataManager.s | 0 .../43U => 43U/system}/iplSocketSetting.s | 0 asm/{system/43U => 43U/system}/iplSystem.s | 2 +- asm/{system/43U => 43U/system}/iplTVRC.s | 2 +- .../43U => 43U/system}/iplTVRCManager.s | 15 ++++- .../43U => 43U/system}/iplWarningHandler.s | 0 asm/{system/43U => 43U/system}/main.s | 0 asm/{system/43U => 43U/system}/odh.s | 0 asm/{system/43U => 43U/system}/rvl_dec.s | 0 asm/BS1.s | 4 +- include/BS1.inc | 6 +- include/macros.inc | 17 +++++ ldscript_ipl2.lcf | 49 +++++++------- libs/RVL_SDK/rules/RVLSDKLibs/base.mak | 19 ++++++ libs/RVL_SDK/rules/RVLSDKLibs/os.mak | 21 ++++++ libs/RVL_SDK/rules/base/build.mak | 13 ---- libs/RVL_SDK/rules/base/define.mak | 5 -- libs/RVL_SDK/rules/build.mak | 15 ----- libs/RVL_SDK/rules/define.mak | 6 -- libs/RVL_SDK/rules/mainrules.mak | 16 +++++ libs/RVL_SDK/rules/os/build.mak | 13 ---- libs/RVL_SDK/rules/os/define.mak | 7 -- libs/RevoEX/rules/RevoEXLibs/net.mak | 19 ++++++ libs/RevoEX/rules/build.mak | 14 ---- libs/RevoEX/rules/define.mak | 5 -- libs/RevoEX/rules/mainrules.mak | 15 +++++ libs/RevoEX/rules/net/build.mak | 13 ---- libs/RevoEX/rules/net/define.mak | 5 -- libs/Runtime/rules/build.mak | 26 -------- libs/Runtime/rules/define.mak | 14 ---- libs/Runtime/rules/mainrules.mak | 35 ++++++++++ libs/Runtime/src/Gecko_ExceptionPPC.cpp | 8 +++ libs/Runtime/src/__init_cpp_exceptions.cpp | 8 +-- libs/Runtime/src/global_destructor_chain.c | 4 +- libs/Runtime/src/runtime.c | 48 +++++++------- prepare.py | 2 +- rules/BS1/build.mak | 4 -- rules/BS1/define.mak | 3 - rules/BS1rules.mak | 26 ++++++++ rules/BS2/build.mak | 13 ---- rules/BS2/define.mak | 6 -- rules/BS2Libs/BS2.mak | 20 ++++++ rules/BS2Libs/system.mak | 56 ++++++++++++++++ rules/BS2rules.mak | 36 ++++++++++ rules/ElfToBS.mak | 0 rules/build.mak | 22 ------- rules/define.mak | 31 --------- rules/{global_build.mak => global/build.mak} | 2 +- .../{global_define.mak => global/define.mak} | 39 ++++++----- rules/system/build.mak | 13 ---- rules/system/define.mak | 42 ------------ src/BS2/BootStart.c | 12 ++-- src/system/main.cpp | 9 +-- src/system/odh.cpp | 4 +- tools/elf2bs.c | 6 +- 92 files changed, 461 insertions(+), 438 deletions(-) rename asm/{system/43U/iplRso.s => 43U/system/IplRsoSystem.s} (99%) rename asm/{system/43U => 43U/system}/RIPL_BoardRecord.s (100%) rename asm/{system/43U => 43U/system}/iplBs2Manager.s (99%) rename asm/{system/43U => 43U/system}/iplCdbBackup.s (100%) rename asm/{system/43U => 43U/system}/iplCdbManager.s (100%) rename asm/{system/43U => 43U/system}/iplCdbWrapper.s (100%) rename asm/{system/43U => 43U/system}/iplChannelManager.s (100%) rename asm/{system/43U => 43U/system}/iplChannelRsoThread.s (100%) rename asm/{system/43U => 43U/system}/iplChannelScriptManager.s (100%) rename asm/{system/43U => 43U/system}/iplController.s (100%) rename asm/{system/43U => 43U/system}/iplDialogWindow.s (99%) rename asm/{system/43U => 43U/system}/iplErrorHandler.s (99%) rename asm/{system/43U => 43U/system}/iplException.s (100%) rename asm/{system/43U => 43U/system}/iplFramework.s (100%) rename asm/{system/43U => 43U/system}/iplHomeButtonMenu.s (98%) rename asm/{system/43U => 43U/system}/iplKeyboard.s (100%) rename asm/{system/43U => 43U/system}/iplMessage.s (100%) rename asm/{system/43U => 43U/system}/iplMessageManager.s (100%) rename asm/{system/43U => 43U/system}/iplNand.s (99%) rename asm/{system/43U => 43U/system}/iplNandManager.s (100%) rename asm/{system/43U => 43U/system}/iplNandMeta.s (100%) rename asm/{system/43U => 43U/system}/iplNandSDWorker.s (100%) rename asm/{system/43U => 43U/system}/iplNandShared.s (100%) rename asm/{system/43U => 43U/system}/iplNandWall.s (100%) rename asm/{system/43U => 43U/system}/iplNandWrapper.s (100%) rename asm/{system/43U => 43U/system}/iplNigaoe.s (100%) rename asm/{system/43U => 43U/system}/iplNigaoeManager.s (100%) rename asm/{system/43U => 43U/system}/iplNwc24Manager.s (100%) rename asm/{system/43U => 43U/system}/iplPlayTimeLog.s (100%) rename asm/{system/43U => 43U/system}/iplPointer.s (100%) rename asm/{system/43U => 43U/system}/iplPointerCore.s (99%) rename asm/{system/43U => 43U/system}/iplPostmanManager.s (100%) rename asm/{system/43U => 43U/system}/iplResetHandler.s (100%) rename asm/{system/43U => 43U/system}/iplSDVFWorker.s (100%) rename asm/{system/43U => 43U/system}/iplSaveDataManager.s (100%) rename asm/{system/43U => 43U/system}/iplSocketSetting.s (100%) rename asm/{system/43U => 43U/system}/iplSystem.s (99%) rename asm/{system/43U => 43U/system}/iplTVRC.s (99%) rename asm/{system/43U => 43U/system}/iplTVRCManager.s (98%) rename asm/{system/43U => 43U/system}/iplWarningHandler.s (100%) rename asm/{system/43U => 43U/system}/main.s (100%) rename asm/{system/43U => 43U/system}/odh.s (100%) rename asm/{system/43U => 43U/system}/rvl_dec.s (100%) create mode 100644 libs/RVL_SDK/rules/RVLSDKLibs/base.mak create mode 100644 libs/RVL_SDK/rules/RVLSDKLibs/os.mak delete mode 100644 libs/RVL_SDK/rules/base/build.mak delete mode 100644 libs/RVL_SDK/rules/base/define.mak delete mode 100644 libs/RVL_SDK/rules/build.mak delete mode 100644 libs/RVL_SDK/rules/define.mak create mode 100644 libs/RVL_SDK/rules/mainrules.mak delete mode 100644 libs/RVL_SDK/rules/os/build.mak delete mode 100644 libs/RVL_SDK/rules/os/define.mak create mode 100644 libs/RevoEX/rules/RevoEXLibs/net.mak delete mode 100644 libs/RevoEX/rules/build.mak delete mode 100644 libs/RevoEX/rules/define.mak create mode 100644 libs/RevoEX/rules/mainrules.mak delete mode 100644 libs/RevoEX/rules/net/build.mak delete mode 100644 libs/RevoEX/rules/net/define.mak delete mode 100644 libs/Runtime/rules/build.mak delete mode 100644 libs/Runtime/rules/define.mak create mode 100644 libs/Runtime/rules/mainrules.mak delete mode 100644 rules/BS1/build.mak delete mode 100644 rules/BS1/define.mak create mode 100644 rules/BS1rules.mak delete mode 100644 rules/BS2/build.mak delete mode 100644 rules/BS2/define.mak create mode 100644 rules/BS2Libs/BS2.mak create mode 100644 rules/BS2Libs/system.mak create mode 100644 rules/BS2rules.mak create mode 100644 rules/ElfToBS.mak delete mode 100644 rules/build.mak delete mode 100644 rules/define.mak rename rules/{global_build.mak => global/build.mak} (99%) rename rules/{global_define.mak => global/define.mak} (50%) delete mode 100644 rules/system/build.mak delete mode 100644 rules/system/define.mak diff --git a/.gitignore b/.gitignore index 79bba24f..05e04783 100644 --- a/.gitignore +++ b/.gitignore @@ -48,7 +48,8 @@ tools/info.txt *.bin *.map *.log -READMEcomp.md -objdiff.json +*.elf +*.dol +objdiff.json.old *.lnk diff --git a/Makefile b/Makefile index f663ad86..0afeec47 100644 --- a/Makefile +++ b/Makefile @@ -1,58 +1,53 @@ -VERSION := 43U -IPL_INFILE = base.$(VERSION).app +VERSION := 43U +IPL_INFILE = base.$(VERSION).app ifneq ($(VERSION),43U) $(error Only Wii Menu 4.3U is currently supported) endif ifneq ($(OS),Windows_NT) -EXEC = wine -PY = python +EXEC = wine +PY = python else -EXEC = -PY = python3 +EXEC = +PY = python3 endif ### Directory defines -BUILD_ROOT = build/$(VERSION) -CONFIG_ROOT = config/$(VERSION) -OBJECT_ROOT = $(BUILD_ROOT)/obj -ASSEMBLY_ROOT = asm -SOURCE_ROOT = src -INCLUDE_ROOT = include -RULES_ROOT = rules -TOOLS_ROOT = tools -LIBRARIES_ROOT = libs +BUILD_ROOT = build/$(VERSION) +CONFIG_ROOT = config/$(VERSION) +OBJECT_ROOT = $(BUILD_ROOT)/obj +ASSEMBLY_ROOT = asm +VER_ASSEMBLY_ROOT = $(ASSEMBLY_ROOT)/$(VERSION) +SOURCE_ROOT = src +INCLUDE_ROOT = include +RULES_ROOT = rules +TOOLS_ROOT = tools +LIBRARIES_ROOT = libs ### Library path defines -RUNTIME_ROOT = $(LIBRARIES_ROOT)/Runtime -METROTRK_ROOT = $(LIBRARIES_ROOT)/MetroTRK -MSL_ROOT = $(LIBRARIES_ROOT)/MSL -REVOLUTION_SDK_ROOT = $(LIBRARIES_ROOT)/RVL_SDK -REVOLUTION_EXT_ROOT = $(LIBRARIES_ROOT)/RevoEX +RUNTIME_ROOT = $(LIBRARIES_ROOT)/Runtime +METROTRK_ROOT = $(LIBRARIES_ROOT)/MetroTRK +MSL_ROOT = $(LIBRARIES_ROOT)/MSL +REVOLUTION_SDK_ROOT = $(LIBRARIES_ROOT)/RVL_SDK +REVOLUTION_EXT_ROOT = $(LIBRARIES_ROOT)/RevoEX -include $(RULES_ROOT)/global_define.mak +include $(RULES_ROOT)/global/define.mak +include $(RULES_ROOT)/global/build.mak ### Setup library files -include $(RUNTIME_ROOT)/$(RULES_ROOT)/define.mak -include $(REVOLUTION_SDK_ROOT)/$(RULES_ROOT)/define.mak -include $(REVOLUTION_EXT_ROOT)/$(RULES_ROOT)/define.mak -include $(RULES_ROOT)/define.mak ### Main thing -all: Runtime RVL_SDK RevoEX ipl $(BIN_OUTPUT) +all: Runtime RVL_SDK RevoEX bs1 bs2 $(BIN_OUTPUT) -clean: clean_Runtime clean_RVL_SDK clean_RevoEX clean_ipl +clean: clean_Runtime clean_RVL_SDK clean_RevoEX clean_bs1 clean_bs2 -include $(RULES_ROOT)/global_build.mak - ### Build library files -include $(RUNTIME_ROOT)/$(RULES_ROOT)/build.mak -include $(REVOLUTION_SDK_ROOT)/$(RULES_ROOT)/build.mak -include $(REVOLUTION_EXT_ROOT)/$(RULES_ROOT)/build.mak -include $(RULES_ROOT)/build.mak - - +include $(RUNTIME_ROOT)/$(RULES_ROOT)/$(DEFRULES).mak +include $(REVOLUTION_SDK_ROOT)/$(RULES_ROOT)/$(DEFRULES).mak +include $(REVOLUTION_EXT_ROOT)/$(RULES_ROOT)/$(DEFRULES).mak +include $(RULES_ROOT)/BS1rules.mak +include $(RULES_ROOT)/BS2rules.mak \ No newline at end of file diff --git a/README.md b/README.md index ae27f677..282099bd 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,6 @@ If you have not got Wine installed, You will need to follow [this guide](https:/ ``` - Otherwise download the repository by clicking on **Code** then **Download ZIP** then extract the .zip contents - You will need to prepare for compiling. To do that you need to type in - On Windows: - ``` - python prepare.py - ``` - On Linux: ``` python3 prepare.py ``` @@ -72,9 +67,9 @@ If you have not got Wine installed, You will need to follow [this guide](https:/ |`ipl.43E.app` (Version 4.3E)|`2ebea6ed22473857ed64b12daa71ae2d1ed61708`| # Credits -[decomp-toolkit](https://www.github.com/encounter/decomp-toolkit) - A tool that can do a lot and will make decompiling GameCube/Wii games easier and better. Special thanks to the every contributer :D +[decomp-toolkit](https://www.github.com/encounter/decomp-toolkit) - A tool that can do a lot and will make decompiling GameCube/Wii games easier and better. Seriously thanks to the people who worked on this. [objdiff](https://www.github.com/encounter/objdiff) - Used to check whenever if the compiled object is matching or not. -[Ghidra](https://www.github.com/NationalSecurityAgency/ghidra) - Used to load executables and output an approximate decompilaton of a function. +[Ghidra](https://www.github.com/NationalSecurityAgency/ghidra) - Used to load executables and output a rough decompilaton of a function. [WiiBrew](https://www.wiibrew.org) - A website that contains dozens of documentation about the Wii. [Gamecube/Wii Decompilation Discord](https://discord.gg/hKx3FJJgrV) - Contains helpful resources for decompiling. diff --git a/asm/system/43U/iplRso.s b/asm/43U/system/IplRsoSystem.s similarity index 99% rename from asm/system/43U/iplRso.s rename to asm/43U/system/IplRsoSystem.s index 839c73a0..b6e392c5 100644 --- a/asm/system/43U/iplRso.s +++ b/asm/43U/system/IplRsoSystem.s @@ -164,7 +164,7 @@ /* 81359C78 00028078 2C 03 00 00 */ cmpwi r3, 0x0 /* 81359C7C 0002807C 7C 7F 1B 78 */ mr r31, r3 /* 81359C80 00028080 41 82 00 10 */ beq .L_81359C90 -/* 81359C84 00028084 48 00 8B ED */ bl fn_81362870 +/* 81359C84 00028084 48 00 8B ED */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 81359C88 00028088 38 00 00 01 */ li r0, 0x1 /* 81359C8C 0002808C 90 1F 00 14 */ stw r0, 0x14(r31) .L_81359C90: diff --git a/asm/system/43U/RIPL_BoardRecord.s b/asm/43U/system/RIPL_BoardRecord.s similarity index 100% rename from asm/system/43U/RIPL_BoardRecord.s rename to asm/43U/system/RIPL_BoardRecord.s diff --git a/asm/system/43U/iplBs2Manager.s b/asm/43U/system/iplBs2Manager.s similarity index 99% rename from asm/system/43U/iplBs2Manager.s rename to asm/43U/system/iplBs2Manager.s index 48fd4f5d..dc44fa06 100644 --- a/asm/system/43U/iplBs2Manager.s +++ b/asm/43U/system/iplBs2Manager.s @@ -1,5 +1,5 @@ .include "macros.inc" -.file "iplBs2Manager.cpp" +.file "iplBS2Manager.cpp" # 0x813607A0 - 0x81361048 .text diff --git a/asm/system/43U/iplCdbBackup.s b/asm/43U/system/iplCdbBackup.s similarity index 100% rename from asm/system/43U/iplCdbBackup.s rename to asm/43U/system/iplCdbBackup.s diff --git a/asm/system/43U/iplCdbManager.s b/asm/43U/system/iplCdbManager.s similarity index 100% rename from asm/system/43U/iplCdbManager.s rename to asm/43U/system/iplCdbManager.s diff --git a/asm/system/43U/iplCdbWrapper.s b/asm/43U/system/iplCdbWrapper.s similarity index 100% rename from asm/system/43U/iplCdbWrapper.s rename to asm/43U/system/iplCdbWrapper.s diff --git a/asm/system/43U/iplChannelManager.s b/asm/43U/system/iplChannelManager.s similarity index 100% rename from asm/system/43U/iplChannelManager.s rename to asm/43U/system/iplChannelManager.s diff --git a/asm/system/43U/iplChannelRsoThread.s b/asm/43U/system/iplChannelRsoThread.s similarity index 100% rename from asm/system/43U/iplChannelRsoThread.s rename to asm/43U/system/iplChannelRsoThread.s diff --git a/asm/system/43U/iplChannelScriptManager.s b/asm/43U/system/iplChannelScriptManager.s similarity index 100% rename from asm/system/43U/iplChannelScriptManager.s rename to asm/43U/system/iplChannelScriptManager.s diff --git a/asm/system/43U/iplController.s b/asm/43U/system/iplController.s similarity index 100% rename from asm/system/43U/iplController.s rename to asm/43U/system/iplController.s diff --git a/asm/system/43U/iplDialogWindow.s b/asm/43U/system/iplDialogWindow.s similarity index 99% rename from asm/system/43U/iplDialogWindow.s rename to asm/43U/system/iplDialogWindow.s index 688ade21..becb13d1 100644 --- a/asm/system/43U/iplDialogWindow.s +++ b/asm/43U/system/iplDialogWindow.s @@ -812,7 +812,7 @@ /* 813453B8 000137B8 38 63 02 8C */ addi r3, r3, 0x28c /* 813453BC 000137BC 48 1C CF 5D */ bl fn_81512318 /* 813453C0 000137C0 7C 7D 1B 78 */ mr r29, r3 -/* 813453C4 000137C4 48 01 D4 AD */ bl fn_81362870 +/* 813453C4 000137C4 48 01 D4 AD */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 813453C8 000137C8 93 DD 00 14 */ stw r30, 0x14(r29) /* 813453CC 000137CC 88 1F 00 37 */ lbz r0, 0x37(r31) /* 813453D0 000137D0 2C 00 00 00 */ cmpwi r0, 0x0 @@ -848,7 +848,7 @@ /* 81345440 00013840 38 63 02 8C */ addi r3, r3, 0x28c /* 81345444 00013844 48 1C CE D5 */ bl fn_81512318 /* 81345448 00013848 7C 7D 1B 78 */ mr r29, r3 -/* 8134544C 0001384C 48 01 D4 25 */ bl fn_81362870 +/* 8134544C 0001384C 48 01 D4 25 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 81345450 00013850 93 DD 00 14 */ stw r30, 0x14(r29) /* 81345454 00013854 88 1F 00 37 */ lbz r0, 0x37(r31) /* 81345458 00013858 2C 00 00 00 */ cmpwi r0, 0x0 @@ -903,7 +903,7 @@ /* 81345510 00013910 38 63 02 8C */ addi r3, r3, 0x28c /* 81345514 00013914 48 1C CE 05 */ bl fn_81512318 /* 81345518 00013918 7C 7D 1B 78 */ mr r29, r3 -/* 8134551C 0001391C 48 01 D3 55 */ bl fn_81362870 +/* 8134551C 0001391C 48 01 D3 55 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 81345520 00013920 93 DD 00 14 */ stw r30, 0x14(r29) /* 81345524 00013924 88 1F 00 37 */ lbz r0, 0x37(r31) /* 81345528 00013928 2C 00 00 00 */ cmpwi r0, 0x0 @@ -985,7 +985,7 @@ /* 81345620 00013A20 38 63 02 8C */ addi r3, r3, 0x28c /* 81345624 00013A24 48 1C CC F5 */ bl fn_81512318 /* 81345628 00013A28 7C 7F 1B 78 */ mr r31, r3 -/* 8134562C 00013A2C 48 01 D2 45 */ bl fn_81362870 +/* 8134562C 00013A2C 48 01 D2 45 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 81345630 00013A30 38 60 00 01 */ li r3, 0x1 /* 81345634 00013A34 38 00 00 04 */ li r0, 0x4 /* 81345638 00013A38 90 7F 00 14 */ stw r3, 0x14(r31) @@ -1130,7 +1130,7 @@ /* 81345814 00013C14 38 63 02 8C */ addi r3, r3, 0x28c /* 81345818 00013C18 48 1C CB 01 */ bl fn_81512318 /* 8134581C 00013C1C 7C 7E 1B 78 */ mr r30, r3 -/* 81345820 00013C20 48 01 D0 51 */ bl fn_81362870 +/* 81345820 00013C20 48 01 D0 51 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 81345824 00013C24 38 00 00 01 */ li r0, 0x1 /* 81345828 00013C28 90 1E 00 14 */ stw r0, 0x14(r30) /* 8134582C 00013C2C 48 00 00 34 */ b .L_81345860 @@ -1144,7 +1144,7 @@ /* 81345848 00013C48 38 63 02 8C */ addi r3, r3, 0x28c /* 8134584C 00013C4C 48 1C CA CD */ bl fn_81512318 /* 81345850 00013C50 7C 7E 1B 78 */ mr r30, r3 -/* 81345854 00013C54 48 01 D0 1D */ bl fn_81362870 +/* 81345854 00013C54 48 01 D0 1D */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 81345858 00013C58 38 00 00 01 */ li r0, 0x1 /* 8134585C 00013C5C 90 1E 00 14 */ stw r0, 0x14(r30) .L_81345860: @@ -1337,7 +1337,7 @@ /* 81345B1C 00013F1C 38 63 02 8C */ addi r3, r3, 0x28c /* 81345B20 00013F20 48 1C C7 F9 */ bl fn_81512318 /* 81345B24 00013F24 7C 7E 1B 78 */ mr r30, r3 -/* 81345B28 00013F28 48 01 CD 49 */ bl fn_81362870 +/* 81345B28 00013F28 48 01 CD 49 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 81345B2C 00013F2C 38 00 00 01 */ li r0, 0x1 /* 81345B30 00013F30 90 1E 00 14 */ stw r0, 0x14(r30) .L_81345B34: @@ -1615,7 +1615,7 @@ /* 81345F00 00014300 2C 00 00 00 */ cmpwi r0, 0x0 /* 81345F04 00014304 41 82 00 D8 */ beq .L_81345FDC /* 81345F08 00014308 38 60 00 00 */ li r3, 0x0 -/* 81345F0C 0001430C 48 01 CB C1 */ bl fn_81362ACC +/* 81345F0C 0001430C 48 01 CB C1 */ bl setDefaultOrtho__Q33ipl7utility8GraphicsFUl /* 81345F10 00014310 80 7F 00 78 */ lwz r3, 0x78(r31) /* 81345F14 00014314 80 63 00 00 */ lwz r3, 0x0(r3) /* 81345F18 00014318 48 02 48 85 */ bl fn_8136A79C @@ -1933,7 +1933,7 @@ /* 8134634C 0001474C 38 63 02 8C */ addi r3, r3, 0x28c /* 81346350 00014750 48 1C BF C9 */ bl fn_81512318 /* 81346354 00014754 7C 7E 1B 78 */ mr r30, r3 -/* 81346358 00014758 48 01 C5 19 */ bl fn_81362870 +/* 81346358 00014758 48 01 C5 19 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 8134635C 0001475C 38 60 00 01 */ li r3, 0x1 /* 81346360 00014760 38 C0 00 02 */ li r6, 0x2 /* 81346364 00014764 90 7E 00 14 */ stw r3, 0x14(r30) @@ -2055,7 +2055,7 @@ /* 81346510 00014910 38 63 02 8C */ addi r3, r3, 0x28c /* 81346514 00014914 48 1C BE 05 */ bl fn_81512318 /* 81346518 00014918 7C 7F 1B 78 */ mr r31, r3 -/* 8134651C 0001491C 48 01 C3 55 */ bl fn_81362870 +/* 8134651C 0001491C 48 01 C3 55 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 81346520 00014920 38 00 00 01 */ li r0, 0x1 /* 81346524 00014924 3C 60 81 09 */ lis r3, lbl_8108992C@ha /* 81346528 00014928 3C 80 81 63 */ lis r4, lbl_8163596B@ha @@ -2149,7 +2149,7 @@ /* 8134666C 00014A6C 38 63 02 8C */ addi r3, r3, 0x28c /* 81346670 00014A70 48 1C BC A9 */ bl fn_81512318 /* 81346674 00014A74 7C 7E 1B 78 */ mr r30, r3 -/* 81346678 00014A78 48 01 C1 F9 */ bl fn_81362870 +/* 81346678 00014A78 48 01 C1 F9 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 8134667C 00014A7C 3C 60 81 09 */ lis r3, lbl_8108992C@ha /* 81346680 00014A80 3C 80 81 63 */ lis r4, lbl_8163596B@ha /* 81346684 00014A84 93 FE 00 14 */ stw r31, 0x14(r30) @@ -2899,7 +2899,7 @@ /* 813470FC 000154FC 38 63 02 8C */ addi r3, r3, 0x28c /* 81347100 00015500 48 1C B2 19 */ bl fn_81512318 /* 81347104 00015504 7C 7E 1B 78 */ mr r30, r3 -/* 81347108 00015508 48 01 B7 69 */ bl fn_81362870 +/* 81347108 00015508 48 01 B7 69 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 8134710C 0001550C 93 FE 00 14 */ stw r31, 0x14(r30) /* 81347110 00015510 38 80 00 03 */ li r4, 0x3 /* 81347114 00015514 80 7C 00 78 */ lwz r3, 0x78(r28) @@ -2977,7 +2977,7 @@ /* 81347224 00015624 38 63 02 8C */ addi r3, r3, 0x28c /* 81347228 00015628 48 1C B0 F1 */ bl fn_81512318 /* 8134722C 0001562C 7C 7E 1B 78 */ mr r30, r3 -/* 81347230 00015630 48 01 B6 41 */ bl fn_81362870 +/* 81347230 00015630 48 01 B6 41 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 81347234 00015634 93 FE 00 14 */ stw r31, 0x14(r30) /* 81347238 00015638 38 80 00 03 */ li r4, 0x3 /* 8134723C 0001563C 80 7C 00 78 */ lwz r3, 0x78(r28) @@ -3092,7 +3092,7 @@ /* 813473B4 000157B4 38 63 02 8C */ addi r3, r3, 0x28c /* 813473B8 000157B8 48 1C AF 61 */ bl fn_81512318 /* 813473BC 000157BC 7C 7E 1B 78 */ mr r30, r3 -/* 813473C0 000157C0 48 01 B4 B1 */ bl fn_81362870 +/* 813473C0 000157C0 48 01 B4 B1 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 813473C4 000157C4 38 00 00 01 */ li r0, 0x1 /* 813473C8 000157C8 90 1E 00 14 */ stw r0, 0x14(r30) .L_813473CC: @@ -3186,7 +3186,7 @@ /* 813474F0 000158F0 38 63 02 8C */ addi r3, r3, 0x28c /* 813474F4 000158F4 48 1C AE 25 */ bl fn_81512318 /* 813474F8 000158F8 7C 7D 1B 78 */ mr r29, r3 -/* 813474FC 000158FC 48 01 B3 75 */ bl fn_81362870 +/* 813474FC 000158FC 48 01 B3 75 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 81347500 00015900 38 00 00 01 */ li r0, 0x1 /* 81347504 00015904 90 1D 00 14 */ stw r0, 0x14(r29) .L_81347508: @@ -3327,7 +3327,7 @@ /* 813476DC 00015ADC 38 63 02 8C */ addi r3, r3, 0x28c /* 813476E0 00015AE0 48 1C AC 39 */ bl fn_81512318 /* 813476E4 00015AE4 7C 7E 1B 78 */ mr r30, r3 -/* 813476E8 00015AE8 48 01 B1 89 */ bl fn_81362870 +/* 813476E8 00015AE8 48 01 B1 89 */ bl initFrame__Q33ipl7utility15FrameControllerFv /* 813476EC 00015AEC 38 60 00 01 */ li r3, 0x1 /* 813476F0 00015AF0 90 7E 00 14 */ stw r3, 0x14(r30) /* 813476F4 00015AF4 80 1F 00 8C */ lwz r0, 0x8c(r31) diff --git a/asm/system/43U/iplErrorHandler.s b/asm/43U/system/iplErrorHandler.s similarity index 99% rename from asm/system/43U/iplErrorHandler.s rename to asm/43U/system/iplErrorHandler.s index 74b7b52b..2968c0b8 100644 --- a/asm/system/43U/iplErrorHandler.s +++ b/asm/43U/system/iplErrorHandler.s @@ -270,7 +270,7 @@ /* 813567D0 00024BD0 2C 00 00 01 */ cmpwi r0, 0x1 /* 813567D4 00024BD4 40 82 00 14 */ bne .L_813567E8 /* 813567D8 00024BD8 38 60 00 00 */ li r3, 0x0 -/* 813567DC 00024BDC 48 00 C2 F1 */ bl fn_81362ACC +/* 813567DC 00024BDC 48 00 C2 F1 */ bl setDefaultOrtho__Q33ipl7utility8GraphicsFUl /* 813567E0 00024BE0 80 7F 00 20 */ lwz r3, 0x20(r31) /* 813567E4 00024BE4 48 01 3F B9 */ bl fn_8136A79C .L_813567E8: diff --git a/asm/system/43U/iplException.s b/asm/43U/system/iplException.s similarity index 100% rename from asm/system/43U/iplException.s rename to asm/43U/system/iplException.s diff --git a/asm/system/43U/iplFramework.s b/asm/43U/system/iplFramework.s similarity index 100% rename from asm/system/43U/iplFramework.s rename to asm/43U/system/iplFramework.s diff --git a/asm/system/43U/iplHomeButtonMenu.s b/asm/43U/system/iplHomeButtonMenu.s similarity index 98% rename from asm/system/43U/iplHomeButtonMenu.s rename to asm/43U/system/iplHomeButtonMenu.s index ff1e6dad..44e89237 100644 --- a/asm/system/43U/iplHomeButtonMenu.s +++ b/asm/43U/system/iplHomeButtonMenu.s @@ -128,7 +128,7 @@ /* 81347D34 00016134 93 C1 00 48 */ stw r30, 0x48(r1) /* 81347D38 00016138 7C 7E 1B 78 */ mr r30, r3 /* 81347D3C 0001613C 38 60 00 00 */ li r3, 0x0 -/* 81347D40 00016140 48 01 AD 8D */ bl fn_81362ACC +/* 81347D40 00016140 48 01 AD 8D */ bl setDefaultOrtho__Q33ipl7utility8GraphicsFUl /* 81347D44 00016144 80 7E 00 20 */ lwz r3, 0x20(r30) /* 81347D48 00016148 38 81 00 20 */ addi r4, r1, 0x20 /* 81347D4C 0001614C 38 A0 00 00 */ li r5, 0x0 @@ -158,7 +158,7 @@ /* 81347DAC 000161AC 99 01 00 09 */ stb r8, 0x9(r1) /* 81347DB0 000161B0 98 01 00 0A */ stb r0, 0xa(r1) /* 81347DB4 000161B4 9B E1 00 0B */ stb r31, 0xb(r1) -/* 81347DB8 000161B8 48 01 B2 05 */ bl fn_81362FBC +/* 81347DB8 000161B8 48 01 B2 05 */ bl drawTexture__Q33ipl7utility8GraphicsFRCQ34nw4r2ut4RectRC9_GXTexObj8_GXColorUcQ43ipl7utility8Graphics11Orientation /* 81347DBC 000161BC 80 01 00 54 */ lwz r0, 0x54(r1) /* 81347DC0 000161C0 83 E1 00 4C */ lwz r31, 0x4c(r1) /* 81347DC4 000161C4 83 C1 00 48 */ lwz r30, 0x48(r1) @@ -521,14 +521,14 @@ /* 813482D0 000166D0 2C 00 00 00 */ cmpwi r0, 0x0 /* 813482D4 000166D4 41 82 00 10 */ beq .L_813482E4 /* 813482D8 000166D8 38 60 00 00 */ li r3, 0x0 -/* 813482DC 000166DC 48 01 A7 F1 */ bl fn_81362ACC +/* 813482DC 000166DC 48 01 A7 F1 */ bl setDefaultOrtho__Q33ipl7utility8GraphicsFUl /* 813482E0 000166E0 48 02 94 61 */ bl fn_81371740 .L_813482E4: /* 813482E4 000166E4 88 1F 00 68 */ lbz r0, 0x68(r31) /* 813482E8 000166E8 2C 00 00 00 */ cmpwi r0, 0x0 /* 813482EC 000166EC 41 82 00 18 */ beq .L_81348304 /* 813482F0 000166F0 38 60 00 00 */ li r3, 0x0 -/* 813482F4 000166F4 48 01 A7 D9 */ bl fn_81362ACC +/* 813482F4 000166F4 48 01 A7 D9 */ bl setDefaultOrtho__Q33ipl7utility8GraphicsFUl /* 813482F8 000166F8 88 9F 00 71 */ lbz r4, 0x71(r31) /* 813482FC 000166FC 7F E3 FB 78 */ mr r3, r31 /* 81348300 00016700 4B FF FA 21 */ bl DrawBanIcon__Q23ipl14HomeButtonMenuFUc diff --git a/asm/system/43U/iplKeyboard.s b/asm/43U/system/iplKeyboard.s similarity index 100% rename from asm/system/43U/iplKeyboard.s rename to asm/43U/system/iplKeyboard.s diff --git a/asm/system/43U/iplMessage.s b/asm/43U/system/iplMessage.s similarity index 100% rename from asm/system/43U/iplMessage.s rename to asm/43U/system/iplMessage.s diff --git a/asm/system/43U/iplMessageManager.s b/asm/43U/system/iplMessageManager.s similarity index 100% rename from asm/system/43U/iplMessageManager.s rename to asm/43U/system/iplMessageManager.s diff --git a/asm/system/43U/iplNand.s b/asm/43U/system/iplNand.s similarity index 99% rename from asm/system/43U/iplNand.s rename to asm/43U/system/iplNand.s index f6a8de5d..3f5b70f3 100644 --- a/asm/system/43U/iplNand.s +++ b/asm/43U/system/iplNand.s @@ -1001,7 +1001,7 @@ /* 8133C06C 0000A46C 4B FF F2 C9 */ bl __ct__Q33ipl4nand4FileFPQ23EGG4HeapPCcP9ARCHandlePCciUlb .L_8133C070: /* 8133C070 0000A470 90 79 00 04 */ stw r3, 0x4(r25) -/* 8133C074 0000A474 48 02 74 ED */ bl fn_81363560 +/* 8133C074 0000A474 48 02 74 ED */ bl getPath__Q33ipl7utility8LanguageFv /* 8133C078 0000A478 7C 7F 1B 78 */ mr r31, r3 /* 8133C07C 0000A47C 7F 64 DB 78 */ mr r4, r27 /* 8133C080 0000A480 38 61 00 08 */ addi r3, r1, 0x8 diff --git a/asm/system/43U/iplNandManager.s b/asm/43U/system/iplNandManager.s similarity index 100% rename from asm/system/43U/iplNandManager.s rename to asm/43U/system/iplNandManager.s diff --git a/asm/system/43U/iplNandMeta.s b/asm/43U/system/iplNandMeta.s similarity index 100% rename from asm/system/43U/iplNandMeta.s rename to asm/43U/system/iplNandMeta.s diff --git a/asm/system/43U/iplNandSDWorker.s b/asm/43U/system/iplNandSDWorker.s similarity index 100% rename from asm/system/43U/iplNandSDWorker.s rename to asm/43U/system/iplNandSDWorker.s diff --git a/asm/system/43U/iplNandShared.s b/asm/43U/system/iplNandShared.s similarity index 100% rename from asm/system/43U/iplNandShared.s rename to asm/43U/system/iplNandShared.s diff --git a/asm/system/43U/iplNandWall.s b/asm/43U/system/iplNandWall.s similarity index 100% rename from asm/system/43U/iplNandWall.s rename to asm/43U/system/iplNandWall.s diff --git a/asm/system/43U/iplNandWrapper.s b/asm/43U/system/iplNandWrapper.s similarity index 100% rename from asm/system/43U/iplNandWrapper.s rename to asm/43U/system/iplNandWrapper.s diff --git a/asm/system/43U/iplNigaoe.s b/asm/43U/system/iplNigaoe.s similarity index 100% rename from asm/system/43U/iplNigaoe.s rename to asm/43U/system/iplNigaoe.s diff --git a/asm/system/43U/iplNigaoeManager.s b/asm/43U/system/iplNigaoeManager.s similarity index 100% rename from asm/system/43U/iplNigaoeManager.s rename to asm/43U/system/iplNigaoeManager.s diff --git a/asm/system/43U/iplNwc24Manager.s b/asm/43U/system/iplNwc24Manager.s similarity index 100% rename from asm/system/43U/iplNwc24Manager.s rename to asm/43U/system/iplNwc24Manager.s diff --git a/asm/system/43U/iplPlayTimeLog.s b/asm/43U/system/iplPlayTimeLog.s similarity index 100% rename from asm/system/43U/iplPlayTimeLog.s rename to asm/43U/system/iplPlayTimeLog.s diff --git a/asm/system/43U/iplPointer.s b/asm/43U/system/iplPointer.s similarity index 100% rename from asm/system/43U/iplPointer.s rename to asm/43U/system/iplPointer.s diff --git a/asm/system/43U/iplPointerCore.s b/asm/43U/system/iplPointerCore.s similarity index 99% rename from asm/system/43U/iplPointerCore.s rename to asm/43U/system/iplPointerCore.s index dc50373a..fdc82331 100644 --- a/asm/system/43U/iplPointerCore.s +++ b/asm/43U/system/iplPointerCore.s @@ -234,7 +234,7 @@ /* 813447C4 00012BC4 48 2B 4D 05 */ bl _savegpr_29 /* 813447C8 00012BC8 7C 7D 1B 78 */ mr r29, r3 /* 813447CC 00012BCC 38 60 00 00 */ li r3, 0x0 -/* 813447D0 00012BD0 48 01 E2 FD */ bl fn_81362ACC +/* 813447D0 00012BD0 48 01 E2 FD */ bl setDefaultOrtho__Q33ipl7utility8GraphicsFUl /* 813447D4 00012BD4 3B C0 00 03 */ li r30, 0x3 /* 813447D8 00012BD8 3B E0 00 3C */ li r31, 0x3c .L_813447DC: diff --git a/asm/system/43U/iplPostmanManager.s b/asm/43U/system/iplPostmanManager.s similarity index 100% rename from asm/system/43U/iplPostmanManager.s rename to asm/43U/system/iplPostmanManager.s diff --git a/asm/system/43U/iplResetHandler.s b/asm/43U/system/iplResetHandler.s similarity index 100% rename from asm/system/43U/iplResetHandler.s rename to asm/43U/system/iplResetHandler.s diff --git a/asm/system/43U/iplSDVFWorker.s b/asm/43U/system/iplSDVFWorker.s similarity index 100% rename from asm/system/43U/iplSDVFWorker.s rename to asm/43U/system/iplSDVFWorker.s diff --git a/asm/system/43U/iplSaveDataManager.s b/asm/43U/system/iplSaveDataManager.s similarity index 100% rename from asm/system/43U/iplSaveDataManager.s rename to asm/43U/system/iplSaveDataManager.s diff --git a/asm/system/43U/iplSocketSetting.s b/asm/43U/system/iplSocketSetting.s similarity index 100% rename from asm/system/43U/iplSocketSetting.s rename to asm/43U/system/iplSocketSetting.s diff --git a/asm/system/43U/iplSystem.s b/asm/43U/system/iplSystem.s similarity index 99% rename from asm/system/43U/iplSystem.s rename to asm/43U/system/iplSystem.s index 9807ee09..21f0e295 100644 --- a/asm/system/43U/iplSystem.s +++ b/asm/43U/system/iplSystem.s @@ -1578,7 +1578,7 @@ /* 813341E4 000025E4 38 61 00 2C */ addi r3, r1, 0x2c /* 813341E8 000025E8 90 81 00 3C */ stw r4, 0x3c(r1) /* 813341EC 000025EC 90 01 00 38 */ stw r0, 0x38(r1) -/* 813341F0 000025F0 48 02 F2 6D */ bl fn_8136345C +/* 813341F0 000025F0 48 02 F2 6D */ bl setCalendarTime__Q33ipl7utility8CalendarFP14OSCalendarTime /* 813341F4 000025F4 38 60 00 58 */ li r3, 0x58 /* 813341F8 000025F8 48 23 62 F5 */ bl fn_8156A4EC /* 813341FC 000025FC 38 61 00 94 */ addi r3, r1, 0x94 diff --git a/asm/system/43U/iplTVRC.s b/asm/43U/system/iplTVRC.s similarity index 99% rename from asm/system/43U/iplTVRC.s rename to asm/43U/system/iplTVRC.s index 0a0e0771..d0517f1f 100644 --- a/asm/system/43U/iplTVRC.s +++ b/asm/43U/system/iplTVRC.s @@ -227,7 +227,7 @@ .L_81361320: /* 81361320 0002F720 38 80 00 00 */ li r4, 0x0 /* 81361324 0002F724 38 A0 00 08 */ li r5, 0x8 -/* 81361328 0002F728 48 00 13 C5 */ bl fn_813626EC +/* 81361328 0002F728 48 00 13 C5 */ bl RangeCheckGELTS32__Q23ipl7utilityFlll /* 8136132C 0002F72C 2C 03 00 00 */ cmpwi r3, 0x0 /* 81361330 0002F730 40 82 00 0C */ bne .L_8136133C /* 81361334 0002F734 38 60 00 00 */ li r3, 0x0 diff --git a/asm/system/43U/iplTVRCManager.s b/asm/43U/system/iplTVRCManager.s similarity index 98% rename from asm/system/43U/iplTVRCManager.s rename to asm/43U/system/iplTVRCManager.s index ec49d106..d8fdcfee 100644 --- a/asm/system/43U/iplTVRCManager.s +++ b/asm/43U/system/iplTVRCManager.s @@ -1,7 +1,7 @@ .include "macros.inc" .file "iplTVRCManager.cpp" -# 0x81361950 - 0x813626EC +# 0x81361950 - 0x8136270C .text .balign 4 @@ -990,6 +990,19 @@ /* 813626E8 00030AE8 4E 80 00 20 */ blr .endfn isTVRCChannel__Q23ipl11TVRCManagerFUl +# ipl::utility::RangeCheckGELTS32(long, long, long) +.fn RangeCheckGELTS32__Q23ipl7utilityFlll, global +/* 813626EC 00030AEC 7C 03 20 00 */ cmpw r3, r4 +/* 813626F0 00030AF0 38 00 00 00 */ li r0, 0x0 +/* 813626F4 00030AF4 41 80 00 10 */ blt .L_81362704 +/* 813626F8 00030AF8 7C 03 28 00 */ cmpw r3, r5 +/* 813626FC 00030AFC 40 80 00 08 */ bge .L_81362704 +/* 81362700 00030B00 38 00 00 01 */ li r0, 0x1 +.L_81362704: +/* 81362704 00030B04 7C 03 03 78 */ mr r3, r0 +/* 81362708 00030B08 4E 80 00 20 */ blr +.endfn RangeCheckGELTS32__Q23ipl7utilityFlll + # 0x81639890 - 0x81639900 .data .balign 8 diff --git a/asm/system/43U/iplWarningHandler.s b/asm/43U/system/iplWarningHandler.s similarity index 100% rename from asm/system/43U/iplWarningHandler.s rename to asm/43U/system/iplWarningHandler.s diff --git a/asm/system/43U/main.s b/asm/43U/system/main.s similarity index 100% rename from asm/system/43U/main.s rename to asm/43U/system/main.s diff --git a/asm/system/43U/odh.s b/asm/43U/system/odh.s similarity index 100% rename from asm/system/43U/odh.s rename to asm/43U/system/odh.s diff --git a/asm/system/43U/rvl_dec.s b/asm/43U/system/rvl_dec.s similarity index 100% rename from asm/system/43U/rvl_dec.s rename to asm/43U/system/rvl_dec.s diff --git a/asm/BS1.s b/asm/BS1.s index cb89f5df..24d4030d 100644 --- a/asm/BS1.s +++ b/asm/BS1.s @@ -128,6 +128,4 @@ __BS1_entry: .space BS2_ENTRY_PAD /* At the end of BS1 */ -.long BS2_ENTRY - - +.long BS2_ENTRY \ No newline at end of file diff --git a/include/BS1.inc b/include/BS1.inc index c8133cd2..b4e767d4 100644 --- a/include/BS1.inc +++ b/include/BS1.inc @@ -1,7 +1,7 @@ /*---------------------------------------------------------------------------* Wii Menu Boot Sequence 1 Disassembled from Version 4.3 (PAL) - but they are effectively the same in every version + but they are the exact same in every version *---------------------------------------------------------------------------*/ HID0_DEFAULT .set 0x00110C64 @@ -33,6 +33,4 @@ BS1_ALIGN .set 0x00000100 BS2_ENTRY .set 0x81330000 BS2_ENTRY_OFFSET .set 0x000037FC -BS2_ENTRY_PAD .set (BS2_ENTRY_OFFSET - 0x00003600) - - +BS2_ENTRY_PAD .set (BS2_ENTRY_OFFSET - 0x00003600) \ No newline at end of file diff --git a/include/macros.inc b/include/macros.inc index ac20a94f..bebf2e42 100644 --- a/include/macros.inc +++ b/include/macros.inc @@ -100,6 +100,15 @@ .set IBAT2L, 533 .set IBAT3U, 534 .set IBAT3L, 535 +.set IBAT3L, 535 +.set IBAT4U, 560 +.set IBAT4L, 561 +.set IBAT5U, 562 +.set IBAT5L, 563 +.set IBAT6U, 564 +.set IBAT6L, 565 +.set IBAT7U, 566 +.set IBAT7L, 567 .set DBAT0U, 536 .set DBAT0L, 537 .set DBAT1U, 538 @@ -108,6 +117,14 @@ .set DBAT2L, 541 .set DBAT3U, 542 .set DBAT3L, 543 +.set DBAT4U, 568 +.set DBAT4L, 569 +.set DBAT5U, 570 +.set DBAT5L, 571 +.set DBAT6U, 572 +.set DBAT6L, 573 +.set DBAT7U, 574 +.set DBAT7L, 575 .set GQR0, 912 .set GQR1, 913 .set GQR2, 914 diff --git a/ldscript_ipl2.lcf b/ldscript_ipl2.lcf index 2a32da75..5a8e3fc2 100644 --- a/ldscript_ipl2.lcf +++ b/ldscript_ipl2.lcf @@ -1,35 +1,36 @@ MEMORY { - da_bss : origin = 0x81080000 - text : origin = 0x81330000 + // The BSS is moved to there as since version 2.0 they were running out of free space in the BS2 area (0x81330000 - 0x8137D0000) which is where the Wii Menu is stored. + da_bss: origin = 0x81080000 + main: origin = 0x81330000 } SECTIONS { GROUP: { - .init ALIGN(0x20):{} - extab ALIGN(0x20):{} - extabindex ALIGN(0x20):{} - .text ALIGN(0x20):{} - .ctors ALIGN(0x20):{} - .dtors ALIGN(0x20):{} - .rodata ALIGN(0x20):{} - .data ALIGN(0x20):{} - .sdata2 ALIGN(0x20):{} - .sbss2 ALIGN(0x20):{} - .sdata ALIGN(0x20):{} - .sbss ALIGN(0x20):{} - .stack ALIGN(0x100):{} - } > text - + .init ALIGN(0x20):{} + extab ALIGN(0x20):{} + extabindex ALIGN(0x20):{} + .text ALIGN(0x20):{} + .ctors ALIGN(0x20):{} + .dtors ALIGN(0x20):{} + .rodata ALIGN(0x20):{} + .data ALIGN(0x20):{} + .sdata2 ALIGN(0x20):{} + .sbss2 ALIGN(0x20):{} + .sdata ALIGN(0x20):{} + .sbss ALIGN(0x20):{} + .stack ALIGN(0x100):{} + } > main + GROUP: { - .bss ALIGN(0x20):{} + .bss ALIGN(0x20):{} } > da_bss - _stack_end = _f_sbss + SIZEOF(.sbss); - _stack_addr = (_stack_end + 0xFFFF + 0x7) & ~0x7; - _db_stack_addr = (_stack_addr + 0x2000); - _db_stack_end = _stack_addr; - __ArenaLo = (_db_stack_addr + 0x1f) & ~0x1f; - __ArenaHi = 0x81700000; + _stack_end = _f_sbss + SIZEOF(.sbss); + _stack_addr = (_stack_end + 0xFFFF + 0x7) & ~0x7; + _db_stack_addr = (_stack_addr + 0x2000); + _db_stack_end = _stack_addr; + __ArenaLo = (_db_stack_addr + 0x1f) & ~0x1f; + __ArenaHi = 0x81700000; } diff --git a/libs/RVL_SDK/rules/RVLSDKLibs/base.mak b/libs/RVL_SDK/rules/RVLSDKLibs/base.mak new file mode 100644 index 00000000..c585c6a0 --- /dev/null +++ b/libs/RVL_SDK/rules/RVLSDKLibs/base.mak @@ -0,0 +1,19 @@ +BASE_LIBNAME = base +BASE_CFLAGS = -O4,s -ipa file $(COMMON_CCFLAGS) +BASE_CCPATH = $(CW_GC_30A52) +BASE_OBJECTS = PPCArch.o + +$(SDK_OBJ_PATH)/$(BASE_LIBNAME)/%.o: $(SDK_SRC_PATH)/$(BASE_LIBNAME)/%.c + $(call BuildCSources,$(BASE_CCPATH),$(BASE_CFLAGS),$(SDK_INC_PATHS),$(INCLUDE_ROOT)) + +$(SDK_OBJ_PATH)/$(BASE_LIBNAME)/%.o: $(SDK_SRC_PATH)/$(BASE_LIBNAME)/%.cpp + $(call BuildCPPSources,$(BASE_CCPATH),$(BASE_CFLAGS),$(SDK_INC_PATHS),$(INCLUDE_ROOT)) + +$(SDK_OBJ_PATH)/$(BASE_LIBNAME)/$(ASSEMBLY_ROOT)/%.o: $(SDK_ASM_PATH)/$(BASE_LIBNAME)/%.s + $(call BuildASMSources,$(INCLUDE_ROOT)) + +$(SDK_BLD_PATH)/$(BASE_LIBNAME).a: $(foreach OBJ,$(BASE_OBJECTS:.s=.o),$(SDK_OBJ_PATH)/$(BASE_LIBNAME)/$(OBJ)) + $(call LinkLibrary,$(BASE_CCPATH),$?,$@) + + + diff --git a/libs/RVL_SDK/rules/RVLSDKLibs/os.mak b/libs/RVL_SDK/rules/RVLSDKLibs/os.mak new file mode 100644 index 00000000..bbfc85cd --- /dev/null +++ b/libs/RVL_SDK/rules/RVLSDKLibs/os.mak @@ -0,0 +1,21 @@ +OS_LIBNAME = os +OS_CFLAGS = -O4,s -ipa file $(COMMON_CCFLAGS) +OS_CCPATH = $(CW_GC_30A52) +OS_OBJECTS = OSAlarm.o \ + stubs.o \ + __ppc_eabi_init.o + +$(SDK_OBJ_PATH)/$(OS_LIBNAME)/%.o: $(SDK_SRC_PATH)/$(OS_LIBNAME)/%.c + $(call BuildCSources,$(OS_CCPATH),$(OS_CFLAGS),$(SDK_INC_PATHS),$(INCLUDE_ROOT)) + +$(SDK_OBJ_PATH)/$(OS_LIBNAME)/%.o: $(SDK_SRC_PATH)/$(OS_LIBNAME)/%.cpp + $(call BuildCPPSources,$(OS_CCPATH),$(OS_CFLAGS),$(SDK_INC_PATHS),$(INCLUDE_ROOT)) + +$(SDK_OBJ_PATH)/$(OS_LIBNAME)/$(ASSEMBLY_ROOT)/%.o: $(SDK_ASM_PATH)/$(OS_LIBNAME)/%.s + $(call BuildASMSources,$(INCLUDE_ROOT)) + +$(SDK_BLD_PATH)/$(OS_LIBNAME).a: $(foreach OBJ,$(OS_OBJECTS:.s=.o),$(SDK_OBJ_PATH)/$(OS_LIBNAME)/$(OBJ)) + $(call LinkLibrary,$(OS_CCPATH),$?,$@) + + + diff --git a/libs/RVL_SDK/rules/base/build.mak b/libs/RVL_SDK/rules/base/build.mak deleted file mode 100644 index 6edc6254..00000000 --- a/libs/RVL_SDK/rules/base/build.mak +++ /dev/null @@ -1,13 +0,0 @@ -TMP_BASE_OBJ = $(BASE_SOURCES:.cpp=.o) -TMP_BASE2_OBJ = $(TMP_BASE_OBJ:.c=.o) -BASE_OBJECTS = $(foreach OBJ,$(TMP_BASE2_OBJ:.s=.o),$(RVLSDK_OBJROOT)/$(BASE_LIBNAME)/$(OBJ)) -BASE_BIN_OUT = $(RVLSDK_OUTROOT)/$(BASE_LIBNAME).a - -$(RVLSDK_OBJROOT)/$(BASE_LIBNAME)/%.o: $(RVLSDK_ASMROOT)/$(BASE_LIBNAME)/%.s - $(call BuildASMSources,$(INCLUDE_ROOT)) -$(RVLSDK_OBJROOT)/$(BASE_LIBNAME)/%.o: $(RVLSDK_SRCROOT)/$(BASE_LIBNAME)/%.c - $(call BuildCSources,$(BASE_CCPATH),$(BASE_CFLAGS),$(BASE_INCLUDES),$(RVLSDK_INCROOT)) -$(RVLSDK_OBJROOT)/$(BASE_LIBNAME)/%.o: $(RVLSDK_SRCROOT)/$(BASE_LIBNAME)/%.cpp - $(call BuildCPPSources,$(BASE_CCPATH),$(BASE_CFLAGS),$(BASE_INCLUDES),$(RVLSDK_INCROOT)) -$(BASE_BIN_OUT): $(BASE_OBJECTS) - $(call LinkLibrary,$(BASE_CCPATH),$(BASE_OBJECTS),$@) \ No newline at end of file diff --git a/libs/RVL_SDK/rules/base/define.mak b/libs/RVL_SDK/rules/base/define.mak deleted file mode 100644 index 8cd019c3..00000000 --- a/libs/RVL_SDK/rules/base/define.mak +++ /dev/null @@ -1,5 +0,0 @@ -BASE_LIBNAME = base -BASE_CFLAGS = -O4,p -ipa file $(COMMON_CCFLAGS) -BASE_INCLUDES = $(RVL_SDK_COMMON_INC) -BASE_CCPATH = $(CW_GC_30A52) -BASE_SOURCES = PPCArch.c \ No newline at end of file diff --git a/libs/RVL_SDK/rules/build.mak b/libs/RVL_SDK/rules/build.mak deleted file mode 100644 index 909e0af6..00000000 --- a/libs/RVL_SDK/rules/build.mak +++ /dev/null @@ -1,15 +0,0 @@ -RVLSDK_ASMROOT = $(REVOLUTION_SDK_ROOT)/$(ASSEMBLY_ROOT) -RVLSDK_SRCROOT = $(REVOLUTION_SDK_ROOT)/$(SOURCE_ROOT) -RVLSDK_OBJROOT = $(REVOLUTION_SDK_ROOT)/$(OBJECT_ROOT) -RVLSDK_OUTROOT = $(REVOLUTION_SDK_ROOT)/$(BUILD_ROOT) -RVLSDK_INCROOT = $(REVOLUTION_SDK_ROOT)/$(INCLUDE_ROOT) - -include $(REVOLUTION_SDK_ROOT)/$(RULES_ROOT)/base/build.mak -include $(REVOLUTION_SDK_ROOT)/$(RULES_ROOT)/os/build.mak - -RVL_SDK: $(BASE_BIN_OUT) $(OS_BIN_OUT) -clean_RVL_SDK: - @echo Cleaning RVL_SDK... - @rm -rf $(RVLSDK_OUTROOT) - - diff --git a/libs/RVL_SDK/rules/define.mak b/libs/RVL_SDK/rules/define.mak deleted file mode 100644 index 4f700bc8..00000000 --- a/libs/RVL_SDK/rules/define.mak +++ /dev/null @@ -1,6 +0,0 @@ -RVL_SDK_COMMON_INC = $(COMMON_INCLUDES) - -include $(REVOLUTION_SDK_ROOT)/$(RULES_ROOT)/base/define.mak -include $(REVOLUTION_SDK_ROOT)/$(RULES_ROOT)/os/define.mak - - diff --git a/libs/RVL_SDK/rules/mainrules.mak b/libs/RVL_SDK/rules/mainrules.mak new file mode 100644 index 00000000..f120a83b --- /dev/null +++ b/libs/RVL_SDK/rules/mainrules.mak @@ -0,0 +1,16 @@ +# mandatory +SDK_SRC_PATH = $(REVOLUTION_SDK_ROOT)/$(SOURCE_ROOT) +SDK_ASM_PATH = $(REVOLUTION_SDK_ROOT)/$(VER_ASSEMBLY_ROOT) +SDK_BLD_PATH = $(REVOLUTION_SDK_ROOT)/$(BUILD_ROOT) +SDK_OBJ_PATH = $(SDK_BLD_PATH)/obj +SDK_INC_PATHS = $(COMMON_INCLUDES) + +include $(REVOLUTION_SDK_ROOT)/$(RULES_ROOT)/RVLSDKLibs/base.mak +include $(REVOLUTION_SDK_ROOT)/$(RULES_ROOT)/RVLSDKLibs/os.mak + +RVL_SDK: $(SDK_BLD_PATH)/$(BASE_LIBNAME).a $(SDK_BLD_PATH)/$(OS_LIBNAME).a +clean_RVL_SDK: + @echo Cleaning RVL_SDK... + @rm -rf $(SDK_BLD_PATH) + + diff --git a/libs/RVL_SDK/rules/os/build.mak b/libs/RVL_SDK/rules/os/build.mak deleted file mode 100644 index c8b405f6..00000000 --- a/libs/RVL_SDK/rules/os/build.mak +++ /dev/null @@ -1,13 +0,0 @@ -TMP_OS_OBJ = $(OS_SOURCES:.cpp=.o) -TMP_OS2_OBJ = $(TMP_OS_OBJ:.c=.o) -OS_OBJECTS = $(foreach OBJ,$(TMP_OS2_OBJ:.s=.o),$(RVLSDK_OBJROOT)/$(OS_LIBNAME)/$(OBJ)) -OS_BIN_OUT = $(RVLSDK_OUTROOT)/$(OS_LIBNAME).a - -$(RVLSDK_OBJROOT)/$(OS_LIBNAME)/%.o: $(RVLSDK_ASMROOT)/$(OS_LIBNAME)/%.s - $(call BuildASMSources,$(INCLUDE_ROOT)) -$(RVLSDK_OBJROOT)/$(OS_LIBNAME)/%.o: $(RVLSDK_SRCROOT)/$(OS_LIBNAME)/%.c - $(call BuildCSources,$(OS_CCPATH),$(OS_CFLAGS),$(OS_INCLUDES),$(RVLSDK_INCROOT)) -$(RVLSDK_OBJROOT)/$(OS_LIBNAME)/%.o: $(RVLSDK_SRCROOT)/$(OS_LIBNAME)/%.cpp - $(call BuildCPPSources,$(OS_CCPATH),$(OS_CFLAGS),$(OS_INCLUDES),$(RVLSDK_INCROOT)) -$(OS_BIN_OUT): $(OS_OBJECTS) - $(call LinkLibrary,$(OS_CCPATH),$(OS_OBJECTS),$@) \ No newline at end of file diff --git a/libs/RVL_SDK/rules/os/define.mak b/libs/RVL_SDK/rules/os/define.mak deleted file mode 100644 index b63669e8..00000000 --- a/libs/RVL_SDK/rules/os/define.mak +++ /dev/null @@ -1,7 +0,0 @@ -OS_LIBNAME = os -OS_CFLAGS = -O4,p -ipa file $(COMMON_CCFLAGS) -OS_INCLUDES = $(RVL_SDK_COMMON_INC) -OS_CCPATH = $(CW_GC_30A52) -OS_SOURCES = OSAlarm.c \ - stubs.c \ - __ppc_eabi_init.cpp \ No newline at end of file diff --git a/libs/RevoEX/rules/RevoEXLibs/net.mak b/libs/RevoEX/rules/RevoEXLibs/net.mak new file mode 100644 index 00000000..1f85272f --- /dev/null +++ b/libs/RevoEX/rules/RevoEXLibs/net.mak @@ -0,0 +1,19 @@ +NET_LIBNAME = net +NET_CFLAGS = -O4,s -ipa file $(COMMON_CCFLAGS) +NET_CCPATH = $(CW_GC_30A52) +NET_OBJECTS = NETDigest.o + +$(REVOEX_OBJ_PATH)/$(NET_LIBNAME)/%.o: $(REVOEX_SRC_PATH)/$(NET_LIBNAME)/%.c + $(call BuildCSources,$(NET_CCPATH),$(NET_CFLAGS),$(REVOEX_INC_PATHS),$(INCLUDE_ROOT)) + +$(REVOEX_OBJ_PATH)/$(NET_LIBNAME)/%.o: $(REVOEX_SRC_PATH)/$(NET_LIBNAME)/%.cpp + $(call BuildCPPSources,$(NET_CCPATH),$(NET_CFLAGS),$(REVOEX_INC_PATHS),$(INCLUDE_ROOT)) + +$(REVOEX_OBJ_PATH)/$(NET_LIBNAME)/$(ASSEMBLY_ROOT)/%.o: $(REVOEX_ASM_PATH)/$(NET_LIBNAME)/%.s + $(call BuildASMSources,$(INCLUDE_ROOT)) + +$(REVOEX_BLD_PATH)/$(NET_LIBNAME).a: $(foreach OBJ,$(NET_OBJECTS:.s=.o),$(REVOEX_OBJ_PATH)/$(NET_LIBNAME)/$(OBJ)) + $(call LinkLibrary,$(NET_CCPATH),$?,$@) + + + diff --git a/libs/RevoEX/rules/build.mak b/libs/RevoEX/rules/build.mak deleted file mode 100644 index db195aa7..00000000 --- a/libs/RevoEX/rules/build.mak +++ /dev/null @@ -1,14 +0,0 @@ -REVOEX_ASMROOT = $(REVOLUTION_EXT_ROOT)/$(ASSEMBLY_ROOT) -REVOEX_SRCROOT = $(REVOLUTION_EXT_ROOT)/$(SOURCE_ROOT) -REVOEX_OBJROOT = $(REVOLUTION_EXT_ROOT)/$(OBJECT_ROOT) -REVOEX_OUTROOT = $(REVOLUTION_EXT_ROOT)/$(BUILD_ROOT) -REVOEX_INCROOT = $(REVOLUTION_EXT_ROOT)/$(INCLUDE_ROOT) - -include $(REVOLUTION_EXT_ROOT)/$(RULES_ROOT)/net/build.mak - -RevoEX: $(NET_BIN_OUT) -clean_RevoEX: - @echo Cleaning RevoEX... - @rm -rf $(REVOEX_OUTROOT) - - diff --git a/libs/RevoEX/rules/define.mak b/libs/RevoEX/rules/define.mak deleted file mode 100644 index 997e3320..00000000 --- a/libs/RevoEX/rules/define.mak +++ /dev/null @@ -1,5 +0,0 @@ -REVO_EXT_COMMON_INC = $(COMMON_INCLUDES) - -include $(REVOLUTION_EXT_ROOT)/$(RULES_ROOT)/net/define.mak - - diff --git a/libs/RevoEX/rules/mainrules.mak b/libs/RevoEX/rules/mainrules.mak new file mode 100644 index 00000000..3823385b --- /dev/null +++ b/libs/RevoEX/rules/mainrules.mak @@ -0,0 +1,15 @@ +# mandatory +REVOEX_SRC_PATH = $(REVOLUTION_EXT_ROOT)/$(SOURCE_ROOT) +REVOEX_ASM_PATH = $(REVOLUTION_EXT_ROOT)/$(VER_ASSEMBLY_ROOT) +REVOEX_BLD_PATH = $(REVOLUTION_EXT_ROOT)/$(BUILD_ROOT) +REVOEX_OBJ_PATH = $(REVOEX_BLD_PATH)/obj +REVOEX_INC_PATHS = $(COMMON_INCLUDES) + +include $(REVOLUTION_EXT_ROOT)/$(RULES_ROOT)/RevoEXLibs/net.mak + +RevoEX: $(REVOEX_BLD_PATH)/$(NET_LIBNAME).a +clean_RevoEX: + @echo Cleaning RevoEX... + @rm -rf $(REVOEX_BLD_PATH) + + diff --git a/libs/RevoEX/rules/net/build.mak b/libs/RevoEX/rules/net/build.mak deleted file mode 100644 index a223cb8a..00000000 --- a/libs/RevoEX/rules/net/build.mak +++ /dev/null @@ -1,13 +0,0 @@ -TMP_NET_OBJ = $(NET_SOURCES:.cpp=.o) -TMP_NET2_OBJ = $(TMP_NET_OBJ:.c=.o) -NET_OBJECTS = $(foreach OBJ,$(TMP_NET2_OBJ:.s=.o),$(REVOEX_OBJROOT)/$(NET_LIBNAME)/$(OBJ)) -NET_BIN_OUT = $(REVOEX_OUTROOT)/$(NET_LIBNAME).a - -$(REVOEX_OBJROOT)/$(NET_LIBNAME)/%.o: $(REVOEX_ASMROOT)/$(NET_LIBNAME)/%.s - $(call BuildASMSources,$(INCLUDE_ROOT)) -$(REVOEX_OBJROOT)/$(NET_LIBNAME)/%.o: $(REVOEX_SRCROOT)/$(NET_LIBNAME)/%.c - $(call BuildCSources,$(NET_CCPATH),$(NET_CFLAGS),$(NET_INCLUDES),$(REVOEX_INCROOT)) -$(REVOEX_OBJROOT)/$(NET_LIBNAME)/%.o: $(REVOEX_SRCROOT)/$(NET_LIBNAME)/%.cpp - $(call BuildCPPSources,$(NET_CCPATH),$(NET_CFLAGS),$(NET_INCLUDES),$(REVOEX_INCROOT)) -$(NET_BIN_OUT): $(NET_OBJECTS) - $(call LinkLibrary,$(NET_CCPATH),$(NET_OBJECTS),$@) \ No newline at end of file diff --git a/libs/RevoEX/rules/net/define.mak b/libs/RevoEX/rules/net/define.mak deleted file mode 100644 index b72f59b8..00000000 --- a/libs/RevoEX/rules/net/define.mak +++ /dev/null @@ -1,5 +0,0 @@ -NET_LIBNAME = net -NET_CFLAGS = -O4,p -ipa file $(COMMON_CCFLAGS) -NET_INCLUDES = $(REVO_EXT_COMMON_INC) -NET_CCPATH = $(CW_GC_30A52) -NET_SOURCES = NETDigest.c \ No newline at end of file diff --git a/libs/Runtime/rules/build.mak b/libs/Runtime/rules/build.mak deleted file mode 100644 index 2ce93c38..00000000 --- a/libs/Runtime/rules/build.mak +++ /dev/null @@ -1,26 +0,0 @@ -PPCRUN_ASMROOT = $(RUNTIME_ROOT)/$(ASSEMBLY_ROOT) -PPCRUN_SRCROOT = $(RUNTIME_ROOT)/$(SOURCE_ROOT) -PPCRUN_OBJROOT = $(RUNTIME_ROOT)/$(OBJECT_ROOT) -PPCRUN_OUTROOT = $(RUNTIME_ROOT)/$(BUILD_ROOT) -PPCRUN_INCROOT = $(RUNTIME_ROOT)/$(INCLUDE_ROOT) - -TMP_RUNTIME_OBJ = $(RUNTIME_SOURCES:.cpp=.o) -TMP_RUNTIME2_OBJ = $(TMP_RUNTIME_OBJ:.c=.o) -RUNTIME_OBJECTS = $(foreach OBJ,$(TMP_RUNTIME2_OBJ:.s=.o),$(PPCRUN_OBJROOT)/$(OBJ)) -RUNTIME_BIN_OUT = $(PPCRUN_OUTROOT)/$(RUNTIME_LIBNAME).a - -$(PPCRUN_OBJROOT)/%.o: $(PPCRUN_ASMROOT)/%.s - $(call BuildASMSources,$(INCLUDE_ROOT)) -$(PPCRUN_OBJROOT)/%.o: $(PPCRUN_SRCROOT)/%.c - $(call BuildCSources,$(RUNTIME_CCPATH),$(RUNTIME_CFLAGS),$(RUNTIME_INCLUDES),$(PPCRUN_INCROOT)) -$(PPCRUN_OBJROOT)/%.o: $(PPCRUN_SRCROOT)/%.cpp - $(call BuildCSources,$(RUNTIME_CCPATH),$(RUNTIME_CFLAGS),$(RUNTIME_INCLUDES),$(PPCRUN_INCROOT)) -$(RUNTIME_BIN_OUT): $(RUNTIME_OBJECTS) - $(call LinkLibrary,$(RUNTIME_CCPATH),$(RUNTIME_OBJECTS),$@) - -Runtime: $(RUNTIME_BIN_OUT) -clean_Runtime: - @echo Cleaning Runtime... - @rm -rf $(PPCRUN_OUTROOT) - - diff --git a/libs/Runtime/rules/define.mak b/libs/Runtime/rules/define.mak deleted file mode 100644 index e018f09d..00000000 --- a/libs/Runtime/rules/define.mak +++ /dev/null @@ -1,14 +0,0 @@ -RUNTIME_COMMON_INC = $(COMMON_INCLUDES) - -RUNTIME_LIBNAME = Runtime.PPCEABI.H -RUNTIME_CFLAGS = -O4,p $(COMMON_MW_CCFLAGS) -RUNTIME_INCLUDES = $(RUNTIME_COMMON_INC) -RUNTIME_CCPATH = $(CW_GC_30A52) -RUNTIME_SOURCES = __mem.c \ - __va_arg.c \ - global_destructor_chain.c \ - runtime.c \ - __init_cpp_exceptions.cpp \ - Gecko_ExceptionPPC.cpp - - diff --git a/libs/Runtime/rules/mainrules.mak b/libs/Runtime/rules/mainrules.mak new file mode 100644 index 00000000..e298c3bb --- /dev/null +++ b/libs/Runtime/rules/mainrules.mak @@ -0,0 +1,35 @@ +# mandatory +RUNTIME_SRC_PATH = $(RUNTIME_ROOT)/$(SOURCE_ROOT) +RUNTIME_ASM_PATH = $(RUNTIME_ROOT)/$(VER_ASSEMBLY_ROOT) +RUNTIME_BLD_PATH = $(RUNTIME_ROOT)/$(BUILD_ROOT) +RUNTIME_OBJ_PATH = $(RUNTIME_BLD_PATH)/obj +RUNTIME_INC_PATHS = $(COMMON_INCLUDES) + +RUNTIME_LIBNAME = Runtime.PPCEABI.H +RUNTIME_CFLAGS = -O4,p $(COMMON_CCFLAGS) +RUNTIME_CCPATH = $(CW_GC_30A52) +RUNTIME_OBJECTS = __mem.o \ + __va_arg.o \ + global_destructor_chain.o \ + runtime.o \ + __init_cpp_exceptions.o \ + Gecko_ExceptionPPC.o + +$(RUNTIME_OBJ_PATH)/%.o: $(RUNTIME_SRC_PATH)/%.c + $(call BuildCSources,$(RUNTIME_CCPATH),$(RUNTIME_CFLAGS),$(RUNTIME_INC_PATHS),$(INCLUDE_ROOT)) + +$(RUNTIME_OBJ_PATH)/%.o: $(RUNTIME_SRC_PATH)/%.cpp + $(call BuildCPPSources,$(RUNTIME_CCPATH),$(RUNTIME_CFLAGS),$(RUNTIME_INC_PATHS),$(INCLUDE_ROOT)) + +$(RUNTIME_OBJ_PATH)/$(ASSEMBLY_ROOT)/%.o: $(RUNTIME_ASM_PATH)/%.s + $(call BuildASMSources,$(INCLUDE_ROOT)) + +$(RUNTIME_BLD_PATH)/$(RUNTIME_LIBNAME).a: $(foreach OBJ,$(RUNTIME_OBJECTS:.s=.o),$(RUNTIME_OBJ_PATH)/$(OBJ)) + $(call LinkLibrary,$(RUNTIME_CCPATH),$?,$@) + +Runtime: $(RUNTIME_BLD_PATH)/$(RUNTIME_LIBNAME).a +clean_Runtime: + @echo Cleaning Runtime... + @rm -rf $(RUNTIME_BLD_PATH) + + diff --git a/libs/Runtime/src/Gecko_ExceptionPPC.cpp b/libs/Runtime/src/Gecko_ExceptionPPC.cpp index 5fba7a61..d294938d 100644 --- a/libs/Runtime/src/Gecko_ExceptionPPC.cpp +++ b/libs/Runtime/src/Gecko_ExceptionPPC.cpp @@ -1,5 +1,9 @@ #include <__ppc_eabi_linker.h> +#ifdef __cplusplus +extern "C" { +#endif + /* *** STUB *** */ @@ -14,4 +18,8 @@ void __unregister_fragment(int id) { } +#ifdef __cplusplus +} +#endif + diff --git a/libs/Runtime/src/__init_cpp_exceptions.cpp b/libs/Runtime/src/__init_cpp_exceptions.cpp index 946655b9..d4723639 100644 --- a/libs/Runtime/src/__init_cpp_exceptions.cpp +++ b/libs/Runtime/src/__init_cpp_exceptions.cpp @@ -24,8 +24,8 @@ static inline void __exception_info_constants(__eti_init_info* info, char** R2) } /* - @Address: 0x815F9D08 - @Size: 0x3C + @note Address: 0x815F9D08 + @note Size: 0x3C */ extern void __init_cpp_exceptions() { if (fragmentID == -2) { @@ -37,8 +37,8 @@ extern void __init_cpp_exceptions() { } /* - @Address: 0x815F9D44 - @Size: 0x34 + @note Address: 0x815F9D44 + @note Size: 0x34 */ extern void __fini_cpp_exceptions() { if (fragmentID != -2) { diff --git a/libs/Runtime/src/global_destructor_chain.c b/libs/Runtime/src/global_destructor_chain.c index 52f08b2d..630a4dda 100644 --- a/libs/Runtime/src/global_destructor_chain.c +++ b/libs/Runtime/src/global_destructor_chain.c @@ -4,7 +4,7 @@ DtorChain* __global_destructor_chain; /* - @Address: 0x815F8FE0 + @note Address: 0x815F8FE0 @Size 0x18 */ void __register_global_object(void* object, void* dtor, DtorChain* chain) { @@ -15,7 +15,7 @@ void __register_global_object(void* object, void* dtor, DtorChain* chain) { } /* - @Address: 0x815F8FF8 + @note Address: 0x815F8FF8 @Size 0x48 */ void __destroy_global_chain() { diff --git a/libs/Runtime/src/runtime.c b/libs/Runtime/src/runtime.c index a185a4ef..86439f87 100644 --- a/libs/Runtime/src/runtime.c +++ b/libs/Runtime/src/runtime.c @@ -311,8 +311,8 @@ static asm void __restore_gpr() { } /* - @Address: 0x815F9524 - @Size: 0xEC + @note Address: 0x815F9524 + @note Size: 0xEC */ asm void __div2u() { /* 815F9524 002C7924 2C 03 00 00 */ cmpwi r3, 0x0 @@ -386,8 +386,8 @@ L_815F9604: } /* - @Address: 0x815F9610 - @Size: 0x138 + @note Address: 0x815F9610 + @note Size: 0x138 */ asm void __div2i() { /* 815F9610 002C7A10 94 21 FF F0 */ stwu r1, -0x10(r1) @@ -484,8 +484,8 @@ L_815F9740: } /* - @Address: 0x815F9748 - @Size: 0xE4 + @note Address: 0x815F9748 + @note Size: 0xE4 */ asm void __mod2u() { /* 815F9748 002C7B48 2C 03 00 00 */ cmpwi r3, 0x0 @@ -557,8 +557,8 @@ L_815F9828: } /* - @Address: 0x815F982C - @Size: 0x10C + @note Address: 0x815F982C + @note Size: 0x10C */ asm void __mod2i() { /* 815F982C 002C7C2C 2F 83 00 00 */ cmpwi cr7, r3, 0x0 @@ -643,8 +643,8 @@ L_815F9934: } /* - @Address: 0x815F9938 - @Size: 0x24 + @note Address: 0x815F9938 + @note Size: 0x24 */ asm void __shl2i() { /* 815F9938 002C7D38 21 05 00 20 */ subfic r8, r5, 0x20 @@ -659,8 +659,8 @@ asm void __shl2i() { } /* - @Address: 0x815F995C - @Size: 0x24 + @note Address: 0x815F995C + @note Size: 0x24 */ asm void __shr2u() { /* 815F995C 002C7D5C 21 05 00 20 */ subfic r8, r5, 0x20 @@ -675,8 +675,8 @@ asm void __shr2u() { } /* - @Address: 0x815F9980 - @Size: 0x28 + @note Address: 0x815F9980 + @note Size: 0x28 */ asm void __shr2i() { /* 815F9980 002C7D80 21 05 00 20 */ subfic r8, r5, 0x20 @@ -693,8 +693,8 @@ L_815F99A0: } /* - @Address: 0x815F99A8 - @Size: 0xB0 + @note Address: 0x815F99A8 + @note Size: 0xB0 */ asm void __cvt_sll_dbl() { /* 815F99A8 002C7DA8 94 21 FF F0 */ stwu r1, -0x10(r1) @@ -748,8 +748,8 @@ L_815F9A44: } /* - @Address: 0x815F9A58 - @Size: 0x9C + @note Address: 0x815F9A58 + @note Size: 0x9C */ asm void __cvt_ull_dbl() { /* 815F9A58 002C7E58 94 21 FF F0 */ stwu r1, -0x10(r1) @@ -797,8 +797,8 @@ L_815F9AE0: } /* - @Address: 0x815F9AF4 - @Size: 0xA0 + @note Address: 0x815F9AF4 + @note Size: 0xA0 */ asm void __cvt_ull_flt() { /* 815F9AF4 002C7EF4 94 21 FF F0 */ stwu r1, -0x10(r1) @@ -847,8 +847,8 @@ L_815F9B7C: } /* - @Address: 0x815F9B94 - @Size: 0xCC + @note Address: 0x815F9B94 + @note Size: 0xCC */ asm void __cvt_dbl_usll() { /* 815F9B94 002C7F94 94 21 FF F0 */ stwu r1, -0x10(r1) @@ -911,8 +911,8 @@ L_815F9C58: } /* - @Address: 0x815F9C60 - @Size: 0xAB + @note Address: 0x815F9C60 + @note Size: 0xAB */ asm void __cvt_dbl_ull() { /* 815F9C60 002C8060 94 21 FF F0 */ stwu r1, -0x10(r1) diff --git a/prepare.py b/prepare.py index 260b7e88..2fb21cf9 100644 --- a/prepare.py +++ b/prepare.py @@ -21,7 +21,7 @@ def extractZIPURL(url): def main(): print("Downloading MWCC...") - extractZIPURL("https://files.decomp.dev/compilers_20231018.zip") + extractZIPURL("https://files.decomp.dev/compilers_latest.zip") print("Downloading PowerPC BinUtils...") diff --git a/rules/BS1/build.mak b/rules/BS1/build.mak deleted file mode 100644 index fde2a8be..00000000 --- a/rules/BS1/build.mak +++ /dev/null @@ -1,4 +0,0 @@ -BS1_OBJ = $(OBJECT_ROOT)/$(BS1_ASM:.s=.o) - -$(BS1_OBJ): $(ASSEMBLY_ROOT)/$(BS1_ASM) - $(call BuildMWCCASMSources,$(INCLUDE_ROOT),$(CW_GC_30A3)) \ No newline at end of file diff --git a/rules/BS1/define.mak b/rules/BS1/define.mak deleted file mode 100644 index b61c90e0..00000000 --- a/rules/BS1/define.mak +++ /dev/null @@ -1,3 +0,0 @@ -BS1_BINNAME = BS1 -BS1_CCPATH = $(CW_GC_30A52) -BS1_ASM = $(BS1_BINNAME).s \ No newline at end of file diff --git a/rules/BS1rules.mak b/rules/BS1rules.mak new file mode 100644 index 00000000..baa76cc3 --- /dev/null +++ b/rules/BS1rules.mak @@ -0,0 +1,26 @@ +# mandatory +BS1_BLD_PATH = $(BUILD_ROOT)/BS1 +BS1_OBJ_PATH = $(BS1_BLD_PATH)/obj + +# stuff for linking the elf +BS1_ELF_NAME = BS1 +BS1_ELF_CC = $(CW_GC_30A52) +BS1_ELF_ADDRESS = 0x80003400 + +# only one little object +BS1_OBJECTS = BS1.o + +$(BS1_OBJ_PATH)/%.o: $(ASSEMBLY_ROOT)/%.s + $(call BuildMWCCASMSources,$(INCLUDE_ROOT),$(BS1_ELF_CC)) +$(BUILD_ROOT)/$(BS1_ELF_NAME).elf: $(foreach OBJ,$(BS1_OBJECTS:.s=.o),$(BS1_OBJ_PATH)/$(OBJ)) + $(call LinkSmallElf,$(BS1_ELF_CC),$?,$@,$(BS1_ELF_ADDRESS)) + +bs1: $(BUILD_ROOT)/$(BS1_ELF_NAME).elf + +clean_bs1: + @echo Cleaning BS1... + @rm -rf $(BS1_BLD_PATH) + @rm -rf $(BUILD_ROOT)/$(BS1_ELF_NAME).elf + @rm -rf $(BUILD_ROOT)/$(BS1_ELF_NAME).map + + diff --git a/rules/BS2/build.mak b/rules/BS2/build.mak deleted file mode 100644 index 9da23fd2..00000000 --- a/rules/BS2/build.mak +++ /dev/null @@ -1,13 +0,0 @@ -TMP_BS2_OBJ = $(BS2_SOURCES:.cpp=.o) -TMP_BS2_2_OBJ = $(TMP_BS2_OBJ:.c=.o) -BS2_OBJECTS = $(foreach OBJ,$(TMP_BS2_2_OBJ:.s=.o),$(OBJECT_ROOT)/$(BS2_LIBNAME)/$(OBJ)) -BS2_BIN_OUT = $(BUILD_ROOT)/$(BS2_LIBNAME).a - -$(OBJECT_ROOT)/$(BS2_LIBNAME)/%.o: $(ASSEMBLY_ROOT)/$(BS2_LIBNAME)/%.s - $(call BuildASMSources,$(INCLUDE_ROOT)) -$(OBJECT_ROOT)/$(BS2_LIBNAME)/%.o: $(SOURCE_ROOT)/$(BS2_LIBNAME)/%.c - $(call BuildCSources,$(BS2_CCPATH),$(BS2_CFLAGS),$(BS2_INCLUDES),$(INCLUDE_ROOT)) -$(OBJECT_ROOT)/$(BS2_LIBNAME)/%.o: $(SOURCE_ROOT)/$(BS2_LIBNAME)/%.cpp - $(call BuildCPPSources,$(BS2_CCPATH),$(BS2_CFLAGS),$(BS2_INCLUDES),$(INCLUDE_ROOT)) -$(BS2_BIN_OUT): $(BS2_OBJECTS) - $(call LinkLibrary,$(BS2_CCPATH),$(BS2_OBJECTS),$@) \ No newline at end of file diff --git a/rules/BS2/define.mak b/rules/BS2/define.mak deleted file mode 100644 index 949f7b4c..00000000 --- a/rules/BS2/define.mak +++ /dev/null @@ -1,6 +0,0 @@ -BS2_LIBNAME = BS2 -BS2_CFLAGS = -O4,s -ipa file $(COMMON_CCFLAGS) -BS2_INCLUDES = $(BS2_COMMON_INC) -BS2_CCPATH = $(CW_GC_30A52) -BS2_SOURCES = BootStart.c \ - BS2.c \ No newline at end of file diff --git a/rules/BS2Libs/BS2.mak b/rules/BS2Libs/BS2.mak new file mode 100644 index 00000000..55b4f65b --- /dev/null +++ b/rules/BS2Libs/BS2.mak @@ -0,0 +1,20 @@ +BS2_LIBNAME = BS2 +BS2_CFLAGS = -O4,s -ipa file $(COMMON_CCFLAGS) +BS2_CCPATH = $(CW_GC_30A52) +BS2_OBJECTS = BootStart.o \ + BS2.o + +$(BS2_OBJ_PATH)/$(BS2_LIBNAME)/%.o: $(BS2_SRC_PATH)/$(BS2_LIBNAME)/%.c + $(call BuildCSources,$(BS2_CCPATH),$(BS2_CFLAGS),$(BS2_INC_PATHS),$(INCLUDE_ROOT)) + +$(BS2_OBJ_PATH)/$(BS2_LIBNAME)/%.o: $(BS2_SRC_PATH)/$(BS2_LIBNAME)/%.cpp + $(call BuildCPPSources,$(BS2_CCPATH),$(BS2_CFLAGS),$(BS2_INC_PATHS),$(INCLUDE_ROOT)) + +$(BS2_OBJ_PATH)/$(BS2_LIBNAME)/$(ASSEMBLY_ROOT)/%.o: $(BS2_ASM_PATH)/$(BS2_LIBNAME)/%.s + $(call BuildASMSources,$(INCLUDE_ROOT)) + +$(BS2_BLD_PATH)/$(BS2_LIBNAME).a: $(foreach OBJ,$(BS2_OBJECTS:.s=.o),$(BS2_OBJ_PATH)/$(BS2_LIBNAME)/$(OBJ)) + $(call LinkLibrary,$(BS2_CCPATH),$?,$@) + + + diff --git a/rules/BS2Libs/system.mak b/rules/BS2Libs/system.mak new file mode 100644 index 00000000..7fcad1cf --- /dev/null +++ b/rules/BS2Libs/system.mak @@ -0,0 +1,56 @@ +SYSTEM_LIBNAME = system +SYSTEM_CFLAGS = -O4,s -ipa file $(COMMON_CCFLAGS) +SYSTEM_CCPATH = $(CW_GC_30A52) +SYSTEM_OBJECTS = $(ASSEMBLY_ROOT)/rvl_dec.o \ + $(ASSEMBLY_ROOT)/RIPL_BoardRecord.o \ + $(ASSEMBLY_ROOT)/iplSystem.o \ + $(ASSEMBLY_ROOT)/iplController.o \ + $(ASSEMBLY_ROOT)/iplChannelManager.o \ + $(ASSEMBLY_ROOT)/iplChannelScriptManager.o \ + $(ASSEMBLY_ROOT)/iplFramework.o \ + $(ASSEMBLY_ROOT)/iplException.o \ + $(ASSEMBLY_ROOT)/iplMessage.o \ + $(ASSEMBLY_ROOT)/iplMessageManager.o \ + $(ASSEMBLY_ROOT)/iplNigaoeManager.o \ + $(ASSEMBLY_ROOT)/iplNigaoe.o \ + $(ASSEMBLY_ROOT)/iplCdbManager.o \ + $(ASSEMBLY_ROOT)/iplCdbWrapper.o \ + $(ASSEMBLY_ROOT)/iplPlayTimeLog.o \ + $(ASSEMBLY_ROOT)/iplNwc24Manager.o \ + $(ASSEMBLY_ROOT)/iplPointer.o \ + $(ASSEMBLY_ROOT)/iplPointerCore.o \ + $(ASSEMBLY_ROOT)/iplDialogWindow.o \ + $(ASSEMBLY_ROOT)/iplHomeButtonMenu.o \ + $(ASSEMBLY_ROOT)/iplNandSDWorker.o \ + $(ASSEMBLY_ROOT)/iplKeyboard.o \ + $(ASSEMBLY_ROOT)/iplErrorHandler.o \ + $(ASSEMBLY_ROOT)/iplResetHandler.o \ + $(ASSEMBLY_ROOT)/iplWarningHandler.o \ + $(ASSEMBLY_ROOT)/iplSocketSetting.o \ + $(ASSEMBLY_ROOT)/iplPostmanManager.o \ + $(ASSEMBLY_ROOT)/iplSaveDataManager.o \ + $(ASSEMBLY_ROOT)/iplChannelRsoThread.o \ + $(ASSEMBLY_ROOT)/IplRsoSystem.o \ + $(ASSEMBLY_ROOT)/iplCdbBackup.o \ + $(ASSEMBLY_ROOT)/odh.o \ + $(ASSEMBLY_ROOT)/iplSDVFWorker.o \ + $(ASSEMBLY_ROOT)/iplNandWrapper.o \ + main.o \ + $(ASSEMBLY_ROOT)/iplBs2Manager.o \ + $(ASSEMBLY_ROOT)/iplTVRC.o \ + $(ASSEMBLY_ROOT)/iplTVRCManager.o + +$(BS2_OBJ_PATH)/$(SYSTEM_LIBNAME)/%.o: $(BS2_SRC_PATH)/$(SYSTEM_LIBNAME)/%.c + $(call BuildCSources,$(SYSTEM_CCPATH),$(SYSTEM_CFLAGS),$(BS2_INC_PATHS),$(INCLUDE_ROOT)) + +$(BS2_OBJ_PATH)/$(SYSTEM_LIBNAME)/%.o: $(BS2_SRC_PATH)/$(SYSTEM_LIBNAME)/%.cpp + $(call BuildCPPSources,$(SYSTEM_CCPATH),$(SYSTEM_CFLAGS),$(BS2_INC_PATHS),$(INCLUDE_ROOT)) + +$(BS2_OBJ_PATH)/$(SYSTEM_LIBNAME)/$(ASSEMBLY_ROOT)/%.o: $(BS2_ASM_PATH)/$(SYSTEM_LIBNAME)/%.s + $(call BuildASMSources,$(INCLUDE_ROOT)) + +$(BS2_BLD_PATH)/$(SYSTEM_LIBNAME).a: $(foreach OBJ,$(SYSTEM_OBJECTS),$(BS2_OBJ_PATH)/$(SYSTEM_LIBNAME)/$(OBJ)) + $(call LinkLibrary,$(SYSTEM_CCPATH),$?,$@) + + + diff --git a/rules/BS2rules.mak b/rules/BS2rules.mak new file mode 100644 index 00000000..78045a46 --- /dev/null +++ b/rules/BS2rules.mak @@ -0,0 +1,36 @@ +# mandatory +BS2_SRC_PATH = $(SOURCE_ROOT) +BS2_ASM_PATH = $(VER_ASSEMBLY_ROOT) +BS2_BLD_PATH = $(BUILD_ROOT)/BS2 +BS2_OBJ_PATH = $(BS2_BLD_PATH)/obj +BS2_INC_PATHS = $(COMMON_INCLUDES) + +# stuff for linking the elf +BS2_ELF_NAME = BS2 +BS2_ELF_CC = $(CW_GC_30A52) +BS2_ELF_ENTRY_POINT = __start +BS2_ELF_ADDRESS = 0x81330000 +BS2_ELF_LINKSCRIPT = ldscript_ipl2.lcf +BS2_ELF_LIBRARIES = $(BS2_BLD_PATH)/system.a \ + $(BS2_BLD_PATH)/BS2.a \ + $(REVOLUTION_SDK_ROOT)/$(BUILD_ROOT)/base.a \ + $(REVOLUTION_SDK_ROOT)/$(BUILD_ROOT)/os.a \ + $(RUNTIME_ROOT)/$(BUILD_ROOT)/Runtime.PPCEABI.H.a + +# libraries +include $(RULES_ROOT)/BS2Libs/system.mak +include $(RULES_ROOT)/BS2Libs/BS2.mak + +$(BUILD_ROOT)/$(BS2_ELF_NAME).elf: $(BS2_ELF_LIBRARIES) + $(call LinkElf,$(BS2_ELF_CC),$?,$@,$(BS2_ELF_LINKSCRIPT)) + +# the target +bs2: $(BUILD_ROOT)/$(BS2_ELF_NAME).elf + +clean_bs2: + @echo Cleaning BS2... + @rm -rf $(BS2_BLD_PATH) + @rm -rf $(BUILD_ROOT)/$(BS2_ELF_NAME).elf + @rm -rf $(BUILD_ROOT)/$(BS2_ELF_NAME).map + + diff --git a/rules/ElfToBS.mak b/rules/ElfToBS.mak new file mode 100644 index 00000000..e69de29b diff --git a/rules/build.mak b/rules/build.mak deleted file mode 100644 index bb8cd642..00000000 --- a/rules/build.mak +++ /dev/null @@ -1,22 +0,0 @@ -include $(RULES_ROOT)/system/build.mak -include $(RULES_ROOT)/BS2/build.mak -include $(RULES_ROOT)/BS1/build.mak - -BS1_ELF_OUTPUT = $(BUILD_ROOT)/$(BS1_ELF_NAME).out.elf -BS2_ELF_OUTPUT = $(BUILD_ROOT)/$(BS2_ELF_NAME).out.elf - -ipl: $(SYSTEM_BIN_OUT) $(BS2_BIN_OUT) $(BS1_OBJ) $(BS1_ELF_OUTPUT) $(BS2_ELF_OUTPUT) - -clean_ipl: - @echo Cleaning IPL... - @rm -rf $(BUILD_ROOT) - -## Linking the BS1 exectuable -$(BS1_ELF_OUTPUT): $(BS1_ELF_OBJECTS) - $(call LinkSmallElf,$(BS1_ELF_CC),$(BS1_ELF_OBJECTS),$@,$(BS1_ELF_ADDRESS)) - -## Linking the BS2 exectuable -$(BS2_ELF_OUTPUT): $(BS2_ELF_OBJECTS) - $(call LinkElf,$(BS2_ELF_CC),$(BS2_ELF_OBJECTS),$@,$(BS2_ELF_LINKER_FILE)) - - diff --git a/rules/define.mak b/rules/define.mak deleted file mode 100644 index 58da4319..00000000 --- a/rules/define.mak +++ /dev/null @@ -1,31 +0,0 @@ -BS2_COMMON_INC = $(COMMON_INCLUDES) \ - $(REVOLUTION_EXT_ROOT)/$(INCLUDE_ROOT) - -include $(RULES_ROOT)/system/define.mak -include $(RULES_ROOT)/BS2/define.mak -include $(RULES_ROOT)/BS1/define.mak - -# for BS1 executable linking -BS1_ELF_NAME = BS1 -BS1_ELF_CC = $(CW_GC_30A52) -BS1_ELF_ENTRY_POINT = __BS1_entry -BS1_ELF_ADDRESS = 0x80003400 - -BS1_ELF_OBJECTS = $(OBJECT_ROOT)/BS1.o - -# for BS2 executable linking - -BS2_ELF_NAME = BS2 -BS2_ELF_CC = $(CW_GC_30A52) -BS2_ELF_LINKER_FILE = ldscript_ipl2.lcf -BS2_ELF_LDFLAGS = $(COMMON_LDFLAGS) - -# the objects!... or libraries -BS2_ELF_OBJECTS = $(BUILD_ROOT)/system.a \ - $(BUILD_ROOT)/BS2.a \ - $(REVOLUTION_EXT_ROOT)/$(BUILD_ROOT)/net.a \ - $(REVOLUTION_SDK_ROOT)/$(BUILD_ROOT)/base.a \ - $(REVOLUTION_SDK_ROOT)/$(BUILD_ROOT)/os.a \ - $(RUNTIME_ROOT)/$(BUILD_ROOT)/Runtime.PPCEABI.H.a - - diff --git a/rules/global_build.mak b/rules/global/build.mak similarity index 99% rename from rules/global_build.mak rename to rules/global/build.mak index 20a4d033..4624e5e6 100644 --- a/rules/global_build.mak +++ b/rules/global/build.mak @@ -1,6 +1,6 @@ ifneq ($(OS),Windows_NT) define AddPerms - chmod +x $(1) + @chmod +x $(1) endef endif diff --git a/rules/global_define.mak b/rules/global/define.mak similarity index 50% rename from rules/global_define.mak rename to rules/global/define.mak index b460b33d..bca046f7 100644 --- a/rules/global_define.mak +++ b/rules/global/define.mak @@ -1,32 +1,35 @@ -NULL = -NONE = none +NULL = +NONE = none -AS = powerpc-eabi-as -AS_MWCC = mwasmeppc.exe -CC = mwcceppc.exe -LD = mwldeppc.exe +DEFRULES = mainrules -CW_GC_27 = $(TOOLS_ROOT)/GC/2.7 -CW_GC_30A3 = $(TOOLS_ROOT)/GC/3.0a3 +AS = powerpc-eabi-as +AS_MWCC = mwasmeppc.exe +CC = mwcceppc.exe +LD = mwldeppc.exe + +CW_GC_27 = $(TOOLS_ROOT)/GC/2.7 +CW_GC_30A3 = $(TOOLS_ROOT)/GC/3.0a3 CW_GC_30A32 = $(TOOLS_ROOT)/GC/3.0a3.2 -CW_GC_30A33 = $(TOOLS_ROOT)/GC/3.0a3.3 +CW_GC_30A33 = $(TOOLS_ROOT)/GC/3.0a3.3 CW_GC_30A34 = $(TOOLS_ROOT)/GC/3.0a3.4 -CW_GC_30A5 = $(TOOLS_ROOT)/GC/3.0a5 -CW_GC_30A52 = $(TOOLS_ROOT)/GC/3.0a5.2 -CW_WII_10 = $(TOOLS_ROOT)/Wii/1.0 -CW_WII_11 = $(TOOLS_ROOT)/Wii/1.1 -CW_WII_13 = $(TOOLS_ROOT)/Wii/1.3 +CW_GC_30A5 = $(TOOLS_ROOT)/GC/3.0a5 +CW_GC_30A52 = $(TOOLS_ROOT)/GC/3.0a5.2 +CW_WII_10 = $(TOOLS_ROOT)/Wii/1.0 +CW_WII_11 = $(TOOLS_ROOT)/Wii/1.1 +CW_WII_13 = $(TOOLS_ROOT)/Wii/1.3 -COMMON_INCLUDES = $(INCLUDE_ROOT)/decomp \ +COMMON_INCLUDES = $(INCLUDE_ROOT)/decomp \ $(RUNTIME_ROOT)/$(INCLUDE_ROOT) \ $(METROTRK_ROOT)/$(INCLUDE_ROOT) \ $(MSL_ROOT)/$(INCLUDE_ROOT) \ - $(REVOLUTION_SDK_ROOT)/$(INCLUDE_ROOT) + $(REVOLUTION_SDK_ROOT)/$(INCLUDE_ROOT) \ + $(REVOLUTION_EXT_ROOT)/$(INCLUDE_ROOT) -COMMON_ASFLAGS = -mgekko +COMMON_ASFLAGS = -mgekko COMMON_MWCC_ASFLAGS = -proc gekko -# Common Compiler Flags for Nintendo's libraries +# Common Compiler Flags for Nintendo's libraries and the application COMMON_CCFLAGS = -enum int \ -inline auto \ -Cpp_exceptions off \ diff --git a/rules/system/build.mak b/rules/system/build.mak deleted file mode 100644 index 756ddb52..00000000 --- a/rules/system/build.mak +++ /dev/null @@ -1,13 +0,0 @@ -TMP_SYSTEM_OBJ = $(SYSTEM_SOURCES:.cpp=.o) -TMP_SYSTEM2_OBJ = $(TMP_SYSTEM_OBJ:.c=.o) -SYSTEM_OBJECTS = $(foreach OBJ,$(TMP_SYSTEM2_OBJ:.s=.o),$(OBJECT_ROOT)/$(SYSTEM_LIBNAME)/$(OBJ)) -SYSTEM_BIN_OUT = $(BUILD_ROOT)/$(SYSTEM_LIBNAME).a - -$(OBJECT_ROOT)/$(SYSTEM_LIBNAME)/%.o: $(ASSEMBLY_ROOT)/$(SYSTEM_LIBNAME)/%.s - $(call BuildASMSources,$(INCLUDE_ROOT)) -$(OBJECT_ROOT)/$(SYSTEM_LIBNAME)/%.o: $(SOURCE_ROOT)/$(SYSTEM_LIBNAME)/%.c - $(call BuildCSources,$(SYSTEM_CCPATH),$(SYSTEM_CFLAGS),$(SYSTEM_INCLUDES),$(INCLUDE_ROOT)) -$(OBJECT_ROOT)/$(SYSTEM_LIBNAME)/%.o: $(SOURCE_ROOT)/$(SYSTEM_LIBNAME)/%.cpp - $(call BuildCPPSources,$(SYSTEM_CCPATH),$(SYSTEM_CFLAGS),$(SYSTEM_INCLUDES),$(INCLUDE_ROOT)) -$(SYSTEM_BIN_OUT): $(SYSTEM_OBJECTS) - $(call LinkLibrary,$(SYSTEM_CCPATH),$(SYSTEM_OBJECTS),$@) \ No newline at end of file diff --git a/rules/system/define.mak b/rules/system/define.mak deleted file mode 100644 index 34377f29..00000000 --- a/rules/system/define.mak +++ /dev/null @@ -1,42 +0,0 @@ -SYSTEM_LIBNAME = system -SYSTEM_CFLAGS = -O4,s -ipa file $(COMMON_CCFLAGS) -SYSTEM_INCLUDES = $(BS2_COMMON_INC) -SYSTEM_CCPATH = $(CW_GC_30A52) -SYSTEM_SOURCES = $(VERSION)/rvl_dec.s \ - $(VERSION)/RIPL_BoardRecord.s \ - $(VERSION)/iplSystem.s \ - $(VERSION)/iplController.s \ - $(VERSION)/iplChannelManager.s \ - $(VERSION)/iplChannelScriptManager.s \ - $(VERSION)/iplFramework.s \ - $(VERSION)/iplException.s \ - $(VERSION)/iplMessage.s \ - $(VERSION)/iplMessageManager.s \ - $(VERSION)/iplNigaoeManager.s \ - $(VERSION)/iplNigaoe.s \ - $(VERSION)/iplCdbManager.s \ - $(VERSION)/iplCdbWrapper.s \ - $(VERSION)/iplPlayTimeLog.s \ - $(VERSION)/iplNwc24Manager.s \ - $(VERSION)/iplPointer.s \ - $(VERSION)/iplPointerCore.s \ - $(VERSION)/iplDialogWindow.s \ - $(VERSION)/iplHomeButtonMenu.s \ - $(VERSION)/iplNandSDWorker.s \ - $(VERSION)/iplKeyboard.s \ - $(VERSION)/iplErrorHandler.s \ - $(VERSION)/iplResetHandler.s \ - $(VERSION)/iplWarningHandler.s \ - $(VERSION)/iplSocketSetting.s \ - $(VERSION)/iplPostmanManager.s \ - $(VERSION)/iplSaveDataManager.s \ - $(VERSION)/iplChannelRsoThread.s \ - $(VERSION)/iplRso.s \ - $(VERSION)/iplCdbBackup.s \ - $(VERSION)/odh.s \ - $(VERSION)/iplSDVFWorker.s \ - $(VERSION)/iplNandWrapper.s \ - main.cpp \ - $(VERSION)/iplBs2Manager.s \ - $(VERSION)/iplTVRC.s \ - $(VERSION)/iplTVRCManager.s \ No newline at end of file diff --git a/src/BS2/BootStart.c b/src/BS2/BootStart.c index e1b5088d..25171f29 100644 --- a/src/BS2/BootStart.c +++ b/src/BS2/BootStart.c @@ -25,8 +25,8 @@ extern void exit(); extern void __start(); /* - @Address: 0x81330000 - @Size: 0xA8 + @note Address: 0x81330000 + @note Size: 0xA8 */ __declspec(weak) asm void __start() { nofralloc @@ -93,8 +93,8 @@ bi2_end_arg_parse: } /* - @Address: 0x813300A8 - @Size: 0x90 + @note Address: 0x813300A8 + @note Size: 0x90 */ static asm void __init_registers() { nofralloc @@ -155,8 +155,8 @@ static void init_bss_section(void* dest, unsigned int size) { } /* - @Address: 0x81330138 - @Size: 0xA0 + @note Address: 0x81330138 + @note Size: 0xA0 */ static void __init_data() { __rom_copy_info* rci; diff --git a/src/system/main.cpp b/src/system/main.cpp index 27e47c3c..60760fc6 100644 --- a/src/system/main.cpp +++ b/src/system/main.cpp @@ -12,8 +12,9 @@ extern s32 NANDCheck(u32 fsBlock, u32 inode, u32 *answer); #endif // __cplusplus /* - @Address: 0x81360764 - @Size: 0x2C + @note Address: 0x81360764 + @note Size: 0x2C + @description The entry point */ void mainmenu() { ipl::System::init(NULL, NULL); @@ -21,8 +22,8 @@ void mainmenu() { } /* - @Address: 0x81360764 - @Size: 0x2C + @note Address: 0x81360764 + @note Size: 0x2C */ s32 NANDCheck(u32 fsBlock, u32 inode, u32 *answer) { *answer = 0; diff --git a/src/system/odh.cpp b/src/system/odh.cpp index dfa8ee78..dc776427 100644 --- a/src/system/odh.cpp +++ b/src/system/odh.cpp @@ -1,8 +1,8 @@ #include "system/odh.h" /* - @Address: 0x8135DDB0 - @Size: 0x24 + @note Address: 0x8135DDB0 + @note Size: 0x24 */ s32 CArGBAOdh::ScaleLimit(s32 scale) { s32 newScale = scale; diff --git a/tools/elf2bs.c b/tools/elf2bs.c index 93cd5fb4..95863e83 100644 --- a/tools/elf2bs.c +++ b/tools/elf2bs.c @@ -43,9 +43,9 @@ typedef struct { uint32_t pad4[6]; uint32_t bs2Size; uint32_t pad5[10]; - uint32_t unkAddress; // - uint32_t unkSize; // Help - uint32_t bs1RelatedPerhaps; // + uint32_t unkAddress; + uint32_t unkSize; + uint32_t someVirtualOffset; uint32_t pad6[7]; } BSHead;