[libnds] VRAM B Enumeration, suggested change

Add your suggestions for toolchain improvements here.
Post Reply
Sylus101
Posts: 179
Joined: Wed Dec 24, 2008 5:08 am

[libnds] VRAM B Enumeration, suggested change

Post by Sylus101 » Wed Sep 16, 2009 6:33 pm

The current enumeration for VRAM B's modes in video.h are:

Code: Select all

typedef enum {
	VRAM_B_LCD = 0,
	VRAM_B_MAIN_BG	= 1 | VRAM_OFFSET(1),
	VRAM_B_MAIN_BG_0x06000000	= 1 | VRAM_OFFSET(0),
	VRAM_B_MAIN_BG_0x06020000	= 1 | VRAM_OFFSET(1),
	VRAM_B_MAIN_BG_0x06040000	= 1 | VRAM_OFFSET(2),
	VRAM_B_MAIN_BG_0x06060000	= 1 | VRAM_OFFSET(3),
	VRAM_B_MAIN_SPRITE	= 2 | VRAM_OFFSET(1),
	VRAM_B_MAIN_SPRITE_0x06400000	= 2,
	VRAM_B_MAIN_SPRITE_0x06420000	= 2 | VRAM_OFFSET(1),
	VRAM_B_TEXTURE	= 3 | VRAM_OFFSET(1),
	VRAM_B_TEXTURE_SLOT0	= 3 | VRAM_OFFSET(0),
	VRAM_B_TEXTURE_SLOT1	= 3 | VRAM_OFFSET(1),
	VRAM_B_TEXTURE_SLOT2	= 3 | VRAM_OFFSET(2),
	VRAM_B_TEXTURE_SLOT3	= 3 | VRAM_OFFSET(3)
} VRAM_B_TYPE;
VRAM_B_MAIN_SPRITE is currently defined with a VRAM_OFFSET(1) which makes the assumption that you're also using Bank A for Sprites as well, 256KB for Sprites... I would remove the VRAM_OFFSET(1) for this entry, at least it makes more sense to me. Of course you can use VRAM_B_MAIN_SPRITE_0x06400000 in your code, but since VRAM_B_MAIN_SPRITE seems to be some kind of default, it makes the most sense to me to do away with the offset.
-Sylus "Not Stylus..." McFrederickson

Come visit my web site.

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: [libnds] VRAM B Enumeration, suggested change

Post by vuurrobin » Thu Sep 17, 2009 6:43 pm

I agree, VRAM_B_MAIN_SPRITE is the default, which should be with no offset (that, or it should be removed/replaced with the _SLOT_N idea in the topic from gbadev).

there was also some talk about it here:
http://forum.gbadev.org/viewtopic.php?t=16846

which produced a post here:
http://forums.devkitpro.org/viewtopic.php?f=6&t=1505


I also suggest to add enums with adresses to the ones that don't have it already. currently, the vram A, B and C has all has adress variants for the sprite and background constants. however, VRAM_D_SUB_SPRITE doesn't have an with adress variant. some other vram constants also has this, or the other way around (they have an adress constant, but no default constant (although this isn't a big of a deal)).

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests