HGR works but palettes flipped

This commit is contained in:
Joshua Bell 2017-09-04 16:47:11 -07:00
parent a297b3e956
commit 323c3772e8

View File

@ -386,58 +386,56 @@ end: rts
jsr read_file
jsr close_file
ptr := $06
jsr hgr_to_dhr
rts
.endproc
lda #<hires
.proc hgr_to_dhr
ptr := $06
rows := 192
cols := 40
spill := $08 ; spill-over
lda #0 ; row
rloop: pha
tax
lda hires_table_lo,x
sta ptr
lda #>hires
lda hires_table_hi,x
sta ptr+1
lda #>hires_size ; pages
pha
ploop: ldy #0
loop: lda (ptr),y
ldy #0 ; col
sty spill ; spill-over
cloop: lda (ptr),y ; between pairs
tax
lda hgr_to_dhr_aux,x
ora spill
sta PAGE2ON
sta (ptr),y
lda hgr_to_dhr_main,x
sta PAGE2OFF
sta (ptr),y
dey
bne loop
rol a ; shift high bit
lda #0 ; to low bit
rol a
sta spill ; and save
iny
cpy #cols
bne cloop
pla
dec a
beq done
pha
inc ptr+1
jmp ploop
inc
cmp #rows
bne rloop
;; TODO: Restore PAGE2 state?
done: sta PAGE2OFF
rts
.endproc
;; TODO: Stash menu bar pixels - 13 rows * 2 banks * 40 bytes
hires_table:
.addr $2000 ; row 0
.addr $2400 ; 1
.addr $2800 ; 2
.addr $2c00 ; 3
.addr $3000 ; 4
.addr $3400 ; 5
.addr $3800 ; 6
.addr $3c00 ; 7
.addr $2080 ; 8
.addr $2480 ; 9
.addr $2880 ; 10
.addr $2c80 ; 11
.addr $3080 ; 12
.addr $3480 ; 13
stash := $1200 ; Past DA code
rows = 13
@ -459,11 +457,10 @@ inner:
lda #0 ; row #
rloop: pha
asl a
tax
lda hires_table,x
lda hires_table_lo,x
sta src
lda hires_table+1,x
lda hires_table_hi,x
sta src+1
ldy #cols-1
cloop: lda (src),y
@ -510,11 +507,10 @@ inner:
lda #0 ; row #
rloop: pha
asl a
tax
lda hires_table,x
lda hires_table_lo,x
sta dst
lda hires_table+1,x
lda hires_table_hi,x
sta dst+1
ldy #cols-1
cloop: lda (src),y
@ -545,72 +541,126 @@ cloop: lda (src),y
rts
.endproc
hires_table_lo:
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $80,$80,$80,$80,$80,$80,$80,$80
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $80,$80,$80,$80,$80,$80,$80,$80
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $80,$80,$80,$80,$80,$80,$80,$80
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $80,$80,$80,$80,$80,$80,$80,$80
.byte $28,$28,$28,$28,$28,$28,$28,$28
.byte $a8,$a8,$a8,$a8,$a8,$a8,$a8,$a8
.byte $28,$28,$28,$28,$28,$28,$28,$28
.byte $a8,$a8,$a8,$a8,$a8,$a8,$a8,$a8
.byte $28,$28,$28,$28,$28,$28,$28,$28
.byte $a8,$a8,$a8,$a8,$a8,$a8,$a8,$a8
.byte $28,$28,$28,$28,$28,$28,$28,$28
.byte $a8,$a8,$a8,$a8,$a8,$a8,$a8,$a8
.byte $50,$50,$50,$50,$50,$50,$50,$50
.byte $d0,$d0,$d0,$d0,$d0,$d0,$d0,$d0
.byte $50,$50,$50,$50,$50,$50,$50,$50
.byte $d0,$d0,$d0,$d0,$d0,$d0,$d0,$d0
.byte $50,$50,$50,$50,$50,$50,$50,$50
.byte $d0,$d0,$d0,$d0,$d0,$d0,$d0,$d0
.byte $50,$50,$50,$50,$50,$50,$50,$50
.byte $d0,$d0,$d0,$d0,$d0,$d0,$d0,$d0
hires_table_hi:
.byte $20,$24,$28,$2c,$30,$34,$38,$3c
.byte $20,$24,$28,$2c,$30,$34,$38,$3c
.byte $21,$25,$29,$2d,$31,$35,$39,$3d
.byte $21,$25,$29,$2d,$31,$35,$39,$3d
.byte $22,$26,$2a,$2e,$32,$36,$3a,$3e
.byte $22,$26,$2a,$2e,$32,$36,$3a,$3e
.byte $23,$27,$2b,$2f,$33,$37,$3b,$3f
.byte $23,$27,$2b,$2f,$33,$37,$3b,$3f
.byte $20,$24,$28,$2c,$30,$34,$38,$3c
.byte $20,$24,$28,$2c,$30,$34,$38,$3c
.byte $21,$25,$29,$2d,$31,$35,$39,$3d
.byte $21,$25,$29,$2d,$31,$35,$39,$3d
.byte $22,$26,$2a,$2e,$32,$36,$3a,$3e
.byte $22,$26,$2a,$2e,$32,$36,$3a,$3e
.byte $23,$27,$2b,$2f,$33,$37,$3b,$3f
.byte $23,$27,$2b,$2f,$33,$37,$3b,$3f
.byte $20,$24,$28,$2c,$30,$34,$38,$3c
.byte $20,$24,$28,$2c,$30,$34,$38,$3c
.byte $21,$25,$29,$2d,$31,$35,$39,$3d
.byte $21,$25,$29,$2d,$31,$35,$39,$3d
.byte $22,$26,$2a,$2e,$32,$36,$3a,$3e
.byte $22,$26,$2a,$2e,$32,$36,$3a,$3e
.byte $23,$27,$2b,$2f,$33,$37,$3b,$3f
.byte $23,$27,$2b,$2f,$33,$37,$3b,$3f
;;; HGR to DHR - Aux Mem Bytes
hgr_to_dhr_aux:
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $03, $0c, $0f, $30, $33, $3c, $3f
.byte $40, $43, $4c, $4f, $70, $73, $7c, $7f
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
.byte $00, $06, $18, $1e, $60, $66, $78, $7e
;;; HGR to DHR - Main Mem Bytes
hgr_to_dhr_main:
.byte $00, $00, $00, $00, $00, $00, $00, $00
.byte $00, $00, $00, $00, $00, $00, $00, $00
.byte $03, $03, $03, $03, $03, $03, $03, $03
.byte $03, $03, $03, $03, $03, $03, $03, $03
.byte $0c, $0c, $0c, $0c, $0c, $0c, $0c, $0c
.byte $0c, $0c, $0c, $0c, $0c, $0c, $0c, $0c
.byte $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f
.byte $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f
.byte $30, $30, $30, $30, $30, $30, $30, $30
.byte $30, $30, $30, $30, $30, $30, $30, $30
.byte $33, $33, $33, $33, $33, $33, $33, $33
.byte $33, $33, $33, $33, $33, $33, $33, $33
.byte $3c, $3c, $3c, $3c, $3c, $3c, $3c, $3c
.byte $3c, $3c, $3c, $3c, $3c, $3c, $3c, $3c
.byte $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f
.byte $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f
.byte $00, $00, $00, $00, $00, $00, $00, $00
.byte $01, $01, $01, $01, $01, $01, $01, $01
.byte $06, $06, $06, $06, $06, $06, $06, $06
.byte $07, $07, $07, $07, $07, $07, $07, $07
.byte $18, $18, $18, $18, $18, $18, $18, $18
.byte $19, $19, $19, $19, $19, $19, $19, $19
.byte $1e, $1e, $1e, $1e, $1e, $1e, $1e, $1e
.byte $1f, $1f, $1f, $1f, $1f, $1f, $1f, $1f
.byte $60, $60, $60, $60, $60, $60, $60, $60
.byte $61, $61, $61, $61, $61, $61, $61, $61
.byte $66, $66, $66, $66, $66, $66, $66, $66
.byte $67, $67, $67, $67, $67, $67, $67, $67
.byte $78, $78, $78, $78, $78, $78, $78, $78
.byte $79, $79, $79, $79, $79, $79, $79, $79
.byte $7e, $7e, $7e, $7e, $7e, $7e, $7e, $7e
.byte $7f, $7f, $7f, $7f, $7f, $7f, $7f, $7f
.byte $00, $00, $00, $00, $00, $00, $00, $00
.byte $01, $01, $01, $01, $01, $01, $01, $01
.byte $06, $06, $06, $06, $06, $06, $06, $06
.byte $07, $07, $07, $07, $07, $07, $07, $07
.byte $18, $18, $18, $18, $18, $18, $18, $18
.byte $19, $19, $19, $19, $19, $19, $19, $19
.byte $1e, $1e, $1e, $1e, $1e, $1e, $1e, $1e
.byte $1f, $1f, $1f, $1f, $1f, $1f, $1f, $1f
.byte $60, $60, $60, $60, $60, $60, $60, $60
.byte $61, $61, $61, $61, $61, $61, $61, $61
.byte $66, $66, $66, $66, $66, $66, $66, $66
.byte $67, $67, $67, $67, $67, $67, $67, $67
.byte $78, $78, $78, $78, $78, $78, $78, $78
.byte $79, $79, $79, $79, $79, $79, $79, $79
.byte $7e, $7e, $7e, $7e, $7e, $7e, $7e, $7e
.byte $7f, $7f, $7f, $7f, $7f, $7f, $7f, $7f
.byte $00, $00, $00, $00, $00, $00, $00, $00
.byte $03, $03, $03, $03, $03, $03, $03, $03
.byte $0c, $0c, $0c, $0c, $0c, $0c, $0c, $0c
.byte $0f, $0f, $0f, $0f, $0f, $0f, $0f, $0f
.byte $30, $30, $30, $30, $30, $30, $30, $30
.byte $33, $33, $33, $33, $33, $33, $33, $33
.byte $3c, $3c, $3c, $3c, $3c, $3c, $3c, $3c
.byte $3f, $3f, $3f, $3f, $3f, $3f, $3f, $3f
.byte $c0, $c0, $c0, $c0, $c0, $c0, $c0, $c0
.byte $c3, $c3, $c3, $c3, $c3, $c3, $c3, $c3
.byte $cc, $cc, $cc, $cc, $cc, $cc, $cc, $cc
.byte $cf, $cf, $cf, $cf, $cf, $cf, $cf, $cf
.byte $f0, $f0, $f0, $f0, $f0, $f0, $f0, $f0
.byte $f3, $f3, $f3, $f3, $f3, $f3, $f3, $f3
.byte $fc, $fc, $fc, $fc, $fc, $fc, $fc, $fc
.byte $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff