uint8_t main(void) { const char palettes[] = { 0x0f, 0x00, 0x10, 0x20, 0x0f, 0x06, 0x16, 0x26, 0x0f, 0x08, 0x18, 0x28, 0x09, 0x0a, 0x0b, 0x0c }; const char string[] = "hello world!"; char i; ShowScreen(0); // // パレットを書き込み // *(char*)0x2006 = 0x3f; // *(char*)0x2006 = 0x00; // for (i = 0; i < 0x10; i ++) // *(char*)0x2007 = palettes[i]; // // *(char*)0x2006 = 0x21; // *(char*)0x2006 = 0x20; // // ネームテーブルへ書き込み // for (i = 0; i < sizeof(string); i ++) { // *(char*)0x2007 = string[i]; // } SetScroll(0, 0); ShowScreen(1); while (1); return 0; }
Login_Ui::Login_Ui( QWidget * parent ) : QWidget( parent ) { failCount = 0; ui.setupUi( this ); connect( ui.loginButton, SIGNAL( clicked() ), this, SLOT( CheckFields() ) ); connect( ui.cancelButton, SIGNAL( clicked() ), this, SLOT( ResetFields() ) ); connect( this, SIGNAL( FailedLogin() ), this, SLOT( BadLoginAttempt() ) ); connect( ui.username, SIGNAL( returnPressed() ), this, SLOT( CheckFields() ) ); connect( ui.password, SIGNAL( returnPressed() ), this, SLOT( CheckFields() ) ); connect( this, SIGNAL( ShowScreen() ), this, SLOT( ResetFields() ) ); }
Checkout_Confirm_Ui::Checkout_Confirm_Ui( QWidget * parent ) : QWidget( parent ) { ui.setupUi( this ); //connect the dots, tra-la-la-la connect( ui.cancelCheckout, SIGNAL( clicked() ), this, SLOT( Cancel() ) ); connect( this, SIGNAL( ShowScreen() ), this, SLOT( UpdateView() ) ); }
bool GUIManager::Init() { new CEGUI::DefaultLogger(); CEGUI::Logger::getSingleton().setLogFilename("CEGUI.log"); GUIRenderer = &CEGUI::OgreRenderer::bootstrapSystem(); Ogre::ResourceGroupManager::getSingleton().addResourceLocation("Media/GUI/schemes", "FileSystem", "schemes"); Ogre::ResourceGroupManager::getSingleton().addResourceLocation("Media/GUI/imagesets", "FileSystem", "imagesets"); Ogre::ResourceGroupManager::getSingleton().addResourceLocation("Media/GUI/fonts", "FileSystem", "fonts"); Ogre::ResourceGroupManager::getSingleton().addResourceLocation("Media/GUI/layouts", "FileSystem", "layouts"); Ogre::ResourceGroupManager::getSingleton().addResourceLocation("Media/GUI/looknfeel", "FileSystem", "looknfeels"); CEGUI::Imageset::setDefaultResourceGroup("imagesets"); CEGUI::Font::setDefaultResourceGroup("fonts"); CEGUI::Scheme::setDefaultResourceGroup("schemes"); CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels"); CEGUI::WindowManager::setDefaultResourceGroup("layouts"); CEGUI::SchemeManager::getSingleton().create("ArkanaLook.scheme"); CEGUISystem = &CEGUI::System::getSingleton(); CEGUISystem->setDefaultMouseCursor("Vanilla-Images", "MouseArrow"); CEGUISystem->setMouseClickEventGenerationEnabled(true); //CEGUISystem->setDefaultFont("Blackletter-10"); CEGUIWindowManager = &CEGUI::WindowManager::getSingleton(); // Initialize Screens here matching them to their Enum ScreenList[SCREEN_SPLASH] = (ScreenBase*) new SplashScreen(); ScreenList[SCREEN_SPLASH]->Init(); ScreenList[SCREEN_GAME_SETUP] = (ScreenBase*) new GameSetupScreen(); ScreenList[SCREEN_GAME_SETUP]->Init(); ScreenList[SCREEN_MAIN_GAME] = (ScreenBase*) new MainGameScreen(); ScreenList[SCREEN_MAIN_GAME]->Init(); ShowScreen(SCREEN_SPLASH); return true; }
bool VR_VoiceBoxAgentClimate::HVACSteeringScreen( IVECIParsedMessage *pcMsg ) { if (NULL == pcMsg) { return false; } CVECIOutStr xmlMsg; (void)pcMsg->GetString(&xmlMsg); VR_LOG("HVACSteeringScreen: %s\n", xmlMsg.Get()); ShowScreen("STEERING"); return true; }
bool VR_VoiceBoxAgentClimate::HVACSeatOperationScreen( IVECIParsedMessage *pcMsg ) { if (NULL == pcMsg) { return false; } CVECIOutStr xmlMsg; (void)pcMsg->GetString(&xmlMsg); VR_LOG("HVACSeatOperationScreen: %s\n", xmlMsg.Get()); ShowScreen("SEAT_OPERATION"); return true; }
bool VR_VoiceBoxAgentClimate::HVACFrontSeatScreen( IVECIParsedMessage *pcMsg ) { if (NULL == pcMsg) { return false; } CVECIOutStr xmlMsg; (void)pcMsg->GetString(&xmlMsg); VR_LOG("HVACFrontSeatScreen: %s\n", xmlMsg.Get()); ShowScreen("FRONT_SEAT"); return true; }
////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// // // Command - Process text command // // Inputs: Line command to process // // Outputs: None. // void Command(char *Buffer) { ParseInit(Buffer); char *Command = ParseToken(); #ifdef USE_MAIN_SCREEN // // MA - Show the main screen // if( StrEQ(Command,"MA") ) { ShowScreen('MA'); return; } #ifdef USE_MAIN_SCREEN_CMDS // // See if the local screen can manage the command // if( SelectedScreen == 'MA' ) { if( MAScreenCommand(Command) ) return; } // // Universally accept <ESC> as an escape to the main screen. // if( StrEQ(Command,ESC_CMD) ) { ShowScreen('MA'); return; } #endif #endif ////////////////////////////////////////////////////////////////////////////////////////// #ifdef USE_HELP_SCREEN // // HE - Help screen // if( StrEQ(Command,"HE") || StrEQ(Command,"?" ) ) { ShowScreen('HE'); return; } #ifdef USE_HELP_SCREEN_CMDS // // See if the local screen can manage the command // if( SelectedScreen == 'HE' ) { if( HEScreenCommand(Command) ) return; } #endif #endif ////////////////////////////////////////////////////////////////////////////////////////// #ifdef USE_DEBUG_SCREEN // // DE - Show the debug screen // if( StrEQ(Command,"DE") ) { ShowScreen('DE'); return; } #ifdef USE_DEBUG_SCREEN_CMDS // // See if the local screen can manage the command // if( SelectedScreen == 'DE' ) { if( DEScreenCommand(Command) ) return; } #endif #endif ////////////////////////////////////////////////////////////////////////////////////////// #ifdef USE_MEMORY_SCREEN // // ME - Show the memory screen // if( StrEQ(Command,"ME") ) { ShowScreen('ME'); return; } #ifdef USE_MEMORY_SCREEN_CMDS // // See if the local screen can manage the command // if( SelectedScreen == 'ME' ) { if( MEScreenCommand(Command) ) return; } #endif #endif #ifdef USE_EEPROM_SCREEN // // EE - Show the memory screen // if( StrEQ(Command,"EE") ) { ShowScreen('EE'); return; } #ifdef USE_EEPROM_SCREEN_CMDS // // See if the local screen can manage the command // if( SelectedScreen == 'EE' ) { if( EEScreenCommand(Command) ) return; } #endif #endif // // Not a recognized command. Let the user know he goofed. // CursorPos(1,ERROR_ROW); ClearEOL; PrintString("Unrecognized command ("); PrintString(Command); PrintString(")\r\n"); PrintStringP(PSTR(BEEP)); }
int main(int argc,char**argv) { double atStart,now,remain; /// Initialize GLFW glfwInit(); // Open registers OpenGL window if( !(windows[REGISTER_WINDOW]=glfwCreateWindow( REGISTER_WIDTH, REGISTER_HEIGHT, "cpu",NULL,NULL)) ) { glfwTerminate(); return 1; } glfwSetWindowPos(windows[REGISTER_WINDOW],600,740); glfwMakeContextCurrent(windows[REGISTER_WINDOW]); setupGL(REGISTER_WINDOW,REGISTER_WIDTH,REGISTER_HEIGHT); // Open timing OpenGL window if( !(windows[TIMING_WINDOW]=glfwCreateWindow( TIMING_WIDTH, TIMING_HEIGHT, "timing",NULL,NULL)) ) { glfwTerminate(); return 1; } glfwSetWindowPos(windows[TIMING_WINDOW],600,300); glfwMakeContextCurrent(windows[TIMING_WINDOW]); setupGL(TIMING_WINDOW,TIMING_WIDTH,TIMING_HEIGHT); // Open invaders OpenGL window if( !(windows[MAIN_WINDOW]=glfwCreateWindow( WIDTH, HEIGHT, "invaders",NULL,NULL)) ) { glfwTerminate(); return 1; } glfwSetWindowPos(windows[MAIN_WINDOW],300,300); glfwMakeContextCurrent(windows[MAIN_WINDOW]); setupGL(MAIN_WINDOW,WIDTH,HEIGHT); glfwSwapInterval(0); // Disable VSYNC glfwSetKeyCallback(windows[MAIN_WINDOW],kbHandler); glfwSetScrollCallback(windows[TIMING_WINDOW],mwHandler); atStart=glfwGetTime(); ////////////////// if (InitialiseMemory()) return -1; PinSetRESET(1); PIN_BUFFER_RESET=1; PinSetO1(1); // Run with reset high for a few cycles to perform a full cpu reset PinSetO1(0); PinSetO2(1); PinSetO2(0); PinSetO1(1); PinSetO1(0); PinSetO2(1); PinSetO2(0); PinSetO1(1); PinSetO1(0); PinSetO2(1); PinSetO2(0); PinSetRESET(0); // RESET CPU PIN_BUFFER_RESET=0; //dumpInstruction=100000; int stopTheClock=0; while (!glfwGetKey(windows[MAIN_WINDOW],GLFW_KEY_ESCAPE)) { if (!stopTheClock) { masterClock++; if ((masterClock%4)==0) pixelClock++; if ((masterClock%10)==0) { // I8080 emulation works off positive edge trigger. So we need to supply the same sort of // clock. PIN_BUFFER_O2=0; PIN_BUFFER_O1=1; PinSetO1(1); // Execute a cpu step if (bTimingEnabled) RecordPins(); PIN_BUFFER_O1=0; PinSetO1(0); if (bTimingEnabled) RecordPins(); PIN_BUFFER_O2=1; PinSetO2(1); if (bTimingEnabled) RecordPins(); PIN_BUFFER_O2=0; PinSetO2(0); if (!MEM_Handler()) { stopTheClock=1; } if (bTimingEnabled) RecordPins(); PinSetINT(0); // clear interrupt state PIN_BUFFER_INT=0; cpuClock++; } if (pixelClock==30432+10161) // Based on 19968000 Mhz master clock + mame notes { NEXTINT=0xCF; PinSetINT(1); PIN_BUFFER_INT=1; } if (pixelClock==71008+10161) { NEXTINT=0xD7; PinSetINT(1); PIN_BUFFER_INT=1; } } if (pixelClock>=83200 || stopTheClock) { if (pixelClock>=83200) pixelClock=0; if (glfwWindowShouldClose(windows[TIMING_WINDOW])) { bTimingEnabled=0; glfwHideWindow(windows[TIMING_WINDOW]); } if (glfwWindowShouldClose(windows[REGISTER_WINDOW])) { bRegisterEnabled=0; glfwHideWindow(windows[REGISTER_WINDOW]); } glfwMakeContextCurrent(windows[MAIN_WINDOW]); ShowScreen(MAIN_WINDOW,WIDTH,HEIGHT); glfwSwapBuffers(windows[MAIN_WINDOW]); if (bTimingEnabled) { glfwMakeContextCurrent(windows[TIMING_WINDOW]); DrawTiming(videoMemory[TIMING_WINDOW],TIMING_WIDTH); ShowScreen(TIMING_WINDOW,TIMING_WIDTH,TIMING_HEIGHT); glfwSwapBuffers(windows[TIMING_WINDOW]); } if (bRegisterEnabled) { glfwMakeContextCurrent(windows[REGISTER_WINDOW]); DrawRegister(videoMemory[REGISTER_WINDOW],REGISTER_WIDTH); ShowScreen(REGISTER_WINDOW,REGISTER_WIDTH,REGISTER_HEIGHT); glfwSwapBuffers(windows[REGISTER_WINDOW]); } glfwPollEvents(); g_traceStep=0; if (CheckKey(GLFW_KEY_PAUSE)) { g_instructionStep^=1; if (stopTheClock && !g_instructionStep) stopTheClock=0; ClearKey(GLFW_KEY_PAUSE); } if (stopTheClock && CheckKey('S')) { stopTheClock=0; ClearKey('S'); } if (stopTheClock && CheckKey('T')) { stopTheClock=0; g_traceStep=1; ClearKey('T'); } now=glfwGetTime(); remain = now-atStart; while ((remain<0.02f)) { now=glfwGetTime(); remain = now-atStart; } atStart=glfwGetTime(); } } return 0; }
uint8_t main(void) { sprite_t* sprite = (sprite_t*)0x0200; const char palettes[] = { 0x0f, 0x00, 0x10, 0x20, 0x0f, 0x06, 0x16, 0x26, 0x0f, 0x08, 0x18, 0x28, 0x09, 0x0a, 0x0b, 0x0c }; const char string[] = "hello sprite dma!"; char i; ShowScreen(0); // パレットを書き込み *(char*)0x2006 = 0x3f; *(char*)0x2006 = 0x00; for (i = 0; i < 0x10; i ++) *(char*)0x2007 = palettes[i]; *(char*)0x2006 = 0x21; *(char*)0x2006 = 0x20; // ネームテーブルへ書き込み for (i = 0; i < sizeof(string); i ++) { *(char*)0x2007 = string[i]; } SetScroll(0, 0); ShowScreen(1); sprite[0].y = 20; sprite[0].idx = 0; sprite[0].attr = 0; sprite[0].x = 0; sprite[1].y = 25; sprite[1].idx = 1; sprite[1].attr = 0; sprite[1].x = 10; sprite[2].y = 20; sprite[2].idx = 2; sprite[2].attr = 0; sprite[2].x = 20; sprite[3].y = 25; sprite[3].idx = 3; sprite[3].attr = 0; sprite[3].x = 30; sprite[4].y = 20; sprite[4].idx = 4; sprite[4].attr = 0; sprite[4].x = 40; sprite[5].y = 25; sprite[5].idx = 5; sprite[5].attr = 0; sprite[5].x = 50; *APU_SPR_DMA = 0x02; while (1); return 0; }
/**************************************************************************** * Main ****************************************************************************/ int main () { int have_sd = 0; #ifdef HW_DOL int *psoid = (int *) 0x80001800; void (*PSOReload) () = (void (*)()) 0x80001800; #endif Initialise (); /*** Start video ***/ FT_Init (); /*** Start FreeType ***/ ClearScreen(); ShowScreen(); #ifdef HW_RVL initialise_power(); have_sd = initFAT(WaitPromptChoice ("Use internal SD or FAT32 USB device?", "USB", "SD")); #else //Returns 1 (memory card in slot B, sd gecko in slot A) if A button was pressed and 0 if B button was pressed MEM_CARD = WaitPromptChoice ("Please select the slot where SD Gecko is inserted", "SLOT B", "SLOT A"); have_sd = initFAT(MEM_CARD); #endif for (;;) { /*** Select Mode ***/ ClearScreen(); setfontsize (FONT_SIZE); freecardbuf(); cancel = 0;/******a global value to track action aborted by user pressing button B********/ doall = 0; mode = SelectMode (); #ifdef HW_RVL if ((mode != 500 ) && (mode != 100) && (mode != 600)){ if (WaitPromptChoice ("Please select a memory card slot", "Slot B", "Slot A") == 1) { MEM_CARD = CARD_SLOTA; }else { MEM_CARD = CARD_SLOTB; } } #endif /*** Mode == 100 for backup, 200 for restore ***/ switch (mode) { case 100 : //User pressed A so keep looping //SMB_BackupMode(); //WaitPrompt ("Inactive"); break; case 200 : //User wants to delete MC_DeleteMode(MEM_CARD); break; case 300 : //User wants to backup if (have_sd) SD_BackupMode(); else WaitPrompt("Reboot aplication with a FAT device"); break; case 400 : //User wants to restore if (have_sd) SD_RestoreMode(); else WaitPrompt("Reboot aplication with a FAT device"); break; case 500 ://exit ShowAction ("Exiting..."); deinitFAT(); #ifdef HW_RVL //if there's a loader stub load it, if not return to wii menu. if (!!*(u32*)0x80001800) exit(1); else SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); #else if (psoid[0] == PSOSDLOADID) PSOReload (); else SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); #endif break; //PSO_Reload case 600 : //User wants to backup full card /* if (have_sd) SD_BackupModeAllFiles(); else WaitPrompt("Reboot aplication with an SD card"); */ break; case 700 : //Raw backup mode if (have_sd) { SD_RawBackupMode(); }else { WaitPrompt("Reboot aplication with a FAT device"); } break; case 800 : //Raw restore mode //These two lines are a work around for the second call of CARD_Probe to detect a newly inserted memory card CARD_Probe(MEM_CARD); VIDEO_WaitVSync (); if (CARD_Probe(MEM_CARD) > 0) { if (have_sd) SD_RawRestoreMode(); else WaitPrompt("Reboot aplication with a FAT device"); }else if (MEM_CARD) { WaitPrompt("Please insert a memory card in slot B"); }else { WaitPrompt("Please insert a memory card in slot A"); } break; case 900 : //Format card mode //These two lines are a work around for the second call of CARD_Probe to detect a newly inserted memory card CARD_Probe(MEM_CARD); VIDEO_WaitVSync (); if (CARD_Probe(MEM_CARD) > 0) { clearRightPane(); DrawText(390,224,"____________________"); DrawText(390,248,"F o r m a t C a r d"); DrawText(460,268,"M o d e"); DrawText(390,272,"____________________"); MC_FormatMode(MEM_CARD); }else if (MEM_CARD) { WaitPrompt("Please insert a memory card in slot B"); }else { WaitPrompt("Please insert a memory card in slot A"); } break; } offsetchanged = true; } while (1); return 0; }