void set_memory() { OBJECT *tree; int offset; rsrc_gaddr (R_TREE, O_MEM, &tree); if (! Supexec (get_blocks)) if ((tree[OM_ARAM].ob_flags & HIDETREE) == 0) { tree[OM_ARAM].ob_flags |= HIDETREE; offset = tree[OM_STRAM].ob_y - tree[OM_STING].ob_y; tree[OM_BOX].ob_height -= offset; tree[0].ob_height -= offset; } set_ram_string (blocks.sting_ttl, SKR_TTL, FALSE); set_ram_string (blocks.sting_lblk, SKR_LBLK, FALSE); set_ram_string (blocks.st_ttl, STR_TTL, FALSE); set_ram_string (blocks.st_lblk, STR_LBLK, FALSE); set_ram_string (blocks.alt_ttl, ALR_TTL, FALSE); set_ram_string (blocks.alt_lblk, ALR_LBLK, FALSE); }
void handleImagesDownload(void) // OBSOLETE { if(destDir.isSet == 0) { // destination dir not set? selectDestinationDir(); if(destDir.isSet == 0) { // destination dir still not set? (void) Clear_home(); (void) Cconws("You have to select destination dir!\r\nPress any key to continue.\n\r"); getKey(); return; } } BYTE res; (void) Clear_home(); (void) Cconws("Downloading selected images...\r\n"); while(1) { commandShort[4] = FDD_CMD_SEARCH_DOWNLOAD; commandShort[5] = 0; sectorCount = 1; // read 1 sector res = Supexec(ce_acsiReadCommand); if(res == FDD_DN_WORKING) { // if downloading (void) Cconws(pBfr); // write out status string (void) Cconws("\n\r"); } else if(res == FDD_DN_NOTHING_MORE) { // if nothing more to download (void) Cconws("All selected images downloaded.\r\nPress any key to continue.\n\r"); getKey(); break; } else if(res == FDD_DN_DONE) { // if this image finished downloading downloadImage(10); // store this downloaded image (void) Cconws("\n\r\n\r"); } sleep(1); // wait a second } }
main() { int key; Supexec(doit); for (;;) { while (Bconstat(2)!=-1); key=Bconin(2); if (key=='r') Supexec(inner_loop); if (key=='c') Supexec(outer_loop); if (key=='s') Supexec(monitor_sound); if (key=='d') Supexec(disable_loop); if (key=='e') Supexec(enable_loop); if (key==' ') break; } }
void imageSearch(void) { // first write the search string commandShort[4] = FDD_CMD_SEARCH_STRING; commandShort[5] = 0; p64kBlock = pBfr; // use this buffer for writing strcpy((char *) pBfr, search.text); // and copy in the search string sectorCount = 1; // write just one sector BYTE res = Supexec(ce_acsiWriteBlockCommand); if(res != FDD_OK) { // bad? write error showComError(); return; } search.row = 0; search.prevRow = 0; getResultsPage(0); }
void downloadCurrentToStorage(void) { if(!status.doWeHaveStorage) { // no storage? do nothing return; } commandShort[4] = FDD_CMD_SEARCH_DOWNLOAD2STORAGE; commandShort[5] = 0; p64kBlock = pBfr; // use this buffer for writing pBfr[0] = search.pageCurrent; // store page # pBfr[1] = search.row; // store item # sectorCount = 1; // write just one sector BYTE res = Supexec(ce_acsiWriteBlockCommand); if(res != FDD_OK) { // bad? write error showError("Failed to start download to storage.\r\n"); return; } getResultsPage(search.pageCurrent); // reload current page from host }
void insertCurrentIntoSlot(BYTE key) { if(!status.doWeHaveStorage) { // no storage? do nothing return; } commandShort[4] = FDD_CMD_SEARCH_INSERT2SLOT; commandShort[5] = 0; p64kBlock = pBfr; // use this buffer for writing pBfr[0] = search.pageCurrent; // store page # pBfr[1] = search.row; // store item # pBfr[2] = key - KEY_F1; // slot number - transform F1-F3 to 0-2 sectorCount = 1; // write just one sector BYTE res = Supexec(ce_acsiWriteBlockCommand); if(res != FDD_OK) { // bad? just be silent, CE_FDD.PRG doesn't know if this image is downloaded, so don't show warning return; } getResultsPage(search.pageCurrent); // reload current page from host }
void gem_program() { sting_drivers = (DRV_LIST *) Supexec (get_sting_cookie); if (sting_drivers == 0L) { form_alert (1, not_there); return; } if (strcmp (sting_drivers->magic, MAGIC) != 0) { form_alert (1, corrupted); return; } tpl = (TPL *) (*sting_drivers->get_dftab) (TRANSPORT_DRIVER); if (tpl != (TPL *) NULL) { sprintf (alert, found_it, tpl->module, tpl->author, tpl->version); form_alert (1, alert); do_some_work(); } else form_alert (1, no_module); }
int main(void) { int error; #if _MINT_ /* HR 151102 */ have_ssystem = Ssystem(-1, 0, 0) == 0; /* HR 151102: use Ssystem where possible */ mint = (find_cookie('MiNT') == -1) ? FALSE : TRUE; magx = (find_cookie('MagX') == -1) ? FALSE : TRUE; /* HR 151102 */ geneva = (find_cookie('Gnva') == -1) ? FALSE : TRUE; /* DjV 035 080203 */ mint |= magx; /* Quick & dirty */ if (mint) { Psigsetmask(0x7FFFE14EL); Pdomain(1); } #endif x_init(); if ((ap_id = appl_init()) < 0) return -1; if (_GemParBlk.glob.version >= 0x400) { shel_write(9, 1, 0, NULL, NULL); menu_register(ap_id, " Tera Desktop"); } if (rsrc_load(RSRCNAME) == 0) form_alert(1, msg_resnfnd); else { if ((error = init_xdialog(&vdi_handle, malloc, free, "Tera Desktop", 1, &nfonts)) < 0) xform_error(error); else { init_vdi(); rsc_init(); if (((max_w / screen_info.fnt_w) < 40) || ((max_h / screen_info.fnt_h) < 25)) alert_printf(1, MRESTLOW); else { if ((error = alloc_global_memory()) == 0) { if (exec_deskbat() == FALSE) { if (load_icons() == FALSE) { if (init() == FALSE) { graf_mouse(ARROW, NULL); evntloop(); wd_del_all(); menu_bar(menu, 0); xw_close_desk(); } free_icons(); /* HR 151102 */ wind_set(0, WF_NEWDESK, NULL, 0); dsk_draw(); } } Mfree(global_memory); } else xform_error(error); } if (vq_gdos() != 0) vst_unload_fonts(vdi_handle, 0); exit_xdialog(); } rsrc_free(); } /* DjV 013 030103 100203 ---vvv--- */ /* * The following section handles system shutdown and resolution change * If a resolution change is required, shutdown is performed first * If only shutdown s required, system will reset at the end. */ /* appl_exit(); */ if ( chrez || shutdown ) /* If change resolution or shutdown ... */ { /* Tell all applications which would understand it to end */ quit = shel_write ( 4, 2, 0, NULL, NULL ); /* complete shutdown */ evnt_timer( 3000, 0 ); /* Wait a bit? */ /* /* * In Mint, must tell all proceseses to terminate nicely ? * but this is only in this group ? What to do? */ Pkill(0, SIGTERM); evnt_timer(3000, 0); /* Wait a bit? */ */ /* * After all applications have hopefully been closed, * change the screen resolution if needed; * else- reset the computer */ if ( chrez ) get_set_video(2); #if 1 else #if _MINT_ if (!mint) /* HR 230203: Dont reset under MiNT or MagiC !!!!! */ #endif { /* Perform a reset here */ #if 0 /* with warnings */ long *m; /* to memory locations */ long rv; /* reset vector */ Super ( 0L ); /* Supervisor; old stack won't be needed again */ *(m = 0x420L) = 0L; /* memctrl */ *(m = 0x43aL) = 0L; /* memval2 */ *(m = 0x426L) = 0L; /* resvalid */ m = *( m = 0x4f2 ); /* to start of OS */ rv = *(m + 4); /* to routine that handles the reset */ Supexec(rv); /* execute it */ #else /* HR: without warnings */ long (*rv)(); /* reset vector */ Super ( 0L ); /* Supervisor; old stack won't be needed again */ memctrl = 0L; memval2 = 0L; resvalid = 0L; (long)rv = *((long *)os_start + 4); /* routine that handles the reset */ Supexec(rv); /* execute it */ #endif } #endif }
/* Get_Keybell() *========================================================================== * Get Current Keyboard Keyclick and Bell values */ void Get_Keybell( void ) { Supexec( get_noise ); }
/* Set_Keybell() *========================================================================== * Set Keyboard Keyclick and Bell */ void Set_Keybell( void ) { Supexec( set_noise ); }
DWORD getTicksAsUser(void) { DWORD res = Supexec(getTicks); return res; }
/* Set_Speed() *========================================================================== * Set the Blitter or 030 cache */ void Set_Speed( void ) { Set_Blitter(); Supexec( Set_TTCache ); }
void DSP_Stop(void) { Supexec(stop_dma_sound); }
/* show configuration dial, return 1 to cancel installation */ int configure( void ) { OBJECT *tree = rs_object; int quit = 0; int x, y, w, h, ox, oy; MRETS mk; int savelinear, saveudset, savetime, saveptime; if( ma_info == &start ) /* ma_info points at our start */ ObString(OK) = (char *)(rs_frstr[INSTRING]); /* set accel buttons */ savelinear = ma_info->linear; set_accelbox( savelinear ); /* set screensave buttons */ saveudset = ma_info->udset; set_screenbox( saveudset ); savetime = (ma_info->timeout)/3600; sl_x( SAVEBOX, savetime, SAVE_MIN, SAVE_MAX ); /* set modem switch */ if( ma_info->watch ) { Select(MODEM); } else { Deselect(MODEM); } /* set stacy options box */ if( ma_info->stacy ) { ObFlags( SWITCH ) = ObFlags( LITE ) = TOUCHEXIT; if( ma_info->stacmask & SH_SCREEN ) Select( SWITCH ); if( ma_info->stacmask & SH_LIGHT ) Select( LITE ); } else { ObFlags(SWITCH) = ObFlags(LITE) = NONE; ObState(SWITCH) = ObState(LITE) = DISABLED; /* deselects */ } /* set up park box */ Supexec((long(*)())get_parktime); if( parktime >= 0 ) parktime = ma_info->savepark; saveptime = parktime; if( saveptime == 0 ) saveptime = 1; set_parkbox(); if( parktime >= 0 ) sl_x( PARKBOX, parktime, PARK_MIN, PARK_MAX ); /* set appropriate icons */ graf_handle( &x, &y, &w, &h ); if( y < 16 ) { /* if char cell is < 16 pixels high, use 8 pixel icons */ ObSpec(IACCOFF).bitblk = (BITBLK *)(rs_frimg[ACCOFF8]); ObSpec(IACCSLOW).bitblk = (BITBLK *)(rs_frimg[ACCSLOW8]); ObSpec(IACCFAST).bitblk = (BITBLK *)(rs_frimg[ACCFAST8]); ObSpec(ISCREEN).bitblk = (BITBLK *)(rs_frimg[SCREEN8]); ObSpec(SAVEUP).bitblk = (BITBLK *)(rs_frimg[TIMEHI8]); ObSpec(SAVEDOWN).bitblk = (BITBLK *)(rs_frimg[TIMELO8]); ObSpec(IMODEM).bitblk = (BITBLK *)(rs_frimg[MODEM8]); ObSpec(IPARK).bitblk = (BITBLK *)(rs_frimg[PARK8]); ObSpec(PARKUP).bitblk = (BITBLK *)(rs_frimg[TIMEHI8]); ObSpec(PARKDOWN).bitblk = (BITBLK *)(rs_frimg[TIMELO8]); ObSpec(ILITE).bitblk = (BITBLK *)(rs_frimg[LITE8]); ObSpec(ISWITCH).bitblk = (BITBLK *)(rs_frimg[SCREEN8]); } form_center( rs_object, &x, &y, &w, &h ); form_dial( FMD_START, 0, 0, 0, 0, x, y, w, h ); form_dial( FMD_GROW, 0, 0, 0, 0, x, y, w, h ); objc_draw( tree, 0, MAX_DEPTH, x, y, w, h ); graf_mouse( ARROW, 0L ); do { switch( form_do( rs_object, 0 ) & 0x7fff ) { case LITE: if( IsSelected(LITE) ) { /* deselecting */ /* don't allow user to select screensave without litesave */ Deselect(SWITCH); Deselect(LITE); } else { Select(LITE); } Objc_draw( tree, STACOPTS, MAX_DEPTH, NULL ); break; case SWITCH: if( IsSelected(SWITCH) ) { /* deselecting */ Deselect(SWITCH); } else { /* don't allow user to select screensave without litesave */ Select(LITE); Select(SWITCH); } Objc_draw( tree, STACOPTS, MAX_DEPTH, NULL ); break; case SCREEN: /* floggle the bit */ ma_info->udset ^= 1; ma_info->updown = ma_info->udset; set_screenbox( ma_info->udset ); Objc_draw( tree, SCRNSECT, MAX_DEPTH, NULL); break; case ACCOFF: ma_info->linear = -1; break; case ACCSLOW: ma_info->linear = 1; break; case ACCFAST: ma_info->linear = 0; break; case SAVEUP: sl_arrow( SAVEBOX, SAVEUP, 1, SAVE_MIN, SAVE_MAX, &savetime ); break; case SAVEDOWN: sl_arrow( SAVEBOX, SAVEDOWN, -1, SAVE_MIN, SAVE_MAX, &savetime ); break; case SAVESLID: sl_drag( SAVEBOX, SAVE_MIN, SAVE_MAX, &savetime ); break; case SAVEBOX: Graf_mkstate( &mk ); objc_offset( tree, SAVESLID, &ox, &oy ); if( mk.x < ox ) oy = -SAVE_PAGE; else oy = SAVE_PAGE; sl_arrow( SAVEBOX, -1, oy, SAVE_MIN, SAVE_MAX, &savetime ); break; case PARK: if( IsSelected( PARK ) ) { /* deselecting */ saveptime = parktime; parktime = 0; } else { parktime = saveptime; sl_x( PARKBOX, parktime, PARK_MIN, PARK_MAX ); } set_parkbox(); Objc_draw( tree, PARKSECT, MAX_DEPTH, NULL ); break; case PARKUP: sl_arrow( PARKBOX, PARKUP, 1, PARK_MIN, PARK_MAX, &parktime ); break; case PARKDOWN: sl_arrow( PARKBOX, PARKDOWN, -1, PARK_MIN, PARK_MAX, &parktime ); break; case PARKSLID: sl_drag( PARKBOX, PARK_MIN, PARK_MAX, &parktime ); break; case PARKBOX: Graf_mkstate( &mk ); objc_offset( tree, PARKSLID, &ox, &oy ); if( mk.x < ox ) oy = -PARK_PAGE; else oy = PARK_PAGE; sl_arrow( PARKBOX, -1, oy, PARK_MIN, PARK_MAX, &parktime ); break; case SAVE: save_conf( savetime ); rs_object[SAVE].ob_state = NORMAL; Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); break; case OK: quit = OK; break; case CANCEL: quit = CANCEL; break; } /* delay after touchexit objects */ wait_bup(); } while (!quit); form_dial( FMD_SHRINK, 0, 0, 0, 0, x, y, w, h ); form_dial( FMD_FINISH, 0, 0, 0, 0, x, y, w, h ); if( quit == CANCEL ) { ma_info->updown = ma_info->udset = saveudset; ma_info->linear = savelinear; } else { if( IsSelected(MODEM) ) ma_info->watch = 1; else ma_info->watch = 0; if( ma_info->stacy ) { if( IsSelected(SWITCH) ) { ma_info->stacmask |= SH_SCREEN; } else { ma_info->stacmask &= ~SH_SCREEN; } if( IsSelected(LITE) ) { ma_info->stacmask |= SH_LIGHT; } else { ma_info->stacmask &= ~SH_LIGHT; } } ma_info->timeout = savetime * 3600; ma_info->savepark = parktime; Supexec((long(*)())set_ptime); } return (quit == CANCEL); }
int init_network(void) { static long init_drivers(void); char out[80]; int i,j; Supexec(init_drivers); /* See if we got a value */ if (drivers == (DRV_LIST *)NULL) { form_alert(1,"[1][STiK is not loaded! ][Quit]"); exit(EXIT_FAILURE); /* strcpy(out, "STiK is not loaded"); wind_set(win.handle, WF_INFO, (short)((long)out>>16), (short)out, NULL, NULL);*/ return (FALSE); } /* Check Magic number */ if (strcmp(MAGIC, drivers->magic)) { form_alert(1,"[1][Magic string does not match! ][Quit]"); exit(EXIT_FAILURE); /* strcpy(out, "Magic string doesn't match"); wind_set(win.handle, WF_INFO, (short)((long)out>>16), (short)(out), NULL, NULL);*/ return (FALSE); } /* OK, now we can get the address of the "TRANSPORT" layer * driver. If this seems unnecessarily complicated, it's * because I tried to create today, what I would like to * use later on. In future, there will be multiple * drivers accessible via this method. With luck, your * code will still work with future versions of my software. */ tpl = (TPL *)get_dftab(TRANSPORT_DRIVER); if (tpl == (TPL *)NULL) { form_alert(1,"[1][Transport layer NOT loaded! ][Quit]"); exit(EXIT_FAILURE); /* strcpy(out, "Transport layer *not* loaded"); wind_set(win.handle, WF_INFO, (short)((long)out>>16), (short)(out), NULL, NULL);*/ return (FALSE); } /* do_string( 0, "Transport layer loaded, Author\n "); do_string( 0, tpl->author); do_string( 0, ", version "); do_string( 0, tpl->version); do_string( 0, "\015\012"); */ /* form_alert(1,"[1][Transport layer IS loaded ][OK]"); */ sprintf(out, "Transport layer loaded"); wind_set(win.handle, WF_INFO, (short)((long)out>>16), (short)(out), NULL, NULL); for (i=0;i<=10000;i++) {for (j=0; j<=100;j++);} return (TRUE); }
DWORD getTicksAsUser(void) { return Supexec(getTicks); }
/* GetSYSPath() * ==================================================================== * Get the Paths for the EXTEND.SYS */ int GetSYSPath( char *sysfile, char *path ) { long len; /* Get the Bootup Device - It's either 'C' or 'A' */ Supexec( GetBootDrive ); drv = BootDrive; Drive = BootDrive + 'A'; path[0] = Drive; errno = 0; xopen( sysfile ); if( errno ) { /* Error - No SYS file */ return( errno ); } else { /* Found the SYS FILE */ lookahead = NO_TOKEN; /* Check for the PATH line at the top of the file. */ if( !match(PATH) ) { /* Error: No Path line at the top of the SYS file */ xclose(); return( 1 ); } skipequal(); /* Check for the PATH itself at the top of the file.*/ if( match(PATHSPEC) ) { /* Found the PATH */ strncpy( path, yytext, yyleng ); len = yyleng-1; if( path[len] != '\\' ) ++len; path[len] = '\0'; if( len > 2 ) /* below code fails for items like 'f:'*/ { if( !stat( path, &statbuf) ) errno = (isdir(&statbuf)) ? 0 : ENOTDIR; if( errno ) { /* Error Parsing the path */ xclose(); return( errno ); } } } else { /* Error parsing the PATH */ xclose(); return( 1 ); } } xclose(); return( 0 ); }
nohblanks() { if (jimint_status) Supexec(timeboff); }
void AtariIkbd_ShutdownEvents(void) { Supexec(SDL_AtariIkbdUninstall); }
void set_color_scheme(unsigned char colorm) { color=colorm; Supexec(initpal); }
void sleep(int seconds) { sleepSeconds = seconds; Supexec(sleepInSupervisor); }
/* parse_extend() * ==================================================================== * Parse the EXTEND.SYS file * IN: int skip 0 - Don't skip anything, parse everything. * Used during a rez change or boot-up * 1 - Skip parsing the path. Used during a * directory change. */ int parse_extend( int skip ) { long len; char *txtptr; /* Get the Bootup Device */ Supexec( GetBootDevice ); drv = BootDevice; Drive = BootDevice + 'A'; epath[0] = Drive; errno = 0; xopen( epath ); /* Check to see if the file 'EXTEND.SYS' exists. * If it doesn't, set the path to the root of the bootup device * and get the fonts that can be found there. */ if( errno ) { if( !skip ) { sprintf( Current.FontPath, "%c:", Drive ); /* set some defaults here ONLY when we are supposed * to parse EVERYTHING. This way when we are only * switching directories, the current values are * NOT affected. */ Current.FSMCacheSize = 100L; /* Set to 100K */ Current.BITCacheSize = 100L; Current.fsm_percent = 5; /* Set to 50% */ } /* get_all_fsm_fonts();*/ return( errno ); } lookahead = NO_TOKEN; /* If we are just interested in the fonts and info stuff, * let's skip the path parsing */ if( skip ) { skipequal(); match(PATH); skipequal(); match(PATHSPEC); goto skip_me; } /* Check if the PATH line is at the top of the 'EXTEND.SYS' file * If its not, we abort */ if( !match(PATH) ) { /* Error: No Path line at the top of the extend.sys file */ xclose(); sprintf( Current.FontPath, "%c:", Drive ); Current.FSMCacheSize = 100L; /* Set to 100K */ Current.BITCacheSize = 100L; Current.fsm_percent = 5; /* Set to 50% */ /* get_all_fsm_fonts();*/ return( 1 ); } skipequal(); if( match(PATHSPEC) ) { strncpy( fsmpath, yytext, yyleng ); len = yyleng-1; if( fsmpath[len] != '\\' ) ++len; fsmpath[len] = '\0'; if( len > 2 ) /* below code fails for items like 'f:'*/ { if( !stat(fsmpath, &statbuf) ) errno = (isdir(&statbuf)) ? 0 : ENOTDIR; if( errno ) { /* Error Parsing the path */ xclose(); sprintf( Current.FontPath, "%c:", Drive ); Current.FSMCacheSize = 100L; /* Set to 100K */ Current.BITCacheSize = 100L; Current.fsm_percent = 5; /* Set to 50% */ /* get_all_fsm_fonts();*/ return( errno ); } } } else { /* Error parsing the word 'PATHSPEC' */ xclose(); sprintf( Current.FontPath, "%c:", Drive ); Current.FSMCacheSize = 100L; /* Set to 100K */ Current.BITCacheSize = 100L; Current.fsm_percent = 5; /* Set to 50% */ /* get_all_fsm_fonts();*/ return( 1 ); } skip_me: advance(); if( !skip ) strcpy( Current.FontPath, fsmpath ); else strcpy( fsmpath, Current.FontPath ); txtptr = Current.FontPath; txtptr = strupr( txtptr ); #if 0 get_all_fsm_fonts(); #endif while( !match(EOI) ) { if( match(BITCACHE) ) { skipequal(); if( match(NUMBER) ) { Current.BITCacheSize = atol( yytext )/1024L; advance(); } else Current.BITCacheSize = 0L; } else if( match(FSMCACHE) ) { skipequal(); if( match(NUMBER) ) { Current.FSMCacheSize = atol( yytext )/1024L; advance(); } else Current.FSMCacheSize = 0L; /* In case we have a 'comma'# * which is used to divide up the fsm_cache internally * BUT, if we don't have the comma#, don't mess us up. */ if( match( COMMA ) ) { advance(); if( match( NUMBER ) ) { /* convert the number here to integer*/ Current.fsm_percent = atoi( yytext ); advance(); } } else Current.fsm_percent = 5; /* 50% */ } else if( match(WIDTH) ) { skipequal(); if( match(NUMBER) ) { Current.Width = atoi( yytext ); advance(); } else Current.Width = 0; } else fonts(); } xclose(); return 0; }
*cdecl cpx_init( XCPB *Xcpb ) { OBJECT *tree; int port; int temp_port; xcpb = Xcpb; if( xcpb->booting ) { /* Read in defaults and set the options */ store = ( BUFFER *)(*xcpb->Get_Buffer)(); Modem = save_vars; Set_Machine_Code(); Set_Number_Of_Ports(); for( port = 0; port < Num_Ports; port++ ) { Write_Port( port, store ); store++; } Modem.cur_port = Set_Active_Port( Modem.cur_port ); return( ( CPXINFO *)TRUE ); } else { appl_init(); AES_Version = _GemParBlk.global[0]; if( !xcpb->SkipRshFix ) (*xcpb->rsh_fix)( NUM_OBS, NUM_FRSTR, NUM_FRIMG, NUM_TREE, rs_object, rs_tedinfo, rs_strings, rs_iconblk, rs_bitblk, rs_frstr, rs_frimg, rs_trindex, rs_imdope ); Supexec( Get_OS ); tree = ( OBJECT *)rs_trindex[ RS232 ]; Disable( PORT ); Set_Machine_Code(); (( IsTT() || IsSTE() ) ? ( Enable( PORT ) ) : ( Disable( PORT ) ) ); Set_Number_Of_Ports(); store = ( BUFFER *)(*xcpb->Get_Buffer)(); Modem = save_vars; /* Get the Defaults and fill up all 4 ports with info */ /* Get the ACTUAL system values for as many ports as possible.*/ temp_port = Get_Active_Port(); for( port = 0; port < Num_Ports; port++ ) { Read_Port( port, store ); store++; } Modem.cur_port = Set_Active_Port( temp_port ); push_data(); open_vwork(); close_vwork(); gl_ncolors = work_out[13]; if( !xcpb->SkipRshFix ) { if(( AES_Version >= 0x0330 ) && ( gl_ncolors > LWHITE )) { tree = (OBJECT *)rs_trindex[RS232]; MakeActivator( RS232, SAVE ); MakeActivator( RS232, RS232OK ); MakeActivator( RS232, RS232CAN ); } } cpxinfo.cpx_call = cpx_call; cpxinfo.cpx_draw = NULL; cpxinfo.cpx_wmove = NULL; cpxinfo.cpx_timer = NULL; cpxinfo.cpx_key = NULL; cpxinfo.cpx_button = NULL; cpxinfo.cpx_m1 = NULL; cpxinfo.cpx_m2 = NULL; cpxinfo.cpx_hook = NULL; cpxinfo.cpx_close = NULL; return( &cpxinfo ); } }
/* * CPX user interaction */ BOOLEAN cdecl cpx_call( GRECT *rect ) { OBJECT *tree = (OBJECT *)rs_trindex[MACCEL]; int button; int quit = 0; int saveptime; WORD msg[8]; MA_INFO *src; int ox, oy; MRETS mk; if( !ma_installed ) { form_alert( 1, alertbox ); return FALSE; } ma_work = ma_cancel = *ma_info; ObX( ROOT ) = rect->g_x; ObY( ROOT ) = rect->g_y; set_accelbox( tree, ma_info->linear ); set_screenbox( tree, ma_info->udset ); ma_work.timeout /= 3600; ma_cancel.timeout /= 3600; xcpb->Sl_x( tree, SCRNBACK, SCRNTHUM, ma_work.timeout, SCRN_MIN, SCRN_MAX, NULLFUNC ); TedText(SCRNTHUM)[0] = '0' + ma_work.timeout; if( ma_info->watch ) Select(PHONE); else Deselect(PHONE); if( ma_info->stacy ) { ObFlags(STACSCRN) = ObFlags(STACLITE) = TOUCHEXIT; if( ma_info->stacmask & SH_SCREEN ) Select( STACSCRN ); if( ma_info->stacmask & SH_LIGHT ) Select( STACLITE ); } else { ObFlags(STACSCRN) = ObFlags(STACLITE) = NONE; ObState(STACSCRN) = ObState(STACLITE) = DISABLED; /* deselects */ } Supexec( (long(*)())get_ptime ); saveptime = ma_work.savepark = parktime; if( saveptime == 0 ) saveptime = 1; set_parkbox( tree ); if( parktime >= 0 ) { xcpb->Sl_x( tree, PARKBACK, PARKTHUM, parktime, PARK_MIN, PARK_MAX, NULLFUNC ); itoa2( ma_work.savepark, TedText(PARKTHUM) ); } Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); do { dodelay = FALSE; sl_time = SL_MAX_DELAY; button = xcpb->Xform_do( tree, 0, msg ); if( button == -1 ) if( msg[0] == AC_CLOSE ) button = CANCEL; else if( msg[0] == WM_CLOSED ) button = OK; else button &= 0x7fff; switch( button ) { case OK: src = &ma_work; update_info( tree, src ); quit = OK; break; case CANCEL: src = &ma_cancel; quit = CANCEL; break; case SAVE: if( xcpb->XGen_Alert( SAVE_DEFAULTS ) ) { src = &ma_work; update_info( tree, src ); src->timeout *= 3600; if( xcpb->CPX_Save( src, sizeof(MA_INFO) ) ) { set_info( ma_info, src ); src->timeout /= 3600; ma_cancel = ma_work; } else { src->timeout /= 3600; } } deselect( tree, SAVE ); break; case OFF: ma_work.linear = ma_info->linear = -1; break; case SLOW: ma_work.linear = ma_info->linear = 1; break; case FAST: ma_work.linear = ma_info->linear = 0; break; case PARK: if( IsSelected(PARK) ) /* deselecting */ { saveptime = ma_work.savepark; ma_work.savepark = 0; } else { ma_work.savepark = saveptime; xcpb->Sl_x( tree, PARKBACK, PARKTHUM, parktime, PARK_MIN, PARK_MAX, update_parkbox ); } set_parkbox( tree ); Objc_draw( tree, PARKBOX, MAX_DEPTH, NULL ); break; case PARKUP: dodelay = TRUE; xcpb->Sl_arrow( tree, PARKBACK, PARKTHUM, PARKUP, 1, PARK_MIN, PARK_MAX, &ma_work.savepark, HORIZONTAL, update_parkbox ); break; case PARKDN: dodelay = TRUE; xcpb->Sl_arrow( tree, PARKBACK, PARKTHUM, PARKDN, -1, PARK_MIN, PARK_MAX, &ma_work.savepark, HORIZONTAL, update_parkbox ); break; case PARKTHUM: xcpb->Sl_dragx( tree, PARKBACK, PARKTHUM, PARK_MIN, PARK_MAX, &ma_work.savepark, update_parkbox ); break; case PARKBACK: dodelay = TRUE; Graf_mkstate( &mk ); objc_offset( tree, PARKTHUM, &ox, &oy ); if( mk.x < ox ) oy = -PARK_PAGE; else oy = PARK_PAGE; xcpb->Sl_arrow( tree, PARKBACK, PARKTHUM, -1, oy, PARK_MIN, PARK_MAX, &ma_work.savepark, HORIZONTAL, update_parkbox ); break; case SCRN: ma_work.udset ^= 1; set_screenbox( tree, ma_work.udset ); Objc_draw( tree, SCRNBOX, MAX_DEPTH, NULL ); break; case SCRNUP: dodelay = TRUE; xcpb->Sl_arrow( tree, SCRNBACK, SCRNTHUM, SCRNUP, 1, SCRN_MIN, SCRN_MAX, &ma_work.timeout, HORIZONTAL, update_screenbox ); break; case SCRNDN: dodelay = TRUE; xcpb->Sl_arrow( tree, SCRNBACK, SCRNTHUM, SCRNDN, -1, SCRN_MIN, SCRN_MAX, &ma_work.timeout, HORIZONTAL, update_screenbox ); break; case SCRNTHUM: xcpb->Sl_dragx( tree, SCRNBACK, SCRNTHUM, SCRN_MIN, SCRN_MAX, &ma_work.timeout, update_screenbox ); break; case SCRNBACK: dodelay = TRUE; Graf_mkstate( &mk ); objc_offset( tree, SCRNTHUM, &ox, &oy ); if( mk.x < ox ) oy = -SCRN_PAGE; else oy = SCRN_PAGE; xcpb->Sl_arrow( tree, SCRNBACK, SCRNTHUM, -1, oy, SCRN_MIN, SCRN_MAX, &ma_work.timeout, HORIZONTAL, update_screenbox ); break; } } while (!quit); Deselect(quit); src->timeout *= 3600; set_info( ma_info, src ); return FALSE; }
/* Get_Speed() *========================================================================== * Get the current status of the Blitter or TT Cache */ void Get_Speed( void ) { Get_Blitter(); Supexec( Get_TTCache ); }
yeshblanks() { if (jimint_status) Supexec(timebon); }
/* * Initialize CPX */ CPXINFO * cdecl cpx_init( XCPB *Xcpb ) { OBJECT *tree; xcpb = Xcpb; ma_installed = xcpb->getcookie( COOKIE, (long *)(&ma_info) ); if( xcpb->booting ) { Supexec( (long(*)())get_ptime ); /* Read in defaults and set the options */ if( ma_installed ) set_info( ma_info, &save_info ); } else { if( !xcpb->SkipRshFix ) { xcpb->rsh_fix( NUM_OBS, NUM_FRSTR, NUM_FRIMG, NUM_TREE, rs_object, rs_tedinfo, rs_strings, rs_iconblk, rs_bitblk, rs_frstr, rs_frimg, rs_trindex, rs_imdope ); tree = (OBJECT *)rs_trindex[MACCEL]; switch (xcpb->Country_Code) { case CP_FRG: ObString(OK) = (char *)rs_frstr[FRGOK]; ObString(CANCEL) = (char *)rs_frstr[FRGCAN]; ObString(SAVE) = (char *)rs_frstr[FRGSAVE]; alertbox = (char *)rs_frstr[FRGLOAD]; break; case CP_FRA: ObString(OK) = (char *)rs_frstr[FRAOK]; ObString(CANCEL) = (char *)rs_frstr[FRACAN]; ObString(SAVE) = (char *)rs_frstr[FRASAVE]; alertbox = (char *)rs_frstr[FRALOAD]; break; case CP_SPA: ObString(OK) = (char *)rs_frstr[SPAOK]; ObString(CANCEL) = (char *)rs_frstr[SPACAN]; ObString(SAVE) = (char *)rs_frstr[SPASAVE]; alertbox = (char *)rs_frstr[SPALOAD]; break; case CP_ITA: ObString(OK) = (char *)rs_frstr[ITAOK]; ObString(CANCEL) = (char *)rs_frstr[ITACAN]; ObString(SAVE) = (char *)rs_frstr[ITASAVE]; alertbox = (char *)rs_frstr[ITALOAD]; break; case CP_SWE: ObString(OK) = (char *)rs_frstr[SWEOK]; ObString(CANCEL) = (char *)rs_frstr[SWECAN]; ObString(SAVE) = (char *)rs_frstr[SWESAVE]; alertbox = (char *)rs_frstr[SWELOAD]; break; default: alertbox = (char *)rs_frstr[NOLOAD]; } } cpxinfo.cpx_call = cpx_call; cpxinfo.cpx_draw = NULL; cpxinfo.cpx_wmove = NULL; cpxinfo.cpx_timer = NULL; cpxinfo.cpx_key = NULL; cpxinfo.cpx_button = NULL; cpxinfo.cpx_m1 = NULL; cpxinfo.cpx_m2 = NULL; cpxinfo.cpx_hook = NULL; cpxinfo.cpx_close = NULL; } return &cpxinfo; }
static double real_cputime() { long time; time = Supexec(readtime); return (time / 200.0); }