Difference between revisions of "User:Morgan525"

From UFOpaedia
Jump to navigation Jump to search
Line 12: Line 12:
  
 
==Other information==
 
==Other information==
 +
 +
text:00432160                mov    cx, [esp+missiontype]
 +
.text:00432165                push    ebx
 +
.text:00432166                mov    ebx, [esp+4+zonenum]
 +
.text:0043216A                push    ebp
 +
.text:0043216B                movsx  eax, bx
 +
.text:0043216E                push    edi
 +
.text:0043216F                lea    edi, ds:0[eax*8]
 +
.text:00432176                movsx  edx, cx
 +
.text:00432179                sub    edi, eax
 +
.text:0043217B                mov    eax, dwpMISSIONSDAT_49B220
 +
.text:00432180                add    edx, edi
 +
.text:00432182                cmp    cx, 3            ;*
 +
.text:00432186                mov    bp, [eax+edx*8+6] 
 +
.text:0043218B                jnz    loc_4326E1        ;*if missiontype is not 3 goto loc_4326E1
 +
--------------
 +
.text:00432191                xor    edx, edx       
 +
.text:00432193                push    esi
 +
.text:00432194                cmp    bx, dx     
 +
.text:00432197                jnz    loc_432230                ;if zonenum!=0 goto loc_432230
 +
.text:0043219D                cmp    wDIP_USA_b2_4728FA, dx
 +
.text:004321A4                jz      short loc_4321EA          ;if DIP.USA.b2=0 goto loc_4321EA
 +
--------------
 +
.text:004321A6                mov    wDIP_USA_b1E_472916, 1    ;set DIP.USA.byte 1E=1
 +
.text:004321AF                mov    word ptr [eax+18h], dx    ;resets UFO counter to 0
 +
.text:004321B3                movsx  eax, wCurrentMonth_49B1B8
 +
.text:004321BA                mov    ecx, eax
 +
.text:004321BC                shl    ecx, 5
 +
.text:004321BF                sub    ecx, eax
 +
.text:004321C1                mov    eax, 96h
 +
.text:004321C6                shl    ecx, 2
 +
.text:004321C9                mov    esi, dword_49B280[ecx]
 +
.text:004321CF                add    esi, eax
 +
.text:004321D1                mov    dword_49B280[ecx], esi
 +
.text:004321D7                mov    esi, dword_49B240[ecx]
 +
.text:004321DD                add    esi, eax
 +
.text:004321DF                mov    dword_49B240[ecx], esi
 +
.text:004321E5                jmp    loc_432695
 +
-----------------------------------------------------------------
 +
.text:004321EA                mov    wDIP_CAN_b1E_472B32, 1      ;set DIP.CAN.byte 1E=1
 +
.text:004321F3                mov    word ptr [eax+18h], 0FFFFh  ;disables infiltration in MISSION.DAT
 +
.text:004321F9                movsx  eax, wCurrentMonth_49B1B8
 +
.text:00432200                mov    ecx, eax
 +
.text:00432202                shl    ecx, 5
 +
.text:00432205                sub    ecx, eax
 +
.text:00432207                mov    eax, 96h
 +
.text:0043220C                shl    ecx, 2
 +
.text:0043220F                mov    esi, dword_49B280[ecx]
 +
.text:00432215                add    esi, eax
 +
.text:00432217                mov    dword_49B280[ecx], esi
 +
.text:0043221D                mov    esi, dword_49B27C[ecx]
 +
.text:00432223                add    esi, eax
 +
.text:00432225                mov    dword_49B27C[ecx], esi
 +
.text:0043222B                jmp    loc_432695
 +
 +
-----------------------------------------------------------
 +
.text:00432695                mov    eax, dwpMISSIONSDAT_49B220
 +
.text:0043269A                cmp    [eax+edi*8+18h], dx
 +
.text:0043269F                jnz    short loc_4326D2        ;if UFO counter !=0 goto loc_4326D2
 +
-------------
 +
.text:004326A1                mov    si, word_470F36        ;time for first infiltration counter
 +
.text:004326A8                and    esi, 0FFFFh
 +
.text:004326AD                mov    ecx, esi
 +
.text:004326B1                push    ecx
 +
.text:004326B2                call    sGetRandomNum_43D850
 +
.text:004326B7                mov    cx, ax
 +
.text:004326BA                add    esp, 4
 +
.text:004326BD                movsx  eax, si
 +
.text:004326C0                cdq
 +
.text:004326C1                sub    eax, edx
 +
.text:004326C3                mov    edx, dwpMISSIONSDAT_49B220
 +
.text:004326C9                sar    eax, 1
 +
.text:004326CB                add    ecx, eax
 +
.text:004326CD                mov    [edx+edi*8+1Ch], cx    :byte 1C = rand(time)+(time/2)
 +
-------------
 +
.text:004326D2                push    ebp
 +
.text:004326D3                push    ebx
 +
.text:004326D4                call    sCreateAlienBase_432700
 +
.text:004326D9                add    esp, 8
 +
.text:004326DC                pop    esi
 +
.text:004326DD                pop    edi
 +
.text:004326DE                pop    ebp
 +
.text:004326DF                pop    ebx
 +
.text:004326E0                retn

Revision as of 00:34, 6 December 2014

I'm also known as "Tycho" on StrategyCore forums. I've been studying disassembly and C++ coding since December of 2011. This all started because I wanted to mod the tank/cannon of '94 Enemy Unknown into a tank/chaingun for my own games. I started playing the DOS version but eventually switched to the CE version. At first, I focused on the sound problems which is when I started to experiment with Seb76's UFOloader.

UFO Extender

This is the original program created by Seb76 for use with Enemy Unknown. Check out the UFO Extender's Information Page. You can download the latest version and patches here: UFOextender.

If you're interested in the source code, it is available. Be warned you'll need to decompile the executable and be familiar with disassembly terminology to understand a lot of what the Extender does, since it inserts new lines into preexisting code. The source files for the Extender are here: File:UFOExtender-src.zip.

TFTD Extender

It adds a lot of functionality and fixes to the Collector's Edition (MS Windows version) of Terror from the Deep. Click on the title to get to the information page.

For those interested, here is the source code for the Extender.

Other information

text:00432160                 mov     cx, [esp+missiontype]
.text:00432165                 push    ebx
.text:00432166                 mov     ebx, [esp+4+zonenum]
.text:0043216A                 push    ebp
.text:0043216B                 movsx   eax, bx
.text:0043216E                 push    edi
.text:0043216F                 lea     edi, ds:0[eax*8]
.text:00432176                 movsx   edx, cx
.text:00432179                 sub     edi, eax
.text:0043217B                 mov     eax, dwpMISSIONSDAT_49B220
.text:00432180                 add     edx, edi
.text:00432182                 cmp     cx, 3             ;*
.text:00432186                 mov     bp, [eax+edx*8+6]  
.text:0043218B                 jnz     loc_4326E1        ;*if missiontype is not 3 goto loc_4326E1
--------------
.text:00432191                 xor     edx, edx         
.text:00432193                 push    esi
.text:00432194                 cmp     bx, dx       
.text:00432197                 jnz     loc_432230                 ;if zonenum!=0 goto loc_432230
.text:0043219D                 cmp     wDIP_USA_b2_4728FA, dx
.text:004321A4                 jz      short loc_4321EA           ;if DIP.USA.b2=0 goto loc_4321EA
--------------
.text:004321A6                 mov     wDIP_USA_b1E_472916, 1     ;set DIP.USA.byte 1E=1
.text:004321AF                 mov     word ptr [eax+18h], dx     ;resets UFO counter to 0
.text:004321B3                 movsx   eax, wCurrentMonth_49B1B8
.text:004321BA                 mov     ecx, eax
.text:004321BC                 shl     ecx, 5
.text:004321BF                 sub     ecx, eax
.text:004321C1                 mov     eax, 96h
.text:004321C6                 shl     ecx, 2
.text:004321C9                 mov     esi, dword_49B280[ecx]
.text:004321CF                 add     esi, eax
.text:004321D1                 mov     dword_49B280[ecx], esi
.text:004321D7                 mov     esi, dword_49B240[ecx]
.text:004321DD                 add     esi, eax
.text:004321DF                 mov     dword_49B240[ecx], esi
.text:004321E5                 jmp     loc_432695
-----------------------------------------------------------------
.text:004321EA                 mov     wDIP_CAN_b1E_472B32, 1       ;set DIP.CAN.byte 1E=1
.text:004321F3                 mov     word ptr [eax+18h], 0FFFFh   ;disables infiltration in MISSION.DAT
.text:004321F9                 movsx   eax, wCurrentMonth_49B1B8
.text:00432200                 mov     ecx, eax
.text:00432202                 shl     ecx, 5
.text:00432205                 sub     ecx, eax
.text:00432207                 mov     eax, 96h
.text:0043220C                 shl     ecx, 2
.text:0043220F                 mov     esi, dword_49B280[ecx]
.text:00432215                 add     esi, eax
.text:00432217                 mov     dword_49B280[ecx], esi
.text:0043221D                 mov     esi, dword_49B27C[ecx]
.text:00432223                 add     esi, eax
.text:00432225                 mov     dword_49B27C[ecx], esi
.text:0043222B                 jmp     loc_432695 
-----------------------------------------------------------
.text:00432695                 mov     eax, dwpMISSIONSDAT_49B220
.text:0043269A                 cmp     [eax+edi*8+18h], dx
.text:0043269F                 jnz     short loc_4326D2        ;if UFO counter !=0 goto loc_4326D2
-------------
.text:004326A1                 mov     si, word_470F36        ;time for first infiltration counter
.text:004326A8                 and     esi, 0FFFFh
.text:004326AD                 mov     ecx, esi
.text:004326B1                 push    ecx
.text:004326B2                 call    sGetRandomNum_43D850
.text:004326B7                 mov     cx, ax
.text:004326BA                 add     esp, 4
.text:004326BD                 movsx   eax, si
.text:004326C0                 cdq
.text:004326C1                 sub     eax, edx
.text:004326C3                 mov     edx, dwpMISSIONSDAT_49B220
.text:004326C9                 sar     eax, 1
.text:004326CB                 add     ecx, eax
.text:004326CD                 mov     [edx+edi*8+1Ch], cx    :byte 1C = rand(time)+(time/2)
-------------
.text:004326D2                 push    ebp
.text:004326D3                 push    ebx
.text:004326D4                 call    sCreateAlienBase_432700
.text:004326D9                 add     esp, 8
.text:004326DC                 pop     esi
.text:004326DD                 pop     edi
.text:004326DE                 pop     ebp
.text:004326DF                 pop     ebx
.text:004326E0                 retn