#49462 - Miked0801 - Fri Jul 29, 2005 10:35 pm
Ok, I finally got to look at Minish cap running in no$. Here's what I've noticed:
1. They do not double buffer sprites - that means they can have more sprites VRAM in use, but can only load it during VBlank.
2. They're scrolling system in very char in-efficient. They load 2D areas for objects in VRAM in large chunks instead of per char. Most maps I've seen waste over 10% of their avaiable char space because of this. They also don't free scroll/edge fill their maps which means they're taking more time to scroll than they could.
3. I'm seeing no palette management system for sprites.
4. No$ is screaming every single time they scroll. They have a number of read from NULL bugs in their scroll engine.
5. The artwork is nice :)
6. Fades are done with palettes which allows them to use alpha-blending for in-game effects (clouds going by and such.)
Overall, not impressed with the technology, but am impressed with the gameplay and interface. :)
#49466 - sajiimori - Fri Jul 29, 2005 10:57 pm
I wonder if they load larger BG chunks at a time to get better compression on the ROM.
#49474 - tepples - Sat Jul 30, 2005 12:55 am
Miked0801 wrote: |
They do not double buffer sprites - that means they can have more sprites VRAM in use, but can only load it during VBlank. |
Very common technique. You can replace most or all of sprite cel VRAM during vblank, whether using sprite cel DMA or using an ldmia/stmia loop (such as that of CpuFastSet) for quicker responses to serial interrupts.
Quote: |
Fades are done with palettes which allows them to use alpha-blending for in-game effects (clouds going by and such.) |
I have written some code to do this sort of palette fade. It uses pseudo-vector processing, handling two colors at a time for speed. I wrote it because I wanted to fade to red (not black or white which the HW supports) in a game that I'm working on. Specify a source palette (e.g. in ROM or EWRAM), a destination palette (in palette memory), a target color, and a fade level (0-16, with 0 being entirely the source palette and 16 being entirely the target color).
Code: |
/* originally from luminesweeper/util.c
? Damian Yerrick; provided with NO WARRANTY;
free use is permitted provided this notice is maintained in source code */
void set_palette_dimmed(void *in_dst,
const void *in_src,
unsigned int dim_to,
unsigned int dim_level)
{
u32 *dst = in_dst;
const u32 *src = in_src;
unsigned int n;
unsigned int to_expanded = (dim_to & 0xFFFF) | (dim_to << 16);
unsigned int to_0 = ((to_expanded & 0x7C1F03E0) >> 4) * dim_level;
unsigned int to_1 = ((to_expanded & 0x03E07C1F)) * dim_level;
dim_level = 16 - dim_level;
for(n = 8; n > 0; n--)
{
unsigned int from = *src++;
unsigned int from_0 = ((from & 0x7C1F03E0) >> 4) * dim_level;
unsigned int from_1 = ((from & 0x03E07C1F)) * dim_level;
from_0 = ((from_0 + to_0)) & 0x7C1F03E0;
from_1 = ((from_1 + to_1) >> 4) & 0x03E07C1F;
*dst++ = from_0 | from_1;
}
}
|
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#49477 - gladius - Sat Jul 30, 2005 1:07 am
As for the scrolling read from NULL stuff, it's an anti-emulator thing I think. There is one function that deliberately reads from open bus, and loops on the value read. The instruction is set up so that the read will make the loop only execute 3 times or so.
#49482 - sajiimori - Sat Jul 30, 2005 1:52 am
Apparently it didn't work -- I was able to play Minish Cap on VBA right when it came out. ^_^
#49483 - Miked0801 - Sat Jul 30, 2005 2:37 am
I don't think it's intentional - they aren't reading from NULL directly, they're reading a NULL, offseting by a small amount, then reading (as in newValue = NULL->fooStruct)
On the reading of larger data sets for compression - yeah that's a good idea. It'll get better compression than we do per char :)
The vblank load thing - we've had some games where we have to upload so much sprite info every tic that this is impractical and DBing is needed (check out the Lord of the Rings games when 10-15 enemies are roaming the screen.)
Any other thoughts?
#49485 - tepples - Sat Jul 30, 2005 3:00 am
Miked0801 wrote: |
(check out the Lord of the Rings games when 10-15 enemies are roaming the screen.) |
I sincerely hope that your company didn't work on LotR for Super NES. That game went from suck to blow as soon as I found the bug where Sam's parry would sometimes damage him even with no enemies present.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#49487 - sajiimori - Sat Jul 30, 2005 3:50 am
Nah, he's talking about the GBA versions of Two Towers, Return of the King, and Third Age.