Show HN: Simple Gameboy Emulator
21–24 of 24 posts
Re: Show HN: Simple Gameboy Emulator
#22Nice. Please share if this or any other of your repos help(ed) with finding new gigs/clients.
I assure you having even a few hobby projects to show to potential employers is always beneficial. When you can talk about actual code you've written, often you don't even have to do any tests and the usual questions about the basics are skipped completely.
Re: Show HN: Simple Gameboy Emulator
#23I know nothing about emulators, so it would be nice if the README provided instructions for how to build and run the emulator. Here is some inspiration: https://github.com/dolphin-emu/dolphin
You're right, I should've included that from the get-go. Included one now, hope it helps :)
Change LDFLAGS: LDFLAGS=`pkg-config sdl2 --libs --cflags` -g -lm
In interrupt.c, change the two #import lines to #include.
Re: Show HN: Simple Gameboy Emulator
#24Earlier quoted context omitted.
They're using a relatively simple opcode map, but most instructions are logically redundant as can be seen here: http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html The next step in emudev, with most compiled/systems languages at least, would be to create macros (such as OP_LD or OP_ADD) that generates static instructions at compilation. Another, cleanish method, in C is to generate a 256-length function point…
For Z80 emulation the most efficient method I found was indeed a big nested switch-case statement. Compilers turn this into a jump table (or several if there are gaps), but don't need the function entry/exit boilerplate if each instruction code block would be its own C function referenced through a function-pointer-table. The switch-case code is generated with a python script which uses the 'algorithmic decoding appr…