コード例 #1
0
ファイル: RLEBinaryMSX.cs プロジェクト: itsyourOOP/coding
        void donibblebatch(string nibblename, int nibblecount)//, StringBuilder Chunk)
        {
            int lineitem = 0;
            //while (nibblecount > 0)
            // {
            //if (lineitem > 0)
            //{ Chunk.Append(","); }
            //else
            //{ Chunk.Append(nl + "defb "); }

            int nc = nibblecount;

            if (nibblecount > 15)
            {
                nc = 15;
            }
            //nibblecount -= nc;
            string ct = VbX.IntToBin(nc).Substring(4, 4);

            addbytetodata(VbX.BinToHex(nibblename + ct));
            nibblecount -= 15;
            while (nibblecount >= 0)
            {
                int pp2 = nibblecount;
                if (pp2 > 255)
                {
                    pp2 = 255;
                }
                //Chunk.Append(",&" + (pp2).ToString("x"));
                addbytetodata(pp2);
                nibblecount -= 255;
            }

            lineitem++;
            //    }
        }