mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Merge pull request #365 from Ben10do/tools-makefile-integration
Improvements to the tools and their Makefile
This commit is contained in:
commit
175cc6536a
@ -17,7 +17,6 @@ cd ..
|
||||
|
||||
git clone https://github.com/pret/pokecrystal
|
||||
cd pokecrystal
|
||||
make tools
|
||||
```
|
||||
|
||||
To build **pokecrystal.gbc**:
|
||||
@ -42,7 +41,6 @@ cd ..
|
||||
|
||||
git clone https://github.com/pret/pokecrystal
|
||||
cd pokecrystal
|
||||
make tools
|
||||
```
|
||||
|
||||
To build **pokecrystal.gbc**:
|
||||
@ -67,7 +65,6 @@ In the **Cygwin terminal**:
|
||||
|
||||
git clone https://github.com/pret/pokecrystal
|
||||
cd pokecrystal
|
||||
make tools CC=gcc
|
||||
```
|
||||
|
||||
To build **pokecrystal.gbc**:
|
||||
|
8
Makefile
8
Makefile
@ -36,8 +36,16 @@ all: crystal
|
||||
crystal: pokecrystal.gbc
|
||||
crystal11: pokecrystal11.gbc
|
||||
|
||||
# Ensure that the tools are built when making the ROM
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
ifneq ($(MAKECMDGOALS),tools)
|
||||
Makefile: tools
|
||||
endif
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -f $(roms) $(crystal_obj) $(crystal11_obj) $(roms:.gbc=.map) $(roms:.gbc=.sym)
|
||||
make clean -C tools/
|
||||
|
||||
compare: $(roms)
|
||||
@$(SHA1) -c roms.sha1
|
||||
|
8
tools/.gitignore
vendored
Normal file
8
tools/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
gfx
|
||||
lzcomp
|
||||
md5
|
||||
palette
|
||||
png_dimensions
|
||||
pokemon_animation
|
||||
pokemon_animation_graphics
|
||||
scan_includes
|
@ -1,8 +1,8 @@
|
||||
.PHONY: all
|
||||
.PHONY: all clean
|
||||
|
||||
CFLAGS := -std=c99
|
||||
|
||||
all: \
|
||||
tools := \
|
||||
lzcomp \
|
||||
png_dimensions \
|
||||
scan_includes \
|
||||
@ -11,7 +11,11 @@ all: \
|
||||
pokemon_animation_graphics \
|
||||
gfx \
|
||||
md5
|
||||
all: $(tools)
|
||||
@:
|
||||
|
||||
clean:
|
||||
rm -f $(tools)
|
||||
|
||||
%: %.c
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
@ -177,11 +177,11 @@ struct command find_best_copy (const unsigned char * data, unsigned short positi
|
||||
struct command simple = {.command = 7};
|
||||
struct command flipped = simple, backwards = simple;
|
||||
short count, offset;
|
||||
if (count = scan_forwards(data + position, length - position, data, position, &offset))
|
||||
if ((count = scan_forwards(data + position, length - position, data, position, &offset)))
|
||||
simple = (struct command) {.command = 4, .count = count, .value = offset};
|
||||
if (count = scan_forwards(data + position, length - position, bitflipped, position, &offset))
|
||||
if ((count = scan_forwards(data + position, length - position, bitflipped, position, &offset)))
|
||||
flipped = (struct command) {.command = 5, .count = count, .value = offset};
|
||||
if (count = scan_backwards(data, length - position, position, &offset))
|
||||
if ((count = scan_backwards(data, length - position, position, &offset)))
|
||||
backwards = (struct command) {.command = 6, .count = count, .value = offset};
|
||||
struct command command;
|
||||
switch (flags / 24) {
|
||||
|
Loading…
Reference in New Issue
Block a user