447 Commits

Author SHA1 Message Date
b34b4c9caf Added new data, functions and overrides. 2021-05-08 21:10:39 +01:00
230ef291e7 Added l{b, bu, h, hu, w}arr instruction. 2021-05-08 16:12:07 +01:00
7398f43188 Added s{w, h, b}arr pseudo instruction to store an array of registers.
Added a lifetime to `pseudo::Encodable` for instructions to be able to return borrowed iterators.
2021-05-08 16:02:41 +01:00
fdbd30e806 Added j[al]b{a, b, c} pseudo instruction for calling bios functions.
Renamed `Inst::may_jump` to `Inst::expects_branch_delay` to reflect it's nature.
2021-05-08 15:00:32 +01:00
b84117ea48 Branch delay errors are now better explained. 2021-05-07 23:59:36 +01:00
de99f4d929 Renamed compiler to as and decompiler to disasm. 2021-05-07 23:52:54 +01:00
3258cf9be1 Revised dcb-compiler greatly. 2021-05-07 23:40:54 +01:00
be54d877ae Added dcb_util::BTreeMapVector. 2021-05-07 23:40:31 +01:00
972deb68f2 Removed Label.
Renamed `LabelName` to `label` and moved it to it's own module.
2021-05-07 23:40:11 +01:00
b2fad358f2 Added helper methods to LineArg and LineArgExpr.
`LineLabelFunc` is now `Copy`.
2021-05-07 23:39:33 +01:00
8ac0df949a Changes from 3fc494759e6decc7b7692ee2cbbe13dd16676974 are now formatted. 2021-05-07 21:32:03 +01:00
6b3528507f Now parsing and requiring branch delay slot markers.
Fixes #2.
2021-05-07 21:27:01 +01:00
3fc494759e Changed ParseCtx to have a lifetime associated and Parsable::parse to not allow the instruction to borrow the context itself, only it's values. 2021-05-07 21:13:25 +01:00
f6e0f529fa Non-single pseudo instructions following a jump are now decoded as basic instructions. 2021-05-01 20:15:38 +01:00
4c3c940181 Renamed .ascii to .asciiz 2021-05-01 19:36:56 +01:00
d9be541f2e Improved syscall handling. 2021-05-01 19:30:06 +01:00
e50d8f0ec4 Moved ExecError to it's own module. 2021-05-01 18:02:09 +01:00
8913219908 Moved ExecState out of dcb-exe and replaced it with the trait ExecCtx. 2021-05-01 18:00:24 +01:00
bedfb07ea1 Added syscall 2 for printing all registers. 2021-05-01 17:50:40 +01:00
cbff6033c1 Fixed issue where multiple labels couldn't exist in the same position. 2021-05-01 17:36:14 +01:00
275592a6ba Added dcb-dbg for debugging programs.
Fixed issue with `ExecState::exec` skipping instructions.
2021-05-01 17:26:25 +01:00
3c02d93dd9 Added initial support for executing instructions. 2021-05-01 16:24:07 +01:00
233db9b200 Now using anyhow::ensure where appropriate. 2021-05-01 14:19:51 +01:00
e807189052 Improved formatting of dcb_util::fmt_err. 2021-04-30 17:37:28 +01:00
6548ef75a8 Added overriding of data and function paths. 2021-04-30 17:27:32 +01:00
c4678e54cc Cleaned up data/function loading in dcb-decompiler. 2021-04-30 16:54:00 +01:00
1a736c8f80 Added dcb_util::fmt_err_wrapper_owned. 2021-04-30 16:52:06 +01:00
f6cff70e2a Added dcb_util::parse_from_file. 2021-04-30 16:44:21 +01:00
8487c3714c Added serde::Deserialize impl for FuncTable. 2021-04-30 16:44:04 +01:00
a4187f3eb4 Moved BcdU8 to it's own module. 2021-04-30 16:27:16 +01:00
1749b78fed Added function validation.
Fixed issue with function `modify_spu_delay1`.
`dcb_util::fmt_err{_wrapper}` not supports non-static errors.
2021-04-30 15:54:49 +01:00
49c8ee53cc Added missing labels to all known functions. 2021-04-30 15:25:46 +01:00
174b9b03c7 Revised some documentation and added warning for missing labels for the display context implementation in dcb-decompiler. 2021-04-30 15:00:52 +01:00
e04317c091 Functions now have a kind. 2021-04-30 15:00:15 +01:00
53a214602e Moved displaying context to it's own module and renamed it. 2021-04-30 14:44:43 +01:00
475c3c241b Added warning on unused overrides. 2021-04-29 22:58:16 +01:00
80a85d6ca2 Decompiler now outputs + after any jump / condition instruction. 2021-04-29 22:20:28 +01:00
3eed1e930a Moved known/foreign data/func loading into the executable.
Slightly revised the data / func table interface.
2021-04-29 16:36:27 +01:00
4b559b7ce1 Added some more documentation to psx header. 2021-04-29 15:38:26 +01:00
3485d10e21 Removed unnecessary features flags. 2021-04-29 15:20:28 +01:00
c211a2fc86 Revised some names in parse::line and added some unit tests. 2021-04-29 12:06:25 +01:00
b572f1d922 Removed existing Addr{Hi, Lo} and renamed AddrSigned{Hi, Lo} to Addr{Hi, Lo}, as all addresses are siged when obtaining their lo and hi. 2021-04-28 20:13:04 +01:00
bff47fad58 Switched all current @addr_ to @signed_addr_, as they all use addiu, thus they are addresses. 2021-04-28 20:05:07 +01:00
a98c971306 Added some more overrides. 2021-04-28 20:03:58 +01:00
64c7d09b4b Added AddrSignedLo and AddrSignedHi label functions. 2021-04-28 19:40:37 +01:00
c10b9b0b5f Added warning on heuristic functions during argument override. 2021-04-28 19:40:04 +01:00
a5beaa479d Turned all heuristically found data locations used in the overrides to known data. 2021-04-28 16:48:34 +01:00
b152773621 Implemented validation for argument overrides. 2021-04-28 16:12:14 +01:00
cd6f64cb34 Updated parse::line to support label functions.
Fixed single-argument "nop" not being parsed.
2021-04-28 15:25:56 +01:00
926e2669f7 Renamed ParsingIter to DecodeIter. 2021-04-28 13:15:26 +01:00