User Tools

Site Tools


decomp:problems

This is an old revision of the document!


Known Problems

Toolchain Problems

  • The exact version of ARMCC used to compile the game is unknown, so version 4.1 build 713/894/1049 are used since they are the most accurate.
  • The compiler flags used to compile the game may not be fully correct.
  • Constructors in which 2 int-sized members are being initialized to different values (including vtables) will mismatch, due to the compiler used splitting the 'stm' instruction into 'str' instructions. (temporary fix with #pragma O3)

Example (_ZN2al13NerveExecutorC1EPKc):

17b194:    ldr     r1, [pc, #8]  ; 0x17b1a4       |      17b194:    ldr     r1, [pc, #0xc]  ; 0x17b1a8
                                                  >      17b198:    str     r1, [r0]                
17b198:    mov     r2, #0                         r      17b19c:    mov     r1, #0                  
17b19c:    stm     r0, {r1, r2}                   |      17b1a0:    str     r1, [r0, #4]            
17b1a0:    bx      lr                                    17b1a4:    bx      lr 
  • Some while/for loops with if statements inside them will have 'nop' instructions right before the conditional jump instruction, which are not generated by the used compiler.

Example (_ZN16alSensorFunction20findSensorTypeByNameEPKc):

7820c:    bl      192308 ~>                              7820c:    bl      192308 ~>                
78210:    cmp     r0, #0                                 78210:    cmp     r0, #0                   
78214:    nop     {0}                             <                                                 
78218:    beq     78228 ~>                               78214:    beq     78224 ~>                 
7821c:    add     r0, r5, r4, lsl #3              r      78218:    add     r0, r8, r4, lsl #3       
78220:    ldr     r7, [r0, #4]                    |      7821c:    ldrb    r6, [r0, #4]             
78224:    b       78234 ~>                               78220:    b       78230 ~>                 
78228: ~> add     r4, r4, #1                             78224: ~> add     r4, r4, #1
  • Some constructors initialize members in a non-linear order/twice, the used compiler will remove any initializers that happen twice, and will order the initializers by the order they are defined in.
decomp/problems.1671728772.txt.gz · Last modified: 2022/12/22 17:06 by fruityloops