Wack0 / maciNTosh

PowerPC Windows NT ported to Power Macintosh systems
GNU General Public License v2.0
522 stars 16 forks source link

Graphical Corruption with Rage 128 on B&W G3 #3

Closed Compgeke closed 2 months ago

Compgeke commented 2 months ago

Another fun not-Powerbook bug. The factory Rage 128 does not seem to be functioning as intended with the ATI driver support. The display has vertical lines through and text is both massive and wrapping. Image is attached.

G3_NT4_GraphicalCorruption G3_NT4_GraphicalCorruption2

Wack0 commented 2 months ago

I'll reverse the OS9 driver for that card when I get time, to see if I'm missing anything in particular, but given that I don't have the hardware, there's only so much I'll be able to do.

What does open firmware fcode set up the card to be? I just blindly try to set 32bpp, so if some card comes up in 1024x768 and doesn't have enough vram to handle 32bpp in that resolution I'm sure there will be issues there.

Wack0 commented 2 months ago

(some reversing later)

...turns out the various MMIO registers are in totally different positions on these cards! no wonder the modeswitch isn't working correctly lol

Wack0 commented 2 months ago

Can you try the latest release? Hopefully it will at least try to modeswitch, but without having the hardware there's not much else I can suggest other than experimenting with the timing registers...

Compgeke commented 2 months ago

No such luck, actually seems to have made it a bit worse. I'll see if I can poke around a bit later once I get some free time. If there's anything you'd like me to poke at with the real hardware I can definitely try.

G3_NT4_GraphicalCorruption_0 2

Wack0 commented 2 months ago

Can you try this? This adds a write to the hsync start/width register, which I only didn't implement because I observed no difference on lombard, but probably is important on desktops lol.

nt_arcfw_grackle_fwonly_test20240713_1731.zip

Compgeke commented 2 months ago

Unfortunately no luck with that either, exact same thing.

Wack0 commented 2 months ago

Yeah, I just found out that the MMIO base address for the rage4 cards are at a different assigned-address.

Try this one. nt_arcfw_grackle_fwonly_test20240713_1955.zip

Compgeke commented 2 months ago

Good news, that one's actually improved it a bit! It's not 100% perfect but it's no longer wrapped, just blue and triplicated.

G3_NT4_GraphicalCorruption3

Wack0 commented 2 months ago

yeah, that's probably DSP timing issues...

can you try this one?

nt_arcfw_grackle_fwonly_test20240713_2005.zip

Compgeke commented 2 months ago

Got the same result with it.

Wack0 commented 2 months ago

ok, so the hsync register doesn't matter it seems?

can you try this?

nt_arcfw_grackle_fwonly_test20240713_2013.zip

Compgeke commented 2 months ago

With this version, we've got the same triplicating/blue lines but now the display's actually all black. No more readable text or anything. G3_NT4_GraphicalCorruption4

Wack0 commented 2 months ago

ok, can you try this one? just want to see what it does when the DSP timing registers aren't touched:

nt_arcfw_grackle_fwonly_test20240713_2024.zip

Compgeke commented 2 months ago

With that one back to the normal blue/triplicate stuff.

Wack0 commented 2 months ago

looking at the register documentation again, one of the DSP registers are slightly different on rage4, two of the fields changed positions.

try this one:

nt_arcfw_grackle_fwonly_test20240713_2037.zip

Compgeke commented 2 months ago

This one's actually getting a bit closer. The entire display is now blue, although there's still broken text and some duplication.

G3_NT4_GraphicalCorruption5

Wack0 commented 2 months ago

ok, so it is DSP timing stuff...

just saw an issue with the DAC gamma table, so hopefully this at least fixes the colours:

nt_arcfw_grackle_fwonly_test20240713_2045.zip

Compgeke commented 2 months ago

That is correct! Now have proper color. G3_NT4_GraphicalCorruption6

Wack0 commented 2 months ago

ok, can you try this one?

nt_arcfw_grackle_fwonly_test20240713_2225.zip

Compgeke commented 2 months ago

Getting closer. Now the colors are correct and the text is readable. G3_NT4_GraphicalCorruption7

Wack0 commented 2 months ago

this is now just trial and error of dsp timing register changes and observing the output:

nt_arcfw_grackle_fwonly_test20240713_2239.zip

Compgeke commented 2 months ago

This one lost the color lines, but we're back to the same missing text as the 2nd previous test.

Wack0 commented 2 months ago

nt_arcfw_grackle_fwonly_test20240713_2248.zip

Compgeke commented 2 months ago

G3_NT4_GraphicalCorruption8

Wack0 commented 2 months ago

tried reimplementing how the linux driver sets the DSP timings, along with reimplementing how the OS9 driver gets the vclk

nt_arcfw_grackle_fwonly_test20240713_2331.zip

Compgeke commented 2 months ago

Good news! That one's fixed it. We now have properly functioning Rage 128 graphics. G3_NT4_GraphicalCorruption89

JonObst commented 2 months ago

With this latest test zip, NT bootloader freezes here during initial isntall:

image

Not sure if this was supposed to be a fully working ISO or if it has bits missing, apologies if it is the latter. Also I see that the instructions say to install "PowerMac General HID & Storage" but it appears to be named "ADB and USB" in this build.

Compgeke commented 2 months ago

Just curious, did you get through the text-mode setup and all that jazz yet? I'm not able to actually make it through the setup at all, documented here: https://github.com/Wack0/maciNTosh/issues/5

JonObst commented 2 months ago

No, I only got as far as loading the drivers - I hadn't yet been asked to select a keyboard layout. Happy to turn this into a new issue or add to #5 to get it out of this now resolved topic.

Wack0 commented 2 months ago

OK, this crash on boot looks like HAL dying early. Possibly PCI related, which I tried to work around as I read somewhere that blindly enumerating the PCI bus on these systens can freeze, but I probably didn't do it right due to lack of real hardware to test with. Different issue anyway.

(And yes, the driver name is different, due to being my own test ISO rather than a properly cleaned up release build.)

Regarding this specific issue, I'll clean things up for commit and release later.

Wack0 commented 2 months ago

This is fixed by https://github.com/Wack0/maciNTosh/commit/cc6fe4964fdfbd87b03dba1a1468ed966641e511 although I'd rather wait to fix #8 before making another release. In any case, closing this issue now.