I guess that would make sense if you’re not familiar with ASM but an OS will force you to learn that too.
I guess that would make sense if you’re not familiar with ASM but an OS will force you to learn that too.
An emulator already has a "spec" you have to operate to.
You can sort of do that with an emulator too. For example on the GB you could do just the CPU/memory at first, skipping some rare/tough/quirky ones. Graphics aren’t that bad, you can avoid emulating some bugs/ultra-tight timing. Controls are quite easy.
Honestly none of it is that tough as long as you’ve skip sound. Sound is the worst part, and what’s next on my plan for my Swift based emulator.
Of course if you wanted to keep going you could add on color Game Boy support, Game Boy advanced support, cheat codes, save states, stuff like that.
It’s turned in to a pretty great little project.
Here's the emulator I made not so long ago: https://github.com/grishka/miscellaneous/tree/master/GBEmula...
I guess with the emulator it depends how much you want to do. You'd be foolish to write a console emulator and not import someone else's CPU code. When I wrote a Game Gear emulator 26 years ago I used off-the-shelf CPU code and just mapped all the in/out and did the graphics bits. Took me and a friend a single evening to get it happily playing games.
And OS is harder. Well, it was last time I wrote one, again about 26 or 27 years ago. Getting something to boot at all was tricky. I used this book as my main source of inspiration:
https://www.amazon.com/Developing-32-Bit-Operating-System-Cd...
Why? It's part of the learning and it's not particularly complex.
Also, I don't get the point about research: It's a learning project... Doing research and learning is the actual point. Sure, maybe you slice off one part right now if you're not interested in learning how the CPU works, but to say that you'd be foolish to not use someone else's implementation seems to me to be missing the point by quite a margin.
Cpu instructions are literally the easiest part of writing an emulator there is.