From 70e2cea0569ae86d5ec1d900e4ee58be95c88889 Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Mon, 23 Jul 2018 19:22:26 -0700 Subject: [PATCH] More demo refactoring --- README.rst | 2 +- demo/sprite_compiler/Makefile | 44 +++++++++++++++++--------------- demo/sprite_compiler/cpbg.s | 2 +- demo/sprite_compiler/multitest.s | 2 +- demo/sprite_compiler/slowfont.s | 4 +-- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/README.rst b/README.rst index 76ac0b7..5335fab 100644 --- a/README.rst +++ b/README.rst @@ -166,7 +166,7 @@ The sample font is modified from Michael Pohoreski's `excellent tutorial on Apple II fonts `_. -Disclaimer +License ========== AsmGen, the 6502 code generator sponsored by the Player/Missile Podcast diff --git a/demo/sprite_compiler/Makefile b/demo/sprite_compiler/Makefile index afec686..611019f 100644 --- a/demo/sprite_compiler/Makefile +++ b/demo/sprite_compiler/Makefile @@ -1,43 +1,47 @@ -COLORSPRITE = ../sprites/moldy_burger.png -BWSPRITE = ../sprites/apple-sprite9x11.png -ASMGEN = python ../../asmgen.py +COLORSPRITE = ../../sprites/moldy_burger.png +BWSPRITE = ../../sprites/apple-sprite9x11.png +ASMGEN_SRC = ../../asmgen.py +ASMGEN = python $(ASMGEN_SRC) -a mac65 -p 6502 all: cpbg.dsk fonttest.dsk -rowlookup.s: asmgen.py - $(ASMGEN) -a mac65 -p 6502 -r > rowlookup.s +rowlookup.s: $(ASMGEN_SRC) + $(ASMGEN) -r > rowlookup.s -collookupbw.s: asmgen.py - $(ASMGEN) -a mac65 -p 6502 -s hgrbw -c > collookupbw.s +collookupbw.s: $(ASMGEN_SRC) + $(ASMGEN) -s hgrbw -c > collookupbw.s -collookupcolor.s: asmgen.py - $(ASMGEN) -a mac65 -p 6502 -c > collookupcolor.s +collookupcolor.s: $(ASMGEN_SRC) + $(ASMGEN) -c > collookupcolor.s -bwsprite.s: asmgen.py collookupbw.s rowlookup.s $(BWSPRITE) - $(ASMGEN) -a mac65 -p 6502 -s hgrbw $(BWSPRITE) -n bwsprite -m -b > bwsprite.s +bwsprite.s: $(ASMGEN_SRC) collookupbw.s rowlookup.s $(BWSPRITE) + $(ASMGEN) -s hgrbw $(BWSPRITE) -n bwsprite -m -b > bwsprite.s -colorsprite.s: asmgen.py collookupcolor.s rowlookup.s $(COLORSPRITE) - $(ASMGEN) -a mac65 -p 6502 -s hgrcolor $(COLORSPRITE) -n colorsprite -m > colorsprite.s +colorsprite.s: $(ASMGEN_SRC) collookupcolor.s rowlookup.s $(COLORSPRITE) + $(ASMGEN) -s hgrcolor $(COLORSPRITE) -n colorsprite -m > colorsprite.s -bwtest.dsk: asmgen.py bwtest.s bwsprite.s +bwtest.dsk: $(ASMGEN_SRC) bwtest.s bwsprite.s atasm -obwtest.xex bwtest.s -Lbwtest.var -gbwtest.lst atrcopy bwtest.dsk boot -b bwtest.xex --brun 6000 -f -colortest.dsk: asmgen.py colortest.s bwsprite.s +colortest.dsk: $(ASMGEN_SRC) colortest.s bwsprite.s atasm -ocolortest.xex colortest.s -Lcolortest.var -gcolortest.lst atrcopy colortest.dsk boot -b colortest.xex --brun 6000 -f -cpbg-asmgen-driver.s: asmgen.py $(BWSPRITE) - $(ASMGEN) -a mac65 -p 6502 -s hgrbw -m -k -d -g -f fatfont128.dat -o cpbg $(BWSPRITE) $(COLORSPRITE) +cpbg-asmgen-driver.s: $(ASMGEN_SRC) $(BWSPRITE) + $(ASMGEN) -s hgrbw -m -k -d -g -f ../../fonts/fatfont128.dat -o cpbg $(BWSPRITE) $(COLORSPRITE) cpbg.xex: cpbg.s cpbg-asmgen-driver.s atasm -mae -ocpbg.xex cpbg.s -Lcpbg.var -gcpbg.lst -cpbg.dsk: asmgen.py cpbg.xex +cpbg.dsk: $(ASMGEN_SRC) cpbg.xex atrcopy cpbg.dsk boot -b cpbg.xex --brun 6000 -f -fonttest-asmgen-driver.s: asmgen.py fatfont128.dat - $(ASMGEN) -a mac65 -p 6502 -s hgrbw -f fatfont128.dat -r -o fonttest +fonttest-asmgen-driver.s: $(ASMGEN_SRC) ../../fonts/fatfont128.dat + $(ASMGEN) -s hgrbw -f ../../fonts/fatfont128.dat -r -o fonttest + +fatfont.s: + $(ASMGEN) --src ../../fonts/fatfont128.dat > fatfont.s fonttest.dsk: fonttest.s fatfont.s fonttest-asmgen-driver.s slowfont.s atasm -ofonttest.xex fonttest.s -Lfonttest.var -gfonttest.lst diff --git a/demo/sprite_compiler/cpbg.s b/demo/sprite_compiler/cpbg.s index ab54983..57014d7 100644 --- a/demo/sprite_compiler/cpbg.s +++ b/demo/sprite_compiler/cpbg.s @@ -703,5 +703,5 @@ textrows_h .byte $04, $04, $05, $05, $06, $06, $07, $07 -.include cpbg-sprite-driver.s +.include cpbg-asmgen-driver.s .include fatfont.s diff --git a/demo/sprite_compiler/multitest.s b/demo/sprite_compiler/multitest.s index c684ef1..799b46b 100644 --- a/demo/sprite_compiler/multitest.s +++ b/demo/sprite_compiler/multitest.s @@ -330,4 +330,4 @@ sprite_diry -.include multitest-sprite-driver.s +.include multitest-asmgen-driver.s diff --git a/demo/sprite_compiler/slowfont.s b/demo/sprite_compiler/slowfont.s index 4ca068b..5fdf8f5 100644 --- a/demo/sprite_compiler/slowfont.s +++ b/demo/sprite_compiler/slowfont.s @@ -16,10 +16,10 @@ slowfont ; A = character, X = column, Y = row; A is clobbered, X&Y are not rol font_ptr + 1 clc ; add font table address to get pointer inside font table - lda #fatfont + lda #>FONTS_FATFONT128_START adc font_ptr+1 sta slowfont_loop_smc+2