FamiCom CrossFire-an NES with two PPUs

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

Moderator: Moderators

Post Reply
Andy18650
Posts: 43
Joined: Sat Mar 26, 2022 9:58 pm

FamiCom CrossFire-an NES with two PPUs

Post by Andy18650 »

I found this thread on the forum:
viewtopic.php?p=106130#p106130
It seems that the discussion about this topic ceased 9 years ago... But I'm bringing the idea back ;)
My background is in hardware, and I have designed several 8-bit computers. I was excited to learn about this hidden feature of the PPU and decided to do something about it. Here is what I propose:
A computer/console with FC/NES CPU and audio, and two PPUs linked via the EXT pins as graphics.
8KB of internal RAM instead of 2KB.
PPU registers not Mirrored from $2000-$3FFF, instead this area is used as an IO address space (maybe an extension bus can also be added)
Some internal ROM to offer some basic functionality (maybe BASIC itself!) when booted without a cartridge.
A YM2413 OPLL sound chip to enhance the sound capability a little bit.
A 6522 VIA chip to provide some additional IO as well as a timer interrupt.
A 'legacy' mode for FC compatibility (when enabled will hide all enhanced features and load cartridge game like a normal FC/NES, similar to the C64 mode of the Commodore 128)
Optional features include:
SD card interface (via bitbanging)
CF card interface (directly mapped to IO space)
RTC clock
Serial/Parallel port
...
The design is chosen carefully to avoid overpowering the system and placing it against things like the MegaDrive/Genesis or SNES. But it will have some advantage over the SMS such as more 'dynamic' looking graphics (although still slightly worse color), true parallax scrolling, pseudo raster interrupt (using the 6522's timer interrupt, the SMS has a true raster interrupt though...) and better sound (it's essentially APU vs SN76489 as the YM chip is the same). I name the project 'FamiCom CrossFire' since 'Crossfire' is the name by AMD for their technology of hooking two GPUs together, and it plays on the acronym ('FC CF'), plus, it sounds cool.
Another cool feature is the possibility to load a game from SD/CF card and play it, just like on an FPGA implementation or a mini console, or even an emulator, except everything would be run on chips from the 80s!
I believe that I have enough hardware knowledge to make this work, but what I don't have is experience in programming the FC/NES. Since I'm essentially launching a new console here, I need to know what makes one convenient to develop for. I want to gather some feedback from you before solidifying the design as I find this process absolutely vital to the survival of a platform (thinking about the demise of the Atari Jaguar).
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: FamiCom CrossFire-an NES with two PPUs

Post by calima »

Sorry to be negative, but no other such console has survived either. Nobody's bothering with the VT enhanced NESes, or even FDS or the enhanced sprite mode of the AVS. The toy consoles like the one with the crank or the 8-bit bw-screen one, also all dead.
Fiskbit
Posts: 891
Joined: Sat Nov 18, 2017 9:15 pm

Re: FamiCom CrossFire-an NES with two PPUs

Post by Fiskbit »

I find the PPU's EXT pins to be very interesting and I'm excited to see someone looking into making use of them. I think regardless of feedback, you should do here what you want to do and it's going to be a cool project. To some extent, though, I agree with calima that going too heavily in the direction of a fantasy console is probably going to reduce adoption. The way I'd probably approach this is to target a frontloader modded so that the 4 EXT pins are lifted and connected to 4 EXP pins with pulldowns. Then you can put whatever video and audio hardware you want onto an expansion port board, so with the mod and the board, you could have games communicate with the board to pipe in video and audio. Doing this with a traditional cartridge would be challenging because there aren't good interfaces (both fast and simple) for sending data to the expansion port, but if you had a cartridge that could send control signals via EXP pins (new homebrew cartridges or a flash cart like the Everdrive N8 Pro), then you could map the expansion board wherever you want into the CPU address space and things are easy.

While I'm not convinced there'd be a lot of homebrew actually making use of this, I'd expect people to be making graphical upgrades to existing games, along the lines of HD packs people make for Mesen. The additional color depth and/or additional background layer could make for some very pretty improvements, and additional audio options (like with the EPSM that Perkka has been working on) would be interesting, as well. I don't necessarily think there's a lot of value in having more RAM in $0800-1FFF because cartridges can just put however much RAM they want with banking into $6000-7FFF, and things like on-console interrupts and an RTC just don't seem compelling when cartridges can supply these and they push things more in the direction of 'fantasy console'. At least to me, the closer it is to an NES, the more appeal it has. The other fancy stuff can all be in the cartridge if you need it.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: FamiCom CrossFire-an NES with two PPUs

Post by lidnariq »

Andy18650 wrote: Sun Mar 27, 2022 5:25 am PPU registers not Mirrored from $2000-$3FFF, instead this area is used as an IO address space
Design flaws in the CPU+PPU mean there's utility in writing to mirrors. As far as I know, no games use the mirrors, but some demos that push the envelope need to. To fix this, you need to delay the chip select into the PPU so that the data bus is valid before it becomes true
RTC clock
I'm still not sure what RTCs are actually for. The games that I've seen that make use of them seem to just gate content behind arbitrary barriers, either requiring staying up too late (e.g. Animal Crossing), or making you wait for a specific real-world event (e.g. Sword and Sworcery). Either are defeated by changing the clock, and it feels user-hostile.
I need to know what makes one convenient to develop for.
A CPU that's well supported by a modern C compiler and doesn't make operations on types bigger than 8 bits extra work - not the 6502.
A PPU that doesn't require batching updates during vblank - not the 2C02.

You should do this because you want to, not because you'll get buy-in.
calima wrote: Sun Mar 27, 2022 7:47 am The toy consoles like the one with the crank or the 8-bit bw-screen one, also all dead.
The Playdate (still) hasn't even shipped yet.
Andy18650
Posts: 43
Joined: Sat Mar 26, 2022 9:58 pm

Re: FamiCom CrossFire-an NES with two PPUs

Post by Andy18650 »

I'm sorry to make this thread misleading by giving the project a proper name (which I actually seldom do for my homebrew computers!) and talking a lot about commercial stuff and 'launching' the platform. To clear things out, I'm NOT planning to sell this console commercially, at least not for profit. If I want to do it, there are tons of cheaper ways to achieve the same result, such as an FPGA or even just an ARM microcontroller running at 100MHz or so running an emulator. The FCCF is kind of a 'hardware demo'. Just like a software demo is created to show what a platform can do, a 'hardware demo' is created to show what a technology from a certain time can achieve.
lidnariq wrote: Sun Mar 27, 2022 11:01 am You should do this because you want to, not because you'll get buy-in.
I want to make the platform easy to code for not because I want to get buy-in, but in order not to make it a headache for all the awesome people on this forum to write games/demos on. I mentioned the Jaguar just to emphasize that programming difficulty does make a difference. (Many games on the Jaguar just treat the console as a 68000 machine because it is so hard to take the advantage of the dual 32bit RISC processors)
Andy18650
Posts: 43
Joined: Sat Mar 26, 2022 9:58 pm

Re: FamiCom CrossFire-an NES with two PPUs

Post by Andy18650 »

lidnariq wrote: Sun Mar 27, 2022 11:01 am I'm still not sure what RTCs are actually for.
Neither do I! The RTC is, in fact, a remnant of what the FCCF would have been- a 'modern retro' home computer like the commander X16. (Thus the onboard ROM, the BASIC and storage options!) This project was heavily inspired by Mr. David Murry's('The 8-bit Guy') 'dream computer' concept, and the original version even use a 6502 instead of a NES C/APU, resulting in little to no compatibility (some simple games may run using a 'virtual machine' layer that translate register writes, as far as the original plan goes). And since the X16 has an RTC, I decided to add one to make the machine more 'computer like'. In the old plan the RTC is used by the operating system to keep track of the time, display a small digital clock, time-stamp file operations and so on. In the current plan, not so much. (I would still like to see some sort of an operating system on the FCCF though)
lidnariq wrote: Sun Mar 27, 2022 11:01 am Design flaws in the CPU+PPU mean there's utility in writing to mirrors. As far as I know, no games use the mirrors, but some demos that push the envelope need to.
I'm happy to learn that games don't use register mirroring! This will make running games outside of 'legacy mode' easier. (loaded games are likely to run in 'native mode' since the 'OS' may have to do some housekeeping to trick the game into thinking that it is running from ROM. 'Legacy mode' will only work with physical cartridges since it essentially reduces the whole system into a stock FC, but it will work with mapper games. This is the current plan)
lidnariq wrote: Sun Mar 27, 2022 11:01 am To fix this, you need to delay the chip select into the PPU so that the data bus is valid before it becomes true
I consider myself pretty familiar with the quirks of 6502 timing after overhauling the timing circuit on one of my recent projects 3 times (part of that is because I want to connect an AY-3-8910 chip directly to the 6502 data bus without any latching/buffering). However, I cannot really understand what the delay is about. Is it because the CPU and PPU share a clock signal that is not divided by a frequency divider? (So that the internal divided clock of the CPU and PPU may have random phase difference, I remember reading about this somewhere)
Last edited by Andy18650 on Sun Mar 27, 2022 12:39 pm, edited 1 time in total.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: FamiCom CrossFire-an NES with two PPUs

Post by lidnariq »

The PPU - and a bunch of other parts too, but it's especially visible in the PPU - assumes that the data bus is valid the entire time that it's enabled. But the CPU asserts M2 (and the 6502 asserts φ2) before it drives the data bus. This causes a number of interesting and occasionally frustrating glitches. Such as viewtopic.php?t=20892

In other words, φ2 high only means address bus is stable, but PPU designer assumed that during writes it meant the data bus was too.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: FamiCom CrossFire-an NES with two PPUs

Post by calima »

lidnariq wrote: Sun Mar 27, 2022 11:01 am
calima wrote: Sun Mar 27, 2022 7:47 am The toy consoles like the one with the crank or the 8-bit bw-screen one, also all dead.
The Playdate (still) hasn't even shipped yet.
ROFL. Supposed to come out in 2020, now "only" two years delayed, and probably lots more. Well, they're at least claiming it's still coming out, haven't totally given up yet.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: FamiCom CrossFire-an NES with two PPUs

Post by Pokun »

Wrong, FDS will never die and it isn't even a console. It's kind of like calling MMC5 a dead console because we don't have a shitload of MMC5 homebrew.

The AVS is too expensive and niche. I think if an expansion like this would get any real use it would have to be open source so that it can be used with MISTER and other FPGA clones. I doubt it would become a big thing, considering even normal homebrew of popular systems has quite limited communities, but it might get more attention. The Commander X16 have much more leverage to begin with, and I think it has a very good chance to become a successful "fantasy" homecomputer. The MSX3 also has a fair chance (though it's a bit of a different product).


Andy18650 wrote: Sun Mar 27, 2022 5:25 am ......
I kind of like these types of projects. I (and many others here) also sometimes play with the thought of an expanded version of the NES, especially using double PPUs, a little more RAM, RTC and a built-in ROM with BASIC making a homecomputer out of it. Extra sound chips can be added to the cartridge so I think that's a bit less important.
And I don't think most people here have a problem with the 6502 not being that suitable for C or that the PPU must be written to in vblank. That's how many systems of the time works, and we program in assembly anyway.
As for what homebrewers think could make the NES more convenient check out this thread.

I just wonder how you are going to realize it? Are you sourcing the CPU and PPUs from broken consoles or are using some kind of CPLD or FPGA?
Andy18650
Posts: 43
Joined: Sat Mar 26, 2022 9:58 pm

Re: FamiCom CrossFire-an NES with two PPUs

Post by Andy18650 »

lidnariq wrote: Sun Mar 27, 2022 1:19 pm The PPU - and a bunch of other parts too, but it's especially visible in the PPU - assumes that the data bus is valid the entire time that it's enabled. But the CPU asserts M2 (and the 6502 asserts φ2) before it drives the data bus. This causes a number of interesting and occasionally frustrating glitches. Such as viewtopic.php?t=20892

In other words, φ2 high only means address bus is stable, but PPU designer assumed that during writes it meant the data bus was too.
This will actually be an easy fix. Since I'm designing the circuit from the ground up, timing issues can be avoided by adding a few gates. It will be a lot harder to come up with a mod to patch up existing Famicoms.
Also, I read about the mirrored PPUCTRL register can be used as a workaround for the bit 0 race condition. My question is, how many games/demos use this workaround?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: FamiCom CrossFire-an NES with two PPUs

Post by lidnariq »

Andy18650 wrote: Wed Mar 30, 2022 11:29 am This will actually be an easy fix. Since I'm designing the circuit from the ground up, timing issues can be avoided by adding a few gates.
Sure is!
Also, I read about the mirrored PPUCTRL register can be used as a workaround for the bit 0 race condition. My question is, how many games/demos use this workaround?
We only figured out that out four years ago, so I don't think the workaround is too common yet.

There's been a number of esoteric uses of mirrors, but I don't know how common any of them are:

Pino's allpads demo relies on the PPU being mapped at $3F1x to drive open bus behavior for a read on the next cycle from $401x (to precharge the data bus with a chosen value, instead of the default open bus value from the CPU). Bananmos has a demo of doing raster splits in the middle of a scanline (repeatedly, on multiple scanlines) that relies on writing to mirrors to pre-charge the data bus with the right value before a write to $2006 and $2005.
Andy18650
Posts: 43
Joined: Sat Mar 26, 2022 9:58 pm

Re: FamiCom CrossFire-an NES with two PPUs

Post by Andy18650 »

Fiskbit wrote: Sun Mar 27, 2022 8:38 am The way I'd probably approach this is to target a frontloader modded so that the 4 EXT pins are lifted and connected to 4 EXP pins with pulldowns. Then you can put whatever video and audio hardware you want onto an expansion port board, so with the mod and the board, you could have games communicate with the board to pipe in video and audio.
I actually have researched into this idea, and the result is that I don't think it's worth doing. Due to the shape and construction of the DIP package, lifting four out of the 40 pins may do more damage than replacing the whole chip, as you need to bend the pins with a lot of force to get them out. This process may break the pins. I hate to think that people are doing such dangerous mod to their Famicoms for a mod that I propose.
Fiskbit wrote: Sun Mar 27, 2022 8:38 am I don't necessarily think there's a lot of value in having more RAM in $0800-1FFF because cartridges can just put however much RAM they want with banking into $6000-7FFF
The RAM is for BASIC so that the FCCF is not totally unusable without a cartridge. It will also allow the user to tinker with the improved hardware since (at least initially) there won't be a lot of software using it.
Fiskbit wrote: Sun Mar 27, 2022 8:38 am At least to me, the closer it is to an NES, the more appeal it has. The other fancy stuff can all be in the cartridge if you need it.
I ACTUALLY AGREE! I sometimes design (just write a bunch of specs, not actually designing the circuit and without any plan of realizing. You can call it 'fantasy' if you want) some 'strategy remakes' of classical machines. These 'remakes' don't necessarily use old parts or even be compatible with the old machine, but they share the same design philosophy, target consumer group, fit into the same market strategy, etc. For example, using the design strategy of the C64 in 2022 would result in an ARM computer with 2 cores at 0.8~1GHz, Mali400 GPU, 4GB of RAM and a powerful DSP. (Since the C64 use not-so-fast CPU and graphics, with large RAM for its time and spec, and a powerful audio chip) And FCCF is not one of them. It doesn't share the same design philosophy of the Famicom, which is 'The console should be weak in all but the most essential specs (for the time, they were sprits and scrolling. The PPU excels at both) in order to cut prices, but it should also be very expandable so that cartridges can be used to improve the performance significantly'. And following that philosophy I get -a Famicom with the EXT pins of the PPU connected directly to four extra pins of the cartridge port! THAT'S IT! (OK maybe add a few pulldown resistors and the sync/reset pin of the PPU) In fact, I don't know why Nintendo didn't do that as I think it would be the most Nintendo thing they can do! It will increase the expandability of the Famicom dramatically will keeping the cost of the base system virtually unchanged.
On the other hand, I finally landed at the concept of a strong base unit that can have good performance without any cartridge. Partly because I design it also to be a computer, but also because having a wider cartridge connector will instantly void any compatibility with existing cartridges as they won't physically fit.
Fiskbit wrote: Sun Mar 27, 2022 8:38 am and they push things more in the direction of 'fantasy console'.
I'm very sorry, that the FCCF is very much a 'fantasy console', although it is technically closer to a 'fantasy home computer'.
Andy18650
Posts: 43
Joined: Sat Mar 26, 2022 9:58 pm

Re: FamiCom CrossFire-an NES with two PPUs

Post by Andy18650 »

Pokun wrote: Mon Mar 28, 2022 12:00 pm I just wonder how you are going to realize it? Are you sourcing the CPU and PPUs from broken consoles or are using some kind of CPLD or FPGA?
Haha, that's no problem for me ;) I live in China and we have a excessive amount of PPUs here (most of them are clones though). The legitimacy of these clone chips are... questionable, but I doubt that Nintendo or Ricoh will sue some random guy for using clone chips that are almost 40 years old! In fact e also have a company named 'Subor' here, who has been manufacturing Famiclones TO THIS VERY DAY. But they have abandoned DIP chips for a single epoxy blob since the 90s, so their products can't be used for chip sources.
Pokun wrote: Mon Mar 28, 2022 12:00 pm As for what homebrewers think could make the NES more convenient check out this thread.
This is fantastic! I'll definitely look into it.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: FamiCom CrossFire-an NES with two PPUs

Post by Pokun »

Oh clone chips, that's very good to hear. No need for donated parts and very good use of such chips (I also agree with you that modding existing Famicoms with not so easily reversible and easy to break mods like lifting PPU pins isn't a very good idea). I don't think it's too much of a problem that the clone chips aren't fully identical to the original chips since you are building a new system that isn't fully compatible anyway. I don't know if clone PPUs have the video superimpose thing though, so you might have to make that sure first.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: FamiCom CrossFire-an NES with two PPUs

Post by lidnariq »

... By the way, if you'd like to take pictures of discrete famiclone CPUs/PPUs for us to put on the wiki that'd be very helpful:
nesdevwiki:Known PPU revisions
Post Reply