From 57bf2c3dc4ab4f2aa1405531f5d9e6a22eaaece5 Mon Sep 17 00:00:00 2001 From: Jeff Harris Date: Fri, 22 Nov 2019 09:25:44 -0800 Subject: [PATCH] compile DETHRACE and BRSRC13 separately. (#13) * compile DETHRACE and BRSRC13 separately. Fixed some types wronly generated into dr_types.h * Fix makefile ordering * make gcc happy --- Makefile | 34 +- src/BRSRC13/CORE/DOSIO/eventq.h | 1 - src/BRSRC13/CORE/DOSIO/readmse.h | 1 - src/BRSRC13/CORE/FW/assocarr.h | 1 - src/BRSRC13/CORE/FW/brbegin.h | 1 - src/BRSRC13/CORE/FW/brbhook.h | 1 - src/BRSRC13/CORE/FW/brlists.h | 1 - src/BRSRC13/CORE/FW/brprintf.c | 2 + src/BRSRC13/CORE/FW/brprintf.h | 3 +- src/BRSRC13/CORE/FW/brqsort.h | 1 - src/BRSRC13/CORE/FW/bswap.h | 1 - src/BRSRC13/CORE/FW/datafile.h | 1 - src/BRSRC13/CORE/FW/devlist.h | 1 - src/BRSRC13/CORE/FW/devsetup.c | 2 + src/BRSRC13/CORE/FW/devsetup.h | 1 - src/BRSRC13/CORE/FW/diag.c | 2 +- src/BRSRC13/CORE/FW/diag.h | 1 - src/BRSRC13/CORE/FW/error.h | 1 - src/BRSRC13/CORE/FW/file.c | 2 + src/BRSRC13/CORE/FW/file.h | 1 - src/BRSRC13/CORE/FW/fwsetup.h | 1 - src/BRSRC13/CORE/FW/genfile.h | 1 - src/BRSRC13/CORE/FW/image.h | 1 - src/BRSRC13/CORE/FW/lexer.h | 1 - src/BRSRC13/CORE/FW/loader.h | 1 - src/BRSRC13/CORE/FW/mem.h | 1 - src/BRSRC13/CORE/FW/object.h | 1 - src/BRSRC13/CORE/FW/objectc.h | 1 - src/BRSRC13/CORE/FW/pattern.h | 1 - src/BRSRC13/CORE/FW/register.h | 1 - src/BRSRC13/CORE/FW/resource.h | 1 - src/BRSRC13/CORE/FW/resreg.h | 2 +- src/BRSRC13/CORE/FW/scratch.h | 1 - src/BRSRC13/CORE/FW/sys_conf.h | 1 - src/BRSRC13/CORE/FW/token.h | 1 - src/BRSRC13/CORE/FW/tokenval.h | 1 - src/BRSRC13/CORE/HOST/himage.h | 1 - src/BRSRC13/CORE/HOST/hook.h | 1 - src/BRSRC13/CORE/HOST/hostcfg.h | 1 - src/BRSRC13/CORE/HOST/hstsetup.h | 1 - src/BRSRC13/CORE/HOST/memmgmt.c | 6 +- src/BRSRC13/CORE/HOST/memmgmt.h | 1 - src/BRSRC13/CORE/MATH/angles.h | 1 - src/BRSRC13/CORE/MATH/matrix23.h | 1 - src/BRSRC13/CORE/MATH/matrix34.h | 1 - src/BRSRC13/CORE/MATH/matrix4.h | 1 - src/BRSRC13/CORE/MATH/plane.h | 1 - src/BRSRC13/CORE/MATH/quat.h | 1 - src/BRSRC13/CORE/MATH/transfrm.h | 1 - src/BRSRC13/CORE/MATH/vector.h | 1 - src/BRSRC13/CORE/PIXELMAP/fontptrs.h | 1 - src/BRSRC13/CORE/PIXELMAP/genclip.h | 1 - src/BRSRC13/CORE/PIXELMAP/gencopy.h | 1 - src/BRSRC13/CORE/PIXELMAP/pixelmap.h | 1 - src/BRSRC13/CORE/PIXELMAP/pmdsptch.c | 2 + src/BRSRC13/CORE/PIXELMAP/pmdsptch.h | 1 - src/BRSRC13/CORE/PIXELMAP/pmfile.h | 1 - src/BRSRC13/CORE/PIXELMAP/pmgen.h | 1 - src/BRSRC13/CORE/PIXELMAP/pmmem.h | 1 - src/BRSRC13/CORE/PIXELMAP/pmnull.h | 1 - src/BRSRC13/CORE/PIXELMAP/pmsetup.h | 1 - src/BRSRC13/CORE/STD/brexcept.h | 1 - src/BRSRC13/CORE/STD/brmath.h | 1 - src/BRSRC13/CORE/STD/brstddiag.h | 1 - src/BRSRC13/CORE/STD/brstdfile.h | 1 - src/BRSRC13/CORE/STD/brstdlib.c | 10 +- src/BRSRC13/CORE/STD/brstdlib.h | 12 +- src/BRSRC13/CORE/STD/brstdmem.h | 1 - src/BRSRC13/CORE/STD/logwrite.h | 1 - src/BRSRC13/CORE/V1DB/actsupt.h | 1 - src/BRSRC13/CORE/V1DB/custsupt.h | 1 - src/BRSRC13/CORE/V1DB/dbsetup.h | 1 - src/BRSRC13/CORE/V1DB/def_mat.h | 1 - src/BRSRC13/CORE/V1DB/def_mdl.h | 1 - src/BRSRC13/CORE/V1DB/def_otab.h | 1 - src/BRSRC13/CORE/V1DB/enables.h | 1 - src/BRSRC13/CORE/V1DB/matsupt.h | 1 - src/BRSRC13/CORE/V1DB/modrend.h | 1 - src/BRSRC13/CORE/V1DB/modsupt.h | 1 - src/BRSRC13/CORE/V1DB/otable.h | 1 - src/BRSRC13/CORE/V1DB/prepmap.h | 1 - src/BRSRC13/CORE/V1DB/prepmatl.h | 1 - src/BRSRC13/CORE/V1DB/prepmesh.h | 1 - src/BRSRC13/CORE/V1DB/preptab.h | 1 - src/BRSRC13/CORE/V1DB/regsupt.h | 1 - src/BRSRC13/CORE/V1DB/render.h | 1 - src/BRSRC13/CORE/V1DB/v1dbfile.c | 2 + src/BRSRC13/CORE/V1DB/v1dbfile.h | 1 - src/BRSRC13/Makefile | 29 ++ src/{types => BRSRC13}/br_types.h | 374 ++++++++++++++++++- src/DETHRACE/Makefile | 40 +++ src/DETHRACE/{source => }/common/brucetrk.c | 4 + src/DETHRACE/{source => }/common/brucetrk.h | 0 src/DETHRACE/{source => }/common/car.c | 0 src/DETHRACE/{source => }/common/car.h | 0 src/DETHRACE/{source => }/common/controls.c | 1 - src/DETHRACE/{source => }/common/controls.h | 0 src/DETHRACE/{source => }/common/crush.c | 0 src/DETHRACE/{source => }/common/crush.h | 0 src/DETHRACE/{source => }/common/cutscene.c | 0 src/DETHRACE/{source => }/common/cutscene.h | 0 src/DETHRACE/{source => }/common/demo.c | 0 src/DETHRACE/{source => }/common/demo.h | 0 src/DETHRACE/{source => }/common/depth.c | 0 src/DETHRACE/{source => }/common/depth.h | 0 src/DETHRACE/{source => }/common/displays.c | 0 src/DETHRACE/{source => }/common/displays.h | 0 src/DETHRACE/{source => }/common/drfile.c | 0 src/DETHRACE/{source => }/common/drfile.h | 0 src/DETHRACE/{source => }/common/drmem.c | 0 src/DETHRACE/{source => }/common/drmem.h | 0 src/DETHRACE/{source => }/common/errors.c | 5 +- src/DETHRACE/{source => }/common/errors.h | 0 src/DETHRACE/{source => }/common/finteray.c | 0 src/DETHRACE/{source => }/common/finteray.h | 0 src/DETHRACE/{source => }/common/flicplay.c | 0 src/DETHRACE/{source => }/common/flicplay.h | 0 src/DETHRACE/{source => }/common/globvars.c | 0 src/DETHRACE/{source => }/common/globvars.h | 0 src/DETHRACE/{source => }/common/globvrbm.c | 0 src/DETHRACE/{source => }/common/globvrbm.h | 0 src/DETHRACE/{source => }/common/globvrkm.c | 0 src/DETHRACE/{source => }/common/globvrkm.h | 0 src/DETHRACE/{source => }/common/globvrme.c | 0 src/DETHRACE/{source => }/common/globvrme.h | 0 src/DETHRACE/{source => }/common/globvrpb.c | 0 src/DETHRACE/{source => }/common/globvrpb.h | 0 src/DETHRACE/{source => }/common/grafdata.c | 0 src/DETHRACE/{source => }/common/grafdata.h | 0 src/DETHRACE/{source => }/common/graphics.c | 0 src/DETHRACE/{source => }/common/graphics.h | 0 src/DETHRACE/{source => }/common/init.c | 0 src/DETHRACE/{source => }/common/init.h | 0 src/DETHRACE/{source => }/common/input.c | 1 - src/DETHRACE/{source => }/common/input.h | 0 src/DETHRACE/{source => }/common/intrface.c | 0 src/DETHRACE/{source => }/common/intrface.h | 0 src/DETHRACE/{source => }/common/loading.c | 2 +- src/DETHRACE/{source => }/common/loading.h | 2 + src/DETHRACE/{source => }/common/loadsave.c | 0 src/DETHRACE/{source => }/common/loadsave.h | 0 src/DETHRACE/{source => }/common/main.c | 0 src/DETHRACE/{source => }/common/main.h | 0 src/DETHRACE/{source => }/common/mainloop.c | 0 src/DETHRACE/{source => }/common/mainloop.h | 0 src/DETHRACE/{source => }/common/mainmenu.c | 0 src/DETHRACE/{source => }/common/mainmenu.h | 0 src/DETHRACE/{source => }/common/netgame.c | 0 src/DETHRACE/{source => }/common/netgame.h | 0 src/DETHRACE/{source => }/common/network.c | 0 src/DETHRACE/{source => }/common/network.h | 0 src/DETHRACE/{source => }/common/newgame.c | 0 src/DETHRACE/{source => }/common/newgame.h | 0 src/DETHRACE/{source => }/common/oil.c | 0 src/DETHRACE/{source => }/common/oil.h | 0 src/DETHRACE/{source => }/common/oppocar.c | 0 src/DETHRACE/{source => }/common/oppocar.h | 0 src/DETHRACE/{source => }/common/opponent.c | 0 src/DETHRACE/{source => }/common/opponent.h | 0 src/DETHRACE/{source => }/common/oppoproc.c | 0 src/DETHRACE/{source => }/common/oppoproc.h | 0 src/DETHRACE/{source => }/common/options.c | 0 src/DETHRACE/{source => }/common/options.h | 0 src/DETHRACE/{source => }/common/pedestrn.c | 0 src/DETHRACE/{source => }/common/pedestrn.h | 0 src/DETHRACE/{source => }/common/piping.c | 0 src/DETHRACE/{source => }/common/piping.h | 0 src/DETHRACE/{source => }/common/powerup.c | 0 src/DETHRACE/{source => }/common/powerup.h | 0 src/DETHRACE/{source => }/common/pratcam.c | 0 src/DETHRACE/{source => }/common/pratcam.h | 0 src/DETHRACE/{source => }/common/racestrt.c | 0 src/DETHRACE/{source => }/common/racestrt.h | 0 src/DETHRACE/{source => }/common/racesumm.c | 0 src/DETHRACE/{source => }/common/racesumm.h | 0 src/DETHRACE/{source => }/common/raycast.c | 0 src/DETHRACE/{source => }/common/raycast.h | 0 src/DETHRACE/{source => }/common/replay.c | 0 src/DETHRACE/{source => }/common/replay.h | 0 src/DETHRACE/{source => }/common/skidmark.c | 0 src/DETHRACE/{source => }/common/skidmark.h | 0 src/DETHRACE/{source => }/common/sound.c | 0 src/DETHRACE/{source => }/common/sound.h | 0 src/DETHRACE/{source => }/common/spark.c | 0 src/DETHRACE/{source => }/common/spark.h | 0 src/DETHRACE/{source => }/common/structur.c | 0 src/DETHRACE/{source => }/common/structur.h | 0 src/DETHRACE/{source => }/common/trig.c | 0 src/DETHRACE/{source => }/common/trig.h | 0 src/DETHRACE/{source => }/common/utility.c | 9 +- src/DETHRACE/{source => }/common/utility.h | 0 src/DETHRACE/{source => }/common/world.c | 0 src/DETHRACE/{source => }/common/world.h | 0 src/{types => DETHRACE}/dr_types.h | 376 +------------------- src/DETHRACE/{source => }/pc-dos/dosnet.c | 0 src/DETHRACE/{source => }/pc-dos/dosnet.h | 0 src/DETHRACE/{source => }/pc-dos/dossys.c | 5 +- src/DETHRACE/{source => }/pc-dos/dossys.h | 7 +- 198 files changed, 512 insertions(+), 498 deletions(-) create mode 100644 src/BRSRC13/Makefile rename src/{types => BRSRC13}/br_types.h (90%) create mode 100644 src/DETHRACE/Makefile rename src/DETHRACE/{source => }/common/brucetrk.c (97%) rename src/DETHRACE/{source => }/common/brucetrk.h (100%) rename src/DETHRACE/{source => }/common/car.c (100%) rename src/DETHRACE/{source => }/common/car.h (100%) rename src/DETHRACE/{source => }/common/controls.c (99%) rename src/DETHRACE/{source => }/common/controls.h (100%) rename src/DETHRACE/{source => }/common/crush.c (100%) rename src/DETHRACE/{source => }/common/crush.h (100%) rename src/DETHRACE/{source => }/common/cutscene.c (100%) rename src/DETHRACE/{source => }/common/cutscene.h (100%) rename src/DETHRACE/{source => }/common/demo.c (100%) rename src/DETHRACE/{source => }/common/demo.h (100%) rename src/DETHRACE/{source => }/common/depth.c (100%) rename src/DETHRACE/{source => }/common/depth.h (100%) rename src/DETHRACE/{source => }/common/displays.c (100%) rename src/DETHRACE/{source => }/common/displays.h (100%) rename src/DETHRACE/{source => }/common/drfile.c (100%) rename src/DETHRACE/{source => }/common/drfile.h (100%) rename src/DETHRACE/{source => }/common/drmem.c (100%) rename src/DETHRACE/{source => }/common/drmem.h (100%) rename src/DETHRACE/{source => }/common/errors.c (93%) rename src/DETHRACE/{source => }/common/errors.h (100%) rename src/DETHRACE/{source => }/common/finteray.c (100%) rename src/DETHRACE/{source => }/common/finteray.h (100%) rename src/DETHRACE/{source => }/common/flicplay.c (100%) rename src/DETHRACE/{source => }/common/flicplay.h (100%) rename src/DETHRACE/{source => }/common/globvars.c (100%) rename src/DETHRACE/{source => }/common/globvars.h (100%) rename src/DETHRACE/{source => }/common/globvrbm.c (100%) rename src/DETHRACE/{source => }/common/globvrbm.h (100%) rename src/DETHRACE/{source => }/common/globvrkm.c (100%) rename src/DETHRACE/{source => }/common/globvrkm.h (100%) rename src/DETHRACE/{source => }/common/globvrme.c (100%) rename src/DETHRACE/{source => }/common/globvrme.h (100%) rename src/DETHRACE/{source => }/common/globvrpb.c (100%) rename src/DETHRACE/{source => }/common/globvrpb.h (100%) rename src/DETHRACE/{source => }/common/grafdata.c (100%) rename src/DETHRACE/{source => }/common/grafdata.h (100%) rename src/DETHRACE/{source => }/common/graphics.c (100%) rename src/DETHRACE/{source => }/common/graphics.h (100%) rename src/DETHRACE/{source => }/common/init.c (100%) rename src/DETHRACE/{source => }/common/init.h (100%) rename src/DETHRACE/{source => }/common/input.c (99%) rename src/DETHRACE/{source => }/common/input.h (100%) rename src/DETHRACE/{source => }/common/intrface.c (100%) rename src/DETHRACE/{source => }/common/intrface.h (100%) rename src/DETHRACE/{source => }/common/loading.c (99%) rename src/DETHRACE/{source => }/common/loading.h (99%) rename src/DETHRACE/{source => }/common/loadsave.c (100%) rename src/DETHRACE/{source => }/common/loadsave.h (100%) rename src/DETHRACE/{source => }/common/main.c (100%) rename src/DETHRACE/{source => }/common/main.h (100%) rename src/DETHRACE/{source => }/common/mainloop.c (100%) rename src/DETHRACE/{source => }/common/mainloop.h (100%) rename src/DETHRACE/{source => }/common/mainmenu.c (100%) rename src/DETHRACE/{source => }/common/mainmenu.h (100%) rename src/DETHRACE/{source => }/common/netgame.c (100%) rename src/DETHRACE/{source => }/common/netgame.h (100%) rename src/DETHRACE/{source => }/common/network.c (100%) rename src/DETHRACE/{source => }/common/network.h (100%) rename src/DETHRACE/{source => }/common/newgame.c (100%) rename src/DETHRACE/{source => }/common/newgame.h (100%) rename src/DETHRACE/{source => }/common/oil.c (100%) rename src/DETHRACE/{source => }/common/oil.h (100%) rename src/DETHRACE/{source => }/common/oppocar.c (100%) rename src/DETHRACE/{source => }/common/oppocar.h (100%) rename src/DETHRACE/{source => }/common/opponent.c (100%) rename src/DETHRACE/{source => }/common/opponent.h (100%) rename src/DETHRACE/{source => }/common/oppoproc.c (100%) rename src/DETHRACE/{source => }/common/oppoproc.h (100%) rename src/DETHRACE/{source => }/common/options.c (100%) rename src/DETHRACE/{source => }/common/options.h (100%) rename src/DETHRACE/{source => }/common/pedestrn.c (100%) rename src/DETHRACE/{source => }/common/pedestrn.h (100%) rename src/DETHRACE/{source => }/common/piping.c (100%) rename src/DETHRACE/{source => }/common/piping.h (100%) rename src/DETHRACE/{source => }/common/powerup.c (100%) rename src/DETHRACE/{source => }/common/powerup.h (100%) rename src/DETHRACE/{source => }/common/pratcam.c (100%) rename src/DETHRACE/{source => }/common/pratcam.h (100%) rename src/DETHRACE/{source => }/common/racestrt.c (100%) rename src/DETHRACE/{source => }/common/racestrt.h (100%) rename src/DETHRACE/{source => }/common/racesumm.c (100%) rename src/DETHRACE/{source => }/common/racesumm.h (100%) rename src/DETHRACE/{source => }/common/raycast.c (100%) rename src/DETHRACE/{source => }/common/raycast.h (100%) rename src/DETHRACE/{source => }/common/replay.c (100%) rename src/DETHRACE/{source => }/common/replay.h (100%) rename src/DETHRACE/{source => }/common/skidmark.c (100%) rename src/DETHRACE/{source => }/common/skidmark.h (100%) rename src/DETHRACE/{source => }/common/sound.c (100%) rename src/DETHRACE/{source => }/common/sound.h (100%) rename src/DETHRACE/{source => }/common/spark.c (100%) rename src/DETHRACE/{source => }/common/spark.h (100%) rename src/DETHRACE/{source => }/common/structur.c (100%) rename src/DETHRACE/{source => }/common/structur.h (100%) rename src/DETHRACE/{source => }/common/trig.c (100%) rename src/DETHRACE/{source => }/common/trig.h (100%) rename src/DETHRACE/{source => }/common/utility.c (99%) rename src/DETHRACE/{source => }/common/utility.h (100%) rename src/DETHRACE/{source => }/common/world.c (100%) rename src/DETHRACE/{source => }/common/world.h (100%) rename src/{types => DETHRACE}/dr_types.h (92%) rename src/DETHRACE/{source => }/pc-dos/dosnet.c (100%) rename src/DETHRACE/{source => }/pc-dos/dosnet.h (100%) rename src/DETHRACE/{source => }/pc-dos/dossys.c (98%) rename src/DETHRACE/{source => }/pc-dos/dossys.h (98%) diff --git a/Makefile b/Makefile index 802033dc..8e4cb149 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,12 @@ -TARGET_EXEC ?= a.out +.PHONY: clean build test run -BUILD_DIR ?= ./build -SRC_DIRS ?= ./src - -SRCS := $(shell find $(SRC_DIRS) -name *.c) -OBJS := $(SRCS:%=$(BUILD_DIR)/%.o) -DEPS := $(OBJS:.o=.d) - -INC_DIRS := $(shell find $(SRC_DIRS) -type d) -INC_FLAGS := $(addprefix -I,$(INC_DIRS)) - -CFLAGS ?= $(INC_FLAGS) -Wno-return-type -Wno-missing-declarations -Werror=implicit-function-declaration - -$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS) - $(CC) $(OBJS) -o $@ $(LDFLAGS) - -# c source -$(BUILD_DIR)/%.c.o: %.c - @$(MKDIR_P) $(dir $@) - @$(CC) $(CFLAGS) -c $< -o $@ - -.PHONY: clean +build: + $(MAKE) -C src/BRSRC13 build + $(MAKE) -C src/DETHRACE build clean: - $(RM) -r $(BUILD_DIR) + $(MAKE) -C src/BRSRC13 clean + $(MAKE) -C src/DETHRACE clean --include $(DEPS) - -MKDIR_P ?= mkdir -p +run: build + $(src/DETHRACE/build/c1) diff --git a/src/BRSRC13/CORE/DOSIO/eventq.h b/src/BRSRC13/CORE/DOSIO/eventq.h index a53e4ed2..04ffda29 100644 --- a/src/BRSRC13/CORE/DOSIO/eventq.h +++ b/src/BRSRC13/CORE/DOSIO/eventq.h @@ -1,7 +1,6 @@ #ifndef _EVENTQ_H_ #define _EVENTQ_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 14 diff --git a/src/BRSRC13/CORE/DOSIO/readmse.h b/src/BRSRC13/CORE/DOSIO/readmse.h index 394418f6..ad86f5a2 100644 --- a/src/BRSRC13/CORE/DOSIO/readmse.h +++ b/src/BRSRC13/CORE/DOSIO/readmse.h @@ -1,7 +1,6 @@ #ifndef _READMSE_H_ #define _READMSE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 14 diff --git a/src/BRSRC13/CORE/FW/assocarr.h b/src/BRSRC13/CORE/FW/assocarr.h index 1099adb0..dcbce12f 100644 --- a/src/BRSRC13/CORE/FW/assocarr.h +++ b/src/BRSRC13/CORE/FW/assocarr.h @@ -1,7 +1,6 @@ #ifndef _ASSOCARR_H_ #define _ASSOCARR_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 27 diff --git a/src/BRSRC13/CORE/FW/brbegin.h b/src/BRSRC13/CORE/FW/brbegin.h index 76caf94c..b154eaaa 100644 --- a/src/BRSRC13/CORE/FW/brbegin.h +++ b/src/BRSRC13/CORE/FW/brbegin.h @@ -1,7 +1,6 @@ #ifndef _BRBEGIN_H_ #define _BRBEGIN_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 8 diff --git a/src/BRSRC13/CORE/FW/brbhook.h b/src/BRSRC13/CORE/FW/brbhook.h index 83ed78fa..67b9683d 100644 --- a/src/BRSRC13/CORE/FW/brbhook.h +++ b/src/BRSRC13/CORE/FW/brbhook.h @@ -1,7 +1,6 @@ #ifndef _BRBHOOK_H_ #define _BRBHOOK_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 13 diff --git a/src/BRSRC13/CORE/FW/brlists.h b/src/BRSRC13/CORE/FW/brlists.h index cd879988..b189c88f 100644 --- a/src/BRSRC13/CORE/FW/brlists.h +++ b/src/BRSRC13/CORE/FW/brlists.h @@ -1,7 +1,6 @@ #ifndef _BRLISTS_H_ #define _BRLISTS_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 10 diff --git a/src/BRSRC13/CORE/FW/brprintf.c b/src/BRSRC13/CORE/FW/brprintf.c index cbbbb11b..e7ab470e 100644 --- a/src/BRSRC13/CORE/FW/brprintf.c +++ b/src/BRSRC13/CORE/FW/brprintf.c @@ -2,6 +2,8 @@ char rscid[48]; +#include + // Offset: 10 // Size: 75 br_int_32 BrSprintf(char *buf, char *fmt, ...) { diff --git a/src/BRSRC13/CORE/FW/brprintf.h b/src/BRSRC13/CORE/FW/brprintf.h index 760c644f..a98f1b4c 100644 --- a/src/BRSRC13/CORE/FW/brprintf.h +++ b/src/BRSRC13/CORE/FW/brprintf.h @@ -1,9 +1,10 @@ #ifndef _BRPRINTF_H_ #define _BRPRINTF_H_ -#include "dr_types.h" #include "br_types.h" +#include + // Offset: 10 // Size: 75 br_int_32 BrSprintf(char *buf, char *fmt, ...); diff --git a/src/BRSRC13/CORE/FW/brqsort.h b/src/BRSRC13/CORE/FW/brqsort.h index df4a32c3..ce5c9fd7 100644 --- a/src/BRSRC13/CORE/FW/brqsort.h +++ b/src/BRSRC13/CORE/FW/brqsort.h @@ -1,7 +1,6 @@ #ifndef _BRQSORT_H_ #define _BRQSORT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 8 diff --git a/src/BRSRC13/CORE/FW/bswap.h b/src/BRSRC13/CORE/FW/bswap.h index c431e408..40057b33 100644 --- a/src/BRSRC13/CORE/FW/bswap.h +++ b/src/BRSRC13/CORE/FW/bswap.h @@ -1,7 +1,6 @@ #ifndef _BSWAP_H_ #define _BSWAP_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 9 diff --git a/src/BRSRC13/CORE/FW/datafile.h b/src/BRSRC13/CORE/FW/datafile.h index 560465f7..07fad272 100644 --- a/src/BRSRC13/CORE/FW/datafile.h +++ b/src/BRSRC13/CORE/FW/datafile.h @@ -1,7 +1,6 @@ #ifndef _DATAFILE_H_ #define _DATAFILE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 7 diff --git a/src/BRSRC13/CORE/FW/devlist.h b/src/BRSRC13/CORE/FW/devlist.h index 15d5bfaa..cce905f9 100644 --- a/src/BRSRC13/CORE/FW/devlist.h +++ b/src/BRSRC13/CORE/FW/devlist.h @@ -1,7 +1,6 @@ #ifndef _DEVLIST_H_ #define _DEVLIST_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 20 diff --git a/src/BRSRC13/CORE/FW/devsetup.c b/src/BRSRC13/CORE/FW/devsetup.c index 8878e68e..a46763b2 100644 --- a/src/BRSRC13/CORE/FW/devsetup.c +++ b/src/BRSRC13/CORE/FW/devsetup.c @@ -1,5 +1,7 @@ #include "devsetup.h" +#include + br_pixelmap *last_begin_screen; char rscid[51]; diff --git a/src/BRSRC13/CORE/FW/devsetup.h b/src/BRSRC13/CORE/FW/devsetup.h index a66e7cd1..ec7a496e 100644 --- a/src/BRSRC13/CORE/FW/devsetup.h +++ b/src/BRSRC13/CORE/FW/devsetup.h @@ -1,7 +1,6 @@ #ifndef _DEVSETUP_H_ #define _DEVSETUP_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 20 diff --git a/src/BRSRC13/CORE/FW/diag.c b/src/BRSRC13/CORE/FW/diag.c index 15bdd31f..35e8a683 100644 --- a/src/BRSRC13/CORE/FW/diag.c +++ b/src/BRSRC13/CORE/FW/diag.c @@ -1,7 +1,7 @@ #include "diag.h" #include "fwsetup.h" #include "brprintf.h" -#include "brstdlib.h" +#include "CORE/STD/brstdlib.h" #include // Global variables diff --git a/src/BRSRC13/CORE/FW/diag.h b/src/BRSRC13/CORE/FW/diag.h index 0c32b60f..ac7484a5 100644 --- a/src/BRSRC13/CORE/FW/diag.h +++ b/src/BRSRC13/CORE/FW/diag.h @@ -1,7 +1,6 @@ #ifndef _DIAG_H_ #define _DIAG_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 10 // Size: 118 diff --git a/src/BRSRC13/CORE/FW/error.h b/src/BRSRC13/CORE/FW/error.h index dc97706a..c9ba782c 100644 --- a/src/BRSRC13/CORE/FW/error.h +++ b/src/BRSRC13/CORE/FW/error.h @@ -1,7 +1,6 @@ #ifndef _ERROR_H_ #define _ERROR_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 15 diff --git a/src/BRSRC13/CORE/FW/file.c b/src/BRSRC13/CORE/FW/file.c index 9bbd9634..81ae8c60 100644 --- a/src/BRSRC13/CORE/FW/file.c +++ b/src/BRSRC13/CORE/FW/file.c @@ -1,5 +1,7 @@ #include "file.h" +#include + char rscid[49]; // Offset: 12 diff --git a/src/BRSRC13/CORE/FW/file.h b/src/BRSRC13/CORE/FW/file.h index a88f75f0..00b1da1d 100644 --- a/src/BRSRC13/CORE/FW/file.h +++ b/src/BRSRC13/CORE/FW/file.h @@ -1,7 +1,6 @@ #ifndef _FILE_H_ #define _FILE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 12 diff --git a/src/BRSRC13/CORE/FW/fwsetup.h b/src/BRSRC13/CORE/FW/fwsetup.h index 886354fa..6fc07919 100644 --- a/src/BRSRC13/CORE/FW/fwsetup.h +++ b/src/BRSRC13/CORE/FW/fwsetup.h @@ -1,7 +1,6 @@ #ifndef _FWSETUP_H_ #define _FWSETUP_H_ -#include "dr_types.h" #include "br_types.h" extern br_framework_state fw; diff --git a/src/BRSRC13/CORE/FW/genfile.h b/src/BRSRC13/CORE/FW/genfile.h index 35c8bae5..bb02f198 100644 --- a/src/BRSRC13/CORE/FW/genfile.h +++ b/src/BRSRC13/CORE/FW/genfile.h @@ -1,7 +1,6 @@ #ifndef _GENFILE_H_ #define _GENFILE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 12 diff --git a/src/BRSRC13/CORE/FW/image.h b/src/BRSRC13/CORE/FW/image.h index fee11ae1..fa919fcb 100644 --- a/src/BRSRC13/CORE/FW/image.h +++ b/src/BRSRC13/CORE/FW/image.h @@ -1,7 +1,6 @@ #ifndef _IMAGE_H_ #define _IMAGE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 11 diff --git a/src/BRSRC13/CORE/FW/lexer.h b/src/BRSRC13/CORE/FW/lexer.h index fafcd879..8ba60744 100644 --- a/src/BRSRC13/CORE/FW/lexer.h +++ b/src/BRSRC13/CORE/FW/lexer.h @@ -1,7 +1,6 @@ #ifndef _LEXER_H_ #define _LEXER_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 11 diff --git a/src/BRSRC13/CORE/FW/loader.h b/src/BRSRC13/CORE/FW/loader.h index b8301362..16ae8aa7 100644 --- a/src/BRSRC13/CORE/FW/loader.h +++ b/src/BRSRC13/CORE/FW/loader.h @@ -1,7 +1,6 @@ #ifndef _LOADER_H_ #define _LOADER_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 10 diff --git a/src/BRSRC13/CORE/FW/mem.h b/src/BRSRC13/CORE/FW/mem.h index ea3f7363..12cec397 100644 --- a/src/BRSRC13/CORE/FW/mem.h +++ b/src/BRSRC13/CORE/FW/mem.h @@ -1,7 +1,6 @@ #ifndef _MEM_H_ #define _MEM_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 14 diff --git a/src/BRSRC13/CORE/FW/object.h b/src/BRSRC13/CORE/FW/object.h index d61b2453..91e04472 100644 --- a/src/BRSRC13/CORE/FW/object.h +++ b/src/BRSRC13/CORE/FW/object.h @@ -1,7 +1,6 @@ #ifndef _OBJECT_H_ #define _OBJECT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 19 diff --git a/src/BRSRC13/CORE/FW/objectc.h b/src/BRSRC13/CORE/FW/objectc.h index c9b367d6..895d0911 100644 --- a/src/BRSRC13/CORE/FW/objectc.h +++ b/src/BRSRC13/CORE/FW/objectc.h @@ -1,7 +1,6 @@ #ifndef _OBJECTC_H_ #define _OBJECTC_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 21 diff --git a/src/BRSRC13/CORE/FW/pattern.h b/src/BRSRC13/CORE/FW/pattern.h index 7a9ccf5b..270109d1 100644 --- a/src/BRSRC13/CORE/FW/pattern.h +++ b/src/BRSRC13/CORE/FW/pattern.h @@ -1,7 +1,6 @@ #ifndef _PATTERN_H_ #define _PATTERN_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 19 diff --git a/src/BRSRC13/CORE/FW/register.h b/src/BRSRC13/CORE/FW/register.h index 5be98098..21ae2cf7 100644 --- a/src/BRSRC13/CORE/FW/register.h +++ b/src/BRSRC13/CORE/FW/register.h @@ -1,7 +1,6 @@ #ifndef _REGISTER_H_ #define _REGISTER_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 14 diff --git a/src/BRSRC13/CORE/FW/resource.h b/src/BRSRC13/CORE/FW/resource.h index eb85be80..d4e01dc3 100644 --- a/src/BRSRC13/CORE/FW/resource.h +++ b/src/BRSRC13/CORE/FW/resource.h @@ -1,7 +1,6 @@ #ifndef _RESOURCE_H_ #define _RESOURCE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 10 diff --git a/src/BRSRC13/CORE/FW/resreg.h b/src/BRSRC13/CORE/FW/resreg.h index 4730d6fe..e0b527a7 100644 --- a/src/BRSRC13/CORE/FW/resreg.h +++ b/src/BRSRC13/CORE/FW/resreg.h @@ -1,7 +1,7 @@ #ifndef _RESREG_H_ #define _RESREG_H_ -#include "dr_types.h" + #include "br_types.h" // Offset: 14 diff --git a/src/BRSRC13/CORE/FW/scratch.h b/src/BRSRC13/CORE/FW/scratch.h index 1b981848..8f86732d 100644 --- a/src/BRSRC13/CORE/FW/scratch.h +++ b/src/BRSRC13/CORE/FW/scratch.h @@ -1,7 +1,6 @@ #ifndef _SCRATCH_H_ #define _SCRATCH_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 18 diff --git a/src/BRSRC13/CORE/FW/sys_conf.h b/src/BRSRC13/CORE/FW/sys_conf.h index 4e29899e..9c41a437 100644 --- a/src/BRSRC13/CORE/FW/sys_conf.h +++ b/src/BRSRC13/CORE/FW/sys_conf.h @@ -1,7 +1,6 @@ #ifndef _SYS_CONF_H_ #define _SYS_CONF_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 26 diff --git a/src/BRSRC13/CORE/FW/token.h b/src/BRSRC13/CORE/FW/token.h index a1002c7c..7c582eaf 100644 --- a/src/BRSRC13/CORE/FW/token.h +++ b/src/BRSRC13/CORE/FW/token.h @@ -1,7 +1,6 @@ #ifndef _TOKEN_H_ #define _TOKEN_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 13 diff --git a/src/BRSRC13/CORE/FW/tokenval.h b/src/BRSRC13/CORE/FW/tokenval.h index 7bf6dc25..2ce768e5 100644 --- a/src/BRSRC13/CORE/FW/tokenval.h +++ b/src/BRSRC13/CORE/FW/tokenval.h @@ -1,7 +1,6 @@ #ifndef _TOKENVAL_H_ #define _TOKENVAL_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 21 diff --git a/src/BRSRC13/CORE/HOST/himage.h b/src/BRSRC13/CORE/HOST/himage.h index 71d15ad7..163639aa 100644 --- a/src/BRSRC13/CORE/HOST/himage.h +++ b/src/BRSRC13/CORE/HOST/himage.h @@ -1,7 +1,6 @@ #ifndef _HIMAGE_H_ #define _HIMAGE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 14 diff --git a/src/BRSRC13/CORE/HOST/hook.h b/src/BRSRC13/CORE/HOST/hook.h index 0795c8e5..8fc42933 100644 --- a/src/BRSRC13/CORE/HOST/hook.h +++ b/src/BRSRC13/CORE/HOST/hook.h @@ -1,7 +1,6 @@ #ifndef _HOOK_H_ #define _HOOK_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 18 diff --git a/src/BRSRC13/CORE/HOST/hostcfg.h b/src/BRSRC13/CORE/HOST/hostcfg.h index c27e4e38..cb8d858a 100644 --- a/src/BRSRC13/CORE/HOST/hostcfg.h +++ b/src/BRSRC13/CORE/HOST/hostcfg.h @@ -1,7 +1,6 @@ #ifndef _HOSTCFG_H_ #define _HOSTCFG_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 18 diff --git a/src/BRSRC13/CORE/HOST/hstsetup.h b/src/BRSRC13/CORE/HOST/hstsetup.h index 683e4787..6457ade7 100644 --- a/src/BRSRC13/CORE/HOST/hstsetup.h +++ b/src/BRSRC13/CORE/HOST/hstsetup.h @@ -1,7 +1,6 @@ #ifndef _HSTSETUP_H_ #define _HSTSETUP_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 10 diff --git a/src/BRSRC13/CORE/HOST/memmgmt.c b/src/BRSRC13/CORE/HOST/memmgmt.c index 4b989fe6..42ca43a0 100644 --- a/src/BRSRC13/CORE/HOST/memmgmt.c +++ b/src/BRSRC13/CORE/HOST/memmgmt.c @@ -1,5 +1,9 @@ #include "memmgmt.h" +#include +#include +#include + host_regs regs; // Offset: 9 @@ -64,6 +68,6 @@ br_error HostSelectorBaseQuery(br_uint_32 *basep, br_uint_16 sel) { // Size: 175 br_error HostSelectorLimitQuery(br_uint_32 *limitp, br_uint_16 sel) { br_uint_32 limit; - ldt ldt; + ldt ldta; } diff --git a/src/BRSRC13/CORE/HOST/memmgmt.h b/src/BRSRC13/CORE/HOST/memmgmt.h index f8fb3c2d..0957eee8 100644 --- a/src/BRSRC13/CORE/HOST/memmgmt.h +++ b/src/BRSRC13/CORE/HOST/memmgmt.h @@ -1,7 +1,6 @@ #ifndef _MEMMGMT_H_ #define _MEMMGMT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 9 diff --git a/src/BRSRC13/CORE/MATH/angles.h b/src/BRSRC13/CORE/MATH/angles.h index 3d82fed0..edd619e6 100644 --- a/src/BRSRC13/CORE/MATH/angles.h +++ b/src/BRSRC13/CORE/MATH/angles.h @@ -1,7 +1,6 @@ #ifndef _ANGLES_H_ #define _ANGLES_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 18 diff --git a/src/BRSRC13/CORE/MATH/matrix23.h b/src/BRSRC13/CORE/MATH/matrix23.h index 743c36f2..28dbb725 100644 --- a/src/BRSRC13/CORE/MATH/matrix23.h +++ b/src/BRSRC13/CORE/MATH/matrix23.h @@ -1,7 +1,6 @@ #ifndef _MATRIX23_H_ #define _MATRIX23_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 15 diff --git a/src/BRSRC13/CORE/MATH/matrix34.h b/src/BRSRC13/CORE/MATH/matrix34.h index 571218ad..f65a44cb 100644 --- a/src/BRSRC13/CORE/MATH/matrix34.h +++ b/src/BRSRC13/CORE/MATH/matrix34.h @@ -1,7 +1,6 @@ #ifndef _MATRIX34_H_ #define _MATRIX34_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 15 diff --git a/src/BRSRC13/CORE/MATH/matrix4.h b/src/BRSRC13/CORE/MATH/matrix4.h index 8ed1f72e..5304c210 100644 --- a/src/BRSRC13/CORE/MATH/matrix4.h +++ b/src/BRSRC13/CORE/MATH/matrix4.h @@ -1,7 +1,6 @@ #ifndef _MATRIX4_H_ #define _MATRIX4_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 14 diff --git a/src/BRSRC13/CORE/MATH/plane.h b/src/BRSRC13/CORE/MATH/plane.h index d23b9840..63b11727 100644 --- a/src/BRSRC13/CORE/MATH/plane.h +++ b/src/BRSRC13/CORE/MATH/plane.h @@ -1,7 +1,6 @@ #ifndef _PLANE_H_ #define _PLANE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 16 diff --git a/src/BRSRC13/CORE/MATH/quat.h b/src/BRSRC13/CORE/MATH/quat.h index b2956ba1..f5b59f67 100644 --- a/src/BRSRC13/CORE/MATH/quat.h +++ b/src/BRSRC13/CORE/MATH/quat.h @@ -1,7 +1,6 @@ #ifndef _QUAT_H_ #define _QUAT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 10 diff --git a/src/BRSRC13/CORE/MATH/transfrm.h b/src/BRSRC13/CORE/MATH/transfrm.h index b00aefea..5cfb5f35 100644 --- a/src/BRSRC13/CORE/MATH/transfrm.h +++ b/src/BRSRC13/CORE/MATH/transfrm.h @@ -1,7 +1,6 @@ #ifndef _TRANSFRM_H_ #define _TRANSFRM_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 22 diff --git a/src/BRSRC13/CORE/MATH/vector.h b/src/BRSRC13/CORE/MATH/vector.h index c7ee1e01..c1d5421c 100644 --- a/src/BRSRC13/CORE/MATH/vector.h +++ b/src/BRSRC13/CORE/MATH/vector.h @@ -1,7 +1,6 @@ #ifndef _VECTOR_H_ #define _VECTOR_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 14 diff --git a/src/BRSRC13/CORE/PIXELMAP/fontptrs.h b/src/BRSRC13/CORE/PIXELMAP/fontptrs.h index 311031b2..5124d22f 100644 --- a/src/BRSRC13/CORE/PIXELMAP/fontptrs.h +++ b/src/BRSRC13/CORE/PIXELMAP/fontptrs.h @@ -1,7 +1,6 @@ #ifndef _FONTPTRS_H_ #define _FONTPTRS_H_ -#include "dr_types.h" #include "br_types.h" #endif diff --git a/src/BRSRC13/CORE/PIXELMAP/genclip.h b/src/BRSRC13/CORE/PIXELMAP/genclip.h index 78b42efc..0a7f95e2 100644 --- a/src/BRSRC13/CORE/PIXELMAP/genclip.h +++ b/src/BRSRC13/CORE/PIXELMAP/genclip.h @@ -1,7 +1,6 @@ #ifndef _GENCLIP_H_ #define _GENCLIP_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 18 diff --git a/src/BRSRC13/CORE/PIXELMAP/gencopy.h b/src/BRSRC13/CORE/PIXELMAP/gencopy.h index 28ac04b1..9113f69a 100644 --- a/src/BRSRC13/CORE/PIXELMAP/gencopy.h +++ b/src/BRSRC13/CORE/PIXELMAP/gencopy.h @@ -1,7 +1,6 @@ #ifndef _GENCOPY_H_ #define _GENCOPY_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 21 diff --git a/src/BRSRC13/CORE/PIXELMAP/pixelmap.h b/src/BRSRC13/CORE/PIXELMAP/pixelmap.h index d57e8c13..d8c4064f 100644 --- a/src/BRSRC13/CORE/PIXELMAP/pixelmap.h +++ b/src/BRSRC13/CORE/PIXELMAP/pixelmap.h @@ -1,7 +1,6 @@ #ifndef _PIXELMAP_H_ #define _PIXELMAP_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 19 diff --git a/src/BRSRC13/CORE/PIXELMAP/pmdsptch.c b/src/BRSRC13/CORE/PIXELMAP/pmdsptch.c index 5ac8712b..254a2fc5 100644 --- a/src/BRSRC13/CORE/PIXELMAP/pmdsptch.c +++ b/src/BRSRC13/CORE/PIXELMAP/pmdsptch.c @@ -1,5 +1,7 @@ #include "pmdsptch.h" +#include + char rscid[65]; // Offset: 22 diff --git a/src/BRSRC13/CORE/PIXELMAP/pmdsptch.h b/src/BRSRC13/CORE/PIXELMAP/pmdsptch.h index f3f7e8dd..759f6277 100644 --- a/src/BRSRC13/CORE/PIXELMAP/pmdsptch.h +++ b/src/BRSRC13/CORE/PIXELMAP/pmdsptch.h @@ -1,7 +1,6 @@ #ifndef _PMDSPTCH_H_ #define _PMDSPTCH_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 22 diff --git a/src/BRSRC13/CORE/PIXELMAP/pmfile.h b/src/BRSRC13/CORE/PIXELMAP/pmfile.h index 0e24f081..87f21d3b 100644 --- a/src/BRSRC13/CORE/PIXELMAP/pmfile.h +++ b/src/BRSRC13/CORE/PIXELMAP/pmfile.h @@ -1,7 +1,6 @@ #ifndef _PMFILE_H_ #define _PMFILE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 18 diff --git a/src/BRSRC13/CORE/PIXELMAP/pmgen.h b/src/BRSRC13/CORE/PIXELMAP/pmgen.h index ec3d8f62..b7ede426 100644 --- a/src/BRSRC13/CORE/PIXELMAP/pmgen.h +++ b/src/BRSRC13/CORE/PIXELMAP/pmgen.h @@ -1,7 +1,6 @@ #ifndef _PMGEN_H_ #define _PMGEN_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 32 diff --git a/src/BRSRC13/CORE/PIXELMAP/pmmem.h b/src/BRSRC13/CORE/PIXELMAP/pmmem.h index 50e461f1..fb6260ce 100644 --- a/src/BRSRC13/CORE/PIXELMAP/pmmem.h +++ b/src/BRSRC13/CORE/PIXELMAP/pmmem.h @@ -1,7 +1,6 @@ #ifndef _PMMEM_H_ #define _PMMEM_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 26 diff --git a/src/BRSRC13/CORE/PIXELMAP/pmnull.h b/src/BRSRC13/CORE/PIXELMAP/pmnull.h index ab49345f..157315db 100644 --- a/src/BRSRC13/CORE/PIXELMAP/pmnull.h +++ b/src/BRSRC13/CORE/PIXELMAP/pmnull.h @@ -1,7 +1,6 @@ #ifndef _PMNULL_H_ #define _PMNULL_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 34 diff --git a/src/BRSRC13/CORE/PIXELMAP/pmsetup.h b/src/BRSRC13/CORE/PIXELMAP/pmsetup.h index d0492db2..9515940c 100644 --- a/src/BRSRC13/CORE/PIXELMAP/pmsetup.h +++ b/src/BRSRC13/CORE/PIXELMAP/pmsetup.h @@ -1,7 +1,6 @@ #ifndef _PMSETUP_H_ #define _PMSETUP_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 16 diff --git a/src/BRSRC13/CORE/STD/brexcept.h b/src/BRSRC13/CORE/STD/brexcept.h index 309bfdc1..95cb6c7e 100644 --- a/src/BRSRC13/CORE/STD/brexcept.h +++ b/src/BRSRC13/CORE/STD/brexcept.h @@ -1,7 +1,6 @@ #ifndef _BREXCEPT_H_ #define _BREXCEPT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 18 diff --git a/src/BRSRC13/CORE/STD/brmath.h b/src/BRSRC13/CORE/STD/brmath.h index 6c971db0..ecbd98df 100644 --- a/src/BRSRC13/CORE/STD/brmath.h +++ b/src/BRSRC13/CORE/STD/brmath.h @@ -1,7 +1,6 @@ #ifndef _BRMATH_H_ #define _BRMATH_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 13 diff --git a/src/BRSRC13/CORE/STD/brstddiag.h b/src/BRSRC13/CORE/STD/brstddiag.h index 4c7c615a..319eaefa 100644 --- a/src/BRSRC13/CORE/STD/brstddiag.h +++ b/src/BRSRC13/CORE/STD/brstddiag.h @@ -1,7 +1,6 @@ #ifndef _STDDIAG_H_ #define _STDDIAG_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 15 diff --git a/src/BRSRC13/CORE/STD/brstdfile.h b/src/BRSRC13/CORE/STD/brstdfile.h index 61c12384..314ad26a 100644 --- a/src/BRSRC13/CORE/STD/brstdfile.h +++ b/src/BRSRC13/CORE/STD/brstdfile.h @@ -1,7 +1,6 @@ #ifndef _BRSTDFILE_H_ #define _BRSTDFILE_H_ -#include "dr_types.h" #include "br_types.h" extern br_filesystem *_BrDefaultFilesystem; diff --git a/src/BRSRC13/CORE/STD/brstdlib.c b/src/BRSRC13/CORE/STD/brstdlib.c index 5182d977..49a22788 100644 --- a/src/BRSRC13/CORE/STD/brstdlib.c +++ b/src/BRSRC13/CORE/STD/brstdlib.c @@ -2,9 +2,7 @@ #include #include -#include #include -#include #include @@ -55,7 +53,7 @@ int BrStrICmp(char *s1, char *s2) { // Offset: 355 // Size: 47 -char* BrStrCpy(char *s1, char *s2) { +char* BrStrCpy(char *s1, const char *s2) { return strcpy(s1, s2); } @@ -156,13 +154,13 @@ br_boolean BrIsPrint(int c) { // Offset: 1340 // Size: 50 -br_int_32 BrVSprintf(char *buf, char *fmt, va_list args) { +br_int_32 BrVSprintf(char *buf, const char *fmt, va_list args) { return vsprintf(buf, fmt, args); } // Offset: 1402 // Size: 101 -br_int_32 BrVSprintfN(char *buf, br_size_t buf_size, char *fmt, va_list args) { +br_int_32 BrVSprintfN(char *buf, br_size_t buf_size, const char *fmt, va_list args) { // Most C libs have vsnprintf these days that can replace this. unsigned int n; char tmp[512]; @@ -179,7 +177,7 @@ br_int_32 BrVSprintfN(char *buf, br_size_t buf_size, char *fmt, va_list args) { // Offset: 1513 // Size: 50 -br_int_32 BrVSScanf(char *buf, char *fmt, va_list args) { +br_int_32 BrVSScanf(char *buf, const char *fmt, va_list args) { return vsscanf(buf, fmt, args); } diff --git a/src/BRSRC13/CORE/STD/brstdlib.h b/src/BRSRC13/CORE/STD/brstdlib.h index a9ec1411..bf359daf 100644 --- a/src/BRSRC13/CORE/STD/brstdlib.h +++ b/src/BRSRC13/CORE/STD/brstdlib.h @@ -5,9 +5,11 @@ #ifndef _BRSTDLIB_H_ #define _BRSTDLIB_H_ -#include "dr_types.h" #include "br_types.h" +#include +#include + // Offset: 9 // Size: 50 int BrMemCmp(void *s1, void *s2, size_t n); @@ -34,7 +36,7 @@ int BrStrICmp(char *s1, char *s2); // Offset: 355 // Size: 47 -char* BrStrCpy(char *s1, char *s2); +char* BrStrCpy(char *s1, const char *s2); // Offset: 411 // Size: 44 @@ -98,15 +100,15 @@ br_boolean BrIsPrint(int c); // Offset: 1340 // Size: 50 -br_int_32 BrVSprintf(char *buf, char *fmt, va_list args); +br_int_32 BrVSprintf(char *buf, const char *fmt, va_list args); // Offset: 1402 // Size: 101 -br_int_32 BrVSprintfN(char *buf, br_size_t buf_size, char *fmt, va_list args); +br_int_32 BrVSprintfN(char *buf, br_size_t buf_size, const char *fmt, va_list args); // Offset: 1513 // Size: 50 -br_int_32 BrVSScanf(char *buf, char *fmt, va_list args); +br_int_32 BrVSScanf(char *buf, const char *fmt, va_list args); #endif diff --git a/src/BRSRC13/CORE/STD/brstdmem.h b/src/BRSRC13/CORE/STD/brstdmem.h index dff05896..2b877543 100644 --- a/src/BRSRC13/CORE/STD/brstdmem.h +++ b/src/BRSRC13/CORE/STD/brstdmem.h @@ -1,7 +1,6 @@ #ifndef _BRSTDMEM_H_ #define _BRSTDMEM_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 17 diff --git a/src/BRSRC13/CORE/STD/logwrite.h b/src/BRSRC13/CORE/STD/logwrite.h index 194e40fb..3730063d 100644 --- a/src/BRSRC13/CORE/STD/logwrite.h +++ b/src/BRSRC13/CORE/STD/logwrite.h @@ -1,7 +1,6 @@ #ifndef _LOGWRITE_H_ #define _LOGWRITE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 11 diff --git a/src/BRSRC13/CORE/V1DB/actsupt.h b/src/BRSRC13/CORE/V1DB/actsupt.h index e3d2ca22..dc40aeac 100644 --- a/src/BRSRC13/CORE/V1DB/actsupt.h +++ b/src/BRSRC13/CORE/V1DB/actsupt.h @@ -1,7 +1,6 @@ #ifndef _ACTSUPT_H_ #define _ACTSUPT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 12 diff --git a/src/BRSRC13/CORE/V1DB/custsupt.h b/src/BRSRC13/CORE/V1DB/custsupt.h index ec2a5395..25257199 100644 --- a/src/BRSRC13/CORE/V1DB/custsupt.h +++ b/src/BRSRC13/CORE/V1DB/custsupt.h @@ -1,7 +1,6 @@ #ifndef _CUSTSUPT_H_ #define _CUSTSUPT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 21 diff --git a/src/BRSRC13/CORE/V1DB/dbsetup.h b/src/BRSRC13/CORE/V1DB/dbsetup.h index 2044fc86..e017ed68 100644 --- a/src/BRSRC13/CORE/V1DB/dbsetup.h +++ b/src/BRSRC13/CORE/V1DB/dbsetup.h @@ -1,7 +1,6 @@ #ifndef _DBSETUP_H_ #define _DBSETUP_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 12 diff --git a/src/BRSRC13/CORE/V1DB/def_mat.h b/src/BRSRC13/CORE/V1DB/def_mat.h index 64f09e26..c33f25f8 100644 --- a/src/BRSRC13/CORE/V1DB/def_mat.h +++ b/src/BRSRC13/CORE/V1DB/def_mat.h @@ -1,7 +1,6 @@ #ifndef _DEF_MAT_H_ #define _DEF_MAT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 21 diff --git a/src/BRSRC13/CORE/V1DB/def_mdl.h b/src/BRSRC13/CORE/V1DB/def_mdl.h index 07dd571f..933718bf 100644 --- a/src/BRSRC13/CORE/V1DB/def_mdl.h +++ b/src/BRSRC13/CORE/V1DB/def_mdl.h @@ -1,7 +1,6 @@ #ifndef _DEF_MDL_H_ #define _DEF_MDL_H_ -#include "dr_types.h" #include "br_types.h" #endif diff --git a/src/BRSRC13/CORE/V1DB/def_otab.h b/src/BRSRC13/CORE/V1DB/def_otab.h index 18c5d2da..8b2829da 100644 --- a/src/BRSRC13/CORE/V1DB/def_otab.h +++ b/src/BRSRC13/CORE/V1DB/def_otab.h @@ -1,7 +1,6 @@ #ifndef _DEF_OTAB_H_ #define _DEF_OTAB_H_ -#include "dr_types.h" #include "br_types.h" #endif diff --git a/src/BRSRC13/CORE/V1DB/enables.h b/src/BRSRC13/CORE/V1DB/enables.h index 2ca8919c..c4bc08ca 100644 --- a/src/BRSRC13/CORE/V1DB/enables.h +++ b/src/BRSRC13/CORE/V1DB/enables.h @@ -1,7 +1,6 @@ #ifndef _ENABLES_H_ #define _ENABLES_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 12 diff --git a/src/BRSRC13/CORE/V1DB/matsupt.h b/src/BRSRC13/CORE/V1DB/matsupt.h index 11ea9466..4bbb7489 100644 --- a/src/BRSRC13/CORE/V1DB/matsupt.h +++ b/src/BRSRC13/CORE/V1DB/matsupt.h @@ -1,7 +1,6 @@ #ifndef _MATSUPT_H_ #define _MATSUPT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 19 diff --git a/src/BRSRC13/CORE/V1DB/modrend.h b/src/BRSRC13/CORE/V1DB/modrend.h index c34cf019..bb275f8a 100644 --- a/src/BRSRC13/CORE/V1DB/modrend.h +++ b/src/BRSRC13/CORE/V1DB/modrend.h @@ -1,7 +1,6 @@ #ifndef _MODREND_H_ #define _MODREND_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 12 diff --git a/src/BRSRC13/CORE/V1DB/modsupt.h b/src/BRSRC13/CORE/V1DB/modsupt.h index 3829cd11..e11d6bcc 100644 --- a/src/BRSRC13/CORE/V1DB/modsupt.h +++ b/src/BRSRC13/CORE/V1DB/modsupt.h @@ -1,7 +1,6 @@ #ifndef _MODSUPT_H_ #define _MODSUPT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 16 diff --git a/src/BRSRC13/CORE/V1DB/otable.h b/src/BRSRC13/CORE/V1DB/otable.h index a5f06989..6cb4191b 100644 --- a/src/BRSRC13/CORE/V1DB/otable.h +++ b/src/BRSRC13/CORE/V1DB/otable.h @@ -1,7 +1,6 @@ #ifndef _OTABLE_H_ #define _OTABLE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 23 diff --git a/src/BRSRC13/CORE/V1DB/prepmap.h b/src/BRSRC13/CORE/V1DB/prepmap.h index d86b2d35..a8d105ca 100644 --- a/src/BRSRC13/CORE/V1DB/prepmap.h +++ b/src/BRSRC13/CORE/V1DB/prepmap.h @@ -1,7 +1,6 @@ #ifndef _PREPMAP_H_ #define _PREPMAP_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 12 diff --git a/src/BRSRC13/CORE/V1DB/prepmatl.h b/src/BRSRC13/CORE/V1DB/prepmatl.h index b3b305ce..87516779 100644 --- a/src/BRSRC13/CORE/V1DB/prepmatl.h +++ b/src/BRSRC13/CORE/V1DB/prepmatl.h @@ -1,7 +1,6 @@ #ifndef _PREPMATL_H_ #define _PREPMATL_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 17 diff --git a/src/BRSRC13/CORE/V1DB/prepmesh.h b/src/BRSRC13/CORE/V1DB/prepmesh.h index 2e21a159..2ae7facb 100644 --- a/src/BRSRC13/CORE/V1DB/prepmesh.h +++ b/src/BRSRC13/CORE/V1DB/prepmesh.h @@ -1,7 +1,6 @@ #ifndef _PREPMESH_H_ #define _PREPMESH_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 8 diff --git a/src/BRSRC13/CORE/V1DB/preptab.h b/src/BRSRC13/CORE/V1DB/preptab.h index ed299eb0..b2f20fad 100644 --- a/src/BRSRC13/CORE/V1DB/preptab.h +++ b/src/BRSRC13/CORE/V1DB/preptab.h @@ -1,7 +1,6 @@ #ifndef _PREPTAB_H_ #define _PREPTAB_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 14 diff --git a/src/BRSRC13/CORE/V1DB/regsupt.h b/src/BRSRC13/CORE/V1DB/regsupt.h index e37327a7..78e08829 100644 --- a/src/BRSRC13/CORE/V1DB/regsupt.h +++ b/src/BRSRC13/CORE/V1DB/regsupt.h @@ -1,7 +1,6 @@ #ifndef _REGSUPT_H_ #define _REGSUPT_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 11 diff --git a/src/BRSRC13/CORE/V1DB/render.h b/src/BRSRC13/CORE/V1DB/render.h index b032b8fa..798fc3dd 100644 --- a/src/BRSRC13/CORE/V1DB/render.h +++ b/src/BRSRC13/CORE/V1DB/render.h @@ -1,7 +1,6 @@ #ifndef _RENDER_H_ #define _RENDER_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 16 diff --git a/src/BRSRC13/CORE/V1DB/v1dbfile.c b/src/BRSRC13/CORE/V1DB/v1dbfile.c index ecc1a572..dd4a3d00 100644 --- a/src/BRSRC13/CORE/V1DB/v1dbfile.c +++ b/src/BRSRC13/CORE/V1DB/v1dbfile.c @@ -1,5 +1,7 @@ #include "v1dbfile.h" +#include + br_chunks_table_entry MaterialLoadEntries[8]; br_chunks_table MaterialLoadTable; br_chunks_table ActorLoadTable; diff --git a/src/BRSRC13/CORE/V1DB/v1dbfile.h b/src/BRSRC13/CORE/V1DB/v1dbfile.h index 7ead426d..6a98d4cd 100644 --- a/src/BRSRC13/CORE/V1DB/v1dbfile.h +++ b/src/BRSRC13/CORE/V1DB/v1dbfile.h @@ -1,7 +1,6 @@ #ifndef _V1DBFILE_H_ #define _V1DBFILE_H_ -#include "dr_types.h" #include "br_types.h" // Offset: 18 diff --git a/src/BRSRC13/Makefile b/src/BRSRC13/Makefile new file mode 100644 index 00000000..9e0bccd8 --- /dev/null +++ b/src/BRSRC13/Makefile @@ -0,0 +1,29 @@ +TARGET_EXEC ?= c1 + +BUILD_DIR ?= ./build +SRC_DIR ?= . + +SRCS := $(shell find $(SRC_DIR) -name *.c) +OBJS := $(SRCS:%=$(BUILD_DIR)/%.o) +DEPS := $(OBJS:.o=.d) + +INC_DIRS := $(shell find $(SRC_DIR) -type d) +INC_FLAGS := $(addprefix -I,$(INC_DIRS)) + +CFLAGS ?= $(INC_FLAGS) -Wno-return-type -Wno-missing-declarations -Werror=implicit-function-declaration + +.PHONY: clean build + +build: $(OBJS) + +# c source +$(BUILD_DIR)/%.c.o: %.c + @$(MKDIR_P) $(dir $@) + @$(CC) $(CFLAGS) -c $< -o $@ + +clean: + $(RM) -r $(BUILD_DIR) + +-include $(DEPS) + +MKDIR_P ?= mkdir -p diff --git a/src/types/br_types.h b/src/BRSRC13/br_types.h similarity index 90% rename from src/types/br_types.h rename to src/BRSRC13/br_types.h index b9963d78..aee77fc9 100644 --- a/src/types/br_types.h +++ b/src/BRSRC13/br_types.h @@ -1,6 +1,8 @@ #ifndef BR_TYPES_H #define BR_TYPES_H +#include + typedef long br_int_32; typedef unsigned long br_uint_32; typedef short br_int_16; @@ -2324,7 +2326,7 @@ typedef struct br_token_entry { br_int_32 base_length; } br_token_entry; -typedef unsigned int jmp_buf[13]; + typedef struct br_exception_handler br_exception_handler; typedef struct br_exception_handler { br_exception_handler *prev; @@ -2337,5 +2339,375 @@ typedef struct br_pixelmap_state { br_tv_template *pixelmap_match_template; } br_pixelmap_state; +typedef struct pm_type_info { + br_uint_16 bits; + br_uint_16 file_size; + br_uint_16 align; + br_uint_16 channels; +} pm_type_info; + +typedef struct match_tokens { + br_token use; + br_uint_8 pixel_type; + br_int_32 pixel_bits; + br_int_32 width; + br_int_32 height; + br_object *renderer; +} match_tokens; + +typedef struct host_info { + br_uint_32 size; + char identifier[40]; + br_uint_32 capabilities; + br_token processor_family; + br_token processor_type; +} host_info; + +typedef struct host_interrupt_hook { + br_uint_8 vector; + br_boolean active; + br_uint_32 old_offset; + br_uint_16 old_sel; +} host_interrupt_hook; + +typedef struct host_exception_hook { + br_uint_8 exception; + br_boolean active; + br_uint_32 old_offset; + br_uint_16 old_sel; + br_uint_8 scratch[256]; +} host_exception_hook; + +typedef struct host_regs { + struct { + br_uint_32 edi; + br_uint_32 esi; + br_uint_32 ebp; + br_uint_32 _res; + br_uint_32 ebx; + br_uint_32 edx; + br_uint_32 ecx; + br_uint_32 eax; + br_uint_16 flags; + br_uint_16 es; + br_uint_16 ds; + br_uint_16 fs; + br_uint_16 gs; + br_uint_16 ip; + br_uint_16 cs; + br_uint_16 sp; + br_uint_16 ss; + }a; + struct { + br_uint_16 di; + br_uint_16 _pad0; + br_uint_16 si; + br_uint_16 _pad1; + br_uint_16 bp; + br_uint_16 _pad2; + br_uint_16 _res; + br_uint_16 _pad3; + br_uint_16 bx; + br_uint_16 _pad4; + br_uint_16 dx; + br_uint_16 _pad5; + br_uint_16 cx; + br_uint_16 _pad6; + br_uint_16 ax; + br_uint_16 _pad7; + br_uint_16 flags; + br_uint_16 es; + br_uint_16 ds; + br_uint_16 fs; + br_uint_16 gs; + br_uint_16 ip; + br_uint_16 cs; + br_uint_16 sp; + br_uint_16 ss; + }b; + struct { + br_uint_32 _pad0[4]; + br_uint_8 bl; + br_uint_8 bh; + br_uint_8 _pad1; + br_uint_8 _pad2; + br_uint_8 dl; + br_uint_8 dh; + br_uint_8 _pad3; + br_uint_8 _pad4; + br_uint_8 cl; + br_uint_8 ch; + br_uint_8 _pad5; + br_uint_8 _pad6; + br_uint_8 al; + br_uint_8 ah; + br_uint_8 _pad7; + br_uint_8 _pad8; + }c; +} host_regs; + +typedef struct ldt { + unsigned long limit_0: 10; + unsigned long base_0: 10; + unsigned long base_1: 8; + unsigned long type: 4; + unsigned long application: 1; + unsigned long dpl: 2; + unsigned long present: 1; + unsigned long limit_1: 4; + unsigned long system: 1; + unsigned long reserved: 1; + unsigned long use32: 1; + unsigned long granularity: 1; + unsigned long base_2: 8; +} ldt; + +typedef struct msdos_header { + br_uint_16 magic; + br_uint_16 last_page_bytes; + br_uint_16 pages; + br_uint_16 n_relocations; + br_uint_16 header_size; + br_uint_16 minalloc; + br_uint_16 maxalloc; + br_uint_16 start_ss; + br_uint_16 start_sp; + br_uint_16 checksum; + br_uint_16 start_ip; + br_uint_16 start_cs; + br_uint_16 reloc_offset; + br_uint_16 overlay_number; + br_uint_16 _reserved0[4]; + br_uint_16 oem_id; + br_uint_16 oem_info; + br_uint_16 _reserved1[10]; + br_uint_32 new_header_offset; +} msdos_header; + +typedef struct coff_header { + br_uint_16 machine; + br_uint_16 n_sections; + br_uint_32 time_date; + br_uint_32 symbols_offset; + br_uint_32 n_symbols; + br_uint_16 opt_header_size; + br_uint_16 flags; +} coff_header; + +typedef struct nt_optional_header { + br_uint_16 magic; + br_uint_8 l_major; + br_uint_8 l_minor; + br_uint_32 code_size; + br_uint_32 data_size; + br_uint_32 bss_size; + br_uint_32 entry_point; + br_uint_32 code_base; + br_uint_32 data_base; + br_uint_32 image_base; + br_uint_32 section_alignment; + br_uint_32 file_alignment; + br_uint_16 os_major; + br_uint_16 os_minor; + br_uint_16 user_major; + br_uint_16 user_minor; + br_uint_16 subsys_major; + br_uint_16 subsys_minor; + br_uint_32 _reserved; + br_uint_32 image_size; + br_uint_32 header_size; + br_uint_32 file_checksum; + br_uint_16 subsystem; + br_uint_16 dll_flags; + br_uint_32 stack_reserve_size; + br_uint_32 stack_commit_size; + br_uint_32 heap_reserve_size; + br_uint_32 heap_commit_size; + br_uint_32 loader_flags; + br_uint_32 n_data_directories; + struct { + br_uint_32 rva; + br_uint_32 size; + }; +} nt_optional_header; + +typedef struct section_header { + br_uint_8 section_name[8]; + br_uint_32 virtual_size; + br_uint_32 rva; + br_uint_32 data_size; + br_uint_32 data_offset; + br_uint_32 relocs_offset; + br_uint_32 linenums_offset; + br_uint_16 n_relocs; + br_uint_16 n_linenums; + br_uint_32 flags; +} section_header; + +typedef struct resource_header { + br_simple_node node; + br_simple_list children; + br_uint_8 size_l; + br_uint_8 size_m; + br_uint_8 size_h; + br_uint_8 class; + void *magic_ptr; + int magic_num; +} resource_header; + +typedef struct host_real_memory { + br_uint_32 pm_off; + br_uint_16 pm_seg; + br_uint_16 _reserved; + br_uint_16 rm_off; + br_uint_16 rm_seg; +} host_real_memory; + +typedef struct file_info { + br_uint_32 type; + br_uint_32 version; +} file_info; + +typedef struct object_list { + br_simple_list l; +} object_list; + +typedef struct object_list_entry { + br_simple_node n; + br_object *h; +} object_list_entry; + +typedef struct token_match { + br_token_value *original; + br_token_value *query; + br_int_32 n; + void *extra; + br_size_t extra_size; +} token_match; + +typedef struct token_type { + char *identifier; + br_token type; + int length; +} token_type; + +typedef struct export_directory { + br_uint_32 flags; + br_uint_32 timestamp; + br_uint_16 major_version; + br_uint_16 minor_version; + br_uint_32 name; + br_uint_32 ordinal_base; + br_uint_32 n_entries; + br_uint_32 n_names; + br_uint_32 export_table; + br_uint_32 name_table; + br_uint_32 ordinal_table; +} export_directory; + +typedef struct import_directory { + br_uint_32 lookup_table; + br_uint_32 timestamp; + br_uint_32 forwarder; + br_uint_32 name; + br_uint_32 address_table; +} import_directory; + +typedef struct basereloc_header { + br_uint_32 rva; + br_uint_32 size; +} basereloc_header; + +typedef struct order_info { + br_uint_8 a0; + br_uint_8 a1; + br_uint_8 a2; + br_uint_8 _pad[1]; +} order_info; + +typedef struct transform_type { + br_uint_32 id; + br_file_struct *fs; +} transform_type; + +typedef enum dosio_event_type { + DOSIO_EVENT_KEY_DOWN = 0, + DOSIO_EVENT_KEY_UP = 1, + DOSIO_EVENT_POINTER1_DOWN = 2, + DOSIO_EVENT_POINTER1_UP = 3, + DOSIO_EVENT_POINTER2_DOWN = 4, + DOSIO_EVENT_POINTER2_UP = 5, + DOSIO_EVENT_POINTER3_DOWN = 6, + DOSIO_EVENT_POINTER3_UP = 7, + DOSIO_EVENT_POINTER_MOVE = 8, + DOSIO_EVENT_MAX = 9 +} dosio_event_type; + +typedef enum dosio_event_qual { + DOSIO_QUAL_SHIFT = 1, + DOSIO_QUAL_CONTROL = 2, + DOSIO_QUAL_ALT = 4 +} dosio_event_qual; + +typedef struct dosio_event { + br_uint_16 type; + br_uint_16 qualifiers; + br_uint_32 value_1; + br_uint_32 value_2; +} dosio_event; + +typedef struct dosio_event_queue { + br_uint_16 total; + br_uint_16 count; + br_uint_16 head; + br_uint_16 tail; + dosio_event slots[1]; +} dosio_event_queue; + +typedef struct pm_temp_edge { + struct pm_temp_edge *next; + br_uint_16 first; + br_uint_16 last; + char other; +} pm_temp_edge; + +typedef struct prep_vertex { + br_vector3 n; + br_uint_16 v; + br_uint_16 f; +} prep_vertex; + +typedef struct fmt_vertex { + br_vector3 p; + br_vector2 map; + br_vector3 n; +} DR_VERTEX, fmt_vertex; + +typedef struct v11face { + br_uint_16 vertices[3]; + br_uint_16 edges[3]; + br_vector4 eqn; +} DR_FACE, v11face; + +typedef struct v11group { + void *stored; + DR_FACE *faces; + br_colour *face_colours; + br_uint_16 *face_user; + DR_VERTEX *vertices; + br_colour *vertex_colours; + br_uint_16 *vertex_user; + br_uint_16 nfaces; + br_uint_16 nvertices; + br_uint_16 nedges; +} v11group; + +typedef struct v11model { + br_size_t size; + br_uint_32 flags; + br_uint_16 ngroups; + br_vector3 pivot; + v11group *groups; +} v11model; #endif diff --git a/src/DETHRACE/Makefile b/src/DETHRACE/Makefile new file mode 100644 index 00000000..9ab08129 --- /dev/null +++ b/src/DETHRACE/Makefile @@ -0,0 +1,40 @@ +TARGET_EXEC ?= c1 + +BUILD_DIR ?= ./build +SRC_DIR ?= . +BR_SRC_DIR ?= ../BRSRC13 + +SRCS := $(shell find $(SRC_DIR) -name *.c) +OBJS := $(SRCS:%=$(BUILD_DIR)/%.o) $(shell find $(BR_SRC_DIR) -name *.o) +DEPS := $(OBJS:.o=.d) + +INC_DIRS := $(shell find $(SRC_DIR) -type d) ../BRSRC13 +INC_FLAGS := $(addprefix -I,$(INC_DIRS)) + +CFLAGS ?= $(INC_FLAGS) -Wno-return-type -Wno-missing-declarations -Werror=implicit-function-declaration + +.PHONY: clean build test + +build: $(BUILD_DIR)/$(TARGET_EXEC) + +brender: $(BR_OBJS) + $(MAKE) -C BRSRC13 + +$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS) + @$(CC) $(OBJS) -o $@ $(LDFLAGS) + +# c source +$(BUILD_DIR)/%.c.o: %.c + @$(MKDIR_P) $(dir $@) + @$(CC) $(CFLAGS) -c $< -o $@ + +clean: + $(RM) -r $(BUILD_DIR) + +test: build + $(BUILD_DIR)/$(TARGET_EXEC) -test + + +-include $(DEPS) + +MKDIR_P ?= mkdir -p diff --git a/src/DETHRACE/source/common/brucetrk.c b/src/DETHRACE/common/brucetrk.c similarity index 97% rename from src/DETHRACE/source/common/brucetrk.c rename to src/DETHRACE/common/brucetrk.c index b25200c6..3604764e 100644 --- a/src/DETHRACE/source/common/brucetrk.c +++ b/src/DETHRACE/common/brucetrk.c @@ -1,5 +1,7 @@ #include "brucetrk.h" +#include "CORE/STD/brstdlib.h" + br_actor *gMr_blendy; int gDefault_blend_pc; @@ -9,6 +11,8 @@ int gDefault_blend_pc; // EDX: pDst void AllocateActorMatrix(tTrack_spec *pTrack_spec, br_actor ****pDst) { tU16 z; + char *s = "jeff"; + BrStrLen(s); } // Offset: 204 diff --git a/src/DETHRACE/source/common/brucetrk.h b/src/DETHRACE/common/brucetrk.h similarity index 100% rename from src/DETHRACE/source/common/brucetrk.h rename to src/DETHRACE/common/brucetrk.h diff --git a/src/DETHRACE/source/common/car.c b/src/DETHRACE/common/car.c similarity index 100% rename from src/DETHRACE/source/common/car.c rename to src/DETHRACE/common/car.c diff --git a/src/DETHRACE/source/common/car.h b/src/DETHRACE/common/car.h similarity index 100% rename from src/DETHRACE/source/common/car.h rename to src/DETHRACE/common/car.h diff --git a/src/DETHRACE/source/common/controls.c b/src/DETHRACE/common/controls.c similarity index 99% rename from src/DETHRACE/source/common/controls.c rename to src/DETHRACE/common/controls.c index af41758f..87aaafbc 100644 --- a/src/DETHRACE/source/common/controls.c +++ b/src/DETHRACE/common/controls.c @@ -736,4 +736,3 @@ void InitAbuseomatic() { // Size: 94 void DisposeAbuseomatic() { } - diff --git a/src/DETHRACE/source/common/controls.h b/src/DETHRACE/common/controls.h similarity index 100% rename from src/DETHRACE/source/common/controls.h rename to src/DETHRACE/common/controls.h diff --git a/src/DETHRACE/source/common/crush.c b/src/DETHRACE/common/crush.c similarity index 100% rename from src/DETHRACE/source/common/crush.c rename to src/DETHRACE/common/crush.c diff --git a/src/DETHRACE/source/common/crush.h b/src/DETHRACE/common/crush.h similarity index 100% rename from src/DETHRACE/source/common/crush.h rename to src/DETHRACE/common/crush.h diff --git a/src/DETHRACE/source/common/cutscene.c b/src/DETHRACE/common/cutscene.c similarity index 100% rename from src/DETHRACE/source/common/cutscene.c rename to src/DETHRACE/common/cutscene.c diff --git a/src/DETHRACE/source/common/cutscene.h b/src/DETHRACE/common/cutscene.h similarity index 100% rename from src/DETHRACE/source/common/cutscene.h rename to src/DETHRACE/common/cutscene.h diff --git a/src/DETHRACE/source/common/demo.c b/src/DETHRACE/common/demo.c similarity index 100% rename from src/DETHRACE/source/common/demo.c rename to src/DETHRACE/common/demo.c diff --git a/src/DETHRACE/source/common/demo.h b/src/DETHRACE/common/demo.h similarity index 100% rename from src/DETHRACE/source/common/demo.h rename to src/DETHRACE/common/demo.h diff --git a/src/DETHRACE/source/common/depth.c b/src/DETHRACE/common/depth.c similarity index 100% rename from src/DETHRACE/source/common/depth.c rename to src/DETHRACE/common/depth.c diff --git a/src/DETHRACE/source/common/depth.h b/src/DETHRACE/common/depth.h similarity index 100% rename from src/DETHRACE/source/common/depth.h rename to src/DETHRACE/common/depth.h diff --git a/src/DETHRACE/source/common/displays.c b/src/DETHRACE/common/displays.c similarity index 100% rename from src/DETHRACE/source/common/displays.c rename to src/DETHRACE/common/displays.c diff --git a/src/DETHRACE/source/common/displays.h b/src/DETHRACE/common/displays.h similarity index 100% rename from src/DETHRACE/source/common/displays.h rename to src/DETHRACE/common/displays.h diff --git a/src/DETHRACE/source/common/drfile.c b/src/DETHRACE/common/drfile.c similarity index 100% rename from src/DETHRACE/source/common/drfile.c rename to src/DETHRACE/common/drfile.c diff --git a/src/DETHRACE/source/common/drfile.h b/src/DETHRACE/common/drfile.h similarity index 100% rename from src/DETHRACE/source/common/drfile.h rename to src/DETHRACE/common/drfile.h diff --git a/src/DETHRACE/source/common/drmem.c b/src/DETHRACE/common/drmem.c similarity index 100% rename from src/DETHRACE/source/common/drmem.c rename to src/DETHRACE/common/drmem.c diff --git a/src/DETHRACE/source/common/drmem.h b/src/DETHRACE/common/drmem.h similarity index 100% rename from src/DETHRACE/source/common/drmem.h rename to src/DETHRACE/common/drmem.h diff --git a/src/DETHRACE/source/common/errors.c b/src/DETHRACE/common/errors.c similarity index 93% rename from src/DETHRACE/source/common/errors.c rename to src/DETHRACE/common/errors.c index c913a97a..0a66c00b 100644 --- a/src/DETHRACE/source/common/errors.c +++ b/src/DETHRACE/common/errors.c @@ -1,5 +1,9 @@ #include "errors.h" +#include +#include +#include + char *gError_messages[126]; int gError_code; char *gPalette_copy; @@ -48,4 +52,3 @@ void OpenDiagnostics() { // EAX: pMisc_text_index int DoErrorInterface(int pMisc_text_index) { } - diff --git a/src/DETHRACE/source/common/errors.h b/src/DETHRACE/common/errors.h similarity index 100% rename from src/DETHRACE/source/common/errors.h rename to src/DETHRACE/common/errors.h diff --git a/src/DETHRACE/source/common/finteray.c b/src/DETHRACE/common/finteray.c similarity index 100% rename from src/DETHRACE/source/common/finteray.c rename to src/DETHRACE/common/finteray.c diff --git a/src/DETHRACE/source/common/finteray.h b/src/DETHRACE/common/finteray.h similarity index 100% rename from src/DETHRACE/source/common/finteray.h rename to src/DETHRACE/common/finteray.h diff --git a/src/DETHRACE/source/common/flicplay.c b/src/DETHRACE/common/flicplay.c similarity index 100% rename from src/DETHRACE/source/common/flicplay.c rename to src/DETHRACE/common/flicplay.c diff --git a/src/DETHRACE/source/common/flicplay.h b/src/DETHRACE/common/flicplay.h similarity index 100% rename from src/DETHRACE/source/common/flicplay.h rename to src/DETHRACE/common/flicplay.h diff --git a/src/DETHRACE/source/common/globvars.c b/src/DETHRACE/common/globvars.c similarity index 100% rename from src/DETHRACE/source/common/globvars.c rename to src/DETHRACE/common/globvars.c diff --git a/src/DETHRACE/source/common/globvars.h b/src/DETHRACE/common/globvars.h similarity index 100% rename from src/DETHRACE/source/common/globvars.h rename to src/DETHRACE/common/globvars.h diff --git a/src/DETHRACE/source/common/globvrbm.c b/src/DETHRACE/common/globvrbm.c similarity index 100% rename from src/DETHRACE/source/common/globvrbm.c rename to src/DETHRACE/common/globvrbm.c diff --git a/src/DETHRACE/source/common/globvrbm.h b/src/DETHRACE/common/globvrbm.h similarity index 100% rename from src/DETHRACE/source/common/globvrbm.h rename to src/DETHRACE/common/globvrbm.h diff --git a/src/DETHRACE/source/common/globvrkm.c b/src/DETHRACE/common/globvrkm.c similarity index 100% rename from src/DETHRACE/source/common/globvrkm.c rename to src/DETHRACE/common/globvrkm.c diff --git a/src/DETHRACE/source/common/globvrkm.h b/src/DETHRACE/common/globvrkm.h similarity index 100% rename from src/DETHRACE/source/common/globvrkm.h rename to src/DETHRACE/common/globvrkm.h diff --git a/src/DETHRACE/source/common/globvrme.c b/src/DETHRACE/common/globvrme.c similarity index 100% rename from src/DETHRACE/source/common/globvrme.c rename to src/DETHRACE/common/globvrme.c diff --git a/src/DETHRACE/source/common/globvrme.h b/src/DETHRACE/common/globvrme.h similarity index 100% rename from src/DETHRACE/source/common/globvrme.h rename to src/DETHRACE/common/globvrme.h diff --git a/src/DETHRACE/source/common/globvrpb.c b/src/DETHRACE/common/globvrpb.c similarity index 100% rename from src/DETHRACE/source/common/globvrpb.c rename to src/DETHRACE/common/globvrpb.c diff --git a/src/DETHRACE/source/common/globvrpb.h b/src/DETHRACE/common/globvrpb.h similarity index 100% rename from src/DETHRACE/source/common/globvrpb.h rename to src/DETHRACE/common/globvrpb.h diff --git a/src/DETHRACE/source/common/grafdata.c b/src/DETHRACE/common/grafdata.c similarity index 100% rename from src/DETHRACE/source/common/grafdata.c rename to src/DETHRACE/common/grafdata.c diff --git a/src/DETHRACE/source/common/grafdata.h b/src/DETHRACE/common/grafdata.h similarity index 100% rename from src/DETHRACE/source/common/grafdata.h rename to src/DETHRACE/common/grafdata.h diff --git a/src/DETHRACE/source/common/graphics.c b/src/DETHRACE/common/graphics.c similarity index 100% rename from src/DETHRACE/source/common/graphics.c rename to src/DETHRACE/common/graphics.c diff --git a/src/DETHRACE/source/common/graphics.h b/src/DETHRACE/common/graphics.h similarity index 100% rename from src/DETHRACE/source/common/graphics.h rename to src/DETHRACE/common/graphics.h diff --git a/src/DETHRACE/source/common/init.c b/src/DETHRACE/common/init.c similarity index 100% rename from src/DETHRACE/source/common/init.c rename to src/DETHRACE/common/init.c diff --git a/src/DETHRACE/source/common/init.h b/src/DETHRACE/common/init.h similarity index 100% rename from src/DETHRACE/source/common/init.h rename to src/DETHRACE/common/init.h diff --git a/src/DETHRACE/source/common/input.c b/src/DETHRACE/common/input.c similarity index 99% rename from src/DETHRACE/source/common/input.c rename to src/DETHRACE/common/input.c index 22638364..68f2392c 100644 --- a/src/DETHRACE/source/common/input.c +++ b/src/DETHRACE/common/input.c @@ -367,4 +367,3 @@ void EdgeTriggerModeOn() { // Size: 44 void EdgeTriggerModeOff() { } - diff --git a/src/DETHRACE/source/common/input.h b/src/DETHRACE/common/input.h similarity index 100% rename from src/DETHRACE/source/common/input.h rename to src/DETHRACE/common/input.h diff --git a/src/DETHRACE/source/common/intrface.c b/src/DETHRACE/common/intrface.c similarity index 100% rename from src/DETHRACE/source/common/intrface.c rename to src/DETHRACE/common/intrface.c diff --git a/src/DETHRACE/source/common/intrface.h b/src/DETHRACE/common/intrface.h similarity index 100% rename from src/DETHRACE/source/common/intrface.h rename to src/DETHRACE/common/intrface.h diff --git a/src/DETHRACE/source/common/loading.c b/src/DETHRACE/common/loading.c similarity index 99% rename from src/DETHRACE/source/common/loading.c rename to src/DETHRACE/common/loading.c index 3577cbed..9dcbb950 100644 --- a/src/DETHRACE/source/common/loading.c +++ b/src/DETHRACE/common/loading.c @@ -17,7 +17,7 @@ int gCurrent_race_file_index; int gGroove_funk_offset; int gDemo_armour; int gDemo_rank; -int gDecode_thing; +int gDecode_thing = '@'; int gDemo_opponents[5]; int gDemo_power; int gDemo_offensive; diff --git a/src/DETHRACE/source/common/loading.h b/src/DETHRACE/common/loading.h similarity index 99% rename from src/DETHRACE/source/common/loading.h rename to src/DETHRACE/common/loading.h index eac205b3..abd97cd4 100644 --- a/src/DETHRACE/source/common/loading.h +++ b/src/DETHRACE/common/loading.h @@ -4,6 +4,8 @@ #include "dr_types.h" #include "br_types.h" +extern int gDecode_thing; + // Offset: 0 // Size: 67 // EAX: pF diff --git a/src/DETHRACE/source/common/loadsave.c b/src/DETHRACE/common/loadsave.c similarity index 100% rename from src/DETHRACE/source/common/loadsave.c rename to src/DETHRACE/common/loadsave.c diff --git a/src/DETHRACE/source/common/loadsave.h b/src/DETHRACE/common/loadsave.h similarity index 100% rename from src/DETHRACE/source/common/loadsave.h rename to src/DETHRACE/common/loadsave.h diff --git a/src/DETHRACE/source/common/main.c b/src/DETHRACE/common/main.c similarity index 100% rename from src/DETHRACE/source/common/main.c rename to src/DETHRACE/common/main.c diff --git a/src/DETHRACE/source/common/main.h b/src/DETHRACE/common/main.h similarity index 100% rename from src/DETHRACE/source/common/main.h rename to src/DETHRACE/common/main.h diff --git a/src/DETHRACE/source/common/mainloop.c b/src/DETHRACE/common/mainloop.c similarity index 100% rename from src/DETHRACE/source/common/mainloop.c rename to src/DETHRACE/common/mainloop.c diff --git a/src/DETHRACE/source/common/mainloop.h b/src/DETHRACE/common/mainloop.h similarity index 100% rename from src/DETHRACE/source/common/mainloop.h rename to src/DETHRACE/common/mainloop.h diff --git a/src/DETHRACE/source/common/mainmenu.c b/src/DETHRACE/common/mainmenu.c similarity index 100% rename from src/DETHRACE/source/common/mainmenu.c rename to src/DETHRACE/common/mainmenu.c diff --git a/src/DETHRACE/source/common/mainmenu.h b/src/DETHRACE/common/mainmenu.h similarity index 100% rename from src/DETHRACE/source/common/mainmenu.h rename to src/DETHRACE/common/mainmenu.h diff --git a/src/DETHRACE/source/common/netgame.c b/src/DETHRACE/common/netgame.c similarity index 100% rename from src/DETHRACE/source/common/netgame.c rename to src/DETHRACE/common/netgame.c diff --git a/src/DETHRACE/source/common/netgame.h b/src/DETHRACE/common/netgame.h similarity index 100% rename from src/DETHRACE/source/common/netgame.h rename to src/DETHRACE/common/netgame.h diff --git a/src/DETHRACE/source/common/network.c b/src/DETHRACE/common/network.c similarity index 100% rename from src/DETHRACE/source/common/network.c rename to src/DETHRACE/common/network.c diff --git a/src/DETHRACE/source/common/network.h b/src/DETHRACE/common/network.h similarity index 100% rename from src/DETHRACE/source/common/network.h rename to src/DETHRACE/common/network.h diff --git a/src/DETHRACE/source/common/newgame.c b/src/DETHRACE/common/newgame.c similarity index 100% rename from src/DETHRACE/source/common/newgame.c rename to src/DETHRACE/common/newgame.c diff --git a/src/DETHRACE/source/common/newgame.h b/src/DETHRACE/common/newgame.h similarity index 100% rename from src/DETHRACE/source/common/newgame.h rename to src/DETHRACE/common/newgame.h diff --git a/src/DETHRACE/source/common/oil.c b/src/DETHRACE/common/oil.c similarity index 100% rename from src/DETHRACE/source/common/oil.c rename to src/DETHRACE/common/oil.c diff --git a/src/DETHRACE/source/common/oil.h b/src/DETHRACE/common/oil.h similarity index 100% rename from src/DETHRACE/source/common/oil.h rename to src/DETHRACE/common/oil.h diff --git a/src/DETHRACE/source/common/oppocar.c b/src/DETHRACE/common/oppocar.c similarity index 100% rename from src/DETHRACE/source/common/oppocar.c rename to src/DETHRACE/common/oppocar.c diff --git a/src/DETHRACE/source/common/oppocar.h b/src/DETHRACE/common/oppocar.h similarity index 100% rename from src/DETHRACE/source/common/oppocar.h rename to src/DETHRACE/common/oppocar.h diff --git a/src/DETHRACE/source/common/opponent.c b/src/DETHRACE/common/opponent.c similarity index 100% rename from src/DETHRACE/source/common/opponent.c rename to src/DETHRACE/common/opponent.c diff --git a/src/DETHRACE/source/common/opponent.h b/src/DETHRACE/common/opponent.h similarity index 100% rename from src/DETHRACE/source/common/opponent.h rename to src/DETHRACE/common/opponent.h diff --git a/src/DETHRACE/source/common/oppoproc.c b/src/DETHRACE/common/oppoproc.c similarity index 100% rename from src/DETHRACE/source/common/oppoproc.c rename to src/DETHRACE/common/oppoproc.c diff --git a/src/DETHRACE/source/common/oppoproc.h b/src/DETHRACE/common/oppoproc.h similarity index 100% rename from src/DETHRACE/source/common/oppoproc.h rename to src/DETHRACE/common/oppoproc.h diff --git a/src/DETHRACE/source/common/options.c b/src/DETHRACE/common/options.c similarity index 100% rename from src/DETHRACE/source/common/options.c rename to src/DETHRACE/common/options.c diff --git a/src/DETHRACE/source/common/options.h b/src/DETHRACE/common/options.h similarity index 100% rename from src/DETHRACE/source/common/options.h rename to src/DETHRACE/common/options.h diff --git a/src/DETHRACE/source/common/pedestrn.c b/src/DETHRACE/common/pedestrn.c similarity index 100% rename from src/DETHRACE/source/common/pedestrn.c rename to src/DETHRACE/common/pedestrn.c diff --git a/src/DETHRACE/source/common/pedestrn.h b/src/DETHRACE/common/pedestrn.h similarity index 100% rename from src/DETHRACE/source/common/pedestrn.h rename to src/DETHRACE/common/pedestrn.h diff --git a/src/DETHRACE/source/common/piping.c b/src/DETHRACE/common/piping.c similarity index 100% rename from src/DETHRACE/source/common/piping.c rename to src/DETHRACE/common/piping.c diff --git a/src/DETHRACE/source/common/piping.h b/src/DETHRACE/common/piping.h similarity index 100% rename from src/DETHRACE/source/common/piping.h rename to src/DETHRACE/common/piping.h diff --git a/src/DETHRACE/source/common/powerup.c b/src/DETHRACE/common/powerup.c similarity index 100% rename from src/DETHRACE/source/common/powerup.c rename to src/DETHRACE/common/powerup.c diff --git a/src/DETHRACE/source/common/powerup.h b/src/DETHRACE/common/powerup.h similarity index 100% rename from src/DETHRACE/source/common/powerup.h rename to src/DETHRACE/common/powerup.h diff --git a/src/DETHRACE/source/common/pratcam.c b/src/DETHRACE/common/pratcam.c similarity index 100% rename from src/DETHRACE/source/common/pratcam.c rename to src/DETHRACE/common/pratcam.c diff --git a/src/DETHRACE/source/common/pratcam.h b/src/DETHRACE/common/pratcam.h similarity index 100% rename from src/DETHRACE/source/common/pratcam.h rename to src/DETHRACE/common/pratcam.h diff --git a/src/DETHRACE/source/common/racestrt.c b/src/DETHRACE/common/racestrt.c similarity index 100% rename from src/DETHRACE/source/common/racestrt.c rename to src/DETHRACE/common/racestrt.c diff --git a/src/DETHRACE/source/common/racestrt.h b/src/DETHRACE/common/racestrt.h similarity index 100% rename from src/DETHRACE/source/common/racestrt.h rename to src/DETHRACE/common/racestrt.h diff --git a/src/DETHRACE/source/common/racesumm.c b/src/DETHRACE/common/racesumm.c similarity index 100% rename from src/DETHRACE/source/common/racesumm.c rename to src/DETHRACE/common/racesumm.c diff --git a/src/DETHRACE/source/common/racesumm.h b/src/DETHRACE/common/racesumm.h similarity index 100% rename from src/DETHRACE/source/common/racesumm.h rename to src/DETHRACE/common/racesumm.h diff --git a/src/DETHRACE/source/common/raycast.c b/src/DETHRACE/common/raycast.c similarity index 100% rename from src/DETHRACE/source/common/raycast.c rename to src/DETHRACE/common/raycast.c diff --git a/src/DETHRACE/source/common/raycast.h b/src/DETHRACE/common/raycast.h similarity index 100% rename from src/DETHRACE/source/common/raycast.h rename to src/DETHRACE/common/raycast.h diff --git a/src/DETHRACE/source/common/replay.c b/src/DETHRACE/common/replay.c similarity index 100% rename from src/DETHRACE/source/common/replay.c rename to src/DETHRACE/common/replay.c diff --git a/src/DETHRACE/source/common/replay.h b/src/DETHRACE/common/replay.h similarity index 100% rename from src/DETHRACE/source/common/replay.h rename to src/DETHRACE/common/replay.h diff --git a/src/DETHRACE/source/common/skidmark.c b/src/DETHRACE/common/skidmark.c similarity index 100% rename from src/DETHRACE/source/common/skidmark.c rename to src/DETHRACE/common/skidmark.c diff --git a/src/DETHRACE/source/common/skidmark.h b/src/DETHRACE/common/skidmark.h similarity index 100% rename from src/DETHRACE/source/common/skidmark.h rename to src/DETHRACE/common/skidmark.h diff --git a/src/DETHRACE/source/common/sound.c b/src/DETHRACE/common/sound.c similarity index 100% rename from src/DETHRACE/source/common/sound.c rename to src/DETHRACE/common/sound.c diff --git a/src/DETHRACE/source/common/sound.h b/src/DETHRACE/common/sound.h similarity index 100% rename from src/DETHRACE/source/common/sound.h rename to src/DETHRACE/common/sound.h diff --git a/src/DETHRACE/source/common/spark.c b/src/DETHRACE/common/spark.c similarity index 100% rename from src/DETHRACE/source/common/spark.c rename to src/DETHRACE/common/spark.c diff --git a/src/DETHRACE/source/common/spark.h b/src/DETHRACE/common/spark.h similarity index 100% rename from src/DETHRACE/source/common/spark.h rename to src/DETHRACE/common/spark.h diff --git a/src/DETHRACE/source/common/structur.c b/src/DETHRACE/common/structur.c similarity index 100% rename from src/DETHRACE/source/common/structur.c rename to src/DETHRACE/common/structur.c diff --git a/src/DETHRACE/source/common/structur.h b/src/DETHRACE/common/structur.h similarity index 100% rename from src/DETHRACE/source/common/structur.h rename to src/DETHRACE/common/structur.h diff --git a/src/DETHRACE/source/common/trig.c b/src/DETHRACE/common/trig.c similarity index 100% rename from src/DETHRACE/source/common/trig.c rename to src/DETHRACE/common/trig.c diff --git a/src/DETHRACE/source/common/trig.h b/src/DETHRACE/common/trig.h similarity index 100% rename from src/DETHRACE/source/common/trig.h rename to src/DETHRACE/common/trig.h diff --git a/src/DETHRACE/source/common/utility.c b/src/DETHRACE/common/utility.c similarity index 99% rename from src/DETHRACE/source/common/utility.c rename to src/DETHRACE/common/utility.c index 683389e8..8b10899a 100644 --- a/src/DETHRACE/source/common/utility.c +++ b/src/DETHRACE/common/utility.c @@ -1,5 +1,13 @@ #include "utility.h" +#include "loading.h" +#include "errors.h" +#include "dossys.h" + +#include +#include +#include + tU32 gLong_key[4]; tU32 gOther_long_key[4]; char *gMisc_strings[250]; @@ -778,4 +786,3 @@ void BlendifyMaterialPrimitively(br_material *pMaterial, int pPercent) { // EDX: pPercent void BlendifyMaterial(br_material *pMaterial, int pPercent) { } - diff --git a/src/DETHRACE/source/common/utility.h b/src/DETHRACE/common/utility.h similarity index 100% rename from src/DETHRACE/source/common/utility.h rename to src/DETHRACE/common/utility.h diff --git a/src/DETHRACE/source/common/world.c b/src/DETHRACE/common/world.c similarity index 100% rename from src/DETHRACE/source/common/world.c rename to src/DETHRACE/common/world.c diff --git a/src/DETHRACE/source/common/world.h b/src/DETHRACE/common/world.h similarity index 100% rename from src/DETHRACE/source/common/world.h rename to src/DETHRACE/common/world.h diff --git a/src/types/dr_types.h b/src/DETHRACE/dr_types.h similarity index 92% rename from src/types/dr_types.h rename to src/DETHRACE/dr_types.h index 3834cb9d..db0179c4 100644 --- a/src/types/dr_types.h +++ b/src/DETHRACE/dr_types.h @@ -484,13 +484,14 @@ typedef void zs_order_table_traversal_cbfn(int, ot_vertex*, ot_vertex*, ot_verte typedef void tS3_outlet_callback(tS3_outlet_ptr, tS3_sound_tag, tS3_termination_reason); typedef void tS3_sample_filter(tS3_effect_tag, tS3_sound_tag); -typedef struct exception { +// Make gcc happy +typedef struct exception_ { int type; char *name; double arg1; double arg2; double retval; -} exception; +} exception_; typedef struct ot_vertex { br_scalar screenX; @@ -2401,39 +2402,6 @@ typedef struct tPixelmap_user_data { tU16 orig_height; } tPixelmap_user_data; -typedef struct fmt_vertex { - br_vector3 p; - br_vector2 map; - br_vector3 n; -} DR_VERTEX, fmt_vertex; - -typedef struct v11face { - br_uint_16 vertices[3]; - br_uint_16 edges[3]; - br_vector4 eqn; -} DR_FACE, v11face; - -typedef struct v11group { - void *stored; - DR_FACE *faces; - br_colour *face_colours; - br_uint_16 *face_user; - DR_VERTEX *vertices; - br_colour *vertex_colours; - br_uint_16 *vertex_user; - br_uint_16 nfaces; - br_uint_16 nvertices; - br_uint_16 nedges; -} v11group; - -typedef struct v11model { - br_size_t size; - br_uint_32 flags; - br_uint_16 ngroups; - br_vector3 pivot; - v11group *groups; -} v11model; - typedef struct tMatrix_and_actor { br_matrix34 *m; br_actor *a; @@ -4345,40 +4313,6 @@ typedef struct tRM_info { unsigned short SS; } tRM_info; -typedef enum dosio_event_type { - DOSIO_EVENT_KEY_DOWN = 0, - DOSIO_EVENT_KEY_UP = 1, - DOSIO_EVENT_POINTER1_DOWN = 2, - DOSIO_EVENT_POINTER1_UP = 3, - DOSIO_EVENT_POINTER2_DOWN = 4, - DOSIO_EVENT_POINTER2_UP = 5, - DOSIO_EVENT_POINTER3_DOWN = 6, - DOSIO_EVENT_POINTER3_UP = 7, - DOSIO_EVENT_POINTER_MOVE = 8, - DOSIO_EVENT_MAX = 9 -} dosio_event_type; - -typedef enum dosio_event_qual { - DOSIO_QUAL_SHIFT = 1, - DOSIO_QUAL_CONTROL = 2, - DOSIO_QUAL_ALT = 4 -} dosio_event_qual; - -typedef struct dosio_event { - br_uint_16 type; - br_uint_16 qualifiers; - br_uint_32 value_1; - br_uint_32 value_2; -} dosio_event; - -typedef struct dosio_event_queue { - br_uint_16 total; - br_uint_16 count; - br_uint_16 head; - br_uint_16 tail; - dosio_event slots[1]; -} dosio_event_queue; - typedef struct tMem_info { unsigned int largest_block_avail; unsigned int max_unlocked_page; @@ -4392,309 +4326,5 @@ typedef struct tMem_info { unsigned int reserved[3]; } tMem_info; -typedef struct pm_temp_edge { - struct pm_temp_edge *next; - br_uint_16 first; - br_uint_16 last; - char other; -} pm_temp_edge; - -typedef struct prep_vertex { - br_vector3 n; - br_uint_16 v; - br_uint_16 f; -} prep_vertex; - -typedef struct order_info { - br_uint_8 a0; - br_uint_8 a1; - br_uint_8 a2; - br_uint_8 _pad[1]; -} order_info; - -typedef struct transform_type { - br_uint_32 id; - br_file_struct *fs; -} transform_type; - -typedef struct resource_header { - br_simple_node node; - br_simple_list children; - br_uint_8 size_l; - br_uint_8 size_m; - br_uint_8 size_h; - br_uint_8 class; - void *magic_ptr; - int magic_num; -} resource_header; - -typedef struct host_real_memory { - br_uint_32 pm_off; - br_uint_16 pm_seg; - br_uint_16 _reserved; - br_uint_16 rm_off; - br_uint_16 rm_seg; -} host_real_memory; - -typedef struct host_regs { - struct { - br_uint_32 edi; - br_uint_32 esi; - br_uint_32 ebp; - br_uint_32 _res; - br_uint_32 ebx; - br_uint_32 edx; - br_uint_32 ecx; - br_uint_32 eax; - br_uint_16 flags; - br_uint_16 es; - br_uint_16 ds; - br_uint_16 fs; - br_uint_16 gs; - br_uint_16 ip; - br_uint_16 cs; - br_uint_16 sp; - br_uint_16 ss; - }a; - struct { - br_uint_16 di; - br_uint_16 _pad0; - br_uint_16 si; - br_uint_16 _pad1; - br_uint_16 bp; - br_uint_16 _pad2; - br_uint_16 _res; - br_uint_16 _pad3; - br_uint_16 bx; - br_uint_16 _pad4; - br_uint_16 dx; - br_uint_16 _pad5; - br_uint_16 cx; - br_uint_16 _pad6; - br_uint_16 ax; - br_uint_16 _pad7; - br_uint_16 flags; - br_uint_16 es; - br_uint_16 ds; - br_uint_16 fs; - br_uint_16 gs; - br_uint_16 ip; - br_uint_16 cs; - br_uint_16 sp; - br_uint_16 ss; - }b; - struct { - br_uint_32 _pad0[4]; - br_uint_8 bl; - br_uint_8 bh; - br_uint_8 _pad1; - br_uint_8 _pad2; - br_uint_8 dl; - br_uint_8 dh; - br_uint_8 _pad3; - br_uint_8 _pad4; - br_uint_8 cl; - br_uint_8 ch; - br_uint_8 _pad5; - br_uint_8 _pad6; - br_uint_8 al; - br_uint_8 ah; - br_uint_8 _pad7; - br_uint_8 _pad8; - }c; -} host_regs; - -typedef struct host_info { - br_uint_32 size; - char identifier[40]; - br_uint_32 capabilities; - br_token processor_family; - br_token processor_type; -} host_info; - -typedef struct file_info { - br_uint_32 type; - br_uint_32 version; -} file_info; - -typedef struct pm_type_info { - br_uint_16 bits; - br_uint_16 file_size; - br_uint_16 align; - br_uint_16 channels; -} pm_type_info; - -typedef struct match_tokens { - br_token use; - br_uint_8 pixel_type; - br_int_32 pixel_bits; - br_int_32 width; - br_int_32 height; - br_object *renderer; -} match_tokens; - -typedef struct object_list { - br_simple_list l; -} object_list; - -typedef struct object_list_entry { - br_simple_node n; - br_object *h; -} object_list_entry; - -typedef struct token_match { - br_token_value *original; - br_token_value *query; - br_int_32 n; - void *extra; - br_size_t extra_size; -} token_match; - -typedef struct token_type { - char *identifier; - br_token type; - int length; -} token_type; - -typedef struct export_directory { - br_uint_32 flags; - br_uint_32 timestamp; - br_uint_16 major_version; - br_uint_16 minor_version; - br_uint_32 name; - br_uint_32 ordinal_base; - br_uint_32 n_entries; - br_uint_32 n_names; - br_uint_32 export_table; - br_uint_32 name_table; - br_uint_32 ordinal_table; -} export_directory; - -typedef struct import_directory { - br_uint_32 lookup_table; - br_uint_32 timestamp; - br_uint_32 forwarder; - br_uint_32 name; - br_uint_32 address_table; -} import_directory; - -typedef struct basereloc_header { - br_uint_32 rva; - br_uint_32 size; -} basereloc_header; - -typedef struct msdos_header { - br_uint_16 magic; - br_uint_16 last_page_bytes; - br_uint_16 pages; - br_uint_16 n_relocations; - br_uint_16 header_size; - br_uint_16 minalloc; - br_uint_16 maxalloc; - br_uint_16 start_ss; - br_uint_16 start_sp; - br_uint_16 checksum; - br_uint_16 start_ip; - br_uint_16 start_cs; - br_uint_16 reloc_offset; - br_uint_16 overlay_number; - br_uint_16 _reserved0[4]; - br_uint_16 oem_id; - br_uint_16 oem_info; - br_uint_16 _reserved1[10]; - br_uint_32 new_header_offset; -} msdos_header; - -typedef struct coff_header { - br_uint_16 machine; - br_uint_16 n_sections; - br_uint_32 time_date; - br_uint_32 symbols_offset; - br_uint_32 n_symbols; - br_uint_16 opt_header_size; - br_uint_16 flags; -} coff_header; - -typedef struct nt_optional_header { - br_uint_16 magic; - br_uint_8 l_major; - br_uint_8 l_minor; - br_uint_32 code_size; - br_uint_32 data_size; - br_uint_32 bss_size; - br_uint_32 entry_point; - br_uint_32 code_base; - br_uint_32 data_base; - br_uint_32 image_base; - br_uint_32 section_alignment; - br_uint_32 file_alignment; - br_uint_16 os_major; - br_uint_16 os_minor; - br_uint_16 user_major; - br_uint_16 user_minor; - br_uint_16 subsys_major; - br_uint_16 subsys_minor; - br_uint_32 _reserved; - br_uint_32 image_size; - br_uint_32 header_size; - br_uint_32 file_checksum; - br_uint_16 subsystem; - br_uint_16 dll_flags; - br_uint_32 stack_reserve_size; - br_uint_32 stack_commit_size; - br_uint_32 heap_reserve_size; - br_uint_32 heap_commit_size; - br_uint_32 loader_flags; - br_uint_32 n_data_directories; - struct { - br_uint_32 rva; - br_uint_32 size; - }; -} nt_optional_header; - -typedef struct section_header { - br_uint_8 section_name[8]; - br_uint_32 virtual_size; - br_uint_32 rva; - br_uint_32 data_size; - br_uint_32 data_offset; - br_uint_32 relocs_offset; - br_uint_32 linenums_offset; - br_uint_16 n_relocs; - br_uint_16 n_linenums; - br_uint_32 flags; -} section_header; - -typedef struct host_interrupt_hook { - br_uint_8 vector; - br_boolean active; - br_uint_32 old_offset; - br_uint_16 old_sel; -} host_interrupt_hook; - -typedef struct host_exception_hook { - br_uint_8 exception; - br_boolean active; - br_uint_32 old_offset; - br_uint_16 old_sel; - br_uint_8 scratch[256]; -} host_exception_hook; - -typedef struct ldt { - unsigned long limit_0: 10; - unsigned long base_0: 10; - unsigned long base_1: 8; - unsigned long type: 4; - unsigned long application: 1; - unsigned long dpl: 2; - unsigned long present: 1; - unsigned long limit_1: 4; - unsigned long system: 1; - unsigned long reserved: 1; - unsigned long use32: 1; - unsigned long granularity: 1; - unsigned long base_2: 8; -} ldt; - #endif diff --git a/src/DETHRACE/source/pc-dos/dosnet.c b/src/DETHRACE/pc-dos/dosnet.c similarity index 100% rename from src/DETHRACE/source/pc-dos/dosnet.c rename to src/DETHRACE/pc-dos/dosnet.c diff --git a/src/DETHRACE/source/pc-dos/dosnet.h b/src/DETHRACE/pc-dos/dosnet.h similarity index 100% rename from src/DETHRACE/source/pc-dos/dosnet.h rename to src/DETHRACE/pc-dos/dosnet.h diff --git a/src/DETHRACE/source/pc-dos/dossys.c b/src/DETHRACE/pc-dos/dossys.c similarity index 98% rename from src/DETHRACE/source/pc-dos/dossys.c rename to src/DETHRACE/pc-dos/dossys.c index 985715a1..26a5a0b2 100644 --- a/src/DETHRACE/source/pc-dos/dossys.c +++ b/src/DETHRACE/pc-dos/dossys.c @@ -322,6 +322,9 @@ void PDGetMousePosition(int *pX_coord, int *pY_coord) { // Offset: 6272 // Size: 38 int PDGetTotalTime() { + struct timespec spec; + clock_gettime(CLOCK_MONOTONIC, &spec); + return spec.tv_sec * 1000 + spec.tv_nsec / 1000; } // Offset: 6312 @@ -413,7 +416,7 @@ void PDEndItAllAndReRunTheBastard() { // Offset: 7932 // Size: 57 // EAX: err -int matherr(exception *err) { +int matherr(struct exception_ *err) { } // Offset: 7992 diff --git a/src/DETHRACE/source/pc-dos/dossys.h b/src/DETHRACE/pc-dos/dossys.h similarity index 98% rename from src/DETHRACE/source/pc-dos/dossys.h rename to src/DETHRACE/pc-dos/dossys.h index a9a8abcf..3f1350f9 100644 --- a/src/DETHRACE/source/pc-dos/dossys.h +++ b/src/DETHRACE/pc-dos/dossys.h @@ -4,6 +4,11 @@ #include "dr_types.h" #include "br_types.h" +#include +#include +#include +#include + // Offset: 0 // Size: 291 void KeyboardHandler(); @@ -272,7 +277,7 @@ void PDEndItAllAndReRunTheBastard(); // Offset: 7932 // Size: 57 // EAX: err -int matherr(exception *err); +int matherr(struct exception_ *err); // Offset: 7992 // Size: 127