Casino slot machine
Three reels of ten pictographic symbols. Every spin costs a flat three coins and plays all five paylines; a matched line pays a per-symbol amount, and a line of either jackpot symbol opens a bonus round on the same reels. It is a 3D scene, not a sprite collage: the reels are textured cylinders, the paylines are 3D line segments and the cabinet is a mesh.
At a glance
- Overlay
- Extraction PROT 975 at base
0x801CE818; initFUN_801CEC94 - Reel state machine
FUN_801CF0D8, state wordDAT_801D3C84- RNG
- The slot generator
FUN_801D30CCplus the BIOSrand - Feature roll / stop / landing
FUN_801D258C/FUN_801D2114/FUN_801D2440- Win evaluation
FUN_801D13E8over the display strip and the ten payout bytes atDAT_801D3598- Coins
- Overlay-local balance
DAT_801D4114; global coin bank0x800845A4 - Assets
- PROT 1200 (five textures, cabinet mesh, animation), 1198 (sounds), 1199 (effects)
- Port
- Rules
engine-minigames::slot_machine; drawsengine-ui::slot_cabinet/slot_paylines
Getting there
The door is the mode-24 minigame warp: field-VM op 0x3E with op0 = 103 (sub-id 3) sets game mode 0x18 and loads the overlay. It is the ordinary scene-backup, overlay-load, return-to-field sequence, so the game returns to the exact field state it suspended. The mechanism is on the field / event VM page.
A disc-wide walk finds five door records: three interchangeable cabinets in the Sol casino, and the Vidna cabinet in both variants of its scene. The door gate is a coin-bank compare, not an item check - a player with no coins never reaches the machine and sees the cabinet’s refusal line instead. The debit before the warp is a fee, and at a slot cabinet it is zero, because the machine charges its own bets from the balance it copies in.
The three Sol cabinets seat the player the way the Baka Fighter cabinets do: a walk onto the stool, a turn to the machine and the sit clip before the fade, and a second pass after the warp that clears the fade and stands the player up. Every exit - the quit row, an empty machine, the port’s Start escape - comes back through that pass.
Reel state machine
Reel strips
Each reel is a 20-slot strip. Init builds two source strips per reel - the ten symbols and the ten bonus numerals - by drawing a random position and probing forward to a free one, so each value lands on two scattered positions. A third strip, the display strip, is the only one the win evaluator and the renderer read. It is refilled one row per frame, and that refill is how the bonus round swaps numerals onto the reels.
A reel position is a fixed-point angle; the on-screen symbol is (pos >> 8) mod 0x14.
The five paylines
| Result | Credit | Side effect |
|---|---|---|
three of symbol 0..7 on a line | that symbol’s payout byte | - |
three of symbol 8, the blue kick | its payout byte | one bonus round |
three of symbol 9, the red punch | its payout byte | three bonus rounds |
| any bonus-round spin | the product of the three centre-row numerals, 1..=1000 | subtracted from the net take |
During a bonus round the product is computed unconditionally - no match is needed and no payout byte is read. A separate scanner lights the “reach” presentation when two stopped reels already hold a jackpot pair; it sets no payout.
Two generators
x = x * 5 + 1
x = (x << 16) + (x >> 16) fold the halves
The slot generator drives strip construction, reel landing and the feature-stays-on rolls, so reel outcomes are reproducible from its one word. The BIOS rand drives the per-spin feature roll and the landing-line row - the parts that should not be replayable from the visible reels.
The machine pays back what it has taken. Feature odds are bracketed on a net-take counter, not on the balance: the denominators shrink from 700 / 500 to 175 / 125 once the machine is more than 2000 ahead, and each bonus payout is subtracted from the counter. A net take of exactly 1000 or 2000 falls in no bracket.
Coin economy
The machine touches the coin bank in exactly two places: it copies the bank into its own balance on entry and assigns the balance back on exit. It is not debited per spin. A normal spin charges 3 from the local balance and a bonus spin charges 1; the not-enough gate tests for 3 either way.
That is why the well-known infinite-coins code works at the casino but does not make spins free: it pins the bank, and betting decrements the overlay-local balance.
A 3D scene
Each reel emits eight textured quads a frame around an ellipse of radius 585 in height and 512 in depth - a cylinder through the geometry coprocessor, which is why symbols curl away from the payline. The paylines are 3D segments, the medallions, lamps and marquee are billboards, and the marquee is composed as a dot-matrix display. The trig comes from the executable’s shared sine table, whose entries truncate toward zero; that matters because the cylinder multiplies each entry by a radius before shifting back down.
See also
The strip builder, the bonus swap, the cash-out submenu, the RAM state block, every renderer routine and the art pack are in docs/subsystems/minigame-slot-machine.md.