forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PSP 1.50 Kernel

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Sleepy566



Joined: 28 Dec 2006
Posts: 23

PostPosted: Thu Dec 28, 2006 2:32 am    Post subject: PSP 1.50 Kernel Reply with quote

I'm interested in the PSP dev scene, and I can make basic programs, but I am wondering how to activate the kernel mode in 1.50 PSP's. In the SDK documents it says some functions are only useable in kernel mode, which is why I am asking. I mainly want to use it to read if the memory stick is in, so data can be saved to it etc.

Thanks! (Hope it doesn't sound too noobish)

-Sleepy
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Thu Dec 28, 2006 5:38 am    Post subject: Reply with quote

at the top of your main.c/cpp you only have to edit the macro

/* Define the module info section */
PSP_MODULE_INFO("xxo", /*changed: 0 = usermode, 0x1000 = kmode*/0x1000, 1, 1);

then you also have to think about the main thread of your eboot
if you want to use kmode functions inside this main thread you will need
to set main thread as kmode thread ....like so

/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(/*changed: 0 = kmode thread*/0);

you can find more info in svn looking at the module info sections
and thread manager sections
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
Sleepy566



Joined: 28 Dec 2006
Posts: 23

PostPosted: Thu Dec 28, 2006 7:24 am    Post subject: Reply with quote

So if I wanted to change the function of the volume or screen brightness buttons, what would the source look like for that?

Code:
PSP_MODULE_INFO("Title", 0x1000, 1, 1);

PSP_MAIN_THREAD_ATTR(0);

int main() {
pspDebugScreenInit();
SetupCallbacks();
SceCtrlData pad;


printf("Press [Note] Button to begin.");


while(1) {
          sceCtrlReadBufferPositive(&pad, 1);
          if(pad.Buttons & PSP_CTRL_NOTE) {
                    break;
          }
}


Is that correct?



And what I was after in the first place - how would I write a program to detect if a memory stick or UMD is present? Could I see a source excerpt like mine?

Thanks a ton dot_blank, and whoever else decides to help me!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group