Skip to content

Commit 6be6de3

Browse files
Do not require "extras" submodule to build
1 parent e4342f9 commit 6be6de3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+6231
-68
lines changed

.gitmodules

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "extras"]
2-
path = extras
3-
url = git://github.com/kanzure/pokemon-reverse-engineering-tools.git

INSTALL.md

+134-37

Makefile

+40-17
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,14 @@ else
44
RGBDS_DIR =
55
endif
66

7-
PYTHON := python2
8-
MD5 := md5sum -c --quiet
9-
10-
2bpp := $(PYTHON) extras/pokemontools/gfx.py 2bpp
11-
1bpp := $(PYTHON) extras/pokemontools/gfx.py 1bpp
12-
pic := $(PYTHON) extras/pokemontools/pic.py compress
13-
includes := $(PYTHON) extras/pokemontools/scan_includes.py
7+
MD5 := md5sum -c
148

159
pokered_obj := audio_red.o main_red.o text_red.o wram_red.o
1610
pokeblue_obj := audio_blue.o main_blue.o text_blue.o wram_blue.o
1711

1812
.SUFFIXES:
19-
.SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .pic
2013
.SECONDEXPANSION:
21-
# Suppress annoying intermediate file deletion messages.
22-
.PRECIOUS: %.2bpp
23-
.PHONY: all clean red blue compare
14+
.PHONY: all clean red blue compare tools
2415

2516
roms := pokered.gbc pokeblue.gbc
2617

@@ -35,14 +26,27 @@ compare: red blue
3526
clean:
3627
rm -f $(roms) $(pokered_obj) $(pokeblue_obj) $(roms:.gbc=.sym)
3728
find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} +
29+
#$(MAKE) clean -C tools/
30+
31+
tools:
32+
$(MAKE) -C tools/
33+
34+
35+
# Build tools when building the rom.
36+
# This has to happen before the rules are processed, since that's when scan_includes is run.
37+
ifeq (,$(filter clean tools,$(MAKECMDGOALS)))
38+
$(info $(shell $(MAKE) -C tools))
39+
endif
40+
41+
3842

3943
%.asm: ;
4044

41-
%_red.o: dep = $(shell $(includes) $(@D)/$*.asm)
45+
%_red.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
4246
$(pokered_obj): %_red.o: %.asm $$(dep)
4347
$(RGBDS_DIR)rgbasm -D _RED -h -o $@ $*.asm
4448

45-
%_blue.o: dep = $(shell $(includes) $(@D)/$*.asm)
49+
%_blue.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
4650
$(pokeblue_obj): %_blue.o: %.asm $$(dep)
4751
$(RGBDS_DIR)rgbasm -D _BLUE -h -o $@ $*.asm
4852

@@ -54,7 +58,26 @@ pokeblue_opt = -Cjv -k 01 -l 0x33 -m 0x13 -p 0 -r 03 -t "POKEMON RED"
5458
$(RGBDS_DIR)rgbfix $($*_opt) $@
5559
sort $*.sym -o $*.sym
5660

57-
%.png: ;
58-
%.2bpp: %.png ; $(2bpp) $<
59-
%.1bpp: %.png ; $(1bpp) $<
60-
%.pic: %.2bpp ; $(pic) $<
61+
gfx/blue/intro_purin_1.6x6.2bpp: rgbgfx += -h
62+
gfx/blue/intro_purin_2.6x6.2bpp: rgbgfx += -h
63+
gfx/blue/intro_purin_3.6x6.2bpp: rgbgfx += -h
64+
gfx/red/intro_nido_1.6x6.2bpp: rgbgfx += -h
65+
gfx/red/intro_nido_2.6x6.2bpp: rgbgfx += -h
66+
gfx/red/intro_nido_3.6x6.2bpp: rgbgfx += -h
67+
68+
gfx/game_boy.norepeat.2bpp: tools/gfx += --remove-duplicates
69+
gfx/theend.interleave.2bpp: tools/gfx += --interleave --png=$<
70+
gfx/tilesets/%.2bpp: tools/gfx += --trim-whitespace
71+
72+
%.png: ;
73+
74+
%.2bpp: %.png
75+
rgbgfx $(rgbgfx) -o $@ $<
76+
$(if $(tools/gfx),\
77+
tools/gfx $(tools/gfx) -o $@ $@)
78+
%.1bpp: %.png
79+
rgbgfx -d1 $(rgbgfx) -o $@ $<
80+
$(if $(tools/gfx),\
81+
tools/gfx $(tools/gfx) -d1 -o $@ $@)
82+
%.pic: %.2bpp
83+
tools/pkmncompress $< $@

data/mapHeaders/FarawayIslandInside.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ FarawayIslandInside_h:
33
db FARAWAY_ISLAND_INSIDE_HEIGHT, FARAWAY_ISLAND_INSIDE_WIDTH ; dimensions (y, x)
44
dw FarawayIslandInsideBlocks, FarawayIslandInsideTextPointers, FarawayIslandInsideScript ; blocks, texts, scripts
55
db $00 ; connections
6-
dw FarawayIslandInsideObject ; objects
6+
dw FarawayIslandInsideObject ; objects

data/mapHeaders/FarawayIslandOutside.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ FarawayIslandOutside_h:
33
db FARAWAY_ISLAND_OUTSIDE_HEIGHT, FARAWAY_ISLAND_OUTSIDE_WIDTH ; dimensions (y, x)
44
dw FarawayIslandOutsideBlocks, FarawayIslandOutsideTextPointers, FarawayIslandOutsideScript ; blocks, texts, scripts
55
db $00 ; connections
6-
dw FarawayIslandOutsideObject ; objects
6+
dw FarawayIslandOutsideObject ; objects

data/mapHeaders/NavelRockOutside.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ NavelRockOutside_h:
33
db NAVEL_ROCK_OUTSIDE_HEIGHT, NAVEL_ROCK_OUTSIDE_WIDTH ; dimensions (y, x)
44
dw NavelRockOutsideBlocks, NavelRockOutsideTextPointers, NavelRockOutsideScript ; blocks, texts, scripts
55
db $00 ; connections
6-
dw NavelRockOutsideObject ; objects
6+
dw NavelRockOutsideObject ; objects

data/mapHeaders/SouthernIslandInside.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ SouthernIslandInside_h:
33
db SOUTHERN_ISLAND_INSIDE_HEIGHT, SOUTHERN_ISLAND_INSIDE_WIDTH ; dimensions (y, x)
44
dw SouthernIslandInsideBlocks, SouthernIslandInsideTextPointers, SouthernIslandInsideScript ; blocks, texts, scripts
55
db $00 ; connections
6-
dw SouthernIslandInsideObject ; objects
6+
dw SouthernIslandInsideObject ; objects

data/mapHeaders/SouthernIslandOutside.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ SouthernIslandOutside_h:
33
db SOUTHERN_ISLAND_OUTSIDE_HEIGHT, SOUTHERN_ISLAND_OUTSIDE_WIDTH ; dimensions (y, x)
44
dw SouthernIslandOutsideBlocks, SouthernIslandOutsideTextPointers, SouthernIslandOutsideScript ; blocks, texts, scripts
55
db $00 ; connections
6-
dw SouthernIslandOutsideObject ; objects
6+
dw SouthernIslandOutsideObject ; objects

data/mapObjects/FarawayIslandInside.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ FarawayIslandInsideObject:
1212

1313
; warp-to
1414
EVENT_DISP FARAWAY_ISLAND_INSIDE_WIDTH, $13, $c ; FARAWAY_ISLAND_OUTSIDE
15-
EVENT_DISP FARAWAY_ISLAND_INSIDE_WIDTH, $13, $d ; FARAWAY_ISLAND_OUTSIDE
15+
EVENT_DISP FARAWAY_ISLAND_INSIDE_WIDTH, $13, $d ; FARAWAY_ISLAND_OUTSIDE

data/mapObjects/FarawayIslandOutside.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ FarawayIslandOutsideObject:
1616
; warp-to
1717
EVENT_DISP FARAWAY_ISLAND_OUTSIDE_WIDTH, $27, $e ; INSIDE_FERRY
1818
EVENT_DISP FARAWAY_ISLAND_OUTSIDE_WIDTH, $7, $16 ; FARAWAY_ISLAND_INSIDE
19-
EVENT_DISP FARAWAY_ISLAND_OUTSIDE_WIDTH, $7, $17 ; FARAWAY_ISLAND_INSIDE
19+
EVENT_DISP FARAWAY_ISLAND_OUTSIDE_WIDTH, $7, $17 ; FARAWAY_ISLAND_INSIDE

data/mapObjects/NavelRockOutside.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ NavelRockOutsideObject:
1414
; warp-to
1515
EVENT_DISP NAVEL_ROCK_OUTSIDE_WIDTH, $5, $8 ; NAVEL_ROCK_CAVE_1
1616
EVENT_DISP NAVEL_ROCK_OUTSIDE_WIDTH, $b, $9 ; NAVEL_ROCK_FERRY_DOCK
17-
EVENT_DISP NAVEL_ROCK_OUTSIDE_WIDTH, $b, $a ; NAVEL_ROCK_FERRY_DOCK
17+
EVENT_DISP NAVEL_ROCK_OUTSIDE_WIDTH, $b, $a ; NAVEL_ROCK_FERRY_DOCK

data/mapObjects/SouthernIslandInside.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ SouthernIslandInsideObject:
1414

1515
; warp-to
1616
EVENT_DISP SOUTHERN_ISLAND_INSIDE_WIDTH, $15, $c ; SOUTHERN_ISLAND_OUTSIDE
17-
EVENT_DISP SOUTHERN_ISLAND_INSIDE_WIDTH, $15, $d ; SOUTHERN_ISLAND_OUTSIDE
17+
EVENT_DISP SOUTHERN_ISLAND_INSIDE_WIDTH, $15, $d ; SOUTHERN_ISLAND_OUTSIDE

data/mapObjects/SouthernIslandOutside.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ SouthernIslandOutsideObject:
1616
; warp-to
1717
EVENT_DISP SOUTHERN_ISLAND_OUTSIDE_WIDTH, $17, $e ; INSIDE_FERRY
1818
EVENT_DISP SOUTHERN_ISLAND_OUTSIDE_WIDTH, $5, $e ; SOUTHERN_ISLAND_INSIDE
19-
EVENT_DISP SOUTHERN_ISLAND_OUTSIDE_WIDTH, $5, $f ; SOUTHERN_ISLAND_INSIDE
19+
EVENT_DISP SOUTHERN_ISLAND_OUTSIDE_WIDTH, $5, $f ; SOUTHERN_ISLAND_INSIDE

extras

-1
This file was deleted.

gfx/badges.png

742 Bytes

gfx/leaf_fishing_tile_back.png

-22 Bytes

gfx/leaf_fishing_tile_front.png

-12 Bytes

gfx/leaf_fishing_tile_side.png

-14 Bytes

gfx/player_title.png

268 Bytes

gfx/red/redgreenversion.png

2 Bytes

gfx/red_fishing_tile_back.png

-12 Bytes

gfx/red_fishing_tile_front.png

-11 Bytes

gfx/red_fishing_tile_side.png

-2 Bytes

gfx/red_fishingrod_tiles.png

103 Bytes

gfx/sprites/agatha.png

157 Bytes

gfx/sprites/ball.png

-4 Bytes

gfx/sprites/boulder.png

3 Bytes

gfx/sprites/cycling.png

196 Bytes

gfx/sprites/ditto.png

1 Byte

gfx/sprites/girl.png

153 Bytes

gfx/sprites/hiker.png

179 Bytes

gfx/sprites/lance.png

172 Bytes

gfx/sprites/lorelei.png

178 Bytes

gfx/sprites/medium.png

119 Bytes

gfx/sprites/misty.png

177 Bytes

gfx/sprites/mom_geisha.png

145 Bytes

gfx/sprites/red.png

165 Bytes

gfx/sprites/rocket.png

130 Bytes

gfx/sprites/sabrina.png

78 Bytes

gfx/sprites/sudowoodo.png

-3 Bytes

gfx/sprites/tennant.png

156 Bytes

gfx/tilesets/forest_gate.png

642 Bytes

gfx/trainer_info.png

17 Bytes

pic/bmon/arbok.png

383 Bytes

pic/bmon/articuno.png

514 Bytes

pic/bmon/charmander.png

191 Bytes

pic/bmon/dragonair.png

404 Bytes

pic/bmon/dragonite.png

408 Bytes

pic/bmon/dratini.png

168 Bytes

pic/bmon/lugia.png

436 Bytes

pic/monback/bulbasaurb.png

201 Bytes

pic/monback/lugia.png

209 Bytes

pic/trainer/beauty.png

339 Bytes

pic/trainer/birdkeeper.png

337 Bytes

pic/trainer/blackbelt.png

398 Bytes

pic/trainer/brock.png

270 Bytes

pic/trainer/bugcatcher.png

349 Bytes

pic/trainer/burglar.png

299 Bytes

pic/trainer/channeler.png

385 Bytes

pic/trainer/cooltrainerf.png

293 Bytes

pic/trainer/cooltrainerm.png

304 Bytes

pic/trainer/engineer.png

333 Bytes

pic/trainer/erika.png

309 Bytes

pic/trainer/fisher.png

398 Bytes

pic/trainer/gentleman.png

273 Bytes

pic/trainer/hiker.png

384 Bytes

pic/trainer/jr.trainerf.png

304 Bytes

pic/trainer/jr.trainerm.png

336 Bytes

pic/trainer/juggler.png

344 Bytes

pic/trainer/koga.png

365 Bytes

pic/trainer/lass.png

288 Bytes

pic/trainer/oldman.png

219 Bytes

pic/trainer/pi.png

300 Bytes

pic/trainer/pokemaniac.png

359 Bytes

pic/trainer/psychic.png

273 Bytes

pic/trainer/red.png

296 Bytes

pic/trainer/redb.png

232 Bytes

pic/trainer/rocker.png

375 Bytes

pic/trainer/rocket.png

302 Bytes

pic/trainer/sailor.png

305 Bytes

pic/trainer/scientist.png

348 Bytes

pic/trainer/supernerd.png

262 Bytes

pic/trainer/swimmer.png

309 Bytes

pic/trainer/swimmerf.png

317 Bytes

pic/trainer/youngster.png

291 Bytes

tools/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
scan_includes
2+
gfx
3+
pkmncompress

tools/Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.PHONY: all clean
2+
3+
CC := gcc
4+
CFLAGS := -O3 -std=c99 -Wall -Wextra -pedantic
5+
6+
tools := scan_includes gfx pkmncompress
7+
8+
all: $(tools)
9+
@:
10+
11+
clean:
12+
rm -f $(tools)
13+
14+
gfx: common.h
15+
%: %.c
16+
$(CC) $(CFLAGS) -o $@ $<

0 commit comments

Comments
 (0)