Skip to content

Commit

Permalink
Fix after merging Pokered updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JustRegularLuna committed Feb 26, 2015
2 parents c9db008 + d8d0893 commit 8bb0228
Show file tree
Hide file tree
Showing 599 changed files with 45,949 additions and 11,048 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@
*.gb

# rgbds extras
*.map
*.sym

# generated
*.tx

# converted image data
*.2bpp
*.1bpp
Expand Down
63 changes: 24 additions & 39 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,57 @@
# Linux

Dependencies:

sudo apt-get install make gcc bison git python python-setuptools
sudo easy_install pip

The assembler used is [**rgbds**](https://github.com/bentley/rgbds).
sudo easy_install pypng

git clone git://github.com/bentley/rgbds.git
cd rgbds
sudo mkdir -p /usr/local/man/man{1,7}
sudo make install
cd ..
rm -rf rgbds

Set up the repository.

git clone git://github.com/iimarckus/pokered.git
git clone --recursive git://github.com/iimarckus/pokered.git
cd pokered
git submodule init
git submodule update
sudo pip install -r extras/requirements.txt

To build **pokered.gbc** and **pokeblue.gbc**:

make

This should take about 10 seconds. Subsequent builds are faster.

To build them individually:

make red
make blue


# OS X
# Mac

Download and install **Command Line Tools for Xcode**.
Then open a terminal and follow the Linux instructions.
In the shell, run:

xcode-select --install
sudo easy_install pypng

# Windows
git clone git://github.com/bentley/rgbds.git
cd rgbds
sudo make install
cd ..

It's recommended that you use a virtual machine running Linux or OS X.
git clone --recursive git://github.com/iimarckus/pokered.git
cd pokered

If you insist on Windows, use [**Cygwin**](http://cygwin.com/install.html) (32-bit).
make

Dependencies are downloaded in the installer rather than the command line.
Select the following packages:
* make
* git
* gettext
* python
* python-setuptools

To install rgbds, extract the contents of
**http://iimarck.us/etc/rgbds.zip**
and put them in `C:\cygwin\usr\local\bin`.
# Windows

Then set up the repository. In the **Cygwin terminal**:
To build on Windows, use [**Cygwin**](http://cygwin.com/install.html) (32-bit).

git clone git://github.com/iimarckus/pokered.git
cd pokered
git submodule init
git submodule update
easy_install git://github.com/drj11/pypng.git@master#egg=pypng
In the installer, select the following packages: `make` `git` `gettext` `python` `python-setuptools`

To build:
Then get the most recent version of [**rgbds**](https://github.com/bentley/rgbds/releases/).
Put `rgbasm.exe`, `rgblink.exe` and `rgbfix.exe` in `C:\cygwin\usr\local\bin`.

make
In the **Cygwin terminal**:

easy_install pypng
git clone --recursive git://github.com/iimarckus/pokered.git
cd pokered

make
114 changes: 65 additions & 49 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
# Build Red/Blue. Yellow is WIP.
roms := pokered.gbc pokeblue.gbc


.PHONY: all clean red blue yellow compare

all: $(roms)
red: pokered.gbc
blue: pokeblue.gbc
yellow: pokeyellow.gbc

versions := red blue yellow


# Header options for rgbfix.
dmg_opt = -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03
cgb_opt = -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03

red_opt = $(dmg_opt) -t "POKEMON RED"
blue_opt = $(dmg_opt) -t "POKEMON BLUE"
yellow_opt = $(cgb_opt) -t "POKEMON YELLOW"



# If your default python is 3, you may want to change this to python27.
PYTHON := python
MD5 := md5sum -c --quiet

# md5sum -c is used to compare rom hashes. The options may vary across platforms.
MD5 := md5sum -c --quiet


# The compare target is a shortcut to check that the build matches the original roms exactly.
# This is for contributors to make sure a change didn't affect the contents of the rom.
# More thorough comparison can be made by diffing the output of hexdump -C against both roms.
compare: red blue
@$(MD5) roms.md5


# Clear the default suffixes.
.SUFFIXES:
.SUFFIXES: .asm .tx .o .gbc
.PHONY: all clean red blue yellow compare
.PRECIOUS: %.2bpp
.SUFFIXES: .asm .o .gbc .png .2bpp .1bpp .pic

# Secondary expansion is required for dependency variables in object rules.
.SECONDEXPANSION:

# Suppress annoying intermediate file deletion messages.
.PRECIOUS: %.2bpp

# Filepath shortcuts to avoid overly long recipes.
poketools := extras/pokemontools
gfx := $(PYTHON) $(poketools)/gfx.py
pic := $(PYTHON) $(poketools)/pic.py
includes := $(PYTHON) $(poketools)/scan_includes.py
pre := $(PYTHON) prequeue.py


versions := red blue yellow

# Collect file dependencies for objects in red/, blue/ and yellow/.
# These aren't provided by rgbds by default, so we have to look for file includes ourselves.
$(foreach ver, $(versions), \
$(eval $(ver)_asm := $(shell find $(ver) -iname '*.asm')) \
$(eval $(ver)_obj := $($(ver)_asm:.asm=.o)) \
Expand All @@ -26,56 +66,32 @@ $(foreach obj, $(all_obj), \
)


roms := pokered.gbc pokeblue.gbc
# Image files are added to a queue to reduce build time. They're converted when building parent objects.
%.png: ;
%.2bpp: %.png ; $(eval 2bppq += $<) @rm -f $@
%.1bpp: %.png ; $(eval 1bppq += $<) @rm -f $@
%.pic: %.2bpp ; $(eval picq += $<) @rm -f $@

all: $(roms)
red: pokered.gbc
blue: pokeblue.gbc
yellow: pokeyellow.gbc

compare:
@$(MD5) roms.md5
clean:
rm -f $(roms) $(all_obj)
find . \( -iname '*.tx' -o -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} +


%.asm: ;
%.tx: %.asm
$(eval txq += $<)
@rm -f $@

$(all_obj): $$*.tx $$(patsubst %.asm, %.tx, $$($$*_dep))
@$(pre) $(txq); $(eval txq :=)
# Assemble source files into objects.
# Queue payloads are here. These are made silent since there may be hundreds of targets.
# Use rgbasm -h to use halts without nops.
$(all_obj): $$*.asm $$($$*_dep)
@$(gfx) 2bpp $(2bppq); $(eval 2bppq :=)
@$(gfx) 1bpp $(1bppq); $(eval 1bppq :=)
@$(pic) compress $(picq); $(eval picq :=)
rgbasm -h -o $@ $*.tx
rgbasm -h -o $@ $*.asm


link = rgblink -n $*.sym -m $*.map
dmg_opt := -jsv -k 01 -l 0x33 -m 0x13 -p 0 -r 03
cgb_opt := -cjsv -k 01 -l 0x33 -m 0x1b -p 0 -r 03
# Link objects together to build a rom.

pokered.gbc: $(red_obj)
$(link) -o $@ $^
rgbfix $(dmg_opt) -t "POKEMON RED" $@
# Make a symfile for debugging.
link = rgblink -n poke$*.sym

pokeblue.gbc: $(blue_obj)
poke%.gbc: $$(%_obj)
$(link) -o $@ $^
rgbfix $(dmg_opt) -t "POKEMON BLUE" $@
rgbfix $($*_opt) $@

pokeyellow.gbc: $(yellow_obj)
$(link) -o $@ $^
rgbfix $(cgb_opt) -t "POKEMON YELLOW" $@


%.2bpp: %.png
$(eval 2bppq += $<)
@rm -f $@
%.1bpp: %.png
$(eval 1bppq += $<)
@rm -f $@
%.pic: %.2bpp
$(eval picq += $<)
@rm -f $@

clean:
rm -f $(roms) $(all_obj) poke*.sym
find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.pic' \) -exec rm {} +
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ To set up the repository, see [**INSTALL.md**](INSTALL.md).
## See also

* Disassembly of [**Pokémon Crystal**][pokecrystal]
* irc: **nucleus.kafuka.org** [**#skeetendo**][irc]
* irc: **irc.freenode.net** [**#pret**][irc]

[pokecrystal]: https://github.com/kanzure/pokecrystal
[irc]: https://kiwiirc.com/client/irc.nolimitzone.com/?#skeetendo

[irc]: https://kiwiirc.com/client/irc.freenode.net/?#pret
2 changes: 1 addition & 1 deletion audio.asm
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ Func_7d13b:: ; 7d13b (1f:513b)
ld a, [hli]
ld c, [hl]
call PlayMusic
jp Func_2307
jp PlayDefaultMusic

PokedexRatingSfxPointers: ; 7d162 (1f:5162)
db (SFX_1f_51 - SFX_Headers_1f) / 3, BANK(SFX_1f_51)
Expand Down
4 changes: 2 additions & 2 deletions audio/sfx/sfx_1f_5d.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SFX_1f_5d_Ch1: ; 7c45e (1f:445e)
duty 2
IF _RED
IF DEF(_RED)
unknownsfx0x20 4, 244, 0, 7
unknownsfx0x20 3, 228, 128, 6
unknownsfx0x20 3, 228, 192, 6
Expand All @@ -18,7 +18,7 @@ ENDC

SFX_1f_5d_Ch2: ; 7c475 (1f:4475)
duty 2
IF _RED
IF DEF(_RED)
unknownsfx0x20 4, 8, 0, 0
unknownsfx0x20 3, 212, 1, 7
unknownsfx0x20 3, 196, 129, 6
Expand Down
1 change: 1 addition & 0 deletions blue.asm
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
_BLUE EQU 1
INCLUDE "charmap.asm"
Loading

0 comments on commit 8bb0228

Please sign in to comment.