示例#1
0
文件: natfeats.c 项目: r-type/hatari
static int wait_key(void)
{
	while (Cconis()) {
		Cconin();
	}
	Cconws("\r\n<press key>\r\n");
	return Cconin();
}
示例#2
0
main()
{
	/*
	char	buf[512], bbuf[512];
	int	i;
	long	srchndl, dsthndl, ret;
	/**/

/*
	for (i = 0; i < 512*3;) {
		buf[i++] = 'M';
		buf[i++] = 'I';
		buf[i++] = 'N';
		buf[i++] = 'O';
	}
/**/	

	/* physical operation on unit 0 */
/*
	Lrwabs(9, buf, 1, 0x10000, 2);
	Lrwabs(8, bbuf, 1, 0x10000, 3);
/**/	
	/* logical operation on D: */
/*
	i = 1;
	while (i == 1) {
		Mediach(3);
		Getbpb(3);
		Rwabs(1, buf, 1, 0x700, 3);
	}
/**/	
/*
	Lrwabs(0, bbuf, 1, 0x10000, 3);
	Rwabs(1, buf+1, 3, 102, 3);
	Rwabs(0, buf, 3, 102, 3);
	Rwabs(9, bbuf, 1, 0, 11);
	Rwabs(8, bbuf, 1, 0, 11);
	Rwabs(9, bbuf, 1, 0, 11);
	char	*buf256;
	
	buf256 = (char *)Malloc(131072L);
	Rwabs(8, buf256+1, 2, 0, 18);
	Rwabs(9, buf256+1, 2, 0xa35a, 18);
/**/
/*
	Rwabs(8, buf256+1, 255, 0, 10);
	Rwabs(9, buf256+1, 255, 0, 10);
/**/
	Fsfirst("h:\\*.*", 0);
	
	while (!(Cconis()))
		;

	Fsfirst("g:\\*.*", 0);
	Fsfirst("h:\\*.*", 0);
	Pterm(0);
}
示例#3
0
/******************
* scan thru arg list, call check func for each arg
* default to *.fnt if no args
*/
int main( int argc, char *argv[] )
{

   dtap = (struct _dta*)Fgetdta();
   if( argc == 1 ) check_files( "*.fnt" );
   else {
      while( --argc>0 ) check_files(*++argv);
   } /* if */

   Cconws( "finished! press a key ..." );   
   while( Cconis() == 0 );
   (void)Cconin();

   return 0;
     
} /* main() */
示例#4
0
void AtariGemdos_PumpEvents(_THIS)
{
	int i;
	SDL_keysym keysym;

	/* Update pressed keys */
	SDL_memset(gemdos_currentkeyboard, 0, ATARIBIOS_MAXKEYS);

	while (Cconis()!=DEV_BUSY) {
		unsigned long key_pressed;
		unsigned char scancode, asciicode;

		key_pressed=Cnecin();

		asciicode = key_pressed;
		scancode = key_pressed >> 16;

		gemdos_currentkeyboard[scancode]=0xFF;
		gemdos_currentascii[scancode]=asciicode;
	}

	/* Read special keys */
	UpdateSpecialKeys(Kbshift(-1));

	/* Now generate events */
	for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
		/* Key pressed ? */
		if (gemdos_currentkeyboard[i] && !gemdos_previouskeyboard[i])
			SDL_PrivateKeyboard(SDL_PRESSED,
				TranslateKey(i, gemdos_currentascii[i], &keysym, SDL_TRUE));
			
		/* Key unpressed ? */
		if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i])
			SDL_PrivateKeyboard(SDL_RELEASED,
				TranslateKey(i, gemdos_currentascii[i], &keysym, SDL_FALSE));
	}

	if (use_dev_mouse) {
		SDL_AtariDevMouse_PostMouseEvents(this, SDL_TRUE);
	} else {
		SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
	}

	/* Will be previous table */
	SDL_memcpy(gemdos_previouskeyboard, gemdos_currentkeyboard, ATARIBIOS_MAXKEYS);
}
示例#5
0
send_ascii()
{
int c;
int hd;

    if (fsel("*.*",tbuf,"ASCII-Datei senden") == 1){
        if ((hd=Fopen(tbuf,0)) > 0) {
            while (Fread(hd,1L,&c)) {
                send(c>>8);
                if (Cconis())
                    if ((Crawcin()&255) == CAN)
                        return(-1);
            }
            Fclose(hd);
        }
    }
}
示例#6
0
BYTE searchInit(void)
{
    commandShort[4] = FDD_CMD_SEARCH_INIT;
    commandShort[5] = 0;

    sectorCount = 1;                            // read 1 sector
    BYTE res;

    (void) Clear_home();
    (void) Cconws("Initializing... Press ESC to stop.\n\r\n\r");

    while(1) {
        res = Supexec(ce_acsiReadCommand);

        if(res == FDD_DN_LIST) {
            (void) Cconws("Downloading list of floppy images...\n\r");
        } else if(res == FDD_ERROR) {
            (void) Cconws("Failed to initialize! Press any key.\n\r");
            Cnecin();
            return 0;
        } else if(res == FDD_OK) {
            (void) Cconws("Done.\n\r");
            return 1;
        } else {
            (void) Cconws("CosmosEx device communication problem!\n\r");
        }

        WORD val = Cconis();            // see if there is some char waiting
        if(val != 0) {                  // char waiting?
            BYTE key = getKey();

            if(key == KEY_ESC) {
                (void) Cconws("Init terminated by user. Press any key.\n\r");
                Cnecin();
                return 0;
            }
        }

        sleep(1);
    }
}
示例#7
0
WORD main(void)
{{{

	printf("Demo-Programm f�r Benutzung der SCSI-Calls");
	printf("  � Steffen Engel 1995");

	if (init_scsiio() && init_scsi())
		search_drives();
	else
		printf("SCSI-Lib nicht benutzbar");

	printf("\n Taste dr�cken");
	do
	{
	} while (Cconis());
	Cconin();
/*
*/
	return (0);

}}}
示例#8
0
int wait(int sec)
{
long timer;
int event,ret,msgbuff[8];

    timer=get_timer();
    do {
        if (ior->head != ior->tail) return(Cauxin());
        event = evnt_multi(MU_TIMER|MU_MESAG,
            0,0,0,
            0,0,0,0,0,
            0,0,0,0,0,
            msgbuff,(para.timer*20)&0xffff,(para.timer*20)>>16,
            &ret,&ret,&ret,&ret,&ret,&ret);
        if ((event & MU_MESAG) && (msgbuff[0] == AC_OPEN))
            return(-2);
        if (Cconis())
            if ((Crawcin()&255) == CAN)
            	return(-2);
    } while ((get_timer()-timer) < (sec*200));
    return(-1);
}