Energy Screen Project info

WDF files + wdfedit & wdftool & basic wdf file info; support/discussion/questions

Moderator: thunderchero

Locked
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Energy Screen Project info

Post by thunderchero »

This topic will be updated as info is posted in discussion topic for energy screen project.

disassembler help/energy screen project


This is what We know about hsenergy.wdf unedited

0x00 02 00 00 00
0x04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x14 BB 01 00 00 (size of main tga file width)
0x18 C6 01 00 00 (size of main tga file height)
0x1c 68 73 5F 65 6E 62 6B 67 2E 74 67 61 20 (main tga file used)
0x29 26 00 00 00 (total objects used)
0x2d 00 00 00 00
0x31 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (02 00 00 00 might be total buttons used?) untested
0x45 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (02 00 00 00 might be total sliders used?) untested
0x5d 0F 00 00 00 (total image objects used)
0x61 13 00 00 00 (total text objects used)
0x64 00 00 00 00
0x69 02 00 00 00 (02 is code used button)
0x6d 9D 09 00 00 (code to idenify object)
0x71 8B 01 00 00 (placement of top right pixel from right edge of *senbkg.tga)
0x75 4F 01 00 00 (placement of top right pixel from top edge of *senbkg.tga)
0x79 0D 00 00 00 (width of area in pixels to be used)
0x7d 10 00 00 00 (height of area in pixels to be used)
0x81 48 73 5F 73 64 72 72 2E 74 67 61 20 20 (tga file used)
0x8e FF FF FF FF 00 00 00 00 00 00 00 00 00
0x9b 48 73 5F 73 64 72 72 2E 74 67 61 20 20 (tga file used)
0xa8 68 73 5F 73 64 72 72 6F 2E 74 67 61 20 (tga file used)
0xa5 02 00 00 00 (02 is code used button)
0xb9 9C 09 00 00 (code to idenify object)
0xbd BA 00 00 00 (placement of top right pixel from right edge of *senbkg.tga)
0xc1 4F 01 00 00 (placement of top right pixel from top edge of *senbkg.tga)
0xc5 0D 00 00 00 (width of area in pixels to be used)
0xc9 10 00 00 00 (height of area in pixels to be used)
0xcd 48 73 5F 73 64 72 6C 2E 74 67 61 20 20 (tga file used)
0xda FF FF FF FF 00 00 00 00 00 00 00 00 00
0xe7 48 73 5F 64 72 6C 2E 74 67 61 20 20 (tga file used)
0xf4 68 73 5F 73 64 72 6C 6F 2E 74 67 61 20 (tga file used)
0x101 07 00 00 00 (07 is code used slider)
0x105 64 09 00 00 (code to idenify object)
0x109 CE 00 00 00 (placement of top right pixel from right edge of *senbkg.tga)
0x10d 4F 01 00 00 (placement of top right pixel from top edge of *senbkg.tga)
0x111 B6 00 00 00 (width of area in pixels to be used)
0x115 10 00 00 00 (height of area in pixels to be used)
0x119 48 73 5F 73 6C 64 33 30 2E 74 67 61 20 (tga file used)
0x126 00 00
0x128 5B 00 00 00
0x12c 5B 00 00 00
0x130 B6 00 00 00 (width of area in pixels to be used)
0x134 00 00 00 00
0x138 48 73 5F 73 6C 64 33 30 2E 74 67 61 20 (tga file used)
0x145 48 73 5F 73 6C 64 33 31 2E 74 67 61 20 (tga file used)
0x152 6E 6F 6E 65 20 20 20 20 20 20 20 20 20
0x15f 6E 6F 6E 65 20 20 20 20 20 20 20 20 20
0x16c 10 00 00 00 (height of area in pixels to be used)
0x170 00 00 00 00 00 00 00 00 00
0x178 07 00 00 00 (07 is code used slider)
0x17c 65 09 00 00 (code to idenify object)
0x180 CE 00 00 00 (placement of top right pixel from right edge of *senbkg.tga)
0x184 86 01 00 00 (placement of top right pixel from top edge of *senbkg.tga)
0x188 B6 00 00 00 (width of area in pixels to be used)
0x18c 10 00 00 00 (height of area in pixels to be used)
0x190 48 73 5F 73 6C 64 33 30 2E 74 67 61 20 (tga file used)
0x19d 00 00
0x19f 5B 00 00 00
0x1a3 5B 00 00 00
0x1a7 B6 00 00 00 (width of area in pixels to be used)
0x1ab 00 00 00 00
0x1af 48 73 5F 73 6C 64 33 30 2E 74 67 61 20 (tga file used)
0x1bc 49 73 5F 73 6C 64 33 31 2E 74 67 61 20 (tga file used)
0x1c9 6E 6F 6E 65 20 20 20 20 20 20 20 20 20
0x1d6 6E 6F 6E 65 20 20 20 20 20 20 20 20 20
0x1e3 10 00 00 00 00 00 00 00 00 00 00 00 (height of area in pixels to be used)

Image data area
starts 0x1ef - 0x455
it has 15 objects total 14 of them are for energy images.
other 1 is for orbital battery image
41 bytes of data each

0x1ef 0D 00 00 00 (0D is code used for images)
0x1f3 6A 09 00 00 (code to idenify object)
0x1f7 50 00 00 00 (placement of top right pixel from right edge of *senbkg.tga)
0x1fb 5A 00 00 00 (placement of top right pixel from top edge of *senbkg.tga)
0x1ff 1E 00 00 00 (width of area in pixels to be used)
0x203 1E 00 00 00 (height of area in pixels to be used)
0x207 6E 6F 6E 65 20 20 20 20 20 20 20 20 20
0x214 FF FF FF FF

text data area
starts 0x456 - 0xbd4
it has 19 objects total. 14 of them are used for energy value used.
101 bytes of data each.

0x456 0E 00 00 00 (0E is code used for text)
0x45a 60 09 00 00 (code to idenify object)
0x45e 47 00 00 00 (placement of top right pixel from right edge of *senbkg.tga)
0x462 23 00 00 00 (placement of top right pixel from top edge of *senbkg.tga)
0x466 AA 00 00 00 (width of area in pixels to be used)
0x46a 16 00 00 00 (height of area in pixels to be used)
0x46e 6E 6F 6E 65 20 20 20 20 20 20 20 20 20
0x47b 00 00 00 00 00 00 00 00
0x483 AA 00 00 00 (width of area in pixels to be used)
0x487 16 00 00 00 (height of area in pixels to be used)
0x48b 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x4ae 68 75 6D 61 6E 31 35 2E 66 6E 74 20 20 (font file used)

The other 4 *senergy.wdf for the other races are sightly different at the end of the file. All data is redundant data and does not count towards the total objects used or total text objects used. And data should match the final text entry in positions below.

Example below is from csenergy.wdf

0xbd5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xbfb 63 61 72 64 73 6E 31 35 2E 66 6E 74 00 (font file used)
0xc08 0E 00 00 00 (0E is code used for text)
0xc0c 8E 09 00 00 (code to idenify object)
0xc10 8B 01 00 00 (placement of top right pixel from right edge of *senbkg.tga)
0xc14 F5 00 00 00 (placement of top right pixel from top edge of *senbkg.tga)
0xc18 1E 00 00 00 (width of area in pixels to be used)
0xc1c 11 00 00 00 (height of area in pixels to be used)
0xc20 6E 6F 6E 65 20 20 20 20 20 20 20 20 20
0xc2d 00 00 00 00 00 00 00 00
0xc35 1E 00 00 00 (width of area in pixels to be used)
0xc39 11 00 00 00 (height of area in pixels to be used)
0xc3d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xc60 63 61 72 64 73 6E 31 35 2E 66 6E 74 00 (font file used)

I suspect all the extra data was added due to the font file names difference. and this data correct the problem for offsets. All attempts without this data caused CTD at galaxy generation.

human15.fnt 11 bytes
cardsn15.fnt 12 bytes (same for cardassian, ferengi, klingon, romulans)

End of WDF area info

thunderchero
Last edited by thunderchero on Tue Jul 05, 2011 3:21 pm, edited 2 times in total.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Post by thunderchero »

Info on unk_5960f4

I aligned my hex editor to display 12 rows so unk_5960f4 could be seen better.



The first section yellow is the type of object.

02 00 00 00 = button
07 00 00 00 = slider
0D 00 00 00 = image
0E 00 00 00 = text

This must match the data in the wdf for type of each object.

The second section red is the wdf code. This code must match all entries in wdf and this area of trek.exe. If these values are switched they may change what is displayed and where. and some when switched will cause crash. completely different values can be used but values must be kept in same order in both wdf and trek.exe

the third section green is the trek.exe object reference value. This value can only be found in the trek.exe and has many location though out the code used by the wdf GUI. finding all the locations is one of the main keys to this project.

relocation of the unk_5960f4 to allow up to 55 objects total
Spocks-cuddly-tribble wrote:here is how to extend trek.exe area for senergy.wdf:

- number of 12 byte entries / controlled objects (i.e. * 12 = length of data field)
- asm address of data field

Code: Select all

004F8701     BA 26000000     MOV EDX, 26
004F8706     B8 F4605900     MOV EAX, 005960F4

004F9020     BB 26000000     MOV EBX, 26
004F9025     BA F4605900     MOV EDX, 005960F4
Following option allows for 6 more 12 byte entries i.e. 44 in total: (just to keep things simple for testing purpose, at least 55 entries are no problem, if it works)

1. Use shared bonus ranges (i.e. all empires use cardassian data / unmodded this doesn't matter if card range bug was fixed: Map Range)

at 0x7B603 change 01 C3 -> 90 90
at 0x7B79B change 01 C1 -> 90 90

2. Change asm-address of senergy data field to asm_00590B04 i.e. 0x18E904 (ex. fed-rom bonus ranges = 44*12bytes max.)

3. Increase number of entries to read from data field (size)

4. Copy & paste extended new data field at 0x18E904
It is also possible to extend trek.exe area for senergy.wdf to allow 66 objects:

first you would need to move 3 separate unk to the old location of the *senergy.wdf data.

unk_590A80 (132 bytes) 0x18e880 - 0x18e903
unk_590D14 (120 bytes) 0x18eb14 - 0x18eb8b
unk_590D8C (12 bytes) 0x18eb8c - 0x18eb97

after relocating the unk data to 5960F4 0x193ef4 you will have to reset the asm address of data field as before.

for unk_590A80
at 47C1F0 0x7b5f0 mov ebx, offset unk_590A80
and
at 47C380 0x7b780 mov ecx, offset unk_590A80

for unk_590D14
at 47C29E 0x7b69e mov edx, offset unk_590D14
and
at 47C3D8 0x7b7d8 add eax, offset unk_590D14

for unk_590D8C
at 47C2AD 0x7b6ad mov edx, offset unk_590D8C
and
at 47C3BF 0x7b7bf mov eax, offset unk_590D8C

Then the energy data can be moved again to 590A80 0x18e880

then reset the asm address of data field for energy data
at 4F8706 0xf7b06 mov eax, offset unk_5960F4
and
at 4F9025 0xf8425 mov edx, offset unk_5960F4

End of unk_5960f4 info

More info will be added later once images are created or new info found.

thunderchero
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re:

Post by thunderchero »

thunderchero wrote:Info on unk_5960f4

I aligned my hex editor to display 12 rows so unk_5960f4 could be seen better.


The first section yellow is the type of object.

02 00 00 00 = button
07 00 00 00 = slider
0D 00 00 00 = image
0E 00 00 00 = text

This must match the data in the wdf for type of each object.

The second section red is the wdf code. This code must match all entries in wdf and this area of trek.exe. If these values are switched they may change what is displayed and where. and some when switched will cause crash. completely different values can be used but values must be kept in same order in both wdf and trek.exe

the third section green is the trek.exe object reference value. This value can only be found in the trek.exe and has many location though out the code used by the wdf GUI. finding all the locations is one of the main keys to this project.

relocation of the unk_5960f4 to allow up to 55 objects total
Spocks-cuddly-tribble wrote:here is how to extend trek.exe area for senergy.wdf:

- number of 12 byte entries / controlled objects (i.e. * 12 = length of data field)
- asm address of data field

Code: Select all

004F8701     BA 26000000     MOV EDX, 26
004F8706     B8 F4605900     MOV EAX, 005960F4

004F9020     BB 26000000     MOV EBX, 26
004F9025     BA F4605900     MOV EDX, 005960F4
Following option allows for 6 more 12 byte entries i.e. 44 in total: (just to keep things simple for testing purpose, at least 55 entries are no problem, if it works)

1. Use shared bonus ranges (i.e. all empires use cardassian data / unmodded this doesn't matter if card range bug was fixed: Map Range)

at 0x7B603 change 01 C3 -> 90 90
at 0x7B79B change 01 C1 -> 90 90

2. Change asm-address of senergy data field to asm_00590B04 i.e. 0x18E904 (ex. fed-rom bonus ranges = 44*12bytes max.)

3. Increase number of entries to read from data field (size)

4. Copy & paste extended new data field at 0x18E904
It is also possible to extend trek.exe area for senergy.wdf to allow 66 objects:

first you would need to move 3 separate unk to the old location of the *senergy.wdf data.

unk_590A80 (132 bytes) 0x18e880 - 0x18e903
unk_590D14 (120 bytes) 0x18eb14 - 0x18eb8b
unk_590D8C (12 bytes) 0x18eb8c - 0x18eb97

after relocating the unk data to 5960F4 0x193ef4 you will have to reset the asm address of data field as before.

for unk_590A80
at 47C1F0 0x7b5f0 mov ebx, offset unk_590A80
and
at 47C380 0x7b780 mov ecx, offset unk_590A80

for unk_590D14
at 47C29E 0x7b69e mov edx, offset unk_590D14
and
at 47C3D8 0x7b7d8 add eax, offset unk_590D14

for unk_590D8C
at 47C2AD 0x7b6ad mov edx, offset unk_590D8C
and
at 47C3BF 0x7b7bf mov eax, offset unk_590D8C

Then the energy data can be moved again to 590A80 0x18e880

then reset the asm address of data field for energy data
at 4F8706 0xf7b06 mov eax, offset unk_5960F4
and
at 4F9025 0xf8425 mov edx, offset unk_5960F4

End of unk_5960f4 info

More info will be added later once images are created or new info found.

thunderchero
Locked

Return to “WDF files + wdfedit & wdftool & basic wdf file info”