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.

59 lines
1.0 KiB

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 osInvalDCache
  7. blez $a1, .L80323500
  8. nop
  9. li $t3, 8192
  10. sltu $at, $a1, $t3
  11. beqz $at, .L80323508
  12. nop
  13. move $t0, $a0
  14. addu $t1, $a0, $a1
  15. sltu $at, $t0, $t1
  16. beqz $at, .L80323500
  17. nop
  18. andi $t2, $t0, 0xf
  19. beqz $t2, .L803234D0
  20. addiu $t1, $t1, -0x10
  21. subu $t0, $t0, $t2
  22. cache 0x15, ($t0)
  23. sltu $at, $t0, $t1
  24. beqz $at, .L80323500
  25. nop
  26. addiu $t0, $t0, 0x10
  27. .L803234D0:
  28. andi $t2, $t1, 0xf
  29. beqz $t2, .L803234F0
  30. nop
  31. subu $t1, $t1, $t2
  32. cache 0x15, 0x10($t1)
  33. sltu $at, $t1, $t0
  34. bnez $at, .L80323500
  35. nop
  36. .L803234F0:
  37. cache 0x11, ($t0)
  38. sltu $at, $t0, $t1
  39. bnez $at, .L803234F0
  40. addiu $t0, $t0, 0x10
  41. .L80323500:
  42. jr $ra
  43. nop
  44. .L80323508:
  45. li $t0, K0BASE
  46. addu $t1, $t0, $t3
  47. addiu $t1, $t1, -0x10
  48. .L80323514:
  49. cache 1, ($t0)
  50. sltu $at, $t0, $t1
  51. bnez $at, .L80323514
  52. addiu $t0, $t0, 0x10
  53. jr $ra
  54. nop