From 54f8b3ae5df6736c58b2a8398f9ac85da425c96d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 22 Apr 2015 11:30:19 +0200 Subject: moved all to std::string (nw) --- src/osd/modules/debugger/qt/mainwindow.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/osd/modules/debugger/qt/mainwindow.c') diff --git a/src/osd/modules/debugger/qt/mainwindow.c b/src/osd/modules/debugger/qt/mainwindow.c index 8e07cd09c3e..45e82504ccf 100644 --- a/src/osd/modules/debugger/qt/mainwindow.c +++ b/src/osd/modules/debugger/qt/mainwindow.c @@ -136,7 +136,7 @@ void MainWindow::setProcessor(device_t* processor) m_dasmFrame->view()->verticalScrollBar()->setValue(m_dasmFrame->view()->view()->visible_position().y); // Window title - astring title; + std::string title; title.printf("Debug: %s - %s '%s'", m_machine->system().name, processor->name(), processor->tag()); setWindowTitle(title.c_str()); } @@ -225,7 +225,7 @@ void MainWindow::toggleBreakpointAtCursor(bool changedTo) } // If none exists, add a new one - astring command; + std::string command; if (bpindex == -1) { command.printf("bpset 0x%X", address); @@ -257,7 +257,7 @@ void MainWindow::enableBreakpointAtCursor(bool changedTo) if (bp != NULL) { INT32 const bpindex = bp->index(); - astring command; + std::string command; command.printf(bp->enabled() ? "bpdisable 0x%X" : "bpenable 0x%X", bpindex); debug_console_execute_command(*m_machine, command.c_str(), 1); } @@ -273,7 +273,7 @@ void MainWindow::runToCursor(bool changedTo) if (dasmView->cursor_visible() && (debug_cpu_get_visible_cpu(*m_machine) == dasmView->source()->device())) { offs_t address = downcast(dasmView)->selected_address(); - astring command; + std::string command; command.printf("go 0x%X", address); debug_console_execute_command(*m_machine, command.c_str(), 1); } @@ -463,7 +463,7 @@ void MainWindow::createImagesMenu() image_interface_iterator iter(m_machine->root_device()); for (device_image_interface *img = iter.first(); img != NULL; img = iter.next()) { - astring menuName; + std::string menuName; menuName.format("%s : %s", img->device().name(), img->exists() ? img->filename() : "[empty slot]"); QMenu* interfaceMenu = imagesMenu->addMenu(menuName.c_str()); -- cgit v1.2.3-70-g09d2 From da12f5356a789a4a8fe94f121b3f625f2fffda62 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 22 Apr 2015 13:22:18 +0200 Subject: bugix and sdl fix (nw) --- src/emu/emuopts.c | 5 ++++- src/osd/modules/debugger/qt/mainwindow.c | 12 ++++++------ src/osd/sdl/input.c | 2 +- src/osd/sdl/osdsdl.h | 6 +++--- src/osd/sdl/sdlmain.c | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) (limited to 'src/osd/modules/debugger/qt/mainwindow.c') diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c index fb06caf7f6c..ad4d9099d0c 100644 --- a/src/emu/emuopts.c +++ b/src/emu/emuopts.c @@ -313,7 +313,7 @@ void emu_options::add_device_options(bool isfirstpass) std::string option_name; strprintf(option_name, "%s;%s", image->instance_name(), image->brief_instance_name()); if (strcmp(image->device_typename(image->image_type()), image->instance_name()) == 0) - strprintf(option_name, ";%s1;%s1", image->instance_name(), image->brief_instance_name()); + strcatprintf(option_name, ";%s1;%s1", image->instance_name(), image->brief_instance_name()); // add the option if (!exists(image->instance_name())) @@ -504,8 +504,11 @@ void emu_options::set_system_name(const char *name) int num = 0; do { num = options_count(); + printf("num = %i", num); update_slot_options(); + printf("options_count() = %i \n", options_count()); } while(num != options_count()); + printf("out\n"); } } diff --git a/src/osd/modules/debugger/qt/mainwindow.c b/src/osd/modules/debugger/qt/mainwindow.c index 45e82504ccf..382370fc4c8 100644 --- a/src/osd/modules/debugger/qt/mainwindow.c +++ b/src/osd/modules/debugger/qt/mainwindow.c @@ -137,7 +137,7 @@ void MainWindow::setProcessor(device_t* processor) // Window title std::string title; - title.printf("Debug: %s - %s '%s'", m_machine->system().name, processor->name(), processor->tag()); + strprintf(title,"Debug: %s - %s '%s'", m_machine->system().name, processor->name(), processor->tag()); setWindowTitle(title.c_str()); } @@ -228,11 +228,11 @@ void MainWindow::toggleBreakpointAtCursor(bool changedTo) std::string command; if (bpindex == -1) { - command.printf("bpset 0x%X", address); + strprintf(command,"bpset 0x%X", address); } else { - command.printf("bpclear 0x%X", bpindex); + strprintf(command,"bpclear 0x%X", bpindex); } debug_console_execute_command(*m_machine, command.c_str(), 1); } @@ -258,7 +258,7 @@ void MainWindow::enableBreakpointAtCursor(bool changedTo) { INT32 const bpindex = bp->index(); std::string command; - command.printf(bp->enabled() ? "bpdisable 0x%X" : "bpenable 0x%X", bpindex); + strprintf(command,bp->enabled() ? "bpdisable 0x%X" : "bpenable 0x%X", bpindex); debug_console_execute_command(*m_machine, command.c_str(), 1); } } @@ -274,7 +274,7 @@ void MainWindow::runToCursor(bool changedTo) { offs_t address = downcast(dasmView)->selected_address(); std::string command; - command.printf("go 0x%X", address); + strprintf(command,"go 0x%X", address); debug_console_execute_command(*m_machine, command.c_str(), 1); } } @@ -464,7 +464,7 @@ void MainWindow::createImagesMenu() for (device_image_interface *img = iter.first(); img != NULL; img = iter.next()) { std::string menuName; - menuName.format("%s : %s", img->device().name(), img->exists() ? img->filename() : "[empty slot]"); + strprintf(menuName,"%s : %s", img->device().name(), img->exists() ? img->filename() : "[empty slot]"); QMenu* interfaceMenu = imagesMenu->addMenu(menuName.c_str()); interfaceMenu->setObjectName(img->device().name()); diff --git a/src/osd/sdl/input.c b/src/osd/sdl/input.c index e2fd01298bf..42fc08a8ebd 100644 --- a/src/osd/sdl/input.c +++ b/src/osd/sdl/input.c @@ -2231,7 +2231,7 @@ static device_info *generic_device_alloc(device_info **devlist_head_ptr, const c devinfo->head = devlist_head_ptr; // allocate a UTF8 copy of the name - devinfo->name.cpy(name); + devinfo->name.assign(name); // append us to the list for (curdev_ptr = devinfo->head; *curdev_ptr != NULL; curdev_ptr = &(*curdev_ptr)->next) ; diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h index 6e58053d778..f3a3241e065 100644 --- a/src/osd/sdl/osdsdl.h +++ b/src/osd/sdl/osdsdl.h @@ -119,12 +119,12 @@ public: const char *ui_mode_key() const { return value(SDLOPTION_UIMODEKEY); } // joystick mapping - const char *joy_index(int index) const { std::string temp; return value(temp.format("%s%d", SDLOPTION_JOYINDEX, index).c_str()); } + const char *joy_index(int index) const { std::string temp; return value(strformat(temp, "%s%d", SDLOPTION_JOYINDEX, index).c_str()); } bool sixaxis() const { return bool_value(SDLOPTION_SIXAXIS); } #if (SDLMAME_SDL2) - const char *mouse_index(int index) const { std::string temp; return value(temp.format("%s%d", SDLOPTION_MOUSEINDEX, index).c_str()); } - const char *keyboard_index(int index) const { std::string temp; return value(temp.format("%s%d", SDLOPTION_KEYBINDEX, index).c_str()); } + const char *mouse_index(int index) const { std::string temp; return value(strformat(temp, "%s%d", SDLOPTION_MOUSEINDEX, index).c_str()); } + const char *keyboard_index(int index) const { std::string temp; return value(strformat(temp, "%s%d", SDLOPTION_KEYBINDEX, index).c_str()); } #endif const char *video_driver() const { return value(SDLOPTION_VIDEODRIVER); } diff --git a/src/osd/sdl/sdlmain.c b/src/osd/sdl/sdlmain.c index 823b20fc561..04d622874f6 100644 --- a/src/osd/sdl/sdlmain.c +++ b/src/osd/sdl/sdlmain.c @@ -211,7 +211,7 @@ sdl_options::sdl_options() { std::string ini_path(INI_PATH); add_entries(sdl_options::s_option_entries); - ini_path.replace(0, "APP_NAME", emulator_info::get_appname_lower()); + strreplace(ini_path,"APP_NAME", emulator_info::get_appname_lower()); set_default_value(SDLOPTION_INIPATH, ini_path.c_str()); } -- cgit v1.2.3-70-g09d2