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/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/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index 117f2cea8..eafb16a40 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(&w83877f_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..d671cfabe 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 }, + /* 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 }, 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))) { 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() { 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; 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); diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index 5f849bfbe..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; } @@ -3067,6 +3069,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) 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); }