Sometimes the Hardest Problems Need Only the Simplest Fixes
I have been working on improving video output for my PikaPC homebrew computer. When last I left off, I was able to initialize the video chip to output 320x200 video, but it was only outputting 4 colors instead of 256. I really wanted to get it into the proper 256 color mode.
I never did figure it out.
Throughout this project, I've been referencing an annotated disassembly of the Trio64 VBIOS to try to figure out how to use these chips. I've also spent some time in ghidra working through the ViRGE VBIOS. I am currently working with the Trio64V+ which is different from both of those, but they are all close enough to get a good feel for what is going on. The VBIOS initialization sequence is a little hard to follow because it jumps around quite a bit, and requires some detailed knowledge of the PC platform which I lack. But I was eventually able to find and work through the video mode selection function, stepping through the data tables it used for configuring the myriad registers.
The result? 640x480, 16-bit color, with full linear addressing enabled. Far better than I had hoped for. The results were beautiful! But unfortunately it really called attention to a problem I had been ignoring.
I had initially noticed the problem when trying to write low values (dark colors) to video memory. Higher values tended to work without issue, but darker values would end up written to the wrong location or skipped entirely. There was a pattern to the glitches vaguely resembling incrementing binary values, presumably influenced by the write address.
It didn't make much sense to me. Why would the data value affect the address that the data ended up written to? And why would writing 0, in particular, result in a higher address being affected?
And then the problem got much worse … after I removed my logic analyzer probes.
Where previously only very low value writes would glitch, now any value was potentially affected. The binary pattern was much more pronounced. And over time as I tried to debug the problem, it continued to get worse. Eventually nearly every write would fail.
Ok, this is clearly a timing issue. I've had timing issues before; I know how to handle this. I'll just reduce the clock speed from 25MHz to 20MHz. No change. Perhaps 16MHz? or even 12? I think that made it worse. Well … what if I throw a 32MHz oscillator at it, what might that do? Surely overclocking the system will only …
What? How‽ That is the craziest thing I've seen. When fighting timing issues, the answer is never go faster. But faster really did improve the issue. It did not resolve it completely, but it was much better.
I decided I needed to pull out the big logic analyzer and compare what was happening on my shared Address/Data bus with what was getting latched by the video card's address registers. This required soldering 21 tiny 30-gauge wires to the leads of the TSSOP package register chips. It was very fiddly work that took far longer than it should have, but I got there in the end.
With all the analyzer leads attached, I was finally ready to sit down and figure out what was causing this problem.
There was just one small new problem — there was no problem. With all the test leads attached, it worked flawlessly.
[techknight] pointed out that the probes would change overall capacitance of the bus, which tied into a previous conversation we'd had regarding series termination resistors for high speed signals.
Series termination resistors are small-value (20Ω to 30Ω range, typically) resistors placed near the driver on a bus to help with signal reflections. Adding discrete resistors to my hand-wired prototype would be a challenge. I don't have a lot of board space left over and it would require a significant amount of rewiring.
There was an alternative option though — 74'2244 buffers. Anyone in this hobby deep enough to know a few 7400-series part numbers off-hand might recognize the 74'244 octal bus buffer, but '2244? The difference is integrated series termination resistors. As I understand, series termination resistors work best if they are as close as possible to the output driver, and it's hard to get closer than on-die. Plus, it would mean no wiring changes.
So I ordered a few 74ABT2244 buffers and swapped them in for the 74AHCT244 buffers I had been using. And it works beautifully.
That was such a wild ride. Countless hours debugging for a fix that ended up being so simple. But I'm glad to finally have it working. I plan on exhibiting this project at VCF Southwest 2026 coming up at the end of May. It might not be doing anything interactive, but at least it will be able to make some pretty pictures.