Is line -29 508 or 512 cycles in the working scenario? I've redone my visual check and there's a very obvious 4 pixel difference between line -29 and -28 that the only explanation I can think of I really should just write code to test.Steven Seagal wrote:What matters is what you see. This line -29 should be 60hz (NTSC) but you see that it starts at the 50hz position (PAL), so that's what happens, right?
You couldn't know, but there's a hack in Steem for precisely this program at this scanline, when the shifter counter is read, the value has to be as for a 50hz line (starting at cycle 56), if it's 2 bytes higher (starting at cycle 52), the screen is broken.
I thought it had something to do with Steem internal problems, but your visual inspection implies that it's a ST issue.
Working:
-30 - 388:S0000 474:S0000 496:r0900 512:T0100 512:#0000
-29 - 004:r0900 024:r0900 044:r0900 064:r0900 084:r0908
Anyway,
This is a first stab at it - and mostly just to show what I mean. It's not fully complete (STE lacking, doesn't use H to trigger actual line starts/ends), and currently only deal with line lengths. It's very similar to Alien's pseudo-code state machines for a reason - those were pretty complete besides the new wakestate knowledge.troed wrote:It's relatively straight forward to convert Paolo's Excel-sheet into a pseudo-code state machine. I might do that later.
Code: Select all
VAR H; H signal as per Alien's doc
VAR LINE; PAL = 512 cycle 50Hz, NTSC = 508 cycle 60Hz, HIRES = 224 cycle 71Hz
VAR RES; $ff8260, 0 = LO, 2 = HI
VAR FREQ; $ff820a, 0 = 60, 2 = 50
VAR BLANK; Activate blank (? Alien's doc says it isn't used in high res but obviously is causative)
Cycle values are for WS3/4. In WS1 all ff8260 state checks happen 2 cycles earlier, in WS2 2 cycles later.
6 IF(RES == HI) H = TRUE
[lots of checks relating to blank skipped]
(32 IF(RES == HI) LINE = HIRES // todo, there must be a matching position for LORES, if it isn't default)
58 IF(RES == LO) H = TRUE // todo, "unique spot"
166 IF(RES == HI) H = FALSE
186 IF(RES == HI) BLANK = TRUE
378 IF(RES == LO) H = FALSE
["no line 1" and "no line 2" not handled - want to understand what checks cause them]
Cycle values are for WS1/3, in WS2/4 all ff820a state checks happen 2 cycles later
[checks relating to blank skipped]
52 IF(FREQ == 60) H = TRUE
54 IF(FREQ == 50) LINE = PAL // todo, there must be a matching position for NTSC, if it isn't default
56 IF(FREQ == 50) H = TRUE // todo, "unique spot"
372 IF(FREQ == 60) H = FALSE
376 IF(FREQ == 50) H = FALSE

Opinions - Steven and Nicolas?