4cade/src/fx/fx.shr.common.a
2021-12-04 21:23:11 -05:00

67 lines
1.1 KiB
Plaintext

;license:MIT
;(c) 2021 by 4am
!macro BUILD_SHR_LOOKUP_TABLES .lo, .hi {
; in: none
; out: X=0
; Z=1
ldx #$C8
lda #$60
ldy #$9C
- sta .lo-1, x
!if .hi < $100 {
sty .hi-1, x
} else {
pha
tya
sta .hi-1, x
pla
}
sec
sbc #$A0
bcs +
dey
+ dex
bne -
}
!macro BUILD_SHR_REVERSE_LOOKUP_TABLES .lo, .hi {
; in: none
; out: X=0
; Z=1
ldx #$C8
lda #$00
ldy #$20
- sta .lo-1, x
!if .hi < $100 {
sty .hi-1, x
} else {
pha
tya
sta .hi-1, x
pla
}
clc
adc #$A0
bcc +
iny
+ dex
bne -
}
!macro COPY_SCB_AND_PALETTES {
; in: X=0 /!\
; out: X=0
; Z=1
; WRITEAUXMEM active
sta $C005
- lda $9D00, x
sta $9D00, x
lda $9E00, x
sta $9E00, x
lda $9F00, x
sta $9F00, x
inx
bne -
}