From 8f980fe24cb3144bf7bcb6dbcb4f29ef554fbaa3 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 16 Oct 2011 16:59:19 +0000 Subject: Zero out bottom two bits of palette data, to more accurately emulate the PC hardware that only supports 6 bits per channel (thanks GhostlyDeath). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2433 --- src/i_video.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/i_video.c b/src/i_video.c index 15e4a6b7..d671a228 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -956,11 +956,14 @@ void I_SetPalette (byte *doompalette) { int i; - for (i=0; i<256; ++i) + for (i=0; i<256; ++i) { - palette[i].r = gammatable[usegamma][*doompalette++]; - palette[i].g = gammatable[usegamma][*doompalette++]; - palette[i].b = gammatable[usegamma][*doompalette++]; + // Zero out the bottom two bits of each channel - the PC VGA + // controller only supports 6 bits of accuracy. + + palette[i].r = gammatable[usegamma][*doompalette++] & ~3; + palette[i].g = gammatable[usegamma][*doompalette++] & ~3; + palette[i].b = gammatable[usegamma][*doompalette++] & ~3; } palette_to_set = true; -- cgit v1.2.3 From 71d316afb2ae7191a4ef6fac2d757238ae3616e1 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 22 Oct 2011 18:24:08 +0000 Subject: Fix teleport behavior when emulating the alternate Final Doom executable. Change the default Final Doom emulation mode to be the original executable. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2457 --- src/d_main.c | 8 +++++--- src/p_telept.c | 17 ++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/d_main.c b/src/d_main.c index 613db3c1..1c757088 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -735,10 +735,12 @@ static void InitGameVersion(void) else { // Final Doom: tnt or plutonia - // Default to the "alt" version of the executable that - // fixes the demo loop behavior. + // Defaults to emulating the first Final Doom executable, + // which has the crash in the demo loop; however, having + // this as the default should mean that it plays back + // most demos correctly. - gameversion = exe_final2; + gameversion = exe_final; } } } diff --git a/src/p_telept.c b/src/p_telept.c index abd307c5..73c3e9b5 100644 --- a/src/p_telept.c +++ b/src/p_telept.c @@ -104,19 +104,18 @@ EV_Teleport if (!P_TeleportMove (thing, m->x, m->y)) return 0; - - // fraggle: this was changed in final doom, - // problem between normal doom2 1.9 and final doom - // - // Note that although chex.exe is based on Final Doom, - // it does not have this quirk. - if (gameversion < exe_final || gameversion == exe_chex) + // The first Final Doom executable does not set thing->z + // when teleporting. This quirk is unique to this + // particular version; the later version included in + // some versions of the Id Anthology fixed this. + + if (gameversion != exe_final) thing->z = thing->floorz; - + if (thing->player) thing->player->viewz = thing->z+thing->player->viewheight; - + // spawn teleport fog at source and destination fog = P_SpawnMobj (oldx, oldy, oldz, MT_TFOG); S_StartSound (fog, sfx_telept); -- cgit v1.2.3