Reply 20 of 50, by Dominus
- Rank
- DOSBox Moderator
Probably it was only you, I didn't write a PM 😀
Probably it was only you, I didn't write a PM 😀
analog_programmer wrote on 2024-03-04, 15:34:smola wrote on 2024-03-04, 15:20:I'd like to answer but seems I'm too fresh fish on forum and can't reply PM msgs. So... Dunno how to solve this issue, seems I need to send more posts to get higher rank to reply PMs...
Sorry, I also wrote PM to you forgetting that you still can't answer. If I'm not mistaken, after you post 20 comments in the forum's threads you'll be able to send PMs.
Oh my, I'm a total dumb 😀 PM to me was sent by analog_programmer, so sorry to you and Dominus for the mess 😉 I promise, I'll get better 😉
my repairs: mobo index :: vga index :: requests
@analog_programmer:
Due PM rules for fresh users, if you wanna contact with me, just install signal app from https://signal.org and send me your phone number on PM, I can read msg and then I'll answer you on signal via text.
my repairs: mobo index :: vga index :: requests
smola wrote on 2024-03-04, 16:39:@analog_programmer:
Due PM rules for fresh users, if you wanna contact with me, just install signal app from https://signal.org and send me your phone number on PM, I can read msg and then I'll answer you on signal via text.
Ok, I tried this messenger (desktop version for Linux) and I can't register account without "smartphone", 'cause it demands some QR-code scanning through Signal mobile app. I'm not surprised of this as in last years almost every "free" corporate software pushes people to use pocket tracking devices (so the personal tie can be sealed), but maybe you'll be surprised that I've stopped using "smartphones" since android "kit-kat" (I think that was the name for the OS version) was current. Yes, I'm using "dumb" phone with buttons and firmware (no OS) for many years and I'm still living normal human life 😁
Sorry for this off-topic post. You'll be able to communicate through forum's PM-system soon (if I'm not mistaken the restriction is valid if you have less than 20 thread's posts) 😉
from СМ630 to Ryzen gen. 3
engineer's five pennies: this world goes south since everything's run by financiers and economists
this isn't voice chat, yet some people, overusing online communications, "talk" and "hear voices"
I fully understand your point, moreover, I'd like to do same thing like you did, just drop smartphone and back to classic cell, but real life is tough nowadays 😉 I hope soon I will break the PM limits and we will talk normally 😉
my repairs: mobo index :: vga index :: requests
Fantastic investigation! I cant decide what is more impressive, the level of RE or the fact you are using Notepad to read code 😮 😀
analog_programmer wrote on 2024-02-28, 15:57:I thought that this fog effects are used to limit the view distance and thus the weak GPUs of the time are partially offloaded from texturing and rendering of some "far" objects.
fog is free on 3dfx, and 3dfx didnt do early out on Z buffer hits, thus there is no performance difference.
Reproductions
https://github.com/raszpl/FIC-486-GAC-2-Cache-Module for AT&T Globalyst
https://github.com/raszpl/386RC-16 memory board
RE
Zenith Data Systems (ZDS) ZBIOS 'MFM-300 Monitor'
rasz_pl wrote on 2024-03-14, 17:45:Fantastic investigation! I cant decide what is more impressive, the level of RE or the fact you are using Notepad to read code 😮 😀
hehe, thx, actually I use notepad++ on win and mcedit on linux console, sometimes nano/vim depending of platform
my repairs: mobo index :: vga index :: requests
smola wrote on 2024-03-15, 13:46:rasz_pl wrote on 2024-03-14, 17:45:Fantastic investigation! I cant decide what is more impressive, the level of RE or the fact you are using Notepad to read code 😮 😀
hehe, thx, actually I use notepad++ on win and mcedit on linux console, sometimes nano/vim depending of platform
wait a minute, this download/file.php?id=185967&mode=view indeed isnt notepad, so npp with no toolbar/tabs/line numbers/syntax highlighting ??? 😮 To me this is that Cypher "All I see is blond, brunette, redhead" scene :]
Time to send a patch https://github.com/sezero/glide/blob/ee380948 … minihwc.c#L1579 😀
if (hInfo.boardInfo[monitor].h3Mem == 8) {
hInfo.boardInfo[monitor].pciInfo.deviceID = SST_DEVICE_ID_H3 ; /* HACK ALERT: restricting to single TMU for Velocity? */
}
Looks like this line was there at least 21 years ago, thats as far as git blame goes? Whoever wrote that comment already knew bad things were afoot.
Reading it back with hindsight this:
* this prompted me to look into the problem, my first focus was unreal, because I had it, after poking around the internet the p […]
* this prompted me to look into the problem, my first focus was unreal, because I had it, after poking around the internet the problem with the lack of fog was solved by adding this entry to the registry:
{
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\Display\xxxx\Glide
key: FX_GLIDE_NUM_TMU
value: 2
was a really good clue. Glide library forcing Banshee restrictions disables second TMU on 8MB Velocity while Unreal Engine recognizes full V3 card thus forces dual TMU use?
Reproductions
https://github.com/raszpl/FIC-486-GAC-2-Cache-Module for AT&T Globalyst
https://github.com/raszpl/386RC-16 memory board
RE
Zenith Data Systems (ZDS) ZBIOS 'MFM-300 Monitor'
wait a minute, this download/file.php?id=185967&mode=view indeed isnt notepad, so npp with no toolbar/tabs/line numbers/syntax highlighting ??? 😮 To me this is that Cypher "All I see is blond, brunette, redhead" scene :]
Your're mad, you know that? 😉 But i like it 😉 And that woman in red... Mmmm, it was great idea, no doubt 😉 Anyway, I composed this screenshot to show all differences in src code, assembly lng, addresses and offsets, because I know that most ppl don't understand output from diff file. Code was highlighted in viewers from total cmd, which look almost same as notepad - I could use more sophisticated editor/comparator but... There wasn't necessary to use heavy weaponry to shot a fly 😉 Simplifying everything is what I like.
Time to send a patch https://github.com/sezero/glide/blob/ee380948 … minihwc.c#L1579 :-) […]
Time to send a patch https://github.com/sezero/glide/blob/ee380948 … minihwc.c#L1579 😀
if (hInfo.boardInfo[monitor].h3Mem == 8) {
hInfo.boardInfo[monitor].pciInfo.deviceID = SST_DEVICE_ID_H3 ; /* HACK ALERT: restricting to single TMU for Velocity? */
}
Well, right now is too early I suppose. There is no "clear explanation" what exactly conditions should be meet to change card's id 😉 For sure #5 shouldn't be changed, but what about #4 which are "slower" variants of avengers gpu/velocity? Adding additional condition to existing one would block others. I mean more tests are necessary, but these cards are very rare, so it may happen... Never? Right now best solution is to use original Amigamerlin 2.9 drivers, and in case of fog problems, just replace installed glide2x.dll to my patched dll. And when we'll collect more data and we'll find some patterns related to chip revisions/device id, then patch to source code on github would be provided 😉
Looks like this line was there at least 21 years ago, thats as far as git blame goes? Whoever wrote that comment already knew bad things were afoot.
Meantime, after I found this issue and sent description to the forum, I did more research and I found some additional things. Seems that line of code was added by guy called Atai on june 99, according to change log included in minihwc.c:
** 151 6/07/99 3:10p Atai
** report as Banshee if it is an 8M board
So, previous patch with inverting fogtable could work correctly for few months, but this one was just kill'em'all 😉 I think I should make small update to original text, we'll see 😉
Reading it back with hindsight this: (...) was a really good clue. Glide library forcing Banshee restrictions disables second TMU on 8MB Velocity while Unreal Engine recognizes full V3 card thus forces dual TMU use?
I'm not sure if this happens, I didn't check it after patch. However it's possible because banshee has only one tmu. Also forcing 2nd tmu to 'on' state via registry in fact enables both tmu to work with velocity and finally gpu has same efficiency as younger sister v3 2000 which has been confirmed by few tech portals that times. Velocity has just less vmem by half, but I did another research and it's possible to replace sgrams on pcb to twice large capacity and this should "convert" velocity to v3 2000.
cheers
update: Well, this guy Atai from change log, seems to be the same 'Anthony tai', who in reality isn't the same guy with name Anthony who made v6000? I bet this is same person 😉 If so, I've question, can you throw a bit of light to the situation with fog table and inversion + any info related to banshee problems/differences to banshee/velocity/2000? I'm sure many ppl will be very grateful.
my repairs: mobo index :: vga index :: requests
edit:
* added 2 links with problematic cards
my repairs: mobo index :: vga index :: requests
smola wrote on 2024-02-20, 18:04:[translation corrected by Gallu - big thx] […]
[translation corrected by Gallu - big thx]
3dfx Velocity 100 AGP part#2 [25-years old bug in the system] part#1.
info:
* as it turns out that my velocity does not always work as it should, that's because in some of the older games it has a serious chaffing on the screen, the problem was described and reported on vogons by our lukas12p, it related to malfunctioning games nfs2se and carmagedon2. I also experienced this problem with unreal gold, it worked in glide mode but there was no fog.... for nfs3 it worked ok - strange
* this prompted me to look into the problem, my first focus was unreal, because I had it, after poking around the internet the problem with the lack of fog was solved by adding this entry to the registry:
{
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\Display\xxxx\Glide
key: FX_GLIDE_NUM_TMU
value: 2
} string type key, xxxx can be different, depending on how many graphics cards were installed earlier, normally 0000, in my case it was 0018 but it's a test setup for different configurations, you know 😉
* it solved the problem with unreal, but it did not help completely with the 2 previous games
* I only had nfs2se, so I started digging around in sdk glide, I fired up IDA and disassembled the nfs2se exe, I found where the init fog table is, I deactivated it in the new exe, the test went to v2 because there the fog works properly, and indeed it is deactivated, the game looks bit worse but works ok, then I swapped v2 for velocity and.... game fired up without fog but works ok, ugly chaff disappeared 😀
* comparing screenshots of fog on/off it seemed to me that the z-buffer for fog is inverted, because in the background/away the image was ok with textures but crap on close objects, I concluded that fog is "inverted"
* I also checked v3 2000 16MB and the problem was not there - very strange
* I did some tests on diagnostics files for 3dfx, for glide2 crap with fog, but for glide3 it was ok - that was even stranger, because after all they are the same cards
* carving, notes from a chat with a buddy, to whom I reported live the progress of work 😉
{
* i have made many attempts to reverse the loop that generates values for fogtable maps but that had made small differences and improvements, that wasn't it
* in the meantime I made a lot of inline patches, there was a problem with free space in the exe code, I finally fixed it with hiew by using call/jmp, because I did not want to build a whole new environment for the debugger, masm compiler, then recompile and glue exe 😉
* at this point I speculated that the bug must be in the gpu after all, because they implemented the fog arrays in reverse, in the game there are a total of 20 arrays for different cases, each has 64 bytes and contains values in the range 0-ff, there is a function in glide2x.dll that generates this, it is used when you need to reverse the loop to generate this array in reverse order, only a few bytes are missing for the inline patch 😉
* but on the other hand, maybe I could stick the code to reverse the array itself after its generation, then I don't need to patch glide, just paste it in the game exe... such a reverse-order function after the execution of the original procedure, hmmm
* another situation: I have invented an algo for inverting index values from the range 0-63, why should I f* with inverting items, when I can change the main function for calculating values 😉 just for any given 0-63 'do not' and then add 64, perfectly reverses the value, for this I need 15 bytes free, because there is align16 in the exe, I should fit 😀
* and again: i added a patch in glide2x.dll to generate fog table in api and it partially improved, bugs in gpu at 100%
* and the disappoinment: I slowly started to give up on this 'fog' in nfs2, a lot of testing and it f* doesn't work, a little improvement but I wasted my time, it's easier to turn it off and it works perfectly 😉 I think I'll give up coding today and listen to music on my headphones 😀
* I finally found a legitimate carmagedon2 installer, I managed to fix the exe by turning off the fog and it finally looked normal
* in carma2 i tried to invert fog tables, negate indexes but it didn't help much, it must be a bug in early versions of gpu, right after them voodoo3 2000 16mb came out and they worked ok
* I searched the internet, found glide source codes, heavy digging in docs, pdfs, etc...
* and finally: I cracked this 3dfx 😀 the problem is with the card and drivers, the fog works beautifully with nfs2se and carma2 😀
* it wasn't until I downloaded src from glide drivers and rummaged through this crap that I found the place, they had huge problems because of this bug and fixed it wrong, it could have contributed to the downfall of the company too
* it's 1 byte patch, classic jnz->jmp 😀
}
* in the changelog at the beginning of the code there is a visible mention of problems with the fog table, unfortunately no comments in the code but it is visible where it was applied, below important info about changes in the gglide.c file:
{
124 12/18/97 2:13p Peter
fogTable cataclysm
(...)
186 11/18/98 6:29p Dow
Fixed clear problem on banshee/avenger
187 11/24/98 4:21p Jeske
make sure we don't try to apply the banshee (rev<3) fogTable hack to avengers with (rev<3)
}
* as you can see the problem appeared in december 1997 (when the shit hit the fan) and they didn't fix it until a year later in november 1998, unfortunately this fix is bad, because it "spoils" all avengers with revision lower than 3, i.e. for example my velocity 100/v3 1000 8MB and v2 2000 8MB from lukas12p - he even described the problem on vogons but 0 help, a difficult topic 😉
* it can't be ruled out that in banshee chips and early avengers there was a bug in the gpu that required inverting registers from fog and hence these additional conditions, but a quarter of a century has passed and finally it can be corrected 😉
* the list of vulnerable cards is as follows: deviceID=3 and devRev <3, if the card had a bug in the gpu, it will work ok, but if it did not, it will be a chaff with fog on the screen, the bug applies only to games using native glide2x, it is not present in glide3x.dll and that is why nfs3 works ok, the bug also does not apply to all sorts of wrappers like d3d, opengl, nglide etc. - deviceID not quite like that, i will explain later
* crafted glide2x.dll from Amigamerlin v2.9 package, 1 byte classic jnz->jmp patch and.... after dropping it into the directory with the game nfs2se beautiful fog and everything works ok 😀 same with carmagedon2, it is great but there was a dilemma in the analysis because... WHY did my card which has deviceID=5 jump to the code which is intended only for deviceID=3??? - a real brainfu*k
* it made me realize that the error must be somewhere else, even deeper - so, we need to go deeper
* since the critical value is in the condition (gc->bInfo->pciInfo.deviceID == 0x3) I searched all the files from the sources for the string 'pciInfo.deviceID', I found several, the most interesting one is minihwc.c with the following lines:
{
if (hInfo.boardInfo[monitor].h3Mem == 8 ) {
hInfo.boardInfo[monitor].pciInfo.deviceID = SST_DEVICE_ID_H3 ;
}
}
* well I can't believe that someone could write it like that, just a quick verification of the constant SST_DEVICE_ID_H3 and... bingo 😀
{
#define SST_DEVICE_ID_SST1 1
#define SST_DEVICE_ID_SST96 2
#define SST_DEVICE_ID_H3 3
#define SST_DEVICE_ID_H4 4
#define SST_DEVICE_ID_H4_OEM 5
#define SST_DEVICE_ID_AP 6
#define SST_DEVICE_ID_L_AP 6
#define SST_DEVICE_ID_AP_OEM 9
#define SST_DEVICE_ID_H_AP 15
}
* this is where the original error lies, it's in the minihwc.c file inside the hwcInit() function without any checking what card is inserted, the gpu is determined only by the size of the memory, what size? 8MB 😀 so that... if a card with 8MB of vram is inserted, the function will rigidly change the deviceID of the card to SST_DEVICE_ID_H3, that is 3, that is banshee...
* this is a serious bug, because all v3 cards with this amount of memory are susceptible to this regardless of the card ID, and that's why my velocity had the deviceID swapped from 5 to 3 and triggered register inversions from fogtable, this also explains why the v3 2000 lukasa12p works badly - it has 8MB too, f* me 😉
* summarizing this error in 1 line: if vmem 8MB then deviceID=3 and any card becomes voodoo banshee 😀 well, I can't believe how such code can be written 😉
* the only thing left is to disable this nonsense initiation and patch glide2x.dll - I still can't believe what I am seeing 😉
* the patch involves changing the byte under offset 140BF: 75->eb, this will force an unconditional jump to the next instruction with the omission of replacing the card's deviceID
* glide2x.dll patched, tests with nfe2se and carma2 passed, beautiful fog, unreal gold added, because earlier it had a hiccup with operation and did not always start in glide mode and... now beautifully works from the get go, it is the right fog 😀 complete success
* you can now permanently replace this dll in %systemdir% and enjoy trouble-free operation of 8MB vram cards with glide2, this patch may solve problems with other untested games, please comment
* at this time I am curious how this situation affects banshee, unfortunately my card has a burnt gpu and I have no way to check it
* and all owners of v3 cards with 8MB of vram please check the original drivers amigamerlin v2.9 + corrected glide2x.dll, pay attention to the fog or rather lack of it or the havoc it makes on the screen 😉
* used re techniques and static analysis + tools: ida, hiew, totalcmdit finally works 😀 after 25 years 😀
* hopefully this was NOT the nail in the coffin for 3dfx (but it could have contributed just like the acquisition of stb and sinking $141M + the release of gf256 with t&l by nvidia) - it's a serious flaw and it's clear they didn't patch it, well, we'll probably never know
* inception ended on level 3, 1: fogtable off, 2: fogtable on and disable inversion of values in fogtable registers, 3: fogtable on and disable card swap to banshee if vram 8MB - today I'll end the day with a beer, more than one for sure 😉
* and a final riddle: why do I use the word inversion and not negation, what is the difference in asm between neg and not instructions - this was 1 of the interview questions that candidates for threat analysts position were asked at our company 😉web:
* lukas12p problem (nfs2se, carma2): 3dfx Voodoo 3 8MB problem
* OpenRift problem (rune gold): Rune Gold: Grey Models in Glide Mode
* Ozzuneoj problem (descent 3): 3dfx Velocity 100 (Gateway OEM Voodoo3 1000G) graphics corruption in Glide?edit:
* added 2 links with problematic cards
Just wanted to say THANK YOU smola!
Re: 3dfx Velocity 100 (Gateway OEM Voodoo3 1000G) graphics corruption in Glide?
I have had a "Voodoo3 1000G" (a Gateway branded Velocity 100 8MB) since November of 2016 which had these fog table related issues. I now have three of them and I just happened to get around to testing them again recently. If you hadn't posted this fix when you did, they likely would have been stuffed back into a box along with my note from 2016 explaining the issues. Now, they are functional cards. 😀
Now for some blitting from the back buffer.
It's good to hear that another three beauties back to a life. Happy Easter Day!
my repairs: mobo index :: vga index :: requests
Hello everyone! I just wanted to thank Smola for the excellent fix. I'm facing a similar issue with the 3dfx Velocity 100 where there's no fog in Glide 2 games. However, I'm curious about a potential hardware solution. It seems there's a check for 8 MB of RAM. I'm wondering if, theoretically, it might be possible to fix this by modifying the hardware—perhaps by desoldering a 2 MB chip and replacing it with one of a higher value, or simply adding an extra 2 MB. Although having 10 MB might not be inherently beneficial, could such a change potentially resolve the bug at the driver level? What do you and others think about this idea?
Adding 2MB is impossible.
Reproductions
https://github.com/raszpl/FIC-486-GAC-2-Cache-Module for AT&T Globalyst
https://github.com/raszpl/386RC-16 memory board
RE
Zenith Data Systems (ZDS) ZBIOS 'MFM-300 Monitor'
It is possible to resolder existing ram chips to twice bigger capacity and get total of 16MB vram making velocity just ordinary v3 2000 but... I had plan to do it, even found proper chips on aliexpress, but... Velocity is unique card, rare and has problem with sw bug in glide. I also own v3 2000, so 2nd one wouldn't be necessary. I'd rather modify v3 2000 to 8MB and make her vulnerable to glide2 bug 😉 Finally, I decided to left velocity as is and use modified glide2x.dll. Btw, there is no problem in hw in velocity, the problem is in banshee hw.
my repairs: mobo index :: vga index :: requests
Hmm. Upgrading to 16 mb and getting voodoo3 2000 seem more rational decision. Especially for me, because, i sold my voodoo 3 2000, just before i'm installed OS. So i'm still hungry for native 3dfx experience, but with fog))) Will also try to find appropriete memory chips for 16 mb upgrade. Thanks for reply!
Would 16MB sGram be even possible?
Reproductions
https://github.com/raszpl/FIC-486-GAC-2-Cache-Module for AT&T Globalyst
https://github.com/raszpl/386RC-16 memory board
RE
Zenith Data Systems (ZDS) ZBIOS 'MFM-300 Monitor'
rasz_pl wrote on 2024-05-05, 16:27:Would 16MB sGram be even possible?
Yeah I'm pretty sure it is. It's got some empty pads at R22 and R24 that look like my MSI MS-6168 v2 board - with options to connect Chip / Bank Select either to the A10 address line (R22) or Chip Select (R23), with another pad (R24) to hook Chip Select on the RAM chips to Ground so they're always selected and the GPU can toggle the line to select between banks / toggle A10 on and off.
This guy talks about what's involved: 3Dfx Voodoo Powered Motherboard Gets a Memory Upgrade! #GPUJune - K2s Retro Workshop
Here's the picture he made which talks about it too - notice there are some similarities in the design with two unpopulated and one populated 0-ohm resistor when in 8MB mode:
Having done that myself on my MS 6168 I can say it's no small undertaking especially if you're not good with QFP (which I am not great with) Re: MS-6168 rev 2 - Vram upgrade
I used a Dell ATI Rage 128 (part code 041MJU) as the chip donor since those are 4MiB SGRAM chips, but I think the Compaq TNT2 Pro AGP 16MB (part codes 180-P0016-0000-B, 175779-001 or 179997-001) would also be good donor
The one issue I think may crop up is that I can't see how the register value for 4 chip (1 bank) or 8 chip (2 banks) is selected, which is done with a pull-high / pull-low resistor coming off of data pin 5 on the EEPROM, maybe that's already set to a value that would let 16MB work.
Cool. I'm really want to try this upgrade for my Velocity 100. But it seems it's hard to find certain chips or i'm using wrong keywords. I was trying something generic like 'sgram chips', maybe i have to be more specific. Does anyone have advice or even direct url to aliexpress or ebay or another store for this chips? Or even it's not correct strategy and instead of finding chips is more easier and cheaper to find some hardware as donor?
Unfortunately I wont recommend any ram chips, due to only ones I found are selling by only one Chinese guy. There is possibility they may not work, may be broken/fake, there is not good photos on auction. If you still want modify your velocity card, then take following things into consideration:
* you got most info from previous post from @Thermalwrong
* you have to resolder 4 chips and set few resistors to proper position to unlock missing signals
* you have also re-set additional strap resistors to configure new size of ram and memory banks - I have done this but I wont release solution until I test it in real world
* re-setting straps requires cuting/wiring traces on pcb, also requires removing resistors array + replace some of them to lower size from 603 to 402 - without proper skill/tools and microscope it may be difficult and probably you'll destroy your velocity
* you need to buy new ram chips or gather them from donors
If you still wanna do this upgrade, just do some basic math:
* velo has 8MB vram in 4 chips, it means 8/4=2, actually 2MiB per chip, MB is just marketing, MiB is in realality 1024*1024 bytes
* so each chip has 2MiB, organization is 256Kx32x2, you want to change each to twice more capacity, so you have to look for 512Kx32x2
* find datasheet of your existing chips and find dedicated ram, check pinouts on both chips, size of the chips, raster etc., check params, speed etc.
* when you'll find proper replacements, then search seller on ali/ebay and check description/photos, there is always risk you can buy crap
* now resolder ram chips, move resistors, set straps
* test stuff, if you did all in proper way, and your chips are good, then everything should work from a shot
* this is not easy task, most ppl think it's just like a fart, coz it's just replacing mem chips... well, it's not, just do it yourself 😉
Cheers 😀
my repairs: mobo index :: vga index :: requests