[Patch] Amstrad PC5086

Post Reply
User avatar
davide78
Posts: 9
Joined: Sat 22 Aug, 2020 12:36 pm

[Patch] Amstrad PC5086

Post by davide78 »

This is a first implementation of Amstrad PC5086 and of its C&T 82C100 "Super XT" chipset.

The patch expects a system BIOS ROM at:
pc5086/sys_bin.rom

Missing features:
PS/2 Mouse
Internal C&T VGA
Internal XTA HD controller (XTIDE controller works! see screenshot)
Support for EMS memory. The Amstrad PC5086 came with 640Kb of RAM soldered on the motherboard.
However, the chipset can support up to 2.5Mb of RAM, using memory above 640Kb as EMS.

Known bugs and issues:
The BIOS detects COM and LPT ports as "external" (see screenshot). Internal COM port is moved to COM2 (and do not work). Internal LPT port is disabled. External ports works fine.
1.44 Mb HD floppy drives do not work. They can be selected by the BIOS, but not work in the emulator.

Tested on Mac OS X Catalina against last commit 9b737f6

Screenshot 2020-08-22 at 14.33.35.png
Screenshot 2020-08-22 at 14.33.35.png (87.15 KiB) Viewed 6402 times
Screenshot 2020-08-22 at 14.51.08.png
Screenshot 2020-08-22 at 14.51.08.png (71.24 KiB) Viewed 6402 times
Screenshot 2020-08-22 at 14.52.06.png
Screenshot 2020-08-22 at 14.52.06.png (88.46 KiB) Viewed 6402 times
Screenshot 2020-08-22 at 14.54.43.png
Screenshot 2020-08-22 at 14.54.43.png (112.07 KiB) Viewed 6402 times
Screenshot 2020-08-22 at 14.58.15.png
Screenshot 2020-08-22 at 14.58.15.png (340.5 KiB) Viewed 6402 times
Edit: patch superseded by v2: https://pcem-emulator.co.uk/phpBB3/view ... 256#p14256
Last edited by davide78 on Fri 28 Aug, 2020 8:47 pm, edited 1 time in total.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] Amstrad PC5086

Post by omarsis81 »

Nice work!
Do you plan to emulate the internal C&T VGA in the future?
User avatar
davide78
Posts: 9
Joined: Sat 22 Aug, 2020 12:36 pm

Re: [Patch] Amstrad PC5086

Post by davide78 »

Thanks!

Emulation of the internal VGA has a low priority now. I prefer to fix the issues with the ports and the floppy first, and then see if I can get the PS.2 mouse working. It also depends on how easy or difficult it is to add a new VGA chip to PCem. I am no expert of emulation nor of graphic chips internals.
User avatar
davide78
Posts: 9
Joined: Sat 22 Aug, 2020 12:36 pm

Re: [Patch] Amstrad PC5086

Post by davide78 »

I discovered that the PC5086 uses the C&T f82c710 universal peripheral controller as super IO chip. The code for it was originally implemented by EluanCM for the Hyunday Super-286TR. I modified the original implementation to get it working with the Amstrad. This new patch replaces the first one.

New features:
Enable High Density floppy support.
Add support for F82C710 Universal peripheral controller.
Changes in the original code to be compatible with PC5086 BIOS: change UPC configuration at every register write.
This is needed for PC5086 BIOS to detect COM and LPT ports correctly, without complains about external ports.
Replace serial1_init with serial1_set to solve issues with serial mouse. Adds has_fifo parameter to serial1_init and serial2_init

Still missing:
PS2 mouse
Internal VGA and HD controller
EMS

EDIT: patch replaced with v3 that fixes some bugs:
NVR is saved to file
COM and LPT ports are detected correctly after soft reset
Attachments
pc5086_v3.patch
Patch for Amstrad PC5086 v3
(178.85 KiB) Downloaded 392 times
User avatar
davide78
Posts: 9
Joined: Sat 22 Aug, 2020 12:36 pm

Re: [Patch] Amstrad PC5086

Post by davide78 »

A couple of patches with the latest updates, before the imminent v17 feature freeze.

pc5085_v4 fixes a bug in f82c710.c that caused problems with the IDE controller in the Super 286.

pc5086_ps2mouse adds PS/2 mouse support to the Amstrad PC5086. Since the Amstrad has an XT keyboard controller, the PS.2 mouse port is mapped at address 2DC and irq 2. While implementing the code, I discovered a bug in the current code: irq2 is redirected to irq 9 not only on at machine, but also on xt machines. Since there is only one pic in an xt, irq 2 is lost and never activated. So I had to modify the code in pic.c to get a correct behaviour for irq 2.
pc5086_ps2mouse patch contains everything in patch_v4 plus:
- changes in pic.c to enable IRQ2 on XT machines
- changes in keyboard_at to expose mouse queue to external modules
- changes in mouse_ps2 to initialize mouse for the amstrad PC5086
- changes in f82c710 to add support for the ps2 mouse interface
Screenshot 2020-11-07 at 10.34.48.png
Screenshot 2020-11-07 at 10.34.48.png (87.82 KiB) Viewed 5851 times
Screenshot 2020-11-07 at 10.39.30.png
Screenshot 2020-11-07 at 10.39.30.png (66.96 KiB) Viewed 5851 times
Screenshot 2020-11-07 at 10.41.54.png
Screenshot 2020-11-07 at 10.41.54.png (118.79 KiB) Viewed 5851 times
Screenshot 2020-11-07 at 10.43.19.png
Screenshot 2020-11-07 at 10.43.19.png (110.62 KiB) Viewed 5851 times
Attachments
pc5086_ps2mouse.patch
Ps/2 mouse support patch
(198.06 KiB) Downloaded 343 times
pc5086_v4.patch
Patch V4
(178.78 KiB) Downloaded 367 times
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Patch] Amstrad PC5086

Post by SarahWalker »

Committed at a89347d4.
Post Reply