News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_NewsBot

Octoate's News - ACID Verilog code release

Started by NewsBot, 17:00, 15 April 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NewsBot

ACID Verilog code release
15 April 2011, 3:30 pm

Nilquader and I decided to release our Verilog code (based on Nocash's decryption of the algorithm) to "emulate" the ACID protection chip of the Amstrad Plus. So, you can now find it in the ACID article of the CPCWiki and right here in this posting:

Selec All Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: Octoate, Nilquader // ACID Reverse engineering by nocash // // Create Date   : 00:45:53 09/03/2010 // Design Name   : amsacid // Module Name   : amsacid // Project Name  : // Target Devices: Xilinx XC9572 // Tool versions : // Description   : Reverse engineered Amstrad 40908 "ACID" Chip // // Revision: // Revision 0.05 // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module amsacid(PinCLK, PinA, PinOE, PinCCLR, PinSIN);   input PinCLK; input [7:0]PinA; input PinOE; input PinCCLR;   output [7:0]PinSIN;   wire PinCLK;   reg [16:0]ShiftReg = 17'h1FFFF; wire [16:0]CmpVal; wire [16:0]XorVal;   assign CmpVal = 17'h13596   ^ (PinA[0] ? 17'h0000c : 0)             ^ (PinA[1] ? 17'h06000 : 0)             ^ (PinA[2] ? 17'h000c0 : 0)             ^ (PinA[3] ? 17'h00030 : 0)             ^ (PinA[4] ? 17'h18000 : 0)             ^ (PinA[5] ? 17'h00003 : 0)             ^ (PinA[6] ? 17'h00600 : 0)             ^ (PinA[7] ? 17'h01800 : 0); assign XorVal = 17'h0C820   ^ (PinA[0] ? 17'h00004 : 0)             ^ (PinA[1] ? 17'h06000 : 0)             ^ (PinA[2] ? 17'h00080 : 0)             ^ (PinA[3] ? 17'h00020 : 0)             ^ (PinA[4] ? 17'h08000 : 0)             ^ (PinA[5] ? 17'h00000 : 0)             ^ (PinA[6] ? 17'h00000 : 0)             ^ (PinA[7] ? 17'h00800 : 0);   always@(negedge PinCLK)    begin      if (PinCCLR) // not in reset state       begin       if (!PinOE && ((ShiftReg | 17'h00100) == CmpVal))          begin          ShiftReg <= (ShiftReg ^ XorVal) >> 1;          ShiftReg[16] <= ShiftReg[0] ^ ShiftReg[9] ^ ShiftReg[12] ^ ShiftReg[16] ^ XorVal[0];  // hier xorval mit berüchsichtigen          end       else          begin          ShiftReg <= ShiftReg >> 1;          ShiftReg[16] <= ShiftReg[0] ^ ShiftReg[9] ^ ShiftReg[12] ^ ShiftReg[16];          end       end    else       begin          ShiftReg <= 17'h1FFFF;       end    end   //assign PinSIN = ShiftReg[7:0] ^ 8'hff; assign PinSIN = ShiftReg[7:0]; //assign PinSIN[0] = PinCLK;   endmodule
But this isn't everything about the ACID. We also found a timing problem during the investigation with a logic analyzer, which you can see here:

ACID initialisation by GrimACID initialisation (by Grim) You will find glitches on the /CCLR line which show that the SIN contact should be changed... All in all it is possible to use a fast flip-flop to change the SIN signal when such a glitch occurs (see picture below).

Flip flop for ACID replacementFlip flop for ACID replacement You see, this is a very simple schematic, but it isn't much cheaper than a CPLD, which emulates the full ACID and comes with a disadvantage: it won't work with a reset, so you always have to switch the CPC off and on again.

So, have fun with it – maybe Bryce will change his cartridge design and support this solution in the future :-) .

Related posts:


© Octoate for Octoate.de - The Amstrad CPC news portal, 2011. |  Permalink |  No comment |  Add to  del.icio.us    Post tags: 2011, ACID, Amstrad Cartridge Identification Device, cartridge, hardware, nilquader, octoate, plus  

CPC-Topsites  

Feed enhanced by Better Feed from  Ozh

Source: Octoate.de - The Amstrad CPC news portal

---
This news item first appeared on Octoate's Blog and was aggregated through RSS for the forum.
This content has been fetched from a third-party page feed.

TFM

WoW! Thank's for releasing!

I advice everybody to go to Octoates site and take a look at this. It's not hard to understand, but quite interesing!

Thanks for the deep insight into LSD err.... ACID ;-)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ArcadeTV

Is there a pinout for the cpld when used on a custom cartridge?
I would love to make a custom pcb for my gx4000 but i can't seem to find out how this is connected in the cart schematic :-/

If you care to share that info It'd be very much appreciated.
Thanks for your work on the clone, absolutely fascinating stuff though I find it very hard to get into it.

MaV

Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

TFM

Quote from: ArcadeTV on 00:24, 29 October 14
Is there a pinout for the cpld when used on a custom cartridge?
I would love to make a custom pcb for my gx4000 but i can't seem to find out how this is connected in the cart schematic :-/

If you care to share that info It'd be very much appreciated.
Thanks for your work on the clone, absolutely fascinating stuff though I find it very hard to get into it.


Contact Octoate at octoate.de

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Octoate

...or directly here via the forums :).

@ArcadeTV: You can nearly freely assign your pins to the CPLD with the IDE (e.g. Altera Quartus or Xilinx Webpack). We've used an Xilinx XC9536 CPLD, so maybe the best way to get into it is to download the Xilinx Webpack, create a new project for the CPLD which you want to use and then go through all the design steps of the IDE.

Here is an example from the Xilinx forums, how this could look like for a XC9536XL in the Xilinx Webpack:
--

ArcadeTV

That's totally nice, thank you very much for explaining! Though Bryce already told me that the pins can be freely assigned ;-)
Thanks again!

dcdrac

Does this mean in nuts and bolts terms anyone can make a working Plus cartridge now?

TFM

Yes, but the Cart-Shells are still missing.

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ArcadeTV

i have something planned for cartshells... ;)

TFM

Quote from: ArcadeTV on 18:48, 30 October 14
i have something planned for cartshells... ;)


Keep me updated please. I would need 100 if possible. So the price per unit will drop too. Already got 100 ACID chips and 100 Cart PCBs (for 512 KB ROM).

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ArcadeTV

@TFM
did you get my email the other day? if not please contact me.

dcdrac

I would love to see SymbOS on a cartridge

ArcadeTV

@Octoate
@Bryce

I'm having difficulties here and need your advice, guys!
I can't make a decision for a package... I only know that I want one that works with 5V and is easily available. Also I don't want to use a socket in my pcb-layout.

If one of you could advise a package I'll use it.
Also I would like to leave the pin-configuration of the cpld to you. Would be extra-awesome if you'd tell me which pins to use and how to connect them.

This way I cound build the pcb and order it so we have something to play around with as a solid base for a all-in-one cart.

Thanks and happy Halloween!!

TFM

Quote from: ArcadeTV on 00:06, 31 October 14
@TFM
did you get my email the other day? if not please contact me.


Gotta look it up! Been busy at work. Let me check at the weekend.

Happy Helloween!

Quote from: dcdrac on 12:04, 31 October 14I would love to see SymbOS on a cartridge


Right. Meanwhile you can use the Plus version of FutureOS on Cartridge.  :P   ;)   :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Octoate

Quote from: ArcadeTV on 16:11, 31 October 14
@Octoate
@Bryce

I'm having difficulties here and need your advice, guys!
I can't make a decision for a package... I only know that I want one that works with 5V and is easily available. Also I don't want to use a socket in my pcb-layout.

If one of you could advise a package I'll use it.
Also I would like to leave the pin-configuration of the cpld to you. Would be extra-awesome if you'd tell me which pins to use and how to connect them.

This way I cound build the pcb and order it so we have something to play around with as a solid base for a all-in-one cart.

Thanks and happy Halloween!!
Hi ArcadeTV,
well, I decided to put the two projects, which I started in 2010, to my GitHub account. Maybe they can help you a bit to get more into designing a cartridge by yourself or you can use them as a base for your own design. The GitHub page contains a simple cartridge (schematic and board layout) for Amstrad Plus / Amstrad GX4000, which can be either equipped with a real ACID protection chip or with a XC9536 PLCC to emulate the ACID protection and a AT29F040 for flash storage.

The second project is a design for a flash cartridge (only schematics), which uses an ATMega8 to connect to the PC to program it. For more information please refer to the README.md file in the repository in which I tried to explain the intended functionality.

Unfortunately I have not enough time to finish the projects soon, that's why I decided to release them publicly, so maybe someone is interested to take over :). Otherwise I will work on them from time to time :P.
--

ArcadeTV

wow!  :o
That's so noble and generous, thank you very much for releasing this!!

I know that life sometimes gets in the way of such cool projects, I'll do my best to take this to the next step. Thanks again!
That's just awesome.

TFM

Thanks Octoate! That will help people doing great things for CPC.  :) :) :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Octoate

No problem. I am currently cleaning up my unfinished projects and decided to release some of them to the public. It doesn't make sense to keep them in private because someone can learn from them or even take them over. I still can work on them if I want :).
--

ArcadeTV

great spirit and very much appreciated! I already played around with it and I will keep it open for others too. Thanks again!

TFM

Quote from: ArcadeTV on 00:06, 31 October 14
@TFM
did you get my email the other day? if not please contact me.


Did you get mine actually? Or did time render it obsolete?  :-X
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

ArcadeTV

@TFM
not that I knew... when did you send it??

TFM

Quote from: ArcadeTV on 07:39, 04 December 14
@TFM
not that I knew... when did you send it??


Never mind, it's quit a bit ago, but it went to spam probably. If I look at Geralds project, which seems to be quite up and running (and a lot of people show interest) then we can be save time and just use it. Of course on the other hand it would be fun to make a multicart which can be programmed from CPC side.  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod