First post, by Muckrake
Hi everyone!
The last few weeks I've been patching several old Tandy 1000 games to run in 16 colors on a real PCjr. I finally came to Wibarm , and the graphics patch was easy -- just changed "oo b8 8e" several times to "00 18 8e" on the wibarm.jr driver (for some reason it's named jr despite only working on a Tandy) -- and voila, 16 colors and 3 voice sound on a PCjr. However, the keyboard (and possibly the joystick) doesn't work. When I press a key, nothing happens, except esc (sometimes), which just calls up a menu, and then gets stuck. You can bypass everything by pressing the joystick fire button, but once the game starts, it doesn't read the joystick directional input (possibly because it wasn't calibrated).
Anyhow, I couldn't figure out the issue, until the other day, when I came across this post by user ripsaw8080, who encountered the same problem running Wibarm in PCjr mode on DOSBox back in 2009,
There is some evidence in the game code that PCjr is directly supported. The BIOS signatures of F000:C000=0x21 (Tandy) or F000:FFFE=0xFD (PCjr) will cause the WIBARM.JR program overlay to be loaded, however the machine ID of 0xFD will cause the game to use different keyboard scancodes than the Tandy.
... The game then starts up, however the keyboard does not respond normally, instead acting like the keys are mapped differently. I used the debugger to force the game to think it should use the same keyboard scancodes as the Tandy, and the game then appears to work OK. Note that the joystick can be used to get around the keyboard issue, although activating the joystick initially requires the keyboard.
Because the game reacts differently to the Tandy and PCjr BIOS signatures, I suspect the PCjr should work with the game, but is broken in DOSBox due to the memory allocation and scancodes issues. The memory issue seems straightforward to me, but the keyboard stuff could use further analysis. At any rate, PCjr support for the game is not that big of a deal, because AFAICT it looks and sounds identical to Tandy.
Here is a link to the full thread: Re: Can't Get Wibarm To Run - Details provided this time.
Unfortunately, it looks like whatever scancodes the game links the PCjr BIOS signatures to, don't work on a real PCjr either. And I've tried several unpatched versions of the game as well, just in case that was the issue, but no dice. Anyhow, I'm fairly new to debugging and programming (only about a month), and don't really understand how to use debug to find the BIOS signatures ripsaw8080 mentioned, determine which keyboard scancodes they're using, and redirect them to another. I was able to bypass the ID check on Shanghai so it would run on the PCjr (I just changed the byte sequence "21 75" to "FD 75"), but I'm not sure how helpful that is here.
If anyone could give me some direction or guidance on what I should look for, I'd appreciate it. Thanks!