Page 1 of 1
Switching screen modes
Posted: Wed Nov 25, 2020 12:06 pm
by bwinkel67
So I can do the following in BASIC to switch between TV and Monitor mode (in JSU):
In Digital C SE I can do the poke as follows:
Code: Select all
char *mem;
mem = _makerel(0x28032L)
mem[0]=2;
How do I do the NEW? Haven't looked through appropriate trap call...will I find it there?
Re: Switching screen modes
Posted: Wed Nov 25, 2020 1:00 pm
by mk79
NEW deletes the program and redraws the Basic windows. You're not in Basic, what exactly should happen? If you want to redraw your own C windows, just do a Border/Clear call on them.
Re: Switching screen modes
Posted: Wed Nov 25, 2020 5:20 pm
by bwinkel67
mk79 wrote:NEW deletes the program and redraws the Basic windows. You're not in Basic, what exactly should happen? If you want to redraw your own C windows, just do a Border/Clear call on them.
If I do that in BASIC (i.e. change border and clear nothing happens whereas with NEW the screen mode changes from TV mode to Monitor mode and on my JSU rom it switches from NTSC to PAL. I've also tried MODE and again, nothing. So NEW seems to do something on top of that that causes the computer to refresh.
I suppose another question, sometimes a program forces the screen mode and with a JSU rom that means my display switches resolution (on a CRT TV that's more than just changing window configurations since the signal becomes unstable in Monitor mode). Besides changing the value at address 163890, what else does a running program do to basically repeat what happens during F1 vs F2 bootup.
Re: Switching screen modes
Posted: Wed Nov 25, 2020 5:26 pm
by mk79
Ah, now I get your problem. Use MT.DMOD trap to change your screen mode, don‘t poke it in the system variables. That should have the desired effect.
Re: Switching screen modes
Posted: Thu Nov 26, 2020 1:08 am
by bwinkel67
mk79 wrote:Ah, now I get your problem. Use MT.DMOD trap to change your screen mode, don‘t poke it in the system variables. That should have the desired effect.
That did the trick. Unfortunately it didn't work for my purpse...I was hoping the program that was running would yield time to my exec'ed process so I could kick screen resolution back to TV mode but the program below never ran. I'll have to go and debug that other program instead to see if I can undo the screen switch. I did that with Tank Busters almost 30 years ago and found out where it was forcing the screen switch so I could run it on my US TV back then...think I must have used Qmon for that since I own it.
Code: Select all
#include stdio_h
long key[8] = {0X0};
long ret[8];
main()
{
char *mem;
pause(2700);
key[0]=16; /* 0x10 -- $10 */
key[2]=2;
trap1(key,ret);
}
Re: Switching screen modes
Posted: Thu Nov 26, 2020 8:52 am
by Derek_Stewart
mk79 wrote:Ah, now I get your problem. Use MT.DMOD trap to change your screen mode, don‘t poke it in the system variables. That should have the desired effect.
Hi,
This is the correc tprocedure to chnage the QL Screen Mode, as just poking the System Variables will chnage the Screen Mode as required, but the operating system will not register the screen mode change, causing a conflicit.
This is mentioned most good QL technical books.
Re: Switching screen modes
Posted: Thu Nov 26, 2020 10:20 am
by mk79
Derek_Stewart wrote:This is the correc tprocedure to chnage the QL Screen Mode, as just poking the System Variables will chnage the Screen Mode as required, but the operating system will not register the screen mode change, causing a conflicit.
This is mentioned most good QL technical books.
Yes. But to be pedantic, changing the system variables does nothing per se. What the NEW command however does is re-setting the mode by first reading it and then setting it again, presumably to get a free re-initialization of its windows. The hardware doesn't allow reading the actual mode, so the value written in the system variable is used instead. This is where the mode change happens in this case. But it's seldom a good idea to just go and write stuff to the variables, many times there is a better way.