Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:30 29 Nov 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 : Picomite(VGA) V5.07.07 betas - bug fixes + focus on PIO

     Page 10 of 16    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 12:40pm 06 Mar 2023
Copy link to clipboard 
Print this post

  matherp said  You are incrementing the y coordinate by 1.5 so every other output is not aligned with a tile hence the colours are ignored. This has never worked and never could have


Are you sure it never worked ? - I'm fairly certain it did.
What about when Mode 1 was mono ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9147
Posted: 12:57pm 06 Mar 2023
Copy link to clipboard 
Print this post

Can't think how it would have, but it certainly can't now. I'll have a think to see if it can be special cased
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 01:01pm 06 Mar 2023
Copy link to clipboard 
Print this post

  matherp said  Can't think how it would have, but it certainly can't now. I'll have a think to see if it can be special cased


I can learn to cope without, it's just I had a bit of B&W TUI (using x1.5 line spacing) that was highlighting the current selection using black on white (99% sure it was working on PicoMiteVGA since that was the target platform) and now I am looking at it with the latest betas only some items render as "selected", i.e. those that are coincidentally match tile boundaries.

Best wishes,

Tom
Edited 2023-03-06 23:02 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3818
Posted: 01:19pm 06 Mar 2023
Copy link to clipboard 
Print this post

Might it have worked when tile sizes were different?

John
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9147
Posted: 02:11pm 06 Mar 2023
Copy link to clipboard 
Print this post

Try this


PicoMiteVGA.zip
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4262
Posted: 02:33pm 06 Mar 2023
Copy link to clipboard 
Print this post

Not sure what is fixed, will try the latest from previous post, but...

In the b25 version, after a while playing with it, (edit , change color, cls, change tiles) it returns to B&W in mode 1.

Things like


TEXT 0,0,"hello",,,,rgb(red),rgb(green) print text in B&W (white ink on black background).


Fishy....

Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 02:39pm 06 Mar 2023
Copy link to clipboard 
Print this post

  matherp said  Try this

PicoMiteVGA.zip


That seems to fix my use-case, but I don't have any colour programs that use MODE 1 so I can't comment on whether you might have broken something else .

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4262
Posted: 03:37pm 06 Mar 2023
Copy link to clipboard 
Print this post

May not be related, but in my effort to duplicate I stumbled upon this (50707b25).
First do a CPU restart, to make sure all is cold booted.


mode 1
tile 0,0,0,rgb(yellow),80,40


You get a yellow screen...correct


cls rgb(green)


You get a white screen (not green ?)...suspicious


cls rgb(green)
tile 0,0,0,rgb(yellow),80,40


You get ONE yellow text line (12pix height, 640pix wide), the rest of the screen is black (not white, not green)

Volhout
Edited 2023-03-07 01:40 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4262
Posted: 03:47pm 06 Mar 2023
Copy link to clipboard 
Print this post

  matherp said  Try this


PicoMiteVGA.zip


This version fixes the LA_21_b24.bas problem with the colors. Thank you.
But it does not fix the TILE and CLS problem in previous post.
Also, in this last version the default tile height seems to be 16 (not 12).

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9147
Posted: 04:17pm 06 Mar 2023
Copy link to clipboard 
Print this post

You are expecting too much and confusing yourself. Mode 1 is mono i.e. each pixel is either 0 or 1

CLS 0 sets all pixels to 0
CLS (NOT 0) sets all pixels to 1
In addition CLS sets all tiles to white foreground and black background so the screen will go black or white, this is needed so you can get to a known state in a program, at the command prompt, leaving the editor etc.

The only other commands that can change a TILE colour are TILE itself and TEXT (and GUI BITMAP which is effectively the same command as TEXT) IFF the bitmap overlaps completely one or more tiles.

All other commands do not affect colour so BOX 0,0,mm.hres,mm.vres,0,0,rgb(red) will set all pixels to 1 but unless you have used the TILE command previously the screen will be white i.e.  rgb(RED)==(NOT 0)

cls rgb(green)
tile 0,0,0,rgb(yellow),80,40


This is even more confused. You have set all pixels to 1 (cls rgb(green)) and then told the tile mechanism that any pixel set to 1 will display BLACK. Then the command echos and sets the background pixels to the text to 0 (YELLOW).

Hence the display is doing exactly what you asked it to
i.e.
Set all pixels ON = BLACK
write some text which turns a few pixels off which then show yellow

Mode 1 is mono i.e. each pixel is either 0 or 1

  Quote  Also, in this last version the default tile height seems to be 16 (not 12).


No it doesn't unless you have changed it (e.g. by running your program)
Edited 2023-03-07 02:29 by matherp
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4262
Posted: 07:42pm 06 Mar 2023
Copy link to clipboard 
Print this post

  Quote  
  Quote  Also, in this last version the default tile height seems to be 16 (not 12).


No it doesn't unless you have changed it (e.g. by running your program)



Yeah... I could have thought of that one myself..... Stupid me...


But honestly, the thing with the yellow screen that after a CLS is not yellow... That needed your explanation. I would never have thought that that was what happened...

So it is:
CLS   : set all tiles to white/black, and set all pixels to 0 (black)
CLS 0 : leave the tiles as they are, but set all pixels to 0 (background color)
CLS !0: leave the tiles as they are, and set all pixels to 1 (foreground color)


Thanks,

Volhout
Edited 2023-03-07 05:48 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4262
Posted: 09:14pm 06 Mar 2023
Copy link to clipboard 
Print this post

picochess3.zip
@Peter,

Could you try the ZIP I send with the picochess3 program (picochess3.bas/book.txt/Small_Col.bmp) ?
The chess program starts by selecting a game from the opening book, and after a few moves, it starts analyzing and playing.

In this phase the program throws an error in line 122. Like if a variable is re-defined. But this is not the case. Looks like a stack error. But the C-stack calculation I have, is based on information provided by you for 50705RC8, says plenty of stack left. Maybe the math is not accurate anymore, and this is a stack issue in the end.

Thanks,

Volhout
Edited 2023-03-07 17:46 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4262
Posted: 12:53pm 07 Mar 2023
Copy link to clipboard 
Print this post

Hi Peter,

I have no way of debugging this in a propper way, but I managed to make the chess program run more or less by changing the ply depth. But in doing so I noticed that (compared to earlier MMBasic versions such a 5.07.06) it looks like more information is put on the C-stack. I checked the heap, and it seems to have space left.

In the 5.07.06 the stack reading changes in "steps" of around 600bytes. I have no idea what this is, but it could be 1 level deeper into a subroutine.
In this version 50707b25 I see the stack reading change in "steps" of around 730bytes. Like every level deeper into a sub is eating more stack.

Does this make sense in any way ? Or am I imagine-ing things...?
Probably it is....

Regards,

Volhout
Edited 2023-03-07 23:00 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9147
Posted: 10:16am 12 Mar 2023
Copy link to clipboard 
Print this post

V5.07.07b27

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip

Re-compile with a different optimisation to increase stack space
Maximum program size is now
PicoMite 128Kb
PicoMiteVGA 100Kb
PicoMiteWeb 84Kb

Comparative performance (Solar eclipse calculation - 69.4secs on PicoMite)
100%  PicoMite(126MHz)
96%   PicoMiteVGA(126MHz)
87%   PicoMiteWeb(126MHz)
302%  PicoMite(378MHz)
58%   MM+(100MHz)
845%  CMM2G1
1002% CMM2G2


Functional changes:
PICOMITEVGA
With OPTION LCDPANEL NOCONSOLE set you can now change terminal width and height with OPTION DISPLAY

PICOMITE
New "display" drivers
VIRTUAL_C and VIRTUAL_M

These are virtual drivers that allow you to use all the graphics routines without any display attached. In both cases a 38400 byte framebuffer is created when a graphics command is invoked for the first time. VIRTUAL_C is a 320x240 16 colour display and VIRTUAL_M is a 640x480 mono display.

ALL

Bug fixes for various numeric overflow conditions which now produce an error

New version of SAVE IMAGE for 1 and 4 bit/pixel displays. SAVE COMPRESSED IMAGE creates a BMP file but with run length encoding of the image data. This can result in a huge reduction in file size for graphics images (as compared to pictures). To work with this LOAD IMAGE has also been enhanced to support 16-colour BMP files with run length encoded data.


for normal string input and quoted DATA statements (but not unquoted DATA strings)

Implements
  Quote  

Escape sequence Hex value in ASCII Character represented
\a                           07                 Alert (Beep, Bell)
\b                           08                 Backspace
\e                           1B                 Escape character
\f                           0C                 Formfeed Page Break
\n                           0A                 Newline (Line Feed); see notes below
\r                           0D                 Carriage Return
\q                           22                 Quote symbol
\t                           09                 Horizontal Tab
\v                           0B                 Vertical Tab
\\                           5C                 Backslash
\nnn                       any                The byte whose numerical value is given by nnn interpreted as a decimal number
\xhh                       any                The byte whose numerical value is given by hh… interpreted as a hexadecimal number


e.g.
s$="\qHello world\q"

Edited 2023-03-12 20:45 by matherp
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6820
Posted: 10:48am 12 Mar 2023
Copy link to clipboard 
Print this post

Sheesh....  :)
Thanks, Peter. :)

I feel sorry for Geoff, this is a fair bit of "manual labour" for him. ;)
Mick

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

Joined: 02/02/2022
Location: Poland
Posts: 123
Posted: 02:30pm 12 Mar 2023
Copy link to clipboard 
Print this post

Hi, matherp.

Is it possible to add the MMBASICA PicoMite compiler (to ARM0+)?
I imagine that the compiler (e.g. COMPILE name.bas name.bin) would create a runnable binary (e.g. EXEC name.bin).
Of course, the compiled code would refer to all the already ARM0+ functions contained in the PicoMite environment.

Michal
Edited 2023-03-13 00:32 by Michal
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4262
Posted: 08:46am 13 Mar 2023
Copy link to clipboard 
Print this post

Hi Peter,

I tested PicoMiteVGA V50707b27.

You did it !! The C-stack use is slightly more efficient than it was before in 50705RC8. That is saying something if you take into account what has all been added since. The chess program runs unaltered.

Thank you, I am happy with this version !!

Have not gone through all my programs, but up to now all work (with minor chages when using VGA mode 1 and color).

Volhout
Edited 2023-03-13 18:48 by Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9147
Posted: 01:57pm 13 Mar 2023
Copy link to clipboard 
Print this post

Download has been updated to fix setting LCDPANEL SSD1963. No other changes or impact
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 396
Posted: 11:31pm 13 Mar 2023
Copy link to clipboard 
Print this post

Peter,

those Escape sequences are REALLY handy. I was trying to send some chars via Serial to drive an old vacuum fluoresence display and was wondering how the heck I could send the "new line" char... Now with your implementation problem solved :) Really great improvement! Maybe there is another way of doing this, but "/n" for new line is really simple.

Greetings
Daniel
Edited 2023-03-14 09:31 by Amnesie
 
mozzie
Regular Member

Joined: 15/06/2020
Location: Australia
Posts: 68
Posted: 05:59am 14 Mar 2023
Copy link to clipboard 
Print this post

G'day Peter,
A huge thankyou for the escape sequences and being able to directly add byte values to strings, makes dealing with sensors etc just that little bit easier  
As I mainly play with hex this is the first one tested and I couldn't get \xhh to work, after a little messing around it appears to be \&hh ie:


>? "\h41"
h41
>? "\&41"
A
>


Only tested on PicoMite so far but I am going to be using this a lot in the future  
Regards,
Lyle
 
     Page 10 of 16    
Print this page
© JAQ Software 2024