Title screen drawing (Menu/FDLogo.alr, title*_?s.cso + executable)
What script built-in 0x6023 draws: the title
is not a set of menu sprites but a small
multi-pass scene of its own (code
0x140276600–0x14027a850): a scrolling cloud
plane, the logo in two layers, nine animated
flame sheets, a start prompt, a legal line, and
a five-level glare built from the frame itself.
Addresses are for Store build 1.3.25854.2. Read
in the executable and its six title
shaders; the quad tables were pulled out of the
straight-line code with a symbolic tracer and
checked against the sprite sizes of the user’s
FDLogo.alr. H
where code and data agree (marked),
M otherwise. Nothing here was
compared with footage yet.
This extends the menus run’s group 6 notes
(state machine, 0x6020–0x6027) and corrects one
of them: the sound bank
Title_Logo.bin that 0x8046 / 0x8047
load is sound only (“Sound
banks”); every picture of the title comes from
Menu/FDLogo.alr.
Files and resources
Menu/FDLogo.alris loaded by the profile screen’s script into texture-set slot 0 (0x2050 with slot 0, load mode 1) before 0x6020 runs. 0x6020 (0x140276600) copies the slot’s first 12 sprite entries into its own table 0x14059d568[12]. Sprite i of the file (pixel sizes read from the user’s file) and its use (H):i Size Use 0 560 × 96 logo, base layer 1 576 × 112 logo, tinted glow layer 2 96 × 80 not drawn by this code 3 304 × 40 start prompt 4 368 × 16 legal line 5 512 × 512 cloud layer (three of the four cloud samplers) 6 256 × 128 cloud shade (fourth cloud sampler) 7, 8 512 × 1024 flame sheets, 8 × 16 cells of 64 px (128 frames) 9, 10, 11 512 × 512 flame sheets, 8 × 8 cells of 64 px (64 frames) 12 260 × 50 not copied, not used by the title Menu/Title.alr(three 640 × 480 pictures) is named by no script and no executable string: unused in this build (M).Menu/MSLogo.alrgoes into slot 1 and is drawn by the profile script itself with the ordinary sprite built-in (0x2052), not by 0x6023.Shaders, created in 0x6020 and kept as handles: 0x14059dd68
title_cloud_ps, 0x14059dd6ctitle_glare_ps, 0x14059dd70title_blur_ps, 0x14059dd74title_general_ps, 0x14059dd78titleV_vs, 0x14059dd7ctitle_cloud_vs(name table near 0x1403dc5f8, H).Render targets, made in 0x6020 from one 4 MiB block: one 592 × 456 target (0x14059d430; never bound in this build, a leftover) and the glare chain: 5 levels × 2 textures, 256 × 192, 128 × 96, 64 × 48, 32 × 24, 16 × 12 (descriptors 0x14059d450 + 0x14 × n, surfaces 0x14059d518[10]). 0x6021 (0x140276770) releases them (H).
Movies: none in the title drawing. The profile script plays movies itself through the event-movie built-ins (0x312D open(name, 0, 0), polled until true; 0x312F(0x1010) skip mask; 0x312B finished; 0x3127 mode before / after): one logos movie before the title and, after 1800 idle ticks on the title (event 2), one of three demo movies. Files come from
Movie/<name>with the extension swapped for the PC container (movie class 0x1401bd160–0x1401bd5a9). What 0x312D returns when the file cannot be opened was not followed (L). The dump on the data machine has noMoviefolder.
State and timing (0x6022 tick, 0x140276d50)
Globals: state 0x14059dd90, state start frame T0 0x14059dd94, frame counter F 0x14059dd98 (F += 1 at the end of every tick while state ≠ −1; this is the increment the menus run did not locate), and four levels recomputed every tick: A 0x14059dda4 (background and base logo), B 0x14059dda8 (prompt, flames, final logo), C 0x14059ddb4 (logo glow), D 0x14059ddac (prompt pulse). Each tick starts from A = B = C = 0, D = 0.6. A colour set word 0x14059dd8c picks one of three tints in every pass; it is only ever written 0, so the gold set below is the one in use (sets 1 and 2 are dead code).
| State | Per tick (t = F − T0) |
|---|---|
| 0 | T0 = F, state = 1 |
| 1 intro | A = (t / 40)² for t < 40, else 1. With u = t − 10, for u > 0: C = 0.5 − 0.5 cos(π u / 50) for u < 50; 0.75 + 0.25 cos(π (u / 50 − 1)) for 50 ≤ u < 100; 0.5 from u = 100. For u > 90: B = ((u − 90) / 25)². When u > 115: T0 = F, state = 2 |
| 2 idle | A = B = 1, C = 0.5, D = 0.8 − 0.2 cos(π t / 20) (period 40 ticks, 0.6 … 1.0) |
| 3 / 4 leaving (confirm / cancel) | r = T0 − F + 50, counting 50 → 0; at r = 0 state = −1. A = (r / 40)² for r < 40, else 1. With w = r − 10, for w > 0: w > 25: C = 0.2 + 0.3 (w − 25) / 15 and B = ((w − 25) / 15)²; w ≤ 25: C = 0.1 − 0.1 cos(π w / 25), B = 0 |
| −1 | nothing (levels stay 0) |
So the glow swells to full at tick 60,
settles to half at 110, the prompt and flames
fade in over ticks 100–125, and the screen is
idle from tick 126 (H for the
arithmetic; the cosine is the C library
cosf). 0x6024 (skip) and 0x6025
(confirm / cancel) set T0 = F with the new
state, as the menus run wrote down.
Drawing (0x6023, 0x140279e70)
All 2-D quads use titleV_vs
(position from the 2-D transform buffer, four UV
sets, each offset by vertex constants c92–c95)
and positions in the menu’s 640 × 480
design space; every coordinate carries
a +1/32 offset (34.03125 and so on; whole
numbers are given below). The full-screen quads
span x −106.625 … 746.375, y 0 … 480, which is
the 16:9 frame of the PC port around the 4:3
design area (M). Vertices are
44 bytes: position x y, packed colour, four UV
pairs (helper 0x14027a640 draws one quad). Order
per frame, all to the back buffer:
- Glare source (blending off): the glow logo and the prompt (0x140278360, argument 0), then the nine flames with maximum blending (0x140278930).
- Glare chain (0x140277020,
blending off): the frame so far is sampled
(viewport rectangle of the frame texture) into
level 0 with
title_glare_ps, then each level into the next. Then per level: 8 blur passes along x and 16 along y withtitle_blur_ps, ping-ponging between the level’s two textures (the result ends in the first). Tap offsets through c92–c95: (−2.07585, −0.548137, 0.548137, 2.07585), divided by 640 for x and by 480 for y, the same UV step on every level. c92–c95 are zeroed afterwards. - Clouds: target back to the back buffer, then the cloud plane (below). It is opaque and covers the whole frame, so step 1’s pixels survive only inside the glare.
- Base logo (0x140279640, argument 0): sprite 0 at (47, 153)–(607, 249), colour (1, 1, 1, A), normal alpha blending.
- Glare, multiplied in (0x140279aa0, argument 0; blend source = destination colour, destination = one): the five levels as full-screen quads, each (0.8, 0.8, 0.8, 1).
- Additive layer (source one, destination one): glow logo and prompt again (argument 1: the prompt without its pulse), the nine flames, then the five glare levels with colour (1, g, g, 1), g = 1, 0.75, 0.75², … per level (argument 1).
- Final logo (0x140279640, argument 1): sprite 0 again with colour (1, 1, 1, B), normal alpha blending; then the legal line (0x140279410): sprite 4 at (136, 379)–(504, 395), colour (1, 0.5, 0.2, 0.75 B), u running 0 … 1.09524 (past the edge: the port’s quirk).
- Texture stages 0–3 are cleared.
Quads of 0x140278360
(title_general_ps: texture × vertex
colour, alpha = texture alpha × vertex alpha;
samplers clamped):
| Quad | Sprite | Rectangle | Colour (gold set) |
|---|---|---|---|
| glow logo | 1 | (34, 139)–(610, 251) | (C, 0.9 C, 0.4 C, 1) |
| start prompt | 3 | (177, 312)–(465, 352) (288 wide for a 304 px picture) | (p, 0.8 p, 0.4 p, 1), p = B × D (argument 0) or B (argument 1) |
Flames (0x140278930), all with colour (q, 0.9 q, 0.4 q, 1), q = B × C. Frame f = (F + offset) & mask; cell column f & 7, row f >> 3; u from (64 col + 0.5) / 512 to (64 col + 63.5) / 512, v the same with the row over the sheet height (1024 for sprites 7 and 8, 512 for 9–11) (H: the masks and divisors match the sheet sizes):
| # | Sprite | Rectangle | Offset | Mask | Note |
|---|---|---|---|---|---|
| 1 | 7 | (42, −104)–(221, 164) | 0 | 127 | |
| 2 | 8 | (334, −57)–(451, 177) | +24 | 127 | |
| 3 | 9 | (427, 5)–(535, 221) | −16 | 63 | |
| 4 | 10 | (49, 45)–(128, 203) | +24 | 63 | |
| 5 | 8 | (198, 68)–(275, 209) | +44 | 127 | |
| 6 | 11 | (369, −57)–(503, 211) | 0 | 63 | bottom-right u uses +65.5 instead of +63.5 (as shipped) |
| 7 | 8 | (278, 144)–(357, 212) | +24 | 127 | mirrored in u |
| 8 | 10 | (495, 24)–(580, 212) | −28 | 63 | |
| 9 | 11 | (278, 84)–(357, 212) | +24 | 63 | mirrored in u |
Glare quads (0x140279aa0): level n’s first
texture on all four stages, the four UV sets
shifted by (±0.5 / 640, ±0.5 / 480) (one sign
pair per set), title_glare_ps.
Cloud plane
A 3-D quad drawn with
title_cloud_vs /
title_cloud_ps under a perspective
projection of its own: vertical field of view
60°, aspect 1.29825 (= 592 / 456), near 1, far
100, camera at the origin looking along +z.
Static vertices (48 bytes each: position,
colour, four UV pairs):
| Vertex | Position | UV 0 | UV 1 | UV 2 | UV 3 |
|---|---|---|---|---|---|
| 0 | (−38.2, 8, 13.7) | (0, 0) | (2.3, 0.5) | (0.4, 0.3) | (0, 0.3) |
| 1 | (38.2, 8, 13.7) | (2, 0) | (0.3, 0.5) | (2.4, 0.3) | (1, 0.3) |
| 2 | (38.2, −29.4, 50.5) | (2, 1.7) | (0.3, 2.2) | (2.4, 2) | (1, 1) |
| 3 | (−38.2, −29.4, 50.5) | (0, 1.7) | (2.3, 2.2) | (0.4, 2) | (0, 1) |
The near edge sits on the top of the view and the far edge on the bottom (8 = 13.7 tan 30°, 29.4 ≈ 50.5 tan 30°), so the plane fills the frame and recedes downwards (H, geometry checked against the projection).
- Each draw adds to the stored UVs (they accumulate, never wrap): set 0 += (0, 0.006), set 1 += (0.00048, 0.0066), set 2 += (0.00024, 0.0072), set 3 += (0.0006, 0) (0.006 × a constant table).
- Vertex colours each frame: top pair (0.8 A) on all four channels; bottom pair (0.0973 A, 0.0973 A, 0.0973 A, 0.8 A) (0.0973 = 0.8 × 0.121569).
- Textures: sprite 5 on stages 0–2 (UV sets 0–2), sprite 6 on stage 3 (set 3); wrapping, linear.
- Pixel formula (colour c = vertex colour clamped to ±1, a = c.a, t0…t3 the four samples): m = 1 − 2 (1 − t0)(1 − t1) where t0 · (0.301961, 0.588235, 0.109804, 1) > 0.5 (the dot product includes t0’s alpha), else 2 t0 t1; rgb = m × t2 × t3 × c.rgb × (1 − (1 − a)²) + (1 − a)² × a × (0.54902, 1, 0.8); alpha 1.
The other two pixel shaders
title_glare_ps: the mean of four samples (one per UV set) × vertex colour; alpha = saturate(vertex alpha × mean alpha).title_blur_ps: (2 t0 + 15 t1 + 15 t2 + 2 t3) / 34 over the four UV sets (weights 0.117647 and 0.882353, halved); alpha the same and saturated.- All three 2-D pixel shaders discard a pixel whose alpha is not above the engine’s alpha reference constant (the reset 0x140276a80 sets the reference state; its value in these passes was not followed, L).
Other built-ins around the title
- 0x8048 releases the title sound bank (0x140245540); 0x8049 (0x1402198b0) releases the list of title sound objects at [0x140533a48]; 0x804A(0) (0x140219910) writes stored levels back into that object (a volume / stop helper, L). They only matter for the logo jingle.
- 0x207F (0x140208770) returns whether the renderer helper 0x1400218a0 answers non-zero (a display-side query of the PC port; meaning not followed, L). The shared dialog 0x140169d60 was not read in this run.
Implementation notes for the rebuild
- Draw the title from
FDLogosprites 0, 1, 3–11 with the tables above; drive it from the decoded tick (levels A, B, C, D, frame counter F stepping once per menu tick) so the existing state machine needs no change beyond exposing the four levels and F. - Passes in order: glare source into an
off-screen copy (glow logo, prompt, flames with
max blending on black), five-level downsample
(256 × 192 halving to 16 × 12) with 8 horizontal
+ 16 vertical four-tap blur passes per level,
cloud plane, base logo (alpha A), glare
multiplied in at 0.8 per level, additive glow
logo + prompt + flames + tinted glare levels,
final logo (alpha B), legal line. In Godot: one
SubViewport for the glare source, the chain as
five pairs of small SubViewports (or one shader
looping the taps), a canvas shader per
title_*pixel formula; nothing here needs a 3-D scene except the cloud quad, which can be a canvas polygon with the projected corners (the projection is fixed) and perspective-correct UVs. - Keep the UV accumulation of the cloud plane per draw, the +1/32 position offset, the stretched prompt (288 for 304 px), flame 6’s 65.5 and the legal line’s u past 1 with clamping: they are the shipped picture.
- The 4:3 design area sits in the middle of a 16:9 frame; full-screen quads and the cloud plane cover the whole frame, the logo quads keep their 640 × 480 coordinates.
- Movies: answer 0x312D and 0x312B “done” at once (no movie playback), so the logos movie and the idle demo fall through to the title; list as a placeholder.
- The title sound bank calls (0x8046–0x804A) can stay as loaded / no-op until the jingle cue is decoded.