fengb / fundude

Gameboy emulator: Zig -> wasm
https://fengb.github.io/fundude/
MIT License
181 stars 8 forks source link

CPU decode #42

Closed fengb closed 4 years ago

fengb commented 4 years ago

closes https://github.com/fengb/fundude/issues/27

Interesting enough, this naive implementation is ~30% more space efficient and yields ~10% faster CPU. I can't explain the former, but the latter is possibly due to better register allocation for Op.decode and Op.step (2 bytes each), as opposed to 16 bytes.

fengb commented 4 years ago

Function pointers are ~20% slower. So let's keep this dispatch table.