Patch:Skipgame

From Touhou Patch Center
Revision as of 09:00, 25 January 2019 by NamelessLegacy (talk | contribs) (Here's something cool, always unlocking the trophy with the current stage number after clearing that stage. And using a custom scorefile name, since you don't want to ruin your regular one. Funded by zorg.)
Jump to navigation Jump to search

Skip gameplay sections (skipgame)

Depends on

nmlgc/base_tsa, nmlgc/base_tasofro

This patch removes all stage portions and sets a 1-2 second timer on every boss spell card. It is intended to allow for rapid proofreading of in-game translations and endings.

For some games, it also includes "cheats" to achieve e.g. better endings without any gameplay effort.

Replacement ECLs

Icon th06.png Embodiment of Scarlet Devil (th06)

Icon th07.png Perfect Cherry Blossom (th07)

Icon th08.png Imperishable Night (th08)

Icon th10.png Mountain of Faith (th10)

Icon alcostg.png Uwabami Breakers (alcostg)

Icon th11.png Subterranean Animism (th11)

Icon th12.png Undefined Fantastic Object (th12)

Icon th128.png Fairy Wars (th128)

Icon th13.png Ten Desires (th13)

Icon th135.png Hopeless Masquerade (th135)

Skipgame-th145-Nphase.csv.jdiff also work for HM, so we'll reuse them.

Icon th14.png Double Dealing Character (th14)

Icon th143.png Impossible Spell Card (th143)

Icon th145.png Urban Legend in Limbo (th145)

Icon th15.png Legacy of Lunatic Kingdom (th15)

Icon th16.png Hidden Star in Four Seasons (th16)

Icon th165.png Violet Detector (th165)

These only reduce certain delays, the actual functionality is implemented through binary hacks.

Binary hacks

Icon th08.png Imperishable Night (th08)

Increase value of small time items to 127
(time_factor)
Description Helps unlocking Last Spells and the good ending.
Address
v1.00d0x441373
Code
6a79
push 0x79

Icon th09.png Phantasmagoria of Flower View (th09)

Reduce player lives by 2
(player_life_summand)
Description The player life setting (3, 4 or 5) is actually saved as 1, 2 or 3, the remaining two lives are "added" at the start of a run. This hack removes the addition.

Thus, setting your life count to 3 in the option menu reduces your actual lives in-game to 1.

First address is at game start, second at the continue prompt.
Address
v1.50a0x41b0b8, 0x4352fb
Code
909090909090
nop (*6)
Infinite continues
(infinite_continues)
Address
v1.50a0x435265
Code
909090
nop (*3)
Start with Level 2 gauge
(level_2_gauge)
Address
v1.50a0x41ef78
Code
00004843
200.0f
Larger enemy hitboxes
(larger_enemy_hitboxes)
Description I have forgotten how this exactly works, but it causes many an erratically moving enemy to die within 10 seconds.
Address
v1.50a0x41ef28
Code
B9  0000A040
898F B01C0000
8B50 04
3E 807D FC 00
74 05
BA 0000C841
8997 A81C0000
mov ecx, 40a00000
mov dword ptr ds:[edi+1cb0], ecx
mov edx, dword ptr ds:[eax+4]
cmp byte ptr ds:[ebp-4],0
je +5
mov edx, 41c80000
mov dword ptr ds:[edi+1ca8], edx
Start on player's last sub-life (story mode)
(last_sublife_story)
Description i.e. "Run into a bullet to see the losing dialog".
Address
v1.50a0x425a42
Code
6a 01
push 1
Start on player's last sub-life (match mode)
(last_sublife_match)
Description i.e. "Run into a bullet to see the losing dialog".
Address
v1.50a0x41ed43
Code
b9 01000000
90 90
mov ecx, 1
nop (*2)
Enemy starts with 2 lost rounds
(enemy_fail_count)
Description Because this is supposed to reduce the AI skills a bit. And 2 just happened to be in ESI on that call.
Address
v1.50a0x41afc6
Code
8935 9c734a00
mov dword ptr ds:[4a7e9c],esi

Icon th105.png Scarlet Weather Rhapsody (th105)

Set enemy HP to 1
(hpcheat)
Address
v1.06aRx605ee, Rx5d2fa
Code
66b80100
mov ax, 1

Icon th123.png Touhou Hisoutensoku (th123)

Set enemy HP to 1
(hpcheat)
Address
v1.10aRx6be6e, Rx68fda
Code
66b80100
mov ax, 1

Icon th165.png Violet Detector (th165)

Set enemy HP to 1 (ECL ins_511)
(hpcheat_511)
Address
v1.00aRx1d153
Code
b8 01000000
90909090
mov eax, 1
nop (*4)
Set enemy HP to 1 (Enemy spawns)
(hpcheat_spawns)
Description Required for the Nightmare Week pairs that don't use ECL ins_511 to set their HP.
Address
v1.00aRx1fe6c
Code
6a 01
9090
push 1
nop (*2)
Don't require photos for clearing stages
(nophoto_clear)
Description [edi+0xd0] contains the number of photos taken.
Address
v1.00aRx46fc6
Code
31c0
8987 84000000
8987 88000000
40
8987 d0000000
48
48
8987 80000000
90
xor eax, eax
mov [edi+0x84], eax
mov [edi+0x88], eax
inc eax
mov [edi+0xd0], eax
dec eax
dec eax
mov [edi+0x80], eax
nop
Show the trophy popup even if this scorefile already has that trophy
(trophy_show_always)
Address
v1.00aRx5bbb9
Code
909090909090
nop (*6)
Unlock the trophy with the current stage ID after clearing a stage
(trophy_unlock_stagenumber)
Address
v1.00aRx2a5a3
Code
33ff
a1 
v1.00adc3a4b00
b1 32 f6f1 0fb6cc
xor edi, edi


mov eax, [stage_selected_in_menu] ; ecx = stage_selected_in_menu % 50
mov cl, 0x32
div cl
movzx ecx, ah
Use a custom scorefile name
(score_fn)
Address
v1.00aRx9d138, Rx94148
Code
736b69705f
"skip_"