Simplified instruction (step-by-step guide) #149
Replies: 5 comments 4 replies
-
So it's not that XenonRecomp is difficult, but what you have to do after using XenonRecomp, the "real port" part which is the missing libraries (Video, Audio, Controls, etc.) so that the code provided by XenonRecomp works. Do you think you could try doing this with a demo (Dolphin, available in a similar recomp project) and create a video? I think it would be much more informative and capable of being a good Xbox 360 recomp guide. |
Beta Was this translation helpful? Give feedback.
-
yes, I'll try to do this, when I finish all stages before "real port". At this moment I have some problems with bounding jumps (and they make error in output compile process). A lot of people thinks, that it's to hard and give up, but other thinks that it to easy and think, that there a lot of projets, due to popular youtubers and news. You should find basic information in a lot of different places, such as discussions and issues. I think one place with "usual problems" will be better . |
Beta Was this translation helpful? Give feedback.
-
Ok, I've got missing jumps and missing PPC_commands. And now I just try to compile ppc |
Beta Was this translation helpful? Give feedback.
-
I wonder how this works with xex's that have title updates patched into them. For reference, back in the 2010s modders would patch title updates straight into the xex rather than putting it in the content folder. They did this by unzipping the titleupdate file, grabbing the the xex that was in the title update, and then patching it into the original xex file using xextools. For reference: Commenting here to remind myself to do this. |
Beta Was this translation helpful? Give feedback.
-
Hey so far following your guide so far and a couple of other discussions and got to the point where I got the XenonAnalyse tool to work an only gave me empty tables. I noticed that there are discussions on uncompress and unecrypt the xex file and wanted to know if the XEXtool is the only option? I haven't seen any good guides on using it and not to comfortable approaching it not knowing what to do. is it possible to uncompress and unecrypt an xex file using Ghidra? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I think default recompiler instruction too hard, because there a lot of text, that can be explained easier and a lot of not primary information, but less "obviously instructions(for some people it can be not obviously)"
Due to hard instructions a lot of enthusiasts can't GET TO THE MOST INTERESTING THINGS
!!Video-version url (part 1)
https://github.com/testdriveupgrade/XenonRecompUnlim/blob/main/recomp_scheme.jpg
2.open cmd(terminal) in directory and write: git clone --recursive https://github.com/hedge-dev/XenonRecomp.git
3.install clang-cl in Visual Studio installer (or install clang-llvm) (install if you dont have VS https://visualstudio.microsoft.com/vs/ )
4.install CMAKE newer or 3.20 https://cmake.org/download/
(create folder build in output) directory
5.press "configure"
target Visual Studio 2022
(don't select x86, it should be x64(as default)) the parameter of CMAKE write: ClangCL
then "build"
and after "open"
6.After that in Visual Studio press "Run - green triangle"
Then you get exe files of Xenon Analyse and Recomp
7.file works
You should convert your .iso dump to .xex file (recomment to choose GUI) https://github.com/wiredopposite/XGDTool/releases/tag/v1.0.0 (and there select input(folder with .iso)/output(target folder) and choose "Extract"), you will get semi-unpacked game with .xex
(I think integrated XenonR patcher works not good) use xextool to uncompress and unecrypt the .xex file https://digiex.net/threads/xextool-6-3-download.9523/ (IT'S VERY IMPORTANT TO WRITE DIRECTORY PATH IN SPECIFIC WAY better to use these format example: )
necessary commands in cmd:
.\xextool.exe -o default.xex -c u -e u
- (uncompress& unencrypt).\xextool.exe -i default.xex > dump.txt
- get file info, also about compressing & encryption(if xextool output error, then it means that .xex broken or modified and you should try another file)
8.About XenonAnalyser
Some games have different .xex properties, for example some games contain setjmp and longjmp (can be necessary offset), but other don't;
To find them use bin analysis programs, like Binary Ninja, etc.. (use instruction from Jump table)
If you get table like this in the first, then this stage finished(it should be 'ABSOLUTE JUMPTABLE' or 'MANUAL JUMPTABLE'
https://github.com/hedge-dev/UnleashedRecomp/blob/main/UnleashedRecompLib/config/SWA_switch_tables.toml
9.About XenonRecomp
Create config file for your project, get this as example:
https://github.com/hedge-dev/UnleashedRecomp/blob/main/UnleashedRecompLib/config/SWA.toml
(this for optimization, use this later, just remove for first recompile):
skip_lr = true
skip_msr = true
ctr_as_local = true
xer_as_local = true
reserved_as_local = true
cr_as_local = true
non_argument_as_local = true
non_volatile_as_local = true
(Directories):
file_path = "../private/default.xex" (your .xex)
patch_file_path = "../private/default.xexp" (try decompile without patches at the first)
patched_file_path = "../private/default_patched.xex" (try decompile without patches at the first)
out_directory_path = "../ppc" (directory there .cpp will be recompiled)
switch_table_file_path = "SWA_switch_tables.toml" (output of XenonAnalyse)
(important register 14 , you can use modified XenonAnalyse from this fork: (https://github.com/testdriveupgrade/XenonRecompUnlim) with auto-get of r14(will be outputed in console after beginning) of r14, but eventhough check whem manual by this instruction (if one of it is the same, when auto-get got them correctly ):
https://github.com/hedge-dev/XenonRecomp?tab=readme-ov-file#register-restore--save-functions
(examples):
restgprlr_14_address = 0x831B0B40 (re-write all these for your values):
savegprlr_14_address = 0x831B0AF0
restfpr_14_address = 0x831B144C
savefpr_14_address = 0x831B1400
restvmx_14_address = 0x831B36E8
savevmx_14_address = 0x831B3450
restvmx_64_address = 0x831B377C
savevmx_64_address = 0x831B34E4
(use if you have them in your .xex, re-write to your values)
longjmp_address = 0x831B6790
setjmp_address = 0x831B6AB0
(out of bounds function, which you should write manually for errors removing): (late a bit for instruction for this)
(example):
functions = [
{ address = 0x824E7EF0, size = 0x98 },
{ address = 0x824E7F28, size = 0x60 },
The goals for major recompiler : 1)try to compile: .\XenonRecomp.exe .\config.toml(your table file, generated by Analyser) .\ppc_context.h There are will be errors like: missing commands
Open recomiler.cpp file and write your implementation based on current commands
Usualy check discussion, issues, popular forks and merge request (maybe every week) of XenonRecomp, because sometimes people share their implementations of missing function, it can help to save a lot of your time.
10.Compile output .cpp :
https://github.com/hedge-dev/UnleashedRecomp/tree/main
get UnleashedRecomp, and insert your PPC to src (comment hard-coded functions): #125 (comment)
You can also use as example other recomps:
https://github.com/ga2mer/MarathonRecomp/tree/main
https://github.com/Fable2Recomp/Fable2Recomp
(I'll continue to final stages of sources compilation)
My questions:
there some debug mode, can somebody give more tips? I checked the source file of recompiler.cpp and there are only 2 arguments into, how use 3 arguments?
(Compile output cpp files Use CLang++ (installed clang-cl) for compilation)?
P.S. A lot of people want to try use this program and they can give some help and advice to more professional programmers, but they stuck in the beginning stages. I could save a lot of time with step-by-step guide and my goal popularise XenonRecomp and help newbies (because I'm too not advanced in recompilation, but I have a wish re-compile some games) .
Beta Was this translation helpful? Give feedback.
All reactions