From 9f18b19b49d2780af70f29fa9c25eb45c913f783 Mon Sep 17 00:00:00 2001 From: qta3426 Date: Wed, 1 Jun 2022 21:54:54 +0900 Subject: [PATCH 01/10] Added Soltek SL-56A5 --- src/include/86box/machine.h | 1 + src/machine/m_at_socket7.c | 30 ++++++++++++++++++++++++++++++ src/machine/machine_table.c | 2 ++ 3 files changed, 33 insertions(+) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index fae7fb587..43799d1fe 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -627,6 +627,7 @@ extern int machine_at_an430tx_init(const machine_t *); #endif extern int machine_at_ym430tx_init(const machine_t *); extern int machine_at_mb540n_init(const machine_t *); +extern int machine_at_56a5_init(const machine_t *); extern int machine_at_p5mms98_init(const machine_t *); extern int machine_at_ficva502_init(const machine_t *); diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index 117f2cea8..a7273b775 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -799,6 +799,36 @@ machine_at_mb540n_init(const machine_t *model) return ret; } +int +machine_at_56a5_init(const machine_t* model) +{ + int ret; + + ret = bios_load_linear("roms/machines/56a5/54p5b6b.bin", + 0x000e0000, 131072, 0); + + if (bios_only || !ret) + return ret; + + machine_at_common_init_ex(model, 2); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); /* PIIX4 */ + pci_register_slot(0x10, PCI_CARD_NORMAL, 1, 2, 3, 4); + device_add(&i430tx_device); + device_add(&piix4_device); + device_add(&keyboard_ps2_pci_device); + device_add(&w83877tf_acorp_device); + device_add(&sst_flash_29ee010_device); + spd_register(SPD_TYPE_SDRAM, 0x3, 128); + + return ret; +} int machine_at_p5mms98_init(const machine_t *model) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 6a8e74ded..9b948eb1c 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -785,6 +785,8 @@ const machine_t machines[] = { { "[i430TX] Intel YM430TX", "ym430tx", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_ym430tx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, /* The BIOS sends KBC command BB and expects it to output a byte, which is AMI KBC behavior. */ { "[i430TX] PC Partner MB540N", "mb540n", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_mb540n_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 66666667, 2700, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, + /* The BIOS award. PS2, EDO, SDRAM, 4PCI, 4ISA etc.. */ + { "[i430TX] Soltek SL-56A5", "56a5", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_56a5_init, 0, 0, MACHINE_AVAILABLE, 0, CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 55000000, 75000000, 2800, 3520, 1.5, 5.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, /* [TEST] Has AMIKey 'H' KBC firmware. */ { "[i430TX] Supermicro P5MMS98", "p5mms98", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_p5mms98_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2100, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, From 44d4d960cf6304f85d4397d67741015ffb0ec7a7 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Mon, 11 Jul 2022 12:10:57 +0600 Subject: [PATCH 02/10] Include array header --- src/qt/qt_mainwindow.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp index 30163429a..f0fd3ba6a 100644 --- a/src/qt/qt_mainwindow.hpp +++ b/src/qt/qt_mainwindow.hpp @@ -7,6 +7,7 @@ #include #include +#include class MediaMenu; class RendererStack; From f90a38e1625adcfcd57657bca35799e332f5d34c Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Mon, 11 Jul 2022 14:43:14 +0600 Subject: [PATCH 03/10] qt_d3d9renderer: Make screenshots work --- src/qt/qt_d3d9renderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/qt_d3d9renderer.cpp b/src/qt/qt_d3d9renderer.cpp index 3a8001be4..cb2d0a25a 100644 --- a/src/qt/qt_d3d9renderer.cpp +++ b/src/qt/qt_d3d9renderer.cpp @@ -152,7 +152,7 @@ void D3D9Renderer::blit(int x, int y, int w, int h) srcRect.left = source.left(); srcRect.right = source.right(); - if (screenshots) { + if (monitors[m_monitor_index].mon_screenshots) { video_screenshot_monitor((uint32_t *) &(monitors[m_monitor_index].target_buffer->line[y][x]), 0, 0, 2048, m_monitor_index); } if (SUCCEEDED(d3d9surface->LockRect(&lockRect, &srcRect, 0))) { From 2d184a50f72525f814e5e6639469709f97744b4b Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Mon, 11 Jul 2022 15:32:07 +0600 Subject: [PATCH 04/10] qt_openglrenderer: Fix black area at the bottom of the screen --- src/qt/qt_openglrenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/qt_openglrenderer.cpp b/src/qt/qt_openglrenderer.cpp index 918ba155a..7c7cd55fa 100644 --- a/src/qt/qt_openglrenderer.cpp +++ b/src/qt/qt_openglrenderer.cpp @@ -425,7 +425,7 @@ OpenGLRenderer::onBlit(int buf_idx, int x, int y, int w, int h) } if (!hasBufferStorage) - glBufferSubData(GL_PIXEL_UNPACK_BUFFER, BUFFERBYTES * buf_idx, h * ROW_LENGTH * sizeof(uint32_t), (uint8_t *) unpackBuffer + BUFFERBYTES * buf_idx); + glBufferSubData(GL_PIXEL_UNPACK_BUFFER, BUFFERBYTES * buf_idx, h * ROW_LENGTH * sizeof(uint32_t) + (y * ROW_LENGTH * sizeof(uint32_t)), (uint8_t *) unpackBuffer + BUFFERBYTES * buf_idx); glPixelStorei(GL_UNPACK_SKIP_PIXELS, BUFFERPIXELS * buf_idx + y * ROW_LENGTH + x); glPixelStorei(GL_UNPACK_ROW_LENGTH, ROW_LENGTH); From 3348b747a5f2753aa8d0bed32784c1ae74e76353 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Mon, 11 Jul 2022 20:52:04 +0600 Subject: [PATCH 05/10] Restore code to properly restore coordinates --- src/qt/qt_mainwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 1012084b7..31ab4886b 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -642,6 +642,13 @@ void MainWindow::showEvent(QShowEvent *event) { monitors[0].mon_scrnsz_x = fixed_size_x; monitors[0].mon_scrnsz_y = fixed_size_y; } + if (window_remember && vid_resize == 1) { + ui->stackedWidget->setFixedSize(window_w, window_h); + adjustSize(); + ui->stackedWidget->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + monitors[0].mon_scrnsz_x = window_w; + monitors[0].mon_scrnsz_y = window_h; + } } void MainWindow::on_actionKeyboard_requires_capture_triggered() { From a2c9dc5dbb856e615e833b756638eb6090ee3d5b Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Mon, 11 Jul 2022 21:34:58 +0600 Subject: [PATCH 06/10] Make screenshots thread-safe --- src/include/86box/video.h | 3 ++- src/video/video.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/include/86box/video.h b/src/include/86box/video.h index 2847a7cb4..eca390975 100644 --- a/src/include/86box/video.h +++ b/src/include/86box/video.h @@ -25,6 +25,7 @@ #ifdef __cplusplus #include using atomic_bool = std::atomic_bool; +using atomic_int = std::atomic_int; #else #include #endif @@ -112,7 +113,7 @@ typedef struct monitor_t int mon_force_resize; int mon_fullchange; int mon_changeframecount; - int mon_screenshots; + atomic_int mon_screenshots; uint32_t* mon_pal_lookup; int* mon_cga_palette; int mon_pal_lookup_static; /* Whether it should not be freed by the API. */ diff --git a/src/video/video.c b/src/video/video.c index ec56c574c..6738c4fc2 100644 --- a/src/video/video.c +++ b/src/video/video.c @@ -442,7 +442,7 @@ video_screenshot_monitor(uint32_t *buf, int start_x, int start_y, int row_len, i video_take_screenshot_monitor((const char *) path, buf, start_x, start_y, row_len, monitor_index); png_destroy_write_struct(&png_ptr[monitor_index], &info_ptr[monitor_index]); - monitors[monitor_index].mon_screenshots--; + atomic_fetch_sub(&monitors[monitor_index].mon_screenshots, 1); } void @@ -942,6 +942,7 @@ video_monitor_init(int index) monitors[index].mon_force_resize = 1; monitors[index].mon_vid_type = VIDEO_FLAG_TYPE_NONE; atomic_init(&doresize_monitors[index], 0); + atomic_init(&monitors[index].mon_screenshots, 0); if (index >= 1) ui_init_monitor(index); monitors[index].mon_blit_data_ptr->blit_thread = thread_create(blit_thread, monitors[index].mon_blit_data_ptr); } From c202a065ecdcbb02232c58ef3db8a8b42691a6cc Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 11 Jul 2022 18:24:11 +0200 Subject: [PATCH 07/10] Fixed 1280x1024x16bpp and 1600x1200x16bpp on the Elsa S3 Vision 964 and 968 cards. --- src/video/vid_s3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index 5f849bfbe..de238ec83 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -3067,6 +3067,10 @@ static void s3_recalctimings(svga_t *svga) break; case 16: svga->render = svga_render_16bpp_highres; + if ((s3->card_type == S3_ELSAWIN2KPROX_964) || (s3->card_type == S3_ELSAWIN2KPROX)) { + if (s3->width == 1280 || s3->width == 1600) + svga->hdisp <<= 1; + } if ((s3->chip != S3_VISION964) && (s3->card_type != S3_SPEA_MIRAGE_86C801) && (s3->card_type != S3_SPEA_MIRAGE_86C805)) { if (s3->chip == S3_86C928) From ef869d7a3d374b2b826cf0a456103352dcb3d017 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 11 Jul 2022 18:32:19 +0200 Subject: [PATCH 08/10] S3: Disable (S)VGA split screen functionality in enhanced modes, fixes 1600x1200 modes. --- src/video/vid_s3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index de238ec83..6887c0b51 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -2899,6 +2899,8 @@ static void s3_recalctimings(svga_t *svga) if (svga->crtc[0x5e] & 0x04) svga->vblankstart |= 0x400; if (svga->crtc[0x5e] & 0x10) svga->vsyncstart |= 0x400; if (svga->crtc[0x5e] & 0x40) svga->split |= 0x400; + if (s3->accel.advfunc_cntl & 0x01) + svga->split = 0x7fff; if (svga->crtc[0x51] & 0x30) svga->rowoffset |= (svga->crtc[0x51] & 0x30) << 4; else if (svga->crtc[0x43] & 0x04) svga->rowoffset |= 0x100; } From 05cabd5756c7c46a8de0f0a9d3f41c2ce3b850d1 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Mon, 11 Jul 2022 19:52:31 -0400 Subject: [PATCH 09/10] Update Soltek SL-56A5 description --- src/machine/machine_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 9b948eb1c..d671cfabe 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -785,7 +785,7 @@ const machine_t machines[] = { { "[i430TX] Intel YM430TX", "ym430tx", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_ym430tx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, /* The BIOS sends KBC command BB and expects it to output a byte, which is AMI KBC behavior. */ { "[i430TX] PC Partner MB540N", "mb540n", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_mb540n_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 60000000, 66666667, 2700, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, - /* The BIOS award. PS2, EDO, SDRAM, 4PCI, 4ISA etc.. */ + /* Award BIOS, PS2, EDO, SDRAM, 4 PCI, 4 ISA, VIA VT82C42N KBC */ { "[i430TX] Soltek SL-56A5", "56a5", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_56a5_init, 0, 0, MACHINE_AVAILABLE, 0, CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 55000000, 75000000, 2800, 3520, 1.5, 5.5, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, /* [TEST] Has AMIKey 'H' KBC firmware. */ { "[i430TX] Supermicro P5MMS98", "p5mms98", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430TX, machine_at_p5mms98_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2100, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, NULL, NULL }, From 93f3a59849022682b564a6a23caea8f34c6ac749 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Mon, 11 Jul 2022 19:54:10 -0400 Subject: [PATCH 10/10] correct Soltek SL-56A5 SIO --- src/machine/m_at_socket7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index a7273b775..eafb16a40 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -823,7 +823,7 @@ machine_at_56a5_init(const machine_t* model) device_add(&i430tx_device); device_add(&piix4_device); device_add(&keyboard_ps2_pci_device); - device_add(&w83877tf_acorp_device); + device_add(&w83877f_device); device_add(&sst_flash_29ee010_device); spd_register(SPD_TYPE_SDRAM, 0x3, 128);