pinobatch / pently

Scalable music engine for NES games
zlib License
72 stars 4 forks source link

Add a benchmark framework #5

Closed pinobatch closed 6 years ago

pinobatch commented 8 years ago

The NES allows 29,780 CPU cycles per frame, shared among input, game, simulation, graphics, and audio code. A game architect considering integrating Pently would want to know how many cycles it uses for typical music. So it needs a test case running the NSF in a 6502 simulator capable of logging how many cycles each frame takes, and then post-processing the log to show average, 99th percentile, and maximum times.

Qix- commented 8 years ago

Which emulators out there currently support profiling and benchmarking?

pinobatch commented 8 years ago

It doesn't have to be a full NES emulator. It can be just a 6502 simulator with the most basic of I/O, perhaps fake6502 or another on 6502.org's list, and still work. Memblers wrote a basic NSF benchmark tool; perhaps we could build on that.

pinobatch commented 6 years ago

Another angle is to let Pently's NES demo profile it, using a similar technique to the overclock test in the NES port of the 240p Test Suite.

It would involve placing sprite 0 at such a position that a known number of cycles elapse between sprite 0 off and sprite 0 on. There are two such numbers: one for PAL NES (which transposes everything up a semitone) and another for NTSC and Dendy (which does not).