Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 20:39 25 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 : CMM2: V5.07.02b1: Minor bug fixes

     Page 1 of 2    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9111
Posted: 09:52am 08 Oct 2021
Copy link to clipboard 
Print this post

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

The LOC function does not work for files. Fixed in V5.07.02b1
The MEMORY SET SHORT and MEMORY SET WORD commands have bugs. Fixed in V5.07.02b1
MM.ERRMSG$ sometimes returns string with a leading CR/LF. Fixed in V5.07.02b1
Bug in allowable range for LONGSTRING RESIZE. Fixed in V5.07.02b1
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 10:23am 08 Oct 2021
Copy link to clipboard 
Print this post

Thank you very much for the swift turnaround Peter.

I can confirm that it passes all my tests (though I can't comment on MEMORY SET WORD as I don't have any unit-tests for it yet).

Thanks again,

Tom
Edited 2021-10-08 20:24 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9111
Posted: 06:57am 22 Oct 2021
Copy link to clipboard 
Print this post

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

Fixes bug in TIMER= command when value is greater than 70

Extra syntax option for BITBANG WS2812

Existing version
BITBANG WS2812 type, pin,colours%()


Also now allowed
BITBANG WS2812 type, pin, nbr, colours%[()]


The new variant allows you to control a single LED which wasn't previously possible in a clean way e.g.
BITBANG WS2812 O, 3,1,RGB(RED)
 
toml_12953
Guru

Joined: 13/02/2015
Location: United States
Posts: 339
Posted: 11:38am 22 Oct 2021
Copy link to clipboard 
Print this post

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

Fixes bug in TIMER= command when value is greater than 70



What caused that problem?
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1241
Posted: 11:50am 22 Oct 2021
Copy link to clipboard 
Print this post

  toml_12953 said  What caused that problem?

A pair of brackets.
https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=14225

@Peter: Thanks for fixing this so quickly!

Michael
Edited 2021-10-22 21:59 by twofingers
causality ≠ correlation ≠ coincidence
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 10:57am 29 Nov 2021
Copy link to clipboard 
Print this post

Should a newly updated and OPTION RESET CMM2 list the current display as 24x80 ?

> 400MHz Colour Maximite 2
MMBasic Version 5.07.02b2
Copyright 2011-2021 Geoff Graham
Copyright 2016-2021 Peter Mather

> option list
CURRENT VGA mode 800x600 RGB332
CURRENT DISPLAY 24,80
OPTION USBKEYBOARD UK
> ?MM.Hres
800
> ?MM.Vres
600
>

It seems to be acting like it is 50x100 which is what I was expecting and what the EDITor is using too.

Best wishes,

Tom
Edited 2021-11-29 20:58 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 11:03am 29 Nov 2021
Copy link to clipboard 
Print this post

... and this sequence does change it to 50x100 ???

> option reset
> option list
CURRENT VGA mode 800x600 RGB332
CURRENT DISPLAY 24,80
OPTION USBKEYBOARD UK
> option usbkeyboard uk,1
> option list
CURRENT VGA mode 800x600 RGB332
CURRENT DISPLAY 24,80
OPTION USBKEYBOARD UK, 1
> option ram
> option list
CURRENT VGA mode 800x600 RGB332
CURRENT DISPLAY 24,80
OPTION USBKEYBOARD UK, 1
OPTION RAM ON
> option keyboard repeat 200,50
> option list
CURRENT VGA mode 800x600 RGB332
CURRENT DISPLAY 24,80
OPTION USBKEYBOARD UK, 1
OPTION RAM ON
OPTION KEYBOARD REPEAT 200,50
> option sd timing fast
> option list
CURRENT VGA mode 800x600 RGB332
CURRENT DISPLAY 50,100
OPTION USBKEYBOARD UK, 1
OPTION RAM ON
OPTION SD TIMING FAST
OPTION KEYBOARD REPEAT 200,50

Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 9111
Posted: 11:57am 29 Nov 2021
Copy link to clipboard 
Print this post

Will look at it but away from home at the moment and didn't pack a CMM2
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4226
Posted: 02:06pm 14 Jan 2022
Copy link to clipboard 
Print this post

@Peter,

I am sure the CMM2 is as complete as anybody could wish.
But I do have a request for additional functionality.
Could we add a simple 2D plot command ?

Below example from Octave is not MMBasic, but is explanatory of what I am envisioning.
x = -10:0.1:10; # Create an evenly-spaced vector from -10..10
y = sin (x);    # y is also a vector
plot (x, y);
title ("Simple 2-D Plot");
xlabel ("x");
ylabel ("sin (x)");


It is the simplicity of the "plot" command that helps people analyze data.
This is as simple as the output would look like, nothing fancy.



I know this can be done in MMBasic. Every project I re-invent the plot function, since I am very visually oriented.

Is this something that will still fit in the CMM2, and are you willing to code it up ?

Thank you in advance,

Volhout
Edited 2022-01-15 00:07 by Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4036
Posted: 02:25pm 14 Jan 2022
Copy link to clipboard 
Print this post

It's not my baby, but why would we need graph plotting in the firmware? Is this not the perfect use for a .INC file, I'm sure our prolific @William Leue or any number of others could knock one off for this purpose. Possibly if you wanted 3D contour plotting you would need firmware level of performance, but that's what CSUBs are for.

Best wishes,

Tom
Edited 2022-01-15 00:26 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4226
Posted: 03:10pm 14 Jan 2022
Copy link to clipboard 
Print this post

@thwill

You are right. All the graphics functions are there, so it is definitely possible in MMBasic, and not CPU intense. I simply did not create an ".inc" yet, I'll do that my next project, so I can benefit for the next...

I was stunned by the simplicity of the implementation in Octave. Hence the request.

I will withdraw my request.

Volhout
Edited 2022-01-15 01:11 by Volhout
PicomiteVGA PETSCII ROBOTS
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 01:05am 13 Feb 2022
Copy link to clipboard 
Print this post

System hangs with PIXEL FILL x,y,colour if x and/or y is outside the screen size, either less than zero or greater than MM.H/VRES.

ex: immediately after power up, type
PIXEL FILL 10,610,RGB(BLUE)
Reset needed to regain control.

This is with version 5.07.00 @ 400MHz.
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9111
Posted: 09:05am 13 Feb 2022
Copy link to clipboard 
Print this post

  Quote  System hangs with PIXEL FILL x,y,colour if x and/or y is outside the screen size, either less than zero or greater than MM.H/VRES.


Will make it cause an error - thanks
Edited 2022-02-13 19:10 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9111
Posted: 11:35am 13 Feb 2022
Copy link to clipboard 
Print this post

V5.07.02b3

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

Fixes bug in Option RESET setting display width and height
Fixes system crash caused by setting coordinates outside screen with PIXEL FILL. Now gives an error

New Functionality
NEW subcommands for SETTICK
SETTICK PAUSE, myint [,tickno] ' pauses the tick so that the interrupt is delayed but the current count is maintained
SETTICK RESUME, myint [,tickno] ' resumes the tick after a pause
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 01:06am 20 Feb 2022
Copy link to clipboard 
Print this post

The polygon command doesn't appear to accept -1 as a valid fill colour.

=======
I can't decide if PIXEL FILL outside the screen should give an error or just ignore the command. Other drawing commands don't mind offscreen coordinates. (Thank goodness ;-)

Or even clamp the coordinates to the screen and fill from there. (Unlikely to be useful.)

ie: PIXEL FILL MIN(MAX(x,0),MM.HRES),MIN(MAX(y,0),MM.HRES),fillcolour
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9111
Posted: 08:21am 20 Feb 2022
Copy link to clipboard 
Print this post

  Quote  The polygon command doesn't appear to accept -1 as a valid fill colour.


Why would it? If you want a transparent polygon just leave off the fill parameter. I think this is the same (or should be) for all fillable shapes

  Quote  I can't decide if PIXEL FILL outside the screen should give an error or just ignore the command.


I wasn't sure either. In general I don't like commands that do nothing and then return without an error but I can understand that in some cases it makes the Basic coding easier. In most cases I have made this sort of thing an error so will probably leave as-is
Edited 2022-02-20 18:24 by matherp
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 532
Posted: 01:13pm 20 Feb 2022
Copy link to clipboard 
Print this post

  matherp said  
  Quote  I can't decide if PIXEL FILL outside the screen should give an error or just ignore the command.


I wasn't sure either. In general I don't like commands that do nothing and then return without an error but I can understand that in some cases it makes the Basic coding easier. In most cases I have made this sort of thing an error so will probably leave as-is


For me the error is right way. If you think there can be error, you can still catch it with ON ERROR SKIP and calculate proper coordinates...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 04:48pm 20 Feb 2022
Copy link to clipboard 
Print this post

  matherp said  Why would it? If you want a transparent polygon just leave off the fill parameter. I think this is the same (or should be) for all fillable shapes.

That's fine at programming time, but not if the choice happens at run time.

If filled or outline is a user choice, more code is needed for just the polygon command:
IF fillcolour < 0 THEN
  POLYGON n,x%(),y%(),outlinecolour
ELSE
  POLYGON n,x%(),y%(),outlinecolour,fillcolour
ENDIF

With BOX, CIRCLE, RBOX, TRIANGLE, that if structure is contained in the command itself.
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9111
Posted: 05:49pm 22 Feb 2022
Copy link to clipboard 
Print this post

V5.07.02b4

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

Implements READ SAVE and READ RESTORE
These allow a subrountine or include file to read its own data whilst preserving the data pointers for the main program
e.g.

dim a(20)
data 0,1,2,3,4,5,6,7,8,9
data 10,11,12,13,14,15,16,17,18,19
for i=0 to 13
read a(i)
next i
readmydata
for i=14 to 19
read a(i)
next i
for i = 0 to 19
if a(i)<>i then print i,"ERROR",a(i)
next i
end
'
sub readmydata
local s$(7)
local i
read save
restore testlabel
for i=0 to 6
read s$(i)
next i
read restore
for i = 0 to 6
print s$(i);
next i
print ""
end sub
testlabel:
data b,c,d,e,f,g,h
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 06:58pm 23 Mar 2022
Copy link to clipboard 
Print this post

400MHz Colour Maximite 2
MMBasic Version 5.07.02b4
Copyright 2011-2021 Geoff Graham
Copyright 2016-2021 Peter Mather

I seem to have found a combination of data that locks up my CMM2 when trying to draw a 3D object.
Altering the z value (larger values) in the DRAW3D WRITE command (line 27) can clear the freeze, as can changes (lower values) to the z_viewplane and y_camera values in DRAW3D CAMERA (line 21.)

The pyramid has no base, for what it's worth.

Edit: Maybe related, there are drawing artefacts if the object is positioned at large plus/minus x values, y=0 and z passes through the region near 0. (Camera at y=0.) I think I can provide sample code if required.

> list
dim integer cindex(4)=(rgb(green),rgb(0,128,0),rgb(0,64,0),rgb(0,32,0),0)
dim q(4)
dim integer i

' Pyramid definition
dim integer nv2=5, nf2=4 ' pyramid has 5 vertices and 4 faces - no bottom face
dim v2(2,nv2-1)  ' coordinates of each vertex
for i = 0 to nv2-1 : read v2(0,i),v2(1,i),v2(2,i) : next i
data -6,-4,-6, 6,-4,-6, 6,-4,6, -6,-4,6, 0,9,0
math scale v2(),20,v2()

dim integer fcnt2(nf2-1)=(3,3,3,3)  ' number of vertices for each face
dim integer ecol2(nf2-1)=(2,2,2,2)  ' colour of edge of each face
dim integer fcol2(nf2-1)=(1,1,1,1)  ' colour of each face
dim integer fv2(math(sum fcnt2())-1) ' vertices for each face
for i = 0 to math(sum fcnt2())-1 : read fv2(i) : next i
data 0,4,1, 1,4,2, 2,4,3, 3,4,0
draw3d create 2, nv2, nf2, 1, v2(), fcnt2(), fv2(),cindex(),ecol2(),fcol2()
' End pyramid definition

draw3d camera 1,500,0,500

math q_euler rad(327),0,0,q()
draw3d rotate q(),2

' on your marks, get set, crash...
draw3d write 2,0,0,159


==================
Also, a slight anomaly, largely user error:

If you type
autosave "filename.bas"
but do NOT press enter, then send a text block from the console, the first line will get appended to the line you just typed. If the first line is a comment, all will work pretty much as expected, although that first line will be gone from the resulting autosaved file, and the command history (up arrow) will show the comment appended. If the first line is not a comment, expect an error or some other strangeness. And if the cursor is still inside the quotes when the upload begins...
Edited 2022-03-25 01:56 by vegipete
Visit Vegipete's *Mite Library for cool programs.
 
     Page 1 of 2    
Print this page
© JAQ Software 2024