Dialogues, waiting and screen dimming

How modal windows start, stop, return a choice and dim the two screens.

Several windows share Studio's modal machinery. A background task completing, a user asking to stop and a window finishing its animation are different events. Addresses below are American V2; object offsets in this guide are decimal. [1]

Starting a waiting task

Dispatcher 02043A9C finds the waiting-window owner at application offset 5,440. When its active byte at offset 48 is clear, it enables dimming and calls the window's activation method. An already-active window skips both. It invokes the task callback with the context at application offset 5,488, then stores the returned handle at 5,492, including a zero result. This caller does not automatically turn a zero handle into an error or unwind the window. [1]

Waiting-window update 0205CC94 tracks pending work at byte 72, a stop request at 73 and sound state at 74, with a provider pointer at 56. It runs its entry animation and can start sequences 22 and 20. Provider polling updates the pending flag. A null provider leaves pending work pending. Releasing the stop control while work remains sets a request; it does not immediately cancel the task. Once work has finished, the sixty-tick condition or the recorded stop request can begin closing. [1]

Unsaved changes

The unsaved-changes confirmation has Back on the left and Yes on the right. Mode two shows those controls and hides the centre control. Input routine 02033A8C stores whether the left control was selected in result byte 88. The normal left/right sounds are 66/67; mode two reverses them. Optional automatic closure after associated work finishes sets byte 90, result zero and sound 66. [1]

The editor's result reader at 020568F0 reaches that byte through 02043BEC. Nonzero means Back and retains the editor; zero means Yes and leaves it. Treating every nonzero result as acceptance reverses this dialogue's meaning. [1]

Modal priority

Update 020434A4 checks the confirmation owner at application offset 5,432, then the full waiting window at 5,436, then the small waiting window at 5,440. Only the first selected active owner receives its update. When it finishes, dimming ends only if all three owners are inactive. [1]

Brightness registers

Fade calculation 02033D88 uses signed integer division. Writer 020B8D10 updates control, coefficients and intensity halfwords at 04000050 for the main engine and 04001050 for the sub engine. Normal main arguments are 59 and 47; an online predicate selects 59 and 4. The sub arguments are 63 and 47. Nonnegative intensity selects control 0x80; negative intensity selects 0xC0 and its magnitude. Coefficients are 31 and zero. A zero owner clears both control halfwords even if an individual screen-enable flag is clear. [1]

Original-code checks cover task dispatch, polling, button results, modal ordering and register writes. They do not prove cancellation safety for every provider or reproduce complete window animation timing on hardware. [1]

Dialogue configuration and text

American V2 common worker 02033514 locates its text node, checks whether the text pointer lies inside the loaded message DAT bank through 0206DA80, selects a font and colour policy, and invokes wide formatter 020D6654. The bank test uses the address range, not the words displayed. Text outside it takes the retained fallback font and alternate colour policy. Native node-enable writes show left/right buttons and hide the centre for two-button variants; the waiting configuration reverses those flags. Unsaved variants select mode two. Twelve comparisons cover six configurations and both pointer classes; final text binding and complete scene construction remain boundaries. [2]

Only the final modal closure ends dimming

020434A4 updates the current scene and companion, then chooses the first active of three modal objects. A lower-priority active object does not replace it. After its update, the selected object's activity is read again. Dimming ends only if it closed and all three modal flags are now clear; no active modal follows the normal state/animation-completion path instead. [2]

The end wrapper 02043830 passes the display object at application offset 5452 and a byte from the original global descriptor to 02034014. Completion copies display word twelve to eight, clears word sixteen and halfword four, then writes the selected completion value to halfword two. Fourteen comparisons check the whole twenty-byte state across every nonempty modal combination and closing/nonclosing updates. Final GPU composition, physical brightness and complete nested dialogue construction remain open. [2]

Warning admission order

02008364 queries 02056F40, 02057010, 020192BC, 02015C00 and 02024524 in that order. A nonzero result stops before later gates or warning publication. Only after all five permit progress does it inspect framework byte seven. [2]

SD stateChecked action
1Delegate to 02021048
3Request WARNING_WRITE_PROTECT_SD, clear byte eighteen and publish zero
4Request WARNING_IGNORE_SD, clear byte eighteen and publish zero
5Set framework byte twelve and format byte two, then publish zero without a warning request here
6Clear byte eighteen and publish zero without a warning request here
Other checked statesNo dispatch or state mutation

Further execution removes the first two gate substitutes. 02056F40 uses transition idle, application byte 5484, effective state, three windows' byte-forty-eight flags and tutorial activity. Effective-state reader 0202BFEC prefers a nonzero pending state over current state. 02057010 tests modes one, seven and thirty-seven. State-three publication reaches real guarded writer 02005DA8. The remaining three gates and warning painting still have controlled results; their physical meanings and the complete alert system are not established. [2]

Sources

  1. [1] Flipnote Decompilation Project — Original dialogue and waiting-window behaviour
  2. [2] Flipnote Decompilation Project — Dialogue font admission, modal completion and warning priorities

← All documentation