void device_sat_cart_interface::rom_alloc(UINT32 size, const char *tag) { if (m_rom == NULL) { astring tempstring(tag); tempstring.cat(SATSLOT_ROM_REGION_TAG); m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring, size, 4, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } }
void device_astrocade_cart_interface::rom_alloc(UINT32 size, const char *tag) { if (m_rom == NULL) { astring tempstring(tag); tempstring.cat(ASTROCADESLOT_ROM_REGION_TAG); m_rom = device().machine().memory().region_alloc(tempstring.c_str(), size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } }
void device_gba_cart_interface::rom_alloc(UINT32 size, const char *tag) { if (m_rom == NULL) { astring tempstring(tag); tempstring.cat(GBASLOT_ROM_REGION_TAG); // we always alloc 32MB of rom region! m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring.c_str(), 0x2000000, 4, ENDIANNESS_LITTLE)->base(); m_rom_size = size; } }
void device_vboy_cart_interface::rom_alloc(UINT32 size, const char *tag) { if (m_rom == NULL) { astring tempstring(tag); tempstring.cat(VBOYSLOT_ROM_REGION_TAG); m_rom = (UINT32 *)device().machine().memory().region_alloc(tempstring.c_str(), size, 4, ENDIANNESS_LITTLE)->base(); m_rom_size = size/4; m_rom_mask = m_rom_size - 1; } }
void device_a800_cart_interface::rom_alloc(UINT32 size, const char *tag) { if (m_rom == NULL) { astring tempstring(tag); tempstring.cat(A800SLOT_ROM_REGION_TAG); m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; // setup other helpers m_bank_mask = (size / 0x2000) - 1; // code for XEGS carts makes use of this to simplify banking } }
Program::Program() { int i; str tempstring( "temp" ); def_void.type = &type_void; def_void.name = tempstring; def_string.type = &type_string; def_string.name = tempstring; def_float.type = &type_float; def_float.name = tempstring; def_vector.type = &type_vector; def_vector.name = tempstring; def_entity.type = &type_entity; def_entity.name = tempstring; def_function.type = &type_function; def_function.name = tempstring; def_tail = NULL; // link the function type in so state forward declarations match proper type types = &type_function; type_function.next = NULL; // cause all our strings to share their data for( i = 0; i < MAX_STRINGS; i++ ) { strings[ i ].inuse = false; strings[ i ].s = ""; } strings[0].inuse = true; // always used as return string filenames.FreeObjectList(); numpr_globals = 0; numstatements = 0; numfunctions = 1; locals_start = 0; locals_end = 0; pr_error_count = 0; }
void device_a78_cart_interface::rom_alloc(UINT32 size, const char *tag) { if (m_rom == NULL) { astring tempstring(tag); tempstring.cat(A78SLOT_ROM_REGION_TAG); m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base(); m_rom_size = size; // setup other helpers if ((size / 0x4000) & 1) // compensate for SuperGame carts with 9 x 16K banks (to my knowledge no other cart has m_bank_mask != power of 2) m_bank_mask = (size / 0x4000) - 2; else m_bank_mask = (size / 0x4000) - 1; // the rom is mapped to the top of the memory area // so we store the starting point of data to simplify // the access handling m_base_rom = 0x10000 - size; } }
ROCKETCORE_API void EMPStringTests() { std::string ss = "test"; String es = "test"; es = "hello"; es.Resize(100); es.Erase(4); es.Erase(2,100); es += "y"; String sub1 = es.Replace("lo", "l"); sub1 = sub1.Replace("h", "!"); EMPTime start; { // Create a few free buffers String tempstring("buffer"); String tempstring1("buffer1"); String tempstring2("buffer2"); } start = SYSClock::GetRealTime(); for (int i = 0; i < 100000; i++) { std::string str("test"); } Log::Message(LC_CORE, Log::LT_ALWAYS, "SS Assign Short: %f", SYSClock::GetRealTime() - start); start = SYSClock::GetRealTime(); for (int i = 0; i < 100000; i++) { String str("test"); } Log::Message(LC_CORE, Log::LT_ALWAYS, "ES Assign Short: %f", SYSClock::GetRealTime() - start); start = SYSClock::GetRealTime(); for (int i = 0; i < 100000; i++) { std::string str("test this really long string that won't fit in a local buffer"); } Log::Message(LC_CORE, Log::LT_ALWAYS, "SS Assign Long: %f", SYSClock::GetRealTime() - start); start = SYSClock::GetRealTime(); for (int i = 0; i < 100000; i++) { String str("test this really long string that won't fit in a local buffer"); } Log::Message(LC_CORE, Log::LT_ALWAYS, "ES Assign Long: %f", SYSClock::GetRealTime() - start); start = SYSClock::GetRealTime(); for (int i = 0; i < 100000; i++) { if (ss == "hello") { int bob = 10; } } Log::Message(LC_CORE, Log::LT_ALWAYS, "SS Compare: %f (char*)", SYSClock::GetRealTime() - start); std::string compare = "hello"; start = SYSClock::GetRealTime(); for (int i = 0; i < 100000; i++) { if (ss == compare) { int bob = 10; } } Log::Message(LC_CORE, Log::LT_ALWAYS, "SS Compare: %f (std::string)", SYSClock::GetRealTime() - start); start = SYSClock::GetRealTime(); for (int i = 0; i < 100000; i++) { if (es == "hello") { int bob = 10; } } Log::Message(LC_CORE, Log::LT_ALWAYS, "ES Compare: %f (char*)", SYSClock::GetRealTime() - start); String oes = es; start = SYSClock::GetRealTime(); for (int i = 0; i < 100000; i++) { if (es == oes) { int bob = 10; } } Log::Message(LC_CORE, Log::LT_ALWAYS, "ES Compare: %f (String)", SYSClock::GetRealTime() - start); start = SYSClock::GetRealTime(); std::string ss_concat = "hello"; for (int i = 0; i < 100000; i++) { ss_concat += "y"; } Log::Message(LC_CORE, Log::LT_ALWAYS, "SS +=: %f", SYSClock::GetRealTime() - start); String es_concat = "hello"; start = SYSClock::GetRealTime(); for (int i = 0; i < 100000; i++) { if (i == 1016) { int bob = 10; } es_concat += "y"; } Log::Message(LC_CORE, Log::LT_ALWAYS, "ES +=: %f", SYSClock::GetRealTime() - start); const char* x1 = "bob"; String s; String t; String u; s = "hello"; t = "hell"; u = "hello"; if (s == t) { int bob = 10; } if (s == u) { int bob = 10; } t = s + u; if (t == "hellohello") { int bob = 10; } if (t == "x") { int bob = 10; } t += u; size_t x = s.Find("e"); size_t y = s.Find("z"); String sub = t.Replace("lo", "l"); sub = sub.Replace("h", "!"); sub.FormatString(128, "%s", "hello"); int bob = 10; }