![]() |
Forum Index : Microcontroller and PC projects : CMM2: V5.07.00b12 - Various fixes
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 572 |
thanks for this new Sub Commands . ![]() Plasma |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Please download again - error in the last download - no version change |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Please download and test V5.07.00b19 http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip No functional changes but ST have updated the compiler and the development environment. Originally this broke the code which I hope I have fixed so please let me know any issues. |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1122 |
Could this be extended to circles too? (Maybe just round ones - aspect ratio 1?) CIRCLE xxx_PIXELS x, y, r, colour [, pageno] Would be great for simple explosions. Then if we're dreaming, other drawing _primitives_ too?. Lines? Polygons? Pixels? (PIXEL same as: BOX xxx_PIXELS x, y, 1, 1, colour [,pageno], just faster.) Edited 2021-02-28 11:08 by vegipete Visit Vegipete's *Mite Library for cool programs. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
No: too much code for too little use |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Sorry Ignore Edited 2021-03-09 03:40 by matherp |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
V5.07.00b21 now available http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip Improves performance of non-word aligned page scroll left commands New directive to allow multi-line comments. The commands must be in capitals. Any lines between the two commands are completely ignored and not loaded into memory #COMMENT START #COMMENT END You can append extra text to the Commands ![]() e.g. #COMMENT START Forth code module fred ... ... ... #COMMENT END End of Forth module fred Edited 2021-03-14 21:11 by matherp |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Thank you Peter, that sounds like it will do the trick. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1122 |
I'm not sure what I'm doing but I'm managing to lock up my CMM2 with the attached program. I was mucking around with MIDI decoding and getting random freezing, requiring a reset or power cycle to regain control. Very very rarely, the program will run to completion, but most of the time everything just stops, no where in particular. Commenting out line 22 {play sound 1,b,t,nt(note-45)} seems to fix it. The data file is in the attached zip. version: MMBasic Version 5.07.00b16 ' MIDI note #60 is 261.63 Hz dim nt(127) for i = 0 to 63 ' build table of frequencies nt(i)=110*2^(i/12) next i open "test3.txt" for input as #1 timer = 0 do line input #1,a$ if a$ = "0, 0, End_of_file" then exit do chan$ = field$(a$,1,",") if chan$ = "7" then ' listen to this channel ty$ = field$(a$,3,",") ' event type if ty$ = "Note_on_c" then ' only care about Note On ? a$ tm = 4*val(field$(a$,2,",")) ' event time - 256 ticks per second (4 is slow) vel = val(field$(a$,6,",")) ' event velocity (0=off) note = val(field$(a$,5,",")) ' event note do : loop until timer > tm ' wait for previous event to finish if vel then play sound 1,b,t,nt(note-45) '<=========== !!!!!!!???? else play stop ' stop note if velocity is zero endif elseif ty$ = "End_track" then play stop exit do endif endif loop play stop close #1 MIDIParseTest.zip Visit Vegipete's *Mite Library for cool programs. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6220 |
Slow functions can prevent USB attached keyboard from working. The ARC command takes over 12mS to complete. This seems to upset the keyboard reading ability if there are minimal other commands in the loop. The PC console keyboard still works. CLS x = MM.HRES/2 y = MM.VRES/2 r1 = min(x,y)-20 r2 = r1+5 rad1 = 0 rad2 = 5 + RND()*30 DO ARC x, y, r1, r2, rad1, rad2, RGB(RND()*255,RND()*255,RND()*255) rad1 = rad2 rad2 = rad1 +5+RND()*30 ' pause 1 ' this pause is need to allow USB keyboard to be heard. LOOP UNTIL inkey$ <> "" Without the PAUSE 1 command, my USB keyboard can't even perform a ^C I expect that other 'slow' commands will do the same. Jim VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6220 |
I finally found time to play with this. No lockups here but I am getting sick of the tune! running Beta22 Jim VK7JH MMedit |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1122 |
I'm seeing some weirdness with READ and DATA statements. (CMM2 MMBasic Version 5.07.00b16) The following program misbehaves: do read a if a = 0 then exit do read b,c,d,e,f$ ? a,b,c,d,e,f$ loop end data 1,2,3,4,5,"A",1,2,3,4,5 data "B" data 1,2,3,4,5,"C" data 0 The output is: 1 2 3 4 5 A 1 2 3 4 5 0 1 2 3 4 5 C Note the '0' at the end of the second line, instead of 'B' Changing the code to do seems to work.read a if a = 0 then exit do read b,c,d,e : read f$ ? a,b,c,d,e,f$ loop end data 1,2,3,4,5,"A",1,2,3,4,5 data "B" data 1,2,3,4,5,"C" data 0 I get the impression that a structure along the lines of READ <var1>,<var2>,<var3> doesn't work right if a string is involved and the data values are spread across multiple DATA statements. Maybe. . Edited 2021-03-26 11:40 by vegipete Visit Vegipete's *Mite Library for cool programs. |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1636 |
It does the same in MMBasic for DOS. It seems that it gets in a tangle reading mixed variable types on one line. I changed the data to: data 1,2,3,4,5,"A",6,7,8,9,10 data "B" data 11,12,13,14,15,"C" data 0 to prove it was reading the correct data, it does. BUG? Bill Keep safe. Live long and prosper. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
V5.07.00b23 now available http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip Minor bug fixes Fixes bug where some interrupts specified in one program can affect subsequent operation of the CMM2 if the program is terminated without the interrupt being disabled Fixes bug in ARC command not refreshing the USB keyboard correctly Fixes bug in MOUSE command not giving an error if the PS2 mouse is open but the mouse function is used without specifying the channel Data READ bug reported to Geoff |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1122 |
I'm seeing a problem with filled polygons in 12 bit mode: the fill colour is stuck on black. 'mode 1,8 ' works fine mode 1,12 ' no workie 'mode 1,16 ' works fine cls rgb(grey) ' better visibility dim px(4) = (500,633,440,194,229) dim py(4) = ( 88,329,531,413,139) polygon 5,px(),py(),,rgb(red) do : loop until inkey$ <> "" Same on page 1 Visit Vegipete's *Mite Library for cool programs. |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1122 |
My MIDI test program from a few posts up seems to work just fine on the newest firmware. No freezing anymore. Jolly good show! Visit Vegipete's *Mite Library for cool programs. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
Oh no its not - its completely transparent red ![]() Please download b23 again - should be fixed now |
||||
epsilon![]() Senior Member ![]() Joined: 30/07/2020 Location: BelgiumPosts: 255 |
New directive to allow multi-line comments. The commands must be in capitals. Any lines between the two commands are completely ignored and not loaded into memory #COMMENT START #COMMENT END I checked if this feature could be used (abused?) to insert arbitrary content in a .bas file, e.g. a compressed archive. Unfortunately, that didn't work. It looks like line length checks are still done on the contents between #COMMENT START/END. ... readNbytes% = bytesRead% END FUNCTION 'Basic program ends here. #COMMENT START A 4MB binary here... #COMMENT END If I execute the above, I get this: > *marWithPayload Line is too long Epsilon CMM2 projects |
||||
jirsoft![]() Guru ![]() Joined: 18/09/2020 Location: Czech RepublicPosts: 533 |
Maybe it can be done with similar system as BinHex and also split lines. This should work and can be adapted to more compressed system. With binary data I see no easy way how to find #COMMENT END... Edited 2021-04-01 21:53 by jirsoft Jiri Napoleon Commander and SimplEd for CMM2 (GitHub), CMM2.fun |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4251 |
Packing binary data directly into .bas files seems to be a stretch beyond the intended use for this feature and is always going to give any EDITor apoplexy. If you really want something like this then I suggest Base64 encoding the payload before putting it in the #COMMENT block. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |