Some doccuments mention that the sprite priorities cannot be decided by software, that the sprite that have the smaller X coordinate is always on the top of a sprite with a greater X coordinate.
When playing games on my CGB-001 or AGS-001 it seems to proof that (I haven't investigated SGB yet). But when playing games emulated, it seems the priorities of sprites is different and is decided by software. Also, when there is more than 10 sprites per line they flicker, which should not be possible if the priority system is as mentionned above.
It's quite a mess, but it sounds like a real pain if the software can't control the priorities between sprites on the GB.
I've read this too. I haven't tried to observe it yet. But what emulator are you using when you say it is different? I'm not sure there are many hardware accurate GB or GBC emulators. Gambatte is supposed to be aimed at true hardware accuracy, so you should try that.
I guess not being able to control priority could be annoying but you could live without it when designing your game.
I used VirtualBoy and Lameboy. I will try the emulator you mentionned and see the result.
I might suspect that different types of Gameboys would behave differently. But my Super Gameboy behaves like my GBC and my GBA, X position gives the priority.
EDIT : Yes the emulator that you mentionned emulates the priorities as the real GB hardware. I guess the other emulators are just innacurate (or that the original GB does not behave like the GBC, SGB and GBA, in that case emulators can behave like either). Or it may be an innacuracy introducted on purpose, just like NES emulators that allows more than 8 sprites per scanline.
It's a shame that you can't control sprite priorities on the GB.
the sprite priority issue is really a misfeature of the sprite display engine used on the DMG (older gameboy):
* if two sprites x coordinates are the same on DMG OR CGB, the one with the lower address in OAM will be 'on top'
* if two sprites x coordinates are different on DMG, the one with the x coordinate closer to the ?right? of the screen will be on top, regardless of position in OAM. (When in DMG mode (i.e. when playing a non-color enhanced game), the CGB emulates this behavior)
* if two sprites x coordinates are different on CGB in CGB mode, the one with the lower address in OAM will be 'on top', regardless of x coordinate.
LN
Thanks for clarifying things up.