diff --git a/.gitignore b/.gitignore index 383c4ee..4c40ae8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ HGR.xcodeproj/xcuserdata hgrtest.lst HGR.xcodeproj/project.xcworkspace/xcuserdata/qd.xcuserdatad/UserInterfaceState.xcuserstate /.DS_Store +/hisprite.lst diff --git a/HiSprite.py b/HiSprite.py index c489167..6a7adf6 100755 --- a/HiSprite.py +++ b/HiSprite.py @@ -3,13 +3,15 @@ import sys,os,png class Colors: - black,magenta,green = range(3) - - + black,magenta,green,orange,blue = range(5) + + + def main(argv): if len(argv)<1: - usage() + printHorzontalLookup() + exit(0) pngfile = sys.argv[1] @@ -19,25 +21,145 @@ def main(argv): except: usage() - width = pngdata[0]; - height = pngdata[1]; - pixeldata = pngdata[2]; + width = pngdata[0] + height = pngdata[1] + pixeldata = pngdata[2] + byteWidth = width/2+1+1 # TODO: Calculate a power of two for this + niceName = os.path.splitext(pngfile)[0].upper() - bitmap = [[0 for x in range(width)] for y in range(height)] + disclaimer() - for shift in range(7): - for phase in range(2): - - for row in range(height): - for col in range(width): - (color,half) = pixelRemap(pixeldata,row,col,width,shift,phase) - bitmap[row][col] = color + print "%s: ;%d bytes per row" % (niceName,byteWidth) + print "\tSAVE_AXY" + print "\tldy PARAM0" + print "\tldx MOD7_2,y" + print "\tjmp (%s_JMP,x)\n" % (niceName) + + print "%s_JMP:" % (niceName) + for shift in range(0,7): + print "\t.addr %s_SHIFT%d" % (niceName,shift) + + print "\n" + for shift in range(0,7): + print "%s_SHIFT%d:" % (niceName,shift) + print "\tldy PARAM0\n" + print "\tldx PARAM1" + print rowStartCalculatorCode(); + + spriteChunks = layoutSpriteChunk(pixeldata,width,height,shift) + + for row in range(height): + for chunkIndex in range(len(spriteChunks)): + print spriteChunks[chunkIndex][row] - spriteNum = shift*2+phase - printBitmap(bitmap,os.path.splitext(pngfile)[0].upper(),spriteNum,half,0,phase) - + print "\n" + + +def layoutSpriteChunk(pixeldata,width,height,shift): + + bitmap = [[0 for x in range(width)] for y in range(height)] + + byteWidth = width/2+1+1 # TODO: Calculate a power of two for this + spriteChunks = [["" for y in range(height)] for x in range(byteWidth)] + + for row in range(height): + pixelRow = bitmap[row] + bitStream = "" + + for pixelIndex in range(width): + pixel = pixelColor(pixeldata,row,pixelIndex) + if pixel == Colors.black: + bitStream += "00" + else: + if pixel == Colors.green or pixel == Colors.orange: + bitStream += "01" + else: + bitStream += "10" + + bitStream = shiftStringRight(bitStream,shift) + bitStream = bitStream[:byteWidth*8] + + bitPos = 0 + byteSplits = [0 for x in range(byteWidth)] + + for byteIndex in range(byteWidth): + remainingBits = len(bitStream) - bitPos + + bitChunk = "" + + if remainingBits < 0: + bitChunk = "0000000" + else: + if remainingBits < 7: + bitChunk = bitStream[bitPos:] + bitChunk += fillOutByte(7-remainingBits) + else: + bitChunk = bitStream[bitPos:bitPos+7] + + bitChunk = bitChunk[::-1] + + highBit = "0" + if pixel == Colors.orange or pixel == Colors.blue: + highBit = "1" + + byteSplits[byteIndex] = highBit + bitChunk + bitPos += 7 + + for chunkIndex in range(len(byteSplits)): + if (not byteSplits[chunkIndex].endswith("0000000")): + spriteChunks[chunkIndex][row] = \ + "\tlda #%%%s\n" % byteSplits[chunkIndex] + \ + "\tora (SCRATCH0),y\n" + \ + "\tsta (SCRATCH0),y\n"; + + if chunkIndex == len(byteSplits)-1: + spriteChunks[chunkIndex][row] += "\n" + else: + spriteChunks[chunkIndex][row] += "\tiny" + + if row0 and b==0: + color = Colors.orange return color -def pixelRemap(pixeldata,row,col,width,shift,phase): - halfPixel = 0 - overHalf = 0 +def printHorzontalLookup(): + disclaimer() + + print "DIV7_2:" + for pixel in range(140): + print "\t.byte $%02x" % ((pixel / 7)*2) - origColor = pixelColor(pixeldata,row,col) - - if shift>=width: - overHalf = 1 - shift = shift-width+1 - if phase==0: - halfPixel = 1 + print "\n\nMOD7_2:" + for pixel in range(140): + print "\t.byte $%02x" % ((pixel % 7)*2) - if phase==0: - col = col+shift - else: - col = col-(width-shift) - if origColor==Colors.green: - col = col+1 - if not overHalf: - halfPixel = -1 - - if col >= width or col<0: - return (Colors.black,halfPixel) - - remapColor = pixelColor(pixeldata,row,col) - return (remapColor,halfPixel) - - -def colorString(color,currByteString): - if color==Colors.magenta: - return 'ba' - else: - if color==Colors.green: - return 'ab' - - return '00' - - -def containsGreen(row): - for col in range(len(row)): - if row[col] == Colors.green: - return 1 - - return 0 - - -def printBitmap(bitmap,label,spriteNum,halfShift,highbit,phase): - print "%s%d:" % (label,spriteNum) - for row in range(len(bitmap)): - byteString = "" - - for col in range(len(bitmap[0])): - append = colorString(bitmap[row][col],byteString) - byteString += append - if halfShift>0: - byteString = "0" + byteString[:-1] - else: - if halfShift<0: - byteString = byteString[1:] + "0" - - if len(byteString)>6: - byteString = byteString[:-1] - -# if phase==0: -# byteString = byteString[::-1] - - sys.stdout.write("\t.byte\t%%%d%s\n" % (highbit,byteString)); - - sys.stdout.write('\n\n') - sys.stdout.flush() - - - def usage(): print ''' Usage: HiSprite @@ -134,9 +200,16 @@ Usage: HiSprite PNG file must not have an alpha channel! ''' sys.exit(2) + - +def disclaimer(): + print ''' +; This file was generated by SpriteGenerator.py, a sprite generation tool by Quinn Dunki. +; If you feel the need to modify this file, you are probably doing it wrong. +''' + return if __name__ == "__main__": - main(sys.argv[1:]) \ No newline at end of file + main(sys.argv[1:]) + \ No newline at end of file diff --git a/HGR.xcodeproj/project.pbxproj b/HiSprite.xcodeproj/project.pbxproj similarity index 61% rename from HGR.xcodeproj/project.pbxproj rename to HiSprite.xcodeproj/project.pbxproj index 9d943a5..f1c6afa 100644 --- a/HGR.xcodeproj/project.pbxproj +++ b/HiSprite.xcodeproj/project.pbxproj @@ -7,87 +7,83 @@ objects = { /* 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 = ""; }; - 7090ABA91D4012A600F02EAA /* spritedata0.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = spritedata0.s; sourceTree = ""; }; - 7090ABAB1D41663400F02EAA /* scratch.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = scratch.s; sourceTree = ""; }; - 7090ABAC1D418B8900F02EAA /* spritegen0.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen0.s; sourceTree = ""; }; - 7090ABAD1D418B8900F02EAA /* spritegen1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen1.s; sourceTree = ""; }; - 7090ABAE1D419C3E00F02EAA /* spritedata1.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = spritedata1.s; sourceTree = ""; }; - 7090ABAF1D453FDC00F02EAA /* hgrtable2.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = hgrtable2.s; sourceTree = ""; }; + 701B5E0E1D84810000E6D330 /* macros.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = macros.s; sourceTree = ""; }; + 701B5E0F1D84810000E6D330 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; + 701B5E101D84813500E6D330 /* hisprite.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = hisprite.s; sourceTree = ""; }; + 701B5E111D84817500E6D330 /* HiSprite.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = HiSprite.py; sourceTree = ""; }; + 701B5E121D8481C800E6D330 /* hgrtableX.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = hgrtableX.s; sourceTree = ""; }; + 701B5E131D84820100E6D330 /* spritegen0.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen0.s; sourceTree = ""; }; + 701B5E141D84823300E6D330 /* spritegen1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen1.s; sourceTree = ""; }; + 701B5E151D84823300E6D330 /* spritegen2.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen2.s; sourceTree = ""; }; + 701B5E161D84823300E6D330 /* spritegen3.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen3.s; sourceTree = ""; }; + 701B5E171D84824400E6D330 /* hgrtableY.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = hgrtableY.s; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXGroup section */ - 707005B31D3EC71C00623A10 = { + 701B5E031D8480D200E6D330 = { isa = PBXGroup; children = ( - 707005BE1D3EC75F00623A10 /* Makefile */, - 707005BF1D3EC7FD00623A10 /* hgrtest.s */, - 70166CF81D6E2BE1002F1334 /* macros.s */, - 7090ABAB1D41663400F02EAA /* scratch.s */, - 7090ABA91D4012A600F02EAA /* spritedata0.s */, - 7090ABAE1D419C3E00F02EAA /* spritedata1.s */, - 7090ABAC1D418B8900F02EAA /* spritegen0.s */, - 7090ABAD1D418B8900F02EAA /* spritegen1.s */, - 70166CF91D78BD1B002F1334 /* spritegen2.s */, - 70166CFA1D78BD1B002F1334 /* spritegen3.s */, - 707005C01D3FD65900623A10 /* hgrtable.s */, - 7090ABAF1D453FDC00F02EAA /* hgrtable2.s */, + 701B5E0F1D84810000E6D330 /* Makefile */, + 701B5E111D84817500E6D330 /* HiSprite.py */, + 701B5E0E1D84810000E6D330 /* macros.s */, + 701B5E101D84813500E6D330 /* hisprite.s */, + 701B5E121D8481C800E6D330 /* hgrtableX.s */, + 701B5E171D84824400E6D330 /* hgrtableY.s */, + 701B5E131D84820100E6D330 /* spritegen0.s */, + 701B5E141D84823300E6D330 /* spritegen1.s */, + 701B5E151D84823300E6D330 /* spritegen2.s */, + 701B5E161D84823300E6D330 /* spritegen3.s */, ); sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXLegacyTarget section */ - 707005B81D3EC71C00623A10 /* HGR */ = { + 701B5E081D8480D200E6D330 /* HiSprite */ = { isa = PBXLegacyTarget; buildArgumentsString = "$(ACTION)"; - buildConfigurationList = 707005BB1D3EC71C00623A10 /* Build configuration list for PBXLegacyTarget "HGR" */; + buildConfigurationList = 701B5E0B1D8480D200E6D330 /* Build configuration list for PBXLegacyTarget "HiSprite" */; buildPhases = ( ); buildToolPath = /usr/bin/make; dependencies = ( ); - name = HGR; + name = HiSprite; passBuildSettingsInEnvironment = 1; - productName = HGR; + productName = HiSprite; }; /* End PBXLegacyTarget section */ /* Begin PBXProject section */ - 707005B41D3EC71C00623A10 /* Project object */ = { + 701B5E041D8480D200E6D330 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Quinn Dunki"; TargetAttributes = { - 707005B81D3EC71C00623A10 = { + 701B5E081D8480D200E6D330 = { CreatedOnToolsVersion = 7.3.1; }; }; }; - buildConfigurationList = 707005B71D3EC71C00623A10 /* Build configuration list for PBXProject "HGR" */; + buildConfigurationList = 701B5E071D8480D200E6D330 /* Build configuration list for PBXProject "HiSprite" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, ); - mainGroup = 707005B31D3EC71C00623A10; + mainGroup = 701B5E031D8480D200E6D330; projectDirPath = ""; projectRoot = ""; targets = ( - 707005B81D3EC71C00623A10 /* HGR */, + 701B5E081D8480D200E6D330 /* HiSprite */, ); }; /* End PBXProject section */ /* Begin XCBuildConfiguration section */ - 707005B91D3EC71C00623A10 /* Debug */ = { + 701B5E091D8480D200E6D330 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -128,7 +124,7 @@ }; name = Debug; }; - 707005BA1D3EC71C00623A10 /* Release */ = { + 701B5E0A1D8480D200E6D330 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -162,7 +158,7 @@ }; name = Release; }; - 707005BC1D3EC71C00623A10 /* Debug */ = { + 701B5E0C1D8480D200E6D330 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { DEBUGGING_SYMBOLS = YES; @@ -175,7 +171,7 @@ }; name = Debug; }; - 707005BD1D3EC71C00623A10 /* Release */ = { + 701B5E0D1D8480D200E6D330 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -188,25 +184,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 707005B71D3EC71C00623A10 /* Build configuration list for PBXProject "HGR" */ = { + 701B5E071D8480D200E6D330 /* Build configuration list for PBXProject "HiSprite" */ = { isa = XCConfigurationList; buildConfigurations = ( - 707005B91D3EC71C00623A10 /* Debug */, - 707005BA1D3EC71C00623A10 /* Release */, + 701B5E091D8480D200E6D330 /* Debug */, + 701B5E0A1D8480D200E6D330 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 707005BB1D3EC71C00623A10 /* Build configuration list for PBXLegacyTarget "HGR" */ = { + 701B5E0B1D8480D200E6D330 /* Build configuration list for PBXLegacyTarget "HiSprite" */ = { isa = XCConfigurationList; buildConfigurations = ( - 707005BC1D3EC71C00623A10 /* Debug */, - 707005BD1D3EC71C00623A10 /* Release */, + 701B5E0C1D8480D200E6D330 /* Debug */, + 701B5E0D1D8480D200E6D330 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 707005B41D3EC71C00623A10 /* Project object */; + rootObject = 701B5E041D8480D200E6D330 /* Project object */; } diff --git a/HGR.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/HiSprite.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 71% rename from HGR.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to HiSprite.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 30b70aa..95e1e6f 100644 --- a/HGR.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/HiSprite.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:HiSprite.xcodeproj"> diff --git a/HiSprite.xcodeproj/project.xcworkspace/xcuserdata/qd.xcuserdatad/UserInterfaceState.xcuserstate b/HiSprite.xcodeproj/project.xcworkspace/xcuserdata/qd.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..beaa665 Binary files /dev/null and b/HiSprite.xcodeproj/project.xcworkspace/xcuserdata/qd.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/HiSprite.xcodeproj/xcuserdata/qd.xcuserdatad/xcschemes/HiSprite.xcscheme b/HiSprite.xcodeproj/xcuserdata/qd.xcuserdatad/xcschemes/HiSprite.xcscheme new file mode 100644 index 0000000..a6d6596 --- /dev/null +++ b/HiSprite.xcodeproj/xcuserdata/qd.xcuserdatad/xcschemes/HiSprite.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HiSprite.xcodeproj/xcuserdata/qd.xcuserdatad/xcschemes/xcschememanagement.plist b/HiSprite.xcodeproj/xcuserdata/qd.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..afb39c5 --- /dev/null +++ b/HiSprite.xcodeproj/xcuserdata/qd.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + HiSprite.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 701B5E081D8480D200E6D330 + + primary + + + + + diff --git a/HiSprite2.py b/HiSprite2.py deleted file mode 100755 index f9ed55c..0000000 --- a/HiSprite2.py +++ /dev/null @@ -1,171 +0,0 @@ -#!/usr/bin/python - -import sys,os,png - -class Colors: - black,magenta,green,orange,blue = range(5) - - - -def main(argv): - - if len(argv)<1: - printHorzontalLookup() - exit(0) - - pngfile = sys.argv[1] - - reader = png.Reader(pngfile) - try: - pngdata = reader.asRGB8() - except: - usage() - - width = pngdata[0] - height = pngdata[1] - pixeldata = pngdata[2] - byteWidth = width/2+1+1 # TODO: Calculate a power of two for this - - for shift in range(0,7): - print "%s_SHIFT%d: ;%d bytes per row" % (os.path.splitext(pngfile)[0].upper(),shift,byteWidth) - - spriteChunks = layoutSpriteChunk(pixeldata,width,height,shift) - - for row in range(height): - for chunkIndex in range(len(spriteChunks)): - print spriteChunks[chunkIndex][row] - - print "\n" - - - - -def layoutSpriteChunk(pixeldata,width,height,shift): - - bitmap = [[0 for x in range(width)] for y in range(height)] - - byteWidth = width/2+1+1 # TODO: Calculate a power of two for this - spriteChunks = [["" for y in range(height)] for x in range(byteWidth)] - - for row in range(height): - pixelRow = bitmap[row] - bitStream = "" - - for pixelIndex in range(width): - pixel = pixelColor(pixeldata,row,pixelIndex) - if pixel == Colors.black: - bitStream += "00" - else: - if pixel == Colors.green or pixel == Colors.orange: - bitStream += "01" - else: - bitStream += "10" - - bitStream = shiftStringRight(bitStream,shift) - bitStream = bitStream[:byteWidth*8] - - bitPos = 0 - byteSplits = [0 for x in range(byteWidth)] - - for byteIndex in range(byteWidth): - remainingBits = len(bitStream) - bitPos - - bitChunk = "" - - if remainingBits < 0: - bitChunk = "0000000" - else: - if remainingBits < 7: - bitChunk = bitStream[bitPos:] - bitChunk += fillOutByte(7-remainingBits) - else: - bitChunk = bitStream[bitPos:bitPos+7] - - bitChunk = bitChunk[::-1] - - highBit = "0" - if pixel == Colors.orange or pixel == Colors.blue: - highBit = "1" - - byteSplits[byteIndex] = highBit + bitChunk - bitPos += 7 - - for chunkIndex in range(len(byteSplits)): - spriteChunks[chunkIndex][row] = ".byte %%%s" % byteSplits[chunkIndex] - - return spriteChunks - - - -def fillOutByte(numBits): - filler = "" - for bit in range(numBits): - filler += "0" - - return filler - - -def shiftStringRight(string,shift): - if shift==0: - return string - - shift *=2 - result = "" - - for i in range(shift): - result += "0" - - result += string - return result - - -def pixelColor(pixeldata,row,col): - r = pixeldata[row][col*3] - g = pixeldata[row][col*3+1] - b = pixeldata[row][col*3+2] - color = Colors.black - - if r==255 and g==0 and b==255: - color = Colors.magenta - 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 - - -def printHorzontalLookup(): - print "HGRROWS_GRN:" - for byte in range(40): - pixels = 4 - offset = 0 - if (byte%2): - pixels = 3 - offset = -1 - - for entry in range(pixels): - print "\t.byte $%02x" % (byte + offset) - - print "\nHGRROWS_BITSHIFT_GRN:" - for pixel in range(140): - print "\t.byte $%02x" % ((pixel % 7)*32) # 32 = 4 shifts of 8 bytes - - -def usage(): - print ''' -Usage: HiSprite - -PNG file must not have an alpha channel! -''' - sys.exit(2) - - -if __name__ == "__main__": - main(sys.argv[1:]) - \ No newline at end of file diff --git a/Makefile b/Makefile index c5d81e6..a34e861 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ CL65=cl65 AC=AppleCommander.jar ADDR=6000 -PGM=hgrtest +PGM=hisprite all: $(PGM) diff --git a/V2Make.scpt b/V2Make.scpt index 8c107ae..403811f 100644 Binary files a/V2Make.scpt and b/V2Make.scpt differ diff --git a/hgrtable2.s b/hgrtableX.s similarity index 53% rename from hgrtable2.s rename to hgrtableX.s index cca434f..4aad6ea 100644 --- a/hgrtable2.s +++ b/hgrtableX.s @@ -1,4 +1,8 @@ -HGRROWS_GRN: + +; This file was generated by SpriteGenerator.py, a sprite generation tool by Quinn Dunki. +; If you feel the need to modify this file, you are probably doing it wrong. + +DIV7_2: .byte $00 .byte $00 .byte $00 @@ -140,144 +144,145 @@ HGRROWS_GRN: .byte $26 .byte $26 -HGRROWS_BITSHIFT_GRN: + +MOD7_2: .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c .byte $00 - .byte $20 - .byte $40 - .byte $60 - .byte $80 - .byte $a0 - .byte $c0 + .byte $02 + .byte $04 + .byte $06 + .byte $08 + .byte $0a + .byte $0c diff --git a/hgrtable.s b/hgrtableY.s similarity index 100% rename from hgrtable.s rename to hgrtableY.s diff --git a/hgrtest.s b/hgrtest.s deleted file mode 100644 index dca28f1..0000000 --- a/hgrtest.s +++ /dev/null @@ -1,495 +0,0 @@ -; -; hgrtest.s -; -; Created by Quinn Dunki on 7/19/16 -; Copyright (c) 2015 One Girl, One Laptop Productions. All rights reserved. -; - - -.org $6000 - -.include "macros.s" - -; Softswitches -TEXT = $c050 -HIRES1 = $c057 -HIRES2 = $c058 - - -; ROM entry points -COUT = $fded -ROMWAIT = $fca8 - -; Zero page locations we use (unused by Monitor, Applesoft, or ProDOS) -PARAM0 = $06 -PARAM1 = $07 -PARAM2 = $08 -PARAM3 = $09 -SCRATCH0 = $19 -SCRATCH1 = $1a - -; Macros -.macro BLITBYTE xPos,yPos,addr - lda #xPos - sta PARAM0 - lda #yPos - sta PARAM1 - lda #addr - sta PARAM3 - jsr BlitSpriteOnByte -.endmacro - -.macro BLIT xPos,yPos,addr - lda #xPos - sta PARAM0 - lda #yPos - sta PARAM1 - lda #addr - sta PARAM3 - jsr BlitSprite -.endmacro - - -.macro WAIT - lda #$80 - jsr $fca8 -.endmacro - - - -main: - jsr EnableHires - - lda #$00 - jsr LinearFill - -.if 1 - - ldx #0 -loop: - txa - asl - asl - sta PARAM0 - lda #80 - sta PARAM1 - lda #BOX_MAG_SHIFT0 - 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 - - inx - cpx #35 - bne loop - -.endif -.if 0 - BLITBYTE 0,80,BOX_MAG_SHIFT0_CHUNK0 - BLITBYTE 1,80,BOX_MAG_SHIFT0_CHUNK1 - BLITBYTE 2,80,BOX_MAG_SHIFT0_CHUNK2 - - BLITBYTE 0,90,BOX_MAG_SHIFT1_CHUNK0 - BLITBYTE 1,90,BOX_MAG_SHIFT1_CHUNK1 - BLITBYTE 2,90,BOX_MAG_SHIFT1_CHUNK2 - - BLITBYTE 0,100,BOX_MAG_SHIFT2_CHUNK0 - BLITBYTE 1,100,BOX_MAG_SHIFT2_CHUNK1 - BLITBYTE 2,100,BOX_MAG_SHIFT2_CHUNK2 - - BLITBYTE 0,110,BOX_MAG_SHIFT3_CHUNK0 - BLITBYTE 1,110,BOX_MAG_SHIFT3_CHUNK1 - BLITBYTE 2,110,BOX_MAG_SHIFT3_CHUNK2 - - BLITBYTE 0,120,BOX_MAG_SHIFT4_CHUNK0 - BLITBYTE 1,120,BOX_MAG_SHIFT4_CHUNK1 - BLITBYTE 2,120,BOX_MAG_SHIFT4_CHUNK2 - - BLITBYTE 0,130,BOX_MAG_SHIFT5_CHUNK0 - BLITBYTE 1,130,BOX_MAG_SHIFT5_CHUNK1 - BLITBYTE 2,130,BOX_MAG_SHIFT5_CHUNK2 - - BLITBYTE 0,140,BOX_MAG_SHIFT6_CHUNK0 - BLITBYTE 1,140,BOX_MAG_SHIFT6_CHUNK1 - BLITBYTE 2,140,BOX_MAG_SHIFT6_CHUNK2 - - - - - BLITBYTE 4,80,BOX_GRN_SHIFT0_CHUNK0 - BLITBYTE 5,80,BOX_GRN_SHIFT0_CHUNK1 - BLITBYTE 6,80,BOX_GRN_SHIFT0_CHUNK2 - - BLITBYTE 4,90,BOX_GRN_SHIFT1_CHUNK0 - BLITBYTE 5,90,BOX_GRN_SHIFT1_CHUNK1 - BLITBYTE 6,90,BOX_GRN_SHIFT1_CHUNK2 - - BLITBYTE 4,100,BOX_GRN_SHIFT2_CHUNK0 - BLITBYTE 5,100,BOX_GRN_SHIFT2_CHUNK1 - BLITBYTE 6,100,BOX_GRN_SHIFT2_CHUNK2 - - BLITBYTE 4,110,BOX_GRN_SHIFT3_CHUNK0 - BLITBYTE 5,110,BOX_GRN_SHIFT3_CHUNK1 - BLITBYTE 6,110,BOX_GRN_SHIFT3_CHUNK2 - - BLITBYTE 4,120,BOX_GRN_SHIFT4_CHUNK0 - BLITBYTE 5,120,BOX_GRN_SHIFT4_CHUNK1 - BLITBYTE 6,120,BOX_GRN_SHIFT4_CHUNK2 - - BLITBYTE 4,130,BOX_GRN_SHIFT5_CHUNK0 - BLITBYTE 5,130,BOX_GRN_SHIFT5_CHUNK1 - BLITBYTE 6,130,BOX_GRN_SHIFT5_CHUNK2 - - BLITBYTE 4,140,BOX_GRN_SHIFT6_CHUNK0 - BLITBYTE 5,140,BOX_GRN_SHIFT6_CHUNK1 - BLITBYTE 6,140,BOX_GRN_SHIFT6_CHUNK2 - -.endif - - -.if 0 - BLITBYTE 20,80,MAG0 - BLITBYTE 21,80,MAG1 - - BLITBYTE 20,90,MAG2 - BLITBYTE 21,90,MAG3 - - BLITBYTE 20,100,MAG4 - BLITBYTE 21,100,MAG5 - - BLITBYTE 20,110,MAG6 - BLITBYTE 21,110,MAG7 - - BLITBYTE 21,120,MAG8 - BLITBYTE 22,120,MAG9 - - BLITBYTE 21,130,MAG10 - BLITBYTE 22,130,MAG11 - - BLITBYTE 21,140,MAG12 - BLITBYTE 22,140,MAG13 -.endif - -.if 0 - - BLITBYTE 22,80,GRN0 - BLITBYTE 23,80,GRN1 - - BLITBYTE 22,90,GRN2 - BLITBYTE 23,90,GRN3 - - BLITBYTE 22,100,GRN4 - BLITBYTE 23,100,GRN5 - - BLITBYTE 22,110,GRN6 - BLITBYTE 23,110,GRN7 - - BLITBYTE 23,120,GRN8 - BLITBYTE 24,120,GRN9 - - BLITBYTE 23,130,GRN10 - BLITBYTE 24,130,GRN11 - - BLITBYTE 23,140,GRN12 - BLITBYTE 24,140,GRN13 -.endif - - -.if 0 - BLITBYTE 20,80,BOX_MAG0 - BLITBYTE 21,80,BOX_MAG1 - - BLITBYTE 20,90,BOX_MAG2 - BLITBYTE 21,90,BOX_MAG3 - - BLITBYTE 20,100,BOX_MAG4 - BLITBYTE 21,100,BOX_MAG5 - - BLITBYTE 20,110,BOX_MAG6 - BLITBYTE 21,110,BOX_MAG7 - - BLITBYTE 21,120,BOX_MAG8 - BLITBYTE 22,120,BOX_MAG9 - - BLITBYTE 21,130,BOX_MAG10 - BLITBYTE 22,130,BOX_MAG11 - - BLITBYTE 21,140,BOX_MAG12 - BLITBYTE 22,140,BOX_MAG13 -.endif - -.if 0 - BLITBYTE 20,80,BOX_GRN0 - - BLITBYTE 20,90,BOX_GRN1 - BLITBYTE 21,90,BOX_GRN2 - - BLITBYTE 20,100,BOX_GRN3 - BLITBYTE 21,100,BOX_GRN4 - - BLITBYTE 20,110,BOX_GRN5 - BLITBYTE 21,110,BOX_GRN6 - - BLITBYTE 21,120,BOX_GRN7 - BLITBYTE 22,120,BOX_GRN8 - - BLITBYTE 21,130,BOX_GRN9 - BLITBYTE 22,130,BOX_GRN10 - - BLITBYTE 21,140,BOX_GRN11 - BLITBYTE 22,140,BOX_GRN12 -.endif - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -.if 0 - BLITBYTE 20,80,BOX0 - WAIT - BLITBYTE 20,80,BLACK - - BLITBYTE 20,80,BOX1 - BLITBYTE 21,80,BOX2 - WAIT - BLITBYTE 20,80,BLACK - BLITBYTE 21,80,BLACK - - BLITBYTE 20,80,BOX3 - BLITBYTE 21,80,BOX4 - WAIT - BLITBYTE 20,80,BLACK - BLITBYTE 21,80,BLACK - - BLITBYTE 20,80,BOX5 - BLITBYTE 21,80,BOX6 - WAIT - BLITBYTE 20,80,BLACK - BLITBYTE 21,80,BLACK - - BLITBYTE 21,80,BOX7 - BLITBYTE 22,80,BOX8 - WAIT - BLITBYTE 21,80,BLACK - BLITBYTE 22,80,BLACK - - BLITBYTE 21,80,BOX9 - BLITBYTE 22,80,BOX10 - WAIT - BLITBYTE 21,80,BLACK - BLITBYTE 22,80,BLACK - - BLITBYTE 21,80,BOX11 - BLITBYTE 22,80,BOX12 - WAIT - BLITBYTE 21,80,BLACK - BLITBYTE 22,80,BLACK - - BLITBYTE 22,80,BOX0 - WAIT - BLITBYTE 22,80,BLACK - - jmp loop -.endif - - - rts - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; BlitSprite -; Trashes everything, including parameters -; PARAM0: X Pos -; PARAM1: Y Pos -; PARAM2: Sprite Ptr LSB -; PARAM3: Sprite Ptr MSB -; -BlitSprite: - SAVE_AXY - - clc ; Compute sprite data base - ldx PARAM0 - lda HGRROWS_BITSHIFT_GRN,x - adc PARAM2 - sta PARAM2 - lda #0 - adc PARAM3 - sta PARAM3 - - lda #7 - sta SCRATCH0 ; Tracks row index - - asl ; Multiply by byte width - asl - sta SCRATCH1 ; Tracks total bytes - ldy #0 - -blitSprite_Yloop: - clc ; Calculate Y line on screen - lda SCRATCH0 - adc PARAM1 - tax - - lda HGRROWS_H,x ; Compute hires row - sta blitSprite_smc+2 ; Self-modifying code - sta blitSprite_smc+5 - lda HGRROWS_L,x - sta blitSprite_smc+1 - sta blitSprite_smc+4 - - ldx PARAM0 ; Compute hires horizontal byte - lda HGRROWS_GRN,x - tax - -blitSprite_Xloop: - lda (PARAM2),y - -blitSprite_smc: - ora $2000,x - sta $2000,x - inx - iny - tya ; End of row? - and #$03 ; If last two bits are zero, we've wrapped a row - bne blitSprite_Xloop - - dec SCRATCH0 - bpl blitSprite_Yloop - - RESTORE_AXY - rts - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; BlitSpriteOnByte -; Trashes everything -; PARAM0: X Byte -; PARAM1: Y Pos -; PARAM2: Sprite Ptr MSB -; PARAM3: Sprite Ptr LSB -; -BlitSpriteOnByte: - ldy #7 - -blitSpriteOnByte_loop: - clc - tya - adc PARAM1 ; Calculate Y line - tax - - lda HGRROWS_H,x ; Compute hires row - sta blitSpriteOnByte_smc+2 - lda HGRROWS_L,x - sta blitSpriteOnByte_smc+1 - - ldx PARAM0 ; Compute hires column - lda (PARAM2),y - -blitSpriteOnByte_smc: - sta $2000,x - dey - bpl blitSpriteOnByte_loop - rts - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; EnableHires -; Trashes A -; -EnableHires: - lda TEXT - lda HIRES1 - lda HIRES2 - rts - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; LinearFill -; A: Byte value to fill -; Trashes all registers -; -LinearFill: - ldx #0 - -linearFill_outer: - pha - lda HGRROWS_H,x - sta linearFill_inner+2 - lda HGRROWS_L,x - sta linearFill_inner+1 - pla - - ldy #39 -linearFill_inner: - sta $2000,y - dey - bpl linearFill_inner - - inx - cpx #192 - bne linearFill_outer - rts - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; VenetianFill -; A: Byte value to fill -; Trashes all registers -; -VenetianFill: - ldx #$3f -venetianFill_outer: - stx venetianFill_inner+2 - ldy #$00 -venetianFill_inner: - sta $2000,y ; Upper byte of address is self-modified - iny - bne venetianFill_inner - dex - cpx #$1f - bne venetianFill_outer - rts - - -.include "hgrtable.s" -.include "hgrtable2.s" -.include "spritedata0.s" -.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 -.SEGMENT "ZPSAVE" -.SEGMENT "EXEHDR" -.SEGMENT "STARTUP" -.SEGMENT "INIT" -.SEGMENT "LOWCODE" diff --git a/hgrtest.dsk b/hisprite.dsk similarity index 86% rename from hgrtest.dsk rename to hisprite.dsk index 1d62972..99326ec 100644 Binary files a/hgrtest.dsk and b/hisprite.dsk differ diff --git a/hisprite.s b/hisprite.s new file mode 100644 index 0000000..c402ea0 --- /dev/null +++ b/hisprite.s @@ -0,0 +1,166 @@ +; +; hgrtest.s +; +; Created by Quinn Dunki on 7/19/16 +; Copyright (c) 2015 One Girl, One Laptop Productions. All rights reserved. +; + + +.org $6000 + +.include "macros.s" + +; Softswitches +TEXT = $c050 +HIRES1 = $c057 +HIRES2 = $c058 + + +; ROM entry points +COUT = $fded +ROMWAIT = $fca8 + +; Zero page locations we use (unused by Monitor, Applesoft, or ProDOS) +PARAM0 = $06 +PARAM1 = $07 +PARAM2 = $08 +PARAM3 = $09 +SCRATCH0 = $19 +SCRATCH1 = $1a + +; Macros +.macro BLITBYTE xPos,yPos,addr + lda #xPos + sta PARAM0 + lda #yPos + sta PARAM1 + lda #addr + sta PARAM3 + jsr BlitSpriteOnByte +.endmacro + +.macro BLIT xPos,yPos,addr + lda #xPos + sta PARAM0 + lda #yPos + sta PARAM1 + lda #addr + sta PARAM3 + jsr BlitSprite +.endmacro + + +.macro WAIT + lda #$80 + jsr $fca8 +.endmacro + + + +main: + jsr EnableHires + + lda #$00 + jsr LinearFill + + ldx #0 +loop: + txa + asl + asl + sta PARAM0 + lda #0 + sta PARAM1 + jsr BOX_MAG + + lda #88 + sta PARAM1 + jsr BOX_GRN + + lda #96 + sta PARAM1 + jsr BOX_ORG + + lda #184 + sta PARAM1 + jsr BOX_BLU + + inx + cpx #35 + bne loop + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; EnableHires +; Trashes A +; +EnableHires: + lda TEXT + lda HIRES1 + lda HIRES2 + rts + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; LinearFill +; A: Byte value to fill +; Trashes all registers +; +LinearFill: + ldx #0 + +linearFill_outer: + pha + lda HGRROWS_H,x + sta linearFill_inner+2 + lda HGRROWS_L,x + sta linearFill_inner+1 + pla + + ldy #39 +linearFill_inner: + sta $2000,y + dey + bpl linearFill_inner + + inx + cpx #192 + bne linearFill_outer + rts + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; VenetianFill +; A: Byte value to fill +; Trashes all registers +; +VenetianFill: + ldx #$3f +venetianFill_outer: + stx venetianFill_inner+2 + ldy #$00 +venetianFill_inner: + sta $2000,y ; Upper byte of address is self-modified + iny + bne venetianFill_inner + dex + cpx #$1f + bne venetianFill_outer + rts + + +.include "hgrtableX.s" +.include "hgrtableY.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 +.SEGMENT "ZPSAVE" +.SEGMENT "EXEHDR" +.SEGMENT "STARTUP" +.SEGMENT "INIT" +.SEGMENT "LOWCODE" diff --git a/scratch.s b/scratch.s deleted file mode 100644 index 4623d61..0000000 --- a/scratch.s +++ /dev/null @@ -1,19 +0,0 @@ -BOX0: - .byte %00101010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00101010 - -BOX1: - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 diff --git a/spritedata0.s b/spritedata0.s deleted file mode 100644 index e62f8dc..0000000 --- a/spritedata0.s +++ /dev/null @@ -1,162 +0,0 @@ -; -; spritedata.s -; -; Created by Quinn Dunki on 7/19/16 -; Copyright (c) 2015 One Girl, One Laptop Productions. All rights reserved. -; - -MAG0: - .byte %01010101 ; Byte aligned - .byte %01000001 ; (reversed) - .byte %01000001 - .byte %01000001 ;;;;;;;;;;;;;;;;;;;; - .byte %01000001 - .byte %01000001 - .byte %01000001 - .byte %01010101 - -MAG1: - .byte %00000000 ; Byte aligned - .byte %00000000 ; (2nd byte, reversed) - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 - -MAG2: - .byte %01010100 ; One pixel shift - .byte %00000100 ; (reversed) - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %01010100 - -MAG3: - .byte %00000010 ; One pixel shift - .byte %00000010 ; (2nd byte, reversed) - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - - -MAG4: - .byte %01010000 ; Two pixel shift - .byte %00010000 ; (reversed) - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %01010000 - -MAG5: - .byte %00001010 ; Two pixel shift - .byte %00001000 ; (2nd byte, reversed) - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00001010 - - -MAG6: - .byte %01000000 ; Three pixel shift - .byte %01000000 ; (reversed) - .byte %01000000 - .byte %01000000 - .byte %01000000 - .byte %01000000 - .byte %01000000 - .byte %01000000 - -MAG7: - .byte %00101010 ; Three pixel shift - .byte %00100000 ; (2nd byte, reversed) - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00101010 - - -MAG8: - .byte %00101010 ; Four pixel shift - .byte %00000010 ; (reversed) - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00101010 - -MAG9: - .byte %00000001 ; Four pixel shift - .byte %00000001 ; (2nd byte, reversed) - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 - - -MAG10: - .byte %00101000 ; Five pixel shift - .byte %00001000 ; (reversed) - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00101000 - -MAG11: - .byte %00000101 ; Five pixel shift - .byte %00000100 ; (2nd byte, reversed) - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %00000101 - - -MAG12: - .byte %00100000 ; Six pixel shift - .byte %00100000 ; (2nd byte, reversed) - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00100000 - -MAG13: - .byte %00010101 ; Six pixel shift - .byte %00010000 ; (reversed) - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %00010101 - - -BLACK: - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 diff --git a/spritedata1.s b/spritedata1.s deleted file mode 100644 index a7953b2..0000000 --- a/spritedata1.s +++ /dev/null @@ -1,152 +0,0 @@ -; -; spritedata.s -; -; Created by Quinn Dunki on 7/19/16 -; Copyright (c) 2015 One Girl, One Laptop Productions. All rights reserved. -; - -GRN0: - .byte %00101010 ; Byte aligned - .byte %00000010 ; (reversed) - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00101010 - -GRN1: - .byte %00000001 ; Byte aligned - .byte %00000001 ; (2nd byte, reversed) - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 - .byte %00000001 - -GRN2: - .byte %00101000 ; One pixel shift - .byte %00001000 ; (reversed) - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00101000 - -GRN3: - .byte %00000101 ; One pixel shift - .byte %00000100 ; (2nd byte, reversed) - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %00000101 - - -GRN4: - .byte %00100000 ; Two pixel shift - .byte %00100000 ; (reversed) - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00100000 - -GRN5: - .byte %00010101 ; Two pixel shift - .byte %00010000 ; (2nd byte, reversed) - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %00010101 - - -GRN6: - .byte %00000000 ; Three pixel shift - .byte %00000000 ; (reversed) - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 - .byte %00000000 - -GRN7: - .byte %01010101 ; Three pixel shift - .byte %01000001 ; (2nd byte, reversed) - .byte %01000001 - .byte %01000001 ;;;;;;;;;;;;;;;;;;;; - .byte %01000001 - .byte %01000001 - .byte %01000001 - .byte %01010101 - - -GRN8: - .byte %01010100 ; Four pixel shift - .byte %00000100 ; (reversed) - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %00000100 - .byte %01010100 - -GRN9: - .byte %00000010 ; Four pixel shift - .byte %00000010 ; (2nd byte, reversed) - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - .byte %00000010 - - -GRN10: - .byte %01010000 ; Five pixel shift - .byte %00010000 ; (reversed) - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %00010000 - .byte %01010000 - -GRN11: - .byte %00001010 ; Five pixel shift - .byte %00001000 ; (2nd byte, reversed) - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00001000 - .byte %00001010 - - -GRN12: - .byte %01000000 ; Six pixel shift - .byte %01000000 ; (2nd byte, reversed) - .byte %01000000 - .byte %01000000 - .byte %01000000 - .byte %01000000 - .byte %01000000 - .byte %01000000 - -GRN13: - .byte %00101010 ; Six pixel shift - .byte %00100000 ; (reversed) - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00100000 - .byte %00101010 - diff --git a/spritegen0.s b/spritegen0.s index a84acad..7724ad0 100644 --- a/spritegen0.s +++ b/spritegen0.s @@ -1,245 +1,1116 @@ -BOX_MAG_SHIFT0: ;4 bytes per row -.byte %01010101 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01010101 -.byte %00000000 -.byte %00000000 -.byte %00000000 + +; This file was generated by SpriteGenerator.py, a sprite generation tool by Quinn Dunki. +; If you feel the need to modify this file, you are probably doing it wrong. + +BOX_MAG: ;4 bytes per row + SAVE_AXY + ldy PARAM0 + ldx MOD7_2,y + jmp (BOX_MAG_JMP,x) + +BOX_MAG_JMP: + .addr BOX_MAG_SHIFT0 + .addr BOX_MAG_SHIFT1 + .addr BOX_MAG_SHIFT2 + .addr BOX_MAG_SHIFT3 + .addr BOX_MAG_SHIFT4 + .addr BOX_MAG_SHIFT5 + .addr BOX_MAG_SHIFT6 -BOX_MAG_SHIFT1: ;4 bytes per row -.byte %01010100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %01010100 -.byte %00000010 -.byte %00000000 -.byte %00000000 +BOX_MAG_SHIFT0: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + RESTORE_AXY + rts -BOX_MAG_SHIFT2: ;4 bytes per row -.byte %01010000 -.byte %00001010 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %01010000 -.byte %00001010 -.byte %00000000 -.byte %00000000 + +BOX_MAG_SHIFT1: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01010100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01010100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -BOX_MAG_SHIFT3: ;4 bytes per row -.byte %01000000 -.byte %00101010 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00101010 -.byte %00000000 -.byte %00000000 + +BOX_MAG_SHIFT2: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -BOX_MAG_SHIFT4: ;4 bytes per row -.byte %00000000 -.byte %00101010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00101010 -.byte %00000001 -.byte %00000000 + +BOX_MAG_SHIFT3: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -BOX_MAG_SHIFT5: ;4 bytes per row -.byte %00000000 -.byte %00101000 -.byte %00000101 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00101000 -.byte %00000101 -.byte %00000000 + +BOX_MAG_SHIFT4: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts -BOX_MAG_SHIFT6: ;4 bytes per row -.byte %00000000 -.byte %00100000 -.byte %00010101 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010101 -.byte %00000000 + +BOX_MAG_SHIFT5: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00101000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00101000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts + + + +BOX_MAG_SHIFT6: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts + diff --git a/spritegen1.s b/spritegen1.s index 7bfa392..acfee28 100644 --- a/spritegen1.s +++ b/spritegen1.s @@ -1,245 +1,1116 @@ -BOX_GRN_SHIFT0: ;4 bytes per row -.byte %00101010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00000010 -.byte %00000001 -.byte %00000000 -.byte %00000000 -.byte %00101010 -.byte %00000001 -.byte %00000000 -.byte %00000000 + +; This file was generated by SpriteGenerator.py, a sprite generation tool by Quinn Dunki. +; If you feel the need to modify this file, you are probably doing it wrong. + +BOX_GRN: ;4 bytes per row + SAVE_AXY + ldy PARAM0 + ldx MOD7_2,y + jmp (BOX_GRN_JMP,x) + +BOX_GRN_JMP: + .addr BOX_GRN_SHIFT0 + .addr BOX_GRN_SHIFT1 + .addr BOX_GRN_SHIFT2 + .addr BOX_GRN_SHIFT3 + .addr BOX_GRN_SHIFT4 + .addr BOX_GRN_SHIFT5 + .addr BOX_GRN_SHIFT6 -BOX_GRN_SHIFT1: ;4 bytes per row -.byte %00101000 -.byte %00000101 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00001000 -.byte %00000100 -.byte %00000000 -.byte %00000000 -.byte %00101000 -.byte %00000101 -.byte %00000000 -.byte %00000000 +BOX_GRN_SHIFT0: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -BOX_GRN_SHIFT2: ;4 bytes per row -.byte %00100000 -.byte %00010101 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010000 -.byte %00000000 -.byte %00000000 -.byte %00100000 -.byte %00010101 -.byte %00000000 -.byte %00000000 + +BOX_GRN_SHIFT1: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00101000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00101000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -BOX_GRN_SHIFT3: ;4 bytes per row -.byte %00000000 -.byte %01010101 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01000001 -.byte %00000000 -.byte %00000000 -.byte %00000000 -.byte %01010101 -.byte %00000000 -.byte %00000000 + +BOX_GRN_SHIFT2: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -BOX_GRN_SHIFT4: ;4 bytes per row -.byte %00000000 -.byte %01010100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %00000100 -.byte %00000010 -.byte %00000000 -.byte %00000000 -.byte %01010100 -.byte %00000010 -.byte %00000000 + +BOX_GRN_SHIFT3: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -BOX_GRN_SHIFT5: ;4 bytes per row -.byte %00000000 -.byte %01010000 -.byte %00001010 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %00010000 -.byte %00001000 -.byte %00000000 -.byte %00000000 -.byte %01010000 -.byte %00001010 -.byte %00000000 + +BOX_GRN_SHIFT4: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01010100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01010100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts -BOX_GRN_SHIFT6: ;4 bytes per row -.byte %00000000 -.byte %01000000 -.byte %00101010 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00100000 -.byte %00000000 -.byte %00000000 -.byte %01000000 -.byte %00101010 -.byte %00000000 + +BOX_GRN_SHIFT5: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%00010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00001010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts + + + +BOX_GRN_SHIFT6: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%01000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%00101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts + diff --git a/spritegen2.s b/spritegen2.s index 7aab545..25a3ac7 100644 --- a/spritegen2.s +++ b/spritegen2.s @@ -1,245 +1,1116 @@ -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 + +; This file was generated by SpriteGenerator.py, a sprite generation tool by Quinn Dunki. +; If you feel the need to modify this file, you are probably doing it wrong. + +BOX_BLU: ;4 bytes per row + SAVE_AXY + ldy PARAM0 + ldx MOD7_2,y + jmp (BOX_BLU_JMP,x) + +BOX_BLU_JMP: + .addr BOX_BLU_SHIFT0 + .addr BOX_BLU_SHIFT1 + .addr BOX_BLU_SHIFT2 + .addr BOX_BLU_SHIFT3 + .addr BOX_BLU_SHIFT4 + .addr BOX_BLU_SHIFT5 + .addr BOX_BLU_SHIFT6 -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_SHIFT0: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + iny + + RESTORE_AXY + rts -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_SHIFT1: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11010100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11010100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -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_SHIFT2: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -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_SHIFT3: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -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_SHIFT4: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts -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 + +BOX_BLU_SHIFT5: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10101000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10101000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts + + + +BOX_BLU_SHIFT6: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts + diff --git a/spritegen3.s b/spritegen3.s index 3eb6284..24b814c 100644 --- a/spritegen3.s +++ b/spritegen3.s @@ -1,245 +1,1116 @@ -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 + +; This file was generated by SpriteGenerator.py, a sprite generation tool by Quinn Dunki. +; If you feel the need to modify this file, you are probably doing it wrong. + +BOX_ORG: ;4 bytes per row + SAVE_AXY + ldy PARAM0 + ldx MOD7_2,y + jmp (BOX_ORG_JMP,x) + +BOX_ORG_JMP: + .addr BOX_ORG_SHIFT0 + .addr BOX_ORG_SHIFT1 + .addr BOX_ORG_SHIFT2 + .addr BOX_ORG_SHIFT3 + .addr BOX_ORG_SHIFT4 + .addr BOX_ORG_SHIFT5 + .addr BOX_ORG_SHIFT6 -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_SHIFT0: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -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_SHIFT1: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10101000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10101000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -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_SHIFT2: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -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_SHIFT3: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000001 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11010101 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + iny + + RESTORE_AXY + rts -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_SHIFT4: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11010100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10000100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11010100 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10000010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts -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 + +BOX_ORG_SHIFT5: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%10010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11010000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10001010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts + + + +BOX_ORG_SHIFT6: + ldy PARAM0 + + ldx PARAM1 + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10100000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + inx + lda HGRROWS_H,x + sta SCRATCH1 + lda HGRROWS_L,x + sta SCRATCH0 + ldy PARAM0 + lda DIV7_2,y + tay + + iny + lda #%11000000 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + lda #%10101010 + ora (SCRATCH0),y + sta (SCRATCH0),y + iny + + RESTORE_AXY + rts +