@wasm-gaming/fbneo-wasm 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # @wasm-gaming/fbneo-wasm
2
+
3
+ FinalBurn Neo (FBNeo) — the multi-system arcade emulator (Capcom CPS-1/2/3, SNK
4
+ Neo Geo, Sega System 16, Cave, PGM, and many more) — compiled to WebAssembly via
5
+ Emscripten and packaged as a wasm-gaming engine SDK.
6
+
7
+ This subproject follows the same engine-package approach used by jgenesis-wasm,
8
+ blastem-wasm, rsdkv3, and rsdkv4:
9
+
10
+ - typed `manifest`
11
+ - typed `options`
12
+ - `load(config)` engine SDK surface
13
+ - Makefile-driven build (`build-sdk`, `build-wasm`, `preview`)
14
+
15
+ It conforms to the [`@wasm-gaming/engine-specs`](https://github.com/wasm-gaming/engine-specs)
16
+ contract (`EngineSDK` = `{ manifest, load }`).
17
+
18
+ ## Contract surface
19
+
20
+ ```js
21
+ import { manifest, load } from '@wasm-gaming/fbneo-wasm';
22
+
23
+ const engine = await load({
24
+ canvas, // per engine-specs EngineConfig
25
+ assets: {
26
+ rom: romZipBytes, // arcade ROM set (zip)
27
+ bios: neogeoZipBytes, // optional: e.g. neogeo.zip for Neo Geo sets
28
+ },
29
+ options: { driver: 'mslug', renderFilter: 'pixelated' },
30
+ onEvent: (e) => console.log(e),
31
+ });
32
+ engine.start();
33
+ ```
34
+
35
+ FBNeo identifies a game by the ROM zip **filename** (without extension). Pass the
36
+ game short name explicitly via `options.driver` (e.g. `"mslug"`, `"sf2"`,
37
+ `"kof98"`), or let it be inferred from `options.romFileName` / the picked file's
38
+ name.
39
+
40
+ ### Options
41
+
42
+ | Option | Default | Description |
43
+ |--------|---------|-------------|
44
+ | `romFileName` | `game.zip` | Filename used when writing ROM bytes to MEMFS. |
45
+ | `driver` | *(inferred)* | FBNeo ROM set short name to boot. |
46
+ | `renderFilter` | `pixelated` | `pixelated` (crisp) or `smooth` (linear). |
47
+ | `audioSampleRate` | `44100` | Target audio sample rate in Hz. |
48
+ | `vsync` | `true` | Enable vertical sync. |
49
+ | `integerScale` | `false` | Integer scaling only. |
50
+ | `windowScale` | `2` | Internal render-resolution multiplier. |
51
+
52
+ ## Build
53
+
54
+ ```sh
55
+ make build # Full build: WASM (Docker/Emscripten) + TypeScript SDK
56
+ make build-sdk # TypeScript only (SDK + manifest + demo shell)
57
+ make build-wasm # FBNeo WASM only (via Docker)
58
+ make preview # Serve dist/ with COOP/COEP headers
59
+ ```
60
+
61
+ WebAssembly threads/SharedArrayBuffer require the COOP/COEP headers that
62
+ `make preview` sets — serve the built `dist/` with those headers in production too.
63
+
64
+ ## WASM artifacts
65
+
66
+ | File | Description |
67
+ |------|-------------|
68
+ | `fbneo.js` | Emscripten-generated module loader (`createFbneoModule`). |
69
+ | `fbneo.wasm` | Compiled FBNeo runtime. |
70
+
71
+ FBNeo uses Emscripten SDL2. The JS loader expects a `<canvas id="canvas">` in the
72
+ DOM (the SDK sets this id automatically). ROM zips are written to the in-memory
73
+ MEMFS under `/roms/` before the emulator boots, and FBNeo is launched with the
74
+ driver short name.
75
+
76
+ See [CORE.md](CORE.md) for the mapping between upstream FBNeo capabilities and the
77
+ options currently exposed by this wrapper.