Merge remote-tracking branch 'origin/master' into feature/machine_and_kb
This commit is contained in:
65
.github/workflows/cmake.yml
vendored
65
.github/workflows/cmake.yml
vendored
@@ -131,3 +131,68 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: '86Box-${{ matrix.build.name }}-VS2019-${{ matrix.target-arch }}-${{ matrix.toolset }}-${{ github.sha }}'
|
name: '86Box-${{ matrix.build.name }}-VS2019-${{ matrix.target-arch }}-${{ matrix.toolset }}-${{ github.sha }}'
|
||||||
path: build/artifacts/bin/**
|
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
|
||||||
|
@@ -83,8 +83,10 @@ find_package(SDL2 REQUIRED)
|
|||||||
include_directories(${SDL2_INCLUDE_DIRS})
|
include_directories(${SDL2_INCLUDE_DIRS})
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
target_link_libraries(86Box SDL2::SDL2-static)
|
target_link_libraries(86Box SDL2::SDL2-static)
|
||||||
else()
|
elseif(WIN32)
|
||||||
target_link_libraries(86Box SDL2::SDL2)
|
target_link_libraries(86Box SDL2::SDL2)
|
||||||
|
else()
|
||||||
|
target_link_libraries(86Box ${SDL2_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(PNG REQUIRED)
|
find_package(PNG REQUIRED)
|
||||||
|
@@ -4314,6 +4314,56 @@ static inline void FP_LOAD_REG_D(int reg, int *host_reg1, int *host_reg2)
|
|||||||
|
|
||||||
*host_reg1 = REG_EBX;
|
*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)
|
static inline int64_t x87_fround(double b)
|
||||||
{
|
{
|
||||||
int64_t a, c;
|
int64_t a, c;
|
||||||
|
@@ -1498,10 +1498,15 @@ uint8_t
|
|||||||
d86f_get_data(int drive, int base)
|
d86f_get_data(int drive, int base)
|
||||||
{
|
{
|
||||||
d86f_t *dev = d86f[drive];
|
d86f_t *dev = d86f[drive];
|
||||||
int data;
|
int data, byte_count;
|
||||||
|
|
||||||
if (dev->data_find.bytes_obtained < (d86f_get_data_len(drive) + base)) {
|
if (fdd_get_turbo(drive) && (dev->version == 0x0063))
|
||||||
data = fdc_getdata(d86f_fdc, dev->data_find.bytes_obtained == (d86f_get_data_len(drive) + base - 1));
|
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)) {
|
if ((data & DMA_OVER) || (data == -1)) {
|
||||||
dev->dma_over++;
|
dev->dma_over++;
|
||||||
if (data == -1)
|
if (data == -1)
|
||||||
@@ -1577,7 +1582,7 @@ d86f_read_sector_data(int drive, int side)
|
|||||||
} else {
|
} else {
|
||||||
if (dev->data_find.bytes_obtained < d86f_get_data_len(drive)) {
|
if (dev->data_find.bytes_obtained < d86f_get_data_len(drive)) {
|
||||||
if (dev->state != STATE_16_VERIFY_DATA) {
|
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)
|
if (read_status == -1)
|
||||||
dev->dma_over++;
|
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);
|
dat = d86f_handler[drive].read_data(drive, side, dev->turbo_pos);
|
||||||
else
|
else
|
||||||
dat = (random_generate() & 0xff);
|
dat = (random_generate() & 0xff);
|
||||||
dev->turbo_pos++;
|
|
||||||
|
|
||||||
if (dev->state == STATE_11_SCAN_DATA) {
|
if (dev->state == STATE_11_SCAN_DATA) {
|
||||||
/* Scan/compare command. */
|
/* Scan/compare command. */
|
||||||
recv_data = d86f_get_data(drive, 0);
|
recv_data = d86f_get_data(drive, 0);
|
||||||
d86f_compare_byte(drive, recv_data, dat);
|
d86f_compare_byte(drive, recv_data, dat);
|
||||||
} else {
|
} 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) {
|
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)
|
if (read_status == -1)
|
||||||
dev->dma_over++;
|
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;
|
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)) {
|
if ((flags & SECTOR_CRC_ERROR) && (dev->state != STATE_02_READ_DATA)) {
|
||||||
#ifdef ENABLE_D86F_LOG
|
#ifdef ENABLE_D86F_LOG
|
||||||
|
Reference in New Issue
Block a user