Jump to content



1

window algorithm


2 replies to this topic

#1 tschak909 OFFLINE  

tschak909

    Chopper Commander

  • 159 posts
  • Location:USA

Posted Sat Mar 10, 2007 2:37 AM

I am needing to put together a window algorithm for coarse scrolling...maybe it's just me being up at 3:30 in the morning, and my head is mush, but......

I have a buffer of 32 values, and I need to display 25 of them on screen at a given time, from top, to bottom, and once it hits the bottom, the window needs to warp back around to the top while part of it is still on the bottom....

maybe i'll come up with an answer tomorrow, but.. i wanted to get some input from you guys as well.

thanks. :-)

-Thom

p.s. this is a very difficult challenge for me, because of the limited memory constraints ($FF,x) and stuff...not enough memory..... and I am trying to do the display part of this tight enough to keep the kernel stable.... and i hope i can calculate the new offscreen data for the next 1 or two lines ahead during the overscan or vertical blank....

I was thinking something akin to two counters, c2 = c1 + size of buffer & size of buffer ? .... damn I need to go to bed....

Edited by tschak909, Sat Mar 10, 2007 2:41 AM.


#2 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Sat Mar 10, 2007 3:58 PM

So all you really need to do is reset an index value when it's bumped 32 times? Why not just do this in the display kernal?

inc $counter ;5
lda $counter ;3
and #$1F ;2
sta $counter ;3

This could be done after each of the 25 bands...and then by loading the value of $counter to an index register, the proper data can be loaded for that band during the kernal portion that displays them.

Are you hurting for cycles on every scanline of the display?

#3 tschak909 OFFLINE  

tschak909

    Chopper Commander

  • 159 posts
  • Location:USA

Posted Sat Mar 10, 2007 4:26 PM

Ah yes! That makes sense! was making it more complicated than it needed to be. :-D

Thanks!

p.s. no i _shouldn't_ be for now, although things might get interesting when i start displaying fishermen and bears.

-Thom




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users