init commit
This commit is contained in:
commit
5212f07e78
5 changed files with 76 additions and 0 deletions
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
build/
|
||||||
|
build-*/
|
||||||
|
*.dll
|
||||||
|
*.exe
|
||||||
|
*.log
|
||||||
|
__pycache__/
|
||||||
|
.cache/
|
||||||
14
CONTRIBUTING.md
Normal file
14
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
# Contributing — clean-room rules
|
||||||
|
|
||||||
|
This tree must stay publishable as engine code only. Never commit:
|
||||||
|
- game data in any form: `.gob` contents, extracted catalogs, saves, textures, strings dumps;
|
||||||
|
- the original binaries, or anything derived from them by a decompiler/disassembler
|
||||||
|
(no decompiler output, no disassembly excerpts, no pasted pseudo-code — not even in comments);
|
||||||
|
- copied fixture files from the game. Test fixtures are hand-written minimal samples.
|
||||||
|
|
||||||
|
Facts *about* the binary (addresses, calling conventions, prototypes, struct layouts) enter this
|
||||||
|
repo only through `include/generated/sots_addresses.h`, which is generated from the RE repo with a
|
||||||
|
provenance header. Everything else is written from understanding, in our own words and code.
|
||||||
|
|
||||||
|
Real-data tests read `$SOTS_DATA_DIR` (the owner's installed copy) and must skip cleanly when unset.
|
||||||
|
Run `tools/clean_room_check.sh` before committing.
|
||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Alex Camilo
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
23
README.md
Normal file
23
README.md
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# sots-engine
|
||||||
|
|
||||||
|
A from-scratch, functional reimplementation of the engine behind **Sword of the Stars (2006)**.
|
||||||
|
Not a byte-for-byte decompilation: behavior-equivalent code, built up one verified piece at a time
|
||||||
|
(OpenRCT2-style) until the tree can build the whole application on its own.
|
||||||
|
|
||||||
|
**Bring your own game.** This repository contains engine code only. Game data, assets, saves, and
|
||||||
|
the original binaries are never included; tests and tools read an owner-supplied copy via
|
||||||
|
`$SOTS_DATA_DIR`. See `CONTRIBUTING.md` for the clean-room rules.
|
||||||
|
|
||||||
|
## Status
|
||||||
|
Phase 2 / M0 — the shim frontend (`src/shim/`): a proxy DLL the original game loads, used to
|
||||||
|
verify each reimplemented function against the original before it displaces it. Engine code
|
||||||
|
accrues under `src/mars/` (engine) and `src/game/` (game logic) as milestones land.
|
||||||
|
|
||||||
|
## Layout (grows with the work)
|
||||||
|
- `src/shim/` — binkw32 proxy + hooks + old-vs-new compare harness (frontend #1)
|
||||||
|
- `src/mars/`, `src/game/` — the engine and game reimplementation (accruing)
|
||||||
|
- `include/generated/sots_addresses.h` — binary facts (RVAs/prototypes), generated from the RE repo
|
||||||
|
- `tests/` — host tests; real-data tests skip unless `$SOTS_DATA_DIR` is set
|
||||||
|
- `tools/` — build (MinGW i686 cross) and deploy scripts
|
||||||
|
|
||||||
|
Planning, findings, and verification evidence are tracked in the private RE repo (`sots-re`).
|
||||||
11
tools/clean_room_check.sh
Executable file
11
tools/clean_room_check.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Refuse forbidden artifacts: game data, saves, binaries, decompiler output markers.
|
||||||
|
set -e; cd "$(dirname "$0")/.."
|
||||||
|
bad=0
|
||||||
|
while IFS= read -r f; do
|
||||||
|
case "$f" in *.gob|*.sav|*.tga|*.dds|*.X|*.wav) echo "forbidden asset: $f"; bad=1;; esac
|
||||||
|
done < <(git ls-files)
|
||||||
|
if git grep -nE 'FUN_[0-9a-f]{8}|undefined[0-9]? \*|\bDAT_[0-9a-f]{8}\b|__thiscall +FUN_' -- ':!include/generated/*' ':!tools/clean_room_check.sh' >/dev/null 2>&1; then
|
||||||
|
echo "decompiler-style identifiers found outside include/generated/:"; git grep -nE 'FUN_[0-9a-f]{8}|\bDAT_[0-9a-f]{8}\b' -- ':!include/generated/*' ':!tools/clean_room_check.sh' | head; bad=1
|
||||||
|
fi
|
||||||
|
[ $bad -eq 0 ] && echo "clean-room check: OK"; exit $bad
|
||||||
Loading…
Add table
Reference in a new issue