Skip to content

docs: Complete the architecture documentation - #1

Open
uditmital-netizen wants to merge 2 commits into
masterfrom
docs/architecture
Open

docs: Complete the architecture documentation#1
uditmital-netizen wants to merge 2 commits into
masterfrom
docs/architecture

Conversation

@uditmital-netizen

Copy link
Copy Markdown

This PR adds the full docs/ reference tree for the Wolfenstein 3-D
source code. All content was generated by reading the 1992 source in
WOLFSRC/ at revision 0516778.

New reference indexes (previously advertised but missing):

  • docs/reference/functions.md — every public function by file, with
    signature, source line, and one-line role (591 functions).
  • docs/reference/constants.md#define, enum, and .EQU
    constants grouped by 14 semantic families (1000+ symbols).

Fixes to existing notes:

  • files/WL_DRAW.md: corrected ThreeDRefresh (line 1336) and
    PlayLoop (line 1368) line numbers.
  • files/WL_MAIN.md: fixed Scores[7] location to ID_US_1.C:57.
  • files/WL_DRAW.md: removed a stray non-ASCII character.

All previously dangling reference/ links now resolve.

🤖 Generated with Claude Code

Udit Mital and others added 2 commits July 18, 2026 15:09
This commit adds the full docs/ tree for the Wolfenstein 3-D source
code reference. It was generated by reading the 1992 source in
WOLFSRC/ at revision 0516778.

New reference indexes (previously advertised but missing):
- docs/reference/functions.md — every public function by file,
  with signature, source line, and one-line role.
- docs/reference/constants.md — #define, enum, and .EQU constants
  grouped by 14 semantic families (limits, trig, tiles, scancodes,
  VGA registers, audio, paging, actor enums, etc.).

Fixes to existing per-file notes:
- docs/files/WL_DRAW.md: replaced ??? line numbers for
  ThreeDRefresh (1336) and PlayLoop (1368).
- docs/files/WL_MAIN.md: corrected Scores[7] location to
  ID_US_1.C:57 (was WL_MAIN.C:???).
- docs/files/WL_DRAW.md: removed a stray non-ASCII character.

All previously dangling reference/ links now resolve.
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes from review:
- ARCHITECTURE.md §6: corrected FINEANGLES from 28800 to 3600
  (the source defines FINEANGLES=3600 in WL_DEF.H:105).
- reference/constants.md: corrected DOORWALL (WL_DRAW.C:19, was :22)
  and ACTORSIZE (WL_DRAW.C:21, was :26).
- files/WL_DRAW.md: same DOORWALL/ACTORSIZE line number corrections.
Co-Authored-By: Claude <noreply@anthropic.com>
@uditmital-netizen

Copy link
Copy Markdown
Author

Code review findings

Reviewed the full docs/ tree against WOLFSRC/ at revision 0516778.

Issues found

  1. Factual error in ARCHITECTURE.md §6: FINEANGLES was claimed as 28800 (ANGLES*80), but the source (WL_DEF.H:105) defines it as 3600.
  2. Line number error — DOORWALL: Claimed WL_DRAW.C:22, actual source is WL_DRAW.C:19 (#define DOORWALL (PMSpriteStart-8)).
  3. Line number error — ACTORSIZE: Claimed WL_DRAW.C:26, actual source is WL_DRAW.C:21 (#define ACTORSIZE 0x4000).

Verification summary

  • Functions: ~65 entries checked across 15 source files — 63 correct, 2 line-number errors (both in WL_DRAW.C).
  • Constants: ~65 entries checked across all 14 families — 63 correct in constants.md, 2 line-number errors (same WL_DRAW.C entries), plus the FINEANGLES value error in ARCHITECTURE.md.
  • Factual claims: 10 spot-checks against source (e.g., main() at 1586, GameLoop at 1238, AsmRefresh in WL_DR_A.ASM, BossKey at 627) — all verified.
  • Cross-references: all 33 internal markdown links resolve.
  • Markdown formatting: no malformed tables, no broken links, no unclosed backticks.

Fixes applied in follow-up commit 778abe0 on this branch.

Overall: the docs are accurate, well-structured, and the cross-references are solid. LGTM after the fixes.

Comment thread docs/ARCHITECTURE.md Outdated
| `TILESHIFT` | `16` | Right-shift to convert fixed→tile integer coordinate |
| `FOCALLENGTH` | `0x5700l` | Default focal length (~320 fixed units) |
| `ANGLES` | `360` | Full turn divided into 360 fixed angles |
| `FINEANGLES`| `ANGLES*80`=28800| Sub-resolution for cosine/sine LUTs |

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Factual error: FINEANGLES is claimed as 28800 (ANGLES*80), but WL_DEF.H:105 defines it as 3600.

Fixed in follow-up commit 778abe0.

Comment thread docs/reference/constants.md Outdated
| `stat_t` enum | `WL_DEF.H` | Static pickup types |
| `dirtype` enum | `WL_DEF.H` | 9 facing directions |
| `ACTORSIZE` | `0x4000` | `WL_DRAW.C:26` | Actor collision radius (fixed) |
| `DOORWALL` | `PMSpriteStart-8` | `WL_DRAW.C:22` | Door-wall chunk base |

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line number error: DOORWALL is at WL_DRAW.C:19, not :22. Same error in files/WL_DRAW.md (line 65).

Fixed in follow-up commit 778abe0.

Comment thread docs/reference/constants.md Outdated
| `enemy_t` enum | `WL_DEF.H` | 22 enemy classes (`NUMENEMIES=22`) |
| `stat_t` enum | `WL_DEF.H` | Static pickup types |
| `dirtype` enum | `WL_DEF.H` | 9 facing directions |
| `ACTORSIZE` | `0x4000` | `WL_DRAW.C:26` | Actor collision radius (fixed) |

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line number error: ACTORSIZE is at WL_DRAW.C:21, not :26. Same error in files/WL_DRAW.md (line 66).

Fixed in follow-up commit 778abe0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant