It is currently Thu Oct 19, 2017 4:00 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Sprite priorities
PostPosted: Fri Jan 16, 2009 11:20 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7230
Location: Chexbres, VD, Switzerland
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.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2009 11:50 am 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2800
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2009 12:35 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7230
Location: Chexbres, VD, Switzerland
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.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 20, 2009 1:34 pm 
Offline

Joined: Wed Apr 05, 2006 10:12 am
Posts: 126
Location: PA, USA
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

_________________
"When life gives you zombies... *CHA-CHIK!* ...you make zombie-ade!"


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 20, 2009 2:52 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7230
Location: Chexbres, VD, Switzerland
Thanks for clarifying things up.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group