(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-allow-non-DT-trick-down.CEA 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. [enable]
  2. alloc(newmem,200)
  3. alloc(option_trickup, 1) //boolean, only need a byte
  4. registersymbol(option_trickup)
  5. label(returnhere)
  6. label(in_air)
  7. label(no_anim)
  8. label(trickdown)
  9. label(exit)
  10. //Vergil currently does not have a input combination:
  11. //Lock-ON + Back + Jump
  12. //while he is in air in his human form
  13. //so add it.
  14. option_trickup:
  15. db 0
  16. newmem: //still going to do this
  17. //currently this will be called every frame
  18. //currently esi is address of player character
  19. test byte ptr [esi+00001A64],01
  20. pushfd //keep flags for the conditional jump on returning
  21. je in_air
  22. no_anim:
  23. xor al, al
  24. exit:
  25. popfd //restore flags
  26. jmp returnhere
  27. in_air:
  28. //eax, ecx do not need to be pushed/popped
  29. //now for preliminary checks
  30. //these are done also on Trick Down (air)
  31. cmp dword ptr [esi+3924], 02
  32. jne no_anim
  33. cmp byte ptr [esi+3928], 01
  34. jne no_anim
  35. test byte ptr [esi+392c], 10
  36. je no_anim
  37. movq xmm0, [esi+3930] //prepare registers for function call
  38. mov ecx, [esi+3940] //this and above will placed on stack
  39. sub esp, 14 //make room on the stack
  40. mov eax, esp //use eax for moving stuff to stack addresses
  41. movq [eax], xmm0
  42. movq xmm0, [esi+3938]
  43. movq [eax+8], xmm0
  44. mov [eax+10], ecx
  45. call DevilMayCry4SpecialEdition.exe+4CCD40 //listen lock-on input
  46. cmp [esi+1bfc], C //representation for back
  47. je trickdown
  48. cmp [esi+1bfc], 6 //representation for diagonal back
  49. je trickdown
  50. jmp exit
  51. trickdown:
  52. mov eax, [esi] //get starting address for player character methods
  53. mov eax, [eax+234]
  54. push 2a //push animation i.d for trick down
  55. mov ecx, esi //set ecx to address of player character
  56. call eax
  57. mov al, 01
  58. //don't add esp, end of real function will do that instead
  59. jmp exit
  60. "DevilMayCry4SpecialEdition.exe"+D2C77:
  61. jmp newmem
  62. nop
  63. nop
  64. returnhere:
  65. DevilMayCry4SpecialEdition.exe+D2C80:
  66. //script needs to set al
  67. //if a move is to be done, al = 1
  68. //otherwise, al = 0
  69. nop
  70. nop
  71. [disable]
  72. dealloc(newmem)
  73. dealloc(option_trickup)
  74. "DevilMayCry4SpecialEdition.exe"+D2C77:
  75. test byte ptr [esi+00001A64],01
  76. DevilMayCry4SpecialEdition.exe+D2C80:
  77. xor al,al