Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:26 24 Nov 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 : MMBasic Test Version 2.6A - With Fonts

     Page 3 of 4    
Author Message
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 08:09am 23 Sep 2011
Copy link to clipboard 
Print this post

  Geoffg said   Nick, I am not sure what you mean by a programmable character set but this ability to dynamically load different fonts sounds close. You could even generate the font file from within your program then load it as a new font within to the same program.Geoff


A command to redefine a character matrix.

Example:

FONT 42,10,27,102,210,3,33,76,100

In the above example, the first number is the ASCI character to be redefined and the remaining 8 numbers form an 8 x 8 pixel matrix (from the bit values).

This is assuming the font you have is 8 x 8.

The way this would work is that the font table is to be copied to RAM on boot. Then this command just re-assigns the matrix for each selected character. It could be POKE'd also but a command is nicer. May not need to be the entire character set if RAM is short.

This allows the font definitions to reside within the BASIC program. Or it could be loaded as you have done. It's just tidier with it in one program and easier to follow.

Also, a character can be redefined multiple times so that one character is being used multi-purpose. Allows for some simple animation too if one wants to go that far because redefining a single character that repeats itself on screen means that all occurrences change at one.

It's better than just loading a new font table.Edited by Nick 2011-09-24
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 02:09pm 23 Sep 2011
Copy link to clipboard 
Print this post

  Nick said  It's better than just loading a new font table.


Thanks for the tutorial but I could not disagree with you more in so many ways.

That was a messy technique only acceptable when 8K of RAM was big.
Geoff Graham - http://geoffg.net
 
Nick

Guru

Joined: 09/06/2011
Location: Australia
Posts: 512
Posted: 07:19pm 23 Sep 2011
Copy link to clipboard 
Print this post

  Geoffg said   Thanks for the tutorial but I could not disagree with you more in so many ways. That was a messy technique only acceptable when 8K of RAM was big.


Your missing the potential.

What if I wanted a program with one or two special characters? Do I have to create and load a complete new fontset to do that? The Font command would do that easy within the program.

What if I wanted to create a border around something that I would like to flash or animate in some way to highlight it? The font command would easily do that by changing one character.

In a game where an object needs to be moved left and right smoothly? A font command redefining 2 characters by shifting the bit pattern shape does that (The alternative is a font table with several characters with every 'frame' of the animation).

It's also more clearly defined and readable as a BASIC program. You can follow and understand the program logic if you can see the character redefinition.

Anyway, it's not my call. Just a suggestion of something that was available on Microbees, VIC-20's etc (although they had to POKE to change the fonts).

Nick
 
Gadget
Regular Member

Joined: 22/06/2011
Location: Australia
Posts: 70
Posted: 11:59pm 23 Sep 2011
Copy link to clipboard 
Print this post

Nick,

I agree being able to change individual characters on the fly could be usefull.
My understanding of how the video system works is that it is a plain bitmap and each time a character is 'printed' the bitmap that defines it is written to the screen bitmap, only the once. whereas the computers of the 80's used a character map and the video circuitry would look up what character was to be written, and then look up it's definition each time the screen was refreshed. Maximite only refreshes the screen with the data in the entire bitmap. so unfortunately we cannot employ the tricks we used to use on the older machines

Geoff correct me if I am wrong, but this is how I understand the video to work.

Terry
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 12:05am 24 Sep 2011
Copy link to clipboard 
Print this post

Hi All

Has anybody tried the new fonts with composite video ?
I seem to have a problem with the display getting all muddled up
when using the fonts. My old code (no font command) works fine
in VGA mode the display is as expected

The bit from 3060 - 3130 works as expected this only run once at startup
the bit from 4000 - 4070 produces the odd display only on composite video
this run in each pass


3060 PRINT "EVO Statistics"
3065 FONT #1, 2, 1
3070 LOCATE 30,20 : PRINT "Voltage"
3080 LOCATE 165,20 : PRINT "Cabin Temp"
3090 LOCATE 25,90 : PRINT"Manifold"
3100 LOCATE 210,90 : PRINT"Boost"
3110 LOCATE 60,155 : PRINT"AFR"
3120 LOCATE 190,155 : PRINT "Out Temp"
3130 RETURN

4000 ' rem print
4010 FONT #1, 3 : LOCATE 35,50 : PRINT volts$ +" V"
4020 LOCATE 210,50 : PRINT intemp$ + " C"
4030 LOCATE 177,120 : PRINT boost$ + " PSI"
4040 LOCATE 40,120 : PRINT exhtemp$ + " C"
4050 LOCATE 30,179 : PRINT AFR$
4060 LOCATE 210,179 : PRINT outtemp$ + " C"
4070 RETURN




Regards

John



Garbled display



Display of 18 remains even after doing a list



Layout with fonts is all good only goes odd when running
the value display code


Edited by jman 2011-09-25
 
BobDevries

Senior Member

Joined: 08/06/2011
Location: Australia
Posts: 266
Posted: 12:08am 24 Sep 2011
Copy link to clipboard 
Print this post

Hello guys,

I don't see a problem with creating a font "on the fly" with the commands we have now.

Since the font files are just text files, they can be created within a programme by opening a file, writing only those characters which are needed in your programme, and closing the file, then use the FONT LOAD command to enable it. If necessary, you could KILL the file when the programme terminates.

Regards,

Bob Devries
Dalby, QLD, Australia
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 01:38am 24 Sep 2011
Copy link to clipboard 
Print this post

John,

The problem is probably caused because you are not using a semicolon at the end of the print statements.

Without the semicolon a line feed will be outputted in the current font. The firmware will see that the line feed goes beyond the bottom of the screen because the font is so large, so it will scroll the screen upwards... not what you were expecting.

The moral is; with large fonts use a semicolon.

Was the cursor at the top of the screen when you had the display of 18 remaining even after doing a list? That would be normal, list does not clear the screen.

GeoffEdited by Geoffg 2011-09-25
Geoff Graham - http://geoffg.net
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 04:08am 24 Sep 2011
Copy link to clipboard 
Print this post

Another update - version 2.6C.

This fixes all the issues that I know of in 2.6B. Ie, the space/backspace before the prompt on USB and unloads any loaded fonts before running a program.

Download it from:
http://geoffg.net/Downloads/Maximite/Maximite_Update_V2.6A.z ip

Geoff (who is looking forward to Space Invaders on the MM)
Geoff Graham - http://geoffg.net
 
ajkw
Senior Member

Joined: 29/06/2011
Location: Australia
Posts: 290
Posted: 05:09am 24 Sep 2011
Copy link to clipboard 
Print this post

Geoff,

Font unload is not working

Error line xx: This font is in use

See attached jpg. Ignore the "header text" it is from my Autorun.




Also the link for version C is incorrect, you have linked version A.

Cheers,
Anthony.
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 06:12am 24 Sep 2011
Copy link to clipboard 
Print this post

  Geoffg said   John,

The problem is probably caused because you are not using a semicolon at the end of the print statements.

Without the semicolon a line feed will be outputted in the current font. The firmware will see that the line feed goes beyond the bottom of the screen because the font is so large, so it will scroll the screen upwards... not what you were expecting.

The moral is; with large fonts use a semicolon.

Was the cursor at the top of the screen when you had the display of 18 remaining even after doing a list? That would be normal, list does not clear the screen.

Geoff


Many many thanks you are course spot on
Made the change and now the display is working as expected
Updated Pics in the orginal post

Regards

John
 
ajkw
Senior Member

Joined: 29/06/2011
Location: Australia
Posts: 290
Posted: 08:07am 24 Sep 2011
Copy link to clipboard 
Print this post

I thought I'd have a go at making some numbers in-between 1 and 2 size. Maybe someone can use them.

2011-09-24_175912_MED.FNT.zip

The file is not a zip, just delete the date part and the .zip leaving MED.FNT or otherwise rename it.

This one works a lot better when inversed.
2011-09-24_193230_MED1.FNT.ZIP

Cheers,
Anthony.
Edited by ajkw 2011-09-25
 
jebz

Regular Member

Joined: 13/06/2011
Location: Australia
Posts: 79
Posted: 10:03am 24 Sep 2011
Copy link to clipboard 
Print this post

  ajkw said  
Font unload is not working
Error line xx: This font is in use


I tried your font and it works. The unload fails as well. I think the unload is not being recognised because it doesn't get capitalised when you list the program if it was lower case when entered.
 
Xiongmao

Regular Member

Joined: 25/08/2011
Location: Australia
Posts: 48
Posted: 10:25am 24 Sep 2011
Copy link to clipboard 
Print this post

What size should the .hex files be?
Up to 2.5F, the files unpacked to ~480kB. Now 2.6A/B/C unpack to around 1254kB. Is this right? It seems rather large. The bootloader reports programming ok, but on restarting, the MM does nothing. I revert back to 2.5F and all is good. With all versions, I unzipped with win7's inbuilt function.
 
jebz

Regular Member

Joined: 13/06/2011
Location: Australia
Posts: 79
Posted: 10:31am 24 Sep 2011
Copy link to clipboard 
Print this post

  Xiongmao said   What size should the .hex files be?
Up to 2.5F, the files unpacked to ~480kB. Now 2.6A/B/C unpack to around 1254kB.


2.6B/C were 1254KB on my downloads as well. 2.6C works on my Maximite.
 
Xiongmao

Regular Member

Joined: 25/08/2011
Location: Australia
Posts: 48
Posted: 10:44am 24 Sep 2011
Copy link to clipboard 
Print this post

Enh!

I tried it one more time - this time it behaved itself. Go figure!
 
wizard

Newbie

Joined: 29/07/2011
Location: United States
Posts: 38
Posted: 05:59pm 24 Sep 2011
Copy link to clipboard 
Print this post

Hi,

Hex size problem is due to a VERY large region
programmed to 'FF'.

Probably a jump in the source code for the font
tables?

Wiz

p.s.- Since unprogrammed state is FF, the hex file
could be split and become MUCH smaller.

Also, chip erases blocks to FF so large fields of
'00' cause unnecessary wear to the flash.
 
brucepython

Regular Member

Joined: 19/06/2011
Location: Australia
Posts: 64
Posted: 08:45pm 24 Sep 2011
Copy link to clipboard 
Print this post

Hi Geoff!
Just in case you were running out of things to do, I have come across a minor glitch in v2.6B when it runs an autorun.bas file at startup. Try this:

10 input a$
20 print a$

When run after entering the code, or at any time after booting, it works as it should. However, when run as autorun.bas at switch-on the character "v" is inserted after the prompt and prefixes the string a$.

I don't recall this happening with 2.4 or any of the previous versions I was using.

The glitch is inelegant rather than life-threatening so I'd put it at the bottom of your to-do list!

Many thanks for all the excellent ideas and hard work that's gone into the Maximite. I'm really looking forward to my fourth retirement so I can rip into some projects I've been wanting to start for several years. The Maxi will make them a lot more achievable. That's assuming I don't get dragged into yet another business idea, of course.

Bruce

NB Just discovered and installed v2.6C, which seems to have the same glitch.Edited by brucepython 2011-09-26
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 11:01pm 24 Sep 2011
Copy link to clipboard 
Print this post

As pointed out, I used the wrong link for this test version. It should be:
http://geoffg.net/Downloads/Maximite/Maximite_Update_V2.6C.z ip

This version should have fixed the font unload issue.

The hex file is larger than 2.6. This is because it contains place holders for development which I have not removed. This does not affect speed or your chip's life - just a little longer download time.

The "v" character on startup is caused by the keyboard on power up. I will have to dig into the arcane world of the IBM keyboard to find the cause but I bet that it is reporting its status or something. Until I find the cause a couple of INKEY$s in the autorun would remove them.

Thanks for the reports, this is great.
Geoff
Geoff Graham - http://geoffg.net
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 11:16pm 24 Sep 2011
Copy link to clipboard 
Print this post

Anthony,

I have just had a look at your screen shot and the font command is doing what it should. You have the font selected when you do the unload so it correctly reports that the font is in use.

Before you use the font unload command you should select another font. eg, FONT #1

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

Regular Member

Joined: 19/06/2011
Location: Australia
Posts: 64
Posted: 11:17pm 24 Sep 2011
Copy link to clipboard 
Print this post

Ah! Thanks Geoff. Just one inkey$ certainly solves the problem.

Most importantly, the idea of a keyboard generating its own contributions gives me great solace: it can now take the blame for all the typos I find in my ramblings.

Bruce



 
     Page 3 of 4    
Print this page
© JAQ Software 2024