Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 19:23 04 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 : CMM2: V5.07.00b12 - Various fixes

     Page 3 of 9    
Author Message
Plasmamac

Guru

Joined: 31/01/2019
Location: Germany
Posts: 501
Posted: 01:25am 25 Feb 2021
Copy link to clipboard 
Print this post

thanks for this new Sub Commands .  
Plasma
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 07:50am 25 Feb 2021
Copy link to clipboard 
Print this post

  Quote  thanks for this new Sub Commands


Please download again - error in the last download - no version change
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 11:14am 27 Feb 2021
Copy link to clipboard 
Print this post

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: Canada
Posts: 1083
Posted: 01:05am 28 Feb 2021
Copy link to clipboard 
Print this post

  matherp said  
  Quote  V5.07.00b18 now available

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

New Sub-Commands as requested by Mauro: BOX AND_PIXELS, BOX OR_PIXELS, BOX XOR_PIXELS
BOX xxx_PIXELS x, y, w, h, colour [,pageno]
This executes the requested logical operation between the pixels in the area defined on the page specified (defaults to the write page) with the colour specified

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 Kingdom
Posts: 8592
Posted: 08:23am 28 Feb 2021
Copy link to clipboard 
Print this post

  Quote  Could this be extended to circles too?


No: too much code for too little use
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 12:26pm 08 Mar 2021
Copy link to clipboard 
Print this post

Sorry Ignore
Edited 2021-03-09 03:40 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 11:05am 14 Mar 2021
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 3848
Posted: 02:33pm 14 Mar 2021
Copy link to clipboard 
Print this post

Thank you Peter, that sounds like it will do the trick.

Best wishes,

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

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1083
Posted: 01:30am 17 Mar 2021
Copy link to clipboard 
Print this post

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: Australia
Posts: 5913
Posted: 03:54am 22 Mar 2021
Copy link to clipboard 
Print this post

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   MMBasic Help
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5913
Posted: 04:23am 22 Mar 2021
Copy link to clipboard 
Print this post

  vegipete said  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.


I finally found time to play with this.

No lockups here but I am getting sick of the tune!

running Beta22

Jim
VK7JH
MMedit   MMBasic Help
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1083
Posted: 01:29am 26 Mar 2021
Copy link to clipboard 
Print this post

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
 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
seems to work.

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: Australia
Posts: 1593
Posted: 01:53am 26 Mar 2021
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 8592
Posted: 08:51am 26 Mar 2021
Copy link to clipboard 
Print this post

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: Canada
Posts: 1083
Posted: 05:30pm 26 Mar 2021
Copy link to clipboard 
Print this post

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: Canada
Posts: 1083
Posted: 05:38pm 26 Mar 2021
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 8592
Posted: 06:09pm 26 Mar 2021
Copy link to clipboard 
Print this post

  Quote  the fill colour is stuck on black.


Oh no its not - its completely transparent red  

Please download b23 again - should be fixed now
 
epsilon

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 09:59am 01 Apr 2021
Copy link to clipboard 
Print this post

  matherp said  
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 Republic
Posts: 532
Posted: 11:51am 01 Apr 2021
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 3848
Posted: 11:59am 01 Apr 2021
Copy link to clipboard 
Print this post

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
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 3 of 9    
Print this page
© JAQ Software 2024