mirror of
https://github.com/open-goal/jak-project
synced 2026-07-10 07:07:04 -04:00
[decomp] better handling of animation code and art files (#1352)
* update refs * [decompiler] read and process art groups * finish decompiler art group selection & detect in `ja-group?` * make art stuff work on offline tests! * [decompiler] detect `ja-group!` (primitive) * corrections. * more * use new feature on skel groups! * find `loop!` as well * fully fledged `ja` macro & decomp + `loop` detect * fancy fixed point printing! * update source * `:num! max` (i knew i should've done this) * Update jak1_ntsc_black_label.jsonc * hi imports * make compiling the game work * fix `defskelgroup` * clang * update refs * fix chan * fix seek and finalboss * fix tests * delete unused function * track let rewrite stats * reorder `rewrite_let` * Update .gitattributes * fix bug with `:num! max` * Update robotboss-part.gc * Update goal-lib.gc * document `ja` * get rid of pc fixes thing * use std::abs
This commit is contained in:
@@ -15,6 +15,13 @@ Matcher Matcher::any_label(int match_id) {
|
||||
return m;
|
||||
}
|
||||
|
||||
Matcher Matcher::reg(Register reg) {
|
||||
Matcher m;
|
||||
m.m_kind = Kind::REG;
|
||||
m.m_reg = reg;
|
||||
return m;
|
||||
}
|
||||
|
||||
Matcher Matcher::op(const GenericOpMatcher& op, const std::vector<Matcher>& args) {
|
||||
Matcher m;
|
||||
m.m_kind = Kind::GENERIC_OP;
|
||||
@@ -184,7 +191,8 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
|
||||
maps_out->forms[m_form_match] = input;
|
||||
}
|
||||
return true;
|
||||
case Kind::ANY_REG: {
|
||||
case Kind::ANY_REG:
|
||||
case Kind::REG: {
|
||||
bool got = false;
|
||||
RegisterAccess result;
|
||||
|
||||
@@ -206,7 +214,9 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
|
||||
}
|
||||
|
||||
if (got) {
|
||||
if (m_reg_out_id != -1) {
|
||||
if (m_kind == Kind::REG) {
|
||||
return result.reg() == *m_reg;
|
||||
} else if (m_reg_out_id != -1) {
|
||||
maps_out->regs.resize(std::max(size_t(m_reg_out_id + 1), maps_out->regs.size()));
|
||||
maps_out->regs.at(m_reg_out_id) = result;
|
||||
}
|
||||
@@ -610,6 +620,14 @@ MatchResult match(const Matcher& spec, Form* input) {
|
||||
return result;
|
||||
}
|
||||
|
||||
MatchResult match(const Matcher& spec, FormElement* input) {
|
||||
Form hack;
|
||||
hack.elts().push_back(input);
|
||||
MatchResult result;
|
||||
result.matched = spec.do_match(&hack, &result.maps);
|
||||
return result;
|
||||
}
|
||||
|
||||
DerefTokenMatcher DerefTokenMatcher::string(const std::string& str) {
|
||||
DerefTokenMatcher result;
|
||||
result.m_kind = Kind::STRING;
|
||||
|
||||
Reference in New Issue
Block a user