And I finally had some time to work on my emulator.
I fixed some issues with my interrupt code (and I actually forgot to generate the normal vblank interrupt and only did the vblank-STAT one... ) and added timers.
That was enough to get some games running. Then I found a really nasty bug that was actually caused by the reference I was using:
The size of ld (ff00+C),A and ld A,(ff00+C) was stated as 2 bytes, but it is only one byte large.
I found this one by debugging the seemingly different issue of missing sprites in pokemon.
Pokemon does something like this on startup:
This copies a small routine to HRAM which then updates the OAM each vblank via DMA.
jr nz loop
By using the wrong instruction size, the inc c was skipped each time and everything except the ret at the end of the routine was overwritten.
So the emulator unwillingly removed the sprite code from pokemon. That was 'fun' to debug...
Now quite some games I tested run more or less perfect: Mario Land 1/2, Pokemon Red/Blue/Green/Yellow, Kirby's Dream Land 1/2, Harvest Moon, Tetris, Metroid II...
Pokemon Gold/Silver has some weird graphical issues but is otherwise playable. Zelda runs but sections of the map are corrupted and the sprite colors look off.
I looked into adding sound, but I will also consider using Blargg's library for the time being as it looks like quite a big task...