Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2ed6200
Add initial imm attribute support
zero318 Jun 29, 2022
a8b2ad4
Improve unsigned/hex support and update padding
zero318 Jun 30, 2022
e66c92d
Several suggested changes
zero318 Jun 30, 2022
f3de737
Change _ back to 4 bytes and add - for single bytes
zero318 Jun 30, 2022
96c1d4c
First batch of updated signatures
zero318 Jul 1, 2022
7fe31f4
Second batch of updated signatures
zero318 Jul 2, 2022
4d089ac
Add scratch registers for IN-StB and fix size arg sign
zero318 Jul 2, 2022
9605ae3
Third batch of updated signatures
zero318 Jul 3, 2022
5ff6724
Fourth batch of updated signatures
zero318 Jul 5, 2022
b3e8508
please let the merge work
zero318 Jul 5, 2022
b70b2ed
Fifth batch of updated signatures
zero318 Jul 7, 2022
17ce209
Sixth batch of updated signatures
zero318 Jul 9, 2022
92292d5
Seventh batch of updated signatures
zero318 Jul 10, 2022
3d32e3b
Eigth batch of updated signatures
zero318 Jul 12, 2022
88e5a47
Ninth batch of updated signatures and a few misc fixes
zero318 Jul 15, 2022
26f14dc
e
zero318 Apr 26, 2024
6e5e625
Fixed roundtrip problems
zero318 Apr 27, 2024
8d9e7a8
First attempt at th20 support
zero318 May 5, 2025
7a8dd56
Fix th20 std support
khang06 May 5, 2025
4e2e6a2
Merge pull request #2 from khang06/th20-std
zero318 May 5, 2025
ac21a91
Fix th20 std support (again)
khang06 Aug 25, 2025
fba8534
Merge pull request #3 from khang06/th20-std
zero318 Aug 25, 2025
e04f291
Fix more STD/MSG/END stuff for th20
zero318 Aug 25, 2025
20a4da0
Merge commit '7517af7ac0352ae0f42d0b998f46af7946521e9e' into neww-zero
ExpHP Aug 26, 2025
b2dcd1c
Merge commit '88e5a47a2f9bbdd5fdc999bec32999350faf59c' into neww-zero
ExpHP Aug 26, 2025
7778c45
e
zero318 Apr 26, 2024
21c30dd
Fixed roundtrip problems
zero318 Apr 27, 2024
3bdc5fa
First attempt at th20 support
zero318 May 5, 2025
e9c3d28
Fix th20 std support
khang06 May 5, 2025
471b51d
Fix th20 std support (again)
khang06 Aug 25, 2025
1a5964e
Fix more STD/MSG/END stuff for th20
zero318 Aug 25, 2025
8eb4c4b
Merge branch 'format_improvements_test' of https://github.com/ExpHP/t…
zero318 Aug 26, 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
139 changes: 74 additions & 65 deletions src/core_mapfiles/anm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,35 @@ static ANM_INS_06: &'static CoreSignatures = &CoreSignatures {
(Th06, 0, Some(("", None))),
(Th06, 1, Some(("n", None))),
(Th06, 2, Some(("ff", None))),
(Th06, 3, Some(("S", None))),
(Th06, 4, Some(("C", None))),
(Th06, 3, Some(("b(hex)---", None))),
(Th06, 4, Some(("b(hex)b(hex)b(hex)-", None))),
(Th06, 5, Some(("o", Some(IKind::Jmp)))),
(Th06, 6, Some(("", None))),
(Th06, 7, Some(("", None))),
(Th06, 8, Some(("", None))),
(Th06, 9, Some(("fff", None))),
(Th06, 10, Some(("fff", None))),
(Th06, 11, Some(("ff", None))),
(Th06, 12, Some(("SS", None))),
(Th06, 12, Some(("b(hex)---s--", None))),
(Th06, 13, Some(("", None))),
(Th06, 14, Some(("", None))),
(Th06, 15, Some(("", None))),
(Th06, 16, Some(("nS", None))),
(Th06, 16, Some(("nu--", None))),
(Th06, 17, Some(("fff", None))),
(Th06, 18, Some(("fffS", None))),
(Th06, 19, Some(("fffS", None))),
(Th06, 20, Some(("fffS", None))),
(Th06, 18, Some(("fffs--", None))),
(Th06, 19, Some(("fffs--", None))),
(Th06, 20, Some(("fffs--", None))),
(Th06, 21, Some(("", None))),
(Th06, 22, Some(("S", Some(IKind::InterruptLabel)))),
(Th06, 23, Some(("", None))),
(Th06, 24, Some(("", None))),
(Th06, 25, Some(("S", None))),
(Th06, 26, Some(("S", None))),
(Th06, 25, Some((r#"U(enum="bool")"#, None))), // zero: U(enum="BitBool")
(Th06, 26, Some(("s--", None))),
(Th06, 27, Some(("f", None))),
(Th06, 28, Some(("f", None))),
(Th06, 29, Some(("S", None))),
(Th06, 30, Some(("ffS", None))),
(Th06, 31, Some(("S", None))),
(Th06, 29, Some((r#"U(enum="bool")"#, None))), // zero: U(enum="BitBool")
(Th06, 30, Some(("ffs--", None))),
(Th06, 31, Some((r#"U(enum="bool")"#, None))), // zero: U(enum="BitBool")
],
var: &[],
};
Expand All @@ -86,44 +86,44 @@ static ANM_INS_06: &'static CoreSignatures = &CoreSignatures {
static ANM_INS_07_09: &'static CoreSignatures = &CoreSignatures {
inherit: &[],
ins: &[
// v2
// v2 (PCB)
(Th07, 0, Some(("", None))),
(Th07, 1, Some(("", None))),
(Th07, 2, Some(("", None))),
(Th07, 3, Some(("n", None))),
(Th07, 4, Some(("ot", Some(IKind::Jmp)))),
(Th07, 5, Some(("Sot", Some(IKind::CountJmp(B::Ne))))),
(Th07, 5, Some(("Sot", Some(IKind::CountJmp(B::Gt))))),
(Th07, 6, Some(("fff", None))),
(Th07, 7, Some(("ff", None))),
(Th07, 8, Some(("S", None))),
(Th07, 9, Some(("S", None))),
(Th07, 8, Some(("b(imm;hex)---", None))),
(Th07, 9, Some(("b(imm;hex)b(imm;hex)b(imm;hex)-", None))),
(Th07, 10, Some(("", None))),
(Th07, 11, Some(("", None))),
(Th07, 12, Some(("fff", None))),
(Th07, 13, Some(("fff", None))),
(Th07, 14, Some(("ff", None))),
(Th07, 15, Some(("SS", None))),
(Th07, 16, Some(("S", None))),
(Th07, 15, Some(("b(imm;hex)---S", None))),
(Th07, 16, Some(("U(imm)", None))),
(Th07, 17, Some(("fffS", None))),
(Th07, 18, Some(("fffS", None))),
(Th07, 19, Some(("fffS", None))),
(Th07, 20, Some(("", None))),
(Th07, 21, Some(("S", Some(IKind::InterruptLabel)))),
(Th07, 21, Some(("S(imm)", Some(IKind::InterruptLabel)))),
(Th07, 22, Some(("", None))),
(Th07, 23, Some(("", None))),
(Th07, 24, Some(("S", None))),
(Th07, 25, Some(("S", None))),
(Th07, 24, Some((r#"U(imm;enum="bool")"#, None))), // zero: U(imm;enum="BitBool")
(Th07, 25, Some(("s(imm)--", None))),
(Th07, 26, Some(("f", None))),
(Th07, 27, Some(("f", None))),
(Th07, 28, Some(("S", None))),
(Th07, 28, Some((r#"U(imm;enum="bool")"#, None))), // zero: U(imm;enum="BitBool")
(Th07, 29, Some(("ffS", None))),
(Th07, 30, Some(("S", None))),
(Th07, 31, Some(("S", None))),
(Th07, 32, Some(("SSfff", None))),
(Th07, 33, Some(("SSS", None))),
(Th07, 34, Some(("SSS", None))),
(Th07, 35, Some(("SSfff", None))),
(Th07, 36, Some(("SSff", None))),
(Th07, 30, Some((r#"U(imm;enum="bool")"#, None))), // zero: U(imm;enum="BitBool")
(Th07, 31, Some((r#"U(imm;enum="bool")"#, None))), // zero: U(imm;enum="BitBool")
(Th07, 32, Some(("Sb(imm)---fff", None))),
(Th07, 33, Some(("Sb(imm)---b(imm;hex)b(imm;hex)b(imm;hex)-", None))),
(Th07, 34, Some(("Sb(imm)---b(imm;hex)---", None))),
(Th07, 35, Some(("Sb(imm)---fff", None))),
(Th07, 36, Some(("Sb(imm)---ff", None))),
(Th07, 37, Some(("SS", Some(IKind::AssignOp(A::Assign, Ty::Int))))),
(Th07, 38, Some(("ff", Some(IKind::AssignOp(A::Assign, Ty::Float))))),
(Th07, 39, Some(("SS", Some(IKind::AssignOp(A::Add, Ty::Int))))),
Expand All @@ -146,7 +146,7 @@ static ANM_INS_07_09: &'static CoreSignatures = &CoreSignatures {
(Th07, 56, Some(("fff", Some(IKind::BinOp(B::Div, Ty::Float))))),
(Th07, 57, Some(("SSS", Some(IKind::BinOp(B::Rem, Ty::Int))))),
(Th07, 58, Some(("fff", Some(IKind::BinOp(B::Rem, Ty::Float))))),
(Th07, 59, Some(("SS", None))),
(Th07, 59, Some(("SU", None))),
(Th07, 60, Some(("ff", None))),
(Th07, 61, Some(("ff", Some(IKind::UnOp(U::Sin, Ty::Float))))),
(Th07, 62, Some(("ff", Some(IKind::UnOp(U::Cos, Ty::Float))))),
Expand All @@ -170,18 +170,22 @@ static ANM_INS_07_09: &'static CoreSignatures = &CoreSignatures {
(Th07, 80, Some(("f", None))),
(Th07, 81, Some(("f", None))),

// v3
// color instructions changed to take 3 dwords
(Th08, 9, Some(("SSS", None))),
(Th08, 33, Some(("SSSSS", None))),
// v3, v3b (IN, PoFV)
// alpha/color/alphaTime/colorTime instructions changed to take dword variables
// alphaTimeLinear not updated
(Th08, 8, Some(("C", None))),
(Th08, 9, Some(("CCC", None))),
(Th08, 16, Some((r#"U(imm;enum="bool")"#, None))),
(Th08, 33, Some(("Sb(imm)---CCC", None))),
(Th08, 34, Some(("Sb(imm)---C", None))),
// new instructions
(Th08, 82, Some(("S", None))),
(Th08, 83, Some(("S", None))),
(Th08, 84, Some(("SSS", None))),
(Th08, 85, Some(("S", None))),
(Th08, 86, Some(("SSSSS", None))),
(Th08, 87, Some(("SSS", None))),
(Th08, 88, Some(("S", None))),
(Th08, 82, Some(("U(imm)", None))),
(Th08, 83, Some(("S(imm)", None))),
(Th08, 84, Some(("CCC", None))),
(Th08, 85, Some(("C", None))),
(Th08, 86, Some(("Sb(imm)---CCC", None))),
(Th08, 87, Some(("Sb(imm)---C", None))),
(Th08, 88, Some(("-b(imm)--", None))),
(Th08, 89, Some(("", None))),
],
var: &[],
Expand All @@ -191,6 +195,7 @@ static ANM_INS_07_09: &'static CoreSignatures = &CoreSignatures {
static ANM_INS_095_128: &'static CoreSignatures = &CoreSignatures {
inherit: &[],
ins: &[
// v4 (StB)
(Th095, 0, Some(("", None))),
(Th095, 1, Some(("", None))),
(Th095, 2, Some(("", None))),
Expand Down Expand Up @@ -242,43 +247,43 @@ static ANM_INS_095_128: &'static CoreSignatures = &CoreSignatures {
(Th095, 48, Some(("fff", None))),
(Th095, 49, Some(("fff", None))),
(Th095, 50, Some(("ff", None))),
(Th095, 51, Some(("S", None))),
(Th095, 52, Some(("SSS", None))),
(Th095, 51, Some(("C", None))),
(Th095, 52, Some(("CCC", None))),
(Th095, 53, Some(("fff", None))),
(Th095, 54, Some(("ff", None))),
(Th095, 55, Some(("SS", None))),
(Th095, 56, Some(("SSfff", None))),
(Th095, 57, Some(("SSSSS", None))),
(Th095, 58, Some(("SSS", None))),
(Th095, 59, Some(("SSfff", None))),
(Th095, 60, Some(("SSff", None))),
(Th095, 55, Some(("b(imm;hex)---S", None))),
(Th095, 56, Some(("Sb(imm)---fff", None))),
(Th095, 57, Some(("Sb(imm)---CCC", None))),
(Th095, 58, Some(("Sb(imm)---C", None))),
(Th095, 59, Some(("Sb(imm)---fff", None))),
(Th095, 60, Some(("Sb(imm)---ff", None))),
(Th095, 61, Some(("", None))),
(Th095, 62, Some(("", None))),
(Th095, 63, Some(("", None))),
(Th095, 64, Some(("S", Some(IKind::InterruptLabel)))),
(Th095, 65, Some(("ss", None))),
(Th095, 66, Some(("S", None))),
(Th095, 67, Some(("S", None))),
(Th095, 68, Some(("S", None))),
(Th095, 64, Some(("S(imm)", Some(IKind::InterruptLabel)))),
(Th095, 65, Some(("u(imm)u(imm)", None))),
(Th095, 66, Some(("U(imm)", None))),
(Th095, 67, Some(("U(imm)", None))),
(Th095, 68, Some(("b(imm)---", None))),
(Th095, 69, Some(("", None))),
(Th095, 70, Some(("f", None))),
(Th095, 71, Some(("f", None))),
(Th095, 72, Some(("S", None))),
(Th095, 73, Some(("S", None))),
(Th095, 74, Some(("S", None))),
(Th095, 72, Some((r#"U(imm;enum="bool")"#, None))), // zero: U(imm;enum="BitBool")
(Th095, 73, Some((r#"U(imm;enum="bool")"#, None))), // zero: U(imm;enum="BitBool")
(Th095, 74, Some((r#"U(imm;enum="bool")"#, None))), // zero: U(imm;enum="BitBool")
(Th095, 75, Some(("S", None))),
(Th095, 76, Some(("SSS", None))),
(Th095, 77, Some(("S", None))),
(Th095, 78, Some(("SSSSS", None))),
(Th095, 79, Some(("SSS", None))),
(Th095, 80, Some(("S", None))),
(Th095, 80, Some(("b(imm)---", None))),
(Th095, 81, Some(("", None))),
(Th095, 82, Some(("S", None))),
(Th095, 82, Some((r#"b(imm;enum="bool")---"#, None))), // zero: b(imm;enum="BitBool")---
(Th095, 83, Some(("", None))),
(Th095, 84, Some(("S", None))),
(Th095, 85, Some(("S", None))),
(Th095, 86, Some(("S", None))),
(Th095, 87, Some(("S", None))),
(Th095, 85, Some((r#"b(imm;enum="bool")---"#, None))), // zero: b(imm;enum="BitBool")---
(Th095, 86, Some((r#"U(enum="bool")"#, None))), // zero: U(enum="BitBool")
(Th095, 87, Some(("b(imm)---", None))),

(Th10, 88, Some(("N", None))),
(Th10, 89, Some(("S", None))),
Expand Down Expand Up @@ -473,6 +478,7 @@ static ANM_VAR: &'static CoreSignatures = &CoreSignatures {
inherit: &[],
ins: &[],
var: &[
// v2, v3 (PCB, IN)
(Th07, 10000, Some("$")),
(Th07, 10001, Some("$")),
(Th07, 10002, Some("$")),
Expand All @@ -484,9 +490,12 @@ static ANM_VAR: &'static CoreSignatures = &CoreSignatures {
(Th07, 10008, Some("$")),
(Th07, 10009, Some("$")),

(Th095, 10010, Some("%")),
(Th095, 10011, Some("%")),
(Th095, 10012, Some("%")),
// v3b (PoFV)
(Th09, 10010, Some("%")),
(Th09, 10011, Some("%")),
(Th09, 10012, Some("%")),

// v4 (StB)
(Th095, 10013, Some("%")),
(Th095, 10014, Some("%")),
(Th095, 10015, Some("%")),
Expand Down
Loading