When you wrote "the split value is captured"
When I say "captured" I mean the conditions that must be true for the data to be read and used.
For split and soft scroll you need to think in CRTC coordinates (HCC for horizontal matching against R1,R0 and R2, RCC and VCC for vertical, RCC counter matching against R9, VCC matching against R4 and R7).
Split screen comparison is like this:
SPLT7 SPLT6 SPLT5 SPLT4 SPLT3 SPLT2 SPLT1 SPLT0 == VC4 VC3 VC2 VC1 VC0 RC2 RC1 RC0
SPLT7->SPLT0 are the bit 7 to bit 0 of value written to 6801.
VC4 to VC0 are bits from VCC counter.
RC2 to RC0 are bits from RCC counter.
VCC counter is 7 bits. RCC counter is 5 bits. So some bits are ignored.
For split screen the values are "captured" or "collected" under these conditions:
- If VCC!=R4 and RCC!=R9 and SPLT line is matched (see above), and HCC=R1 then the value in 6802/6803 is stored.
This means you must set 6801 before HCC=R1 and 6802/6803 before HCC=R1 for the split to use your values.
- If VCC==R4 and RCC=R9 and SPLT line is matched (see above), and HCC=(R0-1) (or it could be HCC=R0 I can't tell exactly at the moment), then the value in 6802/6803 is stored. It will not be stored when HCC=R1 in *this* case.
This means you must set 6801 before HCC=R0 and 6802/6803 before HCC=R0. They are ignored at HCC=R1.
MA is the counter inside the CRTC which makes part of the ram address. It is incremented for each char horizontally. At the end of the line it is often reloaded from a stored value. So it resets each scanline. Without split (6801=0), MA is captured at HC=R1 and RCC=R9 and used on the next scanline (i.e. VCC=VCC+1 and RCC=0).
SPLT takes priority.
When SPLT is used:
- When VCC!=0 and RCC!=0 (i.e. not first scanline), stored value is used to set MA at the start of the next scan line.
(e.g. "captured" on VCC=1, RCC=2, stored value used on VCC=1, RCC=3. If "captured" on VCC=1, RCC=7, used on VCC=2 and RCC=0.)
- When VCC=0 and RCC=0 (start of frame) then R12/R13 is *ALWAYS* used for MA. The stored value is then used when VCC=0 and RCC=1.
MA will continue to count with new value until you set a new SPLT which matches OR until RCC=R9 when normal operation continues.
For Delerium Tremens, although R1 is set on last scanline, split happens at the end of the scanline. Also, because R12/R13 is used for first scanline then the left column is always the same, the remaining columns change using the split value.
Soft scroll:
Note: Split has priority over soft scroll and normal operation. If you set the split it uses it.
With vertical soft scroll the RCC=R9 condition to capture MA when HCC=R1 is altered.
It takes SSCR and adds it to RCC. If the condition matches R9 then MA is captured when HCC=R1 and used on next scanline.
Like this:
SSCR=0, R9=7
0 + 0 -> 0
1 + 0 -> 1
2 + 0 -> 2
3 + 0 -> 3
4 + 0 -> 4
5 + 0 -> 5
6 + 0 -> 6
7 + 0 -> 7 <<<MA is captured this line if HCC=R1
SSCR = 5, R9=7
0 + 5 -> 5
1 + 5 -> 6
2 + 5 -> 7 <- MA captured on this line.
3 + 5 -> 0
4 + 5 -> 1
5 + 5 -> 2
6 + 5 -> 3
7 + 5 -> 4
For scroll we also need to look at the RA "outputs" from the ASIC "CRTC":
For soft scroll it appears to make RA+SSCR.
EDIT: Added ASCII art:
HCC=0 HCC=R1 HCC=R0
-----------------------------------------------------------------
| |XXXXXXXXXXXXXXXXXXXXXXX
-----------------------------------------------------------------
^
capture here
HCC=0 HCC=R1 HCC=R0
-----------------------------------------------------------------
| |XXXXXXXXXXXXXXXXXXXXXXX
-----------------------------------------------------------------
^
capture here
HCC=0 HCC=R1 HCC=R0
-----------------------------------------------------------------
| |XXXXXXXXXXXXXXXXXXXXXXX
-----------------------------------------------------------------
^
used here