shave some bytes

This commit is contained in:
4am 2020-11-24 21:18:55 -05:00
parent ba8559c3cf
commit 96508fb725
5 changed files with 32 additions and 33 deletions

View File

@ -46,6 +46,7 @@
sta .mirror_copymasks+$60
sta $C004
; X=0
}
!macro FX_PRECOMPUTED_1BIT_DHGR .coords {

View File

@ -103,14 +103,13 @@ Loop ldy #0
bne +
inc input+1
+ lda reverse_input
beq +
php
dec reverse_input
dec reverse_input
jmp Loop
+ dec reverse_input
dec reverse_input
plp
bne +
dec reverse_input+1
bit $c000
bmi +
jmp Loop
+ rts
bmi ++
+ jmp Loop
++ rts

View File

@ -15,13 +15,14 @@ EndCoordinates1Bit=Coordinates1Bit+$3480
!macro BUILD_MIRROR_COLS .mirror_cols {
; build lookup table to get $27-y for y in $00..$27
ldx #$27
ldx #$28
ldy #$00
- tya
sta .mirror_cols, x
sta .mirror_cols-1, x
iny
dex
bpl -
bne -
; X=0
}
!macro BUILD_SPARSE_BITMASKS .copymasks, .mirror_copymasks {
@ -109,17 +110,17 @@ EndCoordinates1Bit=Coordinates1Bit+$3480
!macro DEC_INPUT_AND_LOOP .loop {
lda input
beq +
php
dec input
dec input
jmp .loop
+ dec input
dec input
plp
bne +
dec input+1
bit $c000
bmi +
jmp .loop
+ rts
bpl .loop
bmi ++
+ jmp .loop
++ rts
}
!macro FX_INITONCE_1BIT .CoordinatesFile, .Start {

View File

@ -62,14 +62,13 @@ Loop ldy #0
bne +
inc input+1
+ lda reverse_input
beq +
php
dec reverse_input
dec reverse_input
jmp Loop
+ dec reverse_input
dec reverse_input
plp
bne +
dec reverse_input+1
bit $c000
bmi +
jmp Loop
+ rts
bmi ++
+ jmp Loop
++ rts

View File

@ -21,9 +21,9 @@ input = $FE ; word
+FX_INITONCE_1BIT CoordinatesFile, Start
Start
+BUILD_HGR_LOOKUP_TABLES hgrlo, hgr1hi
+BUILD_HGR_MIRROR_LOOKUP_TABLES hgrlomirror, hgr1himirror
+BUILD_MIRROR_COLS mirror_cols
+BUILD_HGR_LOOKUP_TABLES_X_IS_ALREADY_0 hgrlo, hgr1hi
+BUILD_HGR_MIRROR_LOOKUP_TABLES hgrlomirror, hgr1himirror
+BUILD_SPARSE_BITMASKS copymasks, mirror_copymasks
+LDADDR Coordinates1Bit
+ST16 input
@ -74,17 +74,16 @@ Loop ldy #0
bne +
inc input+1
+ lda reverse_input
beq +
php
dec reverse_input
dec reverse_input
jmp Loop
+ dec reverse_input
dec reverse_input
plp
bne +
dec reverse_input+1
bit $c000
bmi +
jmp Loop
+ rts
bmi ++
+ jmp Loop
++ rts
CoordinatesFile
!byte 14