Skip to content

Commit

Permalink
Support for The Catacomb Apocalypse is now in. Comments about the pre…
Browse files Browse the repository at this point in the history
…ceding commit for Armageddon apply here as well.
  • Loading branch information
NY00123 committed Dec 19, 2014
1 parent 3c02fd0 commit d9178d8
Show file tree
Hide file tree
Showing 172 changed files with 14,422 additions and 408 deletions.
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
.PHONY: clean
all:
$(MAKE) all -C src/kdreams
$(MAKE) all -C src/id91_11/cat3d
$(MAKE) all -C src/id91_11/catadventures/catabyss
$(MAKE) all -C src/id91_11/catadventures/catarm
$(MAKE) all -C src
clean:
$(MAKE) clean -C src/kdreams
$(MAKE) clean -C src/id91_11/cat3d
$(MAKE) clean -C src/id91_11/catadventures/catabyss
$(MAKE) clean -C src/id91_11/catadventures/catarm
$(MAKE) clean -C src
37 changes: 37 additions & 0 deletions catarm_savegame_compat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Nasty...

skycolor can be any of
- &debug_sky
- &scolor
- &sky_colors[0] (commented out in Arm/Apoc)
- &sky_colors[gamestate.mapon] for some map (commented out in Arm/Apoc)
- (See note about **** PlayLoop can increment the skycolor POINTER (until read value is 0xFFFF).
- Could also decrement but that's commented out...
- scolors, an input to InitBgChange. This is either sky_daytonight (commented out in Arm/Apoc) or sky_lightning.
- C5_WIZ.C:ReadScroll, &blackcolor (seems commented out)
- C5_WIZ.C:ReadScroll, skytemp (just old value of skycolor, and again commented out)

Similarly groundcolor can be any of
- &debug_gnd
- &gcolor
- &gnd_colors[0] (commented out in Arm/Apoc)
- &gnd_colors[gamestate.mapon] for some map (commented out in Arm/Apoc)
- **** PlayLoop can increment it like skycolor
- Also decrement, but again that's commented out
- gcolors, an input to InitBgChange. This is however NULL so InitBgChange never actually sets this.
- C5_WIZ.C:ReadScroll, &blackcolor (commented out)
- C5_WIZ.C:ReadScroll, gndtemp (original groundcolor pointer, commented out)

A FEW MORE NOTES THAT CAN BE USEFUL:
- Looks like InitBgChange is always called with gtimer==-1, so effectively
the groundcolor pointer is never incremented in PlayLoop.
- skycolor *can*, however, be incremented (for the lightning). This is done
by a call to InitBgChange with skytimer==1 and scolors==sky_daytonight.
- So in *theory*, skycolor should only increment as long as it goes over
sky_daytonight (or similarly sky_lightning in CatAbyss), until the value
of 0xFFFF is reached at the end of the sky colors array.

PROBLEM:
- It looks like if sky color is changed in Apoc using a cheat while in the
middle of a lightning, it CAN lead to a buffer overflow. This must depend on
the EXE layout.
7 changes: 7 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: clean
all:
$(MAKE) all -C kdreams
$(MAKE) all -C id91_11
clean:
$(MAKE) clean -C kdreams
$(MAKE) clean -C id91_11
2 changes: 2 additions & 0 deletions src/be_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ RefKeenConfig g_refKeenCfg;
#define REFKEEN_DREAMS_CONFIG_FILEPATH "refcatabyss.cfg"
#elif defined REFKEEN_VER_CATARM
#define REFKEEN_DREAMS_CONFIG_FILEPATH "refcatarm.cfg"
#elif defined REFKEEN_VER_CATAPOC
#define REFKEEN_DREAMS_CONFIG_FILEPATH "refcatapoc.cfg"
#else
#error "FATAL ERROR: No Ref port game macro is defined!"
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/be_sdl_graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ void BE_SDL_InitGfx(void)
const char *windowTitle = "Ref Catacomb Abyss";
#elif defined REFKEEN_VER_CATARM
const char *windowTitle = "Ref Catacomb Armageddon";
#elif defined REFKEEN_VER_CATAPOC
const char *windowTitle = "Ref Catacomb Apocalypse";
#else
#error "FATAL ERROR: No Ref port game macro is defined!"
#endif
Expand Down
5 changes: 5 additions & 0 deletions src/id91_11/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.PHONY: clean
all:
$(MAKE) all -C cat_all
clean:
$(MAKE) clean -C cat_all
11 changes: 11 additions & 0 deletions src/id91_11/cat_all/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: clean
all:
$(MAKE) all -C cat3d
$(MAKE) all -C catabyss
$(MAKE) all -C catarm
$(MAKE) all -C catapoc
clean:
$(MAKE) clean -C cat3d
$(MAKE) clean -C catabyss
$(MAKE) clean -C catarm
$(MAKE) clean -C catapoc
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ endif
STRIPBIN=$(BINPREFIX)strip
SDLCONFIG=sdl2-config
SRC=.
C3DCOMMONSRC=../cat3dcommon
IDSRC=..
BESRC=../..
C3DCOMMONSRC=..
IDSRC=../..
BESRC=../../..
OBJPREFIX=obj
OBJ=$(OBJPREFIX)/$(VERDIRNAME)
IDOBJ=$(OBJ)/id
Expand All @@ -34,7 +34,7 @@ OBJECTS=$(OBJ)/c3_act1.o \
$(OBJ)/c3_state.o \
$(OBJ)/c3_wiz.o

#Shared with Catacomb 3-D and the Adventures series
#Shared with Catacomb 3-D and The Adventures Series
OBJECTS+= $(OBJ)/c3_asm.o \
$(OBJ)/c3_scale.o \
$(OBJ)/c3_trace.o
Expand Down Expand Up @@ -70,7 +70,7 @@ ifeq ($(VERDIRNAME), cat3d100)
RSRC_OBJECTS+= $(RSRCOBJ)/introscn.o
endif

INTCXXFLAGS=-I$(SRC) -I$(VERSRC) -I$(IDSRC) -I$(BESRC) -DREFKEEN_VER_CAT3D=1
INTCXXFLAGS=-I$(SRC) -I$(C3DCOMMONSRC) -I$(VERSRC) -I$(IDSRC) -I$(BESRC) -DREFKEEN_VER_CAT3D=1

ifeq ($(VERDIRNAME), cat3d100)
INTCXXFLAGS+= -DREFKEEN_VER_CAT3D_100=1
Expand All @@ -82,11 +82,12 @@ endif

ifeq ($(DEBUG),1)
INTCXXFLAGS+= -ggdb -ftrapv -fstack-check -DREFKEEN_CONFIG_DEBUG
CXXOPT=
else
INTCXXFLAGS+= -O2
CXXOPT=-O2
endif

INTCXXFLAGS+= `$(SDLCONFIG) --cflags` -Wall -Wno-pointer-sign -Wno-unknown-pragmas -Wno-unused-variable -Wno-missing-braces -Wno-switch
INTCXXFLAGS+= $(CXXOPT) `$(SDLCONFIG) --cflags` -Wall -Wno-pointer-sign -Wno-unknown-pragmas -Wno-unused-variable -Wno-missing-braces -Wno-switch
#We need -lm for dbopl
INTLDFLAGS=`$(SDLCONFIG) --libs` -lm

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
*/

id0_short_t colordelay=0;
#ifdef REFKEEN_VER_CATARM
id0_boolean_t autofire=false;
#endif
id0_int_t maporgx;
id0_int_t maporgy;
enum {mapview,tilemapview,actoratview,visview,mapseg2,lastview} viewtype;
Expand Down Expand Up @@ -281,10 +283,14 @@ id0_int_t DebugKeys (void)
IN_Ack ();
}

#endif

#if (DEBUG_KEYS_AVAILABLE) || (defined REFKEEN_VER_CATAPOC)
if (Keyboard[sc_Q]) // Q = Insta-Quit!
Quit("Insta-Quit!");
#endif

#if (DEBUG_KEYS_AVAILABLE) && !(defined REFKEEN_VER_CATAPOC)
if (Keyboard[sc_Z]) // Z = freeze Time
{
if (FreezeTime)
Expand Down Expand Up @@ -527,7 +533,11 @@ id0_int_t DebugKeys (void)
{
CenterWindow(26,3);
PrintY+=6;
#ifdef REFKEEN_VER_CATARM
US_Print(" Warp to which level(0-16):");
#elif defined REFKEEN_VER_CATAPOC
US_Print(" Warp to which level(0-17):");
#endif
VW_UpdateScreen();
esc = !US_LineInput (px,py,str,NULL,true,2,0);
if (!esc)
Expand Down
Loading

0 comments on commit d9178d8

Please sign in to comment.