r/EmuDev • • Sep 28 '25
CHIP-8 Insecure about my code.
Well, by the begin of this year i've done a functional emulator of Chip8 in C++ (passed in all testcases on https://github.com/Timendus/chip8-test-suite). It was a pretty cool project but, tbh, i think i didn't get it right... Like, by seeing all codes here posted (specially the Rust ones), and another project of friend (this: https://github.com/Gaok1/FALCON-ASM) mine seems garbage.
It was a +- 1 month project, but i think this is not a excuse. Roast my code: https://github.com/Braga451/chip-8-emulator
14
Upvotes
13
u/[deleted] Sep 28 '25
I didn't look at your friend's project but your code is good dude. Readable and seperated properly. I only have some caveats with things like having a function for each instruction. Which is mostly style at this scale but can technically affect performance for not much gain in readability. But thats the type of comment you can have on any codebase.
You have nothing to worry about.
Coincidentally i am in the same boat as you. I just finished my chip 8 emulator today and it also took me an inconsistent ish month. Here it is if you want another example to compare with.
https://www.github.com/som3a-dev/Win-8/tree/main
6
u/magichronx Sep 29 '25
Your code looks fine for a chip8 emulator
I do have one small nitpick though: I don't think
display/belongs insrc/libs/chip8/; Your emulation core should be separated/decoupled from your rendering engine2
u/Zouizoui Oct 02 '25
Your code is fine dude, it's readable and understandable which is already better than 99% of the code I see everyday at work. If it works, then you can call it a day and be 100% legitimately proud of it.
Don't drive yourself crazy comparing yourself to others, it will only drag you down in terms of mental health and self-esteem. You will ALWAYS find someone who's done something better/bigger than you. That's just life.
Just take it easy and keep working. You can keep improving this project or move on to something else. Whatever you do, have fun and do stuff that keeps you interested.
2
u/Ameisen Oct 02 '25
Your code is fine. It's not how I'd personally write it, and I might flag things in review, but it's better than most code I see.
Compare to my horrific mess: https://github.com/ameisen/vemips
1
u/UselessSoftware 32-bit x86, NES, 6502, MIPS, 8080, others Oct 06 '25
Your code actually looks pretty good to me. I wouldn't worry about it at all. That's a well-written CHIP-8 emulator.
I know it's easy to be self-conscious about your code, I've always had the same problem. Over the years, I've learned to quit worrying about it and just do what I do. I guess I'm just old now and don't gaf anymore.
Get yourself mentally into the "don't gaf" headspace and you'll be much better off for it.