Live data from Hacker News

Show HN: Simple Gameboy Emulator

github.com

21–24 of 24 posts

Re: Show HN: Simple Gameboy Emulator

#22
post #19
post #15

Nice. 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.

That hasn't ever been my experience. I love talking about code I've written, details of how it works, and so on. It has never gotten me out of coding tests.

Re: Show HN: Simple Gameboy Emulator

#23
post #5
post #2

I 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 :)

For reference, I got it running on my Linux system with the following changes:

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

#24

Earlier 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…

C macros would just take the place of your python script. It's literally the exact same idea.
Post reply on HN