Esempio n. 1
0
File: image.cs Progetto: kwanboy/mcs
        /*-------------------------------------------------
        *   write_config - emit current option statuses as
        *   INI files
        *  -------------------------------------------------*/
        int write_config(emu_options options, string filename, game_driver gamedrv)
        {
            string buffer;
            int    retval = 1;

            if (gamedrv != null)
            {
                buffer   = string.Format("{0}.ini", gamedrv.name);
                filename = buffer;
            }

            emu_file file = new emu_file(options.ini_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE);

            osd_file.error filerr = file.open(filename);
            if (filerr == osd_file.error.NONE)
            {
                string inistring = options.output_ini();
                file.puts(inistring);
                retval = 0;
            }
            file.close();

            return(retval);
        }
Esempio n. 2
0
        /*-------------------------------------------------
        *   write_config - emit current option statuses as
        *   INI files
        *  -------------------------------------------------*/
        int write_config(emu_options options, string filename, game_driver gamedrv)
        {
            string buffer;
            int    retval = 1;

            if (gamedrv != null)
            {
                sprintf(out buffer, "{0}.ini", gamedrv.name);
                filename = buffer;
            }

            emu_file file = new emu_file(options.ini_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE);

            std.error_condition filerr = file.open(filename);
            if (!filerr)
            {
                string inistring = options.output_ini();
                file.puts(inistring);
                retval = 0;
            }
            file.close();

            return(retval);
        }