diff --git a/src/include/86box/vid_8514a.h b/src/include/86box/vid_8514a.h index 4b81e56c0..5d4b262c4 100644 --- a/src/include/86box/vid_8514a.h +++ b/src/include/86box/vid_8514a.h @@ -40,15 +40,13 @@ typedef enum { } ibm8514_extensions_t; typedef struct hwcursor8514_t { - int ena; + int enable; int x; int y; int xoff; int yoff; int cur_xsize; int cur_ysize; - int v_acc; - int h_acc; uint32_t addr; uint32_t pitch; } hwcursor8514_t; @@ -129,7 +127,6 @@ typedef struct ibm8514_t { uint16_t clip_bottom; int16_t clip_left; int16_t clip_top; - uint8_t pix_trans[2]; int ssv_state; int temp_cnt; @@ -144,7 +141,7 @@ typedef struct ibm8514_t { uint32_t src; uint32_t dest; int x_count; - int y_count; + /* y_count not used */ int input; int input2; int output; @@ -154,13 +151,8 @@ typedef struct ibm8514_t { uint8_t ssv_dir; uint8_t ssv_draw; int odd_in; - int odd_out; - uint16_t scratch; int fill_state; - int xdir; - int ydir; - int linedraw; uint32_t ge_offset; uint32_t src_ge_offset; uint32_t dst_ge_offset; @@ -214,10 +206,9 @@ typedef struct ibm8514_t { int hdisp2; int hdisped; int scanline; - int vsyncstart; int vsyncwidth; int vtotal; - int v_disp; + int vdisp_latch; int vdisp; int disp_cntl; int interlace; diff --git a/src/include/86box/vid_ati_eeprom.h b/src/include/86box/vid_ati_eeprom.h index c52b5bd4b..84e09f946 100644 --- a/src/include/86box/vid_ati_eeprom.h +++ b/src/include/86box/vid_ati_eeprom.h @@ -49,7 +49,7 @@ typedef struct ati_eeprom_t { void ati_eeprom_load(ati_eeprom_t *eeprom, char *fn, int type); void ati_eeprom_load_mach8(ati_eeprom_t *eeprom, char *fn, int mca); void ati_eeprom_load_mach8_vga(ati_eeprom_t *eeprom, char *fn); -void ati_eeprom_write(ati_eeprom_t *eeprom, int ena, int clk, int dat); +void ati_eeprom_write(ati_eeprom_t *eeprom, int enable, int clk, int dat); int ati_eeprom_read(ati_eeprom_t *eeprom); #endif /*VIDEO_ATI_EEPROM_H*/ diff --git a/src/include/86box/vid_svga.h b/src/include/86box/vid_svga.h index 77e41273d..b6eae1c8a 100644 --- a/src/include/86box/vid_svga.h +++ b/src/include/86box/vid_svga.h @@ -33,7 +33,7 @@ struct monitor_t; typedef struct hwcursor_t { - int ena; + int enable; int x; int y; int xoff; diff --git a/src/include/86box/vid_xga.h b/src/include/86box/vid_xga.h index e72c7af40..a2ef1a530 100644 --- a/src/include/86box/vid_xga.h +++ b/src/include/86box/vid_xga.h @@ -20,7 +20,7 @@ #include <86box/rom.h> typedef struct xga_hwcursor_t { - int ena; + int enable; int x; int y; int xoff; diff --git a/src/video/ramdac/vid_ramdac_bt48x.c b/src/video/ramdac/vid_ramdac_bt48x.c index d608750e3..0a70afdbd 100644 --- a/src/video/ramdac/vid_ramdac_bt48x.c +++ b/src/video/ramdac/vid_ramdac_bt48x.c @@ -161,7 +161,7 @@ bt48x_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svga_ break; case 0x09: /* Command Register 2 (RS value = 1001) */ ramdac->cmd_r2 = val; - svga->dac_hwcursor.ena = !!(val & 0x03); + svga->dac_hwcursor.enable = !!(val & 0x03); bt48x_set_bpp(ramdac, svga); break; case 0x0a: diff --git a/src/video/ramdac/vid_ramdac_ibm_rgb528.c b/src/video/ramdac/vid_ramdac_ibm_rgb528.c index cd7d5c1b6..947c251e9 100644 --- a/src/video/ramdac/vid_ramdac_ibm_rgb528.c +++ b/src/video/ramdac/vid_ramdac_ibm_rgb528.c @@ -631,7 +631,7 @@ ibm_rgb528_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *s } svga->dac_hwcursor.addr = ramdac->smlc_part; svga->dac_hwcursor.cur_xsize = svga->dac_hwcursor.cur_ysize = (val & 0x04) ? 64 : 32; - svga->dac_hwcursor.ena = ((val & 0x03) != 0x00); + svga->dac_hwcursor.enable = ((val & 0x03) != 0x00); break; case 0x031: if (!updt_cntl) diff --git a/src/video/ramdac/vid_ramdac_tvp3026.c b/src/video/ramdac/vid_ramdac_tvp3026.c index bd5a83fd0..e80aeedab 100644 --- a/src/video/ramdac/vid_ramdac_tvp3026.c +++ b/src/video/ramdac/vid_ramdac_tvp3026.c @@ -170,7 +170,7 @@ tvp3026_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svg svga->dac_hwcursor.cur_xsize = svga->dac_hwcursor.cur_ysize = 64; svga->dac_hwcursor.x = ramdac->hwc_x - svga->dac_hwcursor.cur_xsize; svga->dac_hwcursor.y = ramdac->hwc_y - svga->dac_hwcursor.cur_ysize; - svga->dac_hwcursor.ena = !!(val & 0x03); + svga->dac_hwcursor.enable = !!(val & 0x03); ramdac->mode = val & 0x03; } break; @@ -182,13 +182,13 @@ tvp3026_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svg svga->dac_hwcursor.cur_xsize = svga->dac_hwcursor.cur_ysize = 64; svga->dac_hwcursor.x = ramdac->hwc_x - svga->dac_hwcursor.cur_xsize; svga->dac_hwcursor.y = ramdac->hwc_y - svga->dac_hwcursor.cur_ysize; - svga->dac_hwcursor.ena = !!(val & 0x03); + svga->dac_hwcursor.enable = !!(val & 0x03); ramdac->mode = val & 0x03; } else { svga->dac_hwcursor.cur_xsize = svga->dac_hwcursor.cur_ysize = 64; svga->dac_hwcursor.x = ramdac->hwc_x - svga->dac_hwcursor.cur_xsize; svga->dac_hwcursor.y = ramdac->hwc_y - svga->dac_hwcursor.cur_ysize; - svga->dac_hwcursor.ena = !!(ramdac->dcc & 0x03); + svga->dac_hwcursor.enable = !!(ramdac->dcc & 0x03); ramdac->mode = ramdac->dcc & 0x03; } break; diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index d8dc369e2..f911da6be 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -397,21 +397,21 @@ ibm8514_accel_out_fifo(svga_t *svga, uint16_t port, uint32_t val, int len) case 0x16e8: /*In preparation to switch from VGA to 8514/A mode*/ if (len == 2) { - dev->v_disp = val; - dev->v_disp &= 0x1fff; - ibm8514_log("IBM 8514/A: V_DISP write 16E8 = %d\n", dev->v_disp); + dev->vdisp_latch = val; + dev->vdisp_latch &= 0x1fff; + ibm8514_log("IBM 8514/A: V_DISP write 16E8 = %d\n", dev->vdisp_latch); ibm8514_log("IBM 8514/A: (0x%04x): vdisp=0x%02x.\n", port, val); svga_recalctimings(svga); } else { - WRITE8(port, dev->v_disp, val); + WRITE8(port, dev->vdisp_latch, val); } break; case 0x16e9: /*In preparation to switch from VGA to 8514/A mode*/ if (len == 1) { - WRITE8(port, dev->v_disp, val >> 8); - dev->v_disp &= 0x1fff; - ibm8514_log("IBM 8514/A: V_DISP write 16E8 = %d\n", dev->v_disp); + WRITE8(port, dev->vdisp_latch, val >> 8); + dev->vdisp_latch &= 0x1fff; + ibm8514_log("IBM 8514/A: V_DISP write 16E8 = %d\n", dev->vdisp_latch); ibm8514_log("IBM 8514/A: (0x%04x): vdisp=0x%02x.\n", port, val); svga_recalctimings(svga); } @@ -3663,12 +3663,12 @@ ibm8514_poll(void *priv) if (dev->on) { ibm8514_log("ON!\n"); if (!dev->linepos) { - if ((dev->displine == ((dev->hwcursor_latch.y < 0) ? 0 : dev->hwcursor_latch.y)) && dev->hwcursor_latch.ena) { + if ((dev->displine == ((dev->hwcursor_latch.y < 0) ? 0 : dev->hwcursor_latch.y)) && dev->hwcursor_latch.enable) { dev->hwcursor_on = dev->hwcursor_latch.cur_ysize - dev->hwcursor_latch.yoff; dev->hwcursor_oddeven = 0; } - if ((dev->displine == (((dev->hwcursor_latch.y < 0) ? 0 : dev->hwcursor_latch.y) + 1)) && dev->hwcursor_latch.ena && dev->interlace) { + if ((dev->displine == (((dev->hwcursor_latch.y < 0) ? 0 : dev->hwcursor_latch.y) + 1)) && dev->hwcursor_latch.enable && dev->interlace) { dev->hwcursor_on = dev->hwcursor_latch.cur_ysize - (dev->hwcursor_latch.yoff + 1); dev->hwcursor_oddeven = 1; } @@ -3819,7 +3819,7 @@ ibm8514_recalctimings(svga_t *svga) if (dev->h_total == 1) /*Default to 1024x768 87hz 8514/A htotal timings if it goes to 0.*/ dev->h_total = 0x9e; - dev->vdisp = (dev->v_disp + 1) >> 1; + dev->vdisp = (dev->vdisp_latch + 1) >> 1; if ((dev->vdisp == 478) || (dev->vdisp == 766)) dev->vdisp += 2; diff --git a/src/video/vid_ati_eeprom.c b/src/video/vid_ati_eeprom.c index a057f1f39..1efb506d1 100644 --- a/src/video/vid_ati_eeprom.c +++ b/src/video/vid_ati_eeprom.c @@ -107,18 +107,18 @@ ati_eeprom_save(ati_eeprom_t *eeprom) } void -ati_eeprom_write(ati_eeprom_t *eeprom, int ena, int clk, int dat) +ati_eeprom_write(ati_eeprom_t *eeprom, int enable, int clk, int dat) { - if (!ena) + if (!enable) eeprom->out = 1; if (clk && !eeprom->oldclk) { - if (ena && !eeprom->oldena) { + if (enable && !eeprom->oldena) { eeprom->state = EEPROM_WAIT; eeprom->opcode = 0; eeprom->count = 3; eeprom->out = 1; - } else if (ena) { + } else if (enable) { switch (eeprom->state) { case EEPROM_WAIT: if (!dat) @@ -231,9 +231,9 @@ ati_eeprom_write(ati_eeprom_t *eeprom, int ena, int clk, int dat) break; } } - eeprom->oldena = ena; + eeprom->oldena = enable; } else if (!clk && eeprom->oldclk) { - if (ena) { + if (enable) { switch (eeprom->state) { case EEPROM_OUTPUT: eeprom->out = (eeprom->dat & 0x10000) ? 1 : 0; diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index 471dacb19..fadf1115f 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -2297,7 +2297,7 @@ mach64_vblank_start(svga_t *svga) svga->overlay.addr = mach64->buf_offset[0] & 0x3ffff8; svga->overlay.pitch = mach64->buf_pitch[0] & 0xfff; - svga->overlay.ena = (mach64->overlay_scale_cntl & OVERLAY_EN) && (overlay_cmp_mix != 1); + svga->overlay.enable = (mach64->overlay_scale_cntl & OVERLAY_EN) && (overlay_cmp_mix != 1); mach64->overlay_v_acc = 0; mach64->scaler_update = 1; @@ -3344,9 +3344,9 @@ mach64_ext_writeb(uint32_t addr, uint8_t val, void *priv) ati_eeprom_write(&mach64->eeprom, mach64->gen_test_cntl & 0x10, mach64->gen_test_cntl & 2, mach64->gen_test_cntl & 1); mach64->gen_test_cntl = (mach64->gen_test_cntl & ~8) | (ati_eeprom_read(&mach64->eeprom) ? 8 : 0); if (mach64->type == MACH64_GX) - svga->dac_hwcursor.ena = !!(mach64->gen_test_cntl & 0x80); + svga->dac_hwcursor.enable = !!(mach64->gen_test_cntl & 0x80); else - svga->hwcursor.ena = !!(mach64->gen_test_cntl & 0x80); + svga->hwcursor.enable = !!(mach64->gen_test_cntl & 0x80); break; case 0xdc: diff --git a/src/video/vid_ati_mach8.c b/src/video/vid_ati_mach8.c index 5a767e3fc..4a73d6a8e 100644 --- a/src/video/vid_ati_mach8.c +++ b/src/video/vid_ati_mach8.c @@ -2715,7 +2715,7 @@ mach_set_resolution(mach_t *mach, svga_t *svga) dev->hdisp = (dev->hdisped + 1) << 3; - dev->vdisp = (dev->v_disp + 1) >> 1; + dev->vdisp = (dev->vdisp_latch + 1) >> 1; if ((dev->vdisp == 478) || (dev->vdisp == 598) || (dev->vdisp == 766) || (dev->vdisp == 1022)) dev->vdisp += 2; @@ -3232,17 +3232,17 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u if (len == 2) { if ((mach->accel.clock_sel & 0x01) || (!(mach->accel.clock_sel & 0x01) && (mach->shadow_set & 0x03))) { /*For 8514/A mode, take the shadow sets into account.*/ if (!(mach->shadow_cntl & 0x20) && val) { - dev->v_disp = val; - dev->v_disp &= 0x1fff; + dev->vdisp_latch = val; + dev->vdisp_latch &= 0x1fff; } } - mach_log("ATI 8514/A: V_DISP write 16E8=%d\n", dev->v_disp); + mach_log("ATI 8514/A: V_DISP write 16E8=%d\n", dev->vdisp_latch); mach_log("ATI 8514/A: (0x%04x): vdisp=0x%02x.\n", port, val); } else { if ((mach->accel.clock_sel & 0x01) || (!(mach->accel.clock_sel & 0x01) && (mach->shadow_set & 0x03))) { /*For 8514/A mode, take the shadow sets into account.*/ if (!(mach->shadow_cntl & 0x20)) { - WRITE8(port, dev->v_disp, val); - dev->v_disp &= 0x1fff; + WRITE8(port, dev->vdisp_latch, val); + dev->vdisp_latch &= 0x1fff; } } } @@ -3252,11 +3252,11 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u if (len == 1) { if ((mach->accel.clock_sel & 0x01) || (!(mach->accel.clock_sel & 0x01) && (mach->shadow_set & 0x03))) { /*For 8514/A mode, take the shadow sets into account.*/ if (!(mach->shadow_cntl & 0x20)) { - WRITE8(port, dev->v_disp, val >> 8); - dev->v_disp &= 0x1fff; + WRITE8(port, dev->vdisp_latch, val >> 8); + dev->vdisp_latch &= 0x1fff; } } - mach_log("ATI 8514/A: V_DISP write 16E8=%d.\n", dev->v_disp); + mach_log("ATI 8514/A: V_DISP write 16E8=%d.\n", dev->vdisp_latch); mach_log("ATI 8514/A: (0x%04x): vdisp=0x%02x.\n", port, val); } svga_recalctimings(svga); @@ -3604,7 +3604,7 @@ mach_accel_out_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, u if (len == 2) { WRITE8(port + 1, mach->cursor_offset_hi_reg, val >> 8); } - dev->hwcursor.ena = !!(mach->cursor_offset_hi_reg & 0x8000); + dev->hwcursor.enable = !!(mach->cursor_offset_hi_reg & 0x8000); mach->cursor_offset_hi = mach->cursor_offset_hi_reg & 0x0f; dev->hwcursor.addr = ((mach->cursor_offset_lo | (mach->cursor_offset_hi << 16)) << 2); if (!dev->vram_is_512k && ((mach->accel.ext_ge_config & 0x30) == 0x00)) @@ -4606,13 +4606,13 @@ mach_accel_in_fifo(mach_t *mach, svga_t *svga, ibm8514_t *dev, uint16_t port, in case 0xc6ee: if (len == 2) - temp = dev->v_disp; + temp = dev->vdisp_latch; else - temp = dev->v_disp & 0xff; + temp = dev->vdisp_latch & 0xff; break; case 0xc6ef: if (len == 1) - temp = dev->v_disp >> 8; + temp = dev->vdisp_latch >> 8; break; case 0xcaee: @@ -7246,7 +7246,7 @@ ati8514_init(svga_t *svga, void *ext8514, void *dev8514) dev->accel_bpp = 8; dev->rowoffset = 0x80; dev->hdisped = 0x7f; - dev->v_disp = 0x05ff; + dev->vdisp_latch = 0x05ff; dev->htotal = 0x9d; dev->v_total_reg = 0x0668; dev->v_sync_start = 0x0600; diff --git a/src/video/vid_chips_69000.c b/src/video/vid_chips_69000.c index 70b2b9e16..c63886b04 100644 --- a/src/video/vid_chips_69000.c +++ b/src/video/vid_chips_69000.c @@ -1906,7 +1906,7 @@ chips_69000_write_ext_reg(chips_69000_t* chips, uint8_t val) break; case 0xA0: chips->ext_regs[chips->ext_index] = val; - chips->svga.hwcursor.ena = ((val & 7) == 0b101) || ((val & 7) == 0b1); + chips->svga.hwcursor.enable = ((val & 7) == 0b101) || ((val & 7) == 0b1); chips->svga.hwcursor.cur_xsize = chips->svga.hwcursor.cur_ysize = ((val & 7) == 0b1) ? 32 : 64; break; case 0xA2: diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index e1c02f5a9..a896108d6 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -813,7 +813,7 @@ gd54xx_out(uint16_t addr, uint8_t val, void *priv) else svga->overscan_color = svga->pallook[svga->attrregs[0x11]]; svga_recalctimings(svga); - svga->hwcursor.ena = val & CIRRUS_CURSOR_SHOW; + svga->hwcursor.enable = val & CIRRUS_CURSOR_SHOW; if (svga->crtc[0x27] >= CIRRUS_ID_CLGD5422) svga->hwcursor.cur_xsize = svga->hwcursor.cur_ysize = ((svga->crtc[0x27] >= CIRRUS_ID_CLGD5422) && @@ -1244,7 +1244,7 @@ gd54xx_out(uint16_t addr, uint8_t val, void *priv) break; case 0x3e: gd54xx->overlay.mode = (val >> 1) & 7; - svga->overlay.ena = (val & 1) != 0; + svga->overlay.enable = (val & 1) != 0; gd54xx_update_overlay(gd54xx); break; diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index 533bd1f28..ca2ee8434 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -277,7 +277,7 @@ et4000w32p_out(uint16_t addr, uint8_t val, void *priv) et4000->regs[et4000->index] = val; svga->hwcursor.x = et4000->regs[0xE0] | ((et4000->regs[0xE1] & 7) << 8); svga->hwcursor.y = et4000->regs[0xE4] | ((et4000->regs[0xE5] & 7) << 8); - svga->hwcursor.ena = !!(et4000->regs[0xF7] & 0x80); + svga->hwcursor.enable = !!(et4000->regs[0xF7] & 0x80); svga->hwcursor.xoff = et4000->regs[0xE2]; svga->hwcursor.yoff = et4000->regs[0xE6]; svga->hwcursor.cur_xsize = svga->hwcursor.cur_ysize = ((et4000->regs[0xEF] & 4) || ((et4000->type == ET4000W32) && (et4000->regs[0xe2] >= 0x1f) && (et4000->regs[0xe6] >= 0x1f))) ? 128 : 64; diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index 3089ae26d..061b70246 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -299,7 +299,7 @@ ht216_out(uint16_t addr, uint8_t val, void *priv) break; case 0xa5: - svga->hwcursor.ena = !!(val & 0x80); + svga->hwcursor.enable = !!(val & 0x80); break; case 0xc0: diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index e08ee1724..e5ac55648 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -1380,7 +1380,7 @@ mystique_write_xreg(mystique_t *mystique, int reg, uint8_t val) case XREG_XCURCTRL: mystique->xcurctrl = val; - svga->hwcursor.ena = (val & 3) ? 1 : 0; + svga->hwcursor.enable = (val & 3) ? 1 : 0; break; case XREG_XCURCOL0R: diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index b222957eb..4f890dcdf 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -3037,7 +3037,7 @@ s3_out(uint16_t addr, uint8_t val, void *priv) case 0x45: if ((s3->chip == S3_VISION964) || (s3->chip == S3_VISION968)) break; - svga->hwcursor.ena = val & 1; + svga->hwcursor.enable = val & 1; break; case 0x46: case 0x47: @@ -4442,13 +4442,13 @@ s3_trio64v_recalctimings(svga_t *svga) else svga->overlay.addr = s3->streams.sec_fb0; - svga->overlay.ena = (svga->overlay.x >= 0); + svga->overlay.enable = (svga->overlay.x >= 0); svga->overlay.h_acc = s3->streams.dda_horiz_accumulator; svga->overlay.v_acc = s3->streams.dda_vert_accumulator; svga->rowoffset = s3->streams.pri_stride >> 3; - if (svga->overlay.ena) { - svga->overlay.ena = (((s3->streams.blend_ctrl >> 24) & 7) == 0b000) || + if (svga->overlay.enable) { + svga->overlay.enable = (((s3->streams.blend_ctrl >> 24) & 7) == 0b000) || (((s3->streams.blend_ctrl >> 24) & 7) == 0b101); } switch ((s3->streams.pri_ctrl >> 24) & 0x7) { diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index 9422f69bf..387d5faec 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -584,7 +584,7 @@ s3_virge_out(uint16_t addr, uint8_t val, void *priv) break; case 0x45: - svga->hwcursor.ena = val & 1; + svga->hwcursor.enable = val & 1; break; case 0x46: case 0x47: @@ -965,19 +965,19 @@ s3_virge_recalctimings(svga_t *svga) else svga->overlay.addr = virge->streams.sec_fb0; - svga->overlay.ena = (svga->overlay.x >= 0); + svga->overlay.enable = (svga->overlay.x >= 0); svga->overlay.h_acc = virge->streams.dda_horiz_accumulator; svga->overlay.v_acc = virge->streams.dda_vert_accumulator; if (virge->chip < S3_VIRGEGX2) svga->rowoffset = virge->streams.pri_stride >> 3; - if (virge->chip <= S3_VIRGEDX && svga->overlay.ena) { - svga->overlay.ena = (((virge->streams.blend_ctrl >> 24) & 7) == 0b000) || (((virge->streams.blend_ctrl >> 24) & 7) == 0b101); - } else if (virge->chip >= S3_VIRGEGX2 && svga->overlay.ena) { + if (virge->chip <= S3_VIRGEDX && svga->overlay.enable) { + svga->overlay.enable = (((virge->streams.blend_ctrl >> 24) & 7) == 0b000) || (((virge->streams.blend_ctrl >> 24) & 7) == 0b101); + } else if (virge->chip >= S3_VIRGEGX2 && svga->overlay.enable) { /* 0x20 = Secondary Stream enabled */ /* 0x2000 = Primary Stream enabled */ - svga->overlay.ena = !!(virge->streams.blend_ctrl & 0x20); + svga->overlay.enable = !!(virge->streams.blend_ctrl & 0x20); } if (virge->chip >= S3_VIRGEGX2) { diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 4b80a0eed..54856d9e0 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -1223,32 +1223,32 @@ svga_poll(void *priv) svga_log("SVGA Poll.\n"); if (!svga->linepos) { - if (svga->displine == ((svga->hwcursor_latch.y < 0) ? 0 : svga->hwcursor_latch.y) && svga->hwcursor_latch.ena) { + if (svga->displine == ((svga->hwcursor_latch.y < 0) ? 0 : svga->hwcursor_latch.y) && svga->hwcursor_latch.enable) { svga->hwcursor_on = svga->hwcursor_latch.cur_ysize - svga->hwcursor_latch.yoff; svga->hwcursor_oddeven = 0; } - if (svga->displine == (((svga->hwcursor_latch.y < 0) ? 0 : svga->hwcursor_latch.y) + 1) && svga->hwcursor_latch.ena && svga->interlace) { + if (svga->displine == (((svga->hwcursor_latch.y < 0) ? 0 : svga->hwcursor_latch.y) + 1) && svga->hwcursor_latch.enable && svga->interlace) { svga->hwcursor_on = svga->hwcursor_latch.cur_ysize - (svga->hwcursor_latch.yoff + 1); svga->hwcursor_oddeven = 1; } - if (svga->displine == ((svga->dac_hwcursor_latch.y < 0) ? 0 : svga->dac_hwcursor_latch.y) && svga->dac_hwcursor_latch.ena) { + if (svga->displine == ((svga->dac_hwcursor_latch.y < 0) ? 0 : svga->dac_hwcursor_latch.y) && svga->dac_hwcursor_latch.enable) { svga->dac_hwcursor_on = svga->dac_hwcursor_latch.cur_ysize - svga->dac_hwcursor_latch.yoff; svga->dac_hwcursor_oddeven = 0; } - if (svga->displine == (((svga->dac_hwcursor_latch.y < 0) ? 0 : svga->dac_hwcursor_latch.y) + 1) && svga->dac_hwcursor_latch.ena && svga->interlace) { + if (svga->displine == (((svga->dac_hwcursor_latch.y < 0) ? 0 : svga->dac_hwcursor_latch.y) + 1) && svga->dac_hwcursor_latch.enable && svga->interlace) { svga->dac_hwcursor_on = svga->dac_hwcursor_latch.cur_ysize - (svga->dac_hwcursor_latch.yoff + 1); svga->dac_hwcursor_oddeven = 1; } - if (svga->displine == svga->overlay_latch.y && svga->overlay_latch.ena) { + if (svga->displine == svga->overlay_latch.y && svga->overlay_latch.enable) { svga->overlay_on = svga->overlay_latch.cur_ysize - svga->overlay_latch.yoff; svga->overlay_oddeven = 0; } - if (svga->displine == svga->overlay_latch.y + 1 && svga->overlay_latch.ena && svga->interlace) { + if (svga->displine == svga->overlay_latch.y + 1 && svga->overlay_latch.enable && svga->interlace) { svga->overlay_on = svga->overlay_latch.cur_ysize - svga->overlay_latch.yoff; svga->overlay_oddeven = 1; } diff --git a/src/video/vid_tgui9440.c b/src/video/vid_tgui9440.c index 5cc3a8a78..c0ba06a07 100644 --- a/src/video/vid_tgui9440.c +++ b/src/video/vid_tgui9440.c @@ -530,7 +530,7 @@ tgui_out(uint16_t addr, uint8_t val, void *priv) case 0x50: if (tgui->type >= TGUI_9440) { - svga->hwcursor.ena = !!(val & 0x80); + svga->hwcursor.enable = !!(val & 0x80); svga->hwcursor.cur_xsize = svga->hwcursor.cur_ysize = ((val & 1) ? 64 : 32); } break; diff --git a/src/video/vid_voodoo_banshee.c b/src/video/vid_voodoo_banshee.c index 4bcf8a479..12cccdccb 100644 --- a/src/video/vid_voodoo_banshee.c +++ b/src/video/vid_voodoo_banshee.c @@ -679,7 +679,7 @@ banshee_recalctimings(svga_t *svga) svga->interlace = !!(banshee->vidProcCfg & VIDPROCCFG_INTERLACE); - svga->overlay.ena = banshee->vidProcCfg & VIDPROCCFG_OVERLAY_ENABLE; + svga->overlay.enable = banshee->vidProcCfg & VIDPROCCFG_OVERLAY_ENABLE; svga->overlay.x = voodoo->overlay.start_x; svga->overlay.y = voodoo->overlay.start_y; @@ -689,8 +689,8 @@ banshee_recalctimings(svga_t *svga) if (banshee->vidProcCfg & VIDPROCCFG_OVERLAY_TILE) svga->overlay.pitch *= 128 * 32; if (svga->overlay.cur_xsize <= 0 || svga->overlay.cur_ysize <= 0) - svga->overlay.ena = 0; - if (svga->overlay.ena) { + svga->overlay.enable = 0; + if (svga->overlay.enable) { #if 0 banshee_log("Overlay enabled : start=%i,%i end=%i,%i size=%i,%i pitch=%x\n", voodoo->overlay.start_x, voodoo->overlay.start_y, @@ -894,7 +894,7 @@ banshee_ext_outl(uint16_t addr, uint32_t val, void *priv) banshee_log("vidProcCfg=%08x\n", val); #endif banshee->overlay_pix_fmt = (val & VIDPROCCFG_OVERLAY_PIX_FORMAT_MASK) >> VIDPROCCFG_OVERLAY_PIX_FORMAT_SHIFT; - svga->hwcursor.ena = val & VIDPROCCFG_HWCURSOR_ENA; + svga->hwcursor.enable = val & VIDPROCCFG_HWCURSOR_ENA; svga->fullchange = changeframecount; svga->lut_map = !(val & VIDPROCCFG_DESKTOP_CLUT_BYPASS) && (svga->bpp < 24); svga_recalctimings(svga); diff --git a/src/video/vid_xga.c b/src/video/vid_xga.c index 8f4dc0d0e..51f842cc5 100644 --- a/src/video/vid_xga.c +++ b/src/video/vid_xga.c @@ -424,7 +424,7 @@ xga_ext_out_reg(xga_t *xga, svga_t *svga, uint8_t idx, uint8_t val) case 0x36: xga->hwc_control = val; - xga->hwcursor.ena = xga->hwc_control & 1; + xga->hwcursor.enable = xga->hwc_control & 1; break; case 0x38: @@ -3092,12 +3092,12 @@ xga_poll(void *priv) xga_log("XGA Poll=%d.\n", xga->on); if (xga->on) { if (!xga->linepos) { - if (xga->displine == xga->hwcursor_latch.y && xga->hwcursor_latch.ena) { + if (xga->displine == xga->hwcursor_latch.y && xga->hwcursor_latch.enable) { xga->hwcursor_on = xga->hwcursor_latch.cur_ysize - ((xga->hwcursor_latch.yoff & 0x20) ? 32 : 0); xga->hwcursor_oddeven = 0; } - if (xga->displine == (xga->hwcursor_latch.y + 1) && xga->hwcursor_latch.ena && xga->interlace) { + if (xga->displine == (xga->hwcursor_latch.y + 1) && xga->hwcursor_latch.enable && xga->interlace) { xga->hwcursor_on = xga->hwcursor_latch.cur_ysize - ((xga->hwcursor_latch.yoff & 0x20) ? 33 : 1); xga->hwcursor_oddeven = 1; }