Commit Graph

56 Commits

Author SHA1 Message Date
OBattler
27248397d2 ATi Mach 8: Fix a warning. 2024-06-03 04:01:00 +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
c931e4d460 Further fixes to the code related to the Mach8/32 mode changes.
And 0x6e9 is an alias to 0x2e8 per the Mach32 manual (H_TOTAL).
2024-04-26 19:28:03 +02:00
TC1995
50ca61dfd4 ATI/IBM mode changes in the Mach8/32.
Reworked the way the mode changes work in said chips (and way less hacky than before).
2024-04-20 23:43:27 +02:00
TC1995
929fa7328d Mach8/32 horizontal display changes.
Make sure for the 9001st time to display correctly the horizontal side of the display (looking at you, ATI 1992 set for win3.1x and Mach8/32 drivers for OS/2 1.2x).
2024-03-01 19:50:23 +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
OBattler
4c3cceec69 Fixed off by one errors in (S)VGA horizontal blanking start calculation. 2024-02-18 17:54:14 +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
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
OBattler
19af46a8c2 Some more mouse helper functions and fixed the video warnings. 2024-01-17 03:59:56 +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
OBattler
b1c292a9e9 Sanitized the horizontal blanking adjustments a bit and fixed 640x480x8bpp on some S3 cards. 2024-01-13 22:04:20 +01:00
OBattler
996530a94e Horizontal blanking calculation now takes into account horizontal timings multiplications and divisions, fixes a lot of S3 (and ViRGE) modes. 2024-01-13 03:54:56 +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
3010ce4f8a Minor ATi fixes. 2024-01-11 02:07:21 +01:00
OBattler
d00dafcf16 Apply it to ATi 28800 and Mach 8 as well. 2024-01-10 23:30:48 +01:00
OBattler
a1ef3c47fc 8514/a and ATi Mach 8: Fix the recently introduced warnings. 2024-01-06 00:05:43 +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
d9dfa8d8d5 More ATI accel fixes and undocumented stuff.
1. Apparently some stuff uses read-only port 0x86ee and expects it to return 0 while port 0xf6ee is an alias to 0x82e8, this should fix hangs in Majong 8514 using ATI's DOS drivers.
2. 8514 data available bits are reset properly when new parameters for a new command are installed (port 0xCEEE), fixes remaining hangs with some stuff.
2023-12-28 02:01:45 +01:00
TC1995
1798b2e51c ATI VGA mode fixes:
1. Fixed 4-bit packed modes.
2. Preparation of fixing the 2-bit modes.
3. Extra: fixed the accelerator mode switches again (Mach8/32 only).
2023-12-27 16:07:03 +01:00
TC1995
524fd30c0c ATI Mach8/32 fixes regarding 1992 ATI Ultra drivers for Windows 3.1x:
1. For some reason, background colors were always black under those drivers in 8bpp mode, added a tweak to fix it (as well as Clock colors).
2. Likewise for the red scrolling in pbrush or write, added a tweak to its bitblt read mask.
3. Don't call svga_recalctimings in the hdisp/vdisp ports directly, fixes screen size on said drivers without affecting other stuff.
2023-12-22 19:43:51 +01:00
TC1995
3c654af286 dang it... 2023-12-14 21:57:48 +01:00
TC1995
ea9348d104 Actually initialize the cursor color regs of the ATI Mach32 card. 2023-12-14 21:56:17 +01:00
TC1995
15c6d9e5fa Mach8/32 fixes (again):
1. Fixed wrong setting of highres and lowres mode of 8bpp, makes Transport Tycoon run properly on these ATI cards again.
2. 32-bit (RGBA) True Color is actually supported on the Mach32, but barely used, and the original code was wrong. This fix makes 32-bit True Color render the right colors.
2023-12-14 21:47:10 +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
TC1995
0440d37387 Small mach32/svga mapping fix (actually fixes font rendering on win3.1x using the Mach32 2.6 drivers) 2023-10-19 01:32:52 +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
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
TC1995
cf7b49a52f Pitch fix for Mach8/32.
Fix minor bug in the pitch when it was not being issued correctly in the Mach8/32.
2023-08-15 22:47:29 +02:00
OBattler
6906db6d3b Mach8 and XGA logging clean-ups. 2023-08-15 22:30:55 +02:00
TC1995
3856f9700c Switched back to the "Graphics Ultra Pro" ISA-based BIOS as we found
the true culprit behind the "brokeness" which is that bit 4 of reg 0xBD of the ATI regs must be set in the reads.
2023-08-15 22:12:30 +02:00
Jasmine Iwanek
bd6508350b Yet more tabs to spaces 2023-08-15 13:28:04 -04:00
Jasmine Iwanek
375f69ed61 Fix more compile warnings 2023-08-15 13:28:04 -04:00
TC1995
684276f48b Compile fix (4).
Please...
2023-08-15 01:58:11 +02:00
TC1995
2df1f38c6e Compile fix (3).
And changed the ATI Mach32 ISA bios to a working one (phew).
2023-08-15 01:47:37 +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
81a770001b Shouldn't have separated the 8514/A BPP from the VGA one, dang. 2023-08-12 15:17:54 +02:00
TC1995
a7f23e63c0 More ATI Mach8/32 changes:
1. Separated the 8514/A compatible BPP from the (S)VGA BPP.
2. Corrected clocks, fixes severe dropdown issues in most renderers.
2023-08-12 14:56:34 +02: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
81bb5e564b Better fallthrough annotation macro. 2023-08-09 20:09:36 -04:00
OBattler
c30d5d90b7 PCI and IRQ rework, pci.c rewritten from ground up, fixes numerous issues such as the bridge being added when the number of normal PCI devices equals the number of normal PCI slots, Windows 95 PCI operation on Intel 430NX, sharing of PCI IRQ's with non-PCI level-triggered devices, having both configuration mechanisms operating at the same time (ALi M1435), etc., and makes the code much more readable. 2023-08-07 03:04:52 +02:00
Jasmine Iwanek
a96e14abda sonarlint vid_ati_mach8.c 2023-07-31 14:35:57 -04:00
OBattler
b810d3edc1 Some small 8514/a / Mach8 fixes. 2023-07-30 02:45:53 +02:00
Jasmine Iwanek
d2f42198fd Fix clang build failure 2023-07-26 12:41:18 -04:00
Jasmine Iwanek
db66543959 Apple build fix 2023-07-25 17:59:22 -04:00