QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

[C] [PRX] blit_string

This is a discussion on [C] [PRX] blit_string within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hi, Im trying to make a PRX but when i try it, i dont see the string i want to ...

Reply
 
LinkBack Thread Tools
Old 12-30-2007, 06:41 AM   #1
 
basfreak's Avatar
 
Join Date: Dec 2007
Location: Netherlands
Posts: 147
Trader Feedback: 0
Default [C] [PRX] blit_string

Hi,

Im trying to make a PRX but when i try it, i dont see the string i want to print.

this is my C code:
Code:
#include <pspkernel.h>
#include <string.h>
#include <stdlib.h>
#include "blit.h"

//#define printf(fmt, ...)
#define debug_log(fmt, ...)

PSP_MODULE_INFO("IRSMP3", 0x1000, 1, 1);


int main_thid;
int main_thread(SceSize args, void *argp)
{
    
    while(1)
    {
        sceKernelDelayThread(50000);


                        blit_string(60-17,265,"RAND",0xffffff,0x000000);

    }
}

int module_start(SceSize args, void *argp)
{

   	main_thid = sceKernelCreateThread("IRSMAIN_Thread", main_thread, /*8*/ 8, 0x04000, 0, NULL);
   	if(main_thid >= 0)
   	{
   		sceKernelStartThread(main_thid, args, argp);
   	}

	return 0;
}

//this isn't called
int module_stop(SceSize args, void *argp)
{
	return (0);
}
Makefile:
Code:
TARGET = irsmp3
OBJS = mp3.o blit.o exports.o

USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1
PRX_EXPORTS = exports.exp

INCDIR = 
CFLAGS = -DNOEXIT -DFPM_MIPS -O2 -G0 -Wall
#CFLAGS = -DNOEXIT -DFPM_MIPS -O2 -G0 -Wall -fno-builtin-printf
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LIBS = -lpspkernel -lpsplibc

#EXTRA_TARGETS = EBOOT.PBP
#PSP_EBOOT_TITLE = SDK Test v1.0

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak
exports.exp:
Code:
# Define the exports for the prx
PSP_BEGIN_EXPORTS

# These four lines are mandatory (although you can add other functions like module_stop)
# syslib is a psynonym for the single mandatory export.
PSP_EXPORT_START(syslib, 0, 0x8000)
PSP_EXPORT_FUNC(module_start)
PSP_EXPORT_FUNC(module_stop)
PSP_EXPORT_VAR(module_info)
PSP_EXPORT_END

PSP_EXPORT_START(irsmp3, 0, 0x4001)
PSP_EXPORT_END

PSP_END_EXPORTS
As you can see i've edited the original irsmp3.

Does anyone know why it doesn't work?

Bye,
basfreak is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-30-2007, 07:52 AM   #2
 
Smartpal's Avatar
 
Join Date: Dec 2007
Location: New Delhi
Posts: 134
Trader Feedback: 0
Default

I think this should be in Developer's Dungeon...
Smartpal is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-30-2007, 08:06 AM   #3

Developer
 
Mr305's Avatar
 
Join Date: Nov 2006
Posts: 1,521
Trader Feedback: 0
Default

Quote:
Originally Posted by basfreak
Hi,

Im trying to make a PRX but when i try it, i dont see the string i want to print.

this is my C code:
Code:
#include <pspkernel.h>
#include <string.h>
#include <stdlib.h>
#include "blit.h"

//#define printf(fmt, ...)
#define debug_log(fmt, ...)

PSP_MODULE_INFO("IRSMP3", 0x1000, 1, 1);


int main_thid;
int main_thread(SceSize args, void *argp)
{
    
    while(1)
    {
        sceKernelDelayThread(50000);


                        blit_string(60-17,265,"RAND",0xffffff,0x000000);

    }
}

int module_start(SceSize args, void *argp)
{

       main_thid = sceKernelCreateThread("IRSMAIN_Thread", main_thread, /*8*/ 8, 0x04000, 0, NULL);
       if(main_thid >= 0)
       {
           sceKernelStartThread(main_thid, args, argp);
       }

    return 0;
}

//this isn't called
int module_stop(SceSize args, void *argp)
{
    return (0);
}
Makefile:
Code:
TARGET = irsmp3
OBJS = mp3.o blit.o exports.o

USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1
PRX_EXPORTS = exports.exp

INCDIR = 
CFLAGS = -DNOEXIT -DFPM_MIPS -O2 -G0 -Wall
#CFLAGS = -DNOEXIT -DFPM_MIPS -O2 -G0 -Wall -fno-builtin-printf
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LIBS = -lpspkernel -lpsplibc
 
#EXTRA_TARGETS = EBOOT.PBP
#PSP_EBOOT_TITLE = SDK Test v1.0

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak
exports.exp:
Code:
# Define the exports for the prx
PSP_BEGIN_EXPORTS

# These four lines are mandatory (although you can add other functions like module_stop)
# syslib is a psynonym for the single mandatory export.
PSP_EXPORT_START(syslib, 0, 0x8000)
PSP_EXPORT_FUNC(module_start)
PSP_EXPORT_FUNC(module_stop)
PSP_EXPORT_VAR(module_info)
PSP_EXPORT_END

 PSP_EXPORT_START(irsmp3, 0, 0x4001)
PSP_EXPORT_END
 
PSP_END_EXPORTS
As you can see i've edited the original irsmp3.

Does anyone know why it doesn't work?

Bye,

The bolded ones are not needed.

You are trying to use LIBC and use the flag Kernel LIBC which is totally contrary.
Since you aren't exporting any funcs, these
Code:
PSP_EXPORT_START(irsmp3, 0, 0x4001)
PSP_EXPORT_END
aren't needed
Mr305 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-31-2007, 12:32 AM   #4
 
basfreak's Avatar
 
Join Date: Dec 2007
Location: Netherlands
Posts: 147
Trader Feedback: 0
Default

the error:
Quote:
$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -DNOEXIT -DFPM_MIPS -O2 -G0 -Wal
l -D_PSP_FW_VERSION=150 -c -o blit.o blit.c
blit.c: In function 'blit_string':
blit.c:148: warning: implicit declaration of function 'sceDisplayGetMode'
blit.c:149: warning: implicit declaration of function 'sceDisplayGetFrameBuf'
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -DNOEXIT -DFPM_MIPS -O2 -G0 -Wal
l -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib -Wl,-q,-T/usr/local
/pspdev/psp/sdk/lib/linkfile.prx -mno-crt0 -nostartfiles mp3.o blit.o exports.
o -lpspkernel -lpspdebug -lpspdisplay_driver -lpspctrl_driver -lpspsdk -lc -lpsp
kernel -o irsmp3.elf
psp-fixup-imports irsmp3.elf
psp-prxgen irsmp3.elf irsmp3.prx

USE_KERNEL_LIBC = 1 also delete?

Last edited by basfreak; 12-31-2007 at 12:47 AM..
basfreak is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-31-2007, 02:15 AM   #5
 
Maxy_PSP's Avatar
 
Join Date: Sep 2007
Location: BELGIUM !!
Posts: 234
Trader Feedback: 0
Default

check VSHBlitter on PSP-Programming.com forums,

With VSHBlitter you can blit a string or image in the VSH(XMB)
Maxy_PSP is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-31-2007, 05:17 AM   #6

Developer
 
Raphael's Avatar
 
Join Date: Jan 2006
Location: Germany
Posts: 919
Trader Feedback: 0
Default

Quote:
Originally Posted by basfreak
the error:
Quote:
blit.c: In function 'blit_string':
blit.c:148: warning: implicit declaration of function 'sceDisplayGetMode'
blit.c:149: warning: implicit declaration of function 'sceDisplayGetFrameBuf'
USE_KERNEL_LIBC = 1 also delete?
No, that just means you should include pspdisplay.h in your blit.c file.
__________________
Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.
Raphael is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-31-2007, 09:00 AM   #7
 
basfreak's Avatar
 
Join Date: Dec 2007
Location: Netherlands
Posts: 147
Trader Feedback: 0
Default

it doesnt work anyway

PSP-Dev@bas /cygdrive/c/psp/mp3prx
$ make
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I. -I/usr/local/pspdev/psp/sdk
/include -DNOEXIT -DFPM_MIPS -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -c -o blit.o
blit.c
blit.c: In function 'blit_string':
blit.c:149: warning: passing argument 4 of 'sceDisplayGetFrameBuf' makes integer
from pointer without a cast
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I. -I/usr/local/pspdev/psp/sdk
/include -DNOEXIT -DFPM_MIPS -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -L. -L/usr/loc
al/pspdev/psp/sdk/lib -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx -mno-c
rt0 -nostartfiles mp3.o blit.o exports.o -lpspkernel -lpspdebug -lpspdisplay_d
river -lpspctrl_driver -lpspsdk -lpspkernel -o irsmp3.elf
psp-fixup-imports irsmp3.elf
psp-prxgen irsmp3.elf irsmp3.prx

Last edited by basfreak; 12-31-2007 at 09:39 AM..
basfreak is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-26-2008, 03:03 AM   #8
 
Join Date: Oct 2008
Posts: 2
Trader Feedback: 0
Default

The blit_string function use character unit not pixel unit to set the text position,you should try blit_string(((60-17) / 8) - ((60 - 17) % 8),(265 / 8) - (265 % 8),"RAND",0xffffff,0x0000 00);
adraveny is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-27-2008, 11:44 AM   #9
 
basfreak's Avatar
 
Join Date: Dec 2007
Location: Netherlands
Posts: 147
Trader Feedback: 0
Default

Why did u bump the thread?
basfreak is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
blitstring , prx

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 04:42 PM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us