• Opcode: 0x046
  • Short name: MESW
  • Long name: Display Message and Wait

Argument

none

Stack

Message channel

Message ID

MESW

Description

Popup a message window, and wait for the player to dismiss it before continuing. The size of the message window can be set with WINSIZE. The handler reads two stack values without popping them yet — the message ID (top) and the window/channel number beneath it — resolves the text from the field MSD via the channel, opens the window, and marks that channel busy. It returns 5 (wait, don’t advance) if the channel is already in use, 1 (wait) while the message is up, and only when the channel’s busy bit clears does it pop both values and return 3.

This is never used anywhere in the game, but it works. It was replaced by AMESW, which has built-in position and size parameters.

PC handler: SCRIPT_MESW.

Function addresses

Function Address Description
SCRIPT_MESW 0x528E40 Field script opcode handler (verified IDA function)