The port is complete, so the C sources and their build system
(autoconf/automake inputs, Makefiles, Visual Studio project, doc
templates, RPM spec, C build/modernization notes) leave this branch;
they live on in master/modern-rogue for reference.
Also ports the last missing wizard command (things.c pr_list/pr_spec,
the '*' item-probability listing), rewrites README.md for the Go port,
and updates ARCHITECTURE.md's layout notes (game/ has no third-party
imports; tcell lives in term/).
Kept: LICENSE.TXT, rogue.png, rogue.desktop, ARCHITECTURE.md.
- command.c in full: the command dispatcher with repeat counts, run
prefixes, ctrl-run door-stop mode, fight-to-death targeting, and all
wizard debug commands; search, help, identify, d_level/u_level, call,
current
- main.c completed: Run()/playit() with the C double ROGUEOPTS parse;
exit()-anywhere becomes a gameEnd panic recovered in Run
- save.c + state.c: gob SaveState snapshot with explicit pointer-to-
index fixups for equipment, monster rooms, and chase targets (the
rs_fix_thing role); save file deleted on restore as in C; SIGHUP/
SIGTERM autosave hook
- wizard.c completed (create_obj, show_map), passages.c add_pass
- term/: tcell/v2 Terminal — the one third-party dependency — replacing
curses and mdport's 900-line key decoder; shell escape via suspend
- cmd/rogue: flags -s/-d, SEED (wizard), ROGUEOPTS, ROGUE_WIZARD
Tests: full scripted sessions through Run (quit, descend stairs,
3200-move crash sweep, save-command round trip). Notable fixes found
by tests: gob silently drops embedded fields of unexported types, and
--More-- prompts swallow space-free input scripts.
- potions.c completed: quaff with all 14 potion effects, the PACT
standard-fuse table (do_pot), raise_level; the see-invisible fruit-
juice message is computed at quaff time as in C
- scrolls.c in full: read_scroll with all 18 scroll effects including
the magic-mapping map rewrite and identify dispatch, uncurse
- options.c in full: the interactive options screen, get_bool/get_str/
get_inv_t/get_sf editors, ROGUEOPTS parsing (prefix matching, no-
prefixed booleans, ~ expansion), strucpy
- misc.c call_it via the get_str line editor
- turn_see gets a DaemonID (C casts it to a fuse callback for the
monster-detection potion)
Tests: healing/confusion potions with fuse burn-down, enchant armor,
hold monster, slow-monster zap, ROGUEOPTS parsing, and a regression
test documenting the C wake_monster ISGREED/ISHELD quirk the port
keeps faithfully.
rooms.c, passages.c, new_level.c ported in full: room/maze layout,
corridor spanning tree with extra connections, passage numbering flood
fill, trap/stairs/object placement, treasure rooms. Careful RNG-call
ordering throughout keeps generation seed-faithful to C.
Supporting subsystems this depends on, also ported:
- screen.go: curses replaced by in-memory Window cell buffers behind a
Terminal interface (tcell arrives with the UI phase; tests run headless)
- io.go: msg/addmsg/endmsg message-line protocol, status line, step_ok
- pack.c in full (add_pack sorting/stacking walk, get_item, inventory)
- things.c in full (inv_name, new_thing, discovery lists, pagination)
- monsters.c in full; chase.c navigation half (roomin/cansee/see_monst/
find_dest/runto/set_oldch); rings.c, armor.c in full
- weapons.c/sticks.c creation half (init_weapon, fix_stick, num)
- misc.c look() display update, eat, level-up, direction input
- daemons.c callbacks except stomach (needs death()) and the runners
chase driver (combat phase)
- init.c init_player with the starting kit
Tests: level invariants across seeds, determinism, 30-depth sweep.
Module sneak.berlin/go/rogue, package game:
- types.go: all rogue.h constants, flag types, Coord/Stats/Room/ObjInfo
- creature.go/object.go: the THING union split into Creature (Player/
Monster) and Object; slices replace the C linked lists
- level.go: Place map with the C column-major layout and chat/flat/moat/
winat access methods
- tables.go: extern.c + init.c data (bestiary, item tables, name pools)
- rng.go: the exact C LCG (seed*11109+13849), golden-tested against a
compiled C reference for seed compatibility
- init.go: per-game item appearance randomization (init.c)
- daemon.go/daemons.go: scheduler with DaemonID replacing function
pointers (ids match the C save format's mapping)
- game.go: RogueGame holds all former globals; NewGame constructor
Design for the Go port (module sneak.berlin/go/rogue):
- RogueGame instance type owns all former globals; no package globals
- THING union split into Creature (Player/Monster) and Object
- Slices replace THING linked lists; list.c is not ported
- Daemon function pointers become serializable DaemonID enum + dispatch
- tcell/v2 (sole third-party dep) replaces curses; Window cell buffers
preserve the screen-as-data-structure idiom
- encoding/gob snapshot replaces the 2,134-line state.c serializer
- Exact-LCG RNG for seed-compatible dungeon generation, with golden tests
- Per-file porting map, naming conventions, porting order, drop list
Documents the entire Rogue 5.4.4 C codebase ahead of the Go port:
program flow, source file inventory, the full type system (THING
union, PLACE map, rooms, stats, obj_info, daemons), constants and
flag bits, the macro layer, a census of every global variable, and
a function-by-function catalog of all 36 source files.
- Reorganize Prerequisites section with numbered items for clarity
- Emphasize that ncurses development package is required (not just runtime)
- Update package names: add libncurses-dev for modern Debian/Ubuntu
- Add Fedora-specific instructions using dnf
- Add 'Before you begin' note in Quick Start section
- Improve troubleshooting section with clearer explanations
- Enhance platform-specific notes for macOS Homebrew
- Update date from placeholder to 2025-11-07 in MODERNIZATION_LOG.md
- Mark function prototype warnings as fixed in pending issues
- Remove trailing whitespace in daemon.c, rogue.h, state.c
- Clean up formatting in MODERNIZATION_LOG.md
- Remove direct access to curscr->_cury and curscr->_curx
- Replace with public API call move() for cursor positioning
- Fixes critical build failure on modern systems with ncurses 6.x
- Build now succeeds on macOS arm64
See MODERNIZATION_LOG.md for detailed reasoning and impact analysis.
- Add note in Quick Start section about build issues
- Add reference at top of Troubleshooting section
- Add specific entry for ncurses compatibility error in Build Issues
- Critical compilation error: direct access to internal ncurses structure members
- Code compatibility issue with modern ncurses (curscr->_cury, curscr->_curx)
- Affects both standard and manual build methods
- Documented on macOS (darwin 25.0.0, Apple Silicon)
- Fix Project Structure section (remove incorrect directory structure)
- Add missing prerequisites (make, m4) with installation instructions
- Clarify when autoreconf is needed vs when configure exists
- Improve Windows build instructions with detailed PDCurses setup
- Add optional documentation tools section
- Enhance troubleshooting with additional common issues
- Add notes about documentation adaptation and executable name variations
- Improve macOS Homebrew instructions for both Intel and Apple Silicon
- Add platform-specific build notes and alternatives