Prev: 64313 Up: Map Next: 64354
64317: Display an information window with text at HL and return to game
This routine is called by the instructions at 43620, 44896, 64261, 64293, 64297, 64301, 64305, 64309 and 64313. Immediately after each of these calls is a byte of data representing the index of the window to draw. This data is read in this routine by loading the return address (where the data is held) into DE and then performing a LD A,(DE).
Used by the routines at 43494, 44861, 64258, 64290, 64297, 64301, 64305, 64309 and 64313.
Input
HL Points to text to print in the window
64317 POP DE Remove value on top of stack, as we are not returning to this address, but reading data from it
64318 LD A,(DE) Load A with window index data...
64319 LD (64340),A ...and modify instruction at 64339 with this index
64322 PUSH HL Store HL (pointer to text to print)
64323 LD L,A Load eight times window index into HL...
64324 LD H,0 ...
64326 ADD HL,HL ...
64327 ADD HL,HL ...
64328 ADD HL,HL ...
64329 LD DE,49036 Point DE at y-coordinate of top of window in first entry of window data table at 49034
64332 ADD HL,DE ...and add HL as offset in HL
64333 EX DE,HL Swap DE (now points to y-coordinate of top of required window) and HL (now points to first entry in window data table)
64334 POP HL Restore HL (pointer to text to print)
64335 CALL 45617 Adjust height of window to accommodate text
64338 PUSH HL Store HL (pointer to start of text data)
The operand of the instruction at 64339 represents a window index. This is modified by the instruction at 64319.
64339 LD A,0 Draw window with index specified in data previously...
64341 CALL 47193 ...
64344 POP HL Restore HL (pointer to start of text data)
64345 CALL 46902 Print text to screen
64348 CALL 64230 Wait for interrupt then display "PRESS FIRE TO CONTINUE" window and wait for fire to be pressed
64351 JP 41742 Set Magic Knight's available action flags and jump to start of main game loop
Prev: 64313 Up: Map Next: 64354