Code: Select all
void myEngineEnable(int state){
sceGuEnable(state);
}
All compiles okay, but the program stops at sceGeSyncList, and I d'ont know why.
Initialization :
Code: Select all
static unsigned int __attribute__((aligned(16))) ge_init_list[] = { ...... }; //The same as PSPGU
unsigned int __attribute__((aligned(16))) DisplayList[262144] = { 0 };
void createContext(){
libge_context = &libge_contexts[0];
ge_edram_address = (u32)sceGeEdramGetAddr();
// initialize graphics hardware
ge_list_executed[0] = sceGeListEnQueue((void*)((unsigned int)ge_init_list & 0x1fffffff), 0, 0, 0);
sceGeListSync(ge_list_executed[0], 0); //This works good, so the PSPGE is initialized ?!
libge_context->dList.start = DisplayList;
libge_context->dList.current = libge_context->dList.start;
libge_context->clear_color = 0xffffffff;
//The same as PSPGU, in sceGuStart
static int dither_matrix[16] = {
-4, 0,-3, 1,
2,-2, 3,-1,
-3, 1,-4, 0,
3,-1, 2,-2
};
geSetDither((ScePspIMatrix4*)dither_matrix);
geSendCommandi(CMD_PATCH_DIVIDE, (16 << 8)|16);
geSendCommandi(CMD_MATERIAL, GU_AMBIENT|GU_DIFFUSE|GU_SPECULAR);
geSendCommandf(CMD_SPECULAR, 1.0f);
geSendCommandf(CMD_TEX_SCALE_U, 1.0f);
geSendCommandf(CMD_TEX_SCALE_V, 1.0f);
}
Code: Select all
void Init(){
createContext();
geDrawBuffer(GU_PSM_8888, 0, 512);
geDispBuffer((void*)(512*272*4), 480, 272);
geScissor(0, 0, 480, 272);
geAmbientColor(0xffffffff);
geDisable(GE_DEPTH_TEST);
geEnable(GE_TEXTURE_2D);
geDrawSync(); //The bug is in this function
}
Code: Select all
void geDrawSync(){
*(libge_context->dList.current++) = 0x0f000000;
*(libge_context->dList.current++) = 0x0c000000;
*(libge_context->dList.current++) = 0x00000000;
*(libge_context->dList.current++) = 0x00000000;
ge_list_executed[0] = sceGeListEnQueue(libge_context->dList.start, libge_context->dList.current, 0, NULL);
pspDebugScreenPrintf("SyncList...\n");
sceGeListSync(ge_list_executed[0], PSP_GE_LIST_DONE);
//The program stops running here (i can see "SyncList..." on screen, but not "Ok"
pspDebugScreenPrintf("Ok\n");
sceGeDrawSync(PSP_GE_LIST_DRAWING_DONE);
libge_context->dList.current = libge_context->dList.start; //Reset list
}