The dance in one minute

Buttons
Square and Circle are the chart notes. Triangle is a three-per-song wildcard, the “groovy move”.
Timing
A beat is 281 clock units. A press counts from the beat to 210 units after it; the last 71 units before the next beat are dead.
Points
Only two things score: closing a chain of notes, and a Triangle. A matching note that does not close a chain scores nothing.
Groove gauge
0..2999, never lowered. Each 1000 is a level: the dancer moves to a harder chart row whose chains are longer and pay more.
Score cap
999 per dancer.
Song
92 beats (60 in the how-to lesson); the chart repeats every 32 beats.
Outcome
Story flag 0x50A: set on entry, cleared on a loss. The field script that follows reads it.

Overlay: extraction PROT 0980, 0x8000 bytes at 0x801CE818; init FUN_801CEF54, per-frame tick FUN_801CF470, judge FUN_801D1960, award routine FUN_801D1AF4. Parsers legaia_minigame_formats::dance_chart / dance_cast / dance_art; rules port legaia_engine_minigames::dance.

Getting there

The door is the mode-24 minigame warp: field-VM op 0x3E with op0 = 106 (sub-id 6) 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.

This is the one sub-id where the loader’s index arithmetic steps: sub-ids of 6 and above add two, so sub-id 6 resolves to PROT 0980 rather than 0978. A disc-wide walk of every scene puts every dance door in the casino scene koin3; the hall’s own scene module other7 carries no genuine warp.

The hall sits behind a members-only door at the end of the koin3 corridor. Its doorman asks for a Gold Card: answering Yes with the card in the bag raises the flag the door tests, and from then on the door swings open on contact. Without it, walking into the door has the doorman step into the doorway and push the player back; the door does not open. See prop-door rides.

The tick routine has no direct caller: it is the tick word of a static actor template the init spawns, reached every frame through the actor-pool walk.

How a session flows

1 Setup mode from story flag 2 Load wait how-to only 3 READY... 38 runs, song streams 4 / 5 GO! 11 in + 11 out 6 / 7 Lead-in clock zeroed, 4 runs other modes 10 Play judge + beat clock 11 Finish 3, 2, 1, FINISH! song timer at limit 12 Result wipe pad still read 20 Results grade, save best Back to field fade at 0x100 the finale tier: a Triangle here pays (lane + 1) × 34 State 0, a four-row debug mode menu, is reached only when the field-entry word is zero.
The beat clock runs in states 10, 11 and 12, so the countdown and the wipe still accept presses. The song ends when its timer reaches 92 beats (60 in the how-to); the timer is tested in the play state only.

The count-in

The hall runs at a frame delta of 3, so every state body runs once per three vsyncs. The count-in is 38 READY runs, 11 GO!-in runs and 11 GO!-out runs. There is no 1 2 3 before the song: the digits belong to the finish countdown, four sprite parts spawned at once whose move programs differ only in their wait and their cue.

PartWait (ticks)Cue
300x209
2500x208
11000x207
FINISH!1500x206

Four modes

The field script picks the mode by setting a story flag before the warp. Setup tests 0x133 (how-to), 0x134 (qualifier), 0x135 (finals) and 0x428 (free play) in that order, so the last flag set wins; it then clears the first three but not 0x428, the standing free-play state.

ModeFloorSongHow it grades
0 qualifier (yosenn)Noa + two dancers92 beats, extraction 1048Human score against score slot 2; lower clears the win flag
1 finals (hosenn)Mary centre, Noa, one dancer92 beats, extraction 1054Human score against score slot 1; lower clears the win flag
2 how-to (setumei)Noa alone, the Disco King teaching60 beats, extraction 1048Clears the win flag when the score exceeds 300
3 free play (asobi)six dancers92 beats, rotating 1065 / 1048 / 1054No branch: sets no win or lose flag; shows a personal-best panel

The results state copies the three scores into the field script’s counter slots, which is how the Disco King can announce Noa’s points back in the town. The saved best score (0x80084464, save block 0x324) is raised by the tick’s head on every frame of a run outside the how-to whenever the human’s score beats it, and free play draws it on its personal-best panel at the top left; the port carries it in its saves and draws the panel on every host. Free play’s song rotation counter lives in the game-state window the save block is composed from, so it carries across visits and saves. The English glosses of the four mode labels are inferred.

State machine FUN_801CF470 on DAT_801D5334 through a 21-word jump table at 0x801CEE68. A dev shortcut ahead of the switch forces the results with the human score at 999.

The timing window

Every press is judged against one clock. phase is where the clock sits inside the current beat (0..280), and a press counts only while phase ≤ 0xD2 (210). The window is not centred on the beat: it opens on the beat and closes 210 units later. The 71 units before each beat are a dead zone, so a press made early lands there and misses.

100% on the beat 75% 50% at the edge 100% 50% 0 acceptance window about 7 game frames dead zone press = miss 0 0x46 105 0xD2 = 210 0x119 phase inside the beat (clock units; one game frame = 30 units) 0..0x46: the beat track flashes on its flash beats
The curve is the human’s share of the chain bonus: points = base / 2 + (base × w) >> 13 with the weight w = 0x1000 - phase × 0x1000 / 0xD2. A rival takes the flat table value. The frame and second figures here are derived from the doc’s numbers: the clock adds 30 units per game frame at the hall’s delta of 3, so a beat is about 9.4 game frames (28 vsyncs, a little under half a second) and the window about 7.
QuantityValue
Beat period0x119 (281) phase units
Acceptance windowphase 0..=0xD2 (210)
Dead zonethe remaining 71 units
Clock stepframe_delta × 10 per frame, so frame-rate compensated
Chart cycle32 beats (0x2320)
Song length92 beats (0x64FC), or 60 (0x41DC) in the how-to

What one press does

PressResultScoreGaugeChain
in the dead zonemiss--unchanged
in window, wrong buttonmiss--unchanged
in window, right button, chain still openhitnothing-+1
in window, right button, chain closeschain closedthe bonus points+250reset

The note to press is the judged cell

The CPU feed can substitute a Triangle on a combo slot, but the judge always reads the raw chart cell. Because lane 0’s notes all sit on combo slots, the two diverge on exactly the beats that carry notes. Anything that draws the chart for a player must draw the judged cell; the port exposes both (DanceGame::judged_symbol and required_symbol), and the site’s playable dance drives its note highway off the former.

Judge FUN_801D1960(player, lane, pressed): returns 0 miss, 1 matched, 2 chain closed. CPU feed FUN_801D1820, symbol to pad bit FUN_801D4040.

The chart, the lanes and the bonus table

The step chart is three rows of 32 bytes, one byte per beat. A dancer’s row is its lane, gauge / 1000, so the three rows are three difficulty tiers and every dancer, human or rival, reads the row its own gauge has promoted it to. All three tables are baked into the overlay image; nothing is loaded per song.

SymbolMeaningPad bit
0restnone
1Square0x80
2Circle0x20
3Triangle, produced only by the CPU feed0x10

The lane-0 row puts every one of its steps on a 4-beat boundary (0,0,0,1, 0,0,0,2, ...), so its notes sit exactly on the combo slots, the beats where beat & 3 == 3.

beat 0 beat 1 beat 2 beat 3 beat 4 beat 5 beat 6 beat 7 combo slot combo slot chain cleared lane-0 note lane-0 note beat & 3 == 3 is a combo slot: the only place the Triangle pays its multiplier. The chart cycle is four of these bars; the song is 92 beats.

Two scoring tables sit beside the chart, both indexed by the dancer’s kind (the same id that picks its mesh):

Chart 0x801D509C (PROT 0980 file 0x6884), bonus points 0x801D41A4 (0x598C), triangle schedule 0x801D41E4 (0x59CC); shapes pinned by the index arithmetic in the judge and the CPU feed.

Score and the groove gauge

One award routine runs once per frame for every dancer on the floor. The human’s input is the live pad; every other dancer’s is a pad word synthesised from the chart. Score has exactly two sources:

PressScoreGauge
Triangle on a combo slot, in window(lane + 1) × 25+1000
Triangle anywhere else(lane + 1) × 3-
Square / Circle closing the lane’s chainthe kind’s bonus (accuracy-weighted for the human)+250
Square / Circle that matches but does not closenothing-
Square / Circle that missesnothing (a miss counter rises)-
Lv. 1 = lane 0 1-note chains, bonus k Lv. 2 = lane 1 2-note chains, bonus 2k Lv. 3 = lane 2 3-note chains, bonus 3k 0 1000 2000 2999 +250 per closed chain +1000 per landed groovy move: one whole level Nothing lowers the gauge: not a miss, not a dropped chain. Four closed chains, or one landed groovy move, climb one level.
The gauge is both the difficulty and the multiplier: a higher lane asks for longer chains and pays the larger bonus column, and every Triangle payout scales by lane + 1. The how-to script says the same as the code: “the level rises automatically”.

The rivals

The competitors run the same award routine off a pad word synthesised from the same chart. They differ from the human only by kind, which selects their row of the two scoring tables. A rival therefore hits every note its own lane calls for (so its gauge climbs and promotes it), takes the flat table bonus for each closed chain with no accuracy weighting, and throws its groovy moves on the disc’s schedule. Only the press latch and the move clip it is playing hold it, so it presses again as soon as both allow, several times a beat, and so can you: a second press inside one beat’s window counts toward the chain. In free play the rivals ride your gauge.

The groovy move (Triangle)

Triangle matches no chart cell. It has its own branch, taught by the how-to as a wildcard to press with the last command of a combo, three uses a song. The stock is set to 3 per dancer before the song and is never replenished.

  1. GateOnly when the press latch is clear and the stock is non-zero.
  2. SpendThe stock drops by one wherever the press lands.
  3. PayOn a combo slot inside the window: (lane + 1) × 25 and a full +1000 on the gauge. Anywhere else: only (lane + 1) × 3.
  4. MoveThe dancer plays the lane’s groovy-move clip and spins lane + 1 full turns. Nothing it presses is judged until the clip ends.
LaneOn a combo slotElsewhereFinale tierBannerInput locked for
0 (Lv. 1)25 + one level334Cool!24 game frames, 2.56 beats
1 (Lv. 2)50 + one level668Great!!46 game frames, 4.91 beats
2 (Lv. 3)75 + one level9102Fever!!!64 game frames, 6.83 beats
next combo slot +6: next 3-note combo starts lane 0: 2.56 lane 1: 4.91 lane 2: 6.83 beats 0 2 4 6 8 beats thrown on a combo slot at beat 0; the slot’s window spans 0.75 beat after it
The lock is the move clip, not the spin: Noa’s groovy-move clips hold it for 72 / 138 / 192 clock units by lane. At lanes 1 and 2 it covers the whole next combo slot, and at lane 2 also the first note of the next three-note combo, so that combo cannot close. A press made during the clip is not judged and does not spend a Triangle.

So the move is worth about 8.3 times an ordinary press plus a level, but only on the combo slot, and it costs the dancer’s input for the length of the clip. It belongs on the last note of a combo, in the lane where lane + 1 is biggest.

The finale tier. In the finish countdown and the result wipe (states 11 and 12) the pad is still read, and the same branch pays (lane + 1) × 17 << 1, the ×34 column above, and raises a per-dancer flag whose reader is not in the dump corpus. It is a timing tier, not a “perfect” one.

Award routine FUN_801D1AF4, 0x10 branch; finale arm 0x801D1CE0..0x801D1D30. Lock figures from the clip lengths at the hall’s frame delta of 3.

Playing it well

Each of these follows from a rule above.

The dancers

The overlay names every dancer through a per-mode spawn table and a five-record kind descriptor table; the bodies and clips come from the dance-hall scene module other7, whose first motion section is a 60-record animation bundle (PROT 1229). The rivals are dedicated dancer NPCs, not party members; the casino scene koin3 places the same NPCs on its own floor.

KindWhoMeshRig bones
0Noa, her field model, drawn at 1.25× beside the hall’s NPCsglobal pool slot 110
1Mary, centre stage in the finalsscene TMD 5811
2dancer NPCscene TMD 6212
3dancer recolourscene TMD 6112
4Disco King, the how-to teacherscene TMD 6310

Spawner FUN_801D0190, descriptors at 0x801D4E1C, face stamp FUN_801D03C4, per-dancer handler FUN_801D1358. The party-clip-bank bit 0x200 of a descriptor anim word is carried by no clip on the disc.

The how-to lesson

Mode 2 is driven by the Disco King’s own script, a state machine that prints a line, waits for any face button, and resets the shared run state between segments. In order:

  1. PromptA yes / no choice, moved by Left / Right although the options are stacked vertically. “No thanks” skips to an acknowledgement.
  2. Button pagesFour text pages on the buttons.
  3. Square / Circle practiceProbes the press through the real judge and praises a correct one; ends when a progress accumulator reaches 900.
  4. Level page“The level rises automatically”; arms the load gate.
  5. Groovy-move practicePraise or a timing scold off the triangle-landed flag, for the length of the feedback window; shares the 900 gate.

Two countdown holds clear the beat clock before advancing; both seed 0x3C and advance only once the timer goes negative, so they run one frame longer than the seed reads. The port carries the script’s shape only (dance_tutorial): the dialogue is Sony text, so hosts draw placeholder captions at the retail line positions.

Script FUN_801D0750, a 19-slot jump table at 0x801CEEE8, 18 working states.

What you see and hear

The HUD

Banners and sound

EventBannerSound
missed noteMiss!cue 0x210
closed chainGood! + two starsa random one of three stings
landed groovy move, lane 0Cool! + starscue 0x202 + the groovy sting
landed groovy move, lane 1Great!! + starscue 0x203 + the groovy sting
landed groovy move, lane 2Fever!!!cue 0x205 + the groovy sting
count-in / run startREADY... / GO!cues 0x200 / 0x201

A closed chain fires no SFX-ring cue: its sting keys two SPU voices directly out of the dance’s own sample bank, one of three random tone pairs. A groovy move plays its cue and a sting at a fixed variant (r = 5) that the random pick (r = 0..2) never reaches. The Chicken!! art on the HUD page has no widget record and no spawner.

The music

Each mode streams its song once the READY counter reaches 0x6F: extraction 1048 (music_01 #60, “Sol disco final 1”) for the qualifier and the how-to, 1054 (#66, “Sol disco final 2”) for the finals, and a rotation over 1065 / 1048 / 1054 in free play. The songs are short loops of about one 32-beat chart cycle. See music tracks.

HUD driver FUN_801D231C over a 34-record widget table at 0x801D46CC; cues are direct stores into the SFX ring (SFX table), descriptor block PROT 1228, samples PROT 1231; sting FUN_801D3D78.

The hall, the floor and the camera

The dance is an ordinary scene load. The hall - the raised stage, the checkered floor, banners, spotlight cones, smoke columns and fixtures - is the other7 scene module’s own field geometry, staged by the SCUS loaders the init calls. The overlay issues no texture or mesh load of its own; its own loads are all sound. Its art pack (PROT 1230, 31 TIMs) carries the HUD page, the three dancer face strips and the venue textures, and 27 of its 31 images match a live retail VRAM capture byte for byte.

Entry and exit are a save / restore pair. The init saves the walked-in scene’s name and PROT block base and points the block base at other7; the teardown restores both and arms a BGM reload, once the results fade completes.

The camera flies a keyframe track. From the entry pose it eases (a half-cosine) from key to key, one segment per 0x152 frames, wrapping from key 13 back to key 1, so key 0 plays only once and the flight is not locked to the beat. The how-to holds the entry pose throughout. On the far poses the eye passes behind the stage-entrance curtain; back-face rejection and the GPU’s polygon-size limit keep the curtain out of the frame, and the port applies both rules on every host, to the hall, the marker tiles and the animated props alike: the curtain is a prop, and a page that cut only the hall drew it across the whole frame.

The floor reuses the field engine. The floor passes walk the scene’s cell grid, and the step-marker tiles are the scene’s own tile-trigger records with clip 6..=9: ordinary field actors that each run a mesh flipbook, four classes out of step. On other7 ten such tiles land on drawn floor cells. Every other cell spawns a plain actor, and when its record names a clip the actor runs it every pass: the spotlight beams that sweep above the stage, their fixtures and the stage curtain all loop thirty-frame clips on one shared cursor. The port poses them on that clock on every host.

Only the hall stands. The init's step-marker walk covers one rect around the stage and spawns only the cells with a trigger record; the second floor pass is switched off by the flag the door warp leaves raised, so it spawns nothing. Every retail dance state holds exactly the 35 cells of that rect, and the hall's other placed props - those north of it and east of it - are not there. The port's hall draws the same 35.

Init FUN_801CEF54, exit FUN_801D414C; camera block 0x801CF51C..0x801CF7D8; floor passes FUN_801D3A2C / FUN_801D2A10; marker tick FUN_801D0640; floor kernel legaia_engine_field::minigame_floor.

The hall’s light show

The hall’s light show is palette work, not geometry. The session’s first state spawns two records of the other7 stager bundle at the origin, and they tree out into mode-3 CLUT-cell cyclers over rows 504..=508 (the floor, the walls and the stage lamps) and the scrollers and MoveImage strips of the wall panels. The cyclers follow one leader: the overlay installs its own handler in move-VM op 0x20, whose arm 0 copies the leader’s HSV adds into the caller and zeroes the caller’s rates, and whose arm 1 sets the caller’s V add. Arm 1 with -200 on the leader’s first frames is why the hall opens dark. The tree runs at the hall’s frame step, 3 in every parked dance state.

Port: World::stage_dance_ambient moves the walked-in scene’s ambient seat aside and installs the hall’s, and World::step_dance_ambient repaints the hall’s own VRAM on both hosts. The walked-in scene’s VRAM effects stop for the length of the dance, as they do in retail with that overlay swapped out. The hall’s wall panels and stage screens are step-marker tiles, drawn in place on the hall’s game frames, so their moving art is the tiles’ flipbook.

Spawns FUN_800252EC at 0x801CF9A8, 0x801CF9C0; op 0x20 handler FUN_801D387C, installed at 0x801CF07C. The leader’s rows match retail’s program row for row, but its phase is a clock of game frames, and seating it in a replay means seating every cycler’s phase; the floor’s colour in the two count-in comparison frames is what that leaves.

The hall’s colours depend on when you walked in. Coming through the door, the game does not reload the hall’s art: it keeps the video memory the dance club left, and the light show captures its palettes from there. Those palette cells are themselves strobing in the club, so the hall’s floor is a rotation of whatever colour the club last painted, not of the palette on the disc. The floor’s cells also copy the show’s leader only every other game frame, so on a strobe frame they can be a step behind the walls.

Where this is in the port

The dance is fully playable in the port on all three surfaces, with the rules, the cast, the HUD, the camera and the sound all running off disc data you supply.

Play it in the browser
The minigames page runs a qualifier session with the retail cast, the hall and the rivals scoring their own runs. Its camera starts moving with the song.
Reach it in the game
The play page and the native window run the world session: walk to the door in the casino, or on native press K for a qualifier and U for the how-to.

Internals

Key RAM

Per-dancer arrays use a player × 4 stride; index 0 is the human.

GlobalRole
DAT_801d5334Session state (0..0x14)
DAT_801d514cMode 0..3
DAT_801d581cBeat phase counter: % 0x119 phase, / 0x119 beat; wraps at 0x2320
DAT_801d5820Song timer; ends at 0x41DC / 0x64FC
DAT_801d53cc[]Score, clamped to 999; [0] is the cheat anchor for dance points
DAT_801d544c[]Groove gauge [0, 2999]; never lowered
DAT_801d534c[]Triangle stock, 3 per song
DAT_801d550c[]Chain cursor; cleared every 8 beats
DAT_801d570c[]Last Triangle landed on a combo slot
DAT_801d6090Accuracy weight 0..0x1000
Key functions
FunctionRole
FUN_801CEF54Init: scene staging, entry camera, ease table, face stamps, tick-actor spawn
FUN_801CF470Per-frame controller: states, camera track, beat clock, song end, grading
FUN_801D0190Dancer spawner
FUN_801D0750How-to script (the Disco King)
FUN_801D1358Per-dancer handler: clips, spin, combo-slot banking
FUN_801D1820CPU feed: what a rival presses this beat
FUN_801D1960Judge
FUN_801D1AF4Award routine: input, Triangles, gauge, score, banners, pose
FUN_801D231CHUD driver
FUN_801D414CTeardown

Three dumps named overlay_dance_* sit past the image’s end at 0x801D6818; their bytes are the fishing overlay’s, which loads at the same base.

Closed as negatives, and still open
  • Descriptor +0x20 has no reader. Two byte scans over SCUS and every mapped overlay find no load at that displacement; “dead data” is an inference.
  • The Chicken!! cell has no spawner. No widget record covers it, and the producible widget ids top out at 0x21. A drawer elsewhere stays possible and unevidenced.
  • Open: the dancers’ yaw on the retail floor; the reader of the finale-tier flag; the writer of a banner part’s fade word.

See also

Every state, table, HUD widget and camera key, with its provenance, is in docs/subsystems/minigame-dance.md.

Reference Field / event VM Move VM Actor VM Tile board Fishing Slot machine Baka Fighter Muscle Dome Cheats Minigames page