Keen 4-5-6 choppy scrolling on EGA card

Getting old software/games running on older hardware.

Keen 4-5-6 choppy scrolling on EGA card

Postby keropi » 2017-6-03 @ 21:53

Hiya!

I've been testing my new 286/EGA setup and I noticed that Commander Keen 4,5 and 6 games are plagued with scrolling issues, have a look at this video: https://youtu.be/DfUJjNkNdI0
I tried the "Fix Jerky Motion" option but it did not help.
Keen Dreams, Keen 1~3 and Biomenace games are fine though. The EGA card uses the Paradise PEGA2 chipset , tried to search for a workaround but found nothing... Any ideas how to fix this? Maybe there is some command-line option I am missing?

TIA for any help/tips! :cool:
User avatar
keropi
l33t++
 
Posts: 7295
Joined: 2003-9-08 @ 06:45
Location: Greece

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby Jo22 » 2017-6-04 @ 04:22

Hi, keropi!

Sorry, have no idea what's going wrong there. I would like to help you and test Keen on my EGA-equipped 286..
..but I don't have any EGA monitor, sorry. :depressed:

Maybe you find some helpful stuff at Shikadi.net, though.

They have lots of pieces of information and different Keen 4 binaries: http://www.shikadi.net/keenwiki/Keen_4


Good Luck!

Best regards,
Jo22

(PS: Nice YT channel you've got!)
"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//
User avatar
Jo22
l33t
 
Posts: 3983
Joined: 2009-12-13 @ 07:06
Location: Europe

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby keropi » 2017-6-04 @ 08:09

thanks, I could not find something helpful there either... maybe it's just the way these Paradise chipsets are - I also have an olivetti pc with an onboard PEG2A ega and it behaves the same...
My yt "channel" is just dumping grounds for when I want to show something , no context whatsoever LOL

edit:
There is some Keen scrolling-related discussion here: http://www.vcfed.org/forum/showthread.p ... ion/page13 , did anything ever came out of it?
User avatar
keropi
l33t++
 
Posts: 7295
Joined: 2003-9-08 @ 06:45
Location: Greece

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby aleksej » 2017-6-05 @ 18:19

Maybe something like "/comp" cmd-line switch? :confused:
aleksej
Member
 
Posts: 321
Joined: 2006-4-30 @ 05:27
Location: Moscow

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby keropi » 2017-6-05 @ 20:27

Already tested that , it was meant for SVGA cards and does nothing to help me.
I will get another EGA with the CHIPS chipset as Plasma on VCF replied that it works fine. Fingers crossed!
User avatar
keropi
l33t++
 
Posts: 7295
Joined: 2003-9-08 @ 06:45
Location: Greece

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby aleksej » 2017-6-06 @ 08:13

Yes, CHIPS should be good for it. I have had two systems with CHIPS C&T video and everything is ok with scrolling on Keen 4-6 engine. Sure, these problems also have many ATI chips.
aleksej
Member
 
Posts: 321
Joined: 2006-4-30 @ 05:27
Location: Moscow

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby Great Hierophant » 2017-6-06 @ 13:32

I know Keen 4-6 is very speed sensitive with EGA games and highly compatible EGA cards, including IBM's. There seems to be an ideal speed where the scrolling is correct, at least in DOSBox (2200 cycles is good). Too fast or too slow and you get scrolling issues. It doesn't have the same speed-sensitivity issues with VGA cards.
http://nerdlypleasures.blogspot.com/ - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog
User avatar
Great Hierophant
l33t
 
Posts: 2401
Joined: 2003-4-27 @ 08:20

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby keropi » 2017-6-06 @ 14:58

Well I got a CHIPS 82C435 card, I will report back when I receive it.
Some VGA cards still have issues so the game isn't perfect apparently... LOL
User avatar
keropi
l33t++
 
Posts: 7295
Joined: 2003-9-08 @ 06:45
Location: Greece

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby Great Hierophant » 2017-6-06 @ 15:06

Secret Agent and probably Crystal Caves also have issues with EGA cards, although not nearly as bad as Keen 4-6 & KD.
http://nerdlypleasures.blogspot.com/ - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog
User avatar
Great Hierophant
l33t
 
Posts: 2401
Joined: 2003-4-27 @ 08:20

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby keropi » 2017-6-06 @ 15:23

all that speed talk made me realize I didn't try my 286 with the low setting... at 8mhz it still haves the same scrolling issues - just loading takes longer LOL
Secret Agent and Crystal Caves run OK , these are using the Keen1-3 engine right?
User avatar
keropi
l33t++
 
Posts: 7295
Joined: 2003-9-08 @ 06:45
Location: Greece

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby aleksej » 2017-6-06 @ 16:46

AFAIK, Crystal Caves and Secret Agent has broken image on CHIPS VGA series (65xxx) and totally unplayable. At the same time Keen 1-3 is ok.
aleksej
Member
 
Posts: 321
Joined: 2006-4-30 @ 05:27
Location: Moscow

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby Calvero » 2017-6-06 @ 19:25

keropi wrote:Secret Agent and Crystal Caves run OK , these are using the Keen1-3 engine right?

Wrong.

Secret Agent and Crystal Caves use the same graphics library as Dark Ages, Duke Nukem and FBI Fred.
Calvero
Member
 
Posts: 126
Joined: 2007-8-02 @ 13:30

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby elianda » 2017-6-09 @ 18:03

Wasn't it the case that the super-ega mode used in Keen 4-5-6 basically uses VGA features for the soft scrolling of the EGA screen?
At least I have seen the same that when on the same machine the graphics card is changed from VGA to EGA Keen starts stuttering.
Retronn.de - Vintage Hardware Gallery, Drivers, Guides, Videos. Now with file search
Youtube Channel
FTP Server - Driver Archive and more
DVI2PCIe alignment and 2D image quality measurement tool
User avatar
elianda
l33t
 
Posts: 2427
Joined: 2006-4-21 @ 16:56
Location: Halle / Germany

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby K1n9_Duk3 » 2017-6-12 @ 22:07

elianda wrote:Wasn't it the case that the super-ega mode used in Keen 4-5-6 basically uses VGA features for the soft scrolling of the EGA screen?
At least I have seen the same that when on the same machine the graphics card is changed from VGA to EGA Keen starts stuttering.


No. the engine uses the panning register to do the smooth scrolling ("smooth" as in "in multiple of 2 pixels"), which should be a standard EGA feature. The issues caused by switching from a VGA to an EGA card might be related to the fact that apparently EGA cards run 320x200 at 60 Hz while VGA card run it at 70 Hz. The Keen 4-6 engine uses multiples of 70 Hz for the internal timers, which means the delays don't align properly with the EGA refresh rate.

I think the jerky motion as seen in the video is caused by the CRT start address and the panning registers being updated at a bad time. From what I've seen in a disassembly, the update code tests the video status register to find the best moment to update the screen (address and panning). The code allows a maximum delay of 3 tics in the 70 Hz counter (about 0.043 seconds) and if the status doesn't line up properly during that time, the code ignores the status bits and updates the screen anyway. The thing is, there will be interrupts (otherwise the 70 Hz counter wouldn't be updated), which means there is a chance that the code misses the perfect moment to update the screen. From what I've seen, the "Fix jerky motion" option is even more likely to update the screen disregarding the state of the status bits.

I would suggest turning sound and music off, but as the choppy scrolling is also present during the terminator intro (when there's no sound or music playing), this probably won't help either.

I thought there was a "/latchpel" switch that might have helped, but that doesn't seem to be present in Keen 4-6 (or at least not in the latest version of the games). It seems that the "/jerk" switch replaced it. There is also a "/nopan" switch, but that will make the scrolling even more choppy.

If Keen Dreams and BioMenace work fine on your system, maybe you should try earlier versions of Keen 4. Tell me if one of them works better. If it does, it should be possible to patch its screen update code into the other games.
User avatar
K1n9_Duk3
Member
 
Posts: 116
Joined: 2016-9-30 @ 11:07

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby keropi » 2017-6-12 @ 22:38

Well I'll be damned: the "Special Demo Version v1.0 (538,631 bytes)" does have smooth scrolling :D , have a look: https://www.youtube.com/watch?v=WO51m7lWODI

I have tested all other versions as well, they all have the same problematic scrolling as shown in the video at the 1st post... I have no idea how to inject the old code to the new versions but if something comes up I'll be glad to test it :)
User avatar
keropi
l33t++
 
Posts: 7295
Joined: 2003-9-08 @ 06:45
Location: Greece

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby K1n9_Duk3 » 2017-6-12 @ 22:50

There are patching utilities that can modify the Keen 4-6 executables (in memory, the EXE files aren't modified). I'll need to know which versions of the games you have, so I where in the executable the screen update code will be.
User avatar
K1n9_Duk3
Member
 
Posts: 116
Joined: 2016-9-30 @ 11:07

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby CkRtech » 2017-6-12 @ 23:07

Interesting. I just ran "Special Demo Version 1.0" on my Matrox Mystique, and the scrolling was also smooth.
User avatar
CkRtech
Oldbie
 
Posts: 604
Joined: 2014-8-23 @ 00:54
Location: Seattle, WA

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby keropi » 2017-6-12 @ 23:23

K1n9_Duk3 wrote:There are patching utilities that can modify the Keen 4-6 executables (in memory, the EXE files aren't modified). I'll need to know which versions of the games you have, so I where in the executable the screen update code will be.


Awesome, Keen4+5 are v1.4 and Keen6 is 1.5
thanks a bunch in advance :blush:
User avatar
keropi
l33t++
 
Posts: 7295
Joined: 2003-9-08 @ 06:45
Location: Greece

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby K1n9_Duk3 » 2017-6-12 @ 23:53

Okay, this seems possible. The special edition demo updates the screen in 93 bytes of instructions. Keen 4 v1.4 (Apogee release) uses 196 bytes, so there should be more than enough space to copy the old code into the new executable.
User avatar
K1n9_Duk3
Member
 
Posts: 116
Joined: 2016-9-30 @ 11:07

Re: Keen 4-5-6 choppy scrolling on EGA card

Postby K1n9_Duk3 » 2017-6-13 @ 21:00

I've finished the patches for keropi. See attached files.

Please note that these patches only work for one specific version of each game. That's version 1.4 (Apogee release) for Keen 4 and 5, and version 1.5 for Keen 6.

First of all, download CKPatch v0.11.3 here.

Download my patch scripts, then extract my patch scripts (PATCH?.TXT and CK?.BAT) into the game's directory. Also copy the corresponding CK?PATCH.EXE into that directory. To play the game, simply run the CK?.BAT file.

I'm not sure what happens when you try to run these patches on the wrong game version, so make sure you're using the correct version of the game when trying to run these patches. If I understand the syntax correctly, the patch scripts should only modify the code of the correct EXE, so if you try to run it on version 1.0, it should not change anything, but I haven't actually tested this.

By the way, I added the original assembly code as comments in the patch file, so you can see what's going on in the screen update code. If you know a bit about programming in assembly, you should be able to modify the patch for better results on your system.

Edit: If CKPatch shows an "unrecognized version" error, try unpacking the executable with UNP or UNLZEXE.
Attachments
keen4-5-6.zip
patch files for CKPatch
(2.39 KiB) Downloaded 114 times
Last edited by K1n9_Duk3 on 2017-6-13 @ 22:53, edited 1 time in total.
User avatar
K1n9_Duk3
Member
 
Posts: 116
Joined: 2016-9-30 @ 11:07

Next

Return to Software

Who is online

Users browsing this forum: jmarsh and 1 guest