Page 2 of 3

Re: 80 column text mode at quite high resolution

Posted: Thu Nov 21, 2019 7:12 am
by uze6666
This is really insane and clever. My head hurts trying to understand it.
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
Sorry I wasn't clear, I meant an attribute bit to do arbitrary inverse per character, like in this post. ...unless your lists can do that?

Re: 80 column text mode at quite high resolution

Posted: Thu Nov 21, 2019 8:41 pm
by Jubatian
uze6666 wrote: Thu Nov 21, 2019 7:12 am This is really insane and clever. My head hurts trying to understand it.
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
Sorry I wasn't clear, I meant an attribute bit to do arbitrary inverse per character, like in this post. ...unless your lists can do that?
If you fill up the whole character set, half with the "straight" characters (0 - 127), next half with the inverted variants (128 - 255), then essentially you will have that! I attached a generated character set (21Kbytes) and a corresponding demo. Include the charset on Line 139 of videoMode80core.s instead of the cp437 one, compile, and you have it!

At this resolution I don't see it possible to do an algorithmic swap, or the size of that could end up being much worse (even if it can be done in 2 clocks, having an "rjmp" instead of that likely pays off in tail merging).

EDIT: I assume you have a 128 character set there, I can not quite imagine it working in any other manner at the moment (where else the attribute bit could come from than the 7th bit of the character). If so, I guess the characters beyond the 96 standard ASCII are different than in CP437. If you pass me a character set, I could draw the corresponding extra 32 for the terminal emulator.

Re: 80 column text mode at quite high resolution

Posted: Thu Nov 21, 2019 8:52 pm
by nicksen782
Impressive! I look forward to seeing what comes next! I'm sure a text adventure game would be totally welcome!

Re: 80 column text mode at quite high resolution

Posted: Fri Nov 22, 2019 1:58 am
by uze6666
If you fill up the whole character set, half with the "straight" characters (0 - 127), next half with the inverted variants (128 - 255), then essentially you will have that!
Yeah Indeed, that's what I tried with mode9 but the roughly 110 tiles inverted set could not fit in flash so I resorted to add that flag on the 7th bit (so yes, it's a 128 max tileset). So you say you have a full 256 tileset in just 21K -- and all 80 chars are visible on a TV screen? That's pretty impressive...my crappy version needs 32K for 128 tiles. Man, I spent a couple weeks on this and you find a better method in a day or so?! Leave me a bit of thunder! :lol:
If so, I guess the characters beyond the 96 standard ASCII are different than in CP437. If you pass me a character set, I could draw the corresponding extra 32 for the terminal emulator.
Yeah I decided to prefer the use of the box drawing chars to all the accents and other symbols from ASCII to 31. Here's what I have now. But I can make you another one with all the box chars I can fit up to 127. Btw, what's the size of tiles in your mode and how many clocks per pixel?

Re: 80 column text mode at quite high resolution

Posted: Fri Nov 22, 2019 7:53 pm
by Jubatian
Here you go, a terminal character set attached.

To use it, like before, videoMode80core.s, line 138, include it. Then in videoMode80.c, also modify the appropriate line to read SetFontTilesIndex(0); as this character set has the space at position 0.

I attached the source image as well, that's how it looks like raw. The tiles are 17 cycles wide, corresponding to 17 pixels. You can have up to 7 stretches of pixels, with some limitations, depending on what sort of tile fetch code the compiler can cram between the required "out"s to achieve the appropriate display. Last "pixel" is always 3 cycles wide (ijmp), and either the first or second pixel has to also be 3 cycles wide (for an rjmp). In total the row must have at least 4x 3 cycles wide pixels (the two others are for the ld and the mul instructions), and there are also two 1 cycle instructions which have to fit. The compiler tries to fit from many possible sequences to allow for quite decent freedom.

The minimal size of this type of tileset is 16 KBytes for 8 pixels tall tiles. If you are using a Mode 9 like generation, then it is 8 KBytes for 8 pixels tall tiles, so you may get a Mode 9 like 256 character monochrome font in ~12-15Kbytes (if you used color, then there are less opportunities for tail merging, which would inflate size).

Re: 80 column text mode at quite high resolution

Posted: Fri Nov 22, 2019 11:21 pm
by rv6502
I've also been working on an 8x8 80x25 mode for doing ports.
Each row has to end with a null byte (memory is 81x25) to jump-table out of the sequence so I only got 127 characters usable.
PA222684-small.JPG
PA222684-small.JPG (610.02 KiB) Viewed 12374 times
It's still a bit clunky and my cheap USB capture dongle doesn't line up the pixels right so making screenshot still requires going hardware :lol:
Screenshot_2019-11-22_17-47-34.jpg
Screenshot_2019-11-22_17-47-34.jpg (261.6 KiB) Viewed 12374 times
I don't think I can fix that part, looks like it's just the cheap USB capture being too low-res.

4112 bytes for the charset but I got nothing in the 0-31 range and the font has lots of identical rows so a lot of them get merged.

Font from https://github.com/dhepper/font8x8

Doesn't display in the emulator tho.. I'll have to see if I can patch that.

Re: 80 column text mode at quite high resolution

Posted: Sat Nov 23, 2019 12:48 am
by CunningFellow
rv6502, What CPU tricks are you using to make the emulator not work?

Re: 80 column text mode at quite high resolution

Posted: Sat Nov 23, 2019 12:58 am
by rv6502
Emulator is happy with it once patched :D
Screenshot_2019-11-22_19-47-04.png
Screenshot_2019-11-22_19-47-04.png (105.92 KiB) Viewed 12372 times
And I need to adjust my mid-frame audio generator call it's messing up the hblank by quite a few cycles even with the recursive interrupt.

Funny enough the CRT doesn't care. I guess they used to try hard to keep the picture lined up nice even with bad RF signals. Hurray for PLLs

Re: 80 column text mode at quite high resolution

Posted: Sat Nov 23, 2019 1:10 am
by rv6502
CunningFellow wrote: Sat Nov 23, 2019 12:48 am rv6502, What CPU tricks are you using to make the emulator not work?
I'm being somewhat loose with the vsync signal and the emulator has a very narrow tolerance.

Analogue hardware only cares if past a certain threshold of sync time with a simple capacitor charge/discharge and digital hardware only cares if it's more than 50% duty ratio (or some other arbitrary threshold) of sync then it's a vsync.

Re: 80 column text mode at quite high resolution

Posted: Sat Nov 23, 2019 1:58 am
by uze6666
Each row has to end with a null byte (memory is 81x25) to jump-table out of the sequence so I only got 127 characters usable.
Ha, I arrived with the same solution with my last version with the attribute bit! :ugeek: But I will trash it and use Jubatian's, looks pretty good and the size of the tileset is nothing less than impressive. I didn't look but I assume the vram layout and tile indexes are plain standard (no weird scheme like I used).