deltabeard / Peanut-GB

A Game Boy (DMG) emulator single header library written in C99. Performance is prioritised over accuracy.
https://projects.deltabeard.com/peanutgb/
283 stars 40 forks source link

core: improve performance by calculating interrupt time in gb_run_frame() #21

Closed deltabeard closed 2 years ago

deltabeard commented 5 years ago

An increase in performance may be realised by calculating the time until an interrupt is expected as shown in https://github.com/gregtour/gameboy/issues/5#issuecomment-120506864 .

gb_step_cpu() may be refactored into separate inlined functions in order to allow gb_run_frame() to wrap the main interpreter in a for loop, whilst keeping the current functionality of gb_step_cpu() for debugging purposes.

Any change in performance should be recorded in BENCHMARK.md, Other optimisations mentioned in the comment above should also be considered.

deltabeard commented 2 years ago

This work is being completed in https://github.com/deltabeard/Peanut-GB/issues/54.