Page 1 of 1

PCSX2 Script speed up game, Arc the lad

Posted: Thu Jun 04, 2020 3:34 pm
by kidalot
Hi



I'm trying to use a XP multiplier script but the game speeds up every time I get XP. Where would look to find the issue?



[CODE][ENABLE]



alloc(newmem,2048)

label(returnhere)

label(originalcode)

label(exit)



newmem:

Pushf

//push flags

Mov eax, [ecx]

// mov old xp to eax

Sub edx, eax

// Get difference in xp ->edx

imul edx, #2

// Difference *= 2

Add edx, eax

// Add original xp to new difference



originalcode:

mov [ecx],edx

mov eax,00000001



exit:

jmp returnhere



30332200:

jmp newmem

nop 2

returnhere:



[DISABLE][/CODE]

[automerge]1591291753[/automerge]

For my own reference, changed the following and worked



[CODE][ENABLE]

//code from here to '[DISABLE]' will be used to enable the cheat

alloc(newmem,2048)

label(returnhere)

label(originalcode)

label(exit)



newmem:

Pushf

//push flags

Mov eax, [ecx]

// mov old xp to eax

Sub edx, eax

// Get difference in xp ->edx

IMul edx, #5

// Difference *= 5

Add edx, eax

// Add original xp to new difference



originalcode:

Mov [ecx], edx //original

Popf



exit:

jmp returnhere



3040A160:

jmp newmem

nop 2

returnhere:



[DISABLE]

//code from here till the end of the code will be used to disable the cheat

dealloc(newmem)

3040A160:

mov [ecx],edx

mov eax,00000001

//Alt: db 89 11 B8 01 00 00 00[/CODE]

PCSX2 Script speed up game, Arc the lad

Posted: Thu Jun 04, 2020 10:47 pm
by WhiteSnoop
Cheat engine on PCSX2 or emulation in General is not a good idea. Code is jitted (pre-compiled). Lots of functions you are breakpointing on accesses way more things than just what you're trying to find. My say would either to do extensive Lua scripting on it or try to learn a bit of MIPS assembly and the builtin debugger of PCSX2. It's not an easy road I must add!

PCSX2 Script speed up game, Arc the lad

Posted: Fri Jun 05, 2020 6:20 pm
by kidalot
[QUOTE="WhiteSnoop, post: 138240, member: 6265"]

Cheat engine on PCSX2 or emulation in General is not a good idea. Code is jitted (pre-compiled). Lots of functions you are breakpointing on accesses way more things than just what you're trying to find. My say would either to do extensive Lua scripting on it or try to learn a bit of MIPS assembly and the builtin debugger of PCSX2. It's not an easy road I must add!

[/QUOTE]





Yea no idea why this solves the issue though



originalcode:

Mov [ecx], edx //original

Popf

PCSX2 Script speed up game, Arc the lad

Posted: Sat Jun 06, 2020 1:12 am
by happyTugs
In your first iteration, you pushf (push your flags onto the stack) but forget to popf (reinstate the preserved flags); hence it now works.