(Lua, ASMx86) Replication of Devil May Cry 4's debug functions for it's re-released version.
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.

vergil-tricks-on-style-btn-swordembed.CEA 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. [enable]
  2. alloc(newmem,2048)
  3. alloc(sidetrick_DTrequire, 1)
  4. alloc(trickdown_DTrequire, 1)
  5. registersymbol(sidetrick_DTrequire)
  6. registersymbol(trickdown_DTrequire)
  7. label(returnhere)
  8. label(originalcode)
  9. label(trickup)
  10. label(airtrick)
  11. label(sidetrick)
  12. label(sidetrickanim)
  13. label(trickdown)
  14. label(trickback)
  15. label(trickbackanim)
  16. label(animation_bind)
  17. label(no_anim)
  18. label(get_input)
  19. label(exit)
  20. //Vergil is locked on and has a sword embedded in his target.
  21. //ebx = address of player character
  22. //do NOT touch eax and ecx
  23. sidetrick_DTrequire:
  24. db 01 //default to true
  25. trickdown_DTrequire:
  26. db 00 //default to false
  27. newmem:
  28. jmp animation_bind
  29. //game will read lock-on inputs on ground
  30. //however game will not read lock-on + style in air
  31. test byte ptr [ebx+00001A64],01
  32. je get_input //bl is greater than 0 (which would be 1)
  33. animation_bind:
  34. //need only to map animations!
  35. mov edi, [ebx+1bfc] //edi is safe to be changed.
  36. cmp edi, 0 //lock-on neutral
  37. je airtrick
  38. cmp edi, 1 //lock-on forward
  39. je trickup
  40. cmp edi, 2 //lock-on left
  41. je sidetrick
  42. cmp edi, 8 //lock-on right
  43. je sidetrick
  44. cmp edi, 6 //lock-on back diagonal
  45. je trickback
  46. cmp edi, C //lock-on back
  47. je trickback
  48. jmp no_anim
  49. get_input:
  50. movq xmm0, [ebx+3930] //prepare registers for function call
  51. mov edx, [ebx+3940] //this and above will placed on stack
  52. sub esp, 14 //make room on the stack
  53. mov edi, esp //use edi for moving stuff to stack addresses
  54. movq [edi], xmm0 //prepare stack for function call
  55. movq xmm0, [ebx+3938]
  56. movq [edi+8], xmm0
  57. mov [edi+10], edx
  58. call DevilMayCry4SpecialEdition.exe+4CCD40 //listen lock-on input
  59. jmp animation_bind
  60. originalcode:
  61. mov ecx,ebx
  62. call eax
  63. mov al, 01 //need script to do this
  64. jmp exit
  65. no_anim:
  66. xor al, al
  67. exit:
  68. add esp, 14
  69. jmp returnhere
  70. trickup:
  71. cmp byte ptr [ebx+7c50], 0 //compare trickup count with ..
  72. jg no_anim //don't trickup if limit is hit
  73. push 27 //animation i.d for trick up
  74. jmp originalcode
  75. airtrick:
  76. //this move has no requirements or restrictions
  77. push 24
  78. jmp originalcode
  79. sidetrick:
  80. test byte ptr [ebx+00001A64],01 //check if player is on ground
  81. je no_anim //in air, don't do side trick
  82. //check if script should obey DT rules for side trick
  83. cmp byte ptr [sidetrick_DTrequire], 0
  84. je sidetrickanim //not required so skip to pushing i.d
  85. cmp [ebx+78e4], 0 //if so check if player is in DT
  86. je no_anim //jump if player is not in DT
  87. sidetrickanim:
  88. push 28
  89. jmp originalcode
  90. trickback:
  91. //check if script should obey DT rules for trick down
  92. cmp byte ptr [trickdown_DTrequire], 0
  93. je trickbackanim //skip over dt check
  94. cmp [ebx+78e4], 0 //if so check if player is in DT
  95. je no_anim //jump if player is not in DT
  96. trickbackanim:
  97. test byte ptr [ebx+00001A64],01
  98. je trickdown
  99. push 29
  100. jmp originalcode
  101. trickdown:
  102. push 2a
  103. jmp originalcode
  104. "DevilMayCry4SpecialEdition.exe"+D259F:
  105. jmp newmem
  106. nop
  107. returnhere:
  108. DevilMayCry4SpecialEdition.exe+D25A5:
  109. db 90 90
  110. [disable]
  111. dealloc(sidetrick_DTrequire)
  112. dealloc(trickdown_DTrequire)
  113. dealloc(newmem)
  114. "DevilMayCry4SpecialEdition.exe"+D259F:
  115. push 24 //air trick animation i.d
  116. mov ecx,ebx
  117. call eax
  118. DevilMayCry4SpecialEdition.exe+D25A5:
  119. mov al,01