This commit is contained in:
Quinn Dunki 2016-09-10 11:04:57 -07:00
parent 2d1a5c6f34
commit a37f15846f
22 changed files with 5011 additions and 2183 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ HGR.xcodeproj/xcuserdata
hgrtest.lst
HGR.xcodeproj/project.xcworkspace/xcuserdata/qd.xcuserdatad/UserInterfaceState.xcuserstate
/.DS_Store
/hisprite.lst

View File

@ -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 row<height-1:
spriteChunks[chunkIndex][row] += "\tinx\n" + rowStartCalculatorCode();
else:
spriteChunks[chunkIndex][row] += "\tRESTORE_AXY\n"
spriteChunks[chunkIndex][row] += "\trts\n"
return spriteChunks
def rowStartCalculatorCode():
return \
"\tlda HGRROWS_H,x\n" + \
"\tsta SCRATCH1\n" + \
"\tlda HGRROWS_L,x\n" + \
"\tsta SCRATCH0\n" + \
"\tldy PARAM0\n" + \
"\tlda DIV7_2,y\n" + \
"\ttay\n";
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]
@ -49,84 +171,28 @@ def pixelColor(pixeldata,row,col):
else:
if r==0 and g==255 and b==0:
color = Colors.green
else:
if r==0 and g==0 and b==255:
color = Colors.blue
else:
if r==255 and g>0 and b==0:
color = Colors.orange
return color
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 <png file>
@ -134,9 +200,16 @@ Usage: HiSprite <png file>
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:])
main(sys.argv[1:])

View File

@ -7,87 +7,83 @@
objects = {
/* Begin PBXFileReference section */
70166CF81D6E2BE1002F1334 /* macros.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = macros.s; sourceTree = "<group>"; };
70166CF91D78BD1B002F1334 /* spritegen2.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen2.s; sourceTree = "<group>"; };
70166CFA1D78BD1B002F1334 /* spritegen3.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen3.s; sourceTree = "<group>"; };
707005BE1D3EC75F00623A10 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
707005BF1D3EC7FD00623A10 /* hgrtest.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = hgrtest.s; sourceTree = "<group>"; };
707005C01D3FD65900623A10 /* hgrtable.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = hgrtable.s; sourceTree = "<group>"; };
7090ABA91D4012A600F02EAA /* spritedata0.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = spritedata0.s; sourceTree = "<group>"; };
7090ABAB1D41663400F02EAA /* scratch.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = scratch.s; sourceTree = "<group>"; };
7090ABAC1D418B8900F02EAA /* spritegen0.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen0.s; sourceTree = "<group>"; };
7090ABAD1D418B8900F02EAA /* spritegen1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen1.s; sourceTree = "<group>"; };
7090ABAE1D419C3E00F02EAA /* spritedata1.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = spritedata1.s; sourceTree = "<group>"; };
7090ABAF1D453FDC00F02EAA /* hgrtable2.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = hgrtable2.s; sourceTree = "<group>"; };
701B5E0E1D84810000E6D330 /* macros.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = macros.s; sourceTree = "<group>"; };
701B5E0F1D84810000E6D330 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
701B5E101D84813500E6D330 /* hisprite.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = hisprite.s; sourceTree = "<group>"; };
701B5E111D84817500E6D330 /* HiSprite.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = HiSprite.py; sourceTree = "<group>"; };
701B5E121D8481C800E6D330 /* hgrtableX.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = hgrtableX.s; sourceTree = "<group>"; };
701B5E131D84820100E6D330 /* spritegen0.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen0.s; sourceTree = "<group>"; };
701B5E141D84823300E6D330 /* spritegen1.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen1.s; sourceTree = "<group>"; };
701B5E151D84823300E6D330 /* spritegen2.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen2.s; sourceTree = "<group>"; };
701B5E161D84823300E6D330 /* spritegen3.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = spritegen3.s; sourceTree = "<group>"; };
701B5E171D84824400E6D330 /* hgrtableY.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = hgrtableY.s; sourceTree = "<group>"; };
/* 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 = "<group>";
};
/* 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 */;
}

View File

@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "self:HGR.xcodeproj">
location = "self:HiSprite.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "701B5E081D8480D200E6D330"
BuildableName = "HiSprite"
BlueprintName = "HiSprite"
ReferencedContainer = "container:HiSprite.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "701B5E081D8480D200E6D330"
BuildableName = "HiSprite"
BlueprintName = "HiSprite"
ReferencedContainer = "container:HiSprite.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "701B5E081D8480D200E6D330"
BuildableName = "HiSprite"
BlueprintName = "HiSprite"
ReferencedContainer = "container:HiSprite.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>HiSprite.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>701B5E081D8480D200E6D330</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -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>
PNG file must not have an alpha channel!
'''
sys.exit(2)
if __name__ == "__main__":
main(sys.argv[1:])

View File

@ -13,7 +13,7 @@ CL65=cl65
AC=AppleCommander.jar
ADDR=6000
PGM=hgrtest
PGM=hisprite
all: $(PGM)

Binary file not shown.

View File

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

495
hgrtest.s
View File

@ -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 PARAM2
lda #>addr
sta PARAM3
jsr BlitSpriteOnByte
.endmacro
.macro BLIT xPos,yPos,addr
lda #xPos
sta PARAM0
lda #yPos
sta PARAM1
lda #<addr
sta PARAM2
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 PARAM2
lda #>BOX_MAG_SHIFT0
sta PARAM3
jsr BlitSprite
lda #88
sta PARAM1
lda #<BOX_GRN_SHIFT0
sta PARAM2
lda #>BOX_GRN_SHIFT0
sta PARAM3
jsr BlitSprite
lda #96
sta PARAM1
lda #<BOX_BLU_SHIFT0
sta PARAM2
lda #>BOX_BLU_SHIFT0
sta PARAM3
jsr BlitSprite
lda #104
sta PARAM1
lda #<BOX_ORG_SHIFT0
sta PARAM2
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"

Binary file not shown.

166
hisprite.s Normal file
View File

@ -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 PARAM2
lda #>addr
sta PARAM3
jsr BlitSpriteOnByte
.endmacro
.macro BLIT xPos,yPos,addr
lda #xPos
sta PARAM0
lda #yPos
sta PARAM1
lda #<addr
sta PARAM2
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"

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff