STM32 NES Emulator

Discussion in 'Micro Controllers/FPGAs' started by jefflongo, Feb 22, 2019.

  1. jefflongo Broke BitBuilt Staff Member . .

    Joined:
    Dec 15, 2016
    Messages:
    744
    Likes Received:
    1,008
    Location:
    Ventura, CA
    Portables:
    1
    So I'm taking a microcontrollers class and we need to create a project. Most projects are pretty basic, but my partner and I wanted to go above and beyond. I've always wanted to write an NES emulator, so we decided to write an NES emulator to run on an STM32 microcontroller. We are designing a PCB to house the controller alongside with extra memory, an LCD display, a microSD card slot, and controller ports. In the future, we plan to revise the board to be a full handheld. But 2 months is not enough time for this goal. I need to write a worklog for the class so I figured I'd post my updates here as well.

    I spent a week reading through the abundant MOS6502 documentation and starting writing the CPU emulator in Python as a proof-of-concept. I tested the CPU on a custom .nes file which tests for correctness and after much debugging my emulator is successful for the majority of the tests. I did my best to document every addressing and mode and instruction, making each operation cycle-correct. Tests involving illegal opcodes I didn't worry about since they are only used by a few games and time is limited. After this success, I ported the code to C which will be put on the MCU. The next step will be implementing mappers, finishing and ordering the PCB, and spending more time researching the PPU.

    Feel free to follow the progress on my GitHub as well. https://github.com/jefflongo/STM32-NES
     
    Matthew, StonedEdge, Pinotte and 7 others like this.
  2. Dominatory .

    Joined:
    Jan 22, 2019
    Messages:
    53
    Likes Received:
    11
    this sounds amazballs
     
  3. cheese the tallest memer in town Staff Member . . .

    Joined:
    Mar 2, 2016
    Messages:
    2,468
    Likes Received:
    2,197
    Location:
    Florida
    PPU is gonna be fun :P
    You planning on using the original ports ye? And are you gonna have a menu or just read the first file from the SD?
     
  4. jefflongo Broke BitBuilt Staff Member . .

    Joined:
    Dec 15, 2016
    Messages:
    744
    Likes Received:
    1,008
    Location:
    Ventura, CA
    Portables:
    1
    Yeah I'm going to use the original ports. The plan is for a menu but if we run out of time we will do the latter. ;)
     
    cheese likes this.
  5. jefflongo Broke BitBuilt Staff Member . .

    Joined:
    Dec 15, 2016
    Messages:
    744
    Likes Received:
    1,008
    Location:
    Ventura, CA
    Portables:
    1
    So I haven't updated this thread in awhile but we've made huge progress. We finished the PCB design, ordered, and assembled the board. After a few hours of troubleshooting, we got the MCU to blink an LED, which means the circuit design works. We've also written the 16 bit parallel display driver, and are working on an SD card driver (with some frustration). On the NES side, we've finished the CPU, mapper0 (we will add more mappers later, just need to make a game run), and are working on the PPU. We've got 8 days until our deadline, I'm hoping the next update will be a game running. Here's some pics of the PCB, the assembly, and the finished hardware.
    Screenshot_20190304-071213.png 20190309_161309.jpg 20190312_161455.jpg
     
    Last edited: Mar 12, 2019
    Luca, Matthew, cheese and 3 others like this.

Share This Page

Loading...