Skip to content

Instantly share code, notes, and snippets.

void generate_display_list(uint16_t *codeout, void *segaddr, Gfx *cmd) {
int i=0;
void *functableaddr = (void*)&dl_funcs[0];
cmd = seg_addr((uintptr_t) cmd);
uint32_t opcode = cmd->words.w0 >> 24;
int last_opcode = 0xff;
EMIT_PROLOGUE(codeout++);
EMIT_LOAD32(codeout++, (uintptr_t)functableaddr, R8);
while (opcode != (uint8_t) G_ENDDL) {
mov.l r8,@-r15
mov.l r9,@-r15
mov.l r10,@-r15
sts pr,r10
mov #-116,r0
shll8 r0
or #24,r0
shll8 r0
or #198,r0
shll8 r0
@jnmartin84
jnmartin84 / gist:4d08eba0eb3f6c1df25c5308b58cb4c9
Last active October 27, 2025 02:39
Fast3D recompiler for SH4 - aLandmasterModelDL
mov.l r8,@-r15
mov.l r9,@-r15
mov.l r10,@-r15
sts pr,r10
mov #-116,r0
shll8 r0
or #24,r0
shll8 r0
or #197,r0
shll8 r0