Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Increase the 3000 byte buffer in Nvidia driver  (Read 2316 times)

0 Members and 1 Guest are viewing this topic.

bent98

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 477
  • Last login:February 02, 2019, 03:35:00 pm
  • Hyperspin Moderator
Increase the 3000 byte buffer in Nvidia driver
« on: March 01, 2008, 10:17:12 am »

There is a community of us who use nvidia  cards inconjunction with MAME and multisync arcade monitors. In the quest of getting as close as possible to the real arcade games of old(pacman, donkey kong, etc..) there is a program out there called SOFT 15KHZ. What it does it allow Nvidia and ATI cards to run and at very low resolutions.

http://community.arcadeinfo.de/showthread.php?t=8170

o   15kHz
   240 x 240 @ 60Hz
   256 x 240 @ 60Hz
   256 x 256 @ 60Hz
   256 x 264 @ 60Hz
   304 x 240 @ 60Hz
   321 x 240 @ 60Hz *
   321 x 256 @ 60Hz *
   336 x 240 @ 60Hz
   352 x 256 @ 60Hz
   352 x 264 @ 60Hz
   352 x 288 @ 50Hz **
   368 x 240 @ 60Hz
   384 x 288 @ 50Hz **
   392 x 240 @ 60Hz
   401 x 256 @ 53Hz * **
   448 x 240 @ 60Hz
   512 x 240 @ 60Hz
   512 x 288 @ 50Hz **
   632 x 264 @ 56Hz **
   640 x 240 @ 60Hz
   640 x 288 @ 50Hz **
   640 x 240 @ 60Hz
   512 x 448 @ 60Hz Interlace
   512 x 512 @ 60Hz Interlace
   640 x 480 @ 60Hz Interlace
   720 x 480 @ 60Hz Interlace
   800 x 600 @ 50Hz Interlace **
   1024 x 768 @ 50Hz Interlace **

* "Fake"-Resolution to avoid DirectX-Problems.
** Says 60Hz in Windows.
o   25kHz
   448 x 384 @ 60Hz
   512 x 384 @ 60Hz

o   31kHz
   512 x 448 @ 60Hz
   512 x 512 @ 60Hz
   640 x 480 @ 60Hz
   720 x 480 @ 60Hz
   800 x 600 @ 50Hz **
   1024 x 768 @ 50Hz **

This allows us to display arcade games very close to their original resolution. Soft 15khz accomplishes this by adding those resolutions to the registry. However these resolutions that you see above work for about 95% of games. Unfortanuatly a lot of the classics like pacman run at say 304x240@58z. This casues games sound and graphics to stutter because of the 2hz difference from the original game. This can easily be fixed adding an addition modeline to reflect the proper resolution and refresh rate through Soft 15KHZ, however there is a limitation with Forceware drivers
Theres a limit of 32 modelines with Nvidia drivers
A "bug" in the ForceWare.
They read/write from/to the CUST_MODE registry key with a 3000 byte buffer, while one mode is 92 bytes.
32 Modes * 92 Byte = 2944 Bytes = fine.
33 Modes * 92 Byte = 3036 Bytes = buffer overrun.

If you add more modes via the default NVidia controls you'll end up with garbage in the registry the first way.
If you add more modes via Soft-15kHz the data in the registry is fine.
However, on bootup, the driver reads only those 3000 bytes, which cuts off the 33rd mode and anything behind it, causing the whole CUST_MODE string getting detected as "faulty" and droped, hence the card generates the modes itself IN 31kHz.

This was taken from this thread http://forum.arcadecontrols.com/index.php?topic=66402.240

Can the 3000 byte buffer be increased in the driver?

This is an update in MAME 123u3 that will allow for limitless monitor configurations.

Updated info.c to output raw video parameters (pixclock, htotal,
hbend, hbstart, vtotal, vbend, vbstart) via -listxml if they have
been given. [couriersud]

This is great news, but only for ATI users ATM. Hoping someone out there can figure out how to increase this buffer size so Nvidia users can take advantage of this increased functionality of soft15khz and mame.


Silver

  • Wiki Contributor
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:April 16, 2025, 04:09:53 pm
  • Cunning like the Fox.
    • Mods'n'Mods
Re: Increase the 3000 byte buffer in Nvidia driver
« Reply #1 on: March 01, 2008, 11:06:31 am »
Assuming the Nvidia drivers are closed source, you'd be better off finding a forum relevant to nvidia drivers, or even submitted a bug report to the nvidia driver team. Hacking the drivers without source, apart from being hard, would probably need to be redone for every driver release.

Even if they only want 32 custom modes available, there is clearly a bug with how it deals with more than that. You may find they sort it out.


bent98

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 477
  • Last login:February 02, 2019, 03:35:00 pm
  • Hyperspin Moderator
Re: Increase the 3000 byte buffer in Nvidia driver
« Reply #2 on: March 01, 2008, 11:08:21 am »
I have left a various posts with the omega driver team. Havent gotten a response.

SailorSat

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1239
  • Last login:Today at 05:37:34 pm
    • For Amusement Only e.V.
Re: Increase the 3000 byte buffer in Nvidia driver
« Reply #3 on: March 01, 2008, 08:29:39 pm »
I've submited that bug to nvidia about half a year ago, got some replies regarding how to reproduce the bug, but haven't heard since then, and back then, forceware 71 was state of the art (just realize how OLD these are now).

However those overflow is still there in current releases.
I do all that stuff even without a Joystick ;)
Soft-15kHz, cabMAME, For Amusement Only e.V.


bent98

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 477
  • Last login:February 02, 2019, 03:35:00 pm
  • Hyperspin Moderator
Re: Increase the 3000 byte buffer in Nvidia driver
« Reply #4 on: March 01, 2008, 09:28:47 pm »
Sailor do you think the omega team can fix it through there driver release or nividia needs to fix it in the source code?


If nvidia can only address, if you can tell me who to contact I dont mind following up.
« Last Edit: March 01, 2008, 09:46:03 pm by bent98 »

SailorSat

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1239
  • Last login:Today at 05:37:34 pm
    • For Amusement Only e.V.
Re: Increase the 3000 byte buffer in Nvidia driver
« Reply #5 on: March 01, 2008, 09:51:59 pm »
Well, the bug happens in nv4_mini.sys.
It may be possible to change this by disassembling this file, however without the sourcecode this will be a painfull task with every new release.

Any "skilled" hacker/cracker should be able to do it.
« Last Edit: March 01, 2008, 09:54:44 pm by SailorSat »
I do all that stuff even without a Joystick ;)
Soft-15kHz, cabMAME, For Amusement Only e.V.


Silver

  • Wiki Contributor
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1668
  • Last login:April 16, 2025, 04:09:53 pm
  • Cunning like the Fox.
    • Mods'n'Mods
Re: Increase the 3000 byte buffer in Nvidia driver
« Reply #6 on: March 01, 2008, 10:41:38 pm »
Well, the bug happens in nv4_mini.sys.
It may be possible to change this by disassembling this file, however without the sourcecode this will be a painfull task with every new release.

That's reason enough not bother going that route (at least at the rate that gfx drivers are updated anyway).

Quote
Any "skilled" hacker/cracker should be able to do it.

Probably, assuming it's a simple case of increasing the size of buffer used to read a registry element. Assuming the rest of the driver can process more than 32 custom modes without falling over - as it's clearly never been tested with over 32 custom modes.

I taught myself enough x86 assembler (and Soft-ICE hacking) to hack a real-mode DOS IDE driver, and it was pretty uphill when you have to work on a dissassembled binary vs original source. (And that was a lot simplier as all I was doing was trapping a particular IDE call and then faking the result. I'd hate to imagine how much messier 32-bit Windows drivers are....)

Then again, I'm no programmer/hacker, so I'm sure it's childs play to some....

bent98

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 477
  • Last login:February 02, 2019, 03:35:00 pm
  • Hyperspin Moderator
Re: Increase the 3000 byte buffer in Nvidia driver
« Reply #7 on: March 02, 2008, 07:54:33 am »
Well, as long as we can get the lastest driver hacked, It will suffice. We re not using our cabinets to run pc games.

SailorSat

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1239
  • Last login:Today at 05:37:34 pm
    • For Amusement Only e.V.
Re: Increase the 3000 byte buffer in Nvidia driver
« Reply #8 on: March 02, 2008, 01:48:42 pm »
Well, as long as we can get the lastest driver hacked, It will suffice. We re not using our cabinets to run pc games.

We are not? I actually play World of Warcraft on my Cab!
(At least I use it to show off how to ride a Tiger with a Joystick :D)
I do all that stuff even without a Joystick ;)
Soft-15kHz, cabMAME, For Amusement Only e.V.