diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2b9abeaa8..9973969e4 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -131,3 +131,68 @@ jobs: with: name: '86Box-${{ matrix.build.name }}-VS2019-${{ matrix.target-arch }}-${{ matrix.toolset }}-${{ github.sha }}' path: build/artifacts/bin/** + + linux: + name: "Linux GCC 11" + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + build: + - name: Debug + dev-build: off + new-dynarec: off + type: Debug + - name: Dev + dev-build: on + new-dynarec: on + type: Debug + + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: sudo apt install gcc-11 g++-11 libfreetype-dev libsdl2-dev libpng-dev libopenal-dev libc6-dev + - name: Configure CMake + run: >- + cmake -S . -B build + -D CMAKE_INSTALL_PREFIX=./build/artifacts + -D DEV_BRANCH=${{ matrix.build.dev-build }} + -D NEW_DYNAREC=${{ matrix.build.new-dynarec }} + -D VNC=OFF + -D CMAKE_BUILD_TYPE=${{ matrix.build.type }} + -D CMAKE_C_COMPILER=gcc-11 -D CMAKE_CXX_COMPILER=g++-11 + - name: Build + run: cmake --build build --target install + + macos: + name: "macOS 11" + + runs-on: macos-11 + strategy: + fail-fast: false + matrix: + build: + - name: Debug + dev-build: off + new-dynarec: off + type: Debug + - name: Dev + dev-build: on + new-dynarec: on + type: Debug + + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: brew install freetype sdl2 libpng openal-soft + - name: Configure CMake + run: >- + cmake -S . -B build + -D CMAKE_INSTALL_PREFIX=./build/artifacts + -D DEV_BRANCH=${{ matrix.build.dev-build }} + -D NEW_DYNAREC=${{ matrix.build.new-dynarec }} + -D VNC=OFF + -D CMAKE_BUILD_TYPE=${{ matrix.build.type }} + - name: Build + run: cmake --build build --target install diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c1ffaabd2..c0be6a5cb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -83,8 +83,10 @@ find_package(SDL2 REQUIRED) include_directories(${SDL2_INCLUDE_DIRS}) if(MINGW) target_link_libraries(86Box SDL2::SDL2-static) -else() +elseif(WIN32) target_link_libraries(86Box SDL2::SDL2) +else() + target_link_libraries(86Box ${SDL2_LIBRARIES}) endif() find_package(PNG REQUIRED) diff --git a/src/codegen/codegen_ops_x86-64.h b/src/codegen/codegen_ops_x86-64.h index 906b07dc6..9f3f844a4 100644 --- a/src/codegen/codegen_ops_x86-64.h +++ b/src/codegen/codegen_ops_x86-64.h @@ -4314,6 +4314,56 @@ static inline void FP_LOAD_REG_D(int reg, int *host_reg1, int *host_reg2) *host_reg1 = REG_EBX; } +static inline int64_t x87_fround16_64(double b) +{ + int16_t a, c; + + switch ((cpu_state.npxc >> 10) & 3) + { + case 0: /*Nearest*/ + a = (int16_t)floor(b); + c = (int16_t)floor(b + 1.0); + if ((b - a) < (c - b)) + return (int64_t) a; + else if ((b - a) > (c - b)) + return (int64_t) c; + else + return (a & 1) ? c : a; + case 1: /*Down*/ + return (int64_t)((int16_t)floor(b)); + case 2: /*Up*/ + return (int64_t)((int16_t)ceil(b)); + case 3: /*Chop*/ + return (int64_t)((int16_t)b); + } + + return 0; +} +static inline int64_t x87_fround32_64(double b) +{ + int32_t a, c; + + switch ((cpu_state.npxc >> 10) & 3) + { + case 0: /*Nearest*/ + a = (int32_t)floor(b); + c = (int32_t)floor(b + 1.0); + if ((b - a) < (c - b)) + return (int64_t) a; + else if ((b - a) > (c - b)) + return (int64_t) c; + else + return (a & 1) ? c : a; + case 1: /*Down*/ + return (int64_t)((int32_t)floor(b)); + case 2: /*Up*/ + return (int64_t)((int32_t)ceil(b)); + case 3: /*Chop*/ + return (int64_t)((int32_t)b); + } + + return 0; +} static inline int64_t x87_fround(double b) { int64_t a, c; diff --git a/src/floppy/fdd_86f.c b/src/floppy/fdd_86f.c index ebd7d6f7c..ac4de1ee4 100644 --- a/src/floppy/fdd_86f.c +++ b/src/floppy/fdd_86f.c @@ -1498,10 +1498,15 @@ uint8_t d86f_get_data(int drive, int base) { d86f_t *dev = d86f[drive]; - int data; + int data, byte_count; - if (dev->data_find.bytes_obtained < (d86f_get_data_len(drive) + base)) { - data = fdc_getdata(d86f_fdc, dev->data_find.bytes_obtained == (d86f_get_data_len(drive) + base - 1)); + if (fdd_get_turbo(drive) && (dev->version == 0x0063)) + byte_count = dev->turbo_pos; + else + byte_count = dev->data_find.bytes_obtained; + + if (byte_count < (d86f_get_data_len(drive) + base)) { + data = fdc_getdata(d86f_fdc, byte_count == (d86f_get_data_len(drive) + base - 1)); if ((data & DMA_OVER) || (data == -1)) { dev->dma_over++; if (data == -1) @@ -1577,7 +1582,7 @@ d86f_read_sector_data(int drive, int side) } else { if (dev->data_find.bytes_obtained < d86f_get_data_len(drive)) { if (dev->state != STATE_16_VERIFY_DATA) { - read_status = fdc_data(d86f_fdc, data, dev->data_find.bytes_obtained == ((d86f_get_data_len(drive)) - 1)); + read_status = fdc_data(d86f_fdc, data, dev->data_find.bytes_obtained == (d86f_get_data_len(drive) - 1)); if (read_status == -1) dev->dma_over++; } @@ -2130,23 +2135,24 @@ d86f_turbo_read(int drive, int side) dat = d86f_handler[drive].read_data(drive, side, dev->turbo_pos); else dat = (random_generate() & 0xff); - dev->turbo_pos++; if (dev->state == STATE_11_SCAN_DATA) { /* Scan/compare command. */ recv_data = d86f_get_data(drive, 0); d86f_compare_byte(drive, recv_data, dat); } else { - if (dev->data_find.bytes_obtained < (128UL << dev->last_sector.id.n)) { + if (dev->turbo_pos < (128UL << dev->req_sector.id.n)) { if (dev->state != STATE_16_VERIFY_DATA) { - read_status = fdc_data(d86f_fdc, dat, dev->data_find.bytes_obtained == ((128UL << dev->last_sector.id.n) - 1)); + read_status = fdc_data(d86f_fdc, dat, dev->turbo_pos == ((128UL << dev->req_sector.id.n) - 1)); if (read_status == -1) dev->dma_over++; } } } - if (dev->turbo_pos >= (128 << dev->last_sector.id.n)) { + dev->turbo_pos++; + + if (dev->turbo_pos >= (128UL << dev->req_sector.id.n)) { dev->data_find.sync_marks = dev->data_find.bits_obtained = dev->data_find.bytes_obtained = 0; if ((flags & SECTOR_CRC_ERROR) && (dev->state != STATE_02_READ_DATA)) { #ifdef ENABLE_D86F_LOG diff --git a/src/win/win.c b/src/win/win.c index a72a40709..f3f96cb2e 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -1089,12 +1089,13 @@ plat_setfullscreen(int on) } /* Main Window. */ + if (vid_resize >= 2) + MoveWindow(hwndMain, window_x, window_y, window_w, window_h, TRUE); + if (hide_status_bar) ResizeWindowByClientArea(hwndMain, temp_x, temp_y); else ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height); - - SetWindowPos(hwndMain, HWND_TOP, window_x, window_y, 0, 0, SWP_NOSIZE); } /* Render window. */ diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 75b0aad92..79cc3a121 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -980,7 +980,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) video_force_resize_set(1); } - if (window_remember || (vid_resize & 2)) { + if (!(pos->flags & SWP_NOSIZE) && (window_remember || (vid_resize & 2))) { window_x = pos->x; window_y = pos->y; if (!(vid_resize & 2)) { @@ -1379,6 +1379,7 @@ ui_init(int nCmdShow) MoveWindow(hwnd, window_x, window_y, window_w, window_h, TRUE); else { if (vid_resize >= 2) { + MoveWindow(hwnd, window_x, window_y, window_w, window_h, TRUE); scrnsz_x = fixed_size_x; scrnsz_y = fixed_size_y; } @@ -1386,8 +1387,6 @@ ui_init(int nCmdShow) ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y); else ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height); - - SetWindowPos(hwndMain, HWND_TOP, window_x, window_y, 0, 0, SWP_NOSIZE); } /* Reset all menus to their defaults. */