mirror of
https://github.com/thrust26/6502-QR-code-generator.git
synced 2025-01-14 14:33:36 +00:00
optimized single mask pattern switch for space
changed texts
This commit is contained in:
parent
b8ca4e495a
commit
7dcaaa5c80
172
FuncDataV2.inc
Normal file
172
FuncDataV2.inc
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
BlackGfx
|
||||||
|
LeftBlack
|
||||||
|
;GRP0LBlack
|
||||||
|
.byte %11111111 ; constant, bit 0 of 2nd format copy, level
|
||||||
|
.byte %11111111 ; constant, bit 1 of 2nd format copy, level
|
||||||
|
.byte %11111111 ; constant, bit 2 of 2nd format copy, pattern
|
||||||
|
.byte %11111111 ; constant, bit 3 of 2nd format copy, pattern
|
||||||
|
.byte %11111111 ; constant, bit 4 of 2nd format copy, pattern
|
||||||
|
.byte %11111111 ; constant, bit 5 of 2nd format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 6 of 2nd format copy, ECC
|
||||||
|
.byte %11111111 ; constant, 1 (dark module)
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %11111111 ; constant, bits 1..7 of 1st format copy
|
||||||
|
.byte %11111111 ; constant, bit 8 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, 1 (timing bit)
|
||||||
|
.byte %11111111 ; constant, bit 9 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 10 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 11 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 12 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 13 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 14 of 1st format copy, ECC
|
||||||
|
;FirstBlack
|
||||||
|
.byte %00000000
|
||||||
|
GRP1Black
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000001
|
||||||
|
.byte %00000001
|
||||||
|
.byte %00000001
|
||||||
|
.byte %00000001
|
||||||
|
.byte %00000001
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %11111111
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
GRP0RBlack
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %11110000
|
||||||
|
.byte %11110000
|
||||||
|
.byte %11110000
|
||||||
|
.byte %11110000
|
||||||
|
.byte %11110000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %11111111 ; constant, bits 7..14 of 2nd format copy
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
|
||||||
|
EorGfx
|
||||||
|
;GRP0LEor
|
||||||
|
.byte %00000011 ; constant, bit 0 of 2nd format copy, level
|
||||||
|
.byte %11111011 ; constant, bit 1 of 2nd format copy, level
|
||||||
|
.byte %10001011 ; constant, bit 2 of 2nd format copy, pattern
|
||||||
|
.byte %10001011 ; constant, bit 3 of 2nd format copy, pattern
|
||||||
|
.byte %10001011 ; constant, bit 4 of 2nd format copy, pattern
|
||||||
|
.byte %11111011 ; constant, bit 5 of 2nd format copy, ECC
|
||||||
|
.byte %00000011 ; constant, bit 6 of 2nd format copy, ECC
|
||||||
|
.byte %11111110 ; constant, 1 (dark module)
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000100
|
||||||
|
.byte %11111011 ; constant, bits 1..7 of 1st format copy
|
||||||
|
.byte %11111111 ; constant, bit 8 of 1st format copy, ECC
|
||||||
|
.byte %00000010 ; constant, 1 (timing bit)
|
||||||
|
.byte %11111011 ; constant, bit 9 of 1st format copy, ECC
|
||||||
|
.byte %10001011 ; constant, bit 10 of 1st format copy, ECC
|
||||||
|
.byte %10001011 ; constant, bit 11 of 1st format copy, ECC
|
||||||
|
.byte %10001011 ; constant, bit 12 of 1st format copy, ECC
|
||||||
|
.byte %11111011 ; constant, bit 13 of 1st format copy, ECC
|
||||||
|
.byte %00000011 ; constant, bit 14 of 1st format copy, ECC
|
||||||
|
;FirstEor
|
||||||
|
.byte %00000000
|
||||||
|
;GRP1Eor
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %10101010
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
;GRP0REor
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %11100000
|
||||||
|
.byte %10100000
|
||||||
|
.byte %11100000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %11111111 ; constant, bits 7..14 of 2nd format copy
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %10000000 ; constant
|
||||||
|
.byte %10111110 ; constant
|
||||||
|
.byte %10100010 ; constant
|
||||||
|
.byte %10100010 ; constant
|
||||||
|
.byte %10100010 ; constant
|
||||||
|
.byte %10111110 ; constant
|
||||||
|
.byte %10000000 ; constant
|
||||||
|
|
||||||
|
FirstIdxTbl ; for 25 pixel
|
||||||
|
ds 7, 0
|
||||||
|
.byte $fe
|
||||||
|
ds 7, 0
|
||||||
|
.byte $01
|
||||||
|
ds 7, 0
|
||||||
|
.byte $bf
|
181
FuncDataV2S.inc
Normal file
181
FuncDataV2S.inc
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
MAC EOR_GFX
|
||||||
|
EorGfx
|
||||||
|
;GRP0LEor
|
||||||
|
.byte %00000010 | (({1} >> 7) & %1) ; constant, bit 0 of 2nd format copy, level
|
||||||
|
.byte %11111010 | (({1} >> 6) & %1) ; constant, bit 1 of 2nd format copy, level
|
||||||
|
.byte %10001010 | (({1} >> 5) & %1) ; constant, bit 2 of 2nd format copy, pattern
|
||||||
|
.byte %10001010 | (({1} >> 4) & %1) ; constant, bit 3 of 2nd format copy, pattern
|
||||||
|
.byte %10001010 | (({1} >> 3) & %1) ; constant, bit 4 of 2nd format copy, pattern
|
||||||
|
.byte %11111010 | (({1} >> 2) & %1) ; constant, bit 5 of 2nd format copy, ECC
|
||||||
|
.byte %00000010 | (({1} >> 1) & %1) ; constant, bit 6 of 2nd format copy, ECC
|
||||||
|
.byte %11111110 ; constant, 1 (dark module)
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000100
|
||||||
|
.byte (({1}<<1) & %11111000) | ({1} & %11) ; constant, bits 1..7 of 1st format copy
|
||||||
|
.byte %11111110 | (({2} >> 7) & %1) ; constant, bit 8 of 1st format copy, ECC
|
||||||
|
.byte %00000010 ; constant, 1 (timing bit)
|
||||||
|
.byte %11111010 | (({2} >> 6) & %1) ; constant, bit 9 of 1st format copy, ECC
|
||||||
|
.byte %10001010 | (({2} >> 5) & %1) ; constant, bit 10 of 1st format copy, ECC
|
||||||
|
.byte %10001010 | (({2} >> 4) & %1) ; constant, bit 11 of 1st format copy, ECC
|
||||||
|
.byte %10001010 | (({2} >> 3) & %1) ; constant, bit 12 of 1st format copy, ECC
|
||||||
|
.byte %11111010 | (({2} >> 2) & %1) ; constant, bit 13 of 1st format copy, ECC
|
||||||
|
.byte %00000010 | (({2} >> 1) & %1) ; constant, bit 14 of 1st format copy, ECC
|
||||||
|
;FirstEor
|
||||||
|
.byte %00000000
|
||||||
|
;GRP1Eor
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %10101010
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
;GRP0REor
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %11100000
|
||||||
|
.byte %10100000
|
||||||
|
.byte %11100000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte (({1} << 7) & $80) | ({2} >> 1) ; bits 7..14 of 2nd format copy
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %10000000 ; constant
|
||||||
|
.byte %10111110 ; constant
|
||||||
|
.byte %10100010 ; constant
|
||||||
|
.byte %10100010 ; constant
|
||||||
|
.byte %10100010 ; constant
|
||||||
|
.byte %10111110 ; constant
|
||||||
|
.byte %10000000 ; constant
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
BlackGfx
|
||||||
|
LeftBlack
|
||||||
|
;GRP0LBlack
|
||||||
|
.byte %11111111 ; constant, bit 0 of 2nd format copy, level
|
||||||
|
.byte %11111111 ; constant, bit 1 of 2nd format copy, level
|
||||||
|
.byte %11111111 ; constant, bit 2 of 2nd format copy, pattern
|
||||||
|
.byte %11111111 ; constant, bit 3 of 2nd format copy, pattern
|
||||||
|
.byte %11111111 ; constant, bit 4 of 2nd format copy, pattern
|
||||||
|
.byte %11111111 ; constant, bit 5 of 2nd format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 6 of 2nd format copy, ECC
|
||||||
|
.byte %11111111 ; constant, 1 (dark module)
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %00000100
|
||||||
|
.byte %11111111 ; constant, bits 1..7 of 1st format copy
|
||||||
|
.byte %11111111 ; constant, bit 8 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, 1 (timing bit)
|
||||||
|
.byte %11111111 ; constant, bit 9 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 10 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 11 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 12 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 13 of 1st format copy, ECC
|
||||||
|
.byte %11111111 ; constant, bit 14 of 1st format copy, ECC
|
||||||
|
;FirstBlack
|
||||||
|
.byte %00000000
|
||||||
|
GRP1Black
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000001
|
||||||
|
.byte %00000001
|
||||||
|
.byte %00000001
|
||||||
|
.byte %00000001
|
||||||
|
.byte %00000001
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %11111111
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
GRP0RBlack
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %11110000
|
||||||
|
.byte %11110000
|
||||||
|
.byte %11110000
|
||||||
|
.byte %11110000
|
||||||
|
.byte %11110000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %00000000
|
||||||
|
.byte %11111111 ; constant, bits 7..14 of 2nd format copy
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
.byte %11111111 ; constant
|
||||||
|
|
||||||
|
IF QR_LEVEL = 0
|
||||||
|
EOR_GFX ~%11101111, ~%10001000
|
||||||
|
ENDIF
|
||||||
|
IF QR_LEVEL = 1
|
||||||
|
EOR_GFX ~%10101000, ~%00100100
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
FirstIdxTbl ; for 25 pixel
|
||||||
|
ds 7, 0
|
||||||
|
.byte $fe
|
||||||
|
ds 7, 0
|
||||||
|
.byte $01
|
||||||
|
ds 7, 0
|
||||||
|
.byte $bf
|
@ -423,24 +423,32 @@ QR_TOTAL = QR_MAX_DATA + QR_DEGREE ; 44
|
|||||||
;-----------------------------------------------------------
|
;-----------------------------------------------------------
|
||||||
MAC _DRAW_FORMAT
|
MAC _DRAW_FORMAT
|
||||||
;-----------------------------------------------------------
|
;-----------------------------------------------------------
|
||||||
|
IF QR_SINGLE_MASK
|
||||||
|
IF QR_VERSION = 2 || QR_VERSION = 3
|
||||||
|
; invert 1st pixel of 1st copy (bit 0 not set in formats Q and H)
|
||||||
|
ldy #0
|
||||||
|
ldx #QR_SIZE-9
|
||||||
|
jsr InvertPixel
|
||||||
|
ENDIF
|
||||||
|
ELSE
|
||||||
.idx = tmpVars
|
.idx = tmpVars
|
||||||
|
|
||||||
ldy #QR_FORMATS-1
|
ldy #QR_FORMATS-1
|
||||||
.loopFormat
|
.loopFormat
|
||||||
sty .idx
|
sty .idx
|
||||||
cpy #8
|
cpy #8
|
||||||
IF QR_SINGLE_MASK
|
; IF QR_SINGLE_MASK
|
||||||
lda #%10101000
|
; lda #%10101000
|
||||||
and BitMask,y
|
; and BitMask,y
|
||||||
bcc .lowFormat
|
; bcc .lowFormat
|
||||||
lda #%00100100
|
; lda #%00100100
|
||||||
ELSE
|
; ELSE
|
||||||
ldx qrPattern
|
ldx qrPattern
|
||||||
lda FormatLo,x
|
lda FormatLo,x
|
||||||
and BitMask,y
|
and BitMask,y
|
||||||
bcc .lowFormat
|
bcc .lowFormat
|
||||||
lda FormatHi,x
|
lda FormatHi,x
|
||||||
ENDIF
|
; ENDIF
|
||||||
and BitMask-8,y
|
and BitMask-8,y
|
||||||
.lowFormat
|
.lowFormat
|
||||||
beq .skipFormat
|
beq .skipFormat
|
||||||
@ -457,6 +465,7 @@ QR_TOTAL = QR_MAX_DATA + QR_DEGREE ; 44
|
|||||||
.skipFormat
|
.skipFormat
|
||||||
dey
|
dey
|
||||||
bpl .loopFormat
|
bpl .loopFormat
|
||||||
|
ENDIF
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
; ********** The user macros start here: **********
|
; ********** The user macros start here: **********
|
||||||
@ -613,7 +622,6 @@ FormatHi
|
|||||||
.byte %01000000
|
.byte %01000000
|
||||||
ENDIF
|
ENDIF
|
||||||
; TODO: levels Q and H
|
; TODO: levels Q and H
|
||||||
ENDIF
|
|
||||||
|
|
||||||
; position of the 15 type information bits
|
; position of the 15 type information bits
|
||||||
FormatX1
|
FormatX1
|
||||||
@ -630,6 +638,7 @@ FormatX2
|
|||||||
ds 7, 8
|
ds 7, 8
|
||||||
.byte QR_SIZE-8, QR_SIZE-7, QR_SIZE-6, QR_SIZE-5
|
.byte QR_SIZE-8, QR_SIZE-7, QR_SIZE-6, QR_SIZE-5
|
||||||
.byte QR_SIZE-4, QR_SIZE-3, QR_SIZE-2, QR_SIZE-1
|
.byte QR_SIZE-4, QR_SIZE-3, QR_SIZE-2, QR_SIZE-1
|
||||||
|
ENDIF ; QR_SINGLE_MASK = 0
|
||||||
|
|
||||||
BitMask
|
BitMask
|
||||||
.byte $80, $40, $20, $10, $8, $4, $2, $1
|
.byte $80, $40, $20, $10, $8, $4, $2, $1
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
; + multiple pattern formats
|
; + multiple pattern formats
|
||||||
; + apply pattern
|
; + apply pattern
|
||||||
; x evaluate pattern (very slow!)
|
; x evaluate pattern (very slow!)
|
||||||
|
; + optimize single pattern for space
|
||||||
; - support multiple QR code versions
|
; - support multiple QR code versions
|
||||||
; o support multiple QR code levels
|
; o support multiple QR code levels
|
||||||
; - try to optimize function pattern (SetPixel)
|
; - try to optimize function pattern (SetPixel)
|
||||||
@ -26,6 +27,7 @@
|
|||||||
include vcs.h
|
include vcs.h
|
||||||
LIST ON
|
LIST ON
|
||||||
|
|
||||||
|
|
||||||
;===============================================================================
|
;===============================================================================
|
||||||
; A S S E M B L E R - S W I T C H E S
|
; A S S E M B L E R - S W I T C H E S
|
||||||
;===============================================================================
|
;===============================================================================
|
||||||
@ -38,7 +40,7 @@ NTSC = 1
|
|||||||
QR_VERSION = 2 ; 1, 2 or 3 (TODO 1 and 3)
|
QR_VERSION = 2 ; 1, 2 or 3 (TODO 1 and 3)
|
||||||
QR_LEVEL = 1 ; 0 (L), 1 (M), 2 (Q) and 3 (H)
|
QR_LEVEL = 1 ; 0 (L), 1 (M), 2 (Q) and 3 (H)
|
||||||
QR_OVERLAP = 1 ; overlaps input and output data to save RAM (0 not tested!)
|
QR_OVERLAP = 1 ; overlaps input and output data to save RAM (0 not tested!)
|
||||||
QR_SINGLE_MASK = 0 ; (-156) if 1 uses only 1 of the 8 mask pattern
|
QR_SINGLE_MASK = 0 ; (-248) if 1 uses only 1 of the 8 mask pattern
|
||||||
QR_PADDING = 1 ; (+22) add padding bytes
|
QR_PADDING = 1 ; (+22) add padding bytes
|
||||||
|
|
||||||
IF QR_VERSION = 1 || QR_VERSION = 3
|
IF QR_VERSION = 1 || QR_VERSION = 3
|
||||||
@ -47,6 +49,7 @@ QR_PADDING = 1 ; (+22) add padding bytes
|
|||||||
ERR
|
ERR
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
|
|
||||||
;===============================================================================
|
;===============================================================================
|
||||||
; C O N S T A N T S
|
; C O N S T A N T S
|
||||||
;===============================================================================
|
;===============================================================================
|
||||||
@ -439,7 +442,7 @@ BitMapCode
|
|||||||
;---------------------------------------------------------------
|
;---------------------------------------------------------------
|
||||||
CheckPixel SUBROUTINE
|
CheckPixel SUBROUTINE
|
||||||
;---------------------------------------------------------------
|
;---------------------------------------------------------------
|
||||||
; Platform specific code. Must NOT change X and Y registers!
|
; Platform and version specific code. Must NOT change X and Y registers!
|
||||||
; X = y; Y = x
|
; X = y; Y = x
|
||||||
; determine 8 bit column (0..2) or missile columns
|
; determine 8 bit column (0..2) or missile columns
|
||||||
tya
|
tya
|
||||||
@ -484,7 +487,7 @@ CheckPixel SUBROUTINE
|
|||||||
;---------------------------------------------------------------
|
;---------------------------------------------------------------
|
||||||
InvertPixel SUBROUTINE
|
InvertPixel SUBROUTINE
|
||||||
;---------------------------------------------------------------
|
;---------------------------------------------------------------
|
||||||
; Platform specific code. Must NOT change X and Y registers!
|
; Platform and version specific code. Must NOT change X and Y registers!
|
||||||
; X = y; Y = x
|
; X = y; Y = x
|
||||||
; determine 8 bit column (0..2) or missile column
|
; determine 8 bit column (0..2) or missile column
|
||||||
tya
|
tya
|
||||||
@ -532,180 +535,23 @@ _QR_TOTAL SET _QR_TOTAL + . - BitMapCode
|
|||||||
org BASE_ADR + $600
|
org BASE_ADR + $600
|
||||||
|
|
||||||
FunctionModulesData
|
FunctionModulesData
|
||||||
|
|
||||||
; Platform and version specific function module data definition
|
; Platform and version specific function module data definition
|
||||||
BlackGfx
|
|
||||||
LeftBlack
|
|
||||||
GRP0LBlack
|
|
||||||
.byte %11111111 ; constant, bit 0 of 2nd format copy, level
|
|
||||||
.byte %11111111 ; constant, bit 1 of 2nd format copy, level
|
|
||||||
.byte %11111111 ; constant, bit 2 of 2nd format copy, pattern
|
|
||||||
.byte %11111111 ; constant, bit 3 of 2nd format copy, pattern
|
|
||||||
.byte %11111111 ; constant, bit 4 of 2nd format copy, pattern
|
|
||||||
.byte %11111111 ; constant, bit 5 of 2nd format copy, ECC
|
|
||||||
.byte %11111111 ; constant, bit 6 of 2nd format copy, ECC
|
|
||||||
.byte %11111111 ; constant, 1 (dark module)
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000100
|
|
||||||
.byte %11111111 ; constant, bits 1..7 of 1st format copy
|
|
||||||
.byte %11111111 ; constant, bit 8 of 1st format copy, ECC
|
|
||||||
.byte %11111111 ; constant, 1 (timing bit)
|
|
||||||
.byte %11111111 ; constant, bit 9 of 1st format copy, ECC
|
|
||||||
.byte %11111111 ; constant, bit 10 of 1st format copy, ECC
|
|
||||||
.byte %11111111 ; constant, bit 11 of 1st format copy, ECC
|
|
||||||
.byte %11111111 ; constant, bit 12 of 1st format copy, ECC
|
|
||||||
.byte %11111111 ; constant, bit 13 of 1st format copy, ECC
|
|
||||||
.byte %11111111 ; constant, bit 14 of 1st format copy, ECC
|
|
||||||
;FirstBlack
|
|
||||||
.byte %00000000
|
|
||||||
GRP1Black
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000001
|
|
||||||
.byte %00000001
|
|
||||||
.byte %00000001
|
|
||||||
.byte %00000001
|
|
||||||
.byte %00000001
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %11111111
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
GRP0RBlack
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %11110000
|
|
||||||
.byte %11110000
|
|
||||||
.byte %11110000
|
|
||||||
.byte %11110000
|
|
||||||
.byte %11110000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %11111111 ; constant, bits 7..14 of 2nd format copy
|
|
||||||
.byte %11111111 ; constant
|
|
||||||
.byte %11111111 ; constant
|
|
||||||
.byte %11111111 ; constant
|
|
||||||
.byte %11111111 ; constant
|
|
||||||
.byte %11111111 ; constant
|
|
||||||
.byte %11111111 ; constant
|
|
||||||
.byte %11111111 ; constant
|
|
||||||
.byte %11111111 ; constant
|
|
||||||
|
|
||||||
EorGfx
|
IF QR_VERSION = 1
|
||||||
;GRP0LEor
|
ERR ; TODO
|
||||||
.byte %00000011 ; constant, bit 0 of 2nd format copy, level
|
ENDIF
|
||||||
.byte %11111011 ; constant, bit 1 of 2nd format copy, level
|
|
||||||
.byte %10001011 ; constant, bit 2 of 2nd format copy, pattern
|
|
||||||
.byte %10001011 ; constant, bit 3 of 2nd format copy, pattern
|
|
||||||
.byte %10001011 ; constant, bit 4 of 2nd format copy, pattern
|
|
||||||
.byte %11111011 ; constant, bit 5 of 2nd format copy, ECC
|
|
||||||
.byte %00000011 ; constant, bit 6 of 2nd format copy, ECC
|
|
||||||
.byte %11111110 ; constant, 1 (dark module)
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000100
|
|
||||||
.byte %11111011 ; constant, bits 1..7 of 1st format copy
|
|
||||||
.byte %11111111 ; constant, bit 8 of 1st format copy, ECC
|
|
||||||
.byte %00000010 ; constant, 1 (timing bit)
|
|
||||||
.byte %11111011 ; constant, bit 9 of 1st format copy, ECC
|
|
||||||
.byte %10001011 ; constant, bit 10 of 1st format copy, ECC
|
|
||||||
.byte %10001011 ; constant, bit 11 of 1st format copy, ECC
|
|
||||||
.byte %10001011 ; constant, bit 12 of 1st format copy, ECC
|
|
||||||
.byte %11111011 ; constant, bit 13 of 1st format copy, ECC
|
|
||||||
.byte %00000011 ; constant, bit 14 of 1st format copy, ECC
|
|
||||||
;FirstEor
|
|
||||||
.byte %00000000
|
|
||||||
;GRP1Eor
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %10101010
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
;GRP0REor
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %11100000
|
|
||||||
.byte %10100000
|
|
||||||
.byte %11100000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000000
|
|
||||||
.byte %11111111 ; constant, bits 7..14 of 2nd format copy
|
|
||||||
.byte %11111111 ; constant
|
|
||||||
.byte %10000000 ; constant
|
|
||||||
.byte %10111110 ; constant
|
|
||||||
.byte %10100010 ; constant
|
|
||||||
.byte %10100010 ; constant
|
|
||||||
.byte %10100010 ; constant
|
|
||||||
.byte %10111110 ; constant
|
|
||||||
.byte %10000000 ; constant
|
|
||||||
|
|
||||||
FirstIdxTbl ; for 25 pixel
|
IF QR_VERSION = 2
|
||||||
ds 7, 0
|
IF QR_SINGLE_MASK
|
||||||
.byte $fe
|
include FuncDataV2S.inc ; TODO: special pattern
|
||||||
ds 7, 0
|
ELSE
|
||||||
.byte $01
|
include FuncDataV2.inc
|
||||||
ds 7, 0
|
ENDIF
|
||||||
.byte $bf
|
ENDIF
|
||||||
|
|
||||||
|
IF QR_VERSION = 3
|
||||||
|
ERR ; TODO
|
||||||
|
ENDIF
|
||||||
|
|
||||||
ECHO "QR Code function modules data:", [. - FunctionModulesData]d, "bytes"
|
ECHO "QR Code function modules data:", [. - FunctionModulesData]d, "bytes"
|
||||||
_QR_TOTAL SET _QR_TOTAL + . - FunctionModulesData
|
_QR_TOTAL SET _QR_TOTAL + . - FunctionModulesData
|
||||||
@ -718,40 +564,38 @@ _QR_TOTAL SET _QR_TOTAL + . - FunctionModulesData
|
|||||||
; Galadriel:
|
; Galadriel:
|
||||||
MessageTbl
|
MessageTbl
|
||||||
Message0
|
Message0
|
||||||
.byte "It began with the forging"
|
.byte "2002 - Thrust+ Platinum"
|
||||||
; .byte "AtariAge/?s=_1X<|>[]*#"
|
|
||||||
Message1
|
Message1
|
||||||
.byte "of the Great Rings. Three"
|
.byte "2001 - Jammed "
|
||||||
Message2
|
Message2
|
||||||
.byte "were given to the Elves,"
|
.byte "2005 - SWOOPS!"
|
||||||
Message3
|
Message3
|
||||||
.byte "immortal, wisest and"
|
.byte "2017 - ZeroPage Homebrew"
|
||||||
Message4
|
Message4
|
||||||
.byte "fairest of all beings."
|
.byte "2019 - Aardvark"
|
||||||
Message5
|
Message5
|
||||||
.byte "Seven to the Dwarf lords,"
|
.byte "2012 - Boulder Dash"
|
||||||
Message6
|
Message6
|
||||||
.byte "great miners and craftsmen"
|
.byte "2021 - VROOM!"
|
||||||
Message7
|
Message7
|
||||||
.byte "of the mountain halls. And"
|
.byte "2020 - Robot City"
|
||||||
Message8
|
Message8
|
||||||
.byte "nine, nine rings were"
|
.byte "2015 - Star Castle Arcade"
|
||||||
Message9
|
Message9
|
||||||
.byte "gifted to the race of men,"
|
.byte "2001 - AtariAge"
|
||||||
Message10
|
Message10
|
||||||
.byte "who, above all else,"
|
.byte "1998 - Atari 2600 Nexus"
|
||||||
Message11
|
Message11
|
||||||
.byte "desire power. But they"
|
.byte "2009 - RAM Pong"
|
||||||
Message12
|
Message12
|
||||||
.byte "were, all of them,"
|
.byte "1977 - Atari 2600"
|
||||||
Message13
|
Message13
|
||||||
.byte "deceived, for another Ring"
|
.byte "2014 - Three·s"
|
||||||
Message14
|
Message14
|
||||||
.byte "was made. In the land of"
|
.byte "1996 - Stella Mailing List"
|
||||||
Message15
|
Message15
|
||||||
.byte "Mordor, in the fires of..."
|
.byte "1996 - Stella Emulator"
|
||||||
MessageEnd
|
MessageEnd
|
||||||
|
|
||||||
; .byte "..the single hardest thing"
|
; .byte "..the single hardest thing"
|
||||||
|
|
||||||
MessagePtrLo
|
MessagePtrLo
|
||||||
@ -775,4 +619,4 @@ MessagePtrHi
|
|||||||
ECHO "----------------------------------------"
|
ECHO "----------------------------------------"
|
||||||
ECHO "QR Code total:", [_QR_TOTAL]d, "bytes"
|
ECHO "QR Code total:", [_QR_TOTAL]d, "bytes"
|
||||||
ECHO ""
|
ECHO ""
|
||||||
ECHO "QR Code Version, Level (Degree): ", [QR_VERSION]d, ",", [QR_LEVEL]d, "(", [DEGREE]d, ")"
|
ECHO "QR Code Version, Level (Degree): ", [QR_VERSION]d, ",", [QR_LEVEL]d, "(", [QR_DEGREE]d, ")"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user