CMM2 V6.00.00 betas


Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10169
Posted: 04:20pm 21 Mar 2025      

Attached is an update to the CMM2 firmware.


CMM2V1.5.zip


This brings the MATHS routines up-to-date with the PicoMite. In addition it implements BYVAL and BYREF in function and subroutine definitions.
Finally, it implements drawing thick diagonal lines

Prior to this release diagonal lines could only be 1 pixel wide. This version implements the ability to specify the line width. Currently horizontal and vertical lines can have a defined width and the x1 and y1 coordinate define the top-left pixel of the thick line. i.e. the line is to the right of the specified position or below it on the screen.

This makes no sense for thick diagonal lines where the line should be centered on the origin pixel. To maintain compatibility with existing code you specify this by setting the width as a negative number as in the example below

Try the attached

Option default none
page write 2
Const sw=-7,mw=-11,hw=-15
Const sl=250,ml=220,hl=180
Const xc=MM.HRES\2,yc=MM.VRES\2
Dim integer t=Epoch(now)
Dim x$=DateTime$(t)
Print x$
Dim integer s,m,h
Do
 show s,sw,sl,0
 show m,mw,ml,0
 show h,hw,hl,0
'  t$=Time$
 s=Val(Right$(x$,2))*6
 m=Val(Mid$(x$,15,2))*6
 h=Val(Mid$(x$,12,2))*30
 show h,hw,hl,RGB(yellow)
 show m,mw,ml,RGB(green)
 show s,sw,sl,RGB(red)
 Circle xc,yc,-mw,,,RGB(blue),RGB(blue)
 page copy 2 to 0,b
 Pause 50
'  Do
'  Loop Until Time$<>t$
Inc t
x$=DateTime$(t)
print @(0,0)x$
Loop
'
Sub show(byval angle As integer, byval w As integer, byval l As integer,  byval col As integer)
 Local integer x=l*Sin(Rad(angle))+xc
 Local integer y=yc-l*Cos(Rad(angle))
 Line xc,yc,x,y,w,col
End Sub