Important Parts in NV ROMs
Before editing a Mac nvidia ROM, you need to know where some important strings are located:
1/ Device ID
2/ Softstraps
3/ Performance Table
4/ Boot Settings
5/ Timings Table
6/ Appendix
ROM editing should be done with a hexadecimal editor, like Hexedit.
Some of these edits is only needed for GeForce 6 and newer. GeForce 3/4 series only need Device ID settings and Timings Table as the other parts are not present in older ROMs
1/ Device ID
The first thing that needs to be set correctly in the Mac ROM the is Device ID. It should be set to the hardware, or "hardwired" Device ID of the PC card. You can check it in Windows with Rivatuner.
Example:
Mac ROM for PCIe GF6600, modding for AGP GF6600 (PNY Verto GeForce 6600 AGP Revision 1) :
In the beginning of the ROM:
0x0000: 55 AA 40 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0010: 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00
0x0020: 50 43 49 52 DE 10 41 01 00 00 20 00 00 00 00 03
0x0030: 84 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00
0x0040: F1 08 17 0F 00 01 06 55 12 2A 00 00 00 00 00 00
0x0050: 00 00 00 00 DE 10 50 00 3E 00 21 00 81 90 40 A3
Search for the first DE 10 occurence (DE 10 is "endian-flipped" 10 DE for NVIDIA Vendor ID).
Right after it is 41 01 which is, again, flipped 01 41 - the Device ID of PCIe GeForce 6600.
AGP GeForce 6600 Device ID is usually 00 F2 so you need to set F2 00 in the ROM, like this:
0x0000: 55 AA 40 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0010: 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00
0x0020: 50 43 49 52 DE 10 F2 00 00 00 20 00 00 00 00 03
0x0030: 84 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00
0x0040: F1 08 17 0F 00 01 06 55 12 2A 00 00 00 00 00 00
0x0050: 00 00 00 00 DE 10 50 00 3E 00 21 00 81 90 40 A3
2/ Softstraps
Softstraps are also in the beginning of the ROM, after the second DE 10 occurrence.
If you want to use the PC ROM's memory timings and other advanced settings in the Mac rom, you need to copy the PC ROM's softstraps into the Mac ROM.
Still working on PCIe 6600 rom, the softstraps are located at offset 0x0058:
0x0000: 55 AA 40 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0010: 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00
0x0020: 50 43 49 52 DE 10 41 01 00 00 20 00 00 00 00 03
0x0030: 84 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00
0x0040: F1 08 17 0F 00 01 06 55 12 2A 00 00 00 00 00 00
0x0050: 00 00 00 00 DE 10 50 00 3E 00 21 00 81 90 40 A3
0x0060: 00 00 00 00 90 04 00 80 00 00 A5 F4 00 00 00 00
PC rom softstraps are located at the same place, starting at offset 0x0058:
0x0000: 55 AA 7E EB 4B 37 34 30 30 E9 4C 19 77 CC 56 49
0x0010: 44 45 4F 20 0D 00 00 00 DC 00 13 10 00 00 49 42
0x0020: 4D 20 56 47 41 20 43 6F 6D 70 61 74 69 62 6C 65
0x0030: 01 00 00 00 B0 10 FC 96 30 32 2F 30 32 2F 30 35
0x0040: 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00
0x0050: E9 70 DC 00 00 00 00 00 3F 40 2F 7C 00 91 40 83
0x0060: EF FF FF 7F 10 00 00 80 22 00 A5 BF E9 B9 B6 E9
The length of the softstrap data is always the same - 40 hex digits, seen as 20 pairs of 2. Here is the result for your hybrid rom:
0x0000: 55 AA 40 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0010: 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00
0x0020: 50 43 49 52 DE 10 41 01 00 00 20 00 00 00 00 03
0x0030: 84 00 00 00 01 80 00 00 00 00 00 00 00 00 00 00
0x0040: F1 08 17 0F 00 01 06 55 12 2A 00 00 00 00 00 00
0x0050: 00 00 00 00 DE 10 50 00 3F 40 2F 7C 00 91 40 83
0x0060: EF FF FF 7F 10 00 00 80 22 00 A5 BF 00 00 00 00
3/ Performance Table
The performance Table contains active 3D GPU and memory clock settings, and may also set fan speed and GPU voltage.
The Performance Table is usually located after the beginning of the BIT section, which you can find in Mac GeForce 6/7 series ROMs searching with a hexadecimal editor for the ASCII string BIT
Performance Table itself is right before Board description where you should see in ASCII the BIOS version and Board ID.
It does not always have the exact same formatting depending on ROMs, so here are two examples :
GeForce 6600 style :
23 0B 01 10 08 04 FF 00 00 18 02 20 FF 00 00 64
82 F4 01 00 00 00 C2 01 02 00 00 00 FF FF 00 00
FF FF 00 00 FF FF 00 00 FF FF 00 00 FF FF 00 00
FF FF 00 00 FF FF 00 00 FF FF 00 10 04 03 05 00
GeForce 6800 style :
21 0B 01 0E 08 02 FF 03 00 18 02 20 FF 00 00 20
82 5E 01 00 00 00 F4 01 02 00 FF 00 FF 00 FF 00
FF 00 FF 00 FF 00 FF 00 FF 10 04 03 0E 00 00 00
First 4 bytes block in bold is Fanspeed (1 byte) GPU voltage (1 byte) GPU clock speed (2 bytes) keep in mind little endian formatting for more than 1 byte values. So in the first example, Fan is set at 100% (hex 64) GPU voltage is set at 1.3V (130 is hex 82) and GPU clock is set at 500Mhz (hex 01F4 - endian flipped F4 01). In second example, fan is set at 32% (hex 20) GPU voltage is set at 1.3V (130 is hex 82) and GPU clock is set at 350Mhz (hex 015E - endian flipped 5E01)
Second 2 bytes block in bold is memory clock speed setting. As memory is DDR in modern cards, the value is the actual real value, so it is 500Mhz for DDR1000. Be carefull not to set memory at twice the supported speed ! In first example, memory is set at 450Mhz - DDR900 (hex 01C2 - endian flipped C2 01). In second example, memory is set at 500Mhz - DDR1000 (hex 01F4 - endian flipped F4 01)
4/ Boot Settings
Boot settings are GPU and memory speed settings at boot time, before the nvidia driver takes over. This is not the most important part, but having incorrect settings here can produce boot issues or wake from sleep issues.
These settings are located in Mac and PC roms after the first "4A D4". GPU and memory are both preceded by "4A D4" followed by 8 speed settings.
In the PC rom:
00 00 3C 10 03 00 71 4A D4 03 3C 70 04 08 04 40
00 00 E0 93 04 00 E0 93 04 00 E0 93 04 00 E0 93
04 00 E0 93 04 00 E0 93 04 00 E0 93 04 00 E0 93
04 00 71 4A D4 03 3C 70 04 08 24 40 00 00 20 A1
07 00 20 A1 07 00 20 A1 07 00 20 A1 07 00 20 A1
07 00 20 A1 07 00 20 A1 07 00 20 A1 07 00 71 5B
In the Mac rom:
FF FF FF FF 00 00 00 00 71 71 4A D4 03 3C 70 04
08 04 40 00 00 E0 93 04 00 E0 93 04 00 E0 93 04
00 E0 93 04 00 E0 93 04 00 E0 93 04 00 E0 93 04
00 E0 93 04 00 71 4A D4 03 3C 70 04 08 24 40 00
00 80 1A 06 00 80 1A 06 00 80 01 15 01 12 12 FC
1A 06 00 80 1A 06 00 80 1A 06 00 20 A1 07 00 80
1A 06 00 80 1A 06 00 71 78 D4 03 44 00 00 39 05
Note this string: 01 15 01 12 12 FC. In mac roms, this is repeated many times regularly for tokenizing purpose. Don't mess with it; leave it where it is.
In the PC rom:
Here GPU boot speed is E0 93 04, repeated 8 times - sometimes values are different - the softstraps determine which one the card actually uses, this is partly why softstraps are important. They also set the memory speed from the table in the same way.
E0 93 04 is flipped hex 04 93 E0, for decimal 300000 -> 300Mhz.
Memory boot speed is 20 A1 07, also repeated 8 times, is flipped hex 07 A1 20 for decimal 500000 -> 500Mhz. This is for 4ns DDR RAM, 2x250Mhz.
The Mac ROM has the same GPU boot settings, but different memory boot settings. Here the memory boot settings are 80 1A 06 (400Mhz) 5 times, then 20 A1 07 (500Mh) then the last two are 80 1A 06 (400Mhz).
here is the moddified boot speed settings for hybrid Mac rom:
FF FF FF FF 00 00 00 00 71 71 4A D4 03 3C 70 04
08 04 40 00 00 E0 93 04 00 E0 93 04 00 E0 93 04
00 E0 93 04 00 E0 93 04 00 E0 93 04 00 E0 93 04
00 E0 93 04 00 71 4A D4 03 3C 70 04 08 24 40 00
00 20 A1 07 00 20 A1 07 00 20 01 15 01 12 12 FC
A1 07 00 20 A1 07 00 20 A1 07 00 20 A1 07 00 20
A1 07 00 20 A1 07 00 71 78 D4 03 44 00 00 39 05
5/ Timings table
The timings table is a very important part of the rom. It configures memory settings for your onboard memory chips, and also controls the real amount of memory. This part must be edited for any card not perfectly matching Apple hardware.
Geforce 6200 to Quadro FX 4500 ROMs for Mac and PC use a set of 8 timings sets with several values for each set.
Timings table is located after this string:
32 D4 03 3C 70 04 08 20 02 10 00
Each part of the timing table is divided in 8 values, for the 8 timings sets, preceded by a 32 D4 03 3C … string.
Still working on the Mac PCIe 6600 ROM:
32 D4 03 3C 70 04 08 20 02 10 00 0C 0E 08 04 0C
0E 08 04 1F 2B 16 09 0C 0E 08 04 0C 0E 08 04 0D
0F 09 04 0F 12 0A 05 0D 0F 09 04 32 D4 03 3C 70
04 08 24 02 10 00 05 04 03 05 05 04 01 05 07 08
01 09 05 04 03 05 05 04 03 05 05 04 01 06 06 04
01 05 05 04 01 05 32 D4 03 3C 70 04 08 28 02 10
00 04 04 22 00 04 02 22 20 0C 09 25 23 04 04 22
00 04 04 22 00 04 03 23 20 05 02 22 20 04 02 23
20 32 D4 03 3C 70 04 08 2C 02 10 00 72 F1 08 00
02 81 08 51 07 86 0D 46 72 F1 08 00 71 F1 06 01
15 01 12 12 FC 00 02 81 08 51 03 92 0A 52 02 91
09 51 32 D4 03 3C 70 04 08 30 02 10 00 1F 0C 00
00 1F 0C 00 00 1F 0C 00 00 1F 0C 00 00 1F 0C 00
00 1F 0C 00 00 1F 0C 00 00 1F 0C 00 00 32 D4 03
3C 70 04 08 34 02 10 00 33 FF B5 00 22 54 E4 00
55 92 22 00 33 FF B5 00 33 FF B5 00 33 54 F4 00
21 FF B5 00 33 FF B5 00 32 D4 03 3C 70 04 08 38
02 10 00 14 01 00 00 14 02 15 00 16 01 1F 00 14
01 00 00 12 01 00 00 14 02 15 00 16 02 3F 00 15
02 20 00 …
Don't forget the 01 15 01 12 12 FC string which is repeated in mac roms and can be cutting any other string.
You have to leave it where it is when inserting PC rom values, and this can be confusing sometimes.
Here is the PC ROM timings table:
32 D4 03 3C 70 04 08 20 02 10 00 0C 0E 08 04 10
14 0B 05 1F 2B 16 09 0C 0E 08 04 0C 0E 08 04 0C
0E 08 04 0F 12 0A 05 0D 0F 09 04 32 D4 03 3C 70
04 08 24 02 10 00 05 04 03 05 06 04 01 05 07 08
01 09 05 04 03 05 05 04 03 05 05 04 03 05 06 04
01 05 05 04 01 05 32 D4 03 3C 70 04 08 28 02 10
00 04 04 22 00 05 03 23 20 0C 09 25 23 04 04 22
00 04 04 22 00 04 04 22 00 05 02 22 20 04 02 23
20 32 D4 03 3C 70 04 08 2C 02 10 00 72 F1 08 00
03 92 0A 52 07 86 0D 46 72 F1 08 00 71 F1 06 00
72 F1 08 00 03 92 0A 52 02 91 09 51 32 D4 03 3C
70 04 08 30 02 10 00 BF 01 00 00 3F 0C 00 00 1F
0C 00 00 BF 0C 00 00 1F 00 00 00 1F 00 00 00 3F
0C 00 00 3F 0C 00 00 32 D4 03 3C 70 04 08 34 02
10 00 33 FF B5 00 22 FF B5 00 55 92 22 00 33 FF
B5 00 33 FF B5 00 33 FF B5 00 22 FF B5 00 33 FF
B5 00 32 D4 03 3C 70 04 08 38 02 10 00 14 01 00
00 16 02 20 00 16 01 1F 00 14 01 00 00 12 01 00
00 14 01 00 00 16 02 20 00 15 02 20 00 …
And here is now the Mac ROM timings table with PC ROM values (preserving the 01 15 01 12 12 FC location):
32 D4 03 3C 70 04 08 20 02 10 00 0C 0E 08 04 10
14 0B 05 1F 2B 16 09 0C 0E 08 04 0C 0E 08 04 0C
0E 08 04 0F 12 0A 05 0D 0F 09 04 32 D4 03 3C 70
04 08 24 02 10 00 05 04 03 05 06 04 01 05 07 08
01 09 05 04 03 05 05 04 03 05 05 04 03 05 06 04
01 05 05 04 01 05 32 D4 03 3C 70 04 08 28 02 10
00 04 04 22 00 05 03 23 20 0C 09 25 23 04 04 22
00 04 04 22 00 04 04 22 00 05 02 22 20 04 02 23
20 32 D4 03 3C 70 04 08 2C 02 10 00 72 F1 08 00
03 92 0A 52 07 86 0D 46 72 F1 08 00 71 F1 06 01
15 01 12 12 FC 00 72 F1 08 00 03 92 0A 52 02 91
09 51 32 D4 03 3C 70 04 08 30 02 10 00 BF 01 00
00 3F 0C 00 00 1F 0C 00 00 BF 0C 00 00 1F 00 00
00 1F 00 00 00 3F 0C 00 00 3F 0C 00 00 32 D4 03
3C 70 04 08 34 02 10 00 33 FF B5 00 22 FF B5 00
55 92 22 00 33 FF B5 00 33 FF B5 00 33 FF B5 00
22 FF B5 00 33 FF B5 00 32 D4 03 3C 70 04 08 38
02 10 00 14 01 00 00 16 02 20 00 16 01 1F 00 14
01 00 00 12 01 00 00 14 01 00 00 16 02 20 00 15
02 20 00 …
6/ Appendix
These basic edits might not be enough if you're trying to create a mac ROM for a card which has a very different PCB than the one used by Apple. It could also not work properly if the PC card has different memory amount, different kind of RAM chips (DDR, GDDR2 or GDDR3) or a different memory interface (64bit, 128bit or 256bit).
You can get better results if you edit every string after each occurence of D4 03 3C in Mac ROM according to PC ROM settings. You need to respect the lengh of each string, sometimes, the end of the strings in PC and Mac ROMs differ. Also beware of the 01 15 01 12 12 FC in Mac ROMs so you have to keep every occurence of it where it was. The whole part which needs to be edited in Mac ROM according to PC ROM values is the same part where first and last 01 15 01 12 12 FC are.