4cade/src/fx/fx.shr.lr.a

49 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

2021-11-23 22:32:57 +00:00
;license:MIT
;(c) 2021 by 4am
!cpu 6502
!to "build/FX.INDEXED/SHR.LR",plain
2021-11-23 22:32:57 +00:00
*=$A000
2021-12-17 23:29:35 +00:00
!source "src/fx/macros.a"
2021-11-23 22:32:57 +00:00
shrlo = $301 ; $C8 bytes, indexed as shrlo-1,x
shrhi = $37 ; $C8 bytes, indexed as shrhi-1,x
2021-11-23 22:32:57 +00:00
+BUILD_SHR_LOOKUP_TABLES shrlo, shrhi
2021-12-17 23:29:35 +00:00
+OVERCOPY_TO_0 start, end
;$FF clobbered
2021-12-05 02:23:11 +00:00
;X=0
2021-12-14 02:15:26 +00:00
;Y=0
2021-11-23 22:32:57 +00:00
+COPY_SCB_AND_PALETTES
2021-12-05 02:23:11 +00:00
;WRITEAUXMEM active
2021-12-14 02:15:26 +00:00
2021-11-23 22:32:57 +00:00
jmp loop
start
!pseudopc 0 {
;Y=0
loop ldx #$C8
loop2 lda shrlo-1, x
sta <dst+1
lda shrhi-1, x
sta <dst+2
lda (<dst+1), y
dst sta $0000, y ; SMC
dex
bne loop2
2024-05-29 01:17:10 +00:00
lda KBD
2021-11-23 22:32:57 +00:00
bmi @exit
iny
cpy #$A0
bne loop
2021-12-13 21:04:21 +00:00
@exit
2021-11-23 22:32:57 +00:00
rts
}
end
; if zero page code gets too large, move shrhi to $201
2021-12-14 02:15:26 +00:00
!if end-start > shrhi {
!error "code is too large: ends at ", end-start
}