Browse Source

Added non-crashy trick actions on style button.

master
5 years ago
parent
commit
7fc7a9539b
3 changed files with 1216 additions and 708 deletions
  1. 1
    1
      CEAs/vergil-allow-non-DT-trick-down.CEA
  2. 153
    0
      CEAs/vergil-trick-on-style.CEA
  3. 1062
    707
      DevilMayCry4SpecialEdition.CT

+ 1
- 1
CEAs/vergil-allow-non-DT-trick-down.CEA View File

@@ -13,7 +13,7 @@ label(exit)
//while he is in air in his human form
//so add it.
option_trickup:
db 00
db 00 //default to false
newmem: //still going to do this
//currently this will be called every frame

+ 153
- 0
CEAs/vergil-trick-on-style.CEA View File

@@ -0,0 +1,153 @@
[enable]
alloc(airlock,2048)
label(return_from_read)
label(exit_read)
label(no_anim)
alloc(rebind_air_trick, 1024)
alloc(sidetrick_DTrequire, 1)
alloc(trickback_DTrequire, 1)
alloc(trickdown_DTrequire, 1) //booleans, only need 0, 1
registersymbol(sidetrick_DTrequire)
registersymbol(trickback_DTrequire)
registersymbol(trickdown_DTrequire)
label(exit)
label(do_move)
label(no_move)
label(returnhere)
label(trickup)
label(sidetrick)
label(trickdown)
label(trickback)
airlock:
test byte ptr [esi+00001A64],01 //test player is in air or not
pushfd //keep flags for the conditional jump on returning
cmp dword ptr [esi+3924], 02
jne no_anim
//cmp byte ptr [esi+3928], 01 //check jump button status
//jne no_anim
//test byte ptr [esi+0000392C],10
//je no_anim
//do not check for specific buttons narrow down only to this
movq xmm0, [esi+3930] //prepare registers for function call
mov ecx, [esi+3940] //this and above will placed on stack
sub esp, 14 //make room on the stack
mov eax, esp //use eax for moving stuff to stack addresses
movq [eax], xmm0 //prepare stack for function call
movq xmm0, [esi+3938]
movq [eax+8], xmm0
mov [eax+10], ecx
call DevilMayCry4SpecialEdition.exe+4CCD40 //listen lock-on input
//stack cleaned up by callee
no_anim:
xor al, al //do not play an animation
exit_read:
popfd //restore flags
jmp return_from_read
"DevilMayCry4SpecialEdition.exe"+D2C77:
//this is where the game decides whether or not to read lock-on inputs
jmp airlock
nop
nop
return_from_read:
//+-------------------------------------+
sidetrick_DTrequire:
db 01 //default value to true
trickback_DTrequire:
db 01 //default value to true
trickdown_DTrequire:
db 00 //default value to false
rebind_air_trick:
//need only to map animations!
push edi //save value of edi just in case
mov edi, [ebx+1bfc]
cmp edi, 1 //lock-on forward
je trickup
cmp edi, 2 //lock on left
je sidetrick
cmp edi, 8 //lock on right
je sidetrick
cmp edi, 6 //lock-on back diagonal
je trickdown
cmp edi, C //lock-on back
je trickdown
push 24 //if reached here, then lock-on is neutral! (do air trick)
jmp do_move
no_move:
xor al, al
jmp exit
do_move:
mov ecx,ebx
call eax
mov al, 01
exit:
pop edi
jmp returnhere
trickup: //OK!
cmp byte ptr [ebx+7c50], 0 //amount of trick-ups
jg no_move
push 27
jmp do_move
sidetrick: //Broken, goes in direction of last roll
mov edi, [ebx+78e4] //move devil trigger status into edi
cmp [sidetrick_DTrequire], edi
jg no_move //player is not devil triggered and DT requirement in place
push 28 //side trick i.d
jmp do_move
trickdown: //body animation but no effect?
test byte ptr [ebx+00001A64],01 //in air or not
jne trickback //not in air
mov edi, [ebx+78e4] //move devil trigger status into edi
cmp [trickdown_DTrequire], edi
jg no_move
push 2a
jmp do_move
trickback: //OK! Good to go!
mov edi, [ebx+78e4] //move devil trigger status into edi
cmp [trickback_DTrequire], edi
jg no_move //player is not devil triggered and DT requirement in place
push 29
jmp do_move
"DevilMayCry4SpecialEdition.exe"+D259F:
//this is where the game has decided to do air trick (given sword embedded)
jmp rebind_air_trick
nop
returnhere:
DevilMayCry4SpecialEdition.exe+D25A5:
//where the game sets true or false regarding animation done or not
db 90 90
[disable]
dealloc(airlock)
dealloc(rebind_air_trick)
dealloc(sidetrick_DTrequire)
dealloc(trickback_DTrequire)
dealloc(trickdown_DTrequire)
"DevilMayCry4SpecialEdition.exe"+D2C77:
test byte ptr [esi+00001A64],01
"DevilMayCry4SpecialEdition.exe"+D259F:
push 24
mov ecx,ebx
call eax
DevilMayCry4SpecialEdition.exe+D25A5:
mov al,01

+ 1062
- 707
DevilMayCry4SpecialEdition.CT
File diff suppressed because it is too large
View File


Loading…
Cancel
Save