diff --git a/Makefile b/Makefile
index adf4d240..09f95ac3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+RELEASE_BUILD := 1
+CHANNEL_BUILD := 0
+
#-------------------------------------------------------------------------------
.SUFFIXES:
#-------------------------------------------------------------------------------
@@ -54,7 +57,7 @@ INCLUDES := $(SOURCES) \
#-------------------------------------------------------------------------------
# options for code generation
#-------------------------------------------------------------------------------
-CFLAGS := -g -Wall -O2 -ffunction-sections -Wno-strict-aliasing \
+CFLAGS := -Wall -O2 -ffunction-sections -Wno-strict-aliasing \
-Wno-unknown-pragmas -Wno-parentheses -Wno-sign-compare -Wno-stringop-truncation -Wno-unused-variable \
$(MACHDEP)
@@ -62,8 +65,20 @@ CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ -DLIBRW -DAUDIO_OAL -DrwBIGENDIAN -DBI
CXXFLAGS := $(CFLAGS)
-ASFLAGS := -g $(ARCH)
-LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map)
+ASFLAGS := $(ARCH)
+LDFLAGS = $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map)
+
+ifeq ($(RELEASE_BUILD), 0)
+ CFLAGS += -g -D_DEBUG_BUILD_
+ CXXFLAGS += -g -D_DEBUG_BUILD_
+ ASFLAGS += -g
+ LDFLAGS += -g
+endif
+
+ifeq ($(CHANNEL_BUILD), 1)
+ CFLAGS += -DWIIU_CHANNEL
+ CXXFLAGS += -DWIIU_CHANNEL
+endif
LIBS := -lrw -lmpg123 -lsndfile -lopenal -lSDL2 -lwut
@@ -121,7 +136,7 @@ export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
.PHONY: $(BUILD) clean vendor all
#-------------------------------------------------------------------------------
-all: vendor $(BUILD)
+all: $(BUILD)
vendor:
@echo Building librw
@@ -129,7 +144,7 @@ vendor:
@echo Building openal-soft
@$(MAKE) --no-print-directory -C $(TOPDIR)/vendor/openal-soft
-$(BUILD):
+$(BUILD): | vendor
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
diff --git a/README.md b/README.md
index 29f2529e..a25c3f7a 100644
--- a/README.md
+++ b/README.md
@@ -1,56 +1,13 @@
-
+# re3-wiiu
+
-[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FGTAmodding%2Fre3%2Fbadge%3Fref%3Dmaster&style=flat)](https://actions-badge.atrox.dev/GTAmodding/re3/goto?ref=master)
-
+This is a port of GTA III to the Nintendo Wii U.
-## Intro
-
-The aim of this project is to reverse GTA III for PC by replacing
-parts of the game [one by one](https://en.wikipedia.org/wiki/Ship_of_Theseus)
-such that we have a working game at all times.
-
-## How can I try it?
-
-- re3 requires game assets to work, so you **must** own [a copy of GTA III](https://store.steampowered.com/app/12100/Grand_Theft_Auto_III/).
-- Build re3 or download it from one of the above links (Debug or Release).
-- (Optional) If you want to use optional features like Russian language or menu map, copy the files in /gamefiles folder to your game root folder.
-- Move re3.exe to GTA 3 directory and run it.
-
-## Preparing the environment for building
-
-You may want to point GTA_III_RE_DIR environment variable to GTA3 root folder if you want executable to be moved there via post-build script.
-
-- For Linux, proceed: [Building on Linux](https://github.com/GTAmodding/re3/wiki/Building-on-Linux)
-- For FreeBSD, proceed: [Building on FreeBSD](https://github.com/GTAmodding/re3/wiki/Building-on-FreeBSD)
-- For Windows, assuming you have Visual Studio:
- - Clone the repo using the argument `--recursive`.
- - Run one of the `premake-vsXXXX.cmd` variants on root folder.
- - Open the project via Visual Studio
-
-**If you use 64-bit D3D9**: We don't ship 64-bit Dx9 SDK. You need to download it from Microsoft if you don't have it(although it should come pre-installed after some Windows version)
-
-There are various settings at the very bottom of [config.h](https://github.com/GTAmodding/re3/tree/master/src/core/config.h), you may want to take a look there. i.e. FIX_BUGS define fixes the bugs we've come across.
-
-> :information_source: **If you choose OpenAL on Windows** You must read [Running OpenAL build on Windows](https://github.com/GTAmodding/re3/wiki/Running-OpenAL-build-on-Windows).
-
-> :information_source: **Did you notice librw?** re3 uses completely homebrew RenderWare-replacement rendering engine; [librw](https://github.com/aap/librw/). librw comes as submodule of re3, but you also can use LIBRW enviorenment variable to specify path to your own librw.
-
-## Contributing
-Please read the [Coding Style](https://github.com/GTAmodding/re3/blob/master/CODING_STYLE.md) Document
-
-### Unreversed / incomplete classes (at least the ones we know)
-The following classes have only unused or practically unused code left:
-```
-NameGrid.cpp - only on mobile (a player name grid, either a very early player name code ala GTA1 or a multiplayer leftover)
-PedDebug.cpp - only on mobile (debug code)
-HandlingMgr.cpp - debug functions from mobile
-CFormationInfo - unused PedAI class that could be found on mobile
-CVehicle::ProcessBikeWheel - early bike code (only on mobile)
-CAutomobile::DebugCode - debug function from mobile
-CBoat::DebugCode - debug function from mobile
-CBoat::ModifyHandlingValue - debug function from mobile
-CBoat::DisplayHandlingData - debug function from mobile
-CStreaming::PrintRequestList - debug function from mobile
-d3d8raster.c - only on PC (slight RW modification that we don't actually need)
-```
+## Instructions
+## Building
+To build this project make sure you install the requried packages:
+`(dkp-)pacman -S ppc-mpg123 wiiu-sdl2 wut`
+You also need to build [libsndfile](https://github.com/libsndfile/libsndfile). To configure libsndfile for the Wii U take a look at this gist: https://gist.github.com/GaryOderNichts/475edaf03ff08ba100840608f92eade8
+Then clone this repo using `git clone --recursive https://github.com/GaryOderNichts/re3` and build using `make`.
+To build the channel edit `CHANNEL_BUILD := 0` to `CHANNEL_BUILD := 1` in the `Makefile`.
\ No newline at end of file
diff --git a/src/core/config.h b/src/core/config.h
index c282ed20..2d739896 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -150,7 +150,7 @@ enum Config {
// This is enabled for all released games except mobile
// any debug stuff that is only left in mobile, is not in MASTER
-//#define MASTER
+#define MASTER
// once and for all:
// pc: FINAL & MASTER
@@ -245,14 +245,16 @@ enum Config {
#define USE_TXD_CDIMAGE // generate and load textures from txd.img
#define PS2_ALPHA_TEST // emulate ps2 alpha test
#define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number
-#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time
+// #define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time
#define DISABLE_VSYNC_ON_TEXTURE_CONVERSION // make texture conversion work faster by disabling vsync
//#define USE_TEXTURE_POOL
#ifdef LIBRW
+#ifndef __WIIU__
#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur)
#define EXTENDED_PIPELINES // custom render pipelines (includes Neo)
#define SCREEN_DROPLETS // neo water droplets
#endif
+#endif
#ifndef EXTENDED_COLOURFILTER
#undef SCREEN_DROPLETS // we need the backbuffer for this effect
@@ -292,8 +294,8 @@ enum Config {
#else
# define MENU_MAP // VC-like menu map. Make sure you have new menu.txd
# define SCROLLABLE_STATS_PAGE // only draggable by mouse atm
-# define TRIANGLE_BACK_BUTTON
-//# define CIRCLE_BACK_BUTTON
+//# define TRIANGLE_BACK_BUTTON
+# define CIRCLE_BACK_BUTTON
//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
//# define PS2_SAVE_DIALOG // PS2 style save dialog with transparent black box
# define CUSTOM_FRONTEND_OPTIONS
@@ -317,7 +319,7 @@ enum Config {
# define MISSION_REPLAY // mobile feature
#endif
//#define SIMPLIER_MISSIONS // apply simplifications from mobile
-#define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
+// #define USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
#define SCRIPT_LOG_FILE_LEVEL 0 // 0 == no log, 1 == overwrite every frame, 2 == full log
#ifndef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT
diff --git a/src/skel/wiiu/wiiu.cpp b/src/skel/wiiu/wiiu.cpp
index f0e47b32..64433a05 100644
--- a/src/skel/wiiu/wiiu.cpp
+++ b/src/skel/wiiu/wiiu.cpp
@@ -844,7 +844,9 @@ main(int argc, char *argv[])
WHBProcInit();
WHBInitCrashHandler();
+#ifdef _DEBUG_BUILD_
WHBLogUdpInit();
+#endif
WHBLogPrintf("RE3 Wii U started");
@@ -1216,7 +1218,6 @@ main(int argc, char *argv[])
}
}
-
/*
* About to shut down - block resize events again...
*/
@@ -1273,8 +1274,6 @@ main(int argc, char *argv[])
}
else
{
- if ( gGameState == GS_PLAYING_GAME )
- CGame::ShutDown();
#ifndef MASTER
if ( gbModelViewer )
CAnimViewer::Shutdown();
@@ -1303,8 +1302,6 @@ main(int argc, char *argv[])
}
- if ( gGameState == GS_PLAYING_GAME )
- CGame::ShutDown();
#ifndef MASTER
if ( gbModelViewer )
CAnimViewer::Shutdown();
@@ -1336,7 +1333,10 @@ main(int argc, char *argv[])
*/
RsEventHandler(rsTERMINATE, nil);
- WHBUnmountSdCard();
+#ifdef _DEBUG_BUILD_
+ WHBLogUdpDeinit();
+#endif
+
WHBProcShutdown();
return 0;
}
diff --git a/vendor/librw b/vendor/librw
index c5c451a4..02e50496 160000
--- a/vendor/librw
+++ b/vendor/librw
@@ -1 +1 @@
-Subproject commit c5c451a429add67132bf1beca25aba725faf703f
+Subproject commit 02e504961cc219da61267d5349cfd2065c49dcfa
diff --git a/vendor/openal-soft b/vendor/openal-soft
index d0ab8759..cc1d6d8a 160000
--- a/vendor/openal-soft
+++ b/vendor/openal-soft
@@ -1 +1 @@
-Subproject commit d0ab875955cacfdc9bfbb2edba6101bc28547876
+Subproject commit cc1d6d8a3e3192faf8a7c243aca5d1e5304f0ca5