Working horizontal lookups

This commit is contained in:
Quinn Dunki 2016-08-29 12:44:54 -07:00
parent dbe729e839
commit 53b2080b66
8 changed files with 786 additions and 515 deletions

View File

@ -7,6 +7,7 @@
objects = {
/* Begin PBXFileReference section */
70166CF81D6E2BE1002F1334 /* macros.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = macros.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>"; };
@ -24,6 +25,7 @@
children = (
707005BE1D3EC75F00623A10 /* Makefile */,
707005BF1D3EC7FD00623A10 /* hgrtest.s */,
70166CF81D6E2BE1002F1334 /* macros.s */,
7090ABAB1D41663400F02EAA /* scratch.s */,
7090ABA91D4012A600F02EAA /* spritedata0.s */,
7090ABAE1D419C3E00F02EAA /* spritedata1.s */,

View File

@ -23,15 +23,19 @@ def main(argv):
width = pngdata[0]
height = pngdata[1]
pixeldata = pngdata[2]
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 chunkIndex in range(len(spriteChunks)):
print "%s_SHIFT%d_CHUNK%d:" % (os.path.splitext(pngfile)[0].upper(),shift,chunkIndex)
print spriteChunks[chunkIndex]
for row in range(height):
for chunkIndex in range(len(spriteChunks)):
print spriteChunks[chunkIndex][row]
print "\n"
@ -40,8 +44,8 @@ def layoutSpriteChunk(pixeldata,width,height,shift):
bitmap = [[0 for x in range(width)] for y in range(height)]
byteWidth = width/2+1
spriteChunks = ["" for x in range(byteWidth)]
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]
@ -83,7 +87,7 @@ def layoutSpriteChunk(pixeldata,width,height,shift):
bitPos += 7
for chunkIndex in range(len(byteSplits)):
spriteChunks[chunkIndex] += ".byte %%%s\t\n" % byteSplits[chunkIndex]
spriteChunks[chunkIndex][row] = ".byte %%%s" % byteSplits[chunkIndex]
return spriteChunks
@ -140,7 +144,7 @@ def printHorzontalLookup():
print "\nHGRROWS_BITSHIFT_GRN:"
for pixel in range(140):
print "\t.byte $%02x" % ((pixel % 7)*24)
print "\t.byte $%02x" % ((pixel % 7)*32) # 32 = 4 shifts of 8 bytes
def usage():

View File

@ -142,142 +142,142 @@ HGRROWS_GRN:
HGRROWS_BITSHIFT_GRN:
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0
.byte $00
.byte $18
.byte $30
.byte $48
.byte $20
.byte $40
.byte $60
.byte $78
.byte $90
.byte $80
.byte $a0
.byte $c0

Binary file not shown.

View File

@ -8,6 +8,7 @@
.org $6000
.include "macros.s"
; Softswitches
TEXT = $c050
@ -17,7 +18,7 @@ HIRES2 = $c058
; ROM entry points
COUT = $fded
ROMWAIT = $fca8
; Zero page locations we use (unused by Monitor, Applesoft, or ProDOS)
PARAM0 = $06
@ -63,21 +64,31 @@ SCRATCH1 = $1a
main:
jsr EnableHires
loop:
lda #$00
jsr LinearFill
.if 1
ldx #1
stx PARAM0
ldx #0
loop:
txa
asl
asl
sta PARAM0
lda #80
sta PARAM1
lda #<BOX_MAG_SHIFT0_CHUNK0
lda #<BOX_MAG_SHIFT0
sta PARAM2
lda #>BOX_MAG_SHIFT0_CHUNK0
lda #>BOX_MAG_SHIFT0
sta PARAM3
jsr BlitSprite
; lda #$ff
; jsr ROMWAIT
inx
cpx #35
bne loop
.endif
.if 0
@ -291,13 +302,15 @@ loop:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; BlitSprite
; Trashes everything
; 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
@ -307,30 +320,47 @@ BlitSprite:
adc PARAM3
sta PARAM3
ldy #7
lda #7
sta SCRATCH0 ; Tracks row index
blitSprite_loop:
clc ; Calculate Y line
tya
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
dey
bpl blitSprite_loop
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

165
macros.s Normal file
View File

@ -0,0 +1,165 @@
;
; macros.s
; Generally useful macros for 6502 code
;
; Created by Quinn Dunki on 8/15/14.
; Copyright (c) 2014 One Girl, One Laptop Productions. All rights reserved.
;
; Macros
.macro SETSWITCH name ; Sets the named softswitch (assumes write method)
sta name
.endmacro
.macro SAVE_AXY ; Saves all registers
pha
phx
phy
.endmacro
.macro RESTORE_AXY ; Restores all registers
ply
plx
pla
.endmacro
.macro SAVE_AY ; Saves accumulator and Y index
pha
phy
.endmacro
.macro RESTORE_AY ; Restores accumulator and Y index
ply
pla
.endmacro
.macro SAVE_AX ; Saves accumulator and X index
pha
phx
.endmacro
.macro RESTORE_AX ; Restores accumulator and X index
plx
pla
.endmacro
.macro SAVE_XY ; Saves X and Y index
phx
phy
.endmacro
.macro RESTORE_XY ; Restores X and Y index
ply
plx
.endmacro
.macro SAVE_ZPP ; Saves Zero Page locations we use for parameters
lda PARAM0
pha
lda PARAM1
pha
lda PARAM2
pha
lda PARAM3
pha
.endmacro
.macro RESTORE_ZPP ; Restores Zero Page locations we use for parameters
pla
sta PARAM3
pla
sta PARAM2
pla
sta PARAM1
pla
sta PARAM0
.endmacro
.macro SAVE_ZPS ; Saves Zero Page locations we use for scratch
lda SCRATCH0
pha
lda SCRATCH1
pha
.endmacro
.macro RESTORE_ZPS ; Restores Zero Page locations we use for scratch
pla
sta SCRATCH1
pla
sta SCRATCH0
.endmacro
.macro PARAM16 addr
lda #<addr
sta PARAM0
lda #>addr
sta PARAM1
.endmacro
.macro CALL16 func,addr
PARAM16 addr
jsr func
.endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Rendering macros
;
.macro LDY_AVIEW
asl ; Find our new view record
asl
asl
asl ; Records are 16 bytes wide
tay
.endmacro
.macro LDY_ACTIVEVIEW
lda WG_ACTIVEVIEW ; Find our new view record
LDY_AVIEW
.endmacro
.macro LDX_ACTIVEVIEW
lda WG_ACTIVEVIEW ; Find our new view record
asl
asl
asl
asl ; Records are 16 bytes wide
tax
.endmacro
.macro LDY_FOCUSVIEW
lda WG_FOCUSVIEW ; Find our new view record
LDY_AVIEW
.endmacro
.macro VBL_SYNC ; Synchronize with vertical blanking
lda #$80
;macroWaitVBLToFinish:
; bit RDVBLBAR
; bmi macroWaitVBLToFinish
@macroWaitVBLToStart:
; bit RDVBLBAR
; bpl @macroWaitVBLToStart
.endmacro

View File

@ -1,210 +1,245 @@
BOX_MAG_SHIFT0_CHUNK0:
.byte %01010101
.byte %01000001
.byte %01000001
.byte %01000001
.byte %01000001
.byte %01000001
.byte %01000001
.byte %01010101
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
BOX_MAG_SHIFT0_CHUNK1:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
BOX_MAG_SHIFT0_CHUNK2:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
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_SHIFT1_CHUNK0:
.byte %01010100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %01010100
BOX_MAG_SHIFT1_CHUNK1:
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
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_CHUNK2:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
BOX_MAG_SHIFT2_CHUNK0:
.byte %01010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %01010000
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_CHUNK1:
.byte %00001010
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001010
BOX_MAG_SHIFT2_CHUNK2:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
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_CHUNK0:
.byte %01000000
.byte %01000000
.byte %01000000
.byte %01000000
.byte %01000000
.byte %01000000
.byte %01000000
.byte %01000000
BOX_MAG_SHIFT3_CHUNK1:
.byte %00101010
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00101010
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_SHIFT3_CHUNK2:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
BOX_MAG_SHIFT4_CHUNK0:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
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_SHIFT4_CHUNK1:
.byte %00101010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00101010
BOX_MAG_SHIFT4_CHUNK2:
.byte %00000001
.byte %00000001
.byte %00000001
.byte %00000001
.byte %00000001
.byte %00000001
.byte %00000001
.byte %00000001
BOX_MAG_SHIFT5_CHUNK0:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
BOX_MAG_SHIFT5_CHUNK1:
.byte %00101000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00101000
BOX_MAG_SHIFT5_CHUNK2:
.byte %00000101
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000101
BOX_MAG_SHIFT6_CHUNK0:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
BOX_MAG_SHIFT6_CHUNK1:
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
BOX_MAG_SHIFT6_CHUNK2:
.byte %00010101
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010101

View File

@ -1,210 +1,245 @@
BOX_GRN_SHIFT0_CHUNK0:
.byte %00101010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00101010
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
BOX_GRN_SHIFT0_CHUNK1:
.byte %00000001
.byte %00000001
.byte %00000001
.byte %00000001
.byte %00000001
.byte %00000001
.byte %00000001
.byte %00000001
BOX_GRN_SHIFT0_CHUNK2:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
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_SHIFT1_CHUNK0:
.byte %00101000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00101000
BOX_GRN_SHIFT1_CHUNK1:
.byte %00000101
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000101
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_CHUNK2:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
BOX_GRN_SHIFT2_CHUNK0:
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
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_CHUNK1:
.byte %00010101
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010101
BOX_GRN_SHIFT2_CHUNK2:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
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_CHUNK0:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
BOX_GRN_SHIFT3_CHUNK1:
.byte %01010101
.byte %01000001
.byte %01000001
.byte %01000001
.byte %01000001
.byte %01000001
.byte %01000001
.byte %01010101
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_SHIFT3_CHUNK2:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
BOX_GRN_SHIFT4_CHUNK0:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
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_SHIFT4_CHUNK1:
.byte %01010100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %00000100
.byte %01010100
BOX_GRN_SHIFT4_CHUNK2:
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
.byte %00000010
BOX_GRN_SHIFT5_CHUNK0:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
BOX_GRN_SHIFT5_CHUNK1:
.byte %01010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %00010000
.byte %01010000
BOX_GRN_SHIFT5_CHUNK2:
.byte %00001010
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001000
.byte %00001010
BOX_GRN_SHIFT6_CHUNK0:
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
.byte %00000000
BOX_GRN_SHIFT6_CHUNK1:
.byte %01000000
.byte %01000000
.byte %01000000
.byte %01000000
.byte %01000000
.byte %01000000
.byte %01000000
.byte %01000000
BOX_GRN_SHIFT6_CHUNK2:
.byte %00101010
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00100000
.byte %00101010