ConsoleStation
A shared television console: any emulator core in the world (NES, CHIP-8, Neo Geo, ...) running on one screen that the whole room sees, with two controllers. Put it on an entity at the screen's centre, facing out of the screen (+Z), whose screen mesh draws the material bound to `…
ConsoleStation
A shared television console: any emulator core in the world (NES, CHIP-8, Neo Geo, ...) running on one
screen that the whole room sees, with two controllers. Put it on an entity at the screen's centre, facing
out of the screen (+Z), whose screen mesh draws the material bound to texGuid.
- Choosing a game. Near it with empty hands, Interact (E / pad west / touch) opens the cartridge
library (
stations.cartlib): every built-in cartridge and every cartridge anyone in the session has uploaded, for the consoles inconsoles, plus "Upload from your computer". - Where it runs. On the peer that holds the cartridge's bytes (the runner): the uploader, or the one
who picked a built-in cart. That peer emulates at full speed, hears the sound, and streams the picture to
everyone else (
stations.framecodecdelta frames,streamHza second withinstreamBudgetbytes a second). It restates what is inserted every few seconds, so a late joiner sees it too. - Two players. A
PadControlcontroller sends its buttons here as one word (bit 0-3 right, left, up, down; 4-7 A, B, C, D; 8 Start; 9 Select/Coin). The runner applies player 1 and 2 to the core (NES pads, CHIP-8 keypad, Neo GeosetPad).
Methods: padInput(slot, word) (from a controller on this peer), insert(entry), eject(), cart(),
isRunner(). Fields: consoles, texGuid, streamHz, streamBudget, volume, promptRange,
seatOffset (where a player's view sits while holding a controller, in this entity's frame), status.
- The screen's light. While a picture runs, the picture's drawn colour lights the room on every peer: a
shadowed spot out of the glass (
glowIntensity,glowRange,glowShadows), a small point on the tube, and a broad shadowless fill (fillIntensity,fillBackmetres behind the glass so its falloff from set to seats is gentle,fillAngle,fillPitchdown toward the floor and seats). All go dark on eject.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
closeSound( ) → void
me( ) → any
tvName( ) → string
what the room calls this set: the bedroom CRT apart from the living-room television
myPeer( ) → number
cartlib( ) → any
adapter(id: string) → any
a handheld plays on the television through its adapter spec (stations.gbtv: the Game Boy's picture framed 4:3, the pad mapped, on a worker thread)
| arg | type | description |
|---|---|---|
| id | string |
handheld(id: string) → boolean
| arg | type | description |
|---|---|---|
| id | string |
findSpec(id: string) → any
| arg | type | description |
|---|---|---|
| id | string |
tvCore(id: string) → boolean
an installed console that calls itself a TV console (spec.tv = true) is offered by every set without the room naming it (Mega Drive and later ones)
| arg | type | description |
|---|---|---|
| id | string |
offers(id: string) → boolean
| arg | type | description |
|---|---|---|
| id | string |
ensureDisplay(w: number, h: number) → void
| arg | type | description |
|---|---|---|
| w | number | |
| h | number |
blitFb(fb: buffer) → void
the frame straight into the screen's texture: the buffer itself, with no copy into a string first (a 280 KB string a frame is garbage the collector then has to chase)
| arg | type | description |
|---|---|---|
| fb | buffer |
bit(w: number, b: number) → boolean
| arg | type | description |
|---|---|---|
| w | number | |
| b | number |
toNes(w: number) → number
| arg | type | description |
|---|---|---|
| w | number |
toChip8(p1: number, p2: number) → number
CHIP-8 keypad: player 1 on 2/8/4/6 + 5 (and 1/4 for two-paddle games), player 2 on C/D + E/F
| arg | type | description |
|---|---|---|
| p1 | number | |
| p2 | number |
key(k: number) → void
| arg | type | description |
|---|---|---|
| k | number |
applyPads(m: any) → void
| arg | type | description |
|---|---|---|
| m | any |
cartBytes(c: Cart) → string
| arg | type | description |
|---|---|---|
| c | Cart |
stopMachine( ) → void
boot(c: Cart) → void
| arg | type | description |
|---|---|---|
| c | Cart |
isRunner( ) → boolean
announce( ) → void
accept(c: Cart) → void
| arg | type | description |
|---|---|---|
| c | Cart |
onInsert(_from: number, station: string, console: string, id: string, title: string, runner: number, at: number) → void
| arg | type | description |
|---|---|---|
| _from | number | |
| station | string | |
| console | string | |
| id | string | |
| title | string | |
| runner | number | |
| at | number |
onEject(_from: number, station: string) → void
| arg | type | description |
|---|---|---|
| _from | number | |
| station | string |
onPad(_from: number, station: string, slot: number, word: number) → void
| arg | type | description |
|---|---|---|
| _from | number | |
| station | string | |
| slot | number | |
| word | number |
onFrame(_from: number, station: string, payload: string, w: number, h: number) → void
| arg | type | description |
|---|---|---|
| _from | number | |
| station | string | |
| payload | string | |
| w | number | |
| h | number |
makeGlow( ) → void
fenceFill( ) → boolean
A shadowless light passes through walls, so the fill is fenced in by distance: its source stays in front of the wall behind the set and its range ends short of the wall the set faces, both measured along the screen's axis above the furniture. Measured once the room's colliders are in (the first time the picture lights the room); until a wall answers the fill stays dark rather than leak.
dropGlow( ) → void
sample(px: buffer, w: number, h: number) → void
| arg | type | description |
|---|---|---|
| px | buffer | |
| w | number | |
| h | number |
updateGlow(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
blankScreen( ) → void
padInput(slot: number, word: number) → void
A controller on this peer: its word goes to the runner (or straight in).
| arg | type | description |
|---|---|---|
| slot | number | |
| word | number |
insert(entry: any) → void
Put a cartridge in: `entry` is a cartlib entry (or { console, id, title }). The game runs on a peer holding its bytes: this one when it has them.
| arg | type | description |
|---|---|---|
| entry | any |
eject( ) → void
cart( ) → any
isRunner( ) → boolean
consoleList( ) → void
openLoader( ) → void
onPick(entry: any) → void
| arg | type | description |
|---|---|---|
| entry | any |
chooseGame( ) → void
Open the game chooser on this machine (a player picked up a controller and the television has nothing to play).
localAvatar( ) → any
near(avatar: any) → boolean
| arg | type | description |
|---|---|---|
| avatar | any |
showPrompt(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
awake( ) → void
onDestroy( ) → void
onCallback(id: string, data: any) → void
| arg | type | description |
|---|---|---|
| id | string | |
| data | any |
anyoneNear( ) → boolean
anyone (any peer's player) standing near the set
countFrames(n: number, dt: number) → void
| arg | type | description |
|---|---|---|
| n | number | |
| dt | number |
pushSound(buf: buffer, frames: number) → void
| arg | type | description |
|---|---|---|
| buf | buffer | |
| frames | number |
workerTick(dt: number) → buffer
The worker-thread runner: owes frames by wall time as the in-frame one does, hands the worker the frames owed (at most MAX_WORKER_FRAMES) once the last step settled, and shows each step's frame and plays its sound as it lands. A worker slower than real time lets owed frames past a few go: the game slows rather than spiral. Answers the frame shown this tick, or nil.
| arg | type | description |
|---|---|---|
| dt | number |
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.