EverDrive Forum

General => EverDrive N8 => Topic started by: KRIKzz on February 09, 2013, 04:58 PM

Title: NES CIC CLONE
Post by: KRIKzz on February 09, 2013, 04:58 PM
Huh! After three days of crazy work i made my own AVR based cic clone for NES, woohoo! So, NES version of cart will come very very soon!

(http://imageshack.us/a/img89/2551/dsc0033di.th.jpg) (http://imageshack.us/photo/my-images/89/dsc0033di.jpg/)
Title: Re: NES CIC CLONE
Post by: saturnu on February 09, 2013, 06:07 PM
Good work Krikzz!

What about the two extra Famicom audio lines that go straigt to the expansion Port of the NES?
Will i have the modify my NES in that case, i think so?
Just an idea - a headphone jack would be nice or just solder-Pads on the PCB to add one.^^

greetings saturnu
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 09, 2013, 06:43 PM
Ypu will not able to hear nes internal sound with phones jack if your system is not modified
Title: Re: NES CIC CLONE
Post by: Grambo on February 09, 2013, 07:35 PM
That is very cool to hear. AVR is much cheaper and less work than donor carts :)

How'd you go about recreating the CIC's algorithm? Did you just find a CIC ROM dump and use the same disassembler as the SNES? I've heard they're the same.

3 days is pretty impressive. Big congrats Krikzz! This is awesome.
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 09, 2013, 09:03 PM
That is very cool to hear. AVR is much cheaper and less work than donor carts :)

How'd you go about recreating the CIC's algorithm? Did you just find a CIC ROM dump and use the same disassembler as the SNES? I've heard they're the same.

3 days is pretty impressive. Big congrats Krikzz! This is awesome.
I used Tengen.c to understand algorithm and timing, then i just make asm implementation for avr
Title: Re: NES CIC CLONE
Post by: butfluffy on February 09, 2013, 09:49 PM
nes version of cart will come very very soon. this is great news. so excited about this everdrive :)
Title: Re: NES CIC CLONE
Post by: dvd2vcd on February 09, 2013, 11:00 PM
excellent work krikzz as always
Title: Re: NES CIC CLONE
Post by: Drakon on February 10, 2013, 06:03 AM
So yours works like a pirate cart or the real thing?  And what's an avr? Time for some googling...
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 10, 2013, 11:44 AM
So yours works like a pirate cart or the real thing?  And what's an avr? Time for some googling...
Works like original cic, plus my cic supports any regions. AVR it is an Atmel MCU
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 10, 2013, 12:09 PM
Someone (jims cool) on Nesdev's forum was busy doing the same thing with a attiny13 except he's planning to have it work both as NES CIC and SNES CIC as far as I remember. Impressive that you managed to do it in 3 days! It's always nice seeing AVR get some love:0 Will you be releasing the binary or you are planning on setting the protection fuse and keeping it private? (just curious, no judgments!)
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 10, 2013, 05:53 PM
I will release asm code and binary. By the way, i also chosen ATtiny13 for final implementation(I used atmega16 for prototype), this mcu even bit more cheap than PIC12F629
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 10, 2013, 06:18 PM
Awesome news! That's pretty generous and should break the CIClone monopoly. I'll be sure to try it out when it get released as I have quite a few tiny13 laying around and I'm planning on replacing the CIC stun circuit from an old 60-to-72 nes adapter with one of those baby. Any thought on how you're going to name your creation?
Title: Re: NES CIC CLONE
Post by: dvd2vcd on February 10, 2013, 08:15 PM
krikzz how did you learn about all the different retro stuff? i really admire your work, wished i could do the stuff you do :D
Title: Re: NES CIC CLONE
Post by: Grambo on February 10, 2013, 08:49 PM
I will release asm code and binary. By the way, i also chosen ATtiny13 for final implementation(I used atmega16 for prototype), this mcu even bit more cheap than PIC12F629
I have always loved your approach with DIYers and we appreciate it. This is excellent news, indeed.

Any thought on how you're going to name your creation?

Name it the KobaCIC!!! Or whatever else you think makes more sense with pronunciation. If it's not obvious... I'm going for a play on "ковбаса".
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 10, 2013, 10:50 PM
Awesome news! That's pretty generous and should break the CIClone monopoly. I'll be sure to try it out when it get released as I have quite a few tiny13 laying around and I'm planning on replacing the CIC stun circuit from an old 60-to-72 nes adapter with one of those baby. Any thought on how you're going to name your creation?
Probably avrcic, or something like that.

krikzz how did you learn about all the different retro stuff? i really admire your work, wished i could do the stuff you do :D
Internet is my best friend (:

Name it the KobaCIC!!! Or whatever else you think makes more sense with pronunciation. If it's not obvious... I'm going for a play on "ковбаса".

LOL "cало" would more actual than "ковбаса"  for Ukraine, salocic in this case ha ha
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 11, 2013, 02:48 AM
I'll be sure to try it out when it get released as I have quite a few tiny13 laying around
Do you have PAL NES? i should test avrcic with all types of nes, but i have only US ntsc  system
Title: Re: NES CIC CLONE
Post by: JohnnyPhantom on February 11, 2013, 10:19 PM
Just a question, debating if I'll get the famicon N8 or wait for NES version, will there be any differences in the two other than form factor? and any price difference?

THANKS!! YOU ROCK KRIKzz!
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 11, 2013, 11:11 PM
I'll be sure to try it out when it get released as I have quite a few tiny13 laying around
Do you have PAL NES? i should test avrcic with all types of nes, but i have only US ntsc  system

I only have Canadian NES system which are NTSC.
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 11, 2013, 11:24 PM
Just a question, debating if I'll get the famicon N8 or wait for NES version, will there be any differences in the two other than form factor? and any price difference?

THANKS!! YOU ROCK KRIKzz!
form factor is the only difference. NES version probably will cost bit more, cuz nes require cic and huge size pcb, difference around 2-3 usd
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 11, 2013, 11:51 PM
Would be cool if somebody may test this thing with PAL systems. I waiting for my own nes from ebay, but i have no idea when it will be arrived. I will test it more when cart pcb will be ready and when my pal nes will be arrived.
here what i have at this moment: http://krikzz.com/pub/support/everdrive-n8/development/avrciczz.zip
Title: Re: NES CIC CLONE
Post by: JohnnyPhantom on February 12, 2013, 12:33 AM
Just a question, debating if I'll get the famicon N8 or wait for NES version, will there be any differences in the two other than form factor? and any price difference?

THANKS!! YOU ROCK KRIKzz!
form factor is the only difference. NES version probably will cost bit more, cuz nes require cic and huge size pcb, difference around 2-3 usd

When you say NES will require a cic, what does that mean? as in, if I get the famicon version with the pin adapter, will it work just fine in my US/NTSC NES or will i have to remove the lockout chip or mod the system in some way?
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 12, 2013, 12:35 AM
CIC should be already mounted in adapter
Title: Re: NES CIC CLONE
Post by: JohnnyPhantom on February 12, 2013, 12:40 AM
CIC should be already mounted in adapter

Wow! thats perfect!!

Now I just have to decide, Famicon version or wait for the NES.... grr.. I can't decide :P
Title: Re: NES CIC CLONE
Post by: Drakon on February 12, 2013, 04:58 AM
krikzz how did you learn about all the different retro stuff? i really admire your work, wished i could do the stuff you do :D

Probably a lot of internet documentation combined with a bit of reverse engineering.  I've built new things that way.  Although what krikzz does is wayyyy above my level haha.
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 12, 2013, 07:13 AM
Just tested AVRCICZZ and it worked flawlessly. I was able to replace the crappy CIC stun circuit of an old pirate 60-to-72 pin adapter with this awesome CIC clone. Thanks!
Title: Re: NES CIC CLONE
Post by: JimmyMz on February 12, 2013, 05:50 PM
removed
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 12, 2013, 06:40 PM
Here you go, it was an internal adapter in an old dead pirate cart that I was using as housing for a cool multicart.

http://www.skinnyv.com/img/adapter1.JPG (http://www.skinnyv.com/img/adapter1.JPG)

http://www.skinnyv.com/img/adapter2.JPG (http://www.skinnyv.com/img/adapter2.JPG)

Most of the component are part of the old stun circuit, they could be removed but I just cut the connection leading to the /Data out since I was just quickly testing last night. I had to tap directly on the edge connector as the pin were not connected to anything beside the data out.
Title: Re: NES CIC CLONE
Post by: Grambo on February 12, 2013, 10:15 PM
When you say "most of the components", do you mean all of the resistors, cap and TO-92s? I'm slightly confused about what's going on here. (It looks like PIN2 on the ATTiny13 is going through the PCB, into the data... in?)

I'm also a bit unclear on how you knew the pin layout for Krikzz's CIC as I don't see documentation anywhere. My experience with microcontroller flashing doesn't go incredibly deep, so maybe the answers are right in front of me, but I just don't follow. If you could enlighten me, it'd be greatly appreciated.

Very cool it all works though and that you've already found a fantastic practical use for it.
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 13, 2013, 01:22 AM
Pin layout is found in the ASM file.

Pin 1 = Not connected
Pin 2 = CLK (Cart pin #71)
Pin 3 = LED (Optional LED feedback for region change)
Pin 4 = GND (Any ground point on PCB, Cart pin #1 for example is a GND)
Pin 5 = Data-Out (Cart pin #35)
Pin 6 = Data-In (Cart pin #34)
Pin 7 = Reset (Cart pin #70)
Pin 8 = VCC 5v (Cart pin #36)

No need for any components, the one in my picture were part of the stun circuit, an old technique pirate cart used to trick the CIC verification process (that kind of circuit trickery were defeated by Nintendo on later NES board revision and wouldn't work anymore iirc). I could remove them but chose to just cut the traces to save time as it was getting late. The AVRCICZZ will work by itself with no need for any extra components once programmed properly. Remember that you'll probably need to press RESET repeatably on your nes about 8 to 10 times the first time you boot your cart after installing the AVRCICZZ in order to set the region if it keep resetting.

Adding this to a third-parties 60-to-72 pin adapter effectively make them just as good as an official Nintendo adapter found in Gyromite card. Alternatively, you could also just use any regular salvaged NES lockout chip from a cart of your region and solder it instead of programming an AVRCICZZ but you would need to follow the official NES CIC pinout for that (Can provide info if somebody is planning to go that route).
Title: Re: NES CIC CLONE
Post by: Grambo on February 13, 2013, 01:35 AM
Aha, I get it now. Sorry, I'm not familiar with ASR files and OSX doesn't have the extension associated with any program. All makes sense now, that was definitely the source of my confusion.

Cool stuff, thanks.
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 13, 2013, 01:45 AM
The ASM file is just a text file containing the assembly source code of the AVRCICZZ so you can open it with any text editor even on OSX.
Title: Re: NES CIC CLONE
Post by: Grambo on February 13, 2013, 04:47 AM
The ASM file is just a text file containing the assembly source code of the AVRCICZZ so you can open it with any text editor even on OSX.
Yes, I should have clarified that I had already done so. It's just that there's no default program associated with the extension. I now see that it's the source assembly code with comments and it all makes perfect sense.

Krikzz, how does the region changing and LED work? Does it just rely on the console resetting itself in order to cycle through the different CIC codes?
Also, is the LED pin 3 high when your program cycles to a new CIC code?

I'd like to figure it out on my own, but that AVR assembly code is so foreign to me.
I think I've just been inspired to learn some basic AVR assembly :)
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 13, 2013, 04:58 AM
LED light up upon region change and then turn off as far as I know. I don't really see why the LED would be needed unless you're just testing your chip (or to flash a LED on the nes everdrive)
Title: Re: NES CIC CLONE
Post by: Grambo on February 13, 2013, 05:11 AM
(or to flash a LED on the nes everdrive)
Bingo.
Is an LED installed into my Everdrive cart necessary? Not really. Is it cool? I think so.
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 13, 2013, 05:48 AM
I wouldn't include it in an homemade mod but I got to say it would be nice on the everdrive PCB.
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 13, 2013, 02:02 PM
Krikzz, how does the region changing and LED work? Does it just rely on the console resetting itself in order to cycle through the different CIC codes?

If correct region already selected, then reset pushing will not have any effect, but if cic detects that system locked, then happens next:
1) first 3 resets, cic just trying to unlock system like usually
2) after 3 failure attempt to unlock the system, cic will try to swith on other region (change key/lock codes).
3) led is shine, each next reset will switch cic to next region (4 regions total). Once correct region will be selected, cic will remember it and led will be turned off
Title: Re: NES CIC CLONE
Post by: JimmyMz on February 14, 2013, 12:32 AM
removed
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 14, 2013, 04:30 AM
I got european pal system for test, after some changes avrciczz start working with pal system also. So here avrciczz v2. Cic still should be tested with Asian and UK/Italy/Australia NES version
http://krikzz.com/pub/support/everdrive-n8/development/avrciczz-v2.zip
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 14, 2013, 04:55 AM
Alternatively, you could also just use any regular salvaged NES lockout chip from a cart of your region but you would need to follow the official NES CIC pinout for that (Can provide info if somebody is planning to go that route).
Please do post that information. I'd like to see it.  :)

Here's a quick pin-out comparison, this should give you all the info you need to hook it up:

http://www.skinnyv.com/img/cicwriring.JPG (http://www.skinnyv.com/img/cicwriring.JPG)
Title: Re: NES CIC CLONE
Post by: JimmyMz on February 16, 2013, 07:18 AM
removed
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 16, 2013, 09:28 PM
You just connect the equivalent pin according to the pinout I gave previously (or found in the ASM file). And yes, the unused pin of the CIC should be ideally tied to ground though I doubt it would be a big deal leaving them floating.
Title: Re: NES CIC CLONE
Post by: JimmyMz on February 17, 2013, 01:29 AM
removed
Title: Re: NES CIC CLONE
Post by: SkinnyV on February 17, 2013, 02:13 AM
No problems!
Title: Re: NES CIC CLONE
Post by: JimmyMz on February 17, 2013, 07:27 AM
removed
Title: Re: NES CIC CLONE
Post by: KRIKzz on February 24, 2013, 06:51 AM
v3 will be released bit later, it will include UK systems support. I kill my testing attiny, so i have atmega16 build only. will release after tests with attiny
Title: Re: NES CIC CLONE
Post by: SkinnyV on April 09, 2013, 02:46 AM
Any idea of when we can expect V3 Krikzz?
Title: Re: NES CIC CLONE
Post by: KRIKzz on April 09, 2013, 05:10 PM
Near to day when NES N8 will be released (End of this moth)
Title: Re: NES CIC CLONE
Post by: JimmyMz on May 12, 2013, 10:20 PM
Near to day when NES N8 will be released (End of this moth)
Krikzz, could you release the new version now please? :)
Title: Re: NES CIC CLONE
Post by: KRIKzz on May 13, 2013, 02:17 AM
It already released. http://krikzz.com/pub/support/index.php?dir=everdrive-n8%2Fdevelopment
Title: Re: NES CIC CLONE
Post by: SkinnyV on June 03, 2016, 10:03 PM
What happened to the avrciczz file? They seem to no longer be available in the development section.

Thanks
Title: Re: NES CIC CLONE
Post by: rimmyjustles on June 10, 2016, 11:30 PM
Near to day when NES N8 will be released (End of this moth)

Hey Krikkz nice job.  Now that' that's done, is there any chance you could implement a simple autoboot to game function?  Automatically load a rom right after "Init..." finishes?
Title: Re: NES CIC CLONE
Post by: Cubatron on September 16, 2016, 01:22 AM
Hi,
just a quick question. Since KRIKzz released files of CIC, is it open software? If I were to make nes carts and needed CIC, then I can use KRIKzz's?

Thanks, and sorry if this sounds stupid, i'm new to this.
Title: Re: NES CIC CLONE
Post by: KRIKzz on September 16, 2016, 04:02 PM
Hi,
just a quick question. Since KRIKzz released files of CIC, is it open software? If I were to make nes carts and needed CIC, then I can use KRIKzz's?

Thanks, and sorry if this sounds stupid, i'm new to this.
Yes, you can use it
Title: Re: NES CIC CLONE
Post by: Cubatron on September 16, 2016, 06:18 PM
And to sell said carts? Should i pay you a share or something?