1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-05-17 21:23:22 -07:00

simplify simple spawn with call instruction

This commit is contained in:
Connor Olding 2016-09-27 12:38:15 -07:00
parent d7b100a983
commit 7e9b5e6e88

View File

@ -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
*/