VOGONS


Reply 20 of 72, by mkarcher

User metadata
Rank l33t
Rank
l33t
superfury wrote on 2021-06-27, 23:03:

Edit: OK. So I'll replace A16 with A14 for the Odd/Even A16 case on EGA. Still A16 on VGA and up.

No, that change is too quick. A14 is only to be used on EGA with 64KB RAM, at least in its 640x350 4-color mode.

On EGA with 128KB, 192KB or 256KB RAM, A16 has to be used. These configurations have a 640x350 16-color mode instead.

Reply 21 of 72, by mkarcher

User metadata
Rank l33t
Rank
l33t
superfury wrote on 2021-06-27, 23:03:

port 3CC writes to miscellaneous output register instead of graphics 1 position (it still does on other (S)VGA graphics cards though).

That sounds wrong. Misc Out should only be writeable at 3C2, and only be readable at 3CC. Are you positively aware of SVGA cards that accept writes to 3CC as misc out writes?

Reply 22 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++
mkarcher wrote on 2021-06-27, 23:10:
superfury wrote on 2021-06-27, 23:03:

port 3CC writes to miscellaneous output register instead of graphics 1 position (it still does on other (S)VGA graphics cards though).

That sounds wrong. Misc Out should only be writeable at 3C2, and only be readable at 3CC. Are you positively aware of SVGA cards that accept writes to 3CC as misc out writes?

It might have been a leftover of older code based on rough documentation I don't use anymore.

Once that was fixed (together with the Feature Control register colliding with the other register, the EGA seems to display text at least.

I've modified the dipswitches to report 1110b(0xE), which when read on the status register become 0x1 (inverted read) for 80x25 color mode.

But it still sets the video card up for 40x25 mode it seems? Also CheckIt diagnostics only repots 64K VRAM installed (it's emulating the full 256K though)?

EGA Fantasy Land (taken from pcjs) seems to run a bit. The initial display seems fine (the intro), but once the scrolling part with the map starts it's pretty much a black display being displayed?

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

Reply 23 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just tried the latest UniPCemu commit with SuperSoft ROM POST diagnostics version 1.2 on the XT.
It checks out the EGA memory as 'PASSED'. Once it returns from the memory test, the display also seems to fix itself to the correct view?

The dump of the EGA timings UniPCemu supports shows that it's rendering a 640x200 pixel text mode.

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

Reply 24 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've just been thinking.... If you mask off all upper EGA bits in it's registers the EGA documents as undefined(what UniPCemu does on EGA), but still interpret the registers as a VGA does (UniPCemu does that as well), is the result(except a slight modification on the horizontal total being +2 instead of +5) correct display output?

Because for some reason horizontal timings seem sort of OK, but vertical timings are screwed up? As in, the last few rows of active display end up above the top, so there's definitely some retrace there? It also does seem to use 40-column timing instead of proper 80-column timing?

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

Reply 25 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++

OK. I've been looking through the EGA documentation and compared all registers against the FreeVGA documented ones.
These are all the bits that are different from the VGA ones (ignoring the bits that are masked to 0 to provide EGA register write compatibility on VGA registers):
CRTC register 03h bit 7 is not used for EVRA according to EGA documentation? Just made all reads resolve to the light pen registers instead on EGA (EVRA is still used on VGA and up).
CRTC register 05h bit 7: Start Odd Memory Address instead of End Horizontal Blanking bit 5? Removed said bit from the VGA core's processing and reduced End Horizontal Blaning to a 5-bit match for the EGA.
CRTC register 07h bit 5: Cursor Location Register bit 8 (index hex 0Ah) instead of Vertical Total Bit 9? Removed said bit from the VGA core's processing. Any idea what this bit does?
Graphics register 04h has bit 2 as well as 1&0 for the map select register? So it's selecting from 8 maps instead of just 4??? Any idea what this extra bit does?
CRTC all read and interpreted. Above not implemented yet.

Implemented register changes to the VGA handling:
- Attribute register 12h bits 4-5: Video Status Mux of Input Status Register 1.
- Misc Output register bit 4: Disable internal video drivers.
- Input Status #0 register bit 7: CRTC interrupt. 0 when vertical retrace is occurring?
- Input Status #1 register. Bit 0: 0=Horizontal or vertical retrace interval is happening (the same for bit 3 for a vertical retrace). Light pen strobe/switch on bit 1/2.
- EVRA isn't used for indexes 10h/11h. They always return the light pen registers on EGA!

Those Input Status #0/#1 register bits are inverted to what the VGA does according to the EGA documentation (comparing against the FreeVGA documentation)?

Any ideas about those bits mentioned in the first paragraph in this post?

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

Reply 27 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++
dr.zeissler wrote on 2021-06-29, 13:36:

Google for "PJ-1987-01-Inside_The_EGA.PDF " perhaps this can help you.

It didn't seem to mention anything I didn't already implement?
Edit: Just fixed an issue with the EGA 64 color palette (incorrect 1/3 and 2/3 shades of R/G/B).
Edit: Although the DAC seems fine (looking at the colors after a dump), the 16-color palette in the attribute controller doesn't seem correct? It's programmed with 0-7, followed by 10h-17h? Isn't that supposed to be at the end of the 64-color range (37h-3Fh)?

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

Reply 28 of 72, by mkarcher

User metadata
Rank l33t
Rank
l33t
superfury wrote on 2021-06-29, 16:14:

It didn't seem to mention anything I didn't already implement?
Edit: Just fixed an issue with the EGA 64 color palette (incorrect 1/3 and 2/3 shades of R/G/B).
Edit: Although the DAC seems fine (looking at the colors after a dump), the 16-color palette in the attribute controller doesn't seem correct? It's programmed with 0-7, followed by 10h-17h? Isn't that supposed to be at the end of the 64-color range (37h-3Fh)?

That might be caused by your DIP switch settings. You mentioned that you used DIP configuration 01 (or 0Eh inverted). This is "Primary card MDA, secondary card EGA with color monitor at 80x25". If there is no MDA installed, this configuration automatically falls back to "EGA with color monitor". The important point at this moment is "color monitor". This refers to the IBM 5153 CGA monitor, not the IBM 5154 EGA monitor. That monitor would be called "enhanced monitor", and you should use DIP configuraion 03 (or 0Ch inverted) to drive it in 350-line high-resolution text mode.

The IBM 5153 is a 16-color monitor, and the EGA color bits are mapped to the monitor pins in a way that 0-7 followed by 10h-17h outputs the 16 bit patterns the 5153 monitor recognizes (AKA: The I pin of the IBM5153 is mapped to the secondary green signal of the EGA card). In "mode 1" (200 scanlines), the EGA monitor behaves CGA-like, and falls back to a 16-color mode. It behaves virtually identical to the IBM 5153. Only in "mode 2" (350 scanlines), the power of 64 colors is unleashed. To get the monitor into "mode 2", you need to set a high-resolution graphics mode (0Fh/10h) or text mode with 350 scanlines.

In mode 1, the color values you observe are exactly what is expected. The magic brown correction (brown is #AA5500, although the RGBI pattern looks like #AAAA00) is performed by the monitor. In mode 2, the color values are 0-5, 20, 7, 37h-3Fh. The magic brown correction is done by outputting the correct RGBrbg pattern for #AA5500 (primary red, secondary green, no blue).

Reply 29 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++
mkarcher wrote on 2021-06-29, 18:46:
That might be caused by your DIP switch settings. You mentioned that you used DIP configuration 01 (or 0Eh inverted). This is "P […]
Show full quote
superfury wrote on 2021-06-29, 16:14:

It didn't seem to mention anything I didn't already implement?
Edit: Just fixed an issue with the EGA 64 color palette (incorrect 1/3 and 2/3 shades of R/G/B).
Edit: Although the DAC seems fine (looking at the colors after a dump), the 16-color palette in the attribute controller doesn't seem correct? It's programmed with 0-7, followed by 10h-17h? Isn't that supposed to be at the end of the 64-color range (37h-3Fh)?

That might be caused by your DIP switch settings. You mentioned that you used DIP configuration 01 (or 0Eh inverted). This is "Primary card MDA, secondary card EGA with color monitor at 80x25". If there is no MDA installed, this configuration automatically falls back to "EGA with color monitor". The important point at this moment is "color monitor". This refers to the IBM 5153 CGA monitor, not the IBM 5154 EGA monitor. That monitor would be called "enhanced monitor", and you should use DIP configuraion 03 (or 0Ch inverted) to drive it in 350-line high-resolution text mode.

The IBM 5153 is a 16-color monitor, and the EGA color bits are mapped to the monitor pins in a way that 0-7 followed by 10h-17h outputs the 16 bit patterns the 5153 monitor recognizes (AKA: The I pin of the IBM5153 is mapped to the secondary green signal of the EGA card). In "mode 1" (200 scanlines), the EGA monitor behaves CGA-like, and falls back to a 16-color mode. It behaves virtually identical to the IBM 5153. Only in "mode 2" (350 scanlines), the power of 64 colors is unleashed. To get the monitor into "mode 2", you need to set a high-resolution graphics mode (0Fh/10h) or text mode with 350 scanlines.

In mode 1, the color values you observe are exactly what is expected. The magic brown correction (brown is #AA5500, although the RGBI pattern looks like #AAAA00) is performed by the monitor. In mode 2, the color values are 0-5, 20, 7, 37h-3Fh. The magic brown correction is done by outputting the correct RGBrbg pattern for #AA5500 (primary red, secondary green, no blue).

The dip switch settings are currently set to 0xE(so, on on on off according to the EGA card documentation). Said bits are inverted (software reading 0x1 from the port) when reading the input status 0 register. CheckIt! Diagnostics reports 1110 as it's value (as is setup).
Edit: Changing it from 0xE to 0x3 seems to fix colors.
Although only still half a screen is displayed instead of proper 80x25 text mode? Although the virtual line width seems correct, at least? Text mode active display seems only 40 characters wide, with 80 characters virtual?

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

Reply 30 of 72, by mkarcher

User metadata
Rank l33t
Rank
l33t
superfury wrote on 2021-06-29, 18:52:

The dip switch settings are currently set to 0xE(so, on on on off according to the EGA card documentation). Said bits are inverted (software reading 0x1 from the port) when reading the input status 0 register. CheckIt! Diagnostics reports 1110 as it's value (as is setup).
Edit: Changing it from 0xE to 0x3 seems to fix colors.
Although only still half a screen is displayed instead of proper 80x25 text mode? Although the virtual line width seems correct, at least? Text mode active display seems only 40 characters wide, with 80 characters virtual?

Seems I wasn't clear enough. I suggested to change from 0xE (inverse of 01) to 0xC (inverse of 3). You are now running an unsupported configuration. Only DIP switch settings 04h to 0Fh (which is 00h to 0Bh after inversion) are officially supported, and the remaining 4 settings may cause strange behaviour. I can't yet help you with the screen width, though. EGA is just like VGA in that regard, and "horizontal displayed" should be 79 (IIRC it's -1) in mode 3 (as set by "mode co80"), but 39 in mode 1 (as set by "mode co40").

Reply 31 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++

With 0xC, do you mean on on off off or do you mean off off on on?
The value's I'm setting is as the dipswitches are set (every bit set being the dipswitch set to on).

If I set it to 0xC(on on off off), I get wrong colors. If I set it to 3 (off off on on), I get half a screen with correct colors, with the right half of the screen (the latter 40 characters being blanked somehow) while the BIOS is booting?
After MS-DOS boots (the XT-IDE BIOS sets up a 80x25 text mode, mode 03h), I get 40x25 display somehow?

IBM Advanced Diagnostics 2.25's 40x25 and 80x25 text mode do actually setup the mode correctly though?
So does the Secret of Monkey Island. It's fire at the top of the mountain in the intro sequence is yellow somehow?

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

Reply 32 of 72, by mkarcher

User metadata
Rank l33t
Rank
l33t
superfury wrote on 2021-06-29, 19:24:
With 0xC, do you mean on on off off or do you mean off off on on? The value's I'm setting is as the dipswitches are set (every b […]
Show full quote

With 0xC, do you mean on on off off or do you mean off off on on?
The value's I'm setting is as the dipswitches are set (every bit set being the dipswitch set to on).

If I set it to 0xC(on on off off), I get wrong colors. If I set it to 3 (off off on on), I get half a screen with correct colors, with the right half of the screen (the latter 40 characters being blanked somehow) while the BIOS is booting?
After MS-DOS boots (the XT-IDE BIOS sets up a 80x25 text mode, mode 03h), I get 40x25 display somehow?

IBM Advanced Diagnostics 2.25's 40x25 and 80x25 text mode do actually setup the mode correctly though?
So does the Secret of Monkey Island. It's fire at the top of the mountain in the intro sequence is yellow somehow?

I meant: SW4 = on, SW3 = on, SW2 = off, SW1 = off. That's the last configuration in PDF Page 29 (document page number 21) of the EGA installation manual. This is the minimal change compared to your setting SW1=off, all others=on. On the other hand, that document suggests (see Table 1) to use off, on, on, off instead of you only have the EGA card installed. I will have access to my detailed EGA/VGA book soon, that should be able to provide more detailed information.

Reply 33 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++
mkarcher wrote on 2021-06-29, 20:18:
superfury wrote on 2021-06-29, 19:24:
With 0xC, do you mean on on off off or do you mean off off on on? The value's I'm setting is as the dipswitches are set (every b […]
Show full quote

With 0xC, do you mean on on off off or do you mean off off on on?
The value's I'm setting is as the dipswitches are set (every bit set being the dipswitch set to on).

If I set it to 0xC(on on off off), I get wrong colors. If I set it to 3 (off off on on), I get half a screen with correct colors, with the right half of the screen (the latter 40 characters being blanked somehow) while the BIOS is booting?
After MS-DOS boots (the XT-IDE BIOS sets up a 80x25 text mode, mode 03h), I get 40x25 display somehow?

IBM Advanced Diagnostics 2.25's 40x25 and 80x25 text mode do actually setup the mode correctly though?
So does the Secret of Monkey Island. It's fire at the top of the mountain in the intro sequence is yellow somehow?

I meant: SW4 = on, SW3 = on, SW2 = off, SW1 = off. That's the last configuration in PDF Page 29 (document page number 21) of the EGA installation manual. This is the minimal change compared to your setting SW1=off, all others=on. On the other hand, that document suggests (see Table 1) to use off, on, on, off instead of you only have the EGA card installed. I will have access to my detailed EGA/VGA book soon, that should be able to provide more detailed information.

Just checked again with the EGA documentation on the reporting of the switches. It's indeed that UniPCemu records them in 1=On(closed), 0=Off(open) notation (the bits are all inversed when read by the CPU). Bit 0 = Switch 1, bit 1 = Switch 2, bit 2=Switch 3, bit 3=Switch 4. The binary 4-bit value is what can be seen by running CheckIt! Diagnostics's configuration page.
So in UniPCemu, switches set to 0xC should be "Enhanced Color (in Enhanced Color Mode) ".

I've set the switches to to 0xC. Looking at address 488 in memory, the SW configuration in the EGA seems to be detected as (https://stanislavs.org/helppc/bios_data_area.html) SW1=on SW2=on SW3=off SW4=off?
Edit: Changing the pattern to 0x3, it reports 0x3 at said location, which would be SW1=off, SW2=off, SW3=on, SW4=on
Edit: It's still in mode 01h again with the latter, but half the screen is blanked during Generic Super PC/Turbo XT BIOS POST?
The timings dump as follows:
00:00:32:77.04262: HDispStart:8
00:00:32:77.04362: HDispEnd:168
00:00:32:77.04462: HBlankStart:352
00:00:32:77.04558: HBlankStartFinish:360
00:00:32:77.04656: HBlankEnd:~13
00:00:32:77.04756: HRetraceStart:328
00:00:32:77.04854: HRetraceStartFinish:336
00:00:32:77.04950: HRetraceEnd:~13
00:00:32:77.05050: HTotal:376
00:00:32:77.05146: VDispEnd:350
00:00:32:77.05246: VBlankStart:350
00:00:32:77.05342: VBlankEnd:~10
00:00:32:77.05440: VRetraceStart:350
00:00:32:77.05540: VRetraceEnd:~11
00:00:32:77.05636: VTotal:365

Edit: The switches makes sense now:
0x3 in UniPCemu's switches is correct: switch 1/2 closed, 3/4 open? The set bits in UniPCemu's switches setting are the closed switches(all bits that are set are closed, bit0=switch1 - bit3=switch4).
The display is 20 chars wide though?

Filename
EGA incorrect timing_20210630_0912.zip
File size
33.98 KiB
Downloads
32 downloads
File comment
Incorrect timing full
File license
Fair use/fair dealing exception

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

Reply 34 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++

With the 0x6 set, CheckIt is reporting EGA Switches 0110. Is that correct?
Colors seem fine, but it's still 20 chars wide (and perhaps not 25 rows high)? Also, the rows seem incorrect somehow? Like the last 40 characters are overwriting the first 40 ever other row?

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

Reply 35 of 72, by mkarcher

User metadata
Rank l33t
Rank
l33t
superfury wrote on 2021-06-30, 06:44:

Edit: It's still in mode 01h again with the latter, but half the screen is blanked during Generic Super PC/Turbo XT BIOS POST?

So you are using an XT BIOS. Are you aware that the XT BIOS installs a CGA BIOS and initializes your card like a CGA card if it reads the mainboard DIP switches number 5 and 4 as 0/1 (in mode 01h, 40 columns) or 1/0 (in mode 03h, 80 columns). If you want to use an EGA card, you need the switches to read 0/0 instead. The EGA BIOS then takes care of initializing a concurrently installed MDA or CGA according to the EGA switches.

Reply 36 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++
mkarcher wrote on 2021-06-30, 08:18:
superfury wrote on 2021-06-30, 06:44:

Edit: It's still in mode 01h again with the latter, but half the screen is blanked during Generic Super PC/Turbo XT BIOS POST?

So you are using an XT BIOS. Are you aware that the XT BIOS installs a CGA BIOS and initializes your card like a CGA card if it reads the mainboard DIP switches number 5 and 4 as 0/1 (in mode 01h, 40 columns) or 1/0 (in mode 03h, 80 columns). If you want to use an EGA card, you need the switches to read 0/0 instead. The EGA BIOS then takes care of initializing a concurrently installed MDA or CGA according to the EGA switches.

These are the reported switches:

byte readPPI62()
{
byte result=0;
//Setup PPI62 as defined by System Control Port B!
if (SystemControlPortB&8) //Read high switches?
{
//Bit0=Display 0
//Bit1=Display 1
//Bit2=Floppy drives in system(-1) low
//Bit3=Floppy drives in system(-1) high
if (((getActiveVGA()->registers->specialCGAflags&0x81)==1)) //Pure CGA mode?
{
result |= 2; //First bit set: 80x25 CGA!
}
else if (((getActiveVGA()->registers->specialMDAflags&0x81)==1)) //Pure MDA mode?
{
result |= 3; //Both bits set: 80x25 MDA!
}
else //VGA?
{
//Leave PPI62 at zero for VGA: we're in need of auto detection!
}
result |= 4; //Two floppy drives installed!
}
else //Read low switches?
{
//Bit0=Loop on POST
//Bit1=Co-processor installed
//Bit2=Planar RAM size 0
//Bit3=Planar RAM size 1
result |= 0xD; //Don't loop on POST, no coprocessor, maximum RAM!
}
result |= (PPI62&0xC0); //Ram&IO channel check results!
return result; //Give the switches requested, if any!
}

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

Reply 37 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++

Trying it on the i430fx architecture seems to POST without visible issues? Although the AMI logo at the right seems to be missing?

CheckIt also displays without issues on that one? Still only reporting 64K of VRAM, though?

CheckIt's VRAM test reports 16 errors, each at even addresses, starting from address 0000h? The bits that it reports seem random?

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

Reply 38 of 72, by mkarcher

User metadata
Rank l33t
Rank
l33t

Your switch emulation seems right. Make sure you actually emulate the XT PPI keyboard interface and not the AT keyboard controller when you try to use the XT BIOS. If the EGA emulation works better with the i430fx architecture than with the XT architecture, I suppose something in the XT architecture emulation is broken and disturbs EGA operation. I have my reference book at hand now, and I verified that for mode 3 the default video parameter table for CGA has 0x50 (80) for the horizontal displayed register, whereas the default parameter table for EGA and VGA has 0x4F (79) for the horizontal displayed register. So a confusion between CGA and EGA can not cause your "horizontal displayed is half" problem.

Can you point me to the EGA ROM image you are using on http://minuszerodegrees.net/rom/rom.htm ?

Your checkit problem might be a well-known issue for 64K EGA: http://minuszerodegrees.net/checkit_video_tes … _vt_problem.htm

Reply 39 of 72, by superfury

User metadata
Rank l33t++
Rank
l33t++
mkarcher wrote on 2021-06-30, 16:01:

Your switch emulation seems right. Make sure you actually emulate the XT PPI keyboard interface and not the AT keyboard controller when you try to use the XT BIOS. If the EGA emulation works better with the i430fx architecture than with the XT architecture, I suppose something in the XT architecture emulation is broken and disturbs EGA operation. I have my reference book at hand now, and I verified that for mode 3 the default video parameter table for CGA has 0x50 (80) for the horizontal displayed register, whereas the default parameter table for EGA and VGA has 0x4F (79) for the horizontal displayed register. So a confusion between CGA and EGA can not cause your "horizontal displayed is half" problem.

Can you point me to the EGA ROM image you are using on http://minuszerodegrees.net/rom/rom.htm ?

Your checkit problem might be a well-known issue for 64K EGA: http://minuszerodegrees.net/checkit_video_tes … _vt_problem.htm

Under IBM, the first time(which is a hyperlink) says EGA, below CGA/MDA, with sum 14FC000, with note 1.

Also, 256KB VRAM is installed (just like with the VGA).

Looking at the BIOS assembly code at the end of the documentation, I have found the location I should probably start looking at: C000:04AC.

Edit: It's never reached?
Edit: C000:0244 is reached, so it's starting to POST at least. Somewhere between the two it's going wrong?
Edit: BRST_COLOR_V is reached.
Edit: 038A is reached (POD14_2).

Edit: Oh! It reaches C000:03D5! So that means that it's counted the amount of enables in the specified time interval and found it didn't match?
EBX is C0000 at that point. [BP+02] contains 15E.
Edit: This is the VGA timing used when that point is reached:
00:31:42:84.09280: HDispStart:8
00:31:42:84.09280: HDispEnd:168
00:31:42:84.09408: HBlankStart:352
00:31:42:84.09408: HBlankStartFinish:360
00:31:42:84.09664: HBlankEnd:~13
00:31:42:84.09664: HRetraceStart:352
00:31:42:84.09920: HRetraceStartFinish:360
00:31:42:84.09920: HRetraceEnd:~13
00:31:42:85.00048: HTotal:376
00:31:42:85.00048: VDispEnd:350
00:31:42:85.00304: VBlankStart:350
00:31:42:85.00304: VBlankEnd:~10
00:31:42:85.00432: VRetraceStart:350
00:31:42:85.00432: VRetraceEnd:~11
00:31:42:85.00688: VTotal:365
All those timings are in pixel clocks(16 or 14MHz clocks). And vertical timingas are multiples of the horizontal timings.
Edit: Just found one of vladstamate's older threads (where I seemed to ran into the same kind of issues): IBM EGA and text mode woes

It looks like it's somehow still stuck on the horizontal amount of retraces somehow? BX=0, so it somehow didn't count ANY valid horizontal retraces AT ALL!

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