![]() |
Forum Index : Microcontroller and PC projects : CMM2: VGA output and Terminal Control Escape Sequences
Author | Message | ||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Hi folks, I think this is a noob question that I already know the answer to, but if I PRINT VT100 escape codes then whilst my Putty, Tera Term or the like terminal might behave as I expect the VGA output is just going to print those codes verbatim? From which am I correct in surmising that the behaviour of the inbuilt editor where both the serial console and VGA show the same "rich" text UI is not possible from within BASIC ? Related questions, from within BASIC: 1. Can I detect if VGA is connected? 2. Can I detect that a serial console is connected? 3. Can I detect height/width of any connected serial console? Regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
No to all of them You can get round this with a bit of Basic code. Set OPTION CONSOLE SERIAL at the top of your program. This means PRINT statements don't go to the VGA screen Then create a Basic subroutine that does a PRINT for the serial console and a TEXT for the screen. Needs a little bit of work but nothing too difficult. You can also use the PRINT @ command (see manual) which is interpreted for both the serial console and the VGA screen depending on how "rich" you need the text to be - it only supports cursor positioning on the serial console Edited 2020-06-18 02:25 by matherp |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Thanks Peter sounds like there is something I can work with if necessary. Follow up questions: 1. The manual documents POS as obsolete, what replaces it for querying the current cursor column? 2. Is there a way to query the current cursor row? - I may be repeating myself having asked that question wrt the CMM1 months ago. Best regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Further follow up question: 3. Do the serial and VGA consoles share state or can you safetly toggle between them using OPTION CONSOLE and PRINT differently to each ? MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
MM.INFO(VPOS) MM.INFO(HPOS) A graphic screen characters can start at any column. If we go text 5,0,"A"; MM.INFO(HPOS) will be equal to 13 assuming font 1 As long as you cursor position before each it should be OK as the cursor position is shared. However, the strong recommendation is that the TEXT command is used for graphics rather than PRINT |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
It would depend on the capabilities of the serial console connected. Some of the terminal program will respond to queries. Most Terminal programs will answer with their terminal version. Some might be able to give their size. If you get an answer to a query, you know something is out there but if no answer, it still might be a silent terminal connected. Jim VK7JH MMedit |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |