Beispiel #1
0
void firmware() {
    display_init();
    gfx_init_ctxt(&gfx_ctxt, display_init_framebuffer(), 720, 1280, 768);
    gfx_clear_color(&gfx_ctxt, 0xFF000000);
    gfx_con_init(&gfx_con, &gfx_ctxt);
    gfx_con_setcol(&gfx_con, DEFAULT_TEXT_COL, 0, 0);

    while (!sdMount()) {
        error("Failed to init SD card!\n");
        print("Press POWER to power off, any other key to retry\n");
        if (btn_wait() & BTN_POWER)
            i2c_send_byte(I2C_5, 0x3C, MAX77620_REG_ONOFFCNFG1, MAX77620_ONOFFCNFG1_PWR_OFF);
        btn_wait();
    }
    
    if(PMC(APBDEV_PMC_SCRATCH49) != 69 && fopen("/ReiNX.bin", "rb")) {
        fread((void*)PAYLOAD_ADDR, fsize(), 1);
        fclose();
        sdUnmount();
        display_end();
        CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_V) |= 0x400; // Enable AHUB clock.
        CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_Y) |= 0x40;  // Enable APE clock.
        PMC(APBDEV_PMC_SCRATCH49) = 69;
        ((void (*)())PAYLOAD_ADDR)();
    }
    SYSREG(AHB_AHB_SPARE_REG) = (volatile vu32)0xFFFFFF9F;
	PMC(APBDEV_PMC_SCRATCH49) = 0;
    
    print("Welcome to ReiNX %s!\n", VERSION);
    loadFirm();
    drawSplash();
    launch();
}
Beispiel #2
0
void			display_grid(t_grid *grid)
{
	int		x;
	int		y;

	display_strart(grid);
	x = 0;
	while (x < grid->lines)
	{
		y = 0;
		while (y < grid->columns)
		{
			ft_putstr("\033[34mx ");
			if (!grid->grid[x][y])
				ft_putchar(' ');
			else
				display_player(grid->grid[x][y]);
			ft_putchar(' ');
			y++;
		}
		ft_putstr("\033[34mx\n");
		if (x != grid->lines - 1)
			display_inter(grid);
		x++;
	}
	display_end(grid);
}
Beispiel #3
0
void launch() {
    u8 pre4x = pk11Offs->kb < KB_FIRMWARE_VERSION_400;

    se_aes_key_clear(0x8);
    se_aes_key_clear(0xB);

    if (pre4x) {
        if (pk11Offs->kb == KB_FIRMWARE_VERSION_300)
            PMC(APBDEV_PMC_SECURE_SCRATCH32) = 0xE3;
        else if (pk11Offs->kb == KB_FIRMWARE_VERSION_301)
            PMC(APBDEV_PMC_SECURE_SCRATCH32) = 0x104;
        se_key_acc_ctrl(12, 0xFF);
        se_key_acc_ctrl(13, 0xFF);
    } else {
        se_key_acc_ctrl(12, 0xFF);
        se_key_acc_ctrl(15, 0xFF);
    }

    // TODO: Don't Clear 'BootConfig' for retail >1.0.0.
    //memset((void *)0x4003D000, 0, 0x3000);

    SE_lock();

    // Start boot process now that pk21 is loaded.
    *BOOT_STATE_ADDR = (pre4x ? BOOT_PKG2_LOADED : BOOT_PKG2_LOADED_4X);

    // Boot secmon and Wait for it get ready.
    cluster_boot_cpu0(pk11Offs->secmon_base);
    while (!*SECMON_STATE_ADDR)
        usleep(1);

    // Disable display.
    if (pre4x)
        display_end();

    // Signal to finish boot process.
    *BOOT_STATE_ADDR = (pre4x ? BOOT_DONE : BOOT_DONE_4X);;

    // Halt ourselves in waitevent state.
    while (1) FLOW_CTLR(0x4) = 0x50000000;
}
Beispiel #4
0
/************************************************************************
*									*
*  Display image from sisdata.						*
*  Note that it updates all information in Imginfo items.		*
*  									*
*  Before calling g_display_image, it needs to calculate the image	*
*  field of view and its zoomed factor based on the size of display-	*
*  region.   The field of view will indicate the ratio of image 	*
*  between its width and height source data .  The zoomed factor will	*
*  determine the resulting image will look like on the screen. This	*
*  include number of pixels for its width and height so that the image	*
*  will fit into the display-region.					*
*  (STATIC)								*
*									*/
void
Frame_data::display_data(
	Gframe *gframe,			// frame containing data
	Imginfo *imghead,		// pointer of image information header
   	int src_stx, int src_sty,	// data source starting point
   	int src_wd, int src_ht,		// data source width and height
	float vs,			// vertical scale
	int init)                       // initialize canvas region
{
    //cerr << "Start display_data()" << endl;

    
    // Store the image information
    imghead->datastx = src_stx;
    imghead->datasty = src_sty;
    imghead->datawd = src_wd;
    imghead->dataht = src_ht;
    imghead->vs = vs;

    // Update "imghead->pixstx, pixsty, pixwd, pixht" so that image portion
    // defined by datawd, dataht, just fits in the gframe.
    gframe->update_image_position(imghead);

    if (init){
	display_init(gframe);
    }
    gframe->set_clip_region(FRAME_CLIP_TO_IMAGE);

    imghead->display_data(gframe);

    gframe->set_clip_region(FRAME_NO_CLIP);
    gframe->clean = FALSE;
    if (init){
	display_end(gframe);
    }
}