From: <sba...@us...> - 2023-05-18 04:55:41
|
This is an automated email from the git hooks/post-receive-user script. sbaldovi pushed a commit to branch master in repository fuse. View the commit online: https://sourceforge.net/p/fuse-emulator/fuse/ci/69793e332bf8a1f4e1fe14a0e1e3afa1ee98bfa7/ The following commit(s) were added to refs/heads/master by this push: new 69793e33 fix: Update cross-compiling for WII new 8dade2e8 Merge request #22: Fix cross-compiling for WII 69793e33 is described below commit 69793e332bf8a1f4e1fe14a0e1e3afa1ee98bfa7 Author: Miroslav Ďurčík <743...@us...> AuthorDate: Wed May 3 22:48:09 2023 +0200 fix: Update cross-compiling for WII Multiple changes, fixes needed to make cross compiling for WII fork again: - Make sure GEKKO constant is set from configure. - Explicit defining of GEKKO constant removed from wiijoystick.c and wiimouse.c (as it is set from configure). - Function clock_gettime (wii only) has changed its signature, needing 2 parameters now. I made a best guess here and chose CLOCK_REALTIME as the first parameter. - In WII mode most of optional stuff is turned off. Sockets including. However some code was still requiring winsock2.h. Wrapped it into ifdef HAVE_SOCKETS. - compat_dir variable does not need WII specific type override. - Added missing key mappings based on build failure. Some keys cannot be mapped 1:1, so leaving them at the end. They will not be mapped. - Removing compatibility file dir.c for WII, as it has now standard POSIX dir related functions. - Updated github workflow file, fixed path to allow cross-compiling. Also added checks to make sure cross-compiling was active. - Installing missing packages bison, flex https://sourceforge.net/p/arki55-fuse-mod/tickets/11/ --- .github/workflows/build_wii.yml | 2 +- .github/workflows/build_wii_sub.yml | 30 ++++++++++++++++--- compat.h | 11 ++++--- compat/Makefile.am | 2 +- compat/wii/dir.c | 48 ------------------------------ compat/wii/timer.c | 6 ++-- fuse.c | 3 +- ui/wii/wiijoystick.c | 1 - ui/wii/wiikeysyms.h | 58 ++++++++++++++++++++++++++++++++----- ui/wii/wiimouse.c | 2 -- 10 files changed, 87 insertions(+), 76 deletions(-) diff --git a/.github/workflows/build_wii.yml b/.github/workflows/build_wii.yml index 378ff773..66d91384 100644 --- a/.github/workflows/build_wii.yml +++ b/.github/workflows/build_wii.yml @@ -47,4 +47,4 @@ jobs: dependencies: "" configure_params: "--with-wii" verify_ui: "wii" - verify_audio: "oss" + verify_audio: "wii" diff --git a/.github/workflows/build_wii_sub.yml b/.github/workflows/build_wii_sub.yml index 9ac83566..7993292c 100644 --- a/.github/workflows/build_wii_sub.yml +++ b/.github/workflows/build_wii_sub.yml @@ -49,6 +49,13 @@ jobs: echo "Available devkitPro packages:" dkp-pacman -Sl dkp-libs echo "" + + echo "WII specific libraries:" + find $DEVKITPRO -maxdepth 2 -type d + echo "" + + # Override path to allow cross-compiling (add to file) + echo "$DEVKITPPC/bin" >> $GITHUB_PATH - name: (2) Install dependencies if: @@ -58,6 +65,7 @@ jobs: sudo apt-get update sudo apt-get -y install --no-install-recommends \ wget tar autoconf automake libtool \ + bison flex \ ${{ inputs.dependencies }} && \ sudo rm -rf /var/lib/apt/lists/* echo "Done." @@ -86,6 +94,7 @@ jobs: run: ./autogen.sh - name: (7) Configure for WII + id: run-configure run: | ./configure \ --target=powerpc-eabi \ @@ -94,20 +103,33 @@ jobs: --without-gpm \ --without-libxml2 \ --without-x \ + CFLAGS="-g -I$DEVKITPPC/include -I$DEVKITPRO/libogc/include -DGEKKO" \ + LDFLAGS="-g -mrvl -mcpu=750 -meabi -mhard-float \ + -Wl,-Map,fuse.elf.map -L$DEVKITPPC/lib \ + -L$DEVKITPRO/libogc/lib/wii" \ + LIBS="-lfat -lwiiuse -lbte -logc -lm" \ ${{ inputs.configure_params }} \ |& tee ./configure.out + - name: Check config.log (on failure) + if: failure() && steps.run-configure.outcome != 'success' + run: | + echo "Reading config.log file .." + cat config.log + - name: (8) Verify output from configure # Most of the tested strings are common for all WII builds # Only the strings related to UI selection differ run: | + .github/scripts/in_config.sh "checking whether we are cross compiling... yes" + .github/scripts/in_config.sh "checking for powerpc-eabi-gcc... powerpc-eabi-gcc" .github/scripts/in_config.sh "Fuse options" .github/scripts/in_config.sh "zlib support: no" .github/scripts/in_config.sh "libxml2 support: no" .github/scripts/in_config.sh "libpng support: no" - .github/scripts/in_config.sh "Spectranet support: yes" - .github/scripts/in_config.sh "SpeccyBoot support: yes" - .github/scripts/in_config.sh "TTX2000 S support: yes" + .github/scripts/in_config.sh "Spectranet support: no" + .github/scripts/in_config.sh "SpeccyBoot support: no" + .github/scripts/in_config.sh "TTX2000 S support: no" .github/scripts/in_config.sh "Desktop integration: no" .github/scripts/in_config.sh "User interface: ${{ inputs.verify_ui }}" @@ -126,7 +148,7 @@ jobs: fi - name: (10) Install - run: sudo make install + run: make install - name: (11) Finish run: | diff --git a/compat.h b/compat.h index 931fea15..0d142805 100644 --- a/compat.h +++ b/compat.h @@ -130,12 +130,7 @@ int compat_is_absolute_path( const char *path ); int compat_get_next_path( path_context *ctx ); typedef FILE* compat_fd; - -#ifndef GEKKO typedef DIR* compat_dir; -#else /* #ifndef GEKKO */ -typedef DIR_ITER* compat_dir; -#endif /* #ifndef GEKKO */ extern const compat_fd COMPAT_FILE_OPEN_FAILED; @@ -184,7 +179,11 @@ int compat_get_tap( const char *interface_name ); #define COMPAT_ECONNREFUSED WSAECONNREFUSED typedef SOCKET compat_socket_t; typedef SOCKADDR compat_sockaddr; -#else /* #ifndef WIN32 */ +#elif GEKKO +/* no sockets under WII, just define the minimum + to feed the below compat_ declarations */ +typedef int compat_socket_t; +#else /* #ifndef WIN32 && GEKKO */ #include <sys/socket.h> #include <netdb.h> #include <errno.h> diff --git a/compat/Makefile.am b/compat/Makefile.am index 4647ef3b..c279317d 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -83,7 +83,7 @@ endif ## Wii routines if COMPAT_WII fuse_SOURCES += \ - compat/wii/dir.c \ + compat/unix/dir.c \ compat/unix/file.c \ compat/wii/osname.c \ compat/wii/paths.c \ diff --git a/compat/wii/dir.c b/compat/wii/dir.c deleted file mode 100644 index 709c5b29..00000000 --- a/compat/wii/dir.c +++ /dev/null @@ -1,48 +0,0 @@ -/* dir.c: Directory-related compatibility routines - Copyright (c) 2009 Philip Kendall - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Author contact information: - - E-mail: phi...@sh... - -*/ - -#include "config.h" - -#include "compat.h" - -compat_dir -compat_opendir( const char *path ) -{ - return diropen( path ); -} - -compat_dir_result_t -compat_readdir( compat_dir directory, char *path, size_t length ) -{ - struct stat fstat; - - int done = dirnext( directory, path, &fstat ); - - return done ? COMPAT_DIR_RESULT_END : COMPAT_DIR_RESULT_OK; -} - -int -compat_closedir( compat_dir directory ) -{ - return dirclose( directory ); -} diff --git a/compat/wii/timer.c b/compat/wii/timer.c index bef5018d..afaa60d1 100644 --- a/compat/wii/timer.c +++ b/compat/wii/timer.c @@ -26,20 +26,18 @@ #include <errno.h> #include <string.h> #include <unistd.h> +#include <time.h> #include "compat.h" #include "ui/ui.h" -/* FIXME: where should we get this prototype from? */ -extern int clock_gettime(struct timespec *tp); - double compat_timer_get_time( void ) { int error; struct timespec tp; - error = clock_gettime(&tp); + error = clock_gettime(CLOCK_REALTIME, &tp); if( error ) { ui_error( UI_ERROR_ERROR, "%s: error getting time: %s", __func__, strerror( errno ) ); return -1; diff --git a/fuse.c b/fuse.c index 8ecfb260..95f1f34d 100644 --- a/fuse.c +++ b/fuse.c @@ -46,7 +46,8 @@ #endif /* #if defined UI_SDL || (defined USE_JOYSTICK && !defined HAVE_JSW_H && (defined UI_X || defined UI_GTK) ) */ #ifdef GEKKO -#include <fat.h> +/* #include <fat.h> + that requires disc_io.h which does not exist for wii? */ #endif /* #ifdef GEKKO */ #ifdef HAVE_LIB_XML2 diff --git a/ui/wii/wiijoystick.c b/ui/wii/wiijoystick.c index 5e92eae5..aa17cb9a 100644 --- a/ui/wii/wiijoystick.c +++ b/ui/wii/wiijoystick.c @@ -27,7 +27,6 @@ #include "ui/ui.h" #include "ui/uijoystick.h" -#define GEKKO #include <wiiuse/wpad.h> typedef enum { diff --git a/ui/wii/wiikeysyms.h b/ui/wii/wiikeysyms.h index 7a7bfef2..9aa3aabf 100644 --- a/ui/wii/wiikeysyms.h +++ b/ui/wii/wiikeysyms.h @@ -54,7 +54,7 @@ enum { WII_KEY_X, WII_KEY_Y, WII_KEY_Z, - + WII_KEY_0 = 0x1E, WII_KEY_1, WII_KEY_2, WII_KEY_3, @@ -64,23 +64,23 @@ enum { WII_KEY_7, WII_KEY_8, WII_KEY_9, - WII_KEY_0, - - WII_KEY_RETURN, + WII_KEY_RETURN = 0x28, WII_KEY_ESCAPE, WII_KEY_BACKSPACE, WII_KEY_TAB, WII_KEY_SPACE, WII_KEY_MINUS, WII_KEY_EQUAL, - + WII_KEY_BRACKETLEFT, + WII_KEY_BRACKETRIGHT, + /* Unknown */ + /* Right Backslash */ WII_KEY_SEMICOLON = 0x33, WII_KEY_APOSTROPHE, - + WII_KEY_ASCIITILDE, WII_KEY_COMMA = 0x36, WII_KEY_PERIOD, WII_KEY_SLASH, - WII_KEY_CAPS_LOCK = 0x39, WII_KEY_F1, WII_KEY_F2, @@ -94,7 +94,9 @@ enum { WII_KEY_F10, WII_KEY_F11, WII_KEY_F12, - + /* Print screen (0x46) */ + /* Scroll lock */ + /* Pause/Break */ WII_KEY_INSERT = 0x49, WII_KEY_HOME, WII_KEY_PAGE_UP, @@ -105,6 +107,46 @@ enum { WII_KEY_LEFT, WII_KEY_DOWN, WII_KEY_UP, + /* Num lock (0x53) */ + /* Numpad / */ + WII_KEY_ASTERISK = 0x55, /* Numpad * */ + /* Numpad - */ + WII_KEY_PLUS = 0x57, /* Numpad + */ + /* Numpad Enter */ + /* Numpad 1 (0x59) */ + /* Numpad 2 */ + /* Numpad 3 */ + /* Numpad 4 */ + /* Numpad 5 */ + /* Numpad 6 */ + /* Numpad 7 */ + /* Numpad 8 */ + /* Numpad 9 */ + /* Numpad 0 */ + /* Numpad Period (0x63) */ + /* Left Backslash */ + /* Menu Key (0x65) */ + + /* impossible mapping */ + WII_KEY_AMPERSAND, + WII_KEY_ASCIICIRCUM, + WII_KEY_AT, + WII_KEY_BACKSLASH, + WII_KEY_BAR, + WII_KEY_BRACELEFT, + WII_KEY_BRACERIGHT, + WII_KEY_COLON, + WII_KEY_DEAD_CIRCUMFLEX, + WII_KEY_DOLLAR, + WII_KEY_EXCLAM, + WII_KEY_GREATER, + WII_KEY_LESS, + WII_KEY_PERCENT, + WII_KEY_PARENLEFT, + WII_KEY_PARENRIGHT, + WII_KEY_QUESTION, + WII_KEY_QUOTEDBL, + WII_KEY_UNDERSCORE, }; diff --git a/ui/wii/wiimouse.c b/ui/wii/wiimouse.c index c578879e..514a56ed 100644 --- a/ui/wii/wiimouse.c +++ b/ui/wii/wiimouse.c @@ -32,8 +32,6 @@ #include <unistd.h> #include <string.h> -#define GEKKO - #include <wiiuse/wpad.h> #include "fuse.h" |