Skip to content

Commit fcd5783

Browse files
committed
Fix GitHub Pages Freedoom web build
1 parent e268545 commit fcd5783

5 files changed

Lines changed: 78 additions & 13 deletions

File tree

.github/workflows/build.yml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ permissions:
1515

1616
env:
1717
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
18+
PAGES_DOOM_IWAD: .tools/assets/freedoom-0.13.0.zip
19+
PAGES_DOOM_CROM_FILE_BYTES: "2097152"
1820

1921
concurrency:
2022
group: pages-${{ github.ref }}
@@ -85,6 +87,42 @@ jobs:
8587
path: dist/asm-rom/*
8688
if-no-files-found: error
8789

90+
pages-rom:
91+
name: GitHub Pages Freedoom ROM
92+
runs-on: ubuntu-24.04
93+
if: github.event_name != 'pull_request'
94+
steps:
95+
- name: Checkout
96+
uses: actions/checkout@v4
97+
98+
- name: Install ngdevkit
99+
run: |
100+
sudo apt-get update
101+
sudo apt-get install -y software-properties-common curl zip imagemagick sox libsox-fmt-mp3 python3-pil python3-ruamel.yaml
102+
sudo add-apt-repository -y ppa:dciabrin/ngdevkit
103+
sudo apt-get update
104+
sudo apt-get install -y ngdevkit ngdevkit-gngeo
105+
106+
- name: Download Freedoom IWAD
107+
run: make "${PAGES_DOOM_IWAD}"
108+
109+
- name: Build web-safe Freedoom ROM
110+
run: |
111+
make cart bios \
112+
TOOLS_PREFIX=/usr \
113+
DOOM_IWAD="${PAGES_DOOM_IWAD}" \
114+
DOOM_CROM_FILE_BYTES="${PAGES_DOOM_CROM_FILE_BYTES}"
115+
116+
- name: Collect Pages ROM artifacts
117+
run: python3 tools/doomgeo_build.py package --out dist/pages-rom
118+
119+
- name: Upload Pages ROM
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: doomgeo-aes-pages-rom
123+
path: dist/pages-rom/*
124+
if-no-files-found: error
125+
88126
helpers:
89127
name: Standalone helpers (${{ matrix.os }})
90128
strategy:
@@ -187,6 +225,7 @@ jobs:
187225
runs-on: ubuntu-24.04
188226
needs:
189227
- rom
228+
- pages-rom
190229
- asm-rom
191230
if: github.event_name != 'pull_request'
192231
environment:
@@ -196,11 +235,11 @@ jobs:
196235
- name: Checkout
197236
uses: actions/checkout@v4
198237

199-
- name: Download ROM artifact
238+
- name: Download Pages ROM artifact
200239
uses: actions/download-artifact@v4
201240
with:
202-
name: doomgeo-aes-rom
203-
path: dist/rom
241+
name: doomgeo-aes-pages-rom
242+
path: dist/pages-rom
204243

205244
- name: Download ASM ROM artifact
206245
uses: actions/download-artifact@v4
@@ -209,7 +248,7 @@ jobs:
209248
path: dist/asm-rom
210249

211250
- name: Build Pages bundle
212-
run: python3 tools/doomgeo_build.py pages --rom dist/rom/doomgeo-aes.zip --bios dist/rom/neogeo.zip --asm-rom dist/asm-rom/doomgeo-aes-asm.zip --out dist/pages
251+
run: python3 tools/doomgeo_build.py pages --rom dist/pages-rom/doomgeo-aes.zip --bios dist/pages-rom/neogeo.zip --asm-rom dist/asm-rom/doomgeo-aes-asm.zip --out dist/pages
213252

214253
- name: Verify FBNeo web package CRCs
215254
run: |

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ python3 tools/inspect_map_specials.py --map E1M2
188188
```
189189

190190
You must provide your own Neo Geo BIOS for local emulation. The browser package
191-
uses an FBNeo-compatible packaging path, but that does not rename the project:
192-
`DoomGeo-AES` is the game name; `puzzledp` is only the private FBNeo driver/chip
193-
identity used so the arcade core accepts the generated homebrew ROM zip.
191+
uses a separate Freedoom-based ROM and an FBNeo-compatible packaging path, but
192+
that does not rename the project: `DoomGeo-AES` is the game name; `puzzledp` is
193+
only the private FBNeo driver/chip identity used so the arcade core accepts the
194+
generated homebrew ROM zip.
194195

195196
## Documentation
196197

docs/build-packaging.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Both are plain Python scripts under `tools/` and are packaged as standalone
99
Linux and Windows binaries by GitHub Actions.
1010

1111
There is also a GitHub Pages bundle generated by `doomgeo-build pages`. It
12-
publishes the generated Neo Geo cartridge plus the null BIOS and loads them with
13-
EmulatorJS's FBNeo WebAssembly/asm.js frontend, so the current ROM can be played
14-
directly from the repository's Pages site. The same Pages bundle can expose the
15-
standalone 68000 assembly ROM at `asm.html`.
12+
publishes a web-safe generated Neo Geo cartridge plus the null BIOS and loads
13+
them with EmulatorJS's FBNeo WebAssembly/asm.js frontend, so the current ROM can
14+
be played directly from the repository's Pages site. The same Pages bundle can
15+
expose the standalone 68000 assembly ROM at `asm.html`.
1616

1717
FBNeo is an arcade core and validates known romsets by filename, size, and CRC.
1818
For the Pages bundle only, `doomgeo-build pages` writes FBNeo-compatible launch
@@ -23,6 +23,13 @@ the private FBNeo driver/chip compatibility identity. The raw build artifacts
2323
under `build/rom/` are not rewritten this way; this compatibility package is
2424
only for the browser player.
2525

26+
The deployed Pages ROM is built separately from the normal native artifact. CI
27+
uses the redistributable Freedoom IWAD and `DOOM_CROM_FILE_BYTES=2097152` for
28+
that job so the browser package does not embed proprietary Doom assets and still
29+
matches the fixed C-ROM chip sizes expected by FBNeo's `puzzledp` driver. The
30+
regular Linux, Windows, and local ROM artifacts are left on the normal build
31+
path.
32+
2633
## Local Linux Build
2734

2835
The existing Makefile still expects ngdevkit under `.tools/ngdevkit-local/usr`
@@ -370,9 +377,10 @@ or system packages installed through apt/MSYS2.
370377

371378
## GitHub Actions
372379

373-
`.github/workflows/build.yml` has three responsibilities:
380+
`.github/workflows/build.yml` has these responsibilities:
374381

375382
- Build and upload the Neo Geo ROM on `ubuntu-24.04`.
383+
- Build and upload a separate Freedoom-based web-safe ROM for GitHub Pages.
376384
- Build and upload a separate 68000 ASM Neo Geo ROM on `ubuntu-24.04`.
377385
- Build and upload the Neo Geo ROM on Windows through MSYS2 UCRT64.
378386
- Package `doomgeo-build` and `doomgeo-plan` as standalone binaries on Linux
@@ -382,7 +390,7 @@ or system packages installed through apt/MSYS2.
382390
The Ubuntu ROM job uses the upstream ngdevkit PPA and passes `TOOLS_PREFIX=/usr`
383391
so the CI machine does not need repo-local `.tools` state.
384392

385-
The Pages job consumes the ROM artifact and writes:
393+
The Pages job consumes the Freedoom web ROM artifact and writes:
386394

387395
```text
388396
dist/pages/index.html

docs/release-plan.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ the other only accompanies and tracks the plan.
3434
- The Pages ROM zips are expected to be FBNeo-compatible launch packages with
3535
`puzzledp` driver chip filenames, sizes, and CRCs internally while preserving
3636
the generated homebrew data outside the final padding correction bytes.
37+
- The Pages main ROM is expected to come from a separate Freedoom-based build
38+
with 2 MiB C-ROM chips, not from the normal native/local ROM artifact.
3739
- Repo-local installs are removable with `doomgeo-build uninstall`; `--all`
3840
also removes cached WAD/package downloads under `.tools`.
3941
- The installer decision is MSYS2 UCRT64 for native Windows builds, with WSL

tools/doomgeo_build.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
"202-m1.m1": 0x9C0291EA,
4040
"202-v1.v1": 0xDEBEB8FB,
4141
}
42+
FBNEO_PUZZLEDP_SIZE = {
43+
"202-p1.p1": 0x80000,
44+
"202-s1.s1": 0x20000,
45+
"202-c1.c1": 0x200000,
46+
"202-c2.c2": 0x200000,
47+
"202-m1.m1": 0x20000,
48+
"202-v1.v1": 0x80000,
49+
}
4250
FBNEO_NEOGEO_CRC = {
4351
"sp-s3.sp1": 0x91B64BE3,
4452
"sm1.sm1": 0x94416D67,
@@ -385,6 +393,13 @@ def build_fbneo_rom_zip(source_zip: Path, out_zip: Path) -> None:
385393
data = archive.read(name)
386394
except KeyError as exc:
387395
raise BuildError(f"ROM entry missing for FBNeo package: {name}") from exc
396+
expected_size = FBNEO_PUZZLEDP_SIZE[name]
397+
if len(data) != expected_size:
398+
raise BuildError(
399+
f"ROM entry {name} is {len(data)} bytes, but the FBNeo puzzledp "
400+
f"web driver expects {expected_size} bytes; rebuild the Pages ROM "
401+
"with DOOM_CROM_FILE_BYTES=2097152"
402+
)
388403
entries[name] = force_crc32(data, desired_crc)
389404
write_zip_entries(out_zip, entries)
390405
print_step(f"wrote FBNeo-compatible ROM package to {out_zip}")

0 commit comments

Comments
 (0)