Enable the OFFSET annotation gate; document one OFFSET per FUNCTION line

Main is clean (07897c8b): every FUNCTION line has its address right
above it. offsetAnnotations makes the submission gate keep it that way.
CODING_RULES section 2: OFFSET goes on the line directly above each
FUNCTION line, never without one, with no blank line in the block;
several IDs on one body only for template instances.
This commit is contained in:
ragnarok-clanker 2026-11-04 22:30:27 +01:00
commit fa09e99ba9
2 changed files with 16 additions and 3 deletions

View file

@ -27,9 +27,21 @@ void Player::Update(float dt) {
}
```
- `// OFFSET: 0x...` is mandatory on every standalone `// FUNCTION:` definition: one line per stacked ID, placed above
the `FUNCTION` lines, with the address `td symbol <id>` reports (eight uppercase hex digits). Never type an address
from memory or a decompiler listing that disagrees with the symbol database.
- `// OFFSET: 0x...` is mandatory on every standalone `// FUNCTION:` line, on the line directly above it, with the
address `td symbol <id>` reports (eight uppercase hex digits). Never type an address from memory or a decompiler
listing that disagrees with the symbol database. An `OFFSET` line always has its `FUNCTION` line right below it,
and no blank line separates the annotations from the definition. The submission gate checks this.
- Several IDs stack on one definition only for template instances: each `FUNCTION` line keeps its own `OFFSET`
line above it. Two non-template functions with identical bytes are two source functions; one often only calls
the other, which the compiler inlined.
```cpp
// OFFSET: 0x009C2A50
// FUNCTION: fn_13995
// OFFSET: 0x009C2B20
// FUNCTION: fn_13996
template <class T, class D> void CUIListBoxEx<T, D>::Slot15(int width, int height) {
```
- `FUNCTION`/`GLOBAL`/`STRING`/`VTABLE` annotations contain IDs, never addresses; the symbol database stays
authoritative. Preserve existing `// STATIC: 0x...` provenance for data. Inline-only functions must not carry
`OFFSET` provenance.

View file

@ -12,6 +12,7 @@
],
"toolchain": "ragnarok",
"globalRules": true,
"offsetAnnotations": true,
"encodedLiterals": [
{ "macro": "CRYPT_NAME", "kind": "xor-repeating-key", "keyBytes": 8, "includeTerminator": true }
],