![]() |
Forum Index : Microcontroller and PC projects : CMM2: V5.05.06RC7
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
Sasquatch![]() Guru ![]() Joined: 08/05/2020 Location: United StatesPosts: 375 |
Something has changed in .JPG decoding along the way. Now I see horizonal bars of black across some images. Try running this: https://www.thebackshed.com/forum/ViewTopic.php?TID=12538&PID=152343#152343#152343 -Carl |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
Carl Please download and try again - no version change |
||||
Sasquatch![]() Guru ![]() Joined: 08/05/2020 Location: United StatesPosts: 375 |
Yes! That's got it. Thanks for the quick response! -Carl |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4244 |
Hi Peter, Close, but no cigar. This worked previously (including RC 12 & 13) but no longer works in RC 14: Colour Maximite 2 MMBasic Version 5.05.06RC14 Copyright 2011-2020 Geoff Graham Copyright 2016-2020 Peter Mather > list "phon_bug.bas" PLAY TTS PHONETIC "Weh4lkum tuw thah kahlah mae4ksihmay7t tuw" > run "phon_bug.bas" Error in line 1: Invalid phonetic text Best wishes, Tom Edited 2020-11-07 20:35 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
Check this and then try PLAY TTS PHONETIC ucase$("Weh4lkum tuw thah kahlah mae4ksihmay7t tuw") |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4244 |
OK, so it was just a "bug" that let it work using mixed case previously ? I can handle that. Thanks, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
picman100 Newbie ![]() Joined: 08/11/2020 Location: United KingdomPosts: 5 |
Hi matherp, is the source for this build available? Thank you Nick |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
More performance tweaks in V5.05.06RC15 http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip Improved performance of IMAGE RESIZE_FAST Improved performance of triangles without borders Improved performance and reduced memory footprint for simple strings with length <=15 or 2D strings with length <=5 e.g. dim s$ length 15 dim r$(1) length 5 Improved performance of POLYGON command for both triangles and quadrilaterals improved performance of LINE command for diagonal lines Use of oversized arrays for parameters for POLYGON and TRIANGLE In the case of POLYGON the command will read until it finds a ZERO in the number of vertices array In the case of TRIANGLE the command will read until it finds x1=y1=x2=y2=x3=y3=-1 Automatic case conversion of phonetic strings for PLAY TTS I've take the liberty of hacking Pete Cotton's ELITE demo to show off the performance and, in particular, the advantages of using the POLYGON command to allow scaling and positioning of a 3D object ' V5.05.06RC15 or above needed to run this demo mode 1 scale=1 xpos=400 ypos=300 scaleup=0 dim vertex(11,3) ' Store 11 vertex points of x, y and z co-ordinates dim nodeCount%=11 dim plane(16,4) ' Planes are made up of 3 or 4 vertexes dim drawNodeX(16) ' Stores the translated X,Y,Z co-ords of each node/vertex dim drawNodeY(16) dim drawNodeZ(16) dim colours(16) dim blacks(16) dim polyX(17*3+5) ' The array we use to store the points of the polygons dim polyY(17*3+5) dim PolyC(16) ' Vertex data is stored in 2 dimensional array where the 2nd dimension defines x, y or z vertex(0,0)=32:vertex(0,1)=0:vertex(0,2)=76 vertex(1,0)=-32:vertex(1,1)=0:vertex(1,2)=76 vertex(2,0)=0:vertex(2,1)=26:vertex(2,2)=24 vertex(3,0)=-120:vertex(3,1)=-3:vertex(3,2)=-8 vertex(4,0)=120:vertex(4,1)=-3:vertex(4,2)=-8 vertex(5,0)=-88:vertex(5,1)=16:vertex(5,2)=-40 vertex(6,0)=88:vertex(6,1)=16:vertex(6,2)=-40 vertex(7,0)=128:vertex(7,1)=-8:vertex(7,2)=-40 vertex(8,0)=-128:vertex(8,1)=-8:vertex(8,2)=-40 vertex(9,0)=0:vertex(9,1)=26:vertex(9,2)=-40 vertex(10,0)=-32:vertex(10,1)=-24:vertex(10,2)=-40 vertex(11,0)=32:vertex(11,1)=-24:vertex(11,2)=-40 plane(0,0)=2:plane(0,1)=1:plane(0,2)=0 plane(1,0)=0:plane(1,1)=1:plane(1,2)=10:plane(1,3)=11 plane(2,0)=6:plane(2,1)=2:plane(2,2)=0 plane(3,0)=0:plane(3,1)=4:plane(3,2)=6 plane(4,0)=7:plane(4,1)=4:plane(4,2)=0:plane(4,3)=11 plane(5,0)=1:plane(5,1)=2:plane(5,2)=5 plane(6,0)=5:plane(6,1)=3:plane(6,2)=1 plane(7,0)=1:plane(7,1)=3:plane(7,2)=8:plane(7,3)=10 plane(8,0)=9:plane(8,1)=5:plane(8,2)=2 plane(9,0)=2:plane(9,1)=6:plane(9,2)=9 plane(10,0)=3:plane(10,1)=5:plane(10,2)=8 plane(11,0)=7:plane(11,1)=6:plane(11,2)=4 plane(12,0)=10:plane(12,1)=8:plane(12,2)=5 plane(13,0)=11:plane(13,1)=7:plane(13,2)=4 plane(14,0)=9:plane(14,1)=10:plane(14,2)=8:plane(14,3)=5 plane(15,0)=9:plane(15,1)=6:plane(15,2)=7:plane(15,3)=11 plane(16,0)=9:plane(16,1)=11:plane(16,2)=10 sub rotate(ax, ay, az) snz=sin(az) csz=cos(az) sny=sin(ay) csy=cos(ay) snx=sin(ax) csx=cos(ax) for n=0 to nodeCount% x=vertex(n,0) 'x y=vertex(n,1) 'y ' Rotate around z drawNodeX(n)=x*csz-y*snz drawNodeY(n)=y*csz+x*snz drawNodeZ(n)=vertex(n,2) 'z ' Rotate around y x=drawNodeX(n) z=drawNodeZ(n) drawNodeX(n)=x*csy+z*sny drawNodeZ(n)=z*csy-x*sny ' Rotate around x y=drawNodeY(n) z=drawNodeZ(n) drawNodeY(n)=y*csx-z*snx drawNodeZ(n)=z*csx+y*snx next n end sub anglex=0:angley=0:anglez=0 page write 1 cls 'Main loop lc=0 do tts=timer cls anglex=anglex-0.00005 angley=angley+0.01 anglez=anglez+0.025 rotate(anglex,angley,anglez) tt2=timer PolyPos=0 PolyCount=0 for v=0 to 16 p1=plane(v,0) p2=plane(v,1) p3=plane(v,2) p4=plane(v,3) x1=drawNodeX(p1) y1=drawNodeY(p1) ' z1=drawNodeZ(p1) x2=drawNodeX(p2) y2=drawNodeY(p2) ' z2=drawNodeZ(p2) x3=drawNodeX(p3) y3=drawNodeY(p3) ' z3=drawNodeZ(p3) dx1=x1-x2 dy1=y1-y2 dx2=x1-x3 dy2=y1-y3 ' crossX=y1*z2-z1*y2 ' crossY=z1*x2-x1*z2 crossZ=dx1*dy2-dy1*dx2 ' norm=sqr(crossx*crossx+crossy*crossy+crossz*crossz) ' lightLevel=128+ (127*(crossY/norm)) 'dotproduct=x1*x2+y1*y2+drawNodeZ(p1)*drawNodez(p2) if crossZ>0 then polyx(PolyPos)=x1 polyy(PolyPos)=y1 polyx(PolyPos+1)=x2 polyy(PolyPos+1)=y2 polyx(PolyPos+2)=x3 polyy(PolyPos+2)=y3 PolyPos=PolyPos+3 colours(PolyCount)=rgb(128+v*5,255,255) if p4=0 then PolyC(PolyCount)=3 else 'It's a 4 point plane PolyC(PolyCount)=4 polyx(PolyPos)=drawNodeX(p4) polyy(PolyPos)=drawNodeY(p4) PolyPos=PolyPos+1 endif PolyCount=PolyCount+1 endif next v polyc(polycount)=0 'mark the end of valid polygons math scale polyx(),scale,polyx() math scale polyy(),scale,polyy() math add polyx(),xpos,polyx() math add polyy(),ypos,polyy() polygon PolyC(),polyx(),polyy(),blacks(),colours() if scaleup then xpos=xpos-1 ypos=ypos+0.5 scale =scale +0.002 if xpos=200 then scaleup=0 else xpos=xpos+1 ypos=ypos-0.5 scale =scale -0.002 if xpos=600 then scaleup=1 endif timerTotal=timer-tts timerRotate=tt2-tts timerDraw=timer-tt2 fps=fps*0.9+0.1*(1000/timerTotal) print @(0,0)"FPS: " +str$(fps) print "Rotate: " + str$(timerRotate) +" ms" print "Draw: " + str$(timerDraw) + " ms" ,lc lc=lc+1 page copy 1,0 loop Edited 2020-11-10 05:55 by matherp |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4244 |
Sounds good Peter. Does it involve a change in how they are stored in memory that is going to affect how we can PEEK and POKE them ? EDIT: or how we use MEMORY COPY on them. Thanks. Best wishes, Tom Edited 2020-11-10 06:12 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
qwerty823 Newbie ![]() Joined: 30/07/2020 Location: United StatesPosts: 30 |
Peter, Seems like a FILL of -1 causes the TRIANGLE sub to fail. It works if I leave out the fill color. David |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
Always has, always will. If you don't want a fill leave the optional parameter off |
||||
qwerty823 Newbie ![]() Joined: 30/07/2020 Location: United StatesPosts: 30 |
Strange... the manual says otherwise. ![]() TRIANGLE X1, Y1, X2, Y2, X3, Y3 [, C [, FILL]] Draws a triangle on the VGA monitor with the corners at X1, Y1 and X2, Y2 and X3, Y3. 'C' is the colour of the triangle and defaults to the current foreground colour. 'FILL' is the fill colour and defaults to no fill (it can also be set to -1 for no fill). All parameters can be expressed as arrays and the software will plot the number of triangles as determined by the dimensions of the smallest array. 'x1', 'y1', 'x2', 'y2', 'x3',and 'y3' must all be arrays or all be single variables /constants otherwise an error will be generated 'c' and 'fill' can be either arrays or single variables/constants. |
||||
PeteCotton![]() Guru ![]() Joined: 13/08/2020 Location: CanadaPosts: 523 |
Very cool! Thanks! I should also note that it gave a significant speed boost to the code I wrote for the Octohedron challenge. I know the rules state RC14, but with RC15 it went from 1525ms to 1304ms (it looks like the Triangle draw speed area of the code that is boosted). Great work as always Peter! Thanks! |
||||
LeoNicolas![]() Guru ![]() Joined: 07/10/2020 Location: CanadaPosts: 499 |
@matherp This new version is promising... many performance updates being delivered in one version. I'm still using the R14 due to the challenge constraints. Will you update the challenge requirements to accept the R15? |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4244 |
Repost in case it was missed: Does this involve a change in how they are stored in memory that is going to affect how we can PEEK, POKE or use MEMORY COPY on them ? Regards, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
Shouldn't do - zmim works fine and even a bit faster. The one no-no is trying to change the length byte in the header to more than 15 but that is true of strings now (255 in their case) Yes, since the objective is to go as fast as possible Manual doesn't match the code, will amend one or the other Edited 2020-11-10 22:10 by matherp |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4244 |
Thanks Peter. It wasn't Z-MIM I was concerned about, that doesn't really doing anything too funky because it was written to run on the CMM1 too (I hope to create a CMM2 specific version eventually to take advantage of your recent firmware enhancements, but it isn't near the top of my stack at the moment). My concerns were regarding any impact on the data-structure/lexer/parser tooling I'm working on currently ... currently all my unit-tests are passing with RC15 though, so looking good. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4244 |
Esoteric bug in RC 15 (and probably earlier), I suspect you'll say isn't worth fixing given it involves messing with ON ERROR: Colour Maximite 2 MMBasic Version 5.05.06RC15 Copyright 2011-2020 Geoff Graham Copyright 2016-2020 Peter Mather > list "bug.bas" Option Explicit On Option Default None foo() Sub foo() Local x% Print "Before" x% bar() Print "After" x% End Sub Sub bar() On Error Ignore do_nothing(1) On Error Abort End Sub Sub do_nothing(z) End Sub > run "bug.bas" Before 0 After Error in line 10: X is not declared The not immediately obvious solution is to provide a type for 'z'. Tom Edited 2020-11-11 02:47 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
Perspective transforms in V5.05.06RC16 http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip ![]() mode 1,16 load jpg "image2" image warp_h 0,0,400,385, 400,0,385, 600,85,385-170 image warp_v 0,0,400,385, 0,385,400, 100,385*1.5,200 do:loop The new commands are: IMAGE WARP_H x, y, w, h, x1, y1, h1, x2, y2, h2 [,readpage] [,dontcopyblack] IMAGE WARP_V x, y, w, h, x1, y1, w1, x2, y2, w2 [,readpage] [,dontcopyblack] x, y, w, h defined the top left coordinates and the width and height to read from the current write page or optional read page In both cases x1 and x1 define the top left corner of the area to write In both cases x2 and y2 define the top right corner of the area to write When warping horizontally h1 and h2 define the height of the transformed area at the left edge and right edge When warping vertically w1 and w2 define the width of the transformed area at the top edge and bottom edge Enjoy ![]() Correct Edited 2020-11-11 05:43 by matherp |
||||
LeoNicolas![]() Guru ![]() Joined: 07/10/2020 Location: CanadaPosts: 499 |
Mauro Xavier will love this new feature ![]() Peter, after installing the RC15 in my CMM2 the rotation octahedron time drop down from 1540 ms to 1085 ms. This is absolutely amazing ![]() Thank you for your hard work. |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |