Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:26 25 Apr 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 5.05.06 beta

     Page 12 of 12    
Author Message
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5898
Posted: 03:04am 07 Oct 2020
Copy link to clipboard 
Print this post

  NPHighview said  OK - I've narrowed it down a bit.  The superscript 2 (CHR$(253)) works fine in fonts 1 and 4, but doesn't in 2, 3, or 5, regardless of video mode.


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 States
Posts: 192
Posted: 04:02am 08 Oct 2020
Copy link to clipboard 
Print this post

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: Australia
Posts: 5898
Posted: 06:09am 08 Oct 2020
Copy link to clipboard 
Print this post

  NPHighview said  Thanks, Jim, you're right, of course.

Still experiencing the flipped screendumps, though...

...and you're very nice to not say "RTFM" :-)

- Steve


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 Kingdom
Posts: 8578
Posted: 07:25am 08 Oct 2020
Copy link to clipboard 
Print this post

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: Canada
Posts: 1082
Posted: 07:40am 09 Oct 2020
Copy link to clipboard 
Print this post

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




  matherp said  
  Quote  I checked the ARMCFunctions.h and there are some functions missing, like triangle. Is there a new header file version?

Every function exposed in the header file needs code including in MMBasic to support it. It isn't as simple as just adding things to the header. I'm happy to consider things for inclusion but the shutter is just about to come down on V5.05.06 so you need to get in quickly with any requests

Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 08:25am 09 Oct 2020
Copy link to clipboard 
Print this post

  Quote  Would there be any use to a "MATH TRANSLATE in(), distance, out()" command?


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

  Quote  Could the pixel() function have an optional parameter specifying which page to read the pixel from?


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

  Quote  Could the command "LIST 19" be made valid?

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: Canada
Posts: 1082
Posted: 03:33pm 09 Oct 2020
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 8578
Posted: 04:43pm 09 Oct 2020
Copy link to clipboard 
Print this post

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


To reply to this topic, you need to log in.

© JAQ Software 2024