Author Topic: New PCW FPGA hardware emulator  (Read 2614 times)

0 Members and 2 Guests are viewing this topic.

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
New PCW FPGA hardware emulator
« on: 18: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
« Last Edit: 22:25, 05 July 20 by steddyman »

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.070
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 937
  • Likes Given: 2329
Re: New PCW FPGA hardware emulator
« Reply #1 on: 19:43, 05 July 20 »
Great news!

http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.354
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1047
  • Likes Given: 2539
Re: New PCW FPGA hardware emulator
« Reply #2 on: 20: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?

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #3 on: 22: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.

Offline JohnElliott

  • CPC664
  • ***
  • Posts: 96
  • Country: gb
  • Liked: 35
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #4 on: 02: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?
« Last Edit: 02:26, 06 July 20 by JohnElliott »

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #5 on: 13:53, 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

Offline Vince

  • CPC664
  • ***
  • Posts: 73
  • Country: gb
  • Bubble Bobble is the greatest !
  • Liked: 64
  • Likes Given: 55
Re: New PCW FPGA hardware emulator
« Reply #6 on: 01:41, 08 July 20 »
This is very cool indeed and I look forward to hearing more of your progress.
I am very interested in FPGAs.  8)

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #7 on: 23: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.

Offline breiztiger

  • CPC464
  • **
  • Posts: 28
  • Liked: 28
  • Likes Given: 4
Re: New PCW FPGA hardware emulator
« Reply #8 on: 18: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


Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #9 on: 20: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.

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #10 on: 21: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

Offline Redbug

  • CPC464
  • **
  • Posts: 28
  • Country: be
  • Liked: 36
  • Likes Given: 5
Re: New PCW FPGA hardware emulator
« Reply #11 on: 22:14, 18 July 20 »
Look promising !
Thanks
Artisan développeur iPhone/Mac.
CrocoDS - Amstrad emulator for macOS / iOS

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #12 on: 00:37, 02 August 20 »
Quick update.  The keyboard is now working.



https://youtu.be/1IrI-LB45WU

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #13 on: 12: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

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.070
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 937
  • Likes Given: 2329
Re: New PCW FPGA hardware emulator
« Reply #14 on: 18:45, 11 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?
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #15 on: 19: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.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.070
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 937
  • Likes Given: 2329
Re: New PCW FPGA hardware emulator
« Reply #16 on: 16: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?
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline breiztiger

  • CPC464
  • **
  • Posts: 28
  • Liked: 28
  • Likes Given: 4
Re: New PCW FPGA hardware emulator
« Reply #17 on: 19:05, 12 August 20 »

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #18 on: 19: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.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.070
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 937
  • Likes Given: 2329
Re: New PCW FPGA hardware emulator
« Reply #19 on: 00:18, 13 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!

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.  :) :) :)
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #20 on: 00:39, 13 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.

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #21 on: 01:42, 16 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

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

Thanks
« Last Edit: 01:44, 16 August 20 by steddyman »

Offline arkive

  • CPC664
  • ***
  • Posts: 78
  • Country: tw
  • Liked: 41
  • Likes Given: 46
Re: New PCW FPGA hardware emulator
« Reply #22 on: 22:55, 16 August 20 »
Many thanks, it's an awesome addition to MiSTer's micro core shelf. Will try it asap.

Offline funkheld

  • CPC6128
  • ****
  • Posts: 290
  • Liked: 16
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #23 on: 09: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
it is available as a kit or completely assembled.


thank you.
greeting
« Last Edit: 10:01, 23 August 20 by funkheld »

Offline steddyman

  • CPC464
  • **
  • Posts: 16
  • Country: gb
    • Unashamed Geek
  • Liked: 39
  • Likes Given: 0
Re: New PCW FPGA hardware emulator
« Reply #24 on: 00:06, 24 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.