Login  •  Register


The time is now: Mon Feb 20, 2017 10:55 am

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 2 [ 27 posts ]    Go to page 1, 2  Next
Print view Previous topic  |  Next topic
Author Message
PostPosted: Sun Feb 05, 2017 3:27 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
Apparently, DOSBox has Voodoo2 emulation working, that translates Glide2 calls to OpenGL.

http://www.vogons.org/viewtopic.php?t=25888

http://dl.dropbox.com/u/7801769/DOSBox%20Glide%20Wrapper%20for%20OSX_Intel.dmg

I wonder if we can use this with Qemu to emulate a Voodoo2 in OS 9?

Here are the diff's for it, but I'm not sure what version of DOSBox's source code they are build against.

DOSBox ?Windows?.

https://drive.google.com/open?id=0B9sU4v5iZl0pMjZfbHd6aUF6VjQ

DOSBox OS X:

https://drive.google.com/open?id=0B9sU4v5iZl0pTEJDZGNWREt4Wm8


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Feb 05, 2017 10:46 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
Just looking at the code for DOSBox, it looks like it uses SDL for windowing and OpenGL calls to the host. So, I figured a good starting place would be to get a working SDL build of Qemu.

I tried first with the Qemu source from GitHub, but that built, but I got some crazy error when I run make install, about a missing file. Remembering that alex made an SDL build, I used his source linked in the mega thread, and it seemed to build fine with --enable-sdl --disable-cocoa in the configure script.

Now I have an SDL build, that supports screen scaling in windowed mode:

Image

Image

I guess that's the easy part, I've tried to apply the diff's to DosBox's latest SVN, but I get errors when I try and make it. Once I figure out how to get it to compile clean, I'll start to figure out how it does it's voodoo emulation, and how hard it will be to port to Qemu.

Here is an updated diff against the lastest SVN for DOSBox, still need to run the OS X diff linked in my first post.

https://drive.google.com/open?id=0B9sU4v5iZl0pZHg3aVdiZFA5bWc

Just cd to the DOSBox source dir and run:

Code:
patch -p0 -i < voodoo_20160825.diff


and:

Code:
patch -p0 -i < voodoo_fix.diff


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 12:57 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
Ok, so now I think the next step is to get the Voodoo2 to enumerate on the PCI Bus of the emulated mac, I found something interesting in the pic_database.c:

Code:
static const pci_dev_t vga_devices[] = {
    {
        PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RAGE128_PF,
        NULL, "ATY",      "ATY Rage128", "VGA\0",
        0, 0, 0,
        NULL, NULL,
    },
    {
        PCI_VENDOR_ID_QEMU, PCI_DEVICE_ID_QEMU_VGA,
        NULL, "QEMU,VGA", "Qemu VGA",    "VGA\0",
        0, 0, 0,
        NULL, NULL,
    },
    {
        0xFFFF, 0xFFFF,
        NULL, NULL, NULL, NULL,
        -1, -1, -1,
        NULL, NULL,
    },
};

static const struct pci_iface_t vga_iface[] = {
    {
        0x00, "VGA controller", NULL,
        vga_devices, &vga_config_cb, NULL,
    },
    {
        0x01, "8514 compatible controller", NULL,
        NULL, NULL, NULL,
    },
    {
        0xFF, NULL, NULL,
        NULL, NULL, NULL,
    },
};

static const pci_subclass_t displ_subclass[] = {
    {
        PCI_SUBCLASS_DISPLAY_VGA, "display controller",
        NULL, NULL, vga_iface,
        NULL, NULL,
    },
    {
        PCI_SUBCLASS_DISPLAY_XGA, "XGA display controller",
        NULL, NULL, NULL,
        NULL, NULL,
    },
    {
        PCI_SUBCLASS_DISPLAY_3D, "3D display controller",
        NULL, NULL, NULL,
        NULL, NULL,
    },
    {
        PCI_SUBCLASS_DISPLAY_OTHER, "misc display controller",
        NULL, NULL, NULL,
        NULL, NULL,
    },
    {
        0xFF, NULL,
        NULL, NULL, NULL,
        NULL, NULL,
    },
};


I wonder why there is a ATY, Rage128?

Anyway, I think the part I'm interested in is PCI_SUBCLASS_DISPLAY_3D, "3D display controller". I don't think the Voodoo2 was a VGA device, I think it just did VGA passthrough, tho I'm not sure what class of device it was, I think the subclass was "3D display controller".


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 2:37 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
hmmmmmm...................

Image

The ATI Extensions didn't load, I'm sure the Startup would have bombed out if they did. I really still emulating the QEMU_VGA, I think I just changed the Vendor ID the Device ID and the name in the Device Tree, but that should have been enough to load the ATI Extensions?

It maybe easier to try and emulate the Rage 128, than the Voodoo2, I still have to track down the 3DFX Voodoo2 Extensions, they seem to be lost to the internet, and I'm unsure of the Class Type of a Voodoo2, but I have all that nice code from DOSBox, that gives the perimeters of the Voodoo2, and translates Glide calls from the Guest, to OpenGL calls for the Host.

However, I believe AMD released the Technical Documentation for the Rage Chips, and there are Open Source Linux driver for it, so maybe I can glean the info needed to emulate the Rage Chip, and the Rage Pro 128 has OpenGL drivers in OS X, and there are no drivers for the Voodoo.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 2:58 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
Hmmmmm.............

Image

That's Panther( 10.3.9 ), I get some weird screen redraws, and the mouse pointer tends to disappear, but then I'm not emulating the Rage 128 chip, itself, I'm still emulating whatever GPU QEMU_VGA uses?

It's progress, none the less.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 4:02 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
Ok, I need to extract the NDRV from the Rage 128 Pro rom:

http://campahunta.free.fr/Downloads/ROMs/ati_oem_rage128pro_110_agp_full.zip

I know it starts with:

Code:
Joy!peffpwpc.........


But I don't know where it ends?

Alex?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 4:36 pm 
Offline
Tinkerer

Joined: Sun Sep 28, 2014 11:53 am
Posts: 76
Location: China
There's another emulator that have the Voodoo 2 emulation. It's PCem that implement Voodoo/Voodoo 2 emulation on register level.
And, the Voodoo 2 Macintosh drivers can be found here: http://falconfly.de/voodoo2.htm


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 5:25 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1450
If you want software compatability, ATi Rage is the way to go, not Voodoo; a lot of 3D-dependent software from the OS 9-10.2 era depended explicitly on the Rage chipset, due to that being inside the iMac.

The best route forward is probably a Rage 128 -> OpenGL 1.2 emulation, if we can figure out how to pass that through to the host graphics subsystem; probably not a good idea to make it platform specific and have to maintain Mac/Win/Lin branches.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 6:22 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
kikyoulinux wrote:
There's another emulator that have the Voodoo 2 emulation. It's PCem that implement Voodoo/Voodoo 2 emulation on register level.
And, the Voodoo 2 Macintosh drivers can be found here: http://falconfly.de/voodoo2.htm


Thanks, tho I may go the Rage/Radeon rout, once I get some preliminary support going, I'll revisit the Voodoo chipsets, as I love Glide.


Last edited by darthnvader on Mon Feb 06, 2017 6:33 pm, edited 1 time in total.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 6:28 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
So far, my code changes to Qemu, should build on any platform. I'm going to try to just get SDL to pass the OpenGL calls to the Host, should work on all platforms.

I can't find the Rage Pro 128 documentation, ATI/AMD may have never released it, tho there is an open source Linux driver, so it maybe best to target the Readon 8500, as that is the last GPU that supports OS 9 and X, but I think it will be a lot harder than the Rage 128, so may more registers to write and debug.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 9:25 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
Hmmmmmmmmm............................................

Image


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 9:28 pm 
Offline
Apple Corer

Joined: Fri Sep 17, 2004 4:22 am
Posts: 279
kikyoulinux wrote:
There's another emulator that have the Voodoo 2 emulation. It's PCem that implement Voodoo/Voodoo 2 emulation on register level.
So does Bochs, but it's not in the official binaries. The relevant patch is derived from DOSBox; perhaps whatever changes were made there would be useful here?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Feb 06, 2017 10:01 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
Likely would, I think Qemu uses the VGA code from Bochs.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Feb 08, 2017 10:21 am 
Offline
Expert User
User avatar

Joined: Fri Feb 13, 2004 8:59 am
Posts: 4048
Location: Sittard, The Netherlands
At lot of work has been done in qemu to provide opengl to guests:

https://wiki.yoctoproject.org/wiki/Open ... gh_in_QEMU
https://www.kraxel.org/slides/qemu-opengl/
https://virgil3d.github.io/
source code: https://cgit.freedesktop.org/virglrenderer

best,
Cat_7


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Feb 10, 2017 12:24 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
I tried playing around with Bochs, to get an idea how Voodoo2 emulation works, but it's dog slow.

I mean, it was faster on my old Powermac 8600 with a 450 Mhz G3 upgrade card, 45 Mhz bus.

Even running Dos in Bochs is too slow, what a piece of crapware. I don't know what they did to Bochs in the last 15 years since I used it last, but I can't see how useful Voodoo emulation is supposed to be on a system that can only emulate an 8 Mhz cpu.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sat Feb 11, 2017 9:34 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
I'm trying to work on the voodoo2, I've got it initializing in Open Firmware, and OS X can see it in the IOReg, but the drivers can't see the device in OS 9.

Image

Image

The System Profiler doesn't show the card in OS 9, or OS X, so I need to figure out why?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Feb 12, 2017 9:30 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1450
Which machine are you emulating in qemu?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sun Feb 12, 2017 10:08 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
I'm emulating mac99, seems I need to set the subsystem-id, and maybe the sub-device-id, and sub-class id, for OS 9 to load the drivers.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Feb 14, 2017 12:48 am 
Offline
Expert User
User avatar

Joined: Fri Feb 13, 2004 8:59 am
Posts: 4048
Location: Sittard, The Netherlands
It seems pcem emulates the Voodoo1 and 2:

https://bitbucket.org/pcem_emulator/pce ... at=default

Best,
Cat_7


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Feb 16, 2017 2:00 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
Hmmmm...............

Image

Image

I can't seem to understand where the NDRV is coming from in Qemu, I'm handing it the proper FCode rom, but somehow it's getting an NDRV, from somewhere other than the Rom file:

Image

Image


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Feb 16, 2017 6:07 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1450
Where are the VGA additions being injected? This could help answer the NDRV question. Could that area in the OpenBIOS also be where the NDRV data is being populated?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Thu Feb 16, 2017 10:10 pm 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
adespoton wrote:
Where are the VGA additions being injected? This could help answer the NDRV question. Could that area in the OpenBIOS also be where the NDRV data is being populated?


I'm not sure what the question you're asking is.

Here's what I get when I try and load OS 9 with the Voodoo4 NDRV:

Image


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Feb 17, 2017 1:18 am 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 1450
What I'm asking is up a layer from that... I'm wondering at what point the VGA patch injects into the OpenBIOS. I can probably find out by statically walking through the OpenBIOS code when I next get a chance. I just know that the VGA code is loaded as an entire object into memory, and this could be happening with the NDRV entry too, not during the regular load sequence.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Feb 17, 2017 2:00 am 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
adespoton wrote:
What I'm asking is up a layer from that... I'm wondering at what point the VGA patch injects into the OpenBIOS. I can probably find out by statically walking through the OpenBIOS code when I next get a chance. I just know that the VGA code is loaded as an entire object into memory, and this could be happening with the NDRV entry too, not during the regular load sequence.


You lost me, it's a bit over my head.

Seems I can't access the Option Rom I'm injecting for the Voodoo5, PCI Peak gives me the Rom Address, 82010001, so the last bit is set, I do:

>swc 11804 6

Then drop into Macsbugs and try and dump the first 100 bytes of the Rom:

dm 82010000 100

But it returns an error that it can't read from that address?

http://mirror.informatimago.com/next/developer.apple.com/technotes/tn/tn2000.html

Seems I'm not getting a proper Assigned-Adresses .property:

Image


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Fri Feb 17, 2017 3:50 am 
Offline
Tinkerer

Joined: Sun Feb 07, 2016 4:40 pm
Posts: 83
Ok, it seems when I use the -device secondary-vga argument, that I use to init the Voodoo2, I'm able to read the Rom from the Voodoo5.

Image


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 2 [ 27 posts ]    Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group