segra Posted March 25, 2009 Share Posted March 25, 2009 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 withSuperDune2 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 for5633C050900EE87000595956B8010050900EE86400595956B8020050900EE85800595956B8040050900EE84C005959replace with5031C05650900EE86F005859403D06007CF15890909090909090909090909090909090909090909090909090909090Basically, 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 functionthis number is passed into a load "previous map" function, which loops thro each GROUPXX section and draws it to the screenThe problem, resulted due to the the code below... the function "drawMapPiece" is called with the GROUP number, and the TEAM numberfor some reason in the original, rather than looping and passing 0 - 5 into this function, the game calls one after the otherfor 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 siModified: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 siHave fun! 1 Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted March 25, 2009 Share Posted March 25, 2009 Man, you're awesome :) Quote Link to comment Share on other sites More sharing options...
Windwalker Posted March 25, 2009 Share Posted March 25, 2009 Yeah you are really deep into it. I almost suspect you are one of the programmers :D Quote Link to comment Share on other sites More sharing options...
segra Posted March 25, 2009 Author Share Posted March 25, 2009 lol, if i was one of the programmers... i would of been about 7 years old during development :) Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted March 27, 2009 Share Posted March 27, 2009 Great! Once again, thanks a lot segra! :) Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted March 27, 2009 Share Posted March 27, 2009 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 Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted March 27, 2009 Share Posted March 27, 2009 no way the code after that is going to assume it still has a value from before this operationUh, is it going to affect the game in a negative way? 'Cause I don't have time for serious test runs. Quote Link to comment Share on other sites More sharing options...
segra Posted March 28, 2009 Author Share Posted March 28, 2009 yeah, i just did it anyway.. not really sure why :) Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted March 28, 2009 Share Posted March 28, 2009 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 :PMost probably, the code behind this piece will start with assigning a new value to 'ax' anyway ;D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.