本文整理汇总了C++中consoleInit函数的典型用法代码示例。如果您正苦于以下问题:C++ consoleInit函数的具体用法?C++ consoleInit怎么用?C++ consoleInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了consoleInit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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();
}
}
示例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;
}
}
示例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();
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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");
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}