News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_zhulien

CPC / Raspberry Pi Bridge Card

Started by zhulien, 14:14, 08 May 16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zhulien

#50
I believe the only part i am waiting for now is the voltage levelers.  Our local electronics stores only sell single line voltage levelers which I would have to use 30+ of if i got them.  That would make a very busy prototype board.


I am now considering the following... what do you think?


16 address lines, all input to PI
8 data lines, I/O to and from PI
RAMDIS (necessary) output from PI
RD, WR to control reading and writing
BRST i am considering attaching to the same GPIO as address line 0, with directions filtered by diodes (can anyone see any issues with this?)
this leaves 1 GPIO left for something else... *and* more importantly I don't need to use the horrible flat cable camera GPIOs of the PI... Just a single 40 pin ribbon cable to connect.


At first I thought I need MREQ and IORQ, but now I don't believe I do, because the PI can monitor everything.  It only matters if i want to know the difference between an I/O request and a memory request and I cannot see why I need to since I won't be sharing address space between the MREQ and IORQ anyway within the PI.


Now here is an interesting thing... If I extend the 40 pins to multiple sockets... I can cater for multiple PIs at once with only the cost of sockets added and board size I believe.  So... why do this?  In theory as follows.


All PIs are monitoring the bus.  Consider if PIs are used for transformations.  Multiple PIs can perform different transformations of the same data at the same time with a simple LDIR.  Consider using a 3d library.  The main PI outputting the 'front' display, subsequent PIs outputting peripheral displays with no additional CPC overheads.  Just like Gran Turismo on the PS3... Maybe we could see a Star Strike 2 one day with peripheral displays... or a Castle Master or similar?


OK, this is really GT5 on PS3 (not the 6128Plus :D

https://www.facebook.com/100010582416753/videos/285077698521642/


How will I know to enable the PI or disable it and not be conflicted with every other memory read/write occuring on the CPC?  I can make sure a particular 'pattern' is in a part of memory to activate the PI... which from a PI's perspective would be a simple string compare.  ie: if ALLPISAREGO is sent to the bus in sequence (can be an LDIR too)... initialising it backward so it doesn't trigger the PI by default...


I am also investigating Spectrum, Sega, PCW and MSX options for the hardware too.  So far I believe the Spectrum, Sega, PCW will be very trivial to support in the same hardware.  The MSX I am still investigating to do with CS1, CS2 and BUSDIR...

zhulien

#51

Just an update because someone in the CPC accelerator thread suggested that everyone should make something and not just talk.  Our projects are being researched, funded and developed through my company and will be likely released in time where the research has proven (hoping sometime this year).  We had advertised locally as well as directly to a few community members to have the hardware work contracted to them, but they had turned us down due to other commitments - so we are taking on this ourselves.

We now have now an abundance of 6128 Pluses, CPC 6128s, a 464 and a few 664s for testing. I got my first PI 3B a couple of weeks ago, GODIL FPGAs, and JustCPC 128ks and all especially for such developments as well as a new PCW, PCW16 and MSX2.  Initial development focuses on CPC as that is what we are most familiar with - we are also mainly a software team - much of our code will be portable to the other Z80 systems.

Some products/projects will be fully open, in the public domain with source code provided (as with the 8BML, VB6 Cross Compiler) and some will be sold but as affordable as possible because we want every CPC owner (and more) to have a new Graphics card with parallel processing capabilities, acceleration, and a few other bells and whistles. We have chosen the PI bolted onto the CPC directly as the PI over 3 generations... have remained backward compatible with their PIs - so our hope is that future upgrades will be possible and inexpensive.

I am waiting still for a few more components to arrive that cannot be bought locally in the electronics shops (Jaycar doesn't really sell much electronic components anymore).  We have more plans for the PI than I have stated here but we are excited still and will update as we progress.

Will it be a CPC if it has a graphics card?  Well... is a PC a PC if you use cards instead of all the onboard features? Definitely!!!  In practice, on the CPC... a Graphics Card won't retarget existing software (CP/M and BASIC could be possible to retarget), but that doesn't mean we all can't have fun coding on our CPCs doing new things in Z80 which we all know and love.

As for the VB6 Cross Compiler... that is the only project that is currently inactive, because we could not find someone competent in Z80 code generation willing to finish it off.  We can and in time we might... but it is the lowest priority of all the projects at this time.

keith56

This sounds an fascinating and mind boggling project! I can't say I understand much of the technical stuff you've described here, but I certainly wish you luck with it, and will be interested in getting my hands on the final product at what ever time it is ready!

Good luck with such an ambitious project.
Chibi Akumas: Comedy-Horror 8-bit Bullet Hell shooter!
Learn ARM, 8086, Z80, 6502 or 68000 with my tutorials: www.assemblytutorial.com
My Assembly programming book is available now on amazon!

krusty_benediction

Atari ST community has a similar card : http://joo.kie.sk/?page_id=384

I would love to have an equivalent on my CPC (ROM, RAM, floppy drive emulation, HDD emulation with a specific firmware, internet access, files, images, snapshots transfers, soundplayer, video acquisition... ) to replace all the different cards more or less maintained

Gryzor

I do have the Atari equivalent. It's a beast and can do tremendous stuff, but it's not the easiest add-on to use...


Unfortunately, its developer had to abandon further development and selling because of the crippling taxes he had to endure.

LambdaMikel

FWIW - here is a great project that gives some insights to some of the engineering challenges one faces in making such a device.


As already suspected, being able to quickly react to an address with the correct byte being put on the databus is extremely challenging with a Raspberry Pi, and only works with a trick here:


https://hackaday.com/2018/05/31/reverse-emulating-nes-nintendception/


The trick is explained from 11'40'' on here:


https://www.youtube.com/watch?v=ar9WRwCiSr0&t=640&authuser=1


LambdaMikel

Quote from: LambdaMikel on 19:56, 01 June 18
The trick is explained from 11'40'' on here


Having said that, this trick (basically, address prediction / guessing) won't work well for the CPC Memory.

LambdaMikel

#57
But then, he is using a Pi Zero... the most recent Pi 3B+ should be almost 2.5 times as fast as the Pi Zero. So maybe it is within range.


What do hardware experts think here? Is that feasible? My suspicion is still "no", because you actually have to do some computation in order to react to an address in an intelligent way (OK, it could just be a memory lookup, but then it is not that interesting).

Gryzor

I watched that video a couple of days ago, really really nice and interesting. I also liked the philosophical angle he threw in.


That said, although it's extremely interesting and impressive, is it practical?

zhulien

Interesting Sidekick64 for Commodore 64 does something very similar - another verification that 'in theory' using a Pi directly to the CPC bus could simulate many hardwares.  Skip to about 17 minutes if you don't want to watch the entire video: 
https://www.youtube.com/watch?v=5YAsx11bgaw

zhulien


zhulien

Yet another 8bit computer doing much the same

https://github.com/frntc/RAD

Anyone want to put the POC together if I send you the parts I have so far? 

Iridium+

Has all development stopped on this now?

I really hope not 😢

An accelerated CPC with a graphics board would be fantastic!

Or am I just the only one?

I wish someone would do a CPC-Next!

zhulien

#63
Quote from: Iridium+ on 12:42, 20 March 23Has all development stopped on this now?

I really hope not 😢

An accelerated CPC with a graphics board would be fantastic!

Or am I just the only one?

I wish someone would do a CPC-Next!
I hope not too.  The issue is I created a basic hardware design with my very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very limited hardware knowledge based on lots of other proven similar projects - ok, there wasn't many proven at the time of conception, but here were a couple - and now there seems dozens - I tried to even hire someone to make a board, there even is a local company microbee (the computer company) that even when I had the money at that time to build a prototype board said they could, but never actually went anywhere - not from my lack of trying.  Unfortuantely I'm really only a software person, a bit advanced, but there are always better programmers too. Such is life.

The circuit I designed if anyone wants to help, is online - it shouldn't take much effort, I can even send the bits i have already if you want a start at it.  The original article I did find has long gone and that was using a Raspberry Pi to bitbang hardware running an emulated CPU core to pretend to be a CPU.  I believe it is possible, but whether ultimately it is limited in some way is unknown on the CPC.  A couple of guys mentioned RAM expansions can be fiddley on the CPC in relation to timings.

Just a note, I recommend anyone to buy a CPLink card as it is a currently existing card that allows you to plug a raspberry Pi onto the CPC.  It currently works and with some more software could provide a good coprocessor foundation - of course I believe interfacing directly with the CPC could give you a sort of Amiga Vampire-like experience or Amiga PiStorm equivalent.

ikonsgr

#64
Hmmm,i have given a thought a lot of times in the past about a CPC accelerator too  :)
 The main problem is that, it's not enough just to have a faster CPU, you need also to accelerate, at least the RAM too! For example, even if you only have an emulated Z80 running 100X times faster than original, you will not see any overall speed improvement of ~10%-20% because EVERYTHING else on the CPC board,  still runs at the mere 1Mhz....
 With some computers like an Amiga, it's rather easy to make such an accelerator, because main cpu (MC68000) already supports a special connection with ram (the famous "Fast ram" which only cpu can access, and it's separate from the rest of the system), so having a powerful cpu and a lot of fast ram, can truly speed up things quite a lot! But, even using this kind of accelerators, since the rest of the system (and especially the circuit that controls video) is still running at the "Ancient" speeds of a few MhZ, you will see great improvement, only when executing CPU intensive code. Practically this means very fast decompression of data (which used a lot in amiga games) and great  improvement in 3D games, all the rest would be the ~same.
Returning to Amstrad CPC, unfortunately this mode of operation is not available. So, it would not be so easy to create a powerful accelerator with cpu+fast ram and at the same time keep everything else in tact, in order to function properly. You see, as there is no DMA access on Amstrad CPC, and all timings are controlled by the GATE array chip, i'm afraid that you might need to "fast emulate" this chip too. Even if you design a super fast z80 with a lot of fast ram too, i doubt it would make any big difference, if you still have GA chip controlling everything at... 1Mhz  ::)

zhulien

I have a Terasic T-Rex which can run CPC in turbo mode at 28Mhz.  If this can do it, I cannot see why another solution cannot - Think of a solution like a Raspberry Pi where the emulator has taken over 99% of the CPC when in turbo mode - but uses the CPC keyboard, perhaps CPC floppy, perhaps some other hardware plugged into the CPC with the helpers of some CPC API that exists - but when in CPC high compatability mode, it goes into use the CPC the majority of time with the real hardware running stuff.  Alternatively as this project was primarily, to use the Raspberry Pi to supliment what the CPC has, some hardware created in software.

ikonsgr

#66
Emulating the entire system on FPGA or using rasberry pi etc, is of course the best approach to get best performance, but then, what you need the original Amstrad CPC for?  You can perfectly plug a keyboard/mouse, video/audio out connectors, and you are ready to go :)   
Anyway, i don't want to sound pessimist but the: "...uses the CPC keyboard, perhaps CPC floppy, perhaps some other hardware plugged into the CPC with the helpers of some CPC API that exists " concept, would be much harder to do than said. Moreover, the most critical point in such projects, i believe is the Software development! No matter how amazing a "SUPER Amstrad CPC" would sound, it would be practically useless, if there is no software that uses it.
And in order to "convince" all the people who are still involved in making software for Amstrad cpc to develop software for it, is to have a wide acceptance for the project.
As i am the creator of USIfAC/ULIfAC  boards,i would say this would be the most difficult part...

zhulien

I don't want to use an external keyboard

GUNHED

Quote from: ikonsgr on 12:36, 26 March 23Emulating the entire system on FPGA or using rasberry pi etc, is of course the best approach to get best performance, but then, what you need the original Amstrad CPC for?  You can perfectly plug a keyboard/mouse, video/audio out connectors, and you are ready to go :) 
Anyway, i don't want to sound pessimist but the: "...uses the CPC keyboard, perhaps CPC floppy, perhaps some other hardware plugged into the CPC with the helpers of some CPC API that exists " concept, would be much harder to do than said. Moreover, the most critical point in such projects, i believe is the Software development! No matter how amazing a "SUPER Amstrad CPC" would sound, it would be practically useless, if there is no software that uses it.
And in order to "convince" all the people who are still involved in making software for Amstrad cpc to develop software for it, is to have a wide acceptance for the project.
As i am the creator of USIfAC/ULIfAC  boards,i would say this would be the most difficult part...
111% agreed!  :) :) :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

zhulien

Yet another pi 8-bit hardware emulator doing exactly this but for a slower system


https://youtu.be/ReTXGczq8Vk

robcfg

I watched that video yesterday and I think we could learn a lot from it thanks to it being an open source project.

zhulien


zhulien

Who wants to finish this hardware for which I believe I have all the components?  

More proof that the concept could  / should work


https://youtu.be/zAla_RtPECE

ikonsgr

Now that i remembered, wasn't Duke developing something like a "SUPER AMSTRAD CPC" board (that would plug onto Z80 socket) codenamed "M7" or something? What happened to this project afterall?

SerErris

The core that is used in Mister would work I assume:

It is using the T80 core:
https://github.com/MiSTer-devel/Amstrad_MiSTer/tree/master/rtl/T80

From the readme:
--------------------------------------------------------------------------------
-- ****
-- T80(c) core. Attempt to finish all undocumented features and provide
--              accurate timings.
--
-- Version 351.
-- Merged Gameboy fixes from Bruno Duarte Gouveia (brNX)
-- Passes Blargg's test ROMs
--
-- Version 350.
-- Copyright (c) 2018 Sorgelig
--  Test passed: ZEXDOC, ZEXALL, Z80Full(*), Z80memptr
--  (*) Currently only SCF and CCF instructions aren't passed X/Y flags check as
--      correct implementation is still unclear.
--
-- ****
-- T80(b) core. In an effort to merge and maintain bug fixes ....
--
-- Ver 303 add undocumented DDCB and FDCB opcodes by TobiFlex 20.04.2010
-- Ver 301 parity flag is just parity for 8080, also overflow for Z80, by Sean Riddle
-- Ver 300 started tidyup.
--
-- MikeJ March 2005
-- Latest version from www.fpgaarcade.com (original www.opencores.org)
--
-- ****
-- Z80 compatible microprocessor core
--
-- Version : 0250
-- Copyright (c) 2001-2002 Daniel Wallner (jesus@opencores.org)
-- All rights reserved

Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

Powered by SMFPacks Menu Editor Mod