Commit Graph

35 Commits

Author SHA1 Message Date
TC1995
4a98cef2bf Cleaned up IBM/ATI 8514/A code (June 9th, 2025)
Replaced the magic numbers with actual enumerators for ease of understanding.
2025-06-09 17:31:56 +02:00
TC1995
14ef3b75ac Vast fixes to the Mach8/32/8514/A compatible side (April 22nd 2025)
1. As tiring as it seems, XOR properly the passthrough bits for mode changes. Fixes everything tested as of now (Mach8/32).
2. Implemented separate destination and source GE pitch and offsets. Fixes Windows 3.1 mach8/32 drivers using devicebitmap enabled (or dmp=1).
3. Properly fixed high and true color patterns so that the aforementioned patterns are drawn correctly in various stuff.
4. Implemented in the best possible way the CRT offset (currently in on conjunction with the GE offset).
5. On ScanToX with bpp set to 24 and dpconfig 0x6211, optmize the SRC/CUR X-Y coordinates at the end of the blit.
6. For mode changes, don't call the mode change recalctimings function if we aren't in the appropriate bits of the respective ports.
7. Separate 8514/A compatible and Extended foreground/background selection implemented, fixes Windows 3.x ATI Ultra drivers from 1992 without hacks.
8. Clear the busy flags when needed without stalling the entire guests (but not the emulator itself) (Mach8/32).
9. The MMIO regs should be enabled only when the VGA aperture has reached a graphics mode (0xA000). This fixes NT 3.x mach drivers in true color mode and making Win3.1 drivers working without a hitch at the same time.
10. Actually implement the hardware 4bpp cursor properly on Mach32.
11. Cosmetic cleanups.
2025-04-22 21:15:05 +02:00
TC1995
5ae5e99e41 Major changes on the 8514/A side again (March 30th, 2025)
1. The DX/DY coordinates for BitBLT are now signed again, fixes 8514/A cursor issues.
2. Made the busy/data available processor statuses more like the ATI one for more stability and no stalls, fixes Windows 3.x and IBM OS/2 1.x (possibly later ones too) that use the built-in 8514/A driver.
3. Made the mode switching clearer (through a note) regarding the shadow sets, this should make every program happy, I hope.
4. In the Mach32 series only, a first load of the CRT sets also initializes the GE offsets if the corresponding bit is set, fixes Mach8/32 mode tests in their eeprom and demoai with hdiload from ATI/IBM.
2025-03-30 22:06:16 +02:00
TC1995
5a4a939e02 More fixes to the 8514/A compatible side.
1. Use proper identification to what chips use what.
2. Apply some mode switch fixes to the ATI 8514/A Ultra and make 1024x768 87Hz interlaced the default mode if htotal is 0 and on ati8514_init.
3. Add the undocumented ports to the ATI 8514/A Ultra add-on as well.
2025-03-29 20:27:20 +01:00
TC1995
c91f2255ad Vast overhaul for the Mach8/32/8514/A (March 29th, 2025)
1. Implemented the FIFO test data to pass some tests of the Mach8 POST ROM and tests (not complete yet).
2. Overhauled the mode switches again, but this time with way less hacks and more on manual instructions.
3. Use a function pointer to determine if the Mach8 type used is a VGA combo or add-on.
4. Mach32 mode tests are no longer incorrectly green (was caused by improper pixtrans parts).
5. Implemented overscan color to the Mach32 as well as the CRT offset.
6. And fixed a PCI LFB GPF issue with the Mach32 2.3 drivers on Win3.1x.
7. Implemented memory boundary for both the Mach32 SVGA and its accelerator.
8. Added undocumented ports used by the FIFO (such as ports 0x8AEE and 0xEAEE).
9. Plus resetting the device right a la s3.
10. Temporarily switched the bus type of the Mach8 to 8-bit in both MCA and ISA variants.
2025-03-29 14:42:25 +01:00
TC1995
5c78fa5203 8514/A compatible changes of the day (March 6th, 2025)
1. Follow the Mach32 manual more closely regarding vblank support.
2. The subsystem status now takes account of the other bits more accurately.
3. The Mach32 PCI, when used with the ATI 68860 ramdac, has its own bpp's when in accelerator mode, separate from the VGA compatible side, so fix this accordingly.
4. Reset the vram when a mapping change occurs, should clear the messups in the ATI Mach8/32 accel video mode tests.
2025-03-06 16:03:11 +01:00
TC1995
9bc5f0dd05 8514/A and S3 changes of the late day (January 9th, 2025)
S3:
1. Cleaned up the Short Stroke command processing.
2. Proceed calculating the error term only when it's equal or greater than the line length (Draw Line, Command 1 and also applies to Short Strokes, Command 0).

8514/A compatibles:
1. Reworked the polygon draw type A processing.
2. As with the S3, reworked the way error term is handled in the processing, and on Command 5 (Draw Polygon Boundary Line).
2025-01-09 22:58:40 +01:00
TC1995
afe95cd20c Video changes of the day (November 13th, 2024)
1. Finally add the ATI 8514/A Ultra add-on BIOS in both ISA and MCA variants (despite the ROM page failure on POST).
2. Fixed a mode switch bug in the Mach8 (both add-on and vga combo) when exiting the Win3.x GUI using the native drivers.
3. Corrected (best possible) the eeprom load of the Mach8 products.
4. Partial implementation of the FIFO on the 8514/A compatible products including Mach8/32 and plain IBM 8514/A.
2024-11-13 22:55:16 +01:00
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
8a7e0ea547 Small but important video changes of the day (October 27th, 2024)
8514/A compatibles:
1. The mode switch (from VGA to 8514/A/ATI and vice-versa) has been fixed again (for the Nth time).
2. Removed a pattern hack used on DPCONFIG = 0x5211 on bitblt, now patterns work properly using the ATI Mach8 3.0 win3.1x drivers.
3. Clipping regs are more accurate for acceleration.

XGA 1-2:
A picky OS is a picky OS, fixes to the Win95 fonts (which uses the pattern sources) applied.
2024-10-27 23:36:11 +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
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
TC1995
fb6b0458a6 ATI Mach32/64 changes for the better:
1. On both Mach'es: direct linear video memory access is now the default for LFB mapping: fixes Mach64 drivers on NeXTSTEP/OPENSTEP and keeps everything else intact.
2. Mach8/32: minor cleanup to mode change code.
2024-05-16 22:33:50 +02: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
TC1995
cfd8ec8088 Slight cleanup of the 8514/A compatible chips.
Hopefully fix various modes altogether in all three chips (640x480, 800x600, 1024x768 and 1280x1024).
2024-01-26 19:03:43 +01:00
TC1995
d17d13e3b8 ATI Mach8/32 mode changes and cleanup:
1. Cleanups and moving the mach8/32 struct to a dedicated header so that would allow for future 8514/A add-on clones (in paper).
2. Mach8/32's port 0x4ae8/9 and shadow set ports (0x5aee and 0x46ee) now account to the mode changes seriously, should fix most of the horizontal/vertical coordinates while entering GUI modes of various stuff.
3. Horizontal/Vertical window coordinates can only be modified if the display enable bit of port 0x22e8 is set as well as bit 0 of port 0x4aee, fixes most problems noted above.
4. Implemented horizontal blanking stuff a la VGA but actually for 8514/A and clones (like ATI).
5. Added some comments regarding the current situation.
6. The Mach8 was actually a 8514/A clone co-processor, not a single solution card of its own. The ATI Graphics Ultra was a single solution card that is actually a Mach8 + ATI 28800-6 in one, so renaming it accordingly.
7. Fixed garbled/distorted acceleration when device bitmap acceleration is enabled in the ATI Mach8 3.0 Win3.1 drivers.
2024-01-15 21:43:33 +01:00
TC1995
4b52a514bd Huge fixes to 8514/A compatibles:
1. Properly implemented polygon filling in the BitBLT side of the ATI 8514/A compatibles (Mach8/32), this allows games like Mj8514 and demos like HDIDEMO from IBM to run under ATI's hdiload 1.1 properly.
2. Finally figured out the polygon filling command in the IBM one about read and write masks (Command 5 and Command 2 with polygon filling bits on, currently only for the read mask one), this allows the above samples to render properly with IBM's original hdiload 1.0 from 1987.
2024-01-05 21:22:01 +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
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
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
59811075db New batch of ATI Mach8/32 changes:
1. Hopefully fixed the passthrough stuff for good and fixed typo's in the IBM 8514/A poll function about the cursor.
2. Eliminated the ibm8514_on global variable in favor of a struct variable to be consistent with XGA.
2023-08-15 00:11:56 +02:00
Jasmine Iwanek
02e41927e3 Dribs and drabs which have escaped 2023-08-12 13:07:00 -04:00
TC1995
f240e8cb0c Video changes:
1. The passthrough from VGA to 8514/A and/or 8514/A to VGA no longer relies on hackish places where to switch from/to, instead, relying on port 0x3c3 of VGA doing so (though the Mach8/32 still needs some places where to manually switch from/to, mainly the MCA one when configuring the EEPROM).
2. Implemented the MCA behalf of the Mach32 and its corresponding reset function.
3. Properly implemented (more or less) true color, including 24-bit BGR rendering
4. Other fixes such as color patterns and mono patterns being more correct than before in various operating systems and in 24-bit true color.
5. Implemented the onboard Mach32 video of the IBM PS/ValuePoint P60 machine.
6. Made the onboard internal video detect when it's 8514/A compatible or not (CGA/EGA/MDA/VGA/etc.). If the former is selected, then the video monitor flag is used instead (for QT).
7. The TGUI9400 and 9440, if on VLB, now detect the right amount of memory if on 2MB.
8. Initial implementation of the ATI 68875 ramdac used by the Mach32 and made the ATI 68860 8514/A aware when selected with the Mach32AX PCI.
9. Separated the 8514/A ramdac ports from the VGA ramdac ports, allowing seamless transition from/to 8514/A/VGA.
10. Fixed a hdisp problem in the ET4000/W32 cards, where it was doubling the horizontal display in 15bpp+ graphics mode.
11. Removed the 0x3da/0x3ba port hack that was on the Mach8/32 code, relying on the (S)VGA core instead.
12. Reworked and simplified the TGUI9440 pitch register based on logging due to no documentation at all.
2023-08-12 00:00:46 +02:00
Jasmine Iwanek
22948be80a sonarlint vid_8514a.c 2023-07-31 14:53:39 -04:00
OBattler
b810d3edc1 Some small 8514/a / Mach8 fixes. 2023-07-30 02:45:53 +02:00
Jasmine Iwanek
ee695e71f9 More sonarlint work 2023-07-25 17:59:22 -04:00
TC1995
cb06b9e78f Video features and fixes:
Added the Mach8 and Mach32 ISA/VLB/PCI cards (initial implementation and MCA coming soon for the Mach32) and their corresponding EEPROM's.
Added INMOS XGA ISA card and updated the SVGA core to reflect its mapping as well as the Mach8/32 mapping when in 8514 monitor mode.
Mark the XGA button as already checked and locked when a standalone XGA BIOS card is present like the INMOS one. (QT only)
Same concept as above, but applies to the Mach8 and 32 for the 8514 option as well. (QT only)
2023-07-14 23:38:04 +02:00
TC1995
cf49686957 Accelerator fixes part 2: 8514/A.
Mix patterns are drawn at the correct position now instead of backwards.
Better handling of subsys/subcntl side.
As usual, better handling of the VGA on/off passthrough.
Better handling of the accelerator pitch (TODO: need a way to properly identify 640x480x256 in the pitch side).
2023-05-05 19:55:27 +02:00
Jasmine Iwanek
a40630ba63 Even more tabs to spaces 2023-01-07 14:09:51 -05:00
Jasmine Iwanek
a04710b517 clang-format in src/win and other misc places 2022-07-27 17:27:51 -04:00
TC1995
333e99113b IBM ESDI MCA, 8514/A, XGA and Rancho changes:
ESDI MCA: Increased esdi_time from 200 to 512, should fix the timeout that caused the bad attention 03 fatal.
Rancho: Added the Rancho RT1000B-MC MCA SCSI controller, it uses the 8.20R BIOS.
8514/A: Reworked the Outline command to satisfy the manual and the win2.10 (286/386) driver.
XGA: Initial rom len is set to 0x8000 (which, after being configured, is set back to 0x2000) just to not make it hang with POST code 40 25 on most configurations.
2022-07-09 23:19:18 +02:00
TC1995
10f867dce1 Fix compile. 2022-06-27 00:08:10 +02:00
TC1995
5fb1ce2bec 8514/A changes:
Reduced the number of variables that depend on the main SVGA handler.
Re-implemented accel command 5 (Polygon Boundary Line) right.
Implemented Polygon fill type A and B (latter not tested yet) on accel command 2 per manual.
Fixed crashes when starting Win2.1x using the built-in 8514/A driver.
Some wip cleanups.
2022-05-19 00:15:03 +02:00
TC1995
d0335e9679 Initial emulation of the IBM 8514/A coprocessor for both the MCA and ISA buses.
Currently the GUI option is on the QT frontend.
2022-05-14 18:55:00 +02:00