CDoom

CDoom v2.05 reference

FEATURES:

Music system: support opl2/opl3/mpu401, the only engine that have music equal doom2.exe original. The mus_card variable in the cdoom.cfg file defines the value 0 as autodetect, 1 opl2, 2 opl3, 3 none, 4 mpu401.

True 3d gameplay: optional, can be changed in the options menu.

Jump: use the key ';'(default), with the cheat JET, can toggle fly mode. Other cheats: INFINITE- infinite ammo, RES- ressurrect the player when it dies.

3d floors: very fast rendering, may have some bugs, in development yet, when running a map with one 3d floor is as if added one sector more, when adding many 3d floors, slow down little(see Metro1,Metro2,Metro3,Mercurio test maps). The thing sprites code rendering in 3d floors is not complete(wrong render order sometimes).

Monsters infight: dehacked option added, for imps against imps, etc.

Sound: works with a SB or compatible card, is a simplified driver. Please, let me know if works in your computer or no. If yes, tell me what is your sound card, if possible dsp version, if compatible with SB or no. I will intend to build a better sound reference in this file.

ENHANCEMENTS:

Detection of blockmap/reject ausent to avoid crash when one of this resources are missed, or for automatic blockmap building by CDoom.

Blockmap collision better in huge maps, Metro1.wad,Metro2.wad,Metro3.wad. When running this maps in MBF, some blockmap points don´t collide properly.

Fast video code: run under WIN NT, not tested in linux dosemu, please test and tell me. Very optimized.

Demo playback: maximum compatibility with doom2.exe v1.9 and MBF v2.03, boom demos may not playback properly. Few demos of doom2.exe v1.9 may desync(eternal et312223). There is demos bad recorded that desync with doom2.exe too.

General speed: extremely optimized, sound code fast, 3d floor code don´t slow down the program, video code fast, is possible some more optimization. The speed of -fastdemo nx22-051 in a pentium 233 is 227 fps maximum. Faster than doom2.exe. The only engine that is faster than CDoom is Boom 2.02 because use __djgpp_bearptr_enable and use a video mode that is a standard VGA. CDoom uses unchained VGA mode, with page flipping.

This is not a enhancement, but CDoom is a very objective engine, very small size, removed all allegro functions and other doom unused functions. I made my own sound library in External.c an the all external access functions.

NOTES:

If sound don´t work in WINNT, use VDMsound library and tell me if works, please. For building 3d floors, there is a special rule(maybe a bug) in CDoom v2.05. First add the lowest 3d floor(lynetypes 281,400 for solid 3d floors and 403 for liquid 3d floors), later the second lowest and so on, until the last be the highest, this is to avoid rendering the lowest plane above the highest and vice versa causing some rendering errors,and to avoid that the lightlevel be wrong. Future updates of this file may be possibles. Note that the features of this port are covered by other ports, but the diference is that CDoom is very faster than other except Boom 2.02. But take care, boom uses __djgpp_nearptr_enable, disprotect the memory, may cause data lost and cannot run in WINNT, linux DOSEMU.

Developing the video code I am trying a faster blitting. The current function to blast the screen writes 4 bytes at each time: void blast(*screens,_dos_ds,0xa0000+destscreen,4000);

.globl _blast _blast: pushl %ebp movl %esp,%ebp pushl %edi pushl %ebx movl 8(%ebp),%ebx movl 16(%ebp),%edi movl 20(%ebp),%ecx movl 12(%ebp),%edx pushl %ebx pushw %es movw %dx,%es movw $0x102,%ax cld .align 4 0: pushl %ebx pushl %edi pushl %eax pushl %ecx movw $0x3c4,%dx outw %ax,%dx 1: movl %ds:12(%ebx),%eax movb %ds:8(%ebx),%ah bswap %eax movb %ds:(%ebx),%al movb %ds:4(%ebx),%ah stosl addl $16,%ebx loop 1b popl %ecx popl %eax popl %edi popl %ebx incl %ebx shlb $1,%ah testb $0x10,%ah jz 0b popw %es popl %ebx leal -8(%ebp),%esp popl %ebx popl %edi leave ret

I want to write 8 bytes at each time, is this possible? Someone can explain me? Please, if you have assembly knowledge help me. I tried to write 8 bytes using "rep stosl", the code is:

.globl _blast _blast: pushl %ebp movl %esp,%ebp pushl %edi pushl %ebx movl 8(%ebp),%ebx movl 16(%ebp),%edi movl 20(%ebp),%ecx movl 12(%ebp),%edx pushl %ebx pushw %es movw %dx,%es movw $0x102,%ax cld .align 4 0: pushl %ebx pushl %edi pushl %eax pushl %ecx movw $0x3c4,%dx outw %ax,%dx 1: movl %ds:12(%ebx),%eax movb %ds:8(%ebx),%ah bswap %eax movb %ds:(%ebx),%al movb %ds:4(%ebx),%ah movl %ds:28(%ebx),%eax movb %ds:24(%ebx),%ah bswap %eax movb %ds:16(%ebx),%al movb %ds:20(%ebx),%ah rep; stosl addl $32,%ebx loop 1b popl %ecx popl %eax popl %edi popl %ebx incl %ebx shlb $1,%ah testb $0x20,%ah jz 0b popw %es popl %ebx leal -8(%ebp),%esp popl %ebx popl %edi leave ret

more or less this, I´m not sure this crash. Please your help is welcome.

Credits to: Jesus Christ

Autor: Carlos Guariglia Email: carlos@doom.zzn.com