Removed I64FMT and SIZETFMT, one usage left in chdman.cpp (nw)

This commit is contained in:
Miodrag Milanovic 2016-03-07 19:34:44 +01:00
parent a0aafea67f
commit e76d30243e
16 changed files with 41 additions and 56 deletions

View File

@ -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;

View File

@ -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());
}

View File

@ -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]);

View File

@ -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;

View File

@ -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

View File

@ -18,7 +18,6 @@
#ifndef __EMU_H__
#define __EMU_H__
#include <stdio.h> // must be here otherwise issues with I64FMT in MINGW
#include <list>
#include <vector>
#include <memory>

View File

@ -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 )

View File

@ -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;
}

View File

@ -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)

View File

@ -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:

View File

@ -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));

View File

@ -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;
}

View File

@ -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]))

View File

@ -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();

View File

@ -12,7 +12,6 @@
// Needed for RAW Input
#define WM_INPUT 0x00FF
#include <stdio.h> // must be here otherwise issues with I64FMT in MINGW
// standard C headers
#include <process.h>
@ -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<windows_options &>(machine().options()).multithreading();
multithreading_enabled = false;//downcast<windows_options &>(machine().options()).multithreading();
// get the main thread ID before anything else
main_threadid = GetCurrentThreadId();

View File

@ -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 &params)
if (err != CHDERR_NONE)
{
UINT64 filepos = static_cast<util::core_file &>(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 &params)
{
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 &params)
{
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());
}
}