Liber VII · Capitulum XI

Performance and hardware

How many MIPS each mode asks for and what is left to measure on a real cartridge.

How it is measured

Stella emulates a Cortex-M0 that executes one instruction per cycle, and its option -dev.arm.mips sets how many million instructions per second the ARM gets. Below the worst gap of the kernel the image stops being reliable; below the worst overblank, the frames grow by a few lines. A project tool plays the whole game at several speeds and counts the lines of each frame.

Measured in StellaMIPS
STRIP, STRIP+ and DOUBLE at 60 frames per second39
FULL at 60 frames per second43
Worst gap in the kernel (the FULL checkerboard)43
The whole room in milestone 4, before optimising111

NTSC, PAL 60 and PAL 50

In NTSC and PAL 60 the frame has 262 lines; in PAL 50, 312, with 25 more lines at the top and bottom (each with its sound sample). The logic and the music run at their original 50 Hz rate: in PAL 50 they advance on every frame, and at 60 Hz the music takes five steps every six frames, each at its instant within the frame, and the logic one tick every 7.2 frames while someone is speaking, or one every 6.9 on average, as soon as the previous one has been drawn, when nobody is. The console cannot know whether it is in NTSC or PAL; the cartridge can say so, and if not, it is chosen in the menu. The colours are translated with the loader's table, measured in Stella. In PAL 50 the interlaced modes are seen at 25 Hz per field, with more flicker.

What is left to measure

Stella counts instructions, not cycles: a real M0+ takes 2 cycles for each load and 2 or 3 for each taken branch, and the flash of the Chameleon Cart by Zackary Scolaro (ZackAttack) at 64 MHz needs 2 wait states. Its 64 MHz are in the order of 30 to 40 Stella MIPS, depending on how much code runs from RAM: the margin is narrow and has to be measured on the cartridge. That is why the kernel goes in RAM, and so does the AI's path search: from flash, Adso's tick when following someone from one room to another reached 65 MHz in the M0+ cycle model and stretched the frame; in RAM, the worst overblank stays at 60 MHz. On the Chameleon the game already runs in DOUBLE and STRIP; the modes with bus stuffing wait for its new firmware. On the PlusCart by Wolfgang Stubig (Al_Nafuur), with a faster ARM, the game already runs from firmware 2.3.32 on.