Experiment in changing text mode settings

NOTE: I HATE A LOT OF YOUR ZZT GAMES, SO WATCH OUT!

Moderators: Commodore, Zenith Nadir

Post Reply
User avatar
Quantum P.
Level 17 Accordion Thief
Posts: 1433
Joined: Fri Sep 12, 2003 1:41 am
Location: Edmonds, WA
Contact:

Experiment in changing text mode settings

Post by Quantum P. »

A year ago, gingermuffins showed us that you can use a palette changing utility, a font changing utility, and blinkx together. That works just fine, but I couldn't help think about optimization...

Single TSR which sets font, palette, and high-intensity backgrounds

It works like the .com files Font Mania uses -- tsr2 i installs the program into memory, and tsr2 u flushes it out of memory. Main differences: you don't have as many files to tote around, it's slightly smaller than Font Mania's .com files, it's slightly more memory efficient, and it does more stuff.

The easiest way to change what it does is to modify the .asm file/.chr and .pal files and recompile (using NASM 0.98.39, DOS version: nasm -fbin tsr2.asm -o tsr2.com). The .chr and .pal files are in the same format that MegaZeux exports them. If you don't like compiling, you can manually edit the .com file with a hex editor -- the font data, palette data, etc, comes after the string "DATA" in the file. Check the .asm file for a clue as to what does what and what comes first.

(I suppose it would be a good idea to write a utility that actually makes it easy to create a new .com file.)



The utility mentioned above would already be more or less pointless. There are existing utilities that do a the same thing (as demonstrated by gingermuffins), and that are easier to use. But we can go further with pointless things! We still need, at minimum, three files: a .com file, a .zzt file, and a .bat file to tie it all together (we're not counting ZZT itself here). What if you had a program which both starts ZZT as a subprocess and loads the font stuff and everything into memory? That's just two files!

Even better, what if you stored all the font stuff at the end of the ZZT file, after the last board, and had a .com file that read the font data from the ZZT file itself? Maybe listen in on whatever interrupt is called for opening files under DOS, and change fonts on the fly, as soon as they open the world from the menu within ZZT! Add whatever BIOS calls were used in MZXak to get SMZX mode, and we could have an "I can't believe it's not MegaZeux" competition! Or something.

But all that's beyond even my pointlessness threshold (although I do think it would be cool to do SMZX stuff in ZZT, even though nobody uses SMZX even in MegaZeux).
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Post by Commodore »

do tsrs work in dosbox? I know people have problems with using fonts in XP (and i'm sure vista doesn't even run zzt) though any true dos gamer has their own real dosbox, it seems that fonts (and perhaps other tsrs) may get pushed to the wayside considering the future of zzt (and dos) will eventually live only in emulation.
*POW* *CLANK* *PING*
User avatar
Quantum P.
Level 17 Accordion Thief
Posts: 1433
Joined: Fri Sep 12, 2003 1:41 am
Location: Edmonds, WA
Contact:

Post by Quantum P. »

TSRs do indeed run in DOSBox, at least in 0.72. Fonts work okay, but if the characters in your font aren't 16 pixels high (MegaZeux and a lot of ZZT games use 14 pixels, for a 640x350 screen), DOSBox will fill the extra space instead of resizing the window. It's still playable, though.

Also, I found a copy of MZXak (the MegaZeux fork which first introduced SMZX) and fired it up in DOSBox. It runs, but no SMZX -- so for compatibility reasons, a SMZX.com file probably wouldn't be a good idea.
User avatar
Commodore
fgsdfs
Posts: 2471
Joined: Wed Mar 12, 2003 5:44 pm
Location: :noitacoL
Contact:

Post by Commodore »

man that was the stupidest run-on sentence I wrote.
*POW* *CLANK* *PING*
Post Reply