mirror of
https://github.com/oliverschmidt/Stream-PDM.git
synced 2024-06-08 15:29:41 +00:00
Removed unnecessary zero page usage.
LDY <absolute>,X without page-crossing (sort of surprisingly) requires only 4 cycles, so there's after all no need at all to resort to LDY <zeropage>,X to stay inside the 4 cycle budget.
This commit is contained in:
parent
c445802cfa
commit
406a0628bd
50
stream.s
50
stream.s
|
@ -5,17 +5,18 @@
|
||||||
.macpack apple2
|
.macpack apple2
|
||||||
.pc02
|
.pc02
|
||||||
|
|
||||||
src := $00
|
; free zero page locations according to ProDOS TechRefMan A.4
|
||||||
dst := $02
|
src := $CE
|
||||||
rd_count := $04
|
dst := $D6
|
||||||
wr_count := $05
|
rd_count := $EB
|
||||||
scroll_row := $06
|
wr_count := $EC
|
||||||
scroll_col := $07
|
scroll_row := $ED
|
||||||
scroll_opc := $08
|
scroll_col := $EE
|
||||||
|
scroll_opc := $EF
|
||||||
|
|
||||||
program := $100B ; adressed via jmp_table !
|
program := $100B ; adressed via jmp_table !
|
||||||
buffer := $9000
|
buffer := $9000
|
||||||
zp_save := $9100
|
physical := $9100
|
||||||
|
|
||||||
px = $8F ; force page crossing
|
px = $8F ; force page crossing
|
||||||
silence = $FF
|
silence = $FF
|
||||||
|
@ -118,22 +119,15 @@ chr:lda a:$0000,x ; patched
|
||||||
|
|
||||||
|
|
||||||
stream:
|
stream:
|
||||||
; Save zero page
|
|
||||||
ldx #$00
|
|
||||||
: lda $00,x
|
|
||||||
sta zp_save,x
|
|
||||||
inx
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
; Crate unrolled loop program
|
; Crate unrolled loop program
|
||||||
jsr unroll
|
jsr unroll
|
||||||
|
|
||||||
; Create socket 0 physical read memory lookup table in zero page
|
; Create socket 0 physical read memory lookup table
|
||||||
ldx #$00
|
ldx #$00
|
||||||
: txa
|
: txa
|
||||||
and #>$1FFF
|
and #>$1FFF
|
||||||
ora #>$6000
|
ora #>$6000
|
||||||
sta $00,x
|
sta physical,x
|
||||||
inx
|
inx
|
||||||
bne :-
|
bne :-
|
||||||
|
|
||||||
|
@ -152,13 +146,6 @@ stream:
|
||||||
; Run unrolled loop program
|
; Run unrolled loop program
|
||||||
jsr program
|
jsr program
|
||||||
|
|
||||||
; Restore zero page
|
|
||||||
ldx #$00
|
|
||||||
: lda zp_save,x
|
|
||||||
sta $00,x
|
|
||||||
inx
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
; Switch to text screen
|
; Switch to text screen
|
||||||
bit $C051
|
bit $C051
|
||||||
|
|
||||||
|
@ -473,17 +460,6 @@ scroll_patch:
|
||||||
:.endmacro
|
:.endmacro
|
||||||
|
|
||||||
|
|
||||||
; 14 bytes, 9 cycles
|
|
||||||
.macro spkr_long
|
|
||||||
lsr a ; 2
|
|
||||||
bcs :+ ; 2 3
|
|
||||||
nop ; 2
|
|
||||||
bra :++ ; 3
|
|
||||||
.res 5
|
|
||||||
: bit $C030 ; 4
|
|
||||||
:.endmacro
|
|
||||||
|
|
||||||
|
|
||||||
; 13 bytes, 9 cycles
|
; 13 bytes, 9 cycles
|
||||||
.macro spkr_jsr addr
|
.macro spkr_jsr addr
|
||||||
lsr a ; 2
|
lsr a ; 2
|
||||||
|
@ -550,8 +526,8 @@ recv_prolog:
|
||||||
spkr ; bit 2
|
spkr ; bit 2
|
||||||
ldx $C0F7 ; high byte
|
ldx $C0F7 ; high byte
|
||||||
spkr ; bit 3
|
spkr ; bit 3
|
||||||
ldy $00,x ; high byte -> physical
|
ldy physical,x ; high byte -> physical
|
||||||
spkr_long ; bit 4
|
spkr ; bit 4
|
||||||
ldx $C0F7 ; low byte
|
ldx $C0F7 ; low byte
|
||||||
spkr ; bit 5
|
spkr ; bit 5
|
||||||
sty $C0F5 ; read addr high
|
sty $C0F5 ; read addr high
|
||||||
|
|
Loading…
Reference in New Issue
Block a user