80 column text mode at quite high resolution

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
User avatar
Jubatian
Posts: 1404
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

80 column text mode at quite high resolution

Post by Jubatian » Sun Nov 17, 2019 7:09 pm

So...
mode80_screenshot.png
Mode 80 in emulator
mode80_screenshot.png (47.88 KiB) Viewed 714 times
Alec: Hope no problem! :D

This was actually an older idea, but seeing how people would like to have a good 80 character wide mode, I made an attempt at it on this weekend. It looks pretty good even on my small NTSC composite display, I purposely designed it so the characters should avoid producing color artifacting (tiles are 17 cycles wide especially for this reason).

Partly it is a "normal" code tile mode which would be capable to do colour like Mode 9, however as an initial, probably most generally useful attempt, I recreated an IBM 437 codepage on it. What is particularly new is that this mode has no actual pixels, the display essentially is some 1400 "pixels" wide (AVR cycles). The generator essentially compiles a tileset for this mode while optimizing it (which results in that this full IBM 437 character set takes "only" 20 kilobytes of ROM space).

The code as it is now is available on my fork for experimenting (It is a mess for now, the mode definitely needs more work, however the example should compile fine):

https://github.com/Jubatian/uzebox/tree ... ideoMode80
Attachments
m80demo.uze
Video mode demo
(28.54 KiB) Downloaded 25 times

CunningFellow
Posts: 1190
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: 80 column text mode at quite high resolution

Post by CunningFellow » Sun Nov 17, 2019 9:09 pm

Looks good on a real CRT.

However I can't make it look very good on my LCD display that is 320 pixels across.

What is your small NTSC display you are using?

User avatar
Jubatian
Posts: 1404
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: 80 column text mode at quite high resolution

Post by Jubatian » Sun Nov 17, 2019 9:18 pm

CunningFellow wrote:
Sun Nov 17, 2019 9:09 pm
However I can't make it look very good on my LCD display that is 320 pixels across.
That is simply not possible since 320 pixels is just not enough for this, no matter how you try it! Even with the most optimal mapping, one character would be 4 physical pixels, which makes it impossible to do 80 columns text on that, unless purposely designing a tiny font for the display with a few cheats here and there (such as an "m" is completely impossible with that). I don't think it is possible at all with the Uzebox (as we can not sync to the physical pixel boundaries to pull off such tweaks). I think my panel is a 800x480 one or something alike, so has about ~600 pixels in 4:3.

EDIT: A bit of stuff added, colors, vertical scrolling, splits, any of these only if you explicitly interact with the corresponding variables (by default, it is just BW text ready to go).
Attachments
m80demo.uze
Some color & scrolling
(28.75 KiB) Downloaded 20 times

User avatar
uze6666
Site Admin
Posts: 4487
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: 80 column text mode at quite high resolution

Post by uze6666 » Mon Nov 18, 2019 5:57 am

Was debugging my telnet client and fell on this 8-)
uzeforums.jpg
uzeforums.jpg (161.2 KiB) Viewed 682 times
Looked at your demo and counting the chars on a line...seems to be more that 80?!? :shock: What I'm I missing?

If you could fit an inverse video mode into it that would be truly be something. Mode 9 is 80 chars wide in principle, but technically, on a real ntsc screen, only about 76 are usable. :(

User avatar
Jubatian
Posts: 1404
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: 80 column text mode at quite high resolution

Post by Jubatian » Mon Nov 18, 2019 8:56 pm

Wow, that's a cool means to view the forum there! :)

You can already do inverse if you start playing around with it: Set up a display list, then you can (should be able to unless I bugged it!) set any global Foreground / Background color.

Code: Select all

m80_dlist_tdef dlist[1];

dlist[0].vramrow = 0U;
dlist[0].tilerow = 0U;
dlist[0].bgc = 0xFFU; /* Background color => White */
dlist[0].fgc = 0x00U; /* Foreground color => Black */
dlist[0].next = 0U;   /* End of Display List */

m80_dlist = &dlist[0];
Of course you could create a longer display list for splits, but a single entry display list is useful if you want to set global colors for text or smooth-scrolling the entire screen.

The demo is more than 80 columns, it is 86 actually, so that's why it looks odd. If you remove SCREEN_TILES_H from the demo's Makefile, it will give you a normal 80 column display.

Why it fits is that these tiles are 17 cycles wide contrary to 18 in Mode 9. The normal CGA high-res would be 16 cycles / tile, but I purposely avoided that as it is 2 colorburst clocks, so the characters would be very prone to pick up as color signal (that's how NTSC color tricks worked in old games). Otherwise with this mechanism, even going down to 15 cycles / tile would be possible, however I believe this is the most useful, a reasonably okay 80 characters display even on composite. I purposely designed the characters as well to avoid composite artifacting (although Mode 9 should also normally do well in this regard with the 3 cycles wide pixels).

User avatar
Jubatian
Posts: 1404
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: 80 column text mode at quite high resolution

Post by Jubatian » Mon Nov 18, 2019 11:35 pm

Did a bit of tweaking around. Now Mode 80 can actually fake Mode 9:
mode80_screenshot_mode9.png
Mode 80 faking Mode 9
mode80_screenshot_mode9.png (23.39 KiB) Viewed 646 times
To get there, as the repo is now, change the tileset in Mode80core.s, line 139, then in videoMode80.c, SetFontTilesIndex(0) (instead of 0x20 as in the Mode9 demo charset space is at position 0), as well as either removing or changing SCREEN_TILES_H in the demo's Makefile to 80. It will look pretty much like if it was Mode 9.

What this does is that its generator does pretty well compacting the character set, so you get this fake Mode 9 with a less than 10Kbyte character set (more than 10 Kbytes smaller than the actual Mode 9 demo).

Tweaking the generators for different dimensions is simple, both contain definitions for this on the top, so you can get other dimensions out of this video mode as well.
Attachments
m809demo.uze
Mode 80 faking Mode 9
(18.21 KiB) Downloaded 18 times

User avatar
Artcfox
Posts: 950
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: 80 column text mode at quite high resolution

Post by Artcfox » Tue Nov 19, 2019 12:06 am

Wow, this looks great!

CunningFellow
Posts: 1190
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: 80 column text mode at quite high resolution

Post by CunningFellow » Tue Nov 19, 2019 8:14 am

Yes - Very wow.

Jubatian - you are a coding machine.

User avatar
Jubatian
Posts: 1404
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: 80 column text mode at quite high resolution

Post by Jubatian » Wed Nov 20, 2019 5:20 pm

I added documentation, hope it could help starting out! I set it up so navigating to the mode displays it in GitHub, so the repo link takes you there:

https://github.com/Jubatian/uzebox/tree ... ideoMode80

User avatar
nicksen782
Posts: 677
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: 80 column text mode at quite high resolution

Post by nicksen782 » Wed Nov 20, 2019 5:31 pm

"You have been eaten by a grue!"
... Zork.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest