|
Post by tokra on Jul 12, 2022 20:28:25 GMT
Probably a question for willymanilly or strobe:
Is it possible to define a VDC-charset wider than 8 pixels? I'm not talking about an 8 pixel font with up to 7 blank pixels to the right and neither semigraphics-mode were the last column is replicated for up to 7 pixels, but "true" wider characters. It seems the VDC always expects characters to be exactly 8 pixels (= 1 byte) wide. Vertically you can go up to 32 pixels and then 32 bytes make up a char, but horizonally it seems impossible to have more than 8 pixel width. Right?
|
|
|
Post by willymanilly on Jul 13, 2022 10:08:08 GMT
As stated in Mapping the Commodore 128 taking note of the sentence in bold, the maximum number of active pixels per character horizontally is 8 pixels regardless of the total character width.
22 $16 Character horizontal size control Bits 0-3: The value in these bits determines how many of the total horizontal pixels in the character position will be used to display character pattern data. (The total number is specified in bits 4-7 of this register.) If the number of active pixels is less than the total number of pixels, the extra pixels will be blank for intercharacter spacing. If you specify a value here that is greater than the total number of pixels available for the position, only the specified total number of pixels will be visible. However, the value here should not exceed 8, since a maximum of eight bits are available per byte of character pat- tern data. Even for values greater than 8, no more than eight pixels will be active per horizontal scan line within the character position. For graphic mode, the value here should be equal to the total number of pixels; otherwise there will be gaps in the display. The default value for these bits is 8, for eight active horizontal pixels per character-position scan line. This is the same as the total number of pixels per position, so there will be no intercharacter spacing. (For the default character set, the rightmost column of each character pattern is left blank to pro- vide the effect of intercharacter spacing,) Bits 4-7: The value in these bits determines the width of each character position (in pixels). The value stored here should be one less than the desired total number of pixels. If the total is greater than the number of active pixels specified in bits 0-3 of this register, the extra pixels will be blank for intercharacter spacing. The default value for these bits is 7, for eight total pixels per character position. The total number of horizontal pixels is determined by multiplying the value here (plus 1) by the total number of character positions (from register 0/$00).
|
|
|
Post by tokra on Jul 13, 2022 14:28:45 GMT
Thanks for checking. I was afraid this was the case. Interesting the C128 Programmers Reference Guide does not mention this. Up until now this was my go-to reference for VDC-registers. Is "Mapping the C128" better in that regard?
Sadly this means I cannot use a "true" DOS-style 9x14 font where characters from 0xC0–0xDF need to be exteneded into the 9th column. Using semigraphic-mode ALL characters would be expanded which looks bad for letters like "W".
Otherwise theoretically an ASCII/ANSI-viewer should be possible on the C128. Or does something like that already exist?
|
|
|
Post by c128old on Jul 14, 2022 17:15:46 GMT
If you check the VGA character matrices you will find the W is 8 pix. All others have the rightmost column empty. It is therefore possible to create the 9x14 font (in interlace) if you set the inter-character gap to 1 bit I use this on an LCD screen (these things deinterlace) to get nice readable output. Limits: when you enable the semigraph bit, graphics characters connect as intended but the M and W also extend. HW reverse still works. The MDA char matrix (monochrome to begin with) works. For CRT use you would need a slow phosphor tube (apple had these, see 8-bit guy mac-emul on amiga)
True VGA with attributes still needs graphics mode.
Finally: pc mda/vga has char and attrib interleaved. On VDC we have to switch the mem ptr all the time. I cannot think of a way to make VDC ‘skip’ or waste every other character. The best you do is char and attrib interlaced per line.
|
|
|
Post by strobe on Jul 18, 2022 7:07:30 GMT
Correct you can only define the first 8 pixels. Your only options for the inter-character gap are blank space or semi-graphics mode to extend the rightmost active pixels. I can't (quickly) think of any hack to achieve "true" 9 pixel character definitions other than using bitmap mode with some kind of soft-80 setup which would be horridly slow and not give you independent colour control of each character. But I think you are barking up the wrong tree here, as you are assuming that the MDA/VGA has fully defined 9 pixel wide characters but it doesn't. Which if you think about it makes sense because to do that you would need some kind of non-standard 9-bit ROM and/or special logic to read the 9th bit from some extra byte(s) or some other mucking around. Remember these chips were designed in the 80's when every transistor counts, they just wouldn't bother. If you check the wikipedia article on codepage 437 you'll see it mention this: The original IBM PC MDA display adapter stored the code page 437 character glyphs as bitmaps eight pixels wide, but for visual enhancement displayed them every nine pixels on screen. This range of characters had the eighth pixel column duplicated by special hardware circuitry,[23] thus filling in gaps in lines and filled areas. The VGA adapter allows this behaviour to be turned on or off.[24]
So basically MDA/VGA used intercharacter gap of one pixel with semi-graphics mode! So yes you could do 9x14 font just like on PC, the same way it does it. You would have to use interlace to get the height, and a 4:3 screen would give you about 80x30. I suspect a 9x16 font would look better as it would be more in proportion to what you expect if you wanted 80x25. If you really want 9x14 at 80x25 you would need to use a non-standard resolution like MDA did of 350 vertical lines for the active area (i.e. EGA resolution). As for the possibility of ASCII/ANSI viewer with PC fonts on VDC, remember that these have existed for years in one form - terminal programs like Desterm, Novaterm etc. For VDC references, I generally find Mapping the 128 a much better VDC reference than the 128 PRG. There lots of "tidbits" in there not in the PRG.
|
|
|
Post by tokra on Jul 18, 2022 8:14:51 GMT
Thanks, I actually found a simple ASCII/ANSI-viewer in the meantime called "Browser V2": commodore.software/downloads/download/810-c128-sequential-file-tools/305-browser-v2The only difference with VDC semigraphic mode compared to MDA is that it is only available as an "all-or-nothing"-option. While on MDA it is just activated for the characters from $c0-$df. I've tried a resolution of 720x350 non-interlaced already, but basically this only works with multisync-monitors or the C= 1901. Still looks interesting.
|
|