diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 4057c61a1..1d667c6ee 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -78,10 +78,9 @@ ifeq ($(PLATFORM),WINDOWS) endif else ifeq ($(PLATFORM),LINUX) - LIBS+= -ldl -pthread - else - LIBS+= -pthread + LIBS+= -ldl endif + LIBS+= -pthread ifneq (0,$(PROFILER)) ifneq ($(PLATFORM),DARWIN) LIBS+= -lprofiler @@ -199,8 +198,6 @@ ifeq ($(PLATFORM),LINUX) endif ifeq ($(PLATFORM),WII) - STRIP=powerpc-eabi-strip - OURCFLAGS += -g -mcpu=750 -meabi -mhard-float -msdata -O2 -I$(LIBOGC_INC) -I$(PORTLIBS)/include -DGEKKO LIBS += -L$(LIBOGC_LIB) -L$(PORTLIBS)/lib -lvorbisidec -lfreetype -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard endif @@ -296,7 +293,8 @@ ifneq (0,$(PROFILER)) OURLDFLAGS+=-pg endif ifeq ($(PLATFORM),WII) - MISCLINKOPTS+= -g -mrvl -meabi -mhard-float -msdata -Wl,--gc-sections -Wl,-Map,$(notdir $@).map + OURLDFLAGS+= -mrvl -meabi -mhard-float -Wl,--gc-sections -Wl,-Map,$(notdir $@).map + # -msdata=eabi endif ifeq ($(PRETTY_OUTPUT),1) @@ -304,14 +302,23 @@ ifeq ($(PRETTY_OUTPUT),1) endif .PHONY: clean all engine $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB) +EDUKE32_TARGET:=eduke32$(EXESUFFIX) +ifneq ($(PLATFORM),WII) + MAPSTER32_TARGET:=mapster32$(EXESUFFIX) +endif + # TARGETS -all: notice eduke32$(EXESUFFIX) mapster32$(EXESUFFIX) $(EBACKTRACEDLL_TARGET) +all: notice $(EDUKE32_TARGET) $(MAPSTER32_TARGET) $(EBACKTRACEDLL_TARGET) all: $(BUILD_FINISHED) - @ls -l eduke32$(EXESUFFIX) - @ls -l mapster32$(EXESUFFIX) +ifneq (,$(EDUKE32_TARGET)) + @ls -l $(EDUKE32_TARGET) +endif +ifneq (,$(MAPSTER32_TARGET)) + @ls -l $(MAPSTER32_TARGET) +endif notice: $(BUILD_STARTED) @@ -321,13 +328,15 @@ eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLI if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -o $@ $^ $(OURLDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi ifeq (1,$(RELEASE)) ifeq (0,$(DEBUGANYWAY)) - $(STRIP) eduke32$(EXESUFFIX) + ifneq ($(PLATFORM),WII) + $(STRIP) $(EDUKE32_TARGET) + endif endif endif ifeq ($(PLATFORM),DARWIN) cp -RPf "Apple/bundles/EDuke32.app" "./" mkdir -p "EDuke32.app/Contents/MacOS" - cp -f "eduke32$(EXESUFFIX)" "EDuke32.app/Contents/MacOS/" + cp -f "$(EDUKE32_TARGET)" "EDuke32.app/Contents/MacOS/" endif mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) @@ -335,13 +344,15 @@ mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB) $ if $(CC) $(OURCONLYFLAGS) $(OURCFLAGS) -o $@ $^ $(OURLDFLAGS) $(LIBS) $(STATICSTDCPP) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi ifeq (1,$(RELEASE)) ifeq (0,$(DEBUGANYWAY)) - $(STRIP) mapster32$(EXESUFFIX) + ifneq ($(PLATFORM),WII) + $(STRIP) $(MAPSTER32_TARGET) + endif endif endif ifeq ($(PLATFORM),DARWIN) cp -RPf "Apple/bundles/Mapster32.app" "./" mkdir -p "Mapster32.app/Contents/MacOS" - cp -f "mapster32$(EXESUFFIX)" "Mapster32.app/Contents/MacOS/" + cp -f "$(MAPSTER32_TARGET)" "Mapster32.app/Contents/MacOS/" endif include Makefile.deps diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index e4b7837b2..0fd3d52aa 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -91,6 +91,11 @@ BASECXXFLAGS= -fno-exceptions -fno-rtti BASEASFLAGS=-s #-g BASELDFLAGS= +ifeq ($(PLATFORM),WII) + override USE_LIBPNG = 0 + override USE_LIBVPX = 0 +endif + LIBS=-lm ifneq (0,$(USE_LIBPNG)) LIBS+= -lpng -lz @@ -105,6 +110,8 @@ ifneq ($(RELEASE)$(DEBUGANYWAY),10) # debug build or DEBUGANYWAY=1 --> -g flag ifneq (0,$(CLANG)) debug=-g + else ifeq ($(PLATFORM), WII) + debug=-g else debug=-ggdb endif diff --git a/polymer/eduke32/Wii/apps/eduke32/icon.png b/polymer/eduke32/Wii/apps/eduke32/icon.png new file mode 100644 index 000000000..1d3f36555 Binary files /dev/null and b/polymer/eduke32/Wii/apps/eduke32/icon.png differ diff --git a/polymer/eduke32/Wii/meta_1.xml b/polymer/eduke32/Wii/meta_1.xml new file mode 100644 index 000000000..16059eb87 --- /dev/null +++ b/polymer/eduke32/Wii/meta_1.xml @@ -0,0 +1,4 @@ + + + EDuke32 Wii + EDuke32 Team diff --git a/polymer/eduke32/Wii/meta_2.xml b/polymer/eduke32/Wii/meta_2.xml new file mode 100644 index 000000000..9d18129bf --- /dev/null +++ b/polymer/eduke32/Wii/meta_2.xml @@ -0,0 +1,6 @@ + Duke Nukem 3D + EDuke32 is an awesome, free homebrew game engine and source port of the classic PC first person shooter Duke Nukem 3D--Duke3D for short. We've added thousands of cool and useful features and upgrades for regular players and additional editing capabilities and scripting extensions for homebrew developers and mod creators. EDuke32 is completely free, open source software. EDuke32 is licensed under the GNU GPL and the BUILD license. http://eduke32.com/ + + + + diff --git a/polymer/eduke32/build/Makefile.shared b/polymer/eduke32/build/Makefile.shared index 13c47a24f..016ea02b0 100644 --- a/polymer/eduke32/build/Makefile.shared +++ b/polymer/eduke32/build/Makefile.shared @@ -162,10 +162,24 @@ ifeq ($(PLATFORM),SKYOS) LIBS+= -lSDL -lnet endif ifeq ($(PLATFORM),WII) + ifeq ($(strip $(DEVKITPPC)),) + $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") + endif + + include $(DEVKITPPC)/wii_rules + + RANLIB=powerpc-eabi-ranlib + STRIP=powerpc-eabi-strip + RENDERTYPE=SDL EXESUFFIX=.elf + override USE_OPENGL=0 + override NOASM=1 override WITHOUT_GTK=1 - BUILDCFLAGS+= -g -mcpu=750 -meabi -mhard-float -msdata -O2 -DGEKKO -DHAVE_INTTYPES -D__POWERPC__ -I$(LIBOGC_INC) -I$(LIBOGC_INC)/SDL + # -msdata=eabi + BUILDCFLAGS+= -g -mtune=750 -meabi -mhard-float \ + -DGEKKO -DHAVE_INTTYPES -D__POWERPC__ \ + -I$(LIBOGC_INC) -I$(LIBOGC_INC)/SDL -I$(PORTLIBS)/include SDLCONFIG= LIBS+= -lSDL_mixer -lsmpeg -lSDL -laesnd endif @@ -262,7 +276,10 @@ endif ifneq ($(PLATFORM),WINDOWS) - LIBS+= -ldl -pthread + ifneq ($(PLATFORM),WII) + LIBS+= -ldl + endif + LIBS+= -pthread endif ifeq ($(PLATFORM),WINDOWS) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index f81ef53f6..6b20981e3 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -248,7 +248,10 @@ static int32_t osdcmd_restartvid(const osdfuncparm_t *parm) static int32_t osdcmd_vidmode(const osdfuncparm_t *parm) { - int32_t newx = xdim, newy = ydim, newbpp = bpp, newfullscreen = fullscreen, tmp; + int32_t newx = xdim, newy = ydim, newbpp = bpp, newfullscreen = fullscreen; +#ifdef USE_OPENGL + int32_t tmp; +#endif switch (parm->numparms) { diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 9515870ce..7b1a3b3c4 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -7766,7 +7766,11 @@ static inline int32_t raytrace(int32_t x3, int32_t y3, int32_t *x4, int32_t *y4) // Exported Engine Functions // -#if !defined _WIN32 && defined DEBUGGINGAIDS +#if !defined _WIN32 && defined DEBUGGINGAIDS && !defined GEKKO +#ifdef GEKKO +#define __rtems__ +#define _POSIX_REALTIME_SIGNALS +#endif #include static void sighandler(int32_t sig, const siginfo_t *info, void *ctx) { @@ -7917,7 +7921,7 @@ int32_t initengine(void) { int32_t i, j; -#if !defined _WIN32 && defined DEBUGGINGAIDS +#if !defined _WIN32 && defined DEBUGGINGAIDS && !defined GEKKO struct sigaction sigact, oldact; memset(&sigact, 0, sizeof(sigact)); sigact.sa_sigaction = (void *)sighandler; diff --git a/polymer/eduke32/psd/wii-hbc-icon.xcf b/polymer/eduke32/psd/wii-hbc-icon.xcf new file mode 100644 index 000000000..d31eabcfc Binary files /dev/null and b/polymer/eduke32/psd/wii-hbc-icon.xcf differ diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index f3d388835..c5afcb93b 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -2685,12 +2685,12 @@ void G_DisplayRest(int32_t smoothratio) { if (pp->palette == WATERPAL) { - static palette_t wp = { 224, 192, 255, 0 }; + static const palette_t wp = { 224, 192, 255, 0 }; Bmemcpy(&hictinting[MAXPALOOKUPS-1], &wp, sizeof(palette_t)); } else if (pp->palette == SLIMEPAL) { - static palette_t sp = { 208, 255, 192, 0 }; + static const palette_t sp = { 208, 255, 192, 0 }; Bmemcpy(&hictinting[MAXPALOOKUPS-1], &sp, sizeof(palette_t)); } else @@ -10616,12 +10616,13 @@ MAIN_LOOP_RESTART: // stdin -> OSD input for dedicated server if (g_networkMode == NET_DEDICATED_SERVER) { - int32_t nb, flag = 1; + int32_t nb; char ch; static uint32_t bufpos = 0; static char buf[128]; #ifndef GEKKO + int32_t flag = 1; ioctl(0, FIONBIO, &flag); #endif diff --git a/polymer/eduke32/wiibuild.bat b/polymer/eduke32/wiibuild.bat new file mode 100644 index 000000000..926553a1a --- /dev/null +++ b/polymer/eduke32/wiibuild.bat @@ -0,0 +1,36 @@ +@echo off +setlocal ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION + +set PATH=C:\devkitPro\devkitPPC\bin;C:\devkitPro\msys\bin;C:\MinGW\bin;C:\MinGW\msys\1.0\bin;%PATH% + +:: Detect versioning systems and pull the revision number: +for /f "delims=" %%G in ('svn info 2^>^&1 ^| grep Revision ^| cut -d " " -f 2') do @set rev=r%%G +if not "%rev%"=="" set vc=svn +if "%rev%"=="" for /f "delims=" %%G in ('git svn info 2^>^&1 ^| grep Revision ^| cut -d " " -f 2') do @set rev=r%%G +if not "%rev%"=="" set vc=git +if "%rev%"=="" set vc=none +if not "%rev%"=="" echo const char *s_buildRev = "%rev%";>source\rev.h +if "%rev%"=="" set rev=rXXXX + +:: Get the current date: +for /f "delims=" %%G in ('"C:\MinGW\msys\1.0\bin\date.exe" +%%Y%%m%%d') do @set currentdate=%%G + +:: Build: +set buildparameters=PLATFORM=WII %* + +make veryclean %buildparameters% +make OPTLEVEL=2 LTO=0 %buildparameters% + +:: Package data: +xcopy /e /q /y Wii\apps apps\ +for %%G in (eduke32) do for %%H in (.elf) do if exist "%%~G%%~H" move /y "%%~G%%~H" "apps\%%~G\boot%%~H" +for %%G in (eduke32) do for %%H in (.elf.map) do if exist "%%~G%%~H" del /f /q "%%~G%%~H" +"echo.exe" -e " %rev%\n %currentdate%" | "cat.exe" Wii\meta_1.xml - Wii\meta_2.xml >"apps\eduke32\meta.xml" +if exist "*.txt" copy /y "*.txt" "apps\eduke32\" +"ls.exe" -l -R apps + +:: Clean up revision number: +if "%vc%"=="svn" svn revert source\rev.h +if "%vc%"=="git" git checkout source\rev.h + +endlocal