diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 7eafa3d12..0c4ecd6b7 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -16,9 +16,9 @@ on: jobs: msys2: - name: MSYS2 Makefile (Win32 GUI, ${{ matrix.build.name }}, ${{ matrix.dynarec.name }}, ${{ matrix.environment.msystem }}) + name: "Windows MSYS2 Makefile (Win32 GUI, ${{ matrix.build.name }}, ${{ matrix.dynarec.name }}, ${{ matrix.environment.msystem }})" - runs-on: windows-latest + runs-on: windows-2022 defaults: run: @@ -50,28 +50,38 @@ jobs: - msystem: MINGW64 prefix: mingw-w64-x86_64 x64: y + - msystem: UCRT64 + prefix: mingw-w64-ucrt-x86_64 + x64: y steps: - - uses: msys2/setup-msys2@v2 - with: - update: true - msystem: ${{ matrix.environment.msystem }} - install: >- - make - ${{ matrix.environment.prefix }}-gcc - ${{ matrix.environment.prefix }}-pkg-config - ${{ matrix.environment.prefix }}-openal - ${{ matrix.environment.prefix }}-freetype - ${{ matrix.environment.prefix }}-SDL2 - ${{ matrix.environment.prefix }}-zlib - ${{ matrix.environment.prefix }}-libpng - ${{ matrix.environment.prefix }}-libvncserver - ${{ matrix.environment.prefix }}-rtmidi - - uses: actions/checkout@v3 - - name: make - run: make -fwin/makefile.mingw -j DEV_BUILD=${{ matrix.build.dev }} DEBUG=${{ matrix.build.debug }} NEW_DYNAREC=${{ matrix.dynarec.new }} X64=${{ matrix.environment.x64 }} VNC=n - working-directory: ./src - - uses: actions/upload-artifact@v3 - with: - name: '86Box${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-Windows-${{ matrix.environment.msystem }}-gha${{ github.run_number }}' - path: src/86Box.exe + - name: Prepare MSYS2 environment + uses: msys2/setup-msys2@v2 + with: + update: true + msystem: ${{ matrix.environment.msystem }} + install: >- + make + ${{ matrix.environment.prefix }}-gcc + ${{ matrix.environment.prefix }}-pkg-config + ${{ matrix.environment.prefix }}-freetype + ${{ matrix.environment.prefix }}-SDL2 + ${{ matrix.environment.prefix }}-zlib + ${{ matrix.environment.prefix }}-libpng + ${{ matrix.environment.prefix }}-openal + ${{ matrix.environment.prefix }}-rtmidi + ${{ matrix.environment.prefix }}-libvncserver + - uses: actions/checkout@v3 + - name: make + run: >- + make -fwin/makefile.mingw -j + DEV_BUILD=${{ matrix.build.dev }} + DEBUG=${{ matrix.build.debug }} + NEW_DYNAREC=${{ matrix.dynarec.new }} + X64=${{ matrix.environment.x64 }} + VNC=n + working-directory: ./src + - uses: actions/upload-artifact@v3 + with: + name: '86Box${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-Windows-${{ matrix.environment.msystem }}-gha${{ github.run_number }}' + path: src/86Box.exe diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 534d268b7..6876e83bc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -25,7 +25,7 @@ on: jobs: msys2: - name: MSYS2 (Win32 GUI, ${{ matrix.build.name }}, ${{ matrix.dynarec.name }}, ${{ matrix.environment.msystem }}) + name: "Windows MSYS2 (${{ matrix.ui.name }}, ${{ matrix.build.name }}, ${{ matrix.dynarec.name }}, ${{ matrix.environment.msystem }})" runs-on: windows-2022 @@ -50,6 +50,17 @@ jobs: - name: NDR new: on slug: -NDR + ui: + - name: Win32 GUI + qt: off + static: on + - name: Qt GUI + qt: on + static: off + slug: -Qt + packages: >- + qt5-base:p + qt5-tools:p environment: - msystem: MINGW32 prefix: mingw-w64-i686 @@ -62,22 +73,24 @@ jobs: toolchain: ./cmake/flags-gcc-x86_64.cmake steps: - - uses: msys2/setup-msys2@v2 + - name: Prepare MSYS2 environment + uses: msys2/setup-msys2@v2 with: - path-type: inherit update: true msystem: ${{ matrix.environment.msystem }} - install: >- - ${{ matrix.environment.prefix }}-ninja - ${{ matrix.environment.prefix }}-cc - ${{ matrix.environment.prefix }}-pkg-config - ${{ matrix.environment.prefix }}-freetype - ${{ matrix.environment.prefix }}-SDL2 - ${{ matrix.environment.prefix }}-zlib - ${{ matrix.environment.prefix }}-libpng - ${{ matrix.environment.prefix }}-libvncserver - ${{ matrix.environment.prefix }}-openal - ${{ matrix.environment.prefix }}-rtmidi + pacboy: >- + ninja:p + cmake:p + gcc:p + pkg-config:p + freetype:p + SDL2:p + zlib:p + libpng:p + openal:p + rtmidi:p + libvncserver:p + ${{ matrix.ui.packages }} - uses: actions/checkout@v3 - name: Configure CMake run: >- @@ -85,87 +98,16 @@ jobs: --toolchain ${{ matrix.environment.toolchain }} -D NEW_DYNAREC=${{ matrix.dynarec.new }} -D CMAKE_INSTALL_PREFIX=./build/artifacts - -D QT=OFF + -D QT=${{ matrix.ui.qt }} + -D STATIC_BUILD=${{ matrix.ui.static }} + -D VNC=n - name: Build run: cmake --build build - name: Generate package run: cmake --install build - uses: actions/upload-artifact@v3 with: - name: '86Box${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-Windows-${{ matrix.environment.msystem }}-gha${{ github.run_number }}' - path: build/artifacts/** - - msys2-qt: - name: MSYS2 (Qt GUI, ${{ matrix.build.name }}, ${{ matrix.dynarec.name }}, ${{ matrix.environment.msystem }}) - - runs-on: windows-2022 - - defaults: - run: - shell: msys2 {0} - - strategy: - fail-fast: true - matrix: - build: - - name: Debug - preset: debug - slug: -Debug - - name: Dev - preset: experimental - slug: -Dev - dynarec: - - name: ODR - new: off - slug: -ODR - - name: NDR - new: on - slug: -NDR - environment: - - msystem: MINGW32 - prefix: mingw-w64-i686 - toolchain: ./cmake/flags-gcc-i686.cmake - - msystem: MINGW64 - prefix: mingw-w64-x86_64 - toolchain: ./cmake/flags-gcc-x86_64.cmake - - msystem: UCRT64 - prefix: mingw-w64-ucrt-x86_64 - toolchain: ./cmake/flags-gcc-x86_64.cmake - - steps: - - uses: msys2/setup-msys2@v2 - with: - path-type: inherit - update: true - msystem: ${{ matrix.environment.msystem }} - install: >- - ${{ matrix.environment.prefix }}-ninja - ${{ matrix.environment.prefix }}-cc - ${{ matrix.environment.prefix }}-pkg-config - ${{ matrix.environment.prefix }}-freetype - ${{ matrix.environment.prefix }}-SDL2 - ${{ matrix.environment.prefix }}-zlib - ${{ matrix.environment.prefix }}-libpng - ${{ matrix.environment.prefix }}-libvncserver - ${{ matrix.environment.prefix }}-openal - ${{ matrix.environment.prefix }}-rtmidi - ${{ matrix.environment.prefix }}-qt5-base - ${{ matrix.environment.prefix }}-qt5-tools - - uses: actions/checkout@v3 - - name: Configure CMake - run: >- - cmake -G Ninja -S . -B build --preset ${{ matrix.build.preset }} - --toolchain ${{ matrix.environment.toolchain }} - -D NEW_DYNAREC=${{ matrix.dynarec.new }} - -D CMAKE_INSTALL_PREFIX=./build/artifacts - -D QT=ON - - name: Build - run: cmake --build build - - name: Generate package - run: cmake --install build - - uses: actions/upload-artifact@v3 - with: - name: '86Box-Qt${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-Windows-${{ matrix.environment.msystem }}-gha${{ github.run_number }}' + name: '86Box${{ matrix.ui.slug }}${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-Windows-${{ matrix.environment.msystem }}-gha${{ github.run_number }}' path: build/artifacts/** llvm-windows: @@ -196,21 +138,21 @@ jobs: ui: - name: Win32 GUI qt: off -# - name: Qt GUI -# qt: on + - name: Qt GUI + qt: on slug: -Qt target: - name: x86 triplet: x86-windows-static - toolchain: cmake/llvm-win32-i686.cmake + toolchain: ./cmake/llvm-win32-i686.cmake vcvars: x64_x86 - name: x64 triplet: x64-windows-static - toolchain: cmake/llvm-win32-x86_64.cmake + toolchain: ./cmake/llvm-win32-x86_64.cmake vcvars: x64 - name: ARM64 triplet: arm64-windows-static - toolchain: cmake/llvm-win32-aarch64.cmake + toolchain: ./cmake/llvm-win32-aarch64.cmake vcvars: x64_arm64 exclude: - dynarec: @@ -219,7 +161,6 @@ jobs: name: ARM64 steps: - - uses: actions/checkout@v3 - name: Prepare VS environment uses: ilammy/msvc-dev-cmd@v1 with: @@ -241,11 +182,13 @@ jobs: -password "${{ secrets.GITHUB_TOKEN }}" - name: Fix MSVC atomic headers run: dir "C:/Program Files/Microsoft Visual Studio/2022/*/VC/Tools/MSVC/*/include" -include stdatomic.h -recurse | del + - uses: actions/checkout@v3 - name: Configure CMake run: > cmake -G Ninja -S . -B build --preset ${{ matrix.build.preset }} --toolchain C:/vcpkg/scripts/buildsystems/vcpkg.cmake -D NEW_DYNAREC=${{ matrix.dynarec.new }} -D QT=${{ matrix.ui.qt }} + -D CMAKE_INSTALL_PREFIX=./build/artifacts -D VCPKG_CHAINLOAD_TOOLCHAIN_FILE=${{ github.workspace }}/${{ matrix.target.toolchain }} -D VCPKG_TARGET_TRIPLET=${{ matrix.target.triplet }} -D VCPKG_HOST_TRIPLET=x64-windows @@ -261,14 +204,14 @@ jobs: - name: Build run: cmake --build build - name: Generate package - run: cmake --install build --prefix ./build/artifacts + run: cmake --install build - uses: actions/upload-artifact@v3 with: name: '86Box${{ matrix.ui.slug }}${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-Windows-LLVM-${{ matrix.target.name }}-gha${{ github.run_number }}' path: build/artifacts/** linux: - name: "Linux GCC 11 (${{ matrix.build.name }} ${{ matrix.dynarec.name }} x86_64)" + name: "Linux GCC 11 (Qt GUI, ${{ matrix.build.name }}, ${{ matrix.dynarec.name }}, x86_64)" runs-on: ubuntu-22.04 @@ -291,7 +234,6 @@ jobs: slug: -NDR steps: - - uses: actions/checkout@v3 - name: Install dependencies run: >- sudo apt update && sudo apt install @@ -305,22 +247,24 @@ jobs: qtbase5-dev qttools5-dev libopenal-dev + - uses: actions/checkout@v3 - name: Configure CMake run: >- cmake -G Ninja -S . -B build --preset ${{ matrix.build.preset }} --toolchain ./cmake/flags-gcc-x86_64.cmake -D NEW_DYNAREC=${{ matrix.dynarec.new }} + -D CMAKE_INSTALL_PREFIX=./build/artifacts - name: Build run: cmake --build build -# - name: Generate package -# run: cmake --install build --prefix ./build/artifacts -# - uses: actions/upload-artifact@v3 -# with: -# name: '86Box${{ matrix.build.slug }}-UbuntuJammy-x86_64-gha${{ github.run_number }}' -# path: build/artifacts/** + - name: Generate package + run: cmake --install build + - uses: actions/upload-artifact@v3 + with: + name: '86Box-Qt${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-UbuntuJammy-x86_64-gha${{ github.run_number }}' + path: build/artifacts/** macos11: - name: "macOS 11 (${{ matrix.build.name }} x86_64)" + name: "macOS 11 (Qt GUI, ${{ matrix.build.name }}, ${{ matrix.dynarec.name }}, x86_64)" runs-on: macos-11 @@ -343,22 +287,31 @@ jobs: slug: -NDR steps: - - uses: actions/checkout@v3 - name: Install dependencies - run: brew install freetype sdl2 libpng rtmidi qt@5 openal-soft ninja + run: >- + brew install + ninja + freetype + sdl2 + libpng + rtmidi + qt@5 + openal-soft + - uses: actions/checkout@v3 - name: Configure CMake run: >- cmake -G Ninja -S . -B build --preset ${{ matrix.build.preset }} - --toolchain cmake/flags-gcc-x86_64.cmake - -D NEW_DYNAREC=${{ matrix.build.new-dynarec }} + --toolchain ./cmake/flags-gcc-x86_64.cmake + -D NEW_DYNAREC=${{ matrix.dynarec.new }} + -D CMAKE_INSTALL_PREFIX=./build/artifacts -D Qt5_ROOT=$(brew --prefix qt@5) -D Qt5LinguistTools_ROOT=$(brew --prefix qt@5) -D OpenAL_ROOT=$(brew --prefix openal-soft) - name: Build run: cmake --build build - name: Generate package - run: cmake --install build --prefix ./build/artifacts + run: cmake --install build - uses: actions/upload-artifact@v3 with: - name: '86Box${{ matrix.build.slug }}-macOS-x86_64-gha${{ github.run_number }}' + name: '86Box-Qt${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-macOS-x86_64-gha${{ github.run_number }}' path: build/artifacts/** diff --git a/cmake/llvm-win32-arm.cmake b/cmake/llvm-win32-arm.cmake new file mode 100644 index 000000000..9d3488124 --- /dev/null +++ b/cmake/llvm-win32-arm.cmake @@ -0,0 +1,30 @@ +# +# 86Box A hypervisor and IBM PC system emulator that specializes in +# running old operating systems and software designed for IBM +# PC systems and compatibles from 1981 through fairly recent +# system designs based on the PCI bus. +# +# This file is part of the 86Box distribution. +# +# CMake toolchain file for Clang on Windows builds (ARM64 target). +# +# Authors: David Hrdlička, +# +# Copyright 2021 David Hrdlička. +# + +include(${CMAKE_CURRENT_LIST_DIR}/flags-gcc-armv7.cmake) + +# Use the GCC-compatible Clang executables in order to use our flags +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) + +# `llvm-rc` is barely usable as of LLVM 13, using MS' rc.exe for now +set(CMAKE_RC_COMPILER rc) + +set(CMAKE_C_COMPILER_TARGET arm-pc-windows-msvc) +set(CMAKE_CXX_COMPILER_TARGET arm-pc-windows-msvc) + +set(CMAKE_SYSTEM_PROCESSOR ARM) + +# TODO: set the vcpkg target triplet perhaps? diff --git a/src/include/86box/unix_sdl.h b/src/include/86box/unix_sdl.h index 0054ed938..27d7ec0aa 100644 --- a/src/include/86box/unix_sdl.h +++ b/src/include/86box/unix_sdl.h @@ -2,9 +2,9 @@ #define _UNIX_SDL_H extern void sdl_close(void); -extern int sdl_inits(); -extern int sdl_inith(); -extern int sdl_initho(); +extern int sdl_inits(void); +extern int sdl_inith(void); +extern int sdl_initho(void); extern int sdl_pause(void); extern void sdl_resize(int x, int y); extern void sdl_enable(int enable); diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 102363414..d707fc7ea 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -261,7 +261,7 @@ MainWindow::MainWindow(QWidget *parent) + (statusBar()->height() * !hide_status_bar) + (ui->toolBar->height() * !hide_tool_bar); - ui->stackedWidget->resize(w, h); + ui->stackedWidget->resize(w, (h / (!dpi_scale ? util::screenOfWidget(this)->devicePixelRatio() : 1.))); setFixedSize(w, modifiedHeight); } }); @@ -1835,6 +1835,7 @@ video_toggle_option(QAction *action, int *val) action->setChecked(*val > 0 ? true : false); endblit(); config_save(); + reset_screen_size(); device_force_redraw(); for (int i = 0; i < MONITORS_NUM; i++) { if (monitors[i].target_buffer) diff --git a/src/unix/macOSXGlue.h b/src/unix/macOSXGlue.h index f49402805..44bf9e7f6 100644 --- a/src/unix/macOSXGlue.h +++ b/src/unix/macOSXGlue.h @@ -14,7 +14,7 @@ CF_IMPLICIT_BRIDGING_ENABLED CF_EXTERN_C_BEGIN void getDefaultROMPath(char *); -int toto(); +int toto(void); CF_EXTERN_C_END CF_IMPLICIT_BRIDGING_DISABLED diff --git a/src/unix/unix.c b/src/unix/unix.c index 4410118f3..296da5e14 100644 --- a/src/unix/unix.c +++ b/src/unix/unix.c @@ -468,12 +468,12 @@ ui_sb_update_tip(int arg) } void -ui_sb_update_panes() +ui_sb_update_panes(void) { } void -ui_sb_update_text() +ui_sb_update_text(void) { } @@ -699,7 +699,7 @@ typedef struct mouseinputdata { SDL_mutex *mousemutex; static mouseinputdata mousedata; void -mouse_poll() +mouse_poll(void) { SDL_LockMutex(mousemutex); mouse_x = mousedata.deltax; @@ -754,7 +754,7 @@ plat_pause(int p) } void -plat_init_rom_paths() +plat_init_rom_paths(void) { #ifndef __APPLE__ if (getenv("XDG_DATA_HOME")) { @@ -1202,7 +1202,7 @@ main(int argc, char **argv) case SDL_RENDER_DEVICE_RESET: case SDL_RENDER_TARGETS_RESET: { - extern void sdl_reinit_texture(); + extern void sdl_reinit_texture(void); sdl_reinit_texture(); break; } @@ -1238,7 +1238,7 @@ main(int argc, char **argv) sdl_blit(params.x, params.y, params.w, params.h); } if (title_set) { - extern void ui_window_title_real(); + extern void ui_window_title_real(void); ui_window_title_real(); } if (video_fullscreen && keyboard_isfsexit()) { @@ -1303,13 +1303,13 @@ joystick_process(void) { } void -startblit() +startblit(void) { SDL_LockMutex(blitmtx); } void -endblit() +endblit(void) { SDL_UnlockMutex(blitmtx); } diff --git a/src/unix/unix_sdl.c b/src/unix/unix_sdl.c index bd2f3937b..bc89c9290 100644 --- a/src/unix/unix_sdl.c +++ b/src/unix/unix_sdl.c @@ -46,7 +46,7 @@ double mouse_sensitivity = 1.0; /* Unused. */ double mouse_x_error = 0.0, mouse_y_error = 0.0; /* Unused. */ static uint8_t interpixels[17842176]; -extern void RenderImGui(); +extern void RenderImGui(void); static void sdl_integer_scale(double *d, double *g) { @@ -61,7 +61,7 @@ sdl_integer_scale(double *d, double *g) } } -void sdl_reinit_texture(); +void sdl_reinit_texture(void); static void sdl_stretch(int *w, int *h, int *x, int *y) @@ -141,7 +141,7 @@ sdl_blit_shim(int x, int y, int w, int h, int monitor_index) video_blit_complete_monitor(monitor_index); } -void ui_window_title_real(); +void ui_window_title_real(void); void sdl_real_blit(SDL_Rect *r_src) @@ -286,7 +286,7 @@ sdl_select_best_hw_driver(void) } void -sdl_reinit_texture() +sdl_reinit_texture(void) { sdl_destroy_texture(); @@ -416,19 +416,19 @@ sdl_init_common(int flags) } int -sdl_inits() +sdl_inits(void) { return sdl_init_common(0); } int -sdl_inith() +sdl_inith(void) { return sdl_init_common(RENDERER_HARDWARE); } int -sdl_initho() +sdl_initho(void) { return sdl_init_common(RENDERER_HARDWARE | RENDERER_OPENGL); } @@ -462,7 +462,7 @@ wchar_t sdl_win_title[512] = { L'8', L'6', L'B', L'o', L'x', 0 }; SDL_mutex *titlemtx = NULL; void -ui_window_title_real() +ui_window_title_real(void) { char *res; if (sizeof(wchar_t) == 1) { diff --git a/vcpkg.json b/vcpkg.json index f3f420b33..46ab6bff3 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -21,6 +21,7 @@ "concurrent", "default-features", "gui", + "opengl", "harfbuzz", "network", "vulkan",