@gameslate/sdk 0.3.14 → 0.3.15
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/lib/game-support.js
CHANGED
|
@@ -123,6 +123,10 @@ function checkMapAgainstCode(support, ctx, problems) {
|
|
|
123
123
|
if ((support.map.status === 'done' || support.map.status === 'partial') && !hasMapCap) {
|
|
124
124
|
problems.push(`map.status is "${support.map.status}" but no source declares map_2d`);
|
|
125
125
|
}
|
|
126
|
+
/* "partial" means some map is drawn: a live position alone leaves the game owed a map */
|
|
127
|
+
if (support.map.status !== 'open' && support.map.geometry === 'none') {
|
|
128
|
+
problems.push(`map.status is "${support.map.status}" but map.geometry is "none": nothing is drawn, so it stays "open"`);
|
|
129
|
+
}
|
|
126
130
|
if (support.map.status === 'open' && hasMapCap) {
|
|
127
131
|
problems.push('map.status is "open" but source already declares map_2d');
|
|
128
132
|
}
|
package/lib/sandbox-protocol.js
CHANGED
|
@@ -18,7 +18,13 @@ export const SandboxSourceSchema = z.object({
|
|
|
18
18
|
ramAnchor: z
|
|
19
19
|
.object({
|
|
20
20
|
romOffset: z.number().int().nonnegative().multipleOf(4),
|
|
21
|
-
|
|
21
|
+
/* word-aligned (the search matches only there), its 64 bytes inside 8 MB of RAM */
|
|
22
|
+
ramAddress: z
|
|
23
|
+
.number()
|
|
24
|
+
.int()
|
|
25
|
+
.multipleOf(4)
|
|
26
|
+
.gte(0x80000000)
|
|
27
|
+
.lte(0x80800000 - 64),
|
|
22
28
|
})
|
|
23
29
|
.optional(),
|
|
24
30
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gameslate/sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.15",
|
|
4
4
|
"description": "Build plugins for GameSlate, the second-screen companion for PC games: the plugin contract, game-state and catalogue schemas, and the plugin builder.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -599,6 +599,24 @@ the plugin repos) in the same change as the fix. The next game should not have t
|
|
|
599
599
|
and plain `yarn check` is its built-in lockfile check: CI stayed green while running no tests.
|
|
600
600
|
Pin `packageManager` and run `yarn run check`.
|
|
601
601
|
|
|
602
|
+
- **Read the decomp's licence before you port any of its code.** Plugins are MIT. An MIT or CC0
|
|
603
|
+
decomp may be ported, with its notice in `THIRD_PARTY_NOTICES.md` and a `/*! … */` header on
|
|
604
|
+
each derived file (esbuild keeps `/*!` comments in the bundle; it drops plain ones). A GPL decomp
|
|
605
|
+
(DOOM64-RE) may not be ported at all, however the comments are worded: its addresses and struct
|
|
606
|
+
layouts are facts and may be used, but its code is off limits. For code you need from one, use a
|
|
607
|
+
clean room. One agent reads the GPL source and writes a prose spec with no code, and builds the
|
|
608
|
+
decomp's routine as a black-box test binary on the dev machine. A second agent, which never
|
|
609
|
+
opens the source, implements from the spec and must match the binary's output on every real
|
|
610
|
+
input. Why: on 2026-12-05 the Doom 64 decompressor was ported step by step from DOOM64-RE, and
|
|
611
|
+
had to be rewritten clean before the repo could be published.
|
|
612
|
+
- **Implement a game's decompressor at the game's widths, and check it on every file.** Doom 64's
|
|
613
|
+
map compression is adaptive Huffman whose counts are C `short`s, rescaled only when the root
|
|
614
|
+
count *equals* 2000. In MAP07 the root steps past 2000, the counts climb to 32767 and wrap, and
|
|
615
|
+
a decoder with 32-bit counts unpacks the first 32 maps right and MAP07 wrong. Compare your
|
|
616
|
+
decoder's output with the game's own routine (built on the dev machine, not committed) byte for
|
|
617
|
+
byte on every compressed file in the ROM, and keep a ROM-gated test that unpacks them all to
|
|
618
|
+
their directory sizes. A small synthetic fixture pins the common path, but small inputs never
|
|
619
|
+
reach a wrap like this one.
|
|
602
620
|
- **Texture packs:** a port's HD packs (`mods/*.o2r`) replace textures. Read them the way the game
|
|
603
621
|
does: packs first, in name order, each preferring its `alt/` asset, then the base archive.
|
|
604
622
|
Otherwise you overwrite HD output with vanilla.
|
|
@@ -733,3 +751,101 @@ the plugin repos) in the same change as the fix. The next game should not have t
|
|
|
733
751
|
they're gone, find 64 bytes of ROM code that sit at one RAM address in every snapshot, once,
|
|
734
752
|
and declare them on the build: `supportedBuildIds: new Map([['NM8E.0', { region, ramAnchor:
|
|
735
753
|
{ romOffset: 0x1300, ramAddress: 0x80042f50 } }]])` (sdk 0.3.14).
|
|
754
|
+
- **A table in an overlay is in the ROM unpacked: read it there.** Mario Golf's hole-to-asset
|
|
755
|
+
table is a file static in overlay ovl_02, so the link map names neither it nor the overlay's
|
|
756
|
+
bounds as symbols the address tool reads. Take `.ovl_NN <vram> <size> load address <rom>` from
|
|
757
|
+
the built map. The table's ROM offset is its RAM address (the object's .data base plus the
|
|
758
|
+
static's offset) minus the overlay's VRAM plus its ROM start. Check a shape the source
|
|
759
|
+
guarantees, such as ids that run in a row, so a wrong offset throws instead of drawing another
|
|
760
|
+
hole (2026-12-05).
|
|
761
|
+
- **Erased records aren't data.** A file's unused slots can be all 0xFF, which read as kind -1
|
|
762
|
+
with every corner -1. Skip only those. A record with kind -1 and real corners is the game's
|
|
763
|
+
data, so follow it through every function that reads it. Mario Golf never draws one, but its
|
|
764
|
+
hit test still counts it as water (2026-12-05).
|
|
765
|
+
- **Triangles with no footprint widen a top-down crop.** A wall that stands on one x/z point
|
|
766
|
+
(mini golf had some at the origin) adds nothing to a map seen from above, yet it stretched the
|
|
767
|
+
frame by half the course. Leave out of the framing whatever the drawing leaves out (2026-12-05).
|
|
768
|
+
- **Find a mirrored axis on a level with a shape you can read.** A top-down map can be drawn the
|
|
769
|
+
wrong way round and still look plausible. Mario Golf's mini-golf holes are built as their
|
|
770
|
+
numbers, and they read the right way only with +x on the left. Once the axis is mirrored,
|
|
771
|
+
re-derive the heading's sign and offset from the game's own direction maths (`atan2` in its
|
|
772
|
+
shot code), and pin them with a test that walks a point along the heading through the affine
|
|
773
|
+
(2026-12-05).
|
|
774
|
+
- **The map's affine is one scale for both axes.** If the game's ground texels aren't square
|
|
775
|
+
(Mario Golf's mini golf spreads a 256 × 512 grid over a square), draw each texel at its true
|
|
776
|
+
aspect rather than stretching the grid. Then the affine stays a plain scale and headings point
|
|
777
|
+
true. A lookup that reads half a texel back (`GetMiniGolfSurface`) moves the drawing too: test
|
|
778
|
+
that a point lands on the texel the game reads under it, on each ground (2026-12-05).
|
|
779
|
+
- **A linked list in guest RAM changes while you walk it.** The emulator keeps running between
|
|
780
|
+
reads, so a thing freed mid-walk (Doom 64's `mobjhead` ring) can leave a `next` outside RAM or
|
|
781
|
+
a loop. Treat a broken link as a race: walk again once from the head, and throw only if the
|
|
782
|
+
second walk breaks too. Test both with a memory whose link is broken on the first walk only,
|
|
783
|
+
and on both.
|
|
784
|
+
- **Draw a map with the game's own spoiler rules.** Doom 64's automap draws a line flagged
|
|
785
|
+
`ML_HIDEAUTOMAPTRIGGER` as the wall or step it is built as: colouring it by its special put
|
|
786
|
+
the hidden secret exit on the map in purple. Before giving a line or pin a colour from what it
|
|
787
|
+
does, find every flag the game's map uses to hide that, and table each branch's precedence.
|
|
788
|
+
- **A kept slot index is often the next one.** When a game picks one of N slots in a loop (step
|
|
789
|
+
past the empty ones, keep the index), the field it keeps may point past the slot it used: Mario
|
|
790
|
+
Golf's `nextCupIndex` holds the slot after the cup in play, which is `(next + 3) % 4`. Read the
|
|
791
|
+
loop before calling a field "current", and check it against a snapshot (2026-12-05).
|
|
792
|
+
- **Numbered pins need gapless slots.** If pins are numbered over the set slots after filtering
|
|
793
|
+
out empty ones, refuse a set slot after an empty one: otherwise the labels drift from the slot
|
|
794
|
+
index a counter reports, and a `pinRules` match hides the wrong pin (2026-12-05).
|
|
795
|
+
- **A title or demo screen may mix assets.** Mario Golf's title hole reuses a real hole's terrain
|
|
796
|
+
but loads its own points file. Check RAM against the asset the game actually loaded, not the
|
|
797
|
+
real hole it looks like (2026-12-05).
|
|
798
|
+
- **`position` needs a heading.** The sdk's position requires `headingDeg` (0.3.14). An actor
|
|
799
|
+
with no heading in memory can't be the position; send it as an `enemies`/`npcs` dot and say so
|
|
800
|
+
in Known Gaps rather than inventing an angle (2026-12-05).
|
|
801
|
+
- **Changing a README's frontmatter changes the root support table.** Run
|
|
802
|
+
`gameslate-plugin support plugin --built dist/<repo> --write` after editing `npcs`, `enemies` or
|
|
803
|
+
capabilities, or the check refuses (2026-12-05).
|
|
804
|
+
- **The addresses tool rewrites the header's decomp name.** Run it on a checkout under another
|
|
805
|
+
folder name and the generated header names that folder and its commit: restore the line, or run
|
|
806
|
+
it from the checkout the header names (2026-12-05).
|
|
807
|
+
- **Search for a decomp even when the backlog says there is none.** Space Station Silicon Valley
|
|
808
|
+
had a CC0 decomp that builds the player's ROM (mkst/sssv); the backlog said "no decomp"
|
|
809
|
+
(2026-12-05).
|
|
810
|
+
- **Check the licence per file, not per repo.** A CC0 decomp can bundle someone's "All Rights
|
|
811
|
+
Reserved" code (SSSV's `rnc.c`). Those files go through the clean room like GPL code
|
|
812
|
+
(2026-12-05).
|
|
813
|
+
- **A format's own checksums can stand in for a reference decoder.** When no black-box binary can
|
|
814
|
+
be run, check a clean-room decoder against the CRCs the format stores (RNC's two CRCs), on
|
|
815
|
+
every file in the ROM (2026-12-05).
|
|
816
|
+
- **Debug strings left in the ROM name the globals.** Search for printf formats ("STAGE=%d…",
|
|
817
|
+
"PLAY.POS X=%5d…") and read the code that passes them arguments: Bomberman Hero's stage index
|
|
818
|
+
came from there after byte-diff searches found nothing (2026-12-05).
|
|
819
|
+
- **Static per-map tables are in the ROM.** A linearly loaded data segment has ROM offset = RAM
|
|
820
|
+
address minus a constant: read the table in the extractor rather than committing a stage list
|
|
821
|
+
(2026-12-05).
|
|
822
|
+
- **A "level" byte can be the destination.** A cheat-code "level modifier" byte may change at the
|
|
823
|
+
start of a transition while the old room is still drawn. Find the byte holding the previous id
|
|
824
|
+
at each change snapshot, and send no position while the two differ (Castlevania LoD). Gate on
|
|
825
|
+
"level loaded and ready", not on the level byte alone (SSSV) (2026-12-05).
|
|
826
|
+
- **Cross-check a position without a screen value.** The game's own position trail, the model's
|
|
827
|
+
matrix (translation row = position, row 0 = (cos θ, 0, −sin θ) × scale) and the floor height
|
|
828
|
+
under a grounded player each confirm a position and heading the screen never prints. A height
|
|
829
|
+
grid makes the strongest test: a grounded player's height must match the cell the drawing puts
|
|
830
|
+
them on, which catches swapped or mirrored axes that "inside the drawing" can't (2026-12-05).
|
|
831
|
+
- **Check which axis the renderer treats as up.** Some games hand (x, z, height) to the renderer
|
|
832
|
+
as (x, y, z), so z runs up the page seen from above (SSSV). Read the camera set-up before
|
|
833
|
+
choosing the map's axes (2026-12-05).
|
|
834
|
+
- **A "current actor" slot can lie in one mode.** In SSSV's Evo's Escape it stays on the microchip
|
|
835
|
+
while the screen shows another animal. Compare species with screenshots in every level
|
|
836
|
+
(2026-12-05).
|
|
837
|
+
- **A known MIO0/LZ variant may only differ in its header.** Body Harvest's MIO0 has an extra
|
|
838
|
+
packed-size word: adapt the header for the existing reader instead of writing a decoder. Check
|
|
839
|
+
the result against the game's own unpacked copy in a snapshot's RAM (2026-12-05).
|
|
840
|
+
- **Pin known-undrawn maps in the projection test** by name rather than loosening the bound, so a
|
|
841
|
+
new failure still names its map (2026-12-05).
|
|
842
|
+
- **A live position without a drawing is still `map: open`.** `partial` means some map is drawn.
|
|
843
|
+
Don't add `map_2d` just to pass the support check: the app never reads capabilities, the panel
|
|
844
|
+
shows "No floorplan is registered", and the game drops off the list of maps still owed
|
|
845
|
+
(Castlevania LoD, 2026-12-05). Ship the position with `status: open` and `map_2d` left out.
|
|
846
|
+
- **Mutation scripts: check each run reports a test count.** zsh doesn't word-split unquoted
|
|
847
|
+
variables, so a script given `$T="a b"` ran zero tests and looked like a pass (2026-12-05).
|
|
848
|
+
- **A worktree needs its own `yarn install`.** Copying `.pnp.cjs` across breaks its relative paths
|
|
849
|
+
to the cache (2026-12-05).
|
|
850
|
+
- **Env-var names for ROM-gated tests are per game:** `BH_ROM` was taken by Body Harvest when
|
|
851
|
+
Bomberman Hero needed one (2026-12-05).
|