diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 89f64c0b6..9c5b3d533 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,7 +1,6 @@
FROM --platform=linux/x86_64 mcr.microsoft.com/devcontainers/base:debian
ENV WORKSPACE=/workspace
-ENV DEVKITPRO=/opt/devkitpro
RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg --add-architecture i386 && \
@@ -32,10 +31,6 @@ RUN curl -L https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-SDL2-2.30.2-
curl -L https://mirror.msys2.org/mingw/mingw32/mingw-w64-i686-libpng-1.6.43-1-any.pkg.tar.zst | tar --use-compress-program=unzstd -xv -C /opt && \
curl -L https://mirror.msys2.org/mingw/mingw32/mingw-w64-i686-libvpx-1.14.0-1-any.pkg.tar.zst | tar --use-compress-program=unzstd -xv -C /opt
-# DevkitPRO
-COPY installDevkitPro.sh .
-RUN ./installDevkitPro.sh
-
# Base Directories
RUN mkdir -p "${WORKSPACE}" && chmod -R 777 "$WORKSPACE"
diff --git a/.devcontainer/installDevkitPro.sh b/.devcontainer/installDevkitPro.sh
deleted file mode 100755
index 9e8b9c082..000000000
--- a/.devcontainer/installDevkitPro.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-curl -L https://apt.devkitpro.org/install-devkitpro-pacman > install-devkitpro-pacman || exit 1
-chmod +x install-devkitpro-pacman || exit 1
-
-./install-devkitpro-pacman << END_OF_INPUT
-y
-END_OF_INPUT
-
-rm install-devkitpro-pacman || exit 1
-ln -s /proc/self/mounts /etc/mtab
-
-/opt/devkitpro/pacman/bin/pacman -S wii-dev ppc-libpng ppc-zlib ppc-libvorbis ppc-libvorbisidec ppc-libogg << END_OF_INPUT
-
-y
-END_OF_INPUT
-
-# Clone and install Wii-U Pro Controller Support
-git clone https://github.com/SumolX/libwupc.git && \
-cp -a libwupc/include/wupc /opt/devkitpro/portlibs/ppc/include/ && \
-cp -a libwupc/lib/* /opt/devkitpro/portlibs/ppc/lib/
-
-# Clone and install portlibs compatible ppc VPX development files
-git clone https://github.com/SumolX/portlibs-ppc-libvpx.git
-cp -a portlibs-ppc-libvpx/include/* /opt/devkitpro/portlibs/ppc/include/ && \
-cp -a portlibs-ppc-libvpx/lib/* /opt/devkitpro/portlibs/ppc/lib/
diff --git a/.gitignore b/.gitignore
index 9fdc28e02..3368bb93e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,8 +16,6 @@ tools/bin/.wget-hsts
tools/win-sdk/*
!tools/win-sdk/win-sdk.7z
tools/psp-sdk/*
-tools/devkitpro/*
-!tools/devkitpro/devkitPro.7z
/openbor_vs
engine/ios/Build
**/.DS_Store
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f9093cba..478a71a33 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,6 @@ project(OpenBOR VERSION 4.0 LANGUAGES C)
option(BUILD_WIN "Windows" OFF)
option(BUILD_LINUX "Linux" OFF)
option(BUILD_DARWIN "MacOS" OFF)
-option(BUILD_WII "Nintendo Wii Console" OFF)
# Backends
option(TARGET_ARCH "[X86,AMD64,ARM64,UNIVERSAL]" OFF)
@@ -73,7 +72,7 @@ add_executable(${PROJECT_NAME} ${SRC_FILES})
add_dependencies(${PROJECT_NAME} VersionInfo)
# Auto-Detect
-if(NOT (BUILD_WIN OR BUILD_LINUX OR BUILD_DARWIN OR BUILD_WII))
+if(NOT (BUILD_WIN OR BUILD_LINUX OR BUILD_DARWIN))
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(BUILD_DARWIN ON)
message("Build target not specified, BUILD_DARWIN=ON")
@@ -96,8 +95,6 @@ elseif(BUILD_DARWIN)
include("cmake/macos.cmake")
elseif(BUILD_LINUX)
include("cmake/linux.cmake")
-elseif(BUILD_WII)
- include("cmake/wii.cmake")
endif()
# Include Optional Source Files
diff --git a/COMPILING.md b/COMPILING.md
index 24c227a9a..c691d3d7d 100644
--- a/COMPILING.md
+++ b/COMPILING.md
@@ -9,7 +9,6 @@ Within the root of the OpenBOR repository you will find CMakeLists.txt which con
Linux (linux.cmake)
Windows (windows.cmake, windows-finalize.cmake)
Darwin (macos.cmake, macos-finalize.cmake)
- Wii (wii.cmake)
# Building Target
Cmake provides various options for building a targets in general, however we are only going to focus on a subset of these options. Typically running the cmake command without addition parameters is enough for the configuration system to identify which host you are running on in order to build a native target. A few example are provided below to showcase how to configure and build a OpenBOR target.
@@ -102,7 +101,6 @@ Using the build scripts provided in the repository we can now ensure that all su
-rw-r--r-- 1 root root 1537 Apr 20 15:13 LICENSE.txt
drwxr-xr-x 9 root root 288 Apr 21 01:24 LINUX
-rw-r--r-- 1 root root 314 Apr 20 15:13 README.txt
- drwxr-xr-x 7 root root 224 Apr 21 01:24 WII
drwxr-xr-x 8 root root 256 Apr 21 01:24 WINDOWS
-rw-r--r-- 1 root root 5871 Apr 20 15:13 translation.txt
diff --git a/README.md b/README.md
index 867445f4b..5877b8888 100644
--- a/README.md
+++ b/README.md
@@ -26,33 +26,20 @@ To find out more, stop into the OpenBOR community at [ChronoCrash.com](https://w
* **2011 -** *[Sumo1X](https://github.com/SumolX)* retires from the OpenBOR Team, and hands management duties to [DCurrent (Damon Caskey)](https://github.com/DCurrent).
-* **2017 -** OpenBOR repository migrates from SourceForge to Github.
+* **2017 -** OpenBOR repository migrates from SourceForge to GitHub.
* **2021 -** Development continues on OpenBOR 4.0, with various internal source cleanups, a more object centric script engine, and fixes for long standing issues.
* **2024 -** After an extended development cycle, the first official 4.0 build drops. Development continues to refine and fill requests that did not make the initial 4.0 release deadline.
-## Platforms
-OpenBOR has a very modular and portable design inherited from Beats of Rage - several ports have been made available.
+* **2026 -** Focus shifts to removing legacy console port cruft while refining engine architecture and build tools. The goal is to position OpenBOR as a powerful commercial option for beginners and advanced creators while staying enthusiast-friendly and royalty-free.
-### Current
-These platforms are actively supported and may be compiled with the latest OpenBOR engine.
+## Platforms
+OpenBOR currently supports the following platforms.
* Android
-* Windows
* Linux
-* Wii
-
-### Discontinued
-
-The following platforms are still available as legacy binaries but are no longer supported and may not be compatible with current iterations of OpenBOR.
-
-* PSP
-* Dreamcast
-* GP2X
-* GP2X Wiz
-* Mac OS X
-* OpenDingux (Dingoo A320 & GCW-Zero)
+* Windows
## OpenBOR Team
@@ -61,16 +48,19 @@ The following platforms are still available as legacy binaries but are no longer
#### [Damon Caskey](https://github.com/DCurrent) (2007-)
OpenBOR project manager and site owner of the OpenBOR community. Primary contributions are core engine and scripting development, code cleanup, and organization. Main focus is keeping OpenBOR future proof and modular by replacing specialized hardcoding and overlap with generalized features that allow for more author creativity.
-#### [Plombo](https://github.com/plombo) (2009-)
-A developer who prefers to work on OpenBOR's supporting libraries and platform-specific backends. Known for maintaining the Wii port, writing the GPU-accelerated video code for Wii and OpenGL, and a few engine features.
-
#### [Malik](https://github.com/msmalik681) (2018-)
Malik came to the team with a strong OpenBOR scripting background, and quickly established himself as a resident go-to for the Android Port. Malik dedicates himself to keeping the Android port of OpenBOR a commercially viable platform for authors who wish to sell their original IP projects.
+#### [fgames9000](https://github.com/fgames9000) (2021-)
+Known as Kratus in the OpenBOR community, creator of the amazing [Streets of Rage X](https://www.chronocrash.com/forum/resources/streets-of-rage-x-windows-android.274/) fan remake. Kratus is a highly respected community member known for scripting skills, game design, and assisting other members with projects. Main contributions are unit testing, advising, and bug fixes for engine logic and Linux port.
+
### Former members and contributors
+#### [Plombo](https://github.com/plombo) (2009-2024)
+Developer who prefers to work on OpenBOR's supporting libraries and platform-specific backends. Known for maintaining the Wii port, writing the GPU-accelerated video code for Wii and OpenGL, and a few engine features. Contributed many powerful functionalities including alpha masks, control upgrades, and the PalApply tool.
+
#### [Douglas Baldan](https://github.com/dbaldan) (2018-2021)
-Known as O'Ilusionista, Douglas was a highly respected administrator of the OpenBOR community and a prolific member of the Mugen scene. His professional background in graphic design brought a plethora of graphic and game development experience to the team. Citing personal reasons, Douglas officially retired from the OpenBOR team mid-2021.
+Known as O'Ilusionista, Douglas is prolific figure in OpenBOR and Mugen communities. His professional background in graphic design brought a plethora of graphic and game development experience to the team. Citing personal reasons, Douglas officially retired from the OpenBOR team mid-2021 but continues as an active community member and behind the scenes contributor.
#### [Wasin Thonkaew](https://github.com/haxpor) (2019)
Haxpor in the forums, a Linux centric developer who works hard to ensure our penguin crowd has the proper tools for development and underlying libraries of OpenBOR remain compatible to compile for mobile platforms.
diff --git a/build-all.sh b/build-all.sh
index 8401daccf..83c3b6134 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -10,8 +10,3 @@ cmake -DBUILD_LINUX=ON -DTARGET_ARCH="ARM64" -S . -B build.lin.arm64 && cmake --
rm -rf build.win.x86 build.win.amd64
cmake -DBUILD_WIN=ON -DTARGET_ARCH="x86" -S . -B build.win.x86 && cmake --build build.win.x86 --config Release -- -j `nproc` || exit 1
cmake -DBUILD_WIN=ON -DTARGET_ARCH="AMD64" -S . -B build.win.amd64 && cmake --build build.win.amd64 --config Release -- -j `nproc` || exit 1
-
-# Nintendo Wii
-rm -rf build.wii; mkdir build.wii && cd build.wii && \
-$DEVKITPRO/portlibs/wii/bin/powerpc-eabi-cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_WII=ON .. || exit 1
-make -j `nproc` || exit 1; cd ..
diff --git a/cmake/wii.cmake b/cmake/wii.cmake
deleted file mode 100644
index 5f8e47008..000000000
--- a/cmake/wii.cmake
+++ /dev/null
@@ -1,43 +0,0 @@
-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "NintendoWii")
- message(NOTICE "Invoke DevkitPro's cmake utility directly:")
- message(NOTICE "\t$ENV{DEVKITPRO}/portlibs/wii/bin/powerpc-eabi-cmake -DBUILD_WII=ON ..\n")
-endif()
-
-set(COMMON_COMPILER_FLAGS "${COMMON_COMPILER_FLAGS} -Wno-maybe-uninitialized -Wno-stringop-truncation -Wno-enum-int-mismatch -Wno-array-bounds -Wno-stringop-overflow -Wno-address")
-
-set(USE_TREMOR ON)
-set(USE_WEBM ON)
-
-add_definitions(
- -DWII
-)
-
-file(GLOB SRC_WII "engine/wii/*.c" "engine/wii/*.h")
-target_sources(${PROJECT_NAME} PRIVATE ${SRC_WII})
-
-target_include_directories(${PROJECT_NAME} PRIVATE
- engine/wii
- $ENV{DEVKITPRO}/portlibs/ppc/include
-)
-
-target_link_libraries(${PROJECT_NAME} PUBLIC
- wupc
- wiiuse
- bte
- fat
- asnd
- ogc
-)
-
-# DevkitPro
-ogc_create_dol(${PROJECT_NAME})
-
-# Distribution Preperation
-add_custom_command(TARGET ${PROJECT_NAME}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E make_directory ../engine/releases/WII/Logs
- COMMAND ${CMAKE_COMMAND} -E make_directory ../engine/releases/WII/Paks
- COMMAND ${CMAKE_COMMAND} -E make_directory ../engine/releases/WII/Saves
- COMMAND ${CMAKE_COMMAND} -E make_directory ../engine/releases/WII/ScreenShots
- COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_NAME}.dol ../engine/releases/WII/boot.dol
-)
diff --git a/engine/Makefile b/engine/Makefile
index 4583f7ba0..8da27f8ae 100644
--- a/engine/Makefile
+++ b/engine/Makefile
@@ -165,24 +165,6 @@ BUILD_DEBUG = 1
endif
endif
-ifdef BUILD_WII
-TARGET = $(VERSION_NAME).elf
-TARGET_MAP = $(TARGET).map
-TARGET_FINAL = boot.dol
-TARGET_PLATFORM = WII
-BUILD_TREMOR = 1
-BUILD_WEBM = 1
-BUILD_ELM = 1
-BUILDING = 1
-INCLUDES = $(DEVKITPRO)/portlibs/ppc/include \
- $(DEVKITPRO)/libogc/include
-LIBRARIES = $(DEVKITPRO)/portlibs/ppc/lib \
- $(DEVKITPRO)/libogc/lib/wii
-ifeq ($(BUILD_WII), 0)
-BUILD_DEBUG = 1
-endif
-endif
-
STRIP = cp $(TARGET) $(TARGET_FINAL)
ifndef BUILD_DEBUG
ifndef NO_STRIP
@@ -195,9 +177,6 @@ endif
ifdef BUILD_DARWIN
STRIP = $(PREFIX)strip $(TARGET) -o $(TARGET_FINAL)
endif
-ifdef BUILD_WII
-ELF2DOL = elf2dol $< $@
-endif
endif
endif
@@ -206,10 +185,6 @@ endif
# Directories
#----------------------------------------------------------------------------------------------------
-ifdef BUILD_WII
-INCS += wii
-endif
-
ifdef BUILD_SDL
INCS += sdl
endif
@@ -350,17 +325,6 @@ GAME_CONSOLE = psp/control/control.o
psp/pspport.o
endif
-
-ifdef BUILD_WII
-GAME_CONSOLE = wii/control.o \
- wii/sblaster.o \
- wii/timer.o \
- wii/video.o \
- wii/threads.o \
- wii/menu.o \
- wii/wiiport.o
-endif
-
ifdef BUILD_VITA
GAME_CONSOLE = vita/control.o \
vita/sblaster.o \
@@ -474,14 +438,6 @@ ifdef BUILD_PANDORA
CFLAGS += -DLINUX
endif
-
-ifdef BUILD_WII
-CFLAGS += -DCACHE_BACKGROUNDS -DREVERSE_COLOR -D__ppc__ $(MACHDEP) -Wl,-Map,$(TARGET_MAP),-wrap,wiiuse_register
-# This allows to compile with DevkitPPC r29 and above.
-CFLAGS += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
-endif
-
-
ifdef BUILD_VITA
CFLAGS += -DCACHE_BACKGROUNDS -Wl,-q
endif
@@ -578,12 +534,6 @@ ifdef BUILD_PTHREAD
LIBS += -lpthread
endif
-
-ifdef BUILD_WII
-LIBS += -lwupc -lwiiuse -lbte -lfat -lasnd -logc
-endif
-
-
ifdef BUILD_VITA
LIBS += -lvita2d -lSceKernel_stub -lSceDisplay_stub -lSceGxm_stub \
-lSceSysmodule_stub -lSceCtrl_stub -lScePgf_stub \
@@ -664,30 +614,6 @@ $(TARGET_FINAL) : $(TARGET)
@echo $(TARGET_FINAL) is now ready!
endif
-#----------------------------------------------------------------------------------------------------
-# Rules to manage Files and Libraries for Wii
-#----------------------------------------------------------------------------------------------------
-
-ifdef BUILD_WII
-SOURCES = $(INCS)
-include $(DEVKITPPC)/wii_rules
-all : $(TARGET) $(TARGET_FINAL)
- @echo
-%.o : %.c
- @echo Compiling $(TARGET_PLATFORM) Port: $<...
- @$(CC) $(CFLAGS) -c $< -o $@
-$(TARGET) : $(OBJS) $(RES)
- @echo
- @echo Linking $(TARGET_PLATFORM) Port: $(TARGET)...
- @$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(TARGET_RESOURCE) $(LIBS)
-$(TARGET_FINAL) : $(TARGET)
- @echo Stripping $(TARGET_PLATFORM) Port: $(TARGET_FINAL)...
- @$(ELF2DOL)
- @echo
- @echo Completed $(TARGET_PLATFORM) Port!
- @echo $(TARGET_FINAL) is now ready!
-endif
-
#----------------------------------------------------------------------------------------------------
# Rules to manage Files and Libraries for Vita
#----------------------------------------------------------------------------------------------------
@@ -727,7 +653,6 @@ all:
@echo
@echo make BUILD_PSP=1
@echo make BUILD_PS2=1
- @echo make BUILD_WII=1
@echo make BUILD_WIN=1
@echo make BUILD_PANDORA=1
@echo make BUILD_LINUX=1
diff --git a/engine/build.sh b/engine/build.sh
index 063b99269..d5a1fb57c 100755
--- a/engine/build.sh
+++ b/engine/build.sh
@@ -50,11 +50,7 @@ if test -e "releases/WINDOWS/OpenBOR/OpenBOR.exe"; then
echo "Windows Platform Failed To Build!"
exit 1
fi
- if ! test -e "releases/WII/OpenBOR/boot.dol"; then
- echo "Wii Platform Failed To Build!"
- exit 1
- fi
-
+
if test -e "releases/LINUX/OpenBOR/OpenBOR"; then
cd ../tools/borpak/source/
. build.sh lin
@@ -174,30 +170,6 @@ function windows {
fi
}
-# Wii Environment && Compile
-function wii {
- export PATH=$OLD_PATH
- . ./environ.sh 7
- if test $DEVKITPPC; then
- make clean BUILD_WII=1
- make BUILD_WII=1
- if test -f "./boot.dol"; then
- if test ! -e "./releases/WII" ; then
- mkdir ./releases/WII
- mkdir ./releases/WII/OpenBOR
- mkdir ./releases/WII/OpenBOR/Logs
- mkdir ./releases/WII/OpenBOR/Paks
- mkdir ./releases/WII/OpenBOR/Saves
- mkdir ./releases/WII/OpenBOR/ScreenShots
- fi
- mv boot.dol ./releases/WII/OpenBOR/
- cp ./resources/meta.xml ./releases/WII/OpenBOR
- cp ./resources/OpenBOR_Icon_128x48.png ./releases/WII/OpenBOR/icon.png
- fi
- make clean BUILD_WII=1
- fi
-}
-
# Darwin Environment && Compile
function darwin {
export PATH=$OLD_PATH
@@ -249,7 +221,6 @@ function build_all {
linux_x86
linux_amd64
windows
- wii
darwin
android
fi
@@ -263,7 +234,6 @@ function print_help {
echo " 0 = Distribute"
echo " 4 = Linux (x86, amd64) Example: $0 4 amd64"
echo " 5 = Windows"
- echo " 7 = Wii"
echo " all = build for all applicable targets"
echo "-------------------------------------------------------"
echo "Example: $0 10"
@@ -286,11 +256,6 @@ case $1 in
windows
;;
- 7)
- version
- wii
- ;;
-
?)
version
print_help
diff --git a/engine/environ.sh b/engine/environ.sh
index 80501fd4d..21e6272d7 100755
--- a/engine/environ.sh
+++ b/engine/environ.sh
@@ -304,60 +304,6 @@ case $1 in
fi
;;
-############################################################################
-# #
-# Wii Environment #
-# #
-############################################################################
-7)
- if test -e "/opt/devkitpro"; then
- export DEVKITPRO=/opt/devkitpro
- export DEVKITPPC=$DEVKITPRO/devkitPPC
- export PATH=$PATH:$DEVKITPPC/bin
- elif test -e "c:/devkitpro"; then
- export DEVKITPRO=c:/devkitpro
- export DEVKITPPC=$DEVKITPRO/devkitPPC
- export PATH=$PATH:$DEVKITPPC/bin
- elif [ `echo $HOST_PLATFORM | grep -E "windows|CYGWIN"` ]; then
-
- if [ ! -f "../tools/devkitpro/devkitpro.7z" ]; then
- echo "-------------------------------------------------------"
- echo " WII SDK File - Not Found, Downloading SDK!"
- echo "-------------------------------------------------------"
- wget https://github.com/DCurrent/openbor/raw/ecce29b95700468aa3401915625dac2d56e4ca60/tools/devkitpro/devkitPro.7z -O ../tools/devkitpro/devkitpro.7z
- echo
- echo "-------------------------------------------------------"
- echo " WII SDK File - Download Has Completed!"
- echo "-------------------------------------------------------"
- fi
-
- if [ ! -d "../tools/devkitpro/devkitPPC" ]; then
- echo "-------------------------------------------------------"
- echo " WII SDK - Not Found, Installing SDK!"
- echo "-------------------------------------------------------"
- ../tools/7-Zip/7za.exe x -y ../tools/devkitpro/devkitpro.7z -o../tools/devkitpro/
- echo
- echo "-------------------------------------------------------"
- echo " WII SDK - Installation Has Completed!"
- echo "-------------------------------------------------------"
- fi
- HOST_PLATFORM="SVN";
- export DEVKITPRO=../tools/devkitpro
- export DEVKITPPC=$DEVKITPRO/devkitPPC
- export PATH=$TOOLS:$DEVKITPPC/bin
- fi
- if test $DEVKITPPC; then
- echo "-------------------------------------------------------"
- echo " WII SDK ($HOST_PLATFORM) Environment Loaded!"
- echo "-------------------------------------------------------"
- else
- echo "-------------------------------------------------------"
- echo " ERROR - WII Environment Failed"
- echo " SDK Installed?"
- echo "-------------------------------------------------------"
- fi
- ;;
-
############################################################################
# #
# OpenDingux Environment #
@@ -467,7 +413,6 @@ case $1 in
echo " 4 = Linux"
echo " 5 = Windows"
echo " 6 = Dreamcast"
- echo " 7 = Nintendo Wii"
echo " 8 = OpenDingux"
echo " 9 = Wiz"
echo " 10 = Darwin"
diff --git a/engine/ide/codeblocks/OpenBOR.Windows.cbp b/engine/ide/codeblocks/OpenBOR.Windows.cbp
index 6fe7ba113..80be2a417 100644
--- a/engine/ide/codeblocks/OpenBOR.Windows.cbp
+++ b/engine/ide/codeblocks/OpenBOR.Windows.cbp
@@ -692,33 +692,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/engine/ide/vs/OpenBOR.vcxproj b/engine/ide/vs/OpenBOR.vcxproj
index 8bf7dbd8a..39b145ae9 100644
--- a/engine/ide/vs/OpenBOR.vcxproj
+++ b/engine/ide/vs/OpenBOR.vcxproj
@@ -207,13 +207,6 @@
-
-
-
-
-
-
-
@@ -492,12 +485,6 @@
-
-
-
-
-
-
diff --git a/engine/ide/vs/OpenBOR.vcxproj.filters b/engine/ide/vs/OpenBOR.vcxproj.filters
index ef950739a..b53b67894 100644
--- a/engine/ide/vs/OpenBOR.vcxproj.filters
+++ b/engine/ide/vs/OpenBOR.vcxproj.filters
@@ -402,27 +402,6 @@
Source Files
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
Source Files
@@ -1230,25 +1209,7 @@
Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
+
Header Files
diff --git a/engine/openbor.c b/engine/openbor.c
index 9742bf124..196a101d2 100644
--- a/engine/openbor.c
+++ b/engine/openbor.c
@@ -2631,13 +2631,7 @@ void clearsettings()
savedata.debuginfo = 0;
savedata.fullscreen = 0;
savedata.fpslimit = 1; // default to vsync
-
- #if WII
- savedata.stretch = 1;
- #else
savedata.stretch = 0;
- #endif
-
savedata.swfilter = 0;
#ifdef SDL
@@ -12109,7 +12103,7 @@ void lcmHandleCommandWeapons(ArgList *arglist, s_model *newchar)
/*
* Weapon list arguments left to right, until we
* reach this model's number of weapons. If none,
- * populate wiith "none" index. Otherwise we find
+ * populate with "none" index. Otherwise we find
* a model index to populate with.
*/
@@ -46161,9 +46155,9 @@ void update(int ingame, int usevwait)
// ----------------------------------------------------------------------
/* Plombo 9/4/2010: New function that can use brightness/gamma correction
* independent from the global palette on platforms where it's available.
- * Hardware accelerated brightness/gamma correction is available on Wii and
- * OpenGL platforms using TEV and GLSL, respectively. Returns 1 on success, 0 on
- * error. */
+ * Hardware accelerated brightness/gamma correction is available on OpenGL
+ * platforms using GLSL. Returns 1 on success, 0 on error.
+ */
int set_color_correction(int gm, int br)
{
video_set_color_correction(gm, br);
@@ -46315,43 +46309,38 @@ void display_credits()
font_printf(col1, s + v * m, 0, 0, "Msmalik681");
font_printf(col2, s + v * m, 0, 0, "Developer"); ++m;
- font_printf(col1, s + v * m, 0, 0, "Plombo");
+ font_printf(col1, s + v * m, 0, 0, "Kratus");
font_printf(col2, s + v * m, 0, 0, "Developer"); ++m;
font_printf(_strmidx(1, "Former Staff"), s + v * m, 1, 0, "Former Staff"); ++m;
font_printf(col1, s + v * m, 0, 0, "Fightn Words");
- font_printf(col2, s + v * m, 0, 0, "Fugue"); ++m;
+ font_printf(col2, s + v * m, 0, 0, "Fugue"); ++m;
+
font_printf(col1, s + v * m, 0, 0, "KBAndressen");
- font_printf(col2, s + v * m, 0, 0, "Kirby"); ++m;
- font_printf(col1, s + v * m, 0, 0, "LordBall");
- font_printf(col2, s + v * m, 0, 0, "Orochi_X"); ++m;
+ font_printf(col2, s + v * m, 0, 0, "Kirby"); ++m;
+
+ font_printf(col1, s + v * m, 0, 0, "LordBall");
+ font_printf(col2, s + v * m, 0, 0, "Orochi_X"); ++m;
+
font_printf(col1, s + v * m, 0, 0, "SX");
- font_printf(col2, s + v * m, 0, 0, "Tails"); ++m;
- font_printf(col1, s + v * m, 0, 0, "uTunnels");
- font_printf(col2, s + v * m, 0, 0, "White Dragon"); ++m;
+ font_printf(col2, s + v * m, 0, 0, "Tails"); ++m;
- font_printf(_strmidx(1, "Ports"), s + v * m, 1, 0, "Ports"); ++m;
- font_printf(col1, s + v * m, 0, 0, "PSP/Linux/OSX");
+ font_printf(col1, s + v * m, 0, 0, "uTunnels");
+ font_printf(col2, s + v * m, 0, 0, "White Dragon"); ++m;
+
+ font_printf(col1, s + v * m, 0, 0, "Plombo"); ++m;
+
+ font_printf(_strmidx(1, "Ports"), s + v * m, 1, 0, "Ports"); ++m;
+
+ font_printf(col1, s + v * m, 0, 0, "Linux/OSX");
font_printf(col2, s + v * m, 0, 0, "SX"); ++m;
- /*
- font_printf(col1, s + v * m, 0, 0, "OpenDingux");
- font_printf(col2, s + v * m, 0, 0, "Shin-NiL"); ++m;
-
- font_printf(col1, s + v * m, 0, 0, "DreamCast");
- font_printf(col2, s + v * m, 0, 0, "Neill Corlett, SX"); ++m;
- */
- font_printf(col1, s + v * m, 0, 0, "Wii");
- font_printf(col2, s + v * m, 0, 0, "Plombo, SX, Msmalik681"); ++m;
font_printf(col1, s + v * m, 0, 0, "Android");
font_printf(col2, s + v * m, 0, 0, "CRxTRDude, Plombo,"); ++m;
font_printf(col2, s + v * m, 0, 0, "uTunnels, Msmalik681"); ++m;
font_printf(col2, s + v * m, 0, 0, "White Dragon"); ++m;
- font_printf(col1, s + v * m, 0, 0, "PS Vita");
- font_printf(col2, s + v * m, 0, 0, "Plombo"); ++m;
-
update(2, 0);
done |= (_time > finishtime);
@@ -48835,16 +48824,6 @@ void init_videomodes(int log)
#define tryfile(X) if((tmp=openpackfile(X,packfile))!=-1) { closepackfile(tmp); filename=X; goto readfile; }
#if WIN || LINUX
tryfile("data/videopc.txt");
-#elif WII
- tryfile("data/videowii.txt");
- if(CONF_GetAspectRatio() == CONF_ASPECT_16_9)
- {
- tryfile("data/video169.txt")
- }
- else
- {
- tryfile("data/video43.txt");
- }
#endif
#undef tryfile
@@ -48935,7 +48914,7 @@ void init_videomodes(int log)
videomodes.filter = savedata.swfilter;
switch (videoMode)
{
- // 320x240 - All Platforms
+ // 320x240 - QVGA
case 0:
videomodes.hRes = 320;
videomodes.vRes = 240;
@@ -48949,7 +48928,7 @@ void init_videomodes(int log)
BGHEIGHT = 160;
break;
- // 480x272 - All Platforms
+ // 480x272 - WQVGA
case 1:
videomodes.hRes = 480;
videomodes.vRes = 272;
@@ -48963,7 +48942,7 @@ void init_videomodes(int log)
BGHEIGHT = 182;
break;
- // 640x480 - PC, Dreamcast, Wii
+ // 640x480 - VGA
case 2:
videomodes.hRes = 640;
videomodes.vRes = 480;
@@ -48977,7 +48956,7 @@ void init_videomodes(int log)
BGHEIGHT = 321;
break;
- // 720x480 - PC, Wii
+ // 720x480 - DVD
case 3:
videomodes.hRes = 720;
videomodes.vRes = 480;
@@ -48991,7 +48970,7 @@ void init_videomodes(int log)
BGHEIGHT = 321;
break;
- // 800x480 - PC, Wii, Pandora
+ // 800x480 - WVGA
case 4:
videomodes.hRes = 800;
videomodes.vRes = 480;
@@ -49005,7 +48984,7 @@ void init_videomodes(int log)
BGHEIGHT = 321;
break;
- // 800x600 - PC, Dreamcast, Wii
+ // 800x600 - SVGA
case 5:
videomodes.hRes = 800;
videomodes.vRes = 600;
@@ -49019,7 +48998,7 @@ void init_videomodes(int log)
BGHEIGHT = 401;
break;
- // 960x540 - PC, Wii
+ // 960x540 - qHD
case 6:
videomodes.hRes = 960;
videomodes.vRes = 540;
@@ -49033,6 +49012,7 @@ void init_videomodes(int log)
BGHEIGHT = 362;
break;
+ // Custom video mode
case 255:
videomodes.dOffset = videomodes.vRes * 0.9625;
printf("\nUsing debug video mode: %d x %d\n", videomodes.hRes, videomodes.vRes);
@@ -49367,17 +49347,6 @@ void menu_options_input()
while(!quit)
{
_menutextm(2, x_pos-1, 0, Tr("Control Options"));
-
- #if WII
- if(savedata.usejoy)
- {
- _menutext((selector == 0), -4, -2, Tr("Nunchuk Analog Enabled"));
- }
- else
- {
- _menutext((selector == 0), -4, -2, Tr("Nunchuk Analog Disabled"));
- }
- #else
if(savedata.usejoy)
{
_menutext((selector == 0), x_pos, -2, Tr("GamePads Enabled"));
@@ -49390,8 +49359,6 @@ void menu_options_input()
{
_menutext((selector == 0), x_pos, -2, Tr("GamePads Disabled"));
}
- #endif
-
_menutext((selector == 1), x_pos,-1, Tr("Setup Player 1..."));
_menutext((selector == 2), x_pos, 0, Tr("Setup Player 2..."));
_menutext((selector == 3), x_pos, 1, Tr("Setup Player 3..."));
@@ -50372,20 +50339,6 @@ void menu_options_video()
_menutext((selector == 2), col1, -1, Tr("Window Offset:"));
_menutext((selector == 2), col2, -1, "%i", savedata.windowpos);
-#if WII
- _menutext((selector == 3), col1, 0, Tr("Display Mode:"));
- _menutext((selector == 3), col2, 0, (savedata.stretch ? Tr("Stretch to Screen") : Tr("Preserve Aspect Ratio")));
- _menutextm((selector == 4), 6, 0, Tr("Back"));
- if(selector < 0)
- {
- selector = 4;
- }
- if(selector > 4)
- {
- selector = 0;
- }
-#endif
-
#if SDL
_menutext((selector == 3), col1, 0, Tr("Display Mode:"));
_menutext((selector == 3), col2, 0, savedata.fullscreen ? Tr("Full") : Tr("Window"));
@@ -50547,12 +50500,7 @@ void menu_options_video()
savedata.windowpos = 20;
}
break;
-#if WII
- case 3:
- //video_fullscreen_flip();
- video_stretch((savedata.stretch ^= 1));
- break;
-#elif SDL
+#if SDL
case 3:
video_fullscreen_flip();
break;
diff --git a/engine/openbor.h b/engine/openbor.h
index 4a834d47e..84eded942 100644
--- a/engine/openbor.h
+++ b/engine/openbor.h
@@ -470,7 +470,6 @@ typedef enum
PORTING_OPENDINGUX,
PORTING_PSP,
PORTING_UNKNOWN,
- PORTING_WII,
PORTING_WINDOWS,
PORTING_WIZ,
PORTING_XBOX,
diff --git a/engine/openborscript.c b/engine/openborscript.c
index 8a833e1a1..d7a553622 100644
--- a/engine/openborscript.c
+++ b/engine/openborscript.c
@@ -9176,8 +9176,6 @@ int getsyspropertybyindex(ScriptVariant *var, int index)
porting = PORTING_OPENDINGUX;
#elif PSP
porting = PORTING_PSP;
- #elif WII
- porting = PORTING_WII;
#elif WIN
porting = PORTING_WINDOWS;
#elif WIZ
diff --git a/engine/source/gamelib/threads.h b/engine/source/gamelib/threads.h
index 626246007..b17e6acd0 100644
--- a/engine/source/gamelib/threads.h
+++ b/engine/source/gamelib/threads.h
@@ -9,14 +9,7 @@
#ifndef THREADS_H
#define THREADS_H
-#if WII
-#include
-#include
-struct bor_thread;
-typedef struct bor_thread bor_thread;
-typedef mutex_t bor_mutex;
-typedef cond_t bor_cond;
-#elif SDL
+#if SDL
#include "SDL.h"
#include "SDL_thread.h"
typedef SDL_Thread bor_thread;
diff --git a/engine/source/gamelib/types.h b/engine/source/gamelib/types.h
index 8ed2d39ca..bb75a95e3 100644
--- a/engine/source/gamelib/types.h
+++ b/engine/source/gamelib/types.h
@@ -46,9 +46,7 @@ extern int pixelbytes[(int)5];
// Define fixed-size integer types - these used to be in gfxtypes.h
// TODO: use these for throughout the engine where fixed-length types are needed
-#if WII
-#include "gctypes.h"
-#elif ((__STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (__GNUC__ >= 3))) && (!defined(DC))
+#if ((__STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (__GNUC__ >= 3))) && (!defined(DC))
#include
typedef int8_t s8;
typedef uint8_t u8;
diff --git a/engine/source/globals.h b/engine/source/globals.h
index 73e051852..7c2c0e324 100644
--- a/engine/source/globals.h
+++ b/engine/source/globals.h
@@ -34,15 +34,6 @@
#include "sdlport.h"
#endif
-#ifdef WII
-#include
-#include
-#include "wiiport.h"
-// For devkitPPC r29+
-#define stricmp strcasecmp
-#define strnicmp strncasecmp
-#endif
-
#include "packfile.h"
/////////////////////////////////////////////////////////////////////////////
diff --git a/engine/source/openborscript/constants.c b/engine/source/openborscript/constants.c
index faabaf9da..235d82c9d 100644
--- a/engine/source/openborscript/constants.c
+++ b/engine/source/openborscript/constants.c
@@ -1364,7 +1364,6 @@ int mapstrings_transconst(ScriptVariant **varlist, int paramCount)
ICMPCONST(PORTING_OPENDINGUX)
ICMPCONST(PORTING_PSP)
ICMPCONST(PORTING_UNKNOWN)
- ICMPCONST(PORTING_WII)
ICMPCONST(PORTING_WINDOWS)
ICMPCONST(PORTING_WIZ)
ICMPCONST(PORTING_XBOX)
diff --git a/engine/source/pnglib/pngdec.c b/engine/source/pnglib/pngdec.c
index 1f1bc8936..77887a074 100644
--- a/engine/source/pnglib/pngdec.c
+++ b/engine/source/pnglib/pngdec.c
@@ -78,11 +78,8 @@ s_screen *pngToScreen(const void *data)
{
png_set_tRNS_to_alpha(png_ptr);
}
-#if WII
- png_set_filler(png_ptr, 0xff, PNG_FILLER_BEFORE);
-#else
+
png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
-#endif
image = allocscreen(width, height, PIXEL_32);
if(image == NULL)
diff --git a/engine/source/ramlib/ram.c b/engine/source/ramlib/ram.c
index 05f6565eb..7bced3d94 100644
--- a/engine/source/ramlib/ram.c
+++ b/engine/source/ramlib/ram.c
@@ -173,10 +173,6 @@ void setSystemRam()
//systemRam = 0x02000000 - 0x002C6000;
systemRam = 0x01c8c000;//Opendingux
elfOffset = 0x00000000;
-#elif WII
- // 88 MBytes with 16 Mbytes reserved for ISO System
- systemRam = 0x817FFFFF - 0x80000000 + ((64 - 16) * 1024 * 1024);
- elfOffset = 0x80000000;
#elif VITA
systemRam = 0x0f000000;
elfOffset = 0x00000000;
diff --git a/engine/source/scriptlib/depends.h b/engine/source/scriptlib/depends.h
index 16110f013..b2cd6f096 100644
--- a/engine/source/scriptlib/depends.h
+++ b/engine/source/scriptlib/depends.h
@@ -25,12 +25,7 @@ typedef s32 LONG;
typedef char CHAR;
typedef float FLOAT;
typedef double DOUBLE;
-
-#ifdef WII
-#include
-#else
typedef int BOOL;
-#endif
#ifdef VOID
#undef VOID
diff --git a/engine/source/utils.c b/engine/source/utils.c
index 80b5eca79..375b09d2a 100644
--- a/engine/source/utils.c
+++ b/engine/source/utils.c
@@ -32,11 +32,6 @@
#include
#endif
-#if WII
-#include "wiiport.h"
-#include "savepng.h"
-#endif
-
#if ANDROID
#include "sdlport.h"
#include "savepng.h"
@@ -48,14 +43,7 @@
#define MKDIR(x) mkdir(x, 0777)
#endif
-#ifdef WII
-#define CHECK_LOGFILE(type) type ? fileExists(getFullPath("Logs/OpenBorLog.txt")) : fileExists(getFullPath("Logs/ScriptLog.txt"))
-#define OPEN_LOGFILE(type) type ? fopen(getFullPath("Logs/OpenBorLog.txt"), "wt") : fopen(getFullPath("Logs/ScriptLog.txt"), "wt")
-#define APPEND_LOGFILE(type) type ? fopen(getFullPath("Logs/OpenBorLog.txt"), "at") : fopen(getFullPath("Logs/ScriptLog.txt"), "at")
-#define READ_LOGFILE(type) type ? fopen(getFullPath("Logs/OpenBorLog.txt"), "rt") : fopen(getFullPath("Logs/ScriptLog.txt"), "rt")
-#define COPY_ROOT_PATH(buf, name) strcpy(buf, rootDir); strcat(buf, name); strcat(buf, "/");
-#define COPY_PAKS_PATH(buf, name) strcpy(buf, paksDir); strcat(buf, "/"); strcat(buf, name);
-#elif ANDROID
+#if ANDROID
//msmalik681 now using AndroidRoot fuction from sdlport.c to update all android paths.
#define Alog AndroidRoot("Logs/OpenBorLog.txt")
#define Aslog AndroidRoot("Logs/ScriptLog.txt")
@@ -359,7 +347,7 @@ void screenshot(s_screen *vscreen, unsigned char *pal, int ingame)
getPakName(modname, 99);
do
{
-#if SDL || WII
+#if SDL
sprintf(shotname, "%s/%s - %04u.png", screenShotsDir, modname, shotnum);
#else
sprintf(shotname, "./ScreenShots/%s - %04u.png", modname, shotnum);
diff --git a/engine/wii/control.c b/engine/wii/control.c
deleted file mode 100644
index abe183864..000000000
--- a/engine/wii/control.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * OpenBOR - https://www.chronocrash.com
- * -----------------------------------------------------------------------
- * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
-#include
-#include
-#include
-#include
-#include
-#include "wupc/wupc.h"
-#include "wiiport.h"
-#include "version.h"
-#include "control.h"
-#undef MIN
-#undef MAX
-#include "openbor.h"
-
-#define PAD_START 1
-#define MAX_PADS 4
-#define PAD_END (MAX_BUTTONS*MAX_PADS)
-
-static int usejoy;
-static int initialized;
-static int hwbutton = 0;
-static int using_gc[MAX_PADS];
-static int lastkey[MAX_PADS];
-static int rumbling[MAX_PADS];
-static long long unsigned rumble_msec[MAX_PADS];
-static long long unsigned time2rumble[MAX_PADS];
-
-static const char *padnames[PAD_END+1+1] = {
- "...",
-#define CONTROLNAMES(x) \
- x" Up", \
- x" Right", \
- x" Down", \
- x" Left", \
- x" 1/A", \
- x" 2/B", \
- x" A/Y/X", \
- x" B/X/Y", \
- x" -/Menu", \
- x" +/Start", \
- x" Home/Z", \
- x" R-Trigger", \
- x" L-Trigger", \
- x" ZR", \
- x" ZL", \
- x" Z/L", \
- x" C/R", \
- x" Substick Up", \
- x" Substick Right", \
- x" Substick Down", \
- x" Substick Left",
- CONTROLNAMES("P1")
- CONTROLNAMES("P2")
- CONTROLNAMES("P3")
- CONTROLNAMES("P4")
- "undefined"
-};
-
-void poweroff()
-{
- hwbutton = WII_SHUTDOWN;
-}
-
-void reset()
-{
- hwbutton = WII_RESET;
-}
-
-void wiimote_poweroff(int playernum)
-{
- hwbutton = WII_SHUTDOWN;
-}
-
-// Resets or powers off the Wii if the corresponding buttons are pressed.
-// Resetting returns to the Homebrew Channel.
-void respondToPowerReset()
-{
- borShutdown(hwbutton, DEFAULT_SHUTDOWN_MESSAGE);
-}
-
-static int flag_to_index(unsigned long flag)
-{
- int index = 0;
- unsigned long bit = 1;
- while(!((bit<settings[flag_to_index(flag)] = key;
- pcontrols->keyflags = pcontrols->newkeyflags = 0;
-}
-
-// Scan input for newly-pressed keys.
-// Return value:
-// 0 = no key was pressed
-// >0 = key code for pressed key
-// <0 = error
-int control_scankey()
-{
- static unsigned ready = 0;
- unsigned i, k=0;
-
- for(i=0; i= PAD_START && keycode <= PAD_END) return (char*)padnames[keycode];
- return "...";
-}
-
-void control_update(s_playercontrols ** playercontrols, int numplayers)
-{
- unsigned long k;
- unsigned long i;
- int player;
- int t;
- s_playercontrols * pcontrols;
- unsigned port[MAX_PADS];
- long long unsigned msec = 0;
- for(i=0; i time2rumble[i]+rumble_msec[i])
- {
- rumbling[i] = 0;
- WPAD_Rumble(i, 0);
- WUPC_Rumble(i, false);
- PAD_ControlMotor(i, 0);
- }
- }
- }
- for(player=0; playersettings[i];
- if(t >= PAD_START && t <= PAD_END)
- {
- int portnum = (t-1) / MAX_BUTTONS;
- int shiftby = (t-1) % MAX_BUTTONS;
- if(portnum >= 0 && portnum <= 3)
- {
- if((port[portnum] >> shiftby) & 1) k |= (1<kb_break = 0;
- pcontrols->newkeyflags = k & (~pcontrols->keyflags);
- pcontrols->keyflags = k;
- }
-
- if (hwbutton) respondToPowerReset();
-}
-
-void control_rumble(int port, int ratio, int msec)
-{
- WPADData *wpad;
- struct WUPCData *wupc;
- wpad = WPAD_Data(port);
- wupc = WUPC_Data(port);
-
- rumbling[port] = 1;
- rumble_msec[port] = msec * 3;
- time2rumble[port] = ticks_to_millisecs(gettime());
-
- if (using_gc[port]) PAD_ControlMotor(port, 1);
- else if(wupc != NULL) WUPC_Rumble(port, true);
- else if (wpad->exp.type != WPAD_EXP_CLASSIC) WPAD_Rumble(port, 1);
-}
-
-unsigned long getPad(int port)
-{
- unsigned long btns = 0;
- unsigned short gcbtns;
- WPADData *wpad;
- struct WUPCData *wupc;
-
- // necessary to detect GC controllers plugged in while OpenBOR is running
- PAD_Init();
-
- PAD_ScanPads();
- gcbtns = PAD_ButtonsDown(port) | PAD_ButtonsHeld(port);
- WUPC_UpdateButtonStats();
- WPAD_ScanPads();
- wpad = WPAD_Data(port);
- wupc = WUPC_Data(port);
-
- if (gcbtns) using_gc[port] = 1;
- else if (wpad->btns_h) using_gc[port] = 0;
-
-
- if(wpad->exp.type == WPAD_EXP_CLASSIC)
- {
- // Left thumb stick
- if(wpad->exp.classic.ljs.mag >= 0.3)
- {
- if (wpad->exp.classic.ljs.ang >= 310 ||
- wpad->exp.classic.ljs.ang <= 50) btns |= WII_UP;
- if (wpad->exp.classic.ljs.ang >= 130 &&
- wpad->exp.classic.ljs.ang <= 230) btns |= WII_DOWN;
- if (wpad->exp.classic.ljs.ang >= 220 &&
- wpad->exp.classic.ljs.ang <= 320) btns |= WII_LEFT;
- if (wpad->exp.classic.ljs.ang >= 40 &&
- wpad->exp.classic.ljs.ang <= 140) btns |= WII_RIGHT;
- }
-
- // Right thumb stick
- if(wpad->exp.classic.rjs.mag >= 0.3)
- {
- if (wpad->exp.classic.rjs.ang >= 310 ||
- wpad->exp.classic.rjs.ang <= 50) btns |= WII_SUB_UP;
- if (wpad->exp.classic.rjs.ang >= 130 &&
- wpad->exp.classic.rjs.ang <= 230) btns |= WII_SUB_DOWN;
- if (wpad->exp.classic.rjs.ang >= 220 &&
- wpad->exp.classic.rjs.ang <= 320) btns |= WII_SUB_LEFT;
- if (wpad->exp.classic.rjs.ang >= 40 &&
- wpad->exp.classic.rjs.ang <= 140) btns |= WII_SUB_RIGHT;
- }
-
- // D-pad
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_UP) btns |= WII_UP;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_DOWN) btns |= WII_DOWN;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_LEFT) btns |= WII_LEFT;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_RIGHT) btns |= WII_RIGHT;
- }
- else if (wupc != NULL) // Pro Controller
- {
- if(wupc->button & WPAD_CLASSIC_BUTTON_UP) btns |= WII_UP;
- if(wupc->button & WPAD_CLASSIC_BUTTON_DOWN) btns |= WII_DOWN;
- if(wupc->button & WPAD_CLASSIC_BUTTON_LEFT) btns |= WII_LEFT;
- if(wupc->button & WPAD_CLASSIC_BUTTON_RIGHT) btns |= WII_RIGHT;
- if(wupc->button & WPAD_CLASSIC_BUTTON_PLUS) btns |= WII_PLUS_START;
- if(wupc->button & WPAD_CLASSIC_BUTTON_MINUS) btns |= WII_MINUS;
- if(wupc->button & WPAD_CLASSIC_BUTTON_HOME) btns |= WII_HOME;
- if(wupc->button & WPAD_CLASSIC_BUTTON_A) btns |= WII_1_A;
- if(wupc->button & WPAD_CLASSIC_BUTTON_B) btns |= WII_2_B;
- if(wupc->button & WPAD_CLASSIC_BUTTON_Y) btns |= WII_A_Y_X;
- if(wupc->button & WPAD_CLASSIC_BUTTON_X) btns |= WII_B_X_Y;
- if(wupc->button & WPAD_CLASSIC_BUTTON_FULL_R) btns |= WII_C_R;
- if(wupc->button & WPAD_CLASSIC_BUTTON_FULL_L) btns |= WII_Z_L;
- if(wupc->button & WPAD_CLASSIC_BUTTON_ZL) btns |= WII_ZL;
- if(wupc->button & WPAD_CLASSIC_BUTTON_ZR) btns |= WII_ZR;
-
- //analog sticks
- if(wupc->yAxisL > 200) btns |= WII_UP;
- if(wupc->yAxisL < -200) btns |= WII_DOWN;
- if(wupc->xAxisL > 200) btns |= WII_RIGHT;
- if(wupc->xAxisL < -200) btns |= WII_LEFT;
-
- if(wupc->yAxisR > 200) btns |= WII_SUB_UP;
- if(wupc->yAxisR < -200) btns |= WII_SUB_DOWN;
- if(wupc->xAxisR > 200) btns |= WII_SUB_RIGHT;
- if(wupc->xAxisR < -200) btns |= WII_SUB_LEFT;
-
-
- }
- else if((wpad->exp.type == WPAD_EXP_NUNCHUK) && usejoy) // Nunchuck
- {
- if(wpad->exp.nunchuk.js.pos.y >= 0xB0) btns |= WII_UP;
- if(wpad->exp.nunchuk.js.pos.y <= 0x40) btns |= WII_DOWN;
- if(wpad->exp.nunchuk.js.pos.x <= 0x40) btns |= WII_LEFT;
- if(wpad->exp.nunchuk.js.pos.x >= 0xB0) btns |= WII_RIGHT;
- }
- else // Wiimote
- {
- if(wpad->btns_h & WPAD_BUTTON_UP) btns |= WII_LEFT;
- if(wpad->btns_h & WPAD_BUTTON_DOWN) btns |= WII_RIGHT;
- if(wpad->btns_h & WPAD_BUTTON_LEFT) btns |= WII_DOWN;
- if(wpad->btns_h & WPAD_BUTTON_RIGHT) btns |= WII_UP;
- }
-
- // GameCube analog stick
- if(PAD_StickY(port) > 18) btns |= WII_UP;
- if(PAD_StickY(port) < -18) btns |= WII_DOWN;
- if(PAD_StickX(port) < -18) btns |= WII_LEFT;
- if(PAD_StickX(port) > 18) btns |= WII_RIGHT;
-
- // GameCube C-stick
- if(PAD_SubStickY(port) > 18) btns |= WII_SUB_UP;
- if(PAD_SubStickY(port) < -18) btns |= WII_SUB_DOWN;
- if(PAD_SubStickX(port) < -18) btns |= WII_SUB_LEFT;
- if(PAD_SubStickX(port) > 18) btns |= WII_SUB_RIGHT;
-
- // GameCube D-pad
- if(gcbtns & PAD_BUTTON_UP) btns |= WII_UP;
- if(gcbtns & PAD_BUTTON_DOWN) btns |= WII_DOWN;
- if(gcbtns & PAD_BUTTON_LEFT) btns |= WII_LEFT;
- if(gcbtns & PAD_BUTTON_RIGHT) btns |= WII_RIGHT;
-
- if(wpad->exp.type == WPAD_EXP_CLASSIC) // Classic Controller
- {
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_A) btns |= WII_1_A;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_B) btns |= WII_2_B;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_Y) btns |= WII_A_Y_X;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_X) btns |= WII_B_X_Y;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_MINUS) btns |= WII_MINUS;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_PLUS) btns |= WII_PLUS_START;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_HOME) btns |= WII_HOME;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_FULL_R) btns |= WII_C_R;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_FULL_L) btns |= WII_Z_L;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_ZL) btns |= WII_ZL;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_ZR) btns |= WII_ZR;
-
- }
- else // Wiimote or Wiimote + Nunchuk
- {
- if(wpad->btns_h & WPAD_BUTTON_1) btns |= WII_1_A;
- if(wpad->btns_h & WPAD_BUTTON_2) btns |= WII_2_B;
- if(wpad->btns_h & WPAD_BUTTON_A) btns |= WII_A_Y_X;
- if(wpad->btns_h & WPAD_BUTTON_B) btns |= WII_B_X_Y;
- if(wpad->btns_h & WPAD_BUTTON_MINUS) btns |= WII_MINUS;
- if(wpad->btns_h & WPAD_BUTTON_PLUS) btns |= WII_PLUS_START;
- if(wpad->btns_h & WPAD_BUTTON_HOME) btns |= WII_HOME;
- if(wpad->btns_h & WPAD_NUNCHUK_BUTTON_Z) btns |= WII_Z_L;
- if(wpad->btns_h & WPAD_NUNCHUK_BUTTON_C) btns |= WII_C_R;
- }
-
- if(gcbtns & PAD_BUTTON_X) btns |= WII_A_Y_X;
- if(gcbtns & PAD_BUTTON_Y) btns |= WII_B_X_Y;
- if(gcbtns & PAD_BUTTON_A) btns |= WII_1_A;
- if(gcbtns & PAD_BUTTON_B) btns |= WII_2_B;
- if(gcbtns & PAD_BUTTON_START) btns |= WII_PLUS_START;
- if(gcbtns & PAD_TRIGGER_R) btns |= WII_C_R;
- if(gcbtns & PAD_TRIGGER_L) btns |= WII_Z_L;
- if(gcbtns & PAD_TRIGGER_Z) btns |= WII_HOME;
-
- return lastkey[port] = btns;
-}
diff --git a/engine/wii/control.h b/engine/wii/control.h
deleted file mode 100644
index b89522c17..000000000
--- a/engine/wii/control.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * OpenBOR - https://www.chronocrash.com
- * -----------------------------------------------------------------------
- * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
-#ifndef CONTROL_H
-#define CONTROL_H
-
-#define MAX_BUTTONS 21
-
-#define WII_UP 0x00000001
-#define WII_RIGHT 0x00000002
-#define WII_DOWN 0x00000004
-#define WII_LEFT 0x00000008
-#define WII_1_A 0x00000010
-#define WII_2_B 0x00000020
-#define WII_A_Y_X 0x00000040
-#define WII_B_X_Y 0x00000080
-#define WII_MINUS 0x00000100
-#define WII_PLUS_START 0x00000200
-#define WII_HOME 0x00000400
-#define WII_R_TRIGGER 0x00000800
-#define WII_L_TRIGGER 0x00001000
-#define WII_ZR 0x00002000
-#define WII_ZL 0x00004000
-#define WII_C_R 0x00008000
-#define WII_Z_L 0x00010000
-#define WII_SUB_UP 0x00020000
-#define WII_SUB_RIGHT 0x00040000
-#define WII_SUB_DOWN 0x00080000
-#define WII_SUB_LEFT 0x00100000
-
-#define CONTROL_ESC 11
-
-#define CONTROL_DEFAULT1_UP 1
-#define CONTROL_DEFAULT1_RIGHT 2
-#define CONTROL_DEFAULT1_DOWN 3
-#define CONTROL_DEFAULT1_LEFT 4
-#define CONTROL_DEFAULT1_FIRE1 5
-#define CONTROL_DEFAULT1_FIRE2 7
-#define CONTROL_DEFAULT1_FIRE3 16
-#define CONTROL_DEFAULT1_FIRE4 17
-#define CONTROL_DEFAULT1_FIRE5 6
-#define CONTROL_DEFAULT1_FIRE6 8
-#define CONTROL_DEFAULT1_START 10
-#define CONTROL_DEFAULT1_SCREENSHOT 9
-
-#define CONTROL_DEFAULT2_UP (1+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_RIGHT (2+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_DOWN (3+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_LEFT (4+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_FIRE1 (5+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_FIRE2 (7+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_FIRE3 (16+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_FIRE4 (17+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_FIRE5 (6+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_FIRE6 (8+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_START (10+MAX_BUTTONS)
-#define CONTROL_DEFAULT2_SCREENSHOT (9+MAX_BUTTONS)
-
-#define CONTROL_DEFAULT3_UP (1+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_RIGHT (2+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_DOWN (3+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_LEFT (4+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_FIRE1 (5+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_FIRE2 (7+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_FIRE3 (16+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_FIRE4 (17+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_FIRE5 (6+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_FIRE6 (8+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_START (10+(MAX_BUTTONS*2))
-#define CONTROL_DEFAULT3_SCREENSHOT (9+(MAX_BUTTONS*2))
-
-#define CONTROL_DEFAULT4_UP (1+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_RIGHT (2+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_DOWN (3+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_LEFT (4+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_FIRE1 (5+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_FIRE2 (7+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_FIRE3 (16+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_FIRE4 (17+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_FIRE5 (6+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_FIRE6 (8+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_START (10+(MAX_BUTTONS*3))
-#define CONTROL_DEFAULT4_SCREENSHOT (9+(MAX_BUTTONS*3))
-
-#define CONTROL_NONE (1+(MAX_BUTTONS*99)) //Kratus (20-04-21) value used to clear all keys
-
-#define WII_SHUTDOWN -1
-#define WII_RESET -2
-
-typedef struct
-{
- int settings[32];
- unsigned long keyflags, newkeyflags;
- int kb_break;
-}
-s_playercontrols;
-
-void control_exit();
-void control_init(int joy_enable);
-int control_usejoy(int enable);
-int control_getjoyenabled();
-int keyboard_getlastkey();
-void control_setkey(s_playercontrols * pcontrols, unsigned int flag, int key);
-int control_scankey();
-char* control_getkeyname(unsigned int keycode);
-void control_update(s_playercontrols ** playercontrols, int numplayers);
-void control_rumble(int port, int ratio, int msec);
-unsigned long getPad(int port);
-
-#endif
-
diff --git a/engine/wii/hankaku.h b/engine/wii/hankaku.h
deleted file mode 100644
index a9ab2faf9..000000000
--- a/engine/wii/hankaku.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * OpenBOR - https://www.chronocrash.com
- * -----------------------------------------------------------------------
- * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
- const unsigned char hankaku_font10[]={
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x04,0x04,0x04,0x04,0x00,0x00,0x04,0x00,0x00,
- 0x00,0x0a,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x0a,0x0a,0x1f,0x0a,0x1f,0x0a,0x0a,0x00,0x00,
- 0x00,0x04,0x1e,0x05,0x0e,0x14,0x0f,0x04,0x00,0x00,
- 0x00,0x00,0x16,0x16,0x08,0x04,0x1a,0x1a,0x00,0x00,
- 0x00,0x04,0x0a,0x02,0x14,0x12,0x0a,0x14,0x00,0x00,
- 0x00,0x04,0x04,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x10,0x08,0x08,0x04,0x04,0x04,0x08,0x08,0x10,0x00,
- 0x02,0x04,0x04,0x08,0x08,0x08,0x04,0x04,0x02,0x00,
- 0x00,0x00,0x0a,0x04,0x1f,0x04,0x0a,0x00,0x00,0x00,
- 0x00,0x00,0x04,0x04,0x1f,0x04,0x04,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x02,0x00,
- 0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x0c,0x00,0x00,
- 0x00,0x10,0x10,0x08,0x08,0x04,0x04,0x02,0x02,0x00,
- 0x00,0x0c,0x12,0x1a,0x16,0x12,0x12,0x0c,0x00,0x00,
- 0x00,0x04,0x06,0x04,0x04,0x04,0x04,0x0e,0x00,0x00,
- 0x00,0x0c,0x12,0x10,0x08,0x04,0x02,0x1e,0x00,0x00,
- 0x00,0x0c,0x12,0x10,0x08,0x10,0x12,0x0c,0x00,0x00,
- 0x00,0x08,0x0c,0x0a,0x0a,0x1e,0x08,0x08,0x00,0x00,
- 0x00,0x1e,0x02,0x0e,0x10,0x10,0x12,0x0c,0x00,0x00,
- 0x00,0x0c,0x12,0x02,0x0e,0x12,0x12,0x0c,0x00,0x00,
- 0x00,0x1e,0x12,0x08,0x08,0x04,0x04,0x04,0x00,0x00,
- 0x00,0x0c,0x12,0x12,0x0c,0x12,0x12,0x0c,0x00,0x00,
- 0x00,0x0c,0x12,0x12,0x1c,0x10,0x12,0x0c,0x00,0x00,
- 0x00,0x00,0x0c,0x0c,0x00,0x00,0x0c,0x0c,0x00,0x00,
- 0x00,0x00,0x0c,0x0c,0x00,0x00,0x0c,0x08,0x04,0x00,
- 0x00,0x10,0x08,0x04,0x02,0x04,0x08,0x10,0x00,0x00,
- 0x00,0x00,0x00,0x1e,0x00,0x1e,0x00,0x00,0x00,0x00,
- 0x00,0x02,0x04,0x08,0x10,0x08,0x04,0x02,0x00,0x00,
- 0x00,0x0c,0x12,0x10,0x08,0x08,0x00,0x08,0x00,0x00,
- 0x00,0x0c,0x12,0x1a,0x16,0x0a,0x02,0x0c,0x00,0x00,
- 0x00,0x0c,0x12,0x12,0x1e,0x12,0x12,0x12,0x00,0x00,
- 0x00,0x0e,0x12,0x12,0x0e,0x12,0x12,0x0e,0x00,0x00,
- 0x00,0x0c,0x12,0x02,0x02,0x02,0x12,0x0c,0x00,0x00,
- 0x00,0x0e,0x12,0x12,0x12,0x12,0x12,0x0e,0x00,0x00,
- 0x00,0x1e,0x02,0x02,0x0e,0x02,0x02,0x1e,0x00,0x00,
- 0x00,0x1e,0x02,0x02,0x0e,0x02,0x02,0x02,0x00,0x00,
- 0x00,0x0c,0x12,0x02,0x1a,0x12,0x12,0x1c,0x00,0x00,
- 0x00,0x12,0x12,0x12,0x1e,0x12,0x12,0x12,0x00,0x00,
- 0x00,0x0e,0x04,0x04,0x04,0x04,0x04,0x0e,0x00,0x00,
- 0x00,0x18,0x10,0x10,0x10,0x12,0x12,0x0c,0x00,0x00,
- 0x00,0x12,0x12,0x0a,0x06,0x0a,0x12,0x12,0x00,0x00,
- 0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x1e,0x00,0x00,
- 0x00,0x12,0x1e,0x1e,0x12,0x12,0x12,0x12,0x00,0x00,
- 0x00,0x12,0x12,0x16,0x1a,0x12,0x12,0x12,0x00,0x00,
- 0x00,0x0c,0x12,0x12,0x12,0x12,0x12,0x0c,0x00,0x00,
- 0x00,0x0e,0x12,0x12,0x0e,0x02,0x02,0x02,0x00,0x00,
- 0x00,0x0c,0x12,0x12,0x12,0x16,0x1a,0x0c,0x10,0x00,
- 0x00,0x0e,0x12,0x12,0x0e,0x06,0x0a,0x12,0x00,0x00,
- 0x00,0x0c,0x12,0x02,0x0c,0x10,0x12,0x0c,0x00,0x00,
- 0x00,0x1f,0x04,0x04,0x04,0x04,0x04,0x04,0x00,0x00,
- 0x00,0x12,0x12,0x12,0x12,0x12,0x12,0x0c,0x00,0x00,
- 0x00,0x12,0x12,0x12,0x12,0x1e,0x0c,0x0c,0x00,0x00,
- 0x00,0x12,0x12,0x12,0x12,0x1e,0x1e,0x12,0x00,0x00,
- 0x00,0x12,0x12,0x12,0x0c,0x12,0x12,0x12,0x00,0x00,
- 0x00,0x11,0x11,0x0a,0x04,0x04,0x04,0x04,0x00,0x00,
- 0x00,0x1e,0x10,0x08,0x04,0x04,0x02,0x1e,0x00,0x00,
- 0x1c,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x1c,0x00,
- 0x00,0x11,0x0a,0x04,0x1f,0x04,0x1f,0x04,0x00,0x00,
- 0x0e,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x0e,0x00,
- 0x04,0x0a,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00,
- 0x00,0x04,0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x0c,0x10,0x1c,0x12,0x1c,0x00,0x00,
- 0x00,0x02,0x02,0x0e,0x12,0x12,0x12,0x0e,0x00,0x00,
- 0x00,0x00,0x00,0x0c,0x12,0x02,0x12,0x0c,0x00,0x00,
- 0x00,0x10,0x10,0x1c,0x12,0x12,0x12,0x1c,0x00,0x00,
- 0x00,0x00,0x00,0x0c,0x12,0x1e,0x02,0x0c,0x00,0x00,
- 0x00,0x18,0x04,0x1e,0x04,0x04,0x04,0x04,0x00,0x00,
- 0x00,0x00,0x00,0x1c,0x12,0x12,0x1c,0x10,0x0c,0x00,
- 0x00,0x02,0x02,0x0e,0x12,0x12,0x12,0x12,0x00,0x00,
- 0x00,0x04,0x00,0x06,0x04,0x04,0x04,0x0e,0x00,0x00,
- 0x00,0x10,0x00,0x18,0x10,0x10,0x10,0x12,0x0c,0x00,
- 0x00,0x02,0x02,0x12,0x0a,0x06,0x0a,0x12,0x00,0x00,
- 0x00,0x06,0x04,0x04,0x04,0x04,0x04,0x0e,0x00,0x00,
- 0x00,0x00,0x00,0x0b,0x15,0x15,0x15,0x15,0x00,0x00,
- 0x00,0x00,0x00,0x0e,0x12,0x12,0x12,0x12,0x00,0x00,
- 0x00,0x00,0x00,0x0c,0x12,0x12,0x12,0x0c,0x00,0x00,
- 0x00,0x00,0x00,0x0e,0x12,0x12,0x0e,0x02,0x02,0x00,
- 0x00,0x00,0x00,0x1c,0x12,0x12,0x1c,0x10,0x10,0x00,
- 0x00,0x00,0x00,0x1a,0x06,0x02,0x02,0x02,0x00,0x00,
- 0x00,0x00,0x00,0x1c,0x02,0x0c,0x10,0x0e,0x00,0x00,
- 0x00,0x04,0x04,0x1e,0x04,0x04,0x04,0x18,0x00,0x00,
- 0x00,0x00,0x00,0x12,0x12,0x12,0x12,0x1c,0x00,0x00,
- 0x00,0x00,0x00,0x12,0x12,0x12,0x0c,0x0c,0x00,0x00,
- 0x00,0x00,0x00,0x11,0x15,0x15,0x15,0x0a,0x00,0x00,
- 0x00,0x00,0x00,0x12,0x12,0x0c,0x12,0x12,0x00,0x00,
- 0x00,0x00,0x00,0x12,0x12,0x12,0x1c,0x10,0x0c,0x00,
- 0x00,0x00,0x00,0x1e,0x08,0x04,0x02,0x1e,0x00,0x00,
- 0x18,0x04,0x04,0x04,0x02,0x04,0x04,0x04,0x18,0x00,
- 0x04,0x04,0x04,0x04,0x00,0x04,0x04,0x04,0x04,0x00,
- 0x06,0x08,0x08,0x08,0x10,0x08,0x08,0x08,0x06,0x00,
- 0x1e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x0e,0x0a,0x0e,0x00,0x00,
- 0x00,0x1c,0x04,0x04,0x04,0x04,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x0e,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x04,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x1e,0x10,0x1e,0x10,0x10,0x08,0x04,0x00,0x00,
- 0x00,0x00,0x00,0x1e,0x10,0x0c,0x04,0x02,0x00,0x00,
- 0x00,0x00,0x00,0x10,0x08,0x0e,0x08,0x08,0x00,0x00,
- 0x00,0x00,0x00,0x04,0x1e,0x12,0x10,0x08,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x0e,0x04,0x04,0x0e,0x00,0x00,
- 0x00,0x00,0x00,0x08,0x1e,0x08,0x0c,0x0a,0x00,0x00,
- 0x00,0x00,0x00,0x04,0x1e,0x14,0x04,0x04,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x0c,0x08,0x08,0x1e,0x00,0x00,
- 0x00,0x00,0x00,0x1e,0x10,0x1c,0x10,0x1e,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x0a,0x1a,0x10,0x0c,0x00,0x00,
- 0x00,0x00,0x00,0x02,0x1c,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x1e,0x10,0x14,0x0c,0x04,0x04,0x02,0x00,0x00,
- 0x00,0x10,0x10,0x08,0x0c,0x0a,0x08,0x08,0x00,0x00,
- 0x00,0x04,0x1e,0x12,0x10,0x10,0x08,0x04,0x00,0x00,
- 0x00,0x00,0x0e,0x04,0x04,0x04,0x04,0x1f,0x00,0x00,
- 0x00,0x08,0x1e,0x08,0x0c,0x0c,0x0a,0x0a,0x00,0x00,
- 0x00,0x04,0x1e,0x14,0x14,0x14,0x12,0x1a,0x00,0x00,
- 0x00,0x04,0x1e,0x04,0x1e,0x08,0x08,0x08,0x00,0x00,
- 0x00,0x1c,0x14,0x12,0x10,0x10,0x08,0x04,0x00,0x00,
- 0x00,0x02,0x1e,0x0a,0x0a,0x08,0x08,0x04,0x00,0x00,
- 0x00,0x00,0x1e,0x10,0x10,0x10,0x10,0x1e,0x00,0x00,
- 0x00,0x0a,0x1f,0x0a,0x0a,0x08,0x08,0x04,0x00,0x00,
- 0x00,0x06,0x10,0x16,0x10,0x10,0x08,0x06,0x00,0x00,
- 0x00,0x1e,0x10,0x08,0x08,0x0c,0x14,0x12,0x00,0x00,
- 0x00,0x04,0x04,0x1e,0x14,0x04,0x04,0x18,0x00,0x00,
- 0x00,0x12,0x12,0x14,0x10,0x08,0x08,0x04,0x00,0x00,
- 0x00,0x1c,0x14,0x14,0x1a,0x10,0x08,0x04,0x00,0x00,
- 0x00,0x10,0x0c,0x08,0x1e,0x08,0x08,0x04,0x00,0x00,
- 0x00,0x0a,0x1a,0x1a,0x10,0x10,0x08,0x04,0x00,0x00,
- 0x00,0x0e,0x00,0x1f,0x04,0x04,0x04,0x02,0x00,0x00,
- 0x00,0x02,0x02,0x06,0x0a,0x02,0x02,0x02,0x00,0x00,
- 0x00,0x08,0x08,0x1e,0x08,0x08,0x08,0x04,0x00,0x00,
- 0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,
- 0x00,0x00,0x1e,0x10,0x0c,0x08,0x14,0x02,0x00,0x00,
- 0x00,0x04,0x1f,0x08,0x04,0x0e,0x15,0x04,0x00,0x00,
- 0x00,0x10,0x10,0x10,0x08,0x08,0x04,0x02,0x00,0x00,
- 0x00,0x04,0x08,0x10,0x12,0x12,0x12,0x12,0x00,0x00,
- 0x00,0x02,0x02,0x1e,0x02,0x02,0x02,0x1c,0x00,0x00,
- 0x00,0x1e,0x10,0x10,0x10,0x10,0x08,0x04,0x00,0x00,
- 0x00,0x00,0x04,0x0a,0x0a,0x10,0x10,0x00,0x00,0x00,
- 0x00,0x04,0x1f,0x04,0x04,0x15,0x15,0x04,0x00,0x00,
- 0x00,0x00,0x1e,0x10,0x08,0x0a,0x04,0x08,0x00,0x00,
- 0x00,0x00,0x0e,0x00,0x0e,0x00,0x0e,0x10,0x00,0x00,
- 0x00,0x08,0x04,0x04,0x02,0x12,0x1e,0x10,0x00,0x00,
- 0x00,0x10,0x10,0x14,0x08,0x18,0x14,0x02,0x00,0x00,
- 0x00,0x1e,0x04,0x1e,0x04,0x04,0x04,0x18,0x00,0x00,
- 0x00,0x04,0x1e,0x14,0x04,0x04,0x04,0x04,0x00,0x00,
- 0x00,0x00,0x0c,0x08,0x08,0x08,0x08,0x1e,0x00,0x00,
- 0x00,0x1e,0x10,0x10,0x1c,0x10,0x10,0x1e,0x00,0x00,
- 0x00,0x1e,0x00,0x1e,0x10,0x10,0x08,0x04,0x00,0x00,
- 0x00,0x12,0x12,0x12,0x10,0x10,0x08,0x04,0x00,0x00,
- 0x00,0x08,0x0a,0x0a,0x0a,0x0a,0x1a,0x0a,0x00,0x00,
- 0x00,0x02,0x02,0x02,0x02,0x12,0x0a,0x06,0x00,0x00,
- 0x00,0x1e,0x12,0x12,0x12,0x12,0x12,0x1e,0x00,0x00,
- 0x00,0x1e,0x12,0x10,0x10,0x10,0x08,0x04,0x00,0x00,
- 0x00,0x00,0x16,0x10,0x10,0x10,0x08,0x06,0x00,0x00,
- 0x00,0x04,0x08,0x02,0x04,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x04,0x0a,0x0a,0x04,0x00,0x00,0x00,0x00,0x00,
-};
-
diff --git a/engine/wii/menu.c b/engine/wii/menu.c
deleted file mode 100644
index 41be61ccd..000000000
--- a/engine/wii/menu.c
+++ /dev/null
@@ -1,835 +0,0 @@
-/*
- * OpenBOR - https://www.chronocrash.com
- * -----------------------------------------------------------------------
- * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-// Adapted from sdl/menu.c. Uses s_screen images instead of SDL surfaces.
-
-#include
-#include
-#include
-#include
-#include "wupc/wupc.h"
-#include "wiiport.h"
-#include "video.h"
-#include "control.h"
-#include "packfile.h"
-#include "hankaku.h"
-#include "stristr.h"
-
-#include "pngdec.h"
-#include "../resources/OpenBOR_Logo_480x272_png.h"
-#include "../resources/OpenBOR_Logo_320x240_png.h"
-#include "../resources/OpenBOR_Menu_480x272_png.h"
-#include "../resources/OpenBOR_Menu_320x240_png.h"
-
-#include "openbor.h"
-
-
-extern int videoMode;
-
-#define RGB32(R,G,B) ((R << 16) | ((G) << 8) | (B))
-#define RGB16(R,G,B) ((B&0xF8)<<8) | ((G&0xFC)<<3) | (R>>3)
-#define RGB(R,G,B) (bpp==16?RGB16(R,G,B):RGB32(R,G,B))
-
-#define BLACK RGB( 0, 0, 0)
-#define WHITE RGB(255, 255, 255)
-#define RED RGB(255, 0, 0)
-#define GREEN RGB( 0, 255, 0)
-#define BLUE RGB( 0, 0, 255)
-#define YELLOW RGB(255, 255, 0)
-#define PURPLE RGB(255, 0, 255)
-#define ORANGE RGB(255, 128, 0)
-#define GRAY RGB(112, 128, 144)
-#define LIGHT_GRAY RGB(223, 223, 223)
-#define DARK_RED RGB(128, 0, 0)
-#define DARK_GREEN RGB( 0, 128, 0)
-#define DARK_BLUE RGB( 0, 0, 128)
-
-#define LOG_SCREEN_TOP 2
-#define LOG_SCREEN_END (isWide ? 26 : 23)
-
-#define DIR_UP 0x00000001
-#define DIR_RIGHT 0x00000002
-#define DIR_DOWN 0x00000004
-#define DIR_LEFT 0x00000008
-#define WIIMOTE_A 0x00000010
-#define WIIMOTE_B 0x00000020
-#define WIIMOTE_1 0x00000040
-#define WIIMOTE_2 0x00000080
-#define WIIMOTE_PLUS 0x00000100
-#define WIIMOTE_MINUS 0x00000200
-#define WIIMOTE_HOME 0x00000400
-#define NUNCHUK_C 0x00000800
-#define NUNCHUK_Z 0x00001000
-#define CC_A 0x00002000
-#define CC_B 0x00004000
-#define CC_X 0x00008000
-#define CC_Y 0x00010000
-#define CC_L 0x00020000
-#define CC_R 0x00040000
-#define CC_ZL 0x00080000
-#define CC_ZR 0x00100000
-#define CC_PLUS 0x00200000
-#define CC_MINUS 0x00400000
-#define CC_HOME 0x00800000
-#define GC_A 0x01000000
-#define GC_B 0x02000000
-#define GC_X 0x04000000
-#define GC_Y 0x08000000
-#define GC_L 0x10000000
-#define GC_R 0x20000000
-#define GC_Z 0x40000000
-#define GC_START 0x80000000
-
-s_screen *Source = NULL;
-s_screen *Scaler = NULL;
-s_screen *Screen = NULL;
-int bpp = 32;
-int factor = 1;
-int isFull = 0;
-int isWide = 0;
-int flags;
-int dListTotal;
-int dListCurrentPosition;
-int dListScrollPosition;
-int which_logfile = OPENBOR_LOG;
-int buttonsHeld = 0;
-int buttonsPressed = 0;
-FILE *bgmFile = NULL;
-extern unsigned long bothkeys, bothnewkeys;
-fileliststruct *filelist;
-static s_videomodes videomodes;
-
-typedef struct{
- stringptr *buf;
- int *pos;
- int line;
- int rows;
- char ready;
-}s_logfile;
-s_logfile logfile[2];
-
-typedef struct{
- int x;
- int y;
- int width;
- int height;
-}Rect;
-
-typedef int (*ControlInput)();
-
-int ControlMenu();
-int ControlBGM();
-void PlayBGM();
-void StopBGM();
-void fillRect(s_screen* dest, Rect* rect, u32 color);
-static ControlInput pControl;
-
-int Control()
-{
- return pControl();
-}
-
-void refreshInput()
-{
- unsigned long btns = 0;
- unsigned short gcbtns;
- WPADData *wpad;
- struct WUPCData *wupc;
-
- PAD_Init();
- WUPC_Init();
- PAD_ScanPads();
- gcbtns = PAD_ButtonsDown(0) | PAD_ButtonsHeld(0);
- WUPC_UpdateButtonStats();
- WPAD_ScanPads();
- wpad = WPAD_Data(0);
- wupc = WUPC_Data(0);
-
- if(wpad->exp.type == WPAD_EXP_CLASSIC)
- {
- // Left thumb stick
- if(wpad->exp.classic.ljs.mag >= 0.3)
- {
- if (wpad->exp.classic.ljs.ang >= 310 || wpad->exp.classic.ljs.ang <= 50) btns |= DIR_UP;
- if (wpad->exp.classic.ljs.ang >= 130 && wpad->exp.classic.ljs.ang <= 230) btns |= DIR_DOWN;
- if (wpad->exp.classic.ljs.ang >= 220 && wpad->exp.classic.ljs.ang <= 320) btns |= DIR_LEFT;
- if (wpad->exp.classic.ljs.ang >= 40 && wpad->exp.classic.ljs.ang <= 140) btns |= DIR_RIGHT;
- }
- // D-pad
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_UP) btns |= DIR_UP;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_DOWN) btns |= DIR_DOWN;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_LEFT) btns |= DIR_LEFT;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_RIGHT) btns |= DIR_RIGHT;
- }
- else if (wupc != NULL) // Pro Controller
- {
- if(wupc->button & WPAD_CLASSIC_BUTTON_UP) btns |= DIR_UP;
- if(wupc->button & WPAD_CLASSIC_BUTTON_DOWN) btns |= DIR_DOWN;
- if(wupc->button & WPAD_CLASSIC_BUTTON_LEFT) btns |= DIR_LEFT;
- if(wupc->button & WPAD_CLASSIC_BUTTON_RIGHT) btns |= DIR_RIGHT;
- if(wupc->button & WPAD_CLASSIC_BUTTON_PLUS) btns |= CC_PLUS;
- if(wupc->button & WPAD_CLASSIC_BUTTON_MINUS) btns |= CC_MINUS;
- if(wupc->button & WPAD_CLASSIC_BUTTON_HOME) btns |= CC_HOME;
- if(wupc->button & WPAD_CLASSIC_BUTTON_A) btns |= CC_A;
- if(wupc->button & WPAD_CLASSIC_BUTTON_B) btns |= CC_B;
- if(wupc->button & WPAD_CLASSIC_BUTTON_Y) btns |= CC_Y;
- if(wupc->button & WPAD_CLASSIC_BUTTON_X) btns |= CC_X;
- if(wupc->button & WPAD_CLASSIC_BUTTON_FULL_R) btns |= CC_R;
- if(wupc->button & WPAD_CLASSIC_BUTTON_FULL_L) btns |= CC_L;
- if(wupc->button & WPAD_CLASSIC_BUTTON_ZL) btns |= CC_ZL;
- if(wupc->button & WPAD_CLASSIC_BUTTON_ZR) btns |= CC_ZR;
-
- //analog stick
- if(wupc->yAxisL > 200) btns |= DIR_UP;
- if(wupc->yAxisL < -200) btns |= DIR_DOWN;
- if(wupc->xAxisL > 200) btns |= DIR_RIGHT;
- if(wupc->xAxisL < -200) btns |= DIR_LEFT;
-
- }
- else if(wpad->exp.type == WPAD_EXP_NUNCHUK) // Wiimote + Nunchuk
- {
- if(wpad->exp.nunchuk.js.pos.y >= 0xB0) btns |= DIR_UP;
- if(wpad->exp.nunchuk.js.pos.y <= 0x40) btns |= DIR_DOWN;
- if(wpad->exp.nunchuk.js.pos.x <= 0x40) btns |= DIR_LEFT;
- if(wpad->exp.nunchuk.js.pos.x >= 0xB0) btns |= DIR_RIGHT;
- if(wpad->btns_h & WPAD_BUTTON_UP) btns |= DIR_UP;
- if(wpad->btns_h & WPAD_BUTTON_DOWN) btns |= DIR_DOWN;
- if(wpad->btns_h & WPAD_BUTTON_LEFT) btns |= DIR_LEFT;
- if(wpad->btns_h & WPAD_BUTTON_RIGHT) btns |= DIR_RIGHT;
- }
- else // Wiimote held sideways
- {
- if(wpad->btns_h & WPAD_BUTTON_UP) btns |= DIR_LEFT;
- if(wpad->btns_h & WPAD_BUTTON_DOWN) btns |= DIR_RIGHT;
- if(wpad->btns_h & WPAD_BUTTON_LEFT) btns |= DIR_DOWN;
- if(wpad->btns_h & WPAD_BUTTON_RIGHT) btns |= DIR_UP;
- }
-
- // GameCube analog stick and D-pad
- if(PAD_StickY(0) > 18) btns |= DIR_UP;
- if(PAD_StickY(0) < -18) btns |= DIR_DOWN;
- if(PAD_StickX(0) < -18) btns |= DIR_LEFT;
- if(PAD_StickX(0) > 18) btns |= DIR_RIGHT;
- if(gcbtns & PAD_BUTTON_UP) btns |= DIR_UP;
- if(gcbtns & PAD_BUTTON_DOWN) btns |= DIR_DOWN;
- if(gcbtns & PAD_BUTTON_LEFT) btns |= DIR_LEFT;
- if(gcbtns & PAD_BUTTON_RIGHT) btns |= DIR_RIGHT;
-
- // Controller buttons
- if(wpad->exp.type <= WPAD_EXP_NUNCHUK)
- {
- if(wpad->btns_h & WPAD_BUTTON_1) btns |= WIIMOTE_1;
- if(wpad->btns_h & WPAD_BUTTON_2) btns |= WIIMOTE_2;
- if(wpad->btns_h & WPAD_BUTTON_A) btns |= WIIMOTE_A;
- if(wpad->btns_h & WPAD_BUTTON_B) btns |= WIIMOTE_B;
- if(wpad->btns_h & WPAD_BUTTON_MINUS) btns |= WIIMOTE_MINUS;
- if(wpad->btns_h & WPAD_BUTTON_PLUS) btns |= WIIMOTE_PLUS;
- if(wpad->btns_h & WPAD_BUTTON_HOME) btns |= WIIMOTE_HOME;
- if(wpad->btns_h & WPAD_NUNCHUK_BUTTON_Z) btns |= NUNCHUK_Z;
- if(wpad->btns_h & WPAD_NUNCHUK_BUTTON_C) btns |= NUNCHUK_C;
- }
- else if(wpad->exp.type == WPAD_EXP_CLASSIC)
- {
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_A) btns |= CC_A;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_B) btns |= CC_B;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_Y) btns |= CC_Y;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_X) btns |= CC_X;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_MINUS) btns |= CC_MINUS;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_PLUS) btns |= CC_PLUS;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_HOME) btns |= CC_HOME;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_FULL_R) btns |= CC_R;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_FULL_L) btns |= CC_L;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_ZL) btns |= CC_ZL;
- if(wpad->btns_h & WPAD_CLASSIC_BUTTON_ZR) btns |= CC_ZR;
- }
- else
- {
- if(gcbtns & PAD_BUTTON_X) btns |= GC_X;
- if(gcbtns & PAD_BUTTON_Y) btns |= GC_Y;
- if(gcbtns & PAD_BUTTON_A) btns |= GC_A;
- if(gcbtns & PAD_BUTTON_B) btns |= GC_B;
- if(gcbtns & PAD_TRIGGER_R) btns |= GC_R;
- if(gcbtns & PAD_TRIGGER_L) btns |= GC_L;
- if(gcbtns & PAD_TRIGGER_Z) btns |= GC_Z;
- if(gcbtns & PAD_BUTTON_START) btns |= GC_START;
- }
-
- // update buttons pressed (not held)
- buttonsPressed = btns & ~buttonsHeld;
- buttonsHeld = btns;
-}
-
-void getAllLogs()
-{
- int i, j, k;
- for(i=0; i<2; i++)
- {
- logfile[i].buf = readFromLogFile(i);
- if(logfile[i].buf != NULL)
- {
- logfile[i].pos = malloc(++logfile[i].rows * sizeof(int));
- if(logfile[i].pos == NULL) return;
- memset(logfile[i].pos, 0, logfile[i].rows * sizeof(int));
-
- for(k=0, j=0; jsize; j++)
- {
- if(!k)
- {
- logfile[i].pos[logfile[i].rows - 1] = j;
- k = 1;
- }
- if(logfile[i].buf->ptr[j]=='\n')
- {
- int *_pos = malloc(++logfile[i].rows * sizeof(int));
- if(_pos == NULL) return;
- memcpy(_pos, logfile[i].pos, (logfile[i].rows - 1) * sizeof(int));
- _pos[logfile[i].rows - 1] = 0;
- free(logfile[i].pos);
- logfile[i].pos = NULL;
- logfile[i].pos = malloc(logfile[i].rows * sizeof(int));
- if(logfile[i].pos == NULL) return;
- memcpy(logfile[i].pos, _pos, logfile[i].rows * sizeof(int));
- free(_pos);
- _pos = NULL;
- logfile[i].buf->ptr[j] = 0;
- k = 0;
- }
- if(logfile[i].buf->ptr[j]=='\r') logfile[i].buf->ptr[j] = 0;
- if(logfile[i].rows>0xFFFFFFFE) break;
- }
- logfile[i].ready = 1;
- }
- }
-}
-
-void freeAllLogs()
-{
- int i;
- for(i=0; i<2; i++)
- {
- if(logfile[i].ready)
- {
- free(logfile[i].buf);
- logfile[i].buf = NULL;
- free(logfile[i].pos);
- logfile[i].pos = NULL;
- }
- }
-}
-
-void sortList()
-{
- int i, j;
- fileliststruct temp;
- if(dListTotal<2) return;
- for(j=dListTotal-1; j>0; j--)
- {
- for(i=0; i0)
- {
- temp = filelist[i];
- filelist[i] = filelist[i+1];
- filelist[i+1] = temp;
- }
- }
- }
-}
-
-static int findPaks(void)
-{
- int i = 0;
- DIR* dp = NULL;
- struct dirent* ds;
- dp = opendir(paksDir);
- if(dp != NULL)
- {
- while((ds = readdir(dp)) != NULL)
- {
- if(packfile_supported(ds->d_name))
- {
- fileliststruct *copy = NULL;
- if(filelist == NULL) filelist = malloc(sizeof(fileliststruct));
- else
- {
- copy = malloc(i * sizeof(fileliststruct));
- memcpy(copy, filelist, i * sizeof(fileliststruct));
- free(filelist);
- filelist = malloc((i + 1) * sizeof(fileliststruct));
- memcpy(filelist, copy, i * sizeof(fileliststruct));
- free(copy); copy = NULL;
- }
- memset(&filelist[i], 0, sizeof(fileliststruct));
- strcpy(filelist[i].filename, ds->d_name);
- i++;
- }
- }
- closedir(dp);
- }
- return i;
-}
-
-void copyScreens(s_screen *Image)
-{
- // Copy Logo or Menu from Source to Scaler to give us a background
- // prior to printing to this s_screen.
- copyscreen_o(Scaler, Image, 0, 0);
-}
-
-void writeToScreen(s_screen* src)
-{
- copyscreen(Screen, src);
-}
-
-void drawScreens(s_screen *Image, int x, int y)
-{
- if(Image)
- {
- putscreen(Scaler, Image, x, y, NULL);
- freescreen(&Image);
- Image = NULL;
- }
- writeToScreen(Scaler);
- video_copy_screen(Screen);
-}
-
-void printText(int x, int y, int col, int backcol, int fill, char *format, ...)
-{
- int x1, y1, i;
- unsigned long data;
- unsigned short *line16 = NULL;
- unsigned long *line32 = NULL;
- unsigned char *font;
- unsigned char ch = 0;
- char buf[128] = {""};
- va_list arglist;
- va_start(arglist, format);
- vsprintf(buf, format, arglist);
- va_end(arglist);
- if(factor > 1){ y += 5; }
-
- for(i=0; idata + x + y * Scaler->width;
- else line32 = (unsigned long *)Scaler->data + x + y * Scaler->width;
-
- for (y1=0; y1<10; y1++)
- {
- data = *font++;
- for (x1=0; x1<5; x1++)
- {
- if (data & 1)
- {
- if (bpp == 16) *line16 = col;
- else *line32 = col;
- }
- else if (fill)
- {
- if (bpp == 16) *line16 = backcol;
- else *line32 = backcol;
- }
-
- if (bpp == 16) line16++;
- else line32++;
-
- data = data >> 1;
- }
- if (bpp == 16) line16 += Scaler->width-5;
- else line32 += Scaler->width-5;
- }
- x+=5;
- }
-}
-
-s_screen *getPreview(char *filename)
-{
- int width = 160; //preview width
- int height = 120; //preview height
- s_screen *title = NULL;
- s_screen *scale = NULL;
- FILE *preview = NULL;
-
- char ssPath[MAX_FILENAME_LEN] = "";
- getBasePath(ssPath,"ScreenShots/",0); //get screenshots directory from base path
- strncat(ssPath, filename, strrchr(filename, '.') - filename); //remove extension from pak filename
- strcat(ssPath, " - 0000.png"); //add to end of pak filename
- preview = fopen(ssPath, "r"); //open preview image
-
- if(preview) //if preview image found
- {
- fclose(preview); //close preview image
- strcpy(packfile,"null.file"); //dummy pak file since we are loading outside a pak file
-
- //Create & Load & Scale Image
- if(!loadscreen32(ssPath, packfile, &title)) return NULL; //exit if image screen not loaded
- if((scale = allocscreen(width, height, title->pixelformat)) == NULL) return NULL; //exit if scaled screen not
- scalescreen32(scale, title); //copy image to scaled down screen
-
- } else { return NULL; }
-
- // ScreenShots within Menu will be saved as "Menu"
- strncpy(packfile,"Menu.ext",MAX_FILENAME_LEN);
-
- // Free Images and Terminate FileCaching
- if(title) freescreen(&title); //free image screen
- return scale; // return scaled down screen
-}
-
-int ControlMenu()
-{
- int status = -1;
- int dListMaxDisplay = 17;
- //bothnewkeys = 0;
- //inputrefresh(0);
- refreshInput();
- switch(buttonsPressed)
- {
- case DIR_UP:
- dListScrollPosition--;
- if(dListScrollPosition < 0)
- {
- dListScrollPosition = 0;
- dListCurrentPosition--;
- }
- if(dListCurrentPosition < 0) dListCurrentPosition = 0;
- break;
-
- case DIR_DOWN:
- dListCurrentPosition++;
- if(dListCurrentPosition > dListTotal - 1) dListCurrentPosition = dListTotal - 1;
- if(dListCurrentPosition > dListMaxDisplay)
- {
- if((dListCurrentPosition+dListScrollPosition) < dListTotal) dListScrollPosition++;
- dListCurrentPosition = dListMaxDisplay;
- }
- break;
-
- case DIR_LEFT:
- break;
-
- case DIR_RIGHT:
- break;
-
- case WIIMOTE_PLUS:
- case WIIMOTE_2:
- case CC_PLUS:
- case CC_A:
- case GC_START:
- case GC_A:
- // Start Engine!
- status = 1;
- break;
-
- case WIIMOTE_HOME: // TODO? make a nice-looking Home menu
- case CC_HOME:
- case GC_Z:
- // Exit Engine!
- status = 2;
- break;
-
- case WIIMOTE_1:
- case CC_X:
- case GC_X:
- status = 3;
- break;
-
- default:
- // No Update Needed!
- status = 0;
- break;
- }
- return status;
-}
-
-void initMenu(int type)
-{
- // Read Logo or Menu from Array.
- if(!type) Source = pngToScreen(isWide ? (void*) openbor_logo_480x272_png.data : (void*) openbor_logo_320x240_png.data);
- else Source = pngToScreen(isWide ? (void*) openbor_menu_480x272_png.data : (void*) openbor_menu_320x240_png.data);
-
- // Depending on which mode we are in (WideScreen/FullScreen)
- // allocate proper size for final screen.
- Screen = allocscreen(Source->width, Source->height, PIXEL_32);
-
- // Allocate Scaler.
- Scaler = allocscreen(Screen->width, Screen->height, PIXEL_32);
-
- control_init(2);
- apply_controls();
-}
-
-void termMenu()
-{
- freescreen(&Source);
- Source = NULL;
- freescreen(&Scaler);
- Scaler = NULL;
- freescreen(&Screen);
- Screen = NULL;
- control_exit();
-}
-
-void drawMenu()
-{
- s_screen *Image = NULL;
- char listing[45] = {""};
- int list = 0;
- int shift = 0;
- int colors = 0;
- int clipX=0, clipY=0;
-
- copyScreens(Source);
- if(dListTotal < 1) printText((isWide ? 30 : 8), (isWide ? 33 : 24), RED, 0, 0, "No modules In Paks Folder!");
- for(list=0; list (isWide ? 44 : 28))
- safe_strncpy(listing, filelist[list+dListScrollPosition].filename, (isWide ? 44 : 28));
- if(list == dListCurrentPosition)
- {
- shift = 2;
- colors = RED;
- Image = getPreview(filelist[list+dListScrollPosition].filename);
- if(Image)
- {
- clipX = factor * (isWide ? 286 : 155);
- clipY = factor * (isWide ? (factor == 4 ? (s16)32.5 : 32) : (factor == 4 ? (s16)21.5 : 21));
- }
- //else printText((isWide ? 288 : 157), (isWide ? 141 : 130), RED, 0, 0, "No Preview Available!");
- }
- printText((isWide ? 30 : 7) + shift, (isWide ? 33 : 22)+(11*list) , colors, 0, 0, "%s", listing);
- }
- }
-
- printText((isWide ? 26 : 5), (isWide ? 11 : 4), WHITE, 0, 0, "OpenBoR %s", VERSION);
- printText((isWide ? 392 : 261),(isWide ? 11 : 4), WHITE, 0, 0, __DATE__);
- printText((isWide ? 23 : 4),(isWide ? 251 : 226), WHITE, 0, 0, "%s: Start Game", control_getkeyname(savedata.keys[0][SDID_ATTACK]));
- printText((isWide ? 150 : 84),(isWide ? 251 : 226), WHITE, 0, 0, "%s: BGM Player", control_getkeyname(savedata.keys[0][SDID_ATTACK2]));
- printText((isWide ? 270 : 164),(isWide ? 251 : 226), WHITE, 0, 0, "%s: View Logs", control_getkeyname(savedata.keys[0][SDID_JUMP]));
- printText((isWide ? 390 : 244),(isWide ? 251 : 226), WHITE, 0, 0, "%s: Quit Game", control_getkeyname(savedata.keys[0][SDID_SPECIAL]));
- printText((isWide ? 330 : 197),(isWide ? 170 : 155), BLACK, 0, 0, "www.LavaLit.com");
- printText((isWide ? 322 : 190),(isWide ? 180 : 165), BLACK, 0, 0, "www.SenileTeam.com");
-
-#ifdef SPK_SUPPORTED
- printText((isWide ? 324 : 192),(isWide ? 191 : 176), DARK_RED, 0, 0, "SecurePAK Edition");
-#endif
-
- if(Image)
- {
- //draw screen with the preview image
- drawScreens(Image, clipX, clipY);
- }
- else
- {
- //draw screen without preview
- drawScreens(NULL, 0, 0);
- }
-}
-
-void drawLogs()
-{
- int i=which_logfile, j, k, l, done=0;
- s_screen *Viewer = NULL;
-
- bothkeys = bothnewkeys = 0;
- Viewer = allocscreen(Source->width, Source->height, Source->pixelformat);
- clearscreen(Viewer);
- bothkeys = bothnewkeys = 0;
-
- while(!done)
- {
- copyScreens(Viewer);
- //inputrefresh(0);
- refreshInput();
- printText((isWide ? 410 : 250), 3, RED, 0, 0, "Quit : 1/B");
- if(buttonsPressed & (WIIMOTE_1|CC_B|GC_B)) done = 1;
-
- if(logfile[i].ready)
- {
- printText(5, 3, RED, 0, 0, "OpenBorLog.txt");
- if(buttonsHeld & DIR_UP) --logfile[i].line;
- if(buttonsHeld & DIR_DOWN) ++logfile[i].line;
- if(buttonsHeld & DIR_LEFT) logfile[i].line = 0;
- if(buttonsHeld & DIR_RIGHT) logfile[i].line = logfile[i].rows - (LOG_SCREEN_END - LOG_SCREEN_TOP);
- if(logfile[i].line > logfile[i].rows - (LOG_SCREEN_END - LOG_SCREEN_TOP) - 1) logfile[i].line = logfile[i].rows - (LOG_SCREEN_END - LOG_SCREEN_TOP) - 1;
- if(logfile[i].line < 0) logfile[i].line = 0;
- for(l=LOG_SCREEN_TOP, j=logfile[i].line; jptr[logfile[i].pos[j]+k]) break;
- textpad[k] = logfile[i].buf->ptr[logfile[i].pos[j]+k];
- }
- if(logfile[i].rows>0xFFFF)
- printText(5, l*10, WHITE, 0, 0, "0x%08x: %s", j, textpad);
- else
- printText(5, l*10, WHITE, 0, 0, "0x%04x: %s", j, textpad);
- }
- else break;
- }
- }
- else if(i == SCRIPT_LOG) printText(5, 3, RED, 0, 0, "Log NOT Found: ScriptLog.txt");
- else printText(5, 3, RED, 0, 0, "Log NOT Found: OpenBorLog.txt");
-
- drawScreens(NULL, 0, 0);
- }
- freescreen(&Viewer);
- Viewer = NULL;
- drawMenu();
-}
-
-void drawLogo()
-{
- unsigned startTime;
- initMenu(0);
- copyScreens(Source);
- drawScreens(NULL, 0, 0);
- vga_vwait();
- startTime = timer_gettick();
-
- // The logo displays for 2 seconds. Let's put that time to good use.
- dListTotal = findPaks();
-
- while(1) { // display logo for remainder of time
- if(timer_gettick() - startTime >= 2000) break;
- }
- termMenu();
-}
-
-void fillRect(s_screen *dest, Rect *rect, u32 color)
-{
- u32 *data = (u32*)dest->data;
- int x, y, width=dest->width;
- for(y=rect->y; yy+rect->height; y++)
- {
- for(x=rect->x; xx+rect->width; x++)
- {
- data[x+y*width] = color;
- }
- }
-}
-
-void setVideoMode()
-{
- if(isWide) // 480x272
- {
- videomodes.mode = savedata.screen[videoMode][0];
- videomodes.filter = savedata.screen[videoMode][1];
- videomodes.hRes = 480;
- videomodes.vRes = 272;
- videomodes.hScale = (float)1.5;
- videomodes.vScale = (float)1.13;
- videomodes.hShift = 80;
- videomodes.vShift = 20;
- videomodes.dOffset = 263;
- videomodes.pixel = 4;
- }
- else // 320x240
- {
- videomodes.mode = savedata.screen[videoMode][0];
- videomodes.filter = savedata.screen[videoMode][1];
- videomodes.hRes = 320;
- videomodes.vRes = 240;
- videomodes.hScale = 1;
- videomodes.vScale = 1;
- videomodes.hShift = 0;
- videomodes.vShift = 0;
- videomodes.dOffset = 231;
- videomodes.pixel = 4;
- }
-
- video_set_mode(videomodes);
-}
-
-void Menu()
-{
- int done = 0;
- int ctrl = 0;
-
- // Set video mode based on aspect ratio
- if(CONF_GetAspectRatio() == CONF_ASPECT_16_9) isWide = 1;
- setVideoMode();
- drawLogo();
-
- // Skips menu if we already have a .pak to load
- int quicklaunch = (packfile[0] == '\0') ? 0 : 1;
-
- if(!quicklaunch)
- {
- dListTotal = findPaks();
- dListCurrentPosition = 0;
- if(dListTotal != 1)
- {
- sortList();
- getAllLogs();
- initMenu(1);
- drawMenu();
- pControl = ControlMenu;
-
- while(!done)
- {
- ctrl = Control();
- switch(ctrl)
- {
- case 1:
- if (dListTotal > 0) done = 1;
- break;
-
- case 2:
- done = 1;
- break;
-
- case 3:
- drawLogs();
- break;
-
- case -1:
- drawMenu();
- break;
-
- case -2:
- // BGM player isn't supported
- break;
-
- default:
- break;
- }
- }
- freeAllLogs();
- termMenu();
- if(ctrl == 2)
- {
- if (filelist)
- {
- free(filelist);
- filelist = NULL;
- }
- borExit(0);
- }
- }
- getBasePath(packfile, filelist[dListCurrentPosition+dListScrollPosition].filename, 1);
- }
- free(filelist);
-}
-
diff --git a/engine/wii/menu.h b/engine/wii/menu.h
deleted file mode 100644
index 41167787a..000000000
--- a/engine/wii/menu.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * OpenBOR - https://www.chronocrash.com
- * -----------------------------------------------------------------------
- * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
-#ifndef MENU_H
-#define MENU_H
-
-void Menu();
-
-#endif
-
diff --git a/engine/wii/sblaster.c b/engine/wii/sblaster.c
deleted file mode 100644
index 279b70030..000000000
--- a/engine/wii/sblaster.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * OpenBOR - http://www.chronocrash.com
- * -----------------------------------------------------------------------
- * All rights reserved, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
-/* This code was derived from code carrying the following copyright notice:
-
- Copyright (c) 2008 Francisco Muñoz 'Hermes'
- All rights reserved.
-
- Proper (standard) vorbis usage by Tantric, 2009
- Threading modifications/corrections by Tantric, 2009
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- - Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- - Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- - The names of the contributors may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include
-#include
-#include
-#include
-
-#include "globals.h"
-#include "sblaster.h"
-#include "soundmix.h"
-
-#define READ_SAMPLES 4*1024//4096 // samples that must be read before sending to hardware
-#define MAX_PCMOUT 4*1024//4096 // minimum samples to mix
-#define STACKSIZE 8*1024//8192
-
-typedef struct
-{
- int flag;
- int volume;
- int samplerate;
- short pcmout[2][READ_SAMPLES + MAX_PCMOUT * 2]; /* take 4k out of the data segment, not the stack */
- int pcmout_pos;
- int pcm_indx;
-} private_data;
-
-static private_data sb_private;
-
-static u8 sb_stack[STACKSIZE];
-static lwpq_t sb_queue = LWP_TQUEUE_NULL;
-static lwp_t sb_thread = LWP_THREAD_NULL;
-static int sb_thread_running = 0;
-
-static int sb_inited = 0;
-
-static void SB_init()
-{
- if (sb_inited) return;
- AUDIO_Init(NULL);
- ASND_Init();
- ASND_Pause(0);
- sb_inited = 1;
-}
-
-void SB_exit()
-{
- ASND_Pause(1);
- ASND_End();
- sb_inited = 0;
-}
-
-static void SB_Callback(int voice)
-{
- if (!sb_thread_running)
- {
- ASND_StopVoice(0);
- }
- else
- {
- if (sb_private.pcm_indx >= READ_SAMPLES)
- {
- if (ASND_AddVoice(0,
- (void *) sb_private.pcmout[sb_private.pcmout_pos],
- sb_private.pcm_indx << 1) == 0)
- {
- sb_private.pcmout_pos ^= 1;
- sb_private.pcm_indx = 0;
- sb_private.flag = 0;
- LWP_ThreadSignal(sb_queue);
- }
- }
- else
- {
- if (sb_private.flag & 64)
- {
- sb_private.flag &= ~64;
- LWP_ThreadSignal(sb_queue);
- }
- }
- }
-
- return;
-}
-
-static void *SB_Thread(private_data * priv)
-{
- int first_time = 1;
-
- LWP_InitQueue(&sb_queue);
- ASND_Pause(0);
-
- priv[0].pcm_indx = 0;
- priv[0].pcmout_pos = 0;
- priv[0].flag = 0;
-
- sb_thread_running = 1;
-
- while (sb_thread_running)
- {
- if (priv[0].flag)
- LWP_ThreadSleep(sb_queue);
-
- if (priv[0].flag == 0) // wait until all samples are sent
- {
- if (ASND_TestPointer(0, priv[0].pcmout[priv[0].pcmout_pos])
- && ASND_StatusVoice(0) != SND_UNUSED)
- {
- priv[0].flag |= 64;
- continue;
- }
- if (priv[0].pcm_indx < READ_SAMPLES)
- {
- priv[0].flag = 3;
-
- update_sample((u8 *) &priv[0].pcmout[priv[0].pcmout_pos][priv[0].pcm_indx], MAX_PCMOUT);
- priv[0].flag &= 192;
- priv[0].pcm_indx += MAX_PCMOUT >> 1; //16 bit samples
- }
- else
- priv[0].flag = 1;
- }
-
- if (priv[0].flag == 1)
- {
- if (ASND_StatusVoice(0) == SND_UNUSED || first_time)
- {
- first_time = 0;
- ASND_SetVoice(0, VOICE_STEREO_16BIT, priv[0].samplerate, 0,
- (void *) priv[0].pcmout[priv[0].pcmout_pos],
- priv[0].pcm_indx << 1, priv[0].volume,
- priv[0].volume, SB_Callback);
- priv[0].pcmout_pos ^= 1;
- priv[0].pcm_indx = 0;
- priv[0].flag = 0;
- }
- }
- usleep(100);
- }
- priv[0].pcm_indx = 0;
-
- return 0;
-}
-
-void SB_playstop()
-{
- ASND_StopVoice(0);
- sb_thread_running = 0;
-
- if(sb_thread != LWP_THREAD_NULL)
- {
- if(sb_queue != LWP_TQUEUE_NULL)
- LWP_ThreadSignal(sb_queue);
- LWP_JoinThread(sb_thread, NULL);
- sb_thread = LWP_THREAD_NULL;
- }
- if(sb_queue != LWP_TQUEUE_NULL)
- {
- LWP_CloseQueue(sb_queue);
- sb_queue = LWP_TQUEUE_NULL;
- }
-}
-
-int SB_playstart(int bits, int samplerate)
-{
- SB_init();
- SB_playstop();
-
- sb_private.volume = 127;
- sb_private.flag = 0;
- sb_private.samplerate = samplerate;
-
- if (LWP_CreateThread(&sb_thread, (void *) SB_Thread,
- &sb_private, sb_stack, STACKSIZE, 80) == -1) // 80 prio
- {
- sb_thread_running = 0;
- return 0;
- }
- return 1;
-}
-
-void SB_setvolume(char dev, char volume)
-{
-}
-
-void SB_updatevolume(int volume)
-{
-}
diff --git a/engine/wii/sblaster.h b/engine/wii/sblaster.h
deleted file mode 100644
index e46f9148b..000000000
--- a/engine/wii/sblaster.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * OpenBOR - https://www.chronocrash.com
- * -----------------------------------------------------------------------
- * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
-#ifndef SBLASTER_H
-#define SBLASTER_H
-
-#define MAXDMABUFSIZE 0x10000
-#define MONO 0
-#define STEREO 1
-#define LOWQ 0
-#define HIGHQ 2
-#define SBDETECT -1
-#define SB_MASTERVOL 0x22
-#define SB_VOICEVOL 0x04
-#define SB_CDVOL 0x28
-
-// Globals
-extern char *errptr;
-
-// The interface
-int SB_playstart(int bits, int samplerate);
-void SB_playstop();
-
-//int SB_getvolume(char dev);
-void SB_setvolume(char dev, char volume);
-void SB_updatevolume(int volume);
-
-#endif
diff --git a/engine/wii/threads.c b/engine/wii/threads.c
deleted file mode 100644
index 65efb971e..000000000
--- a/engine/wii/threads.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * OpenBOR - http://www.chronocrash.com
- * -----------------------------------------------------------------------
- * All rights reserved, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
-#include
-#include
-#include
-#include "threads.h"
-
-#define LWP_RETCODE(X) ((X) == 0 ? 0 : -1)
-
-struct bor_thread {
- lwp_t thread;
- int (*run)(void *);
- void *data;
-};
-
-static void *run_thread(void *data)
-{
- bor_thread *thread = (bor_thread*)data;
- return (void*)thread->run(thread->data);
-}
-
-bor_thread *thread_create(int (*fn)(void *), const char *name, void *data)
-{
- bor_thread *thread = malloc(sizeof(bor_thread));
- thread->run = fn;
- thread->data = data;
- LWP_CreateThread(&thread->thread, run_thread, thread, NULL, 0, 64);
- return thread;
-}
-
-void thread_join(bor_thread *thread)
-{
- void *status;
- LWP_JoinThread(thread->thread, &status);
- free(thread);
-}
-
-bor_mutex *mutex_create(void)
-{
- mutex_t *mutex = malloc(sizeof(mutex_t));
- if (LWP_MutexInit(mutex, 0) != 0) return NULL;
- return mutex;
-}
-
-void mutex_destroy(bor_mutex *mutex)
-{
- LWP_MutexDestroy(*mutex);
- free(mutex);
-}
-
-int mutex_lock(bor_mutex *mutex)
-{
- return LWP_RETCODE(LWP_MutexLock(*mutex));
-}
-
-int mutex_unlock(bor_mutex *mutex)
-{
- return LWP_RETCODE(LWP_MutexUnlock(*mutex));
-}
-
-bor_cond *cond_create()
-{
- cond_t *cond = malloc(sizeof(cond_t));
- if (LWP_CondInit(cond) != 0) return NULL;
- return cond;
-}
-
-void cond_destroy(bor_cond *cond)
-{
- LWP_CondDestroy(*cond);
- free(cond);
-}
-
-int cond_signal(bor_cond *cond)
-{
- return LWP_RETCODE(LWP_CondSignal(*cond));
-}
-
-int cond_broadcast(bor_cond *cond)
-{
- return LWP_RETCODE(LWP_CondBroadcast(*cond));
-}
-
-int cond_wait(bor_cond *cond, bor_mutex *mutex)
-{
- return LWP_RETCODE(LWP_CondWait(*cond, *mutex));
-}
-
-int cond_wait_timed(bor_cond *cond, bor_mutex *mutex, int ms)
-{
- struct timespec time_to_wait;
- time_to_wait.tv_sec = ms / 1000;
- time_to_wait.tv_nsec = ((long)(ms % 1000)) * 1000000;
- return LWP_RETCODE(LWP_CondTimedWait(*cond, *mutex, &time_to_wait));
-}
diff --git a/engine/wii/timer.c b/engine/wii/timer.c
deleted file mode 100644
index f904d49df..000000000
--- a/engine/wii/timer.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * OpenBOR - https://www.chronocrash.com
- * -----------------------------------------------------------------------
- * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
-
-#include
-#include "timer.h"
-
-#define GETTIME_FREQ 1000
-
-static unsigned lastinterval = 0;
-unsigned newticks = 0;
-
-void borTimerInit(){}
-void borTimerExit(){}
-
-unsigned timer_getinterval(unsigned freq)
-{
- unsigned tickspassed,ebx,blocksize,now;
- now=timer_gettick()-newticks;
- ebx=now-lastinterval;
- blocksize=GETTIME_FREQ/freq;
- ebx+=GETTIME_FREQ%freq;
- tickspassed=ebx/blocksize;
- ebx-=ebx%blocksize;
- lastinterval+=ebx;
- return tickspassed;
-}
-
-unsigned timer_gettick()
-{
- return gettime() / TB_TIMER_CLOCK;
-}
-
-u64 timer_uticks()
-{
- return timer_gettick() * 1000LL;
-}
-
-unsigned get_last_interval()
-{
- return lastinterval;
-}
-
-void set_last_interval(unsigned value)
-{
- lastinterval = value;
-}
-
-void set_ticks(unsigned value)
-{
- newticks = value;
-}
-
-
diff --git a/engine/wii/video.c b/engine/wii/video.c
deleted file mode 100644
index 3b1c62f3a..000000000
--- a/engine/wii/video.c
+++ /dev/null
@@ -1,543 +0,0 @@
-/*
- * OpenBOR - https://www.chronocrash.com
- * -----------------------------------------------------------------------
- * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
-#include
-#include
-#include
-#include
-#include
-#include "types.h"
-#include "video.h"
-#include "vga.h"
-#include "globals.h"
-#include "screen.h"
-
-#define DEFAULT_FIFO_SIZE (256*1024)
-#define STACK_SIZE 16384
-static unsigned char gp_fifo[DEFAULT_FIFO_SIZE] ATTRIBUTE_ALIGN(32);
-static GXRModeObj* vmode;
-static void* xfb[2] = {NULL, NULL};
-static int whichbuffer = 0;
-static int whichtexture = 0;
-
-static Mtx44 perspective;
-static Mtx modelview;
-
-static GXTexObj texture[2];
-static void* texturemem[2] = {NULL, NULL};
-static int texturemem_size;
-
-static GXTlutObj tlut;
-static unsigned short palette[256] ATTRIBUTE_ALIGN(32);
-
-static int inited = 0;
-static int stretch = 0;
-
-static int brightness = 0;
-static int brightness_update = 0;
-static int _gamma = 0;
-static int _gamma_update = 0;
-
-int xoffset, yoffset;
-int viewportWidth, viewportHeight; // resolution of TV screen
-int scaledWidth, scaledHeight;
-int textureWidth, textureHeight; // dimensions of game screen
-
-static s_screen *yuvScreen;
-
-static int bytes_per_pixel;
-
-/**
- * Initializes GX, the API used for communicating with the Flipper/Hollywood GPU.
- */
-void video_gx_init()
-{
- GXColor background = {0, 0, 0, 0xff};
-
- // clear out FIFO area and initialize GX
- memset(gp_fifo, 0, DEFAULT_FIFO_SIZE);
- GX_Init(gp_fifo, DEFAULT_FIFO_SIZE);
-
- // clear the screen to black when GX_CopyDisp is called with clear=GX_TRUE
- GX_SetCopyClear(background, 0x00ffffff);
-
- // set up viewport
- GX_SetViewport(0, 0, vmode->fbWidth, vmode->efbHeight, 0, 1);
- GX_SetScissor(0, 0, vmode->fbWidth, vmode->efbHeight);
-
- // other GX setup
- GX_SetDispCopySrc(0, 0, vmode->fbWidth, vmode->efbHeight);
- GX_SetDispCopyDst(vmode->fbWidth, vmode->xfbHeight);
- GX_SetDispCopyYScale(GX_GetYScaleFactor(vmode->efbHeight, vmode->xfbHeight));
- GX_SetCopyFilter(vmode->aa, vmode->sample_pattern, GX_TRUE, vmode->vfilter);
- GX_SetPixelFmt(vmode->aa ? GX_PF_RGB565_Z16 : GX_PF_RGB8_Z24, GX_ZC_LINEAR);
- GX_SetCullMode(GX_CULL_NONE);
- GX_SetFieldMode(vmode->field_rendering, ((vmode->viHeight == 2*vmode->xfbHeight) ? GX_ENABLE : GX_DISABLE));
- GX_SetColorUpdate(GX_TRUE);
- GX_SetZMode(GX_DISABLE, GX_ALWAYS, GX_DISABLE);
-
- // set up the vertex descriptors - tell the Flipper/Hollywood to expect direct, floating-point data
- GX_ClearVtxDesc();
- GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
- GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
- GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XY, GX_F32, 0);
- GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
-
- /* set up Texture Environment (TEV), although the brightness/_gamma adjustment
- * in video_render_screen() will override parts of this configuration later */
- GX_SetNumChans(0);
- GX_SetNumTexGens(1);
- GX_SetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
- GX_SetNumTevStages(1);
- GX_SetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_TEXC);
- GX_SetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
- GX_SetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA);
- GX_SetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
- video_set_color_correction(0, 0);
-
- // set up an orthographic perspective
- guOrtho(perspective, 0, viewportHeight-1, 0, viewportWidth-1, 0, 300);
- GX_LoadProjectionMtx(perspective, GX_ORTHOGRAPHIC);
-
- // set up the model view
- guMtxIdentity(modelview);
- GX_LoadPosMtxImm(modelview, GX_PNMTX0);
-
- // initialize texture look-up table (TLUT) used in 8-bit (indexed) color mode
- GX_InitTlutObj(&tlut, palette, GX_TL_RGB565, 256);
-}
-
-/**
- * Initialize the video, including GX. This functon calls VIDEO_Init(), which
- * in turn initializes libogc, so this function must be called before making any
- * libogc calls.
- */
-void video_init()
-{
- if(inited) return;
-
- VIDEO_Init();
- vmode = VIDEO_GetPreferredMode(NULL);
-
- // widescreen fix
- viewportHeight = vmode->xfbHeight;
- viewportWidth = vmode->fbWidth;
- if(CONF_GetAspectRatio() == CONF_ASPECT_16_9)
- {
- viewportWidth = viewportHeight * 16 / 9;
- vmode->viXOrigin = 5;
- vmode->viWidth = VI_MAX_WIDTH_NTSC - 10;
- }
-
- VIDEO_Configure(vmode);
-
- // allocate 2 video buffers for double buffering
- xfb[0] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(vmode));
- xfb[1] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(vmode));
-
- // clear framebuffers, etc.
- VIDEO_ClearFrameBuffer(vmode, xfb[0], COLOR_BLACK);
- VIDEO_ClearFrameBuffer(vmode, xfb[1], COLOR_BLACK);
- VIDEO_SetNextFramebuffer(xfb[whichbuffer]);
- VIDEO_SetBlack(FALSE);
- VIDEO_Flush();
- VIDEO_WaitVSync();
- if(vmode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync();
-
- // initialize GX
- video_gx_init();
-
- inited = 1;
- // finally, the video is up and ready for use :)
-}
-
-/**
- * Uninitialize the video.
- */
-void video_exit()
-{
- if(!inited) return;
- if(texturemem[0]) free(texturemem[0]);
- if(texturemem[1]) free(texturemem[1]);
- VIDEO_SetBlack(TRUE);
- VIDEO_Flush();
- inited = 0;
-}
-
-/**
- * Set the video mode. This includes the width and height of the game screen,
- * as well as the color mode: 8-bit indexed, 16-bit RGB565, or 32-bit RGB888.
- * @param videomodes the video mode structure (see source/gamelib/types.h)
- * @return 1 on success, 0 on error
- */
-int video_set_mode(s_videomodes videomodes)
-{
- float texscale;
- static const int texture_formats[4] = {GX_TF_CI8, GX_TF_RGB565, GX_TF_RGBA8, GX_TF_RGBA8};
-
- bytes_per_pixel = videomodes.pixel;
-
- // clear the embedded framebuffer (EFB) by copying its contents to the unused XFB :)
- GX_CopyDisp(xfb[whichbuffer^1], GX_TRUE);
- GX_Flush();
-
- // free existing memory
- if(texturemem[0]) { free(texturemem[0]); texturemem[0]=NULL; }
- if(texturemem[1]) { free(texturemem[1]); texturemem[1]=NULL; }
- if(yuvScreen) { freescreen(&yuvScreen); yuvScreen=NULL; }
-
- // allocate memory for new texture
- textureWidth = videomodes.hRes;
- textureHeight = videomodes.vRes;
- texturemem_size = GX_GetTexBufferSize(textureWidth, textureHeight, texture_formats[bytes_per_pixel-1], 0, 0);
- texturemem[0] = memalign(32, texturemem_size);
- texturemem[1] = memalign(32, texturemem_size);
-
- // determine scale factor and on-screen dimensions
- texscale = MIN((float)viewportWidth/(float)textureWidth, (float)viewportHeight/(float)textureHeight);
- scaledWidth = (int)(textureWidth * texscale);
- scaledHeight = (int)(textureHeight * texscale);
-
- // determine offsets
- xoffset = (viewportWidth - scaledWidth) / 2;
- yoffset = (viewportHeight - scaledHeight) / 2;
-
- // initialize the texture object
- if(bytes_per_pixel == 1)
- {
- GX_InitTexObjCI(&texture[0], texturemem[0], textureWidth, textureHeight, GX_TF_CI8, GX_CLAMP, GX_CLAMP, GX_FALSE, GX_TLUT0);
- GX_InitTexObjCI(&texture[1], texturemem[1], textureWidth, textureHeight, GX_TF_CI8, GX_CLAMP, GX_CLAMP, GX_FALSE, GX_TLUT0);
- }
- else
- {
- GX_InitTexObj(&texture[0], texturemem[0], textureWidth, textureHeight, texture_formats[bytes_per_pixel-1], GX_CLAMP, GX_CLAMP, GX_FALSE);
- GX_InitTexObj(&texture[1], texturemem[1], textureWidth, textureHeight, texture_formats[bytes_per_pixel-1], GX_CLAMP, GX_CLAMP, GX_FALSE);
- }
-
- return 1;
-}
-
-/**
- * Renders a quad on the screen with the currently loaded texture and with the
- * specified size and offset.
- * @param x the X offset in pixels
- * @param y the Y offset in pixels
- * @param width the width in pixels
- * @param height the height in pixels
- */
-void video_draw_quad(int x, int y, int width, int height)
-{
- GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
- GX_Position2f32(x, y); // top left
- GX_TexCoord2f32(0.0, 0.0);
- GX_Position2f32(x+width-1, y); // top right
- GX_TexCoord2f32(1.0, 0.0);
- GX_Position2f32(x+width-1, y+height-1); // bottom right
- GX_TexCoord2f32(1.0, 1.0);
- GX_Position2f32(x, y+height-1); // bottom left
- GX_TexCoord2f32(0.0, 1.0);
- GX_End();
-}
-
-/**
- * Blits the game screen to the monitor/TV screen.
- * @param src the source image
- * @return 1 on success, 0 on error
- */
-int video_copy_screen(s_screen* src)
-{
- whichtexture ^= 1;
-
- switch(bytes_per_pixel)
- {
- case 1: video_swizzle_simple(src->data, texturemem[whichtexture], src->width, src->height); break;
- case 2: video_swizzle_simple(src->data, texturemem[whichtexture], src->width * 2, src->height); break;
- case 4: copyscreen32(src); break;
- default: assert(!"bytes_per_pixel not 1, 2, or 4");
- }
-
- GX_DrawDone();
-
- // use the currently inactive video buffer for the next frame
- whichbuffer ^= 1;
-
- // upload the texture to the Flipper/Hollywood
- DCFlushRange(texturemem[whichbuffer], texturemem_size);
- GX_LoadTexObj(&texture[whichbuffer], GX_TEXMAP0);
-
- // draw the screen texture onto the EFB as a textured quad
- if(stretch)
- video_draw_quad(0, 0, viewportWidth, viewportHeight);
- else
- video_draw_quad(xoffset, yoffset, scaledWidth, scaledHeight);
-
- // blit the contents of the EFB to the XFB, and swap video buffers
- GX_CopyDisp(xfb[whichbuffer], GX_FALSE);
- GX_Flush();
- VIDEO_SetNextFramebuffer(xfb[whichbuffer]);
- VIDEO_Flush();
-
- return 1;
-}
-
-/**
- * Clear the next external framebuffer (XFB) to black.
- */
-void video_clearscreen()
-{
- whichbuffer ^= 1;
- whichtexture ^= 1;
- VIDEO_ClearFrameBuffer(vmode, xfb[whichbuffer], COLOR_BLACK);
- VIDEO_SetNextFramebuffer(xfb[whichbuffer]);
- VIDEO_Flush();
-}
-
-/**
- * Toggle whether the video should be stretched to take up the entire screen or
- * use black bars when necessary to preserve the original aspect ratio.
- *
- * @param enable 1 to stretch to screen, 0 to preserve aspect ratio
- * TODO: call GX_SetDispCopySrc() to prevent copying black bars from the EFB on
- * every update (maybe?)
- */
-void video_stretch(int enable)
-{
- GX_CopyDisp(xfb[whichbuffer^1], GX_TRUE); // clear the EFB
- GX_Flush();
- stretch = enable;
-}
-
-/**
- * Sets brightness and _gamma correction. Both are implemented using the
- * Flipper/Hollywood's texture environment (TEV) unit.
- *
- * @param br the desired brightness
- * @param gm the desired _gamma
- */
-void video_set_color_correction(int gm, int br)
-{
- if(br < -255) br = -255;
- if(br > 255) br = 255;
- if(gm < -255) gm = -255;
- if(gm > 255) gm = 255;
-
- if(br != brightness)
- {
- brightness = br;
- brightness_update = 1;
- }
-
- if(gm != _gamma)
- {
- _gamma = gm;
- _gamma_update = 1;
- }
-
- // update brightness correction if changed since last frame
- if(brightness_update)
- {
- GXColor correction_color = {abs(brightness),abs(brightness),abs(brightness),abs(brightness)};
- brightness_update = 0;
- if(brightness == 0) GX_SetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_TEXC);
- else
- {
- // for brightness > 0, brightnesscorrect(c,b) = b+(c*(1.0-b))
- // for brightness < 0, brightnesscorrect(c,b) = c*(1.0+b)
- GX_SetTevColor(GX_TEVREG0, correction_color);
- GX_SetTevColorIn(GX_TEVSTAGE0, GX_CC_TEXC, GX_CC_ZERO, GX_CC_C0, brightness > 0 ? GX_CC_C0 : GX_CC_ZERO);
- }
- GX_SetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
- }
-
- // update _gamma correction if changed since last frame
- if(_gamma_update)
- {
- GXColor correction_color = {abs(_gamma),abs(_gamma),abs(_gamma),abs(_gamma)};
- _gamma_update = 0;
- if(_gamma == 0) GX_SetNumTevStages(1);
- else
- {
- GX_SetNumTevStages(3);
- GX_SetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA);
- GX_SetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
- GX_SetTevAlphaIn(GX_TEVSTAGE2, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA);
- GX_SetTevAlphaOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
- GX_SetTevColor(GX_TEVREG1, correction_color);
-
- if(_gamma > 0)
- {
- // for _gamma > 0, _gammacorrect(c,g) = 1.0-((1.0-c)*(1.0-(c*g)))
- // Stage 1: (1.0 - ((1.0-c)*0.0 + g*c)) = 1.0-(c*g)
- // Stage 2: (1.0 - ((1.0-c)*prev + 0*c)) = 1.0-((1.0-c)*(1.0-(c*g)))
- GX_SetTevColorIn(GX_TEVSTAGE1, GX_CC_ZERO, GX_CC_C1, GX_CC_CPREV, GX_CC_ONE);
- GX_SetTevColorOp(GX_TEVSTAGE1, GX_TEV_SUB, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVREG2);
- GX_SetTevColorIn(GX_TEVSTAGE2, GX_CC_C2, GX_CC_ZERO, GX_CC_CPREV, GX_CC_ONE);
- GX_SetTevColorOp(GX_TEVSTAGE2, GX_TEV_SUB, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
- }
- else
- {
- // for _gamma < 0, _gammacorrect(c,g) = c*(1.0-((1.0-c)*g))
- // Stage 1: (1.0 - ((1.0-c)*g + 0.0*c)) = 1.0-((1.0-c)*g)
- // Stage 2: (0.0 + ((1.0-c)*0 + prev*c)) = c*(1.0-((1.0-c)*g))
- GX_SetTevColorIn(GX_TEVSTAGE1, GX_CC_C1, GX_CC_ZERO, GX_CC_CPREV, GX_CC_ONE);
- GX_SetTevColorOp(GX_TEVSTAGE1, GX_TEV_SUB, GX_TB_ZERO, GX_CS_SCALE_1, GX_FALSE, GX_TEVREG2);
- GX_SetTevColorIn(GX_TEVSTAGE2, GX_CC_ZERO, GX_CC_C2, GX_CC_CPREV, GX_CC_ZERO);
- GX_SetTevColorOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
- }
- }
- }
-}
-
-// TODO accelerated YUV->RGB conversion using TEV hardware
-int video_setup_yuv_overlay(const yuv_video_mode *mode)
-{
- s_videomodes videomodes;
- yuv_init(2);
- videomodes.hRes = mode->width;
- videomodes.vRes = mode->height;
- videomodes.pixel = 2;
- video_set_mode(videomodes);
- float texscale = MIN((float)viewportWidth / mode->display_width,
- (float)viewportHeight / mode->display_height);
- scaledWidth = (int)(mode->display_width * texscale);
- scaledHeight = (int)(mode->display_height * texscale);
- xoffset = (viewportWidth - scaledWidth) / 2;
- yoffset = (viewportHeight - scaledHeight) / 2;
- yuvScreen = allocscreen(mode->width, mode->height, PIXEL_16);
- return 1;
-}
-
-int video_prepare_yuv_frame(yuv_frame *src)
-{
- yuv_to_rgb(src, yuvScreen);
- return 1;
-}
-
-int video_display_yuv_frame(void)
-{
- return video_copy_screen(yuvScreen);
-}
-
-/*
- * Blocks until a vertical retrace occurs.
- */
-void vga_vwait(void)
-{
- VIDEO_WaitVSync();
-}
-
-/**
- * Sets the palette used in 8-bit color mode. The Wii supports indexed-color
- * textures, so this function updates the texture lookup table (colormap) with
- * the new palette.
- * The palette is sent to this function as an array of 768 bytes. Each color is
- * 3 bytes: red, then green, then blue.
- * @param pal the new palette
- */
-void vga_setpalette(unsigned char* pal)
-{
- int i;
- for(i=0;i<256;i++)
- {
- palette[i] = (pal[0]>>3<<11) | (pal[1]>>2<<5) | (pal[2]>>3);
- pal+=3;
- }
-
- // upload the palette data to the Flipper
- DCFlushRange(palette, sizeof(palette));
- GX_LoadTlut(&tlut, GX_TLUT0);
-}
-
-/************ Functions to convert s_screen objects to textures ***************/
-
-/**
- * Copies and swizzles an image to texture memory. Works for 8-bit (GX_TF_CI8)
- * and 16-bit (GX_TF_RGB565) texture formats. Both formats are divided into tiles
- * containing 4 rows of 8 bytes.
- *
- * @param src - the image
- * @param dest - the texture memory
- * @param width - the width of each row in *BYTES*, i.e. not in pixels; must be a multiple of 8
- * @param height - number of rows; must be a multiple of 4
- */
-void video_swizzle_simple(const void* src, void* dst, s32 width, s32 height)
-{
- u64* data = (u64*)src;
- u64* dest = (u64*)dst;
- s32 offset1 = width / 8;
- s32 offset2 = (width / 8) * 2;
- s32 offset3 = (width / 8) * 3;
- int x, y;
-
- /**
- * GX_TF_CI8 textures are stored with 1 byte per pixel in tiles 8 pixels
- * by 4 pixels. GX_TF_RGB565 textures have 2 bytes per pixel, with 4 pixels
- * in each row. So tiles in both texture formats are 4 rows of 8 bytes each.
- */
- for(y=0; y> 16; // AR cache line
- *(dest+i+16) = color; // GB cache line
- }
-}
-
-/**
- * Copies and swizzles an image to texture memory. Works for 32-bit (GX_TF_RGBA8)
- * texture format. Textures are stored into tiles containing 4 rows of 8 bytes.
- * However, each tile is 64 bytes in size because each tile is divided across two
- * cache lines. So each 4x4 tile is a 32-byte AR block followed by a 32-byte GB block.
- *
- * @param src the image
- */
-void copyscreen32(s_screen* src)
-{
- int x, y;
- u32* data = (u32*)src->data;
- u16* dest = (u16*)texturemem[whichtexture];
- s32 offset1 = textureWidth;
- s32 offset2 = textureWidth * 2;
- s32 offset3 = textureWidth * 3;
-
- // RGBA8 textures in GX are stored in 4x4 tiles in two cache lines, AR and GB
- for(y=0; y
-
-void video_init();
-int video_set_mode(s_videomodes);
-int video_copy_screen(s_screen*);
-void video_clearscreen();
-void video_draw_quad(int,int,int,int);
-void video_stretch(int);
-void video_set_color_correction(int,int);
-void video_exit();
-
-void video_swizzle_simple(const void*, void*, s32, s32);
-void copyscreen32(s_screen*);
-
-// for WebM video playback
-int video_setup_yuv_overlay(const yuv_video_mode*);
-int video_prepare_yuv_frame(yuv_frame*);
-int video_display_yuv_frame(void);
-
-#endif
-
diff --git a/engine/wii/wiiport.c b/engine/wii/wiiport.c
deleted file mode 100644
index 2ea10b000..000000000
--- a/engine/wii/wiiport.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * OpenBOR - https://www.chronocrash.com
- * -----------------------------------------------------------------------
- * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
-#include
-#include
-#include
-#include "wiiport.h"
-#include "packfile.h"
-#include "video.h"
-#include "control.h"
-#include "utils.h"
-#include "ram.h"
-#include "menu.h"
-#include
-
-extern void __exception_setreload(int t);
-
-char packfile[MAX_FILENAME_LEN];
-char paksDir[MAX_FILENAME_LEN];
-char savesDir[MAX_FILENAME_LEN];
-char logsDir[MAX_FILENAME_LEN];
-char screenShotsDir[MAX_FILENAME_LEN];
-char rootDir[MAX_FILENAME_LEN]; // note: this one ends with a slash
-
-/*
- * Given a file's path relative to the OpenBOR executable;
- */
-char* getFullPath(char *relPath)
-{
- static char filename[MAX_FILENAME_LEN];
- strcpy(filename, rootDir);
- strcat(filename, relPath);
- return filename;
-}
-
-void borExit(int reset)
-{
-#if 0
- if(reset == WII_SHUTDOWN) SYS_ResetSystem(SYS_POWEROFF, 0, 0);
- else if(reset == WII_RESET) SYS_ResetSystem(SYS_HOTRESET, 0, 0);
- else exit(reset);
-#else
- exit(reset); //SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
-#endif
-}
-
-// TODO merge into getFullPath
-void initDirPath(char* dest, char* relPath)
-{
- strcpy(dest, rootDir);
- strcat(dest, relPath);
-}
-
-int main(int argc, char * argv[])
-{
- // Launch a pak directly from a loader with plugin ability(Wiiflow, Postloader etc).
- // With WiiFlow, the first definable plugin's argument in openbor.ini is argv[1].
- int directlaunch = (argc > 1 && (argv[1][0] == 'u' || argv[1][0] == 's')) ? 1 : 0;
-
- video_init();
-
- // Reset after 8 seconds after a crash
- __exception_setreload(8);
-
- // reload to IOS58 for USB2 support
- if (IOS_GetVersion() != 58)
- {
- IOS_ReloadIOS(58);
- }
-
- // use libfat for FAT filesystem access
- int retry = 0;
- int fatMounted = 0;
-
- // try to mount FAT devices during 3 seconds
- while (!fatMounted && (retry < 12))
- {
- fatMounted = fatInitDefault();
- usleep(250000);
- retry++;
- }
-
- setSystemRam();
- packfile_mode(0);
-
- //new system to get base directory on usb or sd.
- char root[MAX_FILENAME_LEN];
- memset(root, '\0', sizeof(root));
-
- // Root path sent by the loader's argument(apps/OpenBOR by default)
- if(directlaunch)
- {
- strncpy(root, argv[1], strrchr(argv[1], '/') - argv[1]);
- }
- else
- {
- strncpy(root, argv[0], strrchr(argv[0], '/') - argv[0]);
- }
-
- snprintf(rootDir, sizeof(rootDir), "%s/", root);
- snprintf(savesDir, sizeof(savesDir), "%s/Saves", root);
- snprintf(paksDir, sizeof(paksDir), "%s/Paks", root);
- snprintf(logsDir, sizeof(logsDir), "%s/Logs", root);
- snprintf(screenShotsDir, sizeof(screenShotsDir), "%s/ScreenShots", root);
-
-
- dirExists(paksDir, 1);
- dirExists(savesDir, 1);
- dirExists(logsDir, 1);
- dirExists(screenShotsDir, 1);
-
- // Pack's name sent by the loader's argument
- if(directlaunch)
- {
- getBasePath(packfile, argv[2], 1);
- }
-
- Menu();
- openborMain(argc, argv);
- borExit(0);
- return 0;
-}
-
diff --git a/engine/wii/wiiport.h b/engine/wii/wiiport.h
deleted file mode 100644
index 044c5c118..000000000
--- a/engine/wii/wiiport.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * OpenBOR - https://www.chronocrash.com
- * -----------------------------------------------------------------------
- * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
- *
- * Copyright (c) OpenBOR Team
- */
-
-#ifndef _WIIPORT_H_
-#define _WIIPORT_H_
-
-#include
-
-#include "globals.h"
-
-//#define stricmp safe_stricmp
-//#define strnicmp safe_strnicmp
-
-char* getFullPath(char *relPath);
-void borExit(int reset);
-void openborMain(int argc, char** argv);
-
-extern char packfile[MAX_FILENAME_LEN];
-extern char paksDir[MAX_FILENAME_LEN];
-extern char savesDir[MAX_FILENAME_LEN];
-extern char logsDir[MAX_FILENAME_LEN];
-extern char screenShotsDir[MAX_FILENAME_LEN];
-extern char rootDir[MAX_FILENAME_LEN];
-
-#endif
diff --git a/tools/devkitpro/devkitPro.7z b/tools/devkitpro/devkitPro.7z
deleted file mode 100644
index 72913dfe5..000000000
Binary files a/tools/devkitpro/devkitPro.7z and /dev/null differ