[stella] Implementing a moving window that wraps...

Thom Cherryhomes thom.cherryhomes at gmail.com
Sun Apr 8 14:51:32 CDT 2007


I am trying to implement a moving window that wraps.....

say you have 32 bytes in zero page, something like

00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16
17 18 19 1a 1b 1c 1d 1e 1f

and you display, 22 of them on screen at a given time:

[00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15] 16
17 18 19 1a 1b 1c 1d 1e 1f

I'm trying to implement an algorithm that implements this moving
window, BUT it wraps around to the beginning after the end has been
reached:

00 01] 02 03 04 05 06 07 08 09 0a 0b [0c 0d 0e 0f 10 11 12 13 14 15 16
17 18 19 1a 1b 1c 1d 1e 1f

(as an aside, the values are the low byte of an indirect address to
LDA into PF1 and PF2 respectively....)

what would be the best way to implement this?

-Thom




More information about the Stella mailing list