Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9aad004
Implement addc
tomcl7 May 23, 2025
4041671
Implement addme
tomcl7 May 23, 2025
1c06e84
Implement eqv
tomcl7 May 23, 2025
18049b4
Implement lvebx/lvehx into the lvx instruction implementation. Memory…
tomcl7 May 23, 2025
3fbe687
Implement rlwnm
tomcl7 May 23, 2025
ae46582
Implement subfme
tomcl7 May 23, 2025
822dfad
Add missing case for vandc
tomcl7 May 23, 2025
5a3848e
Implement vcmpbfp/vcmpbfp128 - need to implement vscr saturation bit …
tomcl7 May 23, 2025
bc9494b
Implement mulhd and mulhdu
tomcl7 May 23, 2025
daa4c00
Implement vavugh
tomcl7 May 23, 2025
3cb492f
Implement vctuxs/vcfpuxws128
tomcl7 May 23, 2025
e38d06e
Implement vmaxsh
tomcl7 May 23, 2025
c68a087
implement vmaxuh
tomcl7 May 23, 2025
bb20abe
Implement vminsh and vminuh
tomcl7 May 23, 2025
68f4ff4
Implement vsubshs
tomcl7 May 23, 2025
ea988fa
Implement subfze
tomcl7 May 23, 2025
541631f
Implement all trap cards
tomcl7 May 23, 2025
0f42cc4
Implement vpkshss and vpkswus
tomcl7 May 23, 2025
9db0182
Implement vpkuwum/vpkuwum128 and vpkuwus/vpkuwum128
tomcl7 May 23, 2025
de697dc
Implement vpkswss/vpkswss128
tomcl7 May 23, 2025
2ae394b
Implement vpkuhum
tomcl7 May 23, 2025
0b4c870
Implement vpkuhus/vpkuhus128
tomcl7 May 23, 2025
5c01ec5
Implement vsl
tomcl7 May 23, 2025
691593d
Implement vslh, vsrah, vsrh, vrlh
tomcl7 May 23, 2025
1b73c20
Add vsel128 to existing vsel
tomcl7 May 26, 2025
5f40c80
Implement addc
tomcl7 May 23, 2025
5fce07a
Implement addme
tomcl7 May 23, 2025
133e95a
Implement eqv
tomcl7 May 23, 2025
3937e54
Implement lvebx/lvehx into the lvx instruction implementation. Memory…
tomcl7 May 23, 2025
4e77be8
Implement rlwnm
tomcl7 May 23, 2025
fd85a41
Implement subfme
tomcl7 May 23, 2025
485ca80
Add missing case for vandc
tomcl7 May 23, 2025
e5ca0a2
Implement vcmpbfp/vcmpbfp128 - need to implement vscr saturation bit …
tomcl7 May 23, 2025
6299ca7
Implement mulhd and mulhdu
tomcl7 May 23, 2025
fb62754
Implement vavugh
tomcl7 May 23, 2025
7c13094
Implement vctuxs/vcfpuxws128
tomcl7 May 23, 2025
7d9e5fb
Implement vmaxsh
tomcl7 May 23, 2025
ca05cd7
implement vmaxuh
tomcl7 May 23, 2025
13b904a
Implement vminsh and vminuh
tomcl7 May 23, 2025
63c0bab
Implement vsubshs
tomcl7 May 23, 2025
30fd01f
Implement subfze
tomcl7 May 23, 2025
045f27a
Implement all trap cards
tomcl7 May 23, 2025
9222ef0
Implement vpkshss and vpkswus
tomcl7 May 23, 2025
81e8dd6
Implement vpkuwum/vpkuwum128 and vpkuwus/vpkuwum128
tomcl7 May 23, 2025
cce9547
Implement vpkswss/vpkswss128
tomcl7 May 23, 2025
004a6da
Implement vpkuhum
tomcl7 May 23, 2025
39003f0
Implement vpkuhus/vpkuhus128
tomcl7 May 23, 2025
6b4c165
Implement vsl
tomcl7 May 23, 2025
fa0c77c
Implement vslh, vsrah, vsrh, vrlh
tomcl7 May 23, 2025
5e945d8
Add vsel128 to existing vsel
tomcl7 May 26, 2025
8782d4d
Added ability to alias function names to ease of debugging and revers…
tomcl7 May 31, 2025
0ddb5e5
Double look-back to 64 bytes to account for computed switch tables co…
tomcl7 Jun 25, 2025
bd25a87
Revert "Added ability to alias function names to ease of debugging an…
tomcl7 Jun 25, 2025
796c983
Merge branch 'impl-opcodes' of https://github.com/CRACKbomber/XenonRe…
tomcl7 Jun 27, 2025
c02c37b
Implement bcdst - no op, performance related cache hint.
tomcl7 Jun 27, 2025
c81d7f8
Implement vnor/vnor128
tomcl7 Jun 27, 2025
0bf4d36
Implement frsqrte - Needs to be optimized but it should work for now
tomcl7 Jun 27, 2025
03a04bc
Implement dbnzf
tomcl7 Jun 27, 2025
edcb89a
Implement vaddsws
tomcl7 Jun 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions XenonAnalyse/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,32 +105,47 @@ void ScanTable(const uint32_t* code, size_t base, SwitchTable& table)
{
ppc_insn insn;
uint32_t cr{ (uint32_t)-1 };
for (int i = 0; i < 32; i++)
for (int i = 0; i < 64; i++)
{
ppc::Disassemble(&code[-i], base - (4 * i), insn);
if (insn.opcode == nullptr)
{
continue;
}

if (cr == -1 && (insn.opcode->id == PPC_INST_BGT || insn.opcode->id == PPC_INST_BGTLR || insn.opcode->id == PPC_INST_BLE || insn.opcode->id == PPC_INST_BLELR))
// Handle conditional branches
if (cr == -1 && (insn.opcode->id == PPC_INST_BGT ||
insn.opcode->id == PPC_INST_BGTLR ||
insn.opcode->id == PPC_INST_BLE ||
insn.opcode->id == PPC_INST_BLELR))
{
cr = insn.operands[0];
if (insn.opcode->operands[1] != 0)
{
table.defaultLabel = insn.operands[1];
}
}
else if (cr != -1)
// Handle CMPLWI even if branch not found yet
else if (insn.opcode->id == PPC_INST_CMPLWI)
{
if (insn.opcode->id == PPC_INST_CMPLWI && insn.operands[0] == cr)
// Only process if we haven't found labels yet
if (table.labels.empty())
{
table.r = insn.operands[1];
table.labels.resize(insn.operands[2] + 1);
table.base = base;
break;
}
}
// Handle CMPLWI after branch detection
else if (cr != -1 &&
insn.opcode->id == PPC_INST_CMPLWI &&
insn.operands[0] == cr)
{
table.r = insn.operands[1];
table.labels.resize(insn.operands[2] + 1);
table.base = base;
break;
}
}
}

Expand Down
Loading