F
fengdi
Unregistered / Unconfirmed
GUEST, unregistred user!
下面这段代码是用BCB写的,想转换为Delphi的,怎么做???
哪位大虾能写出转换为Delphi以后的代码。
#include
#include
#include
#include
void MoveView(int x,int y);
void main(void){
int gdriver,gmode;
gdriver=DETECT,gmode=0;
initgraph(&gdriver,&gmode,"BORLANDCBGI");
rectangle(100,100,200,200);
outtextxy(100,250,"Press Any Key to SHAKE ...");
getch();
for(int i=0;i<20;i++){
MoveView(10-random(20),5-random(10));
delay(50);
}
MoveView(0,0);
getch();
closegraph();
}
void MoveView(int x,int y){
union{
unsigned int whole;
char low;
}adr;
unsigned char high,low;
adr.whole=y*80+x/8,
low=adr.low,
high=(unsigned char)(adr.whole>>8);
outportb(0x3D4,0X0C);
outportb(0x3D5,high);
outportb(0x3D4,0x0D);
outportb(0x3D5,low);
}
哪位大虾能写出转换为Delphi以后的代码。
#include
#include
#include
#include
void MoveView(int x,int y);
void main(void){
int gdriver,gmode;
gdriver=DETECT,gmode=0;
initgraph(&gdriver,&gmode,"BORLANDCBGI");
rectangle(100,100,200,200);
outtextxy(100,250,"Press Any Key to SHAKE ...");
getch();
for(int i=0;i<20;i++){
MoveView(10-random(20),5-random(10));
delay(50);
}
MoveView(0,0);
getch();
closegraph();
}
void MoveView(int x,int y){
union{
unsigned int whole;
char low;
}adr;
unsigned char high,low;
adr.whole=y*80+x/8,
low=adr.low,
high=(unsigned char)(adr.whole>>8);
outportb(0x3D4,0X0C);
outportb(0x3D5,high);
outportb(0x3D4,0x0D);
outportb(0x3D5,low);
}