Skip to content

Commit

Permalink
Re-setup the build process to build a release using 32-bit DH-ACC sin…
Browse files Browse the repository at this point in the history
…ce it doesn't have heap corruption issues
  • Loading branch information
Kyle873 committed Oct 30, 2014
1 parent 18593ab commit f14f47d
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 4 deletions.
8 changes: 4 additions & 4 deletions DoomRPG/_compile.bat
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
@echo off
color F

set PATH=..\Utilities\DH-ACC
set PATH=..\Utilities\DH-ACC\bin\64
set SRC=.\scripts
set OBJ=.\acs
set ACC=DH-acc --named-scripts --near-pointers --use-chunk-ATAG --debug-error-pos -D__LIBDS_HEAPSIZE=128 --debug-static-list=DebugStaticList.log --debug-mapregister-list=MapVars.log --debug-maparray-list=MapArrays.log --script-regargs=4 -Z -i %SRC%\inc -i %SRC%\lib

rem Standard Libraries
echo Compiling Standard Libraries
echo - stdlib
%ACC% -c %PATH%/lib/stdlib.ds -o %OBJ%\stdlib.o
%ACC% -c %PATH%\..\..\lib\stdlib.ds -o %OBJ%\stdlib.o
echo - stdio
%ACC% -c %PATH%/lib/stdio.ds -o %OBJ%\stdio.o
%ACC% -c %PATH%\..\..\lib\stdio.ds -o %OBJ%\stdio.o
echo - string
%ACC% -c %PATH%/lib/string.ds -o %OBJ%\string.o
%ACC% -c %PATH%\..\..\lib\string.ds -o %OBJ%\string.o

echo Linking LibDS.lib
%ACC% %OBJ%\stdlib.o %OBJ%\stdio.o %OBJ%\string.o -o %OBJ%\LibDS.lib
Expand Down
88 changes: 88 additions & 0 deletions DoomRPG/_compile_release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
@echo off
color F

set PATH=..\Utilities\DH-ACC\bin\32
set SRC=.\scripts
set OBJ=.\acs
set ACC=DH-acc --named-scripts --near-pointers --use-chunk-ATAG --debug-error-pos -D__LIBDS_HEAPSIZE=128 --debug-static-list=DebugStaticList.log --debug-mapregister-list=MapVars.log --debug-maparray-list=MapArrays.log --script-regargs=4 -Z -i %SRC%\inc -i %SRC%\lib

rem Standard Libraries
echo Compiling Standard Libraries
echo - stdlib
%ACC% -c %PATH%\..\..\lib\stdlib.ds -o %OBJ%\stdlib.o
echo - stdio
%ACC% -c %PATH%\..\..\lib\stdio.ds -o %OBJ%\stdio.o
echo - string
%ACC% -c %PATH%\..\..\lib\string.ds -o %OBJ%\string.o

echo Linking LibDS.lib
%ACC% %OBJ%\stdlib.o %OBJ%\stdio.o %OBJ%\string.o -o %OBJ%\LibDS.lib

rem Change the stack offset so we don't overlap with the standard library
set ACC=%ACC% --static-offset=16842752

rem Doom RPG Libraries
echo Compiling Doom RPG Libraries
echo - BitIO
%ACC% -c %SRC%/lib/BitIO.c -o %OBJ%\BitIO.o

rem Doom RPG Modules
echo Compiling Doom RPG
echo - Arena
%ACC% -c %SRC%\Arena.ds -o %OBJ%\Arena.o
echo - Augs
%ACC% -c %SRC%\Augs.ds -o %OBJ%\Augs.o
rem echo - GUI
rem %ACC% -c %SRC%\GUI.ds -o %OBJ%\GUI.o
rem echo - GUIMenu
rem %ACC% -c %SRC%\GUIMenu.ds -o %OBJ%\GUIMenu.o
echo - HealthBars
%ACC% -c %SRC%\HealthBars.ds -o %OBJ%\HealthBars.o
echo - HUD
%ACC% -c %SRC%\HUD.ds -o %OBJ%\HUD.o
echo - ItemData
%ACC% -c %SRC%\ItemData.ds -o %OBJ%\ItemData.o
echo - Map
%ACC% -c %SRC%\Map.ds -o %OBJ%\Map.o
echo - Menu
%ACC% -c %SRC%\Menu.ds -o %OBJ%\Menu.o
echo - Minigame
%ACC% -c %SRC%\Minigame.ds -o %OBJ%\Minigame.o
echo - Mission
%ACC% -c %SRC%\Mission.ds -o %OBJ%\Mission.o
echo - Monsters
%ACC% -c %SRC%\Monsters.ds -o %OBJ%\Monsters.o
echo - Namegen
%ACC% -c %SRC%\Namegen.ds -o %OBJ%\Namegen.o
echo - Outpost
%ACC% -c %SRC%\Outpost.ds -o %OBJ%\Outpost.o
echo - Password
%ACC% -c %SRC%\Password.ds -o %OBJ%\Password.o
echo - Popoffs
%ACC% -c %SRC%\Popoffs.ds -o %OBJ%\Popoffs.o
echo - RPG
%ACC% -c %SRC%\RPG.ds -o %OBJ%\RPG.o
echo - Shield
%ACC% -c %SRC%\Shield.ds -o %OBJ%\Shield.o
echo - Shop
%ACC% -c %SRC%\Shop.ds -o %OBJ%\Shop.o
echo - Skills
%ACC% -c %SRC%\Skills.ds -o %OBJ%\Skills.o
echo - Stats
%ACC% -c %SRC%\Stats.ds -o %OBJ%\Stats.o
echo - Stims
%ACC% -c %SRC%\Stims.ds -o %OBJ%\Stims.o
echo - Turret
%ACC% -c %SRC%\Turret.ds -o %OBJ%\Turret.o
echo - Utils
%ACC% -c %SRC%\Utils.ds -o %OBJ%\Utils.o

echo Linking RPG.lib
%ACC% %OBJ%\BitIO.o %OBJ%\Arena.o %OBJ%\Augs.o %OBJ%\HealthBars.o %OBJ%\HUD.o %OBJ%\ItemData.o %OBJ%\Map.o %OBJ%\Menu.o %OBJ%\Minigame.o %OBJ%\Mission.o %OBJ%\Monsters.o %OBJ%\Namegen.o %OBJ%\Outpost.o %OBJ%\Password.o %OBJ%\Popoffs.o %OBJ%\RPG.o %OBJ%\Shield.o %OBJ%\Shop.o %OBJ%\Skills.o %OBJ%\Stats.o %OBJ%\Stims.o %OBJ%\Turret.o %OBJ%\Utils.o -o %OBJ%\RPG.lib

echo Cleaning up Object Files
del %OBJ%\*.o

echo Done!

pause >nul
Binary file modified DoomRPG/acs/LibDS.lib
Binary file not shown.
Binary file modified DoomRPG/acs/RPG.lib
Binary file not shown.
Binary file added Utilities/DH-ACC/bin/32/DH-acc.exe
Binary file not shown.
File renamed without changes.
Binary file added Utilities/DH-ACC/bin/32/libstdc++-6.dll
Binary file not shown.
Binary file added Utilities/DH-ACC/bin/32/libwinpthread-1.dll
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added Utilities/DH-ACC/bin/64/libgcc_s_sjlj-1.dll
Binary file not shown.
File renamed without changes.
File renamed without changes.
40 changes: 40 additions & 0 deletions Utilities/DH-ACC/inc/shortcuts.dh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#ifndef __SHORTCUTS_DH__
#define __SHORTCUTS_DH__

#include "ds_def.h"

#define acscript __extscript "ACS"
#define acsfunc __extfunc "ACS"

// Script types (World-activated)
#define closed __closed
#define open __open
#define lightning __lightning
#define disconnect __disconnect
#define unloading __unloading
// (Player-activated)
#define player_enter __enter
#define player_return __return
#define player_respawn __respawn
#define player_death __death
// (Script flags)
#define net __net
#define clientside __clientside

// Pointer types
#define func_ptr __func_t
#define script_ptr __script_t

// Functions
#define HudMessage __printf<__printf_hud>
#define HudMessageBold __printf<__printf_hud_bold>
#define Log __printf<__printf_log>
#define Print __printf<__printf_print>
#define PrintBold __printf<__printf_bold>
#define FormatString __printf<__printf_string>

// Macros
#define MALLOCTYPE(TYPE) ((TYPE *)(malloc (sizeof (TYPE))))
#define CALLOCTYPE(NUMITEMS,TYPE) ((TYPE *)(calloc (NUMITEMS, sizeof (TYPE))))

#endif // __SHORTCUTS_DH__

0 comments on commit f14f47d

Please sign in to comment.