Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:53 19 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : ArmmiteF4 - how to determine if a display is configured

Author Message
erbp
Senior Member

Joined: 03/05/2016
Location: Australia
Posts: 195
Posted: 08:51am 06 Nov 2021
Copy link to clipboard 
Print this post

Is there a way on the ArmmiteF4 to determine if a display has been configured or not from within a program (using f/w v5.07.00)?

Also is it possible to determine the values of the OPTION DISPLAY settings - # of lines and # of chars?

Thanks,
Phil.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8297
Posted: 09:18am 06 Nov 2021
Copy link to clipboard 
Print this post

From the PicoMite v5.07.00 manual:

Try MM.INFO$(LCDPANEL), which should return the display type or a blank string for none.

MM.HRES would give you the horizontal resolution. If you divide that by the MM.FONTWIDTH value for the system font that might give you the characters/line and similarly for the equivalent vertical values MM.VRES and MM.FONTHEIGHT. Note that you'll have to have that font set as the current one.

I'm only guessing that these will work, I've not tested them as I've no display for my F4 yet. It's on the "To Do" list. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1051
Posted: 11:44am 06 Nov 2021
Copy link to clipboard 
Print this post

MM.VRES\MM.FONTHEIGHT  and MM.HRES\MM.FONTWIDTH  will give you the display settings if you have OPTION LCDPANEL CONSOLE set as this is the calculation it uses to determine the number of columns and rows.

If the CONSOLE is not on ie. OPTION LCDPANEL NOCONSOLE then the display is the default
80 * 24 unless you have set it to something else with OPTION DISPLAY lines,chars

The MM.VRES\MM.FONTHEIGHT calculation will still give the same result, however it wont  determine the display setting like it does when OPTION LCDPANEL CONSOLE is in use.
F4 H7FotSF4xGT
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8297
Posted: 12:40pm 06 Nov 2021
Copy link to clipboard 
Print this post

The important thing is that MM.FONTHEIGHT and MM.FONTWIDTH only apply to the currently selected font. You can't be in a different font in your program and use them to determine the rows & columns on the console.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
erbp
Senior Member

Joined: 03/05/2016
Location: Australia
Posts: 195
Posted: 09:06am 07 Nov 2021
Copy link to clipboard 
Print this post

@Mixtel90 and @disco4now,

Thanks guys - I had forgotten about MM.INFO$(LCDPANEL). I also realised after posting that MM.HRES or MM.VRES could also be used as they would return 0 if no display is configured.

Anyway I have since realised that the second question (how to programatically access the DISPLAY option settings) is the more important one, and is key to knowing how many chars per line and lines per "screen" the console is expecting to be able to use.

When OPTION LCDPANEL CONSOLE is in use, the DISPLAY OPTION is locked at the system derived values based on screen size and font selected for the console. Since there is no way to know for sure what font was selected when the option was set, there is no way to programatically calculate the DISPLAY settings that would apply. When the LCD CONSOLE is not in use, the DISPLAY OPTION is unlocked and can be set manually by the user, so again there is no way to determine what the setting is from within a program. It is ONLY accessible to the interpreter. It would be nice if there were a MM.INFO$(DISPLAY) Read Only Variable that would return the setting so that a program could use it.

In the meantime, for my purpose I will just use the 18 lines x 40 characters value as my program is (currently) targetting a F4 with ILI9341 using OPTION LCDPANEL CONSOLE 1

Thanks for your help anyway.
Cheers,
Phil.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8297
Posted: 09:33am 07 Nov 2021
Copy link to clipboard 
Print this post

I wonder if there's a couple of system variables that could be PEEKed?
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025