Previous Thread
Next Thread
Print Thread
Page 22 of 120 1 2 20 21 22 23 24 119 120
byuu #52783 08/16/09 09:06 PM
Joined: Aug 2009
Posts: 1,250
Likes: 171
Kale Online Sleepy OP
Very Senior Member
OP Online Sleepy
Very Senior Member
Joined: Aug 2009
Posts: 1,250
Likes: 171
I mean the fact that afaik the screen is drawn correctly without any artifact on a real screen if you toggle gfx modes 1/5 or 5/1, something that's imho impossible to not be noted if the resolution is changed during the frame (otherwise games like Seiken Densetsu 3 weren't programmed like that if it was suicide for the eyes).

Kale #52784 08/16/09 09:57 PM
Joined: Dec 2005
Posts: 330
A
AWJ Offline
Senior Member
Offline
Senior Member
A
Joined: Dec 2005
Posts: 330
Originally Posted by Kale
I don't like the "double everything to 512" approach...unless proven otherwise, in the end Seiken Densetsu 3 is running with HRES=256 and the other test cases runs at HRES=512, so the CRTC is presumably doing some post-processing with the internal framebuffer and trigger the internal 256/512 switch caused by modes 5/6 at vblank time. It works for now for either MESS and for BSNES, but imho it's definitely something that requires tests on real HW if possible (for example by quickly switching between mode 1/5 on a single screen and see if there's or not a noticeable flicker on the resulting screen).

Buh? The SNES doesn't have an "internal framebuffer". I don't know if it even has a linebuffer (byuu?). AFAIK each scanline is rendered directly to the video outputs in real time. Don't confuse multi-thousand-dollar arcade PCBs that could afford to throw on hundreds of kilobytes of RAM with consoles that had to retail for $200.

That Seiken Densetsu 3 screenshot is definitely not what the game looks like on real hardware--the Japanese text is too blocky and almost unreadable.

AWJ #52785 08/16/09 10:07 PM
Joined: Aug 2009
Posts: 1,250
Likes: 171
Kale Online Sleepy OP
Very Senior Member
OP Online Sleepy
Very Senior Member
Joined: Aug 2009
Posts: 1,250
Likes: 171
Every CRTC/video chip has an "internal framebuffer(s)", the sprites / tilemaps / blitters / polygons stuff is just a layer that is then always converted internally by the video HW. It's only a recent "invention" that you can control/write this framebuffer directly, but it was still there from the dawn of times...

About Seiken Densetsu 3, there's certainly a bug regarding that garbage at the top of the talk bar, surely there's a couple of bug in the current mode 5/6 implementation (see also the vertical stripes in that Tokimeki Memorial screen).

Kale #52786 08/16/09 10:13 PM
Joined: Jun 2008
Posts: 205
B
Senior Member
Offline
Senior Member
B
Joined: Jun 2008
Posts: 205
Quote
Buh? The SNES doesn't have an "internal framebuffer". I don't know if it even has a linebuffer (byuu?).

I sincerely doubt it. The closest they have is a sort of pre-fetch line for OAM, to handle all the RTO stuff and sorting. That's why scanline 0 is black, OAM is preparing. And yes, modifying certain registers mid-frame will thusly throw off OAM rendering really bad.

Outside of that, yes. It almost certainly outputs one pixel at a time and moves on.

byuu #52787 08/16/09 10:55 PM
Joined: Dec 2005
Posts: 443
Senior Member
Offline
Senior Member
Joined: Dec 2005
Posts: 443
SNES definitely draws on-the-fly. If it has any sort of *buffer, byuu's right: it's for sprites only.

Reasoning? Why would Nintendo add a framebuffer to the SNES, when the NES didn't have one? The hardware *is* directly related. Also, thwe SUperscope is a heavy argument against a framebuffer.

It's been calculated which way sprites are handled, and the basic answer is "there's no way to tell". The data necessary to hold the tiles and x position info are roughly equal to the demands of plotting the sprites out as tiles are fetched, and only handling priority and palette lookup during rendering to screen.

anomie's research always said that p-hi-res was simply double-pumping the DAC, and there was no reason to think modes 5 and 6 were different.

Kale #52789 08/16/09 11:20 PM
Joined: Dec 2005
Posts: 330
A
AWJ Offline
Senior Member
Offline
Senior Member
A
Joined: Dec 2005
Posts: 330
Originally Posted by byuu
I sincerely doubt it. The closest they have is a sort of pre-fetch line for OAM, to handle all the RTO stuff and sorting. That's why scanline 0 is black, OAM is preparing. And yes, modifying certain registers mid-frame will thusly throw off OAM rendering really bad.

Yeah, that's exactly what I meant by a "linebuffer". I meant a double-buffered setup for sprites--there's no reason to double buffer the BG layers!

When 2D arcade hardware is described as line buffered (e.g. Sega System 16A/B) or frame buffered (e.g. Sega X-Board) it refers to how the sprite generator works--BG layers are practically always rendered directly to the mixer. On a frame buffered system the fact that sprites, but not the BG, are double-buffered is what causes "sprite lag", where the sprites appear a frame or two out of sync with the BG if an emulator (or the original game code!) doesn't take the double buffering into account.

Originally Posted by Kale
About Seiken Densetsu 3, there's certainly a bug regarding that garbage at the top of the talk bar, surely there's a couple of bug in the current mode 5/6 implementation

I wasn't just talking about the garbage. Any time there's even a single visible scanline of hires anywhere on the screen you need to render the entire frame at 512 resolution, otherwise you're throwing ("half-")pixels away.

AWJ #52790 08/16/09 11:41 PM
Joined: Dec 2005
Posts: 443
Senior Member
Offline
Senior Member
Joined: Dec 2005
Posts: 443
well, the SNES backgrounds are double-buffered as well, sort of.

The system doesn't have enough bandwidth to render the worst case scenario unless 2 complete sets of BG tiles are loaded at the start of rendering. It also explains why the left tile in Mode 2/4 is not offset smile

Joined: Dec 2005
Posts: 330
A
AWJ Offline
Senior Member
Offline
Senior Member
A
Joined: Dec 2005
Posts: 330
Originally Posted by Heretical_One
The system doesn't have enough bandwidth to render the worst case scenario unless 2 complete sets of BG tiles are loaded at the start of rendering. It also explains why the left tile in Mode 2/4 is not offset smile

I'm having a hard time wrapping my brain around what you mean by that. What exactly is "double buffered"--the tile pattern data? And how does that help with bandwidth? What is the "worst case scenario", and what happens if it occurs on more than one scanline, or even on every scanline?

AWJ #52794 08/17/09 01:34 AM
Joined: Dec 2005
Posts: 443
Senior Member
Offline
Senior Member
Joined: Dec 2005
Posts: 443
You have to load the second tile of the line before rendering starts. That means tilemap and tile data for up to 4 BGs must be present for 2 complete tiles before you start.

you can load 2 bytes per dot, and you render one pixel or 2 half-pixels in high res in that time.

worst case, you have to reload everything after 1 pixel. The SNES can't do that, but 8 pixels is just enough to do that, necessitating caching a second tile. (1 dot = 1 16-bit read, so 1 tilemap or 1 2bpp chunk of 8 pixels). This is why every time you raise the bit depth, the layers drop: to shift bandwidth to accomodate more planes being fetched.

Work it out, you NEED 2 tiles to draw at all with 7 pixels of the first tile scrolled off the left edge of the screen. Can't work any other way (although the order BGs are fetched in isn't assured, and it's unknown how tiles and tilemaps are interleaved)

This only affects a given line. The whole proces restarts on the next line.

Last edited by Heretical_One; 08/17/09 01:35 AM.
Joined: Dec 2005
Posts: 330
A
AWJ Offline
Senior Member
Offline
Senior Member
A
Joined: Dec 2005
Posts: 330
Oh, you meant double buffered in terms of tiles. I was thinking scanlines, since we were previously talking about line buffering sprite generators. Your explanation makes perfect sense (whereas buffering a scanline ahead makes no sense at all)

I figured that the reason the SNES PPU has the modes it does is because of memory bandwidth as soon as I noticed that the total number of 2-bit planes (doubled in the hires modes) plus the number of layers (counting the OPT table as a layer) always adds up to no more than 8:

Mode 0: 4 layers + 4 planes (1 + 1 + 1 + 1) = 8
Mode 1: 3 layers + 5 planes (2 + 2 + 1) = 8
Mode 2: 3 layers + 4 planes (2 + 2) = 7
Mode 3: 2 layers + 6 planes (4 + 2) = 8
Mode 4: 3 layers + 5 planes (4 + 1) = 8
Mode 5: 2 layers + 6 planes (2*2 + 1*2) = 8
Mode 6: 2 layers + 4 planes (2*2) = 6

ETA: I just noticed that this also explains the limitations of Mode 4 compared to the other OPT modes (i.e. each tile can only have a horizontal or vertical offset applied, not both)

Last edited by AWJ; 08/17/09 03:29 AM.
Page 22 of 120 1 2 20 21 22 23 24 119 120

Link Copied to Clipboard
Who's Online Now
3 members (Dorando, Praxis, 1 invisible), 526 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,320
Posts121,930
Members5,074
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com