CPCWiki forum

General Category => Programming => Topic started by: uminded on 23:07, 02 January 20

Title: NC100/200 Fast Text Routines
Post by: uminded on 23:07, 02 January 20
I am trying to understand how to draw a 5x7 font on my NC200's screen in a custom application I am writing. I can boot from disk and use the systems text routines but I plan on clobbering the system memory map so I want to write my own.


Any helpful threads, posts, code snippets that I can use to learn from? Below is the NC100/200 screen mapping:



Code: [Select]
Top left hand corner of the screen.
A 1 bit set means the pixel is set to black.
The first byte controls the first 8 dots with bit 7 controlling the bit on the left.
The next 59 bytes complete the first raster line of 480 dots.
The bytes which define the second raster line start at byte 64.
To make the hardware simpler so bytes 60, 61, 62 and 63 are wasted.

byte00   byte01   byte02      byte60   byte61     byte63
76543210 76543210 76543210 .. 76543210 76543210.. 76543210 


The issue is if I use a small font (5x7) it does not align to any boundaries and I have no idea how to handle this. 3 (5 bit wide) characters can fit into 2 bytes but how do you track the running offset? Most importantly how to do this in a fast way when loading a whole page string with auto line wrapping...
Title: Re: NC100/200 Fast Text Routines
Post by: pelrun on 05:52, 03 January 20
IIRC the NC screen is vertically oriented, so the bits run down the screen, not to the right.
Title: Re: NC100/200 Fast Text Routines
Post by: uminded on 21:20, 03 January 20

Quote
Top left hand corner of the screen.
[/size]Bit 7 controlling the bit on the left.[/size]The next 59 bytes complete the first raster line of 480 dots.



From the documentation it sounds like its left to right one screen width at a time.