CPCWiki forum

General Category => NC100, NC200, PCW, PDA600 - the rest of the Family! => Topic started by: steddyman on 16:23, 05 July 20

Title: New PCW FPGA hardware emulator
Post by: steddyman on 16:23, 05 July 20
Hi everyone


I am developing a new PCW hardware emulator for the MiSTer FPGA project.


I've already made quite a bit of progress and have the video, memory management mapping and disk subsystem recreated.  I can get the PCW to boot of the boot sector, then start to load CPM (or other disk).


However, due to a difference between how the signals of the NEC765 are handled between the CPC and PCW I have hit a boot issue (the PCW issues the TC disk signal).  I can get the emulator to boot to the point it loads the boot sector, then turns on the screen and starts loading the rest of the CPM system.


However, it gets to Track 5, sector 9, then seems to get stuck.  At that point the screen is white, with the top quarter filled with horizontal black lines.  It then flashes between that screen and all white and retries a number of times.


Beyond what I've read of the PCW hardware, required to recreate the logic, I don't know a great deal about the format of the disks or the CPM booting process.  Is there anything special about this track that could cause problems?  Does the point where is stopping give any clues as to what may be wrong with my disk emulation?


Thanks
Title: Re: New PCW FPGA hardware emulator
Post by: GUNHED on 17:43, 05 July 20
Great news!

Title: Re: New PCW FPGA hardware emulator
Post by: robcfg on 18:02, 05 July 20
Welcome!


I'm not sure if there's anything special on that track and sector.


Which disk image are you trying to boot?
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 20:28, 05 July 20
Thanks.  I've tried quite a few, things like the Blagger Boot disk or Infocom boot disk.


I presume the place it stops with about 1/4 the screen having the black in is some indicator of where it got to?


I have had to modify the NEC765 implementation from the CPC MiSTer core, but add some handling for the TC line and interrupts.  Either there is something special about that sector (doubt it) or that portion of the CPM boot, starts to look for different signals from the disk (maybe because the XBIOS takes over)?  I can see in the signal trace it tries to load the same sector multiple times.
Title: Re: New PCW FPGA hardware emulator
Post by: JohnElliott on 00:21, 06 July 20
On the PCW8256 boot disk I tested, J14CPM3.EMS goes all the way from track 1 sector 4 to track 10 sector 2, so track 5 sector 9 is in the middle of it the EMS file and has nothing special about it.

The 9512 boot disk I tested had J21CPM3.EMS going from track 12 sector 5 to track 21 sector 7 -- that's cylinder 6, head 0, sector 5 to cylinder 10, head 1, sector 7, and neither track 5 nor cylinder 5 gets a look-in.

LocoLink has a smaller EMS file -- if you can get your hands on a LocoLink boot disk, does that behave any differently?
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 11:53, 06 July 20
Quote from: JohnElliott on 00:21, 06 July 20
On the PCW8256 boot disk I tested, J14CPM3.EMS goes all the way from track 1 sector 4 to track 10 sector 2, so track 5 sector 9 is in the middle of it the EMS file and has nothing special about it.

The 9512 boot disk I tested had J21CPM3.EMS going from track 12 sector 5 to track 21 sector 7 -- that's cylinder 6, head 0, sector 5 to cylinder 10, head 1, sector 7, and neither track 5 nor cylinder 5 gets a look-in.

LocoLink has a smaller EMS file -- if you can get your hands on a LocoLink boot disk, does that behave any differently?


Thanks John, I appreciate that.  That's very helpful.


I couldn't track down a LocoLink disk though I could find plenty of games to test but they all do the same.


I'll keep tracing and see if I can see anything out of the ordinary.


Thanks
Title: Re: New PCW FPGA hardware emulator
Post by: Vince on 23:41, 07 July 20
This is very cool indeed and I look forward to hearing more of your progress.
I am very interested in FPGAs.  8)
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 21:56, 09 July 20
I'm getting closer.  I've ended up having to disassemble and comment all of the CPM boot process that is loaded from the boot sector code, so I can trace exactly where the issue is.
Title: Re: New PCW FPGA hardware emulator
Post by: breiztiger on 16:55, 10 July 20
hi

very good to see this amstrad computer arrive in mister cores ...

and i think you can help to debug fdc in cpc core because it has some probs with protection like this https://www.atari-forum.com/viewtopic.php?p=393544#p393544

Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 18:49, 10 July 20
Hi


Thanks for the post.  However, I don't think this is a protection issue. The disks I am trying to boot are simple CPM boot disks without protection at this stage.  It seems to be down to how the PCW issues the Termincal Count command to terminate transfers, which the CPC core does not do.  I've implemented TC, but maybe not exactly right.  The Datasheet doesn't do a good job of describing exactly what happens when TC goes high and low.  Currently I have it move from EXECUTE to RESPONSE phase while maintaining the status registers.
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 19:23, 17 July 20
I'm starting to make good progress now.  Quick video of it direct booting the Buran game.  Still got an issue with CPM to resolve and no keyboard support yet.


https://youtu.be/MyE1c0D7HiE (https://youtu.be/MyE1c0D7HiE)
Title: Re: New PCW FPGA hardware emulator
Post by: Redbug on 20:14, 18 July 20
Look promising !
Thanks
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 22:37, 01 August 20
Quick update.  The keyboard is now working.


https://youtu.be/1IrI-LB45WU
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 10:26, 10 August 20
Hi everyone


Disk reading issues are now fixed and the core can run at upto 32Mhz.  Still got one disk issue to track down but I am expecting to release the core this week.


I've just finished adding DKTronics sound and joystick support.  Here is a little demo:


https://youtu.be/ShGYL9Fc8rM
Title: Re: New PCW FPGA hardware emulator
Post by: GUNHED on 16:45, 11 August 20
Quote from: steddyman on 10:26, 10 August 20
... and the core can run at upto 32Mhz.nd and joystick support.


Does this mean, that the hardware emulator can run 8x faster than a real PcW?
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 17:33, 11 August 20
Yes it does.  It can run at 1x, 2x, 4x or 8x speed.


It works suprisingly well on the PCW.  Because most games are timed to the screen refresh or system timer, which both don't change, most things operate correctly but just a lot smoother.  Even AY sound is tagged to a fixed frequency so it sounds correct at higher clocks.
Title: Re: New PCW FPGA hardware emulator
Post by: GUNHED on 14:20, 12 August 20
This is truely amazing!!!!!!!!!!!!!!!!!!!!!  :) :) :) :) :) :) :) :) :) :) :)
Need to get one of them. Can a working unit be bought, or must we put together a kit?
Title: Re: New PCW FPGA hardware emulator
Post by: breiztiger on 17:05, 12 August 20
You can get a full MiSTer


at https://ultimatemister.com/product/ultimate-mister-pro/ (https://ultimatemister.com/product/ultimate-mister-pro/)
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 17:07, 12 August 20
Currently the PCW core requires nothing other than the DE10-Nano.  It doesn't need SDRAM or any of the other addons.


I will probably add support for SDRAM soon though so it can support more than 256k memory.
Title: Re: New PCW FPGA hardware emulator
Post by: GUNHED on 22:18, 12 August 20
Quote from: steddyman on 17:07, 12 August 20
Currently the PCW core requires nothing other than the DE10-Nano.  It doesn't need SDRAM or any of the other addons.
Awesome!

Quote from: steddyman on 17:07, 12 August 20
I will probably add support for SDRAM soon though so it can support more than 256k memory.
That is a great idea. IIRC there are memory expansions for the PcW up to 4 MB.  :) :) :)
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 22:39, 12 August 20

Keeping the memory to 256k allows me to use the BRAM on the FPGA which brings the benefit that the video access does not slow down the CPU at all and it has very low latency.  But I will expand the memory out to the full size supported by the system soon, and just use the BRAM for the first 128k.  The video memory can only be in the first 128k anyway.
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 23:42, 15 August 20

I'm happy to report that the first release of the Amstrad PCW core is now available on the main MiSTer site.


If you run the update script on your MiSTer, then it should automatically download and install.

Alternatively you can download it from the 'releases' folder.

https://github.com/MiSTer-devel/Amstrad-PCW_MiSTer (https://github.com/MiSTer-devel/Amstrad-PCW_MiSTer)

I hope you like it. Let me know any problems you find.

Thanks
Title: Re: New PCW FPGA hardware emulator
Post by: arkive on 20:55, 16 August 20
Many thanks, it's an awesome addition to MiSTer's micro core shelf. Will try it asap.
Title: Re: New PCW FPGA hardware emulator
Post by: funkheld on 07:56, 23 August 20

Hi good afternoon.


i played the mister and the joyce 8256.
a great thing.


in the video you have mount b:
but that's not on my core yet.


I'm looking forward to the 2mb extension.


i have the mister from here : https://manuferhi.com/p/mister-fpga-32mb (https://manuferhi.com/p/mister-fpga-32mb)
it is available as a kit or completely assembled.


thank you.
greeting
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 22:06, 23 August 20
Hi


Yes, I originally had B: drive support but pulled it for the 1st release due to a compatibility issue.  That issue is now resolved and I have also added a bunch of other new features, such as PCW9512+ mode with 3.5" boot disk support.  I haven't yet put that version live though because I'm just enhancing it a little further.  Please be patient a little longer.
Title: Re: New PCW FPGA hardware emulator
Post by: funkheld on 22:18, 23 August 20

yes, thanks for the info.



the fpga is not an emulator   :)

greeting
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 23:13, 23 October 20
My apologies.  I should have posted that I released version 2 of the fpga core for PCW and it includes all the following:


* Turbo support to 32Mhz
* Expanded memory support to a maximum of 2MB
* 3" and 3.5" disk support
* Dual disk drives
* PCW 8xxx and PCW9xxx model support
* All hardware Joysticks and Mice supported
* 4 colour mode support


More details here: https://github.com/MiSTer-devel/Amstrad-PCW_MiSTer (https://github.com/MiSTer-devel/Amstrad-PCW_MiSTer)



Features video here: https://www.youtube.com/watch?v=z-IoDr81xjE (https://www.youtube.com/watch?v=z-IoDr81xjE)
Title: Re: New PCW FPGA hardware emulator
Post by: JohnElliott on 01:01, 24 October 20
I'm not sure you've got the model numbers right.

8256 / 8512: Dot-matrix PCWs with (usually) 180k boot drives. Boot sector checksum is 0FFh.
9256 / 10: Dot-matrix PCWs with 720k boot drives. Boot sector checksum is 0FFh.
9512 / 9512+: Daisywheel PCWs with 720k boot drives. Boot sector checksum is 01h.

So I suspect "9256 / 9512+" doesn't actually describe what it's doing.
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 14:14, 24 October 20
Hi John


Thanks for the response.  Yes, you are correct that the names are misleading.


I only have two modes:
8256/8512 = A: 180K 3", B: 720K 3" (but can read 180K disks) - Checksum 0xFF
9256/9512 = A: 720K 3.5", B: 720K 3.5" - Checksum 0x01


I did struggle on exactly how to classify those two modes in the menu.  Showing the Checksum and the drive types would probably confuse non-hardcore Amstrad PCW users.


I have the disk configuration I do in 8256 mode because it is incredibly convenient.  You can leave a CPM disk in A: then just iterate through the library just swapping drive B:


Any ideas on a better naming convention given the above information?
Title: Re: New PCW FPGA hardware emulator
Post by: JohnElliott on 17:48, 24 October 20
I'd say "9512 / 9512+" for the configuration with checksum=1.
Title: Re: New PCW FPGA hardware emulator
Post by: steddyman on 19:24, 24 October 20
Ok, thanks for the feedback John


I'll change that now.  I'm working on a fix for the SymbOS issue.

Title: Re: New PCW FPGA hardware emulator
Post by: HAL6128 on 18:50, 25 October 20
Just a short question: is it possible to emulate a harddisc for the CP/M OS over the MISTcore / -hardware?
Title: Re: New PCW FPGA hardware emulator
Post by: RockRiver on 07:15, 23 June 21
Quote from: steddyman on 23:13, 23 October 204 colour mode support
PCW with Audio AY (dk'Tronics) and Habisoft's ColorIn board support

GREAT !! enhanced PCW
" PCW plus " " PCW+ "
Title: Re: New PCW FPGA hardware emulator
Post by: TynH on 13:27, 23 June 21
This sounds pretty awesome, maybe something for uhmm Xmas?
Are there any limitations compared to real hardware?
Title: Re: New PCW FPGA hardware emulator
Post by: RockRiver on 22:26, 23 June 21
Quote from: TynH on 13:27, 23 June 21
... limitations compared to real hardware?
no HDD ; no real FDD (USB floppy drive doesn't support non MS-DOS format) ... only "virtual" DSKs...
and core autor said that SymbOS (cause ms-dos fat12 dsk? ) did not work.


[but colour & audio on PCW...  Habisoft guilty!!  :P   
It's one of my wet dreams...  :o  it's "missing link" Arnold Number Two...] if NeptUno core port not come, I'll buy a MISTer too.
I'm working nowadays in new 4 colour palettes for PCW games
Title: Re: New PCW FPGA hardware emulator
Post by: RockRiver on 21:04, 28 August 21
hi! Rampa developer ports PCW Mister Core to NeptUNO fpga board.
8)
maybe in a future ports to others cheaper fpga boards: Sidi, Sidi64 ...
Powered by SMFPacks Menu Editor Mod