mirror of
https://github.com/a2-4am/4cade.git
synced 2024-11-19 18:32:58 +00:00
shave some cycles (use 80STORE mode for 1-STA bank switching) [thanks John B.]
This commit is contained in:
parent
fd4cd16936
commit
a3dc564852
@ -50,8 +50,7 @@ copymasks = $6200 ; [256 bytes, page-aligned, duplicated in a
|
|||||||
start
|
start
|
||||||
!pseudopc 0 {
|
!pseudopc 0 {
|
||||||
!byte %00000011
|
!byte %00000011
|
||||||
copyaux sta $C003
|
copyaux sta $C003 ; copy $4000/aux to $A000/main
|
||||||
sta $C005
|
|
||||||
ldx #$20
|
ldx #$20
|
||||||
ldy #$00
|
ldy #$00
|
||||||
a lda $4000, y
|
a lda $4000, y
|
||||||
@ -62,14 +61,15 @@ b sta $A000, y
|
|||||||
inc b+2
|
inc b+2
|
||||||
dex
|
dex
|
||||||
bne a
|
bne a
|
||||||
|
sta $C002
|
||||||
|
sta $C001 ; 80STORE mode
|
||||||
; X,Y=0 on entry to LFSR
|
; X,Y=0 on entry to LFSR
|
||||||
loop txa
|
loop txa
|
||||||
loop1 eor #$B4 ; LFSR form 0xB400 with period 65535
|
loop1 eor #$B4 ; LFSR form 0xB400 with period 65535
|
||||||
tax ; X is LFSR high byte, Y is LFSR low byte
|
tax ; X is LFSR high byte, Y is LFSR low byte
|
||||||
loop2 lda addrs, x ; which means X is the index into the base address lookup table
|
loop2 lda addrs, x ; which means X is the index into the base address lookup table
|
||||||
bmi aux ; and Y is the offset from the base address
|
bmi aux ; and Y is the offset from the base address
|
||||||
sta $C002
|
sta $C054 ; switch $2000 access to main memory
|
||||||
sta $C004
|
|
||||||
sta <dst+2
|
sta <dst+2
|
||||||
eor #$60
|
eor #$60
|
||||||
sta <src+2
|
sta <src+2
|
||||||
@ -92,10 +92,10 @@ dst sta $FD00, y ; write the result
|
|||||||
bne loop1
|
bne loop1
|
||||||
exit lda $4000 ; last lousy byte (because LFSR never hits 0)
|
exit lda $4000 ; last lousy byte (because LFSR never hits 0)
|
||||||
sta $2000
|
sta $2000
|
||||||
|
sta $C000 ; 80STORE mode off
|
||||||
rts
|
rts
|
||||||
|
|
||||||
aux sta $C003
|
aux sta $C055 ; switch $2000 access to aux memory (read/write!)
|
||||||
sta $C005
|
|
||||||
sta <auxsrc+2
|
sta <auxsrc+2
|
||||||
eor #$80
|
eor #$80
|
||||||
sta <auxdst+2
|
sta <auxdst+2
|
||||||
|
Loading…
Reference in New Issue
Block a user