encounter / dtk-template

Project template for decomp-toolkit
Creative Commons Zero v1.0 Universal
18 stars 15 forks source link

Initial analysis fails while loading `main.dol` for game G4IP52 #16

Open therealjohnpitt opened 8 months ago

therealjohnpitt commented 8 months ago

While trying to setup a project with Shrek Smash n' Crash Racing, the static analysis fails without filling any of the symbols.txt or splits.txt. The game has no ELF/REL, only a DOL file.

WARN module{name=main}: Failed to locate _rom_copy_info    
 WARN module{name=main}: Failed to locate BSS sections    
Failed: While loading object 'main.dol'

Caused by:
    0: While processing 1:0x800A36D4: FunctionSlices {
           blocks: {
               1:0x800A36D4: Some(
                   1:0x800A36F8,
               ),
               1:0x800A36F8: None,
               1:0x800A3734: Some(
                   1:0x800A3744,
               ),
               1:0x800A3744: None,
               1:0x800A374C: Some(
                   1:0x800A3754,
               ),
               1:0x800A3754: None,
           },
           branches: {
               1:0x800A36F4: [
                   1:0x800A36F8,
                   1:0x800A3734,
               ],
               1:0x800A3740: [
                   1:0x800A3744,
                   1:0x800A374C,
               ],
               1:0x800A3750: [
                   1:0x800A3754,
               ],
           },
           function_references: {
               1:0x800A3ED4,
           },
           jump_table_references: {},
           prologue: Some(
               1:0x800A36D4,
           ),
           epilogue: None,
           possible_blocks: {},
           has_conditional_blr: false,
           has_rfi: false,
           finalized: false,
           has_r1_load: false,
       } [
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Constant(
                   2151700640,
               ),
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Constant(
                   2151635104,
               ),
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Constant(
                   0,
               ),
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
           Gpr {
               value: Unknown,
               hi_addr: None,
               lo_addr: None,
           },
       ]
    1: Found duplicate prologue: 1:0x800A36D4 and 1:0x800A3754
ninja: error: rebuilding 'build.ninja': subcommand failed
encounter commented 8 months ago

It looks like this game is built with ProDG (a GCC toolchain). This is usually indicated by:

WARN module{name=main}: Failed to locate _rom_copy_info    
WARN module{name=main}: Failed to locate BSS sections    

Unfortunately, decomp-toolkit's analyzer is mostly written with Metrowerks in mind, since the vast majority of games are built with the official toolchain. It's not an easy lift to get ProDG games working.

I'll leave this issue open in case that changes in the future.