示例#1
0
void pspDebugKbDrawKey(int row, int col, int highlight) {
  int i;
  int spacing = 0;
  int charsTo = 0;
  int charsTotal = 0;

  if (highlight) {
    pspDebugScreenSetTextColor(PSP_DEBUG_KB_CHAR_HIGHLIGHT);
    pspDebugScreenSetBackColor(PSP_DEBUG_KB_BACK_HIGHLIGHT);
  } else {
    pspDebugScreenSetTextColor(PSP_DEBUG_KB_CHAR_COLOUR);
    pspDebugScreenSetBackColor(PSP_DEBUG_KB_BACK_COLOUR);
  }

  if (row == PSP_DEBUG_KB_COMMAND_ROW) {
    for (i=0; i<PSP_DEBUG_KB_NUM_COMMANDS; i++) {
      charsTotal += strlen(commandRow[i]);
      if (i < col) { charsTo += strlen(commandRow[i]); }
    }
    spacing = (PSP_DEBUG_KB_BOX_WIDTH - charsTotal) / (PSP_DEBUG_KB_NUM_COMMANDS + 1);
    pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X + (spacing * (col + 1)) + charsTo, PSP_DEBUG_KB_BOX_Y + (PSP_DEBUG_KB_SPACING_Y * (row + 2)));
    pspDebugScreenPrintf("%s", commandRow[col]);
  } else {
    pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X + PSP_DEBUG_KB_OFFSET_X + (PSP_DEBUG_KB_SPACING_X * col), PSP_DEBUG_KB_BOX_Y + (PSP_DEBUG_KB_SPACING_Y * (row + 2)));
    if (charTable[row][col] == '\0') {
      pspDebugScreenPrintf(" ");
    } else {
    pspDebugScreenPrintf("%c", charTable[row][col]);
  }
  }
}
示例#2
0
static int render_panelcolor_row(OptionsPanel* prPanel) {
    CursorPos* prPos = NULL;
    CursorPos* prCursor = NULL;
    ColorConfig* prPcolor = NULL;
    ColorConfig* prCcolor = NULL;
    Dimension* prSize = NULL;
    int cr = 0;
    char sFmt[10];
    
    if (prPanel == NULL) {
        return OPTIONSPANEL_NULLPTR;
    }
    
    prPos = get_position(prPanel);
    prCursor = get_cursorpos(prPanel);
    prPcolor = get_panelcolor(prPanel);
    prCcolor = get_cursorcolor(prPanel);
    prSize = get_size(prPanel);
    
    pspDebugScreenSetXY(prPos->x, prPos->y + 3);
    if (prPcolor != NULL) {
        pspDebugScreenSetBackColor(prPcolor->background);
        pspDebugScreenSetTextColor(prPcolor->text);
    }
    pspDebugScreenPuts(OPTIONSPANEL_L_PANELC);
    if (prCursor->y == 1) {
        if (prCursor->x == 0) {
            if (prCcolor != NULL) {
                pspDebugScreenSetBackColor(prCcolor->background);
                pspDebugScreenSetTextColor(prCcolor->text);
            }
        }
    }
    pspDebugScreenKprintf("0x%08X", prPcolor->background);
    if (prPcolor != NULL) {
        pspDebugScreenSetBackColor(prPcolor->background);
        pspDebugScreenSetTextColor(prPcolor->text);
    }
    pspDebugScreenPuts(" ");
    if (prCursor->y == 1) {
        if (prCursor->x == 1) {
            if (prCcolor != NULL) {
                pspDebugScreenSetBackColor(prCcolor->background);
                pspDebugScreenSetTextColor(prCcolor->text);
            }
        }
    }
    pspDebugScreenKprintf("0x%08X", prPcolor->text);
    cr = prSize->width - strlen(OPTIONSPANEL_L_PANELC) - 22;
    sprintf(sFmt, "%%-%ds", cr);
    if (prPcolor != NULL) {
        pspDebugScreenSetBackColor(prPcolor->background);
        pspDebugScreenSetTextColor(prPcolor->text);
    }
    pspDebugScreenKprintf(sFmt, "");
    return OPTIONSPANEL_SUCCESS;
}
示例#3
0
static int drawDataColumns(HexEditor* prHex, int iRow) {
    AppletConfig* prApCfg = NULL;
    ColorConfig* prColor = NULL;

    if (prHex == NULL) {
        return HEXEDITOR_MEMORY;
    }
    prApCfg = prHex->prApCfg;
    int bpl = prHex->config.bytes_per_line;
    SceUChar8 *pVal = (SceUChar8*)(prHex->offset + (iRow * bpl));
    prColor = &prHex->config.datacolumns;
    if (iRow == prHex->cursor.y) {
        prColor = &prApCfg->rPanel.rColor;
    }
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    if (bpl == 16) {
        pspDebugScreenKprintf("%02X%02X%02X%02X ",
                pVal[0], pVal[1], pVal[2], pVal[3]);
        pspDebugScreenKprintf("%02X%02X%02X%02X ",
                pVal[4], pVal[5], pVal[6], pVal[7]);
        pspDebugScreenKprintf("%02X%02X%02X%02X ",
                pVal[8], pVal[9], pVal[10], pVal[11]);
        pspDebugScreenKprintf("%02X%02X%02X%02X",
                pVal[12], pVal[13], pVal[14], pVal[15]);
    }
    if (bpl == 8) {
        pspDebugScreenKprintf("%02X %02X %02X %02X %02X %02X %02X %02X",
                pVal[0], pVal[1], pVal[2], pVal[3],
                pVal[4], pVal[5], pVal[6], pVal[7]);
    }
    return HEXEDITOR_SUCCESS;
}
示例#4
0
static void draw_cheat_status(CEFiveUi *prUi) {
    CEFiveConfig* prCfg = NULL;
    ColorConfig* prColor = NULL;
    if (prUi == NULL) {
        return;
    }
    prCfg = prUi->prCEConfig;
    if (prCfg != NULL) {
        prColor = cefiveconfig_get_titlecolor(prCfg);
    } else {
        prColor = &prUi->config.titlebar;
    }
    CheatEngine* prEngine = prUi->prEngine;
    int trigger = prEngine->trigger_active;
    u32 fg = (u32)0xFF0000FF;
    char* msg = "Cheats OFF";
    if (trigger == 1) {
        msg = "Cheats ON";
        fg = (u32)0xFF00FF00;
    }
    pspDebugScreenSetXY(50, 0);
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(fg);
    pspDebugScreenPuts(msg);
}
示例#5
0
static int drawAsciiColumn(HexEditor* prHex, int iRow) {
    AppletConfig* prApCfg = NULL;
    ColorConfig* prColor = NULL;

    if (prHex == NULL) {
        return HEXEDITOR_MEMORY;
    }
    prApCfg = prHex->prApCfg;
    int i;
    char abuf[17];
    int bpl = prHex->config.bytes_per_line;
    SceChar8 *pVal = (SceChar8*)(prHex->offset + (iRow * bpl));
    for (i = 0; i < bpl; i++) {
        if (pVal[i] >= 0x20) {
            abuf[i] = pVal[i];
        } else {
            abuf[i] = '.';
        }
    }
    abuf[bpl] = (char)0;
    prColor = &prHex->config.ascii;
    if (iRow == prHex->cursor.y) {
        prColor = &prApCfg->rPanel.rColor;
    }
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    pspDebugScreenKprintf("%16s", abuf);
    return HEXEDITOR_SUCCESS;
}
示例#6
0
static int render_digit(HexPad* prPad, const int x, const int y) {
    CursorPos* prPos = NULL;
    ColorConfig* prColor = NULL;
    int vx = 0;
    int vy = 0;
    int digit = 0;
    
    if (prPad == NULL) {
        return HEXPAD_NULLPTR;
    }
    digit = (4 * y) + x;
    prPos = hexpad_get_position(prPad);
    vx = prPos->x + (x * 3);
    vy = prPos->y + (y * 3);
    prColor = digit_color(prPad, x, y);
    if (prColor != NULL) {
        pspDebugScreenSetBackColor(prColor->background);
        pspDebugScreenSetTextColor(prColor->text);
    }
    pspDebugScreenSetXY(vx, vy);
    pspDebugScreenPuts("   ");
    pspDebugScreenSetXY(vx, vy + 1);
    pspDebugScreenKprintf(" %X ", digit);
    pspDebugScreenSetXY(vx, vy + 2);
    pspDebugScreenPuts("   ");
    return HEXPAD_SUCCESS;
}
示例#7
0
int searchpanel_redraw(SearchPanel* prPanel) {
    AppletConfig* prApCfg = NULL;
    ColorConfig* prColor = NULL;

    if (prPanel == NULL) {
        return SEARCHPANEL_MEMORY;
    }
    prApCfg = prPanel->prApCfg;

    pspDebugScreenSetXY(prPanel->config.top.x, prPanel->config.top.y);
    if (prApCfg != NULL) {
        prColor = appletconfig_get_panelcolor(prApCfg);
    } else {
        prColor = &prPanel->config.color;
    }

    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    pspDebugScreenPuts("Search Panel");
    draw_query_panel(prPanel);
    draw_button_panel(prPanel);
    draw_results_panel(prPanel);
    draw_status_panel(prPanel);
    
    return SEARCHPANEL_SUCCESS;
}
示例#8
0
void cefiveuiRedraw(CEFiveUi *prUi) {
    CEFiveConfig* prCfg = NULL;
    ColorConfig* prColor = NULL;

    if (prUi == NULL) {
        return;
    }
    prCfg = prUi->prCEConfig;
    if (prCfg != NULL) {
        prColor = cefiveconfig_get_panelcolor(prCfg);
    } else {
        prColor = &prUi->config.color;
    }
    if (prUi->drawn == 0) {
        //pspDebugScreenInitEx(prUi->vram, 0, 0);
        pspDebugScreenSetBackColor(prColor->background);
        pspDebugScreenClear();
    }
    if (prUi->appletmenu.visible == 1) {
        draw_applet_menu(prUi);
    } else {
        draw_titlebar(prUi);
        draw_applet(prUi);
    }
    prUi->drawn = 1;
}
示例#9
0
int searchpanel_reset(SearchPanel* prPanel) {
    AppletConfig* prCfg = NULL;
    ColorConfig* prColor = NULL;
    int x = 0;
    int y = 0;
    int rows = 0;
    int row = 0;
    
    if (prPanel == NULL) {
        return SEARCHPANEL_NULLPTR;
    }
    prCfg = prPanel->prApCfg;
    prColor = appletconfig_get_panelcolor(prCfg);
    x = prPanel->config.tabletop.x;
    y = prPanel->config.tabletop.y;
    rows = prPanel->config.tablesize.height;
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    pspDebugScreenSetXY(x, y - 1);
    pspDebugScreenKprintf("%-67s", "Search Results: 0");
    for (row = 0; row < rows; row++) {
        pspDebugScreenSetXY(x, y + row);
        pspDebugScreenKprintf("%-67s", "");
    }
    return SEARCHPANEL_SUCCESS;
}
示例#10
0
static int panel_color(HexView* prView) {
    if (prView == NULL) {
        return HEXVIEW_NULLPTR;
    }
    pspDebugScreenSetBackColor(prView->panelConfig.rColor.background);
    pspDebugScreenSetTextColor(prView->panelConfig.rColor.text);
    return HEXVIEW_SUCCESS;
}
示例#11
0
static int render_pause_row(OptionsPanel* prPanel) {
    CursorPos* prPos = NULL;
    CursorPos* prCursor = NULL;
    ColorConfig* prPcolor = NULL;
    ColorConfig* prCcolor = NULL;
    CEFiveConfig* prConfig = NULL;
    Dimension* prSize = NULL;
    const char* sLabel = "Pause Game during UI: ";
    const char* sYes = "Yes";
    const char* sNo = "No ";
    char sFmt[10];
    
    if (prPanel == NULL) {
        return OPTIONSPANEL_NULLPTR;
    }
    prPos = get_position(prPanel);
    pspDebugScreenSetXY(prPos->x, prPos->y + 2);
    prPcolor = get_panelcolor(prPanel);
    if (prPcolor != NULL) {
        pspDebugScreenSetBackColor(prPcolor->background);
        pspDebugScreenSetTextColor(prPcolor->text);
    }
    pspDebugScreenPuts(sLabel);
    prCcolor = get_cursorcolor(prPanel);
    prCursor = get_cursorpos(prPanel);
    if (prCursor->y == 0) {
        if (prCcolor != NULL) {
            pspDebugScreenSetBackColor(prCcolor->background);
            pspDebugScreenSetTextColor(prCcolor->text);
        }
    }
    prConfig = get_cefiveconfig(prPanel);
    if (prConfig->pause_during_ui == 1) {
        pspDebugScreenPuts(sYes);
    } else {
        pspDebugScreenPuts(sNo);
    }
    if (prPcolor != NULL) {
        pspDebugScreenSetBackColor(prPcolor->background);
        pspDebugScreenSetTextColor(prPcolor->text);
    }
    prSize = get_size(prPanel);
    sprintf(sFmt, "%%-%ds", prSize->width - strlen(sLabel) - strlen(sYes) - 1);
    pspDebugScreenKprintf(sFmt, "");
    return OPTIONSPANEL_SUCCESS;
}
示例#12
0
文件: disp.c 项目: IgorMac/gSquare
void dispException()
{
  // BSOD ! HAHAHA
  pspDebugScreenInit();
  pspDebugScreenSetBackColor(BLUE);
  pspDebugScreenSetTextColor(WHITE);
  pspDebugScreenClear();
  pspDebugScreenPrintf(exit_err);
}
示例#13
0
static int render_row(OptionsPanel* prPanel, const int row) {
    CursorPos* prPos = NULL;
    Dimension* prSize = NULL;
    ColorConfig* prColor = NULL;
    char sFmt[10];
    if (prPanel == NULL) {
        return OPTIONSPANEL_NULLPTR;
    }
    
    switch (row) {
        case 0: /* Pause Row */
            if (render_pause_row(prPanel) < 0) {
                return OPTIONSPANEL_FAILURE;
            }
            break;
        case 1: /* Panel Color Row */
            if (render_panelcolor_row(prPanel) < 0) {
                return OPTIONSPANEL_FAILURE;
            }
            break;
        case 2: /* Cursor Color Row */
            if (render_cursorcolor_row(prPanel) < 0) {
                return OPTIONSPANEL_FAILURE;
            }
            break;
        case 3: /* Edit Color Row */
            if (render_editcolor_row(prPanel) < 0) {
                return OPTIONSPANEL_FAILURE;
            }
            break;
        case 4: /* Title Color Row */
            if (render_titlecolor_row(prPanel) < 0) {
                return OPTIONSPANEL_FAILURE;
            }
            break;
        case 5: /* Status Color Row */
            if (render_statuscolor_row(prPanel) < 0) {
                return OPTIONSPANEL_FAILURE;
            }
            break;
        default:
            prPos = get_position(prPanel);
            prSize = get_size(prPanel);
            prColor = get_panelcolor(prPanel);
            sprintf(sFmt, "%%-%ds", prSize->width - 1);
            pspDebugScreenSetXY(prPos->x, prPos->y + 2 + row);
            pspDebugScreenSetBackColor(prColor->background);
            pspDebugScreenSetTextColor(prColor->text);
            pspDebugScreenKprintf(sFmt, "");
    }
    return OPTIONSPANEL_SUCCESS;
}
示例#14
0
void pspDebugKbClearBox() {
  int i, j;

  pspDebugScreenSetTextColor(PSP_DEBUG_KB_CHAR_COLOUR);
  pspDebugScreenSetBackColor(PSP_DEBUG_KB_BACK_COLOUR);

  for (i = PSP_DEBUG_KB_BOX_X; i <= PSP_DEBUG_KB_BOX_X + PSP_DEBUG_KB_BOX_WIDTH; i++) {
    for (j = PSP_DEBUG_KB_BOX_Y; j <= PSP_DEBUG_KB_BOX_Y + PSP_DEBUG_KB_BOX_HEIGHT; j++) {
      pspDebugScreenSetXY(i, j);
      pspDebugScreenPrintf(" ");
    }
  }
}
示例#15
0
void ExceptionHandler(PspDebugRegBlock * regs)
{
    int i;
    SceCtrlData pad;

    pspDebugScreenInit();
    pspDebugScreenSetBackColor(0x00FF0000);
    pspDebugScreenSetTextColor(0xFFFFFFFF);
    pspDebugScreenClear();
    pspDebugScreenPrintf("Your PSP has just crashed!\n");
    pspDebugScreenPrintf("Exception details:\n\n");

    pspDebugScreenPrintf("Exception - %s\n", codeTxt[(regs->cause >> 2) & 31]);
    pspDebugScreenPrintf("EPC       - %08X / %s.text + %08X\n", (int)regs->epc, module_info.modname, (unsigned int)(regs->epc-(int)&_ftext));
    pspDebugScreenPrintf("Cause     - %08X\n", (int)regs->cause);
    pspDebugScreenPrintf("Status    - %08X\n", (int)regs->status);
    pspDebugScreenPrintf("BadVAddr  - %08X\n", (int)regs->badvaddr);
    for(i=0; i<32; i+=4) pspDebugScreenPrintf("%s:%08X %s:%08X %s:%08X %s:%08X\n", regName[i], (int)regs->r[i], regName[i+1], (int)regs->r[i+1], regName[i+2], (int)regs->r[i+2], regName[i+3], (int)regs->r[i+3]);

    sceKernelDelayThread(1000000);
    pspDebugScreenPrintf("\n\nPress X to dump information on file exception.log and quit");
    pspDebugScreenPrintf("\nPress O to quit");

    for (;;){
        sceCtrlReadBufferPositive(&pad, 1);
        if (pad.Buttons & PSP_CTRL_CROSS){
            char filename[MAX_FILE];
            sprintf(filename, "%s/exception.log", main_path);
            FILE *log = fopen(filename, "w");
            if (log != NULL){
                char testo[512];
                sprintf(testo, "Exception details:\n\n");
                fwrite(testo, 1, strlen(testo), log);
                sprintf(testo, "Exception - %s\n", codeTxt[(regs->cause >> 2) & 31]);
                fwrite(testo, 1, strlen(testo), log);
                sprintf(testo, "EPC       - %08X / %s.text + %08X\n", (int)regs->epc, module_info.modname, (unsigned int)(regs->epc-(int)&_ftext));
                fwrite(testo, 1, strlen(testo), log);
                sprintf(testo, "Cause     - %08X\n", (int)regs->cause);
                fwrite(testo, 1, strlen(testo), log);
                sprintf(testo, "Status    - %08X\n", (int)regs->status);
                fwrite(testo, 1, strlen(testo), log);
                sprintf(testo, "BadVAddr  - %08X\n", (int)regs->badvaddr);
                fwrite(testo, 1, strlen(testo), log);
                for(i=0; i<32; i+=4){
                    sprintf(testo, "%s:%08X %s:%08X %s:%08X %s:%08X\n", regName[i], (int)regs->r[i], regName[i+1], (int)regs->r[i+1], regName[i+2], (int)regs->r[i+2], regName[i+3], (int)regs->r[i+3]);
                    fwrite(testo, 1, strlen(testo), log);
                }
                fclose(log);
            }
            break;
        }else if (pad.Buttons & PSP_CTRL_CIRCLE){
示例#16
0
void pspDebugKbDrawString(char* str) {
  int i;

  pspDebugScreenSetTextColor(PSP_DEBUG_KB_CHAR_COLOUR);
  pspDebugScreenSetBackColor(PSP_DEBUG_KB_BACK_COLOUR);

  pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X + ((PSP_DEBUG_KB_BOX_WIDTH - PSP_DEBUG_KB_MAXLEN) / 2), PSP_DEBUG_KB_BOX_Y + 1);
  for (i=0; i<PSP_DEBUG_KB_MAXLEN; i++) {
    pspDebugScreenPrintf("_");
  }

  pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X + ((PSP_DEBUG_KB_BOX_WIDTH - PSP_DEBUG_KB_MAXLEN) / 2), PSP_DEBUG_KB_BOX_Y + 1);
  pspDebugScreenPrintf("%s", str);
}
示例#17
0
void MyExceptionHandler(PspDebugRegBlock *regs) {
	/* Do normal initial dump, setup screen etc */

	pspDebugScreenInit();

	pspDebugScreenSetBackColor(0x00FF0000);
	pspDebugScreenSetTextColor(0xFFFFFFFF);
	pspDebugScreenClear();

	pspDebugScreenPrintf("Exception Details:\n");
	pspDebugDumpException(regs);

	while (1) ;
}
示例#18
0
static void draw_applet(CEFiveUi *prUi) {
    CEFiveConfig* prCfg = NULL;
    ColorConfig* prColor = NULL;

    if (prUi == NULL) {
        return;
    }
    prCfg = prUi->prCEConfig;
    switch(prUi->applet) {
        case 0:
            if (prUi->drawn == 0) {
                prUi->cheatpanel.dirty = 1;
            }
            cheatpanel_redraw(&prUi->cheatpanel);
            break;
        case 1:
            ceditor_redraw(&prUi->cheatEditor);
            break;
        case 2:
            if (prUi->drawn == 0) {
                prUi->disassembler.dirty = 1;
            }
            disassembler_redraw(&prUi->disassembler);
            break;
        case 3:
            if (prUi->drawn == 0) {
                prUi->hexeditor.dirty = 1;
            }
            hexeditorRedraw(&prUi->hexeditor);
            break;
        case 4:
            searchpanel_redraw(&prUi->searchpanel);
            break;
        case 5:
            gameinfoRedraw(&prUi->gameinfo);
            break;
        case 6:
            optionspanel_redraw(&prUi->optionspanel);
            break;
    }
    if (prCfg != NULL) {
        prColor = cefiveconfig_get_panelcolor(prCfg);
    } else {
        prColor = &prUi->config.color;
    }
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
}
示例#19
0
文件: main.c 项目: joshdekock/jim-psp
/* Example custom exception handler */
void MyExceptionHandler(PspDebugRegBlock *regs)
{
	/* Do normal initial dump, setup screen etc */
	pspDebugScreenInit();

	/* I always felt BSODs were more interesting that white on black */
	pspDebugScreenSetBackColor(0x00FF0000);
	pspDebugScreenSetTextColor(0xFFFFFFFF);
	pspDebugScreenClear();

	pspDebugScreenPrintf("I regret to inform you your psp has just crashed\n");
	pspDebugScreenPrintf("Please contact Sony technical support for further information\n\n");
	pspDebugScreenPrintf("Exception Details:\n");
	pspDebugDumpException(regs);
	pspDebugScreenPrintf("\nBlame the 3rd party software, it cannot possibly be our fault!\n");
}
示例#20
0
int optionspanel_redraw(OptionsPanel* prPanel) {
    HexPad* prPad = NULL;
    ColorConfig* prColor = NULL;
    CursorPos* prPos = NULL;
    Dimension* prSize = NULL;
    char sFmt[10];
    int i = 0;

    if (prPanel == NULL) {
        return OPTIONSPANEL_NULLPTR;
    }
    
    if (prPanel->editing == 1) {
        prPad = get_hexpad(prPanel);
        if (prPad->visible == 1) {
            if (hexpad_redraw(prPad) < 0) {
                return OPTIONSPANEL_FAILURE;
            }
            return OPTIONSPANEL_SUCCESS;
        }
        if (commit_edit(prPanel) < 1) {
            return OPTIONSPANEL_FAILURE;
        }
    }
    
    if (prPanel->dirty == 0) {
        return OPTIONSPANEL_SUCCESS;
    }
    prColor = get_panelcolor(prPanel);
    prPos = get_position(prPanel);
    prSize = get_size(prPanel);
    
    pspDebugScreenSetXY(prPos->x, prPos->y + 1);
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    sprintf(sFmt, "%%-%ds", prSize->width);
    pspDebugScreenKprintf(sFmt, "Options");

    for (i = 0; i < prSize->height - 2; i++) {
        if (render_row(prPanel, i) < 0) {
            return OPTIONSPANEL_FAILURE;
        }
    }
    prPanel->dirty = 0;
    return OPTIONSPANEL_SUCCESS;
}
示例#21
0
static int render_value(HexPad* prPad) {
    CursorPos* prPos = NULL;
    ColorConfig* prColor = NULL;
    SceUInt32 value = 0;
    
    if (prPad == NULL) {
        return HEXPAD_NULLPTR;
    }
    prPos = hexpad_get_position(prPad);
    prColor = hexpad_get_panelcolor(prPad);
    value = hexpad_get_value(prPad);
    pspDebugScreenSetXY(prPos->x, prPos->y + 12);
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    pspDebugScreenKprintf(" 0x%08X ", value);
    
    return HEXPAD_SUCCESS;
}
示例#22
0
static void draw_applet_menu(CEFiveUi *prUi) {
    CEFiveConfig* prCfg = NULL;
    ColorConfig* prColor = NULL;
    if (prUi == NULL) {
        return;
    }
    prCfg = prUi->prCEConfig;
    AppletMenu *prMenu = &prUi->appletmenu;
    
    appletmenuRedraw(prMenu);
    if (prCfg != NULL) {
        prColor = cefiveconfig_get_panelcolor(prCfg);
    } else {
        prColor = &prUi->config.color;
    }
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
}
示例#23
0
int hexeditorRedraw(HexEditor* prHex) {
    AppletConfig* prApCfg = NULL;
    ColorConfig* prColor = NULL;

    if (prHex == NULL) {
        return HEXEDITOR_MEMORY;
    }
    if (prHex->dirty == 0) {
        return;
    }
    prApCfg = prHex->prApCfg;
    prColor = &prApCfg->rPanel.rColor;
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    pspDebugScreenSetXY(prHex->config.position.x, prHex->config.position.y);
    pspDebugScreenKprintf("%-67s", "Hex Editor");
    drawTable(prHex);
    drawCursor(prHex);
    prHex->dirty = 0;
    return HEXEDITOR_SUCCESS;
}
示例#24
0
static int draw_results_panel(SearchPanel* prPanel) {
    SearchEngine* prEngine = NULL;
    SearchResult* prResult = NULL;
    AppletConfig* prApCfg = NULL;
    ColorConfig* prColor = NULL;
    int row = 0;
    int col = 0;
    int x = 0;
    int y = 0;
    int rct = 0;
    int i = 0;
    
    if (prPanel == NULL) {
        return SEARCHPANEL_MEMORY;
    }
    prEngine = prPanel->prEngine;
    if (prEngine == NULL) {
        return SEARCHPANEL_MEMORY;
    }
    prApCfg = prPanel->prApCfg;
    rct = prEngine->result_count;

    x = prPanel->config.top.x;
    y = prPanel->config.top.y + 9;

    pspDebugScreenSetXY(x, y);
    if (prApCfg != NULL) {
        prColor = appletconfig_get_panelcolor(prApCfg);
    } else {
        prColor = &prPanel->config.color;
    }
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    pspDebugScreenKprintf("Search Results: %d", rct);
    prPanel->config.tabletop.y = 11;
    prPanel->config.tablesize.height = 20;
    draw_dword_results(prPanel);
    return SEARCHPANEL_SUCCESS;
}
示例#25
0
void pspDebugKbDrawBox() {
  int i, j;

  pspDebugScreenSetTextColor(PSP_DEBUG_KB_CHAR_COLOUR);
  pspDebugScreenSetBackColor(PSP_DEBUG_KB_BACK_COLOUR);

  pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X, PSP_DEBUG_KB_BOX_Y);
  pspDebugScreenPrintf("+");
  pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X, PSP_DEBUG_KB_BOX_Y + PSP_DEBUG_KB_BOX_HEIGHT);
  pspDebugScreenPrintf("+");
  pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X + PSP_DEBUG_KB_BOX_WIDTH, PSP_DEBUG_KB_BOX_Y);
  pspDebugScreenPrintf("+");
  pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X + PSP_DEBUG_KB_BOX_WIDTH, PSP_DEBUG_KB_BOX_Y + PSP_DEBUG_KB_BOX_HEIGHT);
  pspDebugScreenPrintf("+");

  for (i = 1; i < PSP_DEBUG_KB_BOX_WIDTH; i++) {
    pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X + i, PSP_DEBUG_KB_BOX_Y);
    pspDebugScreenPrintf("-");
    pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X + i, PSP_DEBUG_KB_BOX_Y + PSP_DEBUG_KB_BOX_HEIGHT);
    pspDebugScreenPrintf("-");
  }

  for (i = 1; i < PSP_DEBUG_KB_BOX_HEIGHT; i++) {
    pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X, PSP_DEBUG_KB_BOX_Y + i);
    pspDebugScreenPrintf("|");
    pspDebugScreenSetXY(PSP_DEBUG_KB_BOX_X + PSP_DEBUG_KB_BOX_WIDTH, PSP_DEBUG_KB_BOX_Y + i);
    pspDebugScreenPrintf("|");
  }

  for (i = 0; i < PSP_DEBUG_KB_NUM_ROWS; i++) {
    for (j = 0; j < PSP_DEBUG_KB_NUM_CHARS; j++) {
      pspDebugKbDrawKey(i, j, 0);
    }
  }

  for (i = 0; i < PSP_DEBUG_KB_NUM_COMMANDS; i++) {
    pspDebugKbDrawKey(PSP_DEBUG_KB_COMMAND_ROW, i, 0);
  }
}
示例#26
0
static void draw_titlebar(CEFiveUi *prUi) {
    CEFiveConfig* prCfg = NULL;
    ColorConfig* prColor = NULL;
    if (prUi == NULL) {
        return;
    }
    prCfg = prUi->prCEConfig;
    if (prCfg != NULL) {
        prColor = cefiveconfig_get_titlecolor(prCfg);
    } else {
        prColor = &prUi->config.titlebar;
    }
    char buf[68];
    u32 bg = prColor->background;
    u32 fg = prColor->text;
    pspDebugScreenSetXY(0, 0);
    pspDebugScreenSetBackColor(bg);
    pspDebugScreenSetTextColor(fg);
    sprintf(buf, "CEFive %d.%d - %s",
            CEFIVE_VERSION_MAJ, CEFIVE_VERSION_MIN, prUi->game_id);
    pspDebugScreenKprintf("%-68s", buf);
    draw_cheat_status(prUi);
}
示例#27
0
static int render_row(HexView* prView, const int row) {
    ColorConfig* prPcolor = NULL;
    ColorConfig* prCcolor = NULL;
    CursorPos* prCursor = NULL;
    CursorPos* prPos = NULL;
    Dimension* prSize = NULL;
    SceUInt32 address = 0;

    if (prView == NULL) {
        return HEXVIEW_NULLPTR;
    }

    prPcolor = get_panelcolor(prView);
    prCcolor = get_cursorcolor(prView);
    prCursor = get_cursorpos(prView);
    prPos = get_position(prView);
    prSize = get_size(prView);

    pspDebugScreenSetXY(prPos->x, prPos->y + row);
    if (row == prCursor->y) {
        if (cursor_color(prView) < 0) {
            return HEXVIEW_FAILURE;
        }
    } else {
        if (panel_color(prView) < 0) {
            return HEXVIEW_FAILURE;
        }
    }
    address = row_address(prView, row);
    pspDebugScreenKprintf("0x%08X", address);

    pspDebugScreenSetBackColor(prPcolor->background);
    pspDebugScreenSetTextColor(prPcolor->text);

    return HEXVIEW_SUCCESS;
}
示例#28
0
static int render_cursor(HexPad* prPad) {
    CursorPos* prPos = NULL;
    ColorConfig* prColor = NULL;
    int bp = 0;
    int ap = 0;
    int x = 0;
    int y = 0;
    char sFmt[20];
    if (prPad == NULL) {
        return HEXPAD_NULLPTR;
    }
    bp = 3 + prPad->digit;
    ap = 12 - bp - 1;
    sprintf(sFmt, "%%%ds^%%-%ds", bp, ap);
    prColor = hexpad_get_panelcolor(prPad);
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    prPos = hexpad_get_position(prPad);
    x = prPos->x;
    y = prPos->y + 13;
    pspDebugScreenSetXY(x, y);
    pspDebugScreenKprintf(sFmt, "", "");
    return HEXPAD_SUCCESS;
}
示例#29
0
static int drawAddressColumn(HexEditor* prHex, int iRow) {
    AppletConfig* prApCfg = NULL;
    ColorConfig* prColor = NULL;

    if (prHex == NULL) {
        return HEXEDITOR_MEMORY;
    }
    prApCfg = prHex->prApCfg;
    SceUInt32 poff = getPhysicalOffset(prHex);
    SceUInt32 base = prHex->config.base_address;
    SceUInt32 vbase = base + poff;
    int bpl = prHex->config.bytes_per_line;
    SceUInt32 vaddr = vbase + (iRow * bpl);
    prColor = &prHex->config.address;
    int y = prHex->cursor.y;
    if (iRow == y) {
        prColor = &prApCfg->rPanel.rCursor;
    }
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    pspDebugScreenKprintf("0x%08X", vaddr);

    return HEXEDITOR_SUCCESS;
}
示例#30
0
static int draw_status_panel(SearchPanel* prPanel) {
    SearchEngine* prEngine = NULL;
    AppletConfig* prApCfg = NULL;
    ColorConfig* prColor = NULL;
    char* sStatus = "Unknown Status";
    char sSmsg[60];
    int x = 0;
    int y = 0;
    ESearchState rEss;
    SceUInt32 pos = 0;
    SceUInt32 max = 0;
    SceUInt32 min = 0;
    SceUInt32 vpos = 0;
    int tdist = 0;
    int edist = 0;
    int cp = 0;

    if (prPanel == NULL) {
        return SEARCHPANEL_MEMORY;
    }
    prEngine = prPanel->prEngine;
    if (prEngine == NULL) {
        return SEARCHPANEL_MEMORY;
    }
    prApCfg = prPanel->prApCfg;
    x = prPanel->config.top.x;
    y = prPanel->config.status_line;
    rEss = prEngine->rState;
    switch (rEss) {
        case ESS_Fault:
            sStatus = "SearchEngine encountered fault.";
            break;
        case ESS_Stopped:
            sStatus = "SearchEngine not running.";
            break;
        case ESS_Idle:
            sStatus = "Idle.";
            break;
        case ESS_Searching:
            pos = searchengine_tell(prEngine);
            max = prEngine->rConfig.max_position;
            min = prEngine->rConfig.min_position;
            tdist = max - min;
            edist = pos - min;
            cp = ((edist / tdist) * 100);
            vpos = pos & ~0x40000000;
            sprintf(sSmsg, "Searching...0x%08X %d%%", vpos, cp);
            sStatus = sSmsg;
            break;
        case ESS_Finished:
            sStatus = "Search Finished.";
            break;
    }
    pspDebugScreenSetXY(x, y);
    if (prApCfg != NULL) {
        prColor = appletconfig_get_statuscolor(prApCfg);
    } else {
        prColor = &prPanel->config.status;
    }
    pspDebugScreenSetBackColor(prColor->background);
    pspDebugScreenSetTextColor(prColor->text);
    pspDebugScreenKprintf("Status: %-59s", sStatus);

    return SEARCHPANEL_SUCCESS;
}