Ejemplo n.º 1
0
static void
glw_ps3_mainloop(glw_ps3_t *gp)
{
  int currentBuffer = 0;
  TRACE(TRACE_INFO, "GLW", "Entering mainloop");
#if 0
  int r = ioPadSetPortSetting(6, 0xffffffff);
  TRACE(TRACE_ERROR, "PS3PAD", "portsetting=0x%x", r);
#endif

  sysRegisterCallback(EVENT_SLOT0, eventHandle, gp);
  while(!gp->stop) {

    handle_pads(gp);
    handle_kb(gp);


    waitFlip();
    drawFrame(gp, currentBuffer, 1);
    flip(gp, currentBuffer);
    currentBuffer = !currentBuffer;
    sysCheckCallback();
  }
  waitFlip();
  drawFrame(gp, currentBuffer, 0);
  flip(gp, currentBuffer);
  currentBuffer = !currentBuffer;

  sysUnregisterCallback(EVENT_SLOT0);
}
Ejemplo n.º 2
0
s32 main(s32 argc, const char* argv[])
{

	atexit(appCleanup);
	deadrsx_init();
	ioPadInit(7);
	sysRegisterCallback(EVENT_SLOT0, eventHandle, NULL);

	u32 *frag_mem = rsxMemAlign(256, 256);
	printf("frag_mem = 0x%08lx\n", (u64) frag_mem);
	realityInstallFragmentProgram_old(context, &nv30_fp, frag_mem);

        loading(); // where all the loading done xD

	long frame = 0; 

	while(1){
                ps3_pad(); // where all are controls are
		waitFlip(); // Wait for the last flip to finish, so we can draw to the old buffer
		drawFrame(currentBuffer, frame++); // Draw into the unused buffer
		flip(currentBuffer); // Flip buffer onto screen
		currentBuffer = !currentBuffer;
		sysCheckCallback();

	}
	
	return 0;
}
Ejemplo n.º 3
0
int main(int argc, const char* argv[])
{
    msgType mdialogok	= MSGDIALOG_NORMAL | MSGDIALOG_BUTTON_TYPE_OK;
    msgType mdialogyesno	= MSGDIALOG_NORMAL | MSGDIALOG_BUTTON_TYPE_YESNO;

    sysRegisterCallback(EVENT_SLOT0, handleevent, NULL);

    init_screen();
    ioPadInit(7);

    waitFlip();

    Lv2FsStat entry;
    int is_mounted = lv2FsStat(MOUNT_POINT, &entry);

    showmessage(mdialogyesno, (is_mounted == 0) ? "Do you want to unmount dev_rwflash ?" : "Do you want to mount dev_rwflash ?");

    if(dlg_action == MSGDIALOG_BUTTON_YES)
    {
        if(is_mounted == 0)
            showmessage(mdialogok, (lv2FsUnmount(MOUNT_POINT) == 0) ? "Successfully unmounted dev_rwflash." : "An error occured while unmounting dev_rwflash.");
        else
            showmessage(mdialogok, (lv2FsMount(DEV_FLASH1, FS_FAT32, MOUNT_POINT, 0) == 0) ? "Successfully mounted dev_rwflash." : "An error occured while mounting dev_rwflash.");
    }

    return 0;
}
Ejemplo n.º 4
0
static void
glw_ps3_mainloop(glw_ps3_t *gp)
{
  int currentBuffer = 0;
  TRACE(TRACE_DEBUG, "GLW", "Entering mainloop");



  sysRegisterCallback(EVENT_SLOT0, eventHandle, gp);
  while(gp->gp_stop != 10) {

    if(gp->gp_stop)
      gp->gp_stop++;

    handle_pads(gp);
    handle_kb(gp);

    waitFlip();
    drawFrame(gp, currentBuffer, 1);
    flip(gp, currentBuffer);
    currentBuffer = !currentBuffer;
    sysCheckCallback();
  }
  waitFlip();
  drawFrame(gp, currentBuffer, 0);
  flip(gp, currentBuffer);
  currentBuffer = !currentBuffer;

  sysUnregisterCallback(EVENT_SLOT0);
}
Ejemplo n.º 5
0
s32 main(s32 argc, const char* argv[])
{
	PadInfo padinfo;
	PadData paddata;
	int i;
	
	atexit(appCleanup);
	init_screen();
	ioPadInit(7);
	sysRegisterCallback(EVENT_SLOT0, eventHandle, NULL);

	// Load texture
	dice = loadPng(dice_bin);
	assert(realityAddressToOffset(dice.data, &tx_offset) == 0);

	//load_acid_texture((uint8_t *)tx_mem, 0);

	// install fragment shader in rsx memory
	u32 *frag_mem = rsxMemAlign(256, 256);
	printf("frag_mem = 0x%08lx\n", (u64) frag_mem);
	realityInstallFragmentProgram_old(context, &nv30_fp, frag_mem);

	long frame = 0; // To keep track of how many frames we have rendered.
	
	// Ok, everything is setup. Now for the main loop.
	while(1){
		// Check the pads.
		ioPadGetInfo(&padinfo);
		for(i=0; i<MAX_PADS; i++){
			if(padinfo.status[i]){
				ioPadGetData(i, &paddata);
				
				if(paddata.BTN_CROSS || paddata.BTN_START){
					return 0;
				}
			}
			
		}

		waitFlip(); // Wait for the last flip to finish, so we can draw to the old buffer
		drawFrame(currentBuffer, frame++); // Draw into the unused buffer
		flip(currentBuffer); // Flip buffer onto screen
		currentBuffer = !currentBuffer;
		sysCheckCallback();

	}
	
	return 0;
}