示例#1
0
文件: acia.c 项目: SteveFosdick/b-em
void acia_poll()
{
//        int c;
//        printf("Poll tape %i %i\n",motor,cswena);
        if (motor)
       	{
       	        startblit();
               	if (csw_ena) csw_poll();
               	else         uef_poll();
               	endblit();

                if (newdat&0x100)
                {
                        newdat&=0xFF;
                        tapenoise_adddat(newdat);
                }
                else if (csw_toneon || uef_toneon) tapenoise_addhigh();
        }
	//           polltape();
}
示例#2
0
文件: uef.c 项目: fesh0r/b-em
void uef_findfilenames()
{
        int temp;
        uint8_t tb;
        int c;
        int fsize = 0;
        char s[256];
        uint32_t run, load;
        uint8_t status;
        int skip;
        int binchunk  = uef_inchunk,  bchunkid = uef_chunkid, bchunklen = uef_chunklen;
        int bchunkpos = uef_chunkpos, bchunkdatabits = uef_chunkdatabits;
        int bintone   = uef_intone,   bffound = ffound;
        float bchunkf = uef_chunkf;
        uint8_t bdat  = fdat;
        if (!uef_f) return;

        uef_inchunk  = 0; uef_chunkid = 0; uef_chunklen = 0;
        uef_chunkpos = 0; uef_chunkdatabits = 8; uef_intone = 0;
        uef_chunkf   = 0;

        startblit();
        temp=gztell(uef_f);
        gzseek(uef_f, 12, SEEK_SET);
        uefloop = 0;
        infilenames = 1;
        while (!uefloop)
        {
                ffound = 0;
                while (!ffound && !uefloop)
                {
                        uef_poll();
                }
                if (uefloop) break;
                fbuffer[0] = fbuffer[1];
                fbuffer[1] = fbuffer[2];
                fbuffer[2] = fbuffer[3];
                fbuffer[3] = fdat;
                if (fdat == 0x2A && uef_toneon == 1)
                {
                        fbuffer[3] = 0;
                        c = 0;
                        do
                        {
                                ffound = 0;
                                while (!ffound && !uefloop)
                                {
                                        uef_poll();
                                }
                                if (uefloop) break;
                                ffilename[c++] = fdat;
                        } while (fdat != 0x0 && c < 10);
                        if (uefloop) break;
                        c--;
                        while (c < 13) ffilename[c++] = 32;
                        ffilename[c] = 0;

                                getuefbyte();
                                tb = fdat;
                                getuefbyte();
                                load = tb | (fdat << 8);
                                getuefbyte();
                                tb = fdat;
                                getuefbyte();
                                load |= (tb | (fdat << 8)) << 16;

                                getuefbyte();
                                tb = fdat;
                                getuefbyte();
                                run = tb | (fdat << 8);
                                getuefbyte();
                                tb = fdat;
                                getuefbyte();
                                run |= (tb | (fdat << 8)) << 16;

                                getuefbyte();
                                getuefbyte();

                                getuefbyte();
                                tb = fdat;
                                getuefbyte();
                                skip = tb | (fdat << 8);

                                fsize += skip;

                                getuefbyte();
                                status = fdat;

                        if (status & 0x80)
                        {
                                sprintf(s, "%s Size %04X Load %08X Run %08X", ffilename, fsize, load, run);
                                cataddname(s);
                                fsize = 0;
                        }
                        for (c = 0; c <skip + 8; c++)
                        {
                                getuefbyte();
                        }
                }
        }
        infilenames = 0;
        gzseek(uef_f, temp, SEEK_SET);
        uefloop = 0;
        uef_inchunk       = binchunk;
        uef_chunkid       = bchunkid;
        uef_chunklen      = bchunklen;
        uef_chunkpos      = bchunkpos;
        uef_chunkdatabits = bchunkdatabits;
        uef_chunkf        = bchunkf;
        fdat = bdat;
        ffound = bffound;
        uef_intone = bintone;
        endblit();
}