Skip to content

Commit

Permalink
Merge branch 'scripting'
Browse files Browse the repository at this point in the history
Conflicts:
	src/actor.h
	src/g_doom/a_doomweaps.cpp
	src/g_hexen/a_blastradius.cpp
	src/p_enemy.cpp
	src/p_enemy.h
	src/thingdef/thingdef.h
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/constants.txt
  • Loading branch information
rheit committed Feb 4, 2016
2 parents 56359b6 + c63f65d commit b3b0886
Show file tree
Hide file tree
Showing 230 changed files with 24,061 additions and 8,641 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -21,6 +21,9 @@
/src/xlat/xlat_parser.c
/src/xlat/xlat_parser.h
/src/xlat/xlat_parser.out
/src/zscript/zcc-parse.c
/src/zscript/zcc-parse.h
/src/zscript/zcc-parse.out
/tools/*/debug
/tools/*/release
/tools/*/*.exe
Expand Down
21 changes: 20 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -685,6 +685,12 @@ add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c ${CMAKE_CUR
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/xlat/xlat_parser.y )

add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.c ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.h
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/zscript/zcc-parse.lemon .
COMMAND lemon zcc-parse.lemon
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/zscript/zcc-parse.lemon )

add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h
COMMAND re2c --no-generation-date -s -o ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h ${CMAKE_CURRENT_SOURCE_DIR}/sc_man_scanner.re
DEPENDS re2c ${CMAKE_CURRENT_SOURCE_DIR}/sc_man_scanner.re )
Expand Down Expand Up @@ -751,6 +757,7 @@ file( GLOB HEADER_FILES
textures/*.h
thingdef/*.h
xlat/*.h
zscript/*.h
*.h
)

Expand Down Expand Up @@ -837,6 +844,9 @@ set( NOT_COMPILED_SOURCE_FILES
xlat/xlat_parser.y
xlat_parser.c
xlat_parser.h
zscript/zcc-parse.lemon
zcc-parse.c
zcc-parse.h

# We could have the ASM macro add these files, but it wouldn't add all
# platforms.
Expand Down Expand Up @@ -1136,7 +1146,6 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
thingdef/thingdef_data.cpp
thingdef/thingdef_exp.cpp
thingdef/thingdef_expression.cpp
thingdef/thingdef_function.cpp
thingdef/thingdef_parse.cpp
thingdef/thingdef_properties.cpp
thingdef/thingdef_states.cpp
Expand Down Expand Up @@ -1171,6 +1180,14 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
r_data/renderstyle.cpp
r_data/r_interpolate.cpp
r_data/r_translate.cpp
zscript/ast.cpp
zscript/vmbuilder.cpp
zscript/vmdisasm.cpp
zscript/vmexec.cpp
zscript/vmframe.cpp
zscript/zcc_compile.cpp
zscript/zcc_expr.cpp
zscript/zcc_parser.cpp
zzautozend.cpp
)

Expand All @@ -1197,6 +1214,7 @@ include_directories( .
thingdef
timidity
xlat
zscript
../gdtoa
../dumb/include
${CMAKE_BINARY_DIR}/gdtoa
Expand Down Expand Up @@ -1318,4 +1336,5 @@ source_group("Shared Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_sh
source_group("Versioning" FILES version.h win32/zdoom.rc)
source_group("Win32 Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/win32/.+")
source_group("Xlat" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/xlat/.+" FILES ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.h)
source_group("ZScript" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/zscript/.+")
source_group("Source Files" FILES ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h sc_man_scanner.re)
42 changes: 24 additions & 18 deletions src/__autostart.cpp
Expand Up @@ -46,24 +46,26 @@

#if defined(_MSC_VER)

#pragma comment(linker, "/merge:.areg=.data /merge:.creg=.data /merge:.greg=.data /merge:.mreg=.data /merge:.yreg=.data")
// The various reg sections are used to group pointers spread across multiple
// source files into cohesive arrays in the final executable. We don't
// actually care about these sections themselves and merge them all into
// a single section during the final link. (.rdata is the standard section
// for initialized read-only data.)

#pragma data_seg(".areg$a")
void *ARegHead = 0;
#pragma comment(linker, "/merge:.areg=.rdata /merge:.creg=.rdata /merge:.greg=.rdata")
#pragma comment(linker, "/merge:.yreg=.rdata")

#pragma data_seg(".creg$a")
void *CRegHead = 0;
#pragma section(".areg$a",read)
__declspec(allocate(".areg$a")) void *const ARegHead = 0;

#pragma data_seg(".greg$a")
void *GRegHead = 0;
#pragma section(".creg$a",read)
__declspec(allocate(".creg$a")) void *const CRegHead = 0;

#pragma data_seg(".mreg$a")
void *MRegHead = 0;
#pragma section(".greg$a",read)
__declspec(allocate(".greg$a")) void *const GRegHead = 0;

#pragma data_seg(".yreg$a")
void *YRegHead = 0;

#pragma data_seg()
#pragma section(".yreg$a",read)
__declspec(allocate(".yreg$a")) void *const YRegHead = 0;

// We want visual styles support under XP
#if defined _M_IX86
Expand All @@ -88,11 +90,15 @@ void *YRegHead = 0;

#include "doomtype.h"

void *ARegHead __attribute__((section(SECTION_AREG))) = 0;
void *CRegHead __attribute__((section(SECTION_CREG))) = 0;
void *GRegHead __attribute__((section(SECTION_GREG))) = 0;
void *MRegHead __attribute__((section(SECTION_MREG))) = 0;
void *YRegHead __attribute__((section(SECTION_YREG))) = 0;
// I don't know of an easy way to merge sections together with the GNU linker,
// so GCC users will see all of these sections appear in the final executable.
// (There are linker scripts, but that apparently involves extracting the
// default script from ld and then modifying it.)

void *const ARegHead __attribute__((section(SECTION_AREG))) = 0;
void *const CRegHead __attribute__((section(SECTION_CREG))) = 0;
void *const GRegHead __attribute__((section(SECTION_GREG))) = 0;
void *const YRegHead __attribute__((section(SECTION_YREG))) = 0;

#else

Expand Down

0 comments on commit b3b0886

Please sign in to comment.