global void psp_fatal_error(char *msg, ...) { // [エラーメッセージを描画] char msgbuf[128]; /* 128==4*32 (pspの構造上32の倍数で指定) */ va_list argptr; // va_start(argptr, msg); vsprintf(msgbuf, msg, argptr); va_end(argptr); strcpy(my_font_text, msgbuf);/*(エラー文字列をmy_font_textに書きこむ)*/ // sw itch (errorlevel)/*int errorlevel,*/ { //ca se ERR_DEBUG: if (debug) { fprintf(stdout,"DEBUG: %s\n",msgbuf); } break; //ca se ERR_INFO: fprintf(stdout,"INFO: %s\n",msgbuf); break; //ca se ERR_FATAL: // fprintf(stdout,"FATAL: %s\n",msgbuf); #if (1)/*(漢字関連の初期化)*/ kanji_init_standard();/*(漢字関連の標準初期化)*/ // set_kanji_hide_line(ML_LINE_99_MAX);/*(全行表示する。)*/ #endif #if (1)/*(デバッグ)*/ { // ml_font[(0)].haikei = (ML_HAIKEI_02_JIKI_SPELL_CARD);/* [赤/自機カード用背景]せりふ背景on */ cg.msg_time = (65536); /* 約 18 分 */ // strcpy(my_font_text, "致命的エラー。" "\n"); // strcpy(my_font_text, msgbuf); kanji_color(7); kanji_draw(); } #endif } vbl_draw_screen(); /* 画面描画とキー入力(本当は v-blanc タイミングで) */ hit_any_key();/*[簡易入力待ち]*/ //[強制終了します。と描画] kanji_window_all_clear(); /* メッセージウィンドウの内容を消す。 */ strcpy(my_font_text, "致命的エラーなので終了します。" "\\n"); kanji_color(7); kanji_draw(); vbl_draw_screen(); /* 画面描画とキー入力(本当は v-blanc タイミングで) */ hit_any_key();/*[簡易入力待ち]*/ //[強制終了する] sceKernelExitGame(); //if (errorlevel==ERR_FATAL) exit(1);/*exit(1)はpspで使えないので注意*/ // // cb.ma in_call_func = NULL; }
/* * Output one character to the terminal */ int scr_putc(int c) { /* handle tabs normally */ if (c == '\t') { do { scr_putc(' '); } while ((cols_printed % 8) != 0); return(c); } /* Output the character... */ if (putc(c, stdout) == EOF) { logoff(NULL, 3); } if (c == '\n') { ++lines_printed; cols_printed = 0; } else if (c == '\r') { cols_printed = 0; } else if (isprint(c)) { ++cols_printed; if ((screenwidth > 0) && (cols_printed > screenwidth)) { ++lines_printed; cols_printed = 0; } } /* How many lines output before stopping for the paginator? * Depends on whether we are displaying a status line. */ int height_offset = ( ((enable_color) && (screenwidth > 0) && (enable_status_line)) ? (3) : (2) ) ; /* Ok, go check it. Stop and display the paginator prompt if necessary. */ if ((screenheight > 0) && (lines_printed > (screenheight-height_offset))) { lines_printed = 0; hit_any_key(); lines_printed = 0; cols_printed = 0; } return c; }