function _gridBaseSetChar($inch)
{
    $ch = ord($inch);
    $cx = _cursorBaseGetX();
    $cy = _cursorBaseGetY();
    _gridBaseSet($cx - 1, $cy - 1, $ch);
}
function _screenHandleShowGridChar()
{
    $ch = _gridBaseGetChar(_configBaseGet("cursorx") - 1, _configBaseGet("cursory") - 1);
    print $ch;
    $cy = _cursorBaseGetY();
    $cx = _cursorBaseGetX();
    system("tput cup {$cy} {$cx}");
}
function _appBaseSaveSession()
{
    if (!_configBaseQuery("loaded")) {
        _logBaseWrite("_appBaseSaveSession NOT LOADED");
        return;
    }
    $data = array();
    $data['grid'] = _configBaseGet("grid");
    $config = array();
    $config['cursor']['x'] = _cursorBaseGetX();
    $config['cursor']['y'] = _cursorBaseGetY();
    $data['config'] = $config;
    //_logBaseWrite($config);
    $t1 = json_encode($data);
    $t2 = gzencode($t1, 9);
    $t3 = base64_encode($t2);
    $encoded = _appBaseEncrypt($t3);
    file_put_contents(_configBaseGet("targetdir") . "/out.logos", $encoded);
}
function _cursorBaseDebug()
{
    print _cursorBaseGetX() . "," . _cursorBaseGetY();
}