• 0 Posts
  • 11 Comments
Joined 1 year ago
cake
Cake day: July 1st, 2023

help-circle


  • Generally speaking the use case is writing tests. If your tests just call all the dependencies and new directly then it’s harder to write tests for your specific component while avoiding setting up a whole bunch of stuff (to make all those other classes work). By requiring all the dependencies to be provided to the class, you can swap them out at test time for something else that’s easier to work with.

    That said, IMO it’s a symptom of problems in language design. Using DI is only necessary because languages like C# don’t make it easy to mock out new or classes used directly, so we resort to wrapping everything in interfaces and factories to avoid those features and replace them with ones that are easier to mock. If the language was designed such that those features were easy to replace during testing then DI probably wouldn’t be a thing.



  • Lol the funny thing is that this isn’t even close to my longest project :P I have one with a first commit close to 10 years ago (and I of course started it a while before the first commit). It’s my favorite just for how fun the result is. IMO the best projects tend to be ones you actually like to use when you’re done.

    That said I also wouldn’t put too much stock in that 1 year, I think I worked on it a lot for about a month and then moved onto other things after having trouble with it. I came back about a year later and managed to more or less finish it. It’s definitely a long time to devote to a project, but if you stayed focused on it you could do it in a couple months I think.


  • Starting with Gameboy might be a bit daunting but if you’re reasonably comfortable with C then I don’t think it’s too bad. If you’re not too familiar with the hardware side of it then that might be a challenge, but the advantage with the Gameboy is that there’s tons of documentation and tutorials out there which can probably help you work though the details. Really the big thing is to just be ready to do lots of reading XD You need to get a base-level of understanding of the system before you start coding. git says it took me around a year to get it functional and playing most ROMs, but that was with some big breaks in-between.

    Also, that’s a very good question. For performance, it was never an issue. I started it with a focus on keeping the code clean vs. worry about performance and it turned out fine, I’ve run it on a cheap 1.6GHz machine and it didn’t even reach 25% CPU usage, so IMO I wouldn’t worry about it. This also doesn’t vary that much ROM to ROM.

    For the ROMs I tested, for the most part every ROM tended to uncover something new, but the Gameboy has a pretty nice progression of “easy” to “hard” ROMs if you just sort by the MBC type, and also the BIOS is a pretty good test of basic functionality. Additionally there are a few different test suite ROMs out there that are fantastic, they’ll run through every instruction or piece of functionality and check for the correct results, they saved me tons of time.




  • I few years back I wrote a Gameboy emulator in C, it was definitely one of the most fun projects I’ve done. The Gameboy is simple enough that you can make an emulator for it without crazy amounts is effort, and the result is very satisfying. A lot of the simpler systems people recommend writing emulators for aren’t that interesting IMO simply because after you write it the games you can run aren’t that great.