News for hackers. Stuff that matters.
Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by leggomylibro on Wednesday May 23, 2018 @12:05PM (#17135245)
Ditto - I've been wanting to do one on a small ARM Cortex-M core, but it's bewildering to even think about where to start.

It seems like people have put together a lot of good documentation for old systems though, which could at least be a good place to start reading:

https://problemkaputt.de/gbatek.htm

Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by jwhitlark on Wednesday May 23, 2018 @12:09PM (#17135274)
Chip8 is a good one to cut your teeth on. Very simple, good examples, does not take too long, but once you've done it, its much easier to see how more complex ones could work.
Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by pjmlp on Wednesday May 23, 2018 @12:51PM (#17135664)
Try this Assembly tutorial

https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/

It has enough for doing 2D games bare metal on ARM.

And then you can jump into PiFox.

https://www.raspberrypi.org/blog/pifox-bare-metal-arm-assemb...

Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by leggomylibro on Wednesday May 23, 2018 @01:58PM (#17136385)
Well I've already gotten simple 2D games working in bare-metal ARM with OLED and TFT displays, it's more the emulation aspect of things that is intimidating.

ARM Cortex-M cores are also a bit different from the Application-class processors used in boards like the Raspberry Pi. They are closer to an Arduino than a "real computer".

Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by pjmlp on Wednesday May 23, 2018 @02:15PM (#17136544)
Yeah, I guess I misunderstood you.

That is how we did 8 and 16 bit coding on home micros back in the day. :)

My favourite SOC is the ESP32, but I guess it already has too much hardware to emulate and isn't an ARM anyway.

Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by leggomylibro on Wednesday May 23, 2018 @02:30PM (#17136695)
Haha, no worries - embedded stuff sometimes feels so confusing that I think I misunderstand myself most of the time.

Yeah, I've wanted to learn more about the ESP32 - it seems like people have done some really cool stuff with it and it looks like you get a lot of power and connectivity.

But I'll bet you can empathize with not having enough hours in the day!

Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by pjmlp on Wednesday May 23, 2018 @02:40PM (#17136818)
Yup, my github repo is full of useless, unfinished stuff. :)
Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by burfog on Wednesday May 23, 2018 @01:13PM (#17135881)
The upside is that the Raspberry Pi has good documentation.

The downside is that you'll need to emulate 4 cores plus a GPU. Guest software (the stuff being emulated) may fail if the cores aren't decently fast. You may also need to do USB, audio, wireless LAN, and Ethernet.

Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by pjmlp on Wednesday May 23, 2018 @01:50PM (#17136299)
I understood that leggomylibro would like to learn the hardware first, before getting into emulation.

Hence the idea of learning ARM Assembly, I guess I got it wrong.

Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by makapuf on Wednesday May 23, 2018 @03:00PM (#17137068)
I ported a gb emulator on baremetal custom diy arm32 console with 192k of ram and 168mhz. The challenge was that the video signal is generated in realtime, like no framebuffer. http://bitboxconsole.blogspot.fr/2014/01/bitboy-bitbox-emula...
Re:Why did I spend 1.5 months creating a Gameboy emulator? (... by leggomylibro on Thursday May 24, 2018 @05:25PM (#17148561)
Oh, cool! Thanks for that link, the STM32F4 is pretty close to the F0/L0/L4 series that I've been learning about; I was actually thinking of using an L082KZ to start with because it has a lot of Flash, built-in EEPROM, a simple M0+ core, and is easy to hand-solder.

Cool idea using VGA as the output; was that hard, or could you just use the DACs normally? I was looking into parallel LCD interfaces for awhile - some F4 cores have a 24-bit RGB LCD peripheral - but they look complicated and I'm still puttering around with SPI OLED/TFT displays.

Anyways, looks like a really cool project!