6 ms·
Show HN: Running Game Boy ROMs on the STM32 ARM Cortex Microcontroller
Got Tetris running on a 26€ STM32F429 Discovery board emulating the Game Boy CPU and graphics on the ARM Cortex M4. Really fun project to hack together, need to try the original Game Boy Pokemon (red/blue) games next.
- Beretta_Vexee 2y agoA DMCA take down from Nintendo should reach you before your morning coffee. /s https://news.ycombinator.com/item?id=41762397 https://news.ycombinator.com/item?id=41762397
- deleted 2y ago[deleted]
- dvh 2y agoHow does F429 speed compares to F103 on real world loads?
- not_a_dane 2y agoDoes anyone have insights on how to license ARM chips after a hobby project reaches maturity?
- scottapotamas 2y agoYou just buy the microcontrollers and put them on your custom PCB. The devkits aren’t suitable for resale but there’s no additional licence when you buy an ARM micro from pretty much any manufacturer.
- jamesmunns 2y agoYou don't generally need to license Arm chips unless you are designing your own chips for sale, like STM32 or Raspberry Pi do. This is something very few companies do, relative to those who just build things from existing chips. If you're just building something with an existing Arm microcontrollers. The vendor (Like STMicro) has already licensed the Arm design and sold it to you.
- anthk 2y agoPublic domain Tetris ROM to try it: https://github.com/tbsp/Adjustris https://github.com/tbsp/Adjustris https://github.com/tbsp/Adjustris/releases https://github.com/tbsp/Adjustris/releases Another one, a platform game, GPLv3 licensed: https://github.com/mholtkamp/carazu https://github.com/mholtkamp/carazu https://github.com/mholtkamp/carazu/releases https://github.com/mholtkamp/carazu/releases You need this to compile both ROMs: https://github.com/gbdev/rgbds https://github.com/gbdev/rgbds
- janosch9001 2y agoThanks, great!
- Tepix 2y agoDoes it only run on the STM32F4 or also some other STM32 CPUs? Looking at https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html https://www.st.com/en/microcontrollers-microprocessors/stm32... how many coremarcs do you think are required for emulation?
- deleted 2y ago[deleted]
- quruquru 2y agoNeat! I also did something very similar when I discovered PeanutGB( https://github.com/deltabeard/Peanut-GB https://github.com/deltabeard/Peanut-GB ) for an university project. I used an STM32F401 (the "blackpill" board). Shoved it into a gameboy case I got from aliexpress and connected an ILI9341 display, a PCB for the buttons I found online from some hobbist selling them and 4 AA batteries in series. The screen wasn't really the same as the gameboy's one in dimensions so it all looked very janky, but it was cool enough to impress people. I had no audio, I was able to play simple GB games quite well but I had some significant slowdowns with stuff like Super Mario Land 2 or the later pokemon. I had 3 big problems: - First, I didn't use DMA at all. That's because I picked a display controller with 8 data GPIOs because at the time I thought "8 lines vs 1? its gonna be faster right?". Dumb me, I didn't consider that DMA existed... - Second, I wanted to scale the image to fit the entire screen. I couldn't fit the scaled framebuffer in memory though, so I had to keep the original size but send each pixel to the screen 4 times - Last, I read games from an SD-card. I had a tiny in-memory cache for recently read data blocks, but you could see when I got a cache miss. It wasn't often though so it wasn't bad at all. I agree, it was an incredibly fun project
- janosch9001 2y agoNice, and yeah, Peanut-GB does the heavy lifting. Would be also interesting to connect directly to original cartridges.
- unwind 2y agoI'm sure you know this, and perhaps it's way too late, but still: the STM32s can certainly use DMA to write to GPIO pins. See for instance [1] (not my project, just a random search hit that seemed nice). [1]: https://github.com/mnemocron/STM32_PatternDriver https://github.com/mnemocron/STM32_PatternDriver