would it be possible to change location to VirtualAlloc?
I was able to get ship loaded in research screen in ida debug, but when ship was loaded it had no palette data at 5B58A8
Spocks-cuddly-tribble wrote: ↑Mon Aug 23, 2021 3:26 pmDr_Breen wrote: ↑Sun Mar 22, 2009 10:55 amthe maximum numbers of palettes that trek.exe can use is 127. here's a small example how your ships look like when you use more than the maximum number of Palettes allowed:
In vanilla botf 122 palettes are already in use, so after adding 5 custom ships to the game you will run into this problem.
The trek.exe limit can be increased by increasing below code pointers by +2*(number of extra palettes), but requires also preparing a new dynamic area in trek.exe (initialized with zero bytes).
Code: Select all
AUTO:00539C05 mov esi, 59FF30 offset dynamic data field length 104h 260 -> new length +2* (number of extra palettes) AUTO:00539C55 mov esi, 59FE30 offset dynamic data field length 100h 256 -> new length +2* (number of extra palettes) sub_538450 AUTO:00538454 sub esp, 108h AUTO:00538497 mov [esp+100h], ebp AUTO:005384A0 mov [esp+104h], ebp AUTO:005384AE lea eax, [esp+100h] AUTO:005384BE mov ecx, [esp+100h] AUTO:005384CE mov esi, [esp+104h] AUTO:005384DC add esp, 108h AUTO:005384EE mov [esp+100h], ebp AUTO:00538503 mov [esp+104h], edi AUTO:0053850C lea eax, [esp+100h] AUTO:00538573 lea eax, [esp+100h] AUTO:00538596 lea eax, [esp+100h] AUTO:005385BB lea eax, [esp+100h] AUTO:005385C9 mov ecx, [esp+100h] AUTO:005385E6 mov [esp+100h], ebx AUTO:005385ED mov esi, [esp+104h] AUTO:00538609 mov [esp+104h], edi AUTO:00538612 add esp, 108h AUTO:0053861D lea eax, [esp+100h] AUTO:0053863E lea eax, [esp+100h] AUTO:00538652 lea eax, [esp+100h] AUTO:005386BC lea eax, [esp+100h] AUTO:005386C8 lea eax, [esp+100h] AUTO:0053870B lea eax, [esp+100h] AUTO:00538754 lea eax, [esp+100h] AUTO:00538762 mov esi, [esp+100h] AUTO:0053877C mov [esp+100h], edi AUTO:00538783 mov ebp, [esp+104h] AUTO:0053879A mov dword ptr [esp+104h], 0FFFFFFFFh AUTO:005387A7 add esp, 108h sub_538CA0 AUTO:00538CA4 sub esp, 110h AUTO:00538CAA mov [esp+10Ch], eax AUTO:00538CB8 mov eax, 130h -> ??? AUTO:00538CCD mov eax, [esp+110h] AUTO:00538CD4 lea edx, [esp+104h] AUTO:00538D4E lea eax, [esp+100h] AUTO:00538D78 lea eax, [esp+100h] AUTO:00538D96 lea eax, [esp+100h] AUTO:00538DB4 lea eax, [esp+100h] AUTO:00538DDF mov eax, [esp+10Ch] AUTO:00538E07 add esp, 110h AUTO:00538E3F add esp, 110h
But we can try to use the fixed asm-address of the loaded combat.bin file (unused feature):
1. Overwrite combat.bin (stbof.res) with zero bytes (62500)
2. Set AUTO:00539C05 mov esi, 59FF30 -> 5B58A8 (adr loaded combat.bin now initialized with zero bytes)
3. Ignore AUTO:00539C55 mov esi, 59FE30 (redirecting 59FF30 redoubles code space).
4. Increase all listed code pointer by 100h.
5. Test up to 255 palettes.