diff --git a/src/cpu/x86.c b/src/cpu/x86.c index 60bc33b9b..77dd3b139 100644 --- a/src/cpu/x86.c +++ b/src/cpu/x86.c @@ -36,6 +36,8 @@ #include <86box/pci.h> #include <86box/ppi.h> #include <86box/timer.h> +#include <86box/video.h> +#include <86box/vid_svga.h> /* The opcode of the instruction currently being executed. */ uint8_t opcode; @@ -341,6 +343,9 @@ softresetx86(void) if (soft_reset_mask) return; + if (ibm8514_enabled) + vga_on = 1; + reset_common(0); } diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index 9881725ff..30d66f436 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -165,8 +165,6 @@ typedef struct svga_t int force_old_addr; - int vga_on; - int remap_required; uint32_t (*remap_func)(struct svga_t *svga, uint32_t in_addr); @@ -174,6 +172,7 @@ typedef struct svga_t } svga_t; extern svga_t *svga_8514; +extern int vga_on; extern void ibm8514_poll(ibm8514_t *dev, svga_t *svga); extern void ibm8514_recalctimings(svga_t *svga); diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index af3d9968d..af18727c5 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -958,8 +958,8 @@ ibm8514_accel_out(uint16_t port, uint32_t val, svga_t *svga, int len) case 0x4ae8: dev->accel.advfunc_cntl = val & 7; - svga->vga_on = ((dev->accel.advfunc_cntl & 1) == 0) ? 1 : 0; - //pclog("IBM 8514/A: VGA ON = %i, val = %02x\n", svga->vga_on, val); + vga_on = ((dev->accel.advfunc_cntl & 1) == 0) ? 1 : 0; + //pclog("IBM 8514/A: VGA ON = %i, val = %02x\n", vga_on, val); svga_recalctimings(svga); break; } diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 4cc66899c..dde271df9 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -53,7 +53,7 @@ uint8_t svga_rotate[8][256]; /*Primary SVGA device. As multiple video cards are not yet supported this is the only SVGA device.*/ static svga_t *svga_pri; - +int vga_on; svga_t *svga_get_pri() @@ -554,7 +554,7 @@ svga_recalctimings(svga_t *svga) } else overscan_x = 16; - if (svga->vga_on) { + if (vga_on) { if (svga->recalctimings_ex) { svga->recalctimings_ex(svga); } @@ -657,7 +657,7 @@ svga_poll(void *p) int wx, wy; int ret, old_ma; - if (!svga->vga_on) { + if (!vga_on) { ibm8514_poll(&svga->dev8514, svga); return; } @@ -968,7 +968,7 @@ svga_init(const device_t *info, svga_t *svga, void *p, int memsize, svga->translate_address = NULL; svga->ksc5601_english_font_type = 0; - svga->vga_on = 1; + vga_on = 1; if ((info->flags & DEVICE_PCI) || (info->flags & DEVICE_VLB) || (info->flags & DEVICE_MCA)) { mem_mapping_add(&svga->mapping, 0xa0000, 0x20000,