Skip to content

Commit

Permalink
Update build to make building easier
Browse files Browse the repository at this point in the history
- Add go-nes as a submodule.  This adds Go as a build requirement but
  removes the need to aquire, build, and configure it separately
- Remove the ca65 & ld65 customizations so compiling will work with a
  release build without issue.
- Don't remove bitmap files with the standard clean recipe.  This
  removes the need for aesprite to build from a "clean" directory.
- Updated README to reflect changes.
  • Loading branch information
zorchenhimer committed Mar 1, 2023
1 parent 2e4f9a5 commit b969705
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "go-nes"]
path = go-nes
url = https://github.com/zorchenhimer/go-nes.git
20 changes: 13 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
export PATH := ../../go-nes/bin:/c/Program Files/Aseprite:../../tools/cc65/bin:$(PATH)
#export PATH := ../../go-nes/bin:/c/Program Files/Aseprite:../../tools/cc65/bin:$(PATH)
.PHONY: all clean

NAME = platforming

NESCFG = nes_000.cfg
CAFLAGS = -g -t nes --color-messages
LDFLAGS = -C $(NESCFG) --dbgfile bin/$(NAME).dbg -m bin/$(NAME).map --color-messages
CAFLAGS = -g -t nes
LDFLAGS = -C $(NESCFG) --dbgfile bin/$(NAME).dbg -m bin/$(NAME).map
CHRUTIL = go-nes/bin/chrutil

SOURCES = main.asm \
map-data.asm \
tiles.chr

all: bin/ bin/$(NAME).nes
all: $(CHRUTIL) bin/ bin/$(NAME).nes

bin/:
mkdir -p bin
Expand All @@ -23,11 +24,16 @@ bin/$(NAME).nes: bin/$(NAME).o
ld65 $(LDFLAGS) -o $@ $^

clean:
-rm -rf bin/*
-rm -rf *.chr *.bmp
-rm bin/* *.chr

cleanall: clean
-rm *.bmp go-nes/bin/*

tiles.chr: tiles.bmp
chrutil -o $@ $<
$(CHRUTIL) -o $@ $<

tiles.bmp: tiles.aseprite
aseprite -b $< --save-as $@

$(CHRUTIL):
$(MAKE) -C go-nes bin/chrutil
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@

This is a simple platforming physics demo for the NES in 6502 assembly.

## Build Requirements
## Building

Building requires the following software installed:

- GNU Make
- ca65 and ld65
- chrutil
- [cc65 compiler suite](https://github.com/cc65/cc65)
- Go
- Aesprite (optional)

To build:

$ git clone https://github.com/zorchenhimer/nes-platforming.git
$ cd nes-platforming && make

## License

Expand Down
1 change: 1 addition & 0 deletions go-nes
Submodule go-nes added at f96269

0 comments on commit b969705

Please sign in to comment.