It is currently Tue Oct 17, 2017 10:57 pm

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Wed Jul 13, 2016 2:34 pm 
Offline

Joined: Sun Mar 27, 2016 7:56 pm
Posts: 137
Not always enabled, since the subscreen is also used for hi-res; that said, color math and hi-res are the only two ways you can have the subscreen show up on-screen.

However, I did remember something; color 0 does not necessarily have to be black, because you can additionally have color math force main screen layers to be black. Using that, you could effectively force display of only the subscreen for those layers.

That said, when using this particular trick, I don't think there's a case where you'd need color 0 to not be black, because there's no circumstance where it would be displayed. Transparent areas on the subscreen would end up showing the subscreen backdrop color (COLDATA), not color 0.


Top
 Profile  
 
PostPosted: Wed Jul 13, 2016 2:37 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
I didn't know that the subscreen had a "different color 0".

Yeah, so effectively, BG3 in the center has all the advantages of any other background layer, it's just that it can't be for color math.

Actually, no, because I'm pretty sure Dracula X does this somehow:

Image


Top
 Profile  
 
PostPosted: Wed Jul 13, 2016 2:41 pm 
Offline

Joined: Sun Mar 27, 2016 7:56 pm
Posts: 137
Yeah, it's outside of the normal 256-color palette, which is a little strange. Can be useful for some things though, like using color math with a solid color that needs to be different from the backdrop color.

Dracula X isn't using the same trick; it simply puts BG3 (the fire) on the subscreen, then applies color math to BG2 (the background), adding the fire to it.

The trick DKC3 uses only needs to be done if you want BG3 to not be transparent.


Top
 Profile  
 
PostPosted: Wed Jul 13, 2016 3:08 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
Yeah, from all this, it seems you can pretty much arrange the BG layers however you want to. Fine with me! :lol:

I'll try and get started on my DMA tilemap thing now, that just stood out to me.

I actually had a genius idea of using a GBA tilemap editor and having 8 of the palettes look exactly the same and use the last palette bit as the priority bit but, I found out that the order of the bits isn't the same. :(

GBA: PPPPVHCCCCCCCCCC
SNES: VHOPPPCCCCCCCCCC

"O" is priority, the rest is self explanatory.

You know what, it would be much easier to just make a GBA to SNES tilemap converter than to deal with making one from scratch.


Top
 Profile  
 
PostPosted: Wed Jul 13, 2016 3:46 pm 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 781
Nicole wrote:
you can't use different color math modes at once
Nicole wrote:
color math and hi-res are the only two ways you can have the subscreen show up on-screen

And here we have the exception that proves the rule. In pseudo-hires mode, you can blend the main screen and subscreen at 50:50, like the add and divide by two option, and also use colour math with the subscreen backdrop.

The 50:50 blending in this case is only an approximation, since what it's actually doing is just alternating half-dots and betting on the TV being blurry enough for the result to look good. The COLDATA math is real though.


Top
 Profile  
 
PostPosted: Wed Jul 13, 2016 3:58 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2283
So the subscreen only shows up on main screen backgrounds with color math enabled. What happens if a sub screen layer has color math enabled? Does that mean that layer shows up transparent everywhere?


Top
 Profile  
 
PostPosted: Wed Jul 13, 2016 4:23 pm 
Offline

Joined: Sun Mar 27, 2016 7:56 pm
Posts: 137
All in all, the SNES is incredibly flexible in the stuff you can do with its graphics settings. It's nothing compared to modern hardware of course, but I do feel like there's a lot of potential that hasn't necessarily been exploited in a lot of games.

psycopathicteen wrote:
So the subscreen only shows up on main screen backgrounds with color math enabled. What happens if a sub screen layer has color math enabled? Does that mean that layer shows up transparent everywhere?

Color math only affects the main screen, essentially. If BG1 was in the main screen, BG2 was in the subscreen, and color math was enabled for BG1 (so BG2 was added to BG1), enabling color math for BG2 as well would make no difference whatsoever.

However, it is possible to have a layer on both the main screen and the subscreen, so it's possible to apply a layer to itself in that case. What that does depends on the mode: addition would double the brightness of the color, since it's adding the color to itself; averaging would leave the color unchanged; subtraction would make the layer black; subtraction with halving would also make the layer black.


Top
 Profile  
 
PostPosted: Wed Jul 13, 2016 6:14 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2283
Nicole wrote:
All in all, the SNES is incredibly flexible in the stuff you can do with its graphics settings. It's nothing compared to modern hardware of course, but I do feel like there's a lot of potential that hasn't necessarily been exploited in a lot of games.

psycopathicteen wrote:
So the subscreen only shows up on main screen backgrounds with color math enabled. What happens if a sub screen layer has color math enabled? Does that mean that layer shows up transparent everywhere?

Color math only affects the main screen, essentially. If BG1 was in the main screen, BG2 was in the subscreen, and color math was enabled for BG1 (so BG2 was added to BG1), enabling color math for BG2 as well would make no difference whatsoever.

However, it is possible to have a layer on both the main screen and the subscreen, so it's possible to apply a layer to itself in that case. What that does depends on the mode: addition would double the brightness of the color, since it's adding the color to itself; averaging would leave the color unchanged; subtraction would make the layer black; subtraction with halving would also make the layer black.


What happens if only BG2 has color math enabled?

On the topic of animation, I think animation is pretty simple to program once you've already figured out what works and what doesn't. When I first started homebrewing I tried uploading every dynamically animated 16x16 sprite at a fixed 30 fps, in the same order they appeared in OAM. I ended up wasting vblank time, being limited to half the available sprites, and inflexible frame rates.


Last edited by psycopathicteen on Wed Jul 13, 2016 8:42 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Jul 13, 2016 6:21 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
psycopathicteen wrote:
being limited to half the available sprites

What now?


Top
 Profile  
 
PostPosted: Wed Jul 13, 2016 6:22 pm 
Offline

Joined: Sun Mar 27, 2016 7:56 pm
Posts: 137
psycopathicteen wrote:
What happens if only BG2 has color math enabled?

Color math only affects the main screen. If only BG1 is on the main screen, all you'll see is BG1. Color math doesn't do anything if the layer it's enabled on isn't on the main screen.


Top
 Profile  
 
PostPosted: Wed Jul 13, 2016 9:21 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2283
Espozo wrote:
psycopathicteen wrote:
being limited to half the available sprites

What now?


Back in 2010, my first attempt at dynamic animation, I did page switching on the bottom 8kB of sprite patterns to double buffer the sprites. I uploaded 4kB one frame, and 4kB the next, and then switched pages. Everything had to be animated at 30fps, and the oam was delayed a frame to sync up with the vram.

This caused a lot of problems. The first was having trouble getting it all in vblank. I wasted time trying to make an unrolled loop, but it still didn't work out. So instead I had it copy the sprite patterns to work RAM, and then DMAing it from there. This was so frustrating for me back then that I had to take a break in programming.


Top
 Profile  
 
PostPosted: Sun Jul 24, 2016 10:25 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2283
Espozo wrote:
So, whenever you use the subscreen, color math is always enabled? It does kind of stink though, because color 0 can't necessarily be whatever you want it to be. I've found that DKC3 does a couple of cool tricks with the video hardware that the other games didn't, like I really like how the tree levels put a window layer behind each tree to have it to where each BG tile can look like it's partially over sprites instead of all or nothing:

Image

About camera movement, wouldn't this be the way to detect what direction the camera has moved in? (assuming it doesn't move #$8000 in one frame :lol: )

Code:
  lda CameraX
  sec
  sbc PreviousCameraX
  beq camera_x_not_moved
  cmp #$8000
  bcc camera_moved_right


You can probably do that to fake a background with Mode-7. Having a wall one color, with sprite bricks on the edges, and having the sky behind it another color.


Top
 Profile  
 
PostPosted: Sun Jul 24, 2016 4:01 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
I've thought about putting a window layer behind BG3 to where you could potentially have 5 colors in one 8x8 block, like this could work great for clouds or mountains or something like that. You could also combine this with scrolling the BG layer vertically every couple of lines and also then changing the tilemap for 5 colors in an 8xWhatever sized area.


Top
 Profile  
 
PostPosted: Sun Jul 24, 2016 7:41 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2283
Or fake a couple mode-7 clouds.

Random news: I'm actually working on adding duplicate checks to my game. I already added an animation number to every metasprite so it can use a "super long list" to point to a CHR table. I will eventually use a linked list too, but I need to have something working first.


Top
 Profile  
 
PostPosted: Sun Jul 24, 2016 8:36 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
psycopathicteen wrote:
I'm actually working on adding duplicate checks to my game. I already added an animation number to every metasprite so it can use a "super long list" to point to a CHR table. I will eventually use a linked list too, but I need to have something working first.
:wink:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group