Ejemplo n.º 1
0
int main()
{
#if GEKKO
    VIDEO_Init();
#if HW_RVL
    WPAD_Init();
#endif
    PAD_Init();

    rmode = VIDEO_GetPreferredMode(nullptr);
    xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));

    CON_Init(xfb, 20, 20, rmode->fbWidth, rmode->xfbHeight, rmode->fbWidth * VI_DISPLAY_PIX_SZ);
    CON_EnableGecko(CARD_SLOTB, true);

    VIDEO_Configure(rmode);
    VIDEO_SetBlack(false);

    VIDEO_Flush();

    VIDEO_WaitVSync();
    if (rmode->viTVMode & VI_NON_INTERLACE)
        VIDEO_WaitVSync();

    athena::io::MemoryCopyReader test("sd:/test.dat");
    while(true)
    {
#if HW_RVL
        WPAD_ScanPads();
#endif
        PAD_ScanPads();
        if (PAD_ButtonsDown(0) & PAD_BUTTON_START)
            break;

#if HW_RVL
        if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME)
            break;
#endif
        VIDEO_WaitVSync();
    }
#endif
    return 0;
}
Ejemplo n.º 2
0
void InitDebug()
{
	if (CFG.debug_gecko & (1|4))
	{
		if (usb_isgeckoalive(EXI_CHANNEL_1)) {
			usb_flush(EXI_CHANNEL_1);
			if (!gecko_enabled) {
				gecko_enabled = 1;
				gecko_prints("\n\n====================\n\n");
			}
		}
	}
	if (CFG.debug_gecko & 2) {
		CON_EnableGecko(EXI_CHANNEL_1, 0);
	}
	debug_inited = 1;
	if (strlen(dbg_log_buf)) {
		gecko_printf(">>>\n%s\n<<<\n", dbg_log_buf);
	}
}
Ejemplo n.º 3
0
void InitTextVideo ()
{
    gprintf("\nInitTextVideo ()");
    if (textVideoInit)
    {
        gprintf("...0");
        return;
    }
    dbvideo=1;
    VIDEO_Init();
                                                  // get default video mode
    GXRModeObj *vmode = VIDEO_GetPreferredMode(NULL);

    // widescreen fix
    VIDEO_Configure (vmode);

    // Allocate the video buffers
    xfb = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (vmode));

    // A console is always useful while debugging
    console_init (xfb, 20, 64, vmode->fbWidth, vmode->xfbHeight, vmode->fbWidth * 2);

    // Clear framebuffers etc.
    VIDEO_ClearFrameBuffer (vmode, xfb, COLOR_BLACK);
    VIDEO_SetNextFramebuffer (xfb);

    VIDEO_SetBlack (FALSE);
    VIDEO_Flush ();
    VIDEO_WaitVSync ();
    if (vmode->viTVMode & VI_NON_INTERLACE)
        VIDEO_WaitVSync ();

    //send console output to the gecko
    if (geckoinit)CON_EnableGecko(1, true);
    textVideoInit = true;
    gprintf("...1");

}
Ejemplo n.º 4
0
//---------------------------------------------------------------------------------
int main(int argc, char **argv) {
//---------------------------------------------------------------------------------
	s32 retval;

	// Initialise the video system
	VIDEO_Init();
	
	// This function initialises the attached controllers
	WPAD_Init();
	
	// Obtain the preferred video mode from the system
	// This will correspond to the settings in the Wii menu
	rmode = VIDEO_GetPreferredMode(NULL);

	// Allocate memory for the display in the uncached region
	xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
	
	// Initialise the console, required for printf
	console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
	
	// Set up the video registers with the chosen mode
	VIDEO_Configure(rmode);
	
	// Tell the video hardware where our display memory is
	VIDEO_SetNextFramebuffer(xfb);
	
	// Make the display visible
	VIDEO_SetBlack(FALSE);

	// Flush the video register changes to the hardware
	VIDEO_Flush();

	// Wait for Video setup to complete
	VIDEO_WaitVSync();
	if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
	if(usb_isgeckoalive(1))CON_EnableGecko(1, 1);

	log_buffer = (char*)malloc(0x4000);
	memset(log_buffer, 0, 0x4000);

	printf("Initializing WC24...\n");
	retval = WC24_Init();
	if(retval<0)
	{
		printf("WC24_Init returned %d\n", retval);
		return retval;
	}
	curtitleid = WC24_GetTitleID();

	printf("\n\n");
	printf("Getting NANDBOOTINFO argv...\n");
	argv = WII_GetNANDBootInfoArgv(&argc, &launchcode);
	#ifdef WIILOADAPPDEBUG
		#ifdef WIILOADTEST_BOOTDISC	
		argc = 1;
		launchcode = 2;
		#endif

		#ifdef WIILOADTEST_BOOTHB	
		launchcode = 1;
		argc = 2;
		argv[1] = WIILOADTEST_BOOTHB;
		#endif
	#endif

	ResetWakeup_Timestamp();
	#ifndef WIILOADAPPDEBUG
	retval = ProcessWC24(launchcode & BIT(25));//Don't do any WC24 stuff with HBC wiiload, only with the actual installed wc24boottitle.
	#endif
	launchcode &= ~(BIT(25));
	ProcessArgs(argc, argv, 0);
	printf("Shutting down WC24...\n");
	WC24_Shutdown();
	FlushLog();

	return 0;
}
Ejemplo n.º 5
0
int main(int argc, char *argv[]) {
	s32 res;

#ifdef USE_WII_DI
	DI_Init();
#endif

	VIDEO_Init();
	PAD_Init();
	AUDIO_Init(NULL);

#ifdef DEBUG_WII_USBGECKO
	CON_EnableGecko(1, false);
#endif

#ifdef DEBUG_WII_GDB
	DEBUG_Init(GDBSTUB_DEVICE_USB, 1);
#endif

	printf("startup as ");
	if (argc > 0)
		printf("'%s'\n", argv[0]);
	else
		printf("<unknown>\n");

	SYS_SetResetCallback(reset_cb);
#ifndef GAMECUBE
	SYS_SetPowerCallback(power_cb);
#endif

#ifdef USE_WII_DI
	// initial async mount for the browser, see wii-fs.cpp
	DI_Mount();
#endif

	if (!fatInitDefault()) {
		printf("fatInitDefault failed\n");
	} else {
		// set the default path if libfat couldnt set it
		// this allows loading over tcp/usbgecko
		char cwd[MAXPATHLEN];

		if (getcwd(cwd, MAXPATHLEN)) {
			size_t len = strlen(cwd);

			if (len > 2 && (cwd[len - 1] == ':' || cwd[len - 2] == ':')) {
				printf("chdir to default\n");
				chdir("/apps/scummvm");
			}
		}
	}

	g_system = new OSystem_Wii();
	assert(g_system);

	res = scummvm_main(argc, argv);
	g_system->quit();

	printf("shutdown\n");

	fatUnmountDefault();

#ifdef USE_WII_DI
	DI_Close();
#endif

	if (power_btn_pressed) {
		printf("shutting down\n");
		SYS_ResetSystem(SYS_POWEROFF, 0, 0);
	}

	printf("reloading\n");

	return res;
}