ijor wrote: Wed May 07, 2025 4:06 am
You have the basic idea right. Yes, this is how MMU works. I say MMU and not Shifter, because Shifter doesn't know, neither care, about video addressing or vsync. Shifter only knows about individual scan lines.
Thanks. That's a start -- so each individual burst of LOADs between HSYNCs is indeed a full scanline rather than part of one and part of another?
Perhaps I can work per-scanline rather than per-frame to narrow down my issue.
Well, you missed to give us more context and info, at least if you want us to help you.
From what you said I don't have a clue about how you are doing this. I assume the code you posted is some kind of seudo code. But are you using a PLD, a fast Micocontroller like a Pico, or may be both? If it's a PLD, how you actually implement this? Are you using a flip flop clocked by LOAD?
Yes, it's just dodgy pseudocode. I'm trying to establish if the concept is right. For example, if the data appearing at the shifter is potentially offset (eg. it always loads half a line ahead or something) then I'd need to alter my logic.
A CPLD is monitoring LOAD on the Shifter, plus VSYNC, HSYNC etc from the Glue and sampling the shifter's data lines.
The sampling is clocked by the rising edge of LOAD and the counter is reset at the falling edge of VSYNC. The data is then clocked out to a micro controller for inspection.
The pipe and the decoding has been shown to work when sniffing CPU writes to the screen memory, but it's possible the sheer bandwidth of reading a full screen every 20ms has exposed a limitation. Before I disappear down a rabbit hole, I wanted to be sure the approach wasn't fundamantally flawed based on a misunderstanding on my part.
How do you know the problem is on that (seudo) code you posted and not on whatever post processing you do to actually display the screen?
I don't. Yet. I wanted to make sure I wasn't working under a misapprehension.
Code: Select all
screendata[offset] = D[15:0]
offset += 2
Offset += 2 is probably wrong. I assume this is seudocode and this is just a typo when you transcribed the actual code into seudo code. But once again, without more info we just keep wondering.
Yeah, translation error. It is +2 in address space, but should have been +1 in the pseudocode.
The symptom I'm seeing is is that probably around 50% of the frames are aligned as expected, but there's a (memory) offset to the rest. Eg. the 0,0 position might start a third of the way across the screen and wrap around. Or even several scanlines down the screen.
If that's just a problem in my CPLD-to-micro data transfer, great: I'll work on it. If it's caused by my naivety then I'd rather know now.
Thanks,
BW