Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ROUTINE : RIP X Y Z COORDINATES -> CONVERT TO INT -> STORE
- lui $v0, 0x8009 # 8009E724
- addiu $v0, $v0, 0xE724 # load 0x10010020 into v0
- addu $t5, $v0, $zero
- addu $t3, $zero, $zero
- condition:
- lw $t1, 0x0000 ($v0) # get pointer from v0
- addiu $t3, $t3, 0x0004
- addu $t1, $t1, $t3 # add 0x4 onto pointer address
- l.s $f1, ($t1)
- cvt.w.s $f0, $f1 # convert float into int
- mfc1 $t2, $f0 # move to general register
- beqz $t2, flip # continue if end of coordinate listing
- subi $t2, $t2, 0x30 # take off 0x30 as offset for all written coordinates
- sw $t2, 0x0010 ($t5) # write into 0x10 ahead of pointer for coords
- addiu $t5, $t5, 0x0004 # add 0x4 onto v0
- bnez $t2, condition #if coordinates left
- nop
- # ROUTINE : FLIP CAMERA BYTE -> STORE
- flip:
- lui $t6, 0x8009
- addiu $t6, $t6, 0xE96C
- lw $t0, 0x0000 ($t6)
- addiu $t1, $zero, 0x0003
- beq $t0, $t1, equals # if 0x3 present at 8009E96C, go to equals and write 1
- nop
- sw $t1, 0x0000 ($t6) # else store 3
- j custom_coords # return
- equals:
- addiu $t2, $zero, 0x0001
- sw $t2, 0x0000 ($t6)
- lui $t5, 0x1001
- addiu $t5, $t5, 0x0040
- sw $zero, 0x0000 ($t5) # clear fields #
- sw $zero, 0x0004 ($t5)
- sw $zero, 0x0008 ($t5)
- nop
- custom_coords:
- # ROUTINE : ALTER TLB TO LOAD FROM CUSTOM COORDINATES
- sub $sp, $sp, -4 # save return address
- sw $ra, 0x0000 ($sp)
- lui $t0, 0x7F10 # load address 7F10FF8C
- addiu $t0, $t0, 0xFF8C
- addiu $t1, $zero, 0x0000
- addiu $t2, $zero, 0x8c68 # store op lw t0, 0x0000 (t5)
- jal write_clear_reg
- addiu $t1, $zero, 0x0004
- addiu $t2, $zero, 0x8c69 # store op lw t1, 0x0004 (t5)
- jal write_clear_reg
- addiu $t1, $zero, 0x0008
- addiu $t2, $zero, 0x8c6a # store op lw t2, 0x0008 (t5)
- sh $t1, 0x0000 ($t0)
- sh $t2, 0x0002 ($t0) # redundancy, but write on final
- jal end
- nop
- write_clear_reg:
- sh $t1, 0x0000 ($t0)
- sh $t2, 0x0002 ($t0) # write
- addu $t1, $zero, $zero
- addu $t2, $zero, $zero
- addiu $t0, $t0, 0x0014
- jr $ra
- end:
- add $sp, $sp, 4 # pop ra back
- lw $ra, 0x0000 ($sp)
- jr $ra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement