Heaven/TQA, on Fri Nov 5, 2010 1:43 PM, said:
ok... and how do you want to scroll after 4 pixel? shift the complete screen? and did you made any CPU calculations?
did you had a look at the Menace 6502 sources?
I haven't looked at those sources. Where can I find them please?
I'm fine scrolling every third vblank (I've tried other settings 1 and 2 are too fast and slower than 3 just looks too jerky). I scroll for 4 chars then do a course scroll.
1.) Outside of vblank in the main loop I'm thinking a series of tables that define the map and call the copy routines to create the map in the off screen areas. I think this should work because they are not time critical as long as the area is off screen.
Not sure it is the best way go about it because 2.) Since the scroll will be at a constant rate maybe I should 100% sync the copying with this and I should copy the graphics during the 2 vblank entries when the scrolling is not being updated and skip it when we're scrolling (course or fine), or draw during fine scroll and only skip drawing during the coarse scroll. I'll have to experiment and see.
mainloop
<--- 1.) draw map here (need to keep track of where the screen is.)
jmp mainloop
vblank
<--- 2.) or draw map here (every frame)
count to 3
if not 3 then vblank end
fine scroll
if fine scrolled 4 chars then coarse scroll
<--- 3.) or draw map here (unless we're going to coarse scroll)
jmp vblank end
coarse scroll
vblank end
Worst case copy scenarios.
Each column = 8 x 24 bytes = 192 bytes
option 1.) No sure how quick this will be
option 2.) will copy 48 bytes (Quarter of a column) into the buffer per fine scroll
option 3.) Will copy all 4 columns = 768 bytes
I think I'm swaying towards option 2, especially when I consider I'll not be writing the full complement of 48 bytes each time.
Thanks everyone for your input so far.
A