isolating background layers with simultaneous display

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.freenode.net in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Post Reply
Etrigan
New Member
Posts: 7
Joined: Fri Jan 07, 2011 5:28 am

isolating background layers with simultaneous display

Post by Etrigan »

I'm interested in using zsnes for a 3 tier display running in portrait mode on an lcd monitor.
the top third of the display would display 1 background element of a game, say Super Mario 3. The second third would have 2 background elements, the final third would also have 2; this way when you're playing the game, you see the game elements moving in sync, but at different levels on the monitor. Tell me honestly, how difficult of a task would something like that be? I am not familiar with the language that ZSNES is built on.

Thank you
-Etrigan
Last edited by Etrigan on Thu Sep 11, 2014 8:50 pm, edited 1 time in total.
Etrigan
New Member
Posts: 7
Joined: Fri Jan 07, 2011 5:28 am

Re: isolating background layers with simultaneous display

Post by Etrigan »

Because I didn't capitalize? That's pretty rude.
paulguy
Zealot
Posts: 1076
Joined: Sat Jul 02, 2005 2:01 am
Contact:

Re: isolating background layers with simultaneous display

Post by paulguy »

It's because you said znes.
Maybe these people were born without that part of their brain that lets you try different things to see if they work better. --Retsupurae
grinvader
ZSNES Shake Shake Prinny
Posts: 5626
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: isolating background layers with simultaneous display

Post by grinvader »

Etrigan wrote:the top third of the display would display 1 background element of a game, say Super Mario 3. The second third would have 2 background elements, the final third would also have 2; this way when you're playing the game, you see the game elements moving in sync, but at different levels on the monitor. Now I don't know much about programming, so tell me honestly, how difficult of a task would something like that be?

I don't quite understand what you're aiming for. Split all layers on different part of the screen ?
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)

Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Etrigan
New Member
Posts: 7
Joined: Fri Jan 07, 2011 5:28 am

Re: isolating background layers with simultaneous display

Post by Etrigan »

Oh man. I never got this reply, I apologize.
If anyone is still listening:

I made a mirror box that takes a video screen and splits it into 3 parts, each part is then reflected forward to make it appear that there are 3 2d planes overlapping one another. In theory, you could take a game and by isolating different sprite layers on different planes, make a game look like a hologram while you're playing it.

After this post, through trial and error of turning sprite layers on and off, I found that the sprite layers aren't as Isolated as they'd need to be for this to work. For instance, the blue sky of Mario would need to be removed so that it wouldn't punch out all the colors in front of it, but it seems to be combined with other layers in unexpected ways.
I'm still interested in pursuing my original question, even if the end product isn't quite what I wanted. Any help would be appreciated.
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Re: isolating background layers with simultaneous display

Post by kode54 »

Theoretically, an emulator could be modified to separate the layers like you want, but it would still look sort of janky in cases where layers blend with each other, or where games change the screen mode mid-screen.
grinvader
ZSNES Shake Shake Prinny
Posts: 5626
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: isolating background layers with simultaneous display

Post by grinvader »

Colour math with mainscreen/subscreen on different layers would also turn into hell.


Also, yeah. You can't magic out depth out of the snes stuff, due to how the games were done with everything squished on a single flat plane in mind. Layers and their priorities don't mesh with sprites and their priorities, you can have per-halfpixel screen attribution, several effects would just turn out horribly, and even if you put the different layers in a simple game properly, the obtained '3d' feels like crap because there is only emptiness between the various vertical planes, no ground or sky inbetween.

Massive efforts for abysmal results sure feels like something to waste time on ! ¬_¬
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)

Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Etrigan
New Member
Posts: 7
Joined: Fri Jan 07, 2011 5:28 am

Re: isolating background layers with simultaneous display

Post by Etrigan »

I understand the challenges involved, but before I can worry about color punch-out, I'd need to get a prototype of 3 isolated sprite layers running on 3 sections of a screen running.
I'm more looking for practical information like in what language is ZSNES written? Is it coded in a text interface or is there a development environment? Would I need considerable knowledge to make this work, etc.
Gil_Hamilton
Buzzkill Gil
Posts: 4267
Joined: Wed Jan 12, 2005 7:14 pm

Re: isolating background layers with simultaneous display

Post by Gil_Hamilton »

Etrigan wrote:I'm more looking for practical information like in what language is ZSNES written?

It's coded in a mix of C and asse-waitwhat?

Is it coded in a text interface or is there a development environment?

That has no bearing on anything. This question's existence suggests you may be out of your depth.
Squall_Leonhart wrote:
You have your 2s, 4s, 8s, 16s, 32s, 64s, and 128s(crash course in binary counting!). But no 1s.
DirectInput represents all bits, not just powers of 2 in an axis.


KHDownloads
Etrigan
New Member
Posts: 7
Joined: Fri Jan 07, 2011 5:28 am

Re: isolating background layers with simultaneous display

Post by Etrigan »

... extremely helpful thank you

Often a development environment can help make sense of code for someone who isn't familiar with a project.
Why bother responding to the question?
grinvader
ZSNES Shake Shake Prinny
Posts: 5626
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: isolating background layers with simultaneous display

Post by grinvader »

Don't take sarcasm too negatively. Joking around is important too.
Anyway, still probably out of your league.

Etrigan wrote:I understand the challenges involved, but before I can worry about color punch-out, I'd need to get a prototype of 3 isolated sprite layers running on 3 sections of a screen running.

I assume you mean 3 isolated background layers. There's only one sprite layer.

I'm more looking for practical information like in what language is ZSNES written?

The source is a mix of x86 assembly, c, c++, and custom stuff for config files.

Is it coded in a text interface or is there a development environment?

It was typed manually. No 'project file' or anything you could jam in an IDE to try and see everything. The languages used would also preclude that.

Would I need considerable knowledge to make this work, etc.

As I said, massive. If you are able to do it, you could code something much better from scratch in the time needed to do it.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)

Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Etrigan
New Member
Posts: 7
Joined: Fri Jan 07, 2011 5:28 am

Re: isolating background layers with simultaneous display

Post by Etrigan »

Exactly the info I was looking for. Thank you very much for taking the time to respond, I really appreciate it.
grinvader
ZSNES Shake Shake Prinny
Posts: 5626
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: isolating background layers with simultaneous display

Post by grinvader »

Oh yeah, you may also be interested in the fact that there aren't always 5 layers active. Could be down to 2 in modes 6 & 7 w/o extbg. This can change per line, although games don't typically change mode more than once a frame. Maybe twice for some crazy stuff.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)

Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Etrigan
New Member
Posts: 7
Joined: Fri Jan 07, 2011 5:28 am

Re: isolating background layers with simultaneous display

Post by Etrigan »

Thank you. If I ever got this working, which you convinced me I likely never will, it would definitely only be for a game, maybe 2 If I was lucky. Getting it to work for a whole library even in my uninformed theory, never seemed possible. Mario Kart, the mode 7 parts of Castlevania or Super Star Wars... yeah, those definitely would never fly.
Gonzo
Regular
Posts: 280
Joined: Wed Sep 22, 2004 3:46 am
Location: Tromaville

Re: isolating background layers with simultaneous display

Post by Gonzo »

Look I'm not a coder. I've tried learning a number of different computer languages over the years but I've never had the patience to stick with any of them.
But I've got a half brother who is a games programmer and I frequently talk to him about programming(he likes to talk a lot, and in great detail, about the projects he's working on). What I've gathered from him, and reading threads on this board over the years, is that zsnes is written in a language that is not for amateurs.

You need to have a decent amount of coding experience before you even start looking at doing anything with zsnes.

Now you could spend the next five or so years learning how to take zsnes apart and get it to do what you want, only to have the end result not be all that good after all.

Or you you could spend the next five years learning a computer language, so that you can program your own games which are specifically designed for what you have in mind. Hell you could even learn something like C++ and then port snes games and set up the layers the way you need them to be.

You could start off with doing a level from a game, let's say Super Mario World, and use that as a tech demo to see if everything is working the way you had in mind.
Gil_Hamilton
Buzzkill Gil
Posts: 4267
Joined: Wed Jan 12, 2005 7:14 pm

Re: isolating background layers with simultaneous display

Post by Gil_Hamilton »

grinvader wrote:Oh yeah, you may also be interested in the fact that there aren't always 5 layers active. Could be down to 2 in modes 6 & 7 w/o extbg. This can change per line, although games don't typically change mode more than once a frame. Maybe twice for some crazy stuff.

Does HyperZone change modes repeatedly, like it looks? Or are they just setting all the mode 7 registers to basically do nothing for the central "horizon" strip?

Image
For reference.
Squall_Leonhart wrote:
You have your 2s, 4s, 8s, 16s, 32s, 64s, and 128s(crash course in binary counting!). But no 1s.
DirectInput represents all bits, not just powers of 2 in an axis.


KHDownloads
grinvader
ZSNES Shake Shake Prinny
Posts: 5626
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Re: isolating background layers with simultaneous display

Post by grinvader »

That can be done with a couple updates to projection matrix regs instead of switching out of mode7 altogether, but you'd have to trace the game to be sure.

The example I'm aware of is Battletoads in Battlemaniacs's intro, when the chopper zooms in (and also when silas volkmire shows up iirc).
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)

Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Post Reply