int loadrom(char *fn) { log_message("loadrom: loading rom '%s'\n",fn); unloadrom(); if(((rom = rom_load(fn)) == 0) || (nes_load(rom) != 0)) { log_message("loadrom: error loading rom '%s'\n",fn); return(1); } if(rom->diskdata) loaddiskstate(); // if(config.autostates) // loadstate(); nes_reset(1); //perform hard reset add_recent(fn); return(0); }
static void put_token(pairmatcher_t *pairmatcher, VALUE token, VALUE reporter) { VALUE pair_def; int depth; add_after_open(pairmatcher, token); add_after_close(pairmatcher, token); check_closed_pairs(pairmatcher, reporter); if ((pair_def = open_token_p(pairmatcher, token))) { put_open_token(pairmatcher, token, pair_def); } else if ((pair_def = close_token_p(pairmatcher, token)) && 0 <= (depth = matching_open_depth(pairmatcher, token, pair_def))) { put_close_token(pairmatcher, token, pair_def, depth, reporter); } add_recent(pairmatcher, reporter, token); }
void CWizDlg::from_readerwnd(short v, int v1, int v2, char *v3) { switch ( v) { case 1: // opened new file; //MessageBeep(1); add_recent(CString(v3)); get_file_settings(); m_name.SetWindowText(v3); wnd.update_viewPort(1); UpdateData(); //check_bookm(); first_e=false; // move mouse load_menub(NULL); //********************************* //GetSettings(&Info,sizeof(Info),AfxGetApp()->m_pszRegistryKey); /*strcpy(str1,Info.key); if ( !strchr(decode_b64(str1),'+') || ( (hash( strchr(str1+2,'+')+1 )/ 1000)+11 != strlen(str1+2) ) ) { str1[0] == '1'; } */ //*************************************************** /*{ bool expiried=false; SYSTEMTIME time; FILETIME time2; char drv_str[MAX_PATH]; char* s=drv_str; WIN32_FIND_DATA fnd; HANDLE done; bool find=false; char name[10]; GetLocalTime(&time); if ( time.wMonth > 9 || time.wYear>2000) { expiried=true; } SystemTimeToFileTime(&time,&time2); GetLogicalDriveStrings(49,drv_str); do { if ( GetDriveType(s)!=DRIVE_FIXED) { s+=4; continue; } strcpy(name,s); strcat(name,"*.*"); if ( (done=FindFirstFile(name,&fnd))!=INVALID_HANDLE_VALUE ) do { if ( CompareFileTime(&time2,&fnd.ftLastWriteTime)==-1 ) { expiried=true; break; } } while ( FindNextFile(done,&fnd) ); s+=4; } while ( *s ); GetWindowsDirectory(drv_str,MAX_PATH); strcat(drv_str,"\\*.*"); if ( (done=FindFirstFile(drv_str,&fnd))!=INVALID_HANDLE_VALUE ) do { if ( CompareFileTime(&time2,&fnd.ftLastWriteTime)==-1 ) { expiried=true; break; } } while ( FindNextFile(done,&fnd) ); if (expiried) { this->SendMessage(WM_SYSCOMMAND,SC_CLOSE ,0); //this->EndDialog(1); } if (expiried && wnd.isOpened() ) { wnd.CloseWindow(); } }*/ //****************************** //break; case 2: // page changed (pgUp/pgDn) showstat(); check_bookm(); parse_templ(templ_str,Info.fonts[8].templ); SetWindowText(templ_str); if (Info.show_bm && marked_page) wnd.draw_bm_lable(1); break; case 3: OnBookText(); // pressed "a" break; case 4: OnBookmm(); // press "z" break; case 5: Info.lines=v1; // change number of lines ( sizes(); when ReadFile(); ); break; case 6: //alt+a if ( marked_page ) break; Recents.GetHead()->change_top(CString(""),wnd.get_dim(),0); load_menub(); check_bookm(); if (Info.show_bm && marked_page) wnd.draw_bm_lable(1); break; case 7: //tab if ( Recents.GetHead()->jmp_next() ) wnd.Seek_to((Recents.GetHead())->cur_pos); break; case 8: // alt-m ShowTools(2); break; case 9: //alt-f ShowTools(v1); break; case 27: // close file; set_file_settings(); break; } /*if (exprd) { this->SendMessage(WM_SYSCOMMAND,SC_CLOSE ,0); this->EndDialog(1); }*/ }