fix off-by-1 bug created out of a misunderstanding of a memory corruption bug created by another off-by-1 bug, and also fix the memory corruption bug

This commit is contained in:
4am 2021-12-18 22:23:40 -05:00
parent ab6b87b65d
commit 4fa4a2f611
19 changed files with 56 additions and 49 deletions

View File

@ -8,6 +8,7 @@
!source "src/fx/macros.a"
+OVERCOPY_TO_0 start, end
;$FF clobbered
;X=0
;Y=0
jmp loop

View File

@ -19,6 +19,7 @@ addrs=$BF ; [$40 bytes]
bpl -
+OVERCOPY_TO_0 start, end
;$FF clobbered
;X=0
;Y=0
jmp copyaux

View File

@ -8,6 +8,7 @@
!source "src/fx/macros.a"
+OVERCOPY_TO_0 start, end
;$FF clobbered
;X=0
;Y=0
jmp loop

View File

@ -8,6 +8,7 @@
!source "src/fx/macros.a"
+OVERCOPY_TO_0 start, end
;$FF clobbered
;X=0
;Y=0
jmp loop

View File

@ -8,6 +8,7 @@
!source "src/fx/macros.a" ; no code in here
+OVERCOPY_TO_0 start, end
;$FF clobbered
;X=0
;Y=0
bit <exit

View File

@ -5,12 +5,12 @@
!to "build/FX.INDEXED/SHR.TWOPASS.LR",plain
*=$A000
shrlo = $301 ; $C8 bytes, indexed as shrlo-1,x
shrhi = $38 ; $C8 bytes, indexed as shrhi-1,x
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"
shrlo = $301 ; $C8 bytes
shrhi = $38 ; $C8 bytes
+COPY_TO_0 start, end
+BUILD_SHR_LOOKUP_TABLES shrlo, shrhi
;X=0

View File

@ -68,10 +68,10 @@
!macro BUILD_SHR_MIRROR_ROWS_AND_COLS .mirror_rows, .mirror_cols {
; out: X=0
; Z=1
ldx #$C6
ldx #$C7
ldy #$00
- tya
sta .mirror_cols-$27, x
sta .mirror_cols-$28, x
sta .mirror_rows-1, x
iny
dex

View File

@ -5,8 +5,8 @@
!to "build/FX.INDEXED/SHR.DIAGONAL",plain
*=$A000
shrlo = $301 ; $C8 bytes
shrhi = $201 ; $C8 bytes
shrlo = $301 ; $C8 bytes, indexed as shrlo-1,x
shrhi = $201 ; $C8 bytes, indexed as shrhi-1,x
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"

View File

@ -11,7 +11,7 @@ fracv_hi = $F9
incv = $FA ; byte
src = $FC ; word
dst = $FE ; word
palettes = $BD00 ; $200 bytes
palettes = $BC00 ; $200 bytes
!source "src/fx/macros.a"

View File

@ -19,6 +19,7 @@ addrs=$7F ; [128 bytes]
bne -
+OVERCOPY_TO_0 start, end
;$FF clobbered
;X=0
;Y=0

View File

@ -5,12 +5,12 @@
!to "build/FX.INDEXED/SHR.IRIS",plain
*=$A000
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
mirror_rows = $106 ; $C8 bytes
shrlo = $200 ; $C8 bytes
shrhi = $300 ; $C8 bytes
coords = $9F00 ; $1F41 bytes
CoordinatesFileCopy = $BE42; $11 bytes
mirror_cols = $BE60 ; $A0 bytes but clobbers $27 previous bytes during construction
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"

View File

@ -5,12 +5,12 @@
!to "build/FX.INDEXED/SHR.IRIS.IN",plain
*=$A000
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
mirror_rows = $106 ; $C8 bytes
shrlo = $200 ; $C8 bytes
shrhi = $300 ; $C8 bytes
coords = $9F00 ; $1F41 bytes
CoordinatesFileCopy = $BE42; $11 bytes
mirror_cols = $BE60 ; $A0 bytes but clobbers $27 previous bytes during construction
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"

View File

@ -8,11 +8,12 @@
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"
shrlo = $301 ; $C8 bytes
shrhi = $37 ; $C8 bytes
shrlo = $301 ; $C8 bytes, indexed as shrlo-1,x
shrhi = $37 ; $C8 bytes, indexed as shrhi-1,x
+BUILD_SHR_LOOKUP_TABLES shrlo, shrhi
+OVERCOPY_TO_0 start, end
;$FF clobbered
;X=0
;Y=0
+COPY_SCB_AND_PALETTES

View File

@ -5,8 +5,8 @@
!to "build/FX.INDEXED/SHR.LR2",plain
*=$A000
shrlo = $301 ; $C8 bytes
shrhi = $38 ; $C8 bytes
shrlo = $301 ; $C8 bytes, indexed as shrlo-1,x
shrhi = $38 ; $C8 bytes, indexed as shrhi-1,x
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"

View File

@ -5,13 +5,13 @@
!to "build/FX.INDEXED/SHR.RADIAL",plain
*=$A000
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
mirror_rows = $106 ; $C8 bytes
shrlo = $200 ; $C8 bytes
shrhi = $300 ; $C8 bytes
coords = $9F00 ; $1F41 bytes
last_coords = coords+$1F3E
CoordinatesFileCopy = $BE42; $11 bytes
mirror_cols = $BE60 ; $A0 bytes but clobbers $27 previous bytes during construction
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"

View File

@ -5,13 +5,13 @@
!to "build/FX.INDEXED/SHR.RADIAL2",plain
*=$A000
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
mirror_rows = $106 ; $C8 bytes
shrlo = $200 ; $C8 bytes
shrhi = $300 ; $C8 bytes
coords = $9F00 ; $1F41 bytes
last_coords = coords+$1F3E
CoordinatesFileCopy = $BE42; $11 bytes
mirror_cols = $BE60 ; $A0 bytes but clobbers $27 previous bytes during construction
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"

View File

@ -5,12 +5,12 @@
!to "build/FX.INDEXED/SHR.RIPPLE",plain
*=$A000
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
mirror_rows = $106 ; $C8 bytes
shrlo = $200 ; $C8 bytes
shrhi = $300 ; $C8 bytes
coords = $9F00 ; $1F41 bytes
CoordinatesFileCopy = $BE42; $11 bytes
mirror_cols = $BE60 ; $A0 bytes but clobbers $27 previous bytes during construction
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"

View File

@ -5,12 +5,12 @@
!to "build/FX.INDEXED/SHR.SOFT.IRIS",plain
*=$A000
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
mirror_rows = $106 ; $C8 bytes
shrlo = $200 ; $C8 bytes
shrhi = $300 ; $C8 bytes
coords = $9F00 ; $1F41 bytes
CoordinatesFileCopy = $BE42; $11 bytes
mirror_cols = $BE60 ; $A0 bytes but clobbers $27 previous bytes during construction
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"

View File

@ -5,12 +5,12 @@
!to "build/FX.INDEXED/SHR.SOFTIRIS.IN",plain
*=$A000
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
mirror_rows = $106 ; $C8 bytes
shrlo = $200 ; $C8 bytes
shrhi = $300 ; $C8 bytes
coords = $9F00 ; $1F41 bytes
CoordinatesFileCopy = $BE42; $11 bytes
mirror_cols = $BE60 ; $A0 bytes but clobbers $27 previous bytes during construction
!source "src/fx/macros.a"
!source "src/fx/fx.shr.common.a"