[ZILF] Getting height of window

Hey, this is a quick question about ZILF versions (I guess XZIP and up).
So I was looking through some code, and saw how it seemed the line:
Sets the variable WIDTH to be the width the screen. I wanted to see if there is a similar way I could get the height of the window? (So I can print text that is centered in the screen, say in the dedication for a game at the very start or something?) This question was inspired from UPDATE-STATUS-LINE routine.
Thank you very much for your help, cheers!

LOWCORE can read the field-spec SCRV (SCReen Vertical).

I’m currently writing a Reference Guide for ZILF where I try to collect all these things. I’m far from finished, but you can find it here if you are interested.

I’m not sure that SCRV works in all screens and under all circumstances. You can always look how the quotes in TRINITY is done (<ROUTINE WINDOWS, I think).

TRINITY doesn’t center it vertical but changes the SPLIT a draws the quote and fixed number of lines from the top of the screen.

1 Like

Locations 0x20 and 0x21 in the header hold the screen height in lines and width in characters respectively. <LOWCORE SCRH> is reading byte 0x21 from the header (“low core” = the bottom of RAM); as Henrik mentions, there’s also a constant SCRV (SCReen Vertical dimension) that can be used in the same way.

Note that a value of 255 for SCRV means “no height limit”, for example on an old-fashioned teletype.

1 Like

Great, works like a charm!
Thank you so much!