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 

how to make code Slim compatible?

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



Joined: 30 Mar 2008
Posts: 261

PostPosted: Sun May 18, 2008 3:47 am    Post subject: how to make code Slim compatible? Reply with quote

I'm nog a verry beginner but i don't understand why some programs only run under 1.50 kernel and others on both 1.50 and 3.xx . So what i want to know is: What makes a program a 1.50 one or a 3.xx one. I only have a psp slim so i can't run the 1.50 progams.

My other question is:
How can i make the SDK sample codes 3.xx compatible. I've here the Debug/kprintf sample witch is not 3.xx compatible.

(If you can find a topic where it's explained, please give the link. I spend minutes but i didn't find any good topics/tutorials)

What have i to change to get is 3.xx compatible
main.c
Code:
/*
 * PSP Software Development Kit - http://www.pspdev.org
 * -----------------------------------------------------------------------
 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
 *
 * main.c - Basic sample to demonstrate the kprintf handler.
 *
 * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
 * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
 * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
 *
 * $Id: main.c 1095 2005-09-27 21:02:16Z jim $
 */
#include <pspkernel.h>
#include <pspdebug.h>

PSP_MODULE_INFO("KPTEST", 0x1000, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(0);

/* Define printf, just to make typing easier */
#define printf   pspDebugScreenPrintf

/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
   sceKernelExitGame();

   return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
   int cbid;

   cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
   sceKernelRegisterExitCallback(cbid);

   sceKernelSleepThreadCB();

   return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
   int thid = 0;

   thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, THREAD_ATTR_USER, 0);
   if(thid >= 0)
   {
      sceKernelStartThread(thid, 0, 0);
   }

   return thid;
}

int main(void)
{
   pspDebugScreenInit();
   SetupCallbacks();

   printf("Kprintf Example:\n\n");

   pspDebugInstallKprintfHandler(NULL);

   printf("Lets test a kernel function error report\n");
   pspDebugScreenSetTextColor(0xFF);
   /* Try and load a module, this should print an error to the screen */
   sceKernelLoadModule("test:/this/is/not/a/file.prx", 0, NULL);
   pspDebugScreenSetTextColor(0xFFFFFFFF);
   printf("\nLets call Kprintf directly\n");
   pspDebugScreenSetTextColor(0xFF);
   Kprintf("Hello from Kprintf\n");
   
   /* Let's bug out */
   sceKernelExitDeleteThread(0);

   return 0;
}


Makefile:
Code:
TARGET = kptest
OBJS = main.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Kprintf Test

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Back to top
View user's profile Send private message
pspZorba



Joined: 22 Sep 2007
Posts: 156
Location: NY

PostPosted: Sun May 18, 2008 5:33 am    Post subject: Reply with quote

read:

http://forums.ps2dev.org/viewtopic.php?p=59285

http://forums.ps2dev.org/viewtopic.php?t=9547&highlight=kernel+prx

http://forums.ps2dev.org/viewtopic.php?p=58653
_________________
--pspZorba--
NO to K1.5 !
Back to top
View user's profile Send private message
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Sun May 18, 2008 9:45 pm    Post subject: Reply with quote

If i count only my own replies to this specific question i will die of age before i finish...Many other time people here demonstrated theirself unkind telling only to "USE SEARCH BUTTON" for far more exotical questions...
Back to top
View user's profile Send private message
pspZorba



Joined: 22 Sep 2007
Posts: 156
Location: NY

PostPosted: Sun May 18, 2008 11:47 pm    Post subject: Reply with quote

Yes I don't know what happened to me yesterday.. ;-)
_________________
--pspZorba--
NO to K1.5 !
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