~quf/no-cutscene-kiseki

3ab9828d3e7c7140d133caf06e176fb30cb1d527 — Lukas Himbert 9 months ago 36d13bd
patch more in JP binary (otherwise cutscenes will resume while fastforward is on)
5 files changed, 29 insertions(+), 8 deletions(-)

M Cargo.lock
M Cargo.toml
M README.md
M src/patch.rs
M x.gdb
M Cargo.lock => Cargo.lock +1 -1
@@ 198,7 198,7 @@ checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0"

[[package]]
name = "no-cutscene-kiseki"
version = "0.0.3"
version = "0.0.4"
dependencies = [
 "anyhow",
 "blake2",

M Cargo.toml => Cargo.toml +1 -1
@@ 1,6 1,6 @@
[package]
name = "no-cutscene-kiseki"
version = "0.0.3"
version = "0.0.4"
edition = "2021"

[profile.release]

M README.md => README.md +9 -0
@@ 11,6 11,8 @@ Cutscenes that cannot be skipped this way in the original game are not changed: 
The only currently supported version is the version 1.05 of the NISA PC port.
French and Japanese languages have not been extensively tested.

The mod is intended for speedrunning but not currently allowed on the leaderboards.

Usage
-----



@@ 23,6 25,13 @@ Usage

If your game is installed to a nonstandard location and you want to avoid manually choosing the game folder every time, you can copy the mod .exe to that game folder and it should be recognized automatically.

Known issues
------------

- When auto fast-forward is enabled (L1), the skipped cutscenes will briefly flash instead of the screen staying black.
  The flashes are likely slow enough to not trigger PSE since there tend to be ~1-2 s between flashes, but at the very least it's a bit annoying.
  In runs, the only time this is likely to happen is in the chapter 4 end sequence where that one gate scene isn't implemented as a (skippable) cutscene.

Credits
-------


M src/patch.rs => src/patch.rs +13 -1
@@ 259,12 259,24 @@ pub fn run_and_patch(path: &std::path::Path, version: ExeVersion) -> anyhow::Res
                replacement: Some(b"ToCS3 1.05 autoskip mod\0"),
            },
            Patch {
                description: "the part that resets the flag at the end of a skipped scene", // and probably at other times too because it seems we only need to patch this
                description: "the part that resets the flag at the end of a skipped scene",
                offset: 0x1403210a1,
                expected: &[0xc6, 0x83, 0x3d, 0x3d, 0x00, 0x00, 0x00],          // MOV byte ptr [RBX + 0x3d3d],0x00
                replacement: Some(&[0xc6, 0x83, 0x3d, 0x3d, 0x00, 0x00, 0x01]), // MOV byte ptr [RBX + 0x3d3d],0x01
            },
            Patch {
                description: "cutscene skip flag #2",
                offset: 0x14030acda,
                expected: &[0x48, 0xc7, 0x83, 0x3c, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], // MOV qword ptr [RBX + 0x3d3c],0x00; note that the offset is smaller by one
                replacement: Some(&[0x48, 0xc7, 0x83, 0x3c, 0x3d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00]), // MOV qword ptr [RBX + 0x3d3c],0x100
            },
            Patch {
                description: "cutscene skip flag #3",
                offset: 0x1403d5943,
                expected: &[0xc6, 0x80, 0x3d, 0x3d, 0x00, 0x00, 0x00],          // MOV byte ptr [RAX + 0x3d3d],0x00
                replacement: Some(&[0xc6, 0x80, 0x3d, 0x3d, 0x00, 0x00, 0x01]), // MOV byte ptr [RAX + 0x3d3d],0x01
            },
            Patch {
                description: "skip flag",
                offset: 0x1416af22d,
                expected: &[0x00],

M x.gdb => x.gdb +5 -5
@@ 17,8 17,8 @@ handle SIGUSR1 pass nostop noprint
#watch *(unsigned char *) 0x1416c535d
#condition 1 ((*(unsigned char *) 0x1416c535d) == 0)

#watch *0x14032a5b1 if $rbx != 0x1416c1620
#watch *0x1403dfda3 if $rax != 0x1416c1620
#break *0x14032a5b1 if $rbx != 0x1416c1620
#break *0x1403dfda3 if $rax != 0x1416c1620

## JP



@@ 36,9 36,9 @@ handle SIGUSR1 pass nostop noprint
#condition 1 ($rip != 0x1402f5a36) && ($rip != 0x1403210a8) && ($rip != 0x14030ace5) && ($rip != 0x1403d594a)

# watch cutscene skip flag setters
watch *0x1403210a1 if $rbx != 0x1416ab4f0
#watch *0x14030acda if $rbx != 0x1416ab4f0
#watch *0x1403d5943 if $rax != 0x1416ab4f0
#break *0x1403210a1 if $rbx != 0x1416ab4f0 # tested by doing a full run, never triggered
break *0x14030acda if $rbx != 0x1416ab4f0
#break *0x1403d5943 if $rax != 0x1416ab4f0


continue