Overhaul of art pipeline to support sprite flipping

This commit is contained in:
blondie7575 2018-08-06 13:00:13 -07:00
parent fb2c5b155e
commit 67dabb62a9
28 changed files with 43 additions and 16 deletions

View File

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 249 B

View File

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 242 B

View File

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 197 B

View File

Before

Width:  |  Height:  |  Size: 145 B

After

Width:  |  Height:  |  Size: 145 B

View File

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 197 B

View File

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

View File

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 197 B

View File

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 124 B

View File

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 127 B

View File

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 186 B

View File

@ -13,6 +13,7 @@
700F21DE1F43E31300D7007D /* input.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = input.s; sourceTree = "<group>"; };
700F21DF1F4A364600D7007D /* projectile.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = projectile.s; sourceTree = "<group>"; };
700F21E01F4A3A5500D7007D /* GenerateTrigTables.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = GenerateTrigTables.py; sourceTree = "<group>"; };
700F72872112428D00225B17 /* RenumberSpriteFiles.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = RenumberSpriteFiles.sh; sourceTree = "<group>"; };
700FFAFB1F40F3BF00A442DE /* font.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = font.s; sourceTree = "<group>"; };
7059502B1F37A0BE00BBE90F /* GenerateVRAMTable.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = GenerateVRAMTable.py; sourceTree = "<group>"; };
705AAFA920040B0D001BB0ED /* terrain_e1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = terrain_e1.s; sourceTree = "<group>"; };
@ -65,6 +66,7 @@
70E9D8631F2BD95400555C19 /* Makefile */,
70BDCBC92006AD5F00CB51F1 /* linkerConfig */,
70FE79D21F8814A600E0095C /* MerlinToCA65.sh */,
700F72872112428D00225B17 /* RenumberSpriteFiles.sh */,
7088096D1F2ECE8D00D4C950 /* GenerateRenderSpans.py */,
7059502B1F37A0BE00BBE90F /* GenerateVRAMTable.py */,
7099E3851F4107B100182A82 /* GenerateVRAMYOffset.py */,

View File

@ -15,9 +15,11 @@ ADDR=800
PGM=gscats
MRSPRITE=../MrSprite/mrsprite
GENART=Art/Generated
CHROMA=a4dffb
PALETTE=a4dffb a4dffb 008800 886611 cc9933 eebb44 dd6666 ff99aa 777777 ff0000 b7b7b7 dddddd 0077bb ffff00 000000 ffffff
SPRITES=SpriteBank
FLIPLIST=$(wildcard Art/*Fan.gif) $(wildcard Art/*Spit*.gif)
REMOTESYMBOLS=-Wl $(shell ./ParseMapFile.py *.map)
all: terrain_e1 $(PGM) loader
@ -57,13 +59,20 @@ clean:
rm -f terrain_e1.o
rm -f terrain_e1.map
rm -f terrain_e1
rm -f Art/*m.gif
rm -f $(GENART)/*
.PHONY: art
art:
$(MRSPRITE) CODE "Art/*.gif" $(CHROMA) $(PALETTE)
$(MRSPRITE) BANK "Art/*.txt" $(SPRITES)
mv Art/$(SPRITES)00.bin .
./MerlinToCA65.sh Art/$(SPRITES)Src.txt > spritebank.s
rm Art/*.txt
rm -f $(GENART)/*
for gif in $(FLIPLIST); do $(MRSPRITE) MIRROR "$$gif" $(CHROMA); done
./RenumberSpriteFiles.sh
$(MRSPRITE) CODE $(GENART)"/*.gif" $(CHROMA) $(PALETTE)
$(MRSPRITE) BANK $(GENART)"/*.txt" $(SPRITES)
# $(MRSPRITE) WALLPAPER "Art/*.gif" $(CHROMA) ff0000
mv $(GENART)/$(SPRITES)00.bin .
./MerlinToCA65.sh $(GENART)/$(SPRITES)Src.txt > spritebank.s
rm $(GENART)/*.txt
rm -f Art/*m.gif
java -jar $(AC) -d $(PGM).2mg $(SPRITES)00
java -jar $(AC) -p $(PGM).2mg $(SPRITES)00 BIN 0x0000 < $(SPRITES)00.bin

16
RenumberSpriteFiles.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# Takes the list of gifs in the art folder and numbers them in
# increasing order. This is needed for Mr. Sprite to process them properly
# but requires that alphabetic order of sprite filenames remains consistent
counter=0
for filename in Art/*.gif
do
extension="${filename##*.}"
base="${filename%.*}"
printf -v index "%03d" $counter
newpath=$(echo $filename | sed 's/_*[0-9]*\.gif$/\_'$index'.gif/')
newfile=$(basename $newpath)
cp $filename "Art/Generated/"$newfile
((counter++))
done

Binary file not shown.

Binary file not shown.

View File

@ -90,7 +90,7 @@ renderInventoryItem:
ply
phy
lda #8
lda #11
clc
jsr DrawSpriteBank
@ -104,7 +104,7 @@ renderInventoryItem_unselected:
adc #ITEM_HEIGHT*160
pha
tay
lda #7
lda #10
jsr DrawSpriteBank
; Render counter

View File

@ -41,8 +41,8 @@ projectileTypes:
.word 3 ; Damage
.word 3 ; Crater radius
.word 4 ; Frame 0
.word 5 ; Frame 1
.word 6 ; Frame 2
.word 6 ; Frame 1
.word 8 ; Frame 2
.word 0,0,0 ; Padding to 16-byte boundary
@ -58,9 +58,9 @@ projectileTypes:
; Fan
.word 3 ; Damage
.word 3 ; Crater radius
.word 9 ; Frame 0
.word 9 ; Frame 1
.word 9 ; Frame 2
.word 12 ; Frame 0
.word 12 ; Frame 1
.word 12 ; Frame 2
.word 0,0,0 ; Padding to 16-byte boundary

View File

@ -2,18 +2,18 @@
DrawSpriteBank :
ASL ; A=Sprite Number ($0000-$0009)
ASL ; A=Sprite Number ($0000-$000D)
TAX ; Y=Target Screen Address ($2000-$9D00)
LDA SpriteBankNum,X ; Relative Sprite Number Table
JMP (SpriteBankBank,X) ; Bank Number Table
SpriteBankNum :
.dbyt $0100,$0000,$0600,$0300,$0400,$0800,$0500,$0700
.dbyt $0900,$0200
.dbyt $0100,$0000,$0900,$0400,$0500,$0800,$0C00,$0B00
.dbyt $0700,$0600,$0A00,$0D00,$0200,$0300
SpriteBankBank :
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
.addr SpriteBankBank00,SpriteBankBank00
.addr SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00,SpriteBankBank00
SpriteBankBank00 :
JSL $AA0000