Commodore 128 Alive!

Commodore 128 => 128 programmers => Topic started by: Stephane Richard on October 13, 2006, 02:16 AM

Title: Switching programmatically between 40 and 80 column mode.
Post by: Stephane Richard on October 13, 2006, 02:16 AM
I know this can be, done, I've seen it done, my main question is can BASIC 7.0 do it directly or do I need ASM help?

Anyone know how to do this?  I've notced that the GRAPHICS command, if I'm in 80 column mode, and I issue a GRAPHICS 0 it switches to the 40 column display and everything else is printed there...however, once in there, if I tried to swich back to 80 column and shift everything there using GRAPHICS 5 it doesn't print things there, but rather, prints it still on the 80 column display.  Could someone with a 128 (and hopefully two monitors or a setup to test this) give this code a try and let me know what happens?

100 GRAPHICS 0
110 COLOR 5, 8
120 SCNCLR 0
130 PRINT "THIS IS A TEST"
140 GRAPHICS 5
150 COLOR 5, 2
160 SCNCLR 5
170 PRINT "THIS SHOULD BE ON THE 80 COLUMN DISPLAY"

Thanks all, I'm just wondering :-).
Title: Switching programmatically between 40 and 80 column mode.
Post by: istvan on October 13, 2006, 03:27 AM
The command you want is "GRAPHIC", not "GRAPHICS".  When you use "GRAPHICS", basic will assume you meant "GRAPHIC S", where S is a variable that equals zero.  So, wherever "GRAPHICS" is used it will be the equivalent of "GRAPHIC 0", unless the variable S has been assigned some other value.

I hope that makes sense, let me know if I need to reword that.
Title: Switching programmatically between 40 and 80 column mode.
Post by: Stephane Richard on October 13, 2006, 06:31 AM
Thank you so much istvan, seems the doc I was reading had a typoe.  you're right, and the corrected code performs exactly as expected.  

Thank you, I really appreciate it :-).
EhPortal 1.34 © 2025, WebDev