Browse Source

Build intro map from file

master
Forest Belton 3 years ago
parent
commit
c329224f21
3 changed files with 17 additions and 74 deletions
  1. +15
    -10
      Makefile
  2. BIN
      png/map/intro.png
  3. +2
    -64
      src/bg.s

+ 15
- 10
Makefile View File

@ -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)
rm -f is.gb is.gb.sym $(ALL_2BPP) $(OFILES) $(MAP_ASM)

BIN
png/map/intro.png View File

Before After
Width: 160  |  Height: 144  |  Size: 1.2 KiB

+ 2
- 64
src/bg.s View File

@ -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::

Loading…
Cancel
Save