mirror of
https://github.com/open-goal/jak-project
synced 2026-08-18 21:57:54 -04:00
Decompiler fixes + decompiling (#276)
* decomp pad * more decompilation * update * fix test name
This commit is contained in:
@@ -81,7 +81,7 @@ FormElement* SetVarOp::get_as_form(FormPool& pool, const Env& env) const {
|
||||
result->mark_as_dead_set();
|
||||
// fmt::print("marked {} as dead set\n", to_string(env));
|
||||
}
|
||||
} else if (m_src.get_arg(0).is_sym_ptr() && m_src.get_arg(0).get_str() == "#f") {
|
||||
} else if (m_src.get_arg(0).is_sym_val() && m_src.get_arg(0).get_str() == "#f") {
|
||||
auto& ri = env.reg_use().op.at(m_my_idx);
|
||||
if (ri.written_and_unused.find(dst().reg()) != ri.written_and_unused.end()) {
|
||||
result->mark_as_dead_false();
|
||||
|
||||
@@ -12,7 +12,7 @@ bool tc(const DecompilerTypeSystem& dts, const TypeSpec& expected, const TP_Type
|
||||
}
|
||||
|
||||
bool is_int_or_uint(const DecompilerTypeSystem& dts, const TP_Type& type) {
|
||||
return tc(dts, TypeSpec("int"), type) || tc(dts, TypeSpec("uint"), type);
|
||||
return tc(dts, TypeSpec("integer"), type) || tc(dts, TypeSpec("uint"), type);
|
||||
}
|
||||
|
||||
bool is_signed(const DecompilerTypeSystem& dts, const TP_Type& type) {
|
||||
@@ -534,7 +534,6 @@ TP_Type LoadVarOp::get_src_type(const TypeState& input,
|
||||
IR2_RegOffset ro;
|
||||
if (get_as_reg_offset(m_src, &ro)) {
|
||||
auto& input_type = input.get(ro.reg);
|
||||
|
||||
if ((input_type.kind == TP_Type::Kind::TYPE_OF_TYPE_OR_CHILD ||
|
||||
input_type.kind == TP_Type::Kind::TYPE_OF_TYPE_NO_VIRTUAL) &&
|
||||
ro.offset >= 16 && (ro.offset & 3) == 0 && m_size == 4 && m_kind == Kind::UNSIGNED) {
|
||||
@@ -568,7 +567,8 @@ TP_Type LoadVarOp::get_src_type(const TypeState& input,
|
||||
}
|
||||
}
|
||||
|
||||
if (input_type.typespec() == TypeSpec("pointer")) {
|
||||
if (input_type.typespec() == TypeSpec("pointer") &&
|
||||
input_type.kind != TP_Type::Kind::OBJECT_PLUS_PRODUCT_WITH_CONSTANT) {
|
||||
// we got a plain pointer. let's just assume we're loading an integer.
|
||||
// perhaps we should disable this feature by default on 4-byte loads if we're getting
|
||||
// lots of false positives for loading pointers from plain pointers.
|
||||
|
||||
@@ -302,6 +302,9 @@ bool SetVarElement::is_sequence_point() const {
|
||||
}
|
||||
|
||||
void SetVarElement::collect_vars(VariableSet& vars) const {
|
||||
if (m_var_info.is_dead_set || m_var_info.is_dead_false) {
|
||||
return;
|
||||
}
|
||||
vars.insert(m_dst);
|
||||
m_src->collect_vars(vars);
|
||||
}
|
||||
@@ -1160,6 +1163,12 @@ std::string fixed_operator_to_string(FixedOperatorKind kind) {
|
||||
return "/";
|
||||
case FixedOperatorKind::ADDITION:
|
||||
return "+";
|
||||
case FixedOperatorKind::ADDITION_IN_PLACE:
|
||||
return "+!";
|
||||
case FixedOperatorKind::ADDITION_PTR:
|
||||
return "&+";
|
||||
case FixedOperatorKind::ADDITION_PTR_IN_PLACE:
|
||||
return "&+!";
|
||||
case FixedOperatorKind::SUBTRACTION:
|
||||
return "-";
|
||||
case FixedOperatorKind::MULTIPLICATION:
|
||||
|
||||
@@ -177,6 +177,7 @@ class StoreElement : public FormElement {
|
||||
void apply_form(const std::function<void(Form*)>& f) override;
|
||||
void collect_vars(VariableSet& vars) const override;
|
||||
void get_modified_regs(RegSet& regs) const override;
|
||||
void push_to_stack(const Env& env, FormPool& pool, FormStack& stack) override;
|
||||
|
||||
private:
|
||||
// todo - we may eventually want to use a different representation for more
|
||||
@@ -407,6 +408,11 @@ class ConditionElement : public FormElement {
|
||||
const std::vector<Form*>& source_forms,
|
||||
const std::vector<TypeSpec>& types);
|
||||
|
||||
FormElement* make_zero_check_generic(const Env& env,
|
||||
FormPool& pool,
|
||||
const std::vector<Form*>& source_forms,
|
||||
const std::vector<TypeSpec>& types);
|
||||
|
||||
private:
|
||||
IR2_Condition::Kind m_kind;
|
||||
std::optional<SimpleAtom> m_src[2];
|
||||
|
||||
@@ -72,6 +72,18 @@ bool FormElement::has_side_effects() {
|
||||
|
||||
namespace {
|
||||
|
||||
bool is_power_of_two(int in, int* out) {
|
||||
int x = 1;
|
||||
for (int i = 0; i < 32; i++) {
|
||||
if (x == in) {
|
||||
*out = i;
|
||||
return true;
|
||||
}
|
||||
x = x * 2;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Create a form which represents a variable.
|
||||
*/
|
||||
@@ -222,6 +234,11 @@ bool is_uint_type(const Env& env, int my_idx, Variable var) {
|
||||
auto type = env.get_types_before_op(my_idx).get(var.reg()).typespec();
|
||||
return type == TypeSpec("uint");
|
||||
}
|
||||
|
||||
bool is_ptr_or_child(const Env& env, int my_idx, Variable var) {
|
||||
auto type = env.get_types_before_op(my_idx).get(var.reg()).typespec().base_type();
|
||||
return type == "pointer";
|
||||
}
|
||||
} // namespace
|
||||
|
||||
/*!
|
||||
@@ -456,6 +473,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
|
||||
bool allow_side_effects) {
|
||||
auto arg0_i = is_int_type(env, m_my_idx, m_expr.get_arg(0).var());
|
||||
auto arg0_u = is_uint_type(env, m_my_idx, m_expr.get_arg(0).var());
|
||||
bool arg0_ptr = is_ptr_or_child(env, m_my_idx, m_expr.get_arg(0).var());
|
||||
|
||||
bool arg1_reg = m_expr.get_arg(1).is_var();
|
||||
bool arg1_i = true;
|
||||
@@ -523,28 +541,60 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
|
||||
if (out.success) {
|
||||
// it is. now we have to modify things
|
||||
// first, look for the index
|
||||
auto arg0_matcher =
|
||||
Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ADDITION),
|
||||
{Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::MULTIPLICATION),
|
||||
{Matcher::integer(input.stride), Matcher::any(0)}),
|
||||
Matcher::integer(input.offset)});
|
||||
auto match_result = match(arg0_matcher, args.at(0));
|
||||
if (match_result.matched) {
|
||||
bool used_index = false;
|
||||
std::vector<DerefToken> tokens;
|
||||
for (auto& tok : out.tokens) {
|
||||
if (tok.kind == FieldReverseLookupOutput::Token::Kind::VAR_IDX) {
|
||||
assert(!used_index);
|
||||
used_index = true;
|
||||
tokens.push_back(DerefToken::make_int_expr(match_result.maps.forms.at(0)));
|
||||
} else {
|
||||
tokens.push_back(to_token(tok));
|
||||
int p2;
|
||||
if (is_power_of_two(input.stride, &p2)) {
|
||||
// (+ (shl (-> a0-0 reg-count) 3) 28)
|
||||
auto arg0_matcher =
|
||||
Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ADDITION),
|
||||
{Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::SHL),
|
||||
{Matcher::any(0), Matcher::integer(p2)}),
|
||||
Matcher::integer(input.offset)});
|
||||
auto match_result = match(arg0_matcher, args.at(0));
|
||||
if (match_result.matched) {
|
||||
bool used_index = false;
|
||||
std::vector<DerefToken> tokens;
|
||||
for (auto& tok : out.tokens) {
|
||||
if (tok.kind == FieldReverseLookupOutput::Token::Kind::VAR_IDX) {
|
||||
assert(!used_index);
|
||||
used_index = true;
|
||||
tokens.push_back(DerefToken::make_int_expr(match_result.maps.forms.at(0)));
|
||||
} else {
|
||||
tokens.push_back(to_token(tok));
|
||||
}
|
||||
}
|
||||
result->push_back(pool.alloc_element<DerefElement>(args.at(1), out.addr_of, tokens));
|
||||
return;
|
||||
} else {
|
||||
throw std::runtime_error(
|
||||
fmt::format("Failed to match for stride (power 2 {}) with add: {}", input.stride,
|
||||
args.at(0)->to_string(env)));
|
||||
}
|
||||
result->push_back(pool.alloc_element<DerefElement>(args.at(1), out.addr_of, tokens));
|
||||
return;
|
||||
} else {
|
||||
throw std::runtime_error("Failed to match for stride (non power 2) with add");
|
||||
auto arg0_matcher =
|
||||
Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ADDITION),
|
||||
{Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::MULTIPLICATION),
|
||||
{Matcher::integer(input.stride), Matcher::any(0)}),
|
||||
Matcher::integer(input.offset)});
|
||||
auto match_result = match(arg0_matcher, args.at(0));
|
||||
if (match_result.matched) {
|
||||
bool used_index = false;
|
||||
std::vector<DerefToken> tokens;
|
||||
for (auto& tok : out.tokens) {
|
||||
if (tok.kind == FieldReverseLookupOutput::Token::Kind::VAR_IDX) {
|
||||
assert(!used_index);
|
||||
used_index = true;
|
||||
tokens.push_back(DerefToken::make_int_expr(match_result.maps.forms.at(0)));
|
||||
} else {
|
||||
tokens.push_back(to_token(tok));
|
||||
}
|
||||
}
|
||||
result->push_back(pool.alloc_element<DerefElement>(args.at(1), out.addr_of, tokens));
|
||||
return;
|
||||
} else {
|
||||
throw std::runtime_error(
|
||||
fmt::format("Failed to match for stride (non power 2 {}) with add: {}",
|
||||
input.stride, args.at(0)->to_string(env)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -554,6 +604,10 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::ADDITION), args.at(0), args.at(1));
|
||||
result->push_back(new_form);
|
||||
} else if (arg0_ptr) {
|
||||
auto new_form = pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(FixedOperatorKind::ADDITION_PTR), args.at(0), args.at(1));
|
||||
result->push_back(new_form);
|
||||
} else {
|
||||
auto cast = pool.alloc_single_element_form<CastElement>(
|
||||
nullptr, TypeSpec(arg0_i ? "int" : "uint"), args.at(1));
|
||||
@@ -1459,7 +1513,7 @@ void UntilElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stac
|
||||
for (auto& entry : form->elts()) {
|
||||
entry->push_to_stack(env, pool, temp_stack);
|
||||
}
|
||||
auto new_entries = temp_stack.rewrite(pool);
|
||||
auto new_entries = temp_stack.rewrite(pool, env);
|
||||
form->clear();
|
||||
for (auto e : new_entries) {
|
||||
form->push_back(e);
|
||||
@@ -1478,7 +1532,7 @@ void WhileElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stac
|
||||
for (auto& entry : form->elts()) {
|
||||
entry->push_to_stack(env, pool, temp_stack);
|
||||
}
|
||||
auto new_entries = temp_stack.rewrite(pool);
|
||||
auto new_entries = temp_stack.rewrite(pool, env);
|
||||
form->clear();
|
||||
for (auto e : new_entries) {
|
||||
form->push_back(e);
|
||||
@@ -1517,9 +1571,9 @@ void CondNoElseElement::push_to_stack(const Env& env, FormPool& pool, FormStack&
|
||||
|
||||
std::vector<FormElement*> new_entries;
|
||||
if (form == entry.body && used_as_value) {
|
||||
new_entries = rewrite_to_get_var(temp_stack, pool, final_destination);
|
||||
new_entries = rewrite_to_get_var(temp_stack, pool, final_destination, env);
|
||||
} else {
|
||||
new_entries = temp_stack.rewrite(pool);
|
||||
new_entries = temp_stack.rewrite(pool, env);
|
||||
}
|
||||
|
||||
form->clear();
|
||||
@@ -1568,7 +1622,7 @@ void CondWithElseElement::push_to_stack(const Env& env, FormPool& pool, FormStac
|
||||
}
|
||||
|
||||
std::vector<FormElement*> new_entries;
|
||||
new_entries = temp_stack.rewrite(pool);
|
||||
new_entries = temp_stack.rewrite(pool, env);
|
||||
|
||||
form->clear();
|
||||
for (auto e : new_entries) {
|
||||
@@ -1585,7 +1639,7 @@ void CondWithElseElement::push_to_stack(const Env& env, FormPool& pool, FormStac
|
||||
}
|
||||
|
||||
std::vector<FormElement*> new_entries;
|
||||
new_entries = temp_stack.rewrite(pool);
|
||||
new_entries = temp_stack.rewrite(pool, env);
|
||||
|
||||
else_ir->clear();
|
||||
for (auto e : new_entries) {
|
||||
@@ -1629,9 +1683,9 @@ void CondWithElseElement::push_to_stack(const Env& env, FormPool& pool, FormStac
|
||||
// rewrite extra sets as needed.
|
||||
if (rewrite_as_set && !set_unused) {
|
||||
for (auto& entry : entries) {
|
||||
rewrite_to_get_var(entry.body->elts(), pool, *last_var);
|
||||
rewrite_to_get_var(entry.body->elts(), pool, *last_var, env);
|
||||
}
|
||||
rewrite_to_get_var(else_ir->elts(), pool, *last_var);
|
||||
rewrite_to_get_var(else_ir->elts(), pool, *last_var, env);
|
||||
}
|
||||
|
||||
if (rewrite_as_set) {
|
||||
@@ -1683,9 +1737,9 @@ void ShortCircuitElement::push_to_stack(const Env& env, FormPool& pool, FormStac
|
||||
|
||||
std::vector<FormElement*> new_entries;
|
||||
if (i == int(entries.size()) - 1) {
|
||||
new_entries = rewrite_to_get_var(temp_stack, pool, final_result);
|
||||
new_entries = rewrite_to_get_var(temp_stack, pool, final_result, env);
|
||||
} else {
|
||||
new_entries = temp_stack.rewrite(pool);
|
||||
new_entries = temp_stack.rewrite(pool, env);
|
||||
}
|
||||
|
||||
entry.condition->clear();
|
||||
@@ -1721,9 +1775,9 @@ void ShortCircuitElement::update_from_stack(const Env& env,
|
||||
|
||||
std::vector<FormElement*> new_entries;
|
||||
if (i == int(entries.size()) - 1) {
|
||||
new_entries = rewrite_to_get_var(temp_stack, pool, final_result);
|
||||
new_entries = rewrite_to_get_var(temp_stack, pool, final_result, env);
|
||||
} else {
|
||||
new_entries = temp_stack.rewrite(pool);
|
||||
new_entries = temp_stack.rewrite(pool, env);
|
||||
}
|
||||
|
||||
entry.condition->clear();
|
||||
@@ -1739,13 +1793,34 @@ void ShortCircuitElement::update_from_stack(const Env& env,
|
||||
// ConditionElement
|
||||
///////////////////
|
||||
|
||||
FormElement* ConditionElement::make_generic(const Env&,
|
||||
FormElement* ConditionElement::make_zero_check_generic(const Env&,
|
||||
FormPool& pool,
|
||||
const std::vector<Form*>& source_forms,
|
||||
const std::vector<TypeSpec>&) {
|
||||
// (zero? (+ thing small-integer)) -> (= thing (- small-integer))
|
||||
|
||||
auto mr = match(Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::ADDITION),
|
||||
{Matcher::any(0), Matcher::any_integer(1)}),
|
||||
source_forms.at(0));
|
||||
if (mr.matched) {
|
||||
s64 value = -mr.maps.ints.at(1);
|
||||
auto value_form = pool.alloc_single_element_form<SimpleAtomElement>(
|
||||
nullptr, SimpleAtom::make_int_constant(value));
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::EQ),
|
||||
std::vector<Form*>{mr.maps.forms.at(0), value_form});
|
||||
} else {
|
||||
return pool.alloc_element<GenericElement>(GenericOperator::make_compare(m_kind), source_forms);
|
||||
}
|
||||
}
|
||||
|
||||
FormElement* ConditionElement::make_generic(const Env& env,
|
||||
FormPool& pool,
|
||||
const std::vector<Form*>& source_forms,
|
||||
const std::vector<TypeSpec>& types) {
|
||||
switch (m_kind) {
|
||||
case IR2_Condition::Kind::TRUTHY:
|
||||
case IR2_Condition::Kind::ZERO:
|
||||
return make_zero_check_generic(env, pool, source_forms, types);
|
||||
case IR2_Condition::Kind::TRUTHY:
|
||||
case IR2_Condition::Kind::NONZERO:
|
||||
case IR2_Condition::Kind::FALSE:
|
||||
case IR2_Condition::Kind::IS_PAIR:
|
||||
@@ -1966,7 +2041,7 @@ void ReturnElement::push_to_stack(const Env& env, FormPool& pool, FormStack& sta
|
||||
}
|
||||
|
||||
std::vector<FormElement*> new_entries;
|
||||
new_entries = rewrite_to_get_var(temp_stack, pool, env.end_var());
|
||||
new_entries = rewrite_to_get_var(temp_stack, pool, env.end_var(), env);
|
||||
|
||||
return_code->clear();
|
||||
for (auto e : new_entries) {
|
||||
@@ -2067,20 +2142,6 @@ void DynamicMethodAccess::update_from_stack(const Env& env,
|
||||
// ArrayFieldAccess
|
||||
////////////////////////
|
||||
|
||||
namespace {
|
||||
bool is_power_of_two(int in, int* out) {
|
||||
int x = 1;
|
||||
for (int i = 0; i < 32; i++) {
|
||||
if (x == in) {
|
||||
*out = i;
|
||||
return true;
|
||||
}
|
||||
x = x * 2;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void ArrayFieldAccess::update_with_val(Form* new_val,
|
||||
const Env& env,
|
||||
FormPool& pool,
|
||||
@@ -2277,6 +2338,11 @@ void EmptyElement::push_to_stack(const Env&, FormPool&, FormStack& stack) {
|
||||
stack.push_form_element(this, true);
|
||||
}
|
||||
|
||||
void StoreElement::push_to_stack(const Env&, FormPool&, FormStack& stack) {
|
||||
mark_popped();
|
||||
stack.push_form_element(this, true);
|
||||
}
|
||||
|
||||
bool is_symbol_true(const Form* form) {
|
||||
auto as_simple = dynamic_cast<SimpleExpressionElement*>(form->try_as_single_element());
|
||||
if (as_simple && as_simple->expr().is_identity() && as_simple->expr().get_arg(0).is_sym_ptr() &&
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <algorithm>
|
||||
#include "FormStack.h"
|
||||
#include "Form.h"
|
||||
#include "GenericElementMatcher.h"
|
||||
|
||||
namespace decompiler {
|
||||
std::string FormStack::StackEntry::print(const Env& env) const {
|
||||
@@ -206,7 +207,68 @@ FormElement* FormStack::pop_back(FormPool& pool) {
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<FormElement*> FormStack::rewrite(FormPool& pool) {
|
||||
namespace {
|
||||
bool is_op_in_place(SetVarElement* elt,
|
||||
FixedOperatorKind op,
|
||||
const Env&,
|
||||
Variable* base_out,
|
||||
Form** val_out) {
|
||||
auto matcher = Matcher::op(GenericOpMatcher::fixed(op), {Matcher::any_reg(0), Matcher::any(1)});
|
||||
auto result = match(matcher, elt->src());
|
||||
if (result.matched) {
|
||||
auto first = result.maps.regs.at(0);
|
||||
assert(first.has_value());
|
||||
if (first->reg() != elt->dst().reg()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (first->idx() != elt->dst().idx()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
*val_out = result.maps.forms.at(1);
|
||||
*base_out = first.value();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
FormElement* rewrite_set_op_in_place_for_kind(SetVarElement* in,
|
||||
const Env& env,
|
||||
FormPool& pool,
|
||||
FixedOperatorKind first_kind,
|
||||
FixedOperatorKind in_place_kind) {
|
||||
Form* val = nullptr;
|
||||
Variable base;
|
||||
|
||||
if (is_op_in_place(in, first_kind, env, &base, &val)) {
|
||||
return pool.alloc_element<GenericElement>(
|
||||
GenericOperator::make_fixed(in_place_kind),
|
||||
std::vector<Form*>{
|
||||
pool.alloc_single_element_form<SimpleAtomElement>(nullptr, SimpleAtom::make_var(base)),
|
||||
val});
|
||||
}
|
||||
return in;
|
||||
}
|
||||
|
||||
FormElement* try_rewrites_in_place(SetVarElement* in, const Env& env, FormPool& pool) {
|
||||
auto out = rewrite_set_op_in_place_for_kind(in, env, pool, FixedOperatorKind::ADDITION,
|
||||
FixedOperatorKind::ADDITION_IN_PLACE);
|
||||
if (out != in) {
|
||||
return out;
|
||||
}
|
||||
|
||||
out = rewrite_set_op_in_place_for_kind(in, env, pool, FixedOperatorKind::ADDITION_PTR,
|
||||
FixedOperatorKind::ADDITION_PTR_IN_PLACE);
|
||||
if (out != in) {
|
||||
return out;
|
||||
}
|
||||
|
||||
return in;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
std::vector<FormElement*> FormStack::rewrite(FormPool& pool, const Env& env) {
|
||||
std::vector<FormElement*> result;
|
||||
|
||||
for (auto& e : m_stack) {
|
||||
@@ -215,10 +277,14 @@ std::vector<FormElement*> FormStack::rewrite(FormPool& pool) {
|
||||
}
|
||||
|
||||
if (e.destination.has_value()) {
|
||||
// (set! x (+ x y)) -> (+! x y)
|
||||
|
||||
auto elt =
|
||||
pool.alloc_element<SetVarElement>(*e.destination, e.source, e.sequence_point, e.set_info);
|
||||
e.source->parent_element = elt;
|
||||
result.push_back(elt);
|
||||
|
||||
auto final_elt = try_rewrites_in_place(elt, env, pool);
|
||||
result.push_back(final_elt);
|
||||
} else {
|
||||
result.push_back(e.elt);
|
||||
}
|
||||
@@ -228,7 +294,8 @@ std::vector<FormElement*> FormStack::rewrite(FormPool& pool) {
|
||||
|
||||
void rewrite_to_get_var(std::vector<FormElement*>& default_result,
|
||||
FormPool& pool,
|
||||
const Variable& var) {
|
||||
const Variable& var,
|
||||
const Env&) {
|
||||
auto last_op_as_set = dynamic_cast<SetVarElement*>(default_result.back());
|
||||
if (last_op_as_set && last_op_as_set->dst().reg() == var.reg()) {
|
||||
default_result.pop_back();
|
||||
@@ -243,9 +310,10 @@ void rewrite_to_get_var(std::vector<FormElement*>& default_result,
|
||||
|
||||
std::vector<FormElement*> rewrite_to_get_var(FormStack& stack,
|
||||
FormPool& pool,
|
||||
const Variable& var) {
|
||||
auto default_result = stack.rewrite(pool);
|
||||
rewrite_to_get_var(default_result, pool, var);
|
||||
const Variable& var,
|
||||
const Env& env) {
|
||||
auto default_result = stack.rewrite(pool, env);
|
||||
rewrite_to_get_var(default_result, pool, var, env);
|
||||
return default_result;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class FormStack {
|
||||
FormElement* pop_back(FormPool& pool);
|
||||
Form* unsafe_peek(Register reg, const Env& env);
|
||||
bool is_single_expression();
|
||||
std::vector<FormElement*> rewrite(FormPool& pool);
|
||||
std::vector<FormElement*> rewrite(FormPool& pool, const Env& env);
|
||||
std::string print(const Env& env);
|
||||
bool is_root() const { return m_is_root_stack; }
|
||||
|
||||
@@ -64,6 +64,10 @@ class FormStack {
|
||||
|
||||
void rewrite_to_get_var(std::vector<FormElement*>& default_result,
|
||||
FormPool& pool,
|
||||
const Variable& var);
|
||||
std::vector<FormElement*> rewrite_to_get_var(FormStack& stack, FormPool& pool, const Variable& var);
|
||||
const Variable& var,
|
||||
const Env& env);
|
||||
std::vector<FormElement*> rewrite_to_get_var(FormStack& stack,
|
||||
FormPool& pool,
|
||||
const Variable& var,
|
||||
const Env& env);
|
||||
} // namespace decompiler
|
||||
|
||||
@@ -68,6 +68,13 @@ Matcher Matcher::integer(std::optional<int> value) {
|
||||
return m;
|
||||
}
|
||||
|
||||
Matcher Matcher::any_integer(int match_id) {
|
||||
Matcher m;
|
||||
m.m_kind = Kind::ANY_INT;
|
||||
m.m_int_out_id = match_id;
|
||||
return m;
|
||||
}
|
||||
|
||||
Matcher Matcher::any_quoted_symbol(int match_id) {
|
||||
Matcher m;
|
||||
m.m_kind = Kind::ANY_QUOTED_SYMBOL;
|
||||
@@ -272,6 +279,31 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
|
||||
return false;
|
||||
} break;
|
||||
|
||||
case Kind::ANY_INT: {
|
||||
auto as_simple_atom = dynamic_cast<SimpleAtomElement*>(input->try_as_single_element());
|
||||
if (as_simple_atom) {
|
||||
if (as_simple_atom->atom().is_int()) {
|
||||
if (m_int_out_id != -1) {
|
||||
maps_out->ints[m_int_out_id] = as_simple_atom->atom().get_int();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
auto as_expr = dynamic_cast<SimpleExpressionElement*>(input->try_as_single_element());
|
||||
if (as_expr && as_expr->expr().is_identity()) {
|
||||
auto atom = as_expr->expr().get_arg(0);
|
||||
if (atom.is_int()) {
|
||||
if (m_int_out_id != -1) {
|
||||
maps_out->ints[m_int_out_id] = atom.get_int();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
} break;
|
||||
|
||||
case Kind::ANY_QUOTED_SYMBOL: {
|
||||
auto as_simple_atom = dynamic_cast<SimpleAtomElement*>(input->try_as_single_element());
|
||||
if (as_simple_atom) {
|
||||
|
||||
@@ -18,6 +18,7 @@ struct MatchResult {
|
||||
std::unordered_map<int, std::string> strings;
|
||||
std::unordered_map<int, Form*> forms;
|
||||
std::unordered_map<int, int> label;
|
||||
std::unordered_map<int, int> ints;
|
||||
} maps;
|
||||
};
|
||||
|
||||
@@ -33,6 +34,7 @@ class Matcher {
|
||||
static Matcher cast(const std::string& type, Matcher value);
|
||||
static Matcher any(int match_id = -1);
|
||||
static Matcher integer(std::optional<int> value);
|
||||
static Matcher any_integer(int match_id = -1);
|
||||
static Matcher any_reg_cast_to_int_or_uint(int match_id = -1);
|
||||
static Matcher any_quoted_symbol(int match_id = -1);
|
||||
static Matcher any_symbol(int match_id = -1);
|
||||
@@ -52,6 +54,7 @@ class Matcher {
|
||||
CAST,
|
||||
ANY,
|
||||
INT,
|
||||
ANY_INT,
|
||||
ANY_QUOTED_SYMBOL,
|
||||
ANY_SYMBOL,
|
||||
DEREF_OP,
|
||||
@@ -74,6 +77,7 @@ class Matcher {
|
||||
int m_string_out_id = -1;
|
||||
int m_form_match = -1;
|
||||
int m_label_out_id = -1;
|
||||
int m_int_out_id = -1;
|
||||
std::optional<int> m_int_match;
|
||||
std::string m_str;
|
||||
};
|
||||
|
||||
@@ -93,6 +93,9 @@ enum class FixedOperatorKind {
|
||||
GPR_TO_FPR,
|
||||
DIVISION,
|
||||
ADDITION,
|
||||
ADDITION_PTR,
|
||||
ADDITION_IN_PLACE,
|
||||
ADDITION_PTR_IN_PLACE,
|
||||
SUBTRACTION,
|
||||
MULTIPLICATION,
|
||||
SQRT,
|
||||
|
||||
@@ -66,7 +66,7 @@ SimpleAtom make_src_atom(Register reg, int idx) {
|
||||
}
|
||||
|
||||
SimpleAtom false_sym() {
|
||||
return SimpleAtom::make_sym_ptr("#f");
|
||||
return SimpleAtom::make_sym_val("#f");
|
||||
}
|
||||
|
||||
////////////////////////
|
||||
@@ -168,7 +168,7 @@ std::unique_ptr<AtomicOp> make_standard_store(const Instruction& i0,
|
||||
SimpleExpression dst;
|
||||
if (i0.get_src(0).is_reg(rs7())) {
|
||||
assert(!is_float);
|
||||
val = SimpleAtom::make_sym_ptr("#f");
|
||||
val = SimpleAtom::make_sym_val("#f");
|
||||
} else if (i0.get_src(0).is_reg(rr0())) {
|
||||
assert(!is_float);
|
||||
val = SimpleAtom::make_int_constant(0);
|
||||
@@ -581,7 +581,7 @@ std::unique_ptr<AtomicOp> convert_sw_1(const Instruction& i0, int idx) {
|
||||
SimpleAtom val;
|
||||
if (i0.get_src(0).is_reg(rs7())) {
|
||||
// store a false
|
||||
val = SimpleAtom::make_sym_ptr("#f");
|
||||
val = SimpleAtom::make_sym_val("#f");
|
||||
} else if (i0.get_src(0).is_reg(rr0())) {
|
||||
// store a 0
|
||||
val = SimpleAtom::make_int_constant(0);
|
||||
@@ -648,14 +648,14 @@ std::unique_ptr<AtomicOp> convert_beql_1(const Instruction& i0, int idx, bool li
|
||||
} else if (i0.get_src(0).is_reg(rs7())) {
|
||||
if (s1 == rs7()) {
|
||||
// (if #f ...) type code?
|
||||
condition = IR2_Condition(IR2_Condition::Kind::FALSE, SimpleAtom::make_sym_ptr("#f"));
|
||||
condition = IR2_Condition(IR2_Condition::Kind::FALSE, SimpleAtom::make_sym_val("#f"));
|
||||
} else {
|
||||
condition = IR2_Condition(IR2_Condition::Kind::FALSE, make_src_atom(s1, idx));
|
||||
}
|
||||
} else if (s1 == rs7()) {
|
||||
// likely a case where somebody wrote (= x #f) or (!= x #f). much rarer than the flipped one
|
||||
condition = IR2_Condition(IR2_Condition::Kind::EQUAL, make_src_atom(s0, idx),
|
||||
SimpleAtom::make_sym_ptr("#f"));
|
||||
SimpleAtom::make_sym_val("#f"));
|
||||
} else {
|
||||
condition =
|
||||
IR2_Condition(IR2_Condition::Kind::EQUAL, make_src_atom(s0, idx), make_src_atom(s1, idx));
|
||||
@@ -676,7 +676,7 @@ std::unique_ptr<AtomicOp> convert_bnel_1(const Instruction& i0, int idx, bool li
|
||||
} else if (s1 == rs7()) {
|
||||
// likely a case where somebody wrote (= x #f) or (!= x #f). much rarer than the flipped one
|
||||
condition = IR2_Condition(IR2_Condition::Kind::NOT_EQUAL, make_src_atom(s0, idx),
|
||||
SimpleAtom::make_sym_ptr("#f"));
|
||||
SimpleAtom::make_sym_val("#f"));
|
||||
} else {
|
||||
condition = IR2_Condition(IR2_Condition::Kind::NOT_EQUAL, make_src_atom(s0, idx),
|
||||
make_src_atom(s1, idx));
|
||||
@@ -855,7 +855,7 @@ std::unique_ptr<AtomicOp> convert_bne_2(const Instruction& i0,
|
||||
} else if (s1 == rs7()) {
|
||||
// likely a case where somebody wrote (= x #f) or (!= x #f). much rarer than the flipped one
|
||||
condition = IR2_Condition(IR2_Condition::Kind::NOT_EQUAL, make_src_atom(s0, idx),
|
||||
SimpleAtom::make_sym_ptr("#f"));
|
||||
SimpleAtom::make_sym_val("#f"));
|
||||
} else {
|
||||
condition = IR2_Condition(IR2_Condition::Kind::NOT_EQUAL, make_src_atom(s0, idx),
|
||||
make_src_atom(s1, idx));
|
||||
@@ -879,14 +879,14 @@ std::unique_ptr<AtomicOp> convert_beq_2(const Instruction& i0,
|
||||
} else if (i0.get_src(0).is_reg(rs7())) {
|
||||
if (s1 == rs7()) {
|
||||
// (if #f ...) type code?
|
||||
condition = IR2_Condition(IR2_Condition::Kind::FALSE, SimpleAtom::make_sym_ptr("#f"));
|
||||
condition = IR2_Condition(IR2_Condition::Kind::FALSE, SimpleAtom::make_sym_val("#f"));
|
||||
} else {
|
||||
condition = IR2_Condition(IR2_Condition::Kind::FALSE, make_src_atom(s1, idx));
|
||||
}
|
||||
} else if (s1 == rs7()) {
|
||||
// likely a case where somebody wrote (= x #f) or (!= x #f). much rarer than the flipped one
|
||||
condition = IR2_Condition(IR2_Condition::Kind::EQUAL, make_src_atom(s0, idx),
|
||||
SimpleAtom::make_sym_ptr("#f"));
|
||||
SimpleAtom::make_sym_val("#f"));
|
||||
} else {
|
||||
condition =
|
||||
IR2_Condition(IR2_Condition::Kind::EQUAL, make_src_atom(s0, idx), make_src_atom(s1, idx));
|
||||
@@ -1081,7 +1081,7 @@ std::unique_ptr<AtomicOp> convert_dsubu_3(const Instruction& i0,
|
||||
// some sort of not gone wrong?
|
||||
result = std::make_unique<SetVarConditionOp>(
|
||||
make_dst_var(dest, idx),
|
||||
IR2_Condition(kind, make_src_atom(a, idx), SimpleAtom::make_sym_ptr("#f")), idx);
|
||||
IR2_Condition(kind, make_src_atom(a, idx), SimpleAtom::make_sym_val("#f")), idx);
|
||||
} else if (b == rr0()) {
|
||||
// not the greatest codegen...
|
||||
result = std::make_unique<SetVarConditionOp>(
|
||||
|
||||
@@ -201,7 +201,7 @@ bool delay_slot_sets_false(BranchElement* branch, SetVarOp& delay) {
|
||||
assert(branch->op()->likely());
|
||||
assert(branch->op()->branch_delay().kind() == IR2_BranchDelay::Kind::NO_DELAY);
|
||||
|
||||
if (delay.src().is_identity() && delay.src().get_arg(0).is_sym_ptr() &&
|
||||
if (delay.src().is_identity() && delay.src().get_arg(0).is_sym_val() &&
|
||||
delay.src().get_arg(0).get_str() == "#f") {
|
||||
return true;
|
||||
}
|
||||
@@ -517,7 +517,7 @@ void convert_cond_no_else_to_compare(FormPool& pool,
|
||||
auto dst = body->dst();
|
||||
auto src_atom = get_atom_src(body->src());
|
||||
assert(src_atom);
|
||||
assert(src_atom->is_sym_ptr());
|
||||
assert(src_atom->is_sym_val());
|
||||
assert(src_atom->get_str() == "#f");
|
||||
assert(cne->entries.size() == 1);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ bool convert_to_expressions(Form* top_level_form,
|
||||
std::vector<FormElement*> new_entries;
|
||||
if (f.type.last_arg() != TypeSpec("none")) {
|
||||
auto return_var = f.ir2.atomic_ops->end_op().return_var();
|
||||
new_entries = rewrite_to_get_var(stack, pool, return_var);
|
||||
new_entries = rewrite_to_get_var(stack, pool, return_var, f.ir2.env);
|
||||
auto reg_return_type =
|
||||
f.ir2.env.get_types_after_op(f.ir2.atomic_ops->ops.size() - 1).get(return_var.reg());
|
||||
if (!dts.ts.typecheck(f.type.last_arg(), reg_return_type.typespec(), "", false, false)) {
|
||||
@@ -82,7 +82,7 @@ bool convert_to_expressions(Form* top_level_form,
|
||||
new_entries.push_back(cast);
|
||||
}
|
||||
} else {
|
||||
new_entries = stack.rewrite(pool);
|
||||
new_entries = stack.rewrite(pool, f.ir2.env);
|
||||
}
|
||||
assert(!new_entries.empty());
|
||||
top_level_form->clear();
|
||||
|
||||
@@ -229,9 +229,14 @@ std::string write_from_top_level(const Function& top_level,
|
||||
auto deftype_match_result = match(deftype_matcher, &f);
|
||||
if (deftype_match_result.matched) {
|
||||
auto& name = deftype_match_result.maps.strings.at(type_name);
|
||||
result += fmt::format(";; definition of type {}\n", name);
|
||||
result += dts.ts.generate_deftype(dts.ts.lookup_type(name));
|
||||
result += "\n\n";
|
||||
if (dts.ts.fully_defined_type_exists(name)) {
|
||||
result += fmt::format(";; definition of type {}\n", name);
|
||||
result += dts.ts.generate_deftype(dts.ts.lookup_type(name));
|
||||
result += "\n\n";
|
||||
} else {
|
||||
result +=
|
||||
fmt::format(";; type {} defintion, but it is unknown to the decompiler\n\n", name);
|
||||
}
|
||||
something_matched = true;
|
||||
}
|
||||
}
|
||||
|
||||
+397
-184
@@ -2421,7 +2421,7 @@
|
||||
;;(define-extern vif-stcycl-imm object) ;; unknown type
|
||||
;;(define-extern dma-bank object) ;; unknown type
|
||||
;;(define-extern flush-cache object) ;; unknown type
|
||||
;;(define-extern *video-parms* object) ;; unknown type
|
||||
(define-extern *video-parms* video-parms) ;; unknown type
|
||||
;;(define-extern video-parms object) ;; unknown type
|
||||
;;(define-extern generic-bucket-state object) ;; unknown type
|
||||
;;(define-extern *vu1-enable-user-menu* object) ;; unknown type
|
||||
@@ -2484,7 +2484,7 @@
|
||||
(deftype dma-buffer (basic)
|
||||
((allocated-length int32 :offset-assert 4)
|
||||
(base pointer :offset-assert 8)
|
||||
(end uint32 :offset-assert 12)
|
||||
(end pointer :offset-assert 12)
|
||||
(data uint64 1 :offset-assert 16) ;; weird, I guess this aligns the data?
|
||||
(data-buffer uint8 :dynamic :offset 16)
|
||||
)
|
||||
@@ -2515,9 +2515,11 @@
|
||||
(define-extern dma-buffer-add-buckets (function dma-buffer int none))
|
||||
(define-extern dma-buffer-patch-buckets (function dma-bucket int int))
|
||||
|
||||
;;;;;;;;;;;;;;;
|
||||
;; dma-disasm
|
||||
;;;;;;;;;;;;;;;
|
||||
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;; DMA-DISASM ;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
||||
|
||||
|
||||
(deftype vif-disasm-element (structure)
|
||||
@@ -2534,17 +2536,18 @@
|
||||
)
|
||||
|
||||
(define-extern *vif-disasm-table* (array vif-disasm-element)) ;; unknown type
|
||||
(define-extern disasm-vif-tag function)
|
||||
(define-extern disasm-dma-tag function)
|
||||
(define-extern disasm-vif-details (function symbol (pointer uint8) int int int))
|
||||
;;(define-extern disasm-vif-tag (function (pointer uint32) int symbol int symbol))
|
||||
(define-extern disasm-dma-tag (function uint symbol int))
|
||||
(define-extern disasm-vif-details (function symbol (pointer uint8) int int symbol))
|
||||
(define-extern vif-disasm-element type)
|
||||
;;(define-extern *dma-disasm* object) ;; unknown type
|
||||
(define-extern disasm-dma-list function)
|
||||
|
||||
;;;;;;;;;;;;;;;
|
||||
;; pad
|
||||
;;;;;;;;;;;;;;;
|
||||
|
||||
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;; PAD ;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
||||
(deftype hw-cpad (basic)
|
||||
((valid uint8 :offset-assert 4)
|
||||
(status uint8 :offset-assert 5)
|
||||
@@ -2564,9 +2567,9 @@
|
||||
(deftype cpad-info (hw-cpad)
|
||||
((number int32 :offset-assert 36)
|
||||
(cpad-file int32 :offset-assert 40)
|
||||
(button0-abs int32 3 :offset-assert 44) ;; guess
|
||||
(button0-shadow-abs int32 1 :offset-assert 56) ;; guess
|
||||
(button0-rel int32 3 :offset-assert 60) ;; guess
|
||||
(button0-abs uint32 3 :offset-assert 44) ;; guess
|
||||
(button0-shadow-abs uint32 1 :offset-assert 56) ;; guess
|
||||
(button0-rel uint32 3 :offset-assert 60) ;; guess
|
||||
(stick0-dir float :offset-assert 72)
|
||||
(stick0-speed float :offset-assert 76)
|
||||
(new-pad int32 :offset-assert 80)
|
||||
@@ -2579,6 +2582,9 @@
|
||||
(buzz-act int32 :offset-assert 124)
|
||||
(change-time uint64 :offset-assert 128)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type int) _type_ 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x88
|
||||
:flag-assert #x900000088
|
||||
@@ -2586,29 +2592,91 @@
|
||||
|
||||
(deftype cpad-list (basic)
|
||||
((num-cpads int32 :offset-assert 4)
|
||||
(cpads int32 2 :offset-assert 8) ;; guess
|
||||
(cpads cpad-info 2 :offset-assert 8) ;; guess
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type) _type_ 0))
|
||||
:method-count-assert 9
|
||||
:size-assert #x10
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;;
|
||||
;; gs
|
||||
;;;;;;;;;;;;;;;
|
||||
;; display
|
||||
(define-extern get-current-time (function uint))
|
||||
(define-extern get-integral-current-time (function uint))
|
||||
;; in the kernel.
|
||||
(define-extern cpad-open (function cpad-info int cpad-info))
|
||||
(define-extern cpad-get-data (function cpad-info cpad-info))
|
||||
|
||||
|
||||
(define-extern cpad-set-buzz! (function cpad-info int int int none))
|
||||
(define-extern *cpad-debug* symbol) ;; unknown type
|
||||
(define-extern analog-input (function int float float float float float))
|
||||
(define-extern buzz-stop! (function int none))
|
||||
;;(define-extern cpad-info object) ;; unknown type
|
||||
;;(define-extern hw-cpad object) ;; unknown type
|
||||
(define-extern cpad-invalid! (function cpad-info cpad-info))
|
||||
;;(define-extern cpad-list object) ;; unknown type
|
||||
;;(define-extern *cheat-mode* object) ;; unknown type
|
||||
(define-extern *cpad-list* cpad-list) ;; unknown type
|
||||
(define-extern service-cpads (function cpad-list))
|
||||
|
||||
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;; GS ;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
||||
|
||||
;; L139 - #x900000008
|
||||
;; L138 -
|
||||
;; L137 -
|
||||
|
||||
(deftype gs-pmode (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
(deftype gs-smode2 (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
(define-extern psm-size (function int int))
|
||||
(define-extern psm-page-height (function int int))
|
||||
(define-extern psm->string (function int string))
|
||||
|
||||
(deftype gs-display-fb (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
(deftype gs-display (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
(deftype gs-bgcolor (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
(deftype gs-csr (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
(deftype gs-bank (structure)
|
||||
((pmode uint64 :offset-assert 0)
|
||||
(smode2 uint64 :offset 32)
|
||||
(dspfb1 uint64 :offset 112)
|
||||
(display1 uint64 :offset 128)
|
||||
(dspfb2 uint64 :offset 144)
|
||||
(display2 uint64 :offset 160)
|
||||
((pmode gs-pmode :offset-assert 0)
|
||||
(smode2 gs-smode2 :offset 32)
|
||||
(dspfb1 gs-display-fb :offset 112)
|
||||
(display1 gs-display :offset 128)
|
||||
(dspfb2 gs-display-fb :offset 144)
|
||||
(display2 gs-display :offset 160)
|
||||
(extbuf uint64 :offset 176)
|
||||
(extdata uint64 :offset 192)
|
||||
(extwrite uint64 :offset 208)
|
||||
(bgcolor uint64 :offset 224)
|
||||
(csr uint64 :offset 4096)
|
||||
(bgcolor gs-bgcolor :offset 224)
|
||||
(csr gs-csr :offset 4096)
|
||||
(imr uint64 :offset 4112)
|
||||
(busdir uint64 :offset 4160)
|
||||
)
|
||||
@@ -2617,50 +2685,170 @@
|
||||
:flag-assert #x900001048
|
||||
)
|
||||
|
||||
; ;; gs
|
||||
; (deftype gs-alpha (uint64)
|
||||
; ()
|
||||
; :method-count-assert 9
|
||||
; :size-assert #x8
|
||||
; :flag-assert #x900000008
|
||||
; ;; likely a bitfield type
|
||||
; )
|
||||
(deftype gs-frame (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-zbuf (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-xy-offset (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-scissor (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-prmode-cont (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-color-clamp (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-dthe (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-test (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-prim (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-rgbaq (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-xyz (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-uv (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-st (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-xyzf (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-trxpos (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-trxreg (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-trxdir (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-bitbltbuf (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-tex0 (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-tex1 (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-texa (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-texclut (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-miptbp (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-alpha (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-fog (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gs-fogcol (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
|
||||
; ;; gs
|
||||
; (deftype gs-fog (uint64)
|
||||
; ()
|
||||
; :method-count-assert 9
|
||||
; :size-assert #x8
|
||||
; :flag-assert #x900000008
|
||||
; ;; likely a bitfield type
|
||||
; )
|
||||
|
||||
; ;; gs
|
||||
; (deftype gs-fogcol (uint64)
|
||||
; ()
|
||||
; :method-count-assert 9
|
||||
; :size-assert #x8
|
||||
; :flag-assert #x900000008
|
||||
; ;; likely a bitfield type
|
||||
; )
|
||||
(deftype gif-ctrl (uint32)
|
||||
()
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
(deftype gif-mode (uint32)
|
||||
()
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
(deftype gif-stat (uint32)
|
||||
()
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
(deftype gif-cnt (uint32)
|
||||
()
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
(deftype gif-p3cnt (uint32)
|
||||
()
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
(deftype gif-p3tag (uint32)
|
||||
()
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|
||||
(deftype gif-bank (structure)
|
||||
((ctrl uint32 :offset 0)
|
||||
(mode uint32 :offset 16)
|
||||
(stat uint32 :offset 32)
|
||||
((ctrl gif-ctrl :offset 0)
|
||||
(mode gif-mode :offset 16)
|
||||
(stat gif-stat :offset 32)
|
||||
(tag0 uint32 :offset 64)
|
||||
(tag1 uint32 :offset 80)
|
||||
(tag2 uint32 :offset 96)
|
||||
(tag3 uint32 :offset 112)
|
||||
(cnt uint32 :offset 128)
|
||||
(p3cnt uint32 :offset 144)
|
||||
(p3tag uint32 :offset 160)
|
||||
(cnt gif-cnt :offset 128)
|
||||
(p3cnt gif-p3cnt :offset 144)
|
||||
(p3tag gif-p3tag :offset 160)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xa4
|
||||
:flag-assert #x9000000a4
|
||||
)
|
||||
|
||||
(deftype gif-tag-prim (uint32)
|
||||
()
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
(deftype gif-tag-count (uint32)
|
||||
()
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
(deftype gif-tag64 (uint64)
|
||||
()
|
||||
:flag-assert #x900000008
|
||||
)
|
||||
(deftype gif-tag (uint128)
|
||||
()
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
(deftype gs-gif-tag (structure)
|
||||
((qword uint128 :offset-assert 0) ;; is "qword" and inline? in game
|
||||
(dword uint64 2 :offset 0)
|
||||
@@ -2673,20 +2861,21 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
; ;; gs
|
||||
; (deftype gif-tag (uint128)
|
||||
; ()
|
||||
; :method-count-assert 9
|
||||
; :size-assert #x10
|
||||
; :flag-assert #x900000010
|
||||
; ;; bad type dec string: [~8x] gif-tag~%
|
||||
; )
|
||||
(define-extern *fog-color* int)
|
||||
(define-extern default-buffer-init (function dma-buffer none))
|
||||
(define-extern *default-regs-buffer* dma-buffer)
|
||||
|
||||
|
||||
(deftype gif-packet (basic)
|
||||
((reg-count int32 :offset-assert 4)
|
||||
(gif-tag0 uint128 :offset-assert 16)
|
||||
(gif-tag gs-gif-tag :inline :offset 16) ;; note- added
|
||||
(args uint64 1 :offset-assert 32)
|
||||
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type int) _type_ 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x28
|
||||
:flag-assert #x900000028
|
||||
@@ -2700,11 +2889,74 @@
|
||||
(height int32 :offset-assert 20)
|
||||
(color int32 4 :offset-assert 24)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type int int int int int) _type_ 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x28
|
||||
:flag-assert #x900000028
|
||||
)
|
||||
|
||||
|
||||
;;(define-extern gs-trxreg object) ;; unknown type
|
||||
;;(define-extern gif-packet object) ;; unknown type
|
||||
;;(define-extern gs-fogcol object) ;; unknown type
|
||||
;;(define-extern gs-zbuf object) ;; unknown type
|
||||
;;(define-extern gif-bank object) ;; unknown type
|
||||
;; ;; unknown type
|
||||
;;(define-extern gs-trxpos object) ;; unknown type
|
||||
;;(define-extern gs-xy-offset object) ;; unknown type
|
||||
;;(define-extern gs-tex1 object) ;; unknown type
|
||||
;;(define-extern gs-prim object) ;; unknown type
|
||||
;;(define-extern gif-tag object) ;; unknown type
|
||||
;;(define-extern gs-display object) ;; unknown type
|
||||
;;(define-extern gs-prmode-cont object) ;; unknown type
|
||||
;;(define-extern gs-scissor object) ;; unknown type
|
||||
;;(define-extern gs-st object) ;; unknown type
|
||||
;;(define-extern gs-smode2 object) ;; unknown type
|
||||
(define-extern add-reg-gif-packet (function gif-packet int int none))
|
||||
;;(define-extern draw-context object) ;; unknown type
|
||||
;;(define-extern gs-texclut object) ;; unknown type
|
||||
;;(define-extern gs-bgcolor object) ;; unknown type
|
||||
(define-extern open-gif-packet (function gif-packet gif-packet))
|
||||
;;(define-extern gif-tag-count object) ;; unknown type
|
||||
;;(define-extern gs-test object) ;; unknown type
|
||||
;;(define-extern gs-tex0 object) ;; unknown type
|
||||
;;(define-extern gif-tag64 object) ;; unknown type
|
||||
;;(define-extern gs-alpha object) ;; unknown type
|
||||
;;(define-extern gs-miptbp object) ;; unknown type
|
||||
;;(define-extern gs-color-clamp object) ;; unknown type
|
||||
;;(define-extern gif-p3cnt object) ;; unknown type
|
||||
;;(define-extern gs-clamp object) ;; unknown type
|
||||
;;(define-extern gs-uv object) ;; unknown type
|
||||
;;(define-extern gif-stat object) ;; unknown type
|
||||
|
||||
;;(define-extern gif-mode object) ;; unknown type
|
||||
|
||||
;;(define-extern gs-trxdir object) ;; unknown type
|
||||
;;(define-extern gs-xyzf object) ;; unknown type
|
||||
;;(define-extern gs-csr object) ;; unknown type
|
||||
(define-extern draw-context-set-xy (function draw-context int int none))
|
||||
|
||||
;;(define-extern gs-frame object) ;; unknown type
|
||||
;;(define-extern gs-texa object) ;; unknown type
|
||||
;;(define-extern gs-bank object) ;; unknown type
|
||||
;;(define-extern gif-cnt object) ;; unknown type
|
||||
;;(define-extern gif-ctrl object) ;; unknown type
|
||||
;;(define-extern gs-gif-tag object) ;; unknown type
|
||||
;;(define-extern gs-pmode object) ;; unknown type
|
||||
;;(define-extern gs-dthe object) ;; unknown type
|
||||
;;(define-extern gs-fog object) ;; unknown type
|
||||
;;(define-extern gs-xyz object) ;; unknown type
|
||||
|
||||
;;(define-extern gif-tag-prim object) ;; unknown type
|
||||
;;(define-extern gif-p3tag object) ;; unknown type
|
||||
(define-extern close-gif-packet (function gif-packet int gif-packet))
|
||||
;;(define-extern gs-display-fb object) ;; unknown type
|
||||
;;(define-extern gs-bitbltbuf object) ;; unknown type
|
||||
;;(define-extern gs-rgbaq object) ;; unknown type
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;
|
||||
;; display-h
|
||||
;;;;;;;;;;;;;;;
|
||||
@@ -2745,6 +2997,16 @@
|
||||
:flag-assert #x900000080
|
||||
)
|
||||
|
||||
;;(define-extern display-env object) ;; unknown type
|
||||
;;(define-extern display-frame object) ;; unknown type
|
||||
;;(define-extern display object) ;; unknown type
|
||||
;;(define-extern *post-draw-hook* object) ;; unknown type
|
||||
;;(define-extern virtual-frame object) ;; unknown type
|
||||
(define-extern put-draw-env (function dma-packet none))
|
||||
;;(define-extern draw-env object) ;; unknown type
|
||||
;;(define-extern *pre-draw-hook* object) ;; unknown type
|
||||
|
||||
|
||||
(deftype display-frame (basic)
|
||||
((buffer int32 11 :offset-assert 4) ;; no idea
|
||||
(calc-buf basic :offset 8)
|
||||
@@ -2754,6 +3016,9 @@
|
||||
(bucket-group dma-bucket :offset 44)
|
||||
(profile-bar basic 2 :offset 48)
|
||||
(run-time uint64 :offset 56)
|
||||
)
|
||||
(:methods
|
||||
(new (symbol type) _type_ 0)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x40
|
||||
@@ -2761,13 +3026,14 @@
|
||||
)
|
||||
|
||||
(deftype virtual-frame (structure)
|
||||
((display display-env :offset-assert 0)
|
||||
(display-last display-env :offset-assert 4)
|
||||
(gif uint32 :offset-assert 8)
|
||||
(draw draw-env :offset-assert 12)
|
||||
(frame basic :offset-assert 16)
|
||||
((display display-env :offset-assert 0)
|
||||
(display-last display-env :offset-assert 4)
|
||||
(gif pointer :offset-assert 8)
|
||||
(draw draw-env :offset-assert 12)
|
||||
(frame display-frame :offset-assert 16)
|
||||
)
|
||||
:pack-me
|
||||
|
||||
:allow-misaligned
|
||||
:method-count-assert 9
|
||||
:size-assert #x14
|
||||
:flag-assert #x900000014
|
||||
@@ -2786,10 +3052,8 @@
|
||||
(draw2 draw-env :inline :offset-assert 432)
|
||||
(on-screen int32 :offset-assert 560)
|
||||
(last-screen int32 :offset-assert 564)
|
||||
;(frames UNKNOWN 6 :offset-assert 568)
|
||||
(_frames-pad uint8 196)
|
||||
;(bg-clear-color UNKNOWN 4 :offset-assert 760)
|
||||
(_bg-clear-color-pad uint8 8)
|
||||
(frames virtual-frame 6 :inline :offset-assert 568)
|
||||
(bg-clear-color uint32 4 :offset-assert 760)
|
||||
(real-frame-counter uint64 :offset-assert 776)
|
||||
(base-frame-counter uint64 :offset-assert 784)
|
||||
(game-frame-counter uint64 :offset-assert 792)
|
||||
@@ -2816,11 +3080,13 @@
|
||||
:size-assert #x39c
|
||||
:flag-assert #xa0000039c
|
||||
(:methods
|
||||
(new (symbol type int int int int int) _type_ 0)
|
||||
(dummy-9 () none 9)
|
||||
)
|
||||
)
|
||||
|
||||
(define-extern *display* display)
|
||||
(define-extern set-display (function display int int int int int display))
|
||||
|
||||
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
@@ -2947,9 +3213,29 @@
|
||||
;; loader-h
|
||||
;;;;;;;;;;;;;;;
|
||||
|
||||
(deftype load-dir (basic)
|
||||
((unknown basic)
|
||||
(string-array (array string))
|
||||
(data-array (array basic)))
|
||||
:flag-assert #xb00000010
|
||||
(:methods
|
||||
(new (symbol type int basic) _type_ 0)
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype load-dir-art-group (load-dir)
|
||||
()
|
||||
:flag-assert #xb00000010
|
||||
(:methods
|
||||
(new (symbol type int basic) _type_ 0)
|
||||
)
|
||||
)
|
||||
|
||||
(deftype external-art-buffer (basic)
|
||||
((index int32 :offset-assert 4)
|
||||
(other basic :offset-assert 8)
|
||||
(other external-art-buffer :offset-assert 8)
|
||||
(status basic :offset-assert 12)
|
||||
(locked? basic :offset-assert 16)
|
||||
(frame-lock basic :offset-assert 20)
|
||||
@@ -2970,6 +3256,7 @@
|
||||
:size-assert #x68
|
||||
:flag-assert #x1000000068
|
||||
(:methods
|
||||
(new (symbol type int) _type_)
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
@@ -2989,38 +3276,40 @@
|
||||
(owner uint64 :offset-assert 32)
|
||||
(command-list basic :offset-assert 40)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x2c
|
||||
:flag-assert #x90000002c
|
||||
)
|
||||
|
||||
;; loader-h
|
||||
;; todo inline basics
|
||||
; (deftype external-art-control (basic)
|
||||
; ((buffer basic 2 :offset-assert 4)
|
||||
; ;(rec UNKNOWN 3 :offset-assert 20)
|
||||
; (_rec-pad uint8 142)
|
||||
; (spool-lock uint64 :offset-assert 160)
|
||||
; (reserve-buffer basic :offset-assert 168)
|
||||
; (reserve-buffer-count int32 :offset-assert 172)
|
||||
; (active-stream basic :offset-assert 176)
|
||||
; (preload-stream spool-anim :inline :offset-assert 188)
|
||||
; (last-preload-stream spool-anim :inline :offset-assert 236)
|
||||
; )
|
||||
; :method-count-assert 17
|
||||
; :size-assert #x118
|
||||
; :flag-assert #x1100000118
|
||||
; (:methods
|
||||
; (dummy-9 () none 9)
|
||||
; (dummy-10 () none 10)
|
||||
; (dummy-11 () none 11)
|
||||
; (dummy-12 () none 12)
|
||||
; (dummy-13 () none 13)
|
||||
; (dummy-14 () none 14)
|
||||
; (dummy-15 () none 15)
|
||||
; (dummy-16 () none 16)
|
||||
; )
|
||||
; )
|
||||
; loader-h
|
||||
; todo inline basics
|
||||
(deftype external-art-control (basic)
|
||||
((buffer external-art-buffer 2 :offset-assert 4)
|
||||
(rec spool-anim 3 :inline)
|
||||
(spool-lock uint64 :offset-assert 160)
|
||||
(reserve-buffer basic :offset-assert 168)
|
||||
(reserve-buffer-count int32 :offset-assert 172)
|
||||
(active-stream basic :offset-assert 176)
|
||||
(preload-stream spool-anim :inline :offset-assert 184)
|
||||
(last-preload-stream spool-anim :inline :offset-assert 232)
|
||||
(end-pad uint32)
|
||||
)
|
||||
:method-count-assert 17
|
||||
:size-assert #x118
|
||||
:flag-assert #x1100000118
|
||||
(:methods
|
||||
(new (symbol type) _type_ 0)
|
||||
(dummy-9 () none 9)
|
||||
(dummy-10 () none 10)
|
||||
(dummy-11 () none 11)
|
||||
(dummy-12 () none 12)
|
||||
(dummy-13 () none 13)
|
||||
(dummy-14 () none 14)
|
||||
(dummy-15 () none 15)
|
||||
(dummy-16 () none 16)
|
||||
)
|
||||
)
|
||||
|
||||
;;;;;;;;;;;;;;
|
||||
;; texture-h
|
||||
@@ -32152,88 +32441,12 @@
|
||||
|
||||
;;(define-extern error object) ;; unknown type
|
||||
;;(define-extern details object) ;; unknown type
|
||||
(define-extern cpad-set-buzz! function)
|
||||
;;(define-extern *cpad-debug* object) ;; unknown type
|
||||
(define-extern analog-input function)
|
||||
(define-extern buzz-stop! function)
|
||||
;;(define-extern cpad-info object) ;; unknown type
|
||||
;;(define-extern hw-cpad object) ;; unknown type
|
||||
(define-extern cpad-invalid! function)
|
||||
;;(define-extern cpad-list object) ;; unknown type
|
||||
;;(define-extern *cheat-mode* object) ;; unknown type
|
||||
;;(define-extern *cpad-list* object) ;; unknown type
|
||||
(define-extern service-cpads function)
|
||||
(define-extern get-integral-current-time function)
|
||||
(define-extern get-current-time function)
|
||||
|
||||
(define-extern get-integral-current-time (function uint))
|
||||
(define-extern get-current-time (function uint))
|
||||
;;(define-extern cpad-get-data object) ;; unknown type
|
||||
;;(define-extern cpad-open object) ;; unknown type
|
||||
(define-extern psm->string function)
|
||||
;;(define-extern gs-trxreg object) ;; unknown type
|
||||
;;(define-extern gif-packet object) ;; unknown type
|
||||
;;(define-extern gs-fogcol object) ;; unknown type
|
||||
;;(define-extern gs-zbuf object) ;; unknown type
|
||||
;;(define-extern gif-bank object) ;; unknown type
|
||||
;;(define-extern *fog-color* object) ;; unknown type
|
||||
;;(define-extern gs-trxpos object) ;; unknown type
|
||||
;;(define-extern gs-xy-offset object) ;; unknown type
|
||||
;;(define-extern gs-tex1 object) ;; unknown type
|
||||
;;(define-extern gs-prim object) ;; unknown type
|
||||
;;(define-extern gif-tag object) ;; unknown type
|
||||
;;(define-extern gs-display object) ;; unknown type
|
||||
;;(define-extern gs-prmode-cont object) ;; unknown type
|
||||
;;(define-extern gs-scissor object) ;; unknown type
|
||||
;;(define-extern gs-st object) ;; unknown type
|
||||
;;(define-extern gs-smode2 object) ;; unknown type
|
||||
(define-extern add-reg-gif-packet function)
|
||||
;;(define-extern draw-context object) ;; unknown type
|
||||
;;(define-extern gs-texclut object) ;; unknown type
|
||||
;;(define-extern gs-bgcolor object) ;; unknown type
|
||||
(define-extern open-gif-packet function)
|
||||
;;(define-extern gif-tag-count object) ;; unknown type
|
||||
;;(define-extern gs-test object) ;; unknown type
|
||||
;;(define-extern gs-tex0 object) ;; unknown type
|
||||
;;(define-extern gif-tag64 object) ;; unknown type
|
||||
;;(define-extern gs-alpha object) ;; unknown type
|
||||
;;(define-extern gs-miptbp object) ;; unknown type
|
||||
;;(define-extern gs-color-clamp object) ;; unknown type
|
||||
;;(define-extern gif-p3cnt object) ;; unknown type
|
||||
;;(define-extern gs-clamp object) ;; unknown type
|
||||
;;(define-extern gs-uv object) ;; unknown type
|
||||
;;(define-extern gif-stat object) ;; unknown type
|
||||
(define-extern psm-page-height function)
|
||||
;;(define-extern gif-mode object) ;; unknown type
|
||||
(define-extern psm-size function)
|
||||
;;(define-extern gs-trxdir object) ;; unknown type
|
||||
;;(define-extern gs-xyzf object) ;; unknown type
|
||||
;;(define-extern gs-csr object) ;; unknown type
|
||||
(define-extern draw-context-set-xy function)
|
||||
;;(define-extern *default-regs-buffer* object) ;; unknown type
|
||||
;;(define-extern gs-frame object) ;; unknown type
|
||||
;;(define-extern gs-texa object) ;; unknown type
|
||||
;;(define-extern gs-bank object) ;; unknown type
|
||||
;;(define-extern gif-cnt object) ;; unknown type
|
||||
;;(define-extern gif-ctrl object) ;; unknown type
|
||||
;;(define-extern gs-gif-tag object) ;; unknown type
|
||||
;;(define-extern gs-pmode object) ;; unknown type
|
||||
;;(define-extern gs-dthe object) ;; unknown type
|
||||
;;(define-extern gs-fog object) ;; unknown type
|
||||
;;(define-extern gs-xyz object) ;; unknown type
|
||||
(define-extern default-buffer-init function)
|
||||
;;(define-extern gif-tag-prim object) ;; unknown type
|
||||
;;(define-extern gif-p3tag object) ;; unknown type
|
||||
(define-extern close-gif-packet function)
|
||||
;;(define-extern gs-display-fb object) ;; unknown type
|
||||
;;(define-extern gs-bitbltbuf object) ;; unknown type
|
||||
;;(define-extern gs-rgbaq object) ;; unknown type
|
||||
;;(define-extern display-env object) ;; unknown type
|
||||
;;(define-extern display-frame object) ;; unknown type
|
||||
;;(define-extern display object) ;; unknown type
|
||||
;;(define-extern *post-draw-hook* object) ;; unknown type
|
||||
;;(define-extern virtual-frame object) ;; unknown type
|
||||
(define-extern put-draw-env function)
|
||||
;;(define-extern draw-env object) ;; unknown type
|
||||
;;(define-extern *pre-draw-hook* object) ;; unknown type
|
||||
(define-extern set-display function)
|
||||
|
||||
|
||||
;;(define-extern *display* object) ;; unknown type
|
||||
|
||||
|
||||
@@ -28,5 +28,16 @@
|
||||
["L128", "float", true],
|
||||
["L110", "float", true],
|
||||
["L136", "float", true]
|
||||
],
|
||||
|
||||
"pad":[
|
||||
["L44", "float", true],
|
||||
["L42", "float", true],
|
||||
["L43", "float", true],
|
||||
["L41", "float", true]
|
||||
],
|
||||
|
||||
"loader-h":[
|
||||
["L10", "float", true]
|
||||
]
|
||||
}
|
||||
@@ -175,6 +175,18 @@
|
||||
"dma-bucket-insert-tag":[
|
||||
[1, ["a0", "uint"]],
|
||||
[2, ["v1", "dma-bucket"]]
|
||||
],
|
||||
|
||||
"default-buffer-init":[
|
||||
[9, ["a1", "gs-gif-tag"]],
|
||||
[15, ["a1", "pointer"]],
|
||||
[16, ["a1", "gs-gif-tag"]],
|
||||
[19, ["a1", "gs-gif-tag"]],
|
||||
[24, ["a1", "pointer"]],
|
||||
[25, ["a1", "gs-gif-tag"]],
|
||||
[31, ["a1", "(pointer uint64)"]],
|
||||
[68, ["a0", "gs-gif-tag"]],
|
||||
[72, ["a0", "pointer"]]
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -427,6 +427,47 @@
|
||||
"disasm-vif-details":{
|
||||
"args":["stream", "data", "kind", "count"],
|
||||
"vars":{"s4-0":"count2", "s3-0":"data-ptr", "s2-0":"i"}
|
||||
},
|
||||
|
||||
"cpad-invalid!":{
|
||||
"args":["pad"]
|
||||
},
|
||||
|
||||
"(method 0 cpad-info)":{
|
||||
"args":["alloction", "type-to-make", "idx"],
|
||||
"vars":{"s5-0":"obj"}
|
||||
},
|
||||
|
||||
"analog-input":{
|
||||
"args":["in", "offset", "center-val", "max-val", "out-range"],
|
||||
"vars":{"f1-1":"offset-in", "f0-3":"magnitude", "v1-0":"max-magnitude"}
|
||||
},
|
||||
|
||||
"cpad-set-buzz!":{
|
||||
"args":["pad", "buzz-idx", "buzz-amount", "duration"]
|
||||
},
|
||||
|
||||
"service-cpads":{
|
||||
"vars":{"gp-0":"pad-list", "s5-0":"pad-idx", "s4-0":"pad", "s3-0":"buzz-idx", "v1-29":"current-button0"}
|
||||
},
|
||||
|
||||
"default-buffer-init":{
|
||||
"args":["buff"],
|
||||
"vars":{"v1-0":"buff", "v1-1":"buff", "v1-3":"buff", "v1-4":"buff", "a1-4":"tag", "a1-6":"tag2", "a1-8":"data", "a0-1":"tag3", "v1-2":"buff"}
|
||||
},
|
||||
|
||||
"add-reg-gif-packet":{
|
||||
"args":["packet", "reg-idx", "reg-val"],
|
||||
"vars":{"v1-0":"tag"}
|
||||
},
|
||||
|
||||
"(method 0 draw-context)":{
|
||||
"args":["allocation", "type-to-make", "org-x", "org-y", "width", "height", "color-0"]
|
||||
},
|
||||
|
||||
"(method 0 display)":{
|
||||
"args":["allocation", "type-to-make", "psm", "w", "h", "ztest", "zpsm"],
|
||||
"vars":{"gp-0":"obj"}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user