Just a quick question(ish)

Anything QL Software or Programming Related.
Post Reply
User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Just a quick question(ish)

Post by Mr_Navigator »

Happy New Year to one and all, I hope you have time for QL'ing

I have an SMSQ/e question based around QemuLator and it maybe relevant to QPC2 and SMSQemulator too but I haven't got around to checking that yet.

So in QemuLator I set the video card emulation to Q60 and load in the SMSQ code with

Code: Select all

LRESPR win1_turbo_sms_code
This all works fine.

Memory is set to 8 Meg

I then set up screens with the following procedure

Code: Select all

290 DEFine PROCedure D
300  DISP_COLOUR 3, 1024, 768
310  WINDOW#0,1024,65,0,702:CSIZE#0,1,1:BORDER#0,1,7
320  WINDOW#1,1024,700,0,0 :CSIZE#1,1,1:BORDER#1,1,6
330  WINDOW#2,1024,700,0,0 :CSIZE#2,1,1
340 END DEFine
Again all works fine

For resetting back to normalish views I use this

Code: Select all

420 DEFine PROCedure R
430  DISP_COLOUR 0,512,256
440  MODE 4
450  WTV
460 END DEFine
Again this works OK, plenty of memory left >7 meg.

However now when I call the 'D' procedure again I get an error on line 310 stating "Value out of range" and in order to eliminate the error, the values for the window have to be within the original QL specifications of 512,256,0,0. This is despite the values coming back from SCR_XLIM and SCR_YLIM of 1024 and 768 respectfully. So what gives?

I've just tried the D routine in QPC2 and get the same error, am I missing something simple?


Lee


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
User avatar
tofro
Font of All Knowledge
Posts: 2702
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Just a quick question(ish)

Post by tofro »

Lee,

you got caught by the pointer environment ;)

The first primary window of a program defines its outline - That is, the area of the screen that is going to be saved by the pointer environment in order to restore screen contents "underneath" the program's windows. After the outline is set, any attempt to move or resize or even open another window outside this outline will be rejected.
If you want to enlarge an S*BASIC window, you first need to use OUTLN in order to make the managed area bigger, then you can set your window to whatever size you want, after that adapt the outline to the new size, like

Code: Select all

100 rem Make window smaller
110 window #0,512,256,0,0
120 rem now set a large outline
130 outln #0,1024,768,0,0
140 rem now you can enlarge #0
150 window #0,1024,768,0,0
160 rem adapt outline to new window size 
170 rem (Note without any parameters, outline is set to the window's outer limits)
180 outln #0
Not tested, but should work like that.

This is the price you pay for having the OS preserve the area "underneath" your basic windows.

If you want to "see" the outline, you can add 2 additional parameters to set a "shadow" to the outline like

Code: Select all

outln#0,512,256,0,0,4,4
Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Re: Just a quick question(ish)

Post by Mr_Navigator »

Many thanks Tofro, I will try that later tonight


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
Post Reply