It is currently Thu Sep 20, 2018 12:13 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 93 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
PostPosted: Fri Apr 06, 2018 7:05 am 
Offline

Joined: Thu May 19, 2005 11:30 am
Posts: 653
Quote:
And since you HAVE to disable both the left and the top 8 scanlines to ever hope of scrolling sprites smoothly in the NES screen (this is a hardware limitation), this makes 4-screen mirroring almost entierely useless.
Not really. If you have CHR pattern memory to spare, you can keep shifted versions of each sprite to use at the left and upper edges. So if your two-horizontal-sprites object (with anchor point in its top-left corner) is at position X=0, you put sprite A-normal at X=0 and sprite B-normal at X=8, but if the object is at position X=-2, you put sprite A-shift2 at X=0 and sprite B-normal at X=6. Same thing for the upper edge.

Of course, you'd have to prepare each sprite eight by eight times for all possible shift positions in CHR-ROM memory if you want one-pixel granularity, which is why I was wondering how CPU-intensive it would be for a CHR-RAM game to create these shifted sprites on-the-fly as they are needed. I could also imagine a custom mapper hardware monitoring writes to RAM at $0200 to detect sprite data that needs to be shifted (for example, by setting one of the unused bits in OAM Byte 2), and automatically providing shifted CHR pattern data when the PPU requests them.


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 7:20 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1778
Location: Gothenburg, Sweden
Or instead of shifting, if you have chr-ram, and have it organized in dedicated chr space slots for entities (like in solstice) , you can mask individual lines of pixels off the contents in each slot in order to mask out any lines causing a visual wraparound. So, the wraparound is still happening, but the player would never know.

The problem with this approach is you likely have to update the CHR in round-robin/cascadewise. Maybe some clever chr bank cycling can be used depending on mapper to either improve the update rate or what slivers of chr space are masked.

But... it's quite the effort for something as trivial as a little bit of wraparound. It's for those of you who want a mountain to climb. ;)

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 7:32 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2749
I thought sprites disappear off the side, not wrap around.


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 7:42 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1778
Location: Gothenburg, Sweden
Best example i could find in under a minute:

Look at this video: https://www.youtube.com/watch?v=EEtz3g8_kXs
Play it back at 0.25x and pause-play when the enemy wraps around. Note that the leftmost column is disabled though.

sprites wrap around because the sprite xpos is 8 bits (ie 256 positions) which is exactly the width of the screen area. There are no positions off-screen except on the y axis.

Kid Icarus makes frequent use of this as a feature. Vanilla Metroid could have done it in vertical shafts but didn't in practice.


Games that make sprites disappear when going over the left/right edge do so willfully in software by moving them to a non-visible y-position.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 8:02 am 
Offline

Joined: Thu May 19, 2005 11:30 am
Posts: 653
Quote:
sprites wrap around because the sprite xpos is 8 bits (ie 256 positions) which is exactly the width of the screen area. There are no positions off-screen except on the y axis.
That does not explain why a sprite at X=254 would not just be drawn at X=254..255 but also at X=0..5.


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 8:10 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7517
Location: Chexbres, VD, Switzerland
psycopathicteen wrote:
not wrap around.

You mentionned wrap-arround quite a few times, but actually this does not happen (in hardware) for sprites. It happens for BG on the wrong mirroring axis. Normally any metasprite engine would check individual sprites so that no wrapping arround happens, period.

Quote:
Not really. If you have CHR pattern memory to spare, you can keep shifted versions of each sprite to use at the left and upper edges. So if your two-horizontal-sprites object (with anchor point in its top-left corner) is at position X=0, you put sprite A-normal at X=0 and sprite B-normal at X=8, but if the object is at position X=-2, you put sprite A-shift2 at X=0 and sprite B-normal at X=6. Same thing for the upper edge.

Technically this is correct but it'd be so complicated to implement that... it's much simpler to disable the top and left pixels.


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 8:13 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2255
Location: DIGDUG
Just repeating what Bregalad said.

Sprites do NOT wrap on the NES.

They do wrap on the SNES. Which makes pushing them offscreen downward potentially more problematic, if sprite sizes are set larger than 16x16.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 8:34 am 
Offline

Joined: Thu May 19, 2005 11:30 am
Posts: 653
One thing that I will never understand is why someone would program a vertically-scrolling game to use Vertical Mirroring. I'm looking at you, Star Force, Star Soldier, Legendary Wings...


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 8:43 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20563
Location: NE Indiana, USA (NTSC)
dougeff wrote:
They do wrap on the SNES. Which makes pushing them offscreen downward potentially more problematic, if sprite sizes are set larger than 16x16.

Only if 239-line mode is set and the sprite sizes are 32 and 64. In 224-line mode, y=225 should be safe.

NewRisingSun wrote:
One thing that I will never understand is why someone would program a vertically-scrolling game to use Vertical Mirroring. I'm looking at you, Star Force

Tecmo's Star Force scrolls in all four directions. Its playfield is slightly wider than 1 screen, with the background moving horizontally in the opposite direction of the player's craft. It loads the nametable straight across for the same reason that Super Mario Bros. 3 loads the nametable straight down: not having to manage the complexity of both vertical and horizontal scroll seams.


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 8:57 am 
Offline
User avatar

Joined: Sat Jan 09, 2016 9:21 pm
Posts: 455
Location: Central Illinois, USA
NewRisingSun wrote:
One thing that I will never understand is why someone would program a vertically-scrolling game to use Vertical Mirroring. I'm looking at you, Star Force, Star Soldier, Legendary Wings...


Because it makes it easy to use the other screen and a sprite-0 split for a status bar or some other non-scrolling element. My nesdev competition games were both vertically-scrolling, and used vertical mirroring (so I could put a status bar at the top of Spacey McRacey, and put spikes at the bottom of Robo-Ninja Climb) But why games like Legendary Wings used it and DIDN'T have a status bar, I don't know.

_________________
My games: http://www.bitethechili.com


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 9:04 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1778
Location: Gothenburg, Sweden
bregalad wrote:
but actually this does not happen (in hardware) for sprites.[...] Normally any metasprite engine would check individual sprites so that no wrapping arround happens, period.

Ah! Thanks for correcting. Then the problem is even less of a problem.. since you can display the background in the leftmost column while hiding sprites.

gauauu wrote:
But why games like Legendary Wings used it and DIDN'T have a status bar, I don't know.

The code might've been copied directly from another project in their repository to save a bit of time.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 9:56 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7517
Location: Chexbres, VD, Switzerland
FrankenGraphics wrote:
Ah! Thanks for correcting. Then the problem is even less of a problem.. since you can display the background in the leftmost column while hiding sprites.

You can, but this is not what I'd call scrolling properly. Many games do not write to $2001 during gameplay so I invite you to use some cheat code to write $1a to $2001 (instead of the normal $1e or $18) during gameplay and see what happens. This looks super weird and is not what I'd call "proper scrolling". $18 is the canonical way to get 100% "proper" scrite scrolling, but in many cases using $1e and having sprites pop-up is acceptable.


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 10:08 am 
Offline

Joined: Thu May 19, 2005 11:30 am
Posts: 653
I must say I find occasional sprite pop-up less annoying than constantly-black left 8 columns, especially if the graphics obviously weren't designed for it. A Boy and His Blob is the perfect example: thanks to the black bar on the left, the entire red border becomes assymetric. Ugly.


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 3:34 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2749
If people don't notice any popping on Kid Icarus, then it's not a big problem.


Top
 Profile  
 
PostPosted: Fri Apr 06, 2018 6:18 pm 
Online
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10814
Location: Rio de Janeiro - Brazil
I don't mind a little sprite popping, but it's annoying when games make entire characters pop.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: koitsu and 7 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