Sign in to follow this  
Followers 0
segra

Dune 2
Super Dune 2: Conquest Map Vanishing Houses Fix

9 posts in this topic

Hey all,

I have managed to locate the issue on the conquest map, and it turned out to be fairly simple in the end.

so far ive tested with

SuperDune2 Classic  (1.07)

SuperDune2 Original (1.00)

I had to replace a chunk of code, with a looping chunk instead (asm dumps of both are below)

fire up your hex editor... search the exe for

5633C050900EE87000595956B8010050900EE86400595956B8020050900EE85800595956B8040050900EE84C005959
replace with

5031C05650900EE86F005859403D06007CF15890909090909090909090909090909090909090909090909090909090

Basically, a call to the conquest map function is made from the main game loop,

the mission number of the last completed mission is passed into this function

this number is passed into a load "previous map" function, which loops thro each GROUPXX section and draws it to the screen

The problem, resulted due to the the code below... the function "drawMapPiece" is called with the GROUP number, and the TEAM number

for some reason in the original, rather than looping and passing 0 - 5 into this function, the game calls one after the other

for team 0, 1, 2, 4  (value is put in AX).

I simply replaced this chunk of code with a simple loop which calls the function for all teams.

asm dump of modified area:

Original:

         drawLoop:                               ; CODE XREF: drawGroupMapPieces+40jovr204:0B7F 56                             push    si              ; intovr204:0B80 33 C0                          xor     ax, axovr204:0B82 50                             push    ax              ; teamIDovr204:0B83 90                             nopovr204:0B84 0E                             push    csovr204:0B85 E8 70 00                       call    near ptr drawMapPieceovr204:0B88 59                             pop     cxovr204:0B89 59                             pop     cxovr204:0B8A 56                             push    si              ; intovr204:0B8B B8 01 00                       mov     ax, 1ovr204:0B8E 50                             push    ax              ; teamIDovr204:0B8F 90                             nopovr204:0B90 0E                             push    csovr204:0B91 E8 64 00                       call    near ptr drawMapPieceovr204:0B94 59                             pop     cxovr204:0B95 59                             pop     cxovr204:0B96 56                             push    si              ; intovr204:0B97 B8 02 00                       mov     ax, 2ovr204:0B9A 50                             push    ax              ; teamIDovr204:0B9B 90                             nopovr204:0B9C 0E                             push    csovr204:0B9D E8 58 00                       call    near ptr drawMapPieceovr204:0BA0 59                             pop     cxovr204:0BA1 59                             pop     cxovr204:0BA2 56                             push    si              ; intovr204:0BA3 B8 04 00                       mov     ax, 4ovr204:0BA6 50                             push    ax              ; teamIDovr204:0BA7 90                             nopovr204:0BA8 0E                             push    csovr204:0BA9 E8 4C 00                       call    near ptr drawMapPieceovr204:0BAC 59                             pop     cxovr204:0BAD 59                             pop     cxovr204:0BAE 46                             inc     si
Modified:

ovr204:0B7F             loc_5DC2F:                              ; CODE XREF: sub_5DC22+40jovr204:0B7F 50                          push    axovr204:0B80 31 C0                       xor     ax, axovr204:0B82ovr204:0B82             loop:                                   ; CODE XREF: sub_5DC22+1Djovr204:0B82 56                          push    siovr204:0B83 50                          push    ax              ; teamidovr204:0B84 90                          nopovr204:0B85 0E                          push    csovr204:0B86 E8 6F 00                    call    near ptr drawMapPieceovr204:0B89 58                          pop     axovr204:0B8A 59                          pop     cxovr204:0B8B 40                          inc     axovr204:0B8C 3D 06 00                    cmp     ax, 6ovr204:0B8F 7C F1                       jl      short loopovr204:0B91 58                          pop     axovr204:0B92 90                          nopovr204:0B93 90                          nopovr204:0B94 90                          nopovr204:0B95 90                          nopovr204:0B96 90                          nopovr204:0B97 90                          nopovr204:0B98 90                          nopovr204:0B99 90                          nopovr204:0B9A 90                          nopovr204:0B9B 90                          nopovr204:0B9C 90                          nopovr204:0B9D 90                          nopovr204:0B9E 90                          nopovr204:0B9F 90                          nopovr204:0BA0 90                          nopovr204:0BA1 90                          nopovr204:0BA2 90                          nopovr204:0BA3 90                          nopovr204:0BA4 90                          nopovr204:0BA5 90                          nopovr204:0BA6 90                          nopovr204:0BA7 90                          nopovr204:0BA8 90                          nopovr204:0BA9 90                          nopovr204:0BAA 90                          nopovr204:0BAB 90                          nopovr204:0BAC 90                          nopovr204:0BAD 90                          nopovr204:0BAE 46                          inc     si

Have fun!

post-5746-12833239834595_thumb.jpg

1

Share this post


Link to post
Share on other sites

Man, you're awesome :)

0

Share this post


Link to post
Share on other sites

Yeah you are really deep into it. I almost suspect you are one of the programmers :D

0

Share this post


Link to post
Share on other sites

lol, if i was one of the programmers... i would of been about 7 years old during development :)

0

Share this post


Link to post
Share on other sites

Great! Once again, thanks a lot segra! :)

0

Share this post


Link to post
Share on other sites

I doubt there's any sense keeping that ax stored in the stack though, seeing as it gets seriously modified during the original process anyway... no way the code after that is going to assume it still has a value from before this operation

0

Share this post


Link to post
Share on other sites

no way the code after that is going to assume it still has a value from before this operation

Uh, is it going to affect the game in a negative way? 'Cause I don't have time for serious test runs.

0

Share this post


Link to post
Share on other sites

yeah, i just did it anyway.. not really sure why :)

0

Share this post


Link to post
Share on other sites

lol no MrFlibble. He stores the original value of 'ax' so that it's restored after the entire operation. But as I said, there's no way the game wil still need that value anyway. It's just that he could've spared 2 bytes :P

Most probably, the code behind this piece will start with assigning a new value to 'ax' anyway ;D

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0