MsgDialog::BuildRequest turns a parsed user message with button type 0, 1, 3 or 4
into a ModalDialogRequest: OK; Yes and No; OK and Cancel; Yes and No with the
focus on No. The cancel input picks the last button. Dialogs without a message
pointer, in progress bar or system message mode, without buttons or with a
button type outside those four are not presented, so their callers keep the
automatic answer. The button id of a choice is its index plus one.
The overlay draws UTF-16 code units. MsgDialog::DecodeUtf8 converts a guest
message, replacing each byte of an invalid, overlong, truncated or surrogate
sequence and each stray continuation byte with U+FFFD, and encoding code points
past U+FFFF as surrogate pairs.
sceMsgDialogOpen read the mode, the user message parameter, the button type and
the message through a function that wrote file-scope state. The parse is now a
stateless header returning a ParsedParam, so both message dialog libraries and
tests can share it. The mode, the readability checks, the focused button and the
logged text are unchanged.