::bump::

I found a way to get Super Game Boy support up and running in full.

The cheap, easy way: the SNES sets $2181-3 to a screen index where it expects $7800 to read from. It's offset by either $5000+ or $6800+, as the screen is apparently double-buffered. Subtract that, divide by 320 (size of a tile row), and set the read index there.

The hard way: it seems that reads are always linear across the screen, but certain actions cause one to miss four or more tile rows (eg entering the menu, processing certain SGB commands, etc.) When this happens, it doesn't tell the ICD2 chip anything, so I believe the chip also knows that $7800 hasn't been read and four tile rows have passed. Meaning it's probably buffering at most 1,280 bytes. So after reading $7800 again after so much time has passed in the LY counter, jump ahead to the current position.

Looks like $6000 is the GB-level LY counter, too. If you try and simulate the counter via cycle ticks, the video gets desynchronized and starts flickering really badly. Just feed it the real LY counter and you're good.

The Space Invaders arcade mode game sucks, too. Not at all worth the effort :P