[Decompile] connect, text-h, settings-h, capture, memory-usage-h (#410)

* decompile stuff

* temp

* temp2

* fix

* temp

* preparing for merge

* working

* fix stupid format

* fix codacy
This commit is contained in:
water111
2021-05-05 17:38:16 -04:00
committed by GitHub
parent 8d99bee88c
commit 0a6602e320
41 changed files with 4626 additions and 369 deletions
+2 -1
View File
@@ -756,6 +756,7 @@ void TypeSystem::add_builtin_types() {
uint_type->disallow_in_runtime();
// Methods and Fields
forward_declare_type_as_structure("memory-usage-block");
// OBJECT
add_method(obj_type, "new", make_function_typespec({"symbol", "type", "int"}, "_type_"));
@@ -768,7 +769,7 @@ void TypeSystem::add_builtin_types() {
add_method(obj_type, "copy", make_function_typespec({"_type_", "symbol"}, "_type_"));
add_method(obj_type, "relocate", make_function_typespec({"_type_", "int"}, "_type_"));
add_method(obj_type, "mem-usage",
make_function_typespec({"_type_"}, "int32")); // todo - this is a guess.
make_function_typespec({"_type_", "memory-usage-block"}, "_type_"));
// STRUCTURE
// structure new doesn't support dynamic sizing, which is kinda weird - it grabs the size from
+8 -4
View File
@@ -1647,9 +1647,11 @@ void FunctionEndOp::collect_vars(RegAccessSet& vars) const {
// StackSpillStoreOp
/////////////////////////////
StackSpillStoreOp::StackSpillStoreOp(RegisterAccess value, int size, int offset, int my_idx)
StackSpillStoreOp::StackSpillStoreOp(const SimpleAtom& value, int size, int offset, int my_idx)
: AtomicOp(my_idx), m_value(value), m_size(size), m_offset(offset) {
assert(m_value.mode() == AccessMode::READ);
if (m_value.is_var()) {
assert(m_value.var().mode() == AccessMode::READ);
}
}
goos::Object StackSpillStoreOp::to_form(const std::vector<DecompilerLabel>&, const Env& env) const {
@@ -1673,11 +1675,13 @@ bool StackSpillStoreOp::is_sequence_point() const {
}
void StackSpillStoreOp::update_register_info() {
m_read_regs.push_back(m_value.reg());
if (m_value.is_var()) {
m_read_regs.push_back(m_value.var().reg());
}
}
void StackSpillStoreOp::collect_vars(RegAccessSet& vars) const {
vars.insert(m_value);
m_value.collect_vars(vars);
}
RegisterAccess StackSpillStoreOp::get_set_destination() const {
+2 -2
View File
@@ -724,7 +724,7 @@ class FunctionEndOp : public AtomicOp {
*/
class StackSpillStoreOp : public AtomicOp {
public:
StackSpillStoreOp(RegisterAccess value, int size, int offset, int my_idx);
StackSpillStoreOp(const SimpleAtom& value, int size, int offset, int my_idx);
goos::Object to_form(const std::vector<DecompilerLabel>& labels, const Env& env) const override;
bool operator==(const AtomicOp& other) const override;
bool is_sequence_point() const override;
@@ -737,7 +737,7 @@ class StackSpillStoreOp : public AtomicOp {
void collect_vars(RegAccessSet& vars) const override;
private:
RegisterAccess m_value;
SimpleAtom m_value;
int m_size;
int m_offset;
};
+12 -5
View File
@@ -742,13 +742,20 @@ FormElement* StackSpillLoadOp::get_as_form(FormPool& pool, const Env& env) const
}
FormElement* StackSpillStoreOp::get_as_form(FormPool& pool, const Env& env) const {
auto& slot_type = env.stack_slot_entries.at(m_offset).typespec;
auto src_type = env.get_types_before_op(m_my_idx).get(m_value.reg()).typespec();
std::optional<TypeSpec> cast_type;
if (!env.dts->ts.tc(slot_type, src_type)) {
// we fail the typecheck for a normal set!, so add a cast.
cast_type = slot_type;
// if we aren't a var, we're 0.
TypeSpec src_type = TypeSpec("int");
if (m_value.is_var() && env.has_type_analysis()) {
src_type = env.get_types_before_op(m_my_idx).get(m_value.var().reg()).typespec();
}
auto kv = env.stack_slot_entries.find(m_offset);
if (kv != env.stack_slot_entries.end()) {
if (!env.dts->ts.tc(kv->second.typespec, src_type)) {
// we fail the typecheck for a normal set!, so add a cast.
cast_type = kv->second.typespec;
}
}
return pool.alloc_element<StackSpillStoreElement>(m_value, m_size, m_offset, cast_type);
+2 -2
View File
@@ -1074,14 +1074,14 @@ TypeState StackSpillLoadOp::propagate_types_internal(const TypeState& input,
TypeState StackSpillStoreOp::propagate_types_internal(const TypeState& input,
const Env& env,
DecompilerTypeSystem&) {
DecompilerTypeSystem& dts) {
auto info = env.stack_spills().lookup(m_offset);
if (info.size != m_size) {
throw std::runtime_error(fmt::format(
"Stack slot load mismatch: defined as size {}, got size {}\n", info.size, m_size));
}
auto& stored_type = input.get(m_value.reg());
auto stored_type = m_value.get_type(input, env, dts);
auto result = input;
result.spill_slots[m_offset] = stored_type;
return result;
+5 -3
View File
@@ -1504,7 +1504,7 @@ std::string fixed_operator_to_string(FixedOperatorKind kind) {
case FixedOperatorKind::NONE:
return "none";
case FixedOperatorKind::PCPYLD:
return ".pcpyld";
return "make-u128";
default:
assert(false);
return "";
@@ -2302,7 +2302,7 @@ void VectorFloatLoadStoreElement::collect_vf_regs(RegSet& regs) const {
// StackSpillStoreElement
////////////////////////////////
StackSpillStoreElement::StackSpillStoreElement(RegisterAccess value,
StackSpillStoreElement::StackSpillStoreElement(SimpleAtom value,
int size,
int stack_offset,
const std::optional<TypeSpec>& cast_type)
@@ -2320,7 +2320,9 @@ void StackSpillStoreElement::apply(const std::function<void(FormElement*)>& f) {
void StackSpillStoreElement::apply_form(const std::function<void(Form*)>&) {}
void StackSpillStoreElement::collect_vars(RegAccessSet& vars, bool) const {
vars.insert(m_value);
if (m_value.is_var()) {
vars.insert(m_value.var());
}
}
void StackSpillStoreElement::get_modified_regs(RegSet&) const {}
+2 -2
View File
@@ -1325,7 +1325,7 @@ class VectorFloatLoadStoreElement : public FormElement {
class StackSpillStoreElement : public FormElement {
public:
StackSpillStoreElement(RegisterAccess value,
StackSpillStoreElement(SimpleAtom value,
int size,
int stack_offset,
const std::optional<TypeSpec>& cast_type);
@@ -1338,7 +1338,7 @@ class StackSpillStoreElement : public FormElement {
const std::optional<TypeSpec>& cast_type() const { return m_cast_type; }
private:
RegisterAccess m_value;
SimpleAtom m_value;
int m_size = -1;
int m_stack_offset = -1;
std::optional<TypeSpec> m_cast_type;
+14 -2
View File
@@ -1855,6 +1855,10 @@ void FunctionCallElement::update_from_stack(const Env& env,
fmt::format("Inconsistent types in method call: {} and {}", type_1, type_2));
}
if (type_2 == "array") {
type_2 = "boxed-array";
}
auto quoted_type = pool.alloc_single_element_form<SimpleAtomElement>(
nullptr, SimpleAtom::make_sym_ptr(type_2));
@@ -2052,13 +2056,15 @@ void CondNoElseElement::push_to_stack(const Env& env, FormPool& pool, FormStack&
x->push_to_stack(env, pool, stack);
}
bool first = true;
for (auto& entry : entries) {
for (auto form : {entry.condition, entry.body}) {
if (form == first_condition) {
form->clear();
form->push_back(stack.pop_back(pool));
} else {
FormStack temp_stack(false);
FormStack temp_stack(first && stack.is_root());
first = false;
for (auto& elt : form->elts()) {
elt->push_to_stack(env, pool, temp_stack);
}
@@ -3161,7 +3167,13 @@ void ConditionalMoveFalseElement::push_to_stack(const Env& env, FormPool& pool,
///////////////////////////
void StackSpillStoreElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stack) {
mark_popped();
auto src = pop_to_forms({m_value}, env, pool, stack, true).at(0);
Form* src;
if (m_value.is_var()) {
src = pop_to_forms({m_value.var()}, env, pool, stack, true).at(0);
} else {
src = pool.alloc_single_element_form<SimpleAtomElement>(nullptr, m_value);
}
auto dst = pool.alloc_single_element_form<ConstantTokenElement>(
nullptr, env.get_spill_slot_var_name(m_stack_offset));
if (m_cast_type) {
+3 -4
View File
@@ -255,7 +255,7 @@ void ObjectFileDB::ir2_stack_spill_slot_pass() {
}
func.ir2.env.set_stack_spills(spill_map);
});
lg::info("Analyzed stack spills: found {} functions will spills (total {} vars), took {:.2f} ms",
lg::info("Analyzed stack spills: found {} functions with spills (total {} vars), took {:.2f} ms",
functions_with_spills, total_slots, timer.getMs());
}
@@ -614,7 +614,7 @@ std::string ObjectFileDB::ir2_to_file(ObjectFileData& data) {
}
}
if (func.ir2.print_debug_forms) {
if (false && func.ir2.print_debug_forms) {
result += '\n';
result += ";; DEBUG OUTPUT BELOW THIS LINE:\n";
result += func.ir2.debug_form_string;
@@ -815,9 +815,8 @@ std::string ObjectFileDB::ir2_function_to_string(ObjectFileData& data, Function&
}
if (func.cfg) {
result += func.cfg->to_form_string();
if (!func.cfg->is_fully_resolved()) {
result += func.cfg->to_form_string();
result += "\n";
result += func.cfg->to_dot();
result += "\n";
+1 -1
View File
@@ -187,7 +187,7 @@ std::unique_ptr<AtomicOp> make_standard_store(const Instruction& i0,
return std::make_unique<AsmOp>(i0, idx);
}
// it's a stack spill.
return std::make_unique<StackSpillStoreOp>(make_src_var(i0.get_src(0).get_reg(), idx),
return std::make_unique<StackSpillStoreOp>(make_src_atom(i0.get_src(0).get_reg(), idx),
store_size, i0.get_src(1).get_imm(), idx);
}
SimpleAtom val;
+4 -1
View File
@@ -66,7 +66,10 @@ struct StackInstrInfo {
};
constexpr StackInstrInfo stack_instrs[] = {{InstructionKind::SQ, false, 16, false},
{InstructionKind::LQ, true, 16, false}};
{InstructionKind::LQ, true, 16, false},
{InstructionKind::SW, false, 4, false},
//{InstructionKind::LWU, true, 4, false}
{InstructionKind::SD, false, 8, false}};
} // namespace
StackSpillMap build_spill_map(const std::vector<Instruction>& instructions, Range<int> range) {
+182 -113
View File
@@ -44,6 +44,7 @@
(define-extern int128 type)
(define-extern float type)
(define-extern nothing (function none))
(define-extern kheap type)
;; functions defined in C. TODO - this will end up being a duplicate of kernel-defs.gc?
@@ -2800,9 +2801,7 @@
;; ND did something REALLY strange with these and now we have to suffer from it
(deftype dma-gif-packet (structure)
((dma-vif dma-packet :inline :offset-assert 0)
;(gif gif-tag64 :offset-assert 16)
;(gif-regs gif-tag-regs :offset-assert 24)
(gif uint64 2 :offset-assert 16)
(gif uint64 2 :offset-assert 16) ;; guess
(quad uint128 2 :offset 0)
)
:method-count-assert 9
@@ -3625,8 +3624,10 @@
(vu1-buf dma-buffer :offset 8)
(debug-buf dma-buffer :offset 36)
(global-buf dma-buffer :offset 40)
(buffer uint32 11 :offset 4) ;; for debugging?
(bucket-group dma-bucket :offset 44)
(buffer uint32 11 :offset 4) ;; for debugging?
(profile-bar profile-bar 2 :offset 48)
(run-time uint64 :offset 56)
)
@@ -3699,9 +3700,11 @@
(define-extern *display* display)
;;;;;;;;;;;;;;;
;; display
;;;;;;;;;;;;;;;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; DISPLAY ;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
(define-extern get-current-time (function uint))
(define-extern get-integral-current-time (function uint))
@@ -3979,6 +3982,8 @@
(define-extern *texture-enable-user-menu* int)
(define-extern *texture-enable-user* int)
(declare-type level basic)
(deftype texture-id (uint32)
((index uint16 :offset 8 :size 12)
(page uint16 :offset 20 :size 12)
@@ -3998,52 +4003,62 @@
:flag-assert #x900000008
)
(declare-type texture-page basic)
(declare-type texture-page-segment structure)
(declare-type texture-relocate-later basic)
;; texture-h
(deftype texture-pool (basic)
((top int32 :offset-assert 4)
(cur int32 :offset-assert 8)
(allocate-func basic :offset-assert 12)
(font-palette int32 :offset-assert 16)
(segment texture-pool-segment 4 :inline :offset-assert 20)
(segment-near texture-pool-segment :inline :offset 20)
(segment-common texture-pool-segment :inline :offset 28)
(common-page int32 32 :offset-assert 52)
(allocate-func (function texture-pool texture-page kheap int texture-page) :offset-assert 12)
(font-palette int32 :offset-assert 16) ;; vram word idx
;; these were reordered
(segment-near texture-pool-segment :inline :offset-assert 20)
(segment-common texture-pool-segment :inline :offset-assert 28)
(segment texture-pool-segment 4 :inline :offset 20)
(common-page texture-page 32 :offset-assert 52)
(common-page-mask int32 :offset-assert 180)
(ids int32 126 :offset-assert 184)
(ids uint32 126 :offset-assert 184)
)
:method-count-assert 23
:size-assert #x2b0
:flag-assert #x17000002b0
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(new (symbol type) _type_ 0)
(initialize! (_type_) _type_ 9)
(print-usage (_type_) _type_ 10)
(dummy-11 (_type_) none 11)
(allocate-defaults! (_type_) none 12)
(login-level-textures (_type_ level int (pointer texture-id)) none 13) ;; loading level...
(add-tex-to-dma! (_type_ level int) none 14) ;; very mysterious arg types.
(allocate-vram-words! (_type_ int) int 15)
(allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(upload-one-common! (_type_) symbol 21)
(lookup-boot-common-id (_type_ int) int 22)
)
)
(define-extern *texture-pool* texture-pool)
;; texture-h
(deftype texture (basic)
((w int16 :offset-assert 4)
(h int16 :offset-assert 6)
(num-mips uint8 :offset-assert 8)
(tex1-control uint8 :offset-assert 9)
(psm uint8 :offset-assert 10)
(tex1-control uint8 :offset-assert 9) ;; each level has a dest and a width
(psm gs-psm :offset-assert 10)
(mip-shift uint8 :offset-assert 11)
(clutpsm uint16 :offset-assert 12)
(dest uint16 7 :offset-assert 14)
(clutdest uint16 :offset-assert 28)
(width uint8 7 :offset-assert 30)
(dest uint16 7 :offset-assert 14) ;; dest vram word addr, per leve
(clutdest uint16 :offset-assert 28) ;; destination vram word addr of clut.
(width uint8 7 :offset-assert 30) ;; mip widths
(name basic :offset-assert 40)
(size uint32 :offset-assert 44)
(uv-dist float :offset-assert 48)
@@ -4073,28 +4088,30 @@
((info basic :offset-assert 4)
(name basic :offset-assert 8)
(id uint32 :offset-assert 12)
(length int32 :offset-assert 16)
(length int32 :offset-assert 16) ;; number of texture
(mip0-size uint32 :offset-assert 20)
(size uint32 :offset-assert 24)
(size uint32 :offset-assert 24) ;; in vram words.
(segment texture-page-segment 3 :inline :offset-assert 28)
(pad uint32 16 :offset-assert 64)
(data uint8 :dynamic :offset-assert 128)
(data texture :dynamic :offset-assert 128)
)
:method-count-assert 15
:size-assert #x80
:flag-assert #xf00000080
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(remove-from-heap (_type_ kheap) _type_ 9)
(get-leftover-block-count (_type_ int int) int 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(relocate-dests! (_type_ int int) none 12)
(add-to-dma-buffer (_type_ dma-buffer int) none 13)
(upload-now! (_type_ int) none 14)
)
)
(declare-type adgif-shader structure)
(deftype shader-ptr (uint32)
()
((shader uint32 :offset 8 :size 24))
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
@@ -4102,7 +4119,7 @@
;; texture-h
(deftype texture-link (structure)
((next uint32 :offset-assert 0)
((next shader-ptr 1 :offset-assert 0)
)
:method-count-assert 9
:size-assert #x4
@@ -4113,9 +4130,10 @@
(deftype texture-page-dir-entry (structure)
((length int16 :offset-assert 0)
(status uint16 :offset-assert 2)
(page basic :offset-assert 4)
(link uint32 :offset-assert 8)
(page texture-page :offset-assert 4)
(link texture-link :offset-assert 8)
)
:pack-me
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
@@ -4123,7 +4141,8 @@
;; texture-h
(deftype texture-page-dir (basic)
((pad uint8 #x10))
((length int32)
(entries texture-page-dir-entry 1 :inline))
(:methods
(dummy-9 () none 9)
)
@@ -4137,7 +4156,7 @@
(source uint32 :offset-assert 12)
(move uint32 :offset-assert 16)
(entry texture-page-dir-entry :offset-assert 20)
(page basic :offset-assert 24)
(page texture-page :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
@@ -4158,7 +4177,7 @@
(alpha uint64 :offset 64)
(link-test uint32 :offset 8)
(texture-id uint32 :offset 24)
(next uint32 :offset 40)
(next shader-ptr :offset 40)
)
:method-count-assert 9
:size-assert #x50
@@ -4272,7 +4291,7 @@
(bsp basic :offset-assert 48)
(art-group basic :offset-assert 52)
(info basic :offset-assert 56)
(texture-page basic 9 :offset-assert 60)
(texture-page texture-page 9 :offset-assert 60)
(loaded-texture-page basic 16 :offset-assert 96)
(loaded-texture-page-count int32 :offset-assert 160)
; (foreground-sink-group-0 dma-foreground-sink-group :inline :offset-assert 176)
@@ -4283,8 +4302,8 @@
(foreground-draw-engine basic 3 :offset-assert 272)
(entity basic :offset-assert 284)
(ambient basic :offset-assert 288)
(closest-object basic 9 :offset-assert 292)
(upload-size uint32 9 :offset-assert 328)
(closest-object float 9 :offset-assert 292)
(upload-size int32 9 :offset-assert 328)
(level-distance float :offset-assert 364) ; meters
(inside-sphere? basic :offset-assert 368)
(inside-boxes? basic :offset-assert 372)
@@ -4314,7 +4333,7 @@
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-11 (_type_) none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
@@ -4342,8 +4361,8 @@
;; level-h
(deftype level-group (basic)
((length int32 :offset-assert 4)
(unknown-field-1 basic :offset-assert 8)
(unknown-field-2 basic :offset-assert 12)
(unknown-level-1 level :offset-assert 8)
(unknown-level-2 level :offset-assert 12)
(entity-link entity-links :offset 16) ;; not sure what's going on here
(border? basic :offset-assert 20)
(vis? basic :offset-assert 24)
@@ -4722,6 +4741,9 @@
)
)
(define-extern *text-group-names* (array string))
(define-extern *common-text-heap* kheap)
(define-extern *common-text* symbol)
;;;;;;;;;;;;;;;;
;; settings-h
;;;;;;;;;;;;;;;;
@@ -4822,23 +4844,27 @@
((vifcode vif-tag 4 :offset-assert 0)
(giftag gif-tag :offset-assert 16)
(bitbltbuf gs-bitbltbuf :offset-assert 32)
(bitbltbuf-addr int64 :offset-assert 40)
(bitbltbuf-addr gs-reg64 :offset-assert 40)
(trxpos gs-trxpos :offset-assert 48)
(trxpos-addr int64 :offset-assert 56)
(trxpos-addr gs-reg64 :offset-assert 56)
(trxreg gs-trxreg :offset-assert 64)
(trxreg-addr int64 :offset-assert 72)
(trxreg-addr gs-reg64 :offset-assert 72)
(finish int64 :offset-assert 80) ;; gs-finish
(finish-addr int64 :offset-assert 88)
(finish-addr gs-reg64 :offset-assert 88)
(trxdir gs-trxdir :offset-assert 96)
(trxdir-addr int64 :offset-assert 104)
(trxdir-addr gs-reg64 :offset-assert 104)
)
:method-count-assert 9
:size-assert #x70
:flag-assert #x900000070
)
(define-extern store-image (function int int int int))
(define-extern gs-store-image (function object object object))
(define-extern store-image (function int int))
(define-extern sync-path (function int int none))
(define-extern gs-set-default-store-image (function gs-store-image-packet int int int int int int int int))
(define-extern file-stream-close (function file-stream file-stream))
(define-extern file-stream-write (function file-stream pointer uint uint))
;;;;;;;;;;;;;;;;;;
;; memory-usage-h
@@ -4864,19 +4890,108 @@
:size-assert #x6e0
:flag-assert #xc000006e0
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(reset! (_type_) _type_ 9)
(calculate-total (_type_) int 10)
(dummy-11 () none 11)
)
)
(define-extern *mem-usage* memory-usage-block)
(define-extern *dma-mem-usage* memory-usage-block)
(define-extern *temp-mem-usage* symbol)
;;;;;;;;;;;;;;
;; texture
;;;;;;;;;;;;;;
; ;; texture
(define-extern loado (function string kheap object))
(define-extern ct32-24-block-table (array int32))
(define-extern mz32-24-block-table (array int32))
(define-extern ct16-block-table (array int32))
(define-extern ct16s-block-table (array int32))
(define-extern mz16-block-table (array int32))
(define-extern mz16s-block-table (array int32))
(define-extern mt8-block-table (array int32))
(define-extern mt4-block-table (array int32))
(define-extern texture-page-dir-inspect (function texture-page-dir symbol none))
(define-extern texture-bpp (function gs-psm int))
(define-extern texture-qwc (function int int gs-psm int))
(define-extern physical-address (function pointer pointer))
(define-extern dma-buffer-add-ref-texture (function dma-buffer pointer int int gs-psm none))
(define-extern gs-find-block (function int int gs-psm int))
(define-extern gs-page-width (function gs-psm int))
(define-extern gs-page-height (function gs-psm int))
(define-extern gs-block-width (function gs-psm int))
(define-extern gs-block-height (function gs-psm int))
(define-extern gs-largest-block (function int int gs-psm int))
(define-extern gs-blocks-used (function int int gs-psm int))
;; arg2 in these is not an int, but something else. Not sure what it is yet.
;; all these texture-page-segment might actually be texture-relocate-later!
(define-extern texture-page-default-allocate (function texture-pool texture-page kheap int texture-page))
(define-extern texture-page-common-allocate (function texture-pool texture-page kheap int texture-page))
(define-extern texture-page-common-boot-allocate (function texture-pool texture-page kheap int texture-page))
(define-extern upload-vram-data (function dma-buffer int pointer int none))
(define-extern upload-vram-pages (function texture-pool texture-pool-segment texture-page int int int))
(define-extern update-vram-pages (function texture-pool texture-pool-segment texture-page int int)) ;; todo
(define-extern upload-vram-pages-pris (function texture-pool texture-pool-segment texture-page int int int))
(define-extern texture-page-near-allocate-0 (function texture-pool texture-page kheap int texture-page))
(define-extern texture-page-near-allocate-1 (function texture-pool texture-page kheap int texture-page))
(define-extern texture-page-level-allocate (function texture-pool texture-page kheap int texture-page))
(define-extern texture-page-size-check (function texture-pool level symbol int))
(define-extern texture-relocate (function dma-buffer texture int int int int))
(define-extern *shader-list* pair) ;; unknown type
(define-extern adgif-shader-login-no-remap-fast function)
(define-extern relocate-later (function none))
(define-extern *txt-dma-list* dma-buffer) ;; unknown type
(define-extern adgif-shader-login-fast function)
(define-extern lookup-texture-by-id (function texture-id texture))
;;(define-extern *texture-pool* object) ;; unknown type
(define-extern link-texture-by-id (function adgif-shader texture-id int))
(define-extern *edit-shader* int) ;; unknown type
(define-extern adgif-shader-update! function)
(define-extern loading-level kheap)
(define-extern texture-page-login (function texture-id function kheap texture-page-dir-entry))
(define-extern adgif-shader-login function)
(define-extern adgif-shader-login-no-remap function)
;;;; unknown type
(define-extern adgif-shader<-texture-simple! function)
(define-extern adgif-shader<-texture! function)
(define-extern *font-texture* texture)
;; texture
; (deftype texture-page-dir (basic)
; ()
; ((length int32)
; (pad uint8 12))
; :method-count-assert 10
; :size-assert #x14
; :flag-assert #xa00000014
@@ -7895,8 +8010,9 @@
:flag-assert #x90000012c
)
(define-extern show-mc-info (function none))
(define-extern show-mc-info (function dma-buffer none))
(define-extern mc-sync (function int))
(define-extern mc-get-slot-info (function int mc-slot-info))
;; game-info-h
(deftype game-bank (basic)
@@ -33485,54 +33601,7 @@
;;(define-extern memory-usage-block object) ;; unknown type
;;(define-extern *dma-mem-usage* object) ;; unknown type
;;(define-extern memory-usage-info object) ;; unknown type
(define-extern upload-vram-pages function)
;;(define-extern *shader-list* object) ;; unknown type
(define-extern adgif-shader-login-no-remap-fast function)
;;(define-extern mt8-block-table object) ;; unknown type
(define-extern texture-bpp function)
(define-extern gs-blocks-used function)
(define-extern relocate-later function)
(define-extern gs-page-width function)
(define-extern upload-vram-pages-pris function)
;;(define-extern ct16s-block-table object) ;; unknown type
;;(define-extern *txt-dma-list* object) ;; unknown type
(define-extern adgif-shader-login-fast function)
(define-extern gs-page-height function)
;;(define-extern mz16s-block-table object) ;; unknown type
(define-extern lookup-texture-by-id function)
;;(define-extern *texture-pool* object) ;; unknown type
(define-extern dma-buffer-add-ref-texture function)
(define-extern link-texture-by-id function)
;;(define-extern mt4-block-table object) ;; unknown type
;;(define-extern *edit-shader* object) ;; unknown type
(define-extern adgif-shader-update! function)
;;(define-extern ct16-block-table object) ;; unknown type
(define-extern texture-page-common-boot-allocate function)
(define-extern gs-find-block function)
(define-extern texture-page-level-allocate function)
(define-extern texture-page-common-allocate function)
(define-extern texture-page-login function)
(define-extern texture-page-dir-inspect function)
(define-extern texture-qwc function)
(define-extern adgif-shader-login function)
(define-extern adgif-shader-login-no-remap function)
;;(define-extern mz16-block-table object) ;; unknown type
(define-extern gs-largest-block function)
;;(define-extern ct32-24-block-table object) ;; unknown type
(define-extern gs-block-width function)
(define-extern adgif-shader<-texture-simple! function)
(define-extern texture-relocate function)
(define-extern adgif-shader<-texture! function)
(define-extern update-vram-pages function)
(define-extern texture-page-near-allocate-0 function)
;;(define-extern mz32-24-block-table object) ;; unknown type
(define-extern texture-page-default-allocate function)
(define-extern texture-page-size-check function)
(define-extern gs-block-height function)
(define-extern physical-address function)
(define-extern upload-vram-data function)
(define-extern texture-page-near-allocate-1 function)
;;(define-extern *font-texture* object) ;; unknown type
(define-extern adgif-shader<-texture-with-update! function)
;;(define-extern full object) ;; unknown type
;;(define-extern active object) ;; unknown type
@@ -33848,7 +33917,7 @@
;;(define-extern task object) ;; unknown type
;;(define-extern base object) ;; unknown type
;;(define-extern rot object) ;; unknown type
(define-extern vu-lights-default! function)
(define-extern vu-lights-default! (function light-group none))
(define-extern light-group-slerp function)
(define-extern light-slerp function)
(define-extern light-group-process! function)
@@ -34472,7 +34541,7 @@
;;(define-extern *sprite-array-2d* object) ;; unknown type
(define-extern sprite-allocate-user-hvdf function)
(define-extern sprite-draw-distorters function)
;;(define-extern *shadow-middot-texture* object) ;; unknown type
(define-extern *shadow-middot-texture* texture) ;; unknown type
(define-extern sprite-init-distorter function)
;;(define-extern sprite-distorter-sine-tables object) ;; unknown type
;;(define-extern *sprite-distorter-sine-tables* object) ;; unknown type
@@ -34641,7 +34710,7 @@
(define-extern generic-prepare-dma-double function)
(define-extern generic-upload-vu0 function)
(define-extern generic-work-init function)
;;(define-extern *generic-envmap-texture* object) ;; unknown type
(define-extern *generic-envmap-texture* texture) ;; unknown type
(define-extern mercneric-shader-asm function)
;;(define-extern *inv-init-table* object) ;; unknown type
(define-extern mercneric-bittable-asm function)
@@ -37196,7 +37265,7 @@
;;(define-extern at-pick-object object) ;; unknown type
;;(define-extern far object) ;; unknown type
;;(define-extern anim-speed object) ;; unknown type
;;(define-extern *ocean-texture* object) ;; unknown type
(define-extern *ocean-texture* texture) ;; unknown type
;;(define-extern texture-level object) ;; unknown type
;;(define-extern breath-in object) ;; unknown type
;;(define-extern breath-in-loud object) ;; unknown type
@@ -408,5 +408,25 @@
["L113", "float", true],
["L112", "float", true],
["L111", "float", true]
],
"texture": [
["L356", "_auto_", true],
["L355", "_auto_", true],
["L354", "_auto_", true],
["L353", "_auto_", true],
["L352", "_auto_", true],
["L351", "_auto_", true],
["L350", "_auto_", true],
["L349", "_auto_", true],
["L369", "uint64", true],
["L373", "uint64", true],
["L371", "uint64", true],
["L364", "float", true],
["L360", "float", true],
["L362", "float", true],
["L359", "float", true],
["L358", "float", true],
["L361", "float", true]
]
}
@@ -320,5 +320,65 @@
[66, "a3", "(pointer gs-reg64)"],
[67, "a3", "(pointer uint64)"],
[69, "a3", "(pointer gs-reg64)"]
],
"(method 9 connection)": [[8, "a0", "pointer"]],
"(method 10 connection)": [[8, "a0", "pointer"]],
"(method 0 engine)": [[39, "v0", "pointer"]],
"(method 12 engine)": [[[5, 16], "s4", "connection"]],
"(method 13 engine)": [[[5, 24], "s4", "connection"]],
"(method 15 engine)": [[[0, 36], "v1", "connection"]],
"(method 19 engine)": [[8, "a0", "connection"]],
"(method 20 engine)": [[8, "a0", "connection"]],
"gs-set-default-store-image": [
[9, "t4", "gif-tag64"],
[9, "v1", "gif-tag-regs"]
],
"dma-buffer-add-ref-texture": [
[[25, 29], "a3", "dma-packet"],
[[32, 44], "a3", "gs-gif-tag"],
[[47, 62], "a2", "dma-packet"]
],
"upload-vram-data":[
[[9, 15], "a0", "dma-packet"],
[[18, 24], "a0", "gs-gif-tag"],
[33, "a0", "(pointer gs-bitbltbuf)"],
[35, "a0", "(pointer gs-reg64)"],
[36, "a0", "(pointer gs-trxpos)"],
[38, "a0", "(pointer gs-reg64)"],
[42, "a0", "(pointer gs-trxreg)"],
[44, "a0", "(pointer gs-reg64)"],
[45, "a0", "(pointer gs-trxdir)"],
[47, "a0", "(pointer gs-reg64)"]
],
"texture-page-dir-inspect":[
[[133, 136], "v1", "adgif-shader"]
],
"upload-vram-pages": [
[[135, 140], "a0", "dma-packet"],
[[144, 149], "a0", "gs-gif-tag"],
[[155, 157], "a0", "(pointer gs-reg64)"],
[154, "a0", "(pointer uint64)"],
[[162, 165], "v1", "dma-packet"]
],
"upload-vram-pages-pris": [
[[128, 134], "a0", "dma-packet"],
[[137, 143], "a0", "gs-gif-tag"],
[148, "a0", "(pointer uint64)"],
[150, "a0", "(pointer gs-reg64)"],
[[154, 159], "v1", "dma-packet"]
]
}
@@ -778,7 +778,7 @@
"args": ["packet", "reg-idx", "reg-val"],
"vars": { "v1-0": "tag" }
},
"(method 9 font-context)": {
"args": ["obj", "mat"]
},
@@ -813,7 +813,16 @@
"args": ["obj", "scale"]
},
"(method 0 font-context)": {
"args": ["allocation", "type-to-make", "mat", "x", "y", "z", "color", "flags"],
"args": [
"allocation",
"type-to-make",
"mat",
"x",
"y",
"z",
"color",
"flags"
],
"vars": { "v0-0": "obj" }
},
"font-set-tex0": {
@@ -991,7 +1000,32 @@
},
"gs-set-default-store-image": {
"args": ["packet"]
"args": [
"packet",
"src-fbp",
"src-w",
"src-psm",
"ssax",
"ssay",
"rrw",
"rrh"
]
},
"store-image": {
"args": ["oddeven"],
"vars": {
"s4-0": "buff0",
"s1-0": "buff1",
"s0-0": "packet",
"gp-0": "file",
"s3-0": "width",
"s2-0": "height",
"s0-1": "ptr-0",
"sv-16": "ptr-1",
"sv-32": "y-idx",
"sv-48": "y-idx-2"
}
},
"(method 0 draw-context)": {
@@ -1011,6 +1045,241 @@
"args": ["ctxt", "x", "y"]
},
"texture-qwc": {
"args": ["w", "h", "tex-format"]
},
"gs-find-block": {
"args": ["bx", "by", "tex-format"]
},
"gs-largest-block": {
"args": ["tex-width", "tex-height", "tex-format"],
"vars": {
"s5-0": "block-width",
"v1-0": "block-height",
"a0-6": "real-width",
"a1-4": "real-height",
"s5-1": "width-blocks",
"s3-1": "height-blocks",
"s2-0": "x",
"s1-0": "y",
"s4-1": "max-block"
}
},
"gs-blocks-used": {
"args": ["tex-width", "tex-height", "tex-format"],
"vars": {
"s4-0": "page-width",
"v1-0": "page-height",
"a0-6": "real-width",
"a1-4": "real-height",
"s3-0": "width-blocks",
"s1-0": "height-blocks"
}
},
"dma-buffer-add-ref-texture": {
"args": ["buf", "data", "tex-w", "tex-h", "tex-format"],
"vars": {
"s5-0": "data-ptr",
"v1-0": "qwc",
"a0-4": "qwc-this-time",
"a1-3": "eop",
"a3-1": ["setup-dma", "dma-packet"],
"a3-3": ["setup-dif", "gs-gif-tag"],
"a2-4": ["data-dma", "dma-packet"]
}
},
"(method 15 texture-pool)": {
"args": ["obj", "word-count"]
},
"(method 22 texture-pool)": {
"args": ["obj", "tpage-id"]
},
"(method 10 texture-page)": {
"args": ["obj", "segment-count", "additional-size"]
},
"(method 16 texture-pool)": {
"args": ["obj", "segment", "size"]
},
"(method 9 texture-page)": {
"args": ["obj", "seg"]
},
"texture-page-default-allocate": {
"args": ["pool", "page", "seg", "tpage-id"],
"vars": { "s3-0": "seg-id" }
},
"texture-page-common-allocate": {
"args": ["pool", "page", "seg", "tpage-id"],
"vars": { "s4-0": "seg-id" }
},
"(method 12 texture-page)": {
"args": ["obj", "new-dest", "seg-id"],
"vars": {
"a3-4": "dst-block",
"t0-1": "tex-id",
"t1-6": "tex",
"t2-0": "num-mips",
"t3-4": "mip-id"
}
},
"texture-page-common-boot-allocate": {
"args": ["pool", "page", "heap", "tpage-id"],
"vars": { "s2-0": "tex-id" }
},
"upload-vram-data": {
"args": ["buf", "dest", "tex-data", "tex-h"],
"vars": {
"a3-2": "height-this-time",
"a0-1": ["dma", "dma-packet"],
"a0-3": ["gif", "gs-gif-tag"],
"a0-5": "gs-data"
}
},
"upload-vram-pages": {
"args": ["pool", "segment", "page", "mode", "bucket-idx"],
"vars": {
"s3-0": "dma-buf",
"sv-16": "tex-data",
"sv-20": "tex-dest-base-chunk",
"sv-24": "chunk-count",
"sv-48": "tex-id",
"s1-0": "upload-chunk-idx",
"v1-24": "current-dest-chunk",
"sv-32": "chunks-to-upload-count",
"sv-40": "first-chunk-idx-to-upload",
"gp-0": "total-upload-size",
"s4-0": "dma-start",
"a0-26": ["dma", "dma-packet"],
"a0-28": ["gif", "gs-gif-tag"],
"a0-30": "gif-data",
"v1-50": ["dma-end", "dma-packet"]
}
},
"update-vram-pages": {
"args": ["pool", "pool-segment", "page", "mode"],
"vars": {
"t1-0": "dest-block",
"t2-0": "sz",
"t0-1": "page-id",
"a1-4": "upload-chunks",
"a2-3": "chunk-idx",
"v1-2": "modified-chunk-count",
"a3-8": "vram-chunk"
}
},
"upload-vram-pages-pris": {
"args": ["pool", "segment", "page", "bucket-idx", "allow-cache-mask"],
"vars": {
"s3-0": "dma-buf",
"sv-16": "tex-data",
"sv-20": "tex-dest-base-chunk",
"sv-24": "chunk-count",
"sv-32": "chunks-to-upload-count",
"sv-40": "first-chunk-idx-to-upload",
"sv-48": "page-id",
"s0-0": "upload-chunk-idx",
"sv-52": "current-dest-chunk",
"sv-56": "allow-cached",
"gp-0":"total-upload-size",
"a0-21":["dma", "dma-packet"],
"a0-23":["gif", "gs-gif-tag"],
"v1-55":["dma-end", "dma-packet"]
}
},
"texture-page-near-allocate-0": {
"args": ["pool", "page", "heap", "mode"],
"vars": {
"s3-0":"common-dest",
"s2-0":"page-seg-idx",
"a1-5":"page-seg-2-size",
"v1-15":"after-seg-2-data",
"a0-8":"seg-2-data"
}
},
"texture-page-near-allocate-1": {
"args": ["pool", "page", "heap", "mode"],
"vars": {
"s4-0":"seg2-size",
"a1-1":"seg2-dest",
"s2-0":"common-dest",
"s1-0":"page-seg-idx"
}
},
"texture-page-level-allocate": {
"args": ["pool", "page", "heap", "mode"],
"vars": {
"s2-0":"common-id",
"v1-6":"level-idx"
}
},
"texture-page-size-check": {
"args": ["pool", "level", "hide-prints"],
"vars": {
"gp-0":"oversize",
"s3-0":"tfrag-page",
"v1-0":"tfrag-mip0-size",
"v1-3":"pris-page",
"v1-5":"shrub-page",
"v1-7":"alpha-page",
"v1-9":"water-page"
}
},
"(method 13 texture-pool)": {
"args":["obj", "level", "max-page-kind", "id-array"],
"vars": {
"v1-0":"page-idx",
"v1-5":"tfrag-dir-entry",
"v1-7":"pris-dir-entry",
"v1-9":"shrub-dir-entry",
"v1-11":"alpha-dir-entry",
"v1-13":"water-dir-entry",
"a2-7":"overflow-bits"
}
},
"(method 14 texture-pool)": {
"args":["obj", "level", "tex-page-kind"],
"vars": {
"s3-0":"tfrag-page",
"s2-0":"tfrag-bucket",
"f30-0":"distance",
"a2-4":"pris-page",
"a3-3":"pris-bucket",
"a2-5":"shrub-page",
"f0-5":"shrub-closest",
"t0-4":"shrub-bucket",
"a3-4":"shrub-mode",
"s3-1":"alpha-page",
"f0-6":"alpha-closest",
"s2-1":"alpha-bucket",
"s1-3":"alpha-mode",
"s0-0":"alpha-dest-chunk",
"a2-7":"water-page",
"a3-6":"water-bucket"
}
},
"(method 9 __assert-info-private-struct)": {
"args": ["obj", "filename", "line-num", "column-num"]
},
@@ -1196,6 +1465,34 @@
"vars": { "v0-0": "obj", "v1-11": "idx-to-link", "a0-1": "end-idx" }
},
"(method 10 engine)": {
"args": ["obj", "f"],
"vars": { "a0-1": "current", "s4-0": "next" }
},
"(method 11 engine)": {
"args": ["obj", "f"],
"vars": { "s4-0": "iter" }
},
"(method 12 engine)": {
"vars": { "s4-0": ["ct", "connection"] }
},
"(method 13 engine)": {
"vars": { "s4-0": ["ct", "connection"], "v1-2": "result" }
},
"(method 19 engine)": {
"args": ["obj", "p1-value"],
"vars": { "a0-1": "current", "s4-0": "next" }
},
"(method 20 engine)": {
"args": ["obj", "p2-value"],
"vars": { "a0-1": "current", "s4-0": "next" }
},
"connection-process-apply": {
"args": ["proc", "func"],
"vars": { "s5-0": "iter" }
+16 -2
View File
@@ -25,8 +25,8 @@
:size-assert #x6e0
:flag-assert #xc000006e0
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(reset! (_type_) _type_ 9)
(calculate-total (_type_) int 10)
(dummy-11 () none 11)
)
)
@@ -34,3 +34,17 @@
(define *mem-usage* (new 'debug 'memory-usage-block))
(define *dma-mem-usage* (new 'debug 'memory-usage-block))
(define *temp-mem-usage* #f)
;; Memory usage stats are organized by the type of object.
;; This enum allows you to go from type to the index in the memory-usage-block's data array.
(defenum mem-usage-id
:bitfield #f
:type uint32
(texture 79)
)
;; get a memory usage id as an integer.
(defmacro mem-usage-id-int (kind)
`(the int (mem-usage-id ,kind))
)
+100 -105
View File
@@ -137,18 +137,21 @@
(defmethod get-engine connection ((obj connection))
"Get the engine for this connection. This must be used on a live connection."
;; back up, until we get to the node that's inline on the engine.
(while (-> obj prev0)
(nop!)
(nop!)
(set! obj (the connection (-> obj prev0)))
)
;; the alive-list node has prev0 = #f, so we can just do an offset trick.
;; obj is now alive-list field in an engine, so we can do an offset trick:
(the-as engine (&+ obj -28))
)
(defmethod get-process connection ((obj connection))
"Get the process for this connection"
;; use prev1 to iterate through the process list.
;; same trick as get-engine, but backs up using prev1 until we hit the process.
(while (-> obj prev1)
(nop!)
(nop!)
@@ -250,32 +253,35 @@
)
(defmethod inspect engine ((obj engine))
(local-vars (s5-0 binteger) (s5-1 binteger) (s5-2 binteger) (s5-3 binteger))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tname: ~A~%" (-> obj name))
(format #t "~Tengine-time: ~D~%" (-> obj engine-time))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Talive-list:~%")
(set! s5-0 *print-column*)
(set! *print-column* (+ *print-column* 8))
((method-of-type connectable inspect) (-> obj alive-list))
(set! *print-column* s5-0)
(let ((s5-0 *print-column*))
(set! *print-column* (+ *print-column* 8))
((method-of-type connectable inspect) (-> obj alive-list))
(set! *print-column* s5-0)
)
(format #t "~Talive-list-end:~%")
(set! s5-1 *print-column*)
(set! *print-column* (+ *print-column* 8))
((method-of-type connectable inspect) (-> obj alive-list-end))
(set! *print-column* s5-1)
(let ((s5-1 *print-column*))
(set! *print-column* (+ *print-column* 8))
((method-of-type connectable inspect) (-> obj alive-list-end))
(set! *print-column* s5-1)
)
(format #t "~Tdead-list:~%")
(set! s5-2 *print-column*)
(set! *print-column* (+ *print-column* 8))
((method-of-type connectable inspect) (-> obj dead-list))
(set! *print-column* s5-2)
(let ((s5-2 *print-column*))
(set! *print-column* (+ *print-column* 8))
((method-of-type connectable inspect) (-> obj dead-list))
(set! *print-column* s5-2)
)
(format #t "~Tdead-list-end:~%")
(set! s5-3 *print-column*)
(set! *print-column* (+ *print-column* 8))
((method-of-type connectable inspect) (-> obj dead-list-end))
(set! *print-column* s5-3)
(let ((s5-3 *print-column*))
(set! *print-column* (+ *print-column* 8))
((method-of-type connectable inspect) (-> obj dead-list-end))
(set! *print-column* s5-3)
)
(format #t "~Tdata[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj data))
obj
)
@@ -292,78 +298,68 @@
)
)
(defmethod apply-to-connections engine ((obj engine) (arg0 (function connectable none)))
"Apply the given function to all the live connectables in an engine"
(local-vars
(iter connectable)
(next connectable)
)
(set! iter (-> obj alive-list next0))
(set! next (-> iter next0))
(while (!= iter (-> obj alive-list-end))
(arg0 iter)
(set! iter next)
(set! next (-> next next0))
(defmethod apply-to-connections engine ((obj engine) (f (function connectable none)))
"Apply f to all connections for the engine. It's okay to have f remove the connection."
(let* ((current (-> obj alive-list next0))
;; need to get this _before_ running f, in case we remove.
(next (-> current next0))
)
(while (!= current (-> obj alive-list-end))
(f current)
(set! current next)
(set! next (-> next next0))
)
)
0
)
(defmethod apply-to-connections-reverse engine ((obj engine) (arg0 (function connectable none)))
"Apply the given function to all the live conntables in the engine, iterating backward."
(let ((s4-0 (-> obj alive-list-end prev0)))
(while (!= s4-0 (-> obj alive-list))
(arg0 s4-0)
(set! s4-0 (-> s4-0 prev0))
(defmethod apply-to-connections-reverse engine ((obj engine) (f (function connectable none)))
"Apply f to all connections, reverse order.
Do not use f to remove yourself from the list."
(let ((iter (-> obj alive-list-end prev0)))
(while (!= iter (-> obj alive-list))
(f iter)
(set! iter (-> iter prev0))
)
)
)
0
)
(defmethod execute-connections engine ((obj engine) (arg0 object))
"Iterate through all live connectables and execute them."
(local-vars (s4-0 connectable))
"Run the engine!"
;; update the engine-time
;; remember when
(set! (-> obj engine-time) (-> *display* real-frame-counter))
;; iterate!
(set! s4-0 (-> obj alive-list-end prev0))
(while (!= s4-0 (-> obj alive-list))
;; Execute!
((-> (the-as connection s4-0) param0)
(-> (the-as connection s4-0) param1)
(-> (the-as connection s4-0) param2)
(-> (the-as connection s4-0) param3)
arg0
)
(set! s4-0 (-> s4-0 prev0))
;; go through the connection list, in reverse.
(let ((ct (the-as connection (-> obj alive-list-end prev0))))
(while (!= ct (-> obj alive-list))
;; execute!
((-> ct param0) (-> ct param1) (-> ct param2) (-> ct param3) arg0)
;; advance to previous.
(set! ct (the-as connection (-> ct prev0)))
)
)
0)
0
)
(defmethod execute-connections-and-move-to-dead engine ((obj engine) (arg0 object))
"Execute connections, but remove dead connections from the list."
(local-vars (v0-2 int) (v1-2 object) (s4-0 connectable))
;; update the engine time
"Run the engine! If any objects return 'dead, then remove them"
(set! (-> obj engine-time) (-> *display* real-frame-counter))
(set! s4-0 (-> obj alive-list-end prev0))
;; iterate through alive list in reverse
(while (!= s4-0 (-> obj alive-list))
(set! v1-2
((-> (the-as connection s4-0) param0)
(-> (the-as connection s4-0) param1)
(-> (the-as connection s4-0) param2)
(-> (the-as connection s4-0) param3)
arg0
)
(let ((ct (the-as connection (-> obj alive-list-end prev0))))
(while (!= ct (-> obj alive-list))
;; execute function
(let ((result ((-> ct param0) (-> ct param1) (-> ct param2) (-> ct param3) arg0)))
;; set the next one, _before_ removing
(set! ct (the-as connection (-> ct prev0)))
;; remove if desired.
(if (= result 'dead)
((method-of-type connection move-to-dead) (the-as connection (-> ct next0)))
)
)
)
)
(set! s4-0 (-> s4-0 prev0))
;; if we died, move us to the dead list.
(if (= v1-2 'dead)
(move-to-dead (the-as connection (-> s4-0 next0)))
)
)
0)
0
)
(defmethod execute-connections-if-needed engine ((obj engine) (arg0 object))
"Execute connections, but only if it hasn't been done on this frame."
@@ -529,37 +525,36 @@
)
0)
(defmethod remove-by-param1 engine ((obj engine) (arg0 object))
"Remove all connections with param1 matching arg0."
(local-vars
(a0-1 connectable)
(s4-0 connectable)
)
(set! a0-1 (-> obj alive-list next0))
(set! s4-0 (-> a0-1 next0))
(while (!= a0-1 (-> obj alive-list-end))
(if (= (-> (the-as connection a0-1) param1) arg0)
((method-of-type connection move-to-dead) (the connection a0-1))
(defmethod remove-by-param1 engine ((obj engine) (p1-value object))
"Remove all connections with param1 matching arg0"
(let* ((current (-> obj alive-list next0))
(next (-> current next0))
)
(while (!= current (-> obj alive-list-end))
(if (= (-> (the-as connection current) param1) p1-value)
((method-of-type connection move-to-dead) (the-as connection current))
)
(set! current next)
(set! next (-> next next0))
)
(set! a0-1 s4-0)
(set! s4-0 (-> s4-0 next0))
)
0)
0
)
(defmethod remove-by-param2 engine ((obj engine) (arg0 int))
"Remove all connections with param2 matching arg0"
(local-vars
(a0-1 connectable)
(s4-0 connectable)
)
(set! a0-1 (-> obj alive-list next0))
(set! s4-0 (-> a0-1 next0))
(while (!= a0-1 (-> obj alive-list-end))
(if (= (-> (the-as connection a0-1) param2) arg0)
((method-of-type connection move-to-dead) (the connection a0-1))
(defmethod remove-by-param2 engine ((obj engine) (p2-value int))
"Remove all connections with param2 matching p2-value"
(let* ((current (-> obj alive-list next0))
(next (-> current next0))
)
(while (!= current (-> obj alive-list-end))
(if (= (-> (the-as connection current) param2) p2-value)
((method-of-type connection move-to-dead) (the-as connection current))
)
(set! current next)
(set! next (-> next next0))
)
)
(set! a0-1 s4-0)
(set! s4-0 (-> s4-0 next0))
)
0)
0
)
+1
View File
@@ -135,3 +135,4 @@
)
)
(defun-extern movie? symbol)
+4
View File
@@ -5,3 +5,7 @@
;; name in dgo: main
;; dgos: GAME, ENGINE
(defun movie? ()
"Are we in a movie?"
(nonzero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie)))
)
+117
View File
@@ -5,3 +5,120 @@
;; name in dgo: capture
;; dgos: GAME, ENGINE
;; vif/gif tags to do a transfer of data from VRAM to EE memory.
(deftype gs-store-image-packet (structure)
((vifcode vif-tag 4 :offset-assert 0)
(giftag gif-tag :offset-assert 16)
(bitbltbuf gs-bitbltbuf :offset-assert 32)
(bitbltbuf-addr gs-reg64 :offset-assert 40)
(trxpos gs-trxpos :offset-assert 48)
(trxpos-addr gs-reg64 :offset-assert 56)
(trxreg gs-trxreg :offset-assert 64)
(trxreg-addr gs-reg64 :offset-assert 72)
(finish int64 :offset-assert 80)
(finish-addr gs-reg64 :offset-assert 88)
(trxdir gs-trxdir :offset-assert 96)
(trxdir-addr gs-reg64 :offset-assert 104)
)
:method-count-assert 9
:size-assert #x70
:flag-assert #x900000070
)
(defun gs-set-default-store-image ((packet gs-store-image-packet) (src-fbp int) (src-w int) (src-psm int) (ssax int) (ssay int) (rrw int) (rrh int))
"Set up a gs-store-image-packet for storing"
;; nop
(set! (-> packet vifcode 0) (new 'static 'vif-tag :cmd (vif-cmd nop)))
;; set mskpath3
(set! (-> packet vifcode 1)
(new 'static 'vif-tag :imm #x8000 :cmd (vif-cmd mskpath3))
)
;; flush!
(set! (-> packet vifcode 2)
(new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)
)
;; direct gif transfer.
(set! (-> packet vifcode 3)
(new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
)
;;gif a+d
(set! (-> packet giftag) (the-as gif-tag
(make-u128
(new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))
(new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1)
)
)
)
;; all the a+d
(set! (-> packet bitbltbuf) (new 'static 'gs-bitbltbuf :sbp src-fbp :sbw src-w :spsm src-psm))
(set! (-> packet bitbltbuf-addr) (gs-reg64 bitbltbuf))
(set! (-> packet trxpos) (new 'static 'gs-trxpos :ssax ssax :ssay ssay))
(set! (-> packet trxpos-addr) (gs-reg64 trxpos))
(set! (-> packet trxreg) (new 'static 'gs-trxreg :rrw rrw :rrh rrh))
(set! (-> packet trxreg-addr) (gs-reg64 trxreg))
(set! (-> packet finish) 0)
(set! (-> packet finish-addr) (gs-reg64 finish))
(set! (-> packet trxdir) (new 'static 'gs-trxdir :xdir #x1))
(set! (-> packet trxdir-addr) (gs-reg64 trxdir))
(.sync.l)
7
)
(defun store-image ((oddeven int))
"Store an image to image.raw"
(local-vars (ptr-1 (pointer uint8)) (y-idx int) (y-idx-2 int))
(let ((width 512)
(height (-> *video-parms* screen-sy))
(file (new 'debug 'file-stream "image.raw" 'write))
)
;; create (and leak memory) for 2 arrays.
(let ((buff0 (new 'debug 'boxed-array uint128 (sar (* width height) 2))))
(let ((buff1 (new 'debug 'boxed-array uint128 (sar (* width height) 2))))
;; set up a packet.
(let ((packet (new 'static 'gs-store-image-packet)))
;; capture one field
(gs-set-default-store-image packet #x2800 (sar width 6) 0 0 0 width height)
(flush-cache 0)
(gs-store-image packet (-> buff0 data))
(sync-path 0 0)
;; capture other field
(gs-set-default-store-image packet #x3000 (sar width 6) 0 0 0 width height)
(flush-cache 0)
(gs-store-image packet (-> buff1 data))
)
;; wait for capture to complete.
(sync-path 0 0)
(let ((ptr-0 (-> buff0 data)))
(set! ptr-1 (-> buff1 data))
(cond
((zero? oddeven)
(set! y-idx 0)
(while (< y-idx height)
(file-stream-write file (&+ ptr-0 (* y-idx (shl width 2))) (the-as uint (shl width 2)))
(file-stream-write file (&+ ptr-1 (* y-idx (shl width 2))) (the-as uint (shl width 2)))
(set! y-idx (+ y-idx 1))
)
)
(else
(set! y-idx-2 0)
(while (< y-idx-2 height)
(file-stream-write file (&+ ptr-1 (* y-idx-2 (shl width 2))) (the-as uint (shl width 2)))
(file-stream-write file (&+ ptr-0 (* y-idx-2 (shl width 2))) (the-as uint (shl width 2)))
(set! y-idx-2 (+ y-idx-2 1))
)
)
)
)
(format #t "oddeven = ~d~%" oddeven)
;; this does nothing.
(delete buff1)
)
;; also does nothing.
(delete buff0)
)
(file-stream-close file)
)
0
)
+1 -1
View File
@@ -131,8 +131,8 @@
(vu1-buf dma-buffer :offset 8)
(debug-buf dma-buffer :offset 36)
(global-buf dma-buffer :offset 40)
(buffer uint32 11 :offset 4) ;; for debugging?
(bucket-group dma-bucket :offset 44)
(buffer uint32 11 :offset 4) ;; for debugging?
(profile-bar profile-bar 2 :offset 48)
(run-time uint64 :offset 56)
)
+59 -34
View File
@@ -5,6 +5,17 @@
;; name in dgo: texture-h
;; dgos: GAME, ENGINE
(defenum tpage-kind
:type uint32
:bitfield #f
(tfrag 0)
(pris 1)
(shrub 2)
(alpha 3)
(water 4)
)
;; mask for different texture things.
;; these are the ones that will be displayed in the menu
(define *texture-enable-user-menu* #x1f)
@@ -31,36 +42,43 @@
:flag-assert #x900000008
)
(declare-type texture-page basic)
(declare-type level basic)
(deftype texture-pool (basic)
((top int32 :offset-assert 4)
(cur int32 :offset-assert 8)
(allocate-func basic :offset-assert 12)
(font-palette int32 :offset-assert 16)
(segment texture-pool-segment 4 :inline :offset-assert 20)
(segment-near texture-pool-segment :inline :offset 20)
(segment-common texture-pool-segment :inline :offset 28)
(common-page int32 32 :offset-assert 52)
(common-page-mask int32 :offset-assert 180)
(ids int32 126 :offset-assert 184)
((top int32 :offset-assert 4)
(cur int32 :offset-assert 8)
(allocate-func (function texture-pool texture-page kheap int texture-page) :offset-assert 12)
(font-palette int32 :offset-assert 16) ;; vram word idx
;; these were reordered
(segment-near texture-pool-segment :inline :offset-assert 20)
(segment-common texture-pool-segment :inline :offset-assert 28)
(segment texture-pool-segment 4 :inline :offset 20)
(common-page texture-page 32 :offset-assert 52)
(common-page-mask int32 :offset-assert 180)
(ids uint32 126 :offset-assert 184)
)
:method-count-assert 23
:size-assert #x2b0
:flag-assert #x17000002b0
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(new (symbol type) _type_ 0)
(initialize! (_type_) _type_ 9)
(print-usage (_type_) _type_ 10)
(dummy-11 (_type_) none 11)
(allocate-defaults! (_type_) none 12)
(login-level-textures (_type_ level int (pointer texture-id)) none 13) ;; loading level...
(add-tex-to-dma! (_type_ level int) none 14) ;; very mysterious arg types.
(allocate-vram-words! (_type_ int) int 15)
(allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(upload-one-common! (_type_) symbol 21)
(lookup-boot-common-id (_type_ int) int 22)
)
)
@@ -69,7 +87,7 @@
(h int16 :offset-assert 6)
(num-mips uint8 :offset-assert 8)
(tex1-control uint8 :offset-assert 9)
(psm uint8 :offset-assert 10)
(psm gs-psm :offset-assert 10)
(mip-shift uint8 :offset-assert 11)
(clutpsm uint16 :offset-assert 12)
(dest uint16 7 :offset-assert 14)
@@ -109,30 +127,30 @@
(size uint32 :offset-assert 24)
(segment texture-page-segment 3 :inline :offset-assert 28)
(pad uint32 16 :offset-assert 64)
(data uint8 :dynamic :offset-assert 128)
(data texture :dynamic :offset-assert 128)
)
:method-count-assert 15
:size-assert #x80
:flag-assert #xf00000080
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(remove-from-heap (_type_ kheap) _type_ 9)
(get-leftover-block-count (_type_ int int) int 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(relocate-dests! (_type_ int int) none 12)
(add-to-dma-buffer (_type_ dma-buffer int) none 13)
(upload-now! (_type_ int) none 14)
)
)
(deftype shader-ptr (uint32)
()
((shader uint32 :offset 8 :size 24))
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
)
(deftype texture-link (structure)
((next uint32 :offset-assert 0)
((next shader-ptr 1 :offset-assert 0)
)
:method-count-assert 9
:size-assert #x4
@@ -142,16 +160,18 @@
(deftype texture-page-dir-entry (structure)
((length int16 :offset-assert 0)
(status uint16 :offset-assert 2)
(page basic :offset-assert 4)
(link uint32 :offset-assert 8)
(page texture-page :offset-assert 4)
(link texture-link :offset-assert 8)
)
:pack-me
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
)
(deftype texture-page-dir (basic)
((pad uint8 #x10))
((length int32)
(entries texture-page-dir-entry 1 :inline))
(:methods
(dummy-9 () none 9)
)
@@ -164,7 +184,7 @@
(source uint32 :offset-assert 12)
(move uint32 :offset-assert 16)
(entry texture-page-dir-entry :offset-assert 20)
(page basic :offset-assert 24)
(page texture-page :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
@@ -186,7 +206,7 @@
(alpha uint64 :offset 64)
(link-test uint32 :offset 8)
(texture-id uint32 :offset 24)
(next uint32 :offset 40)
(next shader-ptr :offset 40)
)
:method-count-assert 9
:size-assert #x50
@@ -213,3 +233,8 @@
(define *ocean-base-vram-word* 0)
(define *ocean-base-block* 0)
(define *ocean-base-page* 0)
(defun-extern texture-page-default-allocate texture-pool texture-page kheap int texture-page)
(define-extern texture-page-login (function texture-id function kheap texture-page-dir-entry))
(define-extern *texture-pool* texture-pool)
File diff suppressed because it is too large Load Diff
+45 -8
View File
@@ -5,6 +5,43 @@
;; name in dgo: level-h
;; dgos: GAME, ENGINE
(defenum bucket-id
:type uint32
:bitfield #f
(tfrag-tex0 5)
;; merc0 10
;; generic0 11
(tfrag-tex1 12)
;; merc1 17
;; generic1 18
(shrub-tex0 19)
(shrub-tex1 25)
(alpha-tex0 31)
(alpha-tex1 38)
(pris-tex0 48)
;; merc0 49
;; generic0 50
(pris-tex1 51)
;; merc1 52
;; generic1 53
(water-tex0 57)
;; merc0 58 (+ default)
;; generic0 59 (+ default)
(water-tex1 60)
;; merc1 61
;; generic1 62
)
;; Information related to visibility data for a level.
;; Unclear why there are 8 of these per level.
;; Perhaps there are up to 8 "chunks" of the visibility loaded at a single time?
@@ -94,15 +131,15 @@
(bsp basic :offset-assert 48)
(art-group basic :offset-assert 52)
(info basic :offset-assert 56)
(texture-page basic 9 :offset-assert 60)
(texture-page texture-page 9 :offset-assert 60)
(loaded-texture-page basic 16 :offset-assert 96)
(loaded-texture-page-count int32 :offset-assert 160)
(foreground-sink-group dma-foreground-sink-group 3 :inline :offset-assert 176) ;; inline basic, todo check stride.
(foreground-draw-engine basic 3 :offset-assert 272)
(entity basic :offset-assert 284)
(ambient basic :offset-assert 288)
(closest-object basic 9 :offset-assert 292)
(upload-size uint32 9 :offset-assert 328)
(closest-object float 9 :offset-assert 292)
(upload-size int32 9 :offset-assert 328)
(level-distance float :offset-assert 364) ; meters
(inside-sphere? basic :offset-assert 368)
(inside-boxes? basic :offset-assert 372)
@@ -132,7 +169,7 @@
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-11 (_type_) none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
@@ -161,8 +198,8 @@
;; don't belong to any level, for example to render Jak.
(deftype level-group (basic)
((length int32 :offset-assert 4)
(unknown-field-1 basic :offset-assert 8)
(unknown-field-2 basic :offset-assert 12)
(unknown-level-1 level :offset-assert 8)
(unknown-level-2 level :offset-assert 12)
(entity-link entity-links :offset 16) ;; not sure what's going on here
(border? basic :offset-assert 20)
(vis? basic :offset-assert 24)
@@ -211,8 +248,8 @@
(set! *level*
(new 'static 'level-group
:length 2
:unknown-field-1 #f
:unknown-field-2 #f
:unknown-level-1 #f
:unknown-level-2 #f
:entity-link #f
:border? #f
:want-level #f
+1 -1
View File
@@ -40,4 +40,4 @@
(define *common-text-heap* (new 'global 'kheap))
;; probably some other type.
(define *common-text* #f)
(define *common-text* #f)
+4 -4
View File
@@ -122,14 +122,14 @@
;; put-display-env
;; syncv
;; sync-path
(define-extern sync-path (function int int none))
(define-extern reset-path (function none))
(define-extern reset-graph (function int int int int none))
;; dma-sync
(define-extern dma-sync (function pointer int int int))
;; gs-put-imr
;; gs-get-imr
;; gs-store-image
(define-extern gs-store-image (function object object object))
(define-extern flush-cache (function int none))
;; cpad-open
(declare-type cpad-info structure)
@@ -139,11 +139,11 @@
;; install-debug-handler
;; file-stream-open
(define-extern file-stream-open (function file-stream basic basic file-stream))
;; file-stream-close
(define-extern file-stream-close (function file-stream file-stream))
(define-extern file-stream-length (function file-stream int))
;; file-stream-seek
(define-extern file-stream-read (function file-stream pointer int int))
;; file-stream-write
(define-extern file-stream-write (function file-stream pointer uint uint))
;; scf-get-language
;; scf-get-time
;; scf-get-aspect
+13
View File
@@ -1397,3 +1397,16 @@
;; Copies the contents of a gpr to a cop0 (system control) register
(fake-asm .mtc0 dest src)
)
(defmacro make-u128 (upper lower)
"Make a i128 from two 64-bit values."
`(rlet ((result :class i128)
(upper-xmm :class i128)
(lower-xmm :class i128))
(.mov upper-xmm ,upper)
(.mov lower-xmm ,lower)
(.pcpyld result upper-xmm lower-xmm)
result
)
)
+1 -1
View File
@@ -146,7 +146,7 @@ void Compiler::generate_field_description(const goos::Object& form,
format_args.push_back(get_field_of_structure(type, reg, f.name(), env)->to_gpr(env));
} else if (m_ts.tc(m_ts.make_typespec("integer"), f.type())) {
// Integer
if (f.type().print() == "uint128") {
if (m_ts.lookup_type(f.type())->get_load_size() > 8) {
str_template += fmt::format("~T{}: <cannot-print>~%", f.name());
} else {
str_template += fmt::format("~T{}: ~D~%", f.name());
+1 -1
View File
@@ -41,7 +41,7 @@ def main():
file_stats = []
total_gc_files = 0
excluded_files = {"all_files.gc", "goal-lib.gc", "ocean-trans-tables.gc", "ocean-frames.gc"}
excluded_files = {"all_files.gc", "goal-lib.gc", "ocean-trans-tables.gc", "ocean-frames.gc", "ocean-tables.gc"}
for fn in all_files:
@@ -406,4 +406,23 @@
(defenum gs-reg64
:type uint64
:copy-entries gs-reg
)
)
;; connect
(declare-type engine basic)
(defmacro make-u128 (upper lower)
`(rlet ((result :class i128)
(upper-xmm :class i128)
(lower-xmm :class i128))
(.mov upper-xmm ,upper)
(.mov lower-xmm ,lower)
(.pcpyld result upper-xmm lower-xmm)
result
)
)
;; texture
(declare-type texture-page basic)
(declare-type level basic)
+187
View File
@@ -0,0 +1,187 @@
;;-*-Lisp-*-
(in-package goal)
;; this file is debug only
(when *debug-segment*
;; definition of type gs-store-image-packet
(deftype gs-store-image-packet (structure)
((vifcode vif-tag 4 :offset-assert 0)
(giftag gif-tag :offset-assert 16)
(bitbltbuf gs-bitbltbuf :offset-assert 32)
(bitbltbuf-addr gs-reg64 :offset-assert 40)
(trxpos gs-trxpos :offset-assert 48)
(trxpos-addr gs-reg64 :offset-assert 56)
(trxreg gs-trxreg :offset-assert 64)
(trxreg-addr gs-reg64 :offset-assert 72)
(finish int64 :offset-assert 80)
(finish-addr gs-reg64 :offset-assert 88)
(trxdir gs-trxdir :offset-assert 96)
(trxdir-addr gs-reg64 :offset-assert 104)
)
:method-count-assert 9
:size-assert #x70
:flag-assert #x900000070
)
;; definition for method 3 of type gs-store-image-packet
;; Used lq/sq
(defmethod inspect gs-store-image-packet ((obj gs-store-image-packet))
(format #t "[~8x] ~A~%" obj 'gs-store-image-packet)
(format #t "~Tvifcode[4] @ #x~X~%" (-> obj vifcode))
(format #t "~Tgiftag: ~D~%" (-> obj giftag))
(format #t "~Tbitbltbuf: ~D~%" (-> obj bitbltbuf))
(format #t "~Tbitbltbuf-addr: ~D~%" (-> obj bitbltbuf-addr))
(format #t "~Ttrxpos: ~D~%" (-> obj trxpos))
(format #t "~Ttrxpos-addr: ~D~%" (-> obj trxpos-addr))
(format #t "~Ttrxreg: ~D~%" (-> obj trxreg))
(format #t "~Ttrxreg-addr: ~D~%" (-> obj trxreg-addr))
(format #t "~Tfinish: ~D~%" (-> obj finish))
(format #t "~Tfinish-addr: ~D~%" (-> obj finish-addr))
(format #t "~Ttrxdir: ~D~%" (-> obj trxdir))
(format #t "~Ttrxdir-addr: ~D~%" (-> obj trxdir-addr))
obj
)
;; definition for function gs-set-default-store-image
;; WARN: Unsupported inline assembly instruction kind - [sync.l]
;; Used lq/sq
(defun
gs-set-default-store-image
((packet gs-store-image-packet)
(src-fbp int)
(src-w int)
(src-psm int)
(ssax int)
(ssay int)
(rrw int)
(rrh int)
)
(set! (-> packet vifcode 0) (new 'static 'vif-tag))
(set!
(-> packet vifcode 1)
(new 'static 'vif-tag :imm #x8000 :cmd (vif-cmd mskpath3))
)
(set!
(-> packet vifcode 2)
(new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)
)
(set!
(-> packet vifcode 3)
(new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
)
(set!
(-> packet giftag)
(the-as
gif-tag
(make-u128
(new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))
(new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1)
)
)
)
(set!
(-> packet bitbltbuf)
(new 'static 'gs-bitbltbuf :sbp src-fbp :sbw src-w :spsm src-psm)
)
(set! (-> packet bitbltbuf-addr) (gs-reg64 bitbltbuf))
(set! (-> packet trxpos) (new 'static 'gs-trxpos :ssax ssax :ssay ssay))
(set! (-> packet trxpos-addr) (gs-reg64 trxpos))
(set! (-> packet trxreg) (new 'static 'gs-trxreg :rrw rrw :rrh rrh))
(set! (-> packet trxreg-addr) (gs-reg64 trxreg))
(set! (-> packet finish) 0)
(set! (-> packet finish-addr) (gs-reg64 finish))
(set! (-> packet trxdir) (new 'static 'gs-trxdir :xdir #x1))
(set! (-> packet trxdir-addr) (gs-reg64 trxdir))
(.sync.l)
7
)
;; definition for function store-image
;; Used lq/sq
(defun store-image ((oddeven int))
(local-vars (ptr-1 (pointer uint8)) (y-idx int) (y-idx-2 int))
(let ((width 512)
(height (-> *video-parms* screen-sy))
(file (new 'debug 'file-stream "image.raw" 'write))
)
(let ((buff0 (new 'debug 'boxed-array uint128 (sar (* width height) 2))))
(let ((buff1 (new 'debug 'boxed-array uint128 (sar (* width height) 2))))
(let ((packet (new 'static 'gs-store-image-packet)))
(gs-set-default-store-image
packet
#x2800
(sar width 6)
0
0
0
width
height
)
(flush-cache 0)
(gs-store-image packet (-> buff0 data))
(sync-path 0 0)
(gs-set-default-store-image
packet
#x3000
(sar width 6)
0
0
0
width
height
)
(flush-cache 0)
(gs-store-image packet (-> buff1 data))
)
(sync-path 0 0)
(let ((ptr-0 (-> buff0 data)))
(set! ptr-1 (-> buff1 data))
(cond
((zero? oddeven)
(set! y-idx 0)
(while (< y-idx height)
(file-stream-write
file
(&+ ptr-0 (* y-idx (shl width 2)))
(the-as uint (shl width 2))
)
(file-stream-write
file
(&+ ptr-1 (* y-idx (shl width 2)))
(the-as uint (shl width 2))
)
(set! y-idx (+ y-idx 1))
)
)
(else
(set! y-idx-2 0)
(while (< y-idx-2 height)
(file-stream-write
file
(&+ ptr-1 (* y-idx-2 (shl width 2)))
(the-as uint (shl width 2))
)
(file-stream-write
file
(&+ ptr-0 (* y-idx-2 (shl width 2)))
(the-as uint (shl width 2))
)
(set! y-idx-2 (+ y-idx-2 1))
)
)
)
)
(format #t "oddeven = ~d~%" oddeven)
(delete buff1)
)
(delete buff0)
)
(file-stream-close file)
)
0
)
)
+548
View File
@@ -0,0 +1,548 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type connectable
(deftype connectable (structure)
((next0 connectable :offset-assert 0)
(prev0 connectable :offset-assert 4)
(next1 connectable :offset-assert 8)
(prev1 connectable :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type connectable
(defmethod inspect connectable ((obj connectable))
(format #t "[~8x] ~A~%" obj 'connectable)
(format #t "~Tnext0: ~`connectable`P~%" (-> obj next0))
(format #t "~Tprev0: ~`connectable`P~%" (-> obj prev0))
(format #t "~Tnext1: ~`connectable`P~%" (-> obj next1))
(format #t "~Tprev1: ~`connectable`P~%" (-> obj prev1))
obj
)
;; definition of type connection
(deftype connection (connectable)
((param0 (function object object object object object) :offset-assert 16)
(param1 basic :offset-assert 20)
(param2 basic :offset-assert 24)
(param3 basic :offset-assert 28)
(quad uint128 2 :offset 0)
)
:method-count-assert 14
:size-assert #x20
:flag-assert #xe00000020
(:methods
(get-engine (connection) engine 9)
(get-process (connection) process 10)
(belongs-to-engine? (connection engine) symbol 11)
(belongs-to-process? (connection process) symbol 12)
(move-to-dead (connection) connection 13)
)
)
;; definition for method 3 of type connection
(defmethod inspect connection ((obj connection))
(format #t "[~8x] ~A~%" obj 'connection)
(format #t "~Tnext0: ~`connectable`P~%" (-> obj next0))
(format #t "~Tprev0: ~`connectable`P~%" (-> obj prev0))
(format #t "~Tnext1: ~`connectable`P~%" (-> obj next1))
(format #t "~Tprev1: ~`connectable`P~%" (-> obj prev1))
(format #t "~Tparam0: ~A~%" (-> obj param0))
(format #t "~Tparam1: ~A~%" (-> obj param1))
(format #t "~Tparam2: ~A~%" (-> obj param2))
(format #t "~Tparam3: ~A~%" (-> obj param3))
(format #t "~Tquad[2] @ #x~X~%" (&-> obj next0))
obj
)
;; definition of type engine
(deftype engine (basic)
((name basic :offset-assert 4)
(length int16 :offset-assert 8)
(allocated-length int16 :offset-assert 10)
(engine-time uint64 :offset-assert 16)
(alive-list connectable :inline :offset-assert 32)
(alive-list-end connectable :inline :offset-assert 48)
(dead-list connectable :inline :offset-assert 64)
(dead-list-end connectable :inline :offset-assert 80)
(data connection 1 :inline :offset-assert 96)
)
:method-count-assert 24
:size-assert #x80
:flag-assert #x1800000080
(:methods
(new (symbol type basic int) _type_ 0)
(inspect-all-connections (engine) engine 9)
(apply-to-connections (engine (function connectable none)) int 10)
(apply-to-connections-reverse (engine (function connectable none)) int 11)
(execute-connections (engine object) int 12)
(execute-connections-and-move-to-dead (engine object) int 13)
(execute-connections-if-needed (engine object) int 14)
(add-connection (engine process (function object object object object object) object object object) connection 15)
(remove-from-process (engine process) int 16)
(remove-matching (engine (function connection engine symbol)) int 17)
(remove-all (engine) int 18)
(remove-by-param1 (engine object) int 19)
(remove-by-param2 (engine int) int 20)
(get-first-connectable (engine) connectable 21)
(get-last-connectable (engine) connectable 22)
(unknown-1 (engine (pointer uint32)) uint 23)
)
)
;; definition for method 12 of type connection
(defmethod belongs-to-process? connection ((obj connection) (arg0 process))
(= arg0 ((method-of-type connection get-process) obj))
)
;; definition for method 2 of type connection
(defmethod print connection ((obj connection))
(format
#t
"#<connection (~A ~A ~A ~A) @ #x~X>"
(-> obj param0)
(-> obj param1)
(-> obj param2)
(-> obj param3)
obj
)
obj
)
;; definition for method 9 of type connection
;; INFO: Return type mismatch pointer vs engine.
(defmethod get-engine connection ((obj connection))
(while (-> (the-as connectable obj) prev0)
(nop!)
(nop!)
(set! obj (the-as connection (-> (the-as connectable obj) prev0)))
)
(the-as engine (&+ (the-as pointer obj) -28))
)
;; definition for method 10 of type connection
;; INFO: Return type mismatch pointer vs process.
(defmethod get-process connection ((obj connection))
(while (-> (the-as connectable obj) prev1)
(nop!)
(nop!)
(set! obj (the-as connection (-> (the-as connectable obj) prev1)))
)
(the-as process (&+ (the-as pointer obj) -92))
)
;; definition for method 11 of type connection
(defmethod belongs-to-engine? connection ((obj connection) (arg0 engine))
(and
(< (the-as int arg0) (the-as int obj))
(< (the-as int obj) (the-as int (-> arg0 data (-> arg0 allocated-length))))
)
)
;; definition for method 21 of type engine
(defmethod get-first-connectable engine ((obj engine))
(-> obj alive-list next0)
)
;; definition for method 22 of type engine
(defmethod get-last-connectable engine ((obj engine))
(-> obj alive-list-end)
)
;; definition for method 23 of type engine
(defmethod unknown-1 engine ((obj engine) (arg0 (pointer uint32)))
(-> arg0 0)
)
;; definition for method 0 of type engine
(defmethod
new
engine
((allocation symbol) (type-to-make type) (name basic) (length int))
(let
((obj
(object-new
allocation
type-to-make
(the-as
int
(+ (-> type-to-make size) (the-as uint (shl (+ length -1) 5)))
)
)
)
)
(set! (-> (the-as engine obj) allocated-length) length)
(set! (-> (the-as engine obj) length) 0)
(set! (-> (the-as engine obj) name) name)
(set!
(-> (the-as engine obj) alive-list next0)
(-> (the-as engine obj) alive-list-end)
)
(set! (-> (the-as engine obj) alive-list prev0) #f)
(set! (-> (the-as engine obj) alive-list next1) #f)
(set! (-> (the-as engine obj) alive-list prev1) #f)
(set! (-> (the-as engine obj) alive-list-end next0) #f)
(set!
(-> (the-as engine obj) alive-list-end prev0)
(-> (the-as engine obj) alive-list)
)
(set! (-> (the-as engine obj) alive-list-end next1) #f)
(set! (-> (the-as engine obj) alive-list-end prev1) #f)
(set!
(-> (the-as engine obj) dead-list next0)
(the-as connectable (-> (the-as engine obj) data))
)
(set! (-> (the-as engine obj) dead-list prev0) #f)
(set! (-> (the-as engine obj) dead-list next1) #f)
(set! (-> (the-as engine obj) dead-list prev1) #f)
(set! (-> (the-as engine obj) dead-list-end next0) #f)
(set!
(-> (the-as engine obj) dead-list-end prev0)
(-> (the-as engine obj) data (+ length -1))
)
(set! (-> (the-as engine obj) dead-list-end next1) #f)
(set! (-> (the-as engine obj) dead-list-end prev1) #f)
(set!
(-> (the-as engine obj) data 0 prev0)
(-> (the-as engine obj) dead-list)
)
(set!
(-> (the-as engine obj) data 0 next0)
(the-as connectable (&+ (the-as pointer obj) 124))
)
(let ((idx-to-link 1)
(end-idx (+ length -2))
)
(while (>= end-idx idx-to-link)
(set!
(-> (the-as engine obj) data idx-to-link prev0)
(-> (the-as engine obj) data (+ idx-to-link -1))
)
(set!
(-> (the-as engine obj) data idx-to-link next0)
(-> (the-as engine obj) data (+ idx-to-link 1))
)
(+! idx-to-link 1)
)
)
(set!
(-> (the-as engine obj) data (+ length -1) prev0)
(-> (the-as engine obj) data (+ length -2))
)
(set!
(-> (the-as engine obj) data (+ length -1) next0)
(-> (the-as engine obj) dead-list-end)
)
(the-as engine obj)
)
)
;; definition for method 2 of type engine
(defmethod print engine ((obj engine))
(format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj)
obj
)
;; definition for method 3 of type engine
(defmethod inspect engine ((obj engine))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tname: ~A~%" (-> obj name))
(format #t "~Tengine-time: ~D~%" (-> obj engine-time))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Talive-list:~%")
(let ((s5-0 *print-column*))
(set! *print-column* (+ *print-column* (the-as uint 64)))
((method-of-type connectable inspect) (-> obj alive-list))
(set! *print-column* s5-0)
)
(format #t "~Talive-list-end:~%")
(let ((s5-1 *print-column*))
(set! *print-column* (+ *print-column* (the-as uint 64)))
((method-of-type connectable inspect) (-> obj alive-list-end))
(set! *print-column* s5-1)
)
(format #t "~Tdead-list:~%")
(let ((s5-2 *print-column*))
(set! *print-column* (+ *print-column* (the-as uint 64)))
((method-of-type connectable inspect) (-> obj dead-list))
(set! *print-column* s5-2)
)
(format #t "~Tdead-list-end:~%")
(let ((s5-3 *print-column*))
(set! *print-column* (+ *print-column* (the-as uint 64)))
((method-of-type connectable inspect) (-> obj dead-list-end))
(set! *print-column* s5-3)
)
(format #t "~Tdata[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj data))
obj
)
;; definition for method 4 of type engine
(defmethod length engine ((obj engine))
(-> obj length)
)
;; definition for method 5 of type engine
;; INFO: Return type mismatch uint vs int.
(defmethod asize-of engine ((obj engine))
(the-as
int
(+ (-> engine size) (the-as uint (shl (+ (-> obj allocated-length) -1) 5)))
)
)
;; definition for method 10 of type engine
(defmethod
apply-to-connections
engine
((obj engine) (f (function connectable none)))
(let* ((current (-> obj alive-list next0))
(next (-> current next0))
)
(while (!= current (-> obj alive-list-end))
(f current)
(set! current next)
(set! next (-> next next0))
)
)
0
)
;; definition for method 11 of type engine
(defmethod
apply-to-connections-reverse
engine
((obj engine) (f (function connectable none)))
(let ((iter (-> obj alive-list-end prev0)))
(while (!= iter (-> obj alive-list))
(f iter)
(set! iter (-> iter prev0))
)
)
0
)
;; definition for method 12 of type engine
(defmethod execute-connections engine ((obj engine) (arg0 object))
(set! (-> obj engine-time) (-> *display* real-frame-counter))
(let ((ct (the-as connection (-> obj alive-list-end prev0))))
(while (!= ct (-> obj alive-list))
((-> ct param0) (-> ct param1) (-> ct param2) (-> ct param3) arg0)
(set! ct (the-as connection (-> ct prev0)))
)
)
0
)
;; definition for method 13 of type engine
(defmethod
execute-connections-and-move-to-dead
engine
((obj engine) (arg0 object))
(set! (-> obj engine-time) (-> *display* real-frame-counter))
(let ((ct (the-as connection (-> obj alive-list-end prev0))))
(while (!= ct (-> obj alive-list))
(let
((result
((-> ct param0) (-> ct param1) (-> ct param2) (-> ct param3) arg0)
)
)
(set! ct (the-as connection (-> ct prev0)))
(if (= result 'dead)
((method-of-type connection move-to-dead)
(the-as connection (-> ct next0))
)
)
)
)
)
0
)
;; definition for method 14 of type engine
(defmethod execute-connections-if-needed engine ((obj engine) (arg0 object))
(if (!= (-> *display* real-frame-counter) (-> obj engine-time))
(execute-connections obj arg0)
)
0
)
;; definition for function connection-process-apply
(defun connection-process-apply ((proc process) (func (function object none)))
(when proc
(let ((iter (-> proc connection-list next1)))
(while iter
(func iter)
(set! iter (-> iter next1))
)
)
#f
)
)
;; definition for method 9 of type engine
(defmethod inspect-all-connections engine ((obj engine))
(apply-to-connections
obj
(the-as (function connectable none) (-> connection methods-by-name inspect))
)
obj
)
;; definition for method 15 of type engine
(defmethod
add-connection
engine
((obj engine)
(proc process)
(func (function object object object object object))
(p1 object)
(p2 object)
(p3 object)
)
(let ((con (the-as connection (-> obj dead-list next0))))
(when (not (or (not proc) (= con (-> obj dead-list-end))))
(set! (-> con param0) func)
(set! (-> con param1) (the-as basic p1))
(set! (-> con param2) (the-as basic p2))
(set! (-> con param3) (the-as basic p3))
(set! (-> obj dead-list next0) (-> con next0))
(set! (-> con next0 prev0) (-> obj dead-list))
(set! (-> con next0) (-> obj alive-list next0))
(set! (-> con next0 prev0) con)
(set! (-> con prev0) (-> obj alive-list))
(set! (-> obj alive-list next0) con)
(set! (-> con next1) (-> proc connection-list next1))
(if (-> con next1)
(set! (-> con next1 prev1) con)
)
(set! (-> con prev1) (-> proc connection-list))
(set! (-> proc connection-list next1) con)
(set! (-> obj length) (+ (-> obj length) 1))
con
)
)
)
;; definition for method 13 of type connection
(defmethod move-to-dead connection ((obj connection))
(let ((v1-1 ((method-of-type connection get-engine) obj)))
(set! (-> obj prev0 next0) (-> obj next0))
(set! (-> obj next0 prev0) (-> obj prev0))
(set! (-> obj prev1 next1) (-> obj next1))
(if (-> obj next1)
(set! (-> obj next1 prev1) (-> obj prev1))
)
(set! (-> obj next0) (-> v1-1 dead-list next0))
(set! (-> obj next0 prev0) obj)
(set! (-> obj prev0) (-> v1-1 dead-list))
(set! (-> v1-1 dead-list next0) obj)
(set! (-> v1-1 length) (+ (-> v1-1 length) -1))
)
obj
)
;; definition for function process-disconnect
(defun process-disconnect ((arg0 process))
(when arg0
(let ((gp-0 (-> arg0 connection-list next1)))
(while gp-0
((method-of-type connection move-to-dead) (the-as connection gp-0))
(set! gp-0 (-> gp-0 next1))
)
)
)
0
)
;; definition for method 16 of type engine
(defmethod remove-from-process engine ((obj engine) (arg0 process))
(when arg0
(let ((s5-0 (-> arg0 connection-list next1)))
(while s5-0
(if
((method-of-type connection belongs-to-engine?)
(the-as connection s5-0)
obj
)
((method-of-type connection move-to-dead) (the-as connection s5-0))
)
(set! s5-0 (-> s5-0 next1))
)
)
)
0
)
;; definition for method 17 of type engine
(defmethod
remove-matching
engine
((obj engine) (arg0 (function connection engine symbol)))
(let* ((s4-0 (-> obj alive-list next0))
(s3-0 (-> s4-0 next0))
)
(while (!= s4-0 (-> obj alive-list-end))
(if (arg0 (the-as connection s4-0) obj)
((method-of-type connection move-to-dead) (the-as connection s4-0))
)
(set! s4-0 s3-0)
(set! s3-0 (-> s3-0 next0))
)
)
0
)
;; definition for method 18 of type engine
(defmethod remove-all engine ((obj engine))
(let* ((a0-1 (-> obj alive-list next0))
(s5-0 (-> a0-1 next0))
)
(while (!= a0-1 (-> obj alive-list-end))
((method-of-type connection move-to-dead) (the-as connection a0-1))
(set! a0-1 s5-0)
(set! s5-0 (-> s5-0 next0))
)
)
0
)
;; definition for method 19 of type engine
(defmethod remove-by-param1 engine ((obj engine) (p1-value object))
(let* ((current (-> obj alive-list next0))
(next (-> current next0))
)
(while (!= current (-> obj alive-list-end))
(if (= (-> (the-as connection current) param1) p1-value)
((method-of-type connection move-to-dead) (the-as connection current))
)
(set! current next)
(set! next (-> next next0))
)
)
0
)
;; definition for method 20 of type engine
(defmethod remove-by-param2 engine ((obj engine) (p2-value int))
(let* ((current (-> obj alive-list next0))
(next (-> current next0))
)
(while (!= current (-> obj alive-list-end))
(if (= (-> (the-as connection current) param2) p2-value)
((method-of-type connection move-to-dead) (the-as connection current))
)
(set! current next)
(set! next (-> next next0))
)
)
0
)
+2 -2
View File
@@ -89,8 +89,8 @@
(vu1-buf dma-buffer :offset 8)
(debug-buf dma-buffer :offset 36)
(global-buf dma-buffer :offset 40)
(buffer uint32 11 :offset 4)
(bucket-group dma-bucket :offset 44)
(buffer uint32 11 :offset 4)
(profile-bar profile-bar 2 :offset 48)
(run-time uint64 :offset 56)
)
@@ -110,7 +110,7 @@
(format #t "~Tvu1-buf: ~A~%" (-> obj calc-buf))
(format #t "~Tdebug-buf: ~A~%" (-> obj debug-buf))
(format #t "~Tglobal-buf: ~A~%" (-> obj global-buf))
(format #t "~Tbucket-group: #<dma-bucket @ #x~X>~%" (-> obj buffer 10))
(format #t "~Tbucket-group: #<dma-bucket @ #x~X>~%" (-> obj bucket-group))
(format #t "~Tprofile-bar[2] @ #x~X~%" (-> obj profile-bar))
(format #t "~Trun-time: ~D~%" (-> obj run-time))
obj
+797
View File
@@ -0,0 +1,797 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type char-verts
(deftype char-verts (structure)
((pos vector 4 :inline :offset-assert 0)
(color vector 4 :inline :offset-assert 64)
(tex-st vector 4 :inline :offset-assert 128)
)
:method-count-assert 9
:size-assert #xc0
:flag-assert #x9000000c0
)
;; definition for method 3 of type char-verts
(defmethod inspect char-verts ((obj char-verts))
(format #t "[~8x] ~A~%" obj 'char-verts)
(format #t "~Tpos[4] @ #x~X~%" (-> obj pos))
(format #t "~Tcolor[4] @ #x~X~%" (-> obj color))
(format #t "~Ttex-st[4] @ #x~X~%" (-> obj tex-st))
obj
)
;; definition of type char-color
(deftype char-color (structure)
((color rgba 4 :offset-assert 0)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type char-color
(defmethod inspect char-color ((obj char-color))
(format #t "[~8x] ~A~%" obj 'char-color)
(format #t "~Tcolor[4] @ #x~X~%" (-> obj color))
obj
)
;; definition for symbol *font-default-matrix*, type matrix
(define
*font-default-matrix*
(new 'static 'matrix
:data
(new 'static 'array float 16
1.0
0.0
0.0
0.0
0.0
1.0
0.0
0.0
0.0
0.0
1.0
0.0
-256.0
0.0
0.0
1.0
)
)
)
;; definition of type font-context
(deftype font-context (basic)
((origin vector :inline :offset-assert 16)
(strip-gif vector :inline :offset-assert 32)
(width float :offset-assert 48)
(height float :offset-assert 52)
(projection float :offset-assert 56)
(color int64 :offset-assert 64)
(flags uint32 :offset-assert 72)
(mat matrix :offset-assert 76)
(start-line uint32 :offset-assert 80)
(scale float :offset-assert 84)
)
:method-count-assert 20
:size-assert #x58
:flag-assert #x1400000058
(:methods
(new (symbol type matrix int int float int uint) _type_ 0)
(set-mat! (font-context matrix) font-context 9)
(set-origin! (font-context int int) font-context 10)
(set-depth! (font-context int) font-context 11)
(set-w! (font-context float) font-context 12)
(set-width! (font-context int) font-context 13)
(set-height! (font-context int) font-context 14)
(set-projection! (font-context float) font-context 15)
(set-color! (font-context int) font-context 16)
(set-flags! (font-context uint) font-context 17)
(set-start-line! (font-context uint) font-context 18)
(set-scale! (font-context float) font-context 19)
)
)
;; definition for method 3 of type font-context
(defmethod inspect font-context ((obj font-context))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Torigin: #<vector @ #x~X>~%" (-> obj origin))
(format #t "~Tstrip-gif: #<vector @ #x~X>~%" (-> obj strip-gif))
(format #t "~Twidth: ~f~%" (-> obj width))
(format #t "~Theight: ~f~%" (-> obj height))
(format #t "~Tprojection: ~f~%" (-> obj projection))
(format #t "~Tcolor: ~D~%" (-> obj color))
(format #t "~Tflags: ~D~%" (-> obj flags))
(format #t "~Tmat: #<matrix @ #x~X>~%" (-> obj mat))
(format #t "~Tstart-line: ~D~%" (-> obj start-line))
(format #t "~Tscale: ~f~%" (-> obj scale))
obj
)
;; definition for method 9 of type font-context
(defmethod set-mat! font-context ((obj font-context) (mat matrix))
(set! (-> obj mat) mat)
obj
)
;; definition for method 10 of type font-context
(defmethod set-origin! font-context ((obj font-context) (x int) (y int))
(let ((x (gpr->fpr x)))
(set! (-> obj origin x) (the float x))
)
(set! (-> obj origin y) (the float y))
obj
)
;; definition for method 11 of type font-context
(defmethod set-depth! font-context ((obj font-context) (z int))
(let ((z (gpr->fpr z)))
(set! (-> obj origin z) (the float z))
)
obj
)
;; definition for method 12 of type font-context
(defmethod set-w! font-context ((obj font-context) (w float))
(set! (-> obj origin w) w)
obj
)
;; definition for method 13 of type font-context
(defmethod set-width! font-context ((obj font-context) (width int))
(let ((width (gpr->fpr width)))
(set! (-> obj width) (the float width))
)
obj
)
;; definition for method 14 of type font-context
(defmethod set-height! font-context ((obj font-context) (height int))
(let ((height (gpr->fpr height)))
(set! (-> obj height) (the float height))
)
obj
)
;; definition for method 15 of type font-context
(defmethod set-projection! font-context ((obj font-context) (proj float))
(set! (-> obj projection) proj)
obj
)
;; definition for method 16 of type font-context
(defmethod set-color! font-context ((obj font-context) (color int))
(set! (-> obj color) color)
obj
)
;; definition for method 17 of type font-context
(defmethod set-flags! font-context ((obj font-context) (flags uint))
(set! (-> obj flags) flags)
obj
)
;; definition for method 18 of type font-context
(defmethod set-start-line! font-context ((obj font-context) (start-line uint))
(set! (-> obj start-line) start-line)
obj
)
;; definition for method 19 of type font-context
(defmethod set-scale! font-context ((obj font-context) (scale float))
(set! (-> obj scale) scale)
obj
)
;; definition for method 0 of type font-context
(defmethod
new
font-context
((allocation symbol)
(type-to-make type)
(mat matrix)
(x int)
(y int)
(z float)
(color int)
(flags uint)
)
(let
((obj
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
)
)
(set! (-> obj mat) mat)
(let ((v1-3 obj))
(set! (-> v1-3 origin x) (the float x))
(set! (-> v1-3 origin y) (the float y))
)
(if (= z 0.0)
(let ((v1-4 obj))
(set! (-> v1-4 origin z) (-> *math-camera* isometric data 14))
)
(let ((v1-5 obj))
(set! (-> v1-5 origin z) z)
)
)
(let ((v1-6 obj))
(set! (-> v1-6 origin w) 1.0)
)
(let ((v1-7 obj))
(set! (-> v1-7 width) (the float 512))
)
(let ((v1-8 obj))
(set! (-> v1-8 height) (the float 256))
)
(let ((v1-9 obj))
(set! (-> v1-9 projection) 1.0)
)
(set! (-> obj color) color)
(set! (-> obj flags) flags)
(let ((a0-4 obj))
(set! (-> a0-4 start-line) (the-as uint 0))
)
(let ((v1-13 obj))
(set! (-> v1-13 scale) 1.0)
)
obj
)
)
;; definition of type font-work
(deftype font-work (structure)
((font-tmpl dma-gif-packet :inline :offset-assert 0)
(char-tmpl dma-gif-packet :inline :offset-assert 32)
(tex1-tmpl uint64 2 :offset-assert 64)
(small-font-lo-tmpl uint64 2 :offset-assert 80)
(small-font-hi-tmpl uint64 2 :offset-assert 96)
(large-font-lo-tmpl uint64 2 :offset-assert 112)
(large-font-hi-tmpl uint64 2 :offset-assert 128)
(size1-small vector :inline :offset-assert 144)
(size2-small vector :inline :offset-assert 160)
(size3-small vector :inline :offset-assert 176)
(size1-large vector :inline :offset-assert 192)
(size2-large vector :inline :offset-assert 208)
(size3-large vector :inline :offset-assert 224)
(size-st1 vector :inline :offset-assert 240)
(size-st2 vector :inline :offset-assert 256)
(size-st3 vector :inline :offset-assert 272)
(save vector :inline :offset-assert 288)
(save-color vector 4 :inline :offset-assert 304)
(current-verts char-verts :inline :offset-assert 368)
(src-verts char-verts :inline :offset-assert 560)
(dest-verts char-verts :inline :offset-assert 752)
(justify vector 64 :inline :offset-assert 944)
(color-shadow vector4w :inline :offset-assert 1968)
(color-table char-color 64 :inline :offset-assert 1984)
(last-color uint64 :offset-assert 3008)
(save-last-color uint64 :offset-assert 3016)
(buf basic :offset-assert 3024)
(str-ptr uint32 :offset-assert 3028)
(flags uint32 :offset-assert 3032)
(reg-save uint32 5 :offset-assert 3036)
)
:method-count-assert 9
:size-assert #xbf0
:flag-assert #x900000bf0
)
;; definition for method 3 of type font-work
(defmethod inspect font-work ((obj font-work))
(format #t "[~8x] ~A~%" obj 'font-work)
(format #t "~Tfont-tmpl: #<dma-gif-packet @ #x~X>~%" (-> obj font-tmpl))
(format #t "~Tchar-tmpl: #<dma-gif-packet @ #x~X>~%" (-> obj char-tmpl))
(format #t "~Ttex1-tmpl[2] @ #x~X~%" (-> obj tex1-tmpl))
(format #t "~Tsmall-font-lo-tmpl[2] @ #x~X~%" (-> obj small-font-lo-tmpl))
(format #t "~Tsmall-font-hi-tmpl[2] @ #x~X~%" (-> obj small-font-hi-tmpl))
(format #t "~Tlarge-font-lo-tmpl[2] @ #x~X~%" (-> obj large-font-lo-tmpl))
(format #t "~Tlarge-font-hi-tmpl[2] @ #x~X~%" (-> obj large-font-hi-tmpl))
(format #t "~Tsize1-small: #<vector @ #x~X>~%" (-> obj size1-small))
(format #t "~Tsize2-small: #<vector @ #x~X>~%" (-> obj size2-small))
(format #t "~Tsize3-small: #<vector @ #x~X>~%" (-> obj size3-small))
(format #t "~Tsize1-large: #<vector @ #x~X>~%" (-> obj size1-large))
(format #t "~Tsize2-large: #<vector @ #x~X>~%" (-> obj size2-large))
(format #t "~Tsize3-large: #<vector @ #x~X>~%" (-> obj size3-large))
(format #t "~Tsize-st1: #<vector @ #x~X>~%" (-> obj size-st1))
(format #t "~Tsize-st2: #<vector @ #x~X>~%" (-> obj size-st2))
(format #t "~Tsize-st3: #<vector @ #x~X>~%" (-> obj size-st3))
(format #t "~Tsave: #<vector @ #x~X>~%" (-> obj save))
(format #t "~Tsave-color[4] @ #x~X~%" (-> obj save-color))
(format #t "~Tcurrent-verts: #<char-verts @ #x~X>~%" (-> obj current-verts))
(format #t "~Tsrc-verts: #<char-verts @ #x~X>~%" (-> obj src-verts))
(format #t "~Tdest-verts: #<char-verts @ #x~X>~%" (-> obj dest-verts))
(format #t "~Tjustify[64] @ #x~X~%" (-> obj justify))
(format #t "~Tcolor-shadow: #<vector4w @ #x~X>~%" (-> obj color-shadow))
(format #t "~Tcolor-table[64] @ #x~X~%" (-> obj color-table))
(format #t "~Tlast-color: ~D~%" (-> obj last-color))
(format #t "~Tsave-last-color: ~D~%" (-> obj save-last-color))
(format #t "~Tbuf: ~A~%" (-> obj buf))
(format #t "~Tstr-ptr: ~D~%" (-> obj str-ptr))
(format #t "~Tflags: ~D~%" (-> obj flags))
(format #t "~Treg-save[5] @ #x~X~%" (-> obj reg-save))
obj
)
;; definition for symbol *font-work*, type font-work
(define
*font-work*
(new 'static 'font-work
:font-tmpl
(new 'static 'dma-gif-packet
:dma-vif
(new 'static 'dma-packet
:dma
(new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))
:vif1
(new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)
)
:gif
(new 'static 'array uint64 2 #x102e400000008001 #xe)
)
:char-tmpl
(new 'static 'dma-gif-packet
:dma-vif
(new 'static 'dma-packet
:dma
(new 'static 'dma-tag :qwc #xe :id (dma-tag-id cnt))
:vif1
(new 'static 'vif-tag :imm #xe :cmd (vif-cmd direct) :msk #x1)
)
:gif
(new 'static 'array uint64 2 #xd02e400000008001 #x412412412412e)
)
:tex1-tmpl (new 'static 'array uint64 2 #x60 #x14)
:small-font-lo-tmpl (new 'static 'array uint64 2 #x0 #x6)
:small-font-hi-tmpl (new 'static 'array uint64 2 #x0 #x6)
:large-font-lo-tmpl (new 'static 'array uint64 2 #x0 #x6)
:large-font-hi-tmpl (new 'static 'array uint64 2 #x0 #x6)
:size1-small (new 'static 'vector :x 12.0 :w 0.5)
:size2-small (new 'static 'vector :y 8.0 :w 8.0)
:size3-small
(new 'static 'vector :x 12.0 :y 8.0 :w 8.0)
:size1-large (new 'static 'vector :x 24.0 :w 1.0)
:size2-large (new 'static 'vector :y 16.0 :w 16.0)
:size3-large
(new 'static 'vector :x 24.0 :y 16.0 :w 16.0)
:size-st1 (new 'static 'vector :x 0.08985 :w 0.5)
:size-st2
(new 'static 'vector :y 0.06153846 :w 0.5)
:size-st3
(new 'static 'vector :x 0.08985 :y 0.06153846 :w 0.5)
:current-verts
(new 'static 'char-verts
:pos
(new 'static 'inline-array vector 4
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
)
:tex-st
(new 'static 'inline-array vector 4
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
)
)
:src-verts
(new 'static 'char-verts
:pos
(new 'static 'inline-array vector 4
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
)
:tex-st
(new 'static 'inline-array vector 4
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
)
)
:dest-verts
(new 'static 'char-verts
:pos
(new 'static 'inline-array vector 4
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
)
:tex-st
(new 'static 'inline-array vector 4
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
)
)
:color-shadow (new 'static 'vector4w :w #x80)
:color-table
(new 'static 'inline-array char-color 64
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
(new 'static 'rgba :r #x30 :g #x38 :b #x30 :a #x80)
(new 'static 'rgba :r #x30 :g #x38 :b #x30 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80)
(new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40)
(new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x40)
(new 'static 'rgba :r #x60 :g #x60 :b #x60 :a #x40)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)
(new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)
(new 'static 'rgba :r #x60 :a #x80)
(new 'static 'rgba :r #x60 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x64 :a #x80)
(new 'static 'rgba :r #x80 :g #x64 :a #x80)
(new 'static 'rgba :r #x80 :a #x80)
(new 'static 'rgba :r #x80 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :a #x80)
(new 'static 'rgba :r #x28 :g #x28 :a #x80)
(new 'static 'rgba :r #x28 :g #x28 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x20 :g #x80 :b #x20 :a #x80)
(new 'static 'rgba :r #x20 :g #x80 :b #x20 :a #x80)
(new 'static 'rgba :g #x30 :a #x80)
(new 'static 'rgba :g #x30 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x40 :g #x40 :b #x80 :a #x80)
(new 'static 'rgba :r #x40 :g #x40 :b #x80 :a #x80)
(new 'static 'rgba :b #x60 :a #x80)
(new 'static 'rgba :b #x60 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :g #x20 :b #x50 :a #x80)
(new 'static 'rgba :g #x20 :b #x50 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80)
(new 'static 'rgba :r #x30 :b #x30 :a #x80)
(new 'static 'rgba :r #x30 :b #x30 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x60 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x60 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :g #x40 :b #x60 :a #x80)
(new 'static 'rgba :g #x40 :b #x60 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80)
(new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80)
(new 'static 'rgba :g #x20 :b #x40 :a #x80)
(new 'static 'rgba :g #x20 :b #x40 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80)
(new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80)
(new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80)
(new 'static 'rgba :r #x28 :g #x28 :b #x28 :a #x80)
(new 'static 'rgba :r #x28 :g #x28 :b #x28 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x54 :a #x80)
(new 'static 'rgba :r #x80 :g #x54 :a #x80)
(new 'static 'rgba :r #x60 :a #x80)
(new 'static 'rgba :r #x60 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x80)
(new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x80)
(new 'static 'rgba :g #x60 :a #x80)
(new 'static 'rgba :g #x60 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x48 :g #x58 :b #x8 :a #x80)
(new 'static 'rgba :r #x48 :g #x58 :b #x10 :a #x80)
(new 'static 'rgba :g #x38 :a #x80)
(new 'static 'rgba :g #x38 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x58 :g #x60 :b #x58 :a #x80)
(new 'static 'rgba :r #x58 :g #x60 :b #x58 :a #x80)
(new 'static 'rgba :r #x30 :g #x40 :b #x30 :a #x80)
(new 'static 'rgba :r #x30 :g #x40 :b #x30 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x40 :g #x48 :b #x40 :a #x80)
(new 'static 'rgba :r #x40 :g #x48 :b #x40 :a #x80)
(new 'static 'rgba :r #x18 :g #x28 :b #x18 :a #x80)
(new 'static 'rgba :r #x18 :g #x28 :b #x18 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80)
(new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80)
(new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80)
(new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80)
(new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80)
(new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80)
(new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x20 :g #x5e :b #x78 :a #x80)
(new 'static 'rgba :r #x20 :g #x5e :b #x78 :a #x80)
(new 'static 'rgba :r #x80 :g #x7d :b #x4f :a #x80)
(new 'static 'rgba :r #x80 :g #x7d :b #x4f :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80)
(new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80)
(new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80)
(new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80)
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80)
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80)
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80)
(new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80)
(new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80)
(new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80)
(new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80)
(new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80)
(new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80)
(new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80)
(new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80)
(new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80)
(new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80)
(new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80)
(new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x57 :g #x7e :b #x80 :a #x80)
(new 'static 'rgba :r #x57 :g #x7e :b #x80 :a #x80)
(new 'static 'rgba :r #x29 :g #x63 :b #x79 :a #x80)
(new 'static 'rgba :r #x29 :g #x63 :b #x70 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x7f :g #x7b :b #x33 :a #x80)
(new 'static 'rgba :r #x7f :g #x7b :b #x33 :a #x80)
(new 'static 'rgba :r #x76 :g #x40 :b #x14 :a #x80)
(new 'static 'rgba :r #x76 :g #x40 :b #x14 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x79 :g #x79 :b #x2 :a #x80)
(new 'static 'rgba :r #x79 :g #x79 :b #x2 :a #x80)
(new 'static 'rgba :r #x1b :g #x51 :b #x20 :a #x80)
(new 'static 'rgba :r #x1b :g #x51 :b #x20 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x47 :g #x68 :b #x7a :a #x80)
(new 'static 'rgba :r #x47 :g #x68 :b #x7a :a #x80)
(new 'static 'rgba :g #x3c :b #x4f :a #x80)
(new 'static 'rgba :g #x3c :b #x4f :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
(new 'static 'rgba :r #x30 :g #x38 :b #x30 :a #x80)
(new 'static 'rgba :r #x30 :g #x38 :b #x30 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x60 :a #x80)
(new 'static 'rgba :r #x60 :a #x80)
(new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)
(new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)
)
)
(new 'static 'char-color
:color
(new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)
(new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)
(new 'static 'rgba :r #x60 :a #x80)
(new 'static 'rgba :r #x60 :a #x80)
)
)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
(new 'static 'char-color)
)
)
)
;; definition for function font-set-tex0
;; INFO: Return type mismatch int vs none.
(defun
font-set-tex0
((ptr-tex0 (pointer gs-tex0))
(tex texture)
(tex-addr uint)
(psm uint)
(clut-addr uint)
)
(set!
(-> ptr-tex0 0)
(new 'static 'gs-tex0
:tcc #x1
:cld #x1
:cbp clut-addr
:th (log2 (-> tex h))
:tw (log2 (-> tex w))
:tbw (-> tex width 0)
:tbp0 (sar tex-addr 6)
:psm psm
)
)
(none)
)
;; failed to figure out what this is:
(let ((v0-4 0))
)
+8 -1
View File
@@ -62,7 +62,14 @@
(arg4 object)
(arg5 object)
)
(local-vars (pp process) (s7-0 none) (sp-0 none) (sp-1 int) (ra-0 int))
(local-vars
(pp process)
(s7-0 none)
(sp-0 none)
(sp-1 int)
(ra-0 int)
(sv-0 none)
)
(set!
(-> pp mask)
(logand (lognot (process-mask sleep sleep-code)) (-> pp mask))
+8 -8
View File
@@ -149,15 +149,15 @@
(bsp basic :offset-assert 48)
(art-group basic :offset-assert 52)
(info basic :offset-assert 56)
(texture-page basic 9 :offset-assert 60)
(texture-page texture-page 9 :offset-assert 60)
(loaded-texture-page basic 16 :offset-assert 96)
(loaded-texture-page-count int32 :offset-assert 160)
(foreground-sink-group dma-foreground-sink-group 3 :inline :offset-assert 176)
(foreground-draw-engine basic 3 :offset-assert 272)
(entity basic :offset-assert 284)
(ambient basic :offset-assert 288)
(closest-object basic 9 :offset-assert 292)
(upload-size uint32 9 :offset-assert 328)
(closest-object float 9 :offset-assert 292)
(upload-size int32 9 :offset-assert 328)
(level-distance float :offset-assert 364)
(inside-sphere? basic :offset-assert 368)
(inside-boxes? basic :offset-assert 372)
@@ -187,7 +187,7 @@
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-11 (_type_) none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
@@ -269,8 +269,8 @@
;; definition of type level-group
(deftype level-group (basic)
((length int32 :offset-assert 4)
(unknown-field-1 basic :offset-assert 8)
(unknown-field-2 basic :offset-assert 12)
(unknown-level-1 level :offset-assert 8)
(unknown-level-2 level :offset-assert 12)
(entity-link entity-links :offset 16)
(border? basic :offset-assert 20)
(vis? basic :offset-assert 24)
@@ -335,8 +335,8 @@
*level*
(new 'static 'level-group
:length 2
:unknown-field-1 #f
:unknown-field-2 #f
:unknown-level-1 #f
:unknown-level-2 #f
:entity-link #f
:border? #f
:want-level #f
@@ -0,0 +1,69 @@
;;-*-Lisp-*-
(in-package goal)
;; this file is debug only
(when *debug-segment*
;; definition of type memory-usage-info
(deftype memory-usage-info (structure)
((name basic :offset-assert 0)
(count int32 :offset-assert 4)
(used int32 :offset-assert 8)
(total int32 :offset-assert 12)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type memory-usage-info
(defmethod inspect memory-usage-info ((obj memory-usage-info))
(format #t "[~8x] ~A~%" obj 'memory-usage-info)
(format #t "~Tname: ~A~%" (-> obj name))
(format #t "~Tcount: ~D~%" (-> obj count))
(format #t "~Tused: ~D~%" (-> obj used))
(format #t "~Ttotal: ~D~%" (-> obj total))
obj
)
;; definition of type memory-usage-block
(deftype memory-usage-block (basic)
((work-bsp basic :offset-assert 4)
(length int32 :offset-assert 8)
(data memory-usage-info 109 :inline :offset-assert 16)
)
:method-count-assert 12
:size-assert #x6e0
:flag-assert #xc000006e0
(:methods
(reset! (_type_) _type_ 9)
(calculate-total (_type_) int 10)
(dummy-11 () none 11)
)
)
;; definition for method 3 of type memory-usage-block
(defmethod inspect memory-usage-block ((obj memory-usage-block))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Twork-bsp: ~A~%" (-> obj work-bsp))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tdata[109] @ #x~X~%" (-> obj data))
obj
)
;; definition for symbol *mem-usage*, type memory-usage-block
(define *mem-usage* (the-as memory-usage-block (new 'debug 'memory-usage-block)))
;; definition for symbol *dma-mem-usage*, type memory-usage-block
(define
*dma-mem-usage*
(the-as memory-usage-block (new 'debug 'memory-usage-block))
)
;; definition for symbol *temp-mem-usage*, type symbol
(define *temp-mem-usage* #f)
;; failed to figure out what this is:
(empty-form)
)
+226
View File
@@ -0,0 +1,226 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type setting-data
(deftype setting-data (structure)
((border-mode basic :offset-assert 0)
(sfx-volume float :offset-assert 4)
(music-volume float :offset-assert 8)
(dialog-volume float :offset-assert 12)
(process-mask uint32 :offset-assert 16)
(common-page int32 :offset-assert 20)
(language int64 :offset-assert 24)
(screenx int32 :offset-assert 32)
(screeny int32 :offset-assert 36)
(vibration basic :offset-assert 40)
(play-hints basic :offset-assert 44)
(movie (pointer process) :offset-assert 48)
(talking (pointer process) :offset-assert 52)
(spooling (pointer process) :offset-assert 56)
(hint (pointer process) :offset-assert 60)
(ambient (pointer process) :offset-assert 64)
(video-mode basic :offset-assert 68)
(aspect-ratio basic :offset-assert 72)
(sound-flava uint8 :offset-assert 76)
(auto-save basic :offset-assert 80)
(music-volume-movie float :offset-assert 84)
(sfx-volume-movie float :offset-assert 88)
(music basic :offset-assert 92)
(bg-r float :offset-assert 96)
(bg-g float :offset-assert 100)
(bg-b float :offset-assert 104)
(bg-a float :offset-assert 108)
(bg-a-speed float :offset-assert 112)
(bg-a-force float :offset-assert 116)
(allow-progress basic :offset-assert 120)
(allow-pause basic :offset-assert 124)
(sound-flava-priority float :offset-assert 128)
(ocean-off basic :offset-assert 132)
(allow-look-around basic :offset-assert 136)
(ambient-volume float :offset-assert 140)
(ambient-volume-movie float :offset-assert 144)
(dialog-volume-hint float :offset-assert 148)
(dummy uint32 11 :offset-assert 152)
)
:method-count-assert 10
:size-assert #xc4
:flag-assert #xa000000c4
(:methods
(dummy-9 () none 9)
)
)
;; definition for method 3 of type setting-data
(defmethod inspect setting-data ((obj setting-data))
(format #t "[~8x] ~A~%" obj 'setting-data)
(format #t "~Tborder-mode: ~A~%" (-> obj border-mode))
(format #t "~Tsfx-volume: ~f~%" (-> obj sfx-volume))
(format #t "~Tmusic-volume: ~f~%" (-> obj music-volume))
(format #t "~Tdialog-volume: ~f~%" (-> obj dialog-volume))
(format #t "~Tprocess-mask: ~D~%" (-> obj process-mask))
(format #t "~Tcommon-page: ~D~%" (-> obj common-page))
(format #t "~Tlanguage: ~D~%" (-> obj language))
(format #t "~Tscreenx: ~D~%" (-> obj screenx))
(format #t "~Tscreeny: ~D~%" (-> obj screeny))
(format #t "~Tvibration: ~A~%" (-> obj vibration))
(format #t "~Tplay-hints: ~A~%" (-> obj play-hints))
(let ((t9-12 format)
(a0-13 #t)
(a1-12 "~Tmovie: ~A~%")
(v1-0 (-> obj movie))
)
(t9-12 a0-13 a1-12 (if v1-0
(-> v1-0 0 self)
)
)
)
(let ((t9-13 format)
(a0-14 #t)
(a1-13 "~Ttalking: ~A~%")
(v1-2 (-> obj talking))
)
(t9-13 a0-14 a1-13 (if v1-2
(-> v1-2 0 self)
)
)
)
(let ((t9-14 format)
(a0-15 #t)
(a1-14 "~Tspooling: ~A~%")
(v1-4 (-> obj spooling))
)
(t9-14 a0-15 a1-14 (if v1-4
(-> v1-4 0 self)
)
)
)
(let ((t9-15 format)
(a0-16 #t)
(a1-15 "~Thint: ~A~%")
(v1-6 (-> obj hint))
)
(t9-15 a0-16 a1-15 (if v1-6
(-> v1-6 0 self)
)
)
)
(let ((t9-16 format)
(a0-17 #t)
(a1-16 "~Tambient: ~A~%")
(v1-8 (-> obj ambient))
)
(t9-16 a0-17 a1-16 (if v1-8
(-> v1-8 0 self)
)
)
)
(format #t "~Tvideo-mode: ~A~%" (-> obj video-mode))
(format #t "~Taspect-ratio: ~A~%" (-> obj aspect-ratio))
(format #t "~Tsound-flava: ~D~%" (-> obj sound-flava))
(format #t "~Tauto-save: ~A~%" (-> obj auto-save))
(format #t "~Tmusic-volume-movie: ~f~%" (-> obj music-volume-movie))
(format #t "~Tsfx-volume-movie: ~f~%" (-> obj sfx-volume-movie))
(format #t "~Tmusic: ~A~%" (-> obj music))
(format #t "~Tbg-r: ~f~%" (-> obj bg-r))
(format #t "~Tbg-g: ~f~%" (-> obj bg-g))
(format #t "~Tbg-b: ~f~%" (-> obj bg-b))
(format #t "~Tbg-a: ~f~%" (-> obj bg-a))
(format #t "~Tbg-a-speed: ~f~%" (-> obj bg-a-speed))
(format #t "~Tbg-a-force: ~f~%" (-> obj bg-a-force))
(format #t "~Tallow-progress: ~A~%" (-> obj allow-progress))
(format #t "~Tallow-pause: ~A~%" (-> obj allow-pause))
(format #t "~Tsound-flava-priority: ~f~%" (-> obj sound-flava-priority))
(format #t "~Tocean-off: ~A~%" (-> obj ocean-off))
(format #t "~Tallow-look-around: ~A~%" (-> obj allow-look-around))
(format #t "~Tambient-volume: ~f~%" (-> obj ambient-volume))
(format #t "~Tambient-volume-movie: ~f~%" (-> obj ambient-volume-movie))
(format #t "~Tdialog-volume-hint: ~f~%" (-> obj dialog-volume-hint))
(format #t "~Tdummy[11] @ #x~X~%" (-> obj dummy))
obj
)
;; definition of type setting-control
(deftype setting-control (basic)
((current setting-data :inline :offset-assert 16)
(target setting-data :inline :offset-assert 224)
(default setting-data :inline :offset-assert 432)
(engine engine :offset-assert 628)
)
:method-count-assert 14
:size-assert #x278
:flag-assert #xe00000278
(:methods
(new (symbol type int) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
)
)
;; definition for method 3 of type setting-control
(defmethod inspect setting-control ((obj setting-control))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tcurrent: #<setting-data @ #x~X>~%" (-> obj current))
(format #t "~Ttarget: #<setting-data @ #x~X>~%" (-> obj target))
(format #t "~Tdefault: #<setting-data @ #x~X>~%" (-> obj default))
(format #t "~Tengine: ~A~%" (-> obj engine))
obj
)
;; definition for method 0 of type setting-control
(defmethod
new
setting-control
((allocation symbol) (type-to-make type) (arg0 int))
(let
((s4-0
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
)
)
(set!
(-> s4-0 engine)
((method-of-type engine new) allocation engine 'setting-control arg0)
)
s4-0
)
)
;; definition of type scf-time
(deftype scf-time (structure)
((stat uint8 :offset-assert 0)
(second uint8 :offset-assert 1)
(minute uint8 :offset-assert 2)
(hour uint8 :offset-assert 3)
(week uint8 :offset-assert 4)
(day uint8 :offset-assert 5)
(month uint8 :offset-assert 6)
(year uint8 :offset-assert 7)
)
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type scf-time
(defmethod inspect scf-time ((obj scf-time))
(format #t "[~8x] ~A~%" obj 'scf-time)
(format #t "~Tstat: ~D~%" (-> obj stat))
(format #t "~Tsecond: #x~X~%" (-> obj second))
(format #t "~Tminute: #x~X~%" (-> obj minute))
(format #t "~Thour: #x~X~%" (-> obj hour))
(format #t "~Tweek: #x~X~%" (-> obj week))
(format #t "~Tday: #x~X~%" (-> obj day))
(format #t "~Tmonth: #x~X~%" (-> obj month))
(format #t "~Tyear: #x~X~%" (-> obj year))
obj
)
;; failed to figure out what this is:
(let ((v0-3 0))
)
+63
View File
@@ -0,0 +1,63 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type game-text
(deftype game-text (structure)
((id uint32 :offset-assert 0)
(text string :offset-assert 4)
)
:pack-me
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type game-text
(defmethod inspect game-text ((obj game-text))
(format #t "[~8x] ~A~%" obj 'game-text)
(format #t "~Tid: ~D~%" (-> obj id))
(format #t "~Ttext: ~A~%" (-> obj text))
obj
)
;; definition of type game-text-info
(deftype game-text-info (basic)
((length int32 :offset-assert 4)
(language-id int32 :offset-assert 8)
(group-name string :offset-assert 12)
(data game-text :inline :dynamic :offset-assert 16)
)
:method-count-assert 10
:size-assert #x10
:flag-assert #xa00000010
(:methods
(dummy-9 () none 9)
)
)
;; definition for method 3 of type game-text-info
(defmethod inspect game-text-info ((obj game-text-info))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tlanguage-id: ~D~%" (-> obj language-id))
(format #t "~Tgroup-name: ~A~%" (-> obj group-name))
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
obj
)
;; definition for symbol *text-group-names*, type (array string)
(define
*text-group-names*
(the-as (array string) (new 'static 'boxed-array string 1 "common"))
)
;; definition for symbol *common-text-heap*, type kheap
(define *common-text-heap* (the-as kheap (new 'global 'kheap)))
;; definition for symbol *common-text*, type symbol
(define *common-text* #f)
;; failed to figure out what this is:
(let ((v0-3 0))
)
+54 -53
View File
@@ -46,35 +46,36 @@
;; definition of type texture-pool
(deftype texture-pool (basic)
((top int32 :offset-assert 4)
(cur int32 :offset-assert 8)
(allocate-func basic :offset-assert 12)
(font-palette int32 :offset-assert 16)
(segment texture-pool-segment 4 :inline :offset-assert 20)
(segment-near texture-pool-segment :inline :offset 20)
(segment-common texture-pool-segment :inline :offset 28)
(common-page int32 32 :offset-assert 52)
(common-page-mask int32 :offset-assert 180)
(ids int32 126 :offset-assert 184)
((top int32 :offset-assert 4)
(cur int32 :offset-assert 8)
(allocate-func (function texture-pool texture-page kheap int texture-page) :offset-assert 12)
(font-palette int32 :offset-assert 16)
(segment-near texture-pool-segment :inline :offset-assert 20)
(segment-common texture-pool-segment :inline :offset-assert 28)
(segment texture-pool-segment 4 :inline :offset 20)
(common-page texture-page 32 :offset-assert 52)
(common-page-mask int32 :offset-assert 180)
(ids uint32 126 :offset-assert 184)
)
:method-count-assert 23
:size-assert #x2b0
:flag-assert #x17000002b0
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(new (symbol type) _type_ 0)
(initialize! (_type_) _type_ 9)
(print-usage (_type_) _type_ 10)
(dummy-11 (_type_) none 11)
(allocate-defaults! (_type_) none 12)
(login-level-textures (_type_ level int (pointer texture-id)) none 13)
(add-tex-to-dma! (_type_ level int) none 14)
(allocate-vram-words! (_type_ int) int 15)
(allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(upload-one-common! (_type_) symbol 21)
(lookup-boot-common-id (_type_ int) int 22)
)
)
@@ -85,16 +86,16 @@
(format #t "~Tcur: #x~X~%" (-> obj cur))
(format #t "~Tallocate-func: ~A~%" (-> obj allocate-func))
(format #t "~Tfont-palette: ~D~%" (-> obj font-palette))
(format #t "~Tsegment[4] @ #x~X~%" (-> obj segment))
(format #t "~Tsegment[4] @ #x~X~%" (-> obj segment-near))
(format
#t
"~Tsegment-near: #<texture-pool-segment @ #x~X>~%"
(-> obj segment)
(-> obj segment-near)
)
(format
#t
"~Tsegment-common: #<texture-pool-segment @ #x~X>~%"
(-> obj segment 1)
(-> obj segment-common)
)
(format #t "~Tcommon-page[32] @ #x~X~%" (-> obj common-page))
(format #t "~Tcommon-page-mask: ~D~%" (-> obj common-page-mask))
@@ -108,7 +109,7 @@
(h int16 :offset-assert 6)
(num-mips uint8 :offset-assert 8)
(tex1-control uint8 :offset-assert 9)
(psm uint8 :offset-assert 10)
(psm gs-psm :offset-assert 10)
(mip-shift uint8 :offset-assert 11)
(clutpsm uint16 :offset-assert 12)
(dest uint16 7 :offset-assert 14)
@@ -183,18 +184,18 @@
(size uint32 :offset-assert 24)
(segment texture-page-segment 3 :inline :offset-assert 28)
(pad uint32 16 :offset-assert 64)
(data uint8 :dynamic :offset-assert 128)
(data texture :dynamic :offset-assert 128)
)
:method-count-assert 15
:size-assert #x80
:flag-assert #xf00000080
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(remove-from-heap (_type_ kheap) _type_ 9)
(get-leftover-block-count (_type_ int int) int 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(relocate-dests! (_type_ int int) none 12)
(add-to-dma-buffer (_type_ dma-buffer int) none 13)
(upload-now! (_type_ int) none 14)
)
)
@@ -215,7 +216,8 @@
;; definition of type shader-ptr
(deftype shader-ptr (uint32)
()
((shader uint32 :offset 8 :size 24)
)
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
@@ -223,7 +225,7 @@
;; definition of type texture-link
(deftype texture-link (structure)
((next uint32 :offset-assert 0)
((next shader-ptr 1 :offset-assert 0)
)
:method-count-assert 9
:size-assert #x4
@@ -233,17 +235,18 @@
;; definition for method 3 of type texture-link
(defmethod inspect texture-link ((obj texture-link))
(format #t "[~8x] ~A~%" obj 'texture-link)
(format #t "~Tnext: #x~X~%" (-> obj next))
(format #t "~Tnext: #x~X~%" (-> obj next 0))
obj
)
;; definition of type texture-page-dir-entry
(deftype texture-page-dir-entry (structure)
((length int16 :offset-assert 0)
(status uint16 :offset-assert 2)
(page basic :offset-assert 4)
(link uint32 :offset-assert 8)
((length int16 :offset-assert 0)
(status uint16 :offset-assert 2)
(page texture-page :offset-assert 4)
(link texture-link :offset-assert 8)
)
:pack-me
:method-count-assert 9
:size-assert #xc
:flag-assert #x90000000c
@@ -261,7 +264,8 @@
;; definition of type texture-page-dir
(deftype texture-page-dir (basic)
((pad uint8 16 :offset-assert 4)
((length int32 :offset-assert 4)
(entries texture-page-dir-entry 1 :inline :offset-assert 8)
)
:method-count-assert 10
:size-assert #x14
@@ -278,7 +282,7 @@
(source uint32 :offset-assert 12)
(move uint32 :offset-assert 16)
(entry texture-page-dir-entry :offset-assert 20)
(page basic :offset-assert 24)
(page texture-page :offset-assert 24)
)
:method-count-assert 9
:size-assert #x1c
@@ -311,17 +315,17 @@
;; definition of type adgif-shader
(deftype adgif-shader (structure)
((quad uint128 5 :offset 0)
(prims uint64 10 :offset 0)
(tex0 uint64 :offset 0)
(tex1 uint64 :offset 16)
(miptbp1 uint64 :offset 32)
(clamp uint64 :offset 48)
(clamp-reg uint64 :offset 56)
(alpha uint64 :offset 64)
(link-test uint32 :offset 8)
(texture-id uint32 :offset 24)
(next uint32 :offset 40)
((quad uint128 5 :offset 0)
(prims uint64 10 :offset 0)
(tex0 uint64 :offset 0)
(tex1 uint64 :offset 16)
(miptbp1 uint64 :offset 32)
(clamp uint64 :offset 48)
(clamp-reg uint64 :offset 56)
(alpha uint64 :offset 64)
(link-test uint32 :offset 8)
(texture-id uint32 :offset 24)
(next shader-ptr :offset 40)
)
:method-count-assert 9
:size-assert #x50
@@ -405,6 +409,3 @@
(let ((v0-14 0))
)
+11 -4
View File
@@ -18,7 +18,8 @@ const std::unordered_set<std::string> g_object_files_to_decompile = {
"euler", /* geometry, trigonometry, */
"gsound-h", "timer-h", "timer", "vif-h", "dma-h", "video-h", "vu1-user-h", "dma", "dma-buffer",
"dma-bucket", "dma-disasm", "pad", "gs", "display-h", "vector", "file-io", "loader-h",
"texture-h", "level-h", "math-camera-h", /* math-camera, "font-h",*/ "decomp-h", "display",
"texture-h", "level-h", "math-camera-h", /* math-camera, */ "font-h", "decomp-h", "display",
"connect", "text-h", "settings-h", "capture", "memory-usage-h",
/* gap */
"mspace-h", "drawable-h", "drawable-group-h",
/* gap */
@@ -40,8 +41,8 @@ const std::vector<std::string> g_object_files_to_check_against_reference = {
"matrix", "transform", "quaternion", "euler", /* geometry, trigonometry */
"gsound-h", "timer-h", /* timer, */ "vif-h", "dma-h", "video-h", "vu1-user-h", "dma",
"dma-buffer", "dma-bucket", "dma-disasm", "pad", "gs", "display-h", "vector", "file-io",
"loader-h", "texture-h", "level-h", "math-camera-h", /* math-camera, "font-h",*/ "decomp-h",
"display",
"loader-h", "texture-h", "level-h", "math-camera-h", /* math-camera, */ "font-h", "decomp-h",
"display", "connect", "text-h", "settings-h", "capture", "memory-usage-h",
/* gap */
"mspace-h", "drawable-h", "drawable-group-h",
/* gap */
@@ -91,7 +92,7 @@ const std::unordered_set<std::string> expected_skip_in_decompiler = {
// dma
"symlink2", "symlink3", "dma-sync-hang", // handwritten asm
"vector=", // asm branching
// displyy
// display
"vblank-handler", // asm
"vif1-handler", "vif1-handler-debug",
@@ -154,6 +155,12 @@ const std::unordered_set<std::string> skip_in_compiling = {
// bad decisions on float vs int128
"vector-degf", "vector-degmod", "vector-deg-diff", "vector-degi",
// connect
"(method 9 engine)", // methods-by-name stuff.
// capture
"(method 3 gs-store-image-packet)", // print giftag weirdness
// sync-info
"(method 15 sync-info)", // needs display stuff first
"(method 15 sync-info-eased)", // needs display stuff first