Emulating the Original Gameboy’s CPU
medium.com
medium.com
The most patience testing element of it is you won't really see any direct results for quite a while, but once you get that Nintendo logo scrolling down the screen, achieved from implementing a lot of the core components (cpu, memory, ppu, screen etc) it's almost like magic and extremely satisfying!
It's also annoying to debug because it's not as obvious as video when something is wrong, especially when you've just spent two hours listening to the same chip tune square waves in a row...
My entrance into the GB scene coincided with my interest in LSDJ, and I really want to write a web app around it[1], but I'm stymied by outdated implementations and my own lack of domain knowledge.
[1] https://github.com/andrewrabon/little-web-dj
^ Still unfinished. My own emulator will probably have to come first.
In the meantime you can try to dig around my code which is not nearly as accurate but (hopefully) should be easier to understand: https://github.com/simias/gaembuoy/blob/master/spu.c
It seems to work fine with all games I've tested, although of course that's only a tiny subset of the console's library...
I've been thinking about making my own tutorial for Gameboy/Gameboy Color emulation over the past few months, I've even finished writing the emulator itself: https://github.com/simias/gaembuoy
I've made sure to rebase all of my fixes to have a single, linear, clean commit history that should be easy to follow. It can play most GB and GBC games. Now I just need to make the actual tutorial, but I want to make videos and I know nothing of video editing so I'm afraid that writing the emulator was actually the easy part.
If somebody has tips for video editing on Linux, I'll gladly take them...
edit: also, video editing is the final process of putting everything together. Which learning style are you going for ? What visuals are you using to support that ? How are you going to assess your audience's progress ?
Pedagogy is a really interesting and rewarding field ! So many ways, so many questions !
I've already tried writing a PlayStation emulation guide: https://github.com/simias/psx-guide (only covers the very basics unfortunately). I found that in order to really get in-depth I had to write big walls of text to explain relatively simple concepts. Being able to talk more casually and expressively over illustrations can be less daunting for somebody looking to get into emulation.
Regarding your edit: I already took a bunch of notes while actually implementing the emulator so I have a fairly clear idea of what my script will look like (i.e. Intro -> CPU instructions -> timings -> basic GPU -> controller input -> sprites -> sync to real time -> etc...). I won't focus on the code too much because it's not a programming tutorial, it's meant to me an emulation tutorial. It would be targeting people who already know how to program but might not be comfortable in the low-level and don't know where to start.
I like to record voiceover in a separate audio track and process it separately in post. From what I can tell, OpenShot doesn’t support videos with multiple audio tracks.
small side rant: your repo name -- not saying you should change it, you are allowed to use any name you want -- is a good example of google always trying to outsmart users and being frustrating.
it keeps auto-replacing my search for me. i mean i know i can quote the search but i tend to bookmark a lot from my phone. and it's easier to search for sites i know exist than having to type long urls. so frustrating sometimes when it tells me i didn't mean what i meant...
If you have an other proposition I'm all ears, I don't really care for the name to be honest. Open an issue if you want.
It provides an interesting basis for student projects to work on, such as machine learning on games, rewinding time and replaying (great for machine learning), adding the sound-subsystem, link-cable, and much, much more.
I'd like to write my own document on emulator development someday, but I need to finish my own first. I'm nearly at the point where I can display a screen, hopefully sometime within the next week.
Those look like Z80 register names. Guess it's a Z80 and the article autor doesn't know that?
Or this one: https://gbdev.gg8.se/wiki/articles/CPU_Comparision_with_Z80
The official name of the CPU is unknown - there's some discussion of that here: https://forums.nesdev.com/viewtopic.php?f=20&t=18335
Getting an implementation of the CPU instructions in a high level language with instruction level accuracy and approximately correct timings is a weekend or two project.
Going for extra components like the graphics or audio support, or higher accuracy in terms of cycle counts and timing can make it a lot longer.