VOGONS


Reply 20 of 22, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just added a link to my post on the EGA/(S)VGA SLR behaviour, as well as some discoveries about it's latching and wrapping behaviour during the different graphics modes.

Ofc I don't think that the SLR bit would have any effect in text modes? Since there's nothing extra to rotate in text mode, I guess it would cause the same effect as 256-color mode shifting (the same pixels repeating over and over due to the same inputs being used)?

Edit: Just improved the Tseng chips to properly use the EGA emulation bit to perform the horizontal and vertical blank end properly (masking to 5 bits instead of 6 and 8 bits respectively).
Edit: Just improved the shift registers to operate in big-endian mode properly on little-endian machines, since plane 0=byte 0 of the value read from VRAM.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 21 of 22, by rasz_pl

User metadata
Rank l33t
Rank
l33t
superfury wrote on 2024-02-21, 00:55:

Input Status 0 register: bits 5-6 are binary numbers from the feature connector. Their inputs for either FC0 set (lower bits) and FC1 set (higher bits)

Input status 1 register: bit 1 indicates light pen trigger set. bit 2 indicates light pen switch is open (not pressed?). Bits 4-5 report video status MUX (see color plane enable register) on EGA, required to POST.

are you sure about that?
I just stumbled at this EGA-CGA detecting procedure and it sure looks like its expecting status 1 register Bits 4-5 to be FC0 FC1
https://github.com/raszpl/Zenith_ZBIOS/blob/m … 3.2C.lst#L15899

video_probe_CGA_or_EGA proc near
push ax
push cx
push dx
mov dx, IO_Port_3DAh_CRTC_Status
xor al, al
out dx, al ; Video: bits 0-1 control
; Feature Control outputs FC0 and FC1
in al, dx ; Video status bits:
; 0: retrace. 1=display is in vert or horiz retrace.
; 1: 1=light pen is triggered; 0=armed
; 2: 1=light pen switch is open; 0=closed
; 3: 1=vertical sync pulse is occurring.
mov cl, 3
shr al, cl
and al, 00000110b
mov ch, al
xor al, 00000010b
out dx, al ; Video: bits 0-1 control
; Feature Control outputs FC0 and FC1
push dx
pop dx
in al, dx ; Video status bits:
; 0: retrace. 1=display is in vert or horiz retrace.
; 1: 1=light pen is triggered; 0=armed
; 2: 1=light pen switch is open; 0=closed
; 3: 1=vertical sync pulse is occurring.
shr al, cl
and al, 00000110b
xor al, 00000010b
out dx, al ; Video: bits 0-1 control
; Feature Control outputs FC0 and FC1
xor al, ch
cmp al, ch
mov al, 0
jnz short end
or ch, 21h
mov al, cs:39h

end:
out dx, al ; Video: bits 0-1 control
; Feature Control outputs FC0 and FC1
mov cs:39h, al
mov cs:46h, ch
pop dx
pop cx
pop ax
retn
video_probe_CGA_or_EGA endp

EDIT: or are status 1 register Bits 4-5 reflecting FC0 FC1 only on CGA? then this function would make perfect sense, would only write to cs:39h cs:46h on CGA card.

https://github.com/raszpl/sigrok-disk FM/MFM/RLL decoder
https://github.com/raszpl/FIC-486-GAC-2-Cache-Module (AT&T Globalyst)
https://github.com/raszpl/386RC-16 ram board
https://github.com/raszpl/440BX Reference Design adapted to Kicad

Reply 22 of 22, by superfury

User metadata
Rank l33t++
Rank
l33t++

That's how the EGA BIOS seems to use it during it's POST, to determine it's flags to store in the BDA (switches and feature bits routine). Just read with FC0 set for the low 2 bits, then again with FC1 set for the high 2 bits.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io