[decomp] get started on game info (#674)

* temp

* menu text

* wip

* recognize handle to process

* more
This commit is contained in:
water111
2021-07-03 16:18:41 -04:00
committed by GitHub
parent bc41241234
commit 784cd5debb
63 changed files with 9250 additions and 2542 deletions
+9
View File
@@ -67,6 +67,15 @@ std::string FieldReverseLookupOutput::Token::print() const {
}
}
bool FieldReverseLookupOutput::has_variable_token() const {
for (const auto& tok : tokens) {
if (tok.kind == Token::Kind::VAR_IDX) {
return true;
}
}
return false;
}
namespace {
void try_reverse_lookup(const FieldReverseLookupInput& input,
+2
View File
@@ -104,6 +104,8 @@ struct FieldReverseLookupOutput {
double total_score = 0.;
TypeSpec result_type;
std::vector<Token> tokens;
bool has_variable_token() const;
};
struct FieldReverseMultiLookupOutput {
+5
View File
@@ -7,6 +7,7 @@
#include "decompiler/ObjectFile/LinkedObjectFile.h"
#include "AtomicOp.h"
#include "OpenGoalMapping.h"
#include "Form.h"
namespace decompiler {
/////////////////////////////
@@ -297,6 +298,8 @@ std::string get_simple_expression_op_name(SimpleExpression::Kind kind) {
return "vector-!2";
case SimpleExpression::Kind::VECTOR_FLOAT_PRODUCT:
return "vector-float*!2";
case SimpleExpression::Kind::SUBU_L32_S7:
return "subu-s7";
default:
assert(false);
return {};
@@ -352,6 +355,8 @@ int get_simple_expression_arg_count(SimpleExpression::Kind kind) {
case SimpleExpression::Kind::VECTOR_MINUS:
case SimpleExpression::Kind::VECTOR_FLOAT_PRODUCT:
return 3;
case SimpleExpression::Kind::SUBU_L32_S7:
return 1;
default:
assert(false);
return -1;
+2 -1
View File
@@ -225,7 +225,8 @@ class SimpleExpression {
PCPYLD,
VECTOR_PLUS,
VECTOR_MINUS,
VECTOR_FLOAT_PRODUCT
VECTOR_FLOAT_PRODUCT,
SUBU_L32_S7, // use SUBU X, src0, s7 to check if lower 32-bits are s7.
};
// how many arguments?
+13 -1
View File
@@ -200,6 +200,8 @@ TP_Type SimpleExpression::get_type(const TypeState& input,
return TP_Type::make_from_ts("vector");
case Kind::VECTOR_FLOAT_PRODUCT:
return TP_Type::make_from_ts("vector");
case Kind::SUBU_L32_S7:
return TP_Type::make_from_ts("int");
default:
throw std::runtime_error("Simple expression cannot get_type: " +
to_form(env.file->labels, env).print());
@@ -672,7 +674,6 @@ TypeState AsmOp::propagate_types_internal(const TypeState& input,
// pextuw t0, r0, gp
if (m_instr.kind == InstructionKind::PEXTUW) {
if (m_src[0] && m_src[0]->reg() == Register(Reg::GPR, Reg::R0)) {
// sponge
assert(m_src[1]);
auto type = dts.ts.lookup_type(result.get(m_src[1]->reg()).typespec());
auto as_bitfield = dynamic_cast<BitFieldType*>(type);
@@ -685,6 +686,17 @@ TypeState AsmOp::propagate_types_internal(const TypeState& input,
}
}
// sllv out, in, r0
if (m_instr.kind == InstructionKind::SLLV && m_src[1]->reg() == Register(Reg::GPR, Reg::R0)) {
auto type = dts.ts.lookup_type(result.get(m_src[0]->reg()).typespec());
auto as_bitfield = dynamic_cast<BitFieldType*>(type);
if (as_bitfield) {
auto field = find_field(dts.ts, as_bitfield, 0, 32, {});
result.get(m_dst->reg()) = TP_Type::make_from_ts(field.type());
return result;
}
}
if (m_dst.has_value()) {
auto kind = m_dst->reg().get_kind();
if (kind == Reg::FPR) {
+2
View File
@@ -1548,6 +1548,8 @@ std::string fixed_operator_to_string(FixedOperatorKind kind) {
return "vector+!";
case FixedOperatorKind::VECTOR_FLOAT_PRODUCT:
return "vector-float*!";
case FixedOperatorKind::L32_NOT_FALSE_CBOOL:
return "l32-false-check";
default:
assert(false);
return "";
+5
View File
@@ -154,6 +154,11 @@ class SimpleExpressionElement : public FormElement {
FormStack& stack,
std::vector<FormElement*>* result,
bool allow_side_effects);
void update_from_stack_subu_l32_s7(const Env& env,
FormPool& pool,
FormStack& stack,
std::vector<FormElement*>* result,
bool allow_side_effects);
void update_from_stack_float_to_int(const Env& env,
FormPool& pool,
FormStack& stack,
+174 -37
View File
@@ -128,6 +128,39 @@ bool is_power_of_two(int in, int* out) {
return false;
}
/*!
* Imagine:
* x = foo
* { // some macro/inlined thing
* read from x
* return x;
* }
*
* and you want to transform it to
* x = some_macro(foo, blah, ...)
*
* this will get you foo (and pop it from the stack), assuming the stack is sitting right after the
* point where the inline thing evaluated foo.
*
* For later book-keeping of reg use, if it gets you something new, it will set found_orig_out,
* and also give you the regaccess for the x of the x = foo.
*
* If you use this, you are responsible for adding code that sets x again.
*/
Form* repop_passthrough_arg(Form* in,
FormStack& stack,
const Env& env,
RegisterAccess* orig_out,
bool* found_orig_out) {
*found_orig_out = false;
auto as_atom = form_as_atom(in);
if (as_atom && as_atom->is_var()) {
return stack.pop_reg(as_atom->var().reg(), {}, env, true, -1, orig_out, found_orig_out);
}
return in;
}
/*!
* Create a form which represents a variable.
*/
@@ -654,7 +687,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
input.stride = 1;
input.base_type = arg1_type.typespec();
auto out = env.dts->ts.reverse_field_lookup(input);
if (out.success) {
if (out.success && out.has_variable_token()) {
// it is. now we have to modify things
// first, look for the index
@@ -673,6 +706,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
tokens.push_back(to_token(tok));
}
}
assert(used_index);
result->push_back(pool.alloc_element<DerefElement>(args.at(1), out.addr_of, tokens));
return;
} else {
@@ -686,7 +720,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
input.stride = arg0_type.get_mult_int_constant();
input.base_type = arg1_type.typespec();
auto out = env.dts->ts.reverse_field_lookup(input);
if (out.success) {
if (out.success && out.has_variable_token()) {
// it is. now we have to modify things
// first, look for the index
int p2;
@@ -710,6 +744,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
tokens.push_back(to_token(tok));
}
}
assert(used_index);
result->push_back(pool.alloc_element<DerefElement>(args.at(1), out.addr_of, tokens));
return;
} else {
@@ -736,6 +771,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
tokens.push_back(to_token(tok));
}
}
assert(used_index);
result->push_back(pool.alloc_element<DerefElement>(args.at(1), out.addr_of, tokens));
return;
} else {
@@ -755,7 +791,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
rd_in.base_type = arg0_type.typespec();
auto rd = env.dts->ts.reverse_field_lookup(rd_in);
if (rd.success) {
if (rd.success && rd.has_variable_token()) {
auto arg1_matcher = Matcher::match_or(
{Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::MULTIPLICATION),
{Matcher::any(0), Matcher::integer(rd_in.stride)}),
@@ -774,6 +810,7 @@ void SimpleExpressionElement::update_from_stack_add_i(const Env& env,
tokens.push_back(to_token(tok));
}
}
assert(used_index);
result->push_back(pool.alloc_element<DerefElement>(args.at(0), rd.addr_of, tokens));
return;
} else {
@@ -1474,6 +1511,28 @@ void SimpleExpressionElement::update_from_stack_float_to_int(const Env& env,
}
}
namespace {
GenericElement* allocate_fixed_op(FormPool& pool, FixedOperatorKind kind, Form* op1) {
return pool.alloc_element<GenericElement>(GenericOperator::make_fixed(kind), op1);
}
} // namespace
void SimpleExpressionElement::update_from_stack_subu_l32_s7(const Env& env,
FormPool& pool,
FormStack& stack,
std::vector<FormElement*>* result,
bool allow_side_effects) {
auto var = m_expr.get_arg(0).var();
auto arg = pop_to_forms({var}, env, pool, stack, allow_side_effects).at(0);
auto type = env.get_types_before_op(var.idx()).get(var.reg()).typespec();
if (type != TypeSpec("handle")) {
env.func->warnings.general_warning(
".subu (32-bit) used on a {} at idx {}. This probably should be a handle.", type.print(),
var.idx());
}
result->push_back(allocate_fixed_op(pool, FixedOperatorKind::L32_NOT_FALSE_CBOOL, arg));
}
void SimpleExpressionElement::update_from_stack(const Env& env,
FormPool& pool,
FormStack& stack,
@@ -1613,6 +1672,9 @@ void SimpleExpressionElement::update_from_stack(const Env& env,
case SimpleExpression::Kind::VECTOR_FLOAT_PRODUCT:
update_from_stack_vector_float_product(env, pool, stack, result, allow_side_effects);
break;
case SimpleExpression::Kind::SUBU_L32_S7:
update_from_stack_subu_l32_s7(env, pool, stack, result, allow_side_effects);
break;
default:
throw std::runtime_error(
fmt::format("SimpleExpressionElement::update_from_stack NYI for {}", to_string(env)));
@@ -2633,6 +2695,108 @@ void CondWithElseElement::push_to_stack(const Env& env, FormPool& pool, FormStac
// ShortCircuitElement
///////////////////
FormElement* sc_to_handle_get_proc(ShortCircuitElement* elt,
const Env& env,
FormPool& pool,
FormStack& stack) {
if (elt->kind != ShortCircuitElement::AND) {
return nullptr;
}
if (elt->entries.size() != 2) {
return nullptr;
}
// fmt::print("candidate: {}\n", elt->to_string(env));
constexpr int reg_input_1 = 0;
constexpr int reg_input_2 = 1;
constexpr int reg_input_3 = 2;
constexpr int reg_temp_1 = 10;
constexpr int reg_temp_2 = 11;
constexpr int reg_temp_3 = 12;
// check first.
auto first_matcher =
Matcher::op(GenericOpMatcher::condition(IR2_Condition::Kind::NONZERO),
{Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::L32_NOT_FALSE_CBOOL),
{Matcher::any_reg(reg_input_1)})});
auto first_result = match(first_matcher, elt->entries.at(0).condition);
if (!first_result.matched) {
return nullptr;
}
// auto first_use_of_in = *first_result.maps.regs.at(reg_input_1);
// fmt::print("reg1: {}\n", first_use_of_in.to_string(env));
auto setup_matcher = Matcher::set_var(
Matcher::deref(Matcher::any_reg(reg_input_2), false,
{DerefTokenMatcher::string("process"), DerefTokenMatcher::integer(0)}),
reg_temp_1);
auto if_matcher = Matcher::if_no_else(
Matcher::op(
GenericOpMatcher::fixed(FixedOperatorKind::EQ),
{Matcher::deref(Matcher::any_reg(reg_input_3), false, {DerefTokenMatcher::string("pid")}),
Matcher::deref(Matcher::any_reg(reg_temp_2), false,
{DerefTokenMatcher::string("pid")})}),
Matcher::any_reg(reg_temp_3));
auto second_matcher = Matcher::begin({setup_matcher, if_matcher});
auto second_result = match(second_matcher, elt->entries.at(1).condition);
if (!second_result.matched) {
return nullptr;
}
auto in1 = *first_result.maps.regs.at(reg_input_1);
auto in2 = *second_result.maps.regs.at(reg_input_2);
auto in3 = *second_result.maps.regs.at(reg_input_3);
auto in_name = in1.to_string(env);
if (in_name != in2.to_string(env)) {
return nullptr;
}
if (in_name != in3.to_string(env)) {
return nullptr;
}
auto temp_name = second_result.maps.regs.at(reg_temp_1)->to_string(env);
if (temp_name != second_result.maps.regs.at(reg_temp_2)->to_string(env)) {
return nullptr;
}
if (temp_name != second_result.maps.regs.at(reg_temp_3)->to_string(env)) {
return nullptr;
}
const auto& temp_use_def = env.get_use_def_info(*second_result.maps.regs.at(reg_temp_1));
if (temp_use_def.use_count() != 2 || temp_use_def.def_count() != 1) {
return nullptr;
}
// modify use def:
auto* menv = const_cast<Env*>(&env);
menv->disable_use(in2);
menv->disable_use(in3);
auto repopped = stack.pop_reg(in1, {}, env, true);
// fmt::print("repopped: {}\n", repopped->to_string(env));
if (!repopped) {
repopped = var_to_form(in1, pool);
}
return pool.alloc_element<GenericElement>(
GenericOperator::make_function(
pool.alloc_single_element_form<ConstantTokenElement>(nullptr, "handle->process")),
repopped);
return nullptr;
}
void ShortCircuitElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stack) {
mark_popped();
if (!used_as_value.value_or(false)) {
@@ -2678,8 +2842,14 @@ void ShortCircuitElement::push_to_stack(const Env& env, FormPool& pool, FormStac
}
}
FormElement* to_push = this;
auto as_handle_get = sc_to_handle_get_proc(this, env, pool, stack);
if (as_handle_get) {
to_push = as_handle_get;
}
assert(used_as_value.has_value());
stack.push_value_to_reg(final_result, pool.alloc_single_form(nullptr, this), true,
stack.push_value_to_reg(final_result, pool.alloc_single_form(nullptr, to_push), true,
env.get_variable_type(final_result, false));
already_rewritten = true;
}
@@ -3844,39 +4014,6 @@ Form* is_load_store_vector_to_reg(const Register& reg,
return mr.maps.forms.at(0);
}
/*!
* Imagine:
* x = foo
* { // some macro/inlined thing
* read from x
* return x;
* }
*
* and you want to transform it to
* x = some_macro(foo, blah, ...)
*
* this will get you foo (and pop it from the stack), assuming the stack is sitting right after the
* point where the inline thing evaluated foo.
*
* For later book-keeping of reg use, if it gets you something new, it will set found_orig_out,
* and also give you the regaccess for the x of the x = foo.
*
* If you use this, you are responsible for adding code that sets x again.
*/
Form* repop_passthrough_arg(Form* in,
FormStack& stack,
const Env& env,
RegisterAccess* orig_out,
bool* found_orig_out) {
*found_orig_out = false;
auto as_atom = form_as_atom(in);
if (as_atom && as_atom->is_var()) {
return stack.pop_reg(as_atom->var().reg(), {}, env, true, -1, orig_out, found_orig_out);
}
return in;
}
/*!
* Try to convert a form to a regaccess.
*/
+47
View File
@@ -137,6 +137,14 @@ Matcher Matcher::set(const Matcher& dst, const Matcher& src) {
return m;
}
Matcher Matcher::set_var(const Matcher& src, int dst_match_id) {
Matcher m;
m.m_kind = Kind::SET_VAR;
m.m_sub_matchers = {src};
m.m_reg_out_id = dst_match_id;
return m;
}
Matcher Matcher::while_loop(const Matcher& condition, const Matcher& body) {
Matcher m;
m.m_kind = Kind::WHILE_LOOP;
@@ -151,6 +159,13 @@ Matcher Matcher::any_constant_token(int match_id) {
return m;
}
Matcher Matcher::begin(const std::vector<Matcher>& elts) {
Matcher m;
m.m_kind = Kind::BEGIN;
m.m_sub_matchers = elts;
return m;
}
bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
switch (m_kind) {
case Kind::ANY:
@@ -527,6 +542,38 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
return true;
} break;
case Kind::BEGIN: {
if ((int)m_sub_matchers.size() != input->size()) {
return false;
}
for (int i = 0; i < input->size(); i++) {
Form fake;
fake.elts().push_back(input->elts().at(i));
if (!m_sub_matchers.at(i).do_match(&fake, maps_out)) {
return false;
}
}
return true;
}
case Kind::SET_VAR: {
auto as_set = dynamic_cast<SetVarElement*>(input->try_as_single_active_element());
if (!as_set) {
return false;
}
if (!m_sub_matchers.at(0).do_match(as_set->src(), maps_out)) {
return false;
}
if (m_reg_out_id != -1) {
maps_out->regs.resize(std::max((int)maps_out->regs.size(), m_reg_out_id + 1));
maps_out->regs.at(m_reg_out_id) = as_set->dst();
}
return true;
}
default:
assert(false);
return false;
+5 -1
View File
@@ -28,7 +28,8 @@ class Matcher {
static Matcher any_label(int match_id = -1);
static Matcher op(const GenericOpMatcher& op, const std::vector<Matcher>& args);
static Matcher op_with_rest(const GenericOpMatcher& op, const std::vector<Matcher>& args);
static Matcher set(const Matcher& dst, const Matcher& src);
static Matcher set(const Matcher& dst, const Matcher& src); // form-form
static Matcher set_var(const Matcher& src, int dst_match_id); // var-form
static Matcher fixed_op(FixedOperatorKind op, const std::vector<Matcher>& args);
static Matcher match_or(const std::vector<Matcher>& args);
static Matcher cast(const std::string& type, Matcher value);
@@ -49,6 +50,7 @@ class Matcher {
static Matcher while_loop(const Matcher& condition, const Matcher& body);
static Matcher any_constant_token(int match_id = -1);
static Matcher or_expression(const std::vector<Matcher>& elts);
static Matcher begin(const std::vector<Matcher>& elts);
enum class Kind {
ANY_REG, // matching any register
@@ -63,6 +65,7 @@ class Matcher {
ANY_SYMBOL,
DEREF_OP,
SET,
SET_VAR,
ANY_LABEL,
SYMBOL,
IF_WITH_ELSE,
@@ -70,6 +73,7 @@ class Matcher {
WHILE_LOOP,
ANY_CONSTANT_TOKEN,
SC_OR,
BEGIN,
INVALID
};
+1
View File
@@ -151,6 +151,7 @@ enum class FixedOperatorKind {
VECTOR_PLUS,
VECTOR_MINUS,
VECTOR_FLOAT_PRODUCT,
L32_NOT_FALSE_CBOOL,
INVALID
};
+14
View File
@@ -723,6 +723,18 @@ std::unique_ptr<AtomicOp> convert_bnel_1(const Instruction& i0, int idx, bool li
return make_branch_no_delay(condition, likely, dest, idx);
}
std::unique_ptr<AtomicOp> convert_subu_1(const Instruction& i0, int idx) {
// subu a2, v1, s7
if (i0.get_src(1).is_reg(rs7())) {
auto src = make_src_atom(i0.get_src(0).get_reg(), idx);
auto expr = SimpleExpression(SimpleExpression::Kind::SUBU_L32_S7, src);
auto dst = make_dst_var(i0.get_dst(0).get_reg(), idx);
return std::make_unique<SetVarOp>(dst, expr, idx);
} else {
return nullptr; // go to asm fallback
}
}
std::unique_ptr<AtomicOp> convert_1(const Instruction& i0, int idx, bool hint_inline_asm) {
switch (i0.kind) {
case InstructionKind::OR:
@@ -856,6 +868,8 @@ std::unique_ptr<AtomicOp> convert_1(const Instruction& i0, int idx, bool hint_in
return convert_beql_1(i0, idx, true);
case InstructionKind::BNEL:
return convert_bnel_1(i0, idx, true);
case InstructionKind::SUBU:
return convert_subu_1(i0, idx); // may fail
default:
return nullptr;
}
+397 -150
View File
@@ -594,10 +594,17 @@
(defenum entity-perm-status
:bitfield #t
:type uint16
(bit-0 0)
(bit-1 1)
(dead 2)
(unknown 5) ;; TODO - task-control::task-cstage::14
(complete 6))
(bit-3 3)
(bit-4 4)
(user-set-from-cstage 5)
(complete 6) ;; wrong!
(bit-7 7)
(real-complete 8)
(bit-9 9)
)
(defenum path-control-flag
:bitfield #t
@@ -624,7 +631,6 @@
(need-reminder 5)
(need-reward-speech 6)
(need-resolution 7)
(*unknown* 999999)
)
(defenum game-task
@@ -749,6 +755,189 @@
(*unknown* 255))
(defenum game-text-id
:type uint32
:bitfield #f
(zero 0)
(sfx-volume #x10a)
(music-volume #x10b)
(speech-volume #x10c)
(language #x10d)
(vibrations #x10e)
(play-hints #x10f)
(center-screen #x110)
(english #x114)
(french #x115)
(german #x116)
(spanish #x117)
(italian #x118)
(japanese #x119)
(aspect-ratio #x125)
(video-mode #x126)
(game-options #x127)
(graphic-options #x128)
(sound-options #x129)
(hidden-power-cell #x12f) ;; why is this here??
(continue-without-saving #x13f)
(back #x13e)
(load-game #x14b)
(save-game #x14c)
(options #x150)
(new-game #x15c)
(ok #x15e)
(exit-demo #x15f)
(quit-game #x16f)
(village1-mayor-money #x200)
(vollage1-uncle-money #x201)
(village1-yakow-herd #x202)
(village1-yakow-return #x203)
(village1-oracle #x204)
(beach-ecorocks #x205)
(beach-flutflut-push #x206)
(beach-flutflut-meet #x207)
(beach-pelican #x208)
(beach-seagull #x209)
(beach-cannon #x20a)
(beach-buzzer #x20b)
(jungle-lurkerm-connect #x20c)
(jungle-tower #x20d)
(jungle-eggtop #x20e)
(jungle-plant #x20f)
(jungle-fishgame #x210)
(misty-muse-catch #x211)
(misty-muse-return #x212)
(misty-boat #x213)
(misty-cannon #x214)
(misty-return-to-pool #x215) ;; task name??
(misty-find-transpad #x216) ;; task name?
(misty-balloon-lurkers #x217)
(village1-level-name #x220)
(beach-level-name #x221)
(jungle-level-name #x222)
(misty-level-name #x223)
(beach-seagull-get #x22e)
(jungle-lurkerm-unblock #x22f)
(jungle-lurkerm-return #x230)
(MISSING-orb-hint #x233)
(beach-gimmie #x262)
(beach-sentinel #x263)
(jungle-canyon-end #x264)
(jungle-temple-door #x265)
(misty-bike-jump #x266)
(misty-eco-challenge #x267)
(village2-gambler-money #x300)
(village2-geologist-money #x301)
(village2-warrior-money #x302)
(village2-oracle-money #x303)
(swamp-tether #x304)
(swamp-flutflut #x307)
(swamp-billy #x309)
(sunken-elevator-raise #x30a)
(sunken-elevator-get-to-roof #x30b)
(sunken-pipe #x30c)
(sunken-climb-tube #x30d) ;; task name?
(sunken-pool #x30e) ;; task name?
(sunken-platforms #x30f)
(rolling-moles #x310)
(rolling-moles-return #x311)
(rolling-robbers #x312)
(rolling-race #x313)
(rolling-race-return #x314)
(rolling-lake #x315)
(rolling-plants #x316)
(unknown-buzzers #x317)
(village2-level-name #x319)
(rolling-level-name #x31b)
(swamp-level-name #x31c)
(sunken-level-name #x31d)
(ogre-level-name #x31e)
(swamp-battle #x321)
(sunken-bottom #x322) ;; task name?
(reach-center #x323) ;; task name?
(rolling-ring-chase-1 #x324)
(rolling-ring-chase-2 #x325)
(village3-miner-money #x400)
(village3-oracle-money #x401)
(snow-ram-3-left #x402)
(snow-ram-2-left #x403)
(snow-ram-1-left #x404)
(snow-fort #x405)
(snow-bunnies #x406)
(snow-open-door #x408) ;; task name?
(cave-robot-climb #x40e)
(cave-dark-climb #x40f) ;; destroy crystals
(cave-gnawers #x410)
(cave-dark-crystals #x411)
(village3-buzzer #x413)
(village3-level-name #x415)
(snowy-level-name #x417)
(cave-level-name #x419)
(lavatube-level-name #x41b)
(snow-eggtop #x421)
(cave-spider-tunnel #x423)
(cave-platforms #x424)
(cave-swing-poles #x426)
(snow-frozen-crate #x42b) ;; task name?
(snow-bumpers #x42c)
(fire-canyon-end #x500)
(fire-canyon-buzzer #x501)
(fire-canyon-level-name #x50c)
(ogre-end #x600)
(ogre-buzzer #x601)
(ogre-boss #x603)
(lavatube-end #x700)
(lavatube-buzzer #x701)
(citadel-buzzer #x800)
(citadel-level-name #x801)
(citadel-sage-blue #x802)
(citadel-sage-red #x803)
(citadel-sage-yellow #x804)
(citadel-sage-green #x805)
(training-gimmie-task-name #x91b)
(training-buzzer-task-name #x91c)
(training-door-task-name #x91d)
(training-climb-task-name #x91e)
(training-level-name #x91f)
(inc #xf10)
(europe #xf11)
)
;; ----------------------
;; File - gstring-h
;; Source Path - kernel/gstring-h.gc
@@ -1374,7 +1563,7 @@
(get-bit (_type_ int) symbol 9)
(clear-bit (_type_ int) int 10)
(set-bit (_type_ int) int 11)
(clear (_type_) _type_ 12)
(clear-all! (_type_) _type_ 12)
)
)
@@ -1921,7 +2110,7 @@
)
(deftype border-plane (basic)
((name basic :offset-assert 4)
((name symbol :offset-assert 4)
(action basic :offset-assert 8)
(slot int8 :offset-assert 12)
(trans vector :inline :offset-assert 16)
@@ -1931,8 +2120,8 @@
:size-assert #x30
:flag-assert #xb00000030
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(debug-draw! (_type_) none 9)
(point-past-plane? (_type_ vector) symbol 10)
)
)
@@ -5142,7 +5331,7 @@
:size-assert #x10
:flag-assert #xa00000010
(:methods
(dummy-9 (_type_ uint symbol) string 9)
(lookup-text! (_type_ game-text-id symbol) string 9)
)
)
@@ -8574,11 +8763,11 @@
)
(deftype continue-point (basic)
((name basic :offset-assert 4)
((name string :offset-assert 4)
(level basic :offset-assert 8)
(flags uint32 :offset-assert 12)
(trans vector :inline :offset-assert 16)
(quat vector :inline :offset-assert 32)
(quat quaternion :inline :offset-assert 32)
(camera-trans vector :inline :offset-assert 48)
(camera-rot float 9 :offset-assert 64)
(load-commands pair :offset-assert 100)
@@ -8592,11 +8781,12 @@
:size-assert #x7c
:flag-assert #xa0000007c
(:methods
(dummy-9 () none 9)
(debug-draw! (_type_) none 9)
)
)
(declare-type entity-perm structure)
(declare-type game-save basic)
(declare-type entity-perm-array basic)
(deftype game-info (basic)
((mode symbol :offset-assert 4)
@@ -8614,7 +8804,7 @@
(current-continue continue-point :offset-assert 108)
(text-ids-seen bit-array :offset-assert 112)
(level-opened uint8 32 :offset-assert 116)
(hint-control array :offset-assert 148)
(hint-control (array level-hint-control) :offset-assert 148)
(task-hint-control array :offset-assert 152)
(total-deaths int32 :offset-assert 156)
(continue-deaths int32 :offset-assert 160)
@@ -8624,9 +8814,9 @@
(death-time uint64 :offset-assert 184)
(hit-time uint64 :offset-assert 192)
(fuel-cell-pickup-time uint64 :offset-assert 200)
(fuel-cell-time array :offset-assert 208)
(enter-level-time array :offset-assert 212)
(in-level-time array :offset-assert 216)
(fuel-cell-time (array uint64) :offset-assert 208)
(enter-level-time (array uint64) :offset-assert 212)
(in-level-time (array uint64) :offset-assert 216)
(blackout-time uint64 :offset-assert 224)
(letterbox-time uint64 :offset-assert 232)
(hint-play-time uint64 :offset-assert 240)
@@ -8634,7 +8824,7 @@
(display-text-handle uint64 :offset-assert 256)
(death-movie-tick int32 :offset-assert 264)
(want-auto-save symbol :offset-assert 268)
(auto-save-proc uint64 :offset-assert 272)
(auto-save-proc handle :offset-assert 272)
(auto-save-status uint32 :offset-assert 280)
(auto-save-card int32 :offset-assert 284)
(auto-save-which int32 :offset-assert 288)
@@ -8649,26 +8839,26 @@
:flag-assert #x1d00000144
;; field dummy is a basic loaded with a signed load
(:methods
(dummy-9 (_type_ symbol symbol string) none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 (_type_ uint) entity-perm 13) ; TODO - not totally confirmed
(dummy-14 (_type_) none 14)
(dummy-15 (_type_) none 15)
(dummy-16 () none 16)
(dummy-17 (_type_) continue-point 17)
(dummy-18 () none 18)
(dummy-19 (_type_ continue-point) none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(initialize! (_type_ symbol game-save string) _type_ 9)
(adjust (_type_ symbol float handle) float 10)
(task-complete? (_type_ game-task) symbol 11)
(lookup-entity-perm-by-aid (_type_ uint) entity-perm 12)
(get-entity-task-perm (_type_ game-task) entity-perm 13)
(copy-perms-from-level! (_type_ level) none 14)
(copy-perms-to-level! (_type_ level) none 15)
(debug-print (_type_ symbol) _type_ 16)
(get-or-create-continue! (_type_) continue-point 17)
(get-continue-by-name (_type_ string) continue-point 18)
(set-continue! (_type_ basic) continue-point 19)
(buzzer-count (_type_ game-task) int 20)
(seen-text? (_type_ game-text-id) symbol 21)
(mark-text-as-seen (_type_ game-text-id) none 22)
(got-buzzer? (_type_ game-task int) symbol 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 () none 28)
(load-game! (_type_ game-save) game-save 25)
(clear-text-seen! (_type_ game-text-id) none 26)
(get-death-count (_type_ symbol) int 27)
(get-health-percent-lost (_type_) float 28)
)
)
@@ -9394,7 +9584,7 @@
(:methods
(new (symbol type process pickup-type float) _type_ 0)
(dummy-9 () none 9)
(dummy-10 (_type_ symbol) none 10)
(reset! (_type_ symbol) none 10)
(dummy-11 (_type_) float 11)
)
)
@@ -12582,14 +12772,14 @@
:size-assert #x10
:flag-assert #xa00000010
(:methods
(dummy-9 () none 9)
(update-perm! (_type_ symbol entity-perm-status) _type_ 9)
)
)
(deftype entity-links (structure)
((prev-link entity-links :offset-assert 0)
(next-link entity-links :offset-assert 4)
(entity basic :offset-assert 8)
(entity entity :offset-assert 8)
(process process :offset-assert 12)
(level level :offset-assert 16)
(vis-id int32 :offset-assert 20)
@@ -12615,7 +12805,7 @@
)
(deftype entity-links-array (inline-array-class)
()
((data entity-links :inline :dynamic :offset-assert 16))
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
@@ -13702,8 +13892,8 @@
)
(deftype task-info-data (basic)
((task-id uint8 :offset-assert 4)
(task-name symbol 4 :offset-assert 8)
((task-id game-task :offset-assert 4)
(task-name game-text-id 4 :offset-assert 8)
(text-index-when-resolved int32 :offset-assert 24)
)
:method-count-assert 9
@@ -13712,7 +13902,7 @@
)
(deftype level-tasks-info (basic)
((level-name-id uint32 :offset-assert 4)
((level-name-id game-text-id :offset-assert 4)
(text-group-index int32 :offset-assert 8)
(nb-of-tasks int32 :offset-assert 12)
(buzzer-task-index int32 :offset-assert 16)
@@ -13725,7 +13915,7 @@
(deftype game-option (basic)
((option-type uint64 :offset-assert 8)
(name uint32 :offset-assert 16)
(name game-text-id :offset-assert 16)
(scale basic :offset-assert 20)
(param1 float :offset-assert 24)
(param2 float :offset-assert 28)
@@ -15880,11 +16070,11 @@
;; - Unknowns
;;(define-extern *global-toggle* object) ;; unknown type
;;(define-extern *part-id-table* object) ;; unknown type
(define-extern *part-id-table* (array sparticle-launcher)) ;; unknown type
;;(define-extern *particle-300hz-timer* object) ;; unknown type
;;(define-extern *sp-launch-queue* object) ;; unknown type
;;(define-extern *death-adgif* object) ;; unknown type
;;(define-extern *part-group-id-table* object) ;; unknown type
(define-extern *part-group-id-table* (array sparticle-launch-group))
;;(define-extern *sp-launcher-lock* object) ;; unknown type
;;(define-extern *sp-launcher-enable* object) ;; unknown type
;;(define-extern *particle-adgif-cache* object) ;; unknown type
@@ -15959,7 +16149,7 @@
(define-extern ja-channel-push! (function int int int))
(define-extern ja-channel-set! (function int int))
(define-extern kill-current-level-hint function)
(define-extern kill-current-level-hint (function pair pair symbol none))
(define-extern level-hint-surpress! function)
(define-extern ja-aframe-num (function int float))
(define-extern ja-abort-spooled-anim function)
@@ -15988,24 +16178,32 @@
;; - Types
(defenum task-flags
:type uint8
:bitfield #t
(closed 0)
(has-entity 1)
(closed-by-default 2)
)
(declare-type task-control basic)
(deftype task-cstage (structure)
((game-task game-task :offset-assert 0)
(status task-status :offset-assert 8)
(flags uint8 :offset-assert 16)
(flags task-flags :offset-assert 16)
(condition (function task-control symbol) :offset-assert 20)
)
:method-count-assert 16
:size-assert #x18
:flag-assert #x1000000018
(:methods
(get-game-task (_type_) uint 9)
(get-task-status (_type_) uint 10)
(TODO-RENAME-11 (_type_ task-control) symbol 11)
(first-flag-bit? (_type_) symbol 12)
(third-flag-bit? (_type_) symbol 13)
(TODO-RENAME-14 (_type_) int 14)
(clear-all-but-first-flag-bit (_type_) int 15)
(get-game-task (_type_) game-task 9)
(get-task-status (_type_) task-status 10)
(task-available? (_type_ task-control) symbol 11)
(closed? (_type_) symbol 12)
(closed-by-default? (_type_) symbol 13)
(close-task! (_type_) int 14)
(open-task! (_type_) int 15)
)
)
@@ -16020,13 +16218,13 @@
(current-task (_type_) int 9)
(current-status (_type_) int 10)
(close-current! (_type_) none 11)
(close-status! (_type_ int) int 12)
(close-status! (_type_ task-status) int 12)
(first-any (_type_ symbol) int 13)
(reset! (_type_ symbol symbol) int 14)
(closed? (_type_ int int) symbol 15)
(closed? (_type_ game-task task-status) symbol 15)
(get-reminder (_type_ int) int 16)
(save-reminder (_type_ int int) int 17) ;; TODO - i believe this is none
(exists? (_type_ int int) symbol 18)
(exists? (_type_ game-task task-status) symbol 18)
)
)
@@ -16123,20 +16321,20 @@
;; - Functions
(define-extern get-task-control (function int task-control))
(define-extern level-hint-spawn function)
(define-extern get-game-count function)
(define-extern activate-orb-all function)
(define-extern close-specific-task! (function task-control int int))
(define-extern reset-all-hint-controls function)
(define-extern reset-actors function)
(define-extern get-task-control (function game-task task-control))
(define-extern level-hint-spawn (function game-text-id string symbol process-tree int none))
(define-extern get-game-count (function int count-info))
(define-extern activate-orb-all (function int int))
(define-extern close-specific-task! (function game-task task-status int))
(define-extern reset-all-hint-controls (function none))
(define-extern reset-actors (function symbol none))
(define-extern set-blackout-frames (function int uint))
(define-extern set-master-mode (function symbol none))
(define-extern stop (function symbol int))
(define-extern start (function symbol continue-point target))
(define-extern position-in-front-of-camera! (function vector float float vector))
(define-extern game-task->string (function int string))
(define-extern trsq->continue-point function)
(define-extern game-task->string (function game-task string))
(define-extern trsq->continue-point (function trsq none))
;; - Symbols
@@ -16145,9 +16343,8 @@
;; - Unknowns
;;(define-extern *level-task-data-remap* object) ;; unknown type
(define-extern *spawn-actors* symbol)
(define-extern *default-continue* symbol)
(define-extern *default-continue* continue-point)
;; ----------------------
@@ -16158,57 +16355,105 @@
;; - Types
; (deftype game-save-tag (structure)
; ((user-object UNKNOWN 2 :offset-assert 0)
; (user-uint64 uint64 :offset-assert 0)
; (user-float0 float :offset-assert 0)
; (user-float UNKNOWN 2 :offset-assert 0)
; (user-int32 UNKNOWN 2 :offset-assert 0)
; (user-uint32 UNKNOWN 2 :offset-assert 0)
; (user-int16 UNKNOWN 4 :offset-assert 0)
; (user-uint16 UNKNOWN 4 :offset-assert 0)
; (user-int8 UNKNOWN 8 :offset-assert 0)
; (user-int80 int8 :offset-assert 0)
; (user-int81 int8 :offset-assert 1)
; (user-uint8 UNKNOWN 8 :offset-assert 0)
; (elt-count int32 :offset-assert 8)
; (elt-size uint16 :offset-assert 12)
; (elt-type uint16 :offset-assert 14)
; )
; :method-count-assert 9
; :size-assert #x10
; :flag-assert #x900000010
; )
(defenum game-save-elt
:type uint16
(name 100)
(base-time 101)
(real-time 102)
(game-time 103)
(integral-time 104)
(continue 200)
(life 201)
(money 202)
(money-total 203)
(moeny-per-level 204)
(buzzer-total 205)
(fuel-cell 206)
(death-movie-tick 207)
(task-list 300)
(perm-list 301)
(hint-list 303)
(text-list 304)
(level-open-list 305)
(total-deaths 400)
(continue-deaths 401)
(fuel-cell-deaths 402)
(game-start-time 403)
(continue-timke 404) ;; typo in game
(death-time 405)
(hit-time 406)
(fuel-cell-pickup-time 407)
(continue-time 408)
(fuel-cell-time 409)
(enter-level-time 410)
(deaths-per-level 411)
(death-pos 412)
(auto-save-count 413)
(in-level-time 414)
(sfx-volume 500)
(music-volume 501)
(dialog-volume 502)
(language 503)
(screenx 504)
(screeny 505)
(vibration 506)
(play-hints 507)
(video-mode 508)
(aspect-ratio 509)
)
; (deftype game-save (basic)
; ((version int32 :offset-assert 4)
; (allocated-length int32 :offset-assert 8)
; (length int32 :offset-assert 12)
; (info-int32 UNKNOWN 16 :offset-assert 16)
; (info-int8 UNKNOWN 64 :offset-assert 16)
; (level-index int32 :offset-assert 16)
; (fuel-cell-count float :offset-assert 20)
; (money-count float :offset-assert 24)
; (buzzer-count float :offset-assert 28)
; (completion-percentage float :offset-assert 32)
; (minute uint8 :offset-assert 36)
; (hour uint8 :offset-assert 37)
; (week uint8 :offset-assert 38)
; (day uint8 :offset-assert 39)
; (month uint8 :offset-assert 40)
; (year uint8 :offset-assert 41)
; (new-game int32 :offset-assert 44)
; (tag UNKNOWN :dynamic :offset-assert 80)
; )
; :method-count-assert 12
; :size-assert #x50
; :flag-assert #xc00000050
; (:methods
; (dummy-9 () none 9)
; (dummy-10 () none 10)
; (dummy-11 () none 11)
; )
; )
(deftype game-save-tag (structure)
((user-object object 2 :offset-assert 0)
(user-uint64 uint64 :offset 0)
(user-float0 float :offset 0)
(user-float float 2 :offset 0)
(user-int32 int32 2 :offset 0)
(user-uint32 uint32 2 :offset 0)
(user-int16 int16 4 :offset 0)
(user-uint16 uint16 4 :offset 0)
(user-int8 int8 8 :offset 0)
(user-int80 int8 :offset 0)
(user-int81 int8 :offset 1)
(user-uint8 uint8 8 :offset 0)
(elt-count int32 :offset-assert 8)
(elt-size uint16 :offset-assert 12)
(elt-type game-save-elt :offset-assert 14)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(deftype game-save (basic)
((version int32 :offset-assert 4)
(allocated-length int32 :offset-assert 8)
(length int32 :offset-assert 12)
(info-int32 int32 16 :offset-assert 16)
(info-int8 int8 64 :offset 16)
(level-index int32 :offset 16)
(fuel-cell-count float :offset 20)
(money-count float :offset 24)
(buzzer-count float :offset 28)
(completion-percentage float :offset 32)
(minute uint8 :offset 36)
(hour uint8 :offset 37)
(week uint8 :offset 38)
(day uint8 :offset 39)
(month uint8 :offset 40)
(year uint8 :offset 41)
(new-game int32 :offset 44)
(tag game-save-tag :inline :dynamic :offset-assert 80)
)
:method-count-assert 12
:size-assert #x50
:flag-assert #xc00000050
(:methods
(new (symbol type int) _type_ 0)
(save-to-file (_type_ string) _type_ 9)
(load-from-file! (_type_ string) _type_ 10)
(debug-print (_type_ symbol) _type_ 11)
)
)
(deftype auto-save (process)
((card int32 :offset-assert 112)
@@ -16248,19 +16493,19 @@
(define-extern progress-allowed? (function symbol))
(define-extern print-game-text (function string font-context symbol int int float)) ; TODO decomp error, this seems correct though
(define-extern get-aspect-ratio (function symbol))
(define-extern get-task-status (function task-control int))
(define-extern get-task-status (function game-task task-status))
(define-extern lookup-level-info (function symbol level-load-info))
(define-extern calculate-completion function)
(define-extern game-save-elt->string function)
(define-extern progress-level-index->string function)
(define-extern game-save-elt->string (function game-save-elt string))
(define-extern progress-level-index->string (function int string))
(define-extern auto-save-post function)
(define-extern auto-save-check function)
;; - Unknowns
;;(define-extern *auto-save-info* object) ;; unknown type
(define-extern *auto-save-info* mc-slot-info) ;; unknown type
;;(define-extern scf-get-time object) ;; unknown type
;;(define-extern *level-task-data* object) ;; unknown type
;; ;; unknown type
;; ----------------------
@@ -18232,7 +18477,7 @@
(define-extern hide-bottom-hud function)
(define-extern ambient-hint-init-by-other function)
(define-extern level-hint-process-cmd function)
(define-extern task-known? (function task-control symbol))
(define-extern task-known? (function game-task symbol))
(define-extern can-grab-display? function)
(define-extern level-hint-displayed? function)
(define-extern ambient-inspect function)
@@ -18890,7 +19135,7 @@
(define-extern target-hit-push function)
(define-extern velocity-set-to-target! function)
(define-extern start-sequence-a function)
(define-extern task-closed? (function int int symbol))
(define-extern task-closed? (function game-task task-status symbol))
(define-extern next-level function)
;; - Unknowns
@@ -19803,15 +20048,15 @@
;; - Functions
(define-extern task-status->string (function int string))
(define-extern open-specific-task! (function task-control int int))
(define-extern task-exists? (function task-control int symbol))
(define-extern task-status->string (function task-status string))
(define-extern open-specific-task! (function game-task task-status int))
(define-extern task-exists? (function game-task task-status symbol))
(define-extern sages-kidnapped? (function symbol))
;; - Symbols
(define-extern *null-task-control* task-control)
(define-extern *task-controls* (array task-control))
(define-extern *task-controls* (array basic))
(define-extern *assistant-tasks* task-control)
(define-extern *assistant-village2-tasks* task-control)
(define-extern *gambler-tasks* task-control)
@@ -20357,28 +20602,30 @@
;; Containing DGOs - ['GAME', 'ENGINE']
;; Version - 3
;; - Unknowns
;; - Symbols
;;(define-extern *main-options* object) ;; unknown type
;;(define-extern *title* object) ;; unknown type
;;(define-extern *options* object) ;; unknown type
;;(define-extern *main-options-demo* object) ;; unknown type
;;(define-extern *main-options-demo-shared* object) ;; unknown type
;;(define-extern *game-options* object) ;; unknown type
;;(define-extern *game-options-japan* object) ;; unknown type
;;(define-extern *game-options-demo* object) ;; unknown type
;;(define-extern *graphic-options* object) ;; unknown type
;;(define-extern *graphic-title-options-pal* object) ;; unknown type
;;(define-extern *sound-options* object) ;; unknown type
;;(define-extern *yes-no-options* object) ;; unknown type
;;(define-extern *ok-options* object) ;; unknown type
;;(define-extern *load-options* object) ;; unknown type
;;(define-extern *save-options* object) ;; unknown type
;;(define-extern *save-options-title* object) ;; unknown type
;;(define-extern *options-remap* object) ;; unknown type
;;(define-extern *language-name-remap* object) ;; unknown type
;;(define-extern *task-egg-starting-x* object) ;; unknown type
;;(define-extern *game-counts* object) ;; unknown type
(define-extern *main-options* (array game-option))
(define-extern *title* (array game-option))
(define-extern *options* (array game-option))
(define-extern *main-options-demo* (array game-option))
(define-extern *main-options-demo-shared* (array game-option))
(define-extern *game-options* (array game-option))
(define-extern *game-options-japan* (array game-option))
(define-extern *game-options-demo* (array game-option))
(define-extern *graphic-options* (array game-option))
(define-extern *graphic-title-options-pal* (array game-option))
(define-extern *sound-options* (array game-option))
(define-extern *yes-no-options* (array game-option))
(define-extern *ok-options* (array game-option))
(define-extern *load-options* (array game-option))
(define-extern *save-options* (array game-option))
(define-extern *save-options-title* (array game-option))
(define-extern *options-remap* (array array))
(define-extern *language-name-remap* (array game-text-id))
(define-extern *task-egg-starting-x* (array int32))
(define-extern *game-counts* game-count-info)
(define-extern *level-task-data-remap* (array int32))
(define-extern *level-task-data* (array level-tasks-info))
;; ----------------------
@@ -505,5 +505,9 @@
[496, "(function task-control symbol)"]
],
"game-info": [
[17, "(function symbol symbol continue-point symbol none)"]
],
"placeholder-do-not-add-below": []
}
@@ -471,7 +471,8 @@
"(method 12 level)",
"update-sound-banks",
"(method 16 level-group)",
"bg"
"bg",
"(method 18 game-info)"
],
// If format is used with the wrong number of arguments,
@@ -584,7 +584,7 @@
],
"task-control": [
["L634", "(array task-control)", true],
["L634", "(array basic)", true],
["L1322", "task-control", true],
["L1297", "task-control", true],
["L1103", "task-control", true],
@@ -1092,6 +1092,44 @@
["L560", "_lambda_", true]
],
"game-info": [
["L466", "float", true],
["L467", "float", true],
["L468", "rgba", true],
["L470", "rgba", true],
["L185", "float", true],
["L186", "float", true],
["L191", "float", true],
["L183", "continue-point", true],
["L154", "_lambda_", true],
["L464", "vector2h", true],
["L469", "rgba", true]
],
"progress-static": [
["L2", "(array int32)", true],
["L3", "(array level-tasks-info)", true],
["L121", "(array game-text-id)", true],
["L122", "(array int32)", true],
["L123", "(array array)", true],
["L124", "(array game-option)", true],
["L131", "(array game-option)", true],
["L137", "(array game-option)", true],
["L143", "(array game-option)", true],
["L145", "(array game-option)", true],
["L147", "(array game-option)", true],
["L152", "(array game-option)", true],
["L157", "(array game-option)", true],
["L161", "(array game-option)", true],
["L165", "(array game-option)", true],
["L169", "(array game-option)", true],
["L174", "(array game-option)", true],
["L180", "(array game-option)", true],
["L185", "(array game-option)", true],
["L190", "(array game-option)", true],
["L195", "(array game-option)", true]
],
// please do not add things after this entry! git is dumb.
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
}
@@ -394,17 +394,20 @@
[32, "tracking-spline-sampler"]
],
"draw-ocean-transition": [
[16, "sphere"]
],
"draw-ocean-transition": [[16, "sphere"]],
"(method 22 level)": [[16, "event-message-block"]],
"(method 9 level)": [[16, "event-message-block"]],
"(method 10 load-state)": [[16, "event-message-block"]],
"draw-joint-spheres": [[16, "vector"]],
"(method 16 process-drawable)": [[16, "matrix"], [80, "matrix"], [144, "vector"], [160, "vector"]],
"(method 16 process-drawable)": [
[16, "matrix"],
[80, "matrix"],
[144, "vector"],
[160, "vector"]
],
"draw-ocean-transition": [[16, "sphere"]],
"(anon-function 494 task-control)": [[16, "event-message-block"]],
@@ -440,5 +443,10 @@
"(anon-function 286 task-control)": [[16, "event-message-block"]],
"(anon-function 227 task-control)": [[16, "event-message-block"]],
"(anon-function 38 task-control)": [[16, "event-message-block"]],
"(anon-function 28 task-control)": [[16, "event-message-block"]]
"(anon-function 28 task-control)": [[16, "event-message-block"]],
"(method 10 border-plane)": [[16, "vector"]],
"(method 9 game-info)": [[16, "event-message-block"]],
"(method 9 continue-point)": [[16, "vector"]],
"(method 9 game-save)": [[16, "file-stream"]],
"(method 10 game-save)": [[16, "file-stream"]]
}
@@ -46,12 +46,6 @@
[243, "gp", "(array basic)"]
],
// GKERNEL-H
"(method 2 handle)": [
[10, "a2", "(pointer process)"],
[11, "a3", "process"]
],
// GKERNEL
"(method 0 cpu-thread)": [[[13, 28], "v0", "cpu-thread"]],
@@ -814,6 +808,11 @@
[165, "v1", "symbol"]
],
"task-control-reset": [
[[7, 13], "a0", "task-control"],
[[17, 21], "a0", "task-control"]
],
"(anon-function 494 task-control)": [[32, "v0", "float"]],
"(anon-function 493 task-control)": [[32, "v0", "float"]],
"(anon-function 480 task-control)": [[13, "v0", "float"]],
@@ -885,5 +884,68 @@
"(anon-function 38 task-control)": [[13, "v0", "float"]],
"(anon-function 28 task-control)": [[13, "v0", "float"]],
"(method 18 game-info)": [
[4, "v1", "symbol"],
[5, "v1", "level-load-info"],
[10, "s3", "continue-point"]
],
"(method 9 game-info)": [
[[270, 286], "s2", "(function cpu-thread function object object object object pointer)"]
],
"(method 25 game-info)" :[
[4, "v1", "game-save-tag"],
[53, "v1", "pointer"],
[[7, 53], "v1", "game-save-tag"],
[[72, 138], "s4", "game-save-tag"],
[154, "s4", "pointer"],
[[166, 205], "s4", "game-save-tag"],
[206, "s4", "pointer"],
[498, "s4", "pointer"],
[207, "a1", "(pointer uint8)"],
[[219, 220], "s4", "game-save-tag"],
[223, "s4", "pointer"],
[224, "a1", "(pointer uint8)"],
[[235, 236], "s4", "game-save-tag"],
[249, "s4", "pointer"],
[[261, 262], "s4", "game-save-tag"],
[275, "s4", "pointer"],
[293, "s4", "game-save-tag"],
[302, "s4", "pointer"],
[303, "a2", "(pointer uint8)"],
[315, "s4", "game-save-tag"],
[319, "s4", "pointer"],
[343, "v1", "(pointer uint8)"],
[352, "v1", "(pointer uint8)"],
[[360, 420], "s4", "game-save-tag"],
[423, "s4", "pointer"],
[424, "a1", "(pointer uint8)"],
[436, "s4", "game-save-tag"],
[440, "s4", "pointer"],
[456, "s4", "game-save-tag"],
[460, "s4", "pointer"],
[476, "s4", "game-save-tag"],
[480, "s4", "pointer"],
[[493, 495], "s4", "game-save-tag"]
],
"(method 11 game-save)": [
[126, "v1", "pointer"],
[213, "s4", "pointer"],
[[74, 88], "s4", "game-save-tag"],
[98, "s4", "pointer"],
[107, "s4", "game-save-tag"],
[125, "s4", "(pointer uint8)"],
[131, "s4", "game-save-tag"],
[155, "s4", "game-save-tag"],
[148, "s4", "pointer"],
[172, "s4", "pointer"],
[179, "s4", "game-save-tag"],
[196, "s4", "pointer"],
[[203, 210], "s4", "game-save-tag"]
],
"placeholder-do-not-add-below": []
}
@@ -1253,15 +1253,15 @@
},
"texture-page-dir-inspect": {
"args":["dir", "mode"],
"args": ["dir", "mode"],
"vars": {
"v1-0":"pool",
"s4-0":"level-idx",
"a1-3":"lev",
"s4-1":"entry-idx",
"s3-0":"entry-page",
"s2-0":"entry-link",
"s1-0":"entry-list-length"
"v1-0": "pool",
"s4-0": "level-idx",
"a1-3": "lev",
"s4-1": "entry-idx",
"s3-0": "entry-page",
"s2-0": "entry-link",
"s1-0": "entry-list-length"
}
},
@@ -2100,13 +2100,13 @@
"level-update-after-load": {
"args": ["loaded-level", "level-login-state"],
"vars": {
"s3-0":"level-drawable-trees",
"s5-0":"initial-timer",
"v1-4":"current-timer",
"v1-5":"elapsed-timer",
"s2-0":"current-login-pos",
"s2-1":["current-drawable", "drawable-tree"],
"s1-0":"idx-in-drawable"
"s3-0": "level-drawable-trees",
"s5-0": "initial-timer",
"v1-4": "current-timer",
"v1-5": "elapsed-timer",
"s2-0": "current-login-pos",
"s2-1": ["current-drawable", "drawable-tree"],
"s1-0": "idx-in-drawable"
}
},
@@ -2115,28 +2115,99 @@
"s3-0": ["conn", "connection"]
}
},
"(method 12 level)": {
"vars": {
"s5-3": ["s5-3", "pair"]
}
},
"update-sound-banks": {
"vars": {
"t0-0": ["t0-0", "symbol"]
}
},
"(method 16 level-group)": {
"vars": {
"s1-0": ["s1-0", "continue-point"]
}
},
"(method 20 level)": {
"vars": {
"s3-0": ["s3-0", "ramdisk-rpc-fill"]
}
},
"(method 9 game-info)": {
"args": ["obj", "cause", "save-to-load", "continue-point-override"],
"vars": {
"v1-0": "selected-cause",
"s4-1": "lev-info"
}
},
"(method 10 game-info)": {
"args": ["obj", "item", "amount", "source"],
"vars": {
"v1-10":"proc",
"s4-1":"level-idx",
"a0-35":"buzz-task",
"s4-2":"buzz-index",
"f30-0":"buzz-count",
"s3-0":"ctrl",
"s5-2":"buzz-bits"
}
},
"(method 14 game-info)": {
"args":["obj", "lev"],
"vars": {
"s5-0":"perms",
"s4-0":"lev-entities",
"s3-0":"lev-entity-idx",
"s2-0":"lev-entity-perm",
"v1-8":"info-entity-perm"
}
},
"(method 15 game-info)": {
"args":["obj", "lev"],
"vars": {
"s5-0":"lev-entities",
"s4-0":"lev-entity-idx",
"s3-0":"lev-entity-perm",
"v1-7":"info-entity-perm"
}
},
"(method 25 game-info)": {
"args": ["obj", "save"],
"vars": {
"v1-0": ["save-data", "game-save-tag"],
"s4-0": ["data", "game-save-tag"],
"v1-9": "old-base-frame",
"v1-10": "frame-counter-diff"
}
},
"(method 10 game-save)": {
"args": ["obj", "filename"],
"vars": {
"s5-0": "stream",
"s3-0": "in-size",
"s4-0": "my-size"
}
},
"(method 11 game-save)": {
"args": ["obj", "detail"],
"vars": {
"s4-0": ["tag", "game-save-tag"],
"s3-0": "tag-idx",
"s2-1":"prog-lev-idx",
"a2-13":"lev-name"
}
}
}
+17 -8
View File
@@ -164,7 +164,11 @@ goos::Object decompile_at_label(const TypeSpec& type,
}
if (ts.tc(TypeSpec("array"), type)) {
return decompile_boxed_array(label, labels, words, ts, file);
std::optional<TypeSpec> content_type_spec;
if (type.has_single_arg()) {
content_type_spec = type.get_single_arg();
}
return decompile_boxed_array(label, labels, words, ts, file, content_type_spec);
}
if (ts.tc(TypeSpec("structure"), type)) {
@@ -522,10 +526,10 @@ goos::Object decompile_structure(const TypeSpec& type,
} else if (word.kind == LinkedWord::EMPTY_PTR) {
array_def.push_back(pretty_print::to_symbol("'()"));
} else {
throw std::runtime_error(
fmt::format("Field {} in type {} offset {} did not have a proper reference for "
"array element {}",
field.name(), actual_type.print(), field.offset(), elt));
throw std::runtime_error(fmt::format(
"Field {} in type {} offset {} did not have a proper reference for "
"array element {} k = {}",
field.name(), actual_type.print(), field.offset(), elt, (int)word.kind));
}
}
field_defs_out.emplace_back(field.name(), pretty_print::build_list(array_def));
@@ -715,7 +719,8 @@ goos::Object decompile_boxed_array(const DecompilerLabel& label,
const std::vector<DecompilerLabel>& labels,
const std::vector<std::vector<LinkedWord>>& words,
const TypeSystem& ts,
const LinkedObjectFile* file) {
const LinkedObjectFile* file,
const std::optional<TypeSpec>& content_type_override) {
TypeSpec content_type;
auto type_ptr_word_idx = (label.offset / 4) - 1;
if ((label.offset % 8) == 4) {
@@ -737,6 +742,10 @@ goos::Object decompile_boxed_array(const DecompilerLabel& label,
throw std::runtime_error("Invalid alignment in decompile_boxed_array");
}
if (content_type_override) {
content_type = *content_type_override;
}
// now get the size
auto& size_word_1 = words.at(label.target_segment).at(type_ptr_word_idx + 1);
auto& size_word_2 = words.at(label.target_segment).at(type_ptr_word_idx + 2);
@@ -1057,7 +1066,7 @@ std::string decompile_int_enum_from_int(const TypeSpec& type, const TypeSystem&
}
}
throw std::runtime_error(
fmt::format("Failed to decompile integer enum. Value {} wasn't found in enum {}", value,
type_info->get_name()));
fmt::format("Failed to decompile integer enum. Value {} (0x{:x}) wasn't found in enum {}",
value, value, type_info->get_name()));
}
} // namespace decompiler
+2 -1
View File
@@ -49,7 +49,8 @@ goos::Object decompile_boxed_array(const DecompilerLabel& label,
const std::vector<DecompilerLabel>& labels,
const std::vector<std::vector<LinkedWord>>& words,
const TypeSystem& ts,
const LinkedObjectFile* file);
const LinkedObjectFile* file,
const std::optional<TypeSpec>& content_type_override);
goos::Object decompile_value(const TypeSpec& type,
const std::vector<u8>& bytes,
const TypeSystem& ts);
@@ -16,3 +16,5 @@
(define-perm *camera* camera-master #f)
(define-perm *camera-combiner* camera-combiner #f)
(define-perm *camera-orbit-target* process-drawable #f)
(define-extern position-in-front-of-camera! (function vector float float vector))
@@ -93,3 +93,6 @@
:flag-assert #x900002004
)
(define-extern kill-current-level-hint (function pair pair symbol none))
(define-extern level-hint-spawn (function game-text-id string symbol process-tree int none))
+16 -6
View File
@@ -17,10 +17,17 @@
(defenum entity-perm-status
:bitfield #t
:type uint16
(bit-0 0)
(bit-1 1)
(dead 2)
(unknown 5) ;; TODO - task-control::task-cstage::14
(complete 6))
(bit-3 3)
(bit-4 4)
(user-set-from-cstage 5)
(complete 6)
(bit-7 7)
(real-complete 8)
(bit-9 9)
)
;; definition of type entity-perm
(deftype entity-perm (structure)
@@ -44,15 +51,15 @@
:size-assert #x10
:flag-assert #xa00000010
(:methods
(dummy-9 () none 9)
)
(update-perm! (_type_ symbol entity-perm-status) _type_ 9)
)
)
;; definition of type entity-links
(deftype entity-links (structure)
((prev-link entity-links :offset-assert 0)
(next-link entity-links :offset-assert 4)
(entity basic :offset-assert 8)
(entity entity :offset-assert 8)
(process process :offset-assert 12)
(level level :offset-assert 16)
(vis-id int32 :offset-assert 20)
@@ -82,7 +89,8 @@
;; definition of type entity-links-array
(deftype entity-links-array (inline-array-class)
()
((data entity-links :inline :dynamic :offset-assert 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
@@ -220,3 +228,5 @@
(defun-extern entity-by-name string entity)
(defun-extern entity-by-type type entity-actor)
(defun-extern entity-by-aid uint entity)
(define-extern reset-actors (function symbol none))
(define-extern *spawn-actors* symbol)
+18 -2
View File
@@ -5,6 +5,18 @@
;; name in dgo: entity-table
;; dgos: GAME, ENGINE
;; The *entity-info* table contains some simple information that can be used to
;; spawn a process for an entity.
;; :ptype the type of the process
;; :package the package that must be loaded (not used?)
;; :art-group the art that must be loaded
;; :pool the pool that the process should be allocated from
;; :heap-size the required size for the process heap
;; At one point, this was much bigger, but got smaller between
;; the demo and final build. The entity info is possibly stored somewhere else
;; and this may not even be used.
(define *entity-info*
(new 'static 'boxed-array :type entity-info :length 19 :allocated-length 19
(new 'static 'entity-info
@@ -155,20 +167,24 @@
(the-as entity-info
(cond
((nonzero? (-> arg0 method-table 13))
;; we already cached the type in the method table
(-> arg0 method-table 13)
)
(else
;; search the table
(let ((v1-1 *entity-info*))
(dotimes (a1-0 (-> v1-1 length))
(when (= arg0 (-> v1-1 a1-0 ptype))
(set!
(-> arg0 method-table 13)
;; found it, cache it in the method table
(set! (-> arg0 method-table 13)
(the-as function (-> v1-1 a1-0))
)
(return (-> v1-1 a1-0))
)
)
)
;; didn't find it, cache and return #f
(set! (-> arg0 method-table 13) #f)
#f
)
+2 -2
View File
@@ -95,7 +95,7 @@
(:methods
(new (symbol type process pickup-type float) _type_ 0)
(dummy-9 () none 9)
(dummy-10 (_type_ symbol) none 10)
(reset! (_type_ symbol) none 10)
(dummy-11 (_type_) float 11)
)
)
@@ -230,7 +230,7 @@
"Create information about target. Not sure why this has stuff like pickup-type."
(let ((obj (the-as fact-info-target ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2))))
(set! (-> obj eco-source) (the-as uint #f))
(dummy-10 obj #f)
(reset! obj #f)
obj
)
)
+207 -73
View File
@@ -5,6 +5,130 @@
; ;; name in dgo: game-info-h
; ;; dgos: GAME, ENGINE
;; List of each task in the game.
;; Each task has a task-control associated with it, see task-control.gc
(defenum game-task
:type uint8
(none 0)
(complete 1)
(jungle-eggtop 2)
(jungle-lurkerm 3)
(jungle-tower 4)
(jungle-fishgame 5)
(jungle-plant 6)
(jungle-buzzer 7)
(jungle-canyon-end 8)
(jungle-temple-door 9)
(village1-yakow 10)
(village1-mayor-money 11)
(village1-uncle-money 12)
(village1-oracle-money1 13)
(village1-oracle-money2 14)
(beach-ecorocks 15)
(beach-pelican 16)
(beach-flutflut 17)
(beach-seagull 18)
(beach-cannon 19)
(beach-buzzer 20)
(beach-gimmie 21)
(beach-sentinel 22)
(misty-muse 23)
(misty-boat 24)
(misty-warehouse 25)
(misty-cannon 26)
(misty-bike 27)
(misty-buzzer 28)
(misty-bike-jump 29)
(misty-eco-challenge 30)
(village2-gambler-money 31)
(village2-geologist-money 32)
(village2-warrior-money 33)
(village2-oracle-money1 34)
(village2-oracle-money2 35)
(swamp-billy 36)
(swamp-flutflut 37)
(swamp-battle 38)
(swamp-tether-1 39)
(swamp-tether-2 40)
(swamp-tether-3 41)
(swamp-tether-4 42)
(swamp-buzzer 43)
(sunken-platforms 44)
(sunken-pipe 45)
(sunken-slide 46)
(sunken-room 47)
(sunken-sharks 48)
(sunken-buzzer 49)
(sunken-top-of-helix 50)
(sunken-spinning-room 51)
(rolling-race 52)
(rolling-robbers 53)
(rolling-moles 54)
(rolling-plants 55)
(rolling-lake 56)
(rolling-buzzer 57)
(rolling-ring-chase-1 58)
(rolling-ring-chase-2 59)
(snow-eggtop 60)
(snow-ram 61)
(snow-fort 62)
(snow-ball 63)
(snow-bunnies 64)
(snow-buzzer 65)
(snow-bumpers 66)
(snow-cage 67)
(firecanyon-buzzer 68)
(firecanyon-end 69)
(citadel-sage-green 70)
(citadel-sage-blue 71)
(citadel-sage-red 72)
(citadel-sage-yellow 73)
(village3-extra1 74)
(village1-buzzer 75)
(village2-buzzer 76)
(village3-buzzer 77)
(cave-gnawers 78)
(cave-dark-crystals 79)
(cave-dark-climb 80)
(cave-robot-climb 81)
(cave-swing-poles 82)
(cave-spider-tunnel 83)
(cave-platforms 84)
(cave-buzzer 85)
(ogre-boss 86)
(ogre-end 87)
(ogre-buzzer 88)
(lavatube-end 89)
(lavatube-buzzer 90)
(citadel-buzzer 91)
(training-gimmie 92)
(training-door 93)
(training-climb 94)
(training-buzzer 95)
(village3-miner-money1 96)
(village3-miner-money2 97)
(village3-miner-money3 98)
(village3-miner-money4 99)
(village3-oracle-money1 100)
(village3-oracle-money2 101)
(firecanyon-assistant 102)
(village2-levitator 103)
(swamp-arm 104)
(village3-button 105)
(red-eggtop 106)
(lavatube-balls 107)
(lavatube-start 108)
(intro 109)
(ogre-secret 110)
(village4-button 111)
(finalboss-movies 112)
(plunger-lurker-hit 113)
(leaving-misty 114)
(assistant-village3 115)
(max 116)
(*unknown* 255))
;; Game parameters.
(deftype game-bank (basic)
((life-max-default float :offset-assert 4)
(life-start-default float :offset-assert 8)
@@ -26,16 +150,18 @@
)
)
;; aid
(deftype actor-id (uint32)
()
:flag-assert #x900000004
)
;; the possible state for a level.
(deftype level-buffer-state (structure)
((name basic :offset-assert 0)
(display? symbol :offset-assert 4)
(force-vis? symbol :offset-assert 8)
(force-inside? symbol :offset-assert 12)
((name basic :offset-assert 0) ;; level name
(display? symbol :offset-assert 4) ;; should it be drawn?
(force-vis? symbol :offset-assert 8) ;; ? should it have its vis loaded?
(force-inside? symbol :offset-assert 12) ;; ?
)
:pack-me
:method-count-assert 9
@@ -76,12 +202,15 @@
)
)
(define-extern *load-state* load-state)
;; a game checkpoint
(deftype continue-point (basic)
((name basic :offset-assert 4)
((name string :offset-assert 4)
(level basic :offset-assert 8)
(flags uint32 :offset-assert 12)
(trans vector :inline :offset-assert 16)
(quat vector :inline :offset-assert 32)
(quat quaternion :inline :offset-assert 32)
(camera-trans vector :inline :offset-assert 48)
(camera-rot float 9 :offset-assert 64)
(load-commands pair :offset-assert 100)
@@ -95,84 +224,87 @@
:size-assert #x7c
:flag-assert #xa0000007c
(:methods
(dummy-9 () none 9)
(debug-draw! (_type_) none 9)
)
)
(declare-type entity-perm structure)
(declare-type entity-perm-array basic)
(declare-type game-save basic)
;; Game Info is the full state of the game
;; this information can be saved/loaded from a game save.
;; also, it must be manually synchronized with entity permanent state in the levels
(deftype game-info (basic)
((mode symbol :offset-assert 4)
(save-name basic :offset-assert 8)
(life float :offset-assert 12)
(life-max float :offset-assert 16)
(money float :offset-assert 20)
(money-total float :offset-assert 24)
(money-per-level uint8 32 :offset-assert 28)
(deaths-per-level uint8 32 :offset-assert 60)
(buzzer-total float :offset-assert 92)
(fuel float :offset-assert 96)
(perm-list entity-perm-array :offset-assert 100)
(task-perm-list entity-perm-array :offset-assert 104)
(current-continue continue-point :offset-assert 108)
(text-ids-seen bit-array :offset-assert 112)
(level-opened uint8 32 :offset-assert 116)
(hint-control array :offset-assert 148)
(task-hint-control array :offset-assert 152)
(total-deaths int32 :offset-assert 156)
(continue-deaths int32 :offset-assert 160)
(fuel-cell-deaths int32 :offset-assert 164)
(game-start-time uint64 :offset-assert 168)
(continue-time uint64 :offset-assert 176)
(death-time uint64 :offset-assert 184)
(hit-time uint64 :offset-assert 192)
(fuel-cell-pickup-time uint64 :offset-assert 200)
(fuel-cell-time array :offset-assert 208)
(enter-level-time array :offset-assert 212)
(in-level-time array :offset-assert 216)
(blackout-time uint64 :offset-assert 224)
(letterbox-time uint64 :offset-assert 232)
(hint-play-time uint64 :offset-assert 240)
(display-text-time uint64 :offset-assert 248)
(display-text-handle uint64 :offset-assert 256)
(death-movie-tick int32 :offset-assert 264)
(want-auto-save symbol :offset-assert 268)
(auto-save-proc uint64 :offset-assert 272)
(auto-save-status uint32 :offset-assert 280)
(auto-save-card int32 :offset-assert 284)
(auto-save-which int32 :offset-assert 288)
(pov-camera-handle uint64 :offset-assert 296)
(other-camera-handle uint64 :offset-assert 304)
(death-pos vector-array :offset-assert 312)
(dummy basic :offset-assert 316)
(auto-save-count int32 :offset-assert 320)
((mode symbol :offset-assert 4) ;; can be play/debug
(save-name basic :offset-assert 8)
(life float :offset-assert 12)
(life-max float :offset-assert 16)
(money float :offset-assert 20)
(money-total float :offset-assert 24)
(money-per-level uint8 32 :offset-assert 28)
(deaths-per-level uint8 32 :offset-assert 60)
(buzzer-total float :offset-assert 92)
(fuel float :offset-assert 96)
(perm-list entity-perm-array :offset-assert 100) ;; permament storage for entities
(task-perm-list entity-perm-array :offset-assert 104) ;; permanent storage for task entities
(current-continue continue-point :offset-assert 108)
(text-ids-seen bit-array :offset-assert 112)
(level-opened uint8 32 :offset-assert 116)
(hint-control (array level-hint-control) :offset-assert 148)
(task-hint-control array :offset-assert 152)
(total-deaths int32 :offset-assert 156)
(continue-deaths int32 :offset-assert 160)
(fuel-cell-deaths int32 :offset-assert 164)
(game-start-time uint64 :offset-assert 168)
(continue-time uint64 :offset-assert 176)
(death-time uint64 :offset-assert 184)
(hit-time uint64 :offset-assert 192)
(fuel-cell-pickup-time uint64 :offset-assert 200)
(fuel-cell-time (array uint64) :offset-assert 208)
(enter-level-time (array uint64) :offset-assert 212)
(in-level-time (array uint64) :offset-assert 216)
(blackout-time uint64 :offset-assert 224)
(letterbox-time uint64 :offset-assert 232)
(hint-play-time uint64 :offset-assert 240)
(display-text-time uint64 :offset-assert 248)
(display-text-handle uint64 :offset-assert 256)
(death-movie-tick int32 :offset-assert 264)
(want-auto-save symbol :offset-assert 268)
(auto-save-proc handle :offset-assert 272)
(auto-save-status uint32 :offset-assert 280)
(auto-save-card int32 :offset-assert 284)
(auto-save-which int32 :offset-assert 288)
(pov-camera-handle uint64 :offset-assert 296)
(other-camera-handle uint64 :offset-assert 304)
(death-pos vector-array :offset-assert 312)
(dummy basic :offset-assert 316)
(auto-save-count int32 :offset-assert 320)
)
:method-count-assert 29
:size-assert #x144
:flag-assert #x1d00000144
;; field dummy is a basic loaded with a signed load
(:methods
(dummy-9 (_type_ symbol symbol string) none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 (_type_ uint) entity-perm 13) ; TODO - not totally confirmed
(dummy-14 (_type_) none 14)
(dummy-15 (_type_) none 15)
(dummy-16 () none 16)
(dummy-17 (_type_) continue-point 17)
(dummy-18 () none 18)
(dummy-19 (_type_ continue-point) none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 () none 28)
)
(initialize! (_type_ symbol game-save string) _type_ 9)
(adjust (_type_ symbol float handle) float 10)
(task-complete? (_type_ game-task) symbol 11)
(lookup-entity-perm-by-aid (_type_ uint) entity-perm 12)
(get-entity-task-perm (_type_ game-task) entity-perm 13)
(copy-perms-from-level! (_type_ level) none 14)
(copy-perms-to-level! (_type_ level) none 15)
(debug-print (_type_ symbol) _type_ 16)
(get-or-create-continue! (_type_) continue-point 17)
(get-continue-by-name (_type_ string) continue-point 18)
(set-continue! (_type_ basic) continue-point 19)
(buzzer-count (_type_ game-task) int 20)
(seen-text? (_type_ game-text-id) symbol 21)
(mark-text-as-seen (_type_ game-text-id) none 22)
(got-buzzer? (_type_ game-task int) symbol 23)
(dummy-24 () none 24)
(load-game! (_type_ game-save) game-save 25)
(clear-text-seen! (_type_ game-text-id) none 26)
(get-death-count (_type_ symbol) int 27)
(get-health-percent-lost (_type_) float 28)
)
)
(define-extern *game-info* game-info)
@@ -184,3 +316,5 @@
(set! *game-info* temp)
)
)
(define-extern game-task->string (function game-task string))
File diff suppressed because it is too large Load Diff
+663
View File
@@ -5,5 +5,668 @@
;; name in dgo: game-save
;; dgos: GAME, ENGINE
(defconstant SAVE_VERSION 1)
;; identifier for game save fields
(defenum game-save-elt
:type uint16
(name 100)
(base-time 101)
(real-time 102)
(game-time 103)
(integral-time 104)
(continue 200)
(life 201)
(money 202)
(money-total 203)
(moeny-per-level 204)
(buzzer-total 205)
(fuel-cell 206)
(death-movie-tick 207)
(task-list 300)
(perm-list 301)
(hint-list 303)
(text-list 304)
(level-open-list 305)
(total-deaths 400)
(continue-deaths 401)
(fuel-cell-deaths 402)
(game-start-time 403)
(continue-timke 404) ;; typo in game
(death-time 405)
(hit-time 406)
(fuel-cell-pickup-time 407)
(continue-time 408)
(fuel-cell-time 409)
(enter-level-time 410)
(deaths-per-level 411)
(death-pos 412)
(auto-save-count 413)
(in-level-time 414)
(sfx-volume 500)
(music-volume 501)
(dialog-volume 502)
(language 503)
(screenx 504)
(screeny 505)
(vibration 506)
(play-hints 507)
(video-mode 508)
(aspect-ratio 509)
)
;; the game save is a bunch of "game-save-tag"s
;; the elt-type field identifies what it is.
;; the data may be stored in one of the user fields, or
;; may be stored after the tag itself.
;; the count/size fields determine how big it is.
(deftype game-save-tag (structure)
((user-object object 2 :offset-assert 0)
(user-uint64 uint64 :offset 0)
(user-float0 float :offset 0)
(user-float float 2 :offset 0)
(user-int32 int32 2 :offset 0)
(user-uint32 uint32 2 :offset 0)
(user-int16 int16 4 :offset 0)
(user-uint16 uint16 4 :offset 0)
(user-int8 int8 8 :offset 0)
(user-int80 int8 :offset 0)
(user-int81 int8 :offset 1)
(user-uint8 uint8 8 :offset 0)
(elt-count int32 :offset-assert 8)
(elt-size uint16 :offset-assert 12)
(elt-type game-save-elt :offset-assert 14)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; A game-save is a dynamic type that contains the full save.
;; it contains common metadata plus all the tags
(deftype game-save (basic)
((version int32 :offset-assert 4)
(allocated-length int32 :offset-assert 8)
(length int32 :offset-assert 12)
(info-int32 int32 16 :offset-assert 16)
(info-int8 int8 64 :offset 16)
(level-index int32 :offset 16)
(fuel-cell-count float :offset 20)
(money-count float :offset 24)
(buzzer-count float :offset 28)
(completion-percentage float :offset 32)
(minute uint8 :offset 36)
(hour uint8 :offset 37)
(week uint8 :offset 38)
(day uint8 :offset 39)
(month uint8 :offset 40)
(year uint8 :offset 41)
(new-game int32 :offset 44)
(tag game-save-tag :inline :dynamic :offset-assert 80)
)
:method-count-assert 12
:size-assert #x50
:flag-assert #xc00000050
(:methods
(new (symbol type int) _type_ 0)
(save-to-file (_type_ string) _type_ 9)
(load-from-file! (_type_ string) _type_ 10)
(debug-print (_type_ symbol) _type_ 11)
)
)
(defmethod asize-of game-save ((obj game-save))
"Get the size in memory of the save"
(the-as int (+ (-> game-save size) (the-as uint (-> obj allocated-length))))
)
(defmethod new game-save ((allocation symbol) (type-to-make type) (arg0 int))
"Allocate a game save. arg0 is the number of bytes for tags."
(let ((v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (the-as uint arg0))))))
(set! (-> v0-0 version) SAVE_VERSION)
(set! (-> v0-0 allocated-length) arg0)
v0-0
)
)
(defun-debug game-save-elt->string ((arg0 game-save-elt))
"Convert a game-save-elt to a string"
(let ((v1-0 arg0))
(cond
((= v1-0 (game-save-elt aspect-ratio)) "aspect-ratio")
((= v1-0 (game-save-elt video-mode)) "video-mode")
((= v1-0 (game-save-elt play-hints)) "play-hints")
((= v1-0 (game-save-elt vibration)) "vibration")
((= v1-0 (game-save-elt screeny)) "screeny")
((= v1-0 (game-save-elt screenx)) "screenx")
((= v1-0 (game-save-elt language)) "language")
((= v1-0 (game-save-elt dialog-volume)) "dialog-volume")
((= v1-0 (game-save-elt music-volume)) "music-volume")
((= v1-0 (game-save-elt sfx-volume)) "sfx-volume")
((= v1-0 (game-save-elt in-level-time)) "in-level-time")
((= v1-0 (game-save-elt auto-save-count)) "auto-save-count")
((= v1-0 (game-save-elt death-pos)) "death-pos")
((= v1-0 (game-save-elt deaths-per-level)) "deaths-per-level")
((= v1-0 (game-save-elt enter-level-time)) "enter-level-time")
((= v1-0 (game-save-elt fuel-cell-time)) "fuel-cell-time")
((= v1-0 (game-save-elt continue-time)) "continue-time")
((= v1-0 (game-save-elt fuel-cell-pickup-time)) "fuel-cell-pickup-time")
((= v1-0 (game-save-elt hit-time)) "hit-time")
((= v1-0 (game-save-elt death-time)) "death-time")
((= v1-0 (game-save-elt continue-timke)) "continue-timke")
((= v1-0 (game-save-elt game-start-time)) "game-start-time")
((= v1-0 (game-save-elt fuel-cell-deaths)) "fuel-cell-deaths")
((= v1-0 (game-save-elt continue-deaths)) "continue-deaths")
((= v1-0 (game-save-elt total-deaths)) "total-deaths")
((= v1-0 (game-save-elt level-open-list)) "level-open-list")
((= v1-0 (game-save-elt text-list)) "text-list")
((= v1-0 (game-save-elt hint-list)) "hint-list")
((= v1-0 (game-save-elt perm-list)) "perm-list")
((= v1-0 (game-save-elt task-list)) "task-list")
((= v1-0 (game-save-elt death-movie-tick)) "death-movie-tick")
((= v1-0 (game-save-elt fuel-cell)) "fuel-cell")
((= v1-0 (game-save-elt buzzer-total)) "buzzer-total")
((= v1-0 (game-save-elt moeny-per-level)) "money-per-level")
((= v1-0 (game-save-elt money-total)) "money-total")
((= v1-0 (game-save-elt money)) "money")
((= v1-0 (game-save-elt life)) "life")
((= v1-0 (game-save-elt continue)) "continue")
((= v1-0 (game-save-elt integral-time)) "integral-time")
((= v1-0 (game-save-elt game-time)) "game-time")
((= v1-0 (game-save-elt real-time)) "real-time")
((= v1-0 (game-save-elt base-time)) "base-time")
((= v1-0 (game-save-elt name)) "name")
(else "*unknown*")
)
)
)
(defun progress-level-index->string ((arg0 int))
"Convert an index for a level in the progress menu (not actual data levels)
to a string (translated)."
(if (< arg0 (-> *level-task-data* length))
(lookup-text! *common-text* (-> *level-task-data* arg0 level-name-id) #f)
(the-as string #f)
)
)
(defmethod debug-print game-save ((obj game-save) (detail symbol))
"Print a save to #t"
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tversion: ~D~%" (-> obj version))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tlevel-index: ~D~%" (-> obj level-index))
(format #t "~Tfuel-cell-count: ~f~%" (-> obj fuel-cell-count))
(format #t "~Tmoney-count: ~f~%" (-> obj money-count))
(format #t "~Tbuzzer-count: ~f~%" (-> obj buzzer-count))
(format #t "~Tcompletion-percentage: ~f~%" (-> obj completion-percentage))
(format #t "~Tsave-time: ~x:~x ~x/~x/~x~%"
(-> obj hour)
(-> obj minute)
(-> obj day)
(-> obj month)
(-> obj year)
)
(format #t "~Ttag[]: @ #x~X~%" (-> obj tag))
;; loop through tags
(let ((tag (the-as game-save-tag (-> obj tag)))
(tag-idx 0)
)
(while (< (the-as int tag) (the-as int (-> obj tag)))
(format #t "~T [~3D] ~-32S [~3D/~3D] ~12D ~8f "
tag-idx
(game-save-elt->string (-> tag elt-type))
(-> tag elt-count)
(-> tag elt-size)
(-> tag user-uint64)
(-> tag user-float))
;; name/continue are strings
(let ((v1-0 (-> tag elt-type)))
(if (or (= v1-0 (game-save-elt name)) (= v1-0 (game-save-elt continue)))
(format #t "= \"~G\"~%" (&+ (the-as pointer tag) 16))
(format #t "~%")
)
)
(when detail
(let ((v1-4 (-> tag elt-type)))
(cond
((or (= v1-4 (game-save-elt moeny-per-level)) (= v1-4 (game-save-elt deaths-per-level)))
;; per level u8's
(dotimes (prog-lev-idx (-> tag elt-count))
(let ((lev-name (progress-level-index->string prog-lev-idx)))
(if lev-name
(format #t " ~-32S: ~D~%"
lev-name
(-> (the-as (pointer uint8) (&+ (the-as pointer (&-> (the-as (pointer uint8) tag) 16)) prog-lev-idx)))
)
)
)
)
)
((= v1-4 (game-save-elt enter-level-time))
;; per level u64's
(dotimes (s2-2 (-> tag elt-count))
(let ((a2-14 (progress-level-index->string s2-2)))
(if a2-14
(format #t " ~-32S: ~D~%"
a2-14
(-> (the-as (pointer uint64) (&+ (&+ (the-as pointer tag) 16) (* s2-2 8))))
)
)
)
)
)
((= v1-4 (game-save-elt in-level-time))
(dotimes (s2-3 (-> tag elt-count))
(let ((a2-15 (progress-level-index->string s2-3)))
(if a2-15
(format #t " ~-32S: ~D~%"
a2-15
(-> (the-as (pointer uint64) (&+ (&+ (the-as pointer tag) 16) (* s2-3 8))))
)
)
)
)
)
((= v1-4 (game-save-elt fuel-cell-time))
(dotimes (s2-4 (-> tag elt-count))
(let ((a2-16 (game-task->string (the game-task s2-4))))
(if a2-16
(format #t " ~-32S: ~D~%"
a2-16
(-> (the-as (pointer uint64) (&+ (&+ (the-as pointer tag) 16) (* s2-4 8))))
)
)
)
)
)
)
)
)
(set! tag (the-as game-save-tag
(&+ (the-as pointer tag)
(logand -16 (+ (* (the-as int (-> tag elt-size)) (-> tag elt-count)) 31))
)
)
)
(+! tag-idx 1)
)
)
obj
)
(defmethod inspect game-save ((obj game-save))
(debug-print obj #f)
)
;; todo method 24 game-info
(defmethod load-game! game-info ((obj game-info) (save game-save))
"Copy save data from a game-save to a game-info"
(let ((save-data (the-as game-save-tag (-> save tag))))
;; loop over all tags
(while (< (the-as int save-data) (the-as int (+ (+ (-> save length) 76) (the-as int save))))
(let ((a0-1 (-> save-data elt-type)))
(cond
((= a0-1 (game-save-elt sfx-volume))
(set! (-> *setting-control* default sfx-volume) (-> save-data user-float0))
)
((= a0-1 (game-save-elt music-volume))
(set! (-> *setting-control* default music-volume) (-> save-data user-float0))
)
((= a0-1 (game-save-elt dialog-volume))
(set! (-> *setting-control* default dialog-volume) (-> save-data user-float0))
)
((= a0-1 (game-save-elt language))
(set! (-> *setting-control* default language) (the-as int (-> save-data user-uint64)))
)
((= a0-1 (game-save-elt vibration))
(set! (-> *setting-control* default vibration) (= (-> save-data user-uint64) 1))
)
((= a0-1 (game-save-elt play-hints))
(set! (-> *setting-control* default play-hints) (= (-> save-data user-uint64) 1))
)
)
)
(set! save-data (the-as game-save-tag
(&+ (the-as pointer save-data)
(logand -16 (+ (* (the-as int (-> save-data elt-size)) (-> save-data elt-count)) 31))
)
)
)
)
)
;; if we're a new game, set our checkpoint.
(when (nonzero? (-> save new-game))
(set-continue! obj "game-start")
(set! save save)
(goto cfg-134)
)
;; loop over all tags
(let ((data (the-as game-save-tag (-> save tag))))
(while (< (the-as int data) (the-as int (+ (+ (-> save length) 76) (the-as int save))))
(let ((v1-7 (-> data elt-type)))
(cond
((= v1-7 (game-save-elt base-time))
;; updating this requires some care to not break things
(let ((old-base-frame (-> *display* base-frame-counter)))
(set! (-> *display* base-frame-counter) (-> data user-uint64))
;; remember the old value
(set! (-> *display* old-base-frame-counter) (+ (-> *display* base-frame-counter) -1))
(let ((frame-counter-diff (- (-> *display* base-frame-counter) old-base-frame)))
;; update in-progress counters
(if (nonzero? (-> obj blackout-time))
(set! (-> obj blackout-time) (+ (-> obj blackout-time) frame-counter-diff))
)
(if (nonzero? (-> obj letterbox-time))
(set! (-> obj letterbox-time) (+ (-> obj letterbox-time) frame-counter-diff))
)
(if (nonzero? (-> obj hint-play-time))
(set! (-> obj hint-play-time) (+ (-> obj hint-play-time) frame-counter-diff))
)
(if (nonzero? (-> obj display-text-time))
(set! (-> obj display-text-time) (+ (-> obj display-text-time) frame-counter-diff))
)
)
)
;; vibration may get stuck on if we warp back in time, just kill it
(buzz-stop! 0)
)
((= v1-7 (game-save-elt game-time))
(set! (-> *display* game-frame-counter) (-> data user-uint64))
(set! (-> *display* old-game-frame-counter) (+ (-> *display* game-frame-counter) -1))
)
((= v1-7 (game-save-elt real-time))
(set! (-> *display* real-frame-counter) (-> data user-uint64))
(set! (-> *display* old-real-frame-counter) (+ (-> *display* real-frame-counter) -1))
)
((= v1-7 (game-save-elt integral-time))
(set! (-> *display* integral-frame-counter) (-> data user-uint64))
(set! (-> *display* old-integral-frame-counter) (+ (-> *display* integral-frame-counter) -1))
)
((= v1-7 (game-save-elt continue))
(format (clear *temp-string*) "~G" (&+ (the-as pointer data) 16))
(set-continue! obj *temp-string*)
)
((= v1-7 (game-save-elt life))
(set! (-> obj life) (-> data user-float0))
)
((= v1-7 (game-save-elt buzzer-total))
(set! (-> obj buzzer-total) (-> data user-float0))
)
((= v1-7 (game-save-elt fuel-cell))
(set! (-> obj fuel) (-> data user-float0))
)
((= v1-7 (game-save-elt death-movie-tick))
(set! (-> obj death-movie-tick) (the-as int (-> data user-uint64)))
)
((= v1-7 (game-save-elt money))
(set! (-> obj money) (-> data user-float0))
)
((= v1-7 (game-save-elt money-total))
(set! (-> obj money-total) (-> data user-float0))
)
((= v1-7 (game-save-elt moeny-per-level))
(let ((v1-34 (min 32 (-> data elt-count))))
(dotimes (a0-76 v1-34)
(set!
(-> obj money-per-level a0-76)
(-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-76)
)
)
)
)
((= v1-7 (game-save-elt level-open-list))
(let ((v1-38 (min 32 (-> data elt-count))))
(dotimes (a0-80 v1-38)
(set!
(-> obj level-opened a0-80)
(-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-80)
)
)
)
)
((= v1-7 (game-save-elt perm-list))
(let ((s3-2 (min (-> data elt-count) (-> obj perm-list allocated-length))))
(set! (-> obj perm-list length) s3-2)
(dotimes (s2-0 s3-2)
(mem-copy!
(the-as pointer (-> obj perm-list data s2-0))
(&+ (&+ (the-as pointer data) 16) (* s2-0 16))
16
)
)
)
)
((= v1-7 (game-save-elt task-list))
(let ((s3-4 (min (-> data elt-count) (-> obj task-perm-list allocated-length))))
(set! (-> obj task-perm-list length) s3-4)
(dotimes (s2-1 s3-4)
(mem-copy!
(the-as pointer (-> obj task-perm-list data s2-1))
(&+ (&+ (the-as pointer data) 16) (* s2-1 16))
16
)
)
)
)
((= v1-7 (game-save-elt text-list))
(let ((v1-61 (/ (logand -8 (+ (-> obj text-ids-seen allocated-length) 7)) 8))
(a0-94 (-> data elt-count)))
(dotimes (a1-35 v1-61)
(cond
((>= a1-35 a0-94)
(set! (-> obj text-ids-seen bytes a1-35) (the-as uint 0))
0
)
(else
(set! (-> obj text-ids-seen bytes a1-35)
(-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a1-35)
)
)
)
)
)
)
((= v1-7 (game-save-elt hint-list))
(cond
((= (-> obj hint-control length) (-> data elt-count))
(let ((v1-65 (&+ (the-as pointer data) 16)))
(dotimes (a0-99 (-> data elt-count))
(set! (-> obj hint-control a0-99 start-time)
(-> (the-as (pointer uint64) (&+ v1-65 (* (* a0-99 4) 8))))
)
(set! (-> obj hint-control a0-99 last-time-called)
(-> (the-as (pointer uint64) (&+ v1-65 (* (+ (* a0-99 4) 1) 8))))
)
(set! (-> obj hint-control a0-99 num-attempts)
(-> (the-as (pointer int8)
(&+ (the-as (pointer uint8) v1-65) (+ (* a0-99 32) 16))
)
)
)
(set!
(-> obj hint-control a0-99 num-success)
(-> (the-as (pointer int8)
(&+ (the-as (pointer uint8) v1-65) (+ (* a0-99 32) 17))
)
)
)
)
)
)
(else
(format
0
"WARNING: SAVEGAME: hint control list did not match current, ignoring~%"
)
)
)
)
((= v1-7 (game-save-elt auto-save-count))
(set! (-> obj auto-save-count) (the-as int (-> data user-uint64)))
)
((= v1-7 (game-save-elt total-deaths))
(set! (-> obj total-deaths) (the-as int (-> data user-uint64)))
)
((= v1-7 (game-save-elt continue-deaths))
(set! (-> obj continue-deaths) (the-as int (-> data user-uint64)))
)
((= v1-7 (game-save-elt fuel-cell-deaths))
(set! (-> obj fuel-cell-deaths) (the-as int (-> data user-uint64)))
)
((= v1-7 (game-save-elt game-start-time))
(set! (-> obj game-start-time) (-> data user-uint64))
)
((= v1-7 (game-save-elt continue-time))
(set! (-> obj continue-time) (-> data user-uint64))
)
((= v1-7 (game-save-elt death-time))
(set! (-> obj death-time) (-> data user-uint64))
)
((= v1-7 (game-save-elt hit-time))
(set! (-> obj hit-time) (-> data user-uint64))
)
((= v1-7 (game-save-elt fuel-cell-pickup-time))
(set! (-> obj fuel-cell-pickup-time) (-> data user-uint64))
)
((= v1-7 (game-save-elt deaths-per-level))
(let ((v1-79 (min 32 (-> data elt-count))))
(dotimes (a0-122 v1-79)
(set!
(-> obj deaths-per-level a0-122)
(-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-122)
)
)
)
)
((= v1-7 (game-save-elt enter-level-time))
(let ((v1-83 (min 32 (-> data elt-count))))
(dotimes (a0-126 v1-83)
(set! (-> obj enter-level-time a0-126)
(-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-126 8))))
)
)
)
)
((= v1-7 (game-save-elt in-level-time))
(let ((v1-87 (min 32 (-> data elt-count))))
(dotimes (a0-130 v1-87)
(set! (-> obj in-level-time a0-130)
(-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-130 8))))
)
)
)
)
((= v1-7 (game-save-elt fuel-cell-time))
(let ((v1-92 (min 32 (-> data elt-count))))
(dotimes (a0-133 v1-92)
(set! (-> obj fuel-cell-time a0-133)
(-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-133 8))))
)
)
)
)
)
)
(set! data (the-as game-save-tag (&+ (the-as pointer data)
(logand -16
(+ (* (the-as int (-> data elt-size)) (-> data elt-count)) 31)
)
)
)
)
)
)
;; update entity stuff in levels that are active
(dotimes (s4-1 (-> *level* length))
(let ((a1-68 (-> *level* level s4-1)))
(if (= (-> a1-68 status) 'active)
(copy-perms-to-level! obj a1-68)
)
)
)
;; update tasks
(let ((s5-1 2) ;; jungle eggtop
(s4-2 115) ;; max - 1
)
(while (>= (the-as uint s4-2) (the-as uint s5-1))
;; calling this will run the function to see if the task is done or not
(get-task-status (the-as game-task s5-1))
(+! s5-1 1)
)
)
(label cfg-134)
save
)
(defmethod save-to-file game-save ((obj game-save) (arg0 string))
"Write a game save to a file for debugging"
(let ((s5-0 (new 'stack 'file-stream arg0 'write)))
(file-stream-write s5-0
(&-> obj type)
(+ (-> obj type size) (the-as uint (-> obj length)))
)
(file-stream-close s5-0)
)
obj
)
(defmethod load-from-file! game-save ((obj game-save) (filename string))
(let ((stream (new 'stack 'file-stream filename 'read)))
(let ((in-size (file-stream-length stream))
(my-size (-> obj allocated-length))
)
(cond
((>= (asize-of obj) in-size)
;; thing in file is not bigger than we are, safe to read.
(cond
((= (file-stream-read stream (&-> obj type) in-size) in-size)
;; read success! set the type tag
(set! (-> obj type) game-save)
)
(else
;; fail.
(format 0 "ERROR: SAVEGAME: save file ~A did not read correctly.~%" stream)
(set! (-> obj length) 0)
0
)
)
)
(else
;; file is bigger than we are, just give up because we don't have
;; enough room to put the save
(format 0 "ERROR: SAVEGAME: save file ~A is too big~%" stream)
)
)
(set! (-> obj allocated-length) my-size)
)
(when (!= (-> obj version) SAVE_VERSION)
;; uh-oh, the version is wrong
(format 0 "ERROR: SAVEGAME: save file ~A was version ~d, but only ~d is supported.~%"
stream
(-> obj version)
SAVE_VERSION
)
(set! (-> obj length) 0)
0
)
(file-stream-close stream)
)
obj
)
;; TODO sparticle stuff and more
;; TODO - for credits
(define-extern print-game-text (function string font-context symbol int int float)) ; TODO decomp error, this seems correct though
+1
View File
@@ -131,3 +131,4 @@
(defun-extern set-blackout-frames int uint)
(defun-extern on symbol process)
(defun-extern off int)
(define-extern set-master-mode (function symbol none))
@@ -36,3 +36,5 @@
:size-assert #x4
:flag-assert #x900000004
)
(define-extern reset-all-hint-controls (function none))
+53 -149
View File
@@ -5,7 +5,21 @@
;; name in dgo: task-control-h
;; dgos: GAME, ENGINE
;; custom enums
;; There are a fixed number of game tasks. Most are just getting a power cell,
;; but there are also ones for using the levitator etc.
;; The list of all tasks is the game-task enum in game-info-h.gc
;; the task control contains a list of all cstage.
;; Each task may have multiple cstages.
;; Each cstage corresponds to a game-task and a task-status.
;; There is a concept of a "current stage" being played, but it may sometimes be invalid (-1).
;; it is an index into the task-control list
;; names from task-status->string function
;; the status value will increase.
;; some tasks may do their own thing and not use these values.
(defenum task-status
:type uint64
(invalid 0)
@@ -16,172 +30,59 @@
(need-reminder 5)
(need-reward-speech 6)
(need-resolution 7)
(*unknown* 999999)
)
(defenum game-task
;; our names
(defenum task-flags
:type uint8
(none 0)
(complete 1)
(jungle-eggtop 2)
(jungle-lurkerm 3)
(jungle-tower 4)
(jungle-fishgame 5)
(jungle-plant 6)
(jungle-buzzer 7)
(jungle-canyon-end 8)
(jungle-temple-door 9)
(village1-yakow 10)
(village1-mayor-money 11)
(village1-uncle-money 12)
(village1-oracle-money1 13)
(village1-oracle-money2 14)
(beach-ecorocks 15)
(beach-pelican 16)
(beach-flutflut 17)
(beach-seagull 18)
(beach-cannon 19)
(beach-buzzer 20)
(beach-gimmie 21)
(beach-sentinel 22)
(misty-muse 23)
(misty-boat 24)
(misty-warehouse 25)
(misty-cannon 26)
(misty-bike 27)
(misty-buzzer 28)
(misty-bike-jump 29)
(misty-eco-challenge 30)
(village2-gambler-money 31)
(village2-geologist-money 32)
(village2-warrior-money 33)
(village2-oracle-money1 34)
(village2-oracle-money2 35)
(swamp-billy 36)
(swamp-flutflut 37)
(swamp-battle 38)
(swamp-tether-1 39)
(swamp-tether-2 40)
(swamp-tether-3 41)
(swamp-tether-4 42)
(swamp-buzzer 43)
(sunken-platforms 44)
(sunken-pipe 45)
(sunken-slide 46)
(sunken-room 47)
(sunken-sharks 48)
(sunken-buzzer 49)
(sunken-top-of-helix 50)
(sunken-spinning-room 51)
(rolling-race 52)
(rolling-robbers 53)
(rolling-moles 54)
(rolling-plants 55)
(rolling-lake 56)
(rolling-buzzer 57)
(rolling-ring-chase-1 58)
(rolling-ring-chase-2 59)
(snow-eggtop 60)
(snow-ram 61)
(snow-fort 62)
(snow-ball 63)
(snow-bunnies 64)
(snow-buzzer 65)
(snow-bumpers 66)
(snow-cage 67)
(firecanyon-buzzer 68)
(firecanyon-end 69)
(citadel-sage-green 70)
(citadel-sage-blue 71)
(citadel-sage-red 72)
(citadel-sage-yellow 73)
(village3-extra1 74)
(village1-buzzer 75)
(village2-buzzer 76)
(village3-buzzer 77)
(cave-gnawers 78)
(cave-dark-crystals 79)
(cave-dark-climb 80)
(cave-robot-climb 81)
(cave-swing-poles 82)
(cave-spider-tunnel 83)
(cave-platforms 84)
(cave-buzzer 85)
(ogre-boss 86)
(ogre-end 87)
(ogre-buzzer 88)
(lavatube-end 89)
(lavatube-buzzer 90)
(citadel-buzzer 91)
(training-gimmie 92)
(training-door 93)
(training-climb 94)
(training-buzzer 95)
(village3-miner-money1 96)
(village3-miner-money2 97)
(village3-miner-money3 98)
(village3-miner-money4 99)
(village3-oracle-money1 100)
(village3-oracle-money2 101)
(firecanyon-assistant 102)
(village2-levitator 103)
(swamp-arm 104)
(village3-button 105)
(red-eggtop 106)
(lavatube-balls 107)
(lavatube-start 108)
(intro 109)
(ogre-secret 110)
(village4-button 111)
(finalboss-movies 112)
(plunger-lurker-hit 113)
(leaving-misty 114)
(assistant-village3 115)
(max 116)
(*unknown* 255))
:bitfield #t
(closed 0)
(has-entity 1)
(closed-by-default 2)
)
;; definition of type task-cstage
(declare-type task-control basic)
;; A task-cstage describes
(deftype task-cstage (structure)
((game-task game-task :offset-assert 0)
(status task-status :offset-assert 8)
(flags uint8 :offset-assert 16)
(condition (function task-control symbol) :offset-assert 20)
((game-task game-task :offset-assert 0)
(status task-status :offset-assert 8)
(flags task-flags :offset-assert 16)
(condition (function task-control symbol) :offset-assert 20)
)
:method-count-assert 16
:size-assert #x18
:flag-assert #x1000000018
(:methods
(get-game-task (_type_) uint 9)
(get-task-status (_type_) uint 10)
(TODO-RENAME-11 (_type_ task-control) symbol 11)
(first-flag-bit? (_type_) symbol 12)
(third-flag-bit? (_type_) symbol 13)
(TODO-RENAME-14 (_type_) int 14)
(clear-all-but-first-flag-bit (_type_) int 15)
)
(get-game-task (_type_) game-task 9)
(get-task-status (_type_) task-status 10)
(task-available? (_type_ task-control) symbol 11)
(closed? (_type_) symbol 12)
(closed-by-default? (_type_) symbol 13)
(close-task! (_type_) int 14)
(open-task! (_type_) int 15)
)
)
;; definition of type task-control
(deftype task-control (basic)
((current-stage int16 :offset-assert 4)
(stage (array task-cstage) :offset-assert 8)
((current-stage int16 :offset-assert 4)
(stage (array task-cstage) :offset-assert 8)
)
:method-count-assert 19
:size-assert #xc
:flag-assert #x130000000c
(:methods
(current-task (_type_) int 9)
(current-status (_type_) int 10)
(close-current! (_type_) none 11)
(close-status! (_type_ int) int 12)
(first-any (_type_ symbol) int 13)
(reset! (_type_ symbol symbol) int 14)
(closed? (_type_ int int) symbol 15)
(get-reminder (_type_ int) int 16)
(save-reminder (_type_ int int) int 17) ;; TODO - i believe this is none
(exists? (_type_ int int) symbol 18)
)
(current-task (_type_) int 9)
(current-status (_type_) int 10)
(close-current! (_type_) none 11)
(close-status! (_type_ task-status) int 12)
(first-any (_type_ symbol) int 13)
(reset! (_type_ symbol symbol) int 14)
(closed? (_type_ game-task task-status) symbol 15)
(get-reminder (_type_ int) int 16)
(save-reminder (_type_ int int) int 17)
(exists? (_type_ game-task task-status) symbol 18)
)
)
;; definition of type ambient-control
@@ -269,4 +170,7 @@
)
)
(define-extern task-closed? (function int int symbol))
(define-extern task-closed? (function game-task task-status symbol))
(define-extern get-task-status (function game-task task-status))
(define-extern get-task-control (function game-task task-control))
(define-extern close-specific-task! (function game-task task-status int))
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -20,19 +20,19 @@
)
(deftype border-plane (basic)
((name basic :offset-assert 4)
(action basic :offset-assert 8)
(slot int8 :offset-assert 12)
(trans vector :inline :offset-assert 16)
(normal vector :inline :offset-assert 32)
((name symbol :offset-assert 4)
(action basic :offset-assert 8)
(slot int8 :offset-assert 12)
(trans vector :inline :offset-assert 16)
(normal vector :inline :offset-assert 32)
)
:method-count-assert 11
:size-assert #x30
:flag-assert #xb00000030
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
)
(debug-draw! (_type_) none 9)
(point-past-plane? (_type_ vector) symbol 10)
)
)
(defun-extern quaternion-from-two-vectors-max-angle! quaternion vector vector float quaternion)
+1
View File
@@ -393,3 +393,4 @@
)
)
(define-extern *level-load-list* pair)
+75 -75
View File
@@ -26,7 +26,7 @@
:name "training-start"
:level 'training
:trans (new 'static 'vector :x -5393626.5 :y 28072.346 :z 4332472.5 :w 1.0)
:quat (new 'static 'vector :y 0.9995 :w 0.0297)
:quat (new 'static 'quaternion :y 0.9995 :w 0.0297)
:camera-trans (new 'static 'vector :x -5426915.0 :y 45930.906 :z 4353156.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 -0.5571 0.0 -0.8304 0.1264 0.9883 -0.0848 0.8207 -0.1522 -0.5506)
@@ -52,7 +52,7 @@
:level 'training
:flags #x4
:trans (new 'static 'vector :x -5383524.0 :y 28019.098 :z 4360302.0 :w 1.0)
:quat (new 'static 'vector :y 0.084 :w 0.9964)
:quat (new 'static 'quaternion :y 0.084 :w 0.9964)
:camera-trans
(new 'static 'vector :x -5366765.0 :y 45646.234 :z 4325889.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.9057 0.0 0.4238 -0.0666 0.9875 0.1424 -0.4186 -0.1572 0.8944)
@@ -78,7 +78,7 @@
:level 'training
:flags #x404
:trans (new 'static 'vector :x -5393740.5 :y 28259.533 :z 4360945.5 :w 1.0)
:quat (new 'static 'vector :y 0.9993 :w 0.0359)
:quat (new 'static 'quaternion :y 0.9993 :w 0.0359)
:camera-trans (new 'static 'vector :x -5434444.5 :y 47050.344 :z 4372832.5 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.3536 0.0 -0.9353 0.1315 0.99 -0.0497 0.926 -0.1406 -0.35)
:load-commands
@@ -134,7 +134,7 @@
:name "village1-hut"
:level 'village1
:trans (new 'static 'vector :x -638860.06 :y 139319.7 :z 769990.6 :w 1.0)
:quat (new 'static 'vector :y -0.9889 :w -0.148)
:quat (new 'static 'quaternion :y -0.9889 :w -0.148)
:camera-trans (new 'static 'vector :x -668114.1 :y 164536.31 :z 828633.06 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.8947 0.0 -0.4464 0.1082 0.9701 -0.2169 0.4331 -0.2424 -0.868)
:load-commands '()
@@ -149,7 +149,7 @@
:level 'village1
:flags #x24
:trans (new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0)
:quat (new 'static 'vector :y 0.591 :w 0.8066)
:quat (new 'static 'quaternion :y 0.591 :w 0.8066)
:camera-trans (new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0)
:camera-rot (new 'static 'array float 9 0.7221 0.0 -0.6917 -0.0517 0.9972 -0.054 0.6897 0.0747 0.7201)
:load-commands '()
@@ -164,7 +164,7 @@
:level 'village1
:flags #x804
:trans (new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0)
:quat (new 'static 'vector :y 0.591 :w 0.8066)
:quat (new 'static 'quaternion :y 0.591 :w 0.8066)
:camera-trans (new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0)
:camera-rot (new 'static 'array float 9 0.7221 0.0 -0.6917 -0.0517 0.9972 -0.054 0.6897 0.0747 0.7201)
:load-commands '()
@@ -179,7 +179,7 @@
:level 'village1
:flags #x40
:trans (new 'static 'vector :x -542529.1 :y 189424.03 :z 847101.94 :w 1.0)
:quat (new 'static 'vector :y -0.1717 :w -0.9851)
:quat (new 'static 'quaternion :y -0.1717 :w -0.9851)
:camera-trans (new 'static 'vector :x -559085.2 :y 202996.53 :z 826054.25 :w 1.0)
:camera-rot (new 'static 'array float 9 0.7868 0.0 -0.6171 0.0775 0.992 0.0989 0.6122 -0.1257 0.7806)
:load-commands '()
@@ -194,7 +194,7 @@
:level 'village1
:flags #x10
:trans (new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0)
:quat (new 'static 'vector :y -0.2339 :w 0.9722)
:quat (new 'static 'quaternion :y -0.2339 :w 0.9722)
:camera-trans (new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.6381 0.0 0.7699 -0.0938 0.9925 0.0777 -0.7642 -0.1218 0.6333)
:load-commands
@@ -255,7 +255,7 @@
:name "beach-start"
:level 'beach
:trans (new 'static 'vector :x -504960.22 :y 9477.325 :z -223513.81 :w 1.0)
:quat (new 'static 'vector :y 0.9486 :w -0.3163)
:quat (new 'static 'quaternion :y 0.9486 :w -0.3163)
:camera-trans (new 'static 'vector :x -487550.16 :y 28354.15 :z -184211.05 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.9139 0.0 0.4058 -0.0551 0.9907 -0.1241 -0.4021 -0.1358 -0.9054)
:load-commands '()
@@ -300,7 +300,7 @@
:name "jungle-start"
:level 'jungle
:trans (new 'static 'vector :x 1057631.9 :y 86404.305 :z -647140.56 :w 1.0)
:quat (new 'static 'vector :y -0.9009 :w -0.4339)
:quat (new 'static 'quaternion :y -0.9009 :w -0.4339)
:camera-trans (new 'static 'vector :x 1004424.8 :y 111181.82 :z -611527.9 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.5568 0.0 -0.8306 0.201 0.9702 -0.1347 0.8059 -0.2419 -0.5402)
:load-commands '()
@@ -344,7 +344,7 @@
:name "jungle-tower"
:level 'jungleb
:trans (new 'static 'vector :x 1469510.0 :y -204745.52 :z -959058.3 :w 1.0)
:quat (new 'static 'vector :y -0.6194 :w -0.785)
:quat (new 'static 'quaternion :y -0.6194 :w -0.785)
:camera-trans (new 'static 'vector :x 1485298.5 :y -189972.08 :z -936548.75 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.8614 0.0 0.5078 -0.1177 0.9727 -0.1997 -0.4939 -0.2318 -0.8379)
:load-commands '()
@@ -388,7 +388,7 @@
:name "misty-start"
:level 'misty
:trans (new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0)
:quat (new 'static 'vector :y -0.2339 :w 0.9722)
:quat (new 'static 'quaternion :y -0.2339 :w 0.9722)
:camera-trans (new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.6381 0.0 0.7699 -0.0938 0.9925 0.0777 -0.7642 -0.1218 0.6333)
:load-commands
@@ -415,7 +415,7 @@
:name "misty-silo"
:level 'misty
:trans (new 'static 'vector :x -672503.0 :y 82131.35 :z 3651465.8 :w 1.0)
:quat (new 'static 'vector :y 0.0878 :w 0.9961)
:quat (new 'static 'quaternion :y 0.0878 :w 0.9961)
:camera-trans (new 'static 'vector :x -675754.0 :y 102028.91 :z 3604800.8 :w 1.0)
:camera-rot (new 'static 'array float 9 0.9975 0.0 -0.0704 0.0086 0.9924 0.1223 0.0698 -0.1226 0.9899)
:load-commands
@@ -442,7 +442,7 @@
:name "misty-bike"
:level 'misty
:trans (new 'static 'vector :x 302533.44 :y 35901.848 :z 4138967.8 :w 1.0)
:quat (new 'static 'vector :y -0.2809 :w 0.9597)
:quat (new 'static 'quaternion :y -0.2809 :w 0.9597)
:camera-trans (new 'static 'vector :x 338476.25 :y 55700.684 :z 4109729.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.6308 0.0 0.7759 -0.096 0.9923 0.078 -0.7699 -0.1237 0.6259)
:load-commands
@@ -469,7 +469,7 @@
:name "misty-backside"
:level 'misty
:trans (new 'static 'vector :x -304192.72 :y 33270.99 :z 4646525.0 :w 1.0)
:quat (new 'static 'vector :y -0.8443 :w -0.5357)
:quat (new 'static 'quaternion :y -0.8443 :w -0.5357)
:camera-trans (new 'static 'vector :x -346989.78 :y 54377.676 :z 4674685.5 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.5497 0.0 -0.8353 0.1009 0.9926 -0.0664 0.8291 -0.1208 -0.5457)
:load-commands
@@ -496,7 +496,7 @@
:name "misty-silo2"
:level 'misty
:trans (new 'static 'vector :x -898000.06 :y 98038.17 :z 4162091.0 :w 1.0)
:quat (new 'static 'vector :y -0.1102 :w 0.9938)
:quat (new 'static 'quaternion :y -0.1102 :w 0.9938)
:camera-trans (new 'static 'vector :x -931459.9 :y 118198.68 :z 4196081.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.6605 0.0 -0.7508 0.1086 0.9894 -0.0955 0.7429 -0.1447 -0.6535)
:load-commands
@@ -553,7 +553,7 @@
:name "firecanyon-start"
:level 'firecanyon
:trans (new 'static 'vector :x -87377.1 :y 126444.75 :z -681697.25 :w 1.0)
:quat (new 'static 'vector :y 0.9921 :w -0.1246)
:quat (new 'static 'quaternion :y 0.9921 :w -0.1246)
:camera-trans (new 'static 'vector :x -84559.055 :y 144685.47 :z -641194.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.9976 0.0 0.0688 -0.01 0.9893 -0.1452 -0.068 -0.1456 -0.9869)
:load-commands '()
@@ -567,7 +567,7 @@
:name "firecanyon-end"
:level 'firecanyon
:trans (new 'static 'vector :x 1360576.1 :y 126976.0 :z -5839533.5 :w 1.0)
:quat (new 'static 'vector :y 0.1666 :w 0.986)
:quat (new 'static 'quaternion :y 0.1666 :w 0.986)
:camera-trans (new 'static 'vector :x 1378912.6 :y 144452.81 :z -5872527.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.8847 0.0 0.466 -0.0744 0.9871 0.1414 -0.46 -0.1598 0.8733)
:load-commands '()
@@ -611,7 +611,7 @@
:name "village2-start"
:level 'village2
:trans (new 'static 'vector :x 1460961.2 :y 108562.02 :z -6161391.0 :w 1.0)
:quat (new 'static 'vector :y 0.9917 :w 0.1278)
:quat (new 'static 'quaternion :y 0.9917 :w 0.1278)
:camera-trans (new 'static 'vector :x 1468018.8 :y 133790.92 :z -6096227.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.9941 0.0 0.1076 -0.0261 0.9699 -0.2418 -0.1044 -0.2432 -0.9643)
:load-commands '()
@@ -626,7 +626,7 @@
:level 'village2
:flags #x4
:trans (new 'static 'vector :x 1592492.9 :y 91648.0 :z -6328677.0 :w 1.0)
:quat (new 'static 'vector :y 0.7469 :w 0.6648)
:quat (new 'static 'quaternion :y 0.7469 :w 0.6648)
:camera-trans (new 'static 'vector :x 1555766.1 :y 103759.46 :z -6318964.5 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.2562 0.0 -0.9666 -0.0253 0.9996 0.0067 0.9662 0.0262 -0.2561)
:load-commands '()
@@ -640,7 +640,7 @@
:name "village2-dock"
:level 'village2
:trans (new 'static 'vector :x 1264346.8 :y 19451.494 :z -6833563.5 :w 1.0)
:quat (new 'static 'vector :y 0.0258 :w 0.9996)
:quat (new 'static 'quaternion :y 0.0258 :w 0.9996)
:camera-trans (new 'static 'vector :x 1265547.2 :y 34647.656 :z -6862636.5 :w 1.0)
:camera-rot (new 'static 'array float 9 0.9991 0.0 0.0411 -0.0088 0.9764 0.2155 -0.0401 -0.2156 0.9756)
:load-commands '()
@@ -684,7 +684,7 @@
:name "sunken-start"
:level 'sunken
:trans (new 'static 'vector :x 2172095.2 :y -591749.94 :z -6721553.0 :w 1.0)
:quat (new 'static 'vector :y -0.5083 :w 0.8611)
:quat (new 'static 'quaternion :y -0.5083 :w 0.8611)
:camera-trans (new 'static 'vector :x 2138871.5 :y -572296.4 :z -6751967.5 :w 1.0)
:camera-rot (new 'static 'array float 9 0.7575 0.0 -0.6527 0.0858 0.9913 0.0995 0.647 -0.1314 0.7509)
:load-commands '()
@@ -698,7 +698,7 @@
:name "sunken1"
:level 'sunken
:trans (new 'static 'vector :x 3062988.5 :y -536575.56 :z -6527484.0 :w 1.0)
:quat (new 'static 'vector :y 0.5304 :w 0.8477)
:quat (new 'static 'quaternion :y 0.5304 :w 0.8477)
:camera-trans (new 'static 'vector :x 3015461.2 :y -515480.38 :z -6546573.5 :w 1.0)
:camera-rot (new 'static 'array float 9 0.3725 0.0 -0.928 0.1121 0.9926 0.045 0.9212 -0.1208 0.3697)
:load-commands '()
@@ -712,7 +712,7 @@
:name "sunken2"
:level 'sunken
:trans (new 'static 'vector :x 3133625.5 :y -569343.56 :z -6909587.5 :w 1.0)
:quat (new 'static 'vector :y -0.9512 :w 0.3083)
:quat (new 'static 'quaternion :y -0.9512 :w 0.3083)
:camera-trans (new 'static 'vector :x 3170833.2 :y -548244.25 :z -6874378.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.6872 0.0 0.7263 -0.0878 0.9926 -0.0831 -0.721 -0.1209 -0.6822)
:load-commands '()
@@ -726,7 +726,7 @@
:name "sunken-tube1"
:level 'sunken
:trans (new 'static 'vector :x 2649601.8 :y -569343.56 :z -7132970.0 :w 1.0)
:quat (new 'static 'vector :y 0.9936 :w 0.1124)
:quat (new 'static 'quaternion :y 0.9936 :w 0.1124)
:camera-trans (new 'static 'vector :x 2636150.2 :y -555656.4 :z -7114732.5 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.8024 0.0 -0.5967 0.1721 0.9574 -0.2315 0.5713 -0.2885 -0.7683)
:load-commands '()
@@ -770,7 +770,7 @@
:name "sunkenb-start"
:level 'sunkenb
:trans (new 'static 'vector :x 2229231.2 :y -1019912.2 :z -6788748.5 :w 1.0)
:quat (new 'static 'vector :y 0.895 :w 0.446)
:quat (new 'static 'quaternion :y 0.895 :w 0.446)
:camera-trans (new 'static 'vector :x 2187840.0 :y -998915.7 :z -6759328.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.5786 0.0 -0.8155 0.0992 0.9925 -0.0704 0.8094 -0.1217 -0.5743)
:load-commands '((alive "exit-chamber-1"))
@@ -784,7 +784,7 @@
:name "sunkenb-helix"
:level 'sunkenb
:trans (new 'static 'vector :x 2466572.8 :y -1838989.2 :z -7299582.0 :w 1.0)
:quat (new 'static 'vector :y -0.8841 :w 0.4672)
:quat (new 'static 'quaternion :y -0.8841 :w 0.4672)
:camera-trans (new 'static 'vector :x 2515616.2 :y -1817888.4 :z -7284843.5 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.2889 0.0 0.9573 -0.1163 0.9925 -0.0351 -0.9502 -0.1214 -0.2867)
:load-commands '()
@@ -828,7 +828,7 @@
:name "swamp-start"
:level 'swamp
:trans (new 'static 'vector :x 1842537.2 :y 21027.227 :z -7333297.5 :w 1.0)
:quat (new 'static 'vector :y -0.9933 :w 0.1153)
:quat (new 'static 'quaternion :y -0.9933 :w 0.1153)
:camera-trans (new 'static 'vector :x 1862529.9 :y 44371.56 :z -7277995.5 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.9403 0.0 0.3402 -0.0814 0.9708 -0.2252 -0.3303 -0.2394 -0.9129)
:load-commands
@@ -849,7 +849,7 @@
:name "swamp-dock1"
:level 'swamp
:trans (new 'static 'vector :x 1360386.9 :y 5823.693 :z -8218890.0 :w 1.0)
:quat (new 'static 'vector :y -0.585 :w -0.811)
:quat (new 'static 'quaternion :y -0.585 :w -0.811)
:camera-trans (new 'static 'vector :x 1314475.6 :y 26164.838 :z -8234152.5 :w 1.0)
:camera-rot (new 'static 'array float 9 0.3154 0.0 -0.9489 0.1134 0.9928 0.0376 0.9421 -0.1195 0.3131)
:load-commands
@@ -870,7 +870,7 @@
:name "swamp-cave1"
:level 'swamp
:trans (new 'static 'vector :x 1553700.5 :y 1835.4176 :z -8258429.5 :w 1.0)
:quat (new 'static 'vector :y -0.9871 :w -0.1599)
:quat (new 'static 'quaternion :y -0.9871 :w -0.1599)
:camera-trans (new 'static 'vector :x 1556873.2 :y 22715.598 :z -8208106.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.9982 0.0 0.0596 -0.0072 0.9926 -0.1209 -0.0592 -0.1211 -0.9908)
:load-commands
@@ -891,7 +891,7 @@
:name "swamp-dock2"
:level 'swamp
:trans (new 'static 'vector :x 1645872.4 :y 36495.77 :z -8427323.0 :w 1.0)
:quat (new 'static 'vector :y -0.8294 :w -0.5586)
:quat (new 'static 'quaternion :y -0.8294 :w -0.5586)
:camera-trans (new 'static 'vector :x 1599338.9 :y 57590.168 :z -8405954.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.418 0.0 -0.9084 0.1106 0.9925 -0.0509 0.9016 -0.1218 -0.4149)
:load-commands
@@ -912,7 +912,7 @@
:name "swamp-cave2"
:level 'swamp
:trans (new 'static 'vector :x 2037539.2 :y 1103.872 :z -8560013.0 :w 1.0)
:quat (new 'static 'vector :y 0.0559 :w 0.9984)
:quat (new 'static 'quaternion :y 0.0559 :w 0.9984)
:camera-trans (new 'static 'vector :x 1995208.2 :y 21832.908 :z -8586304.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.5516 0.0 -0.834 0.097 0.9932 0.0641 0.8283 -0.1163 0.5479)
:load-commands
@@ -933,7 +933,7 @@
:name "swamp-game"
:level 'swamp
:trans (new 'static 'vector :x 2612289.2 :y -2047.5905 :z -8315907.5 :w 1.0)
:quat (new 'static 'vector :y -0.6975 :w 0.7165)
:quat (new 'static 'quaternion :y -0.6975 :w 0.7165)
:camera-trans (new 'static 'vector :x 2661940.5 :y 20693.81 :z -8317980.5 :w 1.0)
:camera-rot (new 'static 'array float 9 0.0406 0.0 0.9991 -0.1452 0.9893 0.0059 -0.9885 -0.1453 0.0402)
:load-commands
@@ -954,7 +954,7 @@
:name "swamp-cave3"
:level 'swamp
:trans (new 'static 'vector :x 2011811.4 :y 3711.7952 :z -7923027.0 :w 1.0)
:quat (new 'static 'vector :y -0.5269 :w 0.8499)
:quat (new 'static 'quaternion :y -0.5269 :w 0.8499)
:camera-trans (new 'static 'vector :x 2053120.4 :y 22242.51 :z -7927784.5 :w 1.0)
:camera-rot (new 'static 'array float 9 0.1145 0.0 0.9934 -0.1412 0.9898 0.0162 -0.9833 -0.1422 0.1134)
:load-commands
@@ -1005,7 +1005,7 @@
:name "rolling-start"
:level 'rolling
:trans (new 'static 'vector :x 432272.6 :y 42821.633 :z -6737529.0 :w 1.0)
:quat (new 'static 'vector :y -0.545 :w 0.8383)
:quat (new 'static 'quaternion :y -0.545 :w 0.8383)
:camera-trans (new 'static 'vector :x 494105.8 :y 67237.48 :z -6748524.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.1759 0.0 0.9843 -0.2371 0.9705 0.0423 -0.9553 -0.2409 0.1707)
:load-commands '()
@@ -1050,7 +1050,7 @@
:name "ogre-start"
:level 'ogre
:trans (new 'static 'vector :x 849775.8 :y 163962.88 :z -7301166.5 :w 1.0)
:quat (new 'static 'vector :y -0.9931 :w 0.1166)
:quat (new 'static 'quaternion :y -0.9931 :w 0.1166)
:camera-trans (new 'static 'vector :x 848906.25 :y 185056.88 :z -7249962.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.9998 0.0 -0.0159 0.0019 0.9925 -0.1215 0.0158 -0.1215 -0.9924)
:load-commands '()
@@ -1064,7 +1064,7 @@
:name "ogre-race"
:level 'ogre
:trans (new 'static 'vector :x 841424.9 :y 163801.1 :z -8205419.5 :w 1.0)
:quat (new 'static 'vector :y -0.9857 :w 0.168)
:quat (new 'static 'quaternion :y -0.9857 :w 0.168)
:camera-trans (new 'static 'vector :x 860479.9 :y 183815.38 :z -8162368.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.9145 0.0 0.4045 -0.0497 0.9924 -0.1125 -0.4015 -0.123 -0.9075)
:load-commands '()
@@ -1078,7 +1078,7 @@
:name "ogre-end"
:level 'ogre
:trans (new 'static 'vector :x 3971233.5 :y 141227.62 :z -13935735.0 :w 1.0)
:quat (new 'static 'vector :y -0.8721 :w 0.4892)
:quat (new 'static 'quaternion :y -0.8721 :w 0.4892)
:camera-trans (new 'static 'vector :x 3997892.2 :y 159604.73 :z -13904449.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.7611 0.0 0.6485 -0.0932 0.9896 -0.1094 -0.6417 -0.1438 -0.7532)
:load-commands '()
@@ -1122,7 +1122,7 @@
:name "village3-start"
:level 'village3
:trans (new 'static 'vector :x 4468021.5 :y 186608.03 :z -14054268.0 :w 1.0)
:quat (new 'static 'vector :y 0.9999 :w 0.005)
:quat (new 'static 'quaternion :y 0.9999 :w 0.005)
:camera-trans (new 'static 'vector :x 4469439.5 :y 207701.2 :z -14003077.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.9996 0.0 0.0268 -0.0032 0.9925 -0.1216 -0.0266 -0.1216 -0.9922)
:load-commands '()
@@ -1137,7 +1137,7 @@
:level 'village3
:flags #x4
:trans (new 'static 'vector :x 4549776.0 :y 215375.88 :z -14285922.0 :w 1.0)
:quat (new 'static 'vector :y 0.681 :w 0.7322)
:quat (new 'static 'quaternion :y 0.681 :w 0.7322)
:camera-trans (new 'static 'vector :x 4543255.0 :y 226776.67 :z -14313317.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.8563 0.0 -0.2763 0.0456 0.8875 0.1413 0.2725 -0.1485 0.8446)
:load-commands '()
@@ -1151,7 +1151,7 @@
:name "village3-farside"
:level 'village3
:trans (new 'static 'vector :x 4423744.0 :y 198723.58 :z -14530641.0 :w 1.0)
:quat (new 'static 'vector :y 0.6611 :w 0.7502)
:quat (new 'static 'quaternion :y 0.6611 :w 0.7502)
:camera-trans (new 'static 'vector :x 4381844.0 :y 218599.83 :z -14551361.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.442 0.0 -0.8969 0.1099 0.9924 0.0541 0.8902 -0.1225 0.4387)
:load-commands '()
@@ -1197,7 +1197,7 @@
:name "snow-start"
:level 'snow
:trans (new 'static 'vector :x 4256260.0 :y 983713.8 :z -14182752.0 :w 1.0)
:quat (new 'static 'vector :y 0.7906 :w -0.6122)
:quat (new 'static 'quaternion :y 0.7906 :w -0.6122)
:camera-trans (new 'static 'vector :x 4303859.5 :y 1012363.7 :z -14156672.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.4804 0.0 0.877 -0.2049 0.9723 -0.1122 -0.8527 -0.2336 -0.4671)
:load-commands '()
@@ -1211,7 +1211,7 @@
:name "snow-fort"
:level 'snow
:trans (new 'static 'vector :x 3430875.2 :y 897149.3 :z -13397581.0 :w 1.0)
:quat (new 'static 'vector :y 0.0968 :w 0.9952)
:quat (new 'static 'quaternion :y 0.0968 :w 0.9952)
:camera-trans (new 'static 'vector :x 3428789.8 :y 918241.25 :z -13448724.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.9991 0.0 -0.0419 0.0051 0.9925 0.1216 0.0415 -0.1217 0.9916)
:load-commands '()
@@ -1225,7 +1225,7 @@
:name "snow-flut-flut"
:level 'snow
:trans (new 'static 'vector :x 2481850.0 :y 1054709.4 :z -13922438.0 :w 1.0)
:quat (new 'static 'vector :y 0.8628 :w -0.5055)
:quat (new 'static 'quaternion :y 0.8628 :w -0.5055)
:camera-trans (new 'static 'vector :x 2497063.0 :y 1069339.9 :z -13900353.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.8224 0.0 0.5688 -0.135 0.9713 -0.1953 -0.5525 -0.2374 -0.7989)
:load-commands '()
@@ -1239,7 +1239,7 @@
:name "snow-pass-to-fort"
:level 'snow
:trans (new 'static 'vector :x 3751044.8 :y 917612.1 :z -13828696.0 :w 1.0)
:quat (new 'static 'vector :y -0.3387 :w -0.9408)
:quat (new 'static 'quaternion :y -0.3387 :w -0.9408)
:camera-trans (new 'static 'vector :x 3779776.0 :y 933972.8 :z -13845825.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.6061 0.0 0.7953 -0.1493 0.9822 0.1138 -0.7812 -0.1878 0.5953)
:load-commands '()
@@ -1253,7 +1253,7 @@
:name "snow-by-ice-lake"
:level 'snow
:trans (new 'static 'vector :x 3151164.5 :y 1049638.1 :z -14246464.0 :w 1.0)
:quat (new 'static 'vector :y -0.6226 :w 0.7824)
:quat (new 'static 'quaternion :y -0.6226 :w 0.7824)
:camera-trans (new 'static 'vector :x 3203905.2 :y 1080037.8 :z -14270850.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.4189 0.0 0.9079 -0.2169 0.971 0.1001 -0.8816 -0.2389 0.4068)
:load-commands '()
@@ -1267,7 +1267,7 @@
:name "snow-by-ice-lake-alt"
:level 'snow
:trans (new 'static 'vector :x 3053335.0 :y 1048927.9 :z -14058945.0 :w 1.0)
:quat (new 'static 'vector :y 0.9997 :w 0.022)
:quat (new 'static 'quaternion :y 0.9997 :w 0.022)
:camera-trans (new 'static 'vector :x 3045845.5 :y 1068868.0 :z -14012568.0 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.987 0.0 -0.1601 0.0195 0.9924 -0.1207 0.1589 -0.1223 -0.9796)
:load-commands '()
@@ -1281,7 +1281,7 @@
:name "snow-outside-fort"
:level 'snow
:trans (new 'static 'vector :x 3431014.0 :y 901474.7 :z -13600187.0 :w 1.0)
:quat (new 'static 'vector :y -0.0954 :w -0.9954)
:quat (new 'static 'quaternion :y -0.0954 :w -0.9954)
:camera-trans (new 'static 'vector :x 3429969.0 :y 922565.44 :z -13651353.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.9998 0.0 -0.0196 0.0023 0.9926 0.1213 0.0195 -0.1213 0.9924)
:load-commands '()
@@ -1295,7 +1295,7 @@
:name "snow-outside-cave"
:level 'snow
:trans (new 'static 'vector :x 3200864.2 :y 907400.4 :z -13676660.0 :w 1.0)
:quat (new 'static 'vector :y 0.5867 :w -0.8097)
:quat (new 'static 'quaternion :y 0.5867 :w -0.8097)
:camera-trans (new 'static 'vector :x 3247600.8 :y 928464.06 :z -13697606.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.4062 0.0 0.9137 -0.1107 0.9926 0.0492 -0.907 -0.1211 0.4032)
:load-commands '()
@@ -1309,7 +1309,7 @@
:name "snow-across-from-flut"
:level 'snow
:trans (new 'static 'vector :x 2721898.5 :y 1049845.0 :z -13743428.0 :w 1.0)
:quat (new 'static 'vector :y -0.7688 :w -0.6394)
:quat (new 'static 'quaternion :y -0.7688 :w -0.6394)
:camera-trans (new 'static 'vector :x 2712702.5 :y 1070288.5 :z -13791593.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.9554 0.0 -0.2951 0.0343 0.9932 0.1111 0.2931 -0.1163 0.9489)
:load-commands '()
@@ -1353,7 +1353,7 @@
:name "maincave-start"
:level 'maincave
:trans (new 'static 'vector :x 4420967.0 :y 33006.387 :z -13154230.0 :w 1.0)
:quat (new 'static 'vector :y 0.0174 :w -0.9998)
:quat (new 'static 'quaternion :y 0.0174 :w -0.9998)
:camera-trans (new 'static 'vector :x 4428164.5 :y 54074.164 :z -13204933.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.99 0.0 0.1405 -0.0169 0.9927 0.1192 -0.1395 -0.1204 0.9828)
:load-commands '()
@@ -1367,7 +1367,7 @@
:name "maincave-to-darkcave"
:level 'maincave
:trans (new 'static 'vector :x 4172175.8 :y 154223.83 :z -12445165.0 :w 1.0)
:quat (new 'static 'vector :y -0.2093 :w 0.9778)
:quat (new 'static 'quaternion :y -0.2093 :w 0.9778)
:camera-trans (new 'static 'vector :x 4193893.2 :y 175317.81 :z -12491520.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.9052 0.0 0.4248 -0.0514 0.9926 0.1096 -0.4217 -0.1211 0.8986)
:load-commands '()
@@ -1381,7 +1381,7 @@
:name "maincave-to-robocave"
:level 'maincave
:trans (new 'static 'vector :x 4760896.5 :y 44221.234 :z -12409880.0 :w 1.0)
:quat (new 'static 'vector :y 0.548 :w 0.8364)
:quat (new 'static 'quaternion :y 0.548 :w 0.8364)
:camera-trans (new 'static 'vector :x 4745230.0 :y 57869.926 :z -12426885.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.7343 0.0 -0.6788 0.1872 0.9611 0.2026 0.6524 -0.2759 0.7058)
:load-commands '()
@@ -1425,7 +1425,7 @@
:name "darkcave-start"
:level 'darkcave
:trans (new 'static 'vector :x 3813246.2 :y 129487.664 :z -12114304.0 :w 1.0)
:quat (new 'static 'vector :y 0.1439 :w 0.9895)
:quat (new 'static 'quaternion :y 0.1439 :w 0.9895)
:camera-trans (new 'static 'vector :x 3793301.0 :y 145573.48 :z -12139847.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.7892 0.0 -0.614 0.1178 0.9813 0.1515 0.6026 -0.1919 0.7745)
:load-commands '()
@@ -1468,7 +1468,7 @@
:name "robocave-start"
:level 'robocave
:trans (new 'static 'vector :x 5208223.5 :y 69697.945 :z -11781496.0 :w 1.0)
:quat (new 'static 'vector :y -0.3654 :w -0.9308)
:quat (new 'static 'quaternion :y -0.3654 :w -0.9308)
:camera-trans (new 'static 'vector :x 5171715.0 :y 90796.85 :z -11817413.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 0.7006 0.0 -0.7134 0.0864 0.9926 0.0849 0.7082 -0.1212 0.6954)
@@ -1483,7 +1483,7 @@
:name "robocave-bottom"
:level 'robocave
:trans (new 'static 'vector :x 5435461.5 :y -97111.24 :z -11588379.0 :w 1.0)
:quat (new 'static 'vector :y 0.1086 :w 0.994)
:quat (new 'static 'quaternion :y 0.1086 :w 0.994)
:camera-trans (new 'static 'vector :x 5409966.5 :y -76017.664 :z -11632764.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 0.8662 0.0 -0.4996 0.0605 0.9926 0.105 0.4959 -0.1212 0.8598)
@@ -1528,7 +1528,7 @@
:name "lavatube-start"
:level 'lavatube
:trans (new 'static 'vector :x 5511317.0 :y 159871.8 :z -14621239.0 :w 1.0)
:quat (new 'static 'vector :y -0.3753 :w -0.9268)
:quat (new 'static 'quaternion :y -0.3753 :w -0.9268)
:camera-trans (new 'static 'vector :x 5510636.5 :y 197720.06 :z -14663128.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 0.9992 0.0 -0.0386 0.0178 0.8875 0.4603 0.0343 -0.4606 0.8868)
@@ -1543,7 +1543,7 @@
:name "lavatube-middle"
:level 'lavatube
:trans (new 'static 'vector :x 9081441.0 :y -3935.8464 :z -14056285.0 :w 1.0)
:quat (new 'static 'vector :y -0.7002 :w -0.7139)
:quat (new 'static 'quaternion :y -0.7002 :w -0.7139)
:camera-trans (new 'static 'vector :x 9055362.0 :y 10606.592 :z -14050822.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 -0.205 0.0 -0.9787 0.2321 0.9714 -0.0486 0.9508 -0.2371 -0.1991)
@@ -1558,7 +1558,7 @@
:name "lavatube-after-ribbon"
:level 'lavatube
:trans (new 'static 'vector :x 9954895.0 :y 390513.06 :z -16548614.0 :w 1.0)
:quat (new 'static 'vector :y -0.7485 :w -0.663)
:quat (new 'static 'quaternion :y -0.7485 :w -0.663)
:camera-trans (new 'static 'vector :x 9923721.0 :y 406466.16 :z -16541633.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 -0.2191 0.0 -0.9756 0.1906 0.9807 -0.0428 0.9568 -0.1953 -0.2149)
@@ -1573,7 +1573,7 @@
:name "lavatube-end"
:level 'lavatube
:trans (new 'static 'vector :x 11479892.0 :y -163656.5 :z -18266490.0 :w 1.0)
:quat (new 'static 'vector :y -0.9589 :w -0.2836)
:quat (new 'static 'quaternion :y -0.9589 :w -0.2836)
:camera-trans (new 'static 'vector :x 11526721.0 :y -143482.47 :z -18257412.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 -0.3027 0.0 0.953 -0.1235 0.9915 -0.0392 -0.945 -0.1296 -0.3001)
@@ -1618,7 +1618,7 @@
:name "citadel-start"
:level 'citadel
:trans (new 'static 'vector :x 11442706.0 :y -142755.84 :z -18869044.0 :w 1.0)
:quat (new 'static 'vector :y 0.9992 :w 0.0392)
:quat (new 'static 'quaternion :y 0.9992 :w 0.0392)
:camera-trans (new 'static 'vector :x 11441183.0 :y -122509.31 :z -18820882.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 -0.9991 0.0 -0.0411 0.005 0.9925 -0.122 0.0408 -0.1221 -0.9916)
@@ -1633,7 +1633,7 @@
:name "citadel-entrance"
:level 'citadel
:trans (new 'static 'vector :x 11443969.0 :y -154216.03 :z -18472782.0 :w 1.0)
:quat (new 'static 'vector :y -0.9728 :w 0.2314)
:quat (new 'static 'quaternion :y -0.9728 :w 0.2314)
:camera-trans (new 'static 'vector :x 11436929.0 :y -134244.36 :z -18426254.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 -0.9898 0.0 -0.1424 0.0173 0.9925 -0.1207 0.1413 -0.1219 -0.9824)
@@ -1649,7 +1649,7 @@
:level 'citadel
:flags #x4
:trans (new 'static 'vector :x 11454895.0 :y -161791.6 :z -18204690.0 :w 1.0)
:quat (new 'static 'vector :y 0.7511 :w 0.6601)
:quat (new 'static 'quaternion :y 0.7511 :w 0.6601)
:camera-trans (new 'static 'vector :x 11406872.0 :y -141278.0 :z -18194638.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 -0.1989 0.0 -0.98 0.1179 0.9927 -0.0239 0.9728 -0.1203 -0.1974)
@@ -1664,7 +1664,7 @@
:name "citadel-launch-start"
:level 'citadel
:trans (new 'static 'vector :x 10827551.0 :y -94047.02 :z -18946718.0 :w 1.0)
:quat (new 'static 'vector :y 0.8377 :w -0.546)
:quat (new 'static 'quaternion :y 0.8377 :w -0.546)
:camera-trans (new 'static 'vector :x 10862150.0 :y -75343.875 :z -18922316.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 -0.5766 0.0 0.8169 -0.1125 0.9904 -0.0794 -0.8091 -0.1378 -0.5711)
@@ -1679,7 +1679,7 @@
:name "citadel-launch-end"
:level 'citadel
:trans (new 'static 'vector :x 11047507.0 :y -81514.086 :z -19495960.0 :w 1.0)
:quat (new 'static 'vector :y 0.0292 :w 0.9995)
:quat (new 'static 'quaternion :y 0.0292 :w 0.9995)
:camera-trans (new 'static 'vector :x 11033498.0 :y -63027.2 :z -19534916.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 0.9413 0.0 -0.3373 0.0481 0.9897 0.1343 0.3339 -0.1427 0.9317)
@@ -1694,7 +1694,7 @@
:name "citadel-plat-start"
:level 'citadel
:trans (new 'static 'vector :x 11443470.0 :y -120194.664 :z -19845628.0 :w 1.0)
:quat (new 'static 'vector :y -0.9907 :w -0.1355)
:quat (new 'static 'quaternion :y -0.9907 :w -0.1355)
:camera-trans (new 'static 'vector :x 11443545.0 :y -99100.266 :z -19794374.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 -0.9999 0.0 0.0016 -0.0001 0.9926 -0.1207 -0.0015 -0.1207 -0.9926)
@@ -1709,7 +1709,7 @@
:name "citadel-plat-end"
:level 'citadel
:trans (new 'static 'vector :x 11269726.0 :y -12132.352 :z -19614712.0 :w 1.0)
:quat (new 'static 'vector :y -0.0419 :w 0.9991)
:quat (new 'static 'quaternion :y -0.0419 :w 0.9991)
:camera-trans (new 'static 'vector :x 11264449.0 :y 7920.8447 :z -19661710.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 0.9938 0.0 -0.1103 0.0134 0.9924 0.1215 0.1095 -0.1223 0.9864)
@@ -1724,7 +1724,7 @@
:name "citadel-generator-start"
:level 'citadel
:trans (new 'static 'vector :x 12138031.0 :y -36900.863 :z -18933304.0 :w 1.0)
:quat (new 'static 'vector :y 0.7487 :w 0.6628)
:quat (new 'static 'quaternion :y 0.7487 :w 0.6628)
:camera-trans (new 'static 'vector :x 12101831.0 :y -19811.123 :z -18933632.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 0.0093 0.0 -0.9999 0.1678 0.9858 0.0015 0.9857 -0.1678 0.0092)
@@ -1739,7 +1739,7 @@
:name "citadel-generator-end"
:level 'citadel
:trans (new 'static 'vector :x 11837483.0 :y -20177.715 :z -19506848.0 :w 1.0)
:quat (new 'static 'vector :y -0.3564 :w 0.9342)
:quat (new 'static 'quaternion :y -0.3564 :w 0.9342)
:camera-trans (new 'static 'vector :x 11872697.0 :y 887.6032 :z -19544198.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 0.7296 0.0 0.6838 -0.0851 0.9922 0.0908 -0.6785 -0.1245 0.7239)
@@ -1754,7 +1754,7 @@
:name "citadel-elevator"
:level 'citadel
:trans (new 'static 'vector :x 11447961.0 :y 234055.27 :z -19169000.0 :w 1.0)
:quat (new 'static 'vector :y 0.2351 :w 0.9719)
:quat (new 'static 'quaternion :y 0.2351 :w 0.9719)
:camera-trans (new 'static 'vector :x 11454465.0 :y 252947.66 :z -19126656.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 -0.9932 0.0 0.1161 -0.017 0.9892 -0.1454 -0.1148 -0.1464 -0.9825)
@@ -1800,7 +1800,7 @@
:name "finalboss-start"
:level 'finalboss
:trans (new 'static 'vector :x 11548456.0 :y 2215872.0 :z -19409498.0 :w 1.0)
:quat (new 'static 'vector :y 0.7325 :w 0.6807)
:quat (new 'static 'quaternion :y 0.7325 :w 0.6807)
:camera-trans (new 'static 'vector :x 11513311.0 :y 2234999.5 :z -19435708.0 :w 1.0)
:camera-rot
(new 'static 'array float 9 0.5883 0.0 -0.8085 0.1074 0.9911 0.0781 0.8014 -0.1328 0.5831)
@@ -1817,7 +1817,7 @@
:trans
(new 'static 'vector :x 12288335.0 :y 1970461.9 :z -19848522.0 :w 1.0)
:quat
(new 'static 'vector :y -0.5359 :w -0.8442)
(new 'static 'quaternion :y -0.5359 :w -0.8442)
:camera-trans
(new 'static 'vector :x 12265366.0 :y 1984228.5 :z -19842574.0 :w 1.0)
:camera-rot
@@ -1892,7 +1892,7 @@
:level 'demo
:flags #x8
:trans (new 'static 'vector :x 66396.16 :y 29782.016 :z -919973.5 :w 1.0)
:quat (new 'static 'vector :w 1.0)
:quat (new 'static 'quaternion :w 1.0)
:camera-trans (new 'static 'vector :x 76871.68 :y 55061.707 :z -938752.0 :w 1.0)
:camera-rot (new 'static 'array float 9 0.8743 0.0 0.4852 -0.2117 0.8997 0.3816 -0.4365 -0.4364 0.7866)
:load-commands '()
@@ -1936,7 +1936,7 @@
:level 'title
:flags #x80
:trans (new 'static 'vector :x -635598.9 :y 222551.66 :z 710496.25 :w 1.0)
:quat (new 'static 'vector :y -0.3323 :w -0.9431)
:quat (new 'static 'quaternion :y -0.3323 :w -0.9431)
:camera-trans (new 'static 'vector :x -665644.25 :y 250803.0 :z 668470.9 :w 1.0)
:camera-rot (new 'static 'array float 9 0.8129 0.0 -0.5823 0.0958 0.9863 0.1337 0.5744 -0.1645 0.8018)
:load-commands '()
@@ -1979,7 +1979,7 @@
:name "halfpipe"
:level 'halfpipe
:trans (new 'static 'vector :x -1048.9856 :y -172047.97 :z -212555.78 :w 1.0)
:quat (new 'static 'vector :y 0.061 :w 0.9981)
:quat (new 'static 'quaternion :y 0.061 :w 0.9981)
:camera-trans (new 'static 'vector :x -9941.401 :y -150049.17 :z -159587.94 :w 1.0)
:camera-rot (new 'static 'array float 9 -0.979 0.0 -0.2037 0.0545 0.9634 -0.2622 0.1963 -0.2678 -0.9432)
:load-commands '()
+2 -2
View File
@@ -738,7 +738,7 @@
(case (-> obj status)
(('active 'alive)
(format 0 "----------- kill ~A (status ~A)~%" obj (-> obj status))
(dummy-14 *game-info*)
(copy-perms-from-level! *game-info* obj)
(send-event *camera* 'level-deactivate (-> obj name))
(send-event *target* 'level-deactivate (-> obj name))
(remove-by-param1 *background-draw-engine* (-> obj bsp))
@@ -1191,7 +1191,7 @@
(set! (-> *load-state* want 1 display?) #f)
(set! (-> *load-state* want 1 force-inside?) #f)
(if (-> gp-1 info continues)
(dummy-19 *game-info* (the-as continue-point (car (-> gp-1 info continues))))
(set-continue! *game-info* (the-as continue-point (car (-> gp-1 info continues))))
)
)
(activate-levels! *level*)
+2 -2
View File
@@ -28,7 +28,7 @@
(get-bit (_type_ int) symbol 9)
(clear-bit (_type_ int) int 10)
(set-bit (_type_ int) int 11)
(clear (_type_) _type_ 12)
(clear-all! (_type_) _type_ 12)
)
)
@@ -91,7 +91,7 @@
0
)
(defmethod clear bit-array ((obj bit-array))
(defmethod clear-all! bit-array ((obj bit-array))
"Set all bits to zero."
(countdown (idx (/ (logand -8 (+ (-> obj allocated-length) 7)) 8))
(nop!)
+78 -94
View File
@@ -49,109 +49,97 @@
)
)
;; definition for function draw-title-credits
;; INFO: Return type mismatch int vs none.
(defun draw-title-credits ((arg0 float))
(when (>= 1.0 arg0)
(let* ((s4-0 11)
(f30-0 (* arg0 (the float (+ s4-0 -2))))
(s5-0 (the int f30-0))
(gp-0
(new
'stack
'font-context
*font-default-matrix*
0
0
0.0
0
(the-as uint 3)
)
)
)
(let ((f0-3 1.0))
)
(let ((v1-3 gp-0))
(set! (-> v1-3 width) (the float 600))
)
(let ((v1-4 gp-0))
(set! (-> v1-4 height) (the float 10))
)
(set! (-> gp-0 flags) (the-as uint 38))
(let* ((s5-1 (- s5-0 (mod s5-0 3)))
(f0-10 (- f30-0 (the float s5-1)))
)
(when (and (>= s5-1 0) (< s5-1 s4-0))
(let ((f30-1 (cond
((< f0-10 0.8)
0.0
)
((< f0-10 1.6)
(* 160.0 (+ -0.8 f0-10))
)
((< f0-10 2.2)
128.0
)
(else
(* 128.0 (- 1.0 (* 1.25 (+ -2.2 f0-10))))
)
)
(let* ((s4-0 11)
(f30-0 (* arg0 (the float (+ s4-0 -2))))
(s5-0 (the int f30-0))
(gp-0 (new 'stack 'font-context
*font-default-matrix*
0
0
0.0
0
(the-as uint 3)
)
)
)
(set! (-> gp-0 origin x) -44.0)
(set! (-> gp-0 origin y) 90.0)
(dotimes (s4-1 3)
(let* ((s2-0 (+ (+ s4-1 3840) s5-1))
(s3-0 (dummy-9 *common-text* (the-as uint s2-0) #t))
)
(when (= s2-0 3841)
(let ((v1-18 (scf-get-territory)))
(cond
((= v1-18 1)
(set! s3-0 (dummy-9 *common-text* (the-as uint 3857) #t))
)
((= v1-18 2)
(set! s3-0 (dummy-9 *common-text* (the-as uint 3856) #t))
)
)
)
)
(when s3-0
(let ((v1-25 gp-0))
(set! (-> v1-25 scale) (-> *title-credits-scale* (+ s5-1 s4-1)))
)
(print-game-text s3-0 gp-0 #f (the int f30-1) 22)
)
)
(set!
(-> gp-0 origin y)
(+
(-> gp-0 origin y)
(the float (-> *title-credits-spacing* (+ s5-1 s4-1)))
)
)
1.0
(let ((v1-3 gp-0))
(set! (-> v1-3 width) (the float 600))
)
(let ((v1-4 gp-0))
(set! (-> v1-4 height) (the float 10))
)
(set! (-> gp-0 flags) (the-as uint 38))
(let* ((s5-1 (- s5-0 (mod s5-0 3)))
(f0-10 (- f30-0 (the float s5-1)))
)
(when (and (>= s5-1 0) (< s5-1 s4-0))
(let ((f30-1 (cond
((< f0-10 0.8)
0.0
)
((< f0-10 1.6)
(* 160.0 (+ -0.8 f0-10))
)
((< f0-10 2.2)
128.0
)
(else
(* 128.0 (- 1.0 (* 1.25 (+ -2.2 f0-10))))
)
)
)
)
(set! (-> gp-0 origin x) -44.0)
(set! (-> gp-0 origin y) 90.0)
(dotimes (s4-1 3)
(let* ((s2-0 (+ (+ s4-1 3840) s5-1))
(s3-0 (lookup-text! *common-text* (the-as game-text-id s2-0) #t))
)
(when (= s2-0 3841)
(let ((v1-18 (scf-get-territory)))
(cond
((= v1-18 1)
(set! s3-0 (lookup-text! *common-text* (game-text-id europe) #t))
)
((= v1-18 2)
(set! s3-0 (lookup-text! *common-text* (game-text-id inc) #t))
)
)
)
)
(when s3-0
(let ((v1-25 gp-0))
(set! (-> v1-25 scale) (-> *title-credits-scale* (+ s5-1 s4-1)))
)
(print-game-text s3-0 gp-0 #f (the int f30-1) 22)
)
)
(set! (-> gp-0 origin y)
(+ (-> gp-0 origin y)
(the float (-> *title-credits-spacing* (+ s5-1 s4-1)))
)
)
)
)
)
)
)
)
)
)
)
0
(none)
)
;; definition for function draw-end-credits
(defun draw-end-credits ((arg0 int))
(local-vars (v1-13 int))
(let
((s4-0
(+ (- arg0) (the int (* 1.5 (the float (-> *video-parms* screen-sy)))))
)
(let ((s4-0 (+ (- arg0) (the int (* 1.5 (the float (-> *video-parms* screen-sy))))))
(gp-0 2815)
(s3-0 0)
(s2-0 #t)
(s5-0
(new 'stack 'font-context *font-default-matrix* 31 0 0.0 0 (the-as uint 3))
)
(s5-0 (new 'stack 'font-context *font-default-matrix* 31 0 0.0 0 (the-as uint 3)))
)
(let ((v1-2 s5-0))
(set! (-> v1-2 width) (the float 450))
@@ -163,11 +151,10 @@
(set! (-> v1-4 scale) 1.0)
)
(set! (-> s5-0 flags) (the-as uint 39))
(while
(or s2-0 (and (< s4-0 (- s3-0)) (< (the-as uint gp-0) (the-as uint 3249))))
(while (or s2-0 (and (< s4-0 (- s3-0)) (< (the-as uint gp-0) (the-as uint 3249))))
(+! s4-0 s3-0)
(+! gp-0 1)
(let ((a0-8 (dummy-9 *common-text* (the-as uint gp-0) #t)))
(let ((a0-8 (lookup-text! *common-text* (the-as game-text-id gp-0) #t)))
(if a0-8
(set! s3-0 (the int (+ 5.0 (print-game-text a0-8 s5-0 #t 128 20))))
(set! s3-0 25)
@@ -182,7 +169,7 @@
(else
(set! (-> s5-0 origin y) (the float s4-0))
(while (< (-> s5-0 origin y) (the float (-> *video-parms* screen-sy)))
(let ((a0-11 (dummy-9 *common-text* (the-as uint gp-0) #t)))
(let ((a0-11 (lookup-text! *common-text* (the-as game-text-id gp-0) #t)))
(if a0-11
(set! v1-13 (the int (+ 5.0 (print-game-text a0-11 s5-0 #f 128 20))))
(set! v1-13 25)
@@ -197,6 +184,3 @@
)
)
+19 -15
View File
@@ -25,9 +25,9 @@
)
(deftype task-info-data (basic)
((task-id uint8 :offset-assert 4)
(task-name symbol 4 :offset-assert 8)
(text-index-when-resolved int32 :offset-assert 24)
((task-id game-task :offset-assert 4)
(task-name game-text-id 4 :offset-assert 8)
(text-index-when-resolved int32 :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
@@ -35,11 +35,11 @@
)
(deftype level-tasks-info (basic)
((level-name-id uint32 :offset-assert 4)
(text-group-index int32 :offset-assert 8)
(nb-of-tasks int32 :offset-assert 12)
(buzzer-task-index int32 :offset-assert 16)
(task-info task-info-data 8 :offset-assert 20)
((level-name-id game-text-id :offset-assert 4)
(text-group-index int32 :offset-assert 8)
(nb-of-tasks int32 :offset-assert 12)
(buzzer-task-index int32 :offset-assert 16)
(task-info task-info-data 8 :offset-assert 20)
)
:method-count-assert 9
:size-assert #x34
@@ -47,13 +47,13 @@
)
(deftype game-option (basic)
((option-type uint64 :offset-assert 8)
(name uint32 :offset-assert 16)
(scale basic :offset-assert 20)
(param1 float :offset-assert 24)
(param2 float :offset-assert 28)
(param3 int32 :offset-assert 32)
(value-to-modify uint32 :offset-assert 36)
((option-type uint64 :offset-assert 8)
(name game-text-id :offset-assert 16)
(scale basic :offset-assert 20)
(param1 float :offset-assert 24)
(param2 float :offset-assert 28)
(param3 int32 :offset-assert 32)
(value-to-modify uint32 :offset-assert 36)
)
:method-count-assert 9
:size-assert #x28
@@ -173,3 +173,7 @@
(defun-extern activate-progress process int int)
(define-extern *level-task-data* (array level-tasks-info))
(define-extern *level-task-data-remap* (array int32))
(define-extern get-game-count (function int count-info))
(define-extern activate-orb-all (function int int)) ;; maybe in hud?
File diff suppressed because it is too large Load Diff
+186 -2
View File
@@ -9,6 +9,190 @@
;; Each game string is assigned an ID number.
;; This ID is used to lookup the string for the currently selected language.
(defenum game-text-id
:type uint32
:bitfield #f
(zero 0)
(sfx-volume #x10a)
(music-volume #x10b)
(speech-volume #x10c)
(language #x10d)
(vibrations #x10e)
(play-hints #x10f)
(center-screen #x110)
(english #x114)
(french #x115)
(german #x116)
(spanish #x117)
(italian #x118)
(japanese #x119)
(aspect-ratio #x125)
(video-mode #x126)
(game-options #x127)
(graphic-options #x128)
(sound-options #x129)
(hidden-power-cell #x12f) ;; why is this here??
(continue-without-saving #x13f)
(back #x13e)
(load-game #x14b)
(save-game #x14c)
(options #x150)
(new-game #x15c)
(ok #x15e)
(exit-demo #x15f)
(quit-game #x16f)
(village1-mayor-money #x200)
(vollage1-uncle-money #x201)
(village1-yakow-herd #x202)
(village1-yakow-return #x203)
(village1-oracle #x204)
(beach-ecorocks #x205)
(beach-flutflut-push #x206)
(beach-flutflut-meet #x207)
(beach-pelican #x208)
(beach-seagull #x209)
(beach-cannon #x20a)
(beach-buzzer #x20b)
(jungle-lurkerm-connect #x20c)
(jungle-tower #x20d)
(jungle-eggtop #x20e)
(jungle-plant #x20f)
(jungle-fishgame #x210)
(misty-muse-catch #x211)
(misty-muse-return #x212)
(misty-boat #x213)
(misty-cannon #x214)
(misty-return-to-pool #x215) ;; task name??
(misty-find-transpad #x216) ;; task name?
(misty-balloon-lurkers #x217)
(village1-level-name #x220)
(beach-level-name #x221)
(jungle-level-name #x222)
(misty-level-name #x223)
(beach-seagull-get #x22e)
(jungle-lurkerm-unblock #x22f)
(jungle-lurkerm-return #x230)
(MISSING-orb-hint #x233)
(beach-gimmie #x262)
(beach-sentinel #x263)
(jungle-canyon-end #x264)
(jungle-temple-door #x265)
(misty-bike-jump #x266)
(misty-eco-challenge #x267)
(village2-gambler-money #x300)
(village2-geologist-money #x301)
(village2-warrior-money #x302)
(village2-oracle-money #x303)
(swamp-tether #x304)
(swamp-flutflut #x307)
(swamp-billy #x309)
(sunken-elevator-raise #x30a)
(sunken-elevator-get-to-roof #x30b)
(sunken-pipe #x30c)
(sunken-climb-tube #x30d) ;; task name?
(sunken-pool #x30e) ;; task name?
(sunken-platforms #x30f)
(rolling-moles #x310)
(rolling-moles-return #x311)
(rolling-robbers #x312)
(rolling-race #x313)
(rolling-race-return #x314)
(rolling-lake #x315)
(rolling-plants #x316)
(unknown-buzzers #x317)
(village2-level-name #x319)
(rolling-level-name #x31b)
(swamp-level-name #x31c)
(sunken-level-name #x31d)
(ogre-level-name #x31e)
(swamp-battle #x321)
(sunken-bottom #x322) ;; task name?
(reach-center #x323) ;; task name?
(rolling-ring-chase-1 #x324)
(rolling-ring-chase-2 #x325)
(village3-miner-money #x400)
(village3-oracle-money #x401)
(snow-ram-3-left #x402)
(snow-ram-2-left #x403)
(snow-ram-1-left #x404)
(snow-fort #x405)
(snow-bunnies #x406)
(snow-open-door #x408) ;; task name?
(cave-robot-climb #x40e)
(cave-dark-climb #x40f) ;; destroy crystals
(cave-gnawers #x410)
(cave-dark-crystals #x411)
(village3-buzzer #x413)
(village3-level-name #x415)
(snowy-level-name #x417)
(cave-level-name #x419)
(lavatube-level-name #x41b)
(snow-eggtop #x421)
(cave-spider-tunnel #x423)
(cave-platforms #x424)
(cave-swing-poles #x426)
(snow-frozen-crate #x42b) ;; task name?
(snow-bumpers #x42c)
(fire-canyon-end #x500)
(fire-canyon-buzzer #x501)
(fire-canyon-level-name #x50c)
(ogre-end #x600)
(ogre-buzzer #x601)
(ogre-boss #x603)
(lavatube-end #x700)
(lavatube-buzzer #x701)
(citadel-buzzer #x800)
(citadel-level-name #x801)
(citadel-sage-blue #x802)
(citadel-sage-red #x803)
(citadel-sage-yellow #x804)
(citadel-sage-green #x805)
(training-gimmie-task-name #x91b)
(training-buzzer-task-name #x91c)
(training-door-task-name #x91d)
(training-climb-task-name #x91e)
(training-level-name #x91f)
(inc #xf10)
(europe #xf11)
)
;; an individual string.
(deftype game-text (structure)
((id uint32 :offset-assert 0)
@@ -31,8 +215,8 @@
:size-assert #x10
:flag-assert #xa00000010
(:methods
(dummy-9 (_type_ uint symbol) string 9)
)
(lookup-text! (_type_ game-text-id symbol) string 9)
)
)
;; todo, need support for array
+40 -1
View File
@@ -44,6 +44,45 @@
;; todo method 8
;; todo method 9
(defmethod lookup-text! game-text-info ((obj game-text-info) (arg0 game-text-id) (arg1 symbol))
"Look up text by ID. Will return the string.
If the ID can't be found, and arg1 is #t, it will return #f,
otherwise the temp string UNKNOWN ID <id number>"
;; binary search for it
(let* ((a1-1 0) ;; min
(a3-0 (+ (-> obj length) 1)) ;; max
(v1-2 (/ (+ a1-1 a3-0) 2)) ;; mid
)
(let ((t0-0 -1)) ;; last time's lookup
(while (and (!= (-> obj data v1-2 id) arg0) (!= v1-2 t0-0)) ;; while we haven't found it/not the same as last time
(if (< arg0 (-> obj data v1-2 id))
(set! a3-0 v1-2) ;; bisect, right
(set! a1-1 v1-2) ;; bisect, left
)
(set! t0-0 v1-2) ;; remeber last time
(set! v1-2 (/ (+ a1-1 a3-0) 2)) ;; midpoint for next time
)
)
(cond
((!= (-> obj data v1-2 id) arg0) ;; didn't find it :(
(cond
(arg1
(the-as string #f)
)
(else
(format (clear *temp-string*) "UNKNOWN ID ~D" arg0)
*temp-string*
)
)
)
(else
(-> obj data v1-2 text) ;; found it!
)
)
)
)
;; todo text-is-loading
;; todo load-game-text-info
;; todo load-level-text-files
@@ -53,4 +92,4 @@
;; todo print-game-text
;; todo disable-level-text-file-loading
;; todo enable-level-text-file-loading
+2 -2
View File
@@ -404,7 +404,7 @@
)
(defmacro get-process-from-handle (handle)
(defmacro handle->process (handle)
;; the actual implementation is more clever than this.
;; Checks PID.
`(if (-> ,handle process)
@@ -433,7 +433,7 @@
;; a 0 in the process field, so we check it manually here.
(if (nonzero? (-> obj u64))
(format #t "#<handle :process ~A :pid ~D>"
(get-process-from-handle obj)
(handle->process obj)
(-> obj pid)
)
(format #t "#<handle :process 0 :pid 0>")
+6 -5
View File
@@ -19,8 +19,9 @@ CallingConvention get_function_calling_convention(const TypeSpec& function_type,
}
} else {
for (int i = 0; i < (int)function_type.arg_count() - 1; i++) {
auto info = type_system.lookup_type(function_type.get_arg(i));
if (dynamic_cast<const ValueType*>(info) && info->get_load_size() == 16) {
auto info = type_system.lookup_type_allow_partial_def(function_type.get_arg(i));
auto load_size = type_system.get_load_size_allow_partial_def(function_type.get_arg(i));
if (dynamic_cast<const ValueType*>(info) && load_size == 16) {
cc.arg_regs.push_back(emitter::gRegInfo.get_xmm_arg_reg(xmm_idx++));
} else {
cc.arg_regs.push_back(emitter::gRegInfo.get_gpr_arg_reg(gpr_idx++));
@@ -29,7 +30,7 @@ CallingConvention get_function_calling_convention(const TypeSpec& function_type,
}
if (function_type.last_arg() != TypeSpec("none")) {
if (type_system.lookup_type(function_type.last_arg())->get_load_size() == 16) {
if (type_system.get_load_size_allow_partial_def(function_type.last_arg()) == 16) {
cc.return_reg = emitter::gRegInfo.get_xmm_ret_reg();
} else {
cc.return_reg = emitter::gRegInfo.get_gpr_ret_reg();
@@ -45,8 +46,8 @@ std::vector<emitter::Register> get_arg_registers(const TypeSystem& type_system,
int gpr_idx = 0;
int xmm_idx = 0;
for (auto& type : arg_types) {
auto info = type_system.lookup_type(type);
if (info->get_load_size() == 16) {
auto load_size = type_system.get_load_size_allow_partial_def(type);
if (load_size == 16) {
result.push_back(emitter::gRegInfo.get_xmm_arg_reg(xmm_idx++));
} else {
result.push_back(emitter::gRegInfo.get_gpr_arg_reg(gpr_idx++));
+13 -1
View File
@@ -89,4 +89,16 @@
)
(defconstant PI (the-as float #x40490fda))
(defconstant MINUS_PI (the-as float #xc0490fda))
(defconstant MINUS_PI (the-as float #xc0490fda))
(defmacro handle->process (handle)
;; the actual implementation is more clever than this.
;; Checks PID.
`(if (-> ,handle process)
(let ((proc (-> (-> ,handle process))))
(if (= (-> ,handle pid) (-> proc pid))
proc
)
)
)
)
@@ -32,7 +32,7 @@
:size-assert #x10
:flag-assert #xa00000010
(:methods
(dummy-9 () none 9)
(update-perm! (_type_ symbol entity-perm-status) _type_ 9)
)
)
@@ -61,7 +61,7 @@
(deftype entity-links (structure)
((prev-link entity-links :offset-assert 0)
(next-link entity-links :offset-assert 4)
(entity basic :offset-assert 8)
(entity entity :offset-assert 8)
(process process :offset-assert 12)
(level level :offset-assert 16)
(vis-id int32 :offset-assert 20)
@@ -119,7 +119,8 @@
;; definition of type entity-links-array
(deftype entity-links-array (inline-array-class)
()
((data entity-links :inline :dynamic :offset-assert 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
@@ -130,7 +131,7 @@
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tdata[0] @ #x~X~%" (-> obj _data))
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
obj
)
@@ -122,7 +122,7 @@
(:methods
(new (symbol type process pickup-type float) _type_ 0)
(dummy-9 () none 9)
(dummy-10 (_type_ symbol) none 10)
(reset! (_type_ symbol) none 10)
(dummy-11 (_type_) float 11)
)
)
@@ -506,7 +506,7 @@
)
)
(set! (-> obj eco-source) (the-as uint #f))
(dummy-10 obj #f)
(reset! obj #f)
obj
)
)
@@ -118,25 +118,25 @@
;; definition of type continue-point
(deftype continue-point (basic)
((name basic :offset-assert 4)
(level basic :offset-assert 8)
(flags uint32 :offset-assert 12)
(trans vector :inline :offset-assert 16)
(quat vector :inline :offset-assert 32)
(camera-trans vector :inline :offset-assert 48)
(camera-rot float 9 :offset-assert 64)
(load-commands pair :offset-assert 100)
(vis-nick basic :offset-assert 104)
(lev0 basic :offset-assert 108)
(disp0 basic :offset-assert 112)
(lev1 basic :offset-assert 116)
(disp1 basic :offset-assert 120)
((name string :offset-assert 4)
(level basic :offset-assert 8)
(flags uint32 :offset-assert 12)
(trans vector :inline :offset-assert 16)
(quat quaternion :inline :offset-assert 32)
(camera-trans vector :inline :offset-assert 48)
(camera-rot float 9 :offset-assert 64)
(load-commands pair :offset-assert 100)
(vis-nick basic :offset-assert 104)
(lev0 basic :offset-assert 108)
(disp0 basic :offset-assert 112)
(lev1 basic :offset-assert 116)
(disp1 basic :offset-assert 120)
)
:method-count-assert 10
:size-assert #x7c
:flag-assert #xa0000007c
(:methods
(dummy-9 () none 9)
(debug-draw! (_type_) none 9)
)
)
@@ -161,75 +161,75 @@
;; definition of type game-info
(deftype game-info (basic)
((mode symbol :offset-assert 4)
(save-name basic :offset-assert 8)
(life float :offset-assert 12)
(life-max float :offset-assert 16)
(money float :offset-assert 20)
(money-total float :offset-assert 24)
(money-per-level uint8 32 :offset-assert 28)
(deaths-per-level uint8 32 :offset-assert 60)
(buzzer-total float :offset-assert 92)
(fuel float :offset-assert 96)
(perm-list entity-perm-array :offset-assert 100)
(task-perm-list entity-perm-array :offset-assert 104)
(current-continue continue-point :offset-assert 108)
(text-ids-seen bit-array :offset-assert 112)
(level-opened uint8 32 :offset-assert 116)
(hint-control array :offset-assert 148)
(task-hint-control array :offset-assert 152)
(total-deaths int32 :offset-assert 156)
(continue-deaths int32 :offset-assert 160)
(fuel-cell-deaths int32 :offset-assert 164)
(game-start-time uint64 :offset-assert 168)
(continue-time uint64 :offset-assert 176)
(death-time uint64 :offset-assert 184)
(hit-time uint64 :offset-assert 192)
(fuel-cell-pickup-time uint64 :offset-assert 200)
(fuel-cell-time array :offset-assert 208)
(enter-level-time array :offset-assert 212)
(in-level-time array :offset-assert 216)
(blackout-time uint64 :offset-assert 224)
(letterbox-time uint64 :offset-assert 232)
(hint-play-time uint64 :offset-assert 240)
(display-text-time uint64 :offset-assert 248)
(display-text-handle uint64 :offset-assert 256)
(death-movie-tick int32 :offset-assert 264)
(want-auto-save symbol :offset-assert 268)
(auto-save-proc uint64 :offset-assert 272)
(auto-save-status uint32 :offset-assert 280)
(auto-save-card int32 :offset-assert 284)
(auto-save-which int32 :offset-assert 288)
(pov-camera-handle uint64 :offset-assert 296)
(other-camera-handle uint64 :offset-assert 304)
(death-pos vector-array :offset-assert 312)
(dummy basic :offset-assert 316)
(auto-save-count int32 :offset-assert 320)
((mode symbol :offset-assert 4)
(save-name basic :offset-assert 8)
(life float :offset-assert 12)
(life-max float :offset-assert 16)
(money float :offset-assert 20)
(money-total float :offset-assert 24)
(money-per-level uint8 32 :offset-assert 28)
(deaths-per-level uint8 32 :offset-assert 60)
(buzzer-total float :offset-assert 92)
(fuel float :offset-assert 96)
(perm-list entity-perm-array :offset-assert 100)
(task-perm-list entity-perm-array :offset-assert 104)
(current-continue continue-point :offset-assert 108)
(text-ids-seen bit-array :offset-assert 112)
(level-opened uint8 32 :offset-assert 116)
(hint-control (array level-hint-control) :offset-assert 148)
(task-hint-control array :offset-assert 152)
(total-deaths int32 :offset-assert 156)
(continue-deaths int32 :offset-assert 160)
(fuel-cell-deaths int32 :offset-assert 164)
(game-start-time uint64 :offset-assert 168)
(continue-time uint64 :offset-assert 176)
(death-time uint64 :offset-assert 184)
(hit-time uint64 :offset-assert 192)
(fuel-cell-pickup-time uint64 :offset-assert 200)
(fuel-cell-time (array uint64) :offset-assert 208)
(enter-level-time (array uint64) :offset-assert 212)
(in-level-time (array uint64) :offset-assert 216)
(blackout-time uint64 :offset-assert 224)
(letterbox-time uint64 :offset-assert 232)
(hint-play-time uint64 :offset-assert 240)
(display-text-time uint64 :offset-assert 248)
(display-text-handle uint64 :offset-assert 256)
(death-movie-tick int32 :offset-assert 264)
(want-auto-save symbol :offset-assert 268)
(auto-save-proc handle :offset-assert 272)
(auto-save-status uint32 :offset-assert 280)
(auto-save-card int32 :offset-assert 284)
(auto-save-which int32 :offset-assert 288)
(pov-camera-handle uint64 :offset-assert 296)
(other-camera-handle uint64 :offset-assert 304)
(death-pos vector-array :offset-assert 312)
(dummy basic :offset-assert 316)
(auto-save-count int32 :offset-assert 320)
)
:method-count-assert 29
:size-assert #x144
:flag-assert #x1d00000144
(:methods
(dummy-9 (_type_ symbol symbol string) none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 (_type_ uint) entity-perm 13)
(dummy-14 (_type_) none 14)
(dummy-15 (_type_) none 15)
(dummy-16 () none 16)
(dummy-17 (_type_) continue-point 17)
(dummy-18 () none 18)
(dummy-19 (_type_ continue-point) none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(initialize! (_type_ symbol game-save string) _type_ 9)
(adjust (_type_ symbol float handle) float 10)
(task-complete? (_type_ game-task) symbol 11)
(lookup-entity-perm-by-aid (_type_ uint) entity-perm 12)
(get-entity-task-perm (_type_ game-task) entity-perm 13)
(copy-perms-from-level! (_type_ level) none 14)
(copy-perms-to-level! (_type_ level) none 15)
(debug-print (_type_ symbol) _type_ 16)
(get-or-create-continue! (_type_) continue-point 17)
(get-continue-by-name (_type_ string) continue-point 18)
(set-continue! (_type_ basic) continue-point 19)
(buzzer-count (_type_ game-task) int 20)
(seen-text? (_type_ game-text-id) symbol 21)
(mark-text-as-seen (_type_ game-text-id) none 22)
(got-buzzer? (_type_ game-task int) symbol 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 () none 28)
(load-game! (_type_ game-save) game-save 25)
(clear-text-seen! (_type_ game-text-id) none 26)
(get-death-count (_type_ symbol) int 27)
(get-health-percent-lost (_type_) float 28)
)
)
@@ -289,12 +289,18 @@
gp-0
(new 'static 'game-info :mode 'debug :current-continue #f)
)
(set! (-> gp-0 fuel-cell-time) (new 'global 'boxed-array uint64 116))
(set!
(-> gp-0 fuel-cell-time)
(the-as (array uint64) (new 'global 'boxed-array uint64 116))
)
(set!
(-> gp-0 enter-level-time)
(new 'global 'boxed-array uint64 32)
(the-as (array uint64) (new 'global 'boxed-array uint64 32))
)
(set!
(-> gp-0 in-level-time)
(the-as (array uint64) (new 'global 'boxed-array uint64 32))
)
(set! (-> gp-0 in-level-time) (new 'global 'boxed-array uint64 32))
(set! *game-info* gp-0)
gp-0
)
@@ -5,20 +5,20 @@
(deftype task-cstage (structure)
((game-task game-task :offset-assert 0)
(status task-status :offset-assert 8)
(flags uint8 :offset-assert 16)
(flags task-flags :offset-assert 16)
(condition (function task-control symbol) :offset-assert 20)
)
:method-count-assert 16
:size-assert #x18
:flag-assert #x1000000018
(:methods
(get-game-task (_type_) uint 9)
(get-task-status (_type_) uint 10)
(TODO-RENAME-11 (_type_ task-control) symbol 11)
(first-flag-bit? (_type_) symbol 12)
(third-flag-bit? (_type_) symbol 13)
(TODO-RENAME-14 (_type_) int 14)
(clear-all-but-first-flag-bit (_type_) int 15)
(get-game-task (_type_) game-task 9)
(get-task-status (_type_) task-status 10)
(task-available? (_type_ task-control) symbol 11)
(closed? (_type_) symbol 12)
(closed-by-default? (_type_) symbol 13)
(close-task! (_type_) int 14)
(open-task! (_type_) int 15)
)
)
@@ -44,13 +44,13 @@
(current-task (_type_) int 9)
(current-status (_type_) int 10)
(close-current! (_type_) none 11)
(close-status! (_type_ int) int 12)
(close-status! (_type_ task-status) int 12)
(first-any (_type_ symbol) int 13)
(reset! (_type_ symbol symbol) int 14)
(closed? (_type_ int int) symbol 15)
(closed? (_type_ game-task task-status) symbol 15)
(get-reminder (_type_ int) int 16)
(save-reminder (_type_ int int) int 17)
(exists? (_type_ int int) symbol 18)
(exists? (_type_ game-task task-status) symbol 18)
)
)
File diff suppressed because it is too large Load Diff
@@ -27,7 +27,7 @@
;; definition of type border-plane
(deftype border-plane (basic)
((name basic :offset-assert 4)
((name symbol :offset-assert 4)
(action basic :offset-assert 8)
(slot int8 :offset-assert 12)
(trans vector :inline :offset-assert 16)
@@ -37,8 +37,8 @@
:size-assert #x30
:flag-assert #xb00000030
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(debug-draw! (_type_) none 9)
(point-past-plane? (_type_ vector) symbol 10)
)
)
@@ -104,8 +104,8 @@
((s5-1 (the-as res-lump (-> (the-as vol-control gp-0) process entity)))
(s4-0 (-> (lookup-tag-idx (the-as entity s5-1) 'vol 'exact 0.0) lo))
)
(when (>= s4-0 0)
(let ((s3-0 s4-0)
(when (>= (the-as int s4-0) 0)
(let ((s3-0 (the-as uint s4-0))
(s2-0 (-> s5-1 tag s4-0))
)
0
@@ -144,8 +144,8 @@
((s5-2 (the-as res-lump (-> (the-as vol-control gp-0) process entity)))
(s4-1 (-> (lookup-tag-idx (the-as entity s5-2) 'cutoutvol 'exact 0.0) lo))
)
(when (>= s4-1 0)
(let ((s3-1 s4-1)
(when (>= (the-as int s4-1) 0)
(let ((s3-1 (the-as uint s4-1))
(s2-1 (-> s5-2 tag s4-1))
)
0
@@ -26,7 +26,7 @@
:trans
(new 'static 'vector :x -5393626.5 :y 28072.346 :z 4332472.5 :w 1.0)
:quat
(new 'static 'vector :y 0.9995 :w 0.0297)
(new 'static 'quaternion :y 0.9995 :w 0.0297)
:camera-trans
(new 'static 'vector :x -5426915.0 :y 45930.906 :z 4353156.0 :w 1.0)
:camera-rot
@@ -90,7 +90,7 @@
:trans
(new 'static 'vector :x -5383524.0 :y 28019.098 :z 4360302.0 :w 1.0)
:quat
(new 'static 'vector :y 0.084 :w 0.9964)
(new 'static 'quaternion :y 0.084 :w 0.9964)
:camera-trans
(new 'static 'vector :x -5366765.0 :y 45646.234 :z 4325889.0 :w 1.0)
:camera-rot
@@ -154,7 +154,7 @@
:trans
(new 'static 'vector :x -5393740.5 :y 28259.533 :z 4360945.5 :w 1.0)
:quat
(new 'static 'vector :y 0.9993 :w 0.0359)
(new 'static 'quaternion :y 0.9993 :w 0.0359)
:camera-trans
(new 'static 'vector :x -5434444.5 :y 47050.344 :z 4372832.5 :w 1.0)
:camera-rot
@@ -254,7 +254,7 @@
:trans
(new 'static 'vector :x -638860.06 :y 139319.7 :z 769990.6 :w 1.0)
:quat
(new 'static 'vector :y -0.9889 :w -0.148)
(new 'static 'quaternion :y -0.9889 :w -0.148)
:camera-trans
(new 'static 'vector :x -668114.1 :y 164536.31 :z 828633.06 :w 1.0)
:camera-rot
@@ -283,7 +283,7 @@
:trans
(new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0)
:quat
(new 'static 'vector :y 0.591 :w 0.8066)
(new 'static 'quaternion :y 0.591 :w 0.8066)
:camera-trans
(new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0)
:camera-rot
@@ -312,7 +312,7 @@
:trans
(new 'static 'vector :x -518468.8 :y 189424.03 :z 868568.7 :w 1.0)
:quat
(new 'static 'vector :y 0.591 :w 0.8066)
(new 'static 'quaternion :y 0.591 :w 0.8066)
:camera-trans
(new 'static 'vector :x -559109.3 :y 200461.92 :z 826073.06 :w 1.0)
:camera-rot
@@ -341,7 +341,7 @@
:trans
(new 'static 'vector :x -542529.1 :y 189424.03 :z 847101.94 :w 1.0)
:quat
(new 'static 'vector :y -0.1717 :w -0.9851)
(new 'static 'quaternion :y -0.1717 :w -0.9851)
:camera-trans
(new 'static 'vector :x -559085.2 :y 202996.53 :z 826054.25 :w 1.0)
:camera-rot
@@ -370,7 +370,7 @@
:trans
(new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0)
:quat
(new 'static 'vector :y -0.2339 :w 0.9722)
(new 'static 'quaternion :y -0.2339 :w 0.9722)
:camera-trans
(new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0)
:camera-rot
@@ -484,7 +484,7 @@
:trans
(new 'static 'vector :x -504960.22 :y 9477.325 :z -223513.81 :w 1.0)
:quat
(new 'static 'vector :y 0.9486 :w -0.3163)
(new 'static 'quaternion :y 0.9486 :w -0.3163)
:camera-trans
(new 'static 'vector :x -487550.16 :y 28354.15 :z -184211.05 :w 1.0)
:camera-rot
@@ -549,7 +549,7 @@
:trans
(new 'static 'vector :x 1057631.9 :y 86404.305 :z -647140.56 :w 1.0)
:quat
(new 'static 'vector :y -0.9009 :w -0.4339)
(new 'static 'quaternion :y -0.9009 :w -0.4339)
:camera-trans
(new 'static 'vector :x 1004424.8 :y 111181.82 :z -611527.9 :w 1.0)
:camera-rot
@@ -616,7 +616,7 @@
:trans
(new 'static 'vector :x 1469510.0 :y -204745.52 :z -959058.3 :w 1.0)
:quat
(new 'static 'vector :y -0.6194 :w -0.785)
(new 'static 'quaternion :y -0.6194 :w -0.785)
:camera-trans
(new 'static 'vector :x 1485298.5 :y -189972.08 :z -936548.75 :w 1.0)
:camera-rot
@@ -677,7 +677,7 @@
:trans
(new 'static 'vector :x 164316.78 :y 15128.576 :z 3390588.0 :w 1.0)
:quat
(new 'static 'vector :y -0.2339 :w 0.9722)
(new 'static 'quaternion :y -0.2339 :w 0.9722)
:camera-trans
(new 'static 'vector :x 204089.34 :y 36257.793 :z 3358341.0 :w 1.0)
:camera-rot
@@ -748,7 +748,7 @@
:trans
(new 'static 'vector :x -672503.0 :y 82131.35 :z 3651465.8 :w 1.0)
:quat
(new 'static 'vector :y 0.0878 :w 0.9961)
(new 'static 'quaternion :y 0.0878 :w 0.9961)
:camera-trans
(new 'static 'vector :x -675754.0 :y 102028.91 :z 3604800.8 :w 1.0)
:camera-rot
@@ -819,7 +819,7 @@
:trans
(new 'static 'vector :x 302533.44 :y 35901.848 :z 4138967.8 :w 1.0)
:quat
(new 'static 'vector :y -0.2809 :w 0.9597)
(new 'static 'quaternion :y -0.2809 :w 0.9597)
:camera-trans
(new 'static 'vector :x 338476.25 :y 55700.684 :z 4109729.0 :w 1.0)
:camera-rot
@@ -890,7 +890,7 @@
:trans
(new 'static 'vector :x -304192.72 :y 33270.99 :z 4646525.0 :w 1.0)
:quat
(new 'static 'vector :y -0.8443 :w -0.5357)
(new 'static 'quaternion :y -0.8443 :w -0.5357)
:camera-trans
(new 'static 'vector :x -346989.78 :y 54377.676 :z 4674685.5 :w 1.0)
:camera-rot
@@ -961,7 +961,7 @@
:trans
(new 'static 'vector :x -898000.06 :y 98038.17 :z 4162091.0 :w 1.0)
:quat
(new 'static 'vector :y -0.1102 :w 0.9938)
(new 'static 'quaternion :y -0.1102 :w 0.9938)
:camera-trans
(new 'static 'vector :x -931459.9 :y 118198.68 :z 4196081.0 :w 1.0)
:camera-rot
@@ -1068,7 +1068,7 @@
:trans
(new 'static 'vector :x -87377.1 :y 126444.75 :z -681697.25 :w 1.0)
:quat
(new 'static 'vector :y 0.9921 :w -0.1246)
(new 'static 'quaternion :y 0.9921 :w -0.1246)
:camera-trans
(new 'static 'vector :x -84559.055 :y 144685.47 :z -641194.0 :w 1.0)
:camera-rot
@@ -1096,7 +1096,7 @@
:trans
(new 'static 'vector :x 1360576.1 :y 126976.0 :z -5839533.5 :w 1.0)
:quat
(new 'static 'vector :y 0.1666 :w 0.986)
(new 'static 'quaternion :y 0.1666 :w 0.986)
:camera-trans
(new 'static 'vector :x 1378912.6 :y 144452.81 :z -5872527.0 :w 1.0)
:camera-rot
@@ -1160,7 +1160,7 @@
:trans
(new 'static 'vector :x 1460961.2 :y 108562.02 :z -6161391.0 :w 1.0)
:quat
(new 'static 'vector :y 0.9917 :w 0.1278)
(new 'static 'quaternion :y 0.9917 :w 0.1278)
:camera-trans
(new 'static 'vector :x 1468018.8 :y 133790.92 :z -6096227.0 :w 1.0)
:camera-rot
@@ -1189,7 +1189,7 @@
:trans
(new 'static 'vector :x 1592492.9 :y 91648.0 :z -6328677.0 :w 1.0)
:quat
(new 'static 'vector :y 0.7469 :w 0.6648)
(new 'static 'quaternion :y 0.7469 :w 0.6648)
:camera-trans
(new 'static 'vector :x 1555766.1 :y 103759.46 :z -6318964.5 :w 1.0)
:camera-rot
@@ -1217,7 +1217,7 @@
:trans
(new 'static 'vector :x 1264346.8 :y 19451.494 :z -6833563.5 :w 1.0)
:quat
(new 'static 'vector :y 0.0258 :w 0.9996)
(new 'static 'quaternion :y 0.0258 :w 0.9996)
:camera-trans
(new 'static 'vector :x 1265547.2 :y 34647.656 :z -6862636.5 :w 1.0)
:camera-rot
@@ -1281,7 +1281,7 @@
:trans
(new 'static 'vector :x 2172095.2 :y -591749.94 :z -6721553.0 :w 1.0)
:quat
(new 'static 'vector :y -0.5083 :w 0.8611)
(new 'static 'quaternion :y -0.5083 :w 0.8611)
:camera-trans
(new 'static 'vector :x 2138871.5 :y -572296.4 :z -6751967.5 :w 1.0)
:camera-rot
@@ -1309,7 +1309,7 @@
:trans
(new 'static 'vector :x 3062988.5 :y -536575.56 :z -6527484.0 :w 1.0)
:quat
(new 'static 'vector :y 0.5304 :w 0.8477)
(new 'static 'quaternion :y 0.5304 :w 0.8477)
:camera-trans
(new 'static 'vector :x 3015461.2 :y -515480.38 :z -6546573.5 :w 1.0)
:camera-rot
@@ -1337,7 +1337,7 @@
:trans
(new 'static 'vector :x 3133625.5 :y -569343.56 :z -6909587.5 :w 1.0)
:quat
(new 'static 'vector :y -0.9512 :w 0.3083)
(new 'static 'quaternion :y -0.9512 :w 0.3083)
:camera-trans
(new 'static 'vector :x 3170833.2 :y -548244.25 :z -6874378.0 :w 1.0)
:camera-rot
@@ -1365,7 +1365,7 @@
:trans
(new 'static 'vector :x 2649601.8 :y -569343.56 :z -7132970.0 :w 1.0)
:quat
(new 'static 'vector :y 0.9936 :w 0.1124)
(new 'static 'quaternion :y 0.9936 :w 0.1124)
:camera-trans
(new 'static 'vector :x 2636150.2 :y -555656.4 :z -7114732.5 :w 1.0)
:camera-rot
@@ -1425,7 +1425,8 @@
:level 'sunkenb
:trans
(new 'static 'vector :x 2229231.2 :y -1019912.2 :z -6788748.5 :w 1.0)
:quat (new 'static 'vector :y 0.895 :w 0.446)
:quat
(new 'static 'quaternion :y 0.895 :w 0.446)
:camera-trans
(new 'static 'vector :x 2187840.0 :y -998915.7 :z -6759328.0 :w 1.0)
:camera-rot
@@ -1453,7 +1454,7 @@
:trans
(new 'static 'vector :x 2466572.8 :y -1838989.2 :z -7299582.0 :w 1.0)
:quat
(new 'static 'vector :y -0.8841 :w 0.4672)
(new 'static 'quaternion :y -0.8841 :w 0.4672)
:camera-trans
(new 'static 'vector :x 2515616.2 :y -1817888.4 :z -7284843.5 :w 1.0)
:camera-rot
@@ -1514,7 +1515,7 @@
:trans
(new 'static 'vector :x 1842537.2 :y 21027.227 :z -7333297.5 :w 1.0)
:quat
(new 'static 'vector :y -0.9933 :w 0.1153)
(new 'static 'quaternion :y -0.9933 :w 0.1153)
:camera-trans
(new 'static 'vector :x 1862529.9 :y 44371.56 :z -7277995.5 :w 1.0)
:camera-rot
@@ -1561,7 +1562,7 @@
:trans
(new 'static 'vector :x 1360386.9 :y 5823.693 :z -8218890.0 :w 1.0)
:quat
(new 'static 'vector :y -0.585 :w -0.811)
(new 'static 'quaternion :y -0.585 :w -0.811)
:camera-trans
(new 'static 'vector :x 1314475.6 :y 26164.838 :z -8234152.5 :w 1.0)
:camera-rot
@@ -1608,7 +1609,7 @@
:trans
(new 'static 'vector :x 1553700.5 :y 1835.4176 :z -8258429.5 :w 1.0)
:quat
(new 'static 'vector :y -0.9871 :w -0.1599)
(new 'static 'quaternion :y -0.9871 :w -0.1599)
:camera-trans
(new 'static 'vector :x 1556873.2 :y 22715.598 :z -8208106.0 :w 1.0)
:camera-rot
@@ -1655,7 +1656,7 @@
:trans
(new 'static 'vector :x 1645872.4 :y 36495.77 :z -8427323.0 :w 1.0)
:quat
(new 'static 'vector :y -0.8294 :w -0.5586)
(new 'static 'quaternion :y -0.8294 :w -0.5586)
:camera-trans
(new 'static 'vector :x 1599338.9 :y 57590.168 :z -8405954.0 :w 1.0)
:camera-rot
@@ -1702,7 +1703,7 @@
:trans
(new 'static 'vector :x 2037539.2 :y 1103.872 :z -8560013.0 :w 1.0)
:quat
(new 'static 'vector :y 0.0559 :w 0.9984)
(new 'static 'quaternion :y 0.0559 :w 0.9984)
:camera-trans
(new 'static 'vector :x 1995208.2 :y 21832.908 :z -8586304.0 :w 1.0)
:camera-rot
@@ -1749,7 +1750,7 @@
:trans
(new 'static 'vector :x 2612289.2 :y -2047.5905 :z -8315907.5 :w 1.0)
:quat
(new 'static 'vector :y -0.6975 :w 0.7165)
(new 'static 'quaternion :y -0.6975 :w 0.7165)
:camera-trans
(new 'static 'vector :x 2661940.5 :y 20693.81 :z -8317980.5 :w 1.0)
:camera-rot
@@ -1796,7 +1797,7 @@
:trans
(new 'static 'vector :x 2011811.4 :y 3711.7952 :z -7923027.0 :w 1.0)
:quat
(new 'static 'vector :y -0.5269 :w 0.8499)
(new 'static 'quaternion :y -0.5269 :w 0.8499)
:camera-trans
(new 'static 'vector :x 2053120.4 :y 22242.51 :z -7927784.5 :w 1.0)
:camera-rot
@@ -1879,7 +1880,7 @@
:trans
(new 'static 'vector :x 432272.6 :y 42821.633 :z -6737529.0 :w 1.0)
:quat
(new 'static 'vector :y -0.545 :w 0.8383)
(new 'static 'quaternion :y -0.545 :w 0.8383)
:camera-trans
(new 'static 'vector :x 494105.8 :y 67237.48 :z -6748524.0 :w 1.0)
:camera-rot
@@ -1943,7 +1944,7 @@
:trans
(new 'static 'vector :x 849775.8 :y 163962.88 :z -7301166.5 :w 1.0)
:quat
(new 'static 'vector :y -0.9931 :w 0.1166)
(new 'static 'quaternion :y -0.9931 :w 0.1166)
:camera-trans
(new 'static 'vector :x 848906.25 :y 185056.88 :z -7249962.0 :w 1.0)
:camera-rot
@@ -1971,7 +1972,7 @@
:trans
(new 'static 'vector :x 841424.9 :y 163801.1 :z -8205419.5 :w 1.0)
:quat
(new 'static 'vector :y -0.9857 :w 0.168)
(new 'static 'quaternion :y -0.9857 :w 0.168)
:camera-trans
(new 'static 'vector :x 860479.9 :y 183815.38 :z -8162368.0 :w 1.0)
:camera-rot
@@ -1999,7 +2000,7 @@
:trans
(new 'static 'vector :x 3971233.5 :y 141227.62 :z -13935735.0 :w 1.0)
:quat
(new 'static 'vector :y -0.8721 :w 0.4892)
(new 'static 'quaternion :y -0.8721 :w 0.4892)
:camera-trans
(new 'static 'vector :x 3997892.2 :y 159604.73 :z -13904449.0 :w 1.0)
:camera-rot
@@ -2063,7 +2064,7 @@
:trans
(new 'static 'vector :x 4468021.5 :y 186608.03 :z -14054268.0 :w 1.0)
:quat
(new 'static 'vector :y 0.9999 :w 0.005)
(new 'static 'quaternion :y 0.9999 :w 0.005)
:camera-trans
(new 'static 'vector :x 4469439.5 :y 207701.2 :z -14003077.0 :w 1.0)
:camera-rot
@@ -2092,7 +2093,7 @@
:trans
(new 'static 'vector :x 4549776.0 :y 215375.88 :z -14285922.0 :w 1.0)
:quat
(new 'static 'vector :y 0.681 :w 0.7322)
(new 'static 'quaternion :y 0.681 :w 0.7322)
:camera-trans
(new 'static 'vector :x 4543255.0 :y 226776.67 :z -14313317.0 :w 1.0)
:camera-rot
@@ -2120,7 +2121,7 @@
:trans
(new 'static 'vector :x 4423744.0 :y 198723.58 :z -14530641.0 :w 1.0)
:quat
(new 'static 'vector :y 0.6611 :w 0.7502)
(new 'static 'quaternion :y 0.6611 :w 0.7502)
:camera-trans
(new 'static 'vector :x 4381844.0 :y 218599.83 :z -14551361.0 :w 1.0)
:camera-rot
@@ -2185,7 +2186,7 @@
:trans
(new 'static 'vector :x 4256260.0 :y 983713.8 :z -14182752.0 :w 1.0)
:quat
(new 'static 'vector :y 0.7906 :w -0.6122)
(new 'static 'quaternion :y 0.7906 :w -0.6122)
:camera-trans
(new 'static 'vector :x 4303859.5 :y 1012363.7 :z -14156672.0 :w 1.0)
:camera-rot
@@ -2213,7 +2214,7 @@
:trans
(new 'static 'vector :x 3430875.2 :y 897149.3 :z -13397581.0 :w 1.0)
:quat
(new 'static 'vector :y 0.0968 :w 0.9952)
(new 'static 'quaternion :y 0.0968 :w 0.9952)
:camera-trans
(new 'static 'vector :x 3428789.8 :y 918241.25 :z -13448724.0 :w 1.0)
:camera-rot
@@ -2241,7 +2242,7 @@
:trans
(new 'static 'vector :x 2481850.0 :y 1054709.4 :z -13922438.0 :w 1.0)
:quat
(new 'static 'vector :y 0.8628 :w -0.5055)
(new 'static 'quaternion :y 0.8628 :w -0.5055)
:camera-trans
(new 'static 'vector :x 2497063.0 :y 1069339.9 :z -13900353.0 :w 1.0)
:camera-rot
@@ -2269,7 +2270,7 @@
:trans
(new 'static 'vector :x 3751044.8 :y 917612.1 :z -13828696.0 :w 1.0)
:quat
(new 'static 'vector :y -0.3387 :w -0.9408)
(new 'static 'quaternion :y -0.3387 :w -0.9408)
:camera-trans
(new 'static 'vector :x 3779776.0 :y 933972.8 :z -13845825.0 :w 1.0)
:camera-rot
@@ -2297,7 +2298,7 @@
:trans
(new 'static 'vector :x 3151164.5 :y 1049638.1 :z -14246464.0 :w 1.0)
:quat
(new 'static 'vector :y -0.6226 :w 0.7824)
(new 'static 'quaternion :y -0.6226 :w 0.7824)
:camera-trans
(new 'static 'vector :x 3203905.2 :y 1080037.8 :z -14270850.0 :w 1.0)
:camera-rot
@@ -2325,7 +2326,7 @@
:trans
(new 'static 'vector :x 3053335.0 :y 1048927.9 :z -14058945.0 :w 1.0)
:quat
(new 'static 'vector :y 0.9997 :w 0.022)
(new 'static 'quaternion :y 0.9997 :w 0.022)
:camera-trans
(new 'static 'vector :x 3045845.5 :y 1068868.0 :z -14012568.0 :w 1.0)
:camera-rot
@@ -2353,7 +2354,7 @@
:trans
(new 'static 'vector :x 3431014.0 :y 901474.7 :z -13600187.0 :w 1.0)
:quat
(new 'static 'vector :y -0.0954 :w -0.9954)
(new 'static 'quaternion :y -0.0954 :w -0.9954)
:camera-trans
(new 'static 'vector :x 3429969.0 :y 922565.44 :z -13651353.0 :w 1.0)
:camera-rot
@@ -2381,7 +2382,7 @@
:trans
(new 'static 'vector :x 3200864.2 :y 907400.4 :z -13676660.0 :w 1.0)
:quat
(new 'static 'vector :y 0.5867 :w -0.8097)
(new 'static 'quaternion :y 0.5867 :w -0.8097)
:camera-trans
(new 'static 'vector :x 3247600.8 :y 928464.06 :z -13697606.0 :w 1.0)
:camera-rot
@@ -2409,7 +2410,7 @@
:trans
(new 'static 'vector :x 2721898.5 :y 1049845.0 :z -13743428.0 :w 1.0)
:quat
(new 'static 'vector :y -0.7688 :w -0.6394)
(new 'static 'quaternion :y -0.7688 :w -0.6394)
:camera-trans
(new 'static 'vector :x 2712702.5 :y 1070288.5 :z -13791593.0 :w 1.0)
:camera-rot
@@ -2473,7 +2474,7 @@
:trans
(new 'static 'vector :x 4420967.0 :y 33006.387 :z -13154230.0 :w 1.0)
:quat
(new 'static 'vector :y 0.0174 :w -0.9998)
(new 'static 'quaternion :y 0.0174 :w -0.9998)
:camera-trans
(new 'static 'vector :x 4428164.5 :y 54074.164 :z -13204933.0 :w 1.0)
:camera-rot
@@ -2501,7 +2502,7 @@
:trans
(new 'static 'vector :x 4172175.8 :y 154223.83 :z -12445165.0 :w 1.0)
:quat
(new 'static 'vector :y -0.2093 :w 0.9778)
(new 'static 'quaternion :y -0.2093 :w 0.9778)
:camera-trans
(new 'static 'vector :x 4193893.2 :y 175317.81 :z -12491520.0 :w 1.0)
:camera-rot
@@ -2529,7 +2530,7 @@
:trans
(new 'static 'vector :x 4760896.5 :y 44221.234 :z -12409880.0 :w 1.0)
:quat
(new 'static 'vector :y 0.548 :w 0.8364)
(new 'static 'quaternion :y 0.548 :w 0.8364)
:camera-trans
(new 'static 'vector :x 4745230.0 :y 57869.926 :z -12426885.0 :w 1.0)
:camera-rot
@@ -2593,7 +2594,7 @@
:trans
(new 'static 'vector :x 3813246.2 :y 129487.664 :z -12114304.0 :w 1.0)
:quat
(new 'static 'vector :y 0.1439 :w 0.9895)
(new 'static 'quaternion :y 0.1439 :w 0.9895)
:camera-trans
(new 'static 'vector :x 3793301.0 :y 145573.48 :z -12139847.0 :w 1.0)
:camera-rot
@@ -2654,7 +2655,7 @@
:trans
(new 'static 'vector :x 5208223.5 :y 69697.945 :z -11781496.0 :w 1.0)
:quat
(new 'static 'vector :y -0.3654 :w -0.9308)
(new 'static 'quaternion :y -0.3654 :w -0.9308)
:camera-trans
(new 'static 'vector :x 5171715.0 :y 90796.85 :z -11817413.0 :w 1.0)
:camera-rot
@@ -2682,7 +2683,7 @@
:trans
(new 'static 'vector :x 5435461.5 :y -97111.24 :z -11588379.0 :w 1.0)
:quat
(new 'static 'vector :y 0.1086 :w 0.994)
(new 'static 'quaternion :y 0.1086 :w 0.994)
:camera-trans
(new 'static 'vector :x 5409966.5 :y -76017.664 :z -11632764.0 :w 1.0)
:camera-rot
@@ -2743,7 +2744,7 @@
:trans
(new 'static 'vector :x 5511317.0 :y 159871.8 :z -14621239.0 :w 1.0)
:quat
(new 'static 'vector :y -0.3753 :w -0.9268)
(new 'static 'quaternion :y -0.3753 :w -0.9268)
:camera-trans
(new 'static 'vector :x 5510636.5 :y 197720.06 :z -14663128.0 :w 1.0)
:camera-rot
@@ -2771,7 +2772,7 @@
:trans
(new 'static 'vector :x 9081441.0 :y -3935.8464 :z -14056285.0 :w 1.0)
:quat
(new 'static 'vector :y -0.7002 :w -0.7139)
(new 'static 'quaternion :y -0.7002 :w -0.7139)
:camera-trans
(new 'static 'vector :x 9055362.0 :y 10606.592 :z -14050822.0 :w 1.0)
:camera-rot
@@ -2799,7 +2800,7 @@
:trans
(new 'static 'vector :x 9954895.0 :y 390513.06 :z -16548614.0 :w 1.0)
:quat
(new 'static 'vector :y -0.7485 :w -0.663)
(new 'static 'quaternion :y -0.7485 :w -0.663)
:camera-trans
(new 'static 'vector :x 9923721.0 :y 406466.16 :z -16541633.0 :w 1.0)
:camera-rot
@@ -2827,7 +2828,7 @@
:trans
(new 'static 'vector :x 11479892.0 :y -163656.5 :z -18266490.0 :w 1.0)
:quat
(new 'static 'vector :y -0.9589 :w -0.2836)
(new 'static 'quaternion :y -0.9589 :w -0.2836)
:camera-trans
(new 'static 'vector :x 11526721.0 :y -143482.47 :z -18257412.0 :w 1.0)
:camera-rot
@@ -2891,7 +2892,7 @@
:trans
(new 'static 'vector :x 11442706.0 :y -142755.84 :z -18869044.0 :w 1.0)
:quat
(new 'static 'vector :y 0.9992 :w 0.0392)
(new 'static 'quaternion :y 0.9992 :w 0.0392)
:camera-trans
(new 'static 'vector :x 11441183.0 :y -122509.31 :z -18820882.0 :w 1.0)
:camera-rot
@@ -2919,7 +2920,7 @@
:trans
(new 'static 'vector :x 11443969.0 :y -154216.03 :z -18472782.0 :w 1.0)
:quat
(new 'static 'vector :y -0.9728 :w 0.2314)
(new 'static 'quaternion :y -0.9728 :w 0.2314)
:camera-trans
(new 'static 'vector :x 11436929.0 :y -134244.36 :z -18426254.0 :w 1.0)
:camera-rot
@@ -2948,7 +2949,7 @@
:trans
(new 'static 'vector :x 11454895.0 :y -161791.6 :z -18204690.0 :w 1.0)
:quat
(new 'static 'vector :y 0.7511 :w 0.6601)
(new 'static 'quaternion :y 0.7511 :w 0.6601)
:camera-trans
(new 'static 'vector :x 11406872.0 :y -141278.0 :z -18194638.0 :w 1.0)
:camera-rot
@@ -2976,7 +2977,7 @@
:trans
(new 'static 'vector :x 10827551.0 :y -94047.02 :z -18946718.0 :w 1.0)
:quat
(new 'static 'vector :y 0.8377 :w -0.546)
(new 'static 'quaternion :y 0.8377 :w -0.546)
:camera-trans
(new 'static 'vector :x 10862150.0 :y -75343.875 :z -18922316.0 :w 1.0)
:camera-rot
@@ -3004,7 +3005,7 @@
:trans
(new 'static 'vector :x 11047507.0 :y -81514.086 :z -19495960.0 :w 1.0)
:quat
(new 'static 'vector :y 0.0292 :w 0.9995)
(new 'static 'quaternion :y 0.0292 :w 0.9995)
:camera-trans
(new 'static 'vector :x 11033498.0 :y -63027.2 :z -19534916.0 :w 1.0)
:camera-rot
@@ -3032,7 +3033,7 @@
:trans
(new 'static 'vector :x 11443470.0 :y -120194.664 :z -19845628.0 :w 1.0)
:quat
(new 'static 'vector :y -0.9907 :w -0.1355)
(new 'static 'quaternion :y -0.9907 :w -0.1355)
:camera-trans
(new 'static 'vector :x 11443545.0 :y -99100.266 :z -19794374.0 :w 1.0)
:camera-rot
@@ -3060,7 +3061,7 @@
:trans
(new 'static 'vector :x 11269726.0 :y -12132.352 :z -19614712.0 :w 1.0)
:quat
(new 'static 'vector :y -0.0419 :w 0.9991)
(new 'static 'quaternion :y -0.0419 :w 0.9991)
:camera-trans
(new 'static 'vector :x 11264449.0 :y 7920.8447 :z -19661710.0 :w 1.0)
:camera-rot
@@ -3088,7 +3089,7 @@
:trans
(new 'static 'vector :x 12138031.0 :y -36900.863 :z -18933304.0 :w 1.0)
:quat
(new 'static 'vector :y 0.7487 :w 0.6628)
(new 'static 'quaternion :y 0.7487 :w 0.6628)
:camera-trans
(new 'static 'vector :x 12101831.0 :y -19811.123 :z -18933632.0 :w 1.0)
:camera-rot
@@ -3116,7 +3117,7 @@
:trans
(new 'static 'vector :x 11837483.0 :y -20177.715 :z -19506848.0 :w 1.0)
:quat
(new 'static 'vector :y -0.3564 :w 0.9342)
(new 'static 'quaternion :y -0.3564 :w 0.9342)
:camera-trans
(new 'static 'vector :x 11872697.0 :y 887.6032 :z -19544198.0 :w 1.0)
:camera-rot
@@ -3144,7 +3145,7 @@
:trans
(new 'static 'vector :x 11447961.0 :y 234055.27 :z -19169000.0 :w 1.0)
:quat
(new 'static 'vector :y 0.2351 :w 0.9719)
(new 'static 'quaternion :y 0.2351 :w 0.9719)
:camera-trans
(new 'static 'vector :x 11454465.0 :y 252947.66 :z -19126656.0 :w 1.0)
:camera-rot
@@ -3209,7 +3210,7 @@
:trans
(new 'static 'vector :x 11548456.0 :y 2215872.0 :z -19409498.0 :w 1.0)
:quat
(new 'static 'vector :y 0.7325 :w 0.6807)
(new 'static 'quaternion :y 0.7325 :w 0.6807)
:camera-trans
(new 'static 'vector :x 11513311.0 :y 2234999.5 :z -19435708.0 :w 1.0)
:camera-rot
@@ -3240,7 +3241,7 @@
:trans
(new 'static 'vector :x 12288335.0 :y 1970461.9 :z -19848522.0 :w 1.0)
:quat
(new 'static 'vector :y -0.5359 :w -0.8442)
(new 'static 'quaternion :y -0.5359 :w -0.8442)
:camera-trans
(new 'static 'vector :x 12265366.0 :y 1984228.5 :z -19842574.0 :w 1.0)
:camera-rot
@@ -3333,7 +3334,7 @@
:flags #x8
:trans
(new 'static 'vector :x 66396.16 :y 29782.016 :z -919973.5 :w 1.0)
:quat (new 'static 'vector :w 1.0)
:quat (new 'static 'quaternion :w 1.0)
:camera-trans
(new 'static 'vector :x 76871.68 :y 55061.707 :z -938752.0 :w 1.0)
:camera-rot
@@ -3393,7 +3394,7 @@
:trans
(new 'static 'vector :x -635598.9 :y 222551.66 :z 710496.25 :w 1.0)
:quat
(new 'static 'vector :y -0.3323 :w -0.9431)
(new 'static 'quaternion :y -0.3323 :w -0.9431)
:camera-trans
(new 'static 'vector :x -665644.25 :y 250803.0 :z 668470.9 :w 1.0)
:camera-rot
@@ -3454,7 +3455,7 @@
:trans
(new 'static 'vector :x -1048.9856 :y -172047.97 :z -212555.78 :w 1.0)
:quat
(new 'static 'vector :y 0.061 :w 0.9981)
(new 'static 'quaternion :y 0.061 :w 0.9981)
:camera-trans
(new 'static 'vector :x -9941.401 :y -150049.17 :z -159587.94 :w 1.0)
:camera-rot
@@ -16,7 +16,7 @@
(get-bit (_type_ int) symbol 9)
(clear-bit (_type_ int) int 10)
(set-bit (_type_ int) int 11)
(clear (_type_) _type_ 12)
(clear-all! (_type_) _type_ 12)
)
)
@@ -94,7 +94,7 @@
)
;; definition for method 12 of type bit-array
(defmethod clear bit-array ((obj bit-array))
(defmethod clear-all! bit-array ((obj bit-array))
(countdown (idx (/ (logand -8 (+ (-> obj allocated-length) 7)) 8))
(nop!)
(nop!)
@@ -121,16 +121,16 @@
(set! (-> gp-0 origin y) 90.0)
(dotimes (s4-1 3)
(let* ((s2-0 (+ (+ s4-1 3840) s5-1))
(s3-0 (dummy-9 *common-text* (the-as uint s2-0) #t))
(s3-0 (lookup-text! *common-text* (the-as game-text-id s2-0) #t))
)
(when (= s2-0 3841)
(let ((v1-18 (scf-get-territory)))
(cond
((= v1-18 1)
(set! s3-0 (dummy-9 *common-text* (the-as uint 3857) #t))
(set! s3-0 (lookup-text! *common-text* (game-text-id europe) #t))
)
((= v1-18 2)
(set! s3-0 (dummy-9 *common-text* (the-as uint 3856) #t))
(set! s3-0 (lookup-text! *common-text* (game-text-id inc) #t))
)
)
)
@@ -187,7 +187,7 @@
(or s2-0 (and (< s4-0 (- s3-0)) (< (the-as uint gp-0) (the-as uint 3249))))
(+! s4-0 s3-0)
(+! gp-0 1)
(let ((a0-8 (dummy-9 *common-text* (the-as uint gp-0) #t)))
(let ((a0-8 (lookup-text! *common-text* (the-as game-text-id gp-0) #t)))
(if a0-8
(set! s3-0 (the int (+ 5.0 (print-game-text a0-8 s5-0 #t 128 20))))
(set! s3-0 25)
@@ -202,7 +202,7 @@
(else
(set! (-> s5-0 origin y) (the float s4-0))
(while (< (-> s5-0 origin y) (the float (-> *video-parms* screen-sy)))
(let ((a0-11 (dummy-9 *common-text* (the-as uint gp-0) #t)))
(let ((a0-11 (lookup-text! *common-text* (the-as game-text-id gp-0) #t)))
(if a0-11
(set! v1-13 (the int (+ 5.0 (print-game-text a0-11 s5-0 #f 128 20))))
(set! v1-13 25)
@@ -40,9 +40,9 @@
;; definition of type task-info-data
(deftype task-info-data (basic)
((task-id uint8 :offset-assert 4)
(task-name symbol 4 :offset-assert 8)
(text-index-when-resolved int32 :offset-assert 24)
((task-id game-task :offset-assert 4)
(task-name game-text-id 4 :offset-assert 8)
(text-index-when-resolved int32 :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
@@ -64,7 +64,7 @@
;; definition of type level-tasks-info
(deftype level-tasks-info (basic)
((level-name-id uint32 :offset-assert 4)
((level-name-id game-text-id :offset-assert 4)
(text-group-index int32 :offset-assert 8)
(nb-of-tasks int32 :offset-assert 12)
(buzzer-task-index int32 :offset-assert 16)
@@ -88,13 +88,13 @@
;; definition of type game-option
(deftype game-option (basic)
((option-type uint64 :offset-assert 8)
(name uint32 :offset-assert 16)
(scale basic :offset-assert 20)
(param1 float :offset-assert 24)
(param2 float :offset-assert 28)
(param3 int32 :offset-assert 32)
(value-to-modify uint32 :offset-assert 36)
((option-type uint64 :offset-assert 8)
(name game-text-id :offset-assert 16)
(scale basic :offset-assert 20)
(param1 float :offset-assert 24)
(param2 float :offset-assert 28)
(param3 int32 :offset-assert 32)
(value-to-modify uint32 :offset-assert 36)
)
:method-count-assert 9
:size-assert #x28
File diff suppressed because it is too large Load Diff
@@ -31,7 +31,7 @@
:size-assert #x10
:flag-assert #xa00000010
(:methods
(dummy-9 (_type_ uint symbol) string 9)
(lookup-text! (_type_ game-text-id symbol) string 9)
)
)
@@ -285,35 +285,15 @@
)
;; definition for method 2 of type handle
;; WARN: Unsupported inline assembly instruction kind - [subu a2, v1, s7]
(defmethod print handle ((obj handle))
(local-vars (a2-0 int) (s7-0 none))
(cond
((nonzero? obj)
(let ((t9-0 format)
(a0-1 #t)
(a1-0 "#<handle :process ~A :pid ~D>")
(v1-0 obj)
)
(.subu a2-0 v1-0 s7-0)
(t9-0
a0-1
a1-0
(and
(nonzero? a2-0)
(let ((a3-0 (-> (the-as (pointer process) (-> v1-0 process)) 0)))
(if (= (-> v1-0 pid) (-> a3-0 pid))
a3-0
)
)
)
(-> obj pid)
)
)
)
(else
(format #t "#<handle :process 0 :pid 0>")
(if (nonzero? obj)
(format
#t
"#<handle :process ~A :pid ~D>"
(handle->process obj)
(-> obj pid)
)
(format #t "#<handle :process 0 :pid 0>")
)
obj
)
+1 -1
View File
@@ -300,7 +300,7 @@ TEST_F(DataDecompTest, ContinuePoint) {
" :z -19409498.0\n"
" :w 1.0\n"
" )\n"
" :quat (new 'static 'vector\n"
" :quat (new 'static 'quaternion\n"
" :y 0.7325\n"
" :w 0.6807\n"
" )\n"
+2 -8
View File
@@ -105,10 +105,6 @@ const std::unordered_set<std::string> g_functions_to_skip_compiling = {
// inline assembly
"valid?",
/// GKERNEL-H
// bitfields, possibly inline assembly
"(method 2 handle)",
/// GKERNEL
// asm
"(method 10 process)",
@@ -166,6 +162,8 @@ const std::unordered_set<std::string> g_functions_to_skip_compiling = {
// ripple - calls an asm function
"ripple-execute",
"get-task-status",
};
// default location for the data. It can be changed with a command line argument.
@@ -351,10 +349,6 @@ TEST_F(OfflineDecompilation, FunctionDetect) {
// one login per object file
EXPECT_EQ(config->allowed_objects.size(), login_count);
// not many lambdas.
// TODO - disabling this test, some files do have many lambdas! Gotta figure out a better way to
// do this EXPECT_TRUE(unknown_count < 10);
}
TEST_F(OfflineDecompilation, AsmFunction) {
+25
View File
@@ -338,6 +338,30 @@ static bool ends_with(const std::string& str, const std::string& suffix) {
0 == str.compare(str.size() - suffix.size(), suffix.size(), suffix);
}
void inspect_symbols(const Ram& ram,
const std::unordered_map<u32, std::string>& types,
const SymbolMap& symbols) {
fmt::print("Symbols:\n");
for (const auto& [name, addr] : symbols.name_to_addr) {
std::string found_type;
if (ram.word_in_memory(addr)) {
u32 symbol_value = ram.read<u32>(addr);
if ((symbol_value & 0xf) == 4) {
if (ram.word_in_memory(symbol_value)) {
u32 type = ram.read<u32>(symbol_value - 4);
auto type_it = types.find(type);
if (type_it != types.end()) {
found_type = type_it->second;
}
}
}
}
if (!found_type.empty()) {
fmt::print(" {:30s} : {}\n", name, found_type);
}
}
}
int main(int argc, char** argv) {
fmt::print("MemoryDumpTool\n");
@@ -411,6 +435,7 @@ int main(int argc, char** argv) {
auto basics = find_basics(ram, types);
inspect_basics(ram, basics, types, symbol_map, dts.ts, results);
inspect_symbols(ram, types, symbol_map);
if (fs::exists(output_folder / "ee-results.json")) {
fs::remove(output_folder / "ee-results.json");