Super Mario 64s source code (from a leak on 4chan so be careful)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.2 KiB

6 years ago
  1. .set noreorder # don't insert nops after branches
  2. .set gp=64
  3. .include "macros.inc"
  4. .section .text, "ax"
  5. # This file is handwritten
  6. #void osMapTLB(s32 index, OSPageMask pm, void *vaddr, u32 evenpaddr,
  7. # u32 oddpaddr, s32 asid);
  8. glabel osMapTLB
  9. mfc0 $t0, $10
  10. mtc0 $a0, $0
  11. mtc0 $a1, $5
  12. lw $t1, 0x14($sp) #asid
  13. beq $t1, -1, .L803214D8
  14. li $t4, 1
  15. li $t2, 30
  16. b .L803214DC
  17. or $a2, $a2, $t1 #vaddr
  18. .L803214D8:
  19. li $t2, 31
  20. .L803214DC:
  21. mtc0 $a2, $10 #vaddr
  22. beq $a3, -1, .L80321500 #even paddr
  23. nop
  24. srl $t3, $a3, 6 #evenpaddr
  25. or $t3, $t3, $t2
  26. mtc0 $t3, $2
  27. b .L80321504
  28. nop
  29. .L80321500:
  30. mtc0 $t4, $2
  31. .L80321504:
  32. lw $t3, 0x10($sp) #oddpaddr
  33. beq $t3, -1, .L80321528
  34. nop
  35. srl $t3, $t3, 6
  36. or $t3, $t3, $t2
  37. mtc0 $t3, $3
  38. b .L80321540
  39. nop
  40. .L80321528:
  41. mtc0 $t4, $3
  42. bne $a3, -1, .L80321540 #evenpaddr
  43. nop
  44. lui $t3, 0x8000
  45. mtc0 $t3, $10
  46. .L80321540:
  47. nop
  48. tlbwi
  49. nop
  50. nop
  51. nop
  52. nop
  53. mtc0 $t0, $10
  54. jr $ra
  55. nop #file gets padded but
  56. nop
  57. nop
  58. nop