(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-21-24 07:58 AM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - How are layers drawn on SNES?
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
creaothceann
Posts: 30/43
They are all drawn "at once", so to speak. The actual outcome is the same either way.

The SNES has certain registers that tell it how to draw the current scanline and where to find the required data. An important register is register $2105, the lowest 3 bits determine the BG mode, and hence the drawing order.

To quote anomie's register doc:


In Mode 1, you have 2 BGs of 16 colors and 1 BG of 4 colors. [...]
The background priority varies depending on the setting of bit 3 of $2105.

The priority is (from 'front' to 'back'):
- BG3 tiles with priority 1 if bit 3 of $2105 is set
- Sprites with priority 3
- BG1 tiles with priority 1
- BG2 tiles with priority 1
- Sprites with priority 2
- BG1 tiles with priority 0
- BG2 tiles with priority 0
- Sprites with priority 1
- BG3 tiles with priority 1 if bit 3 of $2105 is clear
- Sprites with priority 0
- BG3 tiles with priority 0

You can't access most PPU registers while the PPUs draw the screen (ie. while the electron beam of the TV is active and draws a line).
HyperHacker
Posts: 1513/5072
Say you have 3 background layers on a SNES game; layer 1 is lowest priority and 3 is highest for simplicity's sake. When they're drawn, does it draw all of layer 1, then all of 2, then 3, or does it just like draw them all at once? And if they're separate, is there any way to tell which is currently being drawn?
Acmlm's Board - I3 Archive - ROM Hacking - How are layers drawn on SNES?


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.010 seconds; used 346.45 kB (max 377.02 kB)