Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:30 02 Aug 2025 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 : Micromite 5.0

     Page 3 of 4    
Author Message
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 12:23pm 28 Nov 2015
Copy link to clipboard 
Print this post

The problem with supporting accented chars, etc is that there are so many of them and no real standard (that I know of) for encoding them like ASCIl. So no, at this time I have no plans for this.

Yes, using either DEFINE FONT or LOAD FONT you can define a single character or a small subset of characters so they would be perfect for creating things like accented characters.

As you alluded, I included sprites in the Maximite version some time ago and I consider that effort a failure as only a small number of people used that feature (to good effect admittedly). Another problem is that I am not a games programmer and without the help of someone who is it is difficult to specify a good sprite interface. So, for the moment l don't have plans to introduce sprites.

Yes, I definitely have some sort of sound/audio/music on the agenda. Just how it should work is another question that I have not sorted out yet. My plan is to fix any remaining issues with the MM+ and release it as V5.0. Then I can incrementally add features like this. Once a feature is added it is painful for everyone if it is later removed or changed so I have to be cautious.

Geoff

Geoff Graham - http://geoffg.net
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 12:37am 29 Nov 2015
Copy link to clipboard 
Print this post

Thanks for the clarifications, Geoff.
Can you please post an example how a single character be redefined using DEFINEFONT as I am unable to work that out from the manual?

The sprites are not that much of importance at all at the moment, neither is the sound, but I think 8-bit support for the fonts is very much needed. You are right saying that the DEFINEFONT can be used to define the accented and special characters, but the fact MM+ is internally cutting the code down to 7 bits is very limiting. For example, if I type £ or € or á, nothing appears on the screen at all, because they both are with codes in the range 0x80..0xff.
If the MM+ was only able to allow these being addressed in a user-defined font, and not reset bit 7 in the code internally (if it does that now), that would be pretty much a full solution to the problem for now.
I can take care of defining a few full 8-bit code page fonts as per ISO8859, but need the support from the MM+'s side for that.Edited by kiiid 2015-11-30
http://rittle.org

--------------
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 01:51am 29 Nov 2015
Copy link to clipboard 
Print this post

  Quote  and not reset bit 7 in the code internally (if it does that now)


I don't think it does. If you have a look at the top of one of the font files Geoff has distributedyou see something like the following

' Grotesk16x32.bas
' Font type : Full (95 characters)
' Font size : 16x32 pixels
' Memory usage : 6084 bytes
' Font downloaded from: http://www.rinkydinkelectronics.com/r_fonts.php
DefineFont #8
5F202010 00000000 00000000 00000000 00000000 00000000 00000000 00000000


These first 4 bytes define the font as follows:
5F - number of characters in the font file
20 - offset to first printable character - i.e. <space>
20 - font height in pixels, i.e. 32
10 - font width in pixels, i.e 16

Any code (e.g. chr$(130)) which falls outside the range specified is printed as a <space>

so to define a font 8x13 with 255 printable characters you would use

FF000D08 as the first word

remember the PIC32 is little endian so the actual C definition would be:


const unsigned char myfont[] = {
0x8, 0xD, 0x00, 0xFF,


 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 02:16am 29 Nov 2015
Copy link to clipboard 
Print this post

For creating fonts the best that I can do is point you to http://www.rinkydinkelectronics.com/h_utft_fonts_101.php where the format is described.

On an extended character set, I understand your point and the importance. I will look at it before I finalise V5.0 for the MM+ but it might not be that easy.

This is because the top bit in a byte is used to indicate a token (command, function or keyword) in the program in memory. If an 8-bit character with the top bit set was allowed in a string it would be mistaken for for a token. At this time the only solution that I can think of is to map some extended characters to the space below 20 hex where the control characters reside. Even then there will be other hurdles lurking in the background.

When I designed MMBasic I was thinking of the simple US ASCII keyboard, not the extended character sets used internationally. It is this type of minimalist approach that enables MMBasic to run on microcontrollers while fancier languages that support unicode, etc can only run on a processor with much more resources.

Geoff
Geoff Graham - http://geoffg.net
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 02:21am 29 Nov 2015
Copy link to clipboard 
Print this post

Hi Peter, you were typing as I was typing.

Without checking the source directly I am sure that the top bit of any incoming byte is set to zero, so the extended character would never make it into memory.
Geoff Graham - http://geoffg.net
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 02:43am 29 Nov 2015
Copy link to clipboard 
Print this post

  Quote  Without checking the source directly I am sure that the top bit of any incoming byte is set to zero, so the extended character would never make it into memory.


No it works fine.

I created a 0xAF character font by appending a second copy of a font to itself

I tested using:

text 0,0,"hello"+chr$(130),,8

and it correctly printed "Hello#" where # is the expected character in the extended set

 
cosmic frog
Guru

Joined: 09/02/2012
Location: United Kingdom
Posts: 302
Posted: 03:00am 29 Nov 2015
Copy link to clipboard 
Print this post

The Sprite function on the MaxiMite was a failure I think because it was just too messy and complicated, also didn't have proper collision detection. It could have been nice and simple with a syntax like - SPRITE(sprite,image,x,y,collision).
It was too hard to use and in the end was easier just to use fonts.
With a better Sprite function I think more people would use it.

Dave.Edited by cosmic frog 2015-11-30
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 03:44am 29 Nov 2015
Copy link to clipboard 
Print this post

About the sprites... there is a simple way to start with.
Remember the shape tables in Apple 2? The DRAW and XDRAW commands? It is known as turtle graphic.
I have done similar stuff many years ago a few times, and it is always extremely simple and effective. In general these shape tables are slow for applications where speed is the main factor, but their benefit is the simplicity and minimum required system resources.

In a simple format we have a 16-bit word, which defines a single vector. The image is expressed by the needed number of vectors in a shape table.

Within a vector:
Bits 0..2 define the direction: N, NE, E, SE, S, SW, W, NW
Bits 3..5 define the operation: overwrite (ignore the old), OR, XOR, NOT, or skip (here is also the END marker for a table).
Bits 6..7 define the vector size in number of steps to take: 1..4
The entire second byte defines an 8-bit colour for the vector in format RGB332.

Of course there are ways to compress the shape table into a much smaller size, but they introduce some complications on the way. For example the colour and the operation can be given in a 'marker' byte, which is then followed by 4-bit vectors (the 4-th bit is skip or draw) only until the next marker byte, etc...
Edited by kiiid 2015-11-30
http://rittle.org

--------------
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 08:04am 30 Nov 2015
Copy link to clipboard 
Print this post

Regarding Touch Screen controller chips . . .

  Geoffg said  There are many different part numbers out there but fortunately they all seem to be compatible. I used the data sheet for the XPT2046 as my standard


Please - does anyone know a link to a 'sustainable' supply of these chips (or an equivalent/compatible chip).

I can get the TFT and Touch PANEL from a 'reliable' source, but am having trouble locating a supplier for the XPT2046

Thanks,
WWEdited by WhiteWizzard 2015-12-01
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 10:18am 30 Nov 2015
Copy link to clipboard 
Print this post

XPT2046 is a yellow copy of TI's TSC2046. You can find the latter one in Digikey or Mouser, at a much higher price of course. If you insist on cheap XPT2046 - AliExpress.

http://rittle.org

--------------
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 10:59am 30 Nov 2015
Copy link to clipboard 
Print this post

  kiiid said   XPT2046 is a yellow copy of TI's TSC2046...


Thanks for that Kon - just what I needed to know
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 01:39pm 30 Nov 2015
Copy link to clipboard 
Print this post

Yellow copy?
Smoke makes things work. When the smoke gets out, it stops!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2442
Posted: 02:57pm 30 Nov 2015
Copy link to clipboard 
Print this post

  Grogster said   Yellow copy?


racist term.

i've noticed these creep into the forums now and then, and really do wish people would avoid using them.

cheers,
rob
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 03:22pm 30 Nov 2015
Copy link to clipboard 
Print this post

Oh......Understood.
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 09:57pm 30 Nov 2015
Copy link to clipboard 
Print this post

@WW How many do you need. I am going to place an order soon and i will be needing about 100 of them. Maybe we can do a combined order to lower cost.
Original (i don't do Chinese copies) Texas Instrument chips, 16 pin TSSOP package.
I can get a quote within a few hours.
A PM is better, not really the right topic. Sorry guys.



Edited by MicroBlocks 2015-12-02
Microblocks. Build with logic.
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2944
Posted: 10:06pm 30 Nov 2015
Copy link to clipboard 
Print this post

@MicroBlocks - PM sent . . . .
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 11:44pm 30 Nov 2015
Copy link to clipboard 
Print this post

  robert.rozee said  
  Grogster said   Yellow copy?


racist term.

i've noticed these creep into the forums now and then, and really do wish people would avoid using them.

cheers,
rob


I don't think so.
In their anxiety not to offend anyone people sometimes go to extreme lengths...
The term roots from such as "yellow press", "yellow part" or "yellow story", i.e. something unbranded and without official approval or certificate.
Yellow copies can easily be made anywhere in the world, including Europe or America, and that has nothing to do with race.
http://rittle.org

--------------
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 12:03am 01 Dec 2015
Copy link to clipboard 
Print this post

I think the term here is "grey" (USA spelling: gray). As in: grey market.

Probably that's offensive somewhere :(

(Personally I object to being called white. I'm not, not even when very cold.)

JohnEdited by JohnS 2015-12-02
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 01:25am 01 Dec 2015
Copy link to clipboard 
Print this post

Grey is different. It refers to stuff on the fringe of the law.
http://rittle.org

--------------
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 02:38am 01 Dec 2015
Copy link to clipboard 
Print this post

Whereas yellow means breaking the law?

John
 
     Page 3 of 4    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025