Page 2 of 4

Re: Displaying Strings on the Screen

Posted: Fri Feb 09, 2018 8:34 pm
by Guenter
Michael wrote:
Fri Feb 09, 2018 8:29 pm
Guenter wrote:
Fri Feb 09, 2018 8:21 pm
... subfolders at least in the Programme folder would be nice for the users and a nice challenge for David ;)
There will be subfolders. No problem for David the magician!
Looks like you had this in the pipeline already.

Günter

Re: Displaying Strings on the Screen

Posted: Fri Feb 09, 2018 9:04 pm
by Michael
Guenter wrote:
Fri Feb 09, 2018 8:34 pm
Looks like you had this in the pipeline already.
Not until today. We discussed it this afternoon and made the decision.

Re: Displaying Strings on the Screen

Posted: Sat Feb 10, 2018 6:29 am
by mcc
Hi Michael, hi David,

"yabba dabba doo!"
-- Fred Flintstone

GREAT!
Thanks a lot!

Cheers
Meino

Re: Displaying Strings on the Screen

Posted: Sat Feb 10, 2018 4:38 pm
by mcc
Hi Bill,

so...weekend-time is DM42-time! :)

Thank you very much for writing the graphics programs! This is the kind of stuff, the DM42 screen needs!

But it seems that I am doing something wrong and cannot figure out, what it is.
As far as I understand, FONTS creates the data (bitpattern) for the characters, and
DISPLAY fetches the current contents of the ALPHA register and "paint" it on the graphics screen.

Beside the contents of the ALPHA register...what else do I need to provide to get an output onto the screen of my DM42?

Cheers!
Meino

(By the way: In a PM Michael says, that only a complete thread can be moved, not a single posting (the one with the file browser problems)...)

Re: Displaying Strings on the Screen

Posted: Sat Feb 10, 2018 6:26 pm
by Bill (Smithville NJ)
Hi Meino,

To display a string:
Load the Alpha Register with the String that is to be displayed
Store a complex number in Register "P". This complex number is the
screen coordinates where you wish the string displayed.
Then XEQ "DISPLAY"


Following is a simple program that would initialize the Font matrix,
initialize the screen resolution, and display the string "HELLO WORLD!"
at screen position 20, 25:

LBL "SAMPLE"
XEQ "FONTS"
2
STO "GrdMod"
CLLCD
CLA
"HELLO WORLD!"
20
25
COMPLEX
STO "P"
XEQ "DISPLAY"
END

Let me know if this doesn't work for you.

Bill
Smithville, NJ

Re: Displaying Strings on the Screen

Posted: Sat Feb 10, 2018 7:21 pm
by mcc
Hi Bill,

thanks for the explanation and the SAMPLE program, which I typed in.

After starting it, I got a "size error" at line 17 of "DISPLAY". This is command STO IND 00.

What I am doing wrong?

Cheers
Meino

Re: Displaying Strings on the Screen

Posted: Sat Feb 10, 2018 10:03 pm
by Bill (Smithville NJ)
mcc wrote:
Sat Feb 10, 2018 7:21 pm

After starting it, I got a "size error" at line 17 of "DISPLAY". This is command STO IND 00.

What I am doing wrong?

Cheers
Meino
You need to set the number of storage registers to 150.

SIZE command is in the MODES menu.

Select SIZE 150

That will allow for 150 storage registers.

Bill
Smithville, NJ

Re: Displaying Strings on the Screen

Posted: Sun Feb 11, 2018 3:47 am
by mcc
Hi Bill,

OH YEAH! Done that and it works GREAT (your library, not only the SIZE-command :) ! )
Thanks a lot for your help and the software!

Cheers
Meino

Re: Displaying Strings on the Screen

Posted: Tue Feb 13, 2018 3:41 am
by Bill (Smithville NJ)
I have updated the routines to now include both "Big Char" and "Small Char" fonts as specified in Free42.
I have also changed the way the programs interface. So if you have previously tried these, plese download these and review the changes below.
There are two routines:

FONTS.raw: Creates 2 x 128 Matrix "CHARS" for storing alpha characters. Row 1 contains "Big Chars", Row 2 contains "Small Chars"

FONTS just needs to be run once. As long as Matrix "CHARS" remains in memory, no need to rerun.

DISPLAY.RAW: Displays the Alpha Register on the screen at a specific location

Upon entry to DISPLAY, the Alpha Register contains the string to display, and X and Y registers contains screen coordinates, X=Row, Y=Column

The calling program should initialize FONTS (if needed), put a string in the Alpha Register and the screen coordinates into X & Y.

The Display routine includes the ability to switch back and forth between the two Char sizes and to display subscripts and superscripts. The ARROW characters are used as "Mode Change" characters. Just place an Arrow Character in the Alpha String where you wish to switch modes.

Modes are as follows:
Left Arrow - Switch to "Small Chars"
Right Arrow - Switch to "Big Chars"
Up Arrow - Switch to Superscript
Down Arrow - Switch to Subscript

To display the arrows in lieu of doing a mode switch, then put two of them in sequence. Fir example, two Left Arrows in a row would print the Left Arrow on the screen in lieu of switching to "Small Chars".

NOTE 1: DISPLAY ALWAYS starts out in "Big Chars".
NOTE 2: DISPLAY includes a "SIZE 150" command. If your calling program requires a larger SIZE, then you need to change this.
NOTE 3: DISPLAY uses Register 97-99 and 101 - 145.

The attached ZIP file contains FONTS.raw, DISPLAY.raw, S1.raw and S2.raw plus screen images for S1 and S2.

S1 is a sample program that displays both "Big Chars" & "Small Chars" on the screen for comparison purposes.
S2 is a sample program that demonstrates subscripts and superscripts.

Attached file XLS.zip includes excel program listings with my comments.

I would appreciate any comments, suggestions, recommendations that you may have.
There has been no attempt to preserve the Stack. Likewise there are no tricky stack manipulations.

Bill
Smithville, NJ

Re: Displaying Strings on the Screen

Posted: Mon Apr 09, 2018 4:57 pm
by Krauts In Space
Bill (Smithville NJ) wrote:
Tue Feb 13, 2018 3:41 am
I have updated the routines to now include both "Big Char" and "Small Char" fonts as specified in Free42.
I have also changed the way the programs interface. So if you have previously tried these, plese download these and review the changes below.
There are two routines:

FONTS.raw: Creates 2 x 128 Matrix "CHARS" for storing alpha characters. Row 1 contains "Big Chars", Row 2 contains "Small Chars"

FONTS just needs to be run once. As long as Matrix "CHARS" remains in memory, no need to rerun.

DISPLAY.RAW: Displays the Alpha Register on the screen at a specific location

Upon entry to DISPLAY, the Alpha Register contains the string to display, and X and Y registers contains screen coordinates, X=Row, Y=Column

The calling program should initialize FONTS (if needed), put a string in the Alpha Register and the screen coordinates into X & Y.

The Display routine includes the ability to switch back and forth between the two Char sizes and to display subscripts and superscripts. The ARROW characters are used as "Mode Change" characters. Just place an Arrow Character in the Alpha String where you wish to switch modes.

Modes are as follows:
Left Arrow - Switch to "Small Chars"
Right Arrow - Switch to "Big Chars"
Up Arrow - Switch to Superscript
Down Arrow - Switch to Subscript

To display the arrows in lieu of doing a mode switch, then put two of them in sequence. Fir example, two Left Arrows in a row would print the Left Arrow on the screen in lieu of switching to "Small Chars".

NOTE 1: DISPLAY ALWAYS starts out in "Big Chars".
NOTE 2: DISPLAY includes a "SIZE 150" command. If your calling program requires a larger SIZE, then you need to change this.
NOTE 3: DISPLAY uses Register 97-99 and 101 - 145.

The attached ZIP file contains FONTS.raw, DISPLAY.raw, S1.raw and S2.raw plus screen images for S1 and S2.

S1 is a sample program that displays both "Big Chars" & "Small Chars" on the screen for comparison purposes.
S2 is a sample program that demonstrates subscripts and superscripts.

Attached file XLS.zip includes excel program listings with my comments.

I would appreciate any comments, suggestions, recommendations that you may have.
There has been no attempt to preserve the Stack. Likewise there are no tricky stack manipulations.

Bill
Smithville, NJ
Hi Bill!
I'm working on a program with your character generator. It helps a lot. Hopefully I can release it into the forum in the near future.
Just the stack filled with complex numbers and the alpha register with some weird characters gives me some headaches.
For the moment I'd love to get a line delete. Is it in your code, do I miss something?

Best wishes,
Gernot