3 ms·
Congratulations for this nice project. I wonder, how to write such an emulator? My initial idea would be to write an interpreter for the processor instruction s
by yodsanklai 12y ago
Congratulations for this nice project. I wonder, how to write such an emulator? My initial idea would be to write an interpreter for the processor instruction set with a big array representing the RAM. Then some callback functions are registered via openGL. They are called when there are some inputs (eg. joystick). When this happens, they put something in the simulated memory (some mapped area for I/O or specific registers) and set up some interrupt flags. Does it make sense? then how to simulate accurately the processor (and coprocessors ?) frequency? any other difficulties I haven't seen?
- mattdotc 12y agoI believe you're thinking along the right lines. If you're really curious to learn more, check out this series which I have enjoyed reading: http://imrannazar.com/GameBoy-Emulation-in-JavaScript http://imrannazar.com/GameBoy-Emulation-in-JavaScript