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.

65 lines
1017 B

6 years ago
  1. .set noat # allow manual use of $at
  2. .set noreorder # don't insert nops after branches
  3. .set gp=64
  4. .include "macros.inc"
  5. .section .text, "ax"
  6. glabel __osProbeTLB
  7. mfc0 $t0, $10
  8. andi $t1, $t0, 0xff
  9. li $at, -8192
  10. and $t2, $a0, $at
  11. or $t1, $t1, $t2
  12. mtc0 $t1, $10
  13. nop
  14. nop
  15. nop
  16. tlbp
  17. nop
  18. nop
  19. mfc0 $t3, $0
  20. lui $at, 0x8000
  21. and $t3, $t3, $at
  22. bnez $t3, .L8032A0D8
  23. nop
  24. tlbr
  25. nop
  26. nop
  27. nop
  28. mfc0 $t3, $5
  29. addi $t3, $t3, 0x2000
  30. srl $t3, $t3, 1
  31. and $t4, $t3, $a0
  32. bnez $t4, .L8032A0A8
  33. addi $t3, $t3, -1
  34. mfc0 $v0, $2
  35. b .L8032A0AC
  36. nop
  37. .L8032A0A8:
  38. mfc0 $v0, $3
  39. .L8032A0AC:
  40. andi $t5, $v0, 2
  41. beqz $t5, .L8032A0D8
  42. nop
  43. lui $at, (0x3FFFFFC0 >> 16) # lui $at, 0x3fff
  44. ori $at, (0x3FFFFFC0 & 0xFFFF) # ori $at, $at, 0xffc0
  45. and $v0, $v0, $at
  46. sll $v0, $v0, 6
  47. and $t5, $a0, $t3
  48. add $v0, $v0, $t5
  49. b .L8032A0DC
  50. nop
  51. .L8032A0D8:
  52. li $v0, -1
  53. .L8032A0DC:
  54. mtc0 $t0, $10
  55. jr $ra
  56. nop
  57. nop
  58. nop