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!

intraFont for 3.xx Kernel????

This is a discussion on intraFont for 3.xx Kernel???? within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I'm having a problem getting intraFont to work for the 3.xx Kernel.... It compiles okay... just when I go to ...

Reply
 
LinkBack Thread Tools
Old 03-30-2008, 04:49 AM   #1

Party at Las Noches!
 
IchigoKurosaki's Avatar
 
Join Date: Jun 2005
Location: Florida
Posts: 1,648
Trader Feedback: 0
Default intraFont for 3.xx Kernel????

I'm having a problem getting intraFont to work for the 3.xx Kernel.... It compiles okay... just when I go to load it... it restarts... Here is my source and Makefile...

Main.c
Code:
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <pspmoduleinfo.h>
#include <psputility.h>
#include <pspgu.h>
#include <pspgum.h>
#include <pspsdk.h>
#include <pspnet.h>
#include <pspnet_inet.h>
#include <pspnet_apctl.h>
#include "intraFont.h"

PSP_MODULE_INFO("FlashmodX", 0, 1, 1);

static int running = 1;
static unsigned int __attribute__((aligned(16))) list[262144];
intraFont* ltn[16];

struct Vertex {
	unsigned int color;
	float x,y,z;
};

#define NUM_SYSTEMPARAMS 15
#define printf  pspDebugScreenPrintf
#define BUF_WIDTH (512)
#define SCR_WIDTH (480)
#define SCR_HEIGHT (272)
#define PIXEL_SIZE (4)
#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
#define ZBUF_SIZE (BUF_WIDTH SCR_HEIGHT * 2)

static void setupGu();
static void drawStuff(void);
int netDialog();
void netInit(void);
void netTerm(void);
int exit_callback(int arg1, int arg2, void *common);
int CallbackThread(SceSize args, void *argp);
int SetupCallbacks(void);

int main(int argc, char *argv[]) {
	sceUtilityLoadNetModule(PSP_NET_MODULE_COMMON);
	sceUtilityLoadNetModule(PSP_NET_MODULE_INET);

	netInit();
	SetupCallbacks();
	intraFontInit();
	
	ltn[4] = intraFontLoad("flash0:/font/ltn4.pgf", INTRAFONT_CACHE_ASCII);
	if (!ltn[4]) sceKernelExitGame();
	
	setupGu();
	
	netDialog();
	netTerm();

	sceKernelExitGame();
	return 0;
}

static void setupGu() {
		sceGuInit();

    	sceGuStart(GU_DIRECT,list);
    	sceGuDrawBuffer(GU_PSM_8888,(void*)0,BUF_WIDTH);
    	sceGuDispBuffer(SCR_WIDTH,SCR_HEIGHT,(void*)0x88000,BUF_WIDTH);
    	sceGuDepthBuffer((void*)0x110000,BUF_WIDTH);
    	sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
    	sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
    	sceGuDepthRange(0xc350,0x2710);
    	sceGuScissor(0,0,SCR_WIDTH,SCR_HEIGHT);
    	sceGuEnable(GU_SCISSOR_TEST);
    	sceGuDepthFunc(GU_GEQUAL);
    	sceGuEnable(GU_DEPTH_TEST);
    	sceGuFrontFace(GU_CW);
    	sceGuShadeModel(GU_SMOOTH);
    	sceGuEnable(GU_CULL_FACE);
    	sceGuEnable(GU_CLIP_PLANES);
    	sceGuFinish();
    	sceGuSync(0,0);

    	sceDisplayWaitVblankStart();
    	sceGuDisplay(GU_TRUE);
}

static void drawStuff(void) {
	sceGuStart(GU_DIRECT, list);

	sceGumMatrixMode(GU_PROJECTION);
	sceGumLoadIdentity();
	sceGumPerspective(75.0f,16.0f/9.0f,0.5f,1000.0f);
	
	sceGuClearColor(0xff000000);
	sceGuClearDepth(0);
	sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);

	intraFontSetStyle(ltn[4], 1.0f, 0xFFFFFFFF, 0xFF000000, INTRAFONT_ALIGN_CENTER);
	intraFontPrint(ltn[4], 240, 25, "Flashmod X - Alpha GUI");
	
	sceGuFinish();
	sceGuSync(0,0);
}

int netDialog() {

   	pspUtilityNetconfData data;

	memset(&data, 0, sizeof(data));
	data.base.size = sizeof(data);
    sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_LANGUAGE, &data.base.language);
    sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_UNKNOWN, &data.base.buttonSwap);
	data.base.graphicsThread = 17;
	data.base.accessThread = 19;
	data.base.fontThread = 18;
	data.base.soundThread = 16;
	data.action = PSP_NETCONF_ACTION_CONNECTAP;
	
	struct pspUtilityNetconfAdhoc adhocparam;
	memset(&adhocparam, 0, sizeof(adhocparam));
	data.adhocparam = &adhocparam;

	sceUtilityNetconfInitStart(&data);
	
	while(running) {
		drawStuff();

		switch(sceUtilityNetconfGetStatus()) {
			case PSP_UTILITY_DIALOG_NONE:
				break;

			case PSP_UTILITY_DIALOG_VISIBLE:
				sceUtilityNetconfUpdate(1);
				break;

			case PSP_UTILITY_DIALOG_QUIT:
				sceUtilityNetconfShutdownStart();
				break;
				
			case PSP_UTILITY_DIALOG_FINISHED:
				return 1;

			default:
				break;
		}

		sceDisplayWaitVblankStart();
		sceGuSwapBuffers();
	}
	
	return 1;
}

void netInit(void) {
	sceNetInit(128*1024, 42, 4*1024, 42, 4*1024);
	sceNetInetInit();
	sceNetApctlInit(0x8000, 48);
}

void netTerm(void) {
	sceNetApctlTerm();
	sceNetInetTerm();
	sceNetTerm();
}

int exit_callback(int arg1, int arg2, void *common) {
	sceKernelExitGame();
	return 0;
}

int CallbackThread(SceSize args, void *argp) {
	int cbid;
	
	cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
	sceKernelRegisterExitCallback(cbid);
	sceKernelSleepThreadCB();
	
	return 0;
}

int SetupCallbacks(void) {
	int thid = 0;
	
	thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, PSP_THREAD_ATTR_USER, 0);
	if (thid >= 0) sceKernelStartThread(thid, 0, 0);

	return thid;
}
Makefile:
Code:
PSPSDK=$(shell psp-config --pspsdk-path)
PSPDIR=$(shell psp-config --psp-prefix)

TARGET = SysParams
OBJS = main.o intraFont.o

CFLAGS = -O2 -G0 -Wall
ASFLAGS = $(CFLAGS)

BUILD_PRX = 1

LIBS = -lpsputility -lpspgum -lpspgu -lm
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = SysParams

include $(PSPSDK)/lib/build.mak
I've tried the sample that comes with intraFont too... I just add "BUILD_PRX = 1" though it did the same as mine... Do I have to have intraFont as an external PRX? I know it's possible because of PSPTube... Though I don't quite know how...

Thanks in advance!
__________________
.:Nobis Development Group:.
.:Personal Portfolio:.

Playstation Portable - PSP1001 - 3.90 M33-2
IchigoKurosaki is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Best prices available for:
Price Range:
$13.00 - $25.00
at 10 Stores

Price Range:
$17.00 - $48.00
at 10 Stores

Old 03-30-2008, 05:08 AM   #2

QJ Gamer Bronze
 
Join Date: Aug 2007
Location: Australia
Posts: 657
Trader Feedback: 0
Default

Problem cant be intraFont because im using it in a game im working on at the moment and running it on my slim
__________________
Xsjado7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-30-2008, 06:40 AM   #3

Developer
 
Join Date: Mar 2006
Posts: 1,026
Trader Feedback: 0
Default

Give yourself some heap space to malloc from.

Code:
PSP_HEAP_SIZE_KB(20480);
Under your PSP_MODULE_INFO line.
__________________

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197

Quote:
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
Insert_Witty_Name is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-30-2008, 08:06 AM   #4

Party at Las Noches!
 
IchigoKurosaki's Avatar
 
Join Date: Jun 2005
Location: Florida
Posts: 1,648
Trader Feedback: 0
Default

Quote:
Originally Posted by Insert_Witty_Name
Give yourself some heap space to malloc from.

Code:
PSP_HEAP_SIZE_KB(20480);
Under your PSP_MODULE_INFO line.
I'll give that a try later hopefully that's all it is =D
-= Double Post =-
Bump...

Just got home from my girlfriend's house and added this to my code:

Code:
PSP_HEAP_SIZE_KB(25000); 
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
and still nothing... The program starts up... you see the Memory Stick light flash a bit... and then it restarts... This program was working before I added intraFont... =/

Last edited by IchigoKurosaki; 03-30-2008 at 05:09 PM.. Reason: Automerged Doublepost
IchigoKurosaki is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-31-2008, 04:30 AM   #5
 
Join Date: Aug 2006
Posts: 6
Trader Feedback: 0
Default

Bump
onigumo1 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-31-2008, 08:56 AM   #6

Party at Las Noches!
 
IchigoKurosaki's Avatar
 
Join Date: Jun 2005
Location: Florida
Posts: 1,648
Trader Feedback: 0
Default

Quote:
Originally Posted by onigumo1
Bump
Thanks for bumping it... Does anyone have any idea why this isn't working?
IchigoKurosaki is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-31-2008, 09:09 AM   #7

QJ Gamer Bronze
 
Join Date: Aug 2007
Location: Australia
Posts: 657
Trader Feedback: 0
Default

Are you sure theres nothing else you've added along with intraFont?
Xsjado7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-31-2008, 09:27 AM   #8

Party at Las Noches!
 
IchigoKurosaki's Avatar
 
Join Date: Jun 2005
Location: Florida
Posts: 1,648
Trader Feedback: 0
Default

Quote:
Originally Posted by Xsjado7
Are you sure theres nothing else you've added along with intraFont?
Nope nothing new... Just used IntraFont 0.22 and the source code up top.
IchigoKurosaki is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-01-2008, 08:26 PM   #9
QJ Gamer Blue
 
Join Date: Mar 2007
Posts: 136
Trader Feedback: 0
Default

IntraFont works fine with Doom for the PSP on the Slim. You might look at the code that comes with it. You might also try commenting out parts of your code to find out exactly where it's hanging.
JLF65 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-01-2008, 08:37 PM   #10

QJ Gamer Bronze
 
Join Date: Aug 2007
Location: Australia
Posts: 657
Trader Feedback: 0
Default

It doesnt hang, it restarts AKA it uses a kernel function
Xsjado7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-02-2008, 01:52 AM   #11

Developer
 
Join Date: Mar 2006
Posts: 1,026
Trader Feedback: 0
Default

I'd guess it restarts because of this line:

Code:
if (!ltn[4]) sceKernelExitGame();
Debug it further to see if and why it's exiting at this stage.
Insert_Witty_Name is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-02-2008, 01:56 AM   #12

Party at Las Noches!
 
IchigoKurosaki's Avatar
 
Join Date: Jun 2005
Location: Florida
Posts: 1,648
Trader Feedback: 0
Default

I got it to work thanks... Not really sure how I fixed it though XD just compiled it for 1.50 tried it out.. worked... then recompiled it for 3.xx and it started to work... LOL XD

Thanks!
IchigoKurosaki is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-02-2008, 02:24 AM   #13

QJ Gamer Bronze
 
Join Date: Aug 2007
Location: Australia
Posts: 657
Trader Feedback: 0
Default

Thats messed
Xsjado7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
3xx , intrafont , kernel

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 12:07 AM.



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