A2D pre-shift tables identified per JB on comp.sys.apple2

This commit is contained in:
Joshua Bell 2018-01-28 11:06:08 -08:00
parent 0981e432c0
commit 2e61ed294d

View File

@ -452,9 +452,10 @@ param_lengths:
PARAM_DEFN 2, $82, 0 ; $4E
;;; ==================================================
;;; Pre-Shift Tables
;; ???
L4221: .byte $00,$02,$04,$06,$08,$0A,$0C,$0E
shift_1_aux:
.byte $00,$02,$04,$06,$08,$0A,$0C,$0E
.byte $10,$12,$14,$16,$18,$1A,$1C,$1E
.byte $20,$22,$24,$26,$28,$2A,$2C,$2E
.byte $30,$32,$34,$36,$38,$3A,$3C,$3E
@ -471,7 +472,8 @@ L4221: .byte $00,$02,$04,$06,$08,$0A,$0C,$0E
.byte $60,$62,$64,$66,$68,$6A,$6C,$6E
.byte $70,$72,$74,$76,$78,$7A,$7C,$7E
L42A1: .byte $00,$00,$00,$00,$00,$00,$00,$00
shift_1_main:
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
@ -488,7 +490,8 @@ L42A1: .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $01,$01,$01,$01,$01,$01,$01,$01
.byte $01,$01,$01,$01,$01,$01,$01,$01
L4321: .byte $00,$04,$08,$0C,$10,$14,$18,$1C
shift_2_aux:
.byte $00,$04,$08,$0C,$10,$14,$18,$1C
.byte $20,$24,$28,$2C,$30,$34,$38,$3C
.byte $40,$44,$48,$4C,$50,$54,$58,$5C
.byte $60,$64,$68,$6C,$70,$74,$78,$7C
@ -505,7 +508,8 @@ L4321: .byte $00,$04,$08,$0C,$10,$14,$18,$1C
.byte $40,$44,$48,$4C,$50,$54,$58,$5C
.byte $60,$64,$68,$6C,$70,$74,$78,$7C
L43A1: .byte $00,$00,$00,$00,$00,$00,$00,$00
shift_2_main:
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
@ -522,7 +526,8 @@ L43A1: .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
L4421: .byte $00,$08,$10,$18,$20,$28,$30,$38
shift_3_aux:
.byte $00,$08,$10,$18,$20,$28,$30,$38
.byte $40,$48,$50,$58,$60,$68,$70,$78
.byte $00,$08,$10,$18,$20,$28,$30,$38
.byte $40,$48,$50,$58,$60,$68,$70,$78
@ -539,7 +544,8 @@ L4421: .byte $00,$08,$10,$18,$20,$28,$30,$38
.byte $00,$08,$10,$18,$20,$28,$30,$38
.byte $40,$48,$50,$58,$60,$68,$70,$78
L44A1: .byte $00,$00,$00,$00,$00,$00,$00,$00
shift_3_main:
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $01,$01,$01,$01,$01,$01,$01,$01
.byte $01,$01,$01,$01,$01,$01,$01,$01
@ -556,7 +562,8 @@ L44A1: .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $07,$07,$07,$07,$07,$07,$07,$07
.byte $07,$07,$07,$07,$07,$07,$07,$07
L4521: .byte $00,$10,$20,$30,$40,$50,$60,$70
shift_4_aux:
.byte $00,$10,$20,$30,$40,$50,$60,$70
.byte $00,$10,$20,$30,$40,$50,$60,$70
.byte $00,$10,$20,$30,$40,$50,$60,$70
.byte $00,$10,$20,$30,$40,$50,$60,$70
@ -573,7 +580,8 @@ L4521: .byte $00,$10,$20,$30,$40,$50,$60,$70
.byte $00,$10,$20,$30,$40,$50,$60,$70
.byte $00,$10,$20,$30,$40,$50,$60,$70
L45A1: .byte $00,$00,$00,$00,$00,$00,$00,$00
shift_4_main:
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $01,$01,$01,$01,$01,$01,$01,$01
.byte $02,$02,$02,$02,$02,$02,$02,$02
.byte $03,$03,$03,$03,$03,$03,$03,$03
@ -590,7 +598,8 @@ L45A1: .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $0E,$0E,$0E,$0E,$0E,$0E,$0E,$0E
.byte $0F,$0F,$0F,$0F,$0F,$0F,$0F,$0F
L4621: .byte $00,$20,$40,$60,$00,$20,$40,$60
shift_5_aux:
.byte $00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60
@ -607,7 +616,8 @@ L4621: .byte $00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60
.byte $00,$20,$40,$60,$00,$20,$40,$60
L46A1: .byte $00,$00,$00,$00,$01,$01,$01,$01
shift_5_main:
.byte $00,$00,$00,$00,$01,$01,$01,$01
.byte $02,$02,$02,$02,$03,$03,$03,$03
.byte $04,$04,$04,$04,$05,$05,$05,$05
.byte $06,$06,$06,$06,$07,$07,$07,$07
@ -624,7 +634,8 @@ L46A1: .byte $00,$00,$00,$00,$01,$01,$01,$01
.byte $1C,$1C,$1C,$1C,$1D,$1D,$1D,$1D
.byte $1E,$1E,$1E,$1E,$1F,$1F,$1F,$1F
L4721: .byte $00,$40,$00,$40,$00,$40,$00,$40
shift_6_aux:
.byte $00,$40,$00,$40,$00,$40,$00,$40
.byte $00,$40,$00,$40,$00,$40,$00,$40
.byte $00,$40,$00,$40,$00,$40,$00,$40
.byte $00,$40,$00,$40,$00,$40,$00,$40
@ -641,7 +652,8 @@ L4721: .byte $00,$40,$00,$40,$00,$40,$00,$40
.byte $00,$40,$00,$40,$00,$40,$00,$40
.byte $00,$40,$00,$40,$00,$40,$00,$40
L47A1: .byte $00,$00,$01,$01,$02,$02,$03,$03
shift_6_main:
.byte $00,$00,$01,$01,$02,$02,$03,$03
.byte $04,$04,$05,$05,$06,$06,$07,$07
.byte $08,$08,$09,$09,$0A,$0A,$0B,$0B
.byte $0C,$0C,$0D,$0D,$0E,$0E,$0F,$0F
@ -658,10 +670,9 @@ L47A1: .byte $00,$00,$01,$01,$02,$02,$03,$03
.byte $38,$38,$39,$39,$3A,$3A,$3B,$3B
.byte $3C,$3C,$3D,$3D,$3E,$3E,$3F,$3F
L4821: .byte $00,$00,$00,$00
L4825: .byte $00,$00,$00
L4828: .byte $01,$01,$01,$01,$01,$01,$01,$02
div7_table:
.byte $00,$00,$00,$00,$00,$00,$00
.byte $01,$01,$01,$01,$01,$01,$01,$02
.byte $02,$02,$02,$02,$02,$02,$03,$03
.byte $03,$03,$03,$03,$03,$04,$04,$04
.byte $04,$04,$04,$04,$05,$05,$05,$05
@ -693,14 +704,9 @@ L4828: .byte $01,$01,$01,$01,$01,$01,$01,$02
.byte $22,$22,$22,$22,$22,$22,$23,$23
.byte $23,$23,$23,$23,$23,$24,$24,$24
.byte $24
L4921: .byte $00,$01,$02,$03
L4925: .byte $04,$05,$06,$00,$01,$02,$03,$04
.byte $05,$06,$00,$01,$02,$03,$04,$05
.byte $06,$00,$01,$02,$03,$04,$05,$06
.byte $00,$01,$02,$03,$04,$05,$06,$00
.byte $01,$02,$03,$04,$05,$06,$00,$01
.byte $02,$03,$04,$05,$06,$00,$01,$02
.byte $03,$04,$05,$06,$00,$01,$02,$03
mod7_table:
.byte $00,$01,$02,$03
.byte $04,$05,$06,$00,$01,$02,$03,$04
.byte $05,$06,$00,$01,$02,$03,$04,$05
.byte $06,$00,$01,$02,$03,$04,$05,$06
@ -709,7 +715,14 @@ L4925: .byte $04,$05,$06,$00,$01,$02,$03,$04
.byte $02,$03,$04,$05,$06,$00,$01,$02
.byte $03,$04,$05,$06,$00,$01,$02,$03
.byte $04,$05,$06,$00,$01,$02,$03,$04
L499D: .byte $05,$06,$00,$01,$02,$03,$04,$05
.byte $05,$06,$00,$01,$02,$03,$04,$05
.byte $06,$00,$01,$02,$03,$04,$05,$06
.byte $00,$01,$02,$03,$04,$05,$06,$00
.byte $01,$02,$03,$04,$05,$06,$00,$01
.byte $02,$03,$04,$05,$06,$00,$01,$02
.byte $03,$04,$05,$06,$00,$01,$02,$03
.byte $04,$05,$06,$00,$01,$02,$03,$04
.byte $05,$06,$00,$01,$02,$03,$04,$05
.byte $06,$00,$01,$02,$03,$04,$05,$06
.byte $00,$01,$02,$03,$04,$05,$06,$00
.byte $01,$02,$03,$04,$05,$06,$00,$01
@ -953,12 +966,12 @@ L4CA3: stx $82
L4CAA: ldx $0601,y
L4CAE := * + 1
L4CAF := * + 2
ora L42A1,x
ora shift_1_main,x
L4CB1 := * + 1
sta $0602,y
L4CB4 := * + 1
L4CB5 := * + 2
lda L4221,x
lda shift_1_aux,x
dey
bpl L4CAA
L4CBA := * + 1
@ -1134,8 +1147,8 @@ set_up_fill_mode:
: lda $96
ror a
tax
lda L4821,x
ldy L4921,x
lda div7_table,x
ldy mod7_table,x
L4E01: sta $82
tya
rol a
@ -1149,8 +1162,8 @@ L4E01: sta $82
lda $92
ror a
tax
lda L4821,x
ldy L4921,x
lda div7_table,x
ldy mod7_table,x
L4E1E: sta $86
tya
rol a
@ -1194,21 +1207,21 @@ L4E68: lda $92
ror a
tax
php
lda L4825,x
lda div7_table+4,x
clc
adc #$24
plp
ldy L4925,x
ldy mod7_table+4,x
bpl L4E1E
L4E79: lda $96
ror a
tax
php
lda L4825,x
lda div7_table+4,x
clc
adc #$24
plp
ldy L4925,x
ldy mod7_table+4,x
bmi L4E8D
jmp L4E01
@ -1217,19 +1230,19 @@ L4E8D: lsr a
txa
ror a
tax
lda L4821,x
ldy L4921,x
lda div7_table,x
ldy mod7_table,x
rts
L4E9A: txa
ror a
tax
php
lda L4825,x
lda div7_table+4,x
clc
adc #$24
plp
ldy L4925,x
ldy mod7_table+4,x
rts
L4EA9: lda $86
@ -1810,13 +1823,13 @@ L5249: tay
L5250: tya
asl a
tay
lda L5293,y
lda shift_table_main,y
sta L4CAE
lda L5293+1,y
lda shift_table_main+1,y
sta L4CAF
lda L5285+2,y
lda shift_table_aux,y
sta L4CB4
lda L5285+3,y
lda shift_table_aux+1,y
sta L4CB5
ldy $81
sty L4CB1
@ -1831,9 +1844,13 @@ L5276: lda L5285,x
L5285: .addr L4CBE,L4CA3
.addr L4221,L4321,L4421,L4521,L4621
shift_table_aux := *-2
.addr shift_1_aux,shift_2_aux,shift_3_aux
.addr shift_4_aux,shift_5_aux,shift_6_aux
L5293: .addr L4721,L42A1,L43A1,L44A1,L45A1,L46A1,L47A1
shift_table_main := *-2
.addr shift_1_main,shift_2_main,shift_3_main
.addr shift_4_main,shift_5_main,shift_6_main
L52A1: stx $B0
@ -3029,14 +3046,14 @@ L5AE7: jmp L5BD4
L5AEA: tya
asl a
tay
lda L5285+2,y
lda shift_table_aux,y
sta $40
lda L5285+3,y
sta $41
lda L5293,y
lda shift_table_aux+1,y
sta $40+1
lda shift_table_main,y
sta $42
lda L5293+1,y
sta $43
lda shift_table_main+1,y
sta $42+1
L5B02 := * + 1
L5B03 := * + 2
jmp L5B04
@ -3184,6 +3201,9 @@ L5C22 := * + 1
L5C23 := * + 2
jmp L5C24
;;; Per JB: "looks like the quickdraw fast-path draw unclipped pattern slab"
L5C24: lda $0F
eor state_tmask
sta ($3E),y
@ -3267,6 +3287,8 @@ L5CBE := * + 1
L5CBF := * + 2
jmp L5CC0
;;; Per JB: "looks like the quickdraw slow-path draw clipped pattern slab"
L5CC0: lda $0F
eor state_tmask
eor ($3E),y
@ -3775,7 +3797,7 @@ draw_cursor:
txa
ror a
tax
ldy L499D,x
ldy mod7_table+124,x ; ???
lda #$FF
bmi L60E4
L60E1: jsr L4E8D
@ -3794,9 +3816,9 @@ L60EE: tay
tya
asl a
tay
lda L5293,y
lda shift_table_main,y
sta L6164
lda L5293+1,y
lda shift_table_main+1,y
sta L6165
lda L5285+2,y
sta L616A
@ -5468,14 +5490,14 @@ L6C98: lda $BC
lda $BB
ror a
tax
lda L4821,x
lda div7_table,x
sta $82
lda $BE
lsr a
lda $BD
ror a
tax
lda L4821,x
lda div7_table,x
sec
sbc $82
sta $90
@ -7213,7 +7235,7 @@ L7922: lda #$00
ldy #$04
lda ($82),y
tax
lda L4828,x
lda div7_table+7,x
sta $90
txa
ldx $93