• Please review our updated Terms and Rules here

„Below the root” hangs on IBM portable 5155

goostaw

Member
Joined
Nov 11, 2018
Messages
26
Location
Poland
Hi. I have a problem with the game "Below the root".
Works on all dos computers I have except IBM 5155.
The game hangs right after the control selection screen (keyboard, joystick)
I checked both versions - pc booter and DOS.
My IBM has 256kB Ram, but I also checked with an additional RAM card (640 in total). Same.
what is going on? what would somebody check on their Ibm?
I will be grateful for your help.
 
Works on 5160, fails on 5155 for me too. Interesting... Probably a bug in the "determine what this machine is" code, which reads the Model ID byte in ROM.
 
Here's the code for the test:

Code:
seg000:0341 B8 00 F0                       mov     ax, 0F000h
seg000:0344 8E C0                          mov     es, ax
seg000:0346                                assume es:nothing
seg000:0346 26 8A 26 FE FF                 mov     ah, es:0FFFEh
seg000:034B 80 FC FD                       cmp     ah, 0FDh ; FDh = PCjr
seg000:034E B0 00                          mov     al, 0
seg000:0350 75 02                          jnz     short loc_10354 ; jmp if not a PCjr
seg000:0352 B0 04                          mov     al, 4
seg000:0354
seg000:0354                loc_10354:
seg000:0354 A2 30 89                       mov     machineType, al

This seems fairly straightforward (JNZ = JNE), so I don't know what else could be the problem.
 
I know the 5155's motherboard is identical to the first-gen 5160 XT board... but does it have a different ROM? If not, how would any program know the difference between a Portable PC and an early XT?
 
Aha, according to http://www.minuszerodegrees.net/5155/misc/5155_basics.htm "The 5155 motherboard does not have a keyboard controller chip. Instead, it uses discrete components" with schematic at http://www.minuszerodegrees.net/5160/keyboard/5160_keyboard_interface.png .

Since the nature of the error is keyboard-related, I think this might be it. So the keyboard handler must be doing something that only works on a true 8042 keyboard controller.

Edit: More disassembly shows that the game only makes INT 16h calls, so I'm back to being puzzled. I'll check the boot sector to see if that does anything odd.

Edit2: Nothing odd in the boot sector.

I'm not motivated enough to install my periscope board in a 5155 to debug this, so continued troubleshooting will have to go to someone else. Or, just play it on a PCjr so you can get the (infrequent) 3-voice music.
 
Last edited:
This seems fairly straightforward (JNZ = JNE), so I don't know what else could be the problem.

Might the freeze be related to the keyboard (unhandled keystrokes filling up the buffer so the 5155 ends up beeping at you)?

See, I just remembered this age-old question: http://www.vcfed.org/forum/showthread.php?42574-Keyboard-difference-between-5155-and-5160. ;) I don't really recall if that ever got satisfactorily resolved, but if keyboard handling is the culprit here too, maybe there's a clue?

[EDIT]: hah -- didn't catch your last reply before I wrote this. There we go then!
 
I'd forgotten about that. :)

Back in 1995, a friend clued me in to the best way to handle key-down scancodes: Don't try to replace the keyboard interrupt at all, but instead let it run and just grab what it produces, then clear out the keyboard queue so that you don't get "buffer full" beeping. While this isn't the fastest way to handle the keyboard, it is the most compatible way, and has worked on PCjrs, laptops, and yes, even the 5155 (just tested it). Some ancient pascal code for you:

Code:
Procedure New9handler; interrupt;
var
  port60h:byte;
begin
  port60h:=port[$60];
  kbd[port60h and $7f] := (port60h < 128);     { record current status }
  asm pushf; end;                              { must precede call to old int }
  old9;                                        { call old interrupt }
  asm cli; end;                                { disable hardware interrupts }
  memw[$0040:$001a] := memw[$0040:$001c];      { clear the keyboard buffer }
  asm sti; end;                                { enable hardware interrupts }
end;

This works great for if you want to test if a key is being held down or not; perfect for games.
 
If the game works on a 5160 but doesn't work on a 5155, then it can't possibly be the keyboard interface circuitry, as these are absolutely identical on both versions of the XT system board (the 64/256K and the 256/640K) that can be used in a 5155 or 5160. If the ROM and the system board are both identical between the 5155 and 5160, what could possibly account for the game working on a 5160 but not on a 5155?

It's unfortunate that my 5160 is currently dead, as I'd really like to be able to confirm whether it can or cannot run the game.

Also I would like to try the booter version of the game, but don't know where to find a copy. Any pointers would be appreciated.
 
Hm, I assume it doesn't do anything funny to INT 16 (hooking/revectoring) before it makes those calls?

@kdr: Trixter has already confirmed that the game runs on his 5160, and I can confirm likewise (see near the bottom of this post for photographic proof, FWIW).

As for the booter version, although it's not technically a "DOS game", it may be that it's available as part of a certain DOS Collection described by its title as 'Total'... but with this shady warez stuff, who can tell. ;)
 
what is going on? what would somebody check on their Ibm?
I no longer have a 5155, but I do have an early 5160. I stripped down the 5160 to match a 'bare bones' 5155. So, my 5160 became:

* 64-256KB version of 5160 motherboard, fitted with 256K of RAM, and fitted with the 11/08/82 revision BIOS. (I.e. matching the 5155)
* Only cards fitted to motherboard: IBM CGA card, and IBM 5.25" Diskette Drive Adapter. (I.e. matching the 5155)
* IBM 360K floppy drive
* IBM 5160 PSU
* CGA monitor.

I downloaded 'Below the Root'.

I created an IBM PC DOS 3.30 boot floppy, then copied the 'Below the Root' files onto that. No CONFIG.SYS nor AUTOEXEC.BAT

Powered on the machine. It counted up to 256K of RAM, then it booted from the floppy. I executed LOADER.COM, and saw 'Below the Root' ask me to press either the K or J key. Pressed K and then I heard the floppy being accessed again, then saw and heard the introductory screens.
 
I was able to play Below the Root on my 5155 tonight.

My epiphany was this: the only difference between a 5155 and a 5160 is the keyboard and the internal CRT, right? And since there's surely no way that the CRT could influence the software.... what about the keyboard?

So I unplugged the 5155's internal keyboard cable and hooked up a genuine Model F from my 5160. And behold, the game worked! It asked me to select keyboard/joystick, waited for a keypress, played the intro, allowed me to select an item from the main menu, et cetera.

The IBM 5155/5160 Technical Reference (the combined one from March '86) only has a single keyboard schematic and claims that 'the following descriptions are common to both the Personal Computer XT and IBM Portable Personal Computer'. But there must be a difference! Perhaps the Intel 8048 controller inside the keyboard has a different mask ROM? And somehow the game can detect this?

*But now it gets even weirder.* I hooked up a generic XT keyboard to the 5155, and the game no longer worked: it immediately skipped to the main menu (without pressing any keys) and froze, just like with the 5155 keyboard. This generic XT keyboard is the one that I used to play the game on my generic turbo XT clone.
 
Last edited:
Quick update... today the game was working with my generic XT keyboard. So far, I've seen it fail to work with both the 5160 keyboard and the generic XT keyboard, one time each. (The symptoms are the same as with the 5155 keyboard: doesn't wait for keypress, skips intro, doesn't accept input.) But I can't reproduce those failures. I still haven't been able to get the game to work even once with the 5155 keyboard, even if I press a bunch of keys -- filling the keyboard buffer until the BIOS beeps at me -- while the game is loading from the floppy.
 
I no longer have a 5155, but I do have an early 5160. I stripped down the 5160 to match a 'bare bones' 5155. So, my 5160 became:

* 64-256KB version of 5160 motherboard, fitted with 256K of RAM, and fitted with the 11/08/82 revision BIOS. (I.e. matching the 5155)
* Only cards fitted to motherboard: IBM CGA card, and IBM 5.25" Diskette Drive Adapter. (I.e. matching the 5155)
* IBM 360K floppy drive
* IBM 5160 PSU
* CGA monitor.

I downloaded 'Below the Root'.

I created an IBM PC DOS 3.30 boot floppy, then copied the 'Below the Root' files onto that. No CONFIG.SYS nor AUTOEXEC.BAT

Powered on the machine. It counted up to 256K of RAM, then it booted from the floppy. I executed LOADER.COM, and saw 'Below the Root' ask me to press either the K or J key. Pressed K and then I heard the floppy being accessed again, then saw and heard the introductory screens.
For the quoted configuration, the following keyboards work (reliably) in Below The Root for me:

* IBM 83-key keyboard ([photo])
* Key Tronic model 101WN ([photo]), switched to XT mode
* IBM 84-key keyboard (an AT-class keyboard) ([photo]) via an AT2X2KB converter

( I have no other types of XT-class keyboards. )
 
I wonder if this issue could have anything to do with the fact that the 5155 keyboard and some 5160 keyboards dont use the reset line on the cable. They evidently reset themselves at power up and therefore the motherboard can not force a keyboard reset later. See the following link http://www.minuszerodegrees.net/5150/misc/5150_keyboard_reset.jpg. Iknow this is talking about 5150 keyboards, but I know for a fact that my 5155 only uses {clock, data, 5v, ground} no reset.
 
I wonder if this issue could have anything to do with the fact that the 5155 keyboard and some 5160 keyboards dont use the reset line on the cable. They evidently reset themselves at power up and therefore the motherboard can not force a keyboard reset later.
But even with the early (i.e. type 1) keyboard, the 5150/5155/5160 motherboard cannot force a hardware reset of the keyboard later.

(Reset of type 1 keyboard is connected to motherboard's reset line. The POWER GOOD signal from the power supply going low is the only mechanism that can activate the 5150/5155/5160 motherboard's reset line.)
 
I wanted to try and narrow down the problem, so I found the booter image of Below the Root and made a floppy for my 5155. It booted into the game and everything worked fine, no matter which keyboard I had connected.

So now I've been able to play BTR on my 5155 using the 5155 keyboard.

I think that there must be some kind of interaction between DOS and the LOADER.COM stub. When loading that version of the game, I've seen intermittent failures of the game on my 5155 with several different keyboards, although the 5155 keyboard is the only one that consistently fails.
 
I wanted to try and narrow down the problem, so I found the booter image of Below the Root and made a floppy for my 5155. It booted into the game and everything worked fine, no matter which keyboard I had connected.

So now I've been able to play BTR on my 5155 using the 5155 keyboard.

Wow. This pc booter from this link, which I have posted before, does not work for me, so I understand that you have any other?
 
I tried the booter version on my 5155 and got instant failure, when the same disk worked on a 5160 without issues. So not sure this is resolved, other than to say that BTR has issues on 5155 systems.
 
Back
Top