Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,482,576
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-25-24 04:50 PM
Guest: Register | Login

0 users currently in ROM Hacking | 3 guests | 1 bot

Main - ROM Hacking - SNES Transparency mode New thread | New reply


dirtbag
Posted on 05-06-07 11:41 PM (rev. 2 of 05-06-07 11:42 PM) Link | Quote | ID: 33441


Red Koopa
Level: 27

Posts: 49/128
EXP: 114671
Next: 1488

Since: 02-24-07

Last post: 3186 days
Last view: 3100 days
I’ve been reading up and I’ve come to the conclusion that using transparency in my hack going to require some hardcore ASM hacking. So I’ve given up on that idea but have now made my self curious. Does the SNES work on a whole layer at a time or could you set curtain pixels to be transparent while others are solid on one layer?

Has anyone added transparency in to a SNES hack before? I take it's not just a clever palette trick?

blackhole89
Posted on 05-06-07 11:51 PM Link | Quote | ID: 33445


The Guardian
Moloch whose eyes are a thousand blind windows!
Level: 124

Posts: 168/4196
EXP: 21531650
Next: 304951

Since: 02-19-07
From: Ithaca, NY, US

Last post: 470 days
Last view: 83 days



It would be useful if you at least mentioned what it is you are hacking... SMW's engine, for instance, has a level mode that renders layer 2 additive.
SNES' PPU supports actual transparency on a somewhat difficult to explain by-layer/by-"screen" mix basis... basically, you have a separate "main screen designation mask" and a "sub screen designation mask" in the PPU registers which determines which layers are rendered on which of the "screens", and another PPU register, commonly called CGADSUB (I think it was $2131, but it has been over a year since I last messed with that...), holds a bitwise mask that determines the layers to be affected by the blending as well as the blend mode to use (additive or subtractive) and, I think, whether the input should be halved in gain (which would turn additive blending into a 50/50 alpha one). If I am not mistaken, all of that information can be googled. With CGADSUB set accordingly, then, the pixels on the sub screen which "come from" a layer that was set as affected by blending in CGADSUB are blended with the specified operation unto the pixels of the main screen, and the result is put on the screen. That's what I recall of it, anyway.

____________________



dirtbag
Posted on 05-07-07 12:04 AM Link | Quote | ID: 33446


Red Koopa
Level: 27

Posts: 50/128
EXP: 114671
Next: 1488

Since: 02-24-07

Last post: 3186 days
Last view: 3100 days
Thanks for you quick response. I'm hacking Super Mario Kart, the aim was to make rainbow road translucent. By the sounds of things if I did manage to get it in to the game it would be the same for every track.

blackhole89
Posted on 05-07-07 12:07 AM Link | Quote | ID: 33447


The Guardian
Moloch whose eyes are a thousand blind windows!
Level: 124

Posts: 169/4196
EXP: 21531650
Next: 304951

Since: 02-19-07
From: Ithaca, NY, US

Last post: 470 days
Last view: 83 days



If I am not mistaken, SMK uses Mode 7 for the ground's display... which would make it impossible to use CGADSUB based blending at all.

____________________



Xkeeper
Posted on 05-07-07 12:44 AM Link | Quote | ID: 33451


Level: 105

Posts: 1575/2846
EXP: 12027520
Next: 234740

Since: 02-19-07

Last post: 6059 days
Last view: 2796 days
Posted by blackhole89
If I am not mistaken, SMK uses Mode 7 for the ground's display... which would make it impossible to use CGADSUB based blending at all.
Wrong. I'm fairly certain it uses a mix of midframe scaling and skewing to accomplish the effect.
Remember that Mode 7 allows only one layer while SMK displays 4 layers.

____________________
I dealt with it.

Sukasa
Posted on 05-07-07 12:59 AM Link | Quote | ID: 33456


Red Birdo
Level: 92

Posts: 179/2112
EXP: 7688904
Next: 68033

Since: 02-19-07

Last post: 4447 days
Last view: 3219 days
I think that SMK actually uses one GFX mode for the Background/etc., and mode 7 for the ground.

MathOnNapkins
Posted on 05-07-07 03:48 AM (rev. 3 of 05-07-07 03:51 AM) Link | Quote | ID: 33488


Super Koopa
Level: 62

Posts: 119/842
EXP: 1935393
Next: 49293

Since: 02-19-07
From: durff

Last post: 4487 days
Last view: 4010 days
Yikes.... i spent about an hour looking around to see if I could pull it off. Try looking in the $80:016A region of RAM. That, I believe keeps settings for the mode 7 and the mode 0 BGs seperately. These are settings for $2130, $2131, and $2132.

The chief problem I've had is that during a race the game does not seem to write to $212D, which is the subscreen designation. To do any kind of "transparency" you need to move one or more BGs to the subscreen then enable subscreen addition (not fixed color addition) on the appropriate layers. Next, I'm going to wager that it's impossible either way b/c the area you want to perform addition on is all mode 7. It's only the top forty pixels or so of the screen that uses mode 0.

edit: The only reason i thought there might be a remote possibility of it working is because the game has a special DSP chip. Plus, even if you got this working, your current rank is drawn to the screen using fixed color addition in a window, so you'd lose that if you enabled subscreen addition (can't have both at once, at least not in the same position on the screen).

____________________
Zelda Hacking Forum
hobbies: delectatio morosa

Raccoon Sam
Posted on 05-07-07 06:35 AM Link | Quote | ID: 33549


Cobrat
Level: 56

Posts: 175/672
EXP: 1379943
Next: 18233

Since: 02-19-07
From: Hi

Last post: 3467 days
Last view: 2698 days
Posted by Sukasa
I think that SMK actually uses one GFX mode for the Background/etc., and mode 7 for the ground.


Reminds me, does Yoshi's Safari use the exact same thing?
Somehow Yoshi's Safari's ground looks better than SMK's.

____________________


Stifu
Posted on 05-07-07 08:10 AM Link | Quote | ID: 33593


Cobrat
Level: 56

Posts: 93/666
EXP: 1361211
Next: 36965

Since: 02-22-07

Last post: 685 days
Last view: 307 days
Posted by dirtbag
Thanks for you quick response. I'm hacking Super Mario Kart, the aim was to make rainbow road translucent. By the sounds of things if I did manage to get it in to the game it would be the same for every track.

That would actually be pointless. Reason: what's below the track is unicolor (the stars and stuff being on the upper part), which means that even if you could do it, you could get the exact same result by just using different color tones.

dirtbag
Posted on 05-07-07 09:58 AM Link | Quote | ID: 33601


Red Koopa
Level: 27

Posts: 51/128
EXP: 114671
Next: 1488

Since: 02-24-07

Last post: 3186 days
Last view: 3100 days
Posted by Stifu
Posted by dirtbag
Thanks for you quick response. I'm hacking Super Mario Kart, the aim was to make rainbow road translucent. By the sounds of things if I did manage to get it in to the game it would be the same for every track.

That would actually be pointless. Reason: what's below the track is unicolor (the stars and stuff being on the upper part), which means that even if you could do it, you could get the exact same result by just using different color tones.


Yeah that's what I was going to do in the end. Still it got people talking

Stifu
Posted on 05-07-07 02:39 PM Link | Quote | ID: 33630


Cobrat
Level: 56

Posts: 94/666
EXP: 1361211
Next: 36965

Since: 02-22-07

Last post: 685 days
Last view: 307 days
Posted by dirtbag
Yeah that's what I was going to do in the end. Still it got people talking

The only way it wouldn't be totally pointless is if you used the ghost pillars in the track (being the only objects that appear on the lower part of the track)... On the other hand, even if you managed to do it, I guess it would make the game lag, from what I've seen with excessive uses of transparency in SMW hacks...

blackhole89
Posted on 05-07-07 08:09 PM Link | Quote | ID: 33661


The Guardian
Moloch whose eyes are a thousand blind windows!
Level: 124

Posts: 171/4196
EXP: 21531650
Next: 304951

Since: 02-19-07
From: Ithaca, NY, US

Last post: 470 days
Last view: 83 days



Technically, if the game lags from transparency, it could at most be from your computer being too slow to handle it... no 65c816 processor time is used for the rasterization.

____________________



Stifu
Posted on 05-08-07 08:07 PM Link | Quote | ID: 33907


Cobrat
Level: 56

Posts: 95/666
EXP: 1361211
Next: 36965

Since: 02-22-07

Last post: 685 days
Last view: 307 days
I guess I should blame it on ZSNES then...

Bio
Posted on 05-08-07 11:18 PM Link | Quote | ID: 33981


Red Paragoomba
Level: 19

Posts: 27/58
EXP: 34991
Next: 786

Since: 02-19-07

Last post: 5833 days
Last view: 5696 days
Posted by Stifu
I guess I should blame it on ZSNES then...

Are you sure it's not SMW's fault, some hack have it set with buyancy to have tranculucent water wich cause slowdown

HyperHacker
Posted on 05-09-07 03:05 AM Link | Quote | ID: 34048

...
Level: 73

Posts: 697/1220
EXP: 3366582
Next: 119286

Since: 03-25-07
From: no

Last post: 6090 days
Last view: 6074 days
If transparency (actually, translucency) alone causes lag, it's the emulator's fault, as this shouldn't have any effect on SNES processing speed. If buoyancy causes lag, it's probably the game's fault, as the code is inefficient and slow. However it's possible for a poorly-coded emulator to lag when the game uses a lot of CPU power, as the buoyancy code would, and combined with lag from translucency, this may be quite noticeable.

You'll just have to try it on a real SNES and see what combinations of things cause slowdown.

Main - ROM Hacking - SNES Transparency mode New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.024 seconds. (339KB of memory used)
MySQL - queries: 82, rows: 117/117, time: 0.016 seconds.