;license:MIT ;(c) 2021 by 4am ; shrlo = $201 ; $C8 bytes CoordinatesFileCopy = $2C8; $11 bytes shrhi = $301 ; $C8 bytes mirror_cols = $1E29 ; $A0 bytes but clobbers $28 bytes before mirror_rows = $1F01 ; $C7 bytes coords = $9F00 ; $1F41 bytes !source "src/constants.a" !source "src/macros.a" !source "src/fx/fx.shr.common.a" start ldx #$C6 ldy #$00 - tya sta mirror_cols-$27, x sta mirror_rows-1, x iny dex bne - +BUILD_SHR_LOOKUP_TABLES shrlo, shrhi ;X=0 +COPY_SCB_AND_PALETTES ;WRITEAUXMEM active +WRITE_MAIN ;X=0 - lda start, x sta $9D00, x lda start+$100, x sta $9E00, x inx bne - jmp stage2 !pseudopc *-$300 { stage2 ldx CoordinatesFile ; LOAD_FILE_AT macro destroys pathname - lda CoordinatesFile, x ; so we need to make a copy sta CoordinatesFileCopy, x dex bpl - +READ_RAM2_WRITE_RAM2 +LOAD_FILE_AT CoordinatesFileCopy, coords ;WRITEMAINMEM active after LOAD_FILE_AT macro ldx #(endzp-startzp) ; copy loop code to zero page - lda startzp-1, x sta $FF, x dex bne - +WRITE_AUX jsr InputLoop +WRITE_MAIN ldx #$00 - lda $9D00, x ; copy main code back to $A000 sta start, x ; so it can be called again if necessary lda $9E00, x sta start+$100, x inx bne - +READ_RAM1_WRITE_RAM1 rts startzp !pseudopc 0 { InputLoop input ldx coords ; first value: SHR row (only 0..99 will be in input array) bmi exit ; if > 127 then we're done ldy #1 lda (