I'm sure someone (RichTW?) can explain it better, but R4 (+1) controls how many character lines are drawn before the 6845 starts again by reading the latched values for R12/R13, this is what I meant by "screen".
R7 determines when VSYNC happens and a little while (54 scan lines after the end I think) the next "field" starts to be displayed at the top of the screen (if you haven't pushed the display so far out of spec that it can't work out where it is supposed to be).
I think you will have fun with games that use vertical scrolling with "vertical rupture" (see RichTW's explanation - I think on RS). I guess technically Frogger uses it as it seems to be just multiple "screens" per "field", but AstroBlaster, Phoenix and my Vertical scrolling sprite demo go a bit further by changing R5 to give pixel vertical scrolling.
The feature I would really like to see supported well is the when you point the 6845 at &7C00..&7CFF (and &3C00..&3CFF B/B+) as this gives you the same address on each scan line until the end of the character ROW R9(+1) and so can be used to give N-height pixels without wasting memory or having to copy the same data multiple times. This was described a little in the Chess thread and there is a little more detail in the request on jsbeeb (copied here as I can never find where I put it).
Code: Select all
On a real beeb, setting R12/R13 start of display address gives the following results:
&2000..&23FF displays &3C00+R12R13 wrapping after &3FFF to &3C00
&2400..&27FF displays &3C00+R12R13 wrapping after &3FFF to &7C00
&2800..&23FF displays &7C00+R12R13 wrapping after &7FFF to &7C00
&2B00..&23FF displays &7C00+R12R13 wrapping after &7FFF to &3C00
I don't have my original test app, but this might be OK.
20 MODE 7
40 FOR X%=&3C00 TO &3FFF STEP 4
170 X%?0=ASC(MID$(DIGIT$,1+(X% DIV &1000),1))
180 X%?1=ASC(MID$(DIGIT$,1+((X% DIV &100) AND &F),1))
190 X%?2=ASC(MID$(DIGIT$,1+((X% DIV &10) AND &F),1))
200 X%?3=ASC(MID$(DIGIT$,1+(X% AND &F),1))
Press any key to advance the start address by &100.
PS Good luck, that is quite a task you have set yourself.
PPS The code in b-em is pretty good, as I suspect is the jsbeeb implementation (neither support the bit above correctly though