Advertisement
Guest User

ZnK.asm v1

a guest
Jan 27th, 2016
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. .psp
  2. .open "EBOOT.BIN", 0x8804000
  3. .headersize 0x8803F40
  4.  
  5. //"Detective" menuitem on triangle menu
  6. .org 0x0881C660
  7. addiu v0,v1,-0xB4D4 ;relocation fix, real operand is -0x74D4
  8. addiu a1,sp,0x10
  9. @@branch2:
  10. lb a0,0x0(v0)
  11. addiu v0,v0,0x1
  12. sb a0,-0x4000(a1) ;relocation fix, real operand is 0x0
  13. bne a0,zero,@@branch2
  14. addiu a1,a1,0x1
  15. nop
  16. nop
  17. addiu s4,sp,0x10
  18. addiu s3,sp,0x14
  19. li s2,-0x1
  20. nop
  21. j 0x0881C140-0x08804000 ;relocation fix- armips arithmetic parser example
  22. nop
  23.  
  24. //Casino fix
  25. .org 0x0898A4CC
  26. swl a1, 0x7(sp)
  27.  
  28. //VWF
  29. .org 0x089E8200
  30. lui v1, 0x406 ;change to rectangle draw (from triangle_strip)
  31. //Rewrite vertex routine to accomodate rectangles
  32. .org 0x0898B2F4
  33. swc1 f5,0x4(t0); texcoord_y-origin
  34. .org 0x0898B330
  35. swc1 f4,0x4(a2); texcoord_y-dest
  36. .org 0x0898B338
  37. swc1 f6,0x0(a2); texcood_x-dest
  38. .org 0x0898B2C4
  39. sh a1,0x0(s5); position x-dest
  40. .org 0x0898B2E0
  41. sh ra,0xE(t0); position y-origin
  42. .org 0x0898B300
  43. sh v0,0x0(s4); position y-dest
  44. //VWF insert point
  45. .org 0x0898B2A4
  46. j 0x08A5E420
  47. nop
  48. //VWF routine
  49. .org 0x08A5E420
  50. li a0,0x08A661D0 ;Load memory addr 0x08A661D0
  51. sw a1,0x0(a0) ;Save value
  52. lbu k1,0x0(a3) ;Load current character
  53. addiu a1,a0,0x10 ;Points to start of lookup table
  54. @@vwf_loop:
  55. lbu a2,0x0(a1) ;Load lookup table char
  56. beq a2,zero,@@vwf_exit ;Exit if dropped off the lookup table
  57. nop
  58. bnel k1,a2,@@vwf_loop ;Exit loop if match
  59. addiu a1,a1,0x2 ;Go to next char in lookup table
  60. lbu a2,0x1(a1) ;Load spacing value from lookup table
  61. nop
  62. seb a2,a2 ;For negative values
  63. addu a2,a2,s7 ;Adjust spacing
  64. sw a2,0x8(sp) ;Store spacing adjustment
  65. @@vwf_exit:
  66. lw a1,0x0(a0) ;Restore original a1 value
  67. addu a2,fp,s6 ;Replace insert point instruction
  68. j 0x0898B2AC ;Return
  69. mfc1 fp,f0 ;Replace insert point instruction
  70.  
  71. //VWF lookup table
  72. .org 0x8A661E0
  73. .ascii " "
  74. .byte 0xFC
  75. .ascii "b"
  76. .byte 0x01
  77. .ascii "f"
  78. .byte 0xFE
  79. .ascii "l"
  80. .byte 0xFD
  81. .ascii "m"
  82. .byte 0x02
  83. .ascii "i"
  84. .byte 0xFD
  85. .ascii "j"
  86. .byte 0xFD
  87. .ascii "r"
  88. .byte 0xFF
  89. .ascii "t"
  90. .byte 0xFF
  91. .ascii ","
  92. .byte 0xFD
  93. .ascii "."
  94. .byte 0xFD
  95. .ascii "'"
  96. .byte 0xFC
  97. .ascii "!"
  98. .byte 0xFC
  99. .ascii "C"
  100. .byte 0x01
  101. .ascii "H"
  102. .byte 0x01
  103. .ascii "I"
  104. .byte 0xFC
  105. .ascii "M"
  106. .byte 0x02
  107. .ascii "O"
  108. .byte 0x01
  109. .ascii "<"
  110. .byte 0xFF
  111. .ascii ">"
  112. .byte 0xFF
  113. .ascii "("
  114. .byte 0xFF
  115. .ascii ")"
  116. .byte 0xFF
  117. .ascii "["
  118. .byte 0xFE
  119. .ascii "]"
  120. .byte 0xFE
  121. .ascii "-"
  122. .byte 0x01
  123.  
  124. .close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement