Terminal control/Dimensions: Difference between revisions

Content added Content deleted
m ({{omit from|GUISS}})
Line 104: Line 104:


Note also that this will typically include 37 extra pixels horizontally and 79 extra pixels vertically, which are not available to display text. In other words, if the result was 700 500 you would really have 663 pixels of width and 421 pixels of height.
Note also that this will typically include 37 extra pixels horizontally and 79 extra pixels vertically, which are not available to display text. In other words, if the result was 700 500 you would really have 663 pixels of width and 421 pixels of height.

=={{header|Locomotive Basic}}==

Locomotive BASIC cannot do this directly, so we have to use Z80 machine code to perform a firmware call to &bb69 (TXT GET WINDOW). It looks like this when disassembled:

<lang z80>4000 d5 push de
4001 e5 push hl
4002 cd69bb call $bb69
4005 ed532040 ld ($4020),de
4009 222240 ld ($4022),hl
400c e1 pop hl
400d d1 pop de
400e c9 ret</lang>

This routine gets POKEd into RAM (starting at address &4000) and CALLed from Locomotive BASIC, then the results are retrieved with PEEK:

<lang locobasic>10 s=&4000:SYMBOL AFTER 256:MEMORY s-1
20 FOR i=1 to 15:READ a:POKE s+i,a:NEXT
30 DATA &d5,&e5,&cd,&69,&bb,&ed,&53,&20,&40,&22,&22,&40,&e1,&d1,&c9
40 CALL s
50 h=PEEK(&4020)-PEEK(&4022)+1
60 w=PEEK(&4021)-PEEK(&4023)+1
70 PRINT "window width:"; w; ", height:"; h</lang>


=={{header|PicoLisp}}==
=={{header|PicoLisp}}==