![]() |
Forum Index : Microcontroller and PC projects : PicoMite V6.00.02 release candidates - all versions
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
toml_12953 Guru ![]() Joined: 13/02/2015 Location: United StatesPosts: 384 |
Even better, I can use vectors (which I should have realized from the beginning) Comments are standard BASIC we old timers (pre-Microsoft days) are used to. 10 OPTION BASE 1 15 DIM C(3),B(3,3) 25 DIM A(3,3)=(1,2,3,2,4,5,3,5,6), X(3)=(3,4,5) ' MAT READ A,X 30 MATH M_INVERSE A(),B() ' MAT B=INV(A) 45 MATH M_PRINT B() ' MAT PRINT B 50 MATH V_MULT B(),X(),C() ' MAT C=B*X 60 PRINT "SOLUTIONS ARE " 65 PRINT 70 MATH V_PRINT C() ' MAT PRINT C 100 END 1.0000, -3.0000, 2.0000 -3.0000, 3.0000, -1.0000 2.0000, -1.0000, 0.0000 SOLUTIONS ARE 1.0000, -2.0000, 2.0000 Edited 2025-04-11 13:26 by toml_12953 |
||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 288 |
HDMI/USB/2350 RC11 @Peter, This note from me is not a problem. Rather in category - looks weird/incorrcet. I noticed it in previous releases too, but was not sure what`s going on. Program itself is not important, I believe as I noticed this while editing other progs. If you F4 and enter editor and on any line end would type --> /* Next /* All code gets yellow. if you would tray close multiline comment somewhere, it will not 'close' multiline comment. For a= 0 To 360 Step 5 */ if you tray correct entering multiline comment switch, like this Next /* It will not switch back to normal coloring until power OFF/ON (instead on next return it might be all white) But if you at any line end would type --> */ it switches off all text yellow as it was multiline comment (like latching switch) Like I said, with any code inside editor you should be able replicate this. Code not interesting by itself. Option ANGLE DEGREES MODE 3 Const cx = 4, cy = 4 Const size = 9 Const total = size * size Dim xin(total - 1), yin(total - 1) Dim xout(total - 1), yout(total - 1) Dim ccolor(total - 1) For i = 0 To total - 1 x = i Mod size y = i \ size sx = x + 50 sy = y + 50 If x = y Or x + y = 8 Then ccc=Rnd()*&hFFFF00 cColor(i) = ccc Pixel sx, sy, ccolor(i) Else Color (i) = RGB(0, 0, 0) EndIf xin(i) = x yin(i) = y Next Do For a= 0 To 360 Step 5 ccc=Rnd()*&HFFFFFF Circle 124,54,7,1,,RGB(yellow) angle = a Math V_ROTATE cx, cy, angle, xin(), yin(), xout(), yout() For i = 0 To total - 1 If ccolor(i) <> RGB(0, 0, 0) Then x = Int(xout(i) + 0.5) y = Int(yout(i) + 0.5) If x >= 0 And x < size And y >= 0 And y < size Then Pixel x + 120, y + 50, ccolor(i) EndIf EndIf Next For i = 0 To total - 1 If ccolor(i) = RGB(0, 0, 0) Then x = Int(xout(i) + 0.5) y = Int(yout(i) + 0.5) If x >= 0 And x < size And y >= 0 And y < size Then Pixel x + 120, y + 50, ccolor(i) EndIf EndIf Next Next a Loop My MMBasic 'sand box' |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4824 |
@tom_12953, Maybe you should place this on "Fruit of the Shed". Because it shows a problem, and a solution in MMBasic. 'I'm trying to solve three equations in three unknowns 'x + 2y + 3z = 3 '2x + 4y + 5z = 4 '3x + 5y + 6z = 5 OPTION BASE 1 DIM C(3),B(3,3) DIM A(3,3)=(1,2,3,2,4,5,3,5,6), X(3)=(3,4,5) ' MAT READ A,X MATH M_INVERSE A(),B() ' MAT B=INV(A) 'MATH M_PRINT B() ' MAT PRINT B MATH V_MULT B(),X(),C() ' MAT C=B*X PRINT "SOLUTION IS " print "x,y,z" MATH V_PRINT C() ' MAT PRINT C END I kept your "GW_BASIC" comments, but removed the linenumbers. MMBasic does not need them. Volhout Edited 2025-04-11 17:24 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10013 |
V6.00.02RC12 is available on https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip Thought it about time we had a new version as there have been lots of tweaks to RC11. RC12 is the same as the last version of RC11 except for a change to the handling of multi-line comments in the editor |
||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 523 |
Hi, I found a possible bug (latest beta Pico 2 VGA firmware): OPTION BREAK 0 doesn't work at all. I want to prevent a (final) program from accidentally stopped via CTRL-C or ANY other input. Or is this only valid for console input? I tested this with PS/2 keyboard. At moment I have no serial to try out. Manual p. 89 states: Setting this option to zero will disable the break function entirely. If I do a OPTION LIST, "OPTION BREAK 0" does not appear at all. Greetings Daniel Edited 2025-04-11 23:10 by Amnesie |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1520 |
I can confirm that for the console. Regards Michael causality ≠ correlation ≠ coincidence |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10013 |
Option break is a temporary option that you set in a program. It definitely works with 0 (tested with a console) if you use it that way. Setting it at the command prompt is meaningless. |
||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 523 |
Oh I didn't knew this, no hint in the manual that it only works from the program iteself! Thank you for clarification, no problem I will implement it in the program then. EDIT: Ha! Cool it works! Thanks ![]() Greetings Daniel Edited 2025-04-11 23:34 by Amnesie |
||||
toml_12953 Guru ![]() Joined: 13/02/2015 Location: United StatesPosts: 384 |
If I want every program to respond to a key other than Ctrl-C then it would be nice to have this option stored so every program wouldn't have to include it. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10013 |
No: it behaves the same in every version of MMBasic and is clearly identified in the manual as not being a permanent option |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4824 |
@Peter, RC12: So far no problems with the VGA 2040 programs. Volhout PicomiteVGA PETSCII ROBOTS |
||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 288 |
USB/HDMI/2350 I run latest RC12 and thinking how much nice things were added option resolution 800, Bit, Byte, flags , i2s, byref, byval.... interesting and usefull. It deserves already to be released ![]() I feel there is now small chance for some boring user wishes ![]() For some misty future (not this release), user might be happy (I believe) to have some control on msg "Warning:SDCARD removed". when program runs I can see logic when this message appears in cmd prompt (not too usefull when displays while EDITING something inside of editor, however). But when in running program... If SDCARD is removed and programmer does not check SDCARD status, there will be error thrown and program stops anyway. But if program runs and programmer do care and do check status of SDCARD there we still get quite destructive "Warning:SDCARD removed" at any random current HPOS,VPOS. This makes weird looking moments from visual design point of view. Sometimes just completely ruins interface. At least it would be somehow less harmfull if we could control appearence of "Warning:SDCARD removed" @(x,y) in case of msg rised. Or disable warning completely from program line, while program runs ? Edited 2025-04-12 17:23 by electricat My MMBasic 'sand box' |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1520 |
Good idea. I think it would be sufficient to optionally set a flag that could be queried in the program. Regards Michael causality ≠ correlation ≠ coincidence |
||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 523 |
I think electricat is definitively right about this issue. in my previous post, I also said that it would be bad to exit a program accidentally via CTRL-C (thanks Peter, problem solved), but the SD-CARD Warning is annoying, too. I tried this in my program and removed the sd card (this can happen by accident) and the warning appeared on screen. Is it possible to catch this warning and do something like: (pseudo-code): If warning then sdWarningFlag=1 redrawScreenFlag=1 EndIf This way I can further process this warning and can decide by myself what is going to happen to fix this warning...But as it is right now, I have absolutely no choice ... My idea would be to leave it as is on default settings, but to have the option do completely disable the "print on screen warning" and set some kind of flag in MMBASIC, so that one is able to detect it in the background and deal with it. But the better solution would be something like this (sd-card warning disabled / hidden) (pseudo-code): If MM.sdcardWarning then 'reach out to user to deal with the problem 'this way I have full control about the warning message EndIf Greetings Daniel Edited 2025-04-12 22:31 by Amnesie |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1520 |
I think the best thing would be to set the error code. That's sufficient. causality ≠ correlation ≠ coincidence |
||||
Bleep Guru ![]() Joined: 09/01/2022 Location: United KingdomPosts: 570 |
Hi Peter, Bug report for USB HDMI i2S version of RC12. If you play a mp3 (maybe other formats?) and then do Play Pause, the program you are running locks up, have to do a reset to escape, this is only on the i2S, the standard non i2S works fine. Also While playing the mp3, on i2S the HDMI screen flashes on and off at 1280 resolution, if I reduce it to 1024 resolution, this reduces, but does not go away, once the mp3 has stopped the flashing stops. However, a major bonus feature. A very interesting feature I have found, while testing to see how much programs slowed while playing a mp3, is that they actually speed up?? My usual test program of bubble does this. No mp3 at 1280 resolution 284mS per iteration. Play mp3 at 1280 resolution 260mS per iteration. Play mp3, but ended (or paused) at 1280 resolution 234mS per iteration! so a 20% speed up, for playing and imediately pausing a mp3? I have tested this on both a i2S and non i2S version and get the same. Very intriguing! Regards Kevin. TestProgram. ' Bubble Universe '2 Nested loops each 52 =2704 points calculated VGA 'Pico 2040Anal @ 378MHz normal 316mS Framebuff 397mS 'Pico 2350Anal @ 378MHz normal 185mS Framebuff 185mS '2 Nested loops each 66 =4356 points calculated VGA 'Pico 2040Anal @ 378MHz normal 553mS Framebuff 683mS 'Pico 2040Anal @ 378MHz Framebuff/CLS 607ms 'Pico 2350Anal @ 378MHz normal 341mS Framebuff 341mS 'Pico 2350HDMI @ 372MHz normal 333mS Framebuf 333mS 'Pico 2350HDMI @ 372MHz normal 278mS Framebuf 279mS CLS,remove arrays Play mp3 "B:/mp3/sailing" Pause 1000 Play pause MODE 2 Font 8 FRAMEBUFFER create FRAMEBUFFER write f Dim Float u(65),w(65),p,q,t,v=0,x=0,b Dim Integer c(65),d(65),n(65),m(32,65),nn,dd,xc,yc,xs,ys Dim Integer a,g,i,j,cc',y,z,f(16,65),l(16,65) 'Dim Integer e(65):Math Set 2,e() Const r=(2*Pi)/235,k=255,s=50 CLS RGB(black) t=Rnd*10 't=1 nn=Peek(varaddr n()) dd=Peek(varaddr d()) cc=Peek(varaddr c()) 'calculate centre and scale factor xc=MM.HRES\2:yc=MM.VRES\2 xs=MM.HRES/4.2:ys=MM.VRES/4.0 'Oval 'xs=MM.HRes/6:ys=MM.VRes/4 'Circular For a=0 To 65 For g=0 To 65 If a<18 And g<18 Then n(g)=RGB(0,255,0) Else n(g)=RGB(a*3.93,g*3.93,128*(a+g<65)) EndIf Next 'g Memory pack nn, Peek(varaddr m(0,a)),66,32 'pack pixel colours Next 'a Do CLS Inc t,0.035:g=0:Print Timer,MM.Info(heap):Timer =0 For i=60To 255Step 3 'z=Peek(varaddr f(0,g)):Memory unpack z,cc,66,16 'y=Peek(varaddr l(0,g)):Memory unpack y,dd,66,16 'Pixel c(),d(),0'Box c(),d(),e(),e(),0,,0 b=r*i+t For j=0To 65:u(j)=Sin(i+v)+Sin(x):v=Cos(i+v)+Cos(x):x=u(j)+b:w(j)=v:Next Math Scale u(),xs,c():Math Scale w(),ys,d():Math add c(),xc,c():Math Add d(),yc,d() Memory unpack Peek(varaddr m(0,g)),nn,66,32 'unpack pixel colours Pixel c(),d(),n()'Box c(),d(),e(),e(),0,,n() 'Memory pack cc,z,66,16:Memory pack dd,y,66,16 Inc g Next 'i FRAMEBUFFER copy f,n Loop Footnote added 2025-04-13 07:06 by Bleep I have now tested the speedup, with a wav file and see a similar 20% speed up when the wav finishes or is paused? |
||||
JanVolk Senior Member ![]() Joined: 28/01/2023 Location: NetherlandsPosts: 217 |
I don't know if this is correct? When using the mouse in the editor it works fine regarding movement over the screen and when I click the left mouse button the cursor comes to that point but the Ln: n and Col: n values do not change with the mouse click. If I then do something with the arrows the Ln: and Col: only change to the correct value. But the problem of the arrows is still there, so there is a chance of crashing which also happens and Ln: and Cur: text disappear. Is it correct that there is no mouse support for option resolution 1280 in the editor? PicoMiteHDMI MMBasic USB RP2350A Edition V6.00.02RC12 Copyright 2011-2025 Geoff Graham Copyright 2016-2025 Peter Mather > option list PicoMiteHDMI MMBasic USB RP2350A Edition V6.00.02RC12 OPTION SERIAL CONSOLE COM1,GP0,GP1 OPTION SYSTEM I2C GP20,GP21 OPTION FLASH SIZE 4194304 OPTION COLOR CODE ON OPTION KEYBOARD US OPTION CPU SPEED (KHz) 252000 OPTION RESOLUTION 640x480 OPTION HDMI PINS 1, 3, 7, 5 OPTION SDCARD GP22, GP6, GP7, GP4 OPTION AUDIO GP26,GP27', ON PWM CHANNEL 5 OPTION MODBUFF ENABLE 192 OPTION PLATFORM OLIMEX USB > US USB Keyboard Connected on channel 1 > USB Mouse Connected on channel 2 > > US USB Keyboard Connected on channel 1 > USB Mouse Connected on channel 2 > USB Keyboard Disconnected > USB Mouse Disconnected > Greetings, Jan. |
||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 288 |
USB/HDMI/2350 @Peter, I am sorry, but if OPTION RESOLUTION 800 is switched on, mouse works as I see cursor can be repositioned, but mouse pointer (white rectangle) is not displayed. Is invisible no matter if I set MODE 1 before program exits or in cmd prompt. OPTION RESOLUTION 640 has mouse, means OK. My MMBasic 'sand box' |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4824 |
@Kevin/Peter, In the 2040 VGA version I do see a degradation in speed since 5.09.00 and 6.00.01, but it is not coming back with play/play stop. I accepted it as a result of all the tuning Peter had to do to make all this new functionality work on the same memory footprint of the 2040. But indeed it is a performance hit of 10-20%. I conclude this from comparing screen refresh in the logic analyzer, and several games that have this build in. Regards, Volhout Edited 2025-04-13 22:46 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Bleep Guru ![]() Joined: 09/01/2022 Location: United KingdomPosts: 570 |
Hi Harm, I've just tested a 2040 USB VGA RC8 378MHz By playing any WAV and immediately pausing it I'm seeing a speed up of 40%!! From 606mS per iteration to 422mS per iteration. Please give it a go, hopefully it's not just me. Regards Kevin Ps as an experiment I tried the same thing with Basic Chess & it made no difference, so it looks like it's something that's specific to the Bubble program? Edited 2025-04-14 02:51 by Bleep |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |