Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:58 02 Aug 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 : Is this too silly for MMBasic or is it useful?

     Page 2 of 2    
Author Message
matherp
Guru

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

Have a play with this and see what you think - VGA only for test

PicoMiteVGA.zip

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-09 20:10 by matherp
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 04:06pm 09 Mar 2023
Copy link to clipboard 
Print this post

I think this is a much-needed feature however implemented (and however broadly implemented across MMBasic platforms). The "\" option immediately above looks good to me.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 633
Posted: 10:34am 10 Mar 2023
Copy link to clipboard 
Print this post

Hi Peter,
Yes please I like this feature. :-)
Using the above install I'm getting an "Error : Not enough memory" after running a small mode 2 program, and then going into edit it.
PicoMiteVGA MMBasic Version 5.07.07b26
OPTION SYSTEM I2C GP22,GP15
OPTION COLOURCODE ON
OPTION KEYBOARD UK
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
> memory
Program:
  1K ( 0%) Program (35 lines)
 97K (100%) Free

RAM:
  0K ( 0%) 0 Variables
  2K ( 1%) General
124K (99%) Free
> edit
Error : Not enough memory
> clear
> EDIT
Error : Not enough memory

If I then change to mode 1 edit works fine, Any ideas?
Regards, Kevin.
Edited 2023-03-10 20:37 by Bleep
 
matherp
Guru

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

Need more info - program?
Can't replicate with trivial test
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 633
Posted: 12:09pm 10 Mar 2023
Copy link to clipboard 
Print this post


' Bubble Universe
MODE 2
Dim Float u,a,p,q,t,v=0, x=0
Dim Integer g,b,i,j,c(51),d(51),e(51),n(51),nn
Dim Integer f(13,41),l(13,41),m(26,41),dd,cc
Const w=MM.HRes/2, h=MM.VRes/2
Const r=(2*Pi)/235, o=h/2
CLS RGB(black)
t=Rnd*10:Math set 1,e()
t=1
nn=Peek(varaddr n())
dd=Peek(varaddr d())
cc=Peek(varaddr c())

For g=0 To 41
For b=0 To 51
  n(b)=RGB(g*6,b*5,128*(g+b>30)*(g+b<60))
  If g<26 And b<13 Then n(b)=RGB(0,128,0)
Next
Memory pack nn, Peek(varaddr m(0,g)),52,32
Next g
Do
Inc t,0.01:g=0':Print Timer:Timer =0
For i=50 To 255 Step 5
b=0:a=r*i
Memory unpack Peek(varaddr f(0,g)),cc,52,16
Memory unpack Peek(varaddr l(0,g)),dd,52,16
Box c(),d(),e(),e(),0,,0
For j=50 To 255 Step 4:u=Sin(i+v)+Sin(a+x):v=Cos(i+v)+Cos(a+x):x=u+t:c(b)=w+u*o:d(b)=h+v*o:Inc b:Next
Memory unpack Peek(varaddr m(0,g)),nn,52,32:Box c(),d(),e(),e(),0,,n()
Memory pack cc,Peek(varaddr f(0,g)),52,16
Memory pack dd,Peek(varaddr l(0,g)),52,16
Inc g
Next i
Loop
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 01:32pm 10 Mar 2023
Copy link to clipboard 
Print this post

Still works for me after running your program
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 633
Posted: 03:27pm 10 Mar 2023
Copy link to clipboard 
Print this post

Hi Peter,
Just done a flash wipe & re install, I then put all the options back as above, loaded the same program from the SD card, ran it, ctrl-C out F4 to edit and am still getting the Error : Not enough memory
If I go to mode 1 and then edit works fine, but then going back to mode 2 and then edit same error.
Was going to try resetting all options then re-introduce them 1 at a time, but doing option reset locks up the Pico. powering off and on and they are still all there.
So did a flash wipe and re install.
didn't put any options back and it happened.

So all I have now is
PicoMiteVGA MMBasic Version 5.07.07b26
OPTION KEYBOARD US
OPTION DISPLAY 20, 40
>
> RUN   (Ctrl-C out)
> EDIT
Error : Not enough memory

This is the program, even smaller.
'mandelbrot
'
'inspired by Matt Heffernan s 8-BIT BATTLE
'https://www.youtube.com/watch?v=DC5wi6iv9io
'for PicoMite is a Raspberry Pi Pico running the free MMBasic interpreter.
'2022 by M. Herhaus
'2022 adaptation for picomiteVGA by Volhout
'
'clear screen, home and cursor off
Dim Integer DX,DY,py,px,i
Dim Float p,q,x,y,xy,xz,xt
MODE 2
CLS

'read colours
Dim color(15)
For i=0 To 15
Read color(i)
Next i

'MANDELBROT
Timer =0
' max x and max y
DX=32:DY=22
For py=0 To DY-1
For px=0 To DX-1
 xz=px*3.5/DX-2.5
 yz=py*2/DY-1
 x=0
 y=0
 For i=0To 14
   p=x*x: q=y*y: If p+q>4 Then Exit For
   y=2*x*y+yz: x=p-q+xz
 Next
 Box px*10,py*10,10,10,1,0,color(i)
Next
Next
Print @(10,230) "time = ";Timer;
Do :Loop While Inkey$=""
End              

'indexing the colors
Data RGB(white),RGB(yellow),RGB(lilac),RGB(brown),RGB(fuchsia),RGB(rust)
Data RGB(magenta),RGB(red),RGB(cyan),RGB(green),RGB(cerulean),RGB(midgreen)
Data RGB(cobalt),RGB(myrtle),RGB(blue),RGB(black)

I have no idea why you can't reproduce, are you using the same zip file installation from the top of this page? Hopefully you can reproduce now.
Regards, Kevin.
Edited 2023-03-11 01:39 by Bleep
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 05:45pm 10 Mar 2023
Copy link to clipboard 
Print this post

  Quote  OPTION DISPLAY 20, 40


How are you getting this? There is something you aren't telling me

Try this although I'm not aware I have made any relevant changes

PicoMiteVGA.zip
Edited 2023-03-11 03:55 by matherp
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 633
Posted: 10:09pm 10 Mar 2023
Copy link to clipboard 
Print this post

Hi Peter,
Honest I'm not, that option appears when I or a program sets mode 2.
> option list
PicoMiteVGA MMBasic Version 5.07.07b26
OPTION KEYBOARD US
> mode 1
> option list
PicoMiteVGA MMBasic Version 5.07.07b26
OPTION KEYBOARD US
> mode 2
> option list
PicoMiteVGA MMBasic Version 5.07.07b26
OPTION KEYBOARD US
OPTION DISPLAY 20, 40
>

I'll try the new one, probably tomorrow now.
Regards, Kevin.
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 633
Posted: 10:20pm 10 Mar 2023
Copy link to clipboard 
Print this post

Hi Peter,
Ok the new zip does not give me the not enough memory error, but I do still get the OPTION DISPLAY 20, 40 when using mode 2.
> option list
PicoMiteVGA MMBasic Version 5.07.07b26
OPTION SYSTEM I2C GP22,GP15
OPTION COLOURCODE ON
OPTION KEYBOARD UK
OPTION SDCARD GP5, GP2, GP3, GP4
OPTION AUDIO GP6,GP7, ON PWM CHANNEL 3
OPTION RTC AUTO ENABLE
> mode 2
> option list
PicoMiteVGA MMBasic Version 5.07.07b26
OPTION SYSTEM I2C GP22,GP15
OPTION COLOURCODE ON
OPTION KEYBOARD UK
OPTION DISPLAY 20, 40
OPTION SDCARD GP5, GP2, GP3, GP4
OPTION AUDIO GP6,GP7, ON PWM CHANNEL 3
OPTION RTC AUTO ENABLE

I'm fairly certain it has always done this, certainly when I set OPTION LCDPANEL CONSOLE 7 I then get different Option displays, like OPTION DISPLAY 30, 53 in Mode 2 and OPTION DISPLAY 60, 106 in mode 1.
Thanks Kevin.
Edited 2023-03-11 08:35 by Bleep
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2642
Posted: 10:52pm 10 Mar 2023
Copy link to clipboard 
Print this post

  Quote  I'm fairly certain it has always done this, certainly when I set OPTION LCDPANEL CONSOLE 7 I then get different Option displays, like OPTION DISPLAY 30, 53 in Mode 2 and OPTION DISPLAY 60, 106 in mode 1.

+1
 
     Page 2 of 2    
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