Civilization2 segment register troubles

Jukka Heinonen jhei at iki.fi
Mon Nov 19 07:42:28 CST 2001


Hi.

I noticed that Civilization 2 has several problems under Wine.
First, the game wants to access memory using segment register value 
zero, which causes protection exception since that is not allowed
in protected mode. Second problem is that the game uses segment
register value 0xf8, which Wine does not like.

If I drop null-pointer protection [call to DOSMEM_Init(TRUE)],
emulate cmp and mov commands so that they work even if using
segment register value zero [added stuff to memory/instr.c] and
make Wine accept segment register value 0xf8 [by hacking
INSTR_ReplaceSelector], Civilization 2 starts to work without
any problems.

There are several possible reasons why the above changes make the
game work: Wine corrupts segment registers somewhere,
Civilization 2 wants to use privileged commands and Windows 
emulates them or the game runs in VM86 mode under Windows.

So, I would like to get some ideas what should be done with Wine
in order to get the game working.

Oh, the above modifications fix protection faults that
happen when the game tries to access the following addresses:
0x22, 0xc8, 0xf6, 0xf07c and 0xf0aa.

P.S. Civilization 2 seems to work almost perfectly but it is
     painfully slow. I am pretty certain that I know the reason
     for this, but I would like to get the game working under
     official Wine before trying to make it run faster.

-- 
Jukka Heinonen <http://www.iki.fi/jhei/>




More information about the wine-devel mailing list