- for(x=0;x<count;x++)
- {
- if(!memcmp(toa,sf[x].desc,4))
- {
- if(tsize!=(sf[x].s&(~RLSB)))
- {
- printf("ReadStateChunk: sect \"%c%c%c%c\" has wrong size\n", toa[0], toa[1], toa[2], toa[3]);
- goto nkayo;
- }
- #ifndef LSB_FIRST
- if(sf[x].s&RLSB)
- {
- int z;
- for(z=(sf[x].s&(~RLSB))-1;z>=0;z--)
- *(uint8*)sf[x].v=fgetc(st);
- }
- else
- #endif
- {
- fread((uint8 *)sf[x].v,1,sf[x].s&(~RLSB),st);
- }
- goto bloo;
- }
- }
- printf("ReadStateChunk: sect \"%c%c%c%c\" not handled\n", toa[0], toa[1], toa[2], toa[3]);
- nkayo:
- fseek(st,tsize,SEEK_CUR);
- bloo:;
- } // while(...)
- } // >=53
- else
- {
- for(x=0;x<count;x++)
- {
- #ifdef LSB_FIRST
- fread((uint8 *)sf[x].v,1,sf[x].s&(~RLSB),st);
- #else
- int z;
- if(sf[x].s&RLSB)
- for(z=(sf[x].s&(~RLSB))-1;z>=0;z--)
- {
- *(uint8*)sf[x].v=fgetc(st);
- }
- else
- fread((uint8 *)sf[x].v,1,sf[x].s&(~RLSB),st);