It is currently Mon Dec 11, 2017 4:08 pm

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Thu Sep 25, 2014 1:22 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2421
Since the SNES uses planar mode, you can use the bytes that make up the sprite pattern as indexes to a LUT.


Top
 Profile  
 
PostPosted: Thu Sep 25, 2014 3:36 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
koitsu wrote:
tepples wrote:
Can Super NES OAM even be written during hblank? I know it can on GBA, but GBA has its sprite scaling and rotation in hardware.

Probably -- and could probably be combined with HDMA to do tweaky effects on sprites on a per-scanline basis (e.g. make a sprite wobbly/wavy in a sinus-like manner).

I really doubt there's enough time to write a significant amount of sprites during hblank.

And even then, isn't it very likely that during hblank the SPPU is way too busy fetching sprite data in order to later render it in that scanline? Which would mean that OAM is completely out of reach during hblank as well (as you'd interfere with that process).


Top
 Profile  
 
PostPosted: Thu Sep 25, 2014 5:03 pm 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 818
http://problemkaputt.de/fullsnes.htm#sn ... ryaccesses

It seems no one is sure. A few years ago psycopathicteen had this idea, figuring that you could clone sprites by rewriting their locations during HBlank and get up to 900 of them on screen. All we found out was that the Mega Drive could kinda do it...

Part of the problem is that the OAM address is scrambled during active display and doesn't reset until VBlank or FBlank. Uniracers writes to OAM during HBlank, but as far as I know no one knows exactly what it accomplishes thereby; once the caching for the next scanline is done, the address ends up in the high OAM region and you can't rewrite it (I'm not sure if it ignores writes or if they have unexpected behaviour).

I was considering trying this for my bullet hell port, but there were too many issues, even assuming it was going to work at all...

...

Is it fair to assume that you can't try writing during a scanline, using timed code to target a specific access by the PPU and sneaking in a write to the last-read location before the next read? I don't know if the OAM is wired to allow that, but people seem to be assuming it's not... but if it's not, how was the PPU access timing determined?


Top
 Profile  
 
PostPosted: Thu Sep 25, 2014 7:35 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Well yeah, the Mega Drive can do it perfectly actually, the only issue is that bandwidth is heavily limited during active scan, there's barely enough to overwrite two sprites per scanline (and one sprite alone will fill up the FIFO, so the CPU will get frozen), unless you start exploiting quirks about how the sprite cache works and such. (to be fair, 528 sprites on screen doesn't sound bad...)

However, take into account that the only reason it works on the Mega Drive at all in the first place is because the VDP explicitly allows you to keep writing to video memory during active scan (albeit in limited capacity). The SPPU in the SNES doesn't, and that basically makes this idea pretty much impossible to implement.


Top
 Profile  
 
PostPosted: Thu Sep 25, 2014 7:56 pm 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19330
Location: NE Indiana, USA (NTSC)
Or to put it in the terms of the console wars of the day:

♪ Genesis does ♪
Over two hundred moving objects
♪ You can't do this on Nintendo ♫

I'd like to see a demo that does this.


Top
 Profile  
 
PostPosted: Thu Sep 25, 2014 11:32 pm 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 818
Sik wrote:
Well yeah, the Mega Drive can do it perfectly actually

I was going by TmEE's description, which involved the adjective "jiggly" (though I'm not clear on why this would be). I haven't seen it done myself.

Quote:
However, take into account that the only reason it works on the Mega Drive at all in the first place is because the VDP explicitly allows you to keep writing to video memory during active scan (albeit in limited capacity). The SPPU in the SNES doesn't, and that basically makes this idea pretty much impossible to implement.

Sprite attribute tables on the MD are in VRAM, right? VRAM and OAM are separate on the SNES, meaning the limits on VRAM access (which according to fullsnes may not be as absolute as is generally thought) do not directly prove anything about OAM access. CGRAM, which is analogous to OAM in some respects, is known to be writable during HBlank under at least some circumstances; I've done it myself.

We do know that it is technically possible to edit a certain part of the OAM between scanlines, because Uniracers does it. What is not yet clear, so far as I am aware, is whether it is possible to do anything more interesting/generally applicable, like freely repositioning a sprite after (or while) drawing it. I admit it looks dubious...

Maybe I should try fiddling with this once I have a practical grasp of the sprite system...

...

@psycopathicteen: did you ever get anywhere with this idea?


Top
 Profile  
 
PostPosted: Fri Sep 26, 2014 8:36 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2421
No. I don't have a Neo Myth Cart or PowerPak, so I have no way of testing it out on real hardware.


Top
 Profile  
 
PostPosted: Fri Sep 26, 2014 8:38 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19330
Location: NE Indiana, USA (NTSC)
I have SNES PowerPak and can run a test ROM for you. Or are you talking about needing to test ten different builds in a day?


Top
 Profile  
 
PostPosted: Sat Sep 27, 2014 7:59 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2421
I didn't even start programming the OAM thing.


Top
 Profile  
 
PostPosted: Sat Sep 27, 2014 8:38 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19330
Location: NE Indiana, USA (NTSC)
psycopathicteen wrote:
Since the SNES uses planar mode, you can use the bytes that make up the sprite pattern as indexes to a LUT.

Very interesting trick. I'll have to try it in a demo. And you can even use the same table for the left and right half of a 16x16 by using the multiply ports to shift the right half left by a power of 2.


Top
 Profile  
 
PostPosted: Sat Sep 27, 2014 9:25 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2421
If you're talking about the multiplication trick I've mentioned in the SA-1 thread, I realized something wrong with it. The left-most pixel is bit-7. Maybe it could work, by working right to left, instead of left to right. Another important factor is what format your storing sprites in.


Top
 Profile  
 
PostPosted: Sat Sep 27, 2014 4:40 pm 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19330
Location: NE Indiana, USA (NTSC)
A horizontal sprite squashing method for 1bpp or planar platforms (CV, NES, GB, SMS, TG16, SNES) would be roughly comparable to sprite squashing in the Neo Geo. It would use four lookup tables, totaling 1024 bytes: scale8to7, scale8to6, scale8to5, and scale8to4. Each would be flush right, padded on the left with zeroes.

Pixels:
11223344
(This corresponds to the bitplanes 11001100 00111100 00000011 00000000)
Each plane through right-aligned scale8to6 lookup table:
00112334
(This corresponds to the bitplanes 00110110 00001110 00000001 00000000)
Multiply each plane by four:
11233400
(This corresponds to the bitplanes 11011000 00111000 00000100 00000000)

I know the TG16 is stuck at 16x16 sprites. Does it have any sort of barrel shifter or hardware multiplier, or would it need to use a second set of left-aligned tables?


Top
 Profile  
 
PostPosted: Sun Sep 28, 2014 9:18 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7312
Location: Chexbres, VD, Switzerland
tepples wrote:
Wolfenstein 3D exists. Therefore yes.

psycopathicteen wrote:
Toy Story exists.

tokumaru wrote:
As long as we're playing this game: Jurassic Park exists.


I don't know if this is relevant anymore, but the racing minigame of Chrono Trigger exists.
Tales of Phantasia exists.
Star Ocean exists.


Top
 Profile  
 
PostPosted: Sun Sep 28, 2014 10:38 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Bregalad wrote:
I don't know if this is relevant anymore, but the racing minigame of Chrono Trigger exists.

This one definitely is relevant because it's actual normal sprites being scaled. There are like only two though, and it's possible they're just prerendered since they don't scale that much.

No idea about the other games.


Top
 Profile  
 
PostPosted: Sat Oct 04, 2014 3:21 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 950
Sik wrote:
Bregalad wrote:
I don't know if this is relevant anymore, but the racing minigame of Chrono Trigger exists.

This one definitely is relevant because it's actual normal sprites being scaled. There are like only two though, and it's possible they're just prerendered since they don't scale that much.

No idea about the other games.
You can rotate the camera.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: drludos, Yahoo [Bot] and 10 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