void menu_create(menu_t *menu) { beep(); //GUI_Command(4,0); //press_button(IC_BUTTON_MENU); SendToMC(6, 2, 0); SleepTask(100); FLAG_GUI_MODE = 0x2D; // In theory, we do not need this, but menu_close does not work properly without it... //DPData.gui_mode = 0x2D; // this is not the same as FLAG_GUI_MODE, but so far i do not see what it does current_menu = menu; menu_DPData = DPData; menu_destroy(); menu_initialize(); GUI_Lock(); GUI_PalleteInit(); menu_handler = dialog_create(22, menu_event_handler); //*(int*)((int)(menu_handler+0x58)) = (int)hack_central_handler; //*(int*)((int)(menu_handler+0x7C)) = (int)menu_event_handler; PalettePush(); PaletteChange(current_menu->color); menu_event_display(); GUI_UnLock(); GUI_PalleteUnInit(); }
/********************************************************************* * * GUITASK_AssertNoLock * */ void GUITASK_AssertNoLock(void) { GUI_Lock(); if (GUITASK__EntranceCnt > 1) { GUI_DEBUG_ERROROUT("GUITASK.c: GUITASK_AssertNoLock failed!"); } GUI_Unlock(); }
/******************************************************************* * * _DemoRandomGraph */ static void _DemoRandomGraph(void) { PARAM Param; int tDiff, t0; GUI_RECT Rect = {19, (LCD_YSIZE - 20) - YSIZE, (LCD_XSIZE - 2), (LCD_YSIZE - 21)}; GUI_HMEM hMem = GUI_ALLOC_AllocZero((LCD_XSIZE - 20) * sizeof(I16)); GUI_SetColor(GUI_WHITE); GUI_SetBkColor(GUI_RED); GUI_ClearRect(0, 55, LCD_XSIZE, 75); GUI_SetFont(&GUI_FontComic18B_1); GUI_DispStringAt("Random graph", 20, 55); GUI_Lock(); Param.aY = GUI_ALLOC_h2p(hMem); GUI_SetFont(&GUI_Font6x8); t0 = GUI_GetTime(); while((tDiff = (GUI_GetTime() - t0)) < 10000) { int t1, tDiff2; _GetRandomData(Param.aY, tDiff, (LCD_XSIZE - 20)); t1 = GUI_GetTime(); GUI_MEMDEV_Draw(&Rect, _Draw, &Param, 0, 0); tDiff2 = GUI_GetTime() - t1; if (tDiff2 < 100) { GUI_Delay(100 - tDiff2); } } GUI_Unlock(); GUI_ALLOC_Free(hMem); }
/********************************************************************* * * GUITASK_GetpContext * */ GUI_CONTEXT * GUITASK_GetpContext(int Index) { GUI_CONTEXT * pContext; pContext = NULL; GUI_Lock(); if (Index < GUI_MAXTASK) { pContext = &_Save[Index].Context; } GUI_Unlock(); return pContext; }