Commander Keen Enters the Matrix: messing with video modes

Here, you can get help with anything or just chat about the original Commander Keen games.
Post Reply
tgies
Grunt
Posts: 5
Joined: Thu Aug 06, 2009 0:07

Commander Keen Enters the Matrix: messing with video modes

Post by tgies »

Hey folks. I used to post at this forum waaaaay back in the day, when it was on ezboard and when it was on insidetheweb or whatever it was called before that. Basically about ten or more years ago. I was briefly involved in that Isis II thing if anyone remembers that. I was also 10 or 11 years old and really dumb.

Anyway, I got to messing around with Keen 4 again today and created something horrifying.

http://www.youtube.com/watch?v=KvTjwuENyhU

I was poking around with the hideous CGA version of Keen 4, trying to get it to use the brown-green-yellow CGA palette instead of the cyan-magenta-white one (the brown-hued maps like Border Village were basically made for that palette! Come on!) when I sort of inadvertently trapped a mode switch into graphical mode and changed it to a mode switch into 80-column text mode. The result is REALLY TRIPPY. You can actually still make out features like the stone "huts" and stuff if you know what you're looking for. They wind up all red and flashy.

While I'm on the subject, has anyone experimented with changing the palette of the CGA version? I managed to do it in a debugger, but patching the EXE to add the palette switch interrupt has proven a little trickier than I'd expected. I'm way out of practice on my x86 asm anyway D:
Sciz CT
Council Janitor
Posts: 112
Joined: Thu Nov 01, 2007 4:57

Post by Sciz CT »

Groovy. I'm impressed that it actually still functions, never mind that it's even slightly recognizable.
tgies
Grunt
Posts: 5
Joined: Thu Aug 06, 2009 0:07

Post by tgies »

Sciz CT wrote:Groovy. I'm impressed that it actually still functions, never mind that it's even slightly recognizable.
It works simply because the game doesn't "know" or care how the video card is interpreting what's in its memory. The game blasts a bunch of bytes representing pixels to video memory, and how the video card chooses to deal with that is a completely opaque process.

I think it might result in a "snow" or "jitter" effect on certain CGA clone cards, however.

On another note, you can also do a similar trick in EGA Keen to trick it into displaying a 640*350 raster, which actually has the effect of letting you see "off the edge of the screen" and into adjacent areas. This also serves as a nifty visual aid to how Carmack's scrolling trick draws in tiles on the edges of the screen right before they scroll into view.
Galaxieretter
Arachnut
Posts: 891
Joined: Thu Nov 01, 2007 2:35
Location: Lancaster PA
Contact:

Post by Galaxieretter »

DANG! That's cool. I saw this happen before in another game... I'm not sure which one though.
tgies wrote:On another note, you can also do a similar trick in EGA Keen to trick it into displaying a 640*350 raster, which actually has the effect of letting you see "off the edge of the screen" and into adjacent areas.
Wow! How do you do this? I want to try it out with not only CK but with other games now.
User avatar
KeenRush
Android Dummy
Posts: 2560
Joined: Sat Oct 27, 2007 20:57
Location: KEEN1.EXE
Contact:

Post by KeenRush »

Cool. :smokin2 I'm surprised this works so well. :) I'd also be interested in seeing that 640x350 thing.

Welcome back, by the way.
My newest mod - Commander Keen: Sunset: viewtopic.php?t=8568 | codename H.Y.E.N.A.
User avatar
DaVince
lazy/busy Keener
Posts: 1476
Joined: Thu Nov 01, 2007 15:34
Location: Amsterdam, Netherlands
Contact:

Post by DaVince »

This is so amazing. Please provide more videos and/or patches! :)
Wow look at me I'm lurking
User avatar
Deltamatic
Vorticon Elite
Posts: 1418
Joined: Sun Apr 26, 2009 12:55
Location: Shreveport, Louisiana

Post by Deltamatic »

KeenRush wrote::smokin2
KeenRush, the curse of posting new pages is now transferred to you.
On an on-topic note, this thing is pretty awesome. Is it possible to change the font on it?
tgies
Grunt
Posts: 5
Joined: Thu Aug 06, 2009 0:07

Post by tgies »

KeenRush wrote:Cool. :smokin2 I'm surprised this works so well. :) I'd also be interested in seeing that 640x350 thing.

Welcome back, by the way.
Hey! I remember when you first started posting, I think. Man, that was ages ago.
Galaxieretter wrote: Wow! How do you do this? I want to try it out with not only CK but with other games now.
I'll see about writing step-by-step instructions to pull it off later, but basically you need to put the EGA card into mode 10h, as opposed to mode 0Dh. I suppose I could make a simple patch to cause it to start up in that mode -- it would only have to change one byte of the program.
Deltamatic wrote: On an on-topic note, this thing is pretty awesome. Is it possible to change the font on it?
Nope. Unfortunately, real CGA cards have the font in ROM and there's no way to change it short of modifying hardware. Some CGA clones that were in early laptops, etc. do let you redefine the font, though.
Calvero
Vortininja
Posts: 98
Joined: Tue Jan 29, 2008 15:31

Post by Calvero »

It's possible in Crystal Caves and Secret Agent to hack the game to use screen mode 640x200 instead of 320x200 and it shows the whole width of a level at once. Too bad it still scrolls horizontally, but I think that can be fixed.

I've read somewhere that it's also possible to hack DOSBox and some DOS pinball games to show the whole pinball table at once, instead of scrolling vertically.
Galaxieretter
Arachnut
Posts: 891
Joined: Thu Nov 01, 2007 2:35
Location: Lancaster PA
Contact:

Post by Galaxieretter »

tgies wrote:Nope. Unfortunately, real CGA cards have the font in ROM and there's no way to change it short of modifying hardware. Some CGA clones that were in early laptops, etc. do let you redefine the font, though.
Oh, is THAT why all the CGA games used to have the same font! :dead

And welcome back. I hope you stick around. Old people coming back is always awesome.
User avatar
Levellass
S-Triazine
Posts: 5266
Joined: Tue Sep 23, 2008 6:40

Post by Levellass »

I want that patch, it may have interesting applications.

And, Hey There!
What you really need, not what you think you ought to want.
Post Reply