[1.10b] Mac D2 Function List
Moderator: Contrail
-
- Paladin
- Posts: 169
- Joined: Sun Jul 13, 2003 1:37 am
- Location: Austin, TX
[1.10b] Mac D2 Function List
This is the Mac counterpart to the 1.10 D2 Functions List in the Code Editing forum. Any contributions to this list would be quite welcome. In addition to the normal information about each function, the corresponding Windows D2 function from version 1.10 should be listed if one is known to exist. The function ordinals I'm giving here were derived using PEFViewer, a tool for viewing PEF executable files I downloaded from the Apple Developer Connection website.
Diablo II (Carbon) Functions
Diablo II (Carbon).2383 - Loads all txt or bin images
Diablo II (Carbon).2387 - Load a bin file to memory or load a txt file and compile to bin
Diablo II (Carbon).3616 - Get gold limit in stash from ptUnit
Diablo II (Carbon).3634 - Get gold limit in character inventory from ptUnit
Diablo II (Carbon).3866 - Gets stat value (base plus items)
Diablo II (Carbon).3867 - Get a stat value (base only)
Diablo II (Carbon).3868 - Increase a stat by a value
Diablo II (Carbon).6798 - Compiles table to bin format
Diablo II (Carbon).6799 - Converts bin tables from little-endian format to big-endian format
- Contrail
Diablo II (Carbon) Functions
Diablo II (Carbon).2383 - Loads all txt or bin images
Diablo II (Carbon).2387 - Load a bin file to memory or load a txt file and compile to bin
Diablo II (Carbon).3616 - Get gold limit in stash from ptUnit
Diablo II (Carbon).3634 - Get gold limit in character inventory from ptUnit
Diablo II (Carbon).3866 - Gets stat value (base plus items)
Diablo II (Carbon).3867 - Get a stat value (base only)
Diablo II (Carbon).3868 - Increase a stat by a value
Diablo II (Carbon).6798 - Compiles table to bin format
Diablo II (Carbon).6799 - Converts bin tables from little-endian format to big-endian format
- Contrail
Last edited by Contrail on Wed Nov 07, 2007 2:38 pm, edited 2 times in total.
-
- Paladin
- Posts: 169
- Joined: Sun Jul 13, 2003 1:37 am
- Location: Austin, TX
Re: [1.10b] Mac D2 Function List
Here is the first set of functions...
- Contrail
Code: Select all
Diablo II (Carbon).2383 (D2Common.10576)
Function: Loads all txt or bin images
Offset: 00160470 (0x01168470)
Parameters: r3 - 0
r4 - ?
r5 - ?
Returns: N/A
Code: Select all
Diablo II (Carbon).2387 (D2Common.10578)
Function: Load a bin file to memory OR load a txt file and compile to bin
Offset: 00160bc0 (0x01168bc0)
Parameters: r3 - 0
r4 - location of the table name
r5 - location on the stack for bottom of build defining table structure
r6 - location that receives the number of records
r7 - limit of record length in bytes
Returns: r3 = pointer to heap memory for the bin image
Code: Select all
Diablo II (Carbon).3616 (D2Common.10339)
Function: Get gold limit in stash from ptUnit
Offset: 001da350 (0x011e2350)
Parameters: r3 - ptUnit
Returns: r3 = gold limit in stash
Code: Select all
Diablo II (Carbon).3634 (D2Common.10439)
Function: Get gold limit in character inventory from ptUnit
Offset: 001dad60 (0x011e2d60)
Parameters: r3 - ptUnit
Returns: r3 = gold limit in stash
Code: Select all
Diablo II (Carbon).3866 (D2Common.10519)
Function: Gets stat value (base plus items)
Offset: 001ea1d0 (0x011f21d0)
Parameters: r3 - ptUnit
r4 - stat ID from ItemStatCost.txt
r5 - stat table index
Returns: r3 = stat value
Code: Select all
Diablo II (Carbon).3867 (D2Common.10521)
Function: Get a stat value (base only)
Offset: 001ea360 (0x011f2360)
Parameter: r3 - ptUnit
r4 - stat ID from ItemStatCost.txt
r5 - stat table index
Returns: r3 = stat value
Code: Select all
Diablo II (Carbon).3868 (D2Common.10518)
Function: Increase a stat by a value
Offset: 001ea4e0 (0x011f24e0)
Parameters: r3 - ptUnit
r4 - stat ID from ItemStatCost.txt
r5 - stat increase (signed value)
r6 - stat table index
Returns: N/A
Code: Select all
Diablo II (Carbon).6798 (Fog.10207)
Function: Compiles table to bin format
Offset: 003d12b0 (0x013d92b0)
Parameters: r3 - pointer to the file image in memory
r4 - pointer to the table structure in local variables
r5 - pointer to the destination memory block
r6 - number of records
r7 - record length
Returns: N/A
Code: Select all
Diablo II (Carbon).6799
Function: Converts bin tables from little-endian format to big-endian format
Offset: 003d1df0 (0x013d9df0)
Parameters: r3 - table structure
r4 - table memory block
r5 - number of entries
r6 - record length
Returns: N/A
Re: [1.10b] Mac D2 Function List
That is an impressive start! I bet Souricette would have loved to have known about that last function.
One minor nit, the Windows equivalent functions pointed to are for v1.10 and v1.09x only. When Blizzard Leftover released v1.11 they scrambled the decks badly, then they did it again with v1.11b. Nefarius has been working in the latest version and uses those ordinals exclusively, while some of us dinosaurs (myself included) still work in the older versions.
One minor nit, the Windows equivalent functions pointed to are for v1.10 and v1.09x only. When Blizzard Leftover released v1.11 they scrambled the decks badly, then they did it again with v1.11b. Nefarius has been working in the latest version and uses those ordinals exclusively, while some of us dinosaurs (myself included) still work in the older versions.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening
-
- Paladin
- Posts: 169
- Joined: Sun Jul 13, 2003 1:37 am
- Location: Austin, TX
Re: [1.10b] Mac D2 Function List
I'm sure he would've, although the conversion isn't completely perfect for generating bin files for output. There's one multibyte bin datatype (0x17) that doesn't get converted from little-endian to big-endian for some reason, so I had to write some custom code to fix those particular values since they still get generated as big-endian. Thankfully it seems to only be used in a handful of files.Myhrginoc";p="364315" wrote:That is an impressive start! I bet Souricette would have loved to have known about that last function.
I actually have a longer list that's just equivalences between functions in the Mac version and the Windows version, which were reasoned out while doing some side-by-side comparisons of the same function in both versions. It would've been a lot harder to figure out these functions if I didn't have what's known about the Windows version to use as a reference.
I've edited the initial post to clarify which version of Windows D2 the equivalent functions are taken from. I think it makes the most sense to use the same version on each platform when comparing functions between platforms. If I ever make a 1.11b version of this list, I'd use Windows 1.11b ordinals for the equivalent functions.One minor nit, the Windows equivalent functions pointed to are for v1.10 and v1.09x only. When Blizzard Leftover released v1.11 they scrambled the decks badly, then they did it again with v1.11b. Nefarius has been working in the latest version and uses those ordinals exclusively, while some of us dinosaurs (myself included) still work in the older versions.
- Contrail
Last edited by Contrail on Wed Nov 07, 2007 3:13 pm, edited 1 time in total.
Re: [1.10b] Mac D2 Function List
That one is strange. Unlike the other datatypes, this type serves to call any number of functions based on the field's purpose. If you trap the call to Diablo II (Carbon).2387 for Monstats, Monstats2, MonPreset and Cubemain, you should see the linking functions used by each type 0x17 field in the stack build (assuming the Mac equivalent formats the inputs the same way).Contrail" wrote:There's one multibyte bin datatype (0x17) that doesn't get converted from little-endian to big-endian for some reason, so I had to write some custom code to fix those particular values since they still get generated as big-endian. Thankfully it seems to only be used in a handful of files.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening