Commit Graph

188 Commits

Author SHA1 Message Date
TC1995
12a57ffeac Changes to 8514/A compatible stuff (November 2nd, 2024)
1. vga_on global variable removed, as it didn't play well with 2 subsystems at once (8514/A and XGA both enabled).
2. Emulate the Foreground/Background Color aliases of PIX_TRANS properly when not executing a command.
3. Voodoo 3D override now works properly (again) with Mach32 PCI cards and others by turning the 8514/A timer off and on accordingly.
2024-11-02 20:50:06 +01:00
TC1995
9c111584b5 Big video changes of the day (October 26th, 2024)
8514/A/Mach8/32:
Reworked the acceleration a bit as well as the mode switches from VGA to ATI/8514/A mode and viceversa based on the documentation. Fixes the Linux GUI fonts using the Mach32 driver (possibly Mach8 too) and other anomalies (still needs more work on the acceleration though).

PVGA:
Minor fixes to the banking.

S3-based (Pre-ViRGE):
1. Made the chip class use its own banking so that the Enhanced Mode mapping (equivalent to 64K-based A0000) is taken into account (per bit 3 of CRTC31, which forces the mapping to be 64K A0000, regardless of the GDCREG6 bits). Fixes NT 3.1 347.1's S3 driver.
2. Initial rework on 15bpp/16bpp accelerated mode of the 911/924 chips (currently not 100% bug free, I need help with this chips).

XGA-1/2:
Get rid of the linear endian reverse variable hack used by OS/2 and, instead, use the already declared ones more wisely, fixes OS/2 2.1 reversed fonts and keeps everything else working as it should.

Misc:
Added the BT481 RAMDAC for future card use.
2024-10-26 21:32:47 +02:00
TC1995
f102fee497 Major video changes of the day (October 3rd, 2024)
8514/A changes:
1. Correct interlaced display resolution.
2. Added a limit to cursor coordinates.
3. Test/WIP features of the add-on Mach8 side (ATI 8514/A Ultra) such as configurable BIOS.
4. Made the CMD 5 of the acceleration (Polygon Boundary) more accurate per manual (as much as I could regarding the clipping).

Cirrus related:
1. Added SUBSYS PCI vendor/device ID of the 5480 (per manual).

IBM VGA:
1. Built-in/option rom-less VGA don't need the "available" flag.

ATI Mach8/32:
1. As with 8514/A, corrected interlaced display.

XGA-1/-2:
1. Moved the XGA R/W memory size tests out of the SVGA R/W routines to reflect the per card basis, although anything that uses its own SVGA mapping would call the tests there (such as Cirrus, Headland and ATI) when not accessing the LFB. This finally puts an end to the XGA MCA mapping enabling bugs.
2. Re-organized the ISA standalone and non-standalone (INMOS) sides of the chips so that they work properly and remove the FILE rom loading hack from init.
3. The Memory Mapped R/W sides now account for instance in their address range.
4. INMOS only: prevent any ROM address access to anything lower than 0xc8000 to not conflict with the main BIOS rom loading.
5. Fixed native pitch by using the correct register, this fixes non 1024x768 resolutions under NT.
6. More logs when enabled to see any future bugs.
2024-10-03 14:56:23 +02:00
TC1995
5247214061 Video changes of the day (August 12th, 2024, S3/TGUI/SVGA))
SVGA: Added an indicator of the internal line to make matters easier for some vertical resolution problems.
TGUI 9400CXi: Fixed the basic acceleration as much as I could.
TGUI 9440AGi+: As with the line indicator, make matters easier for some resolution problems plus some refactoring of the bpp. Added write protection to some regs based on some documentation on the vt8601.
TGUI cursor: fixed the left edge of the cursor X offset.
S3: Apply the vblankstart = dispend statement only on enhanced modes, fixes vertical display on The Incredible Machine for DOS.
Commented out some excess logs.
2024-08-12 19:52:52 +02:00
OBattler
c32c685070 vid_svga.c: Allocate 8 bytes more of video memory to avoid segmentation faults. 2024-07-28 03:44:45 +02:00
OBattler
e377e58881 Assorted fixes and Dev branched the Matrox G100 and the PCL printer. 2024-07-26 00:39:11 +02:00
TC1995
1b6fd190fb Video changes of the day (July 8th, 2024)
IBM 8514/A set:
Fixed a one off video bug that was causing the VGA video to not be restored after quitting a 8514/A GUI session (namely on Win2.x' 8514/A's driver).
ATI Mach32:
Fixed another vertical display issue when activated (in 1280x1024 mode, when 1024 was 1022).
All involved:
Apply RG's changedvram fix to 8514/A, Mach8/32 and XGA's changedvram pointers.
2024-07-08 21:21:06 +02:00
RichardG867
357701dbb5 SVGA: Make changedvram 1 page bigger to fix adjacent page checks going OOB when the framebuffer is at top of VRAM (Voodoo 3 drivers) 2024-07-02 17:54:44 -03:00
TC1995
2ac3d289e6 Video changes part 1 for 4.2
1. Corrected the ATI 1881x clocks for use with the ATI Mach8/32 and VGA Wonder chips. The CPU slowdowns should now be gone.
2. Merged I/O ports common to both the ATI and IBM 8514/A compatible chips where they have identical code (extended behavior is still separate). Code duplication is now less than before.
3. Fixed a general polygon pattern issue in the Mach8/32 affecting calc.exe in Win3.x and other stuff.
4. Mode changes are, once again, changed (ATI and IBM), as close as possible to the real thing without destroying existing resolutions.
5. The 8514/A Vertical Counter has been extended to 0xfff so that it can take 1280x1024 resolutions well offered by the Mach32 as well as a better way to change the IBM/ATI modes through a callback swap where approprietate.
6. in 8514/A mode, reads from the 0x3c6-0x3c9 ramdac range is redirected to the 8514/A RAMDAC (0x2ea-0x2ed).
7. LFB access in the Mach32 now no longer takes account of the SVGA derived rops. Fixes Mach32 display on NeXTSTEP/OPENSTEP 3.x/4.x
8. Reworked the Display Sense Status and Subsystem Status ports so that they're not copycats from MAME and instead follow the datasheet.
2024-05-29 20:47:22 +02:00
OBattler
656591d385 The forgotten changes to video/vid_svga.c. 2024-05-03 11:18:28 +02:00
OBattler
ee7df06168 Voodoo: Honor monitor overscan. 2024-04-02 00:08:40 +02:00
Alexander Babikov
8e06b5449f Overhaul plat_get_string()
Now takes constants with human-readable names instead of
Win32 string table IDs, language.h is no longer needed

ui_msgbox*() no longer accepts string IDs as arguments directly,
plat_get_string() must be explicitly called to retrieve the string
2024-03-20 20:33:28 +05:00
OBattler
9124e8165b Removed the incorrect usage of CRTC register 3 bits 5 and 6. 2024-02-23 17:02:42 +01:00
TC1995
46fbb3bb9e Video related changes:
IBM/ATI 8514/A side:
Made mode switches more immediate when actually switching from VGA to 8514/A and viceversa.

Tseng ET4000AX/W32 series side:
Actually use bit 2 of index 0x3f for the horizontal blank start bit 8 instead of bit 4 (horizontal retrace start), fixes skew issues with the et4000w32i rev B. card with resolutions like 1024x768 at 15 or 16bpp and others.
2024-02-22 13:35:04 +01:00
Cacodemon345
1b5d84f366 C&T 69000: DPMS
Also draw black overscan when monitor is turned off via DPMS.
2024-02-21 02:25:40 +06:00
TC1995
963b7eec04 Some temporary video changes regarding the horizontal display.
S3 side:
Temporary changes to match the release (due to tomorrow) of 86box. Said changes are about the horizontal display of the tvp3026-based S3 chips.

IBM/ATI 8514-based:
Temporarily commented out the hblank side of it due to htotal bugs.

TVP3026 side:
When the upper clock selection bits are 0 and when extended VGA modes are set, double the hdisp.
2024-02-20 18:41:51 +01:00
OBattler
4c3cceec69 Fixed off by one errors in (S)VGA horizontal blanking start calculation. 2024-02-18 17:54:14 +01:00
OBattler
26dcf9cb73 Make the horizontal blanking loops no longer loop eternally. 2024-02-18 11:54:11 +01:00
Cacodemon345
f5995a4719 vid_svga.c: Hardware cursors with negative Y values work properly now
* Fixes cursor disappearing completely in Matrox cards in some cases.
* Allows emulated video adapters allowing negative Y values for hardware cursor to render those properly
2024-02-15 00:34:24 +06:00
TC1995
a330860b2e Fixed the Cirrus banking issue for good (really)
A bit controversial regarding extra_banks but this should be enough to fix everything in the banks of the CL-GD54xx (up to 5480).
2024-02-09 18:28:09 +01:00
OBattler
3f8952a558 More (S)VGA horizontal blanking fixes and CPU CR0 bit 4 fixes. 2024-02-09 18:02:33 +01:00
TC1995
ca11dae903 Fix SVGA code warnings.
See above.
2024-02-07 20:56:25 +01:00
TC1995
7198b78069 Couple of changes in the video side.
1. Second attempt to fix the banking in the Cirrus (sigh, why doesn't banking get nulled automatically...)
2. Introduce a new timer to the 8514/A side so it won't slow the VGA clock down it was shared before.
2024-02-07 01:53:16 +01:00
OBattler
f3d585a1e1 Fix horizontal blanking calculation, fixes some S3 blanking excesses. 2024-02-07 00:11:02 +01:00
OBattler
ca4f5bad13 More horizontal blanking calculation fixes (and actually use blank start, not retrace start), fixes graphics cut-off on Voodoo on Windows 98 SE. 2024-01-13 00:41:45 +01:00
OBattler
553e58f8ef Remove an unnecessary subtraction proven to be wrong by the S3 and IBM documentation and that was a result of VGADOC being vague. 2024-01-11 02:11:23 +01:00
OBattler
c4aa4e8889 A minor change to video/vid_svga.c. 2024-01-11 01:56:32 +01:00
OBattler
fe52ecc3da GreaseMonkey's comments in vid_svga.c. 2024-01-10 23:44:27 +01:00
OBattler
03a1f783f2 ATi Mach64: Override (S)VGA horizontal blanking calculation in accelerator CRTC mode. 2024-01-10 22:41:13 +01:00
Cacodemon345
8e9a2e0b79 Apply blanking extensions to more SVGA cards.
* Fix duplicated logic in vid_svga.c
* Voodoo 3/Banshee emulation now has blanking extensions applied
* S3 ViRGE and Matrox video cards as well
* Tseng ET4000-series cards as well
* Fix off-by-one error in vid_cl54xx.c

Trident cards are yet to be investigated. XGA and 8514/A are yet to be made blanking extensions compliant. Mach64, Paradise/WDC and OAK OTI cards remain as-is for now.
2024-01-11 01:48:49 +06:00
OBattler
0a8b4d061c Conflict resolution. 2024-01-10 08:59:46 +01:00
OBattler
79874ad3d5 EGA and (S)VGA: Removed a leftover if block around overscan Y, fixes garbage overscan Y values causing crashes. 2024-01-09 17:38:54 +01:00
GreaseMonkey
258c55dcd3 EGA, (S)VGA: Fix vertical fine scroll behaviour
Ref: GH-4001
2024-01-07 09:04:25 +13:00
TC1995
979198d592 More ATI changes plus one IBM 8514/A fix:
1. Made the 4 color mode (67h) work properly now, including its 4 schemes on all ATI cards that support said mode.
2. Shadow set now has a true purpose for 8514/A compatibility on ATI Mach8/32.
3. Non-ATI 8514/A used to not work before because of the dev->local variable was not being set to 0 in the ibm8514_init() function, now it's fixed.
2023-12-27 21:01:25 +01:00
OBattler
35450fe632 Restored some previously reverted changes. 2023-12-27 15:47:42 +01:00
OBattler
2002f8e34e Fixed the variable's name. 2023-12-27 15:38:43 +01:00
OBattler
a2a180ad8e Merge branch 'master' of https://github.com/86Box/86Box 2023-12-27 15:37:44 +01:00
OBattler
d9a571c179 A small preparation in vid_svga. 2023-12-27 15:37:37 +01:00
TC1995
f0f52279c4 Restore correct CGA compatible mode behavior in (S)VGA. 2023-12-27 02:48:55 +01:00
Cacodemon345
1bd4bbdfa1 MGA: Implement gamma-correction for <= 16 bpp modes 2023-12-25 15:24:52 +06:00
TC1995
f5642ab1c3 MGA fixes 2:
1. Reverted the packed chain4 and fb_only sides to 1 when extended mode is set, but with the call to svga_recalctimings removed from port 0x3df due to mode issues, this should fix all the MGA mode issues I know.
2. Cleaned up the rendering order in svga_recalctimings, especially 4bpp and 8bpp.
2023-12-18 13:42:32 +01:00
TC1995
ce0b6e1da1 Cirrus, ATI Mach8/32 and XGA fixes.
1. Update svga->fast to account for packed chain mode toggles, fixes issues on Descent II for DOS using the Cirrus cards.
2. Re-organized ATI Mach8/32 LFB access as well as 8514/A/ATI mode toggles, should end the video mode issues once and for all.
3. Fixed a small but major pattern issue with IBM OS/2 1.30.1's XGA driver (not .2, which is fine as is).
2023-12-06 15:00:31 +01:00
GreaseMonkey
d19fe700f5 Use 8bpp renderer when attrregs.0x10.6 is set instead of when gdcreg.0x05.6 is set
This allows correct emulation of the 4bpp chunky mode which is supported by many but not all chipsets.
See discussion #3840 on GitHub.
2023-11-23 09:58:16 +13:00
GreaseMonkey
220d5fa237 (S)VGA: Do redraws if blink is enabled in graphics mode too
Easy test case in QBASIC:

    SCREEN 10
    PSET (2,0),2

There should be a blinking pixel in the top-left.
2023-11-21 19:32:43 +13:00
TC1995
6c356df9e7 More and more video changes and fixes (8514/A and compatibles):
1. Made the 8514/A mode switch to VGA and viceversa (including ATI mode) actually usable and eliminating the last bugs related to them. Fixes 8514/A mode in OS/2 1.x/2.x (both IBM and Microsoft).
2. More sanity checks to the 8514/A and XGA pointers. Should fix emulator crashes on hard resets.
2023-11-08 23:47:16 +01:00
TC1995
85bdf40a1c VGA/XGA memory fix.
the XGA memory test takes account of Win3.x' XGA memory test again without conflicting XGAKIT's test, fixes DOS-based boxes using Win3.x XGA drivers in 386 mode.
2023-10-15 19:27:33 +02:00
TC1995
6913de32c5 More video fixes:
ATI Mach64 is temporarily unthreaded because of blitter desyncing.
ATI Mach32 now returns to ATI mode from IBM mode and vice versa more correctly.
Make the IBM 8514/A compatible poll not run if a 3D add-on card (Voodoo1/2) takes precedence (seen on a Mach32 PCI and Voodoo2 3D combo).
Finally ended the mess ups of the TGUI9440/96x0 pitch, it actually was the CRTC offset reg (SVGA CRTC 0x13) that defined it with some shifting based on the BPP.
2023-10-11 18:46:15 +02:00
OBattler
881844dd32 Do not call 8514/A or XGA recalculate timings functions until the function pointer is non-NULL. 2023-10-10 00:49:44 +02:00
OBattler
39d10899ac Sanitized some video code to avoid #include's inside headers, and added guards to include/86box/thread.h. 2023-10-09 20:14:03 +02:00
TC1995
6802c0593b Video, Storage and MCA changes/fixes.
1. Cirrus Logic GD54xx, Paradise/WD VGA now reset the interlace once a text mode is issued if not done automatically.
2. Paradise/WD's 15/16bpp modes using the 800x600 resolution now have the correct ma_latch, should fix most operating systems drivers using this combo.
3. More fixes (hopefully) to the accelerated pitch and rowoffset of the Trident TGUI cards (9440AGi and 96x0XGi), should fix issues with delayed displays mode changes under various operating systems (e.g.: Win3.1x).
4. Preliminary implementation of the Area Fill command of XGA, which is issued while using various painting and/or calc utilities on Win3.1x (IBM XGA updated drivers, e.g.: 2.12).
5. Preliminary (and incomplete) 4bpp XGA mode.
6. The XGA memory test for the 0xa5 using writes (used by various operating systems) no longer conflicts with DOS' XGAKIT's memory detection.
7. Small ROP fixes to both XGA and 8514/A.
8. Re-organized the mapping of the Mach32 chipset, especially when to enable the ATI mode or switching back to IBM mode, should fix LFB conflicts with various operating systems.
9. According to The OS/2 Museum, the Adaptec AHA-154xB series of SCSI cards fail the ASPI4DOS.SYS 3.36 signature check, so now make the changes accordingly.
10. Remove useless and crashy bios-less option of the Trantor T128.
11. The Image Manager 1024 card can also be used on a XT (although only if it has a V20/V30).
12. Re-organized the IBM PS/2 model 60 initialization as well as its right POS machine ID (though an update to sc.exe is still required for the POST memory amount to work normally).
2023-09-30 22:08:08 +02:00