diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-05-08 12:48:50 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-05-08 12:48:50 -0400 |
commit | 5db9af7b0d1d027b9325b45917ab46beaa52d5a0 (patch) | |
tree | 99ee8f01b2a51690ef3eb95bf5e644fd9f256e3c /programs | |
parent | 6cb51003b5afeb061955925e4d704743925893da (diff) |
Rewrite `clr_arr` to use the ortho extension.
This makes the code much smaller than the previous
version.
Diffstat (limited to 'programs')
-rw-r--r-- | programs/sub-suite/subeditor.s | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/programs/sub-suite/subeditor.s b/programs/sub-suite/subeditor.s index 1053790..aa9482a 100644 --- a/programs/sub-suite/subeditor.s +++ b/programs/sub-suite/subeditor.s @@ -68,19 +68,16 @@ init_tables: clr_arr: - pha.q ; Preserve A. - and #0 ; Reset A. + pha.q ; Preserve A. + and #0 ; Reset A. @loop: - mov.q (d), a ; Clear 16 bytes. - mov.q (d+8), a ; - add d, #$10 ; Increment the pointer by 16. - sub s, #$10 ; Subtract 16 from the size. - bcc @end ; We've reached the end of the array, so we're done. - beq @end ; - bra @loop ; Keep looping. + mov.q (d+s), a ; Clear 16 bytes. + mov.q (d+s+8), a ; + sub s, #16 ; Subtract 16 from the size. + bcs @loop ; We haven't reached the end, so keep looping. @end: - pla.q ; Restore A. - rts ; End of clr_arr. + pla.q ; Restore A. + rts ; End of clr_arr. pnt_strt: |