mirror of
https://github.com/notwa/mm
synced 2025-02-05 05:23:22 -08:00
simplify simple spawn with call instruction
This commit is contained in:
parent
d7b100a983
commit
7e9b5e6e88
1 changed files with 18 additions and 0 deletions
|
@ -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:
|
simple_spawn:
|
||||||
// a0: actor number
|
// a0: actor number
|
||||||
// a1: actor variable
|
// a1: actor variable
|
||||||
|
@ -32,3 +49,4 @@ simple_spawn:
|
||||||
jal @actor_spawn
|
jal @actor_spawn
|
||||||
nop
|
nop
|
||||||
ret 4, 9, ra
|
ret 4, 9, ra
|
||||||
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue