From 2d1a5c6f3402a2e7e7d221478cf15a2a17e325b1 Mon Sep 17 00:00:00 2001 From: Quinn Dunki Date: Thu, 1 Sep 2016 13:13:27 -0700 Subject: [PATCH] All basic colors working --- HGR.xcodeproj/project.pbxproj | 4 + HiSprite2.py | 16 ++- box_blu.png | Bin 0 -> 164 bytes box_org.png | Bin 0 -> 165 bytes hgrtest.dsk | Bin 143360 -> 143360 bytes hgrtest.s | 26 ++++ spritegen2.s | 245 ++++++++++++++++++++++++++++++++++ spritegen3.s | 245 ++++++++++++++++++++++++++++++++++ 8 files changed, 533 insertions(+), 3 deletions(-) create mode 100644 box_blu.png create mode 100644 box_org.png create mode 100644 spritegen2.s create mode 100644 spritegen3.s diff --git a/HGR.xcodeproj/project.pbxproj b/HGR.xcodeproj/project.pbxproj index c79f1ba..9d943a5 100644 --- a/HGR.xcodeproj/project.pbxproj +++ b/HGR.xcodeproj/project.pbxproj @@ -8,6 +8,8 @@ /* Begin PBXFileReference section */ 70166CF81D6E2BE1002F1334 /* macros.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = macros.s; sourceTree = ""; }; + 70166CF91D78BD1B002F1334 /* spritegen2.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen2.s; sourceTree = ""; }; + 70166CFA1D78BD1B002F1334 /* spritegen3.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen3.s; sourceTree = ""; }; 707005BE1D3EC75F00623A10 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; 707005BF1D3EC7FD00623A10 /* hgrtest.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = hgrtest.s; sourceTree = ""; }; 707005C01D3FD65900623A10 /* hgrtable.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = hgrtable.s; sourceTree = ""; }; @@ -31,6 +33,8 @@ 7090ABAE1D419C3E00F02EAA /* spritedata1.s */, 7090ABAC1D418B8900F02EAA /* spritegen0.s */, 7090ABAD1D418B8900F02EAA /* spritegen1.s */, + 70166CF91D78BD1B002F1334 /* spritegen2.s */, + 70166CFA1D78BD1B002F1334 /* spritegen3.s */, 707005C01D3FD65900623A10 /* hgrtable.s */, 7090ABAF1D453FDC00F02EAA /* hgrtable2.s */, ); diff --git a/HiSprite2.py b/HiSprite2.py index 8270d1f..f9ed55c 100755 --- a/HiSprite2.py +++ b/HiSprite2.py @@ -3,7 +3,7 @@ import sys,os,png class Colors: - black,magenta,green = range(3) + black,magenta,green,orange,blue = range(5) @@ -56,7 +56,7 @@ def layoutSpriteChunk(pixeldata,width,height,shift): if pixel == Colors.black: bitStream += "00" else: - if pixel == Colors.green: + if pixel == Colors.green or pixel == Colors.orange: bitStream += "01" else: bitStream += "10" @@ -83,7 +83,11 @@ def layoutSpriteChunk(pixeldata,width,height,shift): bitChunk = bitChunk[::-1] - byteSplits[byteIndex] = "0" + bitChunk + highBit = "0" + if pixel == Colors.orange or pixel == Colors.blue: + highBit = "1" + + byteSplits[byteIndex] = highBit + bitChunk bitPos += 7 for chunkIndex in range(len(byteSplits)): @@ -126,6 +130,12 @@ def pixelColor(pixeldata,row,col): else: if r==0 and g==255 and b==0: color = Colors.green + else: + if r==0 and g==0 and b==255: + color = Colors.blue + else: + if r==255 and g>0 and b==0: + color = Colors.orange return color diff --git a/box_blu.png b/box_blu.png new file mode 100644 index 0000000000000000000000000000000000000000..27c623283304060ddfd6b964cca762534249dbbc GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^EI`b`!2~1&15bhkI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sf15QR^O#|V>Y!N^q+02lL66gHf+|;}hAeVu`xhOTUBsE2$JhLQ2!QIn0AVn{g z9Vjm4>Eal|aXmRD;m7#~mIrhG`Td`*W&5+C5$UT-G@yGywpr Cp(+Fb literal 0 HcmV?d00001 diff --git a/box_org.png b/box_org.png new file mode 100644 index 0000000000000000000000000000000000000000..1b3ba575c5d6de47afbf081740061d4ad681f946 GIT binary patch literal 165 zcmeAS@N?(olHy`uVBq!ia0vp^EI`b`!2~1&15bhkI14-?iy0WWg+Z8+Vb&Z8pdfpR zr>`sf15QR^O}2^;InI~`f;K>9sh{an^LB{Ts5 D3}Gqc literal 0 HcmV?d00001 diff --git a/hgrtest.dsk b/hgrtest.dsk index 84754e1dc40530b0d486271de6e734003dc52e8c..1d629726a063cb4d7554080c3c059e437e8e60b9 100644 GIT binary patch delta 799 zcmZp8z|ru4V?#Q(z#n!7MMZ9228PEB2_VMia_&yI`i2D)8nEN34XYX(8k%rmklc#a zhK7z7>=-1sU@8uyK~@6g8m>0fH#8gsGO*#RK=CV04Gk?gFi7q~S3|>u4(u2tcVHC| zFTjCUH83zRGEANrYFiJo3!582VsvnadjmDXnt^HZ#Zd9dZ$d>T$A{=o)(=@S`Er=< z`L&s6(zBZZ7)aiWZhV4(LV{j6B2qSC+yvm*xR4b zJ1GGuRWms@RxuPPvj;4^8z{DsV=jY2hrrW>wE+j#h96iPaRBHbkG()O_rYrJC1fm6 tp9xa(>&1fu7oH|8vhVwpuz&$5bmGFVQxD`Xd`M7G(a>p%TNcN72>`YDgYN(U delta 289 zcmZp8z|ru4V?#Q(06!aptfCeV1H)s61Q26$Id`YqVh3hMUIzsR1~{IqC~$wW0F%gM z-H^+Z_lN3E)(yQpIXOghazO~oWXTYb$%0|&lc$8`OtuK+namTaI9WIR@}w}`#f(gh ziz1mP>&9H36t1hQFePCngTlOoMGReBT&-*?16tWv`nPhdOljp*P)T_4K>5P+1dm%$ z63f{3-cFhv6)P=zKA|@`p*JmIZ+~KMQbKQP0#M3-a#yTkC{U&!EZhea+sHAOL7_w7 zX~Noo18c(%tc^GTw8LXBP|YT=nvDq=3)E+Vl>B<};J}5a35)FejwUQ%01BPB@axnA W`3oNs6jU^HCdKGB#Vw0tyaWI)?QvHC diff --git a/hgrtest.s b/hgrtest.s index 24f5a30..dca28f1 100644 --- a/hgrtest.s +++ b/hgrtest.s @@ -83,6 +83,30 @@ loop: sta PARAM3 jsr BlitSprite + lda #88 + sta PARAM1 + lda #BOX_GRN_SHIFT0 + sta PARAM3 + jsr BlitSprite + + lda #96 + sta PARAM1 + lda #BOX_BLU_SHIFT0 + sta PARAM3 + jsr BlitSprite + + lda #104 + sta PARAM1 + lda #BOX_ORG_SHIFT0 + sta PARAM3 + jsr BlitSprite + ; lda #$ff ; jsr ROMWAIT @@ -459,6 +483,8 @@ venetianFill_inner: .include "spritedata1.s" .include "spritegen0.s" .include "spritegen1.s" +.include "spritegen2.s" +.include "spritegen3.s" ; Suppress some linker warnings - Must be the last thing in the file diff --git a/spritegen2.s b/spritegen2.s new file mode 100644 index 0000000..7aab545 --- /dev/null +++ b/spritegen2.s @@ -0,0 +1,245 @@ +BOX_BLU_SHIFT0: ;4 bytes per row +.byte %11010101 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11010101 +.byte %10000000 +.byte %10000000 +.byte %10000000 + + +BOX_BLU_SHIFT1: ;4 bytes per row +.byte %11010100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %11010100 +.byte %10000010 +.byte %10000000 +.byte %10000000 + + +BOX_BLU_SHIFT2: ;4 bytes per row +.byte %11010000 +.byte %10001010 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %11010000 +.byte %10001010 +.byte %10000000 +.byte %10000000 + + +BOX_BLU_SHIFT3: ;4 bytes per row +.byte %11000000 +.byte %10101010 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10101010 +.byte %10000000 +.byte %10000000 + + +BOX_BLU_SHIFT4: ;4 bytes per row +.byte %10000000 +.byte %10101010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10101010 +.byte %10000001 +.byte %10000000 + + +BOX_BLU_SHIFT5: ;4 bytes per row +.byte %10000000 +.byte %10101000 +.byte %10000101 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10101000 +.byte %10000101 +.byte %10000000 + + +BOX_BLU_SHIFT6: ;4 bytes per row +.byte %10000000 +.byte %10100000 +.byte %10010101 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010101 +.byte %10000000 + + diff --git a/spritegen3.s b/spritegen3.s new file mode 100644 index 0000000..3eb6284 --- /dev/null +++ b/spritegen3.s @@ -0,0 +1,245 @@ +BOX_ORG_SHIFT0: ;4 bytes per row +.byte %10101010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10000010 +.byte %10000001 +.byte %10000000 +.byte %10000000 +.byte %10101010 +.byte %10000001 +.byte %10000000 +.byte %10000000 + + +BOX_ORG_SHIFT1: ;4 bytes per row +.byte %10101000 +.byte %10000101 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10001000 +.byte %10000100 +.byte %10000000 +.byte %10000000 +.byte %10101000 +.byte %10000101 +.byte %10000000 +.byte %10000000 + + +BOX_ORG_SHIFT2: ;4 bytes per row +.byte %10100000 +.byte %10010101 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010000 +.byte %10000000 +.byte %10000000 +.byte %10100000 +.byte %10010101 +.byte %10000000 +.byte %10000000 + + +BOX_ORG_SHIFT3: ;4 bytes per row +.byte %10000000 +.byte %11010101 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11000001 +.byte %10000000 +.byte %10000000 +.byte %10000000 +.byte %11010101 +.byte %10000000 +.byte %10000000 + + +BOX_ORG_SHIFT4: ;4 bytes per row +.byte %10000000 +.byte %11010100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %10000100 +.byte %10000010 +.byte %10000000 +.byte %10000000 +.byte %11010100 +.byte %10000010 +.byte %10000000 + + +BOX_ORG_SHIFT5: ;4 bytes per row +.byte %10000000 +.byte %11010000 +.byte %10001010 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %10010000 +.byte %10001000 +.byte %10000000 +.byte %10000000 +.byte %11010000 +.byte %10001010 +.byte %10000000 + + +BOX_ORG_SHIFT6: ;4 bytes per row +.byte %10000000 +.byte %11000000 +.byte %10101010 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10100000 +.byte %10000000 +.byte %10000000 +.byte %11000000 +.byte %10101010 +.byte %10000000 + +