Matrix Viewer

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: https://technical.swissmicros.com/decoders/dm42/

You can then copy/paste the listing and post it in "code" tags.
Bill (Smithville NJ)
Posts: 34
Joined: Sat Jul 22, 2017 9:14 pm

Re: Matrix Viewer

Post by Bill (Smithville NJ) »

fridlmue wrote:
Wed Feb 19, 2020 3:38 pm
Bill (Smithville NJ) wrote:
Wed Feb 19, 2020 2:52 pm
What else should I try?
Update your DM42 to the in just published "release candidate" version 3.17, then it will work. I had the same problem before that.
Just did the update and all is good.

Thanks.

Bill
Smithville, NJ
rprosperi
Posts: 1703
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: Matrix Viewer

Post by rprosperi »

There are some issues with the new rc1 build related to using the universal/platform-independent/portable state files; we hope an update will be available shortly. Short version - portable state files from other platforms likely cannot be read - so at the moment, not too portable... :(
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Bill (Smithville NJ)
Posts: 34
Joined: Sat Jul 22, 2017 9:14 pm

Re: Matrix Viewer

Post by Bill (Smithville NJ) »

Werner,

Could you post the raw file of the program that generates the "UFL" font file?
I see this is a variation of the file I had done with a middle size font added for
the digits 0-9.

Also, what does the letters "UFL" stand for? Assume the "F" is for FONT.

It's too bad that we can't save/load a Matrix variable. Would make it a lot
easier than regenerating a fixed matrix.

Thanks,

Bill
Smithville, NJ
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: Matrix Viewer

Post by whuyse »

Hi Bill,
Yes I realised there’s no easy way of copying a matrix to another state file, but I wanted to make it easy to take a peek.
You don’t need UFL though, well not for now, I just put the digit fonts into DF, but the problem remains of course. One of my goals is to have UFL hold all 4 fonts, and do away with DF, but that is going to take a while.
UFL is short for Universal Font Library, a term coming from my ‘48 days ;-)
The differences with your CHARS matrix are:
- fonts are ordered small to large, so font 1 is 5 high, font 2 6 etc.
- fonts are top-aligned (well that currently holds only for DF)
- every character ends with a blank
- UFL now contains a font per column, your CHARS one per row. I think I’ll adopt the row encoding as well.
I created UFL from CHARS, actually, and have only added digit fonts 6x4
I’ll see that I can create a DF program, I have been working on a Print Matrix program that will do exactly that
( I have added an 8x5 font 4 in the meantime )

Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
Bill (Smithville NJ)
Posts: 34
Joined: Sat Jul 22, 2017 9:14 pm

Re: Matrix Viewer

Post by Bill (Smithville NJ) »

whuyse wrote:
Fri Feb 28, 2020 6:18 pm
Hi Bill,
Yes I realised there’s no easy way of copying a matrix to another state file, but I wanted to make it easy to take a peek.
You don’t need UFL though, well not for now, I just put the digit fonts into DF, but the problem remains of course. One of my goals is to have UFL hold all 4 fonts, and do away with DF, but that is going to take a while.
UFL is short for Universal Font Library, a term coming from my ‘48 days ;-)
The differences with your CHARS matrix are:
- fonts are ordered small to large, so font 1 is 5 high, font 2 6 etc.
- fonts are top-aligned (well that currently holds only for DF)
- every character ends with a blank
- UFL now contains a font per column, your CHARS one per row. I think I’ll adopt the row encoding as well.
I created UFL from CHARS, actually, and have only added digit fonts 6x4
I’ll see that I can create a DF program, I have been working on a Print Matrix program that will do exactly that
( I have added an 8x5 font 4 in the meantime )

Cheers, Werner

Hi Werner,

Thanks for the explanations. I've been going over your code that was in your state file and
had noticed that the DF program extracts the digits from UFL and then does the top alignment.
That took me a little while to figure out what was going on.

I've picked up some new coding techniques from reviewing your programs.
One of the best was the use of subtracting the pressed key code from the key code
matrix and doing 1/x on the matrix. If it results in an error (ie, divide by zero) then
you know if a valid key was pressed. Much quicker/easier than using the matrix FIND
function. I would have never thought of doing that.

What I would like to see is development of standard font/string display routines that
everyone could use in developing their programs. I think I would like to standardized on
your routines since they are better developed than mine. Likewise your UFL matrix.
Just need to get them documented as individual stand alone routines that other could load
and call.

Thanks for all your work and please keep me updated on your progress.

Bill
Smithville, NJ
Bill (Smithville NJ)
Posts: 34
Joined: Sat Jul 22, 2017 9:14 pm

Re: Matrix Viewer

Post by Bill (Smithville NJ) »

Werner,

I would like to modify my routines to use your UFL matrix. That way only one
font matrix for everyone. But I have some questions/comments:

1. It sounds like your final UFL matrix will have four font sizes. That would be fantastic.
2. I'm not sure about having the UFL matrix "top aligned". By it being Bottom Aligned,
it makes doing upper/lower case words simple - likewise doing subscripts/superscripts.
3. I think it would be best to have the UFL matrix bottom aligned and then just use your
DF program to adjust for a top aligned digit matrix when required.

I would like to go ahead and modify my "FONTS" program so that it will create the "UFL" matrix.
I could make the UFL matrix 128x4, insert your middle digits 0-9 and then leave the other columns
with missing fonts as "0".

But before I do this, let's come to a decision of 128x4 or 4x128.

Once I get the revised "UFL" done, I can then update my programs to use it.

I would like to get everyone doing program development to use the same UFL matrix,
so that we don't end up with multiple font files.

(Now if we can only get a Matrix Variable Load/Save function!!)

Appreciate your comments on this.

Bill
Smithville, NJ
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: Matrix Viewer

Post by whuyse »

Bill (Smithville NJ) wrote:
Fri Feb 28, 2020 6:48 pm
I've picked up some new coding techniques from reviewing your programs.
One of the best was the use of subtracting the pressed key code from the key code
matrix and doing 1/x on the matrix. If it results in an error (ie, divide by zero) then
you know if a valid key was pressed. Much quicker/easier than using the matrix FIND
function. I would have never thought of doing that.
I couldn't use [FIND] because I'm EDITing the matrix.
But there's an even better/easier way: POSA.
Create a matrix, say "GK", holding the alpha codes of the supported keys, 6 per entry.
Then the GETKEY loop becomes:

Code: Select all

 RCL "GK"
 CLA
 XTOA
>LBL 10
 Rv
 GETKEY
 POSA
 X<0?
 GTO 10
 Rv
 GTO IND ST L
But I couldn't use that here, as the Alpha register holds the code to invert the current number, and I need to apply that again to remove the focus. Once I have the 'Black Block' code BLK integrated I might use it.

Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: Matrix Viewer

Post by whuyse »

Bill (Smithville NJ) wrote:
Fri Feb 28, 2020 8:28 pm
2. I'm not sure about having the UFL matrix "top aligned". By it being Bottom Aligned,
it makes doing upper/lower case words simple - likewise doing subscripts/superscripts.
3. I think it would be best to have the UFL matrix bottom aligned and then just use your
DF program to adjust for a top aligned digit matrix when required.
Okay. What is important to me is that I can make the whole program independent from the font used, as is currently already the case for the indexes. I can make the font top-aligned when I create the "1", "2", "3 and "4" digit font local variables. I can't use bottom-aligned fonts because they will erase part of the cells above in overwrite mode, which I need as I don't do a CLLCD unless I really have to. I tried to make everything as fast as possible, I had no idea how long a screen refresh would take.
There was another reason to use top-alignment: you can define fonts 1,2 and probably almost all of font 3 with strings and hex edits. Bottom-alignment means all chars use codes >128, and the program to create UFL will grow quite a bit larger. Unless we create it as top-aligned and then run a small routine to make them bottom-aligned, as I did with DF.
I would like to go ahead and modify my "FONTS" program so that it will create the "UFL" matrix.
I could make the UFL matrix 128x4, insert your middle digits 0-9 and then leave the other columns
with missing fonts as "0".

But before I do this, let's come to a decision of 128x4 or 4x128.
I tend to think column-wise, but in this case I will adopt the row order, for the simple reason that extracting a font is then a row, which is stored sequentially. Not that anyone would notice the difference, what with the blazing speed of the DM42.

Thanks for your comments & interest!
Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: Matrix Viewer

Post by whuyse »

I’m having second thoughts on the top vs bottom-aligned fonts.
Bill (Smithville NJ) wrote:
Fri Feb 28, 2020 8:28 pm
2. I'm not sure about having the UFL matrix "top aligned". By it being Bottom Aligned,
it makes doing upper/lower case words simple - likewise doing subscripts/superscripts.
Upper/lower case is no issue of course, that’s not what I meant by ‘topaligned’. It’s just that a font of n pixels occupies the top n pixels, not the bottom n.
And sub- and superscript is similar: just swap the two adjustments? (The Y-adjustment for a bottom-aligned subscript is the negative of the adjustment for a top-aligned superscript)
On the other hand, AGRAPH’s coordinates refer to the top left of the string to display, and if you’re going to display several lines, lower lines may overwrite what you’ve written before (with bottom-alignment).
So, I still vote for top-alignment ;-)

Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: Matrix Viewer

Post by Walter »

Top or bottom alignment are nice alternatives as long as you're talking about one line only. They become less relevant turning to multiple lines: you've to provide interline space anyway be it at top or bottom of characters. 8-) So choose top or bottom and keep it.
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
Post Reply