VOGONS


First post, by onre

User metadata
Rank Newbie
Rank
Newbie

Hi,

As I've posted in another topic, I took up compiling old Nethack versions for fun. The game uses an overlay scheme to fit in memory, and there are options of using MS C 7.0 overlay manager (very slow) or their own version (very fast). My target machine is Toshiba T1200 with hardware EMS + a software driver for accessing the hardware.

I've come across an interesting problem with their overlay manager. The game runs fine for a while, but when you either travel from one level to another or save the game, something gets corrupted. Saving usually breaks with incorrect code being run, non-sensical messages displayed and so on, and after changing levels game commands may start to perform incorrect actions - classic symptoms of memory corruption. In both cases the disk is accessed - in saving, obviously to save the game, and in changing levels, to write the recovery file for recovering a crashed game, and sometimes to load a special pre-built level. Could the Toshiba EMM driver require some special actions before performing DOS interrupts? I've read through the EMS 4.0 specification and it did not mention anything about this.

Here are some observations:

- This happens with two separate versions of Toshiba EMM.SYS, one implementing version 3.2 and another implementing version 4.0 of the EMS specification. Overlay manager claims to support both.
- There is no EMM-using TSRs loaded. The only TSRs are NANSI.SYS, KEYB.COM and DOSKEY.COM.
- This does not happen when EMM.SYS is not loaded and EMS is thus disabled.
- The same binaries work perfectly normally with EMM386 inside Virtualbox.
- This happens on a real T1200 and also in PCEM emulated T1200 and T3100e. Symptoms are exactly the same on all of these.
- This also happens under MS-DOS 6.22 on the emulated T1200.
- This also happens with both Nethack 3.0.10 and 3.1.3.

The code maps EMS physical pages 0..3 and I checked those to actually conform to addresses D0000..DFFFF, which is the EMM page frame in the upper memory area so it is not a case of accidentally mapping EMM pages over conventional memory. This is also the default page frame location so I suppose it shouldn't overlap with anything else. I could not find any documentation for the Toshiba EMM driver to see if the page frame can even be moved.

Anyone have any idea what could be going on here? I am currently looking at Nethack 3.1.3 OVLMGR.ASM source file and trying to figure out what could be causing this. It's a rather complex piece of assembly and the stuff it is doing is not exactly trivial. However, the EMS part is very straightforward - they only use the most basic functionality to detect EMS presence and then allocate, map and free pages. This makes it even more puzzling unless it's a case where all the other EMM managers let you do something that the Toshiba EMM doesn't.

The steps not taken so far:

- Setup another hardware EMS machine (probably in PCEM) and see if the bug is still there.

Any input is welcome.

Reply 1 of 1, by ConventionalMemories

User metadata
Rank Newbie
Rank
Newbie

Hi, sorry to dig this up, could you maybe post some pictures of that EMS board for the T1200?
I've never seen one, only in the Toshiba flyers. Thanks