At a glance

Overlay
PROT 0976, 0xE000 bytes at base 0x801CE818; init FUN_801CF00C
Cabinet state machine
FUN_801CF388, state word DAT_801DBF44, 37 states
Round state machine
FUN_801D3468, phase DAT_801DBF78
Exchange / damage / critical
FUN_801D3A14 / FUN_801D3B18 / FUN_801D6660
Combat tick / CPU pick
FUN_801D3F44 / FUN_801D487C
Fighter data
Roster table 0x801D769C, 17 records, stride 0x6C; action tables PTR_DAT_801DB8B8[char]
Art and sound
Party pack PROT 1204 / 1205, ladder fighters 1206..=1219, HUD + stage 1203; SFX bank 0869, BGM 1043
Pot
Prize accumulator _DAT_80084440, banked into the coin bank 0x800845A4
Port
engine-minigames (baka_fighter, baka_cabinet, baka_fighter_chrome, baka_impact_fx, baka_duel); 3D duel engine-minigame-scenes::baka_duel_scene

Every rule on this page is read off the overlay’s disassembly; provenance is ghidra/scripts/funcs/overlay_baka_fighter_<addr>.txt. The two dispatchers are read from the disassembly, not the decompiled C, which renders most of the cabinet’s exits as fake label-calls.

Getting there

The three Baka Fighter cabinets in the Sol casino (koin1) are interchangeable doors. Each sits behind an entry gate: an inventory compare and a one-coin fee before the fade and the warp. Failing the gate skips the warp. The door is the mode-24 minigame warp, field-VM op 0x3E with op0 = 104 (sub-id 4), which sets game mode 0x18 and loads the overlay. It is the ordinary scene-backup, overlay-load, return-to-field sequence, so the game comes back to the exact field state it left (mechanism on the field / event VM page).

A disc-wide walk of every scene finds a fourth site, on an overworld map. It is dev residue: a bare record with nothing but the warp, in a slot no reachable script spawns.

The seat

All six casino cabinet records (three Baka Fighter, three slot machine) share one choreography, written into the cabinet’s own script:

  1. Seat flagone per cabinet: 0x433..0x435 for Baka Fighter
  2. Walkthe player walks onto the stool tile and the record waits until they land
  3. Turnthe player turns to the machine over 23 frames
  4. Sit + feethe sit clip, then the coin gate and the fee
  5. Washa subtractive white held at full: the screen goes black
  6. Warpthe door warp into mode 24

A second pass after the warp walks the wash out, clears it, stands the player up and glides them off the stool. Nothing in the record reaches it on its own: the scene’s system script loops on the six seat flags, clears the one it finds and re-engages that cabinet once the field is back.

The port runs both passes on both play hosts through the field-VM talk runner, and emits no field colour push in a minigame mode, so the wash never draws over the duel.

A visit, start to finish

Above the fight sits the cabinet: one state word with 37 branch targets covering the whole run - attract, player select, per-rung setup, the round bracket, the duel, the win / lose / all-clear sequences, the NEXT GAME / PAY OUT menu, the pause menu and an unreachable developer menu. Only state 0x64 is “a round is live”.

Attract 0x00..0x02 title card Player select 0x0A..0x0E Install opponent 0x1E: the rung fold Round setup 0x32: HP to 0xC80 ROUND / READY / FIGHT 0x33..0x38 GAME OVER 0x96 / 0x97: pot zeroed Pause menu 0xBE / 0xBF Duel 0x64: rounds run next round match lost match won Exit 0x1F4: pot to coin bank Reload 0x6E: next rung NEXT GAME / PAY OUT 0x68 Flourish + tally 0x65 / 0x66 / 0x67 NEXT All stage clear 0xFA..0xFE all-clear flag PAY OUT
Every exit runs through 0x1F4, the only state that banks the pot. GAME OVER zeroes the pot on its first frame, before its banner spawns, so a lost match exits with nothing. Not drawn: the secret opponent’s own tally (0x6D), which replaces the ordinary tally exit when a secret rung was armed and also leads to the reload, and the How to Play screen (0xC0) under the pause menu.

Front end

NEXT GAME / PAY OUT

After a won match and its tally, a two-way menu offers NEXT GAME (fight the next rung, keeping the pot on the line) or PAY OUT (bank the pot and leave). The pot shows under it as a GET COIN readout. The menu’s cursor wraps both ways, and the sheet vanishes the frame NEXT GAME is taken.

Pad masks, cursor folds and draw gates

The cabinet reads the packed Legaia pad word, not the raw PSX layout:

MaskMeaning
0x44confirm (Cross plus L1)
0x21cancel (Circle plus L2)
0x844attract “press to start” (Start, Cross or L1)
0xF0any of the four face buttons
0x110in-duel menu (Select or Triangle)
0x8000 / 0x2000cursor left / right
0x1000 / 0x4000cursor up / down

The player-select and NEXT GAME / PAY OUT cursors wrap both ways. The three-row pause menu and the developer menu fold with an unsigned modulo, so they wrap at the bottom and stick at the top: -1 as a u32 is divisible by both 3 and 5.

The epilogue carries two draw flags: the arena pass is off on the attract, the tally, the last all-clear beats and the exit; the duel HUD draws only in 0x36..0x38, 0x64, 0x65, 0x6E, 0x96 and 0x97. So the tally and the NEXT GAME / PAY OUT menu show no duel HUD.

The round and the exchange

A match is first to two round wins. Inside a round, each fighter commits at most one attack per exchange; the exchange stays undecided until both sides have committed, and is booked on the frame the winner’s strike lands.

Square type 1 Circle type 2 Cross type 3 beats beats beats type 4 special: wins Setup HP 0xC80, seated Banners ROUND / READY / FIGHT Open you throw, it answers Committed waits for the strike Finisher one HP at 0: auto special Round over hold 0xB5 frames both HP at 0 match open: next round
A committed exchange returns to Open once its damage is booked. A round does not end when HP reaches zero: the standing fighter then auto-commits the special, and its last keyframe credits the round. The round-over hold runs 0xB5 frames from the deciding exchange; until it is out, fighters, HP and result banners stay as the exchange left them. The pause menu (Select or Triangle) is not drawn.

Who wins an exchange

P1 \ P20 idle1 Square2 Circle3 Cross4 special
0 idleundecidedundecidedundecidedundecidedP2
1 SquareundecideddrawP2P1P2
2 CircleundecidedP1drawP2P2
3 CrossundecidedP2P1drawP2
4 specialP1P1P1P1P1

The resolver tests in a fixed order: a special on either side wins outright (P1 checked first); both idle, or either side still mid-commit, is undecided; equal types draw; otherwise the beats relation. A draw books damage to both fighters. An attack never lands on a fighter who has not thrown. The resolver also has a settle timer, but it is vestigial: nothing in the overlay ever stores a positive value to it, so exchange pacing comes from the clips.

Damage

hit = power + power * ATK / 100
dmg = (hit * (200 - (mod + mod * DEF / 100)) * 0x20) / 100  +  (combo - 1) * 0x40

critical pending on the winner:  dmg = power << 7
InputWhere it comes from
powerthe winning attack’s action record +0x18
ATKthe winner’s roster record, one of three values picked by the winner’s HP tier
DEFthe loser’s roster record, one of three values picked by the loser’s HP tier
modthe loser’s roster damage modifier +0x24
combothe loser’s count of consecutive hits taken; it rises after every hit and clears when that fighter wins an exchange
stat tier (ATK and DEF) tier [2] tier [1] tier [0] critical roll armed no roll 0 0x280 0x3C1 0x8C1 0xC80 KO full HP
Both scales are the same fighter’s own HP, drawn to scale. The VITAL bar on the HUD is one pixel per 32 HP, so a full bar is 100 pixels and the critical band is its last 20.

Damage FUN_801D3B18, critical FUN_801D6660, resolver FUN_801D3A14. The constants (0x20, 0x40, << 7, the HP thresholds) are immediates in the dump; a debug printf labels the +0x38 family atk, which pins ATK against DEF.

Throwing, timing and the CPU

ButtonTypeBeatsLoses to
Square1CrossCircle
Circle2SquareCross
Cross3CircleSquare
(automatic)4everything-

The player’s throw comes from the edge-triggered pad word, so a throw is a press, not a hold. The special is not a button: it fires automatically for a fighter whose own HP is not zero, whose foe’s HP is zero, in a round not already decided. It plays its clip, spawns the afterimage and drops the duel into slow motion.

The strike clock

An exchange is booked on the frame the winner’s strike keyframe is crossed, not when both fighters have chosen. Every attack and special in the action tables carries at least one strike frame, each in 0..=64 clip frames, in order. Each tick the clip cursor advances by the action’s speed; the range it covered is checked against the strike frames, and a hit arms the booking. So a slower attack lands later even when it wins.

When the CPU throws

The opponent never leads. It throws only in answer to your throw, on the same frame and blind to what you picked, so the duel stands still until you press, and a player who holds back is never attacked. Its answer pulls it out of its own hit reaction; yours does not. A struck player’s pad stays masked until the reaction clip ends, and a throw lands from the idle or straight after a booked hit, which is how a winning attack chains. The two attacks stand after a booking, so an attack with a second strike frame can hit twice on one exchange.

How the CPU picks

Each opponent mixes random throws with a canned pattern: a NUL-terminated byte list in its roster record at +0x4C. Every pick:

  1. Rollroll = rand() % 6
  2. Pattern running?if the pattern cursor is not zero, step it back one and throw (pattern[cursor] - 1) % 3 + 1, whatever the roll
  3. Randomotherwise, a roll below 3 throws roll % 3 + 1: one of the three attacks, uniformly
  4. Start the patternotherwise, if the pattern is not empty, set the cursor to its length and throw from its last byte; an empty pattern falls back to random

So an idle cursor gives a three-in-six chance of a random attack and a three-in-six chance of starting the pattern, which then plays back to front to exhaustion regardless of later rolls. The CPU never opens with a special; its specials are the same automatic finisher as yours. A developer branch, unreachable on retail, can instead remap the opponent to counter the player’s committed input.

Combat tick FUN_801D3F44 (slot-0 branch for the buttons), keyframe lookup FUN_801D6E5C, CPU pick FUN_801D487C; port BakaFight::ai_pick on a BIOS-rand stream.

The ladder, the secret rungs and the pot

stage roster id 25 36 47 58 69 710 811 912 1013 1114 1215 1316 prize gold strictly rising across the first lap secret: roster 3 score > 250,000 secret: roster 4 score > 700,000 past stage 13: all stage clear wraps to 0: lap 2 opens on 3, 4 the stage counter is seeded to 2 each visit; roster = stage + 3
The twelve rungs served first are roster ids 5 to 16. Roster ids 0 to 2 are the party; 3 and 4 are the two opponents the victory art promises (“ALL STAGE CLEAR! ... IT’S NOT OVER YET”), reachable through the score gate mid-run or on a second lap.

The fighters’ names, prizes, stats and patterns decode from the disc (roster parser legaia_minigame_formats::baka_opponents) and are not reproduced here; the minigames page reads them off your disc.

Score and the tally

A won match ends on a tally of four counters. Three feed the running high score (which is what the secret-rung gate reads); the fourth is the coin prize, which feeds the pot.

RowWhat it addsDrains into
Match bonus30,000 when the opponent won no round (a shutout), else 20,000high score
Combo bonusper resolved hit, a table cell keyed by the longest streak you have landed, clamped at 0x13 (20 rows)high score
HP clear bonusper resolved hit, 50,000 at full HP 0xC80, else a table cell keyed by hp / 0x140 (11 rows)high score
Coin prizethe rung’s prize, roster record +0x20the pot

The rows drain strictly in sequence, each starting once the rows before it are empty, with a tick blip every step. A row fades in while the row just above it is empty, so a zero row lets the next one light up early and drain without a pause when its turn comes. A row moves a fifth of what is left per frame while more than 5 remain, half while 3 to 5 remain, and exactly one below that. Pressing any face button snaps the tally to its end: the fast-forward latch short-circuits the step to the whole remainder.

The combo row reads the running maximum of the opponent’s hits-taken counter, which the HUD latches once a frame - so the score’s combo term tracks the longest streak you land.

Tally FUN_801D239C, drain step FUN_801D6710, per-exchange accumulator FUN_801D2A28, combo / HP tables DAT_801D70C4 / DAT_801D711C (overlay rodata, no terminators). The same drain step is linked into the Muscle Dome hub.

Playing it well

Each of these follows from a rule above.

The arena in 3D

Everything the duel draws in 3D is placed by immediates in the overlay. The fighters are full battle-form meshes: the party’s are the same high-detail TMDs the turn-based battle uses, and each ladder opponent ships its own mesh, 256x256 atlas and 8-clip animation bank.

In the port, one 3D surface (engine-minigame-scenes::baka_duel_scene) draws the duel on all three hosts: fighters, ghosts, walls, floor, impact parts and the round-start cameo, plus the cabinet’s front-end lineup. The floor carries the epilogue’s warm pool of light and, in the duel alone, each fighter’s subtractive drop shadow: the combat tick is the only caller that draws one, so the title card and the lineup show none.

Effects

The impact pair

When an exchange books, two effects spawn at the winner’s strike offset - the fist, on the frame the strike lands: an additive flip-book flash (eight cells along one row, seven along the next) and a stage-pack mesh that fades in and out, yawed to mirror the flash across the arena. A draw spawns both fighters’ pairs.

The finishing special’s afterimage

The special draws two ghosts of its thrower, three and six frames behind the body. They are translucent: the colour word’s mode byte raises the semi-transparency bit with additive blending, so each ghost is the fighter’s texture at half, then a quarter, of its weight added over the frame. The far ghost is the fainter one - a glow that thins away from the body, not a dark copy.

The round-start cameo

Held Triangle at a round setup spawns the stage pack’s fourth model, a ring girl: she walks in side-on, turns to the camera, strikes a pose, turns back and walks off. At the pose a VRAM cell blit swaps her eye sprite from open to closed and leaves it swapped - a wink. A capture with and without Triangle held confirms she spawns only in the held run.

Impact pair FUN_801D4DF8, afterimage FUN_801D49E8, cameo FUN_801D6310 + blit FUN_801D65F8; ports in baka_fighter_chrome and baka_impact_fx.

The duel HUD and the banners

One renderer draws the duel HUD every frame. Its own pieces sort one layer under the round banners, so a ROUND or FIGHT! card always draws over it.

Round-result banners

Round ended withBanner
both HPs downDRAW
player downYOU LOSE...
foe down, player hitYOU WIN!
foe down, player untouchedPERFECT!!

Each banner comes with an announcer line. The round banner flies two halves together, holds and flies them out; its line is XA32.XA on the channel of the 0-based index of the round about to start, which the round setup has already advanced. The cabinet's banner states 0x33..0x36 drive the banner on their own clock. The title card and the round banner are pure frame-counter timelines. A third timeline long read as a per-round READY / FIGHT countdown is the all-clear announcer: only the five all-clear beats 0xFA..0xFE call it, and run beside the round banner its XA33 line cut the round number off.

Both play hosts draw the duel HUD through one shared builder, whether the duel opened from a casino cabinet seat or from the launcher. Before that builder existed, a seated duel showed a lone round digit: the HUD model was ported and built every frame, but neither host drew it.

HUD renderer FUN_801D2AFC over the 51-record widget table DAT_801D7160; banner draw hook FUN_801D67F0; title card FUN_801D59D4, round banner FUN_801D5C7C, all-clear announcer FUN_801D21FC.

Sound

The cabinet uses four sound-effect cues, all static descriptors written straight to the cue ring:

EventCue
hit: an exchange’s damage lands0x09
confirm / cursor / cancel0x20 / 0x21 / 0x37
score-tally tick0x21

The hit is the only fight sound effect; a draw, which applies damage twice, plays it twice. Everything else you hear in the duel is an announcer voice line streamed as CD-XA: thirteen call sites, ten in the chrome timelines and three in the cabinet itself (the FIGHT! flash, NEXT GAME, GAME OVER). The SFX bank is the shared battle / minigame bank; the BGM is “Sol disco fever” (sound-test #55), see music tracks.

Where this is in the port

The port is from-scratch Rust: the rules crates carry no world, scene or renderer, and the same cabinet, chrome and 3D duel run on all three hosts. Play it on the minigames page with your own disc.

HostHow you get in
native play windowthe casino door warp, or the B key (the same mode-24 warp; B again aborts with no coins)
browser play pagethe casino door warp
minigames pageopens the same cabinet directly; the page keeps the winnings accumulator the play hosts keep on the world

The play hosts run the real ladder inside one visit: NEXT GAME seats the roster record the rung fold names, the tally drains into the same winnings accumulator retail keeps, and the exit’s return warp pays it into the coin bank. Leaving the duel before the tally finishes banks the remainder.

Known differences from retail

Internals

For modders and anyone reading the dumps. The full tables are in the doc linked below.

Assets: fighter packs, HUD pack, action and roster records
  • Party pack: retail loads PROT 1205 raw (1204 is the LZS twin a dev flag would pick). The cabinet reuses the battle-form character pack rather than shipping its own party meshes.
  • Ladder fighters: PROT 1206..=1219, one per fighter (roster id 3 + n is entry 1206 + n), each a chain of a 256x256 4bpp TIM, a TMD and an 8-record ANM bank. Entry 1220 is not a fighter pack.
  • HUD and stage: PROT 1203, a pack of 9 TIMs (banners, digit fonts, icons, logo), 4 stage TMDs (the wall, two impact props, the cameo figure) and a 30-record ANM bank.
  • Action table: 17 tables of 9 actions, 0x60 bytes each - idle, three attacks, special, hit, knockdown, win flourish - with clip speed at +0x04, power at +0x18 and up to 8 strike keyframes.
Roster +Field
0x00fighter name, 32 bytes
0x20coin prize
0x24damage modifier mod
0x28 / 0x2C / 0x30DEF tiers
0x34critical chance, percent
0x38 / 0x3C / 0x40ATK tiers
0x44duel stand-off
0x4CCPU pattern, NUL-terminated bytes

The roster table is 0x801D769C, 17 records of 0x6C: ids 0..=2 are Vahn, Noa and Gala, 3..=16 the ladder. Parsers: legaia_minigame_formats::baka_opponents (parse, parse_actions, parse_fighter_pack, parse_baka_hud).

Developer screens (unreachable on retail)

Retail carries a developer menu (0xC8), an in-game action-table keyframe editor (0x190 / 0x191) and an action-table dump to ot5stat.txt. The pause-menu edge routes to the developer menu only when a word that boots to zero and is only ever cleared is non-zero, so none of them opens. The editor is linked, not dead: it is the callback of one of the overlay’s eight actor prototypes.

The developer menu has five rows: resume (or, with a new stage picked, reload onto that rung), reboot the cabinet, a debug-mode word, the stage pick, and the keyframe editor. Circle confirms a row; Cross resumes from any row. Every pause edge seeds the stage pick from the current stage.

RAM state and key functions

All overlay-resident; per-fighter blocks are 0xA8 bytes per slot (0 = player, 1 = opponent) from DAT_801DBFBC.

GlobalRole
DAT_801DBF44cabinet state; 100 is a live round
DAT_801DBF78match phase (0 teardown / 1 paused / 2 active)
DAT_801DC10Cstage counter (seeded 2, wraps at 0xE)
DAT_801DBF06secret-opponent override (0 / 1 / 2)
DAT_801DBED0round-win target, 2
DAT_801DBEE4running high score
DAT_801DBFC4 (block +0x08)HP
DAT_801DBFEC (block +0x30)consecutive hits taken
DAT_801DC05C (block +0xA0)critical pending
_DAT_80084440casino prize accumulator (the pot)

The two state machines have no jal callers: the init spawns an actor whose tick is the cabinet, which spawns the actor whose tick is the round, and both run through the actor pool walk.

Shared code outside this overlay

The 24-instruction tally drain step here and the one in the Muscle Dome hub are the same routine linked into two overlays; only the pair of instructions that loads its bypass flag differs. Dumps named overlay_baka_fighter_801f.... are a dump-corpus artifact: those addresses hold resident field-overlay code, including the casino coin counter (which credits coins and debits 100 gold per coin) and the op-0x49 submode family.

See also

The 37 cabinet states, the fighter packs and action tables, the strike clock, the arena camera, the effect templates and the whole HUD packet list are in docs/subsystems/minigame-baka-fighter.md.

Reference Minigames page Field / event VM Battle Character mesh Battle data pack Muscle Dome Slot machine Dance Fishing