Advertisement
glank

stage2.S

Nov 11th, 2019
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* $s2: origin */
  2.  
  3. la      $s0, 0x80120000
  4. /* create a vi message queue */
  5. addiu   $a0, $sp, 0x0010  /* mq */
  6. addiu   $a1, $sp, 0x0028  /* msg */
  7. la      $a2, 1
  8. /* hijack vi event from audio thread */
  9. sw      $a0, 0x0180($s0)  /* mq_list.mq for audio irq */
  10. jal     0x80004220        /* osCreateMesgQueue(mq, msg, 1) */
  11.  
  12. .Lloop:
  13. /* wait for vertical retrace */
  14. addiu   $a0, $sp, 0x0010  /* mq */
  15. la      $a1, 0
  16. /* $a2 is not clobbered by osCreateMesgQueue or osRecvMesg, so reuse it */
  17. jal     0x80002030        /* osRecvMesg(mq, NULL, OS_MESG_BLOCK) */
  18. /* copy controller data */
  19. lw      $t0, -0x28D0($s0) /* z64_input_direct[0].raw */
  20. lhu     $t1, -0x289E($s0) /* z64_input_direct[2].raw.x / y */
  21. sh      $t0, 0x003C($s2)
  22. sh      $t1, 0x003E($s2)
  23. addiu   $s2, $s2, 0x0004
  24. bne     $t0, $zero, .Lloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement