Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 02:26 02 May 2024 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 : PicoMiteVGA V5.07.07b19 - Major enhancement - 640x480  edit in colour

     Page 1 of 5    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 12:57pm 16 Feb 2023
Copy link to clipboard 
Print this post


PicoMiteVGAV5.07.07b19.zip




This release will delete all flash disk files and options

I was working on the Telnet connection to the WEB version when, prompted by posts on the TILE thread, I realised, based on a similar approach to the implementation of Telnet,  I could potentially significantly enhance the VGA functionality much more easily than I had previously thought and this is the result.

Basically to achieve this I just had to modify two drawing primitives in the firmware DRAWBITMAP and SCROLLLCD and gain some memory.

The memory was gained by reducing the maximum program size to 96Kb (from 100Kb) and consigning some of the SDcard routines from RAM to Flash memory. This allows for 80x40 tiles 8 pixels wide and 12 pixels high, or the existing 40x30 tiles 16 pixels wide and 16 pixels high.

The key to this release is in the DRAWBITMAP routine. Previously in mono mode this just output an "on" pixel or an "off" pixel. However, it was already being fed with the foreground and background colours - it just ignored them.

Now, it analyses the bitmap subject to the following conditions:
Does the bitmap start on a pixel exactly divisible by the current tile size both vertically and horizontally?
Is the bitmaps' width and height an exact multiple of the current tile size?

In the case of the editor both these conditions will always be met.

If the conditions are met then the DRAWBITMAP routine now sets the tile(s) where the bitmap (typically a text character) will appear to the foreground and background colours requested.

The change to SCROLLLCD was similar. If the vertical scroll is equal to an exact multiple of the current tile's height then scroll the tile colours as well as the screen pixels

These two simple changes effectively enabled full colour editing in 640x480 resolution (mode 1). There was a bit of tidying up in the editor around the cut-and-paste functionality and making sure to set tiles to the correct colour when deleting characters. Otherwise it just worked.
Or at least it did with CPUSPEED set to 252MHz or above. The next task was to tune the line blanking interrupt routine to have enough time to process the additional capability. This is a complete black art. For example:
"pos+=stepsize;" where stepsize could be 0 or 1 was too slow
whereas:
"if(stepsize)pos++;"
worked.
It was literally a process of tweaking each and every statement to get the processing done in time. Some of it is really counter-intuitive
incrementing pointers to get data - too slow. Array indices - fast enough  
functional parameter set volatile (normal in interrupt routines) - too slow
etc.

However, with all this done......

Colour editing works nicely at 126MHz and

It also enables the PRINT and TEXT commands to use colour as long as the character locations meet the conditions above.

So, in mode 1, you can now go
TEXT 0,0,"Hello World",,,,rgb(red),rgb(green)
or
colour rgb(red),rgb(green)
print @(0,0)"Hello world again"

and it will do what you expect (in mono mode   )

If the output is not aligned to a tile boundary then the tile colours will be
ignored. So print @(100,0)"Hello world" will appear in whatever the tiles on which it is written are set to (typically black and white)

On installing the new firmware the default tile size will be 8x12 to match the default font 1
You can change the default with
OPTION TILE SIZE SMALL/LARGE

This is a permanent change which causes the processor to reset

Alternatively, in a program, you can use:
TILE SMALL/LARGE


To use the editor in colour then, of course, you need to set OPTION COLOURCODE ON

 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 903
Posted: 01:47pm 16 Feb 2023
Copy link to clipboard 
Print this post

Edit with Colorcode looks Nice, Peter..  

but ..
I just discovered a small imperfection..
1. in the editor (mode 1 or 2, color code on or off)
when you move the Cursor from bottom to top and it starts scrolling, the content disappears, except for the top line.

2. If you start editing a Line, everything below this Line disappears

This effect is independend of TILE SMALL or LARGE

Cheers Mart!n
Edited 2023-02-16 23:59 by Martin H.
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 02:05pm 16 Feb 2023
Copy link to clipboard 
Print this post

  Quote  but ..
I just discovered a small imperfection..
1. in the editor (mode 1 or 2, color code on or off)
when you move the Cursor from bottom to top and it starts scrolling, the content disappears, except for the top line.

2. If you start editing a Line, everything below this Line disappears

This effect is independend of TILE SMALL or LARGE


What have I done? - that was all working fine before - will update when fixed
 
IanT
Regular Member

Joined: 29/11/2016
Location: United Kingdom
Posts: 84
Posted: 02:10pm 16 Feb 2023
Copy link to clipboard 
Print this post

'
' Matherp Worship
'
do
  Print "I am not Worthy!"
loop
'

( Help - I can't keep up! )

Regards,


IanT
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 03:13pm 16 Feb 2023
Copy link to clipboard 
Print this post

Typical. Putting the conditional compilation code to bring the source in-line with the other variants I put a #else in the wrong place

Sorry about that


PicoMiteVGAV5.07.07b19.zip
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 903
Posted: 03:46pm 16 Feb 2023
Copy link to clipboard 
Print this post

  matherp said  Typical. Putting the conditional compilation code to bring the source in-line with the other variants I put a #else in the wrong place

Sorry about that


PicoMiteVGAV5.07.07b19.zip

Thank you for your fast response..
I was about to report the next issue...
When Tile set to small, cls RGB(white) does not clear the whole screen.
(also in the new/Updated Version)
to the New version..
1. after booting, VGA Screen stays Black, the prompt appears after you do a CLS
2. as I wrote above, CLS color doesn't work right when small Tilesize is on
3. Colourcode doesn't appear in Edit (Mode 1)..
4. when Tiels set to Small, mysterious Holes in the Listing in Edit mode (Tiles seem to be Black on Black) at the same Place, where the errors at CLS appears.
Edited 2023-02-17 01:49 by Martin H.
'no comment
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 382
Posted: 03:49pm 16 Feb 2023
Copy link to clipboard 
Print this post

Okay,

this is really a major enhancement, bacause I really like to write programs in the built-in editor (only have one monitor) and now it is even better! :)

Thank you so much!

Greetings
Daniel
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 903
Posted: 04:00pm 16 Feb 2023
Copy link to clipboard 
Print this post

  Amnesie said  Okay,

this is really a major enhancement, bacause I really like to write programs in the built-in editor (only have one monitor) and now it is even better! :)

Thank you so much!

Greetings
Daniel

Yes this would be a great enhancement.

  IanT said  '

 Print "I am not Worthy!"

no we are not Worthy  

I'm confident, Peter is able to fix the issues, I reported.
Sorry if I'm annoying

Greetings
Mart!n
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 04:05pm 16 Feb 2023
Copy link to clipboard 
Print this post

  Quote  1. after booting, VGA Screen stays Black, the prompt appears after you do a CLS


Not for me. It appears after a reset, power on or software reset.

  Quote  When Tile set to small, cls RGB(white) does not clear the whole screen.

  Quote  as I wrote above, CLS color doesn't work right when small Tilesize is on



Again, does for me. If you have a sequence that causes the fault I need the complete sequence. You can create the problem by setting tiles. Use TILE RESET to clean things up

  Quote  Colourcode doesn't appear in Edit (Mode 1)..


Explain please

  Quote   when Tiels set to Small, mysterious Holes in the Listing in Edit mode (Tiles seem to be Black on Black) at the same Place, where the errors at CLS appears.


Please try again with OPTION CPUSPEED 252000. Sounds like your Pico maybe isn't completing the interrupt routine in time. I'm not seeing any faults like you describe
Also use auto-adjust on your monitor
Edited 2023-02-17 02:14 by matherp
 
PilotPirx

Regular Member

Joined: 03/11/2020
Location: Germany
Posts: 66
Posted: 04:15pm 16 Feb 2023
Copy link to clipboard 
Print this post

Great enhancement - Peter is a wizard  
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 04:19pm 16 Feb 2023
Copy link to clipboard 
Print this post

Re Martin's points above. Please report if the firmware is working for you without the same issues
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 903
Posted: 04:21pm 16 Feb 2023
Copy link to clipboard 
Print this post

My settings..

PicoMiteVGA MMBasic Version 5.07.07b19
OPTION COLOURCODE ON
OPTION KEYBOARD GR
OPTION CPUSPEED (KHz) 378000
OPTION TILE SIZE LARGE
OPTION SDCARD GP10, GP12, GP11, GP13
OPTION AUDIO GP6,GP7, ON PWM CHANNEL 3


after I set CPU Speed to 252000 Colorcode is back and the Holes in the Edit are gone it was ok.
Then back to 378000 it works..
also the Bootmessage is back.
maybe my Pico just had an hiccup.
Thank you for your patience

Greetings
Mart!n
Edited 2023-02-17 02:24 by Martin H.
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 04:24pm 16 Feb 2023
Copy link to clipboard 
Print this post

378MHz can be marginal in lots of bizarre ways. Always check at 126MHz, then 252MHz. If no errors in these then assume anything with 378MHz is hardware
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 414
Posted: 07:35pm 16 Feb 2023
Copy link to clipboard 
Print this post

Hi Peter,
I have a problem when using the editor in mode 1.
If I change to Mode 1 and then Edit, the editor only shows some of the lines of the program and locks up solid, requiring a power off reset.

PicoMiteVGA MMBasic Version 5.07.07b19
OPTION SYSTEM I2C GP22,GP15
OPTION COLOURCODE ON
OPTION KEYBOARD UK
OPTION DEFAULT MODE 2
OPTION DISPLAY 30, 53
OPTION SDCARD GP5, GP2, GP3, GP4
OPTION AUDIO GP6,GP7, ON PWM CHANNEL 3
OPTION RTC AUTO ENABLE
OPTION DEFAULT FONT 7, 1

I have now found that it's the OPTION DEFAULT MODE 2 that is causing this, if I change it to OPTION DEFAULT MODE 1 all seems to be ok.
Edited 2023-02-17 05:40 by Bleep
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 414
Posted: 08:00pm 16 Feb 2023
Copy link to clipboard 
Print this post

Also, I accidentally copied and pasted all of this piece of code, using autosave.

vgabubble.bas.zip

I realise it's several slightly different versions of the same code, however once loaded the editor mangles it, the first 35 lines of code are fine and consist of a loop so the rest is never executed. However I didn't think the remainder should get corrupted like this, even though it shouldn't be there? the image is after scrolling down one page. I had done a flash erase and fresh install of b19 with no options set this is a terminal, but the VGA looks the same. This isn't particularly important as I shouldn't have done it! :-(



Any Ideas?
Regards, Kevin.
Edited 2023-02-17 06:08 by Bleep
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2290
Posted: 09:38pm 16 Feb 2023
Copy link to clipboard 
Print this post

  matherp said  Or at least it did with CPUSPEED set to 252MHz or above. The next task was to tune the line blanking interrupt routine to have enough time to process the additional capability. This is a complete black art.


Peter: not sure if you are already doing this...

if you're running short on computrons, you could consider having TWO buffers for the scan line data, one for ODD lines, the other for EVEN lines. with two buffers:
(1) you could be filling one while the other one is being transmitted out the VGA pins,
(2) the buffer could be filled at leisure over the period of a complete line, assuming that the 2nd CPU isn't doing anything else.


cheers,
rob   :-)
Edited 2023-02-17 07:39 by robert.rozee
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 03:16pm 17 Feb 2023
Copy link to clipboard 
Print this post

V5.07.07b20


PicoMiteVGAV5.07.07b20.zip


Fixes a bug if OPTION DEFAULT MODE 2 is set and you execute EDIT 1
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 414
Posted: 05:17pm 17 Feb 2023
Copy link to clipboard 
Print this post

Hi Peter,
Thanks for the update, unfortunately after installing b20 I can't get a terminal over usb to connect to it at all, if I plug in a PS2 keyboard, that works as expected.
Regards, Kevin.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 05:32pm 17 Feb 2023
Copy link to clipboard 
Print this post

I only ever use USB so I know there is no issue - try plugging into a different port and or upload clean_flash
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5733
Posted: 08:06pm 17 Feb 2023
Copy link to clipboard 
Print this post

This version of the firmware seems to be running ok at default speed on a YD-RP2040. 252MHz crashes it, as expected.

Many thanks for all your work on this platform, Peter. It gets better and better. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 1 of 5    
Print this page
© JAQ Software 2024