From 7e9b5e6e880753b634201d51c25d0c86615593e9 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Tue, 27 Sep 2016 12:38:15 -0700 Subject: [PATCH] simplify simple spawn with call instruction --- Lua/inject/simple spawn.asm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Lua/inject/simple spawn.asm b/Lua/inject/simple spawn.asm index 299bbf3..11e44d1 100644 --- a/Lua/inject/simple spawn.asm +++ b/Lua/inject/simple spawn.asm @@ -1,3 +1,20 @@ +simple_spawn: + // a0: actor number + // a1: actor variable + push 4, 9, ra + mov a2, a0 + mov t4, a1 + li a1, @global_context + addi a0, a1, @actor_spawn_offset + li t0, @link_actor + lw t1, @actor_x(t0) + lw t2, @actor_y(t0) + lw t3, @actor_z(t0) + lhu t7, @actor_horiz_angle(t0) + call @actor_spawn a0, a1, a2, t1, t2, t3, 0, t7, 0, t4, 0x7F, 0x3FF, 0 + ret 4, 9, ra + +/* old version (before call pseudo-instruction existed) with comments simple_spawn: // a0: actor number // a1: actor variable @@ -32,3 +49,4 @@ simple_spawn: jal @actor_spawn nop ret 4, 9, ra +*/