libnds: setBrightness

Post Reply
RyouArashi
Posts: 29
Joined: Sun Mar 29, 2009 9:23 pm

libnds: setBrightness

Post by RyouArashi » Sun Mar 29, 2009 9:32 pm

In video.c :
//---------------------------------------------------------------------------------
void setBrightness( int screen, int level) {
//---------------------------------------------------------------------------------
int mode = 1<<14;

if ( level < 0){
level = -level;
mode = 2<<14;
}

if (level>16) level =16;

if (screen & 1) REG_MASTER_BRIGHT=(mode | level);
if (screen & 2) REG_MASTER_BRIGHT=(mode | level);
}
The function only sets Brightness for the main engine.

This line should set the brightness
for the sub engine, but instead sets the main engine again:

if (screen & 2) REG_MASTER_BRIGHT=(mode | level);


EDIT:
The correct register should be REG_MASTER_BRIGHT_SUB


Keep on your good work
RyouArashi

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: libnds: setBrightness

Post by eKid » Wed Apr 15, 2009 2:32 pm

Thanks for pointing that out, it'll be fixed for next release.

Aeluin
Posts: 3
Joined: Sat Apr 04, 2009 6:22 pm

Re: libnds: setBrightness

Post by Aeluin » Mon May 18, 2009 3:30 pm

Hello!

Excuse me for resurrect the Post ( necromancer!!) and for the English (I'm spanish).

Where could be the video.c file in hard disk? I'm trying to search it for modify these lines but I don't found it. I have installed devkitpro in C:\

Thanks you for reading

Al_Bro
Posts: 15
Joined: Wed Apr 08, 2009 10:33 pm

Re: libnds: setBrightness

Post by Al_Bro » Thu May 21, 2009 9:56 pm

If you've just installed the devkitpro updater (the obvious download link) then you probably won't have it. You need to download the libnds source code, modify the files and then build it. Not sure if this link will work, but try http://sourceforge.net/project/showfile ... _id=151608. You want to look for the source code file (currently libnds-src-1.3.3.tar.bz2) and you'll need a program like 7-Zip to be able to extract it on windows.

After you've built the library you'll need to make sure that you copy the built library files (look for files like libnds9.a and libnds9d.a in the lib directory) into the main libnds library directory (c:\devkitpro\libnds\lib on my installation).

WinterMute
Site Admin
Posts: 1986
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: libnds: setBrightness

Post by WinterMute » Fri May 22, 2009 4:00 pm

Installation is handled automatically by using "make install", manual copying is frowned upon :p
Help keep devkitPro toolchains free, Donate today

Personal Blog

Al_Bro
Posts: 15
Joined: Wed Apr 08, 2009 10:33 pm

Re: libnds: setBrightness

Post by Al_Bro » Sat May 23, 2009 9:02 pm

Excellent - I didn't realise it had been set up to do that. In that case yes, that's a much better way than manually copying.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest