Issues with EGA emulation

Discussion of development and patch submission.
teppic
Posts: 20
Joined: Tue 20 Jun, 2017 12:31 pm

Issues with EGA emulation

Postby teppic » Thu 22 Jun, 2017 9:01 pm

When I run pcem 12 on my desktop (Haswell i7) I can use EGA. It takes a long time to start up but then presents colour tests and boots.

But on my laptop (Kaby Lake i7) it freezes, and just shows an empty grey window and uses 100% CPU until killed. The config is identical in both cases and the rom files are identical. This is on Windows 10 64bit. There doesn't seem to be an issue with any other graphics emulation.

The other difference is that on my laptop it is HiDPI (3200x1800) so it could be to do with the scaling -- though disabling scaling doesn't help.
User avatar
omarsis81
Posts: 383
Joined: Thu 17 Dec, 2015 6:20 pm

Re: Issues with EGA emulation

Postby omarsis81 » Thu 22 Jun, 2017 10:42 pm

Are you using Intel's graphics on both? I suspect either is a dedicated GPU
If that the case: try changing the output: Direct3D or Direct Draw.
teppic
Posts: 20
Joined: Tue 20 Jun, 2017 12:31 pm

Re: Issues with EGA emulation

Postby teppic » Thu 22 Jun, 2017 10:47 pm

On the desktop (where it works) I have nvidia graphics. On the laptop where it freezes it is Intel integrated. I'll try switching them.

The thing is others work without issue - CGA, VGA are fine.
teppic
Posts: 20
Joined: Tue 20 Jun, 2017 12:31 pm

Re: Issues with EGA emulation

Postby teppic » Thu 22 Jun, 2017 11:03 pm

Ok, with Direct3D selected it will now boot on the IBM XT model, but on the IBM AT is still freezes forever. On other machines pcem just crashes.
ecksemmess
Posts: 101
Joined: Wed 18 Mar, 2015 5:27 am

Re: Issues with EGA emulation

Postby ecksemmess » Mon 26 Jun, 2017 7:15 am

This is actually a very old bug--I reported it years ago, before this forum even existed. PCem's EGA support has always been semi-functional and lag/crash prone for me, whether using DirectDraw or Direct3D. As you point out, this is entirely exclusive to EGA and has never affected CGA, VGA, or any other emulated video card. I haven't had time to really dig into it, but something is clearly badly broken, and it must be something quite simple, like an improper pointer somewhere. Whatever it is must be somewhere in vid_ega.c or vid_ega.h, and shouldn't be too hard to track down.
Battler
Posts: 754
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Issues with EGA emulation

Postby Battler » Tue 27 Jun, 2017 9:55 pm

It's not the emulation that's broken per se but the IBM EGA BIOS that does weird things to probe the card. I have tried implementing the Chips & Technology SuperEGA (with its own BIOS) on top of the same EGA emulation code, and it doesn't have the same problem.
ecksemmess
Posts: 101
Joined: Wed 18 Mar, 2015 5:27 am

Re: Issues with EGA emulation

Postby ecksemmess » Wed 28 Jun, 2017 2:33 am

That's interesting, but still suggests something like an improper pointer or improperly defined/allocated memory or I/O somewhere in vid_ega.c or vid_ega.h, I would think. The weird probing that the IBM EGA BIOS does is likely hitting some rarely used port or memory edge case or something that the SuperEGA BIOS doesn't, thus making the IBM BIOS a more effective torture test of the underlying EGA emulation.
Battler
Posts: 754
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Issues with EGA emulation

Postby Battler » Wed 28 Jun, 2017 8:16 pm

- ecksemmess: That's most probably the case, yes. IBM's BIOS'es liked probing undocumented or rarely used parts of the hardware.
teppic
Posts: 20
Joined: Tue 20 Jun, 2017 12:31 pm

Re: Issues with EGA emulation

Postby teppic » Thu 29 Jun, 2017 12:49 am

Yeah I had more problems on both PCs so realised it wasn't just the OS/host system.

Hopefully the issues can be sorted out, but I guess it's low priority since VGA replaced it.
SarahWalker
Site Admin
Posts: 1143
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Issues with EGA emulation

Postby SarahWalker » Mon 17 Jul, 2017 8:15 pm

I think rev 801 should fix this.
basic2004
Posts: 82
Joined: Sun 08 Jan, 2017 5:59 pm

Re: Issues with EGA emulation

Postby basic2004 » Tue 18 Jul, 2017 12:09 am

I modified EGA monochrome palettes like this URL, palettes bring from HGC/MDA/CGA monochrome monitor type.
https://pcem-emulator.co.uk/phpBB3/viewtopic.php?f=3&t=723#p5478

before
egamono-before.png
egamono-before.png (27.79 KiB) Viewed 155 times

after
egamono-after.png
egamono-after.png (28.1 KiB) Viewed 155 times


Here is a patch.
vid_ega.c.patch
(3.67 KiB) Downloaded 3 times
SarahWalker
Site Admin
Posts: 1143
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Issues with EGA emulation

Postby SarahWalker » Tue 18 Jul, 2017 9:08 pm

Committed at rev 807.

Return to “Development”

Who is online

Users browsing this forum: No registered users and 1 guest