Studying how GeoLith emulates the NeoGeo's rendering of an individual scanline...
Within the visible portion it looks up a backdrop colour & the relevant portions of the frame & sprite buffers, iterates over a line of that framebuffer looking up the colours in the palette falling back to that background colour whilst zeroing out the sprite buffer, zeroes some variables before iterating over & rendering the sprite table 2 lines in advance, & invokes a pre-chosen callback.
1/3?