Patch:Nojoy
Disable joystick support (nojoy)
Depends on |
nmlgc/base_tsa, nmlgc/base_tasofro |
---|
- (adapted from https://gist.github.com/iamgreaser/5651429)
Here, have some patches.
These are patches to disable joystick support for when you'd rather have a joy-to-key mapper than the terribleness that is 99% of games with joystick support not being able to handle a 28-axis controller properly.
You must tick the "Don't use DirectInput for joystick" box for this to actually work, as it doesn't touch those.
Also, these are for the latest (as of writing) full versions.
The general procedure is:
- Look for all instances of joyGetPosEx - there should be exactly 3.
- Make the code pretend that it always returns a nonzero value in all 3 cases.
For instance, this is one of the relevant places in TH07's disassembly:
ALIGN 16
?_03773:push ebp ; 00430290 _ 55
mov ebp, esp ; 00430291 _ 8B. EC
sub esp, 52 ; 00430293 _ 83. EC, 34
mov dword [ebp-34H], 52 ; 00430296 _ C7. 45, CC, 00000034
mov dword [ebp-30H], 255 ; 0043029D _ C7. 45, D0, 000000FF
lea eax, [ebp-34H] ; 004302A4 _ 8D. 45, CC
push eax ; 004302A7 _ 50
push 0 ; 004302A8 _ 6A, 00
call near [imp_joyGetPosEx] ; 004302AA _ FF. 15, 0048D220(d)
test eax, eax ; 004302B0 _ 85. C0
jz ?_03774 ; 004302B2 _ 74, 18
; ^ NOP this opcode with two 0x90 bytes
push ?_15147 ; 004302B4 _ 68, 00497D9C(d)
push ?_15997 ; 004302B9 _ 68, 00624210(d)
call ?_03849 ; 004302BE _ E8, 0000132D
add esp, 8 ; 004302C3 _ 83. C4, 08
mov ax, 1 ; 004302C6 _ 66: B8, 0001
jmp ?_03775 ; 004302CA _ EB, 15
If on the other hand it's a jnz or something that doesn't include zero, you'll need to find what byte to use for a force jump.
Said one other case I have is for a longer-than-usual conditional jump, which involves changing 0F 85 to 90 E9.
Enjoy!
-- GreaseMonkey
Embodiment of Scarlet Devil (th06)
Disable joystick support(nojoy ) |
||
---|---|---|
Address |
|
|
Code | 90 90 nop (*2)
|
Perfect Cherry Blossom (th07)
Disable joystick support(nojoy ) |
||
---|---|---|
Address |
|
|
Code | 90 90 nop (*2)
|
Imperishable Night (th08)
Disable joystick support(nojoy ) |
||
---|---|---|
Address |
|
|
Code | 90 90 nop (*2)
|
Phantasmagoria of Flower View (th09)
Disable joystick support (long jump)(nojoy_long ) |
||
---|---|---|
Address |
|
|
Code | 90 e9 nop
jmp ...
|
Disable joystick support(nojoy ) |
||
---|---|---|
Address |
|
|
Code | 90 90 nop (*2)
|
Mountain of Faith (th10)
Disable joystick support (long jump)(nojoy_long ) |
||
---|---|---|
Address |
|
|
Code | 90 e9 nop
jmp ...
|
Disable joystick support(nojoy ) |
||
---|---|---|
Address |
|
|
Code | 90 90 nop (*2)
|
Subterranean Animism (th11)
Disable joystick support (long jump)(nojoy_long ) |
||
---|---|---|
Address |
|
|
Code | 90 e9 nop
jmp ...
|
Disable joystick support(nojoy ) |
||
---|---|---|
Address |
|
|
Code | 90 90 nop (*2)
|
Undefined Fantastic Object (th12)
Disable joystick support (long jump)(nojoy_long ) |
||
---|---|---|
Address |
|
|
Code | 90 e9 nop
jmp ...
|
Disable joystick support(nojoy ) |
||
---|---|---|
Address |
|
|
Code | 90 90 nop (*2)
|
Fairy Wars (th128)
Disable joystick support (long jump)(nojoy_long ) |
||
---|---|---|
Address |
|
|
Code | 90 e9 nop
jmp ...
|
Disable joystick support(nojoy ) |
||
---|---|---|
Address |
|
|
Code | 90 90 nop (*2)
|
Ten Desires (th13)
Disable joystick support (long jump)(nojoy_long ) |
||
---|---|---|
Address |
|
|
Code | 90 e9 nop
jmp ...
|
Disable joystick support(nojoy ) |
||
---|---|---|
Address |
|
|
Code | 90 90 nop (*2)
|
Double Dealing Character (th14)
Disable joystick support (short jump)(nojoy_short ) |
||
---|---|---|
Address |
|
|
Code | eb jmp ...
|
Disable joystick support(nojoy ) |
||
---|---|---|
Address |
|
|
Code | 90 90 nop (*2)
|