Language…
7 users online: 0doto, ASSATAKKU, EpicGamer1354, GuleDuyeM, jferrerfaj, SonicandMarioGames1985, TheTrueCommonSense - Guests: 96 - Bots: 138
Users: 70,235 (2,557 active)
Latest user: Samn

Making, water for example, transculent

...without chainging ANY level modes @mario head. I just wonder how the

-tranculent effect in SMW works;
-how to use it;
-and the limitations for transculent effects

thanks for any help
From Regs.txt

Code
2130  wb+++- CGWSEL - Color Addition Select
        ccmm--sd

        cc = Clip colors to black before math
            00 => Never
            01 => Outside Color Window only
            10 => Inside Color Window only
            11 => Always

        mm = Prevent color math
            00 => Never
            01 => Outside Color Window only
            10 => Inside Color Window only
            11 => Always

        s     = Add subscreen (instead of fixed color)

        d     = Direct color mode for 256-color BGs

        See the sections "BACKGROUNDS", "WINDOWS", and "RENDERING THE
        SCREEN" below for details.


2131  wb+++- CGADSUB - Color math designation
        shbo4321

        s    = Add/subtract select
            0 => Add the colors
            1 => Subtract the colors

        h    = Half color math. When set, the result of the color math is
            divided by 2 (except when $2130 bit 1 is set and the fixed color is
            used, or when color is cliped).

        4/3/2/1/o/b = Enable color math on BG1/BG2/BG3/BG4/OBJ/Backdrop

        See the sections "BACKGROUNDS", "WINDOWS", and "RENDERING THE
        SCREEN" below for details.


2132  wb+++- COLDATA - Fixed Color Data
        bgrccccc

        b/g/r = Which color plane(s) to set the intensity for.
        ccccc = Color intensity.

        So basically, to set an orange you'd do something along the lines of:
            LDA #$3f
            STA $2132
            LDA #$4f
            STA $2132
            LDA #$80
            STA $2132

        See the sections "BACKGROUNDS" and "WINDOWS" below for details.



Translucent effects are achieved in SMW by doing color addition/subtraction between the main screen and sub screen. BGs can be drawn to the subscreen to make them appear behind layers on the main screen. Levels with translucency in SMW have layer 1/2 on the subscreen and the BG/other layer on the main screen, all while using color addition to "add" the subscreen to the main screen layers.

Color subtraction is used in SMW and other games as a fade effect that doesn't affect every layer. It can also be used for weird color effects by subtracting different amounts from Red, Green, and Blue.
Well, if you're trying to make translucent water in a regular level that doesn't have layer 2, your best bet would be going to a level with a tide in it, and making snapshots of the various frames of the water as it moves. From there, just get those various water tiles into Paint, and you'll notice they have a checkerboard pattern, which allows you to combine them with any tile you want to use (if you want to use them with a background, with the tiles that aren't blue, leave those ones translucent). If you want to use them with any foreground tiles, the best advice I can give is, first make some copies of the individual foreground tiles you want to use, then paste the water tiles over them.

If this is too complicated for you to understand, my apologies, but I did something like this a couple of times in my first world in my hack. It was the only way I could work around the problem where layer 3 disappears if you hit a message block or touch a goal tape.
Originally posted by Monster
From Regs.txt

Code
...STUFF...



Translucent effects are achieved in SMW by doing color addition/subtraction between the main screen and sub screen. BGs can be drawn to the subscreen to make them appear behind layers on the main screen. Levels with translucency in SMW have layer 1/2 on the subscreen and the BG/other layer on the main screen, all while using color addition to "add" the subscreen to the main screen layers.

Color subtraction is used in SMW and other games as a fade effect that doesn't affect every layer. It can also be used for weird color effects by subtracting different amounts from Red, Green, and Blue.


So what would be the best way to implement this? Coding a generator?
Krakenskin Leather Works, my Etsy store.
LordVanya, my art page.
FundamentalEssence, my game development page.
Originally posted by Monster

Translucent effects are achieved in SMW by doing color addition/subtraction between the main screen and sub screen.

okay, now I understand, but one thing:

Code
2130 wb+++- CGWSEL - Color Addition Select ccmm--sd 



cc = Clip colors to black before math 00 => Never 01 => Outside Color Window only 10 => Inside Color Window only 11 => Always 

mm = Prevent color math 00 => Never 01 => Outside Color Window only 10 => Inside Color Window only 11 => Always 

s = Add subscreen (instead of fixed color) 

d = Direct color mode for 256-color BGs 


Could you show me an example Code for this (could be even wrong numbers, I just don't get how to work with it) and must I patch this with Xkas or how?

Originally posted by Vanya
So what would be the best way to implement this? Coding a generator?

That'd be fine. I do my layer manipulation in levelasm. Bout the same thing.


Quote
Could you show me an example Code for this (could be even wrong numbers, I just don't get how to work with it) and must I patch this with Xkas or how?

A generator or levelasm will work.

Code
	LDA #$3F	; enable translucency on layer 3
	STA $40		;
	LDA #$02
	STA $44
	LDA #$1B	; Set layer 3
	STA $212C	; Set it to sub screen
	LDA #$04
	STA $212D

$40 is the SMW mirror of $2131. It's applied below the status bar. #$3F does color addition on every layer, including sprites and stuff.
$44 is the SMW mirror of $2130. Also applied below the status bar. #$02 makes it use the subscreen, instead of a fixed color (instead of using the background color).
$212c and $212d do not have mirrors that are applied during a regular level, so I just wrote to them directly. Don't do this with registers that are mirrored and applied by SMW :)

Code
212c  wb+++- TM - Main Screen Designation
212d  wb+++- TS - Subscreen Designation
        ---o4321

        1/2/3/4/o = Enable BG1/BG2/BG3/BG4/OBJ for display
                    on the main (or sub) screen.

(objects are sprites)

I cleared the 3rd bit in $212C to remove layer 3 from the main screen. I then set the 3rd bit in $212D to place layer 3 on the subscreen and no other layer.