Post Reply 
Displaying String on Free42 & DM42
04-05-2018, 02:00 PM
Post: #10
RE: Displaying String on Free42 & DM42
My version, or, my first working version ;-)
Changes wrt. Bill's:
- 128x2 matrix that holds the fonts is called FONTS. It is the transpose of Bill's CHARS.
- escape char ' to indicate the next char is to be drawn
- 5x1 matrix CTRL of control characters 14,15,16,94,39. To be created manually.
- last char is always drawn
- REGS is not used
- 2 entries, one for double wide/high chars. Can be used to draw extra large text in 200x120, or normal text in 400x240. Or for a really big font on the 42S ;-)

I also changed the name to DISPXY, to not interfere with your DISPLAY, but also because I was thinking along the lines of adding DISP that simply outputs text on a certain line, like on the 48/49/50.

Code:
 { 295-Byte Prgm }
>LBL "DSP2XY"
 2
 GTO 00
>LBL "DISPXY"
 1
>LBL 00
 ALENG
 X=0?
 RTN         ( quick return when nothing to do )
 X<>Y
 STO ".D"     ( multiplication factor )
 SIGN
 STO ".S"     ( font size, 1=large, 2=small )
 DIM ".C"
 Rv
 Rv
 COMPLEX
 STO ".P"
 INDEX ".C"
>LBL 12     ( create a matrix of char codes )
 ATOX
 ->
 FC? 77
 GTO 12
 SF 25
>LBL 90
 INDEX ".C"
 RCLEL
 DELR
 FC? 25     ( last char is always drawn )
 GTO 00
 INDEX "CTRL"
 [FIND]
 GTO IND ST X     ( control chars )
 GTO 00
>LBL 15     ( large font )
>LBL 16     ( small font )
 14
 -
 STO ".S"
 GTO 90
>LBL 94     ( superscript )
 +/-
>LBL 14     ( subscript )
 SIGN
 5
 RCL- ".S"     ( 3 or 4 depending on font size )
 *         ( up or down )
 RCL× ".D"
 0
 X<>Y
 COMPLEX
 STO+ ".P"
 GTO 90
>LBL 39     ( draw next char )
 INDEX ".C"
 RCLEL
 DELR
>LBL 00     ( draw char in X )
 INDEX "FONTS"
 1
 +
 RCL ".S"
 STOIJ
 RCLEL
 XTOA
 GTO IND ".D"
>LBL 02     ( double width and height )
 ALENG
 STO+ ST X
 1
 NEWMAT
 EDIT         ( X: 0 )
>LBL 04     ( loop over all characters )
 ATOX
 7
>LBL 03
 4
 R^
 *
 STO ST T
 Rv
 BIT?
 ISG ST Z
 LBL 03
 DSE ST X
 X=0?
 X=0?
 GTO 03
 3
 R^
 *
 ENTER
 ->
 Rv
 ->
 FC? 77
 GTO 04
 EXITALL
 256
 /
 ENTER
 IP
 XTOA
 0
 8
 COMPLEX
 RCL+ ".P"
 AGRAPH
 R^
 FP
 256
 *
 CLA
 XTOA
>LBL 01
 RCL ".P"
 AGRAPH
 ALENG         ( adjust Position )
 RCL+ ".D"
 STO+ ".P"
 CLA
 FS? 25
 GTO 90
 EXITALL 
 CLV ".P"
 CLV ".S"
 CLV ".C"
 CLV ".D"
 END

Cheers, Werner


Attached File(s)
.zip  DISPXY.zip (Size: 430 bytes / Downloads: 10)

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Displaying String on Free42 & DM42 - Werner - 04-05-2018 02:00 PM



User(s) browsing this thread: 1 Guest(s)