diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2020-06-18 17:22:32 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2020-06-18 17:22:32 -0400 |
commit | 0dc176b403ab5876664a59c666144690e417c87b (patch) | |
tree | e6fec561c6fe524d99373d9022cb0aca5f9263fe | |
parent | c2ca3c0c4fc49a19554c202e45a990c61752e15d (diff) |
Deprecate baserom dependency
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | CONTRIBUTING.md | 8 | ||||
-rw-r--r-- | INSTALL.md | 12 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | arm7/Makefile | 1 | ||||
-rw-r--r-- | arm9/Makefile | 1 | ||||
-rw-r--r-- | explode_incbins.py | 21 | ||||
-rw-r--r-- | tools/csv2bin/Makefile | 8 |
8 files changed, 11 insertions, 43 deletions
diff --git a/.travis.yml b/.travis.yml index 9c60702e..32b091c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,6 @@ cache: install: # These files are only accessible from Travis CI IP Addresses to prevent piracy. - wget http://private.martmists.com/mwccarm.zip - - wget http://private.martmists.com/baserom.nds - wget http://private.martmists.com/nitro.zip - unzip mwccarm.zip - mv mwccarm tools diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 397bdf95..d8e2b89c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,11 +105,11 @@ OBJDUMP_MODE="${OBJDUMP_MODE:-force-thumb}" OBJDUMP_VMA="${OBJDUMP_VMA:-0x02000000}" OBJDUMP="arm-none-eabi-objdump -Drz -bbinary -m${OBJDUMP_ARCH} -M${OBJDUMP_MODE}" OPTIONS="--start-address=$(($1 + OBJDUMP_VMA)) --stop-address=$(($1 + $2 + OBJDUMP_VMA))" -$OBJDUMP $OPTIONS baserom.sbin > baserom.dump || exit 1 -$OBJDUMP $OPTIONS build/arm9.sbin > arm9.dump -diff -u baserom.dump arm9.dump +$OBJDUMP $OPTIONS $(dirname $0)/baserom.sbin > $(dirname $0)/baserom.dump || exit 1 +$OBJDUMP $OPTIONS $(dirname $0)/build/arm9.sbin > $(dirname $0)/arm9.dump +diff -u $(dirname $0)/baserom.dump $(dirname $0)/arm9.dump ``` -Place a clean version of the ARM9 binary as arm9/baserom.sbin. In your terminal, navigate to the arm9 directory and run `./asmdiff.sh 0 $(wc -c baserom.sbin) | less`, then scroll through to where the grievances begin. Fix any obvious problems in your code/tree, and rerun. If the differences are extensive, you may have induced a shift in the binary either by writing incorrect code or placing it incorrectly into the LCF. *Tip: you can specify a start address and size to only compare the portion of the ROM you are working on.* +Place a clean version of the ARM9 binary as arm9/baserom.sbin (arm9/build/arm9.bin from a successful build should suffice). In your terminal, navigate to the arm9 directory and run `./asmdiff.sh 0 $(wc -c baserom.sbin) | less`, then scroll through to where the grievances begin. Fix any obvious problems in your code/tree, and rerun. If the differences are extensive, you may have induced a shift in the binary either by writing incorrect code or placing it incorrectly into the LCF. *Tip: you can specify a start address and size to only compare the portion of the ROM you are working on.* ## Decompiling data @@ -1,18 +1,14 @@ -### 1. Copy baserom(s) into root folder - -Put a clean copy of Pokemon Diamond (US) nds rom at `./baserom.nds`. - -### 2. Install MWCC compiler +### 1. Install MWCC compiler The build system requires the use of the Metrowerk C Compiler 2.0/base to compile matching files. We cannot distribute the correct compiler here so join the PRET discord and download the pinned mwccarm.zip zip in #pokediamond and extract it to tools/. Run each of the executables so they ask for a license.dat and provide the one in the rar (it may also ask for it when compiling). This only needs to be done once. In the future, a GCC option will be available so MWCC is not required to build, however it is required for a matching ROM. -### 3. Install Nitro SDK +### 2. Install Nitro SDK As with the compiler, the Nitro SDK is proprietary and cannot be distributed here. Opened the pinned Mega folder in the PRET discord and download "NITRO SDK v3.0.zip" and "NITRO SDK V3.0 Plus 2.zip" from the "SDK System Libraries" folder. Extract v3.0.zip into a separate folder, then extract v3.0 Plus 2.zip into the same folder, overwriting when prompted. Copy the contents of tools/bin from the Nitro SDK to tools/bin in your pokediamond clone. Finally, copy include/nitro/specfiles/ARM7-TS.lcf.template into the arm7 subdirectory, and include/nitro/specfiles/ARM9-TS.lcf.template into the arm9 subdirectory. -### 4. Dependencies +### 3. Dependencies #### Linux @@ -48,7 +44,7 @@ You will still require the following packages: Install them using either the Cygwin package manager or using pacman on Msys2. -### 5. Build ROM +### 4. Build ROM Run `make` to build the ROM. @@ -8,6 +8,8 @@ It builds the following ROM: To set up the repository, see [INSTALL.md](INSTALL.md). +For contributor instructions, see [CONTRIBUTING.md](CONTRIBUTING.md). + ## See also Other disassembly and/or decompilation projects: diff --git a/arm7/Makefile b/arm7/Makefile index 1ade0ed4..1b0cd3c3 100644 --- a/arm7/Makefile +++ b/arm7/Makefile @@ -196,7 +196,6 @@ DUMMY != mkdir -p $(ALL_DIRS) %.pal: ; # Included files -baserom.%: ; %.h: ; %.inc: ; diff --git a/arm9/Makefile b/arm9/Makefile index 9c1d4f9a..cb8eba06 100644 --- a/arm9/Makefile +++ b/arm9/Makefile @@ -305,7 +305,6 @@ DUMMY != mkdir -p $(ALL_DIRS) %.pal: ; # Included files -baserom.%: ; %.h: ; %.inc: ; diff --git a/explode_incbins.py b/explode_incbins.py deleted file mode 100644 index 4e1af1b5..00000000 --- a/explode_incbins.py +++ /dev/null @@ -1,21 +0,0 @@ -import sys -import re - -with open(sys.argv[1], 'rb') as rom: - for fname in sys.argv[2:]: - with open(fname, 'r+') as fp: - lines = [] - for line in fp: - m = re.search(r'\.incbin "baserom.nds", (0x\w+), (0x\w+)', line) - if m is not None: - addr = int(m[1], 16) - size = int(m[2], 16) - rom.seek(addr) - for i in range(0, size, 16): - data = rom.read(min(size - i, 16)) - lines.append('\t.byte ' + ', '.join(f'0x{k:02X}' for k in data) + '\n') - else: - lines.append(line) - fp.seek(0) - fp.truncate() - fp.write(''.join(lines)) diff --git a/tools/csv2bin/Makefile b/tools/csv2bin/Makefile index 949ec4e4..818e6579 100644 --- a/tools/csv2bin/Makefile +++ b/tools/csv2bin/Makefile @@ -1,19 +1,13 @@ CC = gcc CFLAGS = -O3 -growth_rates_txt = $(wildcard *.txt) -growth_rates_bin = $(growth_rates_txt:%.txt=%.bin) - .PHONY: all clean all: csv2bin $(growth_rates_bin) @: clean: - $(RM) csv2bin $(growth_rates_bin) + $(RM) csv2bin csv2bin: csv2bin.c $(CC) $(CFLAGS) -o $@ $^ - -%.bin: %.txt - ./csv2bin $< |