VOGONS


Reply 61 of 239, by Gona

User metadata
Rank Member
Rank
Member
Gona wrote:

CT6360 has no sticker "Graphics Blaster Falcon" (with 3Dlabs Permedia NT chipset) [note this is an engeneering sample card and never released] might can support IR format HOTCGL games

yjfy Hardware Museum has one of this CT6360 Creative made 3Dlabs Permedia card (engeneering or qualification sample card). I have never seen other than this one, although I've had eBay search for CT6360 for about ten years.

ct6360.jpg
http://www.yjfy.com/Museum/video/CT6360.htm
I contacted yjfy Hardware Museum for a CGL test but the card is unfortunately bad.

The card is bad, can't verify.

Video card compatibility matrix for DOS games | ATI3DCIF compatibility matrix | CGL API compatibility matrix

Reply 63 of 239, by Gona

User metadata
Rank Member
Rank
Member
furan wrote:

I don't see a video BIOS on there, maybe it's not dead - maybe since it's a prototype it can't be used as the VGA card in the system.

There is an AMD PLCC32 BIOS chip to the right of the GLINT Delta chip.

Video card compatibility matrix for DOS games | ATI3DCIF compatibility matrix | CGL API compatibility matrix

Reply 64 of 239, by furan

User metadata
Rank Member
Rank
Member
Gona wrote:
furan wrote:

I don't see a video BIOS on there, maybe it's not dead - maybe since it's a prototype it can't be used as the VGA card in the system.

There is an AMD PLCC32 BIOS chip to the right of the GLINT Delta chip.

My bad - I couldn't read the label - I was wondering if this might be a GAL or PAL.

Reply 65 of 239, by furan

User metadata
Rank Member
Rank
Member

Hi,
For the past several days I've been using some free time to try and dig into CGL more and get a background understanding of how the library works, find more information on it, and have been doing way too much disassembly and debugging. I figured I'd document a little of what I've discovered.

I also accidentally found some incomplete parts of the SDK online, found on GitHub in "preservations" of other games - there is the HOT1/1.2 version, which leaked with Actua Soccer 96 sources, and the HOT2/1.70 version, which leaked with the Urban Assault sources. You can find these on GitHub by searching for filename:cglerr.h and clicking 'code' in the results.

In general with the SDKs there are multiple headers but you include CGL.H to pull in the rest. HOT1/HOT2 are basically the "hot-linking" versions - the CGL driver binary headers are very similar but either have HOT1 or HOT2 to denote this.

With the HOT1/1.2 SDK, two .LIB files are included:

CGLRW.LIB, the 3D Blaster VLB Gaming Glint driver for static linking. This is fun to look at because there's so much info in the .lib that you can glean more about the device itself - if you wanted to figure out how to program the gaming glint directly (or more importantly compare it to the data books for programming later 3DLabs chips), that could be gleaned from disassembly of this lib which has function names and other debug info to help one along. It'd be fun to try and get a driver working for the 500TX.
dTuTYAa.png

CGLCDL.LIB, which is the code that games link in to hotlink to the CGL driver binaries. Looking at disassembly of Hi-Octane and the Test binaries Vetz made available, I can see the HOT2 version of this code and the assembly follows much the same way - the functions have different signatures, for example the V1 loader didn't let you specify a board or type (I'll get to that).

The signature for the HOT2 version of the loader is:
int cglLoad(char *path, int boardID, int type);

'path' is a search path, which is overridden by the HOTCGL environment variable. The code does a simple Watcom _dos_findfirst/_dos_findnext for *.cgl in the search directory or override directory, then does opens the file and checks for HOT1 or HOT2, depending on the version of the loader library linked. Then, if it successfully validates the CGL, it attempts to load it with an internal routine, cdl_load() (names thanks to the linker libs) which does a lot of validation, a lot of what I will just call magic with the header to verify it, and then initializes a list of callback functions. In the game you just call the function provided by the loader lib, and it points to the right function in the loaded CGL HOT2 driver.

[/b]boardId[/b] is a set of bits for which boards you support:
#define CGL_BOARD_AUTO 0x0000
#define CGL_BOARD_GIGI_REV01 0x0001
#define CGL_BOARD_SVGA_REV01 0x0002
#define CGL_BOARD_VERITE_REV01 0x0010
#define CGL_BOARD_CIRRUS_REV01 0x0101
#define CGL_BOARD_MULTI_AUTO 0xFFFF
"AUTO" is load any, I am not sure what "MULTI_AUTO" does but there is no "T-ing" method to control multiple boards at once from the loader library.

type is one of:
#define CGL_CDL_FIXED 0
#define CGL_CDL_FLOAT 2

So we have four types of drivers: FR/IR/FS/IS and I always wondered what the deal was with this.
I think the F versus I part of the driver type is floating point versus integer fixed point math. When a game defines CGLFLOAT, it changes the numeric data type used in all of the drawing structures passed into the driver from 'long' to 'float'.

R/S I thought might have been related to the memory model used in the game but I'm not sure yet.

I have put out feelers to some Creative Labs folks to try and see if they would release the SDK so folks could play with it. I am currently working on reconstructing a Watcom-compatible CGLCDL.LIB loader lib for HOT2 drivers.

I am still working on having a decent debugger for this. The DosBox debugger is reasonable but not what I'm used to for a command line debugger, and idados is a trash heap.

My goal with this at the end of the day:
1) Get Creative to release the CGL SDK, or complete the leaked headers on my own by replicating a HOT2 CGLCDB.LIB loader lib.
2) Create a patched driver for a higher end 3DLabs chip. Not that simple as even if the 300TX or 500TX registers are similar to the 300TX, it's PCI device programming instead of VLB. I'd like to try and hack the Permedia Delta driver to work with my FireGL 1000 but as the driver was never released I have no idea how well it works.
3) Just satisfy my curiosity as a code/hardware history guy.

Random:
- I didn't see any MS-DOS Urban Assault in the games list - it's possible due to performance issues or something else the CGL support never shipped, but it comes with a hefty set of classes for using CGL which include texture caching, etc. so it might be interesting to try and compile the DOS edition and see how it works. It might just be that they shipped only the Windows D3D version due to Microsoft being their publisher.

Thanks to Gona & Vetz for all their writeups and hard work. If I come up with more stuff I'll update this thread.

Reply 66 of 239, by vetz

User metadata
Rank l33t
Rank
l33t

This is really interesting and nice work!

Regarding Urban Assault it was never released with an MS-DOS version. The only info I've found is that the developers started development on an Amiga version, then moved to a MS-DOS release in 1996 before it was finally shipped in 1998 on Windows 95 (with D3D support). It makes sense to include CGL support for an 1996 release. Here is btw the source data on Github:
https://github.com/SgtHannah/YPAGIT

BTW: if you have contacts in Creative Labs, would also be nice if they could release the schematics for the 3D Blaster VLB memory module.

3D Accelerated Games List (Proprietary APIs - No 3DFX/Direct3D)
3D Acceleration Comparison Episodes

Reply 67 of 239, by furan

User metadata
Rank Member
Rank
Member

Just wanted to leave a note that I disassembled the initialization of the driver for the Permedia NT cards (Permedia + Delta) PDLTB170.CGL and found that it only checks the PCI bus for two devices w/PCI VID 0x3D3D (3d Labs) and PID 3 and 4 (Permedia and Delta chips). I tried it out on my Diamond Fire GL 1000 PCI and it does indeed work. I verified this by then removing the driver after it worked and watching both apps fail with an error 699 (can't load CGL). In addition, there is a bunch of debugging code (some active, some inactive) in the driver which causes the file MONO$ to be created, which was created on my disk. I tested the driver successfully with the Battle Arena Toshinden 2.5 demo and DTDTEST -cgl, with HOTCGL set to the dir the CGL was contained in in both cases.

I don't have my video capture working well yet but I'll take some pictures today if I can't get it to work - it seemed to work well enough and there were shadows in BAT.

Reply 68 of 239, by vetz

User metadata
Rank l33t
Rank
l33t

Again, awesome new information!

Did you do any changes to the driver? Did you add the PCI VID for the GL 1000? Putas tried it out in the Re: Fun with CGL (Creative Graphics Library) on 3D Blaster thread and Gona reported it not working.

3D Accelerated Games List (Proprietary APIs - No 3DFX/Direct3D)
3D Acceleration Comparison Episodes

Reply 69 of 239, by furan

User metadata
Rank Member
Rank
Member
vetz wrote on 2020-08-14, 17:04:

Again, awesome new information!

Did you do any changes to the driver? Did you add the PCI VID for the GL 1000? Putas tried it out in the Re: Fun with CGL (Creative Graphics Library) on 3D Blaster thread and Gona reported it not working.

No - I didn't change anything to the driver - I started disassembling it as I was preparing to do so. The PCI VID/PIDs it checks for are the standard 3dLabs ones, and I checked the Fire GL 1000 and it had the standard PCI IDs, so I figured I'd just give it a shot.

There is of course the important bit that the flavor of that driver needs to match the type the game wants to load, but other than that it should work fine with a Fire GL 1000 PCI. I'll try and patch the driver to get it to spit out more to the MONO$ file (I guess it's expecting to send debug output to a monochrome display) to prove out that it's really initializing and using the card.

Basically it expects to see 3D3D:0003 (Permedia) and 3D3D:0004 (Delta) on the bus.

Reply 70 of 239, by vetz

User metadata
Rank l33t
Rank
l33t

I've sent a PM to Gona and Putas, hopefully they can maybe shed a more light on what games they tested with the same card you used.

Seems like we need to create a new compatibility matrix for the Permedia NT 😀

3D Accelerated Games List (Proprietary APIs - No 3DFX/Direct3D)
3D Acceleration Comparison Episodes

Reply 71 of 239, by Gona

User metadata
Rank Member
Rank
Member

Wow, great work furan thank you!

vetz wrote on 2020-08-14, 18:01:

I've sent a PM to Gona and Putas, hopefully they can maybe shed a more light on what games they tested with the same card you used.

Seems like we need to create a new compatibility matrix for the Permedia NT 😀

Unfortunately I still have no Permedia NT. I originally expected that the Laguna3D and Permedia Delta CGL drivers has something hardware or bios check to enable only Creative cards, but testing a non Creative Laguna3D too I have seen that the L3DTB170.CGL have no "Creative check". This is why I asked Putas to test his Permedia NT card with PDLTB170.CGL. Of course I have asked DTDTEST and Rebel Moon/PCI test because we have only "IR" driver for Permedia NT and these are IR type CGL applications. We need retest all "IR" games on Permedia NT.

Video card compatibility matrix for DOS games | ATI3DCIF compatibility matrix | CGL API compatibility matrix

Reply 73 of 239, by Gona

User metadata
Rank Member
Rank
Member
furan wrote on 2020-08-14, 16:41:

I disassembled the initialization of the driver for the Permedia NT cards (Permedia + Delta) PDLTB170.CGL and found that it only checks the PCI bus for two devices w/PCI VID 0x3D3D (3d Labs) and PID 3 and 4 (Permedia and Delta chips).

I have made some test.
In the PDLTB170.CGL I have changed the 0x0004 (Permedia) to 0x0001 (GLINT 300SX) and run DTDTEST with my GLINT 300SX card (with Delta chip). Not says error 699 but (after lot loading times) exits without a word.
Than I have changed to 0x0006 (GLINT MX) and run DTDTEST with my GLINT MX card (with Delta chip). Also not says error 699 but (after lot loading times) exits without a word.
I have made a 0x0009 (Permedia2) variant too and tried with Permedia2 card (has no delta chip), no 699 error but after loading the video signal is disappears and monitor goes power saving, DTDTEST not exits while I press ESC so I think it freezes (I don't know why not says 699 error). I have tried to put the card with Delta as secondary card, but the results are the same. If I change the CGL variant DTDTEST gives 699 error, so I think the PCI IDs are OK in my modded CGL versions.
Finally I put my Permedia (without Delta chip) card into the machine. This gives 699 error. I put 300SX with Delta chip too ad 2nd, try to run again the 0x0004 (Permedia) but still 699 error finally 300SX with Delta to primary VGA and Permedia as 2nd but still 699 error...

Video card compatibility matrix for DOS games | ATI3DCIF compatibility matrix | CGL API compatibility matrix

Reply 75 of 239, by furan

User metadata
Rank Member
Rank
Member
Gona wrote on 2020-08-17, 21:24:
I have made some test. In the PDLTB170.CGL I have changed the 0x0004 (Permedia) to 0x0001 (GLINT 300SX) and run DTDTEST with my […]
Show full quote
furan wrote on 2020-08-14, 16:41:

I disassembled the initialization of the driver for the Permedia NT cards (Permedia + Delta) PDLTB170.CGL and found that it only checks the PCI bus for two devices w/PCI VID 0x3D3D (3d Labs) and PID 3 and 4 (Permedia and Delta chips).

I have made some test.
In the PDLTB170.CGL I have changed the 0x0004 (Permedia) to 0x0001 (GLINT 300SX) and run DTDTEST with my GLINT 300SX card (with Delta chip). Not says error 699 but (after lot loading times) exits without a word.
Than I have changed to 0x0006 (GLINT MX) and run DTDTEST with my GLINT MX card (with Delta chip). Also not says error 699 but (after lot loading times) exits without a word.
I have made a 0x0009 (Permedia2) variant too and tried with Permedia2 card (has no delta chip), no 699 error but after loading the video signal is disappears and monitor goes power saving, DTDTEST not exits while I press ESC so I think it freezes (I don't know why not says 699 error). I have tried to put the card with Delta as secondary card, but the results are the same. If I change the CGL variant DTDTEST gives 699 error, so I think the PCI IDs are OK in my modded CGL versions.
Finally I put my Permedia (without Delta chip) card into the machine. This gives 699 error. I put 300SX with Delta chip too ad 2nd, try to run again the 0x0004 (Permedia) but still 699 error finally 300SX with Delta to primary VGA and Permedia as 2nd but still 699 error...

I’ve been hoping to make the driver work with some other 3DLabs chips later. Hilariously if you look at the register header files in the 9x and NT sample Permedia drivers they are referred to as the “gigi” register set - there is a lot of overlap with the original chip.

Reply 76 of 239, by Putas

User metadata
Rank Oldbie
Rank
Oldbie
furan wrote on 2020-08-18, 07:17:
Putas wrote on 2020-08-17, 14:29:

Still no luck with mine Diamond FireGL 1000. No idea what am I doing wrong.

What PCI IDs do you see on the bus for your FireGL?

104C-3D04 / 1092-1103 (Rev 01)

Reply 77 of 239, by Gona

User metadata
Rank Member
Rank
Member
furan wrote on 2020-08-18, 07:20:

I’ve been hoping to make the driver work with some other 3DLabs chips later. Hilariously if you look at the register header files in the 9x and NT sample Permedia drivers they are referred to as the “gigi” register set - there is a lot of overlap with the original chip.

This really surprising but good news. 😀

Video card compatibility matrix for DOS games | ATI3DCIF compatibility matrix | CGL API compatibility matrix

Reply 78 of 239, by furan

User metadata
Rank Member
Rank
Member
Putas wrote on 2020-08-18, 07:32:

104C-3D04 / 1092-1103 (Rev 01)

I think this explains it. The BIOS for my card is version 1.21, and the card itself looks early - it still has the memory upgrade sockets soldered on. Vendor 0x104C is TI who started making the chips later. And vendor 0x1092 is Diamond Multimedia. As far as devices, 03 is Delta, 04 is Permedia (I mixed those up from memory earlier, sorry). But for the later ones, I would guess 0x3D04 is the TI ID for Permedia and 0x1103 is the Diamond ID for Delta.

For my card the IDs are the original 3DLabs ones:
0x3D3D:0003 Delta
0x3D3D:0004 Permedia

Reply 79 of 239, by furan

User metadata
Rank Member
Rank
Member

I have created a patch here:https://www.dropbox.com/s/nmo8gf20pguv6bz/PERMNTTID.zip?dl=0

What this does is change the search pattern, just in cglBoardPresent() in the driver for the PCI IDs:
0x3D3D:0003 -> 0x1092:1103
0x3D3D:0004 -> 0x104C:3D04

I don't have the hardware to test this so you are my guinea pig(s) but at worst you will see a black screen or crash.

Just to explain what I did a little further - I changed a function cglBoardPresent() calls which searches for the devices by the original 3DLabs PCI VID/PIDs. The code in bold changes to the newer IDs and I recycled a line of dead code to switch to the Diamond VID before searching for the Delta.

; =============== S U B R O U T I N E =======================================
seg000:00475F0E
; Attributes: bp-based frame
CheckForPermediaNT proc near ; CODE XREF: seg000:0047474F↑p
; sub_476BBB+4E↓p
var_24 = dword ptr -24h
var_20 = dword ptr -20h
var_1C = dword ptr -1Ch
var_18 = dword ptr -18h
search_product_id= dword ptr -14h
search_vendor_id= dword ptr -10h
var_C = dword ptr -0Ch
var_8 = dword ptr -8
var_4 = dword ptr -4
push ebx
push ecx
push edx
push esi
push edi
push ebp
mov ebp, esp
sub esp, 24h
mov [ebp+search_product_id], 4 ; Permedia
mov [ebp+search_vendor_id], 3D3Dh ; 3DLabs

mov [ebp+var_8], 0
mov [ebp+var_1C], 0
mov [ebp+var_18], 0
cmp ds:word_459AA7, 0
jz short loc_475F59
xor eax, eax
mov ax, ds:word_459AA7
mov [ebp+var_24], eax
jmp loc_47606A
; ---------------------------------------------------------------------------
loc_475F59: ; CODE XREF: CheckForPermediaNT+39↑j
call CheckForPCIBusInt1A0B1
test eax, eax
jz short loc_475F6E
mov [ebp+var_24], 0
jmp loc_47606A
; ---------------------------------------------------------------------------
loc_475F6E: ; CODE XREF: CheckForPermediaNT+52↑j
; CheckForPermediaNT+94↓j
lea ecx, [ebp+var_C]
xor ebx, ebx
mov bx, word ptr [ebp+var_8]
xor edx, edx
mov dx, word ptr [ebp+search_vendor_id]
xor eax, eax
mov ax, word ptr [ebp+search_product_id]
call FindPCIDeviceInt1A0B1
test eax, eax
jnz short loc_475FA4
inc [ebp+var_8]
xor edx, edx
mov dx, word ptr [ebp+var_8]
shl edx, 2
mov eax, [ebp+var_C]
mov ds:word_45A054[edx], ax
jmp short loc_475F6E
; ---------------------------------------------------------------------------
loc_475FA4: ; CODE XREF: CheckForPermediaNT+7C↑j
xor eax, eax
mov ax, word ptr [ebp+var_8]
mov [ebp+var_18], eax
mov eax, [ebp+var_18]
mov ds:word_459AA7, ax
mov [ebp+var_8], 0
mov [ebp+search_product_id], 3 ; delta coprocessor
loc_475FC4: ; CODE XREF: CheckForPermediaNT+138↓j
lea ecx, [ebp+var_C]
mov eax, [ebp+var_8]
inc [ebp+var_8]
xor ebx, ebx
mov bx, ax
xor edx, edx
mov dx, word ptr [ebp+search_vendor_id] ; dx = 3d3d (3D Labs)
xor eax, eax
mov ax, word ptr [ebp+search_product_id] ; ax = 3 now (Delta Chip)
call FindPCIDeviceInt1A0B1
test eax, eax
jnz short loc_47604C
mov eax, [ebp+var_C]
mov [ebp+var_4], eax
mov [ebp+var_20], 1
loc_475FF4: ; CODE XREF: CheckForPermediaNT+F6↓j
mov eax, [ebp+var_20]
cmp eax, [ebp+var_18]
jle short loc_476006
jmp short loc_47603D
; ---------------------------------------------------------------------------
loc_475FFE: ; CODE XREF: CheckForPermediaNT:loc_47603B↓j
mov eax, [ebp+var_20]
inc [ebp+var_20]
jmp short loc_475FF4
; ---------------------------------------------------------------------------
loc_476006: ; CODE XREF: CheckForPermediaNT+EC↑j
mov eax, [ebp+var_20]
shl eax, 2
mov ax, ds:word_45A054[eax]
shl eax, 8
shr ax, 0Bh
mov edx, eax
mov eax, [ebp+var_4]
shl eax, 8
shr ax, 0Bh
cmp ax, dx
jnz short loc_47603B
mov edx, [ebp+var_20]
shl edx, 2
mov eax, [ebp+var_C]
mov ds:word_45A056[edx], ax
loc_47603B: ; CODE XREF: CheckForPermediaNT+11B↑j
jmp short loc_475FFE
; ---------------------------------------------------------------------------
loc_47603D: ; CODE XREF: CheckForPermediaNT+EE↑j
xor eax, eax
mov ax, word ptr [ebp+var_8]
cmp eax, [ebp+var_18]
jnz loc_475FC4
loc_47604C: ; CODE XREF: CheckForPermediaNT+D7↑j
cmp [ebp+var_18], 0
jz short loc_476064
mov ds:g_device_product_id, 4
mov ds:g_device_vendor_id, 3D3Dh
loc_476064: ; CODE XREF: CheckForPermediaNT+142↑j
mov eax, [ebp+var_18]
mov [ebp+var_24], eax
loc_47606A: ; CODE XREF: CheckForPermediaNT+46↑j
; CheckForPermediaNT+5B↑j
mov eax, [ebp+var_24]
mov esp, ebp
pop ebp
pop edi
pop esi
pop edx
pop ecx
pop ebx
retn

Last edited by furan on 2020-08-18, 10:44. Edited 1 time in total.