<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://wiki.specnext.dev/index.php?action=history&amp;feed=atom&amp;title=Blend_Modes_Draft</id>
	<title>Blend Modes Draft - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.specnext.dev/index.php?action=history&amp;feed=atom&amp;title=Blend_Modes_Draft"/>
	<link rel="alternate" type="text/html" href="http://wiki.specnext.dev/index.php?title=Blend_Modes_Draft&amp;action=history"/>
	<updated>2026-05-07T02:45:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>http://wiki.specnext.dev/index.php?title=Blend_Modes_Draft&amp;diff=13467&amp;oldid=prev</id>
		<title>Em00k at 22:11, 6 April 2025</title>
		<link rel="alternate" type="text/html" href="http://wiki.specnext.dev/index.php?title=Blend_Modes_Draft&amp;diff=13467&amp;oldid=prev"/>
		<updated>2025-04-06T22:11:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:11, 6 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** &lt;/del&gt;This is a draft as I need to confirm everything behaves on hardware or if there are any quirks. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;**&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;===&lt;/ins&gt;This is a draft as I need to confirm everything behaves on hardware or if there are any quirks.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;===&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Layer Blending ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Layer Blending ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key specnext_wiki:diff:1.41:old-13466:rev-13467:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Em00k</name></author>
	</entry>
	<entry>
		<id>http://wiki.specnext.dev/index.php?title=Blend_Modes_Draft&amp;diff=13466&amp;oldid=prev</id>
		<title>Em00k: Created page with &quot;** This is a draft as I need to confirm everything behaves on hardware or if there are any quirks. **  == Layer Blending ==  Layer Blending on the ZX Spectrum Next allows the...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.specnext.dev/index.php?title=Blend_Modes_Draft&amp;diff=13466&amp;oldid=prev"/>
		<updated>2025-04-06T22:10:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;** This is a draft as I need to confirm everything behaves on hardware or if there are any quirks. **  == Layer Blending ==  Layer Blending on the ZX Spectrum Next allows the...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;** This is a draft as I need to confirm everything behaves on hardware or if there are any quirks. **&lt;br /&gt;
&lt;br /&gt;
== Layer Blending ==&lt;br /&gt;
&lt;br /&gt;
Layer Blending on the ZX Spectrum Next allows the visual mixing of the Sprite, Layer 2, and ULA (or Tilemap) layers to produce lighting, shading, or other visual effects.&lt;br /&gt;
&lt;br /&gt;
This is controlled primarily by the layer priority setting {{NextRegNo|$15}} and blending source selection {{NextRegNo|$68}}.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Blending can be enabled using special layer modes referred to as SLU 6 and SLU 7. In these modes, colour values from a &amp;quot;blending&amp;quot; layer (ULA or Tilemap) are added to Layer 2 pixel values and clamped to the 3-bit colour range [0–7].&lt;br /&gt;
&lt;br /&gt;
== Blending Modes (SLU 6 &amp;amp; 7) ==&lt;br /&gt;
&lt;br /&gt;
Set by bits 4–2 of {{NextRegNo|$15}}:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! SLU Value !! Layer Order / Blending Description !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| 000 || S L U || Default mode: Sprites over Layer 2 over ULA&lt;br /&gt;
|-&lt;br /&gt;
| 001 || L S U || Layer 2 over Sprites over ULA&lt;br /&gt;
|-&lt;br /&gt;
| 010 || S U L || Sprites over ULA over Layer 2&lt;br /&gt;
|-&lt;br /&gt;
| 011 || L U S || Layer 2 over ULA over Sprites&lt;br /&gt;
|-&lt;br /&gt;
| 100 || U S L || ULA over Sprites over Layer 2&lt;br /&gt;
|-&lt;br /&gt;
| 101 || U L S || ULA over Layer 2 over Sprites&lt;br /&gt;
|-&lt;br /&gt;
| 110 || (U/T) S (T/U) ( B + L) || Blend layer + Layer 2 colours, clamped to [0–7]&lt;br /&gt;
|-&lt;br /&gt;
| 111 || (U/T) S (T/U) (B + L - 5) || Blend layer + Layer 2 - 5, colours clamped to [0–7]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In both SLU 6 and 7:&lt;br /&gt;
* The blending source is selected by bits 6:5 of {{NextRegNo|$68}}&lt;br /&gt;
* The blended output replaces the separate display of ULA or Tilemap (whichever is selected)&lt;br /&gt;
&lt;br /&gt;
== Blend Source Selection {{NextRegNo|$68}} ==&lt;br /&gt;
&lt;br /&gt;
=== {{NextRegNo|$68}} (104) — ULA Control ===&lt;br /&gt;
(R/W)&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit !! Name !! Description !! Default&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Disable ULA output || Turns off ULA layer entirely || 0&lt;br /&gt;
|-&lt;br /&gt;
| 6–5 || Blending control for SLU 6 &amp;amp; 7 || Selects blend input source || 00&lt;br /&gt;
|-&lt;br /&gt;
| || 00 || Use ULA as blend layer || &lt;br /&gt;
|-&lt;br /&gt;
| || 01 || No blending (disable blend) || &lt;br /&gt;
|-&lt;br /&gt;
| || 10 || Use result of ULA + Tilemap || &lt;br /&gt;
|-&lt;br /&gt;
| || 11 || Use Tilemap as blend layer || &lt;br /&gt;
|-&lt;br /&gt;
| 4 || Disable extended key matrix || Cancels entries in the 8x5 key matrix || 0&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ULA+ enable || Enables enhanced ULA+ mode || 0&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Half-pixel scroll || May enable smoother ULA scrolling || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Reserved || Must be 0 || -&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Stencil mode || Logical AND of ULA + Tilemap unless either is transparent || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&lt;br /&gt;
To enable blending of the ULA layer with Layer 2 and show sprites on top:&lt;br /&gt;
&lt;br /&gt;
# Set NextReg 0x15 bits 4:2 to 110 (SLU 6)&lt;br /&gt;
# Set NextReg 0x68 bits 6:5 to 00 (ULA as blend input)&lt;br /&gt;
&lt;br /&gt;
For darker shading effects using SLU 7:&lt;br /&gt;
# Set NextReg 0x15 bits 4:2 to 111 (SLU 7)&lt;br /&gt;
# Set NextReg 0x68 bits 6:5 accordingly&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* Colours are always clamped to 3-bit RGB values [0–7] per channel.&lt;br /&gt;
* SLU 6 blends normally: Blend + Layer2&lt;br /&gt;
* SLU 7 blends with subtraction: Blend + Layer2 - 5 (for dimming)&lt;br /&gt;
* Blending applies only when the chosen blend source is active and visible.&lt;br /&gt;
* Sprites are unaffected by the blending math and remain on top (as per SLU order).&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Layer 2]]&lt;br /&gt;
* [[Sprites]]&lt;br /&gt;
* [[ULA+]]&lt;br /&gt;
* [[NextReg|NextReg List]]&lt;/div&gt;</summary>
		<author><name>Em00k</name></author>
	</entry>
</feed>