It is currently Wed Oct 18, 2017 1:31 pm

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 77 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
PostPosted: Sat Jul 23, 2016 6:29 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2285
If it allows VRAM access anytime, it has the benefit of not having to delay an animation when the current frame is too DMA busy.


Top
 Profile  
 
PostPosted: Sat Jul 23, 2016 6:53 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19096
Location: NE Indiana, USA (NTSC)
The Sega Genesis VDP's background rendering access pattern offers a few time slots for the CPU to access VRAM during the scanline. VRAM can be written at any time, but more than four writes in quick succession outside vertical or forced blanking will block the CPU until the next slot, causing slowdown. Does X68000's video chip have the same time slot limit?

In addition, if your sprite cels are compressed, you might need to delay an animation until all 16x16 pixel tiles in the cel have been decompressed.


Top
 Profile  
 
PostPosted: Mon Jul 25, 2016 2:16 am 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 781
Stef wrote:
I guess updating the OAM during active display on SNES is even tricker than doing it on MD (from what i read OAM could not be write at all during active display or you get corrupted result).

...yeah, if I've understood correctly, writing OAM during an active line would require ridiculously precise timing, since it's not dual-ported and there's no FIFO or anything, so the write goes to wherever the PPU is looking at the moment*. According to nocash, behaviour during HBlank is unknown and may depend on how many sprites/tiles are on the scanline being prepared. According to byuu, accesses during HBlank go to the HiOAM byte corresponding to the last sprite on the line, and rewriting the address doesn't help. Uniracers actually does this - possibly to prevent sprites from spilling past the screen split in 2-player mode, but I don't think anyone knows for sure...

I may poke at this problem a bit in the near future. Turns out it's actually quite easy to get the SNES to display the contents of OAM, which should help me figure out what's going on.

*The same is true of CGRAM. I managed to exploit this in my DMA direct colour demo, but unfortunately it's nowhere near as useful as the MD version because (a) the SNES has better colour depth normally, so the improvement isn't as noticeable, and (b) the 8-bit DMA cuts the resolution in half, to 64 "pixels" per line. It looks like a really high-colour Atari 2600 game (and when you think about it, it works a fair bit like one too)... on the flip side, since the trick doesn't involve forced blank, BG3 and sprites should still work, as long as they're kept clear of whichever screen the loading pattern is on (main or sub depending on the results of a DMA/PPU alignment test)...

Attachment:
dmac_oam.sfc [64 KiB]
Downloaded 52 times

Quote:
On MD I found a simple trick to display 128 sprites (work both in H32 and H40 mode). You just need to arrange the sprite in SAT so they are linked somehow by Y coordinate (of course still respecting inter sprite priority correctly) so you just need to modify the sprite #0 link field during active display to bypass already rendered sprites. You can modify it once or twice per frame if you really want to exploit the maximum of 128 sprites. This work as internally the link field is 7 bits so the SAT size is 128 entries even if VDP cannot parse more than 80 (linked) entries per scanline.

Sneaky...


Top
 Profile  
 
PostPosted: Mon Jul 25, 2016 5:22 am 
Offline

Joined: Mon Jul 01, 2013 11:25 am
Posts: 228
Yeah i remember about those DMA direct color demo :) Nice accomplishment, to be honest i didn't expected to see it on SNES. The result is a bit less interesting because of the resolution but just for the fun it's cool to see it on SNES as well :p And honestly even on MD it's not really useful as you don't even have enough memory to display a complete screen... It's best to use Sega-CD for full bitmap mode or half screen on Megadrive.


Top
 Profile  
 
PostPosted: Mon Jul 25, 2016 9:54 pm 
Offline

Joined: Fri Jul 04, 2014 9:31 pm
Posts: 781
Stef wrote:
Nice accomplishment, to be honest i didn't expected to see it on SNES.

Thanks! I didn't either, but then byuu said he'd "never once seen a CGRAM write fail", that it would just go to the wrong address during rendering, and it got me thinking.

Sprite multiplexing is of course a very different case. Not to mention that it would be really nice if it were useful as a drop-in enhancement, as your link field trick sounds like it is, rather than just a heavy duty tech demo that requires the rest of the system to stay out of the way. I guess I'll see what I can figure out next time I have the time and inclination...


Top
 Profile  
 
PostPosted: Tue Jul 26, 2016 8:40 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Actually now that I think on it, Stef's idea wouldn't work because the sprite cache can't hold more than 80 sprites so any attempt to link beyond that will result in complete garbage (the VDP tries to use noise instead).


Top
 Profile  
 
PostPosted: Tue Jul 26, 2016 10:44 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2285
Also, if somebody figures out how to do multiplexed sprites on the SNES, there would be no way to control sprite priorities.


Top
 Profile  
 
PostPosted: Tue Jul 26, 2016 5:29 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
How so? Objects get drawn in order, (or at least for me they do) and each section will have its own counter for how many sprites are being drawn.


Top
 Profile  
 
PostPosted: Tue Jul 26, 2016 8:48 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2285
What if you have sprites A, B and C, and you want A to be in front of B, in front of C, but A and C are placed directly below a region boundary. How would this work?


Top
 Profile  
 
PostPosted: Tue Jul 26, 2016 9:46 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
Where is B? I'm not getting this.


Top
 Profile  
 
PostPosted: Tue Jul 26, 2016 10:18 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2285
If B is a little higher than A and C but still overlapping, you'd either need to write A and C around B, or include a second copy of B.


Top
 Profile  
 
PostPosted: Tue Jul 26, 2016 10:35 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3071
Location: Nacogdoches, Texas
psycopathicteen wrote:
or include a second copy of B.

That's what I would have thought you'd do...


Top
 Profile  
 
PostPosted: Wed Jul 27, 2016 4:49 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19096
Location: NE Indiana, USA (NTSC)
That's exactly what you'd do. On Atari 7800, you write a sprite to the display list of all 16-pixel-tall zones it crosses.


Top
 Profile  
 
PostPosted: Wed Jul 27, 2016 6:55 am 
Offline

Joined: Mon Jul 01, 2013 11:25 am
Posts: 228
Sik wrote:
Actually now that I think on it, Stef's idea wouldn't work because the sprite cache can't hold more than 80 sprites so any attempt to link beyond that will result in complete garbage (the VDP tries to use noise instead).


To be honest i never tested the idea (link change mid frame) on the real hardware but are you sure the internal cache size is only 80 sprites long ? I'm almost certain i remember games (as Contra Hardcorp) having sprites located in slots #80 to #127 and could display them short-cuting with link field. In which case it means the sprite cache can actually own the 128 entries...

Note to myself: test that on real hardware ^^


Top
 Profile  
 
PostPosted: Wed Jul 27, 2016 7:47 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Yeah, we checked that during Overdrive's development... Sorry =/ (at first it looks like it sorta works because the VDP doesn't apply any boundaries so it reads high impedance garbage which usually returns back the same old values, but it becomes pretty obvious it's broken not long after)


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users 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