3 ms·
I’m surprised an emulator (especially Game Boy) is considered harder than a little operating system. I guess that would make sense if you’re not familiar with
by MBCook 3y ago
I’m surprised an emulator (especially Game Boy) is considered harder than a little operating system.
I guess that would make sense if you’re not familiar with ASM but an OS will force you to learn that too.
- bombcar 3y agoYou can make a surprisingly usable OS with (relative) ease - because you can control all the features you choose to support (or not). An emulator already has a "spec" you have to operate to.
- MBCook 3y agoI guess you could do something ultra-simple (no loadable programs or me port allocation for example) but that doesn’t feel like an OS to me. 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.
- grishka 3y agoA GameBoy emulator has a lot of edge cases to cover. Yes, it's straightforward to get most games running in a playable state, but there are several games (Prehistorik Man) and demos that rely on precise timing of the PPU relative to the CPU and those are notoriously hard to get right. Here's the emulator I made not so long ago: https://github.com/grishka/miscellaneous/tree/master/GBEmulator https://github.com/grishka/miscellaneous/tree/master/GBEmula...
- qingcharles 3y agoHaving checked off most of the list, I would agree the Game Boy emulator is far easier than the OS. 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-Rom/dp/0672306557 https://www.amazon.com/Developing-32-Bit-Operating-System-Cd...
- 59nadir 3y ago> You'd be foolish to write a console emulator and not import someone else's CPU code. Why? It's part of the learning and it's not particularly complex.
- qingcharles 3y agoThat part has been done to death and optimized to hell, that was my main thought. Plus it's a ton of research on the opcodes etc.
- 59nadir 3y agoLet's agree to disagree. Something being done before is hardly relevant when you're using a project to learn. "Optimized to hell" I don't know about; it's a CPU emulator, there isn't that much you should be doing with it anyway. If you're doing accurate emulation speed doesn't seem like your primary factor as long as you're not implementing it in something ridiculous that will involve a GC. 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.
- Xeamek 3y agoWait what? Cpu instructions are literally the easiest part of writing an emulator there is.
- qingcharles 3y agoThat part has been done to death and optimized to hell, that was my main thought. Plus it's a ton of research on the opcodes etc.
- dysoco 3y agoIsn't that most of the point of making an emulator? If you are just gonna focus on the graphics you might as well just make your own game in SDL or whatever.
- cardiffspaceman 3y agoI did a gameboy emulator one week, when I had time from things like waiting for planes to arrive. I set the goal of playing the logo animation and sound. I achieved that goal within the time I allowed, and then I stopped. I have a good background in game development on Z80-based game systems, so what I learned had more to do with the original GameBoy than with how to write a game.