Mode 0: Difference between revisions
AnasMario130 (talk | contribs) No edit summary |
AnasMario130 (talk | contribs) No edit summary |
||
Line 2: | Line 2: | ||
Mode 0 is the first mode on the SNES, characterized by its offer of '''four''' layers, as opposed to the normal three Mode 1 offers you. However, there are two significant drawbacks: you only have four colors (3 actual colors plus transparency) per palette, and the layer 3 tilemap is halved to make room for layer 4. However, the latter drawback can be circumvented by sacrificing GFX slots. | Mode 0 is the first mode on the SNES, characterized by its offer of '''four''' layers, as opposed to the normal three Mode 1 offers you. However, there are two significant drawbacks: you only have four colors (3 actual colors plus transparency) per palette, and the layer 3 tilemap is halved to make room for layer 4. However, the latter drawback can be circumvented by sacrificing GFX slots. | ||
== Applications of Mode 0 == | == Applications of Mode 0 == | ||
Line 9: | Line 8: | ||
To make things more interesting, in the field of [[Super Mario World]] hacking, a few hacks and contest levels have used it, such as [[ASMWCP]], LMPuny's work-in-progress [https://www.smwcentral.net/?p=viewthread&t=92319 SUPER MARIO BROS. Returns], idol and Katrina's Chocolate Level Design Contest 2018 entry [https://smwc.me/1465858 lightest], and [[AnasMario130]]'s Power Mario Contest entry [https://www.youtube.com/redirect?redir_token=cU_VVfJUeEhKwLzohQliWVuVZNZ8MTU2OTE4MTYyM0AxNTY5MDk1MjIz&event=video_description&v=14HgxKkaF5s&q=https%3A%2F%2Fcdn.discordapp.com%2Fattachments%2F539258326400237579%2F572124372311998467%2Fpyrobluescastle_UPDATED.zip Pyro-Blue's Fort]. | To make things more interesting, in the field of [[Super Mario World]] hacking, a few hacks and contest levels have used it, such as [[ASMWCP]], LMPuny's work-in-progress [https://www.smwcentral.net/?p=viewthread&t=92319 SUPER MARIO BROS. Returns], idol and Katrina's Chocolate Level Design Contest 2018 entry [https://smwc.me/1465858 lightest], and [[AnasMario130]]'s Power Mario Contest entry [https://www.youtube.com/redirect?redir_token=cU_VVfJUeEhKwLzohQliWVuVZNZ8MTU2OTE4MTYyM0AxNTY5MDk1MjIz&event=video_description&v=14HgxKkaF5s&q=https%3A%2F%2Fcdn.discordapp.com%2Fattachments%2F539258326400237579%2F572124372311998467%2Fpyrobluescastle_UPDATED.zip Pyro-Blue's Fort]. | ||
== Palette and Tilemap Distribution == | == Palette and Tilemap Distribution == | ||
Line 18: | Line 16: | ||
graphics instead of the usual four. | graphics instead of the usual four. | ||
== How to Use Mode 0 in Super Mario World == | |||
'''First of all, please use one of the given codes in a level using [[UberASM Tool]] before proceeding:''' | |||
'''Stationary Layer 4''', by [[LMPuny]] | |||
<pre> | |||
init: | |||
LDA #$51 : STA $2109 | |||
LDA #$59 : STA $210A | |||
LDA #$44 : STA $210C | |||
STZ $3E | |||
LDA #$11 : STA $212C : STA $212E | |||
LDA #$0E : STA $212D : STA $212F | |||
REP #$20 : LDA $20 : CLC : ADC #$0080 : SEP #$20 | |||
STA $2112 : XBA : STA $2112 | |||
REP #$20 : LDA $24 | |||
CLC : ADC #$0070 : SEP #$20 | |||
STA $2114 : XBA : STA $2114 | |||
RTL | |||
</pre> | |||
'''Automatically-Scrolling Layer 4''', by [[LMPuny]] | |||
<pre> | |||
!base1 = $0000 | |||
!base2 = $0000 | |||
if read1($00FFD5) == $23 | |||
sa1rom | |||
!base1 = $3000 | |||
!base2 = $6000 | |||
endif | |||
!FreeRAM = $60 | |||
init: | |||
stz !FreeRAM | |||
stz !FreeRAM+1 | |||
LDA #$51 : STA $2109 | |||
LDA #$59 : STA $210A | |||
LDA #$44 : STA $210C | |||
STZ $3E | |||
LDA #$11 : STA $212C : STA $212E | |||
LDA #$0E : STA $212D : STA $212F | |||
REP #$20 : LDA $20 : CLC : ADC #$0080 : SEP #$20 | |||
STA $2112 : XBA : STA $2112 | |||
REP #$20 : LDA $24 | |||
CLC : ADC #$0070 : SEP #$20 | |||
STA $2114 : XBA : STA $2114 | |||
RTL | |||
</pre> | |||
'''Camera-Based Scrolling Layer 4''', by [[LMPuny]]; scrolling code by MolSno from [https://smwc.me/1260886 his Layer 4 code]; however the init: code is broken in that layer 4 doesn't show up at all | |||
<pre> | |||
init: | |||
LDA #$51 : STA $2109 | |||
LDA #$59 : STA $210A | |||
LDA #$44 : STA $210C | |||
STZ $3E | |||
LDA #$11 : STA $212C : STA $212E | |||
LDA #$0E : STA $212D : STA $212F | |||
REP #$20 : LDA $20 : CLC : ADC #$0080 : SEP #$20 | |||
STA $2112 : XBA : STA $2112 | |||
REP #$20 : LDA $24 | |||
CLC : ADC #$0070 : SEP #$20 | |||
STA $2114 : XBA : STA $2114 | |||
main: | |||
; Layer 4 H-Scroll = Layer 3 H-Scroll / 4 | |||
REP #$20 : LDA $22 : LSR A : LSR A : SEP #$20 | |||
STA $2113 : XBA : STA $2113 | |||
; Layer 4 V-Scroll = Layer 3 V-Scroll | |||
REP #$20 : LDA $24 : SEP #$20 | |||
STA $2114 : XBA : STA $2114 | |||
RTL | |||
</pre> | |||
Bugs so far: | |||
# Layer 2/3 translucency doesn't work when set in LM. | |||
# The 2nd layer 4 code doesn't seem to initialize the layer 4 BG's position at all, so you will notice that the position of layer 4 in a section of your level will be carried off from the previous section's. A workaround to this would be swapping their priorities around in LM's Layer 3 Tilemap Editor using the '''Priority --''' tab. More on that later. | |||
Please make a fix to these two bugs and cross them out respectively if possible. |
Revision as of 20:48, 21 September 2019
What is Mode 0?
Mode 0 is the first mode on the SNES, characterized by its offer of four layers, as opposed to the normal three Mode 1 offers you. However, there are two significant drawbacks: you only have four colors (3 actual colors plus transparency) per palette, and the layer 3 tilemap is halved to make room for layer 4. However, the latter drawback can be circumvented by sacrificing GFX slots.
Applications of Mode 0
When it comes to the SNES library of games, only a few have used Layer 4, such as Super Mario Kart, Super Mario World 2 - Yoshi's Island, S.O.S., and Earthbound.
To make things more interesting, in the field of Super Mario World hacking, a few hacks and contest levels have used it, such as ASMWCP, LMPuny's work-in-progress SUPER MARIO BROS. Returns, idol and Katrina's Chocolate Level Design Contest 2018 entry lightest, and AnasMario130's Power Mario Contest entry Pyro-Blue's Fort.
Palette and Tilemap Distribution
As mentioned in the previous heading, Mode 0 can only offer you four colors per palette, including transparency. Each layer takes up 8 four-color palettes distributed in two rows each. Layer 1 takes up rows 0-1, layer 2 rows 2-3, layer 3 rows 4-5, and layer 4 rows 6-7.
As for the tilemap, it is 2bpp, but the size must be 4 KB. However, the arrangement for the tilemap is doubled, meaning that in a graphics editor like YY-Chr, you can have eight rows' worth of graphics instead of the usual four.
How to Use Mode 0 in Super Mario World
First of all, please use one of the given codes in a level using UberASM Tool before proceeding:
Stationary Layer 4, by LMPuny
init: LDA #$51 : STA $2109 LDA #$59 : STA $210A LDA #$44 : STA $210C STZ $3E LDA #$11 : STA $212C : STA $212E LDA #$0E : STA $212D : STA $212F REP #$20 : LDA $20 : CLC : ADC #$0080 : SEP #$20 STA $2112 : XBA : STA $2112 REP #$20 : LDA $24 CLC : ADC #$0070 : SEP #$20 STA $2114 : XBA : STA $2114 RTL
Automatically-Scrolling Layer 4, by LMPuny
!base1 = $0000 !base2 = $0000 if read1($00FFD5) == $23 sa1rom !base1 = $3000 !base2 = $6000 endif !FreeRAM = $60 init: stz !FreeRAM stz !FreeRAM+1 LDA #$51 : STA $2109 LDA #$59 : STA $210A LDA #$44 : STA $210C STZ $3E LDA #$11 : STA $212C : STA $212E LDA #$0E : STA $212D : STA $212F REP #$20 : LDA $20 : CLC : ADC #$0080 : SEP #$20 STA $2112 : XBA : STA $2112 REP #$20 : LDA $24 CLC : ADC #$0070 : SEP #$20 STA $2114 : XBA : STA $2114 RTL
Camera-Based Scrolling Layer 4, by LMPuny; scrolling code by MolSno from his Layer 4 code; however the init: code is broken in that layer 4 doesn't show up at all
init: LDA #$51 : STA $2109 LDA #$59 : STA $210A LDA #$44 : STA $210C STZ $3E LDA #$11 : STA $212C : STA $212E LDA #$0E : STA $212D : STA $212F REP #$20 : LDA $20 : CLC : ADC #$0080 : SEP #$20 STA $2112 : XBA : STA $2112 REP #$20 : LDA $24 CLC : ADC #$0070 : SEP #$20 STA $2114 : XBA : STA $2114 main: ; Layer 4 H-Scroll = Layer 3 H-Scroll / 4 REP #$20 : LDA $22 : LSR A : LSR A : SEP #$20 STA $2113 : XBA : STA $2113 ; Layer 4 V-Scroll = Layer 3 V-Scroll REP #$20 : LDA $24 : SEP #$20 STA $2114 : XBA : STA $2114 RTL
Bugs so far:
- Layer 2/3 translucency doesn't work when set in LM.
- The 2nd layer 4 code doesn't seem to initialize the layer 4 BG's position at all, so you will notice that the position of layer 4 in a section of your level will be carried off from the previous section's. A workaround to this would be swapping their priorities around in LM's Layer 3 Tilemap Editor using the Priority -- tab. More on that later.
Please make a fix to these two bugs and cross them out respectively if possible.