Decompile chrResolveId
This commit is contained in:
parent
5dea00f639
commit
d79dd72c4f
14
Makefile
14
Makefile
|
|
@ -168,11 +168,17 @@ $(B_DIR)/game.elf: $(O_FILES)
|
|||
mkdir -p $(B_DIR)
|
||||
$(TOOLCHAIN)-ld -T ld/game.ld -o $@
|
||||
|
||||
$(B_DIR)/ucode/game.bin: $(B_DIR)/game.elf
|
||||
$(B_DIR)/gamerodata.elf: $(O_FILES)
|
||||
mkdir -p $(B_DIR)
|
||||
$(TOOLCHAIN)-ld -T ld/gamerodata.ld -o $@
|
||||
|
||||
$(B_DIR)/ucode/game.bin: $(B_DIR)/game.elf $(B_DIR)/gamerodata.elf
|
||||
mkdir -p $(B_DIR)/ucode
|
||||
$(TOOLCHAIN)-objcopy $< /tmp/game.tmp -O binary
|
||||
dd if=/tmp/game.tmp of="$@" bs=1808864 count=1
|
||||
rm -f /tmp/game.tmp
|
||||
$(TOOLCHAIN)-objcopy $(B_DIR)/game.elf /tmp/game.tmp -O binary
|
||||
$(TOOLCHAIN)-objcopy $(B_DIR)/gamerodata.elf /tmp/gamerodata.tmp -O binary
|
||||
dd if=/tmp/game.tmp of="$@" bs=1734848 count=1
|
||||
dd if=/tmp/gamerodata.tmp of="$@" bs=74016 count=1 conv=notrunc oflag=append
|
||||
rm -f /tmp/game.tmp /tmp/gamerodata.tmp
|
||||
|
||||
game: $(B_DIR)/ucode/game.bin
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ SECTIONS
|
|||
src/game/chr/chrai.o (.data);
|
||||
src/game/chr/chraicommands.o (.data);
|
||||
src/game/game_0601b0.o (.data);
|
||||
|
||||
src/game/game_000000.o (.rodata);
|
||||
src/game/chr/chrai.o (.rodata);
|
||||
src/game/chr/chraicommands.o (.rodata);
|
||||
src/game/game_0601b0.o (.rodata);
|
||||
}
|
||||
|
||||
.gvars 0x80099fc0 : {
|
||||
|
|
|
|||
13
ld/game.ld
13
ld/game.ld
|
|
@ -8,6 +8,13 @@ SECTIONS
|
|||
src/game/chr/chrai.o (.text);
|
||||
src/game/chr/chraicommands.o (.text);
|
||||
src/game/game_0601b0.o (.text);
|
||||
}
|
||||
|
||||
.gamerodata 0x7f000000 + SIZEOF(.game) : AT(SIZEOF(.game)) {
|
||||
src/game/game_000000.o (.rodata);
|
||||
src/game/chr/chrai.o (.rodata);
|
||||
src/game/chr/chraicommands.o (.rodata);
|
||||
src/game/game_0601b0.o (.rodata);
|
||||
|
||||
src/game/game_000000.o (.data);
|
||||
src/game/chr/chrai.o (.data);
|
||||
|
|
@ -15,12 +22,12 @@ SECTIONS
|
|||
src/game/game_0601b0.o (.data);
|
||||
}
|
||||
|
||||
.library 0x00003050 : AT(SIZEOF(.game)) {
|
||||
.library 0x00003050 : AT(SIZEOF(.game) + SIZEOF(.gamerodata)) {
|
||||
src/library/library.o (.text);
|
||||
src/library/library.o (.data);
|
||||
}
|
||||
|
||||
.setup 0x80059fe0 : AT(SIZEOF(.game) + SIZEOF(.library)) {
|
||||
.setup 0x80059fe0 : AT(SIZEOF(.game) + SIZEOF(.gamerodata) + SIZEOF(.library)) {
|
||||
src/setup/setup_000000.o (.data);
|
||||
src/setup/inventory.o (.data);
|
||||
src/setup/setup_0160b0.o (.data);
|
||||
|
|
@ -28,7 +35,7 @@ SECTIONS
|
|||
src/setup/setup_020df0.o (.data);
|
||||
}
|
||||
|
||||
.gvars 0x80099fc0 : AT(SIZEOF(.game) + SIZEOF(.library) + SIZEOF(.setup)) {
|
||||
.gvars 0x80099fc0 : AT(SIZEOF(.game) + SIZEOF(.gamerodata) + SIZEOF(.library) + SIZEOF(.setup)) {
|
||||
src/gvars/gvars.o (.text);
|
||||
src/gvars/gvars.o (.data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
/*OUTPUT_FORMAT ("elf32-bigmips")*/
|
||||
OUTPUT_ARCH (mips)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.gamerodata 0x7f000000 + SIZEOF(.game) : AT(0) {
|
||||
src/game/game_000000.o (.rodata);
|
||||
src/game/chr/chrai.o (.rodata);
|
||||
src/game/chr/chraicommands.o (.rodata);
|
||||
src/game/game_0601b0.o (.rodata);
|
||||
|
||||
src/game/game_000000.o (.data);
|
||||
src/game/chr/chrai.o (.data);
|
||||
src/game/chr/chraicommands.o (.data);
|
||||
src/game/game_0601b0.o (.data);
|
||||
}
|
||||
|
||||
.game 0x7f000000 : AT(SIZEOF(.gamerodata)) {
|
||||
src/game/game_000000.o (.text);
|
||||
src/game/chr/chrai.o (.text);
|
||||
src/game/chr/chraicommands.o (.text);
|
||||
src/game/game_0601b0.o (.text);
|
||||
}
|
||||
|
||||
.library 0x7f003050 : AT(SIZEOF(.game) + SIZEOF(.gamerodata)) {
|
||||
src/library/library.o (.text);
|
||||
src/library/library.o (.data);
|
||||
}
|
||||
|
||||
.setup 0x80059fe0 : AT(SIZEOF(.game) + SIZEOF(.gamerodata) + SIZEOF(.library)) {
|
||||
src/setup/setup_000000.o (.data);
|
||||
src/setup/inventory.o (.data);
|
||||
src/setup/setup_0160b0.o (.data);
|
||||
src/setup/ailists.o (.data);
|
||||
src/setup/setup_020df0.o (.data);
|
||||
}
|
||||
|
||||
.gvars 0x80099fc0 : AT(SIZEOF(.game) + SIZEOF(.gamerodata) + SIZEOF(.library) + SIZEOF(.setup)) {
|
||||
src/gvars/gvars.o (.text);
|
||||
src/gvars/gvars.o (.data);
|
||||
}
|
||||
|
||||
/DISCARD/ : {
|
||||
* (.MIPS.abiflags);
|
||||
* (.options);
|
||||
* (.gnu.attributes);
|
||||
* (.pdr);
|
||||
* (.mdebug);
|
||||
* (.gptab.bss);
|
||||
* (.gptab.data);
|
||||
* (.reginfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -18112,7 +18112,7 @@ bool aiSetChrSpecialDeathAnimation(void)
|
|||
struct chrdata *chr = chrFindById(g_Vars.chrdata, cmd[2]);
|
||||
|
||||
if (chr) {
|
||||
chr->specialdie = cmd[3];
|
||||
chr->bitfielddata.specialdie = cmd[3];
|
||||
}
|
||||
|
||||
g_Vars.aioffset += 4;
|
||||
|
|
@ -18128,7 +18128,7 @@ bool aiSetRoomToSearch(void)
|
|||
struct chrdata *target = chrFindById(g_Vars.chrdata, TARGET_CHR);
|
||||
|
||||
if (target && target->pos) {
|
||||
g_Vars.chrdata->roomtosearch = target->pos->room;
|
||||
g_Vars.chrdata->bitfielddata.roomtosearch = target->pos->room;
|
||||
}
|
||||
|
||||
g_Vars.aioffset += 2;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
24283
src/game/game_0601b0.c
24283
src/game/game_0601b0.c
File diff suppressed because it is too large
Load Diff
|
|
@ -41,8 +41,7 @@ struct g_vars {
|
|||
/*000058*/ u32 unk000058;
|
||||
/*00005c*/ u32 unk00005c;
|
||||
/*000060*/ u32 unk000060;
|
||||
/*000064*/ u32 unk000064;
|
||||
/*000068*/ u32 unk000068;
|
||||
/*000064*/ struct player *unk000064[2];
|
||||
/*00006c*/ u32 unk00006c;
|
||||
/*000070*/ u32 unk000070;
|
||||
/*000074*/ u32 unk000074;
|
||||
|
|
@ -181,12 +180,12 @@ struct g_vars {
|
|||
/*000288*/ u32 unk000288;
|
||||
/*00028c*/ u32 unk00028c;
|
||||
/*000290*/ u32 unk000290;
|
||||
/*000294*/ u32 unk000294; // suspected 0-3 to indicate p1 controller number
|
||||
/*000298*/ s32 unk000298; // suspected 0-3 to indicate p2 controller number
|
||||
/*00029c*/ u32 unk00029c;
|
||||
/*0002a0*/ u32 unk0002a0; // pointer to a struct with len >= 0xd8
|
||||
/*0002a4*/ u32 unk0002a4; // pointer to a struct with len >= 0xd8
|
||||
/*0002a8*/ u32 unk0002a8;
|
||||
/*000294*/ s32 unk000294; // suspected 0-3 to indicate bond controller number
|
||||
/*000298*/ s32 unk000298; // suspected 0-3 to indicate coop controller number
|
||||
/*00029c*/ s32 unk00029c; // suspected 0-3 to indicate anti controller number
|
||||
/*0002a0*/ struct player *bond;
|
||||
/*0002a4*/ struct player *coop; // Co-op buddy when controlled by human
|
||||
/*0002a8*/ struct player *anti; // Counter-op
|
||||
/*0002ac*/ u32 unk0002ac;
|
||||
/*0002b0*/ u32 unk0002b0;
|
||||
/*0002b4*/ u32 unk0002b4;
|
||||
|
|
@ -222,7 +221,7 @@ struct g_vars {
|
|||
/*00032c*/ u32 unk00032c;
|
||||
/*000330*/ u32 unk000330;
|
||||
/*000334*/ u32 unk000334;
|
||||
/*000338*/ u32 unk000338;
|
||||
/*000338*/ u32 unk000338; // array of something related to chr targets, each 0x48 long
|
||||
/*00033c*/ u32 unk00033c;
|
||||
/*000340*/ u32 unk000340;
|
||||
/*000344*/ u32 unk000344;
|
||||
|
|
|
|||
|
|
@ -25,8 +25,14 @@ struct position {
|
|||
s16 room;
|
||||
};
|
||||
|
||||
struct bitfielddata {
|
||||
u8 unk32e;
|
||||
u8 specialdie;
|
||||
u16 roomtosearch;
|
||||
};
|
||||
|
||||
struct chrdata {
|
||||
/*0x000*/ u16 chrnum;
|
||||
/*0x000*/ s16 chrnum;
|
||||
/*0x002*/ u8 accuracyrating;
|
||||
/*0x003*/ u8 speedrating;
|
||||
/*0x004*/ u16 firecount;
|
||||
|
|
@ -118,11 +124,11 @@ struct chrdata {
|
|||
/*0x125*/ u8 team;
|
||||
/*0x126*/ u8 soundgap;
|
||||
/*0x128*/ s16 padpreset1;
|
||||
/*0x12a*/ u16 chrpreset1;
|
||||
/*0x12c*/ u16 proppreset1;
|
||||
/*0x12e*/ u16 chrseeshot;
|
||||
/*0x130*/ u16 chrseedie;
|
||||
/*0x132*/ u16 chrdup;
|
||||
/*0x12a*/ s16 chrpreset1;
|
||||
/*0x12c*/ s16 proppreset1;
|
||||
/*0x12e*/ s16 chrseeshot;
|
||||
/*0x130*/ s16 chrseedie;
|
||||
/*0x132*/ s16 chrdup;
|
||||
/*0x134*/ u32 unk134;
|
||||
/*0x138*/ u32 unk138;
|
||||
/*0x13c*/ u32 unk13c;
|
||||
|
|
@ -200,10 +206,17 @@ struct chrdata {
|
|||
/*0x314*/ u32 gunrotx[2];
|
||||
/*0x31c*/ u32 onladder;
|
||||
/*0x320*/ struct coord laddernormal;
|
||||
/*0x32c*/ u16 BITFIELD;
|
||||
/*0x32e*/ u8 liftaction;
|
||||
/*0x32f*/ u8 specialdie;
|
||||
/*0x330*/ u16 roomtosearch;
|
||||
/*0x32c*/ u8 liftaction;
|
||||
|
||||
union {
|
||||
/*0x32e*/ u16 BITFIELD;
|
||||
/*0x32e*/ struct bitfielddata bitfielddata;
|
||||
/* 0x32e - u8 unk32e;
|
||||
* 0x32f - u8 specialdie;
|
||||
* 0x330 - u16 roomtosearch;
|
||||
*/
|
||||
};
|
||||
|
||||
/*0x332*/ u8 propsoundcount;
|
||||
/*0x333*/ u8 patrolnextstep;
|
||||
/*0x334*/ u8 BulletsTaken;
|
||||
|
|
@ -295,6 +308,83 @@ struct otheraidata {
|
|||
/*0x62*/ u16 aireturnlist;
|
||||
};
|
||||
|
||||
struct playerbc {
|
||||
u32 unk00;
|
||||
struct chrdata *chr;
|
||||
};
|
||||
|
||||
struct player {
|
||||
/*0x00*/ u32 unk00;
|
||||
/*0x04*/ u32 unk04;
|
||||
/*0x08*/ u32 unk08;
|
||||
/*0x0c*/ u32 unk0c;
|
||||
/*0x10*/ u32 unk10;
|
||||
/*0x14*/ u32 unk14;
|
||||
/*0x18*/ u32 unk18;
|
||||
/*0x1c*/ u32 unk1c;
|
||||
/*0x20*/ u32 unk20;
|
||||
/*0x24*/ u32 unk24;
|
||||
/*0x28*/ u32 unk28;
|
||||
/*0x2c*/ u32 unk2c;
|
||||
/*0x30*/ u32 unk30;
|
||||
/*0x34*/ u32 unk34;
|
||||
/*0x38*/ u32 unk38;
|
||||
/*0x3c*/ u32 unk3c;
|
||||
/*0x40*/ u32 unk40;
|
||||
/*0x44*/ u32 unk44;
|
||||
/*0x48*/ u32 unk48;
|
||||
/*0x4c*/ u32 unk4c;
|
||||
/*0x50*/ u32 unk50;
|
||||
/*0x54*/ u32 unk54;
|
||||
/*0x58*/ u32 unk58;
|
||||
/*0x5c*/ u32 unk5c;
|
||||
/*0x60*/ u32 unk60;
|
||||
/*0x64*/ u32 unk64;
|
||||
/*0x68*/ u32 unk68;
|
||||
/*0x6c*/ u32 unk6c;
|
||||
/*0x70*/ u32 unk70;
|
||||
/*0x74*/ u32 unk74;
|
||||
/*0x78*/ u32 unk78;
|
||||
/*0x7c*/ u32 unk7c;
|
||||
/*0x80*/ u32 unk80;
|
||||
/*0x84*/ u32 unk84;
|
||||
/*0x88*/ u32 unk88;
|
||||
/*0x8c*/ u32 unk8c;
|
||||
/*0x90*/ u32 unk90;
|
||||
/*0x94*/ u32 unk94;
|
||||
/*0x98*/ u32 unk98;
|
||||
/*0x9c*/ u32 unk9c;
|
||||
/*0xa0*/ u32 unka0;
|
||||
/*0xa4*/ u32 unka4;
|
||||
/*0xa8*/ u32 unka8;
|
||||
/*0xac*/ u32 unkac;
|
||||
/*0xb0*/ u32 unkb0;
|
||||
/*0xb4*/ u32 unkb4;
|
||||
/*0xb8*/ u32 unkb8;
|
||||
/*0xbc*/ struct playerbc *unkbc;
|
||||
};
|
||||
|
||||
struct targetsomething {
|
||||
/*0x00*/ u8 unk00;
|
||||
/*0x04*/ struct chrdata *chr;
|
||||
/*0x08*/ u32 unk08;
|
||||
/*0x0c*/ u32 unk0c;
|
||||
/*0x10*/ u32 unk10;
|
||||
/*0x14*/ u32 unk14;
|
||||
/*0x18*/ u32 unk18;
|
||||
/*0x1c*/ u32 unk1c;
|
||||
/*0x20*/ u32 unk20;
|
||||
/*0x24*/ u32 unk24;
|
||||
/*0x28*/ u32 unk28;
|
||||
/*0x2c*/ u32 unk2c;
|
||||
/*0x30*/ u32 unk30;
|
||||
/*0x34*/ u32 unk34;
|
||||
/*0x38*/ u32 unk38;
|
||||
/*0x3c*/ u32 unk3c;
|
||||
/*0x40*/ u32 unk40;
|
||||
/*0x44*/ u32 unk44;
|
||||
};
|
||||
|
||||
struct ailists {
|
||||
u8 *list;
|
||||
u32 id;
|
||||
|
|
|
|||
Loading…
Reference in New Issue