Jump to content

Super Dune 2: Conquest Map Vanishing Houses Fix


Recommended Posts

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

replace with


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:


         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

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!


  • Upvote 1
Link to comment
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

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...