Vinifera icon indicating copy to clipboard operation
Vinifera copied to clipboard

[Enhancement] Improve performance on modern systems by not allocating surfaces to VRAM

Open Rampastring opened this issue 3 years ago • 1 comments

Description:

AlexB has a very detailed write-up of this on his site: http://www.stuffhost.de/files/cnc/ CnCNet ts-patches has this included as well: https://github.com/CnCNet/ts-patches/blob/master/src/graphics_patch.asm

The dimetric Command & Conquer games use several temporary graphics to draw to. Some of them are allocated in Video RAM, some of them are allocated in system RAM. When the game wants to draw something, the data has to be copied from VRAM to system RAM, which is an expensive operation and it gets more obvious the more objects (units, debris, ...) are on the map. The patch changes the game to not allocate surfaces in VRAM in the first place, so this cannot become an issue.

The following bytes need to be changed. This is not optimized. If you understand the raw assembler instructions, you can optimize it by putting a jmp there.

Game Offset Original Patched
Tiberian Sun 0008AC2F 3C 01 75 0C 90 90 90 90

Rampastring avatar May 06 '21 18:05 Rampastring