void unhook( void ) { /* IPL7();*/ resvector = oldrvec; resvalid = oldrval; kbase->kb_mousevec = oldmvec; kbase->kb_kbdsys = oldkbd; Setexc( 76, oldrs ); *vbentry = 0; /* IPL_RESTORE();*/ }
void timer_init(Vwk * vwk) { WORD old_sr; in_proc = 0; // no vblanks in process /* Now initialize the lower level things */ tim_addr = do_nothing_int; // tick points to rts old_sr = set_sr(0x2700); // disable interrupts tim_chain = (void(*)(int)) // save old vector Setexc(0x100, (long)tick_int); // set etv_timer to tick_int set_sr(old_sr); // enable interrupts }
int get_cookie(long cookie, long *value) { long *cookiejar = (long *) Setexc(0x168, -1L); if (cookiejar) { while (*cookiejar) { if (*cookiejar == cookie) { if (value) *value = *++cookiejar; return (1); } cookiejar += 2; } } return (0); }
void xterm(UWORD rc) { PD *p = run; (* (WORD(*)(void)) Setexc(0x102, (long)-1L))(); /* call user term handler */ run = run->p_parent; ixterm(p); /* gouser() will store the current value of D0 in the active PD * so it cannot be used here. See proc_go() above. * termuser() will enter the gouser() code at the proper place. * sep 2005 RCL */ run->p_dreg[0] = rc; termuser(); }
int get_cookie(long id, long *value) { COOKIE *cookiejar = (COOKIE *)Setexc(360,(void (*)())-1L); if (cookiejar) { while (cookiejar->id) { if (cookiejar->id == id) { if (value) *value = cookiejar->value; return(1); } cookiejar++; } } return(0); }
void sethooks( void ) { unsigned int wOriginalValue; int i; /* find out if we're on Stacy */ wOriginalValue = *SHADOW; for(i=0; (i<NPATTERNS)&&(isStacy); ++i){ *SHADOW = wPattern[i]; isStacy = ((*SHADOW & 0xF) == wPattern[i]); } *SHADOW = wOriginalValue; ma_info->stacy = isStacy; #ifdef CLICK_CONFIG /* get kbshift address */ if( sysbase->os_version == 0x100 ) kbshift = KBS10; else kbshift = sysbase->kbshift; #endif /* install maccel vectors */ kbase = Kbdvbase(); mvloc = &kbase->kb_mousevec; /* IPL7();*/ oldrvec = resvector; oldrval = resvalid; resvector = myreset; resvalid = RESMAGIC; oldmvec = kbase->kb_mousevec; kbase->kb_mousevec = mouse; oldkbd = kbase->kb_kbdsys; kbase->kb_kbdsys = ikbd; oldrs = Setexc( 76, rs232 ); vbentry = VBLQUEUE; while( *(++vbentry) ); /* skip the VDI entry */ *(void(**)())vbentry = myvbl; /* IPL_RESTORE();*/ }
/* exported interface documented in atari/osspec.h */ int tos_getcookie(long tag, long * value) { COOKIE * cptr; if( atari_sysinfo.gemdos_version > TOS4VER ) { return( Getcookie(tag, value) ); } cptr = (COOKIE*)Setexc(0x0168, -1L); if(cptr != NULL) { do { if( cptr->c == tag ) { if(cptr->v != 0 ) { if( value != NULL ) { *value = cptr->v; } return( C_FOUND ); } } } while( (cptr++)->c != 0L ); } return( C_NOTFOUND ); }