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 5.05.06 beta
Page 12 of 12 | |||||
Author | Message | ||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5898 |
Read the manual Page 28 Fonts 1 and 4 All 95 ASCII characters plus 7F to FF (hex) Fonts 2,3,5 and 7 All 95 ASCII characters If you want a font that does have the upper characters and 1 or 4 are not suitable, you will have to roll your own. If it's only 1 or two characters, it might be easier to make a small bitmap for them. Jim VK7JH MMedit  MMBasic Help |
||||
NPHighview Senior Member Joined: 02/09/2020 Location: United StatesPosts: 192 |
Thanks, Jim, you're right, of course. Still experiencing the flipped screendumps, though... ...and you're very nice to not say "RTFM" :-) - Steve Live in the Future. It's Just Starting Now! |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5898 |
Using OPTION Y_AXIS UP for anything other than Educational use when introducing students to computer charting is not advisable. You can always flip a BMP image fairly easily so all is not lost. DIM fname$ INPUT "BMP File name";fname$ 'fname$ = "40pin.bmp" bmpFlip fname$ LOAD BMP "flip_"+fname$ SUB bmpFlip f$ ' opens two files using #2 and #3 LOCAL x$, hdr$, b$ LOCAL INTEGER pixStart, iWdth, iHt, bits, bytesperrow, n, k ,rs OPEN f$ FOR INPUT AS #2 x$ = INPUT$(10,#2) ' skip this pixstart = ASC(INPUT$(1,#2))+ASC(INPUT$(1,#2))*256 + ASC(INPUT$(1,#2))*2^16+ASC(INPUT$(1,#2))*2^24 x$ = INPUT$(4,#2) ' skip this iWdth = ASC(INPUT$(1,#2))+ASC(INPUT$(1,#2))*256 +ASC(INPUT$(1,#2))*2^16+ASC(INPUT$(1,#2))*2^24 iHt = ASC(INPUT$(1,#2))+ASC(INPUT$(1,#2))*256 +ASC(INPUT$(1,#2))*2^16+ASC(INPUT$(1,#2))*2^24 x$ = INPUT$(2,#2) ' colour planes - not used bits = ASC(INPUT$(1,#2))+ASC(INPUT$(1,#2))*256 bytesperrow = INT((iWdth*bits/8+3)/4)*4 OPEN "flip_"+f$ FOR OUTPUT AS #3 SEEK #2,0 hdr$ = INPUT$(pixstart-1 ,#2) PRINT #3, hdr$; FOR n = iHt-1 TO 0 STEP -1 rs = pixstart + n*bytesperRow SEEK #2, rs FOR k = 0 TO bytesperRow-1 STEP 4 ' there will always be a mutiple of 4 bytes to a row b$ = INPUT$(4, #2) PRINT #3, b$; NEXT k NEXT n CLOSE #2 CLOSE #3 END SUB No effort made to speedup the process. Jim VK7JH MMedit  MMBasic Help |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8578 |
SAVE IMAGE does not currently respect OPTION Y_AXIS. This will be fixed in the next release candidate. |
||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1082 |
I'm not sure where to put this. These are ideas to consider, given the impending version freeze. Could the pixel() function have an optional parameter specifying which page to read the pixel from? When a program stops with an error, a suitable error message is given, such as Error in line 19: Y Dimensions 1 Could the command "LIST 19" be made valid? With the offending line displayed, variables could be examined to help diagnose the problem. As it currently stands, I can't see the offending line until I type 'EDIT', at which point values in variables are gone.Would there be any use to a "MATH TRANSLATE in(), distance, out()" command? This would add the value 'distance' to each element of the array. My use case? I wanted to fill the screen with hexagons, so I made 2 arrays with the x and y coordinates of the hexagon vertices. For each call to POLYGON, I had to translate each point so each polygon was in the right place. Not hard, but... mode 1,8 cls ' Define polygon vertices dim integer xorg(6) = (-10,-5,5,10,5,-5,-10) dim integer xgon(6) dim integer ygon(6) = (0,9,9,0,-9,-9,0) for j = 1 to 30 for v = 0 to 6 xgon(v) = xorg(v) ygon(v) = ygon(v) + 9 next v for i = 1 to 26 for v = 0 to 6 xgon(v) = xgon(v) + 30 next v polygon 6, xgon(), ygon() next i for v = 0 to 6 xgon(v) = xorg(v) + 15 ygon(v) = ygon(v) + 9 next v for i = 1 to 25 for v = 0 to 6 xgon(v) = xgon(v) + 30 next v polygon 6, xgon(), ygon() next i next j Visit Vegipete's *Mite Library for cool programs. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8578 |
Yes will include in next beta MATH ADD in(), num, out() This adds the value 'num' to every element of the matrix in() and puts the answer in out(). Works for arrays of any dimensionality of both integer and float and can convert between. Setting b to 0 is optimised and is the fastest way of copying an entire array OK but: not the PIXEL command,nor the line LINE command, nor........... PIXEL( x, y [,page_number]) Returns the colour of a pixel on the VGA monitor. 'x' is the horizontal coordinate and 'y' is the vertical coordinate of the pixel. See the chapter "Basic Drawing Commands" for a definition of the colours and graphics coordinates. The optional parameter page number specifies which page is to be read. The default is the current write page. Set the pagenumber to FRAMEBUFFER to read from the framebuffer – see the FRAMEBUFFER command Sorry no: difficult to do, difficult to parse, and wouldn't work when the error is in an include file |
||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1082 |
As Meatloaf would say, 2 out of 3 ain't bad. MATH ADD matches MATH SCALE so that is perfect. Can "in()" and "out()" be the same? Unclear from reading the manual. I suppose them being in function format is asking too much: out() = MATH(ADD, in(), num) PIXEL( x, y [,page_number]) is perfect. Absolutely no request from me for any of the image writing commands to work on other than the current write page. Only commands that read from the screen, all of which I think you've addressed now. Once again, thank you for your effort making this such a fantastic device to play around with. Visit Vegipete's *Mite Library for cool programs. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8578 |
vegipete - try the version just posted in the xmodem thread - should have your two requests - and yes - in() and out() can be the same array for ADD and SCALE |
||||
Page 12 of 12 |
Print this page |