本文整理汇总了C++中outp函数的典型用法代码示例。如果您正苦于以下问题:C++ outp函数的具体用法?C++ outp怎么用?C++ outp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
if(a==-1) break;
sprintf(tmpname,"%s.0%c%c",scene,a/10+'A',a%10+'A');
if(!indemo) printf("Scene: %s ",tmpname);
scenelist[scl].data=readfile(tmpname);
printf("(%i:@%Fp)\n",scl,scenelist[scl].data);
scl++;
ip+=2;
}
if(!indemo)
{
printf("Press any key to continue...");
getch();
}
resetscene();
for(;;)
{
_asm
{
mov bx,6
int 0fch
mov a,cx
mov b,bx
}
if(a>10 && b>46) break;
if(dis_exit()) return;
}
vid_init(3); ////// oversample x 4
cp=(char *)(scenem+16);
//vid_setpal(cp);
outp(0x3c8,0);
for(a=0;a<768;a++) outp(0x3c9,cp[a]);
vid_window(0L,319L,25L,174L,512L,9999999L);
dis_setcopper(2,copper2);
dis_partstart();
xit=0;
coppercnt=0;
syncframe=0;
avgrepeat=1;
cl[0].ready=0;
cl[1].ready=0;
cl[2].ready=0;
cl[3].ready=1;
while(!dis_exit() && !xit)
{
int fov;
int onum;
long pflag;
long dis;
long l;
object *o;
rmatrix *r;
_asm
{
mov bx,6
int 0fch
mov a,cx
mov b,bx
}
if(a>11 && b>54) break;
示例2: Decompress_frame
void Decompress_frame (void)
{
unsigned short x,y,z,w;
unsigned short changes, nfo_word, packets, offset, row;
int frame_pos=0;
unsigned int scr_pos;
char c1, c2, c3, a;
char hi, lo;
for (z=1; z<=h_frame.actions; z++)
{
memmove ( &h_action, (flc_buffer+frame_pos), sizeof(actionheader) );
switch (h_action.code)
{
case 4:
a=1;//fcl_buffer[frame_pos];
// b=0;//flc_buffer[frame_pos];
// c=256; //0=256
frame_pos+=10;
outp (0x3c8, 0);
for (x=0; x<=768; x++) outp (0x3c9, (flc_buffer[(x+frame_pos)]/=4) );
frame_pos+=768;
break;
case 7:
frame_pos+=6;
lo=flc_buffer[frame_pos]; frame_pos++;
hi=flc_buffer[frame_pos]; frame_pos++;
changes=hi*256+lo;
row=0;
for (y=0; y<=(changes-1); y++) // pocet menenych radek
{
lo=flc_buffer[frame_pos]; frame_pos++;
hi=flc_buffer[frame_pos]; frame_pos++;
nfo_word=hi*256+lo;
scr_pos=row*h_flc.width;
if (nfo_word>=0xC000) // preskakovane radky
{
nfo_word=0xFFFF-nfo_word+1;
row+=nfo_word;
}
else
{
for (z=1; z<=nfo_word; z++) // pocet menenych bloku
{
x=1; a=0;
offset = flc_buffer[frame_pos]; // rel. offset bloku
frame_pos++;
scr_pos+=offset;
// while (!a) // zmena bloku
// {
c1 = flc_buffer[frame_pos];
frame_pos++;
if (c1>128)
{
c1=0xFF-c1+1;
c2=flc_buffer[frame_pos];
frame_pos++;
c3=flc_buffer[frame_pos];
frame_pos++;
for (w=1; w<=c1; w++)
{ frame_buffer[scr_pos]=c2;
scr_pos++;
frame_buffer[scr_pos]=c3;
scr_pos++; }
}
else
{
// c3=0xFF-c3+1;
for (w=1; w<=c1; w++)
{ frame_buffer[scr_pos]=flc_buffer[frame_pos];
frame_pos++;
scr_pos++;
frame_buffer[scr_pos]=flc_buffer[frame_pos];
frame_pos++;
scr_pos++; }
}
// if (x>=640) a=1;
// }
}
row++;
}
}
// frame_pos+=h_action.size;
break;
case 15:
frame_pos+=6;
for (y=0; y<=(h_flc.height-1); y++)
{
//.........这里部分代码省略.........
示例3: switch
void SelfAwareness::iam(const Address &reporter,const InetAddress &reporterPhysicalAddress,const InetAddress &myPhysicalAddress,bool trusted,uint64_t now)
{
const InetAddress::IpScope scope = myPhysicalAddress.ipScope();
// This would be weird, e.g. a public IP talking to 10.0.0.1, so just ignore it.
// If your network is this weird it's probably not reliable information.
if (scope != reporterPhysicalAddress.ipScope())
return;
// Some scopes we ignore, and global scope IPs are only used for this
// mechanism if they come from someone we trust (e.g. a root).
switch(scope) {
case InetAddress::IP_SCOPE_NONE:
case InetAddress::IP_SCOPE_LOOPBACK:
case InetAddress::IP_SCOPE_MULTICAST:
return;
case InetAddress::IP_SCOPE_GLOBAL:
if (!trusted)
return;
break;
default:
break;
}
Mutex::Lock _l(_phy_m);
PhySurfaceEntry &entry = _phy[PhySurfaceKey(reporter,reporterPhysicalAddress,scope)];
if ( ((now - entry.ts) < ZT_SELFAWARENESS_ENTRY_TIMEOUT) && (!entry.mySurface.ipsEqual(myPhysicalAddress)) ) {
entry.mySurface = myPhysicalAddress;
entry.ts = now;
TRACE("physical address %s for scope %u as seen from %s(%s) differs from %s, resetting paths in scope",myPhysicalAddress.toString().c_str(),(unsigned int)scope,reporter.toString().c_str(),reporterPhysicalAddress.toString().c_str(),entry.mySurface.toString().c_str());
// Erase all entries in this scope that were not reported from this remote address to prevent 'thrashing'
// due to multiple reports of endpoint change.
// Don't use 'entry' after this since hash table gets modified.
{
Hashtable< PhySurfaceKey,PhySurfaceEntry >::Iterator i(_phy);
PhySurfaceKey *k = (PhySurfaceKey *)0;
PhySurfaceEntry *e = (PhySurfaceEntry *)0;
while (i.next(k,e)) {
if ((k->reporterPhysicalAddress != reporterPhysicalAddress)&&(k->scope == scope))
_phy.erase(*k);
}
}
// Reset all paths within this scope
_ResetWithinScope rset(RR,now,(InetAddress::IpScope)scope);
RR->topology->eachPeer<_ResetWithinScope &>(rset);
// Send a NOP to all peers for whom we forgot a path. This will cause direct
// links to be re-established if possible, possibly using a root server or some
// other relay.
for(std::vector< SharedPtr<Peer> >::const_iterator p(rset.peersReset.begin());p!=rset.peersReset.end();++p) {
if ((*p)->activelyTransferringFrames(now)) {
Packet outp((*p)->address(),RR->identity.address(),Packet::VERB_NOP);
RR->sw->send(outp,true,0);
}
}
} else {
entry.mySurface = myPhysicalAddress;
entry.ts = now;
}
}
示例4: timer_handler
void __interrupt __far timer_handler( union INTPACK r )
{
if( --TimerMod == 0 )
{
TimerMod = TimerMult;
_CHAIN_TO( old_timer_handler );
}
else
{
/* end of interrupt (expected by 8259 before you do RETI) */
outp( INT_CTRL, EOI );
}
if( ! SamplerOff )
{
if( InsiderTime == 0 )
{
++InsiderTime;
if( SampleIndex == 0 )
{
Samples->pref.tick = CurrTick;
if( CallGraphMode )
{
CallGraph->pref.tick = CurrTick;
}
}
++CurrTick;
#ifdef __NETWARE__
/* avoid pointer truncation warning */
RecordSample( (union INTPACK *)FP_OFF(&r) );
#else
RecordSample( &r );
#endif
if( SampleIndex >= Margin )
{
if( InDOS() )
{
Save_Request = TRUE;
}
else
{
/*
We are not in DOS so we can suspend things for a while
and save our block of samples
*/
if( Save_Request )
{
Save_Request = 0;
}
StopAndSave();
}
if( SampleIndex >= Ceiling )
{
if( CallGraphMode )
{
--SampleCount;
SampleIndex = LastSampleIndex;
}
else
{
--SampleIndex;
}
LostData = TRUE;
}
}
--InsiderTime;
}
}
}
示例5: set_timer_reload
static void set_timer_reload(int reload_val)
{
outp(PORT_CMD, CMD_CHAN0 | CMD_ACCESS_BOTH | CMD_OP_SQWAVE);
outp(PORT_DATA0, reload_val & 0xff);
outp(PORT_DATA0, (reload_val >> 8) & 0xff);
}
示例6: main
main()
{
int a,b,c,y;
dis_partstart();
outp(0x3c4,2);
outp(0x3c5,15);
memset(vram,15,32768);
memset(vram+32768,15,32768);
//_asm mov ax,80h+13h
//_asm int 10h
for(a=0;a<32;a++) dis_waitb();
outp(0x3c8,0);
for(a=0;a<255;a++)
{
outp(0x3c9,63);
outp(0x3c9,63);
outp(0x3c9,63);
}
outp(0x3c9,0);
outp(0x3c9,0);
outp(0x3c9,0);
inp(0x3da);
outp(0x3c0,0x11);
outp(0x3c0,255);
outp(0x3c0,0x20);
//inittwk();
_asm
{
mov dx,3d4h
mov ax,000ch
out dx,ax
mov ax,000dh
out dx,ax
mov al,9
out dx,al
inc dx
in al,dx
and al,not 80h
and al,not 31
out dx,al
mov dx,3c0h
mov al,11h
out dx,al
mov al,0
out dx,al
mov al,32
out dx,al
}
_asm
{
mov dx,3c0h
mov al,11h
out dx,al
mov al,255
out dx,al
mov al,20h
out dx,al
}
readp(palette,-1,pic);
for(y=0;y<400;y++)
{
readp(rowbuf,y,pic);
lineblit(vram+(unsigned)y*80U,rowbuf);
}
for(c=0;c<=128;c++)
{
for(a=0;a<768-3;a++) pal2[a]=((128-c)*63+palette[a]*c)/128;
dis_waitb();
setpalarea(pal2,0,254);
}
setpalarea(palette,0,254);
}
示例7: main
void main ( void )
{
uchar *video=( uchar * )0xA0000000L;
uint pos,x;
_asm mov ax,13h
_asm int 10h
outp( 0x3c8,0 );
for( x=0; x<256; x++ )
{
outp( 0x3c9,x >> 2 );
outp( 0x3c9,x >> 2 );
outp( 0x3c9,63 );
}
/* sprot. CRT */
outp( 0x3d4, 0x11 );
outp( 0x3d5, inp( 0x3d5 ) & 0x7f );
/* 256 */
/* ampiezza logica */
_outcrt( 0x13, 32 );
/* tot hor */
_outcrt( 0, 64 + 16 );
/* fine vis. hor */
_outcrt( 1, 63 );
/* iniz blank hor */
_outcrt( 2, 69 );
/* fin blank hor */
_outcrt( 3, 113 );
/* iniz. ritr. oriz */
_outcrt( 4, 72 );
/* fine ritr. oriz */
_outcrt( 5, 112 );
/* 240 */
/*
_outcrt( 6, 13 );
_outcrt( 7, 62 );
_outcrt( 9, 65 );
_outcrt( 0x10, 234 );
_outcrt( 0x11, 172 );
_outcrt( 0x12, 223 );
_outcrt( 0x14, 0 );
_outcrt( 0x15, 231 );
_outcrt( 0x16, 6 );
_outcrt( 0x17, 227 );
outpw( 0x3c4, 0x0100 );
outp( 0x3c2, 0xe3 );
outpw( 0x3c4, 0x0300 );
*/
/* prot. CRT */
outp( 0x3d4, 0x11 );
outp( 0x3d5, inp( 0x3d5 ) | 256 );
for( pos=0; pos<256; pos++ )
for( x=0; x<256; x++ )
video[ ( pos << 8 ) | x ]= ( unsigned char ) ( pos + x );
getch();
_asm mov ax,3h
_asm int 10h
}
示例8: LM78_WRITE
// #define LM78_WRITE(addr,data) outp(LM78_ADDRESS,addr);outp(LM78_DATA,data)
void LM78_WRITE(int addr, int data)
{
outp(LM78_ADDRESS, addr);
outp(LM78_DATA, data);
}
示例9: serial_init_rx
/* Set up uart stuff; expects DDR register to already be set up */
void serial_init_rx(void)
{
outp(BPS(115200, CPUFREQ), UBRR);
outp(inp(UCR) | (1 << RXCIE) | (1 << RXEN), UCR);
}
示例10: LM78_EXIST
int LM78_EXIST(void)
{
outp(LM78_ADDRESS,LM78_IN0);
inp(LM78_DATA);
return(inp(LM78_ADDRESS) == LM78_IN0);
}
示例11: LM78_READ
// #define LM78_READ(addr) ({outp(LM78_ADDRESS,addr);inp(LM78_DATA);})
int LM78_READ(int addr)
{
outp(LM78_ADDRESS,addr);
return(inp(LM78_DATA));
}
示例12: out_word
/* Output a word to an I/O port. */
static void
out_word(unsigned int p,unsigned int d)
{
outp(p, d & 0xff);
outp(p + 1, (d >> 8) & 0xff);
}
示例13: up_addrenv_restore
int up_addrenv_restore(hw_addrenv_t oldenv)
{
outp(Z180_MMU_CBR, (uint8_t)oldenv);
return OK;
}
示例14: key_handler
//.........这里部分代码省略.........
break;
default:
// Parse scancode and break bit
if (key_data.E1Flag > 0 ) { // Special code for Pause, which is E1 1D 45 E1 9D C5
key_data.E1Flag--;
if ( scancode == 0x1D ) {
scancode = KEY_PAUSE;
breakbit = 0;
} else if ( scancode == 0x9d ) {
scancode = KEY_PAUSE;
breakbit = 1;
} else {
break; // skip this keycode
}
} else if ( scancode==0xE1 ) {
key_data.E1Flag = 2;
break;
} else {
breakbit = scancode & 0x80; // Get make/break bit
scancode &= 0x7f; // Strip make/break bit off of scancode
scancode |= key_data.E0Flag; // Add in extended key code
}
key_data.E0Flag = 0; // Clear extended key code
if (breakbit) {
// Key going up
keyd_last_released = scancode;
keyd_pressed[scancode] = 0;
key_data.NumUps[scancode]++;
temp = 0;
temp |= keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT];
temp |= keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT];
temp |= keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL];
#ifndef NDEBUG
temp |= keyd_pressed[KEY_DELETE];
if ( !(keyd_editor_mode && temp) )
#endif // NOTICE LINK TO ABOVE IF!!!!
key_data.TimeKeyHeldDown[scancode] += timer_get_fixed_secondsX() - key_data.TimeKeyWentDown[scancode];
} else {
// Key going down
keyd_last_pressed = scancode;
keyd_time_when_last_pressed = timer_get_fixed_secondsX();
if (!keyd_pressed[scancode]) {
// First time down
key_data.TimeKeyWentDown[scancode] = timer_get_fixed_secondsX();
keyd_pressed[scancode] = 1;
key_data.NumDowns[scancode]++;
#ifndef NDEBUG
if ( (keyd_pressed[KEY_LSHIFT]) && (scancode == KEY_BACKSP) ) {
keyd_pressed[KEY_LSHIFT] = 0;
Int5();
}
#endif
} else if (!keyd_repeat) {
// Don't buffer repeating key if repeat mode is off
scancode = 0xAA;
}
if ( scancode!=0xAA ) {
keycode = scancode;
if ( keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT] )
keycode |= KEY_SHIFTED;
if ( keyd_pressed[KEY_LALT] || keyd_pressed[KEY_RALT] )
keycode |= KEY_ALTED;
if ( keyd_pressed[KEY_LCTRL] || keyd_pressed[KEY_RCTRL] )
keycode |= KEY_CTRLED;
#ifndef NDEBUG
if ( keyd_pressed[KEY_DELETE] )
keycode |= KEY_DEBUGGED;
#endif
temp = key_data.keytail+1;
if ( temp >= KEY_BUFFER_SIZE ) temp=0;
if (temp!=key_data.keyhead) {
key_data.keybuffer[key_data.keytail] = keycode;
key_data.time_pressed[key_data.keytail] = keyd_time_when_last_pressed;
key_data.keytail = temp;
}
}
}
}
#ifndef NDEBUG
#ifdef PASS_KEYS_TO_BIOS
_chain_intr( key_data.prev_int_9 );
#endif
#endif
temp = inp(0x61); // Get current port 61h state
temp |= 0x80; // Turn on bit 7 to signal clear keybrd
outp( 0x61, temp ); // Send to port
temp &= 0x7f; // Turn off bit 7 to signal break
outp( 0x61, temp ); // Send to port
outp( 0x20, 0x20 ); // Reset interrupt controller
}
示例15: outwGUS
static void outwGUS(unsigned int baseport,unsigned int reg,unsigned int val)
{
outp(baseport+0x103, reg);
outpw(baseport+0x104, val);
}