Commit Graph

73 Commits

Author SHA1 Message Date
OBattler
2c197000ea Removed the legacy #defines in device.h. 2025-02-14 07:39:21 +01:00
Jasmine Iwanek
d5d1d5c449 More cleanups to device structs 2025-02-08 01:28:25 -05:00
Jasmine Iwanek
5b894c32e6 Macro Cleaning 2025-02-08 01:28:24 -05:00
OBattler
a540012f9a XGA: Move a variable initialization to IF blocks, fixes segementation fault when pat_src is 8 (eg. in Windows 95 on the MCA XGA). 2025-02-03 00:46:38 +01:00
Jasmine Iwanek
5f273265ae Assorted warning fixes 2025-02-02 03:24:50 -05:00
Jasmine Iwanek
81b8038bc5 Clean up .available & .poll 2025-02-01 03:38:52 -05:00
TC1995
e61f3c8a5d Video changes of the day (January 26th, 2025)
XGA:
1. Added a proper poll so to have its timings independent of the SVGA core and changes its renderer accordingly, mainly a blank render one.
2. Workaround the Ctrl-Alt-Del reset of Windows 2.x so that it switches back to VGA text mode correctly when using the 0xA000 64K aperture (in vid_svga.c).

SVGA core:
Re-organized the way the different timers are organized so that the XGA and 8514/A pollers can coexist with the SVGA timer without conflicts.

ATI Mach32:
Reworked the true color renderer and made it a Mach32 exclusive due to its differences from the standard one. Fixes wrong rendered colors in NT using the 32bpp renderer in RGB mode.
2025-01-26 14:25:35 +01:00
TC1995
f48c50f4ba The delayed video changes of the night (January 20th, 2025)
Generic SVGA layer:
Added function pointers of the banked mapping for use with add-on cards with their own mapping when the VGA card banked mapping is not active or viceversa (e.g.: XGA).

XGA-1/2:
1. Reimplemented Area Fill and Boundary Mode as best as possible.
2. Fixed conflicts with banked mapping with VGA clones.
3. Fixed inverted colors (again) on accelerated 16bpp mode under OS/2.

Video7 with ATI 8514/A add-on.
Added a workaround (BIOS issue? I don't know) that disables 8514/A mode and reenables VGA mode when needed. Fixes screen freezes and polling issues with various drivers for Windows and others.
2025-01-20 03:26:49 +01:00
OBattler
fbc21cdf49 DMA channel -> DMA. 2024-11-10 02:42:01 +01:00
OBattler
a1566e905f XGA address -> Address. 2024-11-10 02:36:34 +01:00
TC1995
52c806b485 Forgot the XGA update 2024-11-02 21:15:43 +01:00
TC1995
4f472445f2 Video and emulator GUI changes of the day (October 28th, 2024)
IBM 8514/A (MCA/ISA).
Added a configure button to the QT frontend for the amount of memory used by said add-on chips.

XGA:
Forgot a change about the 4mb aperture.
2024-10-28 22:14:58 +01:00
TC1995
9685cdfa92 XGA changes of the early day (October 28th, 2024)
1. Pattern/font fixes for Windows 3.1's third party XGA drivers as well as OS/2's win3.x' box (seamless and full).
2. The 4MB aperture is still used internally even if the 1MB one is in use, fixes OS/2's XGA driver on boot when less than 16MB of memory is used.
2024-10-28 02:23:43 +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
5135721359 XGA changes of the day (October 5th, 2024)
1. SVGA decode mask shouldn't be used in XGA native mode, fixes wrong locks in LFB access.
2. INMOS XGA only: more accurate emulation per INMOS G201 MCA/ISA manual, including the MMIO access and port 0x96, allowing full BIOS and MMIO access at the same time on 0xc0000.
2024-10-05 21:24:54 +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
5fd1d0be9f XGA aperture fixes of the day (September 24th, 2024)
Fixed 1MB aperture vram access.
2024-09-24 20:39:20 +02:00
TC1995
f4303dfce2 XGA changes of the day (September 5th, 2024)
Don't overwrite the VGA DAC mask in XGA mode, instead, using dedicated variables for it.
2024-09-05 01:06:34 +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
TC1995
a3d5f8e867 XGA 1-2: Pattern and cursor/sprite fixes.
1. Text is no longer glitchy under win95 using XGA.
2. Now there's a better way to handle the cursor/sprite X/Y offsets, should fix remaining Win3.x cursor blackness and other stuff using said cursor.
2024-05-15 21:18:40 +02:00
TC1995
4325c78fa8 Just shut up the warning.
See above.
2024-04-26 23:59:17 +02:00
TC1995
738446fea6 Cleanup of the XGA mapping to be less messed up.
As well as the cursor/sprite being finally fixed when the xoff goes from 0x20 onwards. This makes Win3.x' XGA cursor look normal and everything else as well. (as in, intact).
2024-04-26 22:52:58 +02:00
TC1995
26ea0c8225 XGA update/slight fixes:
1. Remove some useless parentheses and correct some identation.
2. The reversed linear mapping activation and a5 vram test are reset properly now.
3. More correct Area Fill emulation, especially in 640x480 mode, (800x600 and 1024x768 too).
2024-01-25 22:05:31 +01:00
OBattler
19af46a8c2 Some more mouse helper functions and fixed the video warnings. 2024-01-17 03:59:56 +01:00
TC1995
82311551d2 XGA changes:
Cleanup the area fill side.
2024-01-15 22:35:41 +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
OBattler
531bb61146 Fxied the last warnings. 2023-10-14 00:27:33 +02:00
OBattler
dc44e37f62 Fixed the warnings reported by lemondrops. 2023-10-13 23:03:37 +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
Jasmine Iwanek
197e817ea3 Remove several unused variables 2023-10-08 13:32:43 -04:00
TC1995
097fa229bd Fix compilation. 2023-09-30 22:21:09 +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
23a2923724 More XGA fixes:
These make XGAKIT report 1MB of VRAM (from DOS).
2023-08-24 00:30:21 +02:00
Jasmine Iwanek
506d548b38 More linting in src/video 2023-08-23 00:50:52 -04:00
Alexander Babikov
ef631a8133 8514/A and XGA handling refactor:
* separate (ibm8514|xga)_enabled into (ibm8514|xga)_standalone_enabled
  and (ibm8514|xga)_active, the former being enabled only for standalone
  8514/A or XGA cards, the latter for all 8514/A and XGA-capable cards
  and not saved into the config file;
* remove (ibm8514|xga)_has_vga and replace all uses of it with
  (ibm8514|xga)_standalone_enabled;
* Qt UI: the checkboxes for standalone 8514/A and XGA are now correctly
  grayed out if an (S)VGA card with 8514/A or XGA capability is selected,
  including cases when the card is an internal/onboard one; said cards are
  now no longer appear as SVGA multi-monitor compatible.
2023-08-22 23:48:32 +05:00
OBattler
debed8d196 Re-add XGA ROM reading. 2023-08-16 00:10:38 +02:00
OBattler
6906db6d3b Mach8 and XGA logging clean-ups. 2023-08-15 22:30:55 +02:00
Jasmine Iwanek
375f69ed61 Fix more compile warnings 2023-08-15 13:28:04 -04:00
Jasmine Iwanek
02e41927e3 Dribs and drabs which have escaped 2023-08-12 13:07:00 -04:00
cold-brewed
99cdd3a16a Various warning cleanups 2023-08-12 11:42:11 -04:00
OBattler
ce5e21f870 More warning and compile fixes. 2023-08-08 15:38:40 +02:00
Jasmine Iwanek
2d7c62c853 sonarlint vid_xga.c 2023-07-31 15:10:52 -04:00
TC1995
d2b0d0c3c2 XGA: 16bpp mode in accelerated mode no longer shows inverted colors in various parts of some stuff (e.g.: Win3.1x, OS/2). 2023-07-27 16:01:20 +02:00
Jasmine Iwanek
ee695e71f9 More sonarlint work 2023-07-25 17:59:22 -04:00
Jasmine Iwanek
54c52fb55c Fix several instances of uninitialized variables. 2023-07-21 13:46:08 -04:00
OBattler
7e9045e6b1 And a warning in the XGA code. 2023-07-16 03:50:00 +02: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
Jasmine Iwanek
d1127e68fa Even more sonarlint work 2023-06-04 23:39:14 -04:00
TC1995
a77271cfa6 Accelerator fixes part 1:
XGA: Fix crash when (S)VGA cards not selected as the primary display (e.g.: EGA, CGA. etc).
Better handling of the VGA on/off passthrough (vga_on variable).
MCA side: to avoid lfb issues, bit 0 of POS4 will be always enabled regardless of the ram size (most software uses the >16MB memory method).
Better handling of the BIOS ROM mapping and Memory Mapped I/O during the MCA PS/2 POST and resets, fixes 40 25 hang (once and for all).
Re-organized the ROM loading in ISA mode.
2023-05-05 19:08:49 +02:00