Graphical Errors on 3D games

Software related questions

Re: Graphical Errors on 3D games

Postby Trixter » Thu Oct 16, 2014 8:58 pm

Okay, this beat me up tonight; the issue tends to go away when you use a debugger so trying to debug a problem that isn't showing up is madness.

I have narrowed down the issue to certain places where a keypress occurs and a sound is generated or stopped. If you turn sound off, the issue happens much less, but it can still happen. I'll see if I can get to the bottom of it tomorrow night.

This is very atypical, btw. I have patched a lot of games to run on PCjr and 99% of them are pretty easy.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Graphical Errors on 3D games

Postby MadKingCorduroy » Fri Oct 17, 2014 4:07 pm

Wow that's weird. I really appreciate you doing this, this is so cool. :D
MadKingCorduroy
 
Posts: 14
Joined: Sun Mar 03, 2013 8:28 am
Location: Illinois, USA

Re: Graphical Errors on 3D games

Postby Trixter » Fri Oct 17, 2014 7:52 pm

(Posting for future posterity, and that so others can learn from this exercise)

I found out why it was glitching, and it had nothing to with the previous writes to ports 3d8 and 3d9 -- while those are unsupported, sending them garbage doesn't cause the glitch. What causes the glitch is when Elite tries to write to the speaker (seriously). Controlling the speaker is done through port 61h. On a regular PC, those bits are:

Code: Select all
0: Tmr 2 gate --- OR 03H=spkr ON
1: Tmr 2 data -+  AND 0fcH=spkr OFF
3: 1=read high switches
4: 0=enable RAM parity checking
5: 0=enable I/O channel check
6: 0=hold keyboard clock low
7: 0=enable kbrd


Bits 0-1 control the speaker. Bit 2 is "reserved" (it does nothing). Now, contrast that with the PCjr:

Code: Select all
0: Tmr 2 gate --- OR 03H=spkr ON
1: Tmr 2 data -+  AND 0fcH=spkr OFF
2: +Alpha (-Graphics)
3: Cassette motor off
4: Disable internal beeper and cassette motor relay
5: SPKR switch 0
6: SPKR switch 1
7: reserved


Bits 0-1 are the same, but bit 2 toggles between text mode and graphics mode! And that bit is getting set sometimes and then sent to the speaker. The original programmer didn't do anything "wrong" because that bit does nothing on a PC.

I have an idea where this is getting set; the game runs a housekeeping interrupt 1000 times a second and that interrupt is responsible for, among other things, playing complex sound effects where bit 1 is toggled quickly. I think bit 2 is getting set in there by mistake. Problem is, I'm not sure it can be fixed because I need "room" to add an instruction that un-sets bit 2 before sending it to the speaker, and there is currently no room.

Work continues...
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Graphical Errors on 3D games

Postby Trixter » Fri Oct 17, 2014 8:47 pm

And, we're done:

ftp://ftp.oldskool.org/pub/misc/Softwar ... iteljr.exe

...which changes this code:

Code: Select all
seg000:00D9                 in      al, 61h         ; PC/XT PPI port B
seg000:00DB                 mov     origPortB, al
seg000:00DE                 and     al, 11111100b
seg000:00E0                 mov     portBSpkrVal, al


...to this:

Code: Select all
seg000:00D9                 in      al, 61h         ; PC/XT PPI port B
seg000:00DB                 mov     origPortB, al
seg000:00DE                 and     al, 11111000b  ; <--- also clear bit 2 which is +Alpha (-Graphics)
seg000:00E0                 mov     portBSpkrVal, al


This saves the port 61h info with the graphics bit cleared; since this variable is only used when the game is in graphics mode anyway, it works. Tested successfully; sound, graphics, all work correctly. Probably works on a regular PC as well.

Now let's see another episode of Will it run on the IBM PCjr? ;-)
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Graphical Errors on 3D games

Postby MadKingCorduroy » Fri Oct 17, 2014 10:24 pm

OH MY GOD YOU ARE AWESOME! IT WORKS PERFECTLY! :D

I can't even begin to tell you how awesome this is! I never thought this would be possible lol. YOU ARE THE COOLEST!
I'm am literally dancing around the room! lol

You can bet I'll be letting the world know of this new version in the VERY near future! OMFG this is so cool. lol

Once again I just have to tell you thank you! This has really made my day! YOU ARE THE COOLEST! lol

Also, it runs perfectly fine on my Windows 98SE Packard Bell Platinum 55. So I am guessing it should work fine for all the rest of the PC clones out there as well. :D
MadKingCorduroy
 
Posts: 14
Joined: Sun Mar 03, 2013 8:28 am
Location: Illinois, USA

Re: Graphical Errors on 3D games

Postby Trixter » Mon Oct 20, 2014 9:52 am

:-) Hope the game itself is living up to your standards. Companion video, if you're curious: https://www.youtube.com/watch?v=BCSaKuqPrf4

BTW the crack message in the executable wasn't for you; that was from my original crack in 1989, which is why it is so inelegant. If I can still find the originals, I'll likely re-crack it to just bypass that screen entirely.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Graphical Errors on 3D games

Postby MadKingCorduroy » Mon Oct 20, 2014 5:06 pm

Interesting video, perhaps will lead to more patched games for PCjr. My mistake, I didn't realize you had a generic message. Not sure what you mean about standards though, I've been playing this game for quite a while. I also have it for Commodore 64 (which in all honesty that version is better) but the IBM PCjr is closer to my heart since it was my first 8 bit computer.
MadKingCorduroy
 
Posts: 14
Joined: Sun Mar 03, 2013 8:28 am
Location: Illinois, USA

Re: Graphical Errors on 3D games

Postby Trixter » Mon Oct 20, 2014 5:08 pm

MadKingCorduroy wrote:I also have it for Commodore 64 (which in all honesty that version is better)


That's what I meant by living up to your standards; the PC version is not the best version.
You're all insane and trying to steal my magic bag!
Trixter
 
Posts: 506
Joined: Mon Sep 01, 2008 12:00 am
Location: Illinois, USA

Re: Graphical Errors on 3D games

Postby MadKingCorduroy » Mon Oct 20, 2014 5:10 pm

lol It's all the same game. I'm certainly no graphics whore. :P
MadKingCorduroy
 
Posts: 14
Joined: Sun Mar 03, 2013 8:28 am
Location: Illinois, USA

Previous

Return to PCjr Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron