80x28 1bpp tile mode possible?(For terminal emulator)

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Post Reply
User avatar
D3thAdd3r
Posts: 2437
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

80x28 1bpp tile mode possible?(For terminal emulator)

Post by D3thAdd3r » Fri Feb 06, 2015 7:26 am

I had this idea in my head tonight, again, after messing around with terminal emulators(PuTTY rocks) for some off in the distance idea for Uzenet. A big problem is most servers are assuming a standard terminal width of 80 characters, for instance, NetHack doesn't look good in a 60 wide terminal(and you can't watch games in progress since they all use 80 or more). I figured some one with the knowledge could just easily say it can or it can't be done, and I could stop wondering. Some extra limitations would be fine too, even some weird tile width < 6, or the last/first horizontal line of each tile MUST be black, keep in mind it would be for ASCII characters only. I suspect there is a way to do this, but it looks like inline code + interrupt stuff would be required at the minimum, and I'm not to that level yet. For 6 pixel wide tiles, unroll 1 of 64 possible runs of ldi/out, or even preloaded regs and out/out/out/out/out/out using different regs for different colors?

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

Re: 80x28 1bpp tile mode possible?(For terminal emulator)

Post by CunningFellow » Fri Feb 06, 2015 8:49 am

I think so. Wait till I am in front of a spreadsheet and ill confirm if a 5x7 font is doable

User avatar
D3thAdd3r
Posts: 2437
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: 80x28 1bpp tile mode possible?(For terminal emulator)

Post by D3thAdd3r » Fri Feb 06, 2015 7:03 pm

Cool thanks in advance, also is there some good tutorial on general ASM design using spreadsheets or is it something you just have to learn through experimentation? I've noticed all ASM wizards are using that technique to come to solutions that are definitely not obvious. Never had use for a spreadsheet so there is probably information I'd have to learn just to try it out.

Also, it could use nearly all the ram and flash if necessary since the program would just be a dumb rendering terminal.

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

Re: 80x28 1bpp tile mode possible?(For terminal emulator)

Post by uze6666 » Fri Feb 06, 2015 9:21 pm

A 80 columns mode with 5 pix wide tiles would need 3.5cycles/pixel. That sound pretty challenging. The best I could come up is a resolution of 360x224, 4 cycles/pixel (mode 9) using 6x8 tiles that is still only 60x28. Even 5x8 tiles would still be under 80. The only way I ever achieved a 80 columns resolution was using external hardware (a shift register) on early prototypes. By the way, 80 columns (with 8 pixels wide tiles) usually doesn't look so good on TVs due to the NTSC color artifacts arising from the high resolution (though it look pretty awesome on monochrome monitors :P ).

I'd really like if Cunning can prove me wrong on this one. ;)

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

Re: 80x28 1bpp tile mode possible?(For terminal emulator)

Post by CunningFellow » Fri Feb 06, 2015 9:48 pm

80 characters at 6 pixels each is 480 pixels.

480 pixels gives 3 clocks per pixel.

After the 6 OUTs needed to change pixels that leaves 12 clocks per TILE to work out the next IJMP address and do it.

Sheer luxury. Thats plenty enough for a

Code: Select all

LD   Rn, Y+
MUL  Rn, Rm
MOVW ZL, R0
ADD  ZL, Ro
ADC  ZH, Rp
IJMP
In fact you have 3 clocks spare so I reckon you could have had a colour terminal with an attribute byte if not for the lack of RAM (80x28 = >2K RAM)

The unrolled decision for the above mode will take 25K of flash for a 128 character font.

For the speadsheet. Most of the time when I am thinking - I just use the spreadsheet like a notepad with convenient maths built in.

But when stuff gets hairy I use complex formulas to work stuff out for me that I could not in my head.

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

Re: 80x28 1bpp tile mode possible?(For terminal emulator)

Post by uze6666 » Fri Feb 06, 2015 10:26 pm

After the 6 OUTs needed to change pixels that leaves 12 clocks per TILE to work out the next IJMP address and do it.

Sheer luxury. Thats plenty enough for a

CODE: SELECT ALL
LD Rn, Y+
MUL Rn, Rm
MOVW ZL, R0
ADD ZL, Ro
ADC ZH, Rp
IJMP
Hmmm...and where do you actually load the pixel data?

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

Re: 80x28 1bpp tile mode possible?(For terminal emulator)

Post by CunningFellow » Fri Feb 06, 2015 10:29 pm

Sorry - that was just what is done in the 12 free clocks after the 6 clocks of pixel outing were done.
5x7font.png
The whole shebang
5x7font.png (2.77 KiB) Viewed 2875 times

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

Re: 80x28 1bpp tile mode possible?(For terminal emulator)

Post by CunningFellow » Fri Feb 06, 2015 10:39 pm

OH - and obviously it does not NEED to be monochrome. It could be as many colours as registers are spare.

I'd guess you could have somewhere around 16 colours possible.

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

Re: 80x28 1bpp tile mode possible?(For terminal emulator)

Post by CunningFellow » Fri Feb 06, 2015 10:42 pm

And the calculation that got me 25K of flash is

14 words per IJMP (for the 6 pixels wide char)
x 128 char font
x 7 rows down for the char
= 12544 words
= 25088 bytes

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

Re: 80x28 1bpp tile mode possible?(For terminal emulator)

Post by uze6666 » Fri Feb 06, 2015 11:34 pm

Sorry, I still fail to see how you can provide different pixel data to the OUT in your previous excel. That basically how mode 9 works, but it need an additional LDI per OUTs to load the pixel data.

Btw Lee, what character set is required? Do you need 128 or the full 256 ASCII set?

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests