From 23ae468189b32e04557e3449e70b656eb4a1298b Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Thu, 3 Mar 2016 15:46:15 +0100 Subject: use chrono calls for time handling in core (nw) --- src/osd/sdl/window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/osd/sdl/window.cpp') diff --git a/src/osd/sdl/window.cpp b/src/osd/sdl/window.cpp index 0c5bb7a51ca..2a0147afea5 100644 --- a/src/osd/sdl/window.cpp +++ b/src/osd/sdl/window.cpp @@ -310,7 +310,7 @@ static void sdlwindow_sync(void) while (!osd_work_queue_wait(work_queue, osd_ticks_per_second()*10)) { osd_printf_warning("sdlwindow_sync: Sleeping...\n"); - osd_sleep(100000); + osd_sleep(osd_ticks_per_second() / 1000 * 100); } } } -- cgit v1.2.3-70-g09d2 From 5b549a4fe01408bc959e858a343883156264b4ad Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 5 Mar 2016 13:02:05 +0100 Subject: Using SDL_INIT_GAMECONTROLLER it explicitly calls SDL_INIT_JOYSTICK some experimental code (nw) --- src/osd/modules/input/input_sdl.cpp | 19 ++++++++++++++----- src/osd/sdl/sdlmain.cpp | 7 +++---- src/osd/sdl/window.cpp | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) (limited to 'src/osd/sdl/window.cpp') diff --git a/src/osd/modules/input/input_sdl.cpp b/src/osd/modules/input/input_sdl.cpp index 3894f25e1b4..43d4cbf6a6c 100644 --- a/src/osd/modules/input/input_sdl.cpp +++ b/src/osd/modules/input/input_sdl.cpp @@ -688,11 +688,20 @@ public: int physical_stick; for (physical_stick = 0; physical_stick < SDL_NumJoysticks(); physical_stick++) { - SDL_Joystick *joy = SDL_JoystickOpen(physical_stick); - std::string joy_name = remove_spaces(SDL_JoystickName(joy)); - SDL_JoystickClose(joy); - - devmap_register(&m_joy_map, physical_stick, joy_name.c_str()); + if (SDL_IsGameController(physical_stick)) { + osd_printf_verbose("Joystick %i is supported by the game controller interface!\n", physical_stick); + osd_printf_verbose("Compatible controller, named \'%s\'\n", SDL_GameControllerNameForIndex(physical_stick)); + SDL_GameController *joy = SDL_GameControllerOpen(physical_stick); + osd_printf_verbose("Controller is mapped as \"%s\".\n", SDL_GameControllerMapping(joy)); + std::string joy_name = remove_spaces(SDL_GameControllerName(joy)); + SDL_GameControllerClose(joy); + devmap_register(&m_joy_map, physical_stick, joy_name.c_str()); + } else { + SDL_Joystick *joy = SDL_JoystickOpen(physical_stick); + std::string joy_name = remove_spaces(SDL_JoystickName(joy)); + SDL_JoystickClose(joy); + devmap_register(&m_joy_map, physical_stick, joy_name.c_str()); + } } for (int stick = 0; stick < MAX_DEVMAP_ENTRIES; stick++) diff --git a/src/osd/sdl/sdlmain.cpp b/src/osd/sdl/sdlmain.cpp index 1a52a105fd5..66bca69b1cf 100644 --- a/src/osd/sdl/sdlmain.cpp +++ b/src/osd/sdl/sdlmain.cpp @@ -270,8 +270,7 @@ void sdl_osd_interface::osd_exit() if (!SDLMAME_INIT_IN_WORKER_THREAD) { - /* FixMe: Bug in SDL2.0, Quitting joystick will cause SIGSEGV */ - SDL_QuitSubSystem(SDL_INIT_TIMER| SDL_INIT_VIDEO /*| SDL_INIT_JOYSTICK */); + SDL_QuitSubSystem(SDL_INIT_TIMER| SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER ); } } @@ -490,9 +489,9 @@ void sdl_osd_interface::init(running_machine &machine) { #ifdef SDLMAME_EMSCRIPTEN // timer brings in threads which are not supported in Emscripten - if (SDL_InitSubSystem(SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE)) { + if (SDL_InitSubSystem(SDL_INIT_VIDEO| SDL_INIT_GAMECONTROLLER|SDL_INIT_NOPARACHUTE)) { #else - if (SDL_InitSubSystem(SDL_INIT_TIMER| SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE)) { + if (SDL_InitSubSystem(SDL_INIT_TIMER| SDL_INIT_VIDEO| SDL_INIT_GAMECONTROLLER|SDL_INIT_NOPARACHUTE)) { #endif osd_printf_error("Could not initialize SDL %s\n", SDL_GetError()); exit(-1); diff --git a/src/osd/sdl/window.cpp b/src/osd/sdl/window.cpp index 2a0147afea5..483ad426186 100644 --- a/src/osd/sdl/window.cpp +++ b/src/osd/sdl/window.cpp @@ -184,7 +184,7 @@ static OSDWORK_CALLBACK(sdlwindow_thread_id) if (SDLMAME_INIT_IN_WORKER_THREAD) { - if (SDL_InitSubSystem(SDL_INIT_TIMER|SDL_INIT_AUDIO| SDL_INIT_VIDEO| SDL_INIT_JOYSTICK|SDL_INIT_NOPARACHUTE)) + if (SDL_InitSubSystem(SDL_INIT_TIMER|SDL_INIT_AUDIO| SDL_INIT_VIDEO| SDL_INIT_GAMECONTROLLER|SDL_INIT_NOPARACHUTE)) { osd_printf_error("Could not initialize SDL: %s.\n", SDL_GetError()); exit(-1); -- cgit v1.2.3-70-g09d2 From e76d30243e48cc99cb5e5a92667a66617e2c6f4c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 7 Mar 2016 19:34:44 +0100 Subject: Removed I64FMT and SIZETFMT, one usage left in chdman.cpp (nw) --- src/devices/cpu/es5510/es5510.cpp | 22 +++++++++++----------- src/devices/machine/nvram.cpp | 2 +- src/devices/sound/disc_sys.inc | 2 +- src/devices/sound/discrete.cpp | 4 ++-- src/devices/sound/esqpump.cpp | 4 ++-- src/emu/emu.h | 1 - src/mame/drivers/naomi.cpp | 2 +- src/mame/drivers/ssem.cpp | 2 +- src/mame/machine/dc.cpp | 12 ++++++------ src/mame/machine/dccons.cpp | 2 +- src/mame/machine/xbox.cpp | 2 +- src/mame/video/powervr2.cpp | 2 +- src/osd/osdcomm.h | 19 ------------------- src/osd/sdl/window.cpp | 2 +- src/osd/windows/window.cpp | 5 ++--- src/tools/chdman.cpp | 14 ++++++++++---- 16 files changed, 41 insertions(+), 56 deletions(-) (limited to 'src/osd/sdl/window.cpp') diff --git a/src/devices/cpu/es5510/es5510.cpp b/src/devices/cpu/es5510/es5510.cpp index 17a73204f09..28be6e56f8b 100644 --- a/src/devices/cpu/es5510/es5510.cpp +++ b/src/devices/cpu/es5510/es5510.cpp @@ -422,12 +422,12 @@ WRITE8_MEMBER(es5510_device::host_w) break; /* 0x03 to 0x08 INSTR Register */ - case 0x03: instr_latch = ((instr_latch&U64(0x00ffffffffff)) | ((INT64)data&0xff)<<40); LOG(("ES5510: Host Write INSTR latch[5] = %02x -> %012" I64FMT "x\n", data, instr_latch)); break; - case 0x04: instr_latch = ((instr_latch&U64(0xff00ffffffff)) | ((INT64)data&0xff)<<32); LOG(("ES5510: Host Write INSTR latch[4] = %02x -> %012" I64FMT "x\n", data, instr_latch)); break; - case 0x05: instr_latch = ((instr_latch&U64(0xffff00ffffff)) | ((INT64)data&0xff)<<24); LOG(("ES5510: Host Write INSTR latch[3] = %02x -> %012" I64FMT "x\n", data, instr_latch)); break; - case 0x06: instr_latch = ((instr_latch&U64(0xffffff00ffff)) | ((INT64)data&0xff)<<16); LOG(("ES5510: Host Write INSTR latch[2] = %02x -> %012" I64FMT "x\n", data, instr_latch)); break; - case 0x07: instr_latch = ((instr_latch&U64(0xffffffff00ff)) | ((INT64)data&0xff)<< 8); LOG(("ES5510: Host Write INSTR latch[1] = %02x -> %012" I64FMT "x\n", data, instr_latch)); break; - case 0x08: instr_latch = ((instr_latch&U64(0xffffffffff00)) | ((INT64)data&0xff)<< 0); LOG(("ES5510: Host Write INSTR latch[0] = %02x -> %012" I64FMT "x\n", data, instr_latch)); break; + case 0x03: instr_latch = ((instr_latch&U64(0x00ffffffffff)) | ((INT64)data&0xff)<<40); LOG(("%s",string_format("ES5510: Host Write INSTR latch[5] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x04: instr_latch = ((instr_latch&U64(0xff00ffffffff)) | ((INT64)data&0xff)<<32); LOG(("%s",string_format("ES5510: Host Write INSTR latch[4] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x05: instr_latch = ((instr_latch&U64(0xffff00ffffff)) | ((INT64)data&0xff)<<24); LOG(("%s",string_format("ES5510: Host Write INSTR latch[3] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x06: instr_latch = ((instr_latch&U64(0xffffff00ffff)) | ((INT64)data&0xff)<<16); LOG(("%s",string_format("ES5510: Host Write INSTR latch[2] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x07: instr_latch = ((instr_latch&U64(0xffffffff00ff)) | ((INT64)data&0xff)<< 8); LOG(("%s",string_format("ES5510: Host Write INSTR latch[1] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; + case 0x08: instr_latch = ((instr_latch&U64(0xffffffffff00)) | ((INT64)data&0xff)<< 0); LOG(("%s",string_format("ES5510: Host Write INSTR latch[0] = %02x -> %012I64x\n", data, instr_latch).c_str())); break; /* 0x09 to 0x0b DIL Register (r/o) */ @@ -477,7 +477,7 @@ WRITE8_MEMBER(es5510_device::host_w) break; case 0x80: /* Read select - GPR + INSTR */ - LOG(("ES5510: Host Read INSTR+GPR %02x (%s): %012" I64FMT "x %06x (%d)\n", data, REGNAME(data & 0xff), instr[data] & U64(0xffffffffffff), gpr[data] & 0xffffff, gpr[data])); + LOG(("%s",string_format("ES5510: Host Read INSTR+GPR %02x (%s): %012I64x %06x (%d)\n", data, REGNAME(data & 0xff), instr[data] & U64(0xffffffffffff), gpr[data] & 0xffffff, gpr[data]).c_str())); /* Check if an INSTR address is selected */ if (data < 0xa0) { @@ -498,7 +498,7 @@ WRITE8_MEMBER(es5510_device::host_w) case 0xc0: /* Write select - INSTR */ #if VERBOSE DESCRIBE_INSTR(buf, instr_latch, gpr[data], NULL, NULL, NULL, NULL); - LOG(("ES5510: Host Write INSTR %02x %012" I64FMT "x: %s\n", data, instr_latch&U64(0xffffffffffff), buf)); + LOG(("%s",string_format("ES5510: Host Write INSTR %02x %012I64x: %s\n", data, instr_latch&U64(0xffffffffffff), buf).c_str())); #endif if (data < 0xa0) { instr[data] = instr_latch&U64(0xffffffffffff); @@ -508,7 +508,7 @@ WRITE8_MEMBER(es5510_device::host_w) case 0xe0: /* Write select - GPR + INSTR */ #if VERBOSE DESCRIBE_INSTR(buf, instr_latch, gpr_latch, NULL, NULL, NULL, NULL); - LOG(("ES5510: Host Write INSTR+GPR %02x (%s): %012" I64FMT "x %06x (%d): %s\n", data, REGNAME(data&0xff), instr_latch, gpr_latch, SX(gpr_latch), buf)); + LOG(("%s",string_format("ES5510: Host Write INSTR+GPR %02x (%s): %012I64x %06x (%d): %s\n", data, REGNAME(data&0xff), instr_latch, gpr_latch, SX(gpr_latch), buf).c_str())); #endif if (data < 0xa0) { instr[data] = instr_latch; @@ -675,7 +675,7 @@ void es5510_device::list_program(void(p)(const char *, ...)) { UINT8 cReg = (UINT8)((instr[addr] >> 32) & 0xff); UINT8 dReg = (UINT8)((instr[addr] >> 40) & 0xff); DESCRIBE_INSTR(buf, instr[addr], gpr[addr], name[aReg], name[bReg], name[cReg], name[dReg]); - p("%02x: %012" I64FMT "x %06x (%8d) %s\n", addr, instr[addr], gpr[addr]&0xffffff, SX(gpr[addr]&0xffffff), buf); + p("%s",string_format("%02x: %012I64x %06x (%8d) %s\n", addr, instr[addr], gpr[addr]&0xffffff, SX(gpr[addr]&0xffffff), buf).c_str()); } for (; addr < 0xc0; addr++) { p("%02x: %06x (%d)\n", addr, gpr[addr]&0xffffff, SX(gpr[addr]&0xffffff)); @@ -701,7 +701,7 @@ void es5510_device::execute_run() { #if VERBOSE_EXEC char buf[1024]; DESCRIBE_INSTR(buf, instr[pc], gpr[pc], NULL, NULL, NULL, NULL); - LOG_EXEC(("EXECUTING %02x: %012" I64FMT "x %06x %s\n", pc, instr[pc], gpr[pc]&0xffffff, buf)); + LOG_EXEC(("%s",string_format("EXECUTING %02x: %012I64x %06x %s\n", pc, instr[pc], gpr[pc]&0xffffff, buf).c_str())); #endif ram_pp = ram_p; diff --git a/src/devices/machine/nvram.cpp b/src/devices/machine/nvram.cpp index d1e99ceb98b..88d1191187a 100644 --- a/src/devices/machine/nvram.cpp +++ b/src/devices/machine/nvram.cpp @@ -165,5 +165,5 @@ void nvram_device::determine_final_base() // if we are region-backed for the default, find it now and make sure it's the right size if (m_region != nullptr && m_region->bytes() != m_length) - throw emu_fatalerror("NVRAM device '%s' has a default region, but it should be 0x%" SIZETFMT "X bytes", tag(), m_length); + throw emu_fatalerror("%s",string_format("NVRAM device '%s' has a default region, but it should be 0x%I64uX bytes", tag(), m_length).c_str()); } diff --git a/src/devices/sound/disc_sys.inc b/src/devices/sound/disc_sys.inc index 92b00c30383..a166f71ce49 100644 --- a/src/devices/sound/disc_sys.inc +++ b/src/devices/sound/disc_sys.inc @@ -61,7 +61,7 @@ DISCRETE_STEP( dso_csvlog ) int nodenum; /* Dump any csv logs */ - fprintf(m_csv_file, "%" I64FMT "d", ++m_sample_num); + fprintf(m_csv_file, "%s", string_format("%I64d", ++m_sample_num).c_str()); for (nodenum = 0; nodenum < this->active_inputs(); nodenum++) { fprintf(m_csv_file, ", %f", *this->m_input[nodenum]); diff --git a/src/devices/sound/discrete.cpp b/src/devices/sound/discrete.cpp index 926db3a4a40..dc66910707f 100644 --- a/src/devices/sound/discrete.cpp +++ b/src/devices/sound/discrete.cpp @@ -647,9 +647,9 @@ void discrete_device::display_profiling(void) total = list_run_time(m_node_list); count = m_node_list.count(); /* print statistics */ - printf("Total Samples : %16" I64FMT "d\n", m_total_samples); + printf("%s",string_format("Total Samples : %16I64d\n", m_total_samples).c_str()); tresh = total / count; - printf("Threshold (mean): %16" I64FMT "d\n", tresh / m_total_samples ); + printf("%s",string_format("Threshold (mean): %16I64d\n", tresh / m_total_samples).c_str()); for_each(discrete_base_node **, node, &m_node_list) { discrete_step_interface *step; diff --git a/src/devices/sound/esqpump.cpp b/src/devices/sound/esqpump.cpp index 496cc5c832a..e9ad6cedf85 100644 --- a/src/devices/sound/esqpump.cpp +++ b/src/devices/sound/esqpump.cpp @@ -148,7 +148,7 @@ void esq_5505_5510_pump::sound_stream_update(sound_stream &stream, stream_sample { osd_ticks_t elapsed = now - last_ticks; osd_ticks_t tps = osd_ticks_per_second(); - fprintf(stderr, "Pump: %d samples in %" I64FMT "d ticks for %f Hz\n", last_samples, elapsed, last_samples * (double)tps / (double)elapsed); + fprintf(stderr, "%s",string_format("Pump: %d samples in %I64d ticks for %f Hz\n", last_samples, elapsed, last_samples * (double)tps / (double)elapsed).c_str()); last_ticks = now; while (next_report_ticks <= now) { next_report_ticks += tps; @@ -156,7 +156,7 @@ void esq_5505_5510_pump::sound_stream_update(sound_stream &stream, stream_sample last_samples = 0; #if !PUMP_FAKE_ESP_PROCESSING - fprintf(stderr, " ESP spent %" I64FMT "d ticks on %d samples, %f ticks per sample\n", ticks_spent_processing, samples_processed, (double)ticks_spent_processing / (double)samples_processed); + fprintf(stderr, "%s",string_format(" ESP spent %I64d ticks on %d samples, %f ticks per sample\n", ticks_spent_processing, samples_processed, (double)ticks_spent_processing / (double)samples_processed).c_str()); ticks_spent_processing = 0; samples_processed = 0; #endif diff --git a/src/emu/emu.h b/src/emu/emu.h index 0cf7b7c1384..e978bbe44d5 100644 --- a/src/emu/emu.h +++ b/src/emu/emu.h @@ -18,7 +18,6 @@ #ifndef __EMU_H__ #define __EMU_H__ -#include // must be here otherwise issues with I64FMT in MINGW #include #include #include diff --git a/src/mame/drivers/naomi.cpp b/src/mame/drivers/naomi.cpp index f7554e290b2..5e433324027 100644 --- a/src/mame/drivers/naomi.cpp +++ b/src/mame/drivers/naomi.cpp @@ -1906,7 +1906,7 @@ WRITE64_MEMBER(naomi_state::aw_modem_w ) 0x0060028C rw POUT CN304 (EX. IO board) */ - osd_printf_verbose("MODEM: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x600000+reg*4, dat, data, offset, mem_mask); + osd_printf_verbose("%s",string_format("MODEM: [%08x=%x] write %I64x to %x, mask %I64x\n", 0x600000+reg*4, dat, data, offset, mem_mask).c_str()); } static ADDRESS_MAP_START( aw_map, AS_PROGRAM, 64, naomi_state ) diff --git a/src/mame/drivers/ssem.cpp b/src/mame/drivers/ssem.cpp index 56090713130..2fdc6eefebe 100644 --- a/src/mame/drivers/ssem.cpp +++ b/src/mame/drivers/ssem.cpp @@ -493,7 +493,7 @@ UINT32 ssem_state::screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitma (m_store[(m_store_line << 2) | 1] << 16) | (m_store[(m_store_line << 2) | 2] << 8) | (m_store[(m_store_line << 2) | 3] << 0)); - glyph_print(bitmap, 0, 272, "LINE:%02d VALUE:%08x HALT:%" I64FMT "d", m_store_line, word, m_maincpu->state_int(SSEM_HALT)); + glyph_print(bitmap, 0, 272, "%s",string_format("LINE:%02d VALUE:%08x HALT:%I64d", m_store_line, word, m_maincpu->state_int(SSEM_HALT)).c_str()); return 0; } diff --git a/src/mame/machine/dc.cpp b/src/mame/machine/dc.cpp index 324a1a1dfe6..59141504bdb 100644 --- a/src/mame/machine/dc.cpp +++ b/src/mame/machine/dc.cpp @@ -374,7 +374,7 @@ READ64_MEMBER(dc_state::dc_sysctrl_r ) #if DEBUG_SYSCTRL if ((reg != 0x40) && (reg != 0x41) && (reg != 0x42) && (reg != 0x23) && (reg > 2)) // filter out IRQ status reads { - osd_printf_verbose("SYSCTRL: [%08x] read %x @ %x (reg %x: %s), mask %" I64FMT "x (PC=%x)\n", 0x5f6800+reg*4, dc_sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, space.device().safe_pc()); + osd_printf_verbose("%s",string_format("SYSCTRL: [%08x] read %x @ %x (reg %x: %s), mask %I64x (PC=%x)\n", 0x5f6800+reg*4, dc_sysctrl_regs[reg], offset, reg, sysctrl_names[reg], mem_mask, space.device().safe_pc()).c_str()); } #endif @@ -472,7 +472,7 @@ WRITE64_MEMBER(dc_state::dc_sysctrl_w ) #if DEBUG_SYSCTRL if ((reg != 0x40) && (reg != 0x42) && (reg > 2)) // filter out IRQ acks and ch2 dma { - osd_printf_verbose("SYSCTRL: write %" I64FMT "x to %x (reg %x), mask %" I64FMT "x\n", data>>shift, offset, reg, /*sysctrl_names[reg],*/ mem_mask); + osd_printf_verbose("%s",string_format("SYSCTRL: write %I64x to %x (reg %x), mask %I64x\n", data>>shift, offset, reg, /*sysctrl_names[reg],*/ mem_mask).c_str()); } #endif } @@ -513,7 +513,7 @@ WRITE64_MEMBER(dc_state::dc_gdrom_w ) off=offset << 1; } - osd_printf_verbose("GDROM: [%08x=%x]write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x5f7000+off*4, dat, data, offset, mem_mask); + osd_printf_verbose("%s",string_format("GDROM: [%08x=%x]write %I64x to %x, mask %I64x\n", 0x5f7000+off*4, dat, data, offset, mem_mask).c_str()); } READ64_MEMBER(dc_state::dc_g2_ctrl_r ) @@ -632,7 +632,7 @@ WRITE64_MEMBER(dc_state::dc_modem_w ) reg = decode_reg32_64(offset, mem_mask, &shift); dat = (UINT32)(data >> shift); - osd_printf_verbose("MODEM: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x600000+reg*4, dat, data, offset, mem_mask); + osd_printf_verbose("%s",string_format("MODEM: [%08x=%x] write %I64x to %x, mask %I64x\n", 0x600000+reg*4, dat, data, offset, mem_mask).c_str()); } #define SAVE_G2DMA(x) \ @@ -674,7 +674,7 @@ void dc_state::machine_reset() READ32_MEMBER(dc_state::dc_aica_reg_r) { -// osd_printf_verbose("AICA REG: [%08x] read %" I64FMT "x, mask %" I64FMT "x\n", 0x700000+reg*4, (UINT64)offset, mem_mask); +// osd_printf_verbose("%s",string_format("AICA REG: [%08x] read %I64x, mask %I64x\n", 0x700000+reg*4, (UINT64)offset, mem_mask).c_str()); if(offset == 0x2c00/4) return m_armrst; @@ -705,7 +705,7 @@ WRITE32_MEMBER(dc_state::dc_aica_reg_w) m_aica->write(space, offset*2, data, 0xffff); -// osd_printf_verbose("AICA REG: [%08x=%x] write %x to %x, mask %" I64FMT "x\n", 0x700000+reg*4, data, offset, mem_mask); +// osd_printf_verbose("%s",string_format("AICA REG: [%08x=%x] write %x to %x, mask %I64x\n", 0x700000+reg*4, data, offset, mem_mask).c_str()); } READ32_MEMBER(dc_state::dc_arm_aica_r) diff --git a/src/mame/machine/dccons.cpp b/src/mame/machine/dccons.cpp index 48f4bd372a6..2f1b553e9fb 100644 --- a/src/mame/machine/dccons.cpp +++ b/src/mame/machine/dccons.cpp @@ -136,7 +136,7 @@ READ32_MEMBER(dc_cons_state::dc_mess_g1_ctrl_r ) WRITE32_MEMBER(dc_cons_state::dc_mess_g1_ctrl_w ) { g1bus_regs[offset] = data; // 5f7400+reg*4=dat -// osd_printf_verbose("G1CTRL: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x5f7400+reg*4, dat, data, offset, mem_mask); +// osd_printf_verbose("%s",string_format("G1CTRL: [%08x=%x] write %I64x to %x, mask %I64x\n", 0x5f7400+reg*4, dat, data, offset, mem_mask).c_str()); switch (offset) { case SB_GDST: diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp index b006c9d83b5..5748e09d469 100644 --- a/src/mame/machine/xbox.cpp +++ b/src/mame/machine/xbox.cpp @@ -185,7 +185,7 @@ static void dump_timer_command(running_machine &machine, int ref, int params, co debug_console_printf(machine, "Header.Inserted %d byte\n", space.read_byte(address + 3)); debug_console_printf(machine, "Header.SignalState %08X dword\n", space.read_dword_unaligned(address + 4)); debug_console_printf(machine, "Header.WaitListEntry {%08X,%08X} _LIST_ENTRY\n", space.read_dword_unaligned(address + 8), space.read_dword_unaligned(address + 12)); - debug_console_printf(machine, "DueTime %" I64FMT "x qword\n", (INT64)space.read_qword_unaligned(address + 16)); + debug_console_printf(machine, "%s", string_format("DueTime %I64x qword\n", (INT64)space.read_qword_unaligned(address + 16)).c_str()); debug_console_printf(machine, "TimerListEntry {%08X,%08X} _LIST_ENTRY\n", space.read_dword_unaligned(address + 24), space.read_dword_unaligned(address + 28)); debug_console_printf(machine, "Dpc %08X dword\n", space.read_dword_unaligned(address + 32)); debug_console_printf(machine, "Period %d dword\n", space.read_dword_unaligned(address + 36)); diff --git a/src/mame/video/powervr2.cpp b/src/mame/video/powervr2.cpp index 4907b985f86..1b68402c493 100644 --- a/src/mame/video/powervr2.cpp +++ b/src/mame/video/powervr2.cpp @@ -2010,7 +2010,7 @@ WRITE64_MEMBER( powervr2_device::ta_fifo_poly_w ) tafifo_buff[tafifo_pos]=(UINT32)data; tafifo_buff[tafifo_pos+1]=(UINT32)(data >> 32); #if DEBUG_FIFO_POLY - osd_printf_debug("ta_fifo_poly_w: Unmapped write64 %08x = %" I64FMT "x -> %08x %08x\n", 0x10000000+offset*8, data, tafifo_buff[tafifo_pos], tafifo_buff[tafifo_pos+1]); + osd_printf_debug("%s",string_format("ta_fifo_poly_w: Unmapped write64 %08x = %I64x -> %08x %08x\n", 0x10000000+offset*8, data, tafifo_buff[tafifo_pos], tafifo_buff[tafifo_pos+1]).c_str()); #endif tafifo_pos += 2; } diff --git a/src/osd/osdcomm.h b/src/osd/osdcomm.h index 5d0e792130e..ee040498cf0 100644 --- a/src/osd/osdcomm.h +++ b/src/osd/osdcomm.h @@ -128,25 +128,6 @@ using FPTR = uintptr_t; #define EXTRACT_64HI(val) ((UINT32)((val) >> 32)) #define EXTRACT_64LO(val) ((UINT32)(val)) - -/* MINGW has adopted the MSVC formatting for 64-bit ints as of gcc 4.4 */ -#if defined(__MINGW32__) || defined(_MSC_VER) -#define I64FMT "I64" -#else -#define I64FMT "ll" -#endif - -#if defined(_MSC_VER) || defined(__MINGW32__) -#ifdef PTR64 -#define SIZETFMT "I64u" -#else -#define SIZETFMT "u" -#endif -#else -#define SIZETFMT "zu" -#endif - - /* Highly useful macro for compile-time knowledge of an array size */ #define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0])) diff --git a/src/osd/sdl/window.cpp b/src/osd/sdl/window.cpp index 483ad426186..1ca6e9605a6 100644 --- a/src/osd/sdl/window.cpp +++ b/src/osd/sdl/window.cpp @@ -203,7 +203,7 @@ bool sdl_osd_interface::window_init() { osd_printf_verbose("Enter sdlwindow_init\n"); // determine if we are using multithreading or not - multithreading_enabled = options().multithreading(); + multithreading_enabled = false;//options().multithreading(); // get the main thread ID before anything else main_threadid = SDL_ThreadID(); diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index 52d0a898df7..326e8248bab 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -12,7 +12,6 @@ // Needed for RAW Input #define WM_INPUT 0x00FF -#include // must be here otherwise issues with I64FMT in MINGW // standard C headers #include @@ -152,7 +151,7 @@ static void mtlog_dump(void) for (i = 0; i < mtlogindex; i++) { osd_ticks_t curr = mtlog[i].timestamp * 1000000 / cps; - fprintf(f, "%20" I64FMT "d %10" I64FMT "d %s\n", (UINT64)curr, (UINT64)(curr - last), mtlog[i].event); + fprintf(f, "%s",string_format("%20I64d %10I64d %s\n", (UINT64)curr, (UINT64)(curr - last), mtlog[i].event).c_str()); last = curr; } fclose(f); @@ -174,7 +173,7 @@ bool windows_osd_interface::window_init() size_t temp; // determine if we are using multithreading or not - multithreading_enabled = downcast(machine().options()).multithreading(); + multithreading_enabled = false;//downcast(machine().options()).multithreading(); // get the main thread ID before anything else main_threadid = GetCurrentThreadId(); diff --git a/src/tools/chdman.cpp b/src/tools/chdman.cpp index 5c7e88c233e..0358a4c5620 100644 --- a/src/tools/chdman.cpp +++ b/src/tools/chdman.cpp @@ -31,6 +31,12 @@ //************************************************************************** // CONSTANTS & DEFINES //************************************************************************** +/* MINGW has adopted the MSVC formatting for 64-bit ints as of gcc 4.4 */ +#if defined(__MINGW32__) || defined(_MSC_VER) +#define I64FMT "I64" +#else +#define I64FMT "ll" +#endif // default hard disk sector size const UINT32 IDE_SECTOR_SIZE = 512; @@ -1231,7 +1237,7 @@ void output_track_metadata(int mode, util::core_file &file, int tracknum, const break; } bool needquote = strchr(filename, ' ') != nullptr; - file.printf("%d %d %d %d %s%s%s %" I64FMT "d\n", tracknum+1, frameoffs, mode, size, needquote?"\"":"", filename, needquote?"\"":"", discoffs); + file.printf("%s",string_format("%d %d %d %d %s%s%s %I64d\n", tracknum+1, frameoffs, mode, size, needquote?"\"":"", filename, needquote?"\"":"", discoffs).c_str()); } else if (mode == MODE_CUEBIN) { @@ -2592,7 +2598,7 @@ static void do_extract_ld(parameters_t ¶ms) if (err != CHDERR_NONE) { UINT64 filepos = static_cast(input_chd).tell(); - report_error(1, "Error reading hunk %" I64FMT "d at offset %" I64FMT "d from CHD file (%s): %s\n", framenum, filepos, params.find(OPTION_INPUT)->second->c_str(), chd_file::error_string(err)); + report_error(1, "%s",string_format("Error reading hunk %I64d at offset %I64d from CHD file (%s): %s\n", framenum, filepos, params.find(OPTION_INPUT)->second->c_str(), chd_file::error_string(err)).c_str()); } // write audio @@ -2600,7 +2606,7 @@ static void do_extract_ld(parameters_t ¶ms) { avi_error avierr = avi_append_sound_samples(output_file, chnum, avconfig.audio[chnum], actsamples, 0); if (avierr != AVIERR_NONE) - report_error(1, "Error writing samples for hunk %" I64FMT "d to file (%s): %s\n", framenum, output_file_str->second->c_str(), avi_error_string(avierr)); + report_error(1, "%s",string_format("Error writing samples for hunk %I64d to file (%s): %s\n", framenum, output_file_str->second->c_str(), avi_error_string(avierr)).c_str()); } // write video @@ -2608,7 +2614,7 @@ static void do_extract_ld(parameters_t ¶ms) { avi_error avierr = avi_append_video_frame(output_file, fullbitmap); if (avierr != AVIERR_NONE) - report_error(1, "Error writing video for hunk %" I64FMT "d to file (%s): %s\n", framenum, output_file_str->second->c_str(), avi_error_string(avierr)); + report_error(1, "%s",string_format("Error writing video for hunk %I64d to file (%s): %s\n", framenum, output_file_str->second->c_str(), avi_error_string(avierr)).c_str()); } } -- cgit v1.2.3-70-g09d2