|
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: AustraliaPosts: 195 |
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 KingdomPosts: 8297 |
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: AustraliaPosts: 1051 |
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 KingdomPosts: 8297 |
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: AustraliaPosts: 195 |
@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 KingdomPosts: 8297 |
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 |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |