This section will explain the basic setup of our little project. A lot of other sections will use directories and files in relation to this setup.
All required sources and files for a build of hardware and software of the SD2SNES are available from either the official SD2SNES repository or my repository found HERE. Currently, the Rev. K. files are only available on my repository. They are stored in an extra branch called devaltron/RevKWork.
This will create and populate the git repository in your home directory.
cic/         Source and compiled files for the CIC chip. We need this later!
gfx/         Some image files, not relevant to us for now.
pcb/         PCB construction data. We'll need this very soon!
snes/        This is the code for the SNES menu, which is SNES assembler.
src/         Source files, contains a lot of code used to program the Microcontroller.
utils/       Some small utilities used in the other code.
verilog/     Source code for the FPGA configurations.
pcb/: There is a lot of crud in this directory. You can ignore everything except pcb/kicad/RevK for now, which is the directory that contains the Revision of the PCB schematics that we’re interested in. We can load the project file in this directory in KiCAD to get all the information we need to build our PCB. More on this later.
src/: This directory contains the actual firmware source code as well as the source code for the bootloader, both written in C. The bootloader is the most critical component in this directory, as the firmware can be downloaded pre- built. The src/bootldr directory also comes with Makefiles that will flash it onto the Microcontroller. The actual firmware will then be loaded from the SDCard, so it’s required at a much later step in the process compared to the bootloader. Flashing the Bootloader is akin to breathing life into the SD2SNES, as after this step is successful, most work can be done by changing files on the SDCard.
verilog/: These are the FPGA configurations written in Verilog. This is what gives the FPGA on the board the capability to act as different chips. They are loaded by the firmware onto the FPGA from the SDCard. (They are stored in the sd2snes directory on the card). They can be downloaded pre-built, but we’ll go into the process of building these from scratch in a dedicated section.
snes/: This is the SD2SNES user interface. Loosely speaking, this is a Super Nintendo ROM file, the only difference being that it’s loaded on startup by the firmware, and the firmware has ways to communicate with the ROM file while running. There is a dedicated section on building the user interface, but the user interface can also be downloaded pre- built.