Skip to content

Commit b076729

Browse files
committed
Switch to gcc 2.7.2; decompile cache_file_pos
1 parent 9f93e1f commit b076729

File tree

14 files changed

+27
-15
lines changed

14 files changed

+27
-15
lines changed

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ LD := $(CROSS)ld -EL
5555
OBJCOPY := $(CROSS)objcopy
5656
STRIP := $(CROSS)strip
5757
CPP := $(CROSS)cpp
58-
CC := tools/gcc2.8.1-mipsel/cc1
58+
CC := tools/gcc2.7.2-mipsel/cc1
5959

6060
PRINT := printf '
6161
ENDCOLOR := \033[0m
@@ -74,8 +74,7 @@ ENDLINE := \n'
7474
### Compiler Options ###
7575

7676
ASFLAGS := -Iinclude -march=r3000 -mtune=r3000 -no-pad-sections
77-
CFLAGS := -O2 -G4096 -fpeephole -ffunction-cse -fkeep-static-consts -fpcc-struct-return \
78-
-fcommon -fgnu-linker -msplit-addresses -mgas -mgpOPT -mgpopt -msoft-float -gcoff -quiet
77+
CFLAGS := -O2 -G4096 -fpeephole -ffunction-cse -fpcc-struct-return -fcommon -fgnu-linker -mgas -mgpOPT -mgpopt -msoft-float -gcoff -quiet
7978
CPPFLAGS := -Iinclude
8079
LDFLAGS := -T undefined_syms.txt -T undefined_funcs.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(LD_MAP) \
8180
--no-check-sections -nostdlib

SLUS_007.79.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ segments:
5757
- [0x800, rodata, 800]
5858
- [0x10760, asm, main]
5959
- [0x10C64, asm, 10C64]
60-
- [0x11B10, asm, cache_file_pos]
60+
- [0x11B10, c, cache_file_pos]
6161
- [0x11B60, asm, 11B60]
6262
- [0x14C1C, asm, decode_data]
6363
- [0x14CB0, asm, 14CB0]

THUNDER.ld

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ SECTIONS
2626
BUILD_PATH/asm/data/800.rodata.s.o(.rodata);
2727
BUILD_PATH/asm/main.s.o(.rodata);
2828
BUILD_PATH/asm/10C64.s.o(.rodata);
29-
BUILD_PATH/asm/cache_file_pos.s.o(.rodata);
29+
BUILD_PATH/src/cache_file_pos.c.o(.rodata);
3030
BUILD_PATH/asm/11B60.s.o(.rodata);
3131
BUILD_PATH/asm/decode_data.s.o(.rodata);
3232
BUILD_PATH/asm/14CB0.s.o(.rodata);
@@ -36,7 +36,7 @@ SECTIONS
3636
main_TEXT_START = .;
3737
BUILD_PATH/asm/main.s.o(.text);
3838
BUILD_PATH/asm/10C64.s.o(.text);
39-
BUILD_PATH/asm/cache_file_pos.s.o(.text);
39+
BUILD_PATH/src/cache_file_pos.c.o(.text);
4040
BUILD_PATH/asm/11B60.s.o(.text);
4141
BUILD_PATH/asm/decode_data.s.o(.text);
4242
BUILD_PATH/asm/14CB0.s.o(.text);
@@ -50,8 +50,8 @@ SECTIONS
5050
BUILD_PATH/asm/main.s.o(.data);
5151
_10C64_s = .;
5252
BUILD_PATH/asm/10C64.s.o(.data);
53-
cache_file_pos_s = .;
54-
BUILD_PATH/asm/cache_file_pos.s.o(.data);
53+
cache_file_pos_c = .;
54+
BUILD_PATH/src/cache_file_pos.c.o(.data);
5555
_11B60_s = .;
5656
BUILD_PATH/asm/11B60.s.o(.data);
5757
decode_data_s = .;
@@ -67,7 +67,7 @@ SECTIONS
6767
BUILD_PATH/asm/data/800.rodata.s.o(.bss);
6868
BUILD_PATH/asm/main.s.o(.bss);
6969
BUILD_PATH/asm/10C64.s.o(.bss);
70-
BUILD_PATH/asm/cache_file_pos.s.o(.bss);
70+
BUILD_PATH/src/cache_file_pos.c.o(.bss);
7171
BUILD_PATH/asm/11B60.s.o(.bss);
7272
BUILD_PATH/asm/decode_data.s.o(.bss);
7373
BUILD_PATH/asm/14CB0.s.o(.bss);

include/thunder.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#ifndef THUNDER_H
22
#define THUNDER_H
33

4-
// ...
4+
#define FILES_COUNT 851
5+
6+
typedef unsigned int uint32_t;
7+
8+
typedef struct FileInfo {
9+
char padding[0x24];
10+
} FileInfo;
511

612
#endif /* THUNDER_H */

src/cache_file_pos.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1-
#include <stdint.h>
2-
31
#include "common.h"
42
#include "thunder.h"
53

6-
INCLUDE_ASM("asm/nonmatchings/cache_file_pos", cache_file_pos);
4+
extern FileInfo D_8004A4BC[FILES_COUNT];
5+
6+
void *func_80021490(void*, uint32_t);
7+
8+
void cache_file_pos(void)
9+
{
10+
int i;
11+
12+
for (i = 0; i < sizeof(D_8004A4BC) / sizeof(D_8004A4BC[0]); i++) {
13+
func_80021490(&D_8004A4BC[i], 1);
14+
}
15+
}

tools/gcc2.7.2-mipsel/cc1

2.7 MB
Binary file not shown.

tools/gcc2.7.2-mipsel/cc1plus

3.23 MB
Binary file not shown.
Binary file not shown.

tools/gcc2.7.2-mipsel/g++

697 KB
Binary file not shown.
Binary file not shown.

tools/gcc2.8.1-mipsel/as

Lines changed: 0 additions & 2 deletions
This file was deleted.

tools/gcc2.8.1-mipsel/cc1

-3.08 MB
Binary file not shown.

tools/gcc2.8.1-mipsel/cc1plus

-3.68 MB
Binary file not shown.

tools/gcc2.8.1-mipsel/gcc

-808 KB
Binary file not shown.

0 commit comments

Comments
 (0)