Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.84 KB | None | 0 0
  1.  
  2. typedef char CHAR;
  3. typedef unsigned char UCHAR;
  4. typedef short SHORT;
  5. typedef unsigned short USHORT;
  6. typedef int INT;
  7. typedef unsigned int UINT;
  8.  
  9.  
  10. public struct tByte
  11. {
  12.     UCHAR HiNibble : 4;
  13.     UCHAR LoNibble : 4;
  14. };
  15.  
  16. public struct WindowMatchInfo{
  17.     USHORT Length : 3;
  18.     USHORT Offset : 13;
  19. };
  20.  
  21. public struct WindowMatch{
  22.     var LastExtraByteHighNibble = 0;
  23.     WindowMatchInfo WindowInfo;
  24.     if (WindowInfo.Length >= 7){
  25.         bExtraByteToggle = (!bExtraByteToggle);
  26.         if (bExtraByteToggle){
  27.             tByte ExtraLenByte;
  28.             bExtraByteHighNibble = ExtraLenByte.HiNibble;
  29.             if (ExtraLenByte.LoNibble >= 15){
  30.                 UCHAR AddByte1;
  31.                 if (AddByte1 >= 255){
  32.                     USHORT WholeByteLen1;
  33.                 }
  34.             }
  35.         }else{
  36.             if (bExtraByteHighNibble >= 15){
  37.                 UCHAR AddByte2;
  38.                 if (AddByte2 >= 255){
  39.                     USHORT WholeByteLen2;
  40.                 }
  41.             }
  42.         }
  43.     }
  44. };
  45.  
  46. public struct MetaMap{
  47.     UCHAR Bit0 : 1;
  48.     UCHAR Bit1 : 1;
  49.     UCHAR Bit2 : 1;
  50.     UCHAR Bit3 : 1;
  51.     UCHAR Bit4 : 1;
  52.     UCHAR Bit5 : 1;
  53.     UCHAR Bit6 : 1;
  54.     UCHAR Bit7 : 1;
  55.     UCHAR Bit8 : 1;
  56.     UCHAR Bit9 : 1;
  57.     UCHAR Bit10 : 1;
  58.     UCHAR Bit11 : 1;
  59.     UCHAR Bit12: 1;
  60.     UCHAR Bit13: 1;
  61.     UCHAR Bit14 : 1;
  62.     UCHAR Bit15 : 1;
  63.     UCHAR Bit16 : 1;
  64.     UCHAR Bit17 : 1;
  65.     UCHAR Bit18 : 1;
  66.     UCHAR Bit19 : 1;
  67.     UCHAR Bit20 : 1;
  68.     UCHAR Bit21 : 1;
  69.     UCHAR Bit22 : 1;
  70.     UCHAR Bit23 : 1;
  71.     UCHAR Bit24 : 1;
  72.     UCHAR Bit25 : 1;
  73.     UCHAR Bit26 : 1;
  74.     UCHAR Bit27 : 1;
  75.     UCHAR Bit28 : 1;
  76.     UCHAR Bit29 : 1;
  77.     UCHAR Bit30 : 1;
  78.     UCHAR Bit31 : 1;
  79. };
  80.  
  81.  
  82. public struct LZ77{
  83.     var bExtraByteToggle=0;
  84.     var bExtraByteHighNibble= 0;
  85.  
  86.     MetaMap Map;
  87.  
  88.     if (Map.Bit31){
  89.         WindowMatch Match31;
  90.     }else{
  91.         char Byte31;
  92.     }
  93.  
  94.  
  95.     if (Map.Bit30){
  96.         WindowMatch Match30;
  97.     }else{
  98.         char Byte30;
  99.     }
  100.  
  101.  
  102.     if (Map.Bit29){
  103.         WindowMatch Match29;
  104.     }else{
  105.         char Byte29;
  106.     }
  107.  
  108.  
  109.     if (Map.Bit28){
  110.         WindowMatch Match28;
  111.     }else{
  112.         char Byte28;
  113.     }
  114.  
  115.     if (Map.Bit27){
  116.         WindowMatch Match27;
  117.     }else{
  118.         char Byte27;
  119.     }
  120.  
  121.     if (Map.Bit26){
  122.         WindowMatch Match26;
  123.     }else{
  124.         char Byte26;
  125.     }
  126.  
  127.  
  128.     if (Map.Bit25){
  129.         WindowMatch Match25;
  130.     }else{
  131.         char Byte25;
  132.     }
  133.  
  134.  
  135.     if (Map.Bit24){
  136.         WindowMatch Match24;
  137.     }else{
  138.         char Byte24;
  139.     }
  140.  
  141.     if (Map.Bit23){
  142.         WindowMatch Match23;
  143.     }else{
  144.         char Byte23;
  145.     }
  146.  
  147.     if (Map.Bit22){
  148.         WindowMatch Match22;
  149.     }else{
  150.         char Byte22;
  151.     }
  152.  
  153.     if (Map.Bit21){
  154.         WindowMatch Match21;
  155.     }else{
  156.         char Byte21;
  157.     }
  158.  
  159.     if (Map.Bit20){
  160.         WindowMatch Match20;
  161.     }else{
  162.         char Byte20;
  163.     }
  164.  
  165.     if (Map.Bit19){
  166.         WindowMatch Match19;
  167.     }else{
  168.         char Byte19;
  169.     }
  170.  
  171.     if (Map.Bit18){
  172.         WindowMatch Match18;
  173.     }else{
  174.         char Byte18;
  175.     }
  176.  
  177.     if (Map.Bit17){
  178.         WindowMatch Match17;
  179.     }else{
  180.         char Byte17;
  181.     }
  182.  
  183.     if (Map.Bit16){
  184.         WindowMatch Match16;
  185.     }else{
  186.         char Byte16;
  187.     }
  188.  
  189.  
  190.     if (Map.Bit15){
  191.         WindowMatch Match15;
  192.     }else{
  193.         char Byte15;
  194.     }
  195.  
  196.  
  197.     if (Map.Bit14){
  198.         WindowMatch Match14;
  199.     }else{
  200.         char Byte14;
  201.     }
  202.  
  203.     if (Map.Bit13){
  204.         WindowMatch Match13;
  205.     }else{
  206.         char Byte13;
  207.     }
  208.  
  209.  
  210.     if (Map.Bit12){
  211.         WindowMatch Match12;
  212.     }else{
  213.         char Byte12;
  214.     }
  215.  
  216.  
  217.  
  218.     if (Map.Bit11){
  219.         WindowMatch Match11;
  220.     }else{
  221.         char Byte11;
  222.     }
  223.  
  224.  
  225.  
  226.     if (Map.Bit10){
  227.         WindowMatch Match10;
  228.     }else{
  229.         char Byte10;
  230.     }
  231.  
  232.     if (Map.Bit9){
  233.         WindowMatch Match9;
  234.     }else{
  235.         char Byte9;
  236.     }
  237.  
  238.  
  239.     if (Map.Bit8){
  240.         WindowMatch Match8;
  241.     }else{
  242.         char Byte8;
  243.     }
  244.  
  245.     if (Map.Bit7){
  246.         WindowMatch Match7;
  247.     }else{
  248.         char Byte7;
  249.     }
  250.  
  251.  
  252.     if (Map.Bit6){
  253.         WindowMatch Match6;
  254.     }else{
  255.         char Byte6;
  256.     }
  257.  
  258.  
  259.  
  260.     if (Map.Bit5){
  261.         WindowMatch Match5;
  262.     }else{
  263.         char Byte5;
  264.     }
  265.  
  266.     if (Map.Bit4){
  267.         WindowMatch Match4;
  268.     }else{
  269.         char Byte4;
  270.     }
  271.  
  272.  
  273.     if (Map.Bit3){
  274.         WindowMatch Match3;
  275.     }else{
  276.         char Byte3;
  277.     }
  278.  
  279.  
  280.     if (Map.Bit2){
  281.         WindowMatch Match2;
  282.     }else{
  283.         char Byte2;
  284.     }
  285.  
  286.  
  287.     if (Map.Bit1){
  288.         WindowMatch Match1;
  289.     }else{
  290.         char Byte1;
  291.     }
  292.  
  293.  
  294.     if (Map.Bit0){
  295.         WindowMatch Match0;
  296.     }else{
  297.         char Byte0;
  298.     }
  299.  
  300. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement