![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
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 ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() Party at Las Noches!
|
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;
}
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 Thanks in advance!
__________________
|
|
|
|
|
|
#2 |
![]() ![]() QJ Gamer Bronze
|
Problem cant be intraFont because im using it in a game im working on at the moment and running it on my slim
__________________
|
|
|
|
|
|
#3 | |
![]() ![]() Developer
|
Give yourself some heap space to malloc from.
Code:
PSP_HEAP_SIZE_KB(20480);
__________________
![]() Check out my homebrew & C tutorials at http://insomniac.0x89.org/ Coder formerly known as Insomniac197 Quote:
|
|
|
|
|
|
|
#4 | |
![]() ![]() Party at Las Noches!
|
Quote:
-= 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); Last edited by IchigoKurosaki; 03-30-2008 at 05:09 PM.. Reason: Automerged Doublepost |
|
|
|
|
|
|
#12 |
![]() ![]() Party at Las Noches!
|
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! |
|
|
|
![]() |
| Tags |
| 3xx , intrafont , kernel |
| Thread Tools | |
|
|