FunkyFlashCart project

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderators: B00daW, Moderators

Post Reply
User avatar
artoh
Posts: 41
Joined: Fri Jul 22, 2005 1:30 pm
Location: Finland

FunkyFlashCart project

Post by artoh » Tue Aug 02, 2005 10:46 pm

Some update on my project...

FunkyFlashCart that includes:

Xilinx XC95144 CPLD chip
512 KB PRG FLASH
32 KB PRG RAM (Battery backed with DS1210)
512 KB CHR FLASH
32 KB CHR RAM

-ROMs and the mapper can be flashed with a simple parallel port JTAG cable.
-Can mimic many mappers, MMC3 & downwards.

--------

My project can now run SMB3.. Also reading ROMs + SRAM to the computer works now, but writing isn't implemented yet, I'll do that next.

The SMB3 title screen.
Image
http://img319.imageshack.us/img319/6407/ffcart22fx.jpg

SMB3 running, the IRQs are a bit off now (by half a scanline).. Or is that normal when NTSC version of SMB3 runs on a PAL NES?
Image
http://img147.imageshack.us/img147/9371/ffcart30co.jpg

Some levels have some glitch blocks, guess the SRAMs are too slow (-70).. The real carts have -10 ones :P.. Also the IRQ glitch is in the middle, it should be in the left.
Image
http://img225.imageshack.us/img225/4363/ffcart43xv.jpg

The Game Genie screen looks like this with my cart... any idea, why?
Image
http://img112.imageshack.us/img112/2720/ffcart16oy.jpg

All the project files will be freely available once it's finished.. More updates coming later...

Jagasian
Posts: 421
Joined: Wed Feb 09, 2005 9:31 am

Post by Jagasian » Wed Aug 03, 2005 7:30 am

Looks good. Are there faster SRAM chips available with the same pins?

User avatar
artoh
Posts: 41
Joined: Fri Jul 22, 2005 1:30 pm
Location: Finland

Post by artoh » Wed Aug 03, 2005 10:06 am

Jagasian wrote:Looks good. Are there faster SRAM chips available with the same pins?
Yes, and the new board will have holes for narrower SRAM chips aswell.

Guest

Post by Guest » Wed Aug 03, 2005 11:48 am

-10 almost certainly means 100 ns, not 10 ns. 10 ns SRAM is still fairly expensive today, let alone 15 years ago.

Dunno why you're getting glitchy blocks though.

tepples
Posts: 22014
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: FunkyFlashCart project

Post by tepples » Wed Aug 03, 2005 11:51 am

Hmm... letterboxed... oh, you're in PAL Finland... Have you tested anything on an NTSC system yet?
The Game Genie screen looks like this with my cart... any idea, why?
Image
http://img112.imageshack.us/img112/2720/ffcart16oy.jpg[/img]
Are you making sure to swap in the correct CHR for the Game Genie menu?

Good job so far.

User avatar
Bregalad
Posts: 7889
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Post by Bregalad » Wed Aug 03, 2005 12:47 pm

Well, I've to admit something, I'm a bit confused. They're currently a lot of different flash card project, and I don't understand that at all. I've heard that was impossible to do because of how NES mappers works and how different they are, and now, I see many different projects. Squeedo was supposed to be a customized flash card only for developpement purposes with its "own mapper". But there I understand really nothing, why is there sudently all theese projects, and how god does this works.
Effectively, 512kb flash PRG and CHR can run all NES/FC games out there (exept pirate cards) and 32kb CHR RAM can do for all games, including Videomation that needs more that just 8kb (this is pretty useless, because this card isn't interessting, but because I've heard that 32kb chips are cheaper than 8kb chips, I aggree with that). But HOW do you programm the flash ? Is an usual EPROM programmer able to do that ? (I'm not much expericance yet about flash roms, but I hope I'll have somday).
And HOW does works the logic behind that to simulate an actual mapper ? And HOW is it possible for the NES unit to be able to read/write on the flash cartidge to any location between CPU $4018-$ffff and PPU $0000-$1fff (and also $2000-$2fff for games with 4-Screen mirroring or using a N106 chip) to be able to simulate the mapper, and tell what bankswitching it has to do when you write something somewhere ?

PS : I liked the background of your pictures, with a PS2 on a DVD player with the right corner on another machine (small PSX ? not sure 'bout that). On the right of the PS2 there is a stack of several DVD/PS2 games with Final Fantasy 10 on the top, next to the FF10 box there is a DVD/CD/Game that isn't in it's box (I hope this is not FF10 because that would be a shame to not tidy it correctly, it'll be covered of dust later, and I personally hate buying used game that aren't in good state), and just on the left of the TV is an yellow FC card (probabily pirate), and a PCB (probabily the one found on a NES/FC game, isn't it ? And we can see a wonderfull opened NES, with a nice cat watching all that stuff. It's right leg is just next to a TV adaptater, but unfortunately I can't see what I would see, i.e. the flash card itself. What a shame.
PPS :That would be cool to organize a "how-do you tidy your games" competition someday.
PPPS : Your pussy is really cool. Mine is a bit similar, but he's grey instead of brown, and also have a white neck and leg-end.
Life is complex: it has both real and imaginary components.

User avatar
artoh
Posts: 41
Joined: Fri Jul 22, 2005 1:30 pm
Location: Finland

Post by artoh » Wed Aug 03, 2005 4:03 pm

Bregalad wrote:They're currently a lot of different flash card project, and I don't understand that at all. I've heard that was impossible to do because of how NES mappers works and how different they are, and now, I see many different projects.
Nothing is impossible ;) .. This project here is for playing commercial games, and it can already run one. The mapper chip can be programmed to be equivalent for almost any mapper. It is big enough to fit a MMC3-equivalent.
Bregalad wrote: But HOW do you programm the flash ? Is an usual EPROM programmer able to do that ? (I'm not much expericance yet about flash roms, but I hope I'll have somday).
An usual EPROM programmer is able to program the flash chips - they are just normal flash chips, but an external programmer is not needed because you can connect the device into your pc with a simple cable and program the chips on the cart - without taking them off at all. This is possible, because the PC can force the CPLD chip into EXTEST mode, and it can control it's inputs/outputs freely. You don't even need to remove the cart from the console (i guess).
Bregalad wrote: And HOW does works the logic behind that to simulate an actual mapper ? And HOW is it possible for the NES unit to be able to read/write on the flash cartidge to any location between CPU $4018-$ffff and PPU $0000-$1fff (and also $2000-$2fff for games with 4-Screen mirroring or using a N106 chip) to be able to simulate the mapper, and tell what bankswitching it has to do when you write something somewhere ?
After the game PRG and CHR ROM files are burned, the mapper for the game board is burned next (NES-TSROM is implemented so far). The NES itself doesn't write on the flash roms at all, but of course it reads them like a regular ROM. The CPLD chip has a total control over the NES memory space, it can map the FLASH and the SRAM to anywhere it's told it to map them.
Bregalad wrote: PS : I liked the background of your pictures, with a PS2 on a DVD player with the right corner on another machine (small PSX ? not sure 'bout that).
That is S-CHI, my famiclone I bought from the philippines.
Bregalad wrote: ... but unfortunately I can't see what I would see, i.e. the flash card itself. What a shame.
I posted the picture of the cart in another topic, but here is the link again:
http://img173.imageshack.us/img173/7741/device5hv.jpg

User avatar
artoh
Posts: 41
Joined: Fri Jul 22, 2005 1:30 pm
Location: Finland

Post by artoh » Wed Aug 03, 2005 4:13 pm

Guest wrote: -10 almost certainly means 100 ns, not 10 ns. 10 ns SRAM is still fairly expensive today, let alone 15 years ago.
Dunno why you're getting glitchy blocks though.
Yep, that's what I thought too..
The glitchy blocks are always in the same places, i'll try to figure it out.
tepples wrote: Hmm... letterboxed... oh, you're in PAL Finland... Have you tested anything on an NTSC system yet?
Nope, not yet, because the only NTSC system I own is my famiclone and I'd need an adapter for it.
tepples wrote: Are you making sure to swap in the correct CHR for the Game Genie menu?
I don't really know how it works.. but it shows the same display with any real game, even when they have different ROMs or a RAM there... But not with my cart. :)

Jagasian
Posts: 421
Joined: Wed Feb 09, 2005 9:31 am

Post by Jagasian » Wed Aug 03, 2005 4:30 pm

artoh wrote:
tepples wrote: Are you making sure to swap in the correct CHR for the Game Genie menu?
I don't really know how it works.. but it shows the same display with any real game, even when they have different ROMs or a RAM there... But not with my cart. :)
I think tepples misunderstood the fact that you are not running the Game Genie from your flash cart, but are running your flash cart through a Game Genie. Is that the misunderstanding? The pics show you plugging your flash cart into a game genie which is then plugged into a NES.

User avatar
artoh
Posts: 41
Joined: Fri Jul 22, 2005 1:30 pm
Location: Finland

Post by artoh » Wed Aug 03, 2005 4:41 pm

Jagasian wrote: [I think tepples misunderstood the fact that you are not running the Game Genie from your flash cart, but are running your flash cart through a Game Genie. Is that the misunderstanding? The pics show you plugging your flash cart into a game genie which is then plugged into a NES.
Oh, right. It doesn't really show in the picture, but the cart has a real game genie attached. So the problem is that the real game genie screen looks bad.

Guest

Post by Guest » Wed Aug 03, 2005 5:40 pm

Does the game genie work in your NES normally? If not, then no worries, it's a known problem with them.

Game Genie uses the NTSC blacker-than-black color (Palette $0D iirc), which can cause all sorts of sync issues on some TVs, since it's below true black, and close to the sync voltage. I don't remember if PAL has the same issue with low voltages, but IIRC it does.

User avatar
Bregalad
Posts: 7889
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Post by Bregalad » Thu Aug 04, 2005 1:13 am

artoh wrote:An usual EPROM programmer is able to program the flash chips - they are just normal flash chips, but an external programmer is not needed because you can connect the device into your pc with a simple cable and program the chips on the cart - without taking them off at all. This is possible, because the PC can force the CPLD chip into EXTEST mode, and it can control it's inputs/outputs freely. You don't even need to remove the cart from the console (i guess).
That's just what I suspected, but it sounds too confortable to me to be sure. How usefull to developp games and immediately test them on the real hardware ! So you just have to implement the good mapper on the card (by the way, is the think you call "PRG-RAM" the SRAM usually mapped at $6000-$7000 ?) and to burn your PRG/CHR and here you are, you can test it.
Maybe this is stupid, but how dou you burn this from a PC ? Does it needs any software ?
It's also easy to burn EEPROM, but it needs to destroy a real card (well, with bad games like Adventure Island or Ghostbusters II, it's no problem, but found a bad SNROM game, huh ?). Also, I don't have an EPROM eraser, so once burned, if I mess up, I have to desolder my eprom and trash them to input something else (stupid, but this didn't happen yet fortunately).
After the game PRG and CHR ROM files are burned, the mapper for the game board is burned next (NES-TSROM is implemented so far). The NES itself doesn't write on the flash roms at all, but of course it reads them like a regular ROM. The CPLD chip has a total control over the NES memory space, it can map the FLASH and the SRAM to anywhere it's told it to map them.
Wow, you're sure a master if you were able to made it working. Do you think it would be possible with MMC5 with all it's particular graphic features like the split mode and the EXGraphix mode (I don't know at all how they work in hardware, but it needs a syncronous scanline counter to send palettes, and switch the CHROM banks very fastly in a scanlie). How about MMC4, scince no american or european card uses it, it would be cool to simulate one ? And does MMC1 work well ?
The only problem I can see, it that the think is controlled by a MMC3 simulator, and not a real MMC3. If some info about the chip is misunderstood (for example the famous reversed mirroring about the MMC1 that caused so much problem), then it can work with emulators because all emulators writers does all the same thing wrong, work with the flash because it has be written to work, and don't work with the real mapper because it's different.
I really should build something like this someday. Did you send the board to some factory to build it ? What's this enourmous capacity ? It that a lockout chip defather or is that needed for the CPLD chip ?
At wich freqency does the CPLD runs ? It that fast enough to be able to swap data send to the PPU fast like MMC5 does ?
Life is complex: it has both real and imaginary components.

User avatar
artoh
Posts: 41
Joined: Fri Jul 22, 2005 1:30 pm
Location: Finland

Post by artoh » Thu Aug 04, 2005 9:30 am

Bregalad wrote: So you just have to implement the good mapper on the card (by the way, is the think you call "PRG-RAM" the SRAM usually mapped at $6000-$7000 ?) and to burn your PRG/CHR and here you are, you can test it.
Yep, that is what I meant. RAM that is in the PRG bus. That is the area for it normally, but if you burn a different file to the mapper chip, it can be mapped anywhere.
Bregalad wrote: Maybe this is stupid, but how dou you burn this from a PC ? Does it needs any software ?
Yep a software made by me, available for free later.
Bregalad wrote: Do you think it would be possible with MMC5 with all it's particular graphic features like the split mode and the EXGraphix mode (I don't know at all how they work in hardware, but it needs a syncronous scanline counter to send palettes, and switch the CHROM banks very fastly in a scanlie). How about MMC4, scince no american or european card uses it, it would be cool to simulate one ? And does MMC1 work well ?
The problem with MMC5 is that it's too complex and it can't fit on the chip.
MMC4 should be possible and MMC1 is not implemented yet.
Bregalad wrote: The only problem I can see, it that the think is controlled by a MMC3 simulator, and not a real MMC3.
That is right.. but the MMC3 is a quite simple device after all, and Kevin Horton has documented it very well. But I still haven't got it quite right, because the only TSROM game working now is SMB3. Silver Surfer and SMB2 of the ones I tried, crash. The problem is I don't have any measuring equipment. Maybe when my school starts after a month, I'll have access to a logic analyzator.
Bregalad wrote: I really should build something like this someday. Did you send the board to some factory to build it ? What's this enourmous capacity ? It that a lockout chip defather or is that needed for the CPLD chip ?
The board is manufactured in a factory, yes.. But all the parts are solderable at home. The big cap is just there because I couldn't find a physically smaller one from my junkbox. Now it has a smaller one.
If you want to build one, you can order a PCB from me (LATER!)
Bregalad wrote: At wich freqency does the CPLD runs ? It that fast enough to be able to swap data send to the PPU fast like MMC5 does ?
The CPLD doesn't run internally on any frequency.. It's just pure logic.. so part of it runs at the PRG bus speed and part of it runs at te CHR bus speed. The MMC3 takes now 118/144 Macrocells (82% of the chip's capacity).


Implemented UNROM board! 22/144 Macrocells (16%)
Example of a schematic. http://ameba.lpt.fi/~hataarto/nes/unrom_example.pdf
Ducktales 2 running perfectly:
ImageImage

User avatar
Bregalad
Posts: 7889
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Post by Bregalad » Thu Aug 04, 2005 12:04 pm

That is right.. but the MMC3 is a quite simple device after all, and Kevin Horton has documented it very well. But I still haven't got it quite right, because the only TSROM game working now is SMB3. Silver Surfer and SMB2 of the ones I tried, crash. The problem is I don't have any measuring equipment. Maybe when my school starts after a month, I'll have access to a logic analyzator.
Ah, okay, it's not finished yet. It may be because of tons of different reasons, so good luck !
The CPLD doesn't run internally on any frequency.. It's just pure logic.. so part of it runs at the PRG bus speed and part of it runs at te CHR bus speed. The MMC3 takes now 118/144 Macrocells (82% of the chip's capacity).
I really don't understand at all how does this CPLD works. I was thinking it was a variant of a PIC like Memblers used on his Squeedo card, but look like it's not. I think you can freely design the logic that's inside, you should design youreself tons of NAND connexions, right ? Do you setup that trough the PC cable, like the flash roms ?

Implemented UNROM board! 22/144 Macrocells (16%)
Example of a schematic. http://ameba.lpt.fi/~hataarto/nes/unrom_example.pdf
I don't understand much that shematic (maybe because I'm more used to european than american shematics). UNROM is basically just a '161 chip used only to "memorize" the bankswitched bank, and a '32 chip to OR the current PRG-A12 with the latched value, so if the CPU reads the high 16k bank, the outpout will all be high so the bank value is $7 anyway.
Also, another pin (I've forget its name) is connected to RPG-/RW so, when writing to it, a new value is taken into the '161 counter's latches (and the chip is never used as it was supposed to be, as a counter, that's pretty fun, there is also some quad-D flip flops in the 74 series, but I think they were more expensive, or had more pins ?)
The only think I understand is the 3 OR gates on the right of the shematic, connected to PRG-A14, A15 and A16 (they're noted R instead, I think because how the flash chips are organized). Also
I also think that the square named LD8 does the '161 job, becuase there is whre the PRG Data input comes, and the G pin is similar that the one I described above, exept that it's NANDed with PRG A15 (hum, can't get why, because PRG-A15 is rather an outpout than an input here).
Life is complex: it has both real and imaginary components.

User avatar
artoh
Posts: 41
Joined: Fri Jul 22, 2005 1:30 pm
Location: Finland

Post by artoh » Thu Aug 04, 2005 12:26 pm

I really don't understand at all how does this CPLD works. I was thinking it was a variant of a PIC like Memblers used on his Squeedo card, but look like it's not. I think you can freely design the logic that's inside, you should design youreself tons of NAND connexions, right ? Do you setup that trough the PC cable, like the flash roms ?
Yep, the CPLD setup is done thru the same cable as the flashing (takes around 30 seconds to program it). Using a PIC gives nice features like fast multiplying, which is uncomfortable to do with that CPLD and might take too much space.. The PIC on the Squeedo cart acts like a super mapper for own use, if I got it right... My thing can just run simple mappers that most of the commercial games have.

Image
Just got Videomation (CPROM board) to work! It bugs on my PAL NES, though (same way as an emulator if set to a PAL mode).

Post Reply