Hello! So for the past little while I have been intrigued with assembly, with me only knowing more high level languages like java, and more recently, I took up the challenge of developing a basic game for the NES. Now I do have a few noob questions that I haven't found answers too. First off, if I want to try out my game on the NES, I would need some form of cartridge to put the rom on, now I see the sd ones can be pretty pricey, so I am wondering if there is a design already on GitHub or OSHpark that would allow me to add sockets to both rom chips and the lockout chip (where would I be able to get a reproduction one if I ever wanted to sell my game?) and then use a programmer for them. On that topic, is there any recommended programmer and software for this? And my last question was being, how did games use more than 40kb, and how could I do that? The reason I am wondering, is that I've heard some games had more than 40kb of space and I am genuinely curious on how I could achieve this (or if anyone even has achieved this) for a cartridge instead of an emulator. Many thanks!
I would actually recommend getting one of the pricey cartridges as a noob -- it solves a lot of problems for you. Instead of buying a ROM burner, memory chips, etc, taking forever to erase and rewrite, debugging hardware, etc. you can just put your ROM file directly onto an SD card and not worry about any of that. If you wish to steer toward production, selling cartridges some day, that can be its own project to figure out how to do that easily and cheaply. I would say, spend a little on a fancy SD cart and avoid the hardware aspect for now -- focus more closely on your vision which sounds pretty software-inspired.
Memory limitations are overcome by using memory mappers. This is a special memory "mapper" chip(s) in the cartridge that can swap chunks of memory. Your program can select different sections of memory as needed by writing to some simple registers. As a noob, I would recommend avoiding that at first and use just a small amount of memory. This would be referred to as a "Mapper 0" or "NROM" cartridge. Swapping memory is going to be more advanced and provide more bugs, so it would be good to build a deeper foundation first with NROM and proceed to memory mapping when you know you're ready.
A good EPROM programmer (you definitely don't want the headaches of dealing with a crappy one) can be around the same price as one of the popular NES Flash cartridges (Everdrive or PowerPak), and you also need to buy other things, such as memory chips, sockets, donor cartridges... In the long run, a Flash cartridge may end up being cheaper, not to mention more versatile (due to supporting several mappers) and convenient (works right out of the box).
The only cheap way to get started with making NES cartridges is if you build your own EPROM programmer, which is not a simple task for someone with little experience in electronics.
As for selling your games, one of the options is to look for a publisher. There are several companies online that manufacture cartridges for retro systems using all new parts, so you could show them your game and make a deal with them if they're interested. Another option is to buy the parts yourself and do everything on your own. This might be a good idea if you're planning on releasing very limited runs, otherwise it may be too much for one person to handle (programming, assembling, packaging, handing payments, shipping...).
As for going beyond 40Kb, that's where memory mappers come in. A memory mapper is a chip (or set of chips) inside the cartridge that controls the upper address lines of the memory chips it's connected to. In general, the NES can still only see 40Kb of game data at a time, but with a mapper you can chose which parts of larger memory chips are visible in that 40Kb window. A game doesn't need all of its data available at once, so you can, for example, swap in the music code and data only so you can update the sound registers, then you can swap that out and map something else in. You don't need access to levels you're not playing, so you can activate only the memory bank that contains the data for the level you're in, and so on.
Part of designing an NES game bigger than 40Kb is deciding what data/code you need to be accessible at different times and also when to do the bank swaps, so you can achieve the desired results, taking into consideration the capabilities of the mapper you're using, since different mappers can manage different amounts of memory in chunks of different sizes.
Awesome, thanks for both of your answers! Just to let you know (I should've said this in my original post) I am not new to any form of electrical engineering. I've designed and built pcbs, (even etched them myself) and have worked on many many different projects, ranging from a pcb making printer (it would print toner onto a precut copper board and submerge it in an oscillating tub of etching solution) to an entire cnc machine capable of cutting 4 x 8 sheets of ply (this one was more mechanical, but I wanted to use an open source board that I forked for my purposes). If I decided to go the eeprom way for testing, would there be any recommended open source projects for a programmer (I assume there isn't right now) or even some code for an atmel microcontroller, I remember adafruit selling some form of arduino based chip programmer, maybe I could use that. While we are on the note of eeprom, what are some suggested chips? (other than the lockout, I figured that out). From what you have just read I don't like taking the easy way all the time, it's nice to have a challenge and something that is more physical than digital (reprogramming eeproms/eproms vs clicking in an sd card)
TrendMend wrote:
If I decided to go the eeprom way for testing, would there be any recommended open source projects for a programmer
Back in the days of DOS and parallel ports, making an EPROM programmer was pretty easy, so you can probably find plans for one of those, but things got significantly more complex with modern operating systems and USB ports... I personally am not aware of any DIY EPROM programmer designs for modern computers, but I guess it's possible they exist.
Quote:
While we are on the note of eeprom, what are some suggested chips?
Back when I still programmed my own chips, it was easier to find Flash memory rather than EEPROMs. For small sizes (i.e. 64Kb or less) there are several chips that you can just drop in place of the original mask ROMs that will work fine without any rewiring. I've personally tried the AT29C256 (32Kb Flash) and the W27C512 (64Kb EEPROM). For larger sizes (which always need rewiring) I've only used Flash (e.g. AT29C040).
If you plan on building your boards entirely from scratch, it's best to start with the simple mappers (or no mapper at all), such as UNROM (very common!) or other ones that can be built from off-the-shelf discrete logic chips, as opposed to the ASIC mappers, which are only viable via CPLDs or FPGAs. There are tons of great NES games built on top of discrete logic mappers, and most homebrew games so far work great on those too.
tokumaru wrote:
From what you have just read I don't like taking the easy way all the time, it's nice to have a challenge and something that is more physical than digital (reprogramming eeproms/eproms vs clicking in an sd card)
I understand that and I think a lot of people here feel that way too. But it is very important for new people not to underestimate how difficult it is to make an NES game. This particular hobby is unfortunately very easy for people to form optimism bias and ultimately severe
planning fallacy. It is very meaningful/nostalgic, people spend lots of time dreaming about it, the NES seems so simple, what could go wrong?? All of these factors make people think it will be easier and faster than it really is, get in too deep right away, get overwhelmed, and lose interest. That is the reality that is so important to keep in check. Don't forget -- NES games were made by teams of engineers working together, working weekends, having meetings, disagreeing, starting over, over a period of time... It's all YOU now, it will be possible but HARD, even if it seems so simple right now.
I still really recommend starting small, easy, and have a
focused scope in the short term, wider scope in the long term. Don't start with a finished product, because then you have nothing to do, right? Choose just 1 small part of this project to start with, and leave room to expand later to give a path to have successes and build on those successes. You don't need to be in a hurry with this sort of thing. You can see progress better and feel good at each milestone. Feeling good should always be the goal.
Ben Boldt wrote:
tokumaru wrote:
From what you have just read I don't like taking the easy way all the time, it's nice to have a challenge and something that is more physical than digital (reprogramming eeproms/eproms vs clicking in an sd card)
I did not write that!
Thanks for both of your answers, I totally get the do not start with a finished product thing, one of the only reasons I was talking about the flash chips was because then when I purchased the tools, I wouldn't need to but them again, whereas those flash carts would only be able to be used for my own purposes and not to loan out to friends (once something a little more refined comes out of my currently horrendous blobs of colors)
If you have any experience with microcontrollers, making a programmer that can program one specific kind of flash is an easy task (A couple hours).
Unfortunately, flash really requires that you be able to drive every address line and every data line independently, while older UVEPROMs can just be programmed with the address bus monotonically increasing.
tokumaru wrote:
Ben Boldt wrote:
tokumaru wrote:
From what you have just read I don't like taking the easy way all the time, it's nice to have a challenge and something that is more physical than digital (reprogramming eeproms/eproms vs clicking in an sd card)
I did not write that!
Oopsies! Funny thing is that I actually did think it was you that said that as I was writing the reply too.