<p>I'm trying to alpha blend sprites and backgrounds with <a href="http://www.devkitpro.org/" rel="noreferrer">devkitPro</a> (including libnds, libarm, etc).</p>

<p>Does anyone know how to do this?</p>

[{'answer_id': 7938, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>It\'s been a <i>long</i> time since I\'ve done any GBA programming, but as I recall, the DS supports most (if not all) of the stuff that GBA supports. <a href="http://www.coranac.com/tonc/text/gfx.htm" rel="nofollow noreferrer">This</a> link has a section on how to do alpha blending for GBA (section 13.2). I don\'t know if there\'s a DS-specific way of doing it, but this should work for you.</p>\n'}, {'answer_id': 10527, 'author': 'Cristián Romo', 'author_id': 1256, 'author_profile': 'https://Stackoverflow.com/users/1256', 'pm_score': 2, 'selected': False, 'text': '<p>Sprites on the DS can be alpha blended using the <a href="http://www.coranac.com/tonc/text/gfx.htm#sec-blend" rel="nofollow noreferrer">blend control registers</a>.  TONC gives the necessary information for getting blending working on the main screen because the register locations are the same.  Alpha blending on the subscreen uses the same process with different registers at a 1000h offset.</p>\n\n<p>The registers you\'ll be looking at are <code>REG_BLDMOD</code>, <code>REG_COLV</code>, and <code>REG_COLY</code> for the main screen and <code>REG_BLDMOD_SUB</code>, <code>REG_COLV_SUB</code>, and <code>REG_COLY_SUB</code> for the sub screen.</p>\n\n<p>Also remember that you\'ll have to <a href="http://www.coranac.com/tonc/text/regobj.htm#sec-oam-entry" rel="nofollow noreferrer">change the sprite\'s graphic mode</a> to enable blending per sprite.</p>\n'}, {'answer_id': 119880, 'author': 'PypeBros', 'author_id': 15304, 'author_profile': 'https://Stackoverflow.com/users/15304', 'pm_score': 4, 'selected': True, 'text': '<p>As a generic reference, i once wrote <a href="http://sylvainhb.blogspot.com/2006/09/alpha-blending.html" rel="nofollow noreferrer">a small blog entry</a> about that issue. Basically, you first have to define which layer is alpha-blended against which other layer(s). Afaik,</p>\n\n<ul>\n<li>the source layer(s) must be over destination layer(s) to have some blending displayed. that means the priority of source layers should be numerically lower than the the priority of destination layers.</li>\n<li>the source layer is what is going to be translucent, the destination(s) is what is going to be seen through (and yes, i find this rather confusing).</li>\n</ul>\n\n<p>For the <a href="http://sylvainhb.blogspot.com/2011/09/oam-alpha.html" rel="nofollow noreferrer">sprites, specifically</a>, you then have 3 ways to achieve alpha-blending depending on what you need and what you\'re "ready to pay" for it:</p>\n\n<ul>\n<li>You can make all the sprites have some alpha-blending by turning on <code>BLEND_SRC_SPRITE</code> in <code>REG_BLDCNT[_SUB]</code> ... not that useful. </li>\n<li>You can selectively turn on blending of some sprites by using <code>ATTR0_TYPE_BLENDED</code>. The blending level will be the same for all sprites (and layers)</li>\n<li>bitmap-type sprites use direct colors (bypassing the palettes), so the <code>ATTR2_PALETTE()</code> field of GBA sprites is useless and has been recycled into <code>ATTR2_ALPHA</code>. </li>\n</ul>\n'}]
['https://Stackoverflow.com/questions/7209', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/209/']