mirror of
https://github.com/Ed94/pikuma_ps1.git
synced 2026-07-12 20:31:25 -07:00
adjustments, studying
This commit is contained in:
@@ -1,50 +1,12 @@
|
||||
// Auto-generated by gen_atom_offsets.lua — DO NOT EDIT
|
||||
// Source: C:\projects\Pikuma\ps1\code\duffle\lottes_tape.h
|
||||
#ifndef LOTTES_TAPE_OFFSETS_H
|
||||
#define LOTTES_TAPE_OFFSETS_H
|
||||
#pragma once
|
||||
|
||||
#pragma region lottes_tape
|
||||
|
||||
// Override the placeholder atom_offset() to dispatch via token pasting.
|
||||
// Dispatch macro: token-pastes <tag>_<target> to the enum name
|
||||
#undef atom_offset
|
||||
#define atom_offset(name) atom_offset_##name
|
||||
|
||||
// --- atom: sym (8 words) ---
|
||||
|
||||
|
||||
// --- atom: tape_exit (2 words) ---
|
||||
|
||||
|
||||
// --- atom: yield (4 words) ---
|
||||
|
||||
|
||||
// --- atom: mips_flush_icache (13 words) ---
|
||||
|
||||
|
||||
// --- atom: sync_prim_cursor (6 words) ---
|
||||
|
||||
|
||||
// --- atom: set_gte_world (22 words) ---
|
||||
|
||||
|
||||
// --- atom: rbind_cube_tri (6 words) ---
|
||||
|
||||
|
||||
// --- atom: cube_tri (74 words) ---
|
||||
|
||||
|
||||
// --- atom: rbind_floor_tri (6 words) ---
|
||||
|
||||
|
||||
// --- atom: diag_yield (4 words) ---
|
||||
|
||||
|
||||
// --- atom: diag_color (28 words) ---
|
||||
|
||||
|
||||
// --- atom: diag_gte (34 words) ---
|
||||
|
||||
#define atom_offset(tag, name) atom_offset_##tag##_##name
|
||||
|
||||
#pragma endregion lottes_tape
|
||||
|
||||
#endif // LOTTES_TAPE_OFFSETS_H
|
||||
|
||||
@@ -62,7 +62,8 @@ FI_ void tape_run(Slice_U4 tape) { register U4* tp rgcc(R_TapePtr) = tape.ptr; a
|
||||
|
||||
typedef Relative_(FArena) Struct_(TapeBuilder) { U4 ptr; U4 capacity; U4 used; };
|
||||
FI_ void tb_init(TapeBuilder* tb, FArena* arena) { tb->ptr = arena->start; tb->used = 0; }
|
||||
FI_ TapeBuilder tb_make( FArena* arena) { return (TapeBuilder){ arena->start, 0 }; }
|
||||
FI_ TapeBuilder tb_make_old( FArena* arena) { return (TapeBuilder){ arena->start, 0 }; }
|
||||
FI_ TapeBuilder tb_make(Slice mem) { return (TapeBuilder){ mem.ptr, mem.len, 0 }; }
|
||||
|
||||
#define tb_emit_(tb, atom) tb_emit(tb, tmpl(code,atom))
|
||||
FI_ void tb_emit(TapeBuilder* tb, MipsCode* atom) { u4_r(tb->ptr)[tb->used] = u4_(atom); ++ tb->used; }
|
||||
|
||||
Reference in New Issue
Block a user