Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ uv run python tools\check_exports.py bin\Release\dinput8.dll # exports, image b
do not disable it. If you run MSBuild yourself, pass `/p:PlatformToolset=v145` and
`/p:PostBuildEventUseInBuild=false`.
- `build.ps1` fails on unformatted sources: run `.\scripts\format.ps1` first.
- `sitecheck.py` and the emulator tests need your own unpacked game executable and skip without it; say so in
the pull request. Never commit it.
- `sitecheck.py` and the emulator tests need your own unpacked game executable. The emulator tests skip without it;
`sitecheck.py` cannot run without it. Say so in the pull request. Never commit it.
- Docs-only changes: check that every relative link resolves (`mkdocs build --strict` does, see
[docs/agents/docs-and-testing.md](docs/agents/docs-and-testing.md)).

Expand Down
2 changes: 1 addition & 1 deletion data/chord-diagrams/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Generate from the offline patcher output (`tools/gfxpatch`):

```powershell
# From the repository root; reads the Desktop copies, writes data only in this checkout.
uv run python tools\diagram_patch.py
uv run python tools\diagram_patch.py --edited "$env:USERPROFILE\Desktop\rocksmith-assets\edited\gfx"
```

The generator never edits the patcher folder (`tools\gfxpatch`). Its `--original` and
Expand Down
2 changes: 1 addition & 1 deletion docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ attaches the zip, checksums and notes.
Requirements and failure handling:

- The commit must already exist on GitHub, and `origin` and `gh` must refer to the intended repository.
- If GitHub publication fails after tagging, the local tag remains. Inspect the failure and the
- If GitHub publication fails after tagging, the script deletes the local tag again. Inspect the failure and the
local/remote state before retrying.
- The script refuses existing tags and does not overwrite an existing release.

Expand Down
7 changes: 4 additions & 3 deletions docs/architecture/05-rendering-the-extra-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ RSMods (`rs7rsmods::Present`) and V6 is on, the SetTexture hook gives each such
256x128 A8R8G8B8 MANAGED, rows 7 and 15 grey) its own copy with the V6 lines repainted, with the same
build and self-check (any failure: RSMods' texture stays bound), hides it from `GetTexture` and holds a
reference on the source (a rebuilt RSMods texture is a new address; at most 8 cached). A colour change
rebuilds them at the next bind. Limit: more than 32 distinct RSMods ramps (e.g. rainbow notes) turn this
rebuilds them at the next bind. Limit: more than 32 distinct RSMods ramps within ten seconds (e.g. rainbow notes) turn this
path off for the session; string 6 then shows RSMods' row again.

### Source files
Expand Down Expand Up @@ -150,8 +150,9 @@ the ghost string, `ghost_up_NN`, is CLGU/CLGE) and the chord pluck PL1 reach the
## Fret bars

In `src/features/frets/` (F1 `0x58FB20`), on a guitar built with 7/8 strings every bar (and
the nut) moves half a string spacing towards string 6 and is scaled uniformly by
`k = (L + d/2)/L` with L = 4.61 (`rs7frets::kDefaultHalfLen`, the mesh's half length); measured d 1.6079,
the nut) covers the extra lanes: one for seven strings, two for eight (`rs7frets::Compute` takes the shift and
scale from the real lane positions). For seven strings it moves half a string spacing towards string 6 and is
scaled uniformly by `k = (L + d/2)/L` with L = 4.61 (`rs7frets::kDefaultHalfLen`, the mesh's half length); measured d 1.6079,
k 1.1744. Bars are about 17 % thicker. Locators and span data are never written. Chord frames
(B1 `0x7A2BCA`, B2 `0x7A91E4`) get a string-axis scale and shift from the guitar's lane positions; on 7/8-string
guitars they always reach the last string, like the extended bass's.
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/09-chord-diagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ flowchart TD
serializers. From the native T8 record they add `LowBFret/LowB_Finger/LowB_Color` (string 7) and
`LowFsFret/LowFs_Finger/LowFs_Color` (string 8), with colours `0x808080` and a provisional
`0x00FFFF`, and recompute the fret window over all N strings (`src/features/diagrams/diagrams.cpp`).
- TP13 `0x7578BC` routes the loaded-song template lookup through `Rs7Ns_TplRecord`.
- TP13 `0x7578BC` routes the loaded-song template lookup through `Rs7Ns_FindTplRecord`; a lookup miss keeps the stock pointer.
- DGB `0x55A02C` binds PostProcess's UUID-selected attributes to the exact SNG song.
- Six-string and bass shapes get no extra keys.
- Not covered (stock output): generic database chords, catalogue songs whose SNG is not loaded,
Expand Down
3 changes: 2 additions & 1 deletion docs/architecture/13-known-limitations-and-open-risks.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ Part of the [rs7string architecture](../ARCHITECTURE.md).
| Settings and input | Overlay editing narrows text to ASCII. Table settings fail closed; a few debug switches read directly treat any nonzero value as on (documented). While the overlay uses the mouse or keyboard, that input is masked from the game ([chapter 11](11-window-input-overlay-logging.md)). |
| Tuner and UI | Names are English only; filter and sort use six-string offsets. A rare `GridBuild` timeout keeps the neck marked failed until a six-string selection. |
| Verification | Overlay device Reset is unit-tested but had not been hit in game. Real-guitar bends, slides and harmonics on string 6 and chord techniques still need a final check. |
| Player-visible limits | The three limits listed for players in the [changelog](../release/CHANGELOG.md#known-limits): the co-op low B colours, the song length in the co-op arrangement list, and a Riff Repeater tail colour on six-string bass. |
| Very low tunings | Some subharmonic-table reads below MIDI 22 are unchecked; see below. Open strings below G0 are undetectable. |

## Settings outside the documented range

Settings in the settings tables fail closed (`src/platform/settings.cpp`, `Rs7Config_ReadInt`): a `Bool` or `Int`
Settings in the settings tables fail closed (`src/platform/settings.cpp`, with `Rs7Config_ReadInt` from `src/platform/config.cpp`): a `Bool` or `Int`
value that is not an integer or lies outside its range reads as 0 (off) and is logged; an invalid `Float`, `Text` or
colour value uses the row's default. The remaining direct `GetPrivateProfileIntW` reads are debug and diagnostic keys
(`[debug] veh_log`, `spin_probe`, `publish_trace`, `log_redact`, `[window] console_quickedit_off`, where any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Builders create per-site entries that jump to shared MASM thunks. Native tests,
<summary><b>Source and implementation evidence</b></summary>

The per-site entries are emitted at runtime by `Rs7Mid_Build`, `Rs7Mid_BuildLight` and `Rs7Mid_BuildCall`
(`midhook.cpp`). The two shared thunks they jump to, `Rs7Mid_Thunk` and `Rs7Mid_ThunkLight`, are one MASM file,
(`midhook.cpp`). The three shared thunks they jump to, `Rs7Mid_Thunk`, `Rs7Mid_ThunkLight` and `Rs7Mid_ThunkSse`, are one MASM file,
`src/platform/midhook_thunks.asm` (ml.exe, wired into `rs7string.vcxproj` and `tests/rs7string_tests.vcxproj`
through the `masm` build customisation, exported with `PROC EXPORT`), not inline `__asm`; the WOW64 syscall of
`Rs7_Protect` is `src/platform/protect_syscall.asm` the same way, so `src/platform/` has no inline assembly. Why a
Expand Down Expand Up @@ -420,7 +420,7 @@ A `jmp_atomic8` site is installed with one locked qword exchange, because the co
A `jmp_atomic8` site is a 5-byte jmp inside one aligned qword, written with one locked exchange
(the code may run on another thread while it is patched). A mid-hook is prepared for it as for a `jmp` site, with the
whole `expect` span as the replay (the jmp ends inside an instruction, which the relocator would reject), and startup
writes the entry with the same locked exchange (`PrepareMid` / `Apply` in `startup.cpp`; one condition more). S3 and
writes the entry with the same locked exchange (`Rs7_PrepareMid` in `platform/hooktable.cpp`, called and applied from `startup_sites.cpp`; one condition more). S3 and
PT1 (the guitar / bass exits `mov [eax+1356h],cx|dx; ret` of `Play_Detector_SetTuning`, cold) are the first: the
callback does the store itself, calls the helper, which sees the finished detector as before, and returns for the
function (`Rs7Mid::Ret`); the old stubs left the helper's flags at the return, where no one reads them (contract
Expand Down
9 changes: 5 additions & 4 deletions docs/architecture/15-source-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ Most features patch different game code and can
live in their own folder with their sites, hooks, logic, settings and tests (a vertical slice). The seven-string
features are not independent, though: they share one model of the instrument (string count, tunings, the
7-string unit that fails as a whole, [chapter 3](03-the-string-count-model.md)). That model is a layer of its own (`src/model/`), next to the
platform (`src/platform/`: patching, resolve, mid-hook, protection, log, config), so no feature duplicates it and
no feature reaches into another.
platform (`src/platform/`: patching, resolve, mid-hook, protection, log, config), so no feature duplicates it. A
feature may include another feature's public header (`features/<name>/<name>.h`), never its internal ones;
`tools/check_layout.py` checks this.

```
src/
Expand Down Expand Up @@ -62,7 +63,7 @@ feature's hook rows are its own table (`registration.cpp`), and `src/registry.cp
ranges), tuning, stringcolour, extblock (RS7X), status (overlay status board), groups (`Rs7Feature`,
`Rs7_Group`, the 7-string unit).
- `features/`: allocstats, arrangements, bass, chords, clite, colours, diag, diagrams, extras, fretgrid, frets,
headstock, nextgrid, nslot, pitch, psarc, publish, scene, songend, spacing, string7, strings, testdrive, tuner,
headstock, menuload, nextgrid, nslot, pitch, psarc, publish, scene, songend, spacing, string7, strings, testdrive, tuner,
window. Each has its hook table(s) and settings table where it needs them; its tests are in `tests/<name>/`.
`extras` holds the no-op hooks the public build uses for the private-only features. Every hook row lives in its feature; a group is its table's group (data references are
Core), so `Rs7_FeatureOf` has no id or flag rules.
Expand Down Expand Up @@ -168,7 +169,7 @@ generator; it is not written per site. The mid-hook covers:
- plain sites, with a relocator that also accepts the operand-size prefix `66` and the `INC` / `DEC r/m8` forms;
- call sites, with the callback before or after the callee (`Rs7Mid::Call::Before` / `After`);
- wrappers that see the callee's arguments (`Rs7Mid::Call::Wrap`, `src/platform/midhook_wrap.cpp`);
- hot sites, through the light mode (about 25 ns instead of 150 ns per hit, no floating-point save, all GPRs kept so
- hot sites, through the light mode (about 50 ns instead of 240 ns per hit with the fault guard, no floating-point save, all GPRs kept so
the `Context` stays identical) and the sse mode. Measure one hot site in game before converting hot sites.

The naked stubs that remain need a custom calling convention or call the game with register arguments.
Expand Down
9 changes: 5 additions & 4 deletions docs/release/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ very low tunings without workarounds. It also fixes the game getting stuck on th
five- or six-string bass, and each player's notes, tuner and scoring follow their own arrangement.
- **Low tunings without workarounds.** The game now listens as low as the lowest open string of the song's tuning,
for bass and guitar. A five-string bass in A standard or drop G, or an eight-string guitar tuned down to B, no
longer needs the A220 reference pitch trick or a separate low tuning fix. Songs in standard tunings are unchanged.
longer needs the A220 reference pitch trick or a separate low tuning fix. The lowest open string that can be
detected is G0. Songs in standard tunings are unchanged.
- **String spacing.** You can set how far apart the strings are for each extended instrument, for example to make a
six-string bass as narrow as a four-string one. See `[neck] spacing_bass5`, `spacing_bass6`, `spacing_guitar7`
and `spacing_guitar8` in the [settings](SETTINGS.md); `0`, the default, keeps the normal spacing.
Expand All @@ -40,8 +41,8 @@ very low tunings without workarounds. It also fixes the game getting stuck on th

### Changes

- **The game keeps running if the mod hits a problem.** If a part of rs7string runs into an error while you play,
that part is switched off instead of crashing the game, and `rs7string.log` gets a line starting with
- **The game keeps running if the mod hits a problem.** If a step of rs7string runs into an error while you play,
that step is skipped instead of crashing the game, and `rs7string.log` gets a line starting with
`hook fault:`. Please include that line in bug reports.
- **Fewer settings.** Settings that only changed internal values are gone, and the `rs7string.ini` in the release
no longer lists developer and test keys. An old `rs7string.ini` still loads; the log names each key that is no
Expand Down Expand Up @@ -91,7 +92,7 @@ Colours and other mods:
Headstocks:

- Headstock models built from your game files are rebuilt once when a new rs7string version ships a changed
headstock. A model file you set yourself in `rs7string.ini` is never touched.
headstock. A model file of your own that you set in `rs7string.ini` is never touched.
- An incomplete headstock build is repaired on the next start.

Stability:
Expand Down
10 changes: 6 additions & 4 deletions docs/release/CHART-TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ are in the [RS7X spec](RS7X-SPEC.md). For eight strings add index 7 in the same

## 5. Manifest and HSAN

In the arrangement manifest JSON and in the HSAN, every `Tuning` object keeps `string0` to `string5` and
gets **`Rs7String6`** (spelt exactly like this) with the same value as the SNG's seventh entry:
In the arrangement manifest JSON and in the HSAN, every `Tuning` object keeps `string0` to `string5`. A
seven-string guitar gets **`Rs7String6`** (spelt exactly like this) with the same value as the SNG's seventh entry:

```json
"Tuning": {
Expand Down Expand Up @@ -194,8 +194,10 @@ Other manifest fields (arrangement properties, tones, the tuning name text) need

## 7. Reading packages back

A tool that imports packages (SNG to XML) should read the block, so a seven-string package opens with its
seventh string:
A tool that imports packages (SNG to XML) should read the block, so an extended package opens with its extra
strings. The steps below are for a seven-string guitar. An eight-string guitar has a second column (string 7) in
`CHDT` and `CHNT` and eight tuning entries. A bass block has `STRS` only: it says five or six strings, and the
notes, chords and tuning of strings 4 and 5 are in the stock data.

1. Read the stock sections as usual. If the body has bytes left after MetaData, check them against the
validation rules in [RS7X spec section 3](RS7X-SPEC.md#3-validation-rules). On any failure, treat the
Expand Down
2 changes: 1 addition & 1 deletion docs/release/CHARTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Six-string guitar and four-string bass charts get none of this: no extra keys an
| String numbering | Keep the stock strings as they are. Guitar: 0-5 are low E, A, D, G, B, high E; the low B is **index 6** and the eighth string (low F#) **index 7**. Bass: 0-3 are E, A, D, G; the low B is **index 4** and the high C **index 5**. Never shift existing string numbers. |
| Pitch | Open pitch of a string is its open MIDI note (table above) **+ its tuning offset**; add the fret for fretted notes. Tuning offsets are semitones. |
| SNG tuning | Guitar: the MetaData tuning has **exactly one entry per string**, seven or eight. B standard is `[0, 0, 0, 0, 0, 0, 0]`; Drop A changes only entry 6 to `-2`. Bass: **six entries**, as in a stock bass chart; entry 4 is the low B offset and entry 5 the high C offset. |
| Manifest and HSAN | Every `Tuning` object keeps `string0` to `string5`. **Guitar:** add `Rs7String6` (and `Rs7String7`) with the offsets of the low B (and low F#), the same values as SNG entries 6 (and 7). **Bass:** the offsets are in `string4` (low B) and `string5` (high C), as in the SNG; add `Rs7String4` (and `Rs7String5`) with the same values. On bass these keys only say how many strings there are: one more string per key. |
| Manifest and HSAN | Every `Tuning` object keeps `string0` to `string5`. **Guitar:** add `Rs7String6` (and `Rs7String7`) with the offsets of the low B (and low F#), the same values as SNG entries 6 (and 7). **Bass:** the offsets are in `string4` (low B) and `string5` (high C), as in the SNG; add `Rs7String4` (and `Rs7String5`) with the same values. On bass these keys only say how many strings there are: one more string per key. Every key holds a whole number of semitones from -24 to 24; a key with another value is ignored. |
| RS7X block | Append it after MetaData inside the SNG body. Guitar: `STRS`, `CHDT` and `CHNT`, even with no chords. Bass: `STRS` only, which marks the arrangement as five- or six-string. See [Chords](#chords) and the [specification](RS7X-SPEC.md). |
| Single notes | Ordinary note records with the extra string's index (`string=6` or `7` on guitar, `string=4` or `5` on bass). No extra data is needed. |
| Section masks | Set the extra strings' bits in `StringMask` for sections that use them, chords included: guitar bit 6 (and bit 7 on eight strings), bass bits 4 and 5. The game also adds missing bits itself when the song loads. |
Expand Down
Loading
Loading