Exemple #1
0
	bool ModelUtils::GetAnimationTarget(astring& targetName, AnimationCurveTargetType& targetType, AnimationCurveTargetAxis& targetAxis, const astring& name)
	{
		auto strs = split(astring(name), ToAString("."));

		// ボーン向け設定の取得
		targetName = astring();
		targetType = AnimationCurveTargetType::NoneTarget;
		targetAxis = AnimationCurveTargetAxis::NoneTarget;

		if (strs.size() < 3) return false;

		for (size_t i = 0; i < strs.size() - 2; i++)
		{
			targetName += strs[i];

			if (i != strs.size() - 3)
			{
				targetName += ToAString(".");
			}
		}

		if (strs[strs.size() - 2] == ToAString("pos"))
		{
			targetType = AnimationCurveTargetType::Position;
		}

		if (strs[strs.size() - 2] == ToAString("rot"))
		{
			targetType = AnimationCurveTargetType::Rotation;
		}

		if (strs[strs.size() - 2] == ToAString("scl"))
		{
			targetType = AnimationCurveTargetType::Scale;
		}

		if (strs[strs.size() - 1] == ToAString("x"))
		{
			targetAxis = AnimationCurveTargetAxis::X;
		}

		if (strs[strs.size() - 1] == ToAString("y"))
		{
			targetAxis = AnimationCurveTargetAxis::Y;
		}

		if (strs[strs.size() - 1] == ToAString("z"))
		{
			targetAxis = AnimationCurveTargetAxis::Z;
		}

		if (strs[strs.size() - 1] == ToAString("w"))
		{
			targetAxis = AnimationCurveTargetAxis::W;
		}

		return true;
	}
Exemple #2
0
	static astring GetFileExt(const achar* filepath)
	{
		auto path = astring(filepath);
		size_t i = path.rfind('.', path.length());
		if (i != astring::npos)
		{
			return (path.substr(i + 1, path.length() - i));
		}
		return astring();
	}
Exemple #3
0
	/**
	@brief	文字列分割
	@note
	http://shnya.jp/blog/?p=195 のコードを改造
	*/
	static std::vector<astring> split(const astring &str, const astring &delim)
	{
		std::vector<astring> res;
		size_t current = 0, found, delimlen = delim.size();
		while ((found = str.find(delim, current)) != astring::npos)
		{
			res.push_back(astring(str, current, found - current));
			current = found + delimlen;
		}
		res.push_back(astring(str, current, str.size() - current));
		return res;
	}
Exemple #4
0
pointswin_info::pointswin_info(debugger_windows_interface &debugger) :
	debugwin_info(debugger, false, astring("All Breakpoints").c_str(), NULL)
{
	if (!window())
		return;

	m_views[0].reset(global_alloc(debugview_info(debugger, *this, window(), DVT_BREAK_POINTS)));
	if ((m_views[0] == NULL) || !m_views[0]->is_valid())
	{
		m_views[0].reset();
		return;
	}

	// create the options menu
	HMENU const optionsmenu = CreatePopupMenu();
	AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_BREAKPOINTS, TEXT("Breakpoints\tCtrl+1"));
	AppendMenu(optionsmenu, MF_ENABLED, ID_SHOW_WATCHPOINTS, TEXT("Watchpoints\tCtrl+2"));
	AppendMenu(GetMenu(window()), MF_ENABLED | MF_POPUP, (UINT_PTR)optionsmenu, TEXT("Options"));

	// compute a client rect
	RECT bounds;
	bounds.top = bounds.left = 0;
	bounds.right = m_views[0]->maxwidth() + (2 * EDGE_WIDTH);
	bounds.bottom = 200;
	AdjustWindowRectEx(&bounds, DEBUG_WINDOW_STYLE, FALSE, DEBUG_WINDOW_STYLE_EX);

	// clamp the min/max size
	set_maxwidth(bounds.right - bounds.left);

	// position the window at the bottom-right
	SetWindowPos(window(), HWND_TOP, 100, 100, bounds.right - bounds.left, bounds.bottom - bounds.top, SWP_SHOWWINDOW);

	// recompute the children
	recompute_children();
}
Exemple #5
0
void Thread::parse()
{
    // thread = ["UID" SP] "THREAD" SP thread-alg SP search-criteria
    // thread-alg = "ORDEREDSUBJECT" / "REFERENCES" / thread-alg-ext
    // thread-alg-ext = atom
    // search-criteria = charset 1*(SP search-key)
    // charset = atom / quoted

    space();
    EString threadAlg = atom().lower();
    if ( threadAlg == "orderedsubject" )
        d->threadAlg = ThreadData::OrderedSubject;
    else if ( threadAlg == "refs" )
        d->threadAlg = ThreadData::Refs;
    else if ( threadAlg == "references" )
        d->threadAlg = ThreadData::References;
    else
        error( Bad, "Unsupported thread algorithm" );
    space();
    parser()->mark();
    if ( Codec::byName( astring() ) )
        space();
    else
        parser()->restore();
    d->s = new Selector;
    d->s->add( parseKey() );
    while ( ok() && !parser()->atEnd() ) {
        space();
        d->s->add( parseKey() );
    }
    d->s->simplify();
    end();
}
Exemple #6
0
chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
{
	FILE *infile;
	astring path = astring(tocfname);

	infile = fopen(tocfname, "rb");
	path = get_file_path(path);

	if (infile == (FILE *)NULL)
	{
		return CHDERR_FILE_NOT_FOUND;
	}

	/* clear structures */
	memset(&outtoc, 0, sizeof(outtoc));
	outinfo.reset();

	fseek(infile, 0, SEEK_END);
	long size = ftell(infile);
	fclose(infile);


	outtoc.numtrks = 1;

	outinfo.track[0].fname = tocfname;
	outinfo.track[0].offset = 0;
	outinfo.track[0].idx0offs = 0;
	outinfo.track[0].idx1offs = 0;

	if ((size % 2048)==0 ) {
		outtoc.tracks[0].trktype = CD_TRACK_MODE1;
		outtoc.tracks[0].frames = size / 2048;
		outtoc.tracks[0].datasize = 2048;
		outinfo.track[0].swap = false;
	} else if ((size % 2352)==0 ) {
		// 2352 byte mode 2 raw
		outtoc.tracks[0].trktype = CD_TRACK_MODE2_RAW;
		outtoc.tracks[0].frames = size / 2352;
		outtoc.tracks[0].datasize = 2352;
		outinfo.track[0].swap = false;
	} else {
		printf("ERROR: Unrecognized track type\n");
		return CHDERR_UNSUPPORTED_FORMAT;
	}

	outtoc.tracks[0].subtype = CD_SUB_NONE;
	outtoc.tracks[0].subsize = 0;

	outtoc.tracks[0].pregap = 0;

	outtoc.tracks[0].postgap = 0;
	outtoc.tracks[0].pgtype = 0;
	outtoc.tracks[0].pgsub = CD_SUB_NONE;
	outtoc.tracks[0].pgdatasize = 0;
	outtoc.tracks[0].pgsubsize = 0;
	outtoc.tracks[0].padframes = 0;


	return CHDERR_NONE;
}
image_error_t device_image_interface::set_image_filename(const char *filename)
{
    m_image_name = filename;
    zippath_parent(m_working_directory, filename);
	m_basename.cpy(m_image_name);

	int loc1 = m_image_name.rchr(0,'\\');
	int loc2 = m_image_name.rchr(0,'/');
	int loc3 = m_image_name.rchr(0,':');
	int loc = MAX(loc1,MAX(loc2,loc3));
	if (loc!=-1) {
		if (loc == loc3)
		{
			// temp workaround for softlists now that m_image_name contains the part name too (e.g. list:gamename:cart)
			astring tmpstr = astring(m_basename.substr(0,loc));
			int tmploc = tmpstr.rchr(0,':');
			m_basename = m_basename.substr(tmploc + 1,loc-tmploc);
		}
		else
			m_basename = m_basename.substr(loc + 1,m_basename.len()-loc);
	}
	m_basename_noext = m_basename.cpy(m_basename);
	m_filetype = "";
	loc = m_basename_noext.rchr(0,'.');
	if (loc!=-1) {
		m_basename_noext = m_basename_noext.substr(0,loc);
		m_filetype = m_basename.cpy(m_basename);
		m_filetype = m_filetype.substr(loc + 1,m_filetype.len()-loc);
	}

    return IMAGE_ERROR_SUCCESS;
}
Exemple #8
0
void image_postdevice_init(running_machine &machine)
{
	device_image_interface *image = NULL;

	/* make sure that any required devices have been allocated */
    for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
    {
			int result = image->finish_load();
			/* did the image load fail? */
			if (result)
			{
				/* retrieve image error message */
				astring image_err = astring(image->error());

				/* unload all images */
				image_unload_all(machine);

				fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load failed: %s",
					image->device().name(),
					image_err.cstr());
			}
	}

	/* add a callback for when we shut down */
	machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(image_unload_all), &machine));
}
Exemple #9
0
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
void* EffectTextureLoader::Load(const EFK_CHAR* path, Effekseer::TextureType textureType)
{
	auto key = astring((const achar*) path);
	auto cache = m_caches.find(key);
	if (cache != m_caches.end())
	{
		cache->second.Count++;
		return cache->second.Ptr;
	}

	auto staticFile = m_graphics->GetFile()->CreateStaticFile((const achar*) path);
	if (staticFile.get() == nullptr) return nullptr;

	int32_t imageWidth = 0;
	int32_t imageHeight = 0;
	std::vector<uint8_t> imageDst;
	if (!ImageHelper::LoadPNGImage(staticFile->GetData(), staticFile->GetSize(), IsReversed(), imageWidth, imageHeight, imageDst, m_graphics->GetLog()))
	{
		return nullptr;
	}

	void* img = InternalLoad(m_graphics, imageDst, imageWidth, imageHeight);

	Cache c;
	c.Ptr = img;
	c.Count = 1;
	c.Width = imageWidth;
	c.Height = imageHeight;
	m_caches[key] = c;
	dataToKey[img] = key;

	m_graphics->IncVRAM(ImageHelper::GetVRAMSize(TextureFormat::R8G8B8A8_UNORM, imageWidth, imageHeight));

	return img;
}
Exemple #10
0
nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
		device_t(mconfig, type, name, tag, owner, clock, shortname, source),
		device_video_interface(mconfig, *this),
		device_nubus_card_interface(mconfig, *this)
{
	m_assembled_tag = astring(tag).cat(":").cat(XCEED30HR_SCREEN_NAME);
	m_screen_tag = m_assembled_tag.c_str();
}
Exemple #11
0
nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
		device_t(mconfig, PDS030_XCEED30HR, "Micron/XCEED Technology Color 30HR", tag, owner, clock, "pd3_30hr", __FILE__),
		device_video_interface(mconfig, *this),
		device_nubus_card_interface(mconfig, *this)
{
	m_assembled_tag = astring(tag).cat(":").cat(XCEED30HR_SCREEN_NAME);
	m_screen_tag = m_assembled_tag.c_str();
}
Exemple #12
0
	void Model_IO::LoadMaterial(Material& material, BinaryReader& reader, const achar* path)
	{
		material.Type = reader.Get<int32_t>();
		if (material.Type == 1)
		{
			auto path = reader.Get<astring>();
		}
		else
		{
			material.OriginalColorTexture = reader.Get<astring>();
			material.OriginalNormalTexture = reader.Get<astring>();
			material.OriginalMetalnessTexture = reader.Get<astring>();

			if (material.OriginalColorTexture != astring()) material.ColorTexture = CombinePath(path, material.OriginalColorTexture.c_str());
			if (material.OriginalNormalTexture != astring()) material.NormalTexture = CombinePath(path, material.OriginalNormalTexture.c_str());
			if (material.OriginalMetalnessTexture != astring()) material.MetalnessTexture = CombinePath(path, material.OriginalMetalnessTexture.c_str());
		}
	}
static astring nvram_filename(device_t &device, astring &result)
{
    running_machine &machine = device.machine();
    astring name = astring(device.tag()).replacechr(':','_');
    if (rom_system_bios(machine) == 0 || rom_default_bios(machine) == rom_system_bios(machine)) {
        result.printf("%s\\%s",machine.basename(),name.cstr());
    } else {
        result.printf("%s_%d\\%s",machine.basename(),rom_system_bios(machine) - 1,name.cstr());
    }
    return result;
}
Exemple #14
0
void image_device_init(running_machine &machine)
{
	const char *image_name;

	/* make sure that any required devices have been allocated */
	image_interface_iterator iter(machine.root_device());
	for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
	{
		/* is an image specified for this image */
		image_name = machine.options().device_option(*image);

		if ((image_name != NULL) && (image_name[0] != '\0'))
		{
			/* mark init state */
			image->set_init_phase();

			/* try to load this image */
			bool result = image->load(image_name);

			/* did the image load fail? */
			if (result)
			{
				/* retrieve image error message */
				astring image_err = astring(image->error());
				astring image_basename(image_name);

				/* unload all images */
				image_unload_all(machine);

				fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
					image->device().name(),
					image_basename.cstr(),
					image_err.cstr());
			}
		}
	}

	for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
	{
		/* is an image specified for this image */
		image_name = image->filename();

		if (!((image_name != NULL) && (image_name[0] != '\0')))
		{
			/* no image... must this device be loaded? */
			if (image->must_be_loaded())
			{
				fatalerror_exitcode(machine, MAMERR_DEVICE, "Driver requires that device \"%s\" must have an image to load", image->instance_name());
			}
		}
	}
}
Exemple #15
0
void core_options::append_entry(core_options::entry &newentry)
{
	m_entrylist.append(newentry);

	// if we have names, add them to the map
	for (int name = 0; name < ARRAY_LENGTH(newentry.m_name); name++)
		if (newentry.name(name) != NULL)
		{
			m_entrymap.add(newentry.name(name), &newentry);

			// for boolean options add a "no" variant as well
			if (newentry.type() == OPTION_BOOLEAN)
				m_entrymap.add(astring("no").cat(newentry.name(name)).c_str(), &newentry);
		}
}
Exemple #16
0
const char *emu_options::sub_value(astring &buffer, const char *name, const char *subname) const
{
	astring tmp = astring(",").cat(subname).cat("=");
	buffer = value(name);
	int pos = buffer.find(0, tmp.c_str());
	if (pos != -1)
	{
		int endpos = buffer.chr(pos + 1, ',');
		if (endpos == -1)
			endpos = buffer.len();
		buffer = buffer.substr(pos + tmp.len(), endpos - pos - tmp.len());
	}
	else
		buffer.reset();
	return buffer.c_str();
}
Exemple #17
0
	void Deformer_Imp::AddBone(const achar* name, int32_t parentBoneIndex, RotationOrder rotationOrder, const Matrix44& localMat)
	{
		auto bone = Model_IO::Bone();

		bone.Name = astring(name);
		bone.ParentBoneIndex = parentBoneIndex;
		bone.RotationType = rotationOrder;
		bone.LocalMat = localMat;

		m_bones.push_back(bone);

		if (m_nameToIndex.find(bone.Name) == m_nameToIndex.end())
		{
			m_nameToIndex[bone.Name] = m_bones.size() - 1;
		}	
	}
Exemple #18
0
bool gui::create(const astring &_name) {
	static ge::screen::info sl_screen;
	m_screen_ID = spawn(sl_screen);
	//
	astring l_file = astring("data/gui/") + _name + ".swf";
	std::fstream l_stream(l_file.data()/*, std::ios_base::in|std::ios_base::binary*/);
	if(l_stream.good()) {
		swf::tagstream l_tags(l_stream);
		if(l_tags.good()) {
			swf::RECORDHEADER l_tag;
			while(true) {
				l_tags >> l_tag;
				if(l_tag.type == swf::tag::End) break;
				l_tags.skip(l_tag.length);
			}
			uint a = 0;
		}
Exemple #19
0
void image_device_init(running_machine *machine)
{
	const char *image_name;
	device_image_interface *image = NULL;

	/* make sure that any required devices have been allocated */
    for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
	{
		/* is an image specified for this image */
		image_name = image_get_device_option(image);

		if ((image_name != NULL) && (image_name[0] != '\0'))
		{
			/* mark init state */
			image->set_init_phase();

			/* try to load this image */
			bool result = image->load(image_name);

			/* did the image load fail? */
			if (result)
			{
				/* retrieve image error message */
				astring image_err = astring(image->error());
				const char *image_basename_str = image->basename();
				/* unload all images */
				image_unload_all(*machine);

				fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
					image->image_config().devconfig().name(),
					image_basename_str,
					image_err.cstr());
			}
		}
		else
		{
			/* no image... must this device be loaded? */
			if (image->image_config().must_be_loaded())
			{
				fatalerror_exitcode(machine, MAMERR_DEVICE, "Driver requires that device \"%s\" must have an image to load", image->image_config().instance_name());
			}
		}

		image->call_get_devices();
	}
}
Exemple #20
0
UString Command::mailboxName()
{
    EString n = astring();
    if ( n.endsWith( "/" ) )
        n = n.mid( 0, n.length() - 1 );

    User * u = imap()->user();
    if ( u && n.lower() == "inbox" ) {
        return u->inbox()->name();
    }

    MUtf7Codec m;
    UString un( m.toUnicode( n ) );
    UString r;
    if ( !m.wellformed() ) {
        AsciiCodec a;
        un = a.toUnicode( n );
        if ( !a.valid() ) {
            error( Bad,
                   "Mailbox name misparsed both as ASCII and mUTF-7: " +
                   m.error() + " (mUTF7) + " + a.error() + " (ASCII)" );
            return r;
        }
    }
    if ( un.startsWith( "/" ) ) {
        if ( u &&
             un[u->home()->name().length()] == '/' &&
             un.startsWith( u->home()->name() ) )
            d->usesAbsoluteMailbox = true;
    }
    else if ( !u ) {
        error( Bad, "Relative mailbox name is invalid before login" );
        return r;
    }
    else {
        d->usesRelativeMailbox = true;
        r.append( u->home()->name() );
        r.append( "/" );
    }
    r.append( un );
    if ( !Mailbox::validName( r ) ) {
        error( Bad, "Syntax error in mailbox name: " + n );
        return r;
    }
    return r;
}
Exemple #21
0
// AStackStringConstructors
//------------------------------------------------------------------------------
void TestAString::AStackStringConstructors() const
{
    {
        // AStackString<> with no arguments
        AStackString<> empty;
        TEST_ASSERT( empty.GetLength() == 0 );
        TEST_ASSERT( empty.GetReserved() > 0 );
        TEST_ASSERT( empty.IsEmpty() == true );
        TEST_ASSERT( empty.MemoryMustBeFreed() == false );
    }
    {
        // AStackString<> from char *
        AStackString<> fromCharStar( "hello" );
        TEST_ASSERT( fromCharStar.GetLength() == 5 );
        TEST_ASSERT( fromCharStar.GetReserved() >= 5 );
        TEST_ASSERT( fromCharStar.IsEmpty() == false );
        TEST_ASSERT( fromCharStar.MemoryMustBeFreed() == false );

        // AStackString<> from AStackString
        AStackString<> fromAString( fromCharStar );
        TEST_ASSERT( fromAString.GetLength() == 5 );
        TEST_ASSERT( fromAString.GetReserved() >= 5 );
        TEST_ASSERT( fromAString.IsEmpty() == false );
        TEST_ASSERT( fromAString.MemoryMustBeFreed() == false );
    }
    {
        // AStackString<> from AString
        AString astring( "hello" );
        AStackString<> fromAString( astring );
        TEST_ASSERT( fromAString.GetLength() == 5 );
        TEST_ASSERT( fromAString.GetReserved() >= 5 );
        TEST_ASSERT( fromAString.IsEmpty() == false );
        TEST_ASSERT( fromAString.MemoryMustBeFreed() == false );
    }
    {
        const char * hello = "hellohellohello";
        AStackString<> fromCharStarPair( hello, hello + 5 );
        TEST_ASSERT( fromCharStarPair.GetLength() == 5 );
        TEST_ASSERT( fromCharStarPair.GetReserved() >= 5 );
        TEST_ASSERT( fromCharStarPair.IsEmpty() == false );
        TEST_ASSERT( fromCharStarPair.MemoryMustBeFreed() == false );
    }
}
Exemple #22
0
void Select::parse()
{
    space();
    d->mailbox = mailbox();
    if ( present( " (" ) ) {
        bool more = true;
        while ( ok() && more ) {
            // select-param can be a list or an astring. in our case,
            // only astring is legal, since we advertise no extension
            // that permits the list.
            EString param = astring().lower();
            if ( param == "annotate" )
                d->annotate = true;
            else if ( param == "condstore" )
                d->condstore = true;
            else
                error( Bad, "Unknown select-param: " + param );
            more = present( " " );
        }
        require( ")" );
    }
    end();
}
ssize_t tst::_registry()
{
    LogAlert();

    astring welln[] = {
        astring(".DEFAULT"),
//		astring("S-1-5-18"),
//		astring("S-1-5-19"),
//		astring("S-1-5-20"),
    };

    auto seq = registry::open(HKEY_USERS, "");
    if (seq) {
        for (auto it = seq->begin(), end = seq->end(); it != end; ++it) {
            if (simstd::find(simstd::begin(welln), simstd::end(welln), it->name()) == simstd::end(welln)) {
                LogReport("found name: '%s'", it->name().c_str());

                auto sid = windows::sid::open(it->name().c_str());
                if (sid) {
                    LogReport("\tgood sid: '%s', name: '%s'", sid->as_str().c_str(), sid->name().c_str());
                }

                // try open network
                auto key = registry::open(seq->system(), (it->name() + "\\Network").c_str());
                if (key) {
                    LogReport("\texist!");
                    for (auto it = key->begin(), end = key->end(); it != end; ++it) {
                        auto letter = registry::open(key->system(), it->name().c_str());
                        auto path = letter->get("RemotePath", "");
                        LogReport("letter: '%s' -> '%s'", it->name().c_str(), path.c_str());
                    }
                }
            }
        }
    }
    return 0;
}
	astring to_string(long double value)
	{
		char buffer[128];
		cstr::to_string(buffer, lengthof(buffer), value);
		return astring(buffer);
	}
Exemple #25
0
static void process_disk_entries(romload_private *romdata, const char *regiontag, const rom_entry *parent_region, const rom_entry *romp, const char *locationtag)
{
	/* loop until we hit the end of this region */
	for ( ; !ROMENTRY_ISREGIONEND(romp); romp++)
	{
		/* handle files */
		if (ROMENTRY_ISFILE(romp))
		{
			open_chd *chd = global_alloc(open_chd(regiontag));

			hash_collection hashes(ROM_GETHASHDATA(romp));
			chd_error err;

			/* make the filename of the source */
			astring filename(ROM_GETNAME(romp), ".chd");

			/* first open the source drive */
			LOG(("Opening disk image: %s\n", filename.cstr()));
			err = chd_error(open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, chd->orig_chd(), locationtag));
			if (err != CHDERR_NONE)
			{
				handle_missing_file(romdata, romp, astring(), err);
				global_free(chd);
				continue;
			}

			/* get the header and extract the SHA1 */
			hash_collection acthashes;
			acthashes.add_sha1(chd->orig_chd().sha1());

			/* verify the hash */
			if (hashes != acthashes)
			{
				romdata->errorstring.catprintf("%s WRONG CHECKSUMS:\n", filename.cstr());
				dump_wrong_and_correct_checksums(romdata, hashes, acthashes);
				romdata->warnings++;
			}
			else if (hashes.flag(hash_collection::FLAG_BAD_DUMP))
			{
				romdata->errorstring.catprintf("%s CHD NEEDS REDUMP\n", filename.cstr());
				romdata->knownbad++;
			}

			/* if not read-only, make the diff file */
			if (!DISK_ISREADONLY(romp))
			{
				/* try to open or create the diff */
				err = open_disk_diff(romdata->machine().options(), romp, chd->orig_chd(), chd->diff_chd());
				if (err != CHDERR_NONE)
				{
					romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.cstr(), chd_file::error_string(err));
					romdata->errors++;
					global_free(chd);
					continue;
				}
			}

			/* we're okay, add to the list of disks */
			LOG(("Assigning to handle %d\n", DISK_GETINDEX(romp)));
			romdata->machine().romload_data->chd_list.append(*chd);
		}
	}
}
	astring to_string(unsigned long long value)
	{
		char buffer[64];
		cstr::to_string(buffer, lengthof(buffer), value);
		return astring(buffer);
	}
	astring to_string(float value)
	{
		char buffer[128];
		cstr::to_string(buffer, lengthof(buffer), value);
		return astring(buffer);
	}
Exemple #28
0
void memorywin_info::update_caption()
{
	win_set_window_text_utf8(window(), astring("Memory: ", m_views[0]->source_name()));
}
Exemple #29
0
	astring get_prefixa()
	{
		return astring();
	}
Exemple #30
0
void debug_view_breakpoints::view_update()
{
	const debug_view_source& source = *m_source;
	const device_debug& debugInterface = *source.device()->debug();
	debug_view_char *dest = m_viewdata;

	// Gather a list of all the breakpoints in reverse order
	int numBPs = 0;
	device_debug::breakpoint** bpList = NULL;
	if (debugInterface.breakpoint_first() != NULL)
	{
		// Alloc
		for (device_debug::breakpoint *bp = debugInterface.breakpoint_first(); bp != NULL; bp = bp->next())
			numBPs++;
		bpList = new device_debug::breakpoint*[numBPs];

		// Collect
		int i = 1;
		for (device_debug::breakpoint *bp = debugInterface.breakpoint_first(); bp != NULL; bp = bp->next())
		{
			bpList[numBPs-i] = bp;
			i++;
		}
	}

	// Draw
	for (int row = 0; row < m_visible.y; row++)
	{
		UINT32 effrow = m_topleft.y + row;

		// Header
		if (effrow == 0)
		{
			astring header = "ID   En  Address          Condition         Action";
			for (int i = 0; i < m_visible.x; i++)
			{
				dest->byte = (i < header.len()) ? header[i] : ' ';
				dest->attrib = DCA_ANCILLARY;
				dest++;
			}
			continue;
		}

		// Breakpoints
		int bpi = effrow-1;
		if (bpi < numBPs && bpi >= 0)
		{
			device_debug::breakpoint* bp = bpList[bpi];

			astring buffer;
			buffer.printf("%x", bp->index());
			pad_astring_to_length(buffer, 5);
			buffer.catprintf("%c", bp->enabled() ? 'X' : 'O');
			pad_astring_to_length(buffer, 9);
			buffer.catprintf("%s", core_i64_hex_format(bp->address(), debugInterface.logaddrchars()));
			pad_astring_to_length(buffer, 26);
			if (astring(bp->condition()) != astring("1"))
			{
				buffer.catprintf("%s", bp->condition());
				pad_astring_to_length(buffer, 44);
			}
			if (astring(bp->action()) != astring(""))
			{
				buffer.catprintf("%s", bp->action());
				pad_astring_to_length(buffer, 60);
			}

			for (int i = 0; i < m_visible.x; i++)
			{
				dest->byte = (i < buffer.len()) ? buffer[i] : ' ';
				dest->attrib = DCA_NORMAL;
				dest++;
			}
			continue;
		}

		// Fill the remaining vertical space
		for (int i = 0; i < m_visible.x; i++)
		{
			dest->byte = ' ';
			dest->attrib = DCA_NORMAL;
			dest++;
		}
	}

	delete bpList;
}