News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_llopis

Minimal library to draw text

Started by llopis, 22:04, 09 November 18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

llopis

I'm thinking of creating a diagnostic program that would be 100% in ROM. I'd love to find out a library/routine to draw text on screen. It can be super simple, hardwired fonts, no fancy colors or anything. I could do it myself, but I'm sure that must be done somewhere already. Can someone point me in the right direction?


LambdaMikel

If we do, are you going to acknowledge help that is offered to you, are you going to ignore the replies?

fgbrain

#2
Its easy to make your own little text toutine.
Decide for which screen mode first.
Then grab the font you are using for texts
The shortest code will use mode 2 (1 byte per character line)
_____

6128 (UK keyboard, Crtc type 0/2), 6128+ (UK keyboard), 3.5" and 5.25" drives, Reset switch and Digiblaster (selfmade), Inicron Romram box, Bryce Megaflash, SVideo & PS/2 mouse, , Magnum Lightgun, X-MEM, X4 Board, C4CPC, Multiface2 X4, RTC X4 and Gotek USB Floppy emulator.

llopis

Quote from: LambdaMikel on 16:21, 10 November 18
If we do, are you going to acknowledge help that is offered to you, are you going to ignore the replies?
I'm not sure I follow. This would be for an open source project that I would put up on GitHub. I would acknowledge all significant contributions.


Sent from my iPhone using Tapatalk

llopis

Quote from: fgbrain on 22:21, 10 November 18
Its easy to make your own little text toutine.
Decide for which screen mode first.
Then grab the font you are using for texts
The shortest code will use mode 2 (1 byte per character line)
Right. I probably did that a bunch of times in the last. I was hoping not to have to write that myself again :-)


Sent from my iPhone using Tapatalk

LambdaMikel

#5
Quote from: fgbrain on 22:21, 10 November 18
Then grab the font you are using for texts



Maybe just use the firmware routines?

llopis

Quote from: LambdaMikel on 03:02, 13 November 18
Maybe just use the firmware routines?
I could use the firmware routines to copy the font, but I want this routine to be completely independent of the system firmware (I realize it wasn't clear in my initial description). This is for a diagnostics program, so I want it to work even in the case of a faulty system ROM.

HAL6128

#7
just easily do (for MODE 2):

org &4000   ;just an example... could be somewhere else e.g. &00 in lower ROM ??

ld bc,&7f8e
out (c),c    ;enable mode 2 / disable upper and lower roms paging

ld d,&08 ;number of fine line
ld ix,pattern ;address of bit pattern
ld iy,&c030 ;address of screen ram
ld bc,&800 ;next line of screen address
.l1
ld a,(ix+&00)
ld (iy+&00),a
inc ix
add iy,bc
dec d
jp nz,l1
ret

.pattern
defb 16,16,40,40,68,124,130,130 ; just a simple "A"
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Powered by SMFPacks Menu Editor Mod