;license:MIT ;(c) 2021 by 4am ; !cpu 6502 !to "build/FX.INDEXED/SHR.RADIAL",plain *=$A000 mirror_rows = $106 ; $C8 bytes shrlo = $200 ; $C8 bytes shrhi = $300 ; $C8 bytes coords = $9F00 ; $1F41 bytes last_coords = coords+$1F3E shr_mirror_cols = $BE60 ; $A0 bytes but clobbers $27 previous bytes during construction !source "src/fx/macros.a" +SHR_STAGE_1 shrlo, shrhi, mirror_rows, shr_mirror_cols jmp stage2 !pseudopc *-$300 { stage2 +LOAD_SHR_COORDINATES_AT coords, CoordinatesFile ;WRITEMAINMEM active lda #$80 sta coords-2 +SHR_STAGE_2 startzp, endzp rts CoordinatesFile +PSTRING "SHR.RADIAL.DATA" startzp !pseudopc 0 { ; bottom-left quadrant (opposite row, original column, reverse input order) LoopBL ldx last_coords ; SMC bmi LoopTL lda mirror_rows, x tax ldy #1 lda (LoopBL+1), y tay jsr copy lda $200) { !serious "Stage2 code is too large" } }