unsigned __fastcall__ sleep (unsigned wait) { char typ; if ( (get_tv()) & TV_NTSC ) { typ = 60; } else { typ = 50; } Sleep(wait*typ); return 0; }
/****************************************************** * latLon2timeSlant: * Convert given latitude and longitude to time, slant * range, and doppler, using state vectors.*/ void latLon2timeSlant(meta_parameters *meta, double lat,double lon, double *time,double *slant,double *dop) { // No effort has been made to make this routine work with // pseudoprojected images. assert (meta->projection == NULL || meta->projection->type != LAT_LONG_PSEUDO_PROJECTION); double t,r,dt=1.0; stateVector sat,targ; int iterations = 0; double RE,RP;/*Radius of earth at equator and poles*/ if (meta->sar->image_type=='P') {/*Map projected image has earth polar and equatorial radii*/ RE=meta->projection->re_major; RP=meta->projection->re_minor; } else {/*Use WGS-84 ellipsoid*/ RE=6378137.0; RP=6356752.314; } targ=get_tv(RE,RP,lat,lon); /* get target state vector*/ t = 0.0; while ((fabs(dt) > time_err)&&(iterations<40)) { dt=time_of_radar(meta,t,targ.pos); t += dt; iterations ++; } sat=meta_get_stVec(meta,t); r = dist(sat.pos,targ.pos);/*r: slant range to target.*/ vecSub(targ.pos,sat.pos,&targ.pos); *time=t; *slant=r; if (dop!=NULL) *dop=fd(meta,sat,targ); }
int main(void) { unsigned int t, v; unsigned char palntsc; unsigned char *rev; unsigned char minor; unsigned char c; t = get_ostype(); /* get computer type */ v = get_tv(); /* get tv system */ palntsc = (v == AT_PAL); minor = (t & AT_OS_TYPE_MINOR) >> 5; switch(t & AT_OS_TYPE_MAIN) { case AT_OS_UNKNOWN: default: printf("unknown system type !!\n"); break; case AT_OS_400800: if (minor == 1) rev = "A"; else rev = "B"; printf("it's a 400/800, %s, Rev. %s\n",palntsc ? "PAL" : "NTSC",rev); break; case AT_OS_1200XL: if (minor == 1) rev = "10"; else rev = "11"; printf("it's a 1200XL, %s, Rev. %s\n",palntsc ? "PAL" : "NTSC",rev); break; case AT_OS_XLXE: printf("is'a a XL/XE, %s, Rev. %d\n",palntsc ? "PAL" : "NTSC",minor); break; } printf("hit <RETURN> to continure...\n"); c = getchar(); }