diff --git a/Makefile b/Makefile index acb8fbc..a9affb9 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,28 @@ -PNGFILES := $(shell find png/sprite -type f -name '*.png') -IMGFILES := $(PNGFILES:%.png=%.2bpp) - -COLLFILES := $(shell find png/map -type f -name '*_coll.png') -BUILT_COLLFILES := $(COLLFILES:%_coll.png=%.s) - +# Graphics +SPRITE_PNG := $(shell find png/sprite -type f -name '*.png') +MAP_PNG := $(shell find png/map -type f -name '*.png' -not -name '*_coll.png') +MAP_COLL := $(shell find png/map -type f -name '*_coll.png') +MAP_ASM := $(MAP_PNG:%.png:%.s) +ALL_2BPP := $(SPRITE_PNG:%.png=%.2bpp) $(MAP_PNG:%.png=%.map.2bpp) $(MAP_PNG:%.png=%.tiles.2bpp) + +# Code SFILES := $(shell find src -type f -name '*.s') -OFILES := $(SFILES:%.s=%.o) +OFILES := $(SFILES:%.s=%.o) $(MAP_ASM) .PHONY: clean -is.gb is.gb.sym: $(IMGFILES) $(OFILES) $(BUILT_COLLFILES) +is.gb is.gb.sym:$(OFILES) $(ALL_2BPP) rgblink -o $@ -n $@.sym $(OFILES) rgbfix -v $@ -$(OFILES): $(IMGFILES) +$(OFILES): $(ALL_2BPP) %.o: %.s rgbasm -i inc -o $@ $< +png/map/%.tiles.2bpp png/map/%.map.2bpp: png/map/%.png + rgbgfx -u -t $(<:%.png=%.map.2bpp) -o $(<:%.png=%.tiles.2bpp) $< + png/map/%.s: png/map/%_coll.png python scripts/generate_coll_map.py -o $@ $< @@ -25,4 +30,4 @@ png/sprite/%.2bpp: png/sprite/%.png rgbgfx -o $@ $< clean: - rm -f is.gb is.gb.sym $(IMGFILES) $(OFILES) $(BUILT_COLLFILES) \ No newline at end of file + rm -f is.gb is.gb.sym $(ALL_2BPP) $(OFILES) $(MAP_ASM) \ No newline at end of file diff --git a/png/map/intro.png b/png/map/intro.png new file mode 100644 index 0000000..f45d373 Binary files /dev/null and b/png/map/intro.png differ diff --git a/src/bg.s b/src/bg.s index c27de18..6dd8fba 100644 --- a/src/bg.s +++ b/src/bg.s @@ -22,71 +22,9 @@ sceneHeight EQU 18 SECTION "BG0", ROM0 bg: -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $01,$02,$02,$03,$00,$00,$00,$00,$01,$02 -DB $02,$02,$02,$02,$02,$0A,$03,$00,$00,$00 -DB $07,$09,$09,$08,$00,$00,$00,$00,$07,$09 -DB $09,$09,$09,$09,$09,$0B,$08,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$0C,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$0A,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$0B,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$0C,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$0A,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$01,$02,$02,$02,$02,$02 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$07,$09,$09,$09,$09,$09 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$01,$02,$02,$02 -DB $02,$02,$03,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$07,$09,$09,$09 -DB $09,$09,$08,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 -DB $01,$02,$02,$02,$02,$02,$02,$02,$02,$02 -DB $02,$02,$02,$02,$02,$02,$02,$02,$02,$02 -DB $04,$06,$06,$06,$06,$06,$06,$06,$06,$06 -DB $06,$06,$06,$06,$06,$06,$06,$06,$06,$06 -bg_end: - + INCBIN "png/map/intro.map.2bpp" bg_tiles: - DB $00,$00,$00,$00,$00,$00,$00,$00 - DB $00,$00,$00,$00,$00,$00,$00,$00 - DB $FF,$FF,$DF,$80,$FD,$80,$77,$40 - DB $3F,$3F,$22,$3D,$20,$3F,$28,$37 - DB $FF,$FF,$DF,$00,$FD,$00,$F7,$00 - DB $FF,$FF,$40,$BF,$01,$FE,$10,$EF - DB $FF,$FF,$FB,$01,$BF,$01,$EE,$02 - DB $FC,$FC,$44,$BC,$04,$FC,$14,$EC - DB $22,$3D,$30,$2F,$24,$3B,$20,$3F - DB $20,$3F,$32,$2D,$20,$3F,$28,$37 - DB $44,$BC,$0C,$F4,$24,$DC,$04,$FC - DB $04,$FC,$4C,$B4,$04,$FC,$14,$EC - DB $40,$BF,$02,$FD,$20,$DF,$00,$FF - DB $08,$F7,$40,$BF,$02,$FD,$10,$EF - DB $20,$3F,$22,$3D,$10,$1F,$0F,$0F - DB $00,$00,$00,$00,$00,$00,$00,$00 - DB $04,$FC,$44,$BC,$08,$F8,$F0,$F0 - DB $00,$00,$00,$00,$00,$00,$00,$00 - DB $40,$BF,$02,$FD,$20,$DF,$FF,$FF - DB $00,$00,$00,$00,$00,$00,$00,$00 - DB $FF,$FF,$FF,$81,$FF,$81,$FF,$81 - DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$81 - DB $FF,$81,$FF,$81,$FF,$FF,$FF,$FF - DB $FF,$FF,$FF,$81,$FF,$81,$FF,$81 - DB $FF,$FF,$FF,$FF,$FF,$FF,$FF,$81 - DB $FF,$81,$FF,$81,$FF,$FF,$FF,$FF + INCBIN "png/map/intro.tiles.2bpp" bg_tiles_end: BG_Init::