• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ consoleInit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中consoleInit函数的典型用法代码示例。如果您正苦于以下问题:C++ consoleInit函数的具体用法?C++ consoleInit怎么用?C++ consoleInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了consoleInit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main(void)
{
    gfxInitDefault();

	if(R_FAILED(ndspInit()))
		return 0;

#ifdef DEBUG
    LightLock_Init(&debug_lock);
    consoleInit(GFX_BOTTOM, &bottomScreen);
    consoleDebugInit(debugDevice_CONSOLE);
#endif

    consoleInit(GFX_TOP, &topScreen);
    //aptHook(&hookCookie, AptEventHook, NULL);

    svcCreateEvent(&bufferReadyConsumeRequest, RESET_STICKY);
    svcCreateEvent(&bufferReadyProduceRequest, RESET_STICKY);
    getFiles();

    bool exit = false;
    while (!exit)
    {
        std::string filename = select_file();
        exit = stream_file(filename);
    }

    ndspExit();
    gfxExit();

    return 0;
}
开发者ID:TricksterGuy,项目名称:3ds-vgmstream,代码行数:32,代码来源:main.cpp


示例2: err_show

void err_show(char file_name[], int line, char message[]) {
  quit_for_err = true;
  // Reset all screens
  consoleInit(GFX_TOP, &top_screen);
  consoleInit(GFX_BOTTOM, &debug_screen);
  consoleInit(GFX_BOTTOM, &instruction_screen);
  consoleSelect(&top_screen);
  printf("%s\n\t\tFATAL ERROR\n\n%s", BG_RED, RESET);
  printf("%s\n", file_name);
  printf("line %d\n", line);
  printf(message);
  printf("\n\nPlease raise an issue at:\ngithub.com/thatguywiththatname/3DES/issues\n");
  printf("With details of this error &\nwhat you were doing at the time\n");
  printf("\nPress A to close app\n");
  while (aptMainLoop()) {
    gspWaitForVBlank();
    hidScanInput();
    u32 exitkDown = hidKeysDown();
    if (exitkDown & KEY_A) {
      return;
    }
    gfxFlushBuffers();
    gfxSwapBuffers();
  }
}
开发者ID:RossMeikleham,项目名称:PlutoBoy,代码行数:25,代码来源:err.c


示例3: initTextSystem

/*
 * Initializes the text system.
 * @param loadDefaultFonts Indicates whether or not it should
 * load the default fonts.
 * @param topScreenLayer The background layer to display the text on on the
 * top screen. (Use -1 to not load the top screen's text system)
 * @param bottomScreenLayer The background layer to display the text on on the
 * bottom screen. (Use -1 to not load the bottom screen's text system)
 */
void initTextSystem(bool loadDefaultFonts, int topScreenLayer,
		int bottomScreenLayer)
{
	/*
	 * Checks to make sure the top screen layer is > -1 and is < 4.
	 */
	if (topScreenLayer > -1 && topScreenLayer < 4)
	{
		/*
		 * If it does meet the requirements above, then its console
		 * is initialized.
		 */
		PrintConsole* c = consoleInit(&topScreen, topScreenLayer, BgType_ExRotation,
				BgSize_ER_256x256, topScreenLayer * 4, (topScreenLayer < 3) ? topScreenLayer * 2 + 2 : topScreenLayer * 2 + 1, true,
				loadDefaultFonts);
		topId = c->bgId;
	}

	/*
	 * Checks to make sure the bottom screen layer is > -1 and is < 4.
	 */
	if (bottomScreenLayer > -1 && bottomScreenLayer < 4)
	{
		/*
		 * If it does meet the requirements above, then its console
		 * is initialized.
		 */
		PrintConsole* c = consoleInit(&bottomScreen, bottomScreenLayer, BgType_ExRotation,
				BgSize_ER_256x256, bottomScreenLayer * 4, (bottomScreenLayer < 3) ? bottomScreenLayer * 2 + 2 : bottomScreenLayer * 2 + 1,
				false, loadDefaultFonts);
		bottomId = c->bgId;
	}
}
开发者ID:GEMISIS,项目名称:RPSLS-DS,代码行数:42,代码来源:textFunctions.c


示例4: __attribute__

void __attribute__((noreturn)) __sassert(const char* file, int line, const char* cond, const char* msg)
{
	if (isUserMode()) FeOS_swi_assertfail(file, line, cond, msg);

	videoReset();
	videoSetMode(MODE_0_2D);
	videoSetModeSub(MODE_0_2D);
	PrintConsole* conmain = consoleInit(NULL, 0, BgType_Text4bpp, BgSize_T_256x256, 0, 1, true, true);
	memcpy(&oConSub, consoleGetDefault(), sizeof(PrintConsole));
	PrintConsole* consub = consoleInit(&oConSub, 0, BgType_Text4bpp, BgSize_T_256x256, 0, 1, false, true);
	InstallConThunks();

	consoleSelect(conmain);

	BG_PALETTE[0] = RGB15(31,0,31);
	BG_PALETTE[255] = RGB15(31,31,31);
	BG_PALETTE_SUB[0] = RGB15(31,0,31);
	BG_PALETTE_SUB[255] = RGB15(31,31,31);

	iprintf("\x1b[5CKernel assertion failure!\n\nCondition: %s\n\n%s:%d\n\nMessage: %s\n", cond, file, line, msg);

	consoleSelect(consub);

	iprintf("\x1b[5CStacktrace coming soon\n\nInstead, here's a kitten:\n\n");

	const char** i;
	for (i = meow; *i; i ++)
		iprintf("%s\n", *i);

	for (;;)
		swiWaitForVBlank();
}
开发者ID:steveschnepp,项目名称:FeOS,代码行数:32,代码来源:sassert.c


示例5: init

	void init() {

		initMemory();

		//Init backgrounds
		// Main 3D
		init3DSettings();
		// Main Map:
		mapEngine = new MapEngine(1, 4, 1);
		// Main Console:
		consoleInit(&main_console,3,BgType_ExRotation, BgSize_ER_256x256, 31, 0, true, false);
		bg3 = main_console.bgId;
		bgSetCenter(bg3, 254, 0);
		bgSetRotate(bg3, -8192);

		// Sub Console:
		consoleInit(&sub_console,3,BgType_ExRotation, BgSize_ER_256x256, 31, 1, false, false);
		bg3Sub = sub_console.bgId;
		bgSetCenter(bg3Sub, 254, 0);
		bgSetRotate(bg3Sub, -8192);

		// Sub Image:
		bg2Sub = bgInitSub(2, BgType_Bmp8, BgSize_B8_256x256, 4,0);
		dmaCopy(leftmenuBitmap, bgGetGfxPtr(bg2Sub), 256*192);
		dmaCopy(leftmenuPal, BG_PALETTE_SUB, leftmenuPalLen);

		// Init Sprites
		oamInit(&oamMain, SpriteMapping_1D_128, false);

		// Set the priorities
		bgSetPriority(0,1);
		bgSetPriority(1,2);
		bgSetPriority(2,3);
		bgSetPriority(3,0);
		bgSetPriority(bg3Sub, 2);
		bgSetPriority(bg2Sub, 3);

		//Init font
		font.gfx = (u16*)fontTiles;
		font.pal = (u16*)fontPal;
		font.numChars = 95;
		font.numColors =  fontPalLen / 2;
		font.bpp = 8;
		font.asciiOffset = 32;
		font.convertSingleColor = false;
		consoleSetFont(&main_console, &font);
		consoleSetFont(&sub_console, &font);

		consoleSelect(&main_console);
		iprintf("\x1b[2J");
		iprintf("Arkham Tower v0.01");
		consoleSelect(&sub_console);
		iprintf("\x1b[2J");
	}
开发者ID:Jell,项目名称:tower_game,代码行数:54,代码来源:display.cpp


示例6: prepare_screens

// Initializes the hardware and sets up the backgrounds
void prepare_screens()
{
	videoSetMode(MODE_0_2D);
	videoSetModeSub(MODE_0_2D);

	vramSetBankA(VRAM_A_MAIN_BG);
	vramSetBankC(VRAM_C_SUB_BG);

	consoleInit(&top_screen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, true, true);
	consoleInit(&bottom_screen, 3,BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true);
}
开发者ID:L3n-M3n,项目名称:SchoolCode,代码行数:12,代码来源:main.cpp


示例7: console_init

/*! initialize console subsystem */
void
console_init(void)
{
  consoleInit(GFX_TOP, &status_console);
  consoleSetWindow(&status_console, 0, 0, 50, 1);

  consoleInit(GFX_TOP, &main_console);
  consoleSetWindow(&main_console, 0, 1, 50, 29);

  consoleSelect(&main_console);

  consoleDebugInit(debugDevice_NULL);
}
开发者ID:suloku,项目名称:ftbrony,代码行数:14,代码来源:console.c


示例8: console_init

/*! initialize console subsystem */
void
console_init(void)
{
  consoleInit(GFX_TOP, &status_console);
  consoleSetWindow(&status_console, 0, 0, 50, 1);

  consoleInit(GFX_TOP, &main_console);
  consoleSetWindow(&main_console, 0, 1, 50, 29);

  //consoleInit(GFX_BOTTOM, &tcp_console);	glitched image fix

  consoleSelect(&main_console);
}
开发者ID:FloatingStar,项目名称:FTP-GMX,代码行数:14,代码来源:console.c


示例9: main

int main() {
	suInit();
	gfxInitDefault();
	consoleInit(GFX_TOP, &topConsole);
	consoleSelect(&topConsole);

	cfguInit();
	fsInit();
	amInit();

	fbTopLeft = gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL);
	fbTopRight = gfxGetFramebuffer(GFX_TOP, GFX_RIGHT, NULL, NULL);
	fbBottom = gfxGetFramebuffer(GFX_BOTTOM, 0, NULL, NULL);

	u8 next = mainMenu();
	while (aptMainLoop()) {
		switch (next) {
			case 0: break;
			case 1: next = mainMenu(); break;
			//case 2: next = legitInstallMenu(); break;
			case 3: next = downgradeMenu(); break;
			//case 4: next = downgradeMSETMenu(); break;
			//case 5: next = downgradeBrowserMenu(); break;
			default: next = mainMenu();
		}
		if (next == 0) break;
	}

	gfxExit();
	return 0;
}
开发者ID:DayVeeBoi,项目名称:KernelTimeMachine,代码行数:31,代码来源:main.c


示例10: commInit

void commInit(void)
{
  if (isInit)
    return;

#ifdef USE_ESKYLINK
  eskylinkInit();
#else
  /* radiolinkInit(); */
#endif

  crtpInit();

#ifdef USE_UART_CRTP
  crtpSetLink(uartGetLink());
#elif defined(USE_ESKYLINK)
  crtpSetLink(eskylinkGetLink());
#else
  crtpSetLink(radiolinkGetLink());
#endif

  crtpserviceInit();
  logInit();
  consoleInit();
  paramInit();

  //setup CRTP communication channel
  //TODO: check for USB first and prefer USB over radio
  //if (usbTest())
  //  crtpSetLink(usbGetLink);
  //else if(radioTest())
  //  crtpSetLink(radioGetLink());

  isInit = true;
}
开发者ID:jannson,项目名称:crazyflie-firmware,代码行数:35,代码来源:comm.c


示例11: initConsole

void initConsole(PrintConsole * console) {
	// consoleInit (PrintConsole * console, int layer, BgType type,
	// BgSize size, int mapBase, int tileBase, bool mainDisplay, bool loadGraphics)	
	consoleInit(console, 0, BgType_Text4bpp, BgSize_T_256x256, 2, 0, false, true);
	consoleSelect(console);
	printf("\x1b[30m");
}
开发者ID:bttf,项目名称:petsounds,代码行数:7,代码来源:main.c


示例12: main

//---------------------------------------------------------------------------------
int main(void) {
	short scrX=0, scrY=0;
	unsigned short pad0, move;

    // Initialize SNES 
	consoleInit();

	// Copy tiles to VRAM
	bgInitTileSet(0, &LandTiles, &LandPalette, 1, (&LandTiles_end - &LandTiles), (&LandPalette_end - &LandPalette), BG_16COLORS, 0x0000);
	bgInitTileSet(2, &CloudTiles, &CloudPalette, 0, (&CloudTiles_end - &CloudTiles), (&CloudPalette_end - &CloudPalette),  BG_4COLORS, 0x1000);

	// Copy Map to VRAM
	bgInitMapSet(0, &Maps, (&Maps_end - &Maps),SC_32x32, 0x2000);
	bgInitMapSet(2, &Mapsc, (&Mapsc_end - &Mapsc),SC_32x32, 0x2400);

	// Now Put in 16 color mode and put cloud on top of screen
	setMode(BG_MODE1,BG3_MODE1_PRORITY_HIGH); bgSetDisable(1);  

	// Set BG3 SubScreen and 
	bgSetEnableSub(2);
	
	// enable Subscreen Color ADD/SUB and Color addition on BG1 and Backdrop color
	setColorEffect(CM_SUBBGOBJ_ENABLE, CM_MSCR_BACK | CM_MSCR_BG1);

	// Wait for nothing :P
	while(1) {
        // change scrolling 
	    scrX++; 
		bgSetScroll(2, scrX,0);

		WaitForVBlank();
	}
	return 0;
}
开发者ID:beletsky,项目名称:pvsneslib,代码行数:35,代码来源:Transparency.c


示例13: init_consoles

void init_consoles(void)
{
	/* debug console on top */
	mainConsole = consoleDemoInit();
	debugConsole = (PrintConsole *) malloc(sizeof(PrintConsole));

	if (!debugConsole)
		exit(1);

	memcpy(debugConsole, consoleGetDefault(), sizeof(PrintConsole));
	videoSetMode(MODE_0_2D);
	vramSetBankA(VRAM_A_MAIN_BG);

	consoleInit(debugConsole, debugConsole->bgLayer, BgType_Text4bpp,
		    BgSize_T_256x256, debugConsole->mapBase,
		    debugConsole->gfxBase, true, true);
#ifdef DEBUG
	printf("Test debug console\n");
#endif
	consoleSelect(mainConsole);
#ifdef DEBUG
	printf("Test main console\n");
#endif
	return;
}
开发者ID:Lexus89,项目名称:wifi-arsenal,代码行数:25,代码来源:utils.c


示例14: appInit

int appInit(int argc, char **argv) {
    const char *opt;

    _flubAppCtx.launchedFromConsole = _appLaunchedFromConsole();

    if((opt = strrchr(argv[0], PLATFORM_PATH_SEP)) != NULL) {
        _flubAppCtx.progName = opt;
    } else {
        _flubAppCtx.progName = argv[0];
    }

    if((!logInit()) ||
            (!cmdlineInit(argc, argv)) ||
            (!flubSDLInit()) ||
            (!flubPhysfsInit(argv[0])) ||
            (!flubCfgInit()) ||
            (!videoInit()) ||
            (!texmgrInit()) ||
            (!flubFontInit()) ||
            (!gfxInit()) ||
            (!audioInit()) ||
            (!inputInit()) ||
            (!consoleInit()) ||
            (!flubGuiThemeInit())
      ) {
        return 0;
    }

    return 1;
}
开发者ID:Mojofreem,项目名称:flub,代码行数:30,代码来源:app.c


示例15: systemInit

// This must be the first module to be initialized!
void systemInit(void)
{
  if(isInit)
    return;

  canStartMutex = xSemaphoreCreateMutex();
  xSemaphoreTake(canStartMutex, portMAX_DELAY);

  usblinkInit();
  sysLoadInit();

  /* Initialized hear and early so that DEBUG_PRINT (buffered) can be used early */
  crtpInit();
  consoleInit();

  DEBUG_PRINT("----------------------------\n");
  DEBUG_PRINT(P_NAME " is up and running!\n");
  DEBUG_PRINT("Build %s:%s (%s) %s\n", V_SLOCAL_REVISION,
              V_SREVISION, V_STAG, (V_MODIFIED)?"MODIFIED":"CLEAN");
  DEBUG_PRINT("I am 0x%X%X%X and I have %dKB of flash!\n",
              *((int*)(MCU_ID_ADDRESS+8)), *((int*)(MCU_ID_ADDRESS+4)),
              *((int*)(MCU_ID_ADDRESS+0)), *((short*)(MCU_FLASH_SIZE_ADDRESS)));

  configblockInit();
  workerInit();
  adcInit();
  ledseqInit();
  pmInit();
  buzzerInit();

  isInit = true;
}
开发者ID:JJJJJJJack,项目名称:crazyflie-firmware,代码行数:33,代码来源:system.c


示例16: main

int main()
{
	irqInit();
	irqEnable(IRQ_VBLANK);
	consoleInit(0, 4, 0, NULL, 0, 15);
	BG_COLORS[0]=RGB8(58,110,165);
	BG_COLORS[241]=RGB5(31,31,31);

	SetMode(MODE_0 | BG0_ON);

	/* verify that the overlays are indeed overlapping */
	printf("overlay1_test: %p\noverlay2_test: %p\n", overlay1_test, overlay2_test);
	
	/* set overlay 1 and run code from it */
	memcpy(__iwram_overlay_start, __load_start_iwram1, (int)__load_stop_iwram1 - (int)__load_start_iwram1);
	overlay1_test();
	
	/* set overlay 2 and run code from it */
	memcpy(__iwram_overlay_start, __load_start_iwram2, (int)__load_stop_iwram2 - (int)__load_start_iwram2);
	overlay2_test();
	
	/* back to normal */
	memcpy(__iwram_overlay_start, __load_start_iwram0, (int)__load_stop_iwram0 - (int)__load_start_iwram0);
	while(1);
}
开发者ID:kusma,项目名称:nds,代码行数:25,代码来源:overlay.c


示例17: splash_ascii

int splash_ascii(void)
{
    // print BootCtr logo
    // http://patorjk.com/software/taag/#p=display&f=Bigfig&t=BootCtr
    consoleInit(GFX_TOP, NULL);
    return printf(ASCII_ART_TEMPLATE, VERSION_STRING);
}
开发者ID:leo60228,项目名称:BootCtr,代码行数:7,代码来源:splash.c


示例18: main

int main()
{
	gfxInitDefault();
	consoleInit(GFX_TOP, NULL);

	Result rc = romfsInit();
	if (rc)
		printf("romfsInit: %08lX\n", rc);
	else
	{
		printf("romfs Init Successful!\n");
		printfile("romfs:/folder/file.txt");
		// Test reading a file with non-ASCII characters in the name
		printfile("romfs:/フォルダ/ファイル.txt");
	}

	// Main loop
	while (aptMainLoop())
	{
		gspWaitForVBlank();
		hidScanInput();

		u32 kDown = hidKeysDown();
		if (kDown & KEY_START)
			break; // break in order to return to hbmenu
	}

	romfsExit();
	gfxExit();
	return 0;
}
开发者ID:Cruel,项目名称:3ds-examples,代码行数:31,代码来源:main.c


示例19: main

int main()
{
	sf2d_init();
	sf2d_set_clear_color(RGBA8(0x40, 0x40, 0x40, 0xFF));

	consoleInit(GFX_BOTTOM, NULL);
	printf("sftd sample\n");

	// Font loading
	sftd_init();
	sftd_font *font = sftd_load_font_mem(airstrike_ttf, airstrike_ttf_size);

	while (aptMainLoop()) {

		hidScanInput();
		if (hidKeysDown() & KEY_START) break;

		sf2d_start_frame(GFX_TOP, GFX_LEFT);

			sftd_draw_text(font, 10, 10, RGBA8(255, 0, 0, 255), 20, "Font drawing on the top screen!");
			sftd_draw_textf(font, 10, 40, RGBA8(0, 255, 0, 255), 20, "FPS %f", sf2d_get_fps());

		sf2d_end_frame();

		sf2d_swapbuffers();
	}

	sftd_free_font(font);
	sftd_fini();

	sf2d_fini();
	return 0;
}
开发者ID:Shadowtrance,项目名称:sftdlib,代码行数:33,代码来源:main.c


示例20: main

int main(int argc, char **argv)
{
	// Initialize services
	gfxInitDefault();

	//Initialize console on top screen. Using NULL as the second argument tells the console library to use the internal console structure as current one
	consoleInit(GFX_TOP, NULL);

	//Move the cursor to row 15 and column 19 and then prints "Hello World!" 
	//To move the cursor you have tu print "\x1b[r;cH", where r and c are respectively
	//the row and column where you want your cursor to move
	//The top screen has 30 rows and 50 columns
	//The bottom screen has 30 rows and 40 columns
	printf("\x1b[15;19HHello World!");

	//Move the cursor to the top left corner of the screen
	printf("\x1b[0;0H");

	//Print a REALLY crappy poeam with colored text
	//\x1b[cm set a SGR (Select Graphic Rendition) parameter, where c is the parameter that you want to set
	//Please refer to http://en.wikipedia.org/wiki/ANSI_escape_code#CSI_codes to see all the possible SGR parameters
	//As of now ctrulib support only these parameters:
	//Reset (0), Half bright colors (2), Reverse (7), Text color (30-37) and Background color (40-47)
	printf("Roses are \x1b[31mred\x1b[0m\n");
	printf("Violets are \x1b[34mblue\x1b[0m\n");
	printf("Piracy is bad\n");
	printf("While homebrews are good\n\n");

	//Black text on white background
	//In this example we set two parameter in a single escape sequence by separating them by a semicolon
	//\x1b[47;30m means that it will set a white background (47) and it will print white characters (30)
	//In this we also could have used the 
	printf("\x1b[47;30mBlack text on white background\x1b[0m");


	printf("\x1b[29;15HPress Start to exit.");
	// Main loop
	while (aptMainLoop())
	{
		//Scan all the inputs. This should be done once for each frame
		hidScanInput();

		//hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
		u32 kDown = hidKeysDown();

		if (kDown & KEY_START) break; // break in order to return to hbmenu

		// Flush and swap framebuffers
		gfxFlushBuffers();
		gfxSwapBuffers();

		//Wait for VBlank
		gspWaitForVBlank();
	}

	// Exit services
	gfxExit();
	
	return 0;
}
开发者ID:Cruel,项目名称:3ds-examples,代码行数:60,代码来源:main.c



注:本文中的consoleInit函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ console_init函数代码示例发布时间:2022-05-30
下一篇:
C++ consoleClear函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap