C64Lib.Core.FSDrive.chdir_cmd C# (CSharp) Method

chdir_cmd() private method

private chdir_cmd ( string dirpath ) : void
dirpath string
return void
        void chdir_cmd(string dirpath)
        {
            string str = String.Empty;
            int p = 0;
            close_all_channels();

            // G:. resets the directory path to its original setting
            if (dirpath[0] == '.' && dirpath[1] == 0)
            {
                change_dir(orig_dir_path);
            }
            else
            {
                // Convert directory name
                for (int i = 0; i < dirpath.Length; i++)
                    str += (char)conv_from_64((byte)dirpath[i], false);

                if (!change_dir(str))
                    set_error(ErrorCode1541.ERR_NOTREADY);
            }
        }