Karnov MD: too many fish
Karnov has had less of my time than Tiger Road lately. The continue screen now asks you to PRESS START BUTTON TO CONTINUE, and A, B or C speed up the countdown. On a real console, dots appeared whenever colours changed, because they were written while the picture was being drawn. Now they're written only during the vertical blank. Most of the work, though, has been about slowdown and flicker.
On the arcade board the game has the 68000 to itself. On the Mega Drive it shares it with my glue code, which converts sprites, colours and background every frame. At the end of October a fixed test run lost 283 frames out of 1,800. The game was clearing its sprite list one long word at a time and loading each of its 40 objects before checking whether it was active. With a handful of those routines rewritten in assembly, and 16×32 sprites drawn as one Mega Drive sprite instead of two, the same run loses around 15.
The Mega Drive has four palettes of 16 colours, and the first stage alone uses five for the background and eight for sprites. A fixed plan per stage left some sprites in the wrong colours, so I tried sharing the colours out on the fly. Lost frames went from 8 to 25, and enemies could change colour on screen. An enemy can look different from the arcade, but it can't change in front of you. Now each enemy palette has a fixed place per stage, and their tiles are stored in the ROM already converted, which brought it back to 11 lost frames. For a while the enemies came out full of holes, because the DMA buffer sat at an odd address and everything arrived shifted by one byte.
The underwater stage is the worst. Schools of fish put up to 15 objects on screen. With 15 active the Mega Drive loses 28% of the frames, and with 13 or fewer, about 1%. Half of that time goes to my sprite code and half to the game, mostly checking every enemy against Karnov's fireballs. Unrolling that check took the stage from about 90 lost frames to 70 out of 3,559.
Sprites per line are another problem. In this mode the Mega Drive draws 64 sprites at most, and 16 per line. In stages 6 to 9 the arcade goes over 64 in 6 to 9% of the frames, up to 87 in the ninth, and over 16 per line about as often. What doesn't fit isn't drawn.
The difficulty setting doesn't help: in the arcade it changes how tough and aggressive enemies are, not how many appear. It will probably go like Tiger Road, where one kite man at a time took dropped frames in level 3 from almost 29% to around 3%. Fewer fish at once in the fifth stage, then a look at the later stages to see whether the missing sprites are noticeable.