Thursday, January 19, 2017

NESDev - End of Semester Sprint (Pt. 2)

I just wrapped up my last blog post, which covered some programming concepts for the game.  As I had little time, I had to eventually settle on a stopping point and move on to the hardware implementation of this project, lest I risk getting a low grade.

Cartridge Overview


There are a few ways I could have approached the porting process.  The one I chose is a fairly common practice among developers, in which they purchase a "donor cartridge" and use an EPROM programmer to write their own code onto chips.  The original ROM chips would be desoldered and replaced with the new EPROMS/EEPROMS that the developers have programmed.

The other method is to simply write to new boards altogether.  Some creative individuals have managed to create their own tools and reproduction circuit boards for those who home-brew their own NES games.  I plan on testing this method in the future, purchasing boards and proprietary programmers manufactured by Infinite NES Lives.

The majority of the instructions I followed were provided by The Poor Student Hobbyist.  He provides incredible detailed and easy-to-follow guides for the porting process.

Mappers and Donors


I did not conduct extensive research into the various mappers that can be used for NES games, but I figured that with how small my game currently stands, I could certainly get by with the standard NROM mapper, which was used on classic titles like Bomberman, Mario Bros., and Ice Climbers.  There are many dedicated users who have created full databases of cartridges and mappers, which makes the process of finding a suitable donor much simpler.  After a little research, I visited my local video game retail store and purchased used copies of Baseball and Tennis as my donors.  

After purchasing my donors, I took them to the laboratory to try to desolder them.  I attempted to take apart Baseball first, with little success...

Thank God I bought that second donor cart.

Programming the New Chips


As I learned the hard way, you cannot re-program the CHR and PRG chips that are already in your donor cartridge.  Turns out they are called Read Only Memory chips for a reason.  Once I had got this fact through my thick skull, I went to a local electronics store and picked up a few M27C512 EPROM chips, 1 to hold the PRG data and 1 for the CHR data.  This chip is much bigger than I needed, but I figured I could spare the funds to ensure I had a lot of space to work with.

Now, I kind of lucked out in regards to programming equipment.  The campus had a Chipmaster 6000 hidden away that was used as a universal programmer for EPROM and EEPROM chips.  You can see a few more details on this device on my previous post regarding my hardware setup.

The programmer.

Using the software for this programmer is fairly straight-forward.  In short, you check to ensure that the chip is empty (if not, you need to erase it using UV light), choose the local file that you wish to write to the chip, and burn it.  The software (as well as the indicator lights on the Chipmaster itself) will let you know whether or not there was any issue writing your chosen file to the chip.

Upon reviewing the instructions from the Poor Student Hobbyist, he talks about using the ReadNES3 program to split a ROM file into the PRG and CHR files that will be placed onto each chip.  I was unsure if I would have issues if I instead simply tried to burn the files I had already prepared onto the chips, but being that I was short on time, I went ahead and compiled those files into a ROM, and used ReadNES3 to separate them again.  I even went ahead and doubled the sizes of the separated CHR and PRG files, to ensure they took up the majority of the space on the EPROM chips.

Once all of these steps were said and done, it was time to try programming the chips.  To my amazement (and skepticism), the programmer completed each task without any errors on the first pass.


To ensure that this had worked, I needed to now solder the chips onto the donor board.  To ensure that there would be no damage done to the data, it is recommended that the window on the EPROM is covered with electrical tape, as this window's exposure to UV light sources would essentially erase any data on the chip.




And for the moment of truth...


It works!

Conclusion

The fact that I tried to cram so much information into these last two posts should demonstrate just how much time and effort goes into home-brew games.  I can't help but look at games like Battle Kid and be impressed by the developer.  Truthfully, this was a fascinating experience, and I'm glad that I was able to use it as my senior project before graduation.

I had originally attempted this project due to my life-long love of video games;  I wanted to find a way to combine that passion with the field I had chosen to pursue in school.  What I ended up with, however, is a new hobby.  There is still a lot that I don't fully understand, but with graduation around the bend, I want to continue learning until I can build the game that I am proud of.  This blog was originally intended to share my learning experience, and I am to continue to do just that.

-JWest

No comments:

Post a Comment