Game is using internal memory manager.
Memory block headers are connected in circular list
with pointers to next and previous member. (Not binary tree I was tired )
All members of header except block name are dwords
This is how it looks like:
OFFSET
00 pointer to block
04 block name (12 bytes) this is file name for open files,
and internal name for other purposes (as CDSTREAM,fontbuffer etc)
10 number of bytes allocated (always dividable by 16)
14 number of bytes that block occupies
18 block type (bitfields)
1c ordinal number of block
20 pointer to next block header
24 pointer to previous block header
Firstly I thought that the problem is in allocation, but then I
saw that this bad allocation (0 bytes) comes because contents of block called SECCDSTREAM and/or block called CDSTREAM are not as they should be.
Then I thought that this comes from defectivity of the CD I am using.
I backed up old cd on the new one and of course used new one.
I put old cd (that has 10 years) and the game worked.
Only status trough 21/4402 was problem and I felt like jackass.
What stupid solution. I was debugging for days and have fully researched
about 70 procedures, tracked data structures etc.
Game started form old CD.
But described problems happens with ISO image of this disk made with BlindWrite.
Then I made a copy with nero to blank cd and game worked again,
but doesn't work with earlier copy (one I used during all this debugging)
Very odd isn't it
Ognjen Milic