//----------------------------------- //--- 010 Editor v6.0 Binary Template // // File: OrCAD3.20a_LIB.bt // Author: L. Potjewijd // Revision: 1.21 // Date: 20150530 // Purpose: Parsing OrCad 3.20a library files //----------------------------------- enum YesNo {No,Yes}; enum Vtype {END,LINE,CIRCLE,TEXT,ARC,FILL}; enum ptype {IN,I_O,OUT,OC,PAS,hiZ,OE,PWR}; enum pquad {II,IV}; enum pside {Left,Right,Top,Bottom}; typedef byte bit; // just for readability typedef struct sText { byte Length ; if (Length > 0) char String[Length]; }; typedef struct fTxt (byte fixLen) { byte Length ; if (Length > 0) char String[Length]; if ((fixLen > 0) && (fixLen > Length)) char filler[fixLen-Length]; }; typedef struct Coord { short X; short Y; }; typedef struct idxP { ushort NameOffset ; ushort DefOffset ; BigEndian(); WORD PrefixBitmap ; LittleEndian(); WORD unknown ; }; typedef struct Offsets { ushort offsetLarge; ushort offsetMedium; ushort offsetSmall; }; typedef struct PartDet { BigEndian(); /*************************/ WORD raw ; /* this is to display */ LittleEndian(); /* the 'raw' bits, too */ FSkip (-2); /*************************/ BitfieldLeftToRight(); YesNo hasConvDef : 1; // exact meaning is uncertain bit bitE : 1 ; bit bitD : 1 ; ubyte subparts : 5; // maximum = 16 YesNo isGridArray : 1; bit bit6 : 1 ; bit bit5 : 1 ; bit bit4 : 1 ; bit bit3 : 1 ; YesNo NormBitmap : 1; YesNo ConvBitmap : 1; bit bit0 : 1 ; }; typedef struct PinDet { BigEndian(); /*************************/ WORD raw ; /* this is to display */ LittleEndian(); /* the 'raw' bits, too */ FSkip (-2); /*************************/ BitfieldLeftToRight(); YesNo vertical : 1 ;; byte location : 7; ptype type : 3; YesNo isShort : 1; YesNo hasDOT : 1; YesNo hasCLK : 1; bit bit1 : 1 ; pquad quadrant : 1 ; local pside side = quadrant + (2 * vertical); }; typedef struct DefPart { ushort Length ; local ushort PartStart