void sim_reset() { if (!initialized) sim_init(); clear_pipes(); clear_mem(reg); minAddr = 0; memCnt = 0; starting_up = 1; cycles = instructions = 0; #ifdef HAS_GUI if (gui_mode) { signal_register_clear(); create_memory_display(minAddr, memCnt); } #endif amux = bmux = MUX_NONE; cc = cc_in = DEFAULT_CC; wb_destE = REG_NONE; wb_valE = 0; wb_destM = REG_NONE; wb_valM = 0; mem_addr = 0; mem_data = 0; mem_write = FALSE; sim_report(); }
void fb_hooks(const ALLEGRO_EVENT & event){ switch(event.type){ case ALLEGRO_EVENT_KEY_DOWN: keys[event.keyboard.keycode]=true; switch(event.keyboard.keycode){ case ALLEGRO_KEY_SPACE: if(!has_lost) bird->im.rotation_vel=-(2.0f/3.0f)*(bird->im.rotation+PI/2); break; case ALLEGRO_KEY_R: clear_pipes(); break; case ALLEGRO_KEY_ESCAPE: if(!show_menu){ show_menu=true; menu->active=true; start_button->active=true; quit_button->active=true; has_lost=true; }else quit_at_next_frame(); break; } break; case ALLEGRO_EVENT_KEY_UP: keys[event.keyboard.keycode]=false; break; case ALLEGRO_EVENT_TIMER: if(event.timer.source==fb_timer) create_pipe(); break; } }
void sim_reset() { if (!initialized) sim_init(); clear_pipes(); clear_reg(reg); minAddr = 0; memCnt = 0; starting_up = 1; cycles = instructions = 0; cc = DEFAULT_CC; status = STAT_AOK; amux = bmux = MUX_NONE; cc = cc_in = DEFAULT_CC; wb_destE = REG_NONE; wb_valE = 0; wb_destM = REG_NONE; wb_valM = 0; mem_addr = 0; mem_data = 0; mem_write = FALSE; sim_report(); }