More cleanup of sprintf usage in favor of snprintf. This is to resolve deprecation warnings on Mac OSX
This commit is contained in:
parent
7b79d9db4c
commit
37574f9bef
|
@ -795,7 +795,7 @@ struct OutputStream
|
||||||
if ( writeError )
|
if ( writeError )
|
||||||
{
|
{
|
||||||
char msg[512];
|
char msg[512];
|
||||||
sprintf( msg, "%s Stream Write Errors Detected.\nOutput may be incomplete or corrupt.\nSee log file '%s' for details\n",
|
snprintf( msg, sizeof(msg), "%s Stream Write Errors Detected.\nOutput may be incomplete or corrupt.\nSee log file '%s' for details\n",
|
||||||
isAudio ? "Audio" : "Video", AV_LOG_FILE_NAME);
|
isAudio ? "Audio" : "Video", AV_LOG_FILE_NAME);
|
||||||
FCEUD_PrintError(msg);
|
FCEUD_PrintError(msg);
|
||||||
}
|
}
|
||||||
|
@ -2123,7 +2123,7 @@ int aviRecordLogOpen(void)
|
||||||
if ( avLogFp == NULL )
|
if ( avLogFp == NULL )
|
||||||
{
|
{
|
||||||
char msg[512];
|
char msg[512];
|
||||||
sprintf( msg, "Error: Failed to open AV Recording log file for writing: %s\n", AV_LOG_FILE_NAME);
|
snprintf( msg, sizeof(msg), "Error: Failed to open AV Recording log file for writing: %s\n", AV_LOG_FILE_NAME);
|
||||||
FCEUD_PrintError(msg);
|
FCEUD_PrintError(msg);
|
||||||
avLogFp = stdout;
|
avLogFp = stdout;
|
||||||
}
|
}
|
||||||
|
@ -2224,7 +2224,7 @@ int aviRecordOpenFile( const char *filepath )
|
||||||
|
|
||||||
avi_info.add_pair( "IMED", QSysInfo::prettyProductName().toLocal8Bit().constData() );
|
avi_info.add_pair( "IMED", QSysInfo::prettyProductName().toLocal8Bit().constData() );
|
||||||
|
|
||||||
sprintf( txt, "FCEUX %s", FCEU_VERSION_STRING );
|
snprintf( txt, sizeof(txt), "FCEUX %s", FCEU_VERSION_STRING );
|
||||||
avi_info.add_pair( "ITCH", txt );
|
avi_info.add_pair( "ITCH", txt );
|
||||||
|
|
||||||
romFile = getRomFile();
|
romFile = getRomFile();
|
||||||
|
@ -2305,7 +2305,7 @@ int aviRecordOpenFile( const char *filepath )
|
||||||
char msg[512];
|
char msg[512];
|
||||||
fprintf( avLogFp, "Error: Failed to open AVI file.\n");
|
fprintf( avLogFp, "Error: Failed to open AVI file.\n");
|
||||||
recordEnable = false;
|
recordEnable = false;
|
||||||
sprintf( msg, "Error: AV Recording Initialization Failed.\nSee %s for details...\n", AV_LOG_FILE_NAME);
|
snprintf( msg, sizeof(msg), "Error: AV Recording Initialization Failed.\nSee %s for details...\n", AV_LOG_FILE_NAME);
|
||||||
FCEUD_PrintError(msg);
|
FCEUD_PrintError(msg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -2320,7 +2320,7 @@ int aviRecordOpenFile( const char *filepath )
|
||||||
char msg[512];
|
char msg[512];
|
||||||
fprintf( avLogFp, "Error: Failed to open AVI file.\n");
|
fprintf( avLogFp, "Error: Failed to open AVI file.\n");
|
||||||
recordEnable = false;
|
recordEnable = false;
|
||||||
sprintf( msg, "Error: AV Recording Initialization Failed.\nSee %s for details...\n", AV_LOG_FILE_NAME);
|
snprintf( msg, sizeof(msg), "Error: AV Recording Initialization Failed.\nSee %s for details...\n", AV_LOG_FILE_NAME);
|
||||||
FCEUD_PrintError(msg);
|
FCEUD_PrintError(msg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -3136,7 +3136,7 @@ void LibavOptionsPage::initSampleRateSelect( const char *codec_name )
|
||||||
|
|
||||||
while ( c->supported_samplerates[i] != 0 )
|
while ( c->supported_samplerates[i] != 0 )
|
||||||
{
|
{
|
||||||
sprintf( rateName, "%i", c->supported_samplerates[i] );
|
snprintf( rateName, sizeof(rateName), "%i", c->supported_samplerates[i] );
|
||||||
|
|
||||||
audioSampleRate->addItem( tr(rateName), c->supported_samplerates[i] );
|
audioSampleRate->addItem( tr(rateName), c->supported_samplerates[i] );
|
||||||
|
|
||||||
|
@ -3410,7 +3410,7 @@ void LibavEncOptItem::setValueText(void)
|
||||||
if ( units[x]->default_val.i64 & i )
|
if ( units[x]->default_val.i64 & i )
|
||||||
{
|
{
|
||||||
char stmp2[128];
|
char stmp2[128];
|
||||||
sprintf( stmp2, "%s", units[x]->name );
|
snprintf( stmp2, sizeof(stmp2), "%s", units[x]->name );
|
||||||
if (j>0)
|
if (j>0)
|
||||||
{
|
{
|
||||||
strcat( stmp, ",");
|
strcat( stmp, ",");
|
||||||
|
@ -3445,7 +3445,7 @@ void LibavEncOptItem::setValueText(void)
|
||||||
if ( units[x]->default_val.i64 == i )
|
if ( units[x]->default_val.i64 == i )
|
||||||
{
|
{
|
||||||
char stmp2[128];
|
char stmp2[128];
|
||||||
sprintf( stmp2, " (%s)", units[x]->name );
|
snprintf( stmp2, sizeof(stmp2), " (%s)", units[x]->name );
|
||||||
strcat( stmp, stmp2 );
|
strcat( stmp, stmp2 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3481,12 +3481,12 @@ LibavEncOptWin::LibavEncOptWin(int type, QWidget *parent)
|
||||||
if ( type )
|
if ( type )
|
||||||
{
|
{
|
||||||
codec_name = LIBAV::audio_st.selEnc.c_str();
|
codec_name = LIBAV::audio_st.selEnc.c_str();
|
||||||
sprintf( title, "%s Audio Encoder Configuration", codec_name );
|
snprintf( title, sizeof(title), "%s Audio Encoder Configuration", codec_name );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
codec_name = LIBAV::video_st.selEnc.c_str();
|
codec_name = LIBAV::video_st.selEnc.c_str();
|
||||||
sprintf( title, "%s Video Encoder Configuration", codec_name );
|
snprintf( title, sizeof(title), "%s Video Encoder Configuration", codec_name );
|
||||||
}
|
}
|
||||||
setWindowTitle( title );
|
setWindowTitle( title );
|
||||||
resize(512, 512);
|
resize(512, 512);
|
||||||
|
@ -3816,13 +3816,13 @@ LibavEncOptInputWin::LibavEncOptInputWin( LibavEncOptItem *itemIn, QWidget *pare
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr("Range:") ), 2, 0 );
|
grid->addWidget( new QLabel( tr("Range:") ), 2, 0 );
|
||||||
|
|
||||||
sprintf( stmp, "[ %.0f, %.0f ]", opt->min, opt->max );
|
snprintf( stmp, sizeof(stmp), "[ %.0f, %.0f ]", opt->min, opt->max );
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr("Default:") ), 3, 0 );
|
grid->addWidget( new QLabel( tr("Default:") ), 3, 0 );
|
||||||
|
|
||||||
sprintf( stmp, "%lli", (long long)opt->default_val.i64 );
|
snprintf( stmp, sizeof(stmp), "%lli", (long long)opt->default_val.i64 );
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr(stmp) ), 3, 1 );
|
grid->addWidget( new QLabel( tr(stmp) ), 3, 1 );
|
||||||
|
|
||||||
|
@ -3838,12 +3838,12 @@ LibavEncOptInputWin::LibavEncOptInputWin( LibavEncOptItem *itemIn, QWidget *pare
|
||||||
{
|
{
|
||||||
if ( item->units[i]->help )
|
if ( item->units[i]->help )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%3lli: %s - %s", (long long)item->units[i]->default_val.i64,
|
snprintf( stmp, sizeof(stmp), "%3lli: %s - %s", (long long)item->units[i]->default_val.i64,
|
||||||
item->units[i]->name, item->units[i]->help );
|
item->units[i]->name, item->units[i]->help );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%3lli: %s", (long long)item->units[i]->default_val.i64,
|
snprintf( stmp, sizeof(stmp), "%3lli: %s", (long long)item->units[i]->default_val.i64,
|
||||||
item->units[i]->name );
|
item->units[i]->name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3874,13 +3874,13 @@ LibavEncOptInputWin::LibavEncOptInputWin( LibavEncOptItem *itemIn, QWidget *pare
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr("Range:") ), 2, 0 );
|
grid->addWidget( new QLabel( tr("Range:") ), 2, 0 );
|
||||||
|
|
||||||
sprintf( stmp, "[ %e, %e ]", opt->min, opt->max );
|
snprintf( stmp, sizeof(stmp), "[ %e, %e ]", opt->min, opt->max );
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr("Default:") ), 3, 0 );
|
grid->addWidget( new QLabel( tr("Default:") ), 3, 0 );
|
||||||
|
|
||||||
sprintf( stmp, "%f", opt->default_val.dbl );
|
snprintf( stmp, sizeof(stmp), "%f", opt->default_val.dbl );
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr(stmp) ), 3, 1 );
|
grid->addWidget( new QLabel( tr(stmp) ), 3, 1 );
|
||||||
|
|
||||||
|
@ -3905,7 +3905,7 @@ LibavEncOptInputWin::LibavEncOptInputWin( LibavEncOptItem *itemIn, QWidget *pare
|
||||||
|
|
||||||
if ( opt->default_val.str )
|
if ( opt->default_val.str )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%s", opt->default_val.str );
|
snprintf( stmp, sizeof(stmp), "%s", opt->default_val.str );
|
||||||
}
|
}
|
||||||
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
||||||
|
|
||||||
|
@ -3929,7 +3929,7 @@ LibavEncOptInputWin::LibavEncOptInputWin( LibavEncOptItem *itemIn, QWidget *pare
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr("Default:") ), 2, 0 );
|
grid->addWidget( new QLabel( tr("Default:") ), 2, 0 );
|
||||||
|
|
||||||
sprintf( stmp, "%i/%i", opt->default_val.q.num, opt->default_val.q.den );
|
snprintf( stmp, sizeof(stmp), "%i/%i", opt->default_val.q.num, opt->default_val.q.den );
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
||||||
|
|
||||||
|
@ -3959,7 +3959,7 @@ LibavEncOptInputWin::LibavEncOptInputWin( LibavEncOptItem *itemIn, QWidget *pare
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr("Default:") ), 2, 0 );
|
grid->addWidget( new QLabel( tr("Default:") ), 2, 0 );
|
||||||
|
|
||||||
sprintf( stmp, "%s", opt->default_val.i64 ? "true" : "false" );
|
snprintf( stmp, sizeof(stmp), "%s", opt->default_val.i64 ? "true" : "false" );
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
||||||
|
|
||||||
|
@ -3983,7 +3983,7 @@ LibavEncOptInputWin::LibavEncOptInputWin( LibavEncOptItem *itemIn, QWidget *pare
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr("Default:") ), 2, 0 );
|
grid->addWidget( new QLabel( tr("Default:") ), 2, 0 );
|
||||||
|
|
||||||
sprintf( stmp, "0x%08llX", (unsigned long long)opt->default_val.i64 );
|
snprintf( stmp, sizeof(stmp), "0x%08llX", (unsigned long long)opt->default_val.i64 );
|
||||||
|
|
||||||
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
grid->addWidget( new QLabel( tr(stmp) ), 2, 1 );
|
||||||
|
|
||||||
|
@ -3993,7 +3993,7 @@ LibavEncOptInputWin::LibavEncOptInputWin( LibavEncOptItem *itemIn, QWidget *pare
|
||||||
|
|
||||||
for (size_t i=0; i<item->units.size(); i++)
|
for (size_t i=0; i<item->units.size(); i++)
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%s", item->units[i]->name );
|
snprintf( stmp, sizeof(stmp), "%s", item->units[i]->name );
|
||||||
|
|
||||||
c = new QCheckBox( tr(stmp) );
|
c = new QCheckBox( tr(stmp) );
|
||||||
|
|
||||||
|
|
|
@ -475,112 +475,112 @@ int AviRiffViewerDialog::processChunk( AviRiffTreeItem *item )
|
||||||
|
|
||||||
avi->getChunkData( item->filePos(), data.buf, item->getSize()+8 );
|
avi->getChunkData( item->filePos(), data.buf, item->getSize()+8 );
|
||||||
|
|
||||||
sprintf( stmp, "%c%c%c%c", data.buf[0], data.buf[1], data.buf[2], data.buf[3] );
|
snprintf( stmp, sizeof(stmp), "%c%c%c%c", data.buf[0], data.buf[1], data.buf[2], data.buf[3] );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("fcc") );
|
twi->setText( 0, tr("fcc") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(4) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(4) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("cb") );
|
twi->setText( 0, tr("cb") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(8) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(8) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwMicroSecPerFrame") );
|
twi->setText( 0, tr("dwMicroSecPerFrame") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(12) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(12) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwMaxBytesPerSec") );
|
twi->setText( 0, tr("dwMaxBytesPerSec") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(16) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(16) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwPaddingGranularity") );
|
twi->setText( 0, tr("dwPaddingGranularity") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "0x%X", data.readU32(20) );
|
snprintf( stmp, sizeof(stmp), "0x%X", data.readU32(20) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwFlags") );
|
twi->setText( 0, tr("dwFlags") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(24) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(24) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwTotalFrames") );
|
twi->setText( 0, tr("dwTotalFrames") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(28) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(28) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwInitialFrames") );
|
twi->setText( 0, tr("dwInitialFrames") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(32) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(32) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwStreams") );
|
twi->setText( 0, tr("dwStreams") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(36) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(36) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwSuggestedBufferSize") );
|
twi->setText( 0, tr("dwSuggestedBufferSize") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(40) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(40) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwWidth") );
|
twi->setText( 0, tr("dwWidth") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(44) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(44) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwHeight") );
|
twi->setText( 0, tr("dwHeight") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(48) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(48) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwScale") );
|
twi->setText( 0, tr("dwScale") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(52) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(52) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwRate") );
|
twi->setText( 0, tr("dwRate") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(56) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(56) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwStart") );
|
twi->setText( 0, tr("dwStart") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(60) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(60) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwLength") );
|
twi->setText( 0, tr("dwLength") );
|
||||||
|
@ -593,21 +593,21 @@ int AviRiffViewerDialog::processChunk( AviRiffTreeItem *item )
|
||||||
|
|
||||||
avi->getChunkData( item->filePos(), data.buf, item->getSize()+8 );
|
avi->getChunkData( item->filePos(), data.buf, item->getSize()+8 );
|
||||||
|
|
||||||
sprintf( stmp, "%c%c%c%c", data.buf[0], data.buf[1], data.buf[2], data.buf[3] );
|
snprintf( stmp, sizeof(stmp), "%c%c%c%c", data.buf[0], data.buf[1], data.buf[2], data.buf[3] );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("fcc") );
|
twi->setText( 0, tr("fcc") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(4) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(4) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("cb") );
|
twi->setText( 0, tr("cb") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%c%c%c%c", data.buf[8], data.buf[9], data.buf[10], data.buf[11] );
|
snprintf( stmp, sizeof(stmp), "%c%c%c%c", data.buf[8], data.buf[9], data.buf[10], data.buf[11] );
|
||||||
strcpy( strhType, stmp );
|
strcpy( strhType, stmp );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
|
@ -617,11 +617,11 @@ int AviRiffViewerDialog::processChunk( AviRiffTreeItem *item )
|
||||||
|
|
||||||
if ( isalnum(data.buf[12]) )
|
if ( isalnum(data.buf[12]) )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%c%c%c%c", data.buf[12], data.buf[13], data.buf[14], data.buf[15] );
|
snprintf( stmp, sizeof(stmp), "%c%c%c%c", data.buf[12], data.buf[13], data.buf[14], data.buf[15] );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "0x%X", data.readU32(12) );
|
snprintf( stmp, sizeof(stmp), "0x%X", data.readU32(12) );
|
||||||
}
|
}
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
|
@ -629,42 +629,42 @@ int AviRiffViewerDialog::processChunk( AviRiffTreeItem *item )
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "0x%X", data.readU32(16) );
|
snprintf( stmp, sizeof(stmp), "0x%X", data.readU32(16) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwFlags") );
|
twi->setText( 0, tr("dwFlags") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(20) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(20) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("wPriority") );
|
twi->setText( 0, tr("wPriority") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(22) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(22) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("wLanguage") );
|
twi->setText( 0, tr("wLanguage") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(24) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(24) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwInitialFrames") );
|
twi->setText( 0, tr("dwInitialFrames") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(28) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(28) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwScale") );
|
twi->setText( 0, tr("dwScale") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(32) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(32) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwRate") );
|
twi->setText( 0, tr("dwRate") );
|
||||||
|
@ -672,68 +672,68 @@ int AviRiffViewerDialog::processChunk( AviRiffTreeItem *item )
|
||||||
|
|
||||||
if ( strcmp( strhType, "vids" ) == 0 )
|
if ( strcmp( strhType, "vids" ) == 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "(%13.10f Hz)", (double)data.readU32(32) / (double)data.readU32(28) );
|
snprintf( stmp, sizeof(stmp), "(%13.10f Hz)", (double)data.readU32(32) / (double)data.readU32(28) );
|
||||||
twi->setText( 3, tr(stmp) );
|
twi->setText( 3, tr(stmp) );
|
||||||
}
|
}
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(36) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(36) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwStart") );
|
twi->setText( 0, tr("dwStart") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(40) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(40) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwLength") );
|
twi->setText( 0, tr("dwLength") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(44) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(44) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwSuggestedBufferSize") );
|
twi->setText( 0, tr("dwSuggestedBufferSize") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%i", data.readI32(48) );
|
snprintf( stmp, sizeof(stmp), "%i", data.readI32(48) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwQuality") );
|
twi->setText( 0, tr("dwQuality") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(52) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(52) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("dwSampleSize") );
|
twi->setText( 0, tr("dwSampleSize") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(56) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(56) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("rcFrame.left") );
|
twi->setText( 0, tr("rcFrame.left") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(58) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(58) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("rcFrame.top") );
|
twi->setText( 0, tr("rcFrame.top") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(60) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(60) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("rcFrame.right") );
|
twi->setText( 0, tr("rcFrame.right") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(62) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(62) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("rcFrame.bottom") );
|
twi->setText( 0, tr("rcFrame.bottom") );
|
||||||
|
@ -748,49 +748,49 @@ int AviRiffViewerDialog::processChunk( AviRiffTreeItem *item )
|
||||||
|
|
||||||
avi->getChunkData( item->filePos(), data.buf, item->getSize()+8 );
|
avi->getChunkData( item->filePos(), data.buf, item->getSize()+8 );
|
||||||
|
|
||||||
sprintf( stmp, "%c%c%c%c", data.buf[0], data.buf[1], data.buf[2], data.buf[3] );
|
snprintf( stmp, sizeof(stmp), "%c%c%c%c", data.buf[0], data.buf[1], data.buf[2], data.buf[3] );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("fcc") );
|
twi->setText( 0, tr("fcc") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(4) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(4) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("cb") );
|
twi->setText( 0, tr("cb") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(8) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(8) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("biSize") );
|
twi->setText( 0, tr("biSize") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%i", data.readI32(12) );
|
snprintf( stmp, sizeof(stmp), "%i", data.readI32(12) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("biWidth") );
|
twi->setText( 0, tr("biWidth") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%i", data.readI32(16) );
|
snprintf( stmp, sizeof(stmp), "%i", data.readI32(16) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("biHeight") );
|
twi->setText( 0, tr("biHeight") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(20) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(20) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("biPlanes") );
|
twi->setText( 0, tr("biPlanes") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(22) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(22) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("biBitCount") );
|
twi->setText( 0, tr("biBitCount") );
|
||||||
|
@ -799,11 +799,11 @@ int AviRiffViewerDialog::processChunk( AviRiffTreeItem *item )
|
||||||
|
|
||||||
if ( isalnum(data.buf[24]) )
|
if ( isalnum(data.buf[24]) )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%c%c%c%c", data.buf[24], data.buf[25], data.buf[26], data.buf[27] );
|
snprintf( stmp, sizeof(stmp), "%c%c%c%c", data.buf[24], data.buf[25], data.buf[26], data.buf[27] );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "0x%X", data.readU32(24) );
|
snprintf( stmp, sizeof(stmp), "0x%X", data.readU32(24) );
|
||||||
}
|
}
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
|
@ -811,35 +811,35 @@ int AviRiffViewerDialog::processChunk( AviRiffTreeItem *item )
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(28) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(28) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("biSizeImage") );
|
twi->setText( 0, tr("biSizeImage") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%i", data.readI32(32) );
|
snprintf( stmp, sizeof(stmp), "%i", data.readI32(32) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("biXPelsPerMeter") );
|
twi->setText( 0, tr("biXPelsPerMeter") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%i", data.readI32(36) );
|
snprintf( stmp, sizeof(stmp), "%i", data.readI32(36) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("biYPelsPerMeter") );
|
twi->setText( 0, tr("biYPelsPerMeter") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(40) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(40) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("biClrUsed") );
|
twi->setText( 0, tr("biClrUsed") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(44) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(44) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("biClrImportant") );
|
twi->setText( 0, tr("biClrImportant") );
|
||||||
|
@ -854,56 +854,56 @@ int AviRiffViewerDialog::processChunk( AviRiffTreeItem *item )
|
||||||
|
|
||||||
avi->getChunkData( item->filePos(), data.buf, dataSize );
|
avi->getChunkData( item->filePos(), data.buf, dataSize );
|
||||||
|
|
||||||
sprintf( stmp, "%c%c%c%c", data.buf[0], data.buf[1], data.buf[2], data.buf[3] );
|
snprintf( stmp, sizeof(stmp), "%c%c%c%c", data.buf[0], data.buf[1], data.buf[2], data.buf[3] );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("fcc") );
|
twi->setText( 0, tr("fcc") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(4) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(4) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("cb") );
|
twi->setText( 0, tr("cb") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(8) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(8) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("wFormatTag") );
|
twi->setText( 0, tr("wFormatTag") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(10) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(10) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("nChannels") );
|
twi->setText( 0, tr("nChannels") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(12) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(12) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("nSamplesPerSec") );
|
twi->setText( 0, tr("nSamplesPerSec") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(16) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(16) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("nAvgBytesPerSec") );
|
twi->setText( 0, tr("nAvgBytesPerSec") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(20) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(20) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("nBlockAlign") );
|
twi->setText( 0, tr("nBlockAlign") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU16(22) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU16(22) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("nBitsPerSample") );
|
twi->setText( 0, tr("nBitsPerSample") );
|
||||||
|
@ -929,21 +929,21 @@ int AviRiffViewerDialog::processChunk( AviRiffTreeItem *item )
|
||||||
|
|
||||||
avi->getChunkData( item->filePos(), data.buf, item->getSize()+8 );
|
avi->getChunkData( item->filePos(), data.buf, item->getSize()+8 );
|
||||||
|
|
||||||
sprintf( stmp, "%c%c%c%c", data.buf[0], data.buf[1], data.buf[2], data.buf[3] );
|
snprintf( stmp, sizeof(stmp), "%c%c%c%c", data.buf[0], data.buf[1], data.buf[2], data.buf[3] );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("fcc") );
|
twi->setText( 0, tr("fcc") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(4) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(4) );
|
||||||
|
|
||||||
twi = new QTreeWidgetItem();
|
twi = new QTreeWidgetItem();
|
||||||
twi->setText( 0, tr("cb") );
|
twi->setText( 0, tr("cb") );
|
||||||
twi->setText( 2, tr(stmp) );
|
twi->setText( 2, tr(stmp) );
|
||||||
item->addChild(twi);
|
item->addChild(twi);
|
||||||
|
|
||||||
sprintf( stmp, "%u", data.readU32(8) );
|
snprintf( stmp, sizeof(stmp), "%u", data.readU32(8) );
|
||||||
|
|
||||||
for (i=0; i < static_cast<int>(item->getSize()); i++)
|
for (i=0; i < static_cast<int>(item->getSize()); i++)
|
||||||
{
|
{
|
||||||
|
@ -991,7 +991,7 @@ AviRiffTreeItem::AviRiffTreeItem(int typeIn, long long int fposIn, const char *f
|
||||||
|
|
||||||
strcpy( fourcc, fourccIn );
|
strcpy( fourcc, fourccIn );
|
||||||
|
|
||||||
//sprintf( stmp, "0x%08llX", fposIn );
|
//snprintf( stmp, sizeof(stmp), "0x%08llX", fposIn );
|
||||||
|
|
||||||
switch ( type )
|
switch ( type )
|
||||||
{
|
{
|
||||||
|
@ -1013,16 +1013,16 @@ AviRiffTreeItem::AviRiffTreeItem(int typeIn, long long int fposIn, const char *f
|
||||||
|
|
||||||
if ( showSizeHex )
|
if ( showSizeHex )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "0x%08lX", (unsigned long)size );
|
snprintf( stmp, sizeof(stmp), "0x%08lX", (unsigned long)size );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%zu", size );
|
snprintf( stmp, sizeof(stmp), "%zu", size );
|
||||||
}
|
}
|
||||||
|
|
||||||
setText( 2, QString(stmp) );
|
setText( 2, QString(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "0x%08llX", fposIn );
|
snprintf( stmp, sizeof(stmp), "0x%08llX", fposIn );
|
||||||
|
|
||||||
setText( 3, QString(stmp) );
|
setText( 3, QString(stmp) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -517,9 +517,9 @@ int GuiCheatsDialog_t::addSearchResult(uint32_t a, uint8_t last, uint8_t current
|
||||||
|
|
||||||
item = new QTreeWidgetItem();
|
item = new QTreeWidgetItem();
|
||||||
|
|
||||||
sprintf(addrStr, "$%04X", a);
|
snprintf(addrStr, sizeof(addrStr), "$%04X", a);
|
||||||
sprintf(lastStr, "%02X", last);
|
snprintf(lastStr, sizeof(lastStr), "%02X", last);
|
||||||
sprintf(curStr, "%02X", current);
|
snprintf(curStr, sizeof(curStr), "%02X", current);
|
||||||
|
|
||||||
//item->setFont( 0, font );
|
//item->setFont( 0, font );
|
||||||
//item->setFont( 1, font );
|
//item->setFont( 1, font );
|
||||||
|
@ -693,11 +693,11 @@ int GuiCheatsDialog_t::activeCheatListCB(const char *name, uint32 a, uint8 v, in
|
||||||
|
|
||||||
if (c >= 0)
|
if (c >= 0)
|
||||||
{
|
{
|
||||||
sprintf(codeStr, "$%04X?%02X:%02X", a, c, v);
|
snprintf(codeStr, sizeof(codeStr), "$%04X?%02X:%02X", a, c, v);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(codeStr, "$%04X:%02X ", a, v);
|
snprintf(codeStr, sizeof(codeStr), "$%04X:%02X ", a, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
item = actvCheatList->topLevelItem(actvCheatIdx);
|
item = actvCheatList->topLevelItem(actvCheatIdx);
|
||||||
|
@ -834,7 +834,7 @@ void GuiCheatsDialog_t::saveCheatFile(void)
|
||||||
dialog.selectFile(dir);
|
dialog.selectFile(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(dir, "%s/cheats", FCEUI_GetBaseDirectory());
|
snprintf(dir, sizeof(dir), "%s/cheats", FCEUI_GetBaseDirectory());
|
||||||
|
|
||||||
dialog.setDirectory(tr(dir));
|
dialog.setDirectory(tr(dir));
|
||||||
|
|
||||||
|
@ -1025,15 +1025,15 @@ void GuiCheatsDialog_t::actvCheatItemClicked(QTreeWidgetItem *item, int column)
|
||||||
FCEUI_ToggleCheat(row);
|
FCEUI_ToggleCheat(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sprintf(stmp, "%04X", a);
|
snprintf(stmp, sizeof(stmp), "%04X", a);
|
||||||
cheatAddrEntry->setText(tr(stmp));
|
cheatAddrEntry->setText(tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%02X", v);
|
snprintf(stmp, sizeof(stmp), "%02X", v);
|
||||||
cheatValEntry->setText(tr(stmp));
|
cheatValEntry->setText(tr(stmp));
|
||||||
|
|
||||||
if (c >= 0)
|
if (c >= 0)
|
||||||
{
|
{
|
||||||
sprintf(stmp, "%02X", c);
|
snprintf(stmp, sizeof(stmp), "%02X", c);
|
||||||
cheatCmpEntry->setText(tr(stmp));
|
cheatCmpEntry->setText(tr(stmp));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -364,22 +364,22 @@ void CodeDataLoggerDialog_t::updatePeriodic(void)
|
||||||
|
|
||||||
if (cdloggerdataSize > 0)
|
if (cdloggerdataSize > 0)
|
||||||
{
|
{
|
||||||
sprintf(str, "0x%06x %.2f%%", codecount, (fcodecount / fromsize) * 100);
|
snprintf(str, sizeof(str), "0x%06x %.2f%%", codecount, (fcodecount / fromsize) * 100);
|
||||||
prgLoggedCodeLabel->setText(tr(str));
|
prgLoggedCodeLabel->setText(tr(str));
|
||||||
|
|
||||||
sprintf(str, "0x%06x %.2f%%", datacount, (fdatacount / fromsize) * 100);
|
snprintf(str, sizeof(str), "0x%06x %.2f%%", datacount, (fdatacount / fromsize) * 100);
|
||||||
prgLoggedDataLabel->setText(tr(str));
|
prgLoggedDataLabel->setText(tr(str));
|
||||||
|
|
||||||
sprintf(str, "0x%06x %.2f%%", undefinedcount, (fundefinedcount / fromsize) * 100);
|
snprintf(str, sizeof(str), "0x%06x %.2f%%", undefinedcount, (fundefinedcount / fromsize) * 100);
|
||||||
prgUnloggedLabel->setText(tr(str));
|
prgUnloggedLabel->setText(tr(str));
|
||||||
|
|
||||||
sprintf(str, "0x%06x %.2f%%", rendercount, (frendercount / fvromsize) * 100);
|
snprintf(str, sizeof(str), "0x%06x %.2f%%", rendercount, (frendercount / fvromsize) * 100);
|
||||||
chrLoggedCodeLabel->setText(tr(str));
|
chrLoggedCodeLabel->setText(tr(str));
|
||||||
|
|
||||||
sprintf(str, "0x%06x %.2f%%", vromreadcount, (fvromreadcount / fvromsize) * 100);
|
snprintf(str, sizeof(str), "0x%06x %.2f%%", vromreadcount, (fvromreadcount / fvromsize) * 100);
|
||||||
chrLoggedDataLabel->setText(tr(str));
|
chrLoggedDataLabel->setText(tr(str));
|
||||||
|
|
||||||
sprintf(str, "0x%06x %.2f%%", undefinedvromcount, (fundefinedvromcount / fvromsize) * 100);
|
snprintf(str, sizeof(str), "0x%06x %.2f%%", undefinedvromcount, (fundefinedvromcount / fvromsize) * 100);
|
||||||
chrUnloggedLabel->setText(tr(str));
|
chrUnloggedLabel->setText(tr(str));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -392,7 +392,7 @@ void CodeDataLoggerDialog_t::updatePeriodic(void)
|
||||||
chrUnloggedLabel->setText(tr("------"));
|
chrUnloggedLabel->setText(tr("------"));
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(str, "CDL File: %s", loadedcdfile);
|
snprintf(str, sizeof(str), "CDL File: %s", loadedcdfile);
|
||||||
|
|
||||||
cdlFileLabel->setText(tr(str));
|
cdlFileLabel->setText(tr(str));
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ ColorMenuPickerDialog_t::ColorMenuPickerDialog_t( QColor *c, const char *titleTe
|
||||||
|
|
||||||
style = this->style();
|
style = this->style();
|
||||||
|
|
||||||
sprintf( stmp, "Pick Color for %s", titleText);
|
snprintf( stmp, sizeof(stmp), "Pick Color for %s", titleText);
|
||||||
|
|
||||||
setWindowTitle( stmp );
|
setWindowTitle( stmp );
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent)
|
||||||
|
|
||||||
tabView[i][j] = new DebuggerTabWidget(i,j);
|
tabView[i][j] = new DebuggerTabWidget(i,j);
|
||||||
|
|
||||||
sprintf( stmp, "debuggerTabView%i%i\n", i+1, j+1 );
|
snprintf( stmp, sizeof(stmp), "debuggerTabView%i%i\n", i+1, j+1 );
|
||||||
|
|
||||||
tabView[i][j]->setObjectName( tr(stmp) );
|
tabView[i][j]->setObjectName( tr(stmp) );
|
||||||
|
|
||||||
|
@ -1553,7 +1553,7 @@ void ConsoleDebugger::loadDisplayViews(void)
|
||||||
for (int j=0; j<4; j++)
|
for (int j=0; j<4; j++)
|
||||||
{
|
{
|
||||||
QString tabListVal;
|
QString tabListVal;
|
||||||
sprintf( key, "debugger/tabView%i%i", i+1, j+1 );
|
snprintf( key, sizeof(key), "debugger/tabView%i%i", i+1, j+1 );
|
||||||
tabListVal = settings.value(key).toString();
|
tabListVal = settings.value(key).toString();
|
||||||
|
|
||||||
QStringList tabList = tabListVal.split(',');
|
QStringList tabList = tabListVal.split(',');
|
||||||
|
@ -1610,7 +1610,7 @@ void ConsoleDebugger::loadDisplayViews(void)
|
||||||
// Save Vertical Panel State
|
// Save Vertical Panel State
|
||||||
for (int i=0; i<2; i++)
|
for (int i=0; i<2; i++)
|
||||||
{
|
{
|
||||||
sprintf( key, "debugger/vPanelState%i", i+1);
|
snprintf( key, sizeof(key), "debugger/vPanelState%i", i+1);
|
||||||
vsplitter[i]->restoreState( settings.value(key).toByteArray() );
|
vsplitter[i]->restoreState( settings.value(key).toByteArray() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1628,7 +1628,7 @@ void ConsoleDebugger::saveDisplayViews(void)
|
||||||
for (int j=0; j<4; j++)
|
for (int j=0; j<4; j++)
|
||||||
{
|
{
|
||||||
QString tabListVal;
|
QString tabListVal;
|
||||||
sprintf( key, "debugger/tabView%i%i", i+1, j+1 );
|
snprintf( key, sizeof(key), "debugger/tabView%i%i", i+1, j+1 );
|
||||||
|
|
||||||
for (int k=0; k<tabView[i][j]->count(); k++)
|
for (int k=0; k<tabView[i][j]->count(); k++)
|
||||||
{
|
{
|
||||||
|
@ -1650,7 +1650,7 @@ void ConsoleDebugger::saveDisplayViews(void)
|
||||||
// Save Vertical Panel State
|
// Save Vertical Panel State
|
||||||
for (int i=0; i<2; i++)
|
for (int i=0; i<2; i++)
|
||||||
{
|
{
|
||||||
sprintf( key, "debugger/vPanelState%i", i+1);
|
snprintf( key, sizeof(key), "debugger/vPanelState%i", i+1);
|
||||||
settings.setValue( key, vsplitter[i]->saveState());
|
settings.setValue( key, vsplitter[i]->saveState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1981,13 +1981,13 @@ DebuggerBreakpointEditor::DebuggerBreakpointEditor(int editIndex, watchpointinfo
|
||||||
rom_radio->setChecked(true);
|
rom_radio->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( stmp, "%04X", wp->address );
|
snprintf( stmp, sizeof(stmp), "%04X", wp->address );
|
||||||
|
|
||||||
addr1->setText( tr(stmp) );
|
addr1->setText( tr(stmp) );
|
||||||
|
|
||||||
if ( wp->endaddress > 0 )
|
if ( wp->endaddress > 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%04X", wp->endaddress );
|
snprintf( stmp, sizeof(stmp), "%04X", wp->endaddress );
|
||||||
|
|
||||||
addr2->setText( tr(stmp) );
|
addr2->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
|
@ -2032,14 +2032,14 @@ DebuggerBreakpointEditor::DebuggerBreakpointEditor(int editIndex, watchpointinfo
|
||||||
if ( romAddr >= 0 )
|
if ( romAddr >= 0 )
|
||||||
{
|
{
|
||||||
wp->address = romAddr;
|
wp->address = romAddr;
|
||||||
sprintf( stmp, "%X", wp->address );
|
snprintf( stmp, sizeof(stmp), "%X", wp->address );
|
||||||
addr1->setText( tr(stmp) );
|
addr1->setText( tr(stmp) );
|
||||||
rom_radio->setChecked(true);
|
rom_radio->setChecked(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char str[64];
|
char str[64];
|
||||||
sprintf(str, "K==#%02X", getBank(wp->address));
|
snprintf(str, sizeof(str), "K==#%02X", getBank(wp->address));
|
||||||
cond->setText( tr(str) );
|
cond->setText( tr(str) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2388,11 +2388,11 @@ void ConsoleDebugger::bpListUpdate( bool reset )
|
||||||
|
|
||||||
if ( watchpoint[i].endaddress > 0 )
|
if ( watchpoint[i].endaddress > 0 )
|
||||||
{
|
{
|
||||||
sprintf( addrStr, "$%04X-%04X:", watchpoint[i].address, watchpoint[i].endaddress );
|
snprintf( addrStr, sizeof(addrStr), "$%04X-%04X:", watchpoint[i].address, watchpoint[i].endaddress );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( addrStr, "$%04X:", watchpoint[i].address );
|
snprintf( addrStr, sizeof(addrStr), "$%04X:", watchpoint[i].address );
|
||||||
}
|
}
|
||||||
|
|
||||||
flags[0] = (watchpoint[i].flags & WP_E) ? 'E' : '-';
|
flags[0] = (watchpoint[i].flags & WP_E) ? 'E' : '-';
|
||||||
|
@ -2519,7 +2519,7 @@ void ConsoleDebugger::edit_BM_name( int addr )
|
||||||
|
|
||||||
bm = dbgBmMgr.getAddr( addr );
|
bm = dbgBmMgr.getAddr( addr );
|
||||||
|
|
||||||
sprintf( stmp, "Specify Bookmark Name for %04X", addr );
|
snprintf( stmp, sizeof(stmp), "Specify Bookmark Name for %04X", addr );
|
||||||
|
|
||||||
dialog.setWindowTitle( tr("Edit Bookmark") );
|
dialog.setWindowTitle( tr("Edit Bookmark") );
|
||||||
dialog.setLabelText( tr(stmp) );
|
dialog.setLabelText( tr(stmp) );
|
||||||
|
@ -2571,7 +2571,7 @@ void ConsoleDebugger::bmListUpdate( bool reset )
|
||||||
bmTree->addTopLevelItem( item );
|
bmTree->addTopLevelItem( item );
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( addrStr, "%04X", bm->addr );
|
snprintf( addrStr, sizeof(addrStr), "%04X", bm->addr );
|
||||||
|
|
||||||
//item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable );
|
//item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable );
|
||||||
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemNeverHasChildren );
|
item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemNeverHasChildren );
|
||||||
|
@ -3501,7 +3501,7 @@ void ConsoleDebugger::setBookmarkSelectedAddress( int addr )
|
||||||
{
|
{
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
|
|
||||||
sprintf( stmp, "%04X", addr );
|
snprintf( stmp, sizeof(stmp), "%04X", addr );
|
||||||
|
|
||||||
selBmAddr->setText( tr(stmp) );
|
selBmAddr->setText( tr(stmp) );
|
||||||
|
|
||||||
|
@ -3947,16 +3947,16 @@ void QAsmView::updateAssemblyView(void)
|
||||||
|
|
||||||
if (displayROMoffsets && (a->rom != -1) )
|
if (displayROMoffsets && (a->rom != -1) )
|
||||||
{
|
{
|
||||||
sprintf(chr, " %06X: ", a->rom);
|
snprintf(chr, sizeof(chr), " %06X: ", a->rom);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(chr, "%02X:%04X: ", a->bank, addr);
|
snprintf(chr, sizeof(chr), "%02X:%04X: ", a->bank, addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(chr, " :%04X: ", addr);
|
snprintf(chr, sizeof(chr), " :%04X: ", addr);
|
||||||
}
|
}
|
||||||
line.append(chr);
|
line.append(chr);
|
||||||
|
|
||||||
|
@ -3964,7 +3964,7 @@ void QAsmView::updateAssemblyView(void)
|
||||||
|
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
{
|
{
|
||||||
sprintf(chr, "%02X UNDEFINED", GetMem(addr++));
|
snprintf(chr, sizeof(chr), "%02X UNDEFINED", GetMem(addr++));
|
||||||
line.append(chr);
|
line.append(chr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3973,7 +3973,7 @@ void QAsmView::updateAssemblyView(void)
|
||||||
{
|
{
|
||||||
while (addr < 0xFFFF)
|
while (addr < 0xFFFF)
|
||||||
{
|
{
|
||||||
sprintf(chr, "%02X OVERFLOW\n", GetMem(addr++));
|
snprintf(chr, sizeof(chr), "%02X OVERFLOW\n", GetMem(addr++));
|
||||||
line.append(chr);
|
line.append(chr);
|
||||||
}
|
}
|
||||||
delete a;
|
delete a;
|
||||||
|
@ -3981,7 +3981,7 @@ void QAsmView::updateAssemblyView(void)
|
||||||
}
|
}
|
||||||
for (int j = 0; j < size; j++)
|
for (int j = 0; j < size; j++)
|
||||||
{
|
{
|
||||||
sprintf(chr, "%02X ", opcode[j] = GetMem(addr++));
|
snprintf(chr, sizeof(chr), "%02X ", opcode[j] = GetMem(addr++));
|
||||||
if ( showByteCodes ) line.append(chr);
|
if ( showByteCodes ) line.append(chr);
|
||||||
}
|
}
|
||||||
while (size < 3)
|
while (size < 3)
|
||||||
|
@ -4217,23 +4217,23 @@ void ConsoleDebugger::updateRegisterView(void)
|
||||||
char stmp[64];
|
char stmp[64];
|
||||||
char str[32], str2[32];
|
char str[32], str2[32];
|
||||||
|
|
||||||
sprintf( stmp, "%04X", X.PC );
|
snprintf( stmp, sizeof(stmp), "%04X", X.PC );
|
||||||
|
|
||||||
pcEntry->setText( tr(stmp) );
|
pcEntry->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "%02X", X.A );
|
snprintf( stmp, sizeof(stmp), "%02X", X.A );
|
||||||
|
|
||||||
regAEntry->setText( tr(stmp) );
|
regAEntry->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "%02X", X.X );
|
snprintf( stmp, sizeof(stmp), "%02X", X.X );
|
||||||
|
|
||||||
regXEntry->setText( tr(stmp) );
|
regXEntry->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "%02X", X.Y );
|
snprintf( stmp, sizeof(stmp), "%02X", X.Y );
|
||||||
|
|
||||||
regYEntry->setText( tr(stmp) );
|
regYEntry->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "%02X", X.P );
|
snprintf( stmp, sizeof(stmp), "%02X", X.P );
|
||||||
|
|
||||||
regPEntry->setText( tr(stmp) );
|
regPEntry->setText( tr(stmp) );
|
||||||
|
|
||||||
|
@ -4248,7 +4248,7 @@ void ConsoleDebugger::updateRegisterView(void)
|
||||||
|
|
||||||
stackPtr = X.S | 0x0100;
|
stackPtr = X.S | 0x0100;
|
||||||
|
|
||||||
sprintf( stmp, "Stack: $%04X", stackPtr );
|
snprintf( stmp, sizeof(stmp), "Stack: $%04X", stackPtr );
|
||||||
stackFrame->setTitle( tr(stmp) );
|
stackFrame->setTitle( tr(stmp) );
|
||||||
stackText->updateText();
|
stackText->updateText();
|
||||||
|
|
||||||
|
@ -4266,26 +4266,26 @@ void ConsoleDebugger::updateRegisterView(void)
|
||||||
ResetDebugStatisticsCounters();
|
ResetDebugStatisticsCounters();
|
||||||
counter_value2 = 0;
|
counter_value2 = 0;
|
||||||
}
|
}
|
||||||
sprintf(stmp, "%10llu (+%llu)", counter_value1, counter_value2);
|
snprintf(stmp, sizeof(stmp), "%10llu (+%llu)", counter_value1, counter_value2);
|
||||||
cpuCyclesVal->setText( tr(stmp) );
|
cpuCyclesVal->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf(stmp, "%10llu (+%llu)", total_instructions, delta_instructions);
|
snprintf(stmp, sizeof(stmp), "%10llu (+%llu)", total_instructions, delta_instructions);
|
||||||
cpuInstrsVal->setText( tr(stmp) );
|
cpuInstrsVal->setText( tr(stmp) );
|
||||||
|
|
||||||
// PPU Labels
|
// PPU Labels
|
||||||
sprintf(stmp, "$%02X", PPU[0] );
|
snprintf(stmp, sizeof(stmp), "$%02X", PPU[0] );
|
||||||
ppuCtrlReg->setText( tr(stmp) );
|
ppuCtrlReg->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf(stmp, "$%02X", PPU[1] );
|
snprintf(stmp, sizeof(stmp), "$%02X", PPU[1] );
|
||||||
ppuMaskReg->setText( tr(stmp) );
|
ppuMaskReg->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf(stmp, "$%02X", PPU[2] );
|
snprintf(stmp, sizeof(stmp), "$%02X", PPU[2] );
|
||||||
ppuStatReg->setText( tr(stmp) );
|
ppuStatReg->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf(stmp, "$%04X", (int)FCEUPPU_PeekAddress());
|
snprintf(stmp, sizeof(stmp), "$%04X", (int)FCEUPPU_PeekAddress());
|
||||||
ppuAddrDsp->setText( tr(stmp) );
|
ppuAddrDsp->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf(stmp, "$%02X", PPU[3] );
|
snprintf(stmp, sizeof(stmp), "$%02X", PPU[3] );
|
||||||
oamAddrDsp->setText( tr(stmp) );
|
oamAddrDsp->setText( tr(stmp) );
|
||||||
|
|
||||||
extern int linestartts;
|
extern int linestartts;
|
||||||
|
@ -4302,41 +4302,41 @@ void ConsoleDebugger::updateRegisterView(void)
|
||||||
if (!vblankScanLines)
|
if (!vblankScanLines)
|
||||||
{
|
{
|
||||||
// Idle scanline (240)
|
// Idle scanline (240)
|
||||||
sprintf(str, "%d", scanline); // was "Idle %d"
|
snprintf(str, sizeof(str), "%d", scanline); // was "Idle %d"
|
||||||
} else if (scanline + vblankScanLines == (PAL?311:261))
|
} else if (scanline + vblankScanLines == (PAL?311:261))
|
||||||
{
|
{
|
||||||
// Pre-render
|
// Pre-render
|
||||||
sprintf(str, "-1"); // was "Prerender -1"
|
snprintf(str, sizeof(str), "-1"); // was "Prerender -1"
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// Vblank lines (241-260/310)
|
// Vblank lines (241-260/310)
|
||||||
sprintf(str, "%d", scanline + vblankScanLines); // was "Vblank %d"
|
snprintf(str, sizeof(str), "%d", scanline + vblankScanLines); // was "Vblank %d"
|
||||||
}
|
}
|
||||||
sprintf(str2, "%d", vblankPixel);
|
snprintf(str2, sizeof(str2), "%d", vblankPixel);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// Scanlines 0 - 239
|
// Scanlines 0 - 239
|
||||||
sprintf(str, "%d", scanline);
|
snprintf(str, sizeof(str), "%d", scanline);
|
||||||
sprintf(str2, "%d", ppupixel);
|
snprintf(str2, sizeof(str2), "%d", ppupixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newppu)
|
if(newppu)
|
||||||
{
|
{
|
||||||
sprintf(str ,"%d",newppu_get_scanline());
|
snprintf(str , sizeof(str), "%d",newppu_get_scanline());
|
||||||
sprintf(str2,"%d",newppu_get_dot());
|
snprintf(str2, sizeof(str2), "%d",newppu_get_dot());
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( stmp, "%s", str );
|
snprintf( stmp, sizeof(stmp), "%s", str );
|
||||||
ppuScanLineDsp->setText( tr(stmp) );
|
ppuScanLineDsp->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "%s", str2 );
|
snprintf( stmp, sizeof(stmp), "%s", str2 );
|
||||||
ppuPixelDsp->setText( tr(stmp) );
|
ppuPixelDsp->setText( tr(stmp) );
|
||||||
|
|
||||||
int ppuScrollPosX, ppuScrollPosY;
|
int ppuScrollPosX, ppuScrollPosY;
|
||||||
ppu_getScroll( ppuScrollPosX, ppuScrollPosY);
|
ppu_getScroll( ppuScrollPosX, ppuScrollPosY);
|
||||||
sprintf( stmp, "%i", ppuScrollPosX );
|
snprintf( stmp, sizeof(stmp), "%i", ppuScrollPosX );
|
||||||
ppuScrollX->setText( tr(stmp) );
|
ppuScrollX->setText( tr(stmp) );
|
||||||
sprintf( stmp, "%i", ppuScrollPosY );
|
snprintf( stmp, sizeof(stmp), "%i", ppuScrollPosY );
|
||||||
ppuScrollY->setText( tr(stmp) );
|
ppuScrollY->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -4415,7 +4415,7 @@ void ConsoleDebugger::updatePeriodic(void)
|
||||||
if ( lastBpIdx >= 0 )
|
if ( lastBpIdx >= 0 )
|
||||||
{
|
{
|
||||||
char stmp[128];
|
char stmp[128];
|
||||||
sprintf( stmp, " Emulator Stopped / Paused at Breakpoint: %i", lastBpIdx );
|
snprintf( stmp, sizeof(stmp), " Emulator Stopped / Paused at Breakpoint: %i", lastBpIdx );
|
||||||
emuStatLbl->setText( tr(stmp) );
|
emuStatLbl->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -5374,7 +5374,7 @@ void QAsmView::setSelAddrToLine( int line )
|
||||||
selAddrWidth = 4;
|
selAddrWidth = 4;
|
||||||
selAddrValue = addr;
|
selAddrValue = addr;
|
||||||
selAddrType = 0;
|
selAddrType = 0;
|
||||||
sprintf( selAddrText, "%04X", addr );
|
snprintf( selAddrText, sizeof(selAddrText), "%04X", addr );
|
||||||
|
|
||||||
|
|
||||||
if ( parent )
|
if ( parent )
|
||||||
|
@ -5598,7 +5598,7 @@ bool QAsmView::event(QEvent *event)
|
||||||
}
|
}
|
||||||
else if ( showSymHexDecode )
|
else if ( showSymHexDecode )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "$%04X", asmEntry[line]->sym.offset() );
|
snprintf( stmp, sizeof(stmp), "$%04X", asmEntry[line]->sym.offset() );
|
||||||
|
|
||||||
QToolTip::showText(helpEvent->globalPos(), tr(stmp), this );
|
QToolTip::showText(helpEvent->globalPos(), tr(stmp), this );
|
||||||
}
|
}
|
||||||
|
@ -5606,11 +5606,11 @@ bool QAsmView::event(QEvent *event)
|
||||||
{
|
{
|
||||||
if ( asmEntry[line]->bank < 0 )
|
if ( asmEntry[line]->bank < 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "ADDR:\t$%04X", asmEntry[line]->addr );
|
snprintf( stmp, sizeof(stmp), "ADDR:\t$%04X", asmEntry[line]->addr );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "ADDR:\t$%04X\nBANK:\t$%02X\nROM:\t$%06X",
|
snprintf( stmp, sizeof(stmp), "ADDR:\t$%04X\nBANK:\t$%02X\nROM:\t$%06X",
|
||||||
asmEntry[line]->addr, asmEntry[line]->bank, asmEntry[line]->rom );
|
asmEntry[line]->addr, asmEntry[line]->bank, asmEntry[line]->rom );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5631,11 +5631,11 @@ bool QAsmView::event(QEvent *event)
|
||||||
|
|
||||||
if ( bank < 0 )
|
if ( bank < 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "ADDR:\t$%04X", addr );
|
snprintf( stmp, sizeof(stmp), "ADDR:\t$%04X", addr );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "ADDR:\t$%04X\nBANK:\t$%02X\nROM:\t$%06X",
|
snprintf( stmp, sizeof(stmp), "ADDR:\t$%04X\nBANK:\t$%02X\nROM:\t$%06X",
|
||||||
addr, bank, romOfs );
|
addr, bank, romOfs );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5909,7 +5909,7 @@ void QAsmView::mouseMoveEvent(QMouseEvent * event)
|
||||||
bank = getBank(addr);
|
bank = getBank(addr);
|
||||||
romOfs = GetNesFileAddress(addr);
|
romOfs = GetNesFileAddress(addr);
|
||||||
|
|
||||||
sprintf( txt, "CPU Address: %02X:%04X", bank, addr);
|
snprintf( txt, sizeof(txt), "CPU Address: %02X:%04X", bank, addr);
|
||||||
|
|
||||||
s.assign( txt );
|
s.assign( txt );
|
||||||
|
|
||||||
|
@ -5923,14 +5923,14 @@ void QAsmView::mouseMoveEvent(QMouseEvent * event)
|
||||||
{
|
{
|
||||||
fileName = "...";
|
fileName = "...";
|
||||||
}
|
}
|
||||||
sprintf( txt, "\nOffset 0x%06X in File \"%s\" (NL file: %X)", romOfs, fileName, bank);
|
snprintf( txt, sizeof(txt), "\nOffset 0x%06X in File \"%s\" (NL file: %X)", romOfs, fileName, bank);
|
||||||
|
|
||||||
s.append( txt );
|
s.append( txt );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( txt, "CPU Address: %04X", addr);
|
snprintf( txt, sizeof(txt), "CPU Address: %04X", addr);
|
||||||
|
|
||||||
s.assign( txt );
|
s.assign( txt );
|
||||||
}
|
}
|
||||||
|
@ -6212,13 +6212,13 @@ void QAsmView::mousePressEvent(QMouseEvent * event)
|
||||||
|
|
||||||
if ( selAddrType )
|
if ( selAddrType )
|
||||||
{
|
{
|
||||||
sprintf( selAddrText, "%06X", addr );
|
snprintf( selAddrText, sizeof(selAddrText), "%06X", addr );
|
||||||
selAddrWidth = 6;
|
selAddrWidth = 6;
|
||||||
selAddrChar = pcLocLinePos+1;
|
selAddrChar = pcLocLinePos+1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( selAddrText, "%04X", addr );
|
snprintf( selAddrText, sizeof(selAddrText), "%04X", addr );
|
||||||
selAddrWidth = 4;
|
selAddrWidth = 4;
|
||||||
selAddrChar = pcLocLinePos+3;
|
selAddrChar = pcLocLinePos+3;
|
||||||
}
|
}
|
||||||
|
@ -6357,7 +6357,7 @@ void QAsmView::contextMenuEvent(QContextMenuEvent *event)
|
||||||
|
|
||||||
if ( ctxMenuAddrType == 0 )
|
if ( ctxMenuAddrType == 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Go to $%04X\tDouble+Click", ctxMenuAddr );
|
snprintf( stmp, sizeof(stmp), "Go to $%04X\tDouble+Click", ctxMenuAddr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
menu.addAction(act);
|
menu.addAction(act);
|
||||||
//act->setShortcut( QKeySequence(tr("Ctrl+F10")));
|
//act->setShortcut( QKeySequence(tr("Ctrl+F10")));
|
||||||
|
@ -7105,7 +7105,7 @@ void DebuggerStackDisplay::contextMenuEvent(QContextMenuEvent *event)
|
||||||
{
|
{
|
||||||
char stmp[8];
|
char stmp[8];
|
||||||
|
|
||||||
sprintf( stmp, "%i", i+1 );
|
snprintf( stmp, sizeof(stmp), "%i", i+1 );
|
||||||
|
|
||||||
bytesPerLineAct[i] = new QAction(tr(stmp), &menu);
|
bytesPerLineAct[i] = new QAction(tr(stmp), &menu);
|
||||||
bytesPerLineAct[i]->setCheckable(true);
|
bytesPerLineAct[i]->setCheckable(true);
|
||||||
|
@ -7172,11 +7172,11 @@ void DebuggerStackDisplay::updateText(void)
|
||||||
{
|
{
|
||||||
if ( showAddrs || (stackBytesPerLine <= 1) )
|
if ( showAddrs || (stackBytesPerLine <= 1) )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%03X: %02X", stackPtr, GetMem(stackPtr) );
|
snprintf( stmp, sizeof(stmp), "%03X: %02X", stackPtr, GetMem(stackPtr) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%02X", GetMem(stackPtr) );
|
snprintf( stmp, sizeof(stmp), "%02X", GetMem(stackPtr) );
|
||||||
}
|
}
|
||||||
|
|
||||||
stackLine.assign( stmp );
|
stackLine.assign( stmp );
|
||||||
|
@ -7194,21 +7194,21 @@ void DebuggerStackDisplay::updateText(void)
|
||||||
{
|
{
|
||||||
if ( showAddrs )
|
if ( showAddrs )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "\n%03X: %02X", stackPtr, GetMem(stackPtr) );
|
snprintf( stmp, sizeof(stmp), "\n%03X: %02X", stackPtr, GetMem(stackPtr) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "\n%02X", GetMem(stackPtr) );
|
snprintf( stmp, sizeof(stmp), "\n%02X", GetMem(stackPtr) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, ",%02X", GetMem(stackPtr) );
|
snprintf( stmp, sizeof(stmp), ",%02X", GetMem(stackPtr) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "\n%03X: %02X", stackPtr, GetMem(stackPtr) );
|
snprintf( stmp, sizeof(stmp), "\n%03X: %02X", stackPtr, GetMem(stackPtr) );
|
||||||
}
|
}
|
||||||
stackLine.append( stmp );
|
stackLine.append( stmp );
|
||||||
|
|
||||||
|
@ -7312,11 +7312,11 @@ asmLookAheadPopup::asmLookAheadPopup( int addr, QWidget *parent )
|
||||||
hbox = new QHBoxLayout();
|
hbox = new QHBoxLayout();
|
||||||
vbox->addLayout( hbox );
|
vbox->addLayout( hbox );
|
||||||
|
|
||||||
sprintf( stmp, "%02X : $%04X", bank, addr );
|
snprintf( stmp, sizeof(stmp), "%02X : $%04X", bank, addr );
|
||||||
cpuAddr->setText( tr(stmp) );
|
cpuAddr->setText( tr(stmp) );
|
||||||
sprintf( stmp, "#$%02X", GetMem(addr) );
|
snprintf( stmp, sizeof(stmp), "#$%02X", GetMem(addr) );
|
||||||
cpuVal->setText( tr(stmp) );
|
cpuVal->setText( tr(stmp) );
|
||||||
sprintf( stmp, "$%06X", romOfs );
|
snprintf( stmp, sizeof(stmp), "$%06X", romOfs );
|
||||||
romAddr->setText( tr(stmp) );
|
romAddr->setText( tr(stmp) );
|
||||||
|
|
||||||
lbl = new QLabel( tr("CPU ADDR:") );
|
lbl = new QLabel( tr("CPU ADDR:") );
|
||||||
|
@ -7343,9 +7343,9 @@ asmLookAheadPopup::asmLookAheadPopup( int addr, QWidget *parent )
|
||||||
hbox = new QHBoxLayout();
|
hbox = new QHBoxLayout();
|
||||||
vbox->addLayout( hbox );
|
vbox->addLayout( hbox );
|
||||||
|
|
||||||
sprintf( stmp, "$%04X", addr );
|
snprintf( stmp, sizeof(stmp), "$%04X", addr );
|
||||||
cpuAddr->setText( tr(stmp) );
|
cpuAddr->setText( tr(stmp) );
|
||||||
sprintf( stmp, "#$%02X", GetMem(addr) );
|
snprintf( stmp, sizeof(stmp), "#$%02X", GetMem(addr) );
|
||||||
cpuVal->setText( tr(stmp) );
|
cpuVal->setText( tr(stmp) );
|
||||||
|
|
||||||
lbl = new QLabel( tr("CPU ADDR:") );
|
lbl = new QLabel( tr("CPU ADDR:") );
|
||||||
|
@ -7502,10 +7502,10 @@ ppuRegPopup::ppuRegPopup( QWidget *parent )
|
||||||
sprite0hit_cbox = new QCheckBox( tr("Sprite 0 Hit") );
|
sprite0hit_cbox = new QCheckBox( tr("Sprite 0 Hit") );
|
||||||
spriteOvrflw_cbox = new QCheckBox( tr("Sprite Overflow") );
|
spriteOvrflw_cbox = new QCheckBox( tr("Sprite Overflow") );
|
||||||
|
|
||||||
sprintf( stmp, "$%04X", 0x2000 + (0x400*(PPU[0] & 0x03)));
|
snprintf( stmp, sizeof(stmp), "$%04X", 0x2000 + (0x400*(PPU[0] & 0x03)));
|
||||||
ppuBgAddr->setText( tr(stmp) );
|
ppuBgAddr->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "$%04X", (PPU[0] & 0x08) ? 0x1000 : 0x0000 );
|
snprintf( stmp, sizeof(stmp), "$%04X", (PPU[0] & 0x08) ? 0x1000 : 0x0000 );
|
||||||
ppuSprAddr->setText( tr(stmp) );
|
ppuSprAddr->setText( tr(stmp) );
|
||||||
|
|
||||||
nmiBlank_cbox->setChecked( PPU[0] & 0x80 );
|
nmiBlank_cbox->setChecked( PPU[0] & 0x80 );
|
||||||
|
@ -7865,7 +7865,7 @@ DebugBreakOnDialog::DebugBreakOnDialog(int type, QWidget *parent )
|
||||||
refMode = breakOnInstrMode;
|
refMode = breakOnInstrMode;
|
||||||
threshold = break_instructions_limit;
|
threshold = break_instructions_limit;
|
||||||
|
|
||||||
sprintf(stmp, "Current Instruction Count: %10llu (+%llu)", totalCount, deltaCount);
|
snprintf(stmp, sizeof(stmp), "Current Instruction Count: %10llu (+%llu)", totalCount, deltaCount);
|
||||||
currLbl->setText( tr(stmp) );
|
currLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7889,7 +7889,7 @@ DebugBreakOnDialog::DebugBreakOnDialog(int type, QWidget *parent )
|
||||||
refMode = breakOnCycleMode;
|
refMode = breakOnCycleMode;
|
||||||
threshold = break_cycles_limit;
|
threshold = break_cycles_limit;
|
||||||
|
|
||||||
sprintf(stmp, "Current Cycle Count: %10llu (+%llu)", totalCount, deltaCount);
|
snprintf(stmp, sizeof(stmp), "Current Cycle Count: %10llu (+%llu)", totalCount, deltaCount);
|
||||||
currLbl->setText( tr(stmp) );
|
currLbl->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7969,7 +7969,7 @@ DebugBreakOnDialog::DebugBreakOnDialog(int type, QWidget *parent )
|
||||||
|
|
||||||
grid->addWidget( btn, row, 4-(col*2) );
|
grid->addWidget( btn, row, 4-(col*2) );
|
||||||
|
|
||||||
sprintf( stmp, "%+i%c", -bb, c);
|
snprintf( stmp, sizeof(stmp), "%+i%c", -bb, c);
|
||||||
|
|
||||||
btn->setText( tr(stmp) );
|
btn->setText( tr(stmp) );
|
||||||
|
|
||||||
|
@ -7979,7 +7979,7 @@ DebugBreakOnDialog::DebugBreakOnDialog(int type, QWidget *parent )
|
||||||
|
|
||||||
grid->addWidget( btn, row, 4-(col*2)+1 );
|
grid->addWidget( btn, row, 4-(col*2)+1 );
|
||||||
|
|
||||||
sprintf( stmp, "%+i%c", bb, c);
|
snprintf( stmp, sizeof(stmp), "%+i%c", bb, c);
|
||||||
|
|
||||||
btn->setText( tr(stmp) );
|
btn->setText( tr(stmp) );
|
||||||
|
|
||||||
|
@ -8118,7 +8118,7 @@ void DebugBreakOnDialog::updateCurrent(void)
|
||||||
totalCount = total_instructions;
|
totalCount = total_instructions;
|
||||||
deltaCount = delta_instructions;
|
deltaCount = delta_instructions;
|
||||||
|
|
||||||
sprintf(stmp, "Current Instruction Count: %10llu (+%llu)", totalCount, deltaCount);
|
snprintf(stmp, sizeof(stmp), "Current Instruction Count: %10llu (+%llu)", totalCount, deltaCount);
|
||||||
currLbl->setText( tr(stmp) );
|
currLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8137,7 +8137,7 @@ void DebugBreakOnDialog::updateCurrent(void)
|
||||||
ResetDebugStatisticsCounters();
|
ResetDebugStatisticsCounters();
|
||||||
deltaCount = 0;
|
deltaCount = 0;
|
||||||
}
|
}
|
||||||
sprintf(stmp, "Current Cycle Count: %10llu (+%llu)", totalCount, deltaCount);
|
snprintf(stmp, sizeof(stmp), "Current Cycle Count: %10llu (+%llu)", totalCount, deltaCount);
|
||||||
currLbl->setText( tr(stmp) );
|
currLbl->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8195,7 +8195,7 @@ void DebugBreakOnDialog::setThreshold( unsigned long long int val )
|
||||||
|
|
||||||
threshold = val;
|
threshold = val;
|
||||||
|
|
||||||
sprintf( stmp, "%llu", threshold );
|
snprintf( stmp, sizeof(stmp), "%llu", threshold );
|
||||||
|
|
||||||
countEntryBox->setText( tr(stmp) );
|
countEntryBox->setText( tr(stmp) );
|
||||||
|
|
||||||
|
@ -8229,11 +8229,11 @@ void DebugBreakOnDialog::updateLabel(void)
|
||||||
|
|
||||||
if ( delta > 0 )
|
if ( delta > 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Will break in %lli CPU Instruction%s", delta, (delta > 1) ? "s":"" );
|
snprintf( stmp, sizeof(stmp), "Will break in %lli CPU Instruction%s", delta, (delta > 1) ? "s":"" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Will break immediately, CPU instruction count already exceeds value by %lli.", -delta);
|
snprintf( stmp, sizeof(stmp), "Will break immediately, CPU instruction count already exceeds value by %lli.", -delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -8242,11 +8242,11 @@ void DebugBreakOnDialog::updateLabel(void)
|
||||||
|
|
||||||
if ( delta > 0 )
|
if ( delta > 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Will break in %lli CPU Instruction%s", delta, (delta > 1) ? "s":"" );
|
snprintf( stmp, sizeof(stmp), "Will break in %lli CPU Instruction%s", delta, (delta > 1) ? "s":"" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Will break immediately, CPU instruction count already exceeds value by %lli.", -delta);
|
snprintf( stmp, sizeof(stmp), "Will break immediately, CPU instruction count already exceeds value by %lli.", -delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8258,11 +8258,11 @@ void DebugBreakOnDialog::updateLabel(void)
|
||||||
|
|
||||||
if ( delta > 0 )
|
if ( delta > 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Will break in %lli CPU cycle%s", delta, (delta > 1) ? "s":"" );
|
snprintf( stmp, sizeof(stmp), "Will break in %lli CPU cycle%s", delta, (delta > 1) ? "s":"" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Will break immediately, CPU cycle count already exceeds value by %lli.", -delta);
|
snprintf( stmp, sizeof(stmp), "Will break immediately, CPU cycle count already exceeds value by %lli.", -delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -8271,11 +8271,11 @@ void DebugBreakOnDialog::updateLabel(void)
|
||||||
|
|
||||||
if ( delta > 0 )
|
if ( delta > 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Will break in %lli CPU cycle%s", delta, (delta > 1) ? "s":"" );
|
snprintf( stmp, sizeof(stmp), "Will break in %lli CPU cycle%s", delta, (delta > 1) ? "s":"" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Will break immediately, CPU cycle count already exceeds value %lli.", -delta);
|
snprintf( stmp, sizeof(stmp), "Will break immediately, CPU cycle count already exceeds value %lli.", -delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -332,7 +332,7 @@ void ConsoleSndConfDialog_t::periodicUpdate(void)
|
||||||
|
|
||||||
bufUsage->setValue( (int)(percBufUse) );
|
bufUsage->setValue( (int)(percBufUse) );
|
||||||
|
|
||||||
sprintf( stmp, "Sink Starve Count: %u", nes_shm->sndBuf.starveCounter );
|
snprintf( stmp, sizeof(stmp), "Sink Starve Count: %u", nes_shm->sndBuf.starveCounter );
|
||||||
|
|
||||||
starveLbl->setText( tr(stmp) );
|
starveLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ void ConsoleSndConfDialog_t::setSliderFromProperty(QSlider *slider, QLabel *lbl,
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
g_config->getOption(property, &pval);
|
g_config->getOption(property, &pval);
|
||||||
slider->setValue(pval);
|
slider->setValue(pval);
|
||||||
sprintf(stmp, "%i", pval);
|
snprintf(stmp, sizeof(stmp), "%i", pval);
|
||||||
lbl->setText(stmp);
|
lbl->setText(stmp);
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
@ -404,7 +404,7 @@ void ConsoleSndConfDialog_t::bufSizeChanged(int value)
|
||||||
{
|
{
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
|
|
||||||
sprintf(stmp, "%i", value);
|
snprintf(stmp, sizeof(stmp), "%i", value);
|
||||||
|
|
||||||
bufSizeLabel->setText(stmp);
|
bufSizeLabel->setText(stmp);
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ void ConsoleSndConfDialog_t::volumeChanged(int value)
|
||||||
{
|
{
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
|
|
||||||
sprintf(stmp, "%i", value);
|
snprintf(stmp, sizeof(stmp), "%i", value);
|
||||||
|
|
||||||
volLbl->setText(stmp);
|
volLbl->setText(stmp);
|
||||||
|
|
||||||
|
@ -439,7 +439,7 @@ void ConsoleSndConfDialog_t::triangleChanged(int value)
|
||||||
{
|
{
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
|
|
||||||
sprintf(stmp, "%i", value);
|
snprintf(stmp, sizeof(stmp), "%i", value);
|
||||||
|
|
||||||
triLbl->setText(stmp);
|
triLbl->setText(stmp);
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ void ConsoleSndConfDialog_t::square1Changed(int value)
|
||||||
{
|
{
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
|
|
||||||
sprintf(stmp, "%i", value);
|
snprintf(stmp, sizeof(stmp), "%i", value);
|
||||||
|
|
||||||
sqr1Lbl->setText(stmp);
|
sqr1Lbl->setText(stmp);
|
||||||
|
|
||||||
|
@ -473,7 +473,7 @@ void ConsoleSndConfDialog_t::square2Changed(int value)
|
||||||
{
|
{
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
|
|
||||||
sprintf(stmp, "%i", value);
|
snprintf(stmp, sizeof(stmp), "%i", value);
|
||||||
|
|
||||||
sqr2Lbl->setText(stmp);
|
sqr2Lbl->setText(stmp);
|
||||||
|
|
||||||
|
@ -490,7 +490,7 @@ void ConsoleSndConfDialog_t::noiseChanged(int value)
|
||||||
{
|
{
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
|
|
||||||
sprintf(stmp, "%i", value);
|
snprintf(stmp, sizeof(stmp), "%i", value);
|
||||||
|
|
||||||
nseLbl->setText(stmp);
|
nseLbl->setText(stmp);
|
||||||
|
|
||||||
|
@ -507,7 +507,7 @@ void ConsoleSndConfDialog_t::pcmChanged(int value)
|
||||||
{
|
{
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
|
|
||||||
sprintf(stmp, "%i", value);
|
snprintf(stmp, sizeof(stmp), "%i", value);
|
||||||
|
|
||||||
pcmLbl->setText(stmp);
|
pcmLbl->setText(stmp);
|
||||||
|
|
||||||
|
|
|
@ -1339,7 +1339,7 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
|
||||||
|
|
||||||
for (int i=0; i<size; i++)
|
for (int i=0; i<size; i++)
|
||||||
{
|
{
|
||||||
sprintf(stmp, "$%02X ", opcode[i] );
|
snprintf(stmp, sizeof(stmp), "$%02X ", opcode[i] );
|
||||||
|
|
||||||
text.append( stmp );
|
text.append( stmp );
|
||||||
}
|
}
|
||||||
|
@ -1347,7 +1347,7 @@ QString fceuGetOpcodeToolTip( uint8_t *opcode, int size )
|
||||||
text.append( addrMode );
|
text.append( addrMode );
|
||||||
|
|
||||||
text.append( "\nCycle Count:\t\t" );
|
text.append( "\nCycle Count:\t\t" );
|
||||||
sprintf( stmp, "%i", X6502_GetOpcodeCycles( opcode[0] ) );
|
snprintf( stmp, sizeof(stmp), "%i", X6502_GetOpcodeCycles( opcode[0] ) );
|
||||||
text.append( stmp );
|
text.append( stmp );
|
||||||
text.append( "\n" );
|
text.append( "\n" );
|
||||||
|
|
||||||
|
|
|
@ -518,7 +518,7 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
|
||||||
scrRateReadout->setFont( font );
|
scrRateReadout->setFont( font );
|
||||||
scrRateReadout->setReadOnly(true);
|
scrRateReadout->setReadOnly(true);
|
||||||
scrRateReadout->setAlignment(Qt::AlignCenter);
|
scrRateReadout->setAlignment(Qt::AlignCenter);
|
||||||
sprintf( stmp, "%.3f", consoleWindow->getRefreshRate() );
|
snprintf( stmp, sizeof(stmp), "%.3f", consoleWindow->getRefreshRate() );
|
||||||
scrRateReadout->setText( tr(stmp) );
|
scrRateReadout->setText( tr(stmp) );
|
||||||
|
|
||||||
hbox->addWidget( new QLabel( tr("Refresh Rate (Hz):") ) );
|
hbox->addWidget( new QLabel( tr("Refresh Rate (Hz):") ) );
|
||||||
|
@ -606,11 +606,11 @@ void ConsoleVideoConfDialog_t::updateReadouts(void)
|
||||||
v = consoleWindow->viewport_Interface->size();
|
v = consoleWindow->viewport_Interface->size();
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( stmp, "%i x %i ", w.width(), w.height() );
|
snprintf( stmp, sizeof(stmp), "%i x %i ", w.width(), w.height() );
|
||||||
|
|
||||||
winSizeReadout->setText( tr(stmp) );
|
winSizeReadout->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "%i x %i ", v.width(), v.height() );
|
snprintf( stmp, sizeof(stmp), "%i x %i ", v.width(), v.height() );
|
||||||
|
|
||||||
vpSizeReadout->setText( tr(stmp) );
|
vpSizeReadout->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1038,7 +1038,7 @@ void consoleWin_t::createMainMenu(void)
|
||||||
{
|
{
|
||||||
char stmp[8];
|
char stmp[8];
|
||||||
|
|
||||||
sprintf( stmp, "Slot &%i", i );
|
snprintf( stmp, sizeof(stmp), "Slot &%i", i );
|
||||||
|
|
||||||
state[i] = new QAction(tr(stmp), this);
|
state[i] = new QAction(tr(stmp), this);
|
||||||
state[i]->setCheckable(true);
|
state[i]->setCheckable(true);
|
||||||
|
@ -1254,7 +1254,7 @@ void consoleWin_t::createMainMenu(void)
|
||||||
{
|
{
|
||||||
char stmp[8];
|
char stmp[8];
|
||||||
|
|
||||||
sprintf( stmp, "&%ix", i+1 );
|
snprintf( stmp, sizeof(stmp), "&%ix", i+1 );
|
||||||
|
|
||||||
winSizeAct[i] = new QAction(tr(stmp), this);
|
winSizeAct[i] = new QAction(tr(stmp), this);
|
||||||
|
|
||||||
|
@ -1629,7 +1629,7 @@ void consoleWin_t::createMainMenu(void)
|
||||||
|
|
||||||
for (int j=1; j<=(6-i); j++)
|
for (int j=1; j<=(6-i); j++)
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%i On, %i Off", i, j );
|
snprintf( stmp, sizeof(stmp), "%i On, %i Off", i, j );
|
||||||
autoFireMenuAction *afAct = new autoFireMenuAction( i, j, tr(stmp), this);
|
autoFireMenuAction *afAct = new autoFireMenuAction( i, j, tr(stmp), this);
|
||||||
afAct->setCheckable(true);
|
afAct->setCheckable(true);
|
||||||
group->addAction(afAct);
|
group->addAction(afAct);
|
||||||
|
@ -2217,7 +2217,7 @@ void consoleWin_t::buildRecentRomMenu(void)
|
||||||
|
|
||||||
for (int i=0; i<10; i++)
|
for (int i=0; i<10; i++)
|
||||||
{
|
{
|
||||||
sprintf(buf, "SDL.RecentRom%02i", i);
|
snprintf(buf, sizeof(buf), "SDL.RecentRom%02i", i);
|
||||||
|
|
||||||
g_config->getOption( buf, &s);
|
g_config->getOption( buf, &s);
|
||||||
|
|
||||||
|
@ -2270,7 +2270,7 @@ void consoleWin_t::saveRecentRomMenu(void)
|
||||||
for (it=romList.begin(); it != romList.end(); it++)
|
for (it=romList.begin(); it != romList.end(); it++)
|
||||||
{
|
{
|
||||||
s = *it;
|
s = *it;
|
||||||
sprintf(buf, "SDL.RecentRom%02i", i);
|
snprintf(buf, sizeof(buf), "SDL.RecentRom%02i", i);
|
||||||
|
|
||||||
g_config->setOption( buf, *s );
|
g_config->setOption( buf, *s );
|
||||||
|
|
||||||
|
@ -2279,7 +2279,7 @@ void consoleWin_t::saveRecentRomMenu(void)
|
||||||
}
|
}
|
||||||
for (i = romList.size(); i < 10; i++)
|
for (i = romList.size(); i < 10; i++)
|
||||||
{
|
{
|
||||||
sprintf(buf, "SDL.RecentRom%02i", i);
|
snprintf(buf, sizeof(buf), "SDL.RecentRom%02i", i);
|
||||||
g_config->setOption( buf, "");
|
g_config->setOption( buf, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2290,7 +2290,7 @@ void consoleWin_t::clearRecentRomMenu()
|
||||||
char buf[128];
|
char buf[128];
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
sprintf(buf, "SDL.RecentRom%02i", i);
|
snprintf(buf, sizeof(buf), "SDL.RecentRom%02i", i);
|
||||||
g_config->setOption( buf, "");
|
g_config->setOption( buf, "");
|
||||||
}
|
}
|
||||||
clearRomList();
|
clearRomList();
|
||||||
|
@ -3476,7 +3476,7 @@ void consoleWin_t::warnAmbiguousShortcut( QShortcut *shortcut)
|
||||||
std::string msg;
|
std::string msg;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
|
|
||||||
sprintf( stmp, "Error: Ambiguous Shortcut Activation for Key Sequence: '%s'\n", shortcut->key().toString().toLocal8Bit().constData() );
|
snprintf( stmp, sizeof(stmp), "Error: Ambiguous Shortcut Activation for Key Sequence: '%s'\n", shortcut->key().toString().toLocal8Bit().constData() );
|
||||||
|
|
||||||
msg.assign( stmp );
|
msg.assign( stmp );
|
||||||
|
|
||||||
|
|
|
@ -616,11 +616,11 @@ FKBConfigDialog::FKBConfigDialog(QWidget *parent)
|
||||||
|
|
||||||
if ( strcmp( keyNames[j], keyNames[j+1] ) == 0 )
|
if ( strcmp( keyNames[j], keyNames[j+1] ) == 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, " %s ", keyNames[j] );
|
snprintf( stmp, sizeof(stmp), " %s ", keyNames[j] );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, " %s - %s ", keyNames[j], keyNames[j+1] );
|
snprintf( stmp, sizeof(stmp), " %s - %s ", keyNames[j], keyNames[j+1] );
|
||||||
}
|
}
|
||||||
|
|
||||||
item->setText(0, tr(stmp) );
|
item->setText(0, tr(stmp) );
|
||||||
|
@ -1331,26 +1331,26 @@ void FKBConfigDialog::mappingSave(void)
|
||||||
}
|
}
|
||||||
stmp[k] = 0;
|
stmp[k] = 0;
|
||||||
|
|
||||||
//sprintf(stmp, "k%s", SDL_GetKeyName(bmap[c][i].ButtonNum));
|
//snprintf(stmp, sizeof(stmp), "k%s", SDL_GetKeyName(bmap[c][i].ButtonNum));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fkbmap[i].ButtonNum & 0x2000)
|
if (fkbmap[i].ButtonNum & 0x2000)
|
||||||
{
|
{
|
||||||
/* Hat "button" */
|
/* Hat "button" */
|
||||||
sprintf(stmp, "h%i.%i",
|
snprintf(stmp, sizeof(stmp), "h%i.%i",
|
||||||
(fkbmap[i].ButtonNum >> 8) & 0x1F, fkbmap[i].ButtonNum & 0xFF);
|
(fkbmap[i].ButtonNum >> 8) & 0x1F, fkbmap[i].ButtonNum & 0xFF);
|
||||||
}
|
}
|
||||||
else if (fkbmap[i].ButtonNum & 0x8000)
|
else if (fkbmap[i].ButtonNum & 0x8000)
|
||||||
{
|
{
|
||||||
/* Axis "button" */
|
/* Axis "button" */
|
||||||
sprintf(stmp, "%ca%i",
|
snprintf(stmp, sizeof(stmp), "%ca%i",
|
||||||
(fkbmap[i].ButtonNum & 0x4000) ? '-' : '+', fkbmap[i].ButtonNum & 0x3FFF);
|
(fkbmap[i].ButtonNum & 0x4000) ? '-' : '+', fkbmap[i].ButtonNum & 0x3FFF);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Button */
|
/* Button */
|
||||||
sprintf(stmp, "b%i", fkbmap[i].ButtonNum);
|
snprintf(stmp, sizeof(stmp), "b%i", fkbmap[i].ButtonNum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf( fp, "%s=%s\n", FamilyKeyBoardNames[i], stmp );
|
fprintf( fp, "%s=%s\n", FamilyKeyBoardNames[i], stmp );
|
||||||
|
@ -1462,7 +1462,7 @@ FKBKeyMapDialog::FKBKeyMapDialog( int idx, QWidget *parent )
|
||||||
|
|
||||||
setLayout( mainLayout );
|
setLayout( mainLayout );
|
||||||
|
|
||||||
sprintf( stmp, "Press a key to set new physical mapping for the '%s' Key", keyNames[idx*2] );
|
snprintf( stmp, sizeof(stmp), "Press a key to set new physical mapping for the '%s' Key", keyNames[idx*2] );
|
||||||
|
|
||||||
msgLbl = new QLabel( tr(stmp) );
|
msgLbl = new QLabel( tr(stmp) );
|
||||||
|
|
||||||
|
|
|
@ -209,111 +209,111 @@ void FrameTimingDialog_t::updateTimingStats(void)
|
||||||
getFrameTimingStats(&stats);
|
getFrameTimingStats(&stats);
|
||||||
|
|
||||||
// Absolute
|
// Absolute
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeAbs.tgt * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeAbs.tgt * 1e3);
|
||||||
frameTimeAbs->setText(1, tr(stmp));
|
frameTimeAbs->setText(1, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeAbs.cur * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeAbs.cur * 1e3);
|
||||||
frameTimeAbs->setText(2, tr(stmp));
|
frameTimeAbs->setText(2, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeAbs.min * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeAbs.min * 1e3);
|
||||||
frameTimeAbs->setText(3, tr(stmp));
|
frameTimeAbs->setText(3, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeAbs.max * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeAbs.max * 1e3);
|
||||||
frameTimeAbs->setText(4, tr(stmp));
|
frameTimeAbs->setText(4, tr(stmp));
|
||||||
|
|
||||||
// Delta
|
// Delta
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeDel.tgt * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeDel.tgt * 1e3);
|
||||||
frameTimeDel->setText(1, tr(stmp));
|
frameTimeDel->setText(1, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeDel.cur * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeDel.cur * 1e3);
|
||||||
frameTimeDel->setText(2, tr(stmp));
|
frameTimeDel->setText(2, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeDel.min * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeDel.min * 1e3);
|
||||||
frameTimeDel->setText(3, tr(stmp));
|
frameTimeDel->setText(3, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeDel.max * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeDel.max * 1e3);
|
||||||
frameTimeDel->setText(4, tr(stmp));
|
frameTimeDel->setText(4, tr(stmp));
|
||||||
|
|
||||||
// Work
|
// Work
|
||||||
sprintf(stmp, "lt %.3f", stats.frameTimeWork.tgt * 1e3);
|
snprintf(stmp, sizeof(stmp), "lt %.3f", stats.frameTimeWork.tgt * 1e3);
|
||||||
frameTimeWork->setText(1, tr(stmp));
|
frameTimeWork->setText(1, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeWork.cur * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeWork.cur * 1e3);
|
||||||
frameTimeWork->setText(2, tr(stmp));
|
frameTimeWork->setText(2, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeWork.min * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeWork.min * 1e3);
|
||||||
frameTimeWork->setText(3, tr(stmp));
|
frameTimeWork->setText(3, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeWork.max * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeWork.max * 1e3);
|
||||||
frameTimeWork->setText(4, tr(stmp));
|
frameTimeWork->setText(4, tr(stmp));
|
||||||
|
|
||||||
// Idle
|
// Idle
|
||||||
sprintf(stmp, "gt %.3f", stats.frameTimeIdle.tgt * 1e3);
|
snprintf(stmp, sizeof(stmp), "gt %.3f", stats.frameTimeIdle.tgt * 1e3);
|
||||||
frameTimeIdle->setText(1, tr(stmp));
|
frameTimeIdle->setText(1, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeIdle.cur * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeIdle.cur * 1e3);
|
||||||
frameTimeIdle->setText(2, tr(stmp));
|
frameTimeIdle->setText(2, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeIdle.min * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeIdle.min * 1e3);
|
||||||
frameTimeIdle->setText(3, tr(stmp));
|
frameTimeIdle->setText(3, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.frameTimeIdle.max * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.frameTimeIdle.max * 1e3);
|
||||||
frameTimeIdle->setText(4, tr(stmp));
|
frameTimeIdle->setText(4, tr(stmp));
|
||||||
|
|
||||||
// Work %
|
// Work %
|
||||||
sprintf(stmp, "lt %.1f", 100.0 * stats.frameTimeWork.tgt / stats.frameTimeAbs.tgt);
|
snprintf(stmp, sizeof(stmp), "lt %.1f", 100.0 * stats.frameTimeWork.tgt / stats.frameTimeAbs.tgt);
|
||||||
frameTimeWorkPct->setText(1, tr(stmp));
|
frameTimeWorkPct->setText(1, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.1f", 100.0 * stats.frameTimeWork.cur / stats.frameTimeAbs.tgt);
|
snprintf(stmp, sizeof(stmp), "%.1f", 100.0 * stats.frameTimeWork.cur / stats.frameTimeAbs.tgt);
|
||||||
frameTimeWorkPct->setText(2, tr(stmp));
|
frameTimeWorkPct->setText(2, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.1f", 100.0 * stats.frameTimeWork.min / stats.frameTimeAbs.tgt);
|
snprintf(stmp, sizeof(stmp), "%.1f", 100.0 * stats.frameTimeWork.min / stats.frameTimeAbs.tgt);
|
||||||
frameTimeWorkPct->setText(3, tr(stmp));
|
frameTimeWorkPct->setText(3, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.1f", 100.0 * stats.frameTimeWork.max / stats.frameTimeAbs.tgt);
|
snprintf(stmp, sizeof(stmp), "%.1f", 100.0 * stats.frameTimeWork.max / stats.frameTimeAbs.tgt);
|
||||||
frameTimeWorkPct->setText(4, tr(stmp));
|
frameTimeWorkPct->setText(4, tr(stmp));
|
||||||
|
|
||||||
// Idle %
|
// Idle %
|
||||||
sprintf(stmp, "gt %.1f", 100.0 * stats.frameTimeIdle.tgt / stats.frameTimeAbs.tgt);
|
snprintf(stmp, sizeof(stmp), "gt %.1f", 100.0 * stats.frameTimeIdle.tgt / stats.frameTimeAbs.tgt);
|
||||||
frameTimeIdlePct->setText(1, tr(stmp));
|
frameTimeIdlePct->setText(1, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.1f", 100.0 * stats.frameTimeIdle.cur / stats.frameTimeAbs.tgt);
|
snprintf(stmp, sizeof(stmp), "%.1f", 100.0 * stats.frameTimeIdle.cur / stats.frameTimeAbs.tgt);
|
||||||
frameTimeIdlePct->setText(2, tr(stmp));
|
frameTimeIdlePct->setText(2, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.1f", 100.0 * stats.frameTimeIdle.min / stats.frameTimeAbs.tgt);
|
snprintf(stmp, sizeof(stmp), "%.1f", 100.0 * stats.frameTimeIdle.min / stats.frameTimeAbs.tgt);
|
||||||
frameTimeIdlePct->setText(3, tr(stmp));
|
frameTimeIdlePct->setText(3, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.1f", 100.0 * stats.frameTimeIdle.max / stats.frameTimeAbs.tgt);
|
snprintf(stmp, sizeof(stmp), "%.1f", 100.0 * stats.frameTimeIdle.max / stats.frameTimeAbs.tgt);
|
||||||
frameTimeIdlePct->setText(4, tr(stmp));
|
frameTimeIdlePct->setText(4, tr(stmp));
|
||||||
|
|
||||||
// Video
|
// Video
|
||||||
sprintf(stmp, "%.3f", stats.videoTimeDel.tgt * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.videoTimeDel.tgt * 1e3);
|
||||||
videoTimeAbs->setText(1, tr(stmp));
|
videoTimeAbs->setText(1, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.videoTimeDel.cur * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.videoTimeDel.cur * 1e3);
|
||||||
videoTimeAbs->setText(2, tr(stmp));
|
videoTimeAbs->setText(2, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.videoTimeDel.min * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.videoTimeDel.min * 1e3);
|
||||||
videoTimeAbs->setText(3, tr(stmp));
|
videoTimeAbs->setText(3, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.videoTimeDel.max * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.videoTimeDel.max * 1e3);
|
||||||
videoTimeAbs->setText(4, tr(stmp));
|
videoTimeAbs->setText(4, tr(stmp));
|
||||||
|
|
||||||
// Emulator to GUI Thread Signal Delay
|
// Emulator to GUI Thread Signal Delay
|
||||||
sprintf(stmp, "%.3f", stats.emuSignalDelay.tgt * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.emuSignalDelay.tgt * 1e3);
|
||||||
emuSignalDelay->setText(1, tr(stmp));
|
emuSignalDelay->setText(1, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.emuSignalDelay.cur * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.emuSignalDelay.cur * 1e3);
|
||||||
emuSignalDelay->setText(2, tr(stmp));
|
emuSignalDelay->setText(2, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.emuSignalDelay.min * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.emuSignalDelay.min * 1e3);
|
||||||
emuSignalDelay->setText(3, tr(stmp));
|
emuSignalDelay->setText(3, tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%.3f", stats.emuSignalDelay.max * 1e3);
|
snprintf(stmp, sizeof(stmp), "%.3f", stats.emuSignalDelay.max * 1e3);
|
||||||
emuSignalDelay->setText(4, tr(stmp));
|
emuSignalDelay->setText(4, tr(stmp));
|
||||||
|
|
||||||
// Late Count
|
// Late Count
|
||||||
sprintf(stmp, "%u", stats.lateCount);
|
snprintf(stmp, sizeof(stmp), "%u", stats.lateCount);
|
||||||
frameLateCount->setText(1, tr("0"));
|
frameLateCount->setText(1, tr("0"));
|
||||||
frameLateCount->setText(2, tr(stmp));
|
frameLateCount->setText(2, tr(stmp));
|
||||||
|
|
||||||
|
|
|
@ -368,7 +368,7 @@ void GameGenieDialog_t::ggChanged(const QString &s)
|
||||||
|
|
||||||
if ( a >= 0 )
|
if ( a >= 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%04X", a );
|
snprintf( stmp, sizeof(stmp), "%04X", a );
|
||||||
|
|
||||||
addr->setText( tr(stmp) );
|
addr->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
|
@ -379,7 +379,7 @@ void GameGenieDialog_t::ggChanged(const QString &s)
|
||||||
|
|
||||||
if ( v >= 0 )
|
if ( v >= 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%02X", v );
|
snprintf( stmp, sizeof(stmp), "%02X", v );
|
||||||
|
|
||||||
val->setText( tr(stmp) );
|
val->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
|
@ -390,7 +390,7 @@ void GameGenieDialog_t::ggChanged(const QString &s)
|
||||||
|
|
||||||
if ( c >= 0 )
|
if ( c >= 0 )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%02X", c );
|
snprintf( stmp, sizeof(stmp), "%02X", c );
|
||||||
|
|
||||||
cmp->setText( tr(stmp) );
|
cmp->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
|
@ -467,7 +467,7 @@ void GameGenieDialog_t::ListGGAddresses(void)
|
||||||
{
|
{
|
||||||
item = new QTreeWidgetItem();
|
item = new QTreeWidgetItem();
|
||||||
|
|
||||||
sprintf(str, "%06X", i + (a & 0x1FFF) + 0x10);
|
snprintf(str, sizeof(str), "%06X", i + (a & 0x1FFF) + 0x10);
|
||||||
|
|
||||||
//printf("Added ROM ADDR: %s\n", str );
|
//printf("Added ROM ADDR: %s\n", str );
|
||||||
item->setText( 0, tr(str) );
|
item->setText( 0, tr(str) );
|
||||||
|
|
|
@ -215,7 +215,7 @@ GamePadConfDialog_t::GamePadConfDialog_t(QWidget *parent)
|
||||||
{
|
{
|
||||||
if (js->isConnected())
|
if (js->isConnected())
|
||||||
{
|
{
|
||||||
sprintf(stmp, "%i: %s", i, js->getName());
|
snprintf(stmp, sizeof(stmp), "%i: %s", i, js->getName());
|
||||||
devSel->addItem(tr(stmp), i);
|
devSel->addItem(tr(stmp), i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,7 +328,7 @@ GamePadConfDialog_t::GamePadConfDialog_t(QWidget *parent)
|
||||||
char text[64];
|
char text[64];
|
||||||
QLabel *buttonName;
|
QLabel *buttonName;
|
||||||
|
|
||||||
sprintf(text, "%s:", GamePadNames[i]);
|
snprintf(text, sizeof(text), "%s:", GamePadNames[i]);
|
||||||
|
|
||||||
//hbox2 = new QHBoxLayout();
|
//hbox2 = new QHBoxLayout();
|
||||||
|
|
||||||
|
@ -506,7 +506,7 @@ GamePadConfDialog_t::GamePadConfDialog_t(QWidget *parent)
|
||||||
|
|
||||||
for (int i = 0; i < GAMEPAD_NUM_DEVICES; i++)
|
for (int i = 0; i < GAMEPAD_NUM_DEVICES; i++)
|
||||||
{
|
{
|
||||||
sprintf(stmp, "SDL.Input.GamePad.%i.", i);
|
snprintf(stmp, sizeof(stmp), "SDL.Input.GamePad.%i.", i);
|
||||||
prefix = stmp;
|
prefix = stmp;
|
||||||
|
|
||||||
g_config->getOption(prefix + "Profile", &lcl[i].profile);
|
g_config->getOption(prefix + "Profile", &lcl[i].profile);
|
||||||
|
@ -595,7 +595,7 @@ void GamePadConfDialog_t::loadMapList(void)
|
||||||
|
|
||||||
fileList = dir.entryList(filters, QDir::Files, QDir::NoSort);
|
fileList = dir.entryList(filters, QDir::Files, QDir::NoSort);
|
||||||
|
|
||||||
sprintf(stmp, "SDL.Input.GamePad.%u.", portNum);
|
snprintf(stmp, sizeof(stmp), "SDL.Input.GamePad.%u.", portNum);
|
||||||
prefix = stmp;
|
prefix = stmp;
|
||||||
|
|
||||||
g_config->getOption(prefix + "Profile", &mapName);
|
g_config->getOption(prefix + "Profile", &mapName);
|
||||||
|
@ -880,7 +880,7 @@ void GamePadConfDialog_t::changeButton(int padNo, int x)
|
||||||
( strcmp( js1->getGUID(), js2->getGUID() ) != 0 ) )
|
( strcmp( js1->getGUID(), js2->getGUID() ) != 0 ) )
|
||||||
{
|
{
|
||||||
char stmp[256];
|
char stmp[256];
|
||||||
sprintf( stmp, "Joystick device GUID MisMatch\n\nSelected device is: \n\t%s\n\nbut button mapping is from: \n\t%s",
|
snprintf( stmp, sizeof(stmp), "Joystick device GUID MisMatch\n\nSelected device is: \n\t%s\n\nbut button mapping is from: \n\t%s",
|
||||||
js1->getName(), js2->getName() );
|
js1->getName(), js2->getName() );
|
||||||
QMessageBox::warning( this, tr("Mapping Error"), tr(stmp),
|
QMessageBox::warning( this, tr("Mapping Error"), tr(stmp),
|
||||||
QMessageBox::Cancel, QMessageBox::Cancel );
|
QMessageBox::Cancel, QMessageBox::Cancel );
|
||||||
|
@ -1100,7 +1100,7 @@ void GamePadConfDialog_t::saveConfig(void)
|
||||||
const char *guid;
|
const char *guid;
|
||||||
std::string prefix, mapName;
|
std::string prefix, mapName;
|
||||||
|
|
||||||
sprintf(stmp, "SDL.Input.GamePad.%u.", portNum);
|
snprintf(stmp, sizeof(stmp), "SDL.Input.GamePad.%u.", portNum);
|
||||||
prefix = stmp;
|
prefix = stmp;
|
||||||
|
|
||||||
mapName = mapSel->currentText().toLocal8Bit().constData();
|
mapName = mapSel->currentText().toLocal8Bit().constData();
|
||||||
|
@ -1134,7 +1134,7 @@ void GamePadConfDialog_t::createNewProfile(const char *name)
|
||||||
mapSel->setCurrentIndex(mapSel->count() - 1);
|
mapSel->setCurrentIndex(mapSel->count() - 1);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
|
|
||||||
sprintf(stmp, "Mapping Created: %s/%s \n", GamePad[portNum].getGUID(), name);
|
snprintf(stmp, sizeof(stmp), "Mapping Created: %s/%s \n", GamePad[portNum].getGUID(), name);
|
||||||
mapMsg->setText(tr(stmp));
|
mapMsg->setText(tr(stmp));
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
@ -1180,11 +1180,11 @@ void GamePadConfDialog_t::loadProfileCallback(void)
|
||||||
{
|
{
|
||||||
saveConfig();
|
saveConfig();
|
||||||
|
|
||||||
sprintf(stmp, "Mapping Loaded: %s/%s \n", GamePad[portNum].getGUID(), mapName.c_str());
|
snprintf(stmp, sizeof(stmp), "Mapping Loaded: %s/%s \n", GamePad[portNum].getGUID(), mapName.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(stmp, "Error: Failed to Load Mapping: %s/%s \n", GamePad[portNum].getGUID(), mapName.c_str());
|
snprintf(stmp, sizeof(stmp), "Error: Failed to Load Mapping: %s/%s \n", GamePad[portNum].getGUID(), mapName.c_str());
|
||||||
}
|
}
|
||||||
mapMsg->setText(tr(stmp));
|
mapMsg->setText(tr(stmp));
|
||||||
|
|
||||||
|
@ -1207,11 +1207,11 @@ void GamePadConfDialog_t::saveProfileCallback(void)
|
||||||
{
|
{
|
||||||
saveConfig();
|
saveConfig();
|
||||||
|
|
||||||
sprintf(stmp, "Mapping Saved: %s/%s \n", GamePad[portNum].getGUID(), mapName.c_str());
|
snprintf(stmp, sizeof(stmp), "Mapping Saved: %s/%s \n", GamePad[portNum].getGUID(), mapName.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(stmp, "Error: Failed to Save Mapping: %s \n", mapName.c_str());
|
snprintf(stmp, sizeof(stmp), "Error: Failed to Save Mapping: %s \n", mapName.c_str());
|
||||||
}
|
}
|
||||||
mapMsg->setText(tr(stmp));
|
mapMsg->setText(tr(stmp));
|
||||||
}
|
}
|
||||||
|
@ -1228,11 +1228,11 @@ void GamePadConfDialog_t::deleteProfileCallback(void)
|
||||||
|
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
{
|
{
|
||||||
sprintf(stmp, "Mapping Deleted: %s/%s \n", GamePad[portNum].getGUID(), mapName.c_str());
|
snprintf(stmp, sizeof(stmp), "Mapping Deleted: %s/%s \n", GamePad[portNum].getGUID(), mapName.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(stmp, "Error: Failed to Delete Mapping: %s \n", mapName.c_str());
|
snprintf(stmp, sizeof(stmp), "Error: Failed to Delete Mapping: %s \n", mapName.c_str());
|
||||||
}
|
}
|
||||||
mapMsg->setText(tr(stmp));
|
mapMsg->setText(tr(stmp));
|
||||||
|
|
||||||
|
@ -1269,7 +1269,7 @@ int GamePadConfDialog_t::promptToSave(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
sprintf(stmp, "Warning: Gamepad mappings have not been saved for port%c ", (n > 1) ? 's' : ' ');
|
snprintf(stmp, sizeof(stmp), "Warning: Gamepad mappings have not been saved for port%c ", (n > 1) ? 's' : ' ');
|
||||||
|
|
||||||
msg.assign(stmp);
|
msg.assign(stmp);
|
||||||
|
|
||||||
|
@ -1278,7 +1278,7 @@ int GamePadConfDialog_t::promptToSave(void)
|
||||||
{
|
{
|
||||||
if (padNeedsSave[i])
|
if (padNeedsSave[i])
|
||||||
{
|
{
|
||||||
sprintf(stmp, "%i", i + 1);
|
snprintf(stmp, sizeof(stmp), "%i", i + 1);
|
||||||
|
|
||||||
msg.append(stmp);
|
msg.append(stmp);
|
||||||
|
|
||||||
|
@ -1427,7 +1427,7 @@ void GamePadConfDialog_t::updatePeriodic(void)
|
||||||
{
|
{
|
||||||
char stmp[256];
|
char stmp[256];
|
||||||
//printf("Adding Newly Connected JS\n");
|
//printf("Adding Newly Connected JS\n");
|
||||||
sprintf(stmp, "%i: %s", i, js->getName());
|
snprintf(stmp, sizeof(stmp), "%i: %s", i, js->getName());
|
||||||
devSel->addItem(tr(stmp), i);
|
devSel->addItem(tr(stmp), i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1337,7 +1337,7 @@ void GuiPaletteColorSelect::setText(void)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sprintf( stmp, "%s :: %s", gTxt, rTxt );
|
snprintf( stmp, sizeof(stmp), "%s :: %s", gTxt, rTxt );
|
||||||
|
|
||||||
lbl->setText( tr(stmp) );
|
lbl->setText( tr(stmp) );
|
||||||
|
|
||||||
|
@ -1356,7 +1356,7 @@ void GuiPaletteColorSelect::updateColor(void)
|
||||||
{
|
{
|
||||||
txtColor.setRgb( 255, 255, 255 );
|
txtColor.setRgb( 255, 255, 255 );
|
||||||
}
|
}
|
||||||
sprintf( stmp, "QLabel { background-color : %s; color : %s; border-color : black; }",
|
snprintf( stmp, sizeof(stmp), "QLabel { background-color : %s; color : %s; border-color : black; }",
|
||||||
color.name().toLocal8Bit().constData(), txtColor.name().toLocal8Bit().constData() );
|
color.name().toLocal8Bit().constData(), txtColor.name().toLocal8Bit().constData() );
|
||||||
|
|
||||||
lbl->setStyleSheet( stmp );
|
lbl->setStyleSheet( stmp );
|
||||||
|
|
|
@ -865,7 +865,7 @@ int HexEditorCharTable_t::loadFromFile( const char *filepath )
|
||||||
|
|
||||||
if ( hexValue > 255 )
|
if ( hexValue > 255 )
|
||||||
{
|
{
|
||||||
sprintf( errMsg, "Error: Line %i: Hex Value 0x%X exceeds 0xFF \n", lineNum, hexValue );
|
snprintf( errMsg, sizeof(errMsg), "Error: Line %i: Hex Value 0x%X exceeds 0xFF \n", lineNum, hexValue );
|
||||||
retVal = -1;
|
retVal = -1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -874,7 +874,7 @@ int HexEditorCharTable_t::loadFromFile( const char *filepath )
|
||||||
|
|
||||||
if ( line[i] != '=' )
|
if ( line[i] != '=' )
|
||||||
{
|
{
|
||||||
sprintf( errMsg, "Error: Line %i: Expected assignment operator '=' but got '%c' \n", lineNum, line[i] );
|
snprintf( errMsg, sizeof(errMsg), "Error: Line %i: Expected assignment operator '=' but got '%c' \n", lineNum, line[i] );
|
||||||
retVal = -1;
|
retVal = -1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -929,7 +929,7 @@ int HexEditorCharTable_t::loadFromFile( const char *filepath )
|
||||||
|
|
||||||
if ( mapValue > 255 )
|
if ( mapValue > 255 )
|
||||||
{
|
{
|
||||||
sprintf( errMsg, "Error: Line %i: Map Value 0x%X exceeds 0xFF \n", lineNum, mapValue );
|
snprintf( errMsg, sizeof(errMsg), "Error: Line %i: Map Value 0x%X exceeds 0xFF \n", lineNum, mapValue );
|
||||||
retVal = -1;
|
retVal = -1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1519,7 +1519,7 @@ void HexEditorDialog_t::setWindowTitle(void)
|
||||||
|
|
||||||
modeString = memViewNames[ editor->getMode() ];
|
modeString = memViewNames[ editor->getMode() ];
|
||||||
|
|
||||||
sprintf( stmp, "Hex Editor - %s: 0x%04X", modeString, editor->getAddr() );
|
snprintf( stmp, sizeof(stmp), "Hex Editor - %s: 0x%04X", modeString, editor->getAddr() );
|
||||||
|
|
||||||
QDialog::setWindowTitle( tr(stmp) );
|
QDialog::setWindowTitle( tr(stmp) );
|
||||||
|
|
||||||
|
@ -2253,7 +2253,7 @@ void QHexEdit::openGotoAddrDialog(void)
|
||||||
QHBoxLayout *hbox;
|
QHBoxLayout *hbox;
|
||||||
QPushButton *okButton, *cancelButton;
|
QPushButton *okButton, *cancelButton;
|
||||||
|
|
||||||
sprintf( stmp, "Specify Address [ 0x0 -> 0x%X ]", mb.size()-1 );
|
snprintf( stmp, sizeof(stmp), "Specify Address [ 0x0 -> 0x%X ]", mb.size()-1 );
|
||||||
|
|
||||||
vbox = new QVBoxLayout();
|
vbox = new QVBoxLayout();
|
||||||
hbox = new QHBoxLayout();
|
hbox = new QHBoxLayout();
|
||||||
|
@ -2418,7 +2418,7 @@ void QHexEdit::loadHighlightToClipboard(void)
|
||||||
|
|
||||||
for (a=startAddr; a<=endAddr; a++)
|
for (a=startAddr; a<=endAddr; a++)
|
||||||
{
|
{
|
||||||
sprintf( c, "%02X ", memAccessFunc(a) );
|
snprintf( c, sizeof(c), "%02X ", memAccessFunc(a) );
|
||||||
|
|
||||||
s.append(c);
|
s.append(c);
|
||||||
}
|
}
|
||||||
|
@ -3145,17 +3145,17 @@ void QHexEdit::contextMenuEvent(QContextMenuEvent *event)
|
||||||
subMenu->addAction(act);
|
subMenu->addAction(act);
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamUnsetAll(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(frzRamUnsetAll(void)) );
|
||||||
|
|
||||||
sprintf( stmp, "Add &Read Breakpoint for Address $%04X", addr );
|
snprintf( stmp, sizeof(stmp), "Add &Read Breakpoint for Address $%04X", addr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
menu.addAction(act);
|
menu.addAction(act);
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(addRamReadBP(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(addRamReadBP(void)) );
|
||||||
|
|
||||||
sprintf( stmp, "Add &Write Breakpoint for Address $%04X", addr );
|
snprintf( stmp, sizeof(stmp), "Add &Write Breakpoint for Address $%04X", addr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
menu.addAction(act);
|
menu.addAction(act);
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(addRamWriteBP(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(addRamWriteBP(void)) );
|
||||||
|
|
||||||
sprintf( stmp, "Add &Execute Breakpoint for Address $%04X", addr );
|
snprintf( stmp, sizeof(stmp), "Add &Execute Breakpoint for Address $%04X", addr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
menu.addAction(act);
|
menu.addAction(act);
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(addRamExecuteBP(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(addRamExecuteBP(void)) );
|
||||||
|
@ -3167,7 +3167,7 @@ void QHexEdit::contextMenuEvent(QContextMenuEvent *event)
|
||||||
if ( romAddr >= 0 )
|
if ( romAddr >= 0 )
|
||||||
{
|
{
|
||||||
jumpToRomValue = romAddr;
|
jumpToRomValue = romAddr;
|
||||||
sprintf( stmp, "&Go Here in ROM File: (%08X)", romAddr );
|
snprintf( stmp, sizeof(stmp), "&Go Here in ROM File: (%08X)", romAddr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
menu.addAction(act);
|
menu.addAction(act);
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(jumpToROM(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(jumpToROM(void)) );
|
||||||
|
@ -3181,12 +3181,12 @@ void QHexEdit::contextMenuEvent(QContextMenuEvent *event)
|
||||||
break;
|
break;
|
||||||
case MODE_NES_PPU:
|
case MODE_NES_PPU:
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Add &Read Breakpoint for Address $%04X", addr );
|
snprintf( stmp, sizeof(stmp), "Add &Read Breakpoint for Address $%04X", addr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
menu.addAction(act);
|
menu.addAction(act);
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(addPpuReadBP(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(addPpuReadBP(void)) );
|
||||||
|
|
||||||
sprintf( stmp, "Add &Write Breakpoint for Address $%04X", addr );
|
snprintf( stmp, sizeof(stmp), "Add &Write Breakpoint for Address $%04X", addr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
menu.addAction(act);
|
menu.addAction(act);
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(addPpuWriteBP(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(addPpuWriteBP(void)) );
|
||||||
|
@ -3236,16 +3236,16 @@ void QHexEdit::addBookMarkCB(void)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case MODE_NES_RAM:
|
case MODE_NES_RAM:
|
||||||
sprintf( stmp, "CPU %04X", ctxAddr );
|
snprintf( stmp, sizeof(stmp), "CPU %04X", ctxAddr );
|
||||||
break;
|
break;
|
||||||
case MODE_NES_PPU:
|
case MODE_NES_PPU:
|
||||||
sprintf( stmp, "PPU %04X", ctxAddr );
|
snprintf( stmp, sizeof(stmp), "PPU %04X", ctxAddr );
|
||||||
break;
|
break;
|
||||||
case MODE_NES_OAM:
|
case MODE_NES_OAM:
|
||||||
sprintf( stmp, "OAM %04X", ctxAddr );
|
snprintf( stmp, sizeof(stmp), "OAM %04X", ctxAddr );
|
||||||
break;
|
break;
|
||||||
case MODE_NES_ROM:
|
case MODE_NES_ROM:
|
||||||
sprintf( stmp, "ROM %04X", ctxAddr );
|
snprintf( stmp, sizeof(stmp), "ROM %04X", ctxAddr );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3436,7 +3436,7 @@ void QHexEdit::addRamReadBP(void)
|
||||||
|
|
||||||
if ( ctxAddr >= 0x8000 )
|
if ( ctxAddr >= 0x8000 )
|
||||||
{
|
{
|
||||||
sprintf(cond, "K==#%02X", getBank(ctxAddr));
|
snprintf(cond, sizeof(cond), "K==#%02X", getBank(ctxAddr));
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = NewBreak( name, ctxAddr, -1, type, cond, numWPs, true);
|
retval = NewBreak( name, ctxAddr, -1, type, cond, numWPs, true);
|
||||||
|
@ -3463,7 +3463,7 @@ void QHexEdit::addRamWriteBP(void)
|
||||||
|
|
||||||
if ( ctxAddr >= 0x8000 )
|
if ( ctxAddr >= 0x8000 )
|
||||||
{
|
{
|
||||||
sprintf(cond, "K==#%02X", getBank(ctxAddr));
|
snprintf(cond, sizeof(cond), "K==#%02X", getBank(ctxAddr));
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = NewBreak( name, ctxAddr, -1, type, cond, numWPs, true);
|
retval = NewBreak( name, ctxAddr, -1, type, cond, numWPs, true);
|
||||||
|
@ -3490,7 +3490,7 @@ void QHexEdit::addRamExecuteBP(void)
|
||||||
|
|
||||||
if ( ctxAddr >= 0x8000 )
|
if ( ctxAddr >= 0x8000 )
|
||||||
{
|
{
|
||||||
sprintf(cond, "K==#%02X", getBank(ctxAddr));
|
snprintf(cond, sizeof(cond), "K==#%02X", getBank(ctxAddr));
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = NewBreak( name, ctxAddr, -1, type, cond, numWPs, true);
|
retval = NewBreak( name, ctxAddr, -1, type, cond, numWPs, true);
|
||||||
|
@ -3920,7 +3920,7 @@ void QHexEdit::paintEvent(QPaintEvent *event)
|
||||||
|
|
||||||
|
|
||||||
painter.setPen( fgColor );
|
painter.setPen( fgColor );
|
||||||
sprintf( txt, "%06X", addr );
|
snprintf( txt, sizeof(txt), "%06X", addr );
|
||||||
painter.drawText( x, y, tr(txt) );
|
painter.drawText( x, y, tr(txt) );
|
||||||
|
|
||||||
x = pxHexOffset - pxLineXScroll;
|
x = pxHexOffset - pxLineXScroll;
|
||||||
|
|
|
@ -181,7 +181,7 @@ InputConfDialog_t::InputConfDialog_t(QWidget *parent)
|
||||||
|
|
||||||
color = pal.color(QPalette::WindowText);
|
color = pal.color(QPalette::WindowText);
|
||||||
|
|
||||||
sprintf(stmp, "border: 2px solid #%02X%02X%02X", color.red(), color.green(), color.blue());
|
snprintf(stmp, sizeof(stmp), "border: 2px solid #%02X%02X%02X", color.red(), color.green(), color.blue());
|
||||||
|
|
||||||
//printf("%s\n", stmp);
|
//printf("%s\n", stmp);
|
||||||
nesPortLabel[0]->setAlignment(Qt::AlignCenter);
|
nesPortLabel[0]->setAlignment(Qt::AlignCenter);
|
||||||
|
|
|
@ -423,7 +423,7 @@ void LuaControlDialog_t::startLuaScript(void)
|
||||||
if (0 == FCEU_LoadLuaCode(scriptPath->text().toLocal8Bit().constData(), scriptArgs->text().toLocal8Bit().constData()))
|
if (0 == FCEU_LoadLuaCode(scriptPath->text().toLocal8Bit().constData(), scriptArgs->text().toLocal8Bit().constData()))
|
||||||
{
|
{
|
||||||
char error_msg[2048];
|
char error_msg[2048];
|
||||||
sprintf( error_msg, "Error: Could not open the selected lua script: '%s'\n", scriptPath->text().toLocal8Bit().constData());
|
snprintf( error_msg, sizeof(error_msg), "Error: Could not open the selected lua script: '%s'\n", scriptPath->text().toLocal8Bit().constData());
|
||||||
FCEUD_PrintError(error_msg);
|
FCEUD_PrintError(error_msg);
|
||||||
}
|
}
|
||||||
FCEU_WRAPPER_UNLOCK();
|
FCEU_WRAPPER_UNLOCK();
|
||||||
|
|
|
@ -247,7 +247,7 @@ void MoviePlayDialog_t::updateMovieText(void)
|
||||||
|
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
{
|
{
|
||||||
sprintf(stmp, "Error: Failed to open file '%s'", path.c_str());
|
snprintf(stmp, sizeof(stmp), "Error: Failed to open file '%s'", path.c_str());
|
||||||
showErrorMsgWindow(stmp);
|
showErrorMsgWindow(stmp);
|
||||||
clearMovieText();
|
clearMovieText();
|
||||||
return;
|
return;
|
||||||
|
@ -260,7 +260,7 @@ void MoviePlayDialog_t::updateMovieText(void)
|
||||||
|
|
||||||
validator->setMinMax(0, info.num_frames);
|
validator->setMinMax(0, info.num_frames);
|
||||||
|
|
||||||
sprintf(stmp, "%u", (unsigned)info.num_frames);
|
snprintf(stmp, sizeof(stmp), "%u", (unsigned)info.num_frames);
|
||||||
|
|
||||||
movFramesLbl->setText(tr(stmp));
|
movFramesLbl->setText(tr(stmp));
|
||||||
pauseAtFrameEntry->setText(tr(stmp));
|
pauseAtFrameEntry->setText(tr(stmp));
|
||||||
|
@ -272,11 +272,11 @@ void MoviePlayDialog_t::updateMovieText(void)
|
||||||
int seconds = num_seconds % 60;
|
int seconds = num_seconds % 60;
|
||||||
int minutes = (num_seconds / 60) % 60;
|
int minutes = (num_seconds / 60) % 60;
|
||||||
int hours = (num_seconds / 60 / 60) % 60;
|
int hours = (num_seconds / 60 / 60) % 60;
|
||||||
sprintf(stmp, "%02d:%02d:%02d.%02d", hours, minutes, seconds, fraction);
|
snprintf(stmp, sizeof(stmp), "%02d:%02d:%02d.%02d", hours, minutes, seconds, fraction);
|
||||||
|
|
||||||
movLenLbl->setText(tr(stmp));
|
movLenLbl->setText(tr(stmp));
|
||||||
|
|
||||||
sprintf(stmp, "%u", (unsigned)info.rerecord_count);
|
snprintf(stmp, sizeof(stmp), "%u", (unsigned)info.rerecord_count);
|
||||||
|
|
||||||
recCountLbl->setText(tr(stmp));
|
recCountLbl->setText(tr(stmp));
|
||||||
|
|
||||||
|
@ -297,11 +297,11 @@ void MoviePlayDialog_t::updateMovieText(void)
|
||||||
|
|
||||||
if (info.emu_version_used < 20000)
|
if (info.emu_version_used < 20000)
|
||||||
{
|
{
|
||||||
sprintf(stmp, "FCEU %u.%02u.%02u%s", info.emu_version_used / 10000, (info.emu_version_used / 100) % 100, (info.emu_version_used) % 100, info.emu_version_used < 9813 ? " (blip)" : "");
|
snprintf(stmp, sizeof(stmp), "FCEU %u.%02u.%02u%s", info.emu_version_used / 10000, (info.emu_version_used / 100) % 100, (info.emu_version_used) % 100, info.emu_version_used < 9813 ? " (blip)" : "");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(stmp, "FCEUX %u.%02u.%02u", info.emu_version_used / 10000, (info.emu_version_used / 100) % 100, (info.emu_version_used) % 100);
|
snprintf(stmp, sizeof(stmp), "FCEUX %u.%02u.%02u", info.emu_version_used / 10000, (info.emu_version_used / 100) % 100, (info.emu_version_used) % 100);
|
||||||
}
|
}
|
||||||
emuUsedLbl->setText(tr(stmp));
|
emuUsedLbl->setText(tr(stmp));
|
||||||
|
|
||||||
|
@ -315,14 +315,14 @@ void MoviePlayDialog_t::updateMovieText(void)
|
||||||
|
|
||||||
if (strcmp(stmp, md5_asciistr(info.md5_of_rom_used)) != 0)
|
if (strcmp(stmp, md5_asciistr(info.md5_of_rom_used)) != 0)
|
||||||
{
|
{
|
||||||
sprintf(stmp, "Warning: Selected movie file '%s' may not have been created using the currently loaded ROM.", path.c_str());
|
snprintf(stmp, sizeof(stmp), "Warning: Selected movie file '%s' may not have been created using the currently loaded ROM.", path.c_str());
|
||||||
showWarningMsgWindow(stmp);
|
showWarningMsgWindow(stmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(stmp, "Error: Selected file '%s' does not have a recognized movie format.", path.c_str());
|
snprintf(stmp, sizeof(stmp), "Error: Selected file '%s' does not have a recognized movie format.", path.c_str());
|
||||||
showErrorMsgWindow(stmp);
|
showErrorMsgWindow(stmp);
|
||||||
clearMovieText();
|
clearMovieText();
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ void MoviePlayDialog_t::playMovie(void)
|
||||||
if (movieLoadError)
|
if (movieLoadError)
|
||||||
{
|
{
|
||||||
char stmp[256];
|
char stmp[256];
|
||||||
sprintf(stmp, "Error: Could not load movie file: %s \n", path.c_str());
|
snprintf(stmp, sizeof(stmp), "Error: Could not load movie file: %s \n", path.c_str());
|
||||||
showErrorMsgWindow(stmp);
|
showErrorMsgWindow(stmp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -277,7 +277,7 @@ void MovieRecordDialog_t::recordMovie(void)
|
||||||
if (loadStateFailed)
|
if (loadStateFailed)
|
||||||
{
|
{
|
||||||
char str [1024];
|
char str [1024];
|
||||||
sprintf(str, "Failed to load save state \"%s\".\nRecording from current state instead...", ic_file.c_str());
|
snprintf(str, sizeof(str), "Failed to load save state \"%s\".\nRecording from current state instead...", ic_file.c_str());
|
||||||
FCEUD_PrintError(str);
|
FCEUD_PrintError(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,7 +284,7 @@ ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent)
|
||||||
{
|
{
|
||||||
char stmp[8];
|
char stmp[8];
|
||||||
|
|
||||||
sprintf( stmp, "&%ix", i+1 );
|
snprintf( stmp, sizeof(stmp), "&%ix", i+1 );
|
||||||
|
|
||||||
zoomAct[i] = new QAction(tr(stmp), this);
|
zoomAct[i] = new QAction(tr(stmp), this);
|
||||||
zoomAct[i]->setCheckable(true);
|
zoomAct[i]->setCheckable(true);
|
||||||
|
@ -346,7 +346,7 @@ ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent)
|
||||||
strcpy( stmp, "Full" );
|
strcpy( stmp, "Full" );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sprintf( stmp, "1/%i", 0x01 << i );
|
snprintf( stmp, sizeof(stmp), "1/%i", 0x01 << i );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -768,28 +768,28 @@ void ppuNameTableViewerDialog_t::setPropertyLabels( int TileID, int TileX, int T
|
||||||
{
|
{
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
|
|
||||||
sprintf( stmp, "%02X", TileID);
|
snprintf( stmp, sizeof(stmp), "%02X", TileID);
|
||||||
tileIdxLbl->setText( tr(stmp) );
|
tileIdxLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "%04X", TileID << 4);
|
snprintf( stmp, sizeof(stmp), "%04X", TileID << 4);
|
||||||
tileAddrLbl->setText( tr(stmp) );
|
tileAddrLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "%0d, %0d", TileX, TileY);
|
snprintf( stmp, sizeof(stmp), "%0d, %0d", TileX, TileY);
|
||||||
tileLocLbl->setText( tr(stmp) );
|
tileLocLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf(stmp,"%04X",PPUAddress);
|
snprintf( stmp, sizeof(stmp), "%04X",PPUAddress);
|
||||||
ppuAddrLbl->setText( tr(stmp) );
|
ppuAddrLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf(stmp,"%1X",NameTable);
|
snprintf( stmp, sizeof(stmp), "%1X",NameTable);
|
||||||
nameTableLbl->setText( tr(stmp) );
|
nameTableLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf(stmp,"%02X",Attrib);
|
snprintf( stmp, sizeof(stmp), "%02X",Attrib);
|
||||||
attrDataLbl->setText( tr(stmp) );
|
attrDataLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf(stmp,"%04X",AttAddress);
|
snprintf( stmp, sizeof(stmp), "%04X",AttAddress);
|
||||||
attrAddrLbl->setText( tr(stmp) );
|
attrAddrLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf(stmp,"%04X", palAddr );
|
snprintf( stmp, sizeof(stmp), "%04X", palAddr );
|
||||||
palAddrLbl->setText( tr(stmp) );
|
palAddrLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1341,25 +1341,25 @@ void ppuNameTableView_t::contextMenuEvent(QContextMenuEvent *event)
|
||||||
|
|
||||||
redrawtables = true;
|
redrawtables = true;
|
||||||
|
|
||||||
sprintf( stmp, "Open Tile $%04X in PPU &Viewer", tileAddr );
|
snprintf( stmp, sizeof(stmp), "Open Tile $%04X in PPU &Viewer", tileAddr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
//act->setShortcut( QKeySequence(tr("V")));
|
//act->setShortcut( QKeySequence(tr("V")));
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(openTilePpuViewer(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(openTilePpuViewer(void)) );
|
||||||
menu.addAction( act );
|
menu.addAction( act );
|
||||||
|
|
||||||
sprintf( stmp, "Open &Tile Addr $%04X in Hex Editor", tileAddr );
|
snprintf( stmp, sizeof(stmp), "Open &Tile Addr $%04X in Hex Editor", tileAddr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
//act->setShortcut( QKeySequence(tr("H")));
|
//act->setShortcut( QKeySequence(tr("H")));
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(openTileAddrHexEdit(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(openTileAddrHexEdit(void)) );
|
||||||
menu.addAction( act );
|
menu.addAction( act );
|
||||||
|
|
||||||
sprintf( stmp, "Open &Attr Addr $%04X in Hex Editor", atrbAddr );
|
snprintf( stmp, sizeof(stmp), "Open &Attr Addr $%04X in Hex Editor", atrbAddr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
//act->setShortcut( QKeySequence(tr("H")));
|
//act->setShortcut( QKeySequence(tr("H")));
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(openAtrbAddrHexEdit(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(openAtrbAddrHexEdit(void)) );
|
||||||
menu.addAction( act );
|
menu.addAction( act );
|
||||||
|
|
||||||
sprintf( stmp, "Open &PPU Addr $%04X in Hex Editor", ppuAddr );
|
snprintf( stmp, sizeof(stmp), "Open &PPU Addr $%04X in Hex Editor", ppuAddr );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
//act->setShortcut( QKeySequence(tr("H")));
|
//act->setShortcut( QKeySequence(tr("H")));
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(openPpuAddrHexEdit(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(openPpuAddrHexEdit(void)) );
|
||||||
|
|
|
@ -143,7 +143,7 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
|
||||||
|
|
||||||
connect(ntscFrame, SIGNAL(clicked(bool)), this, SLOT(use_NTSC_Changed(bool)));
|
connect(ntscFrame, SIGNAL(clicked(bool)), this, SLOT(use_NTSC_Changed(bool)));
|
||||||
|
|
||||||
sprintf(stmp, "Tint: %3i", tint);
|
snprintf(stmp, sizeof(stmp), "Tint: %3i", tint);
|
||||||
tintFrame = new QGroupBox(tr(stmp));
|
tintFrame = new QGroupBox(tr(stmp));
|
||||||
hbox1 = new QHBoxLayout();
|
hbox1 = new QHBoxLayout();
|
||||||
tintSlider = new QSlider(Qt::Horizontal);
|
tintSlider = new QSlider(Qt::Horizontal);
|
||||||
|
@ -157,7 +157,7 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
|
||||||
tintFrame->setLayout(hbox1);
|
tintFrame->setLayout(hbox1);
|
||||||
hbox2->addWidget(tintFrame);
|
hbox2->addWidget(tintFrame);
|
||||||
|
|
||||||
sprintf(stmp, "Hue: %3i", hue);
|
snprintf(stmp, sizeof(stmp), "Hue: %3i", hue);
|
||||||
hueFrame = new QGroupBox(tr(stmp));
|
hueFrame = new QGroupBox(tr(stmp));
|
||||||
hbox1 = new QHBoxLayout();
|
hbox1 = new QHBoxLayout();
|
||||||
hueSlider = new QSlider(Qt::Horizontal);
|
hueSlider = new QSlider(Qt::Horizontal);
|
||||||
|
@ -190,7 +190,7 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
|
||||||
grid->setColumnStretch( 1, 40 );
|
grid->setColumnStretch( 1, 40 );
|
||||||
grid->setColumnStretch( 2, 20 );
|
grid->setColumnStretch( 2, 20 );
|
||||||
|
|
||||||
sprintf(stmp, "Notch: %3i%%", palnotch);
|
snprintf(stmp, sizeof(stmp), "Notch: %3i%%", palnotch);
|
||||||
notchFrame = new QGroupBox(tr(stmp));
|
notchFrame = new QGroupBox(tr(stmp));
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
||||||
notchFrame->setMinimumWidth( notchFrame->fontMetrics().horizontalAdvance('2') * strlen(stmp) );
|
notchFrame->setMinimumWidth( notchFrame->fontMetrics().horizontalAdvance('2') * strlen(stmp) );
|
||||||
|
@ -207,7 +207,7 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
|
||||||
hbox1->addWidget(notchSlider);
|
hbox1->addWidget(notchSlider);
|
||||||
notchFrame->setLayout(hbox1);
|
notchFrame->setLayout(hbox1);
|
||||||
|
|
||||||
sprintf(stmp, "Saturation: %3i%%", palsaturation);
|
snprintf(stmp, sizeof(stmp), "Saturation: %3i%%", palsaturation);
|
||||||
saturationFrame = new QGroupBox(tr(stmp));
|
saturationFrame = new QGroupBox(tr(stmp));
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
||||||
saturationFrame->setMinimumWidth( saturationFrame->fontMetrics().horizontalAdvance('2') * strlen(stmp) );
|
saturationFrame->setMinimumWidth( saturationFrame->fontMetrics().horizontalAdvance('2') * strlen(stmp) );
|
||||||
|
@ -224,7 +224,7 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
|
||||||
hbox1->addWidget(saturationSlider);
|
hbox1->addWidget(saturationSlider);
|
||||||
saturationFrame->setLayout(hbox1);
|
saturationFrame->setLayout(hbox1);
|
||||||
|
|
||||||
sprintf(stmp, "Sharpness: %3i%%", palsharpness*2);
|
snprintf(stmp, sizeof(stmp), "Sharpness: %3i%%", palsharpness*2);
|
||||||
sharpnessFrame = new QGroupBox(tr(stmp));
|
sharpnessFrame = new QGroupBox(tr(stmp));
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
||||||
sharpnessFrame->setMinimumWidth( sharpnessFrame->fontMetrics().horizontalAdvance('2') * strlen(stmp) );
|
sharpnessFrame->setMinimumWidth( sharpnessFrame->fontMetrics().horizontalAdvance('2') * strlen(stmp) );
|
||||||
|
@ -241,7 +241,7 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
|
||||||
hbox1->addWidget(sharpnessSlider);
|
hbox1->addWidget(sharpnessSlider);
|
||||||
sharpnessFrame->setLayout(hbox1);
|
sharpnessFrame->setLayout(hbox1);
|
||||||
|
|
||||||
sprintf(stmp, "Contrast: %3i%%", palcontrast);
|
snprintf(stmp, sizeof(stmp), "Contrast: %3i%%", palcontrast);
|
||||||
contrastFrame = new QGroupBox(tr(stmp));
|
contrastFrame = new QGroupBox(tr(stmp));
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
||||||
contrastFrame->setMinimumWidth( contrastFrame->fontMetrics().horizontalAdvance('2') * strlen(stmp) );
|
contrastFrame->setMinimumWidth( contrastFrame->fontMetrics().horizontalAdvance('2') * strlen(stmp) );
|
||||||
|
@ -258,7 +258,7 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
|
||||||
hbox1->addWidget(contrastSlider);
|
hbox1->addWidget(contrastSlider);
|
||||||
contrastFrame->setLayout(hbox1);
|
contrastFrame->setLayout(hbox1);
|
||||||
|
|
||||||
sprintf(stmp, "Brightness: %3i%%", palbrightness);
|
snprintf(stmp, sizeof(stmp), "Brightness: %3i%%", palbrightness);
|
||||||
brightnessFrame = new QGroupBox(tr(stmp));
|
brightnessFrame = new QGroupBox(tr(stmp));
|
||||||
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
#if QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
|
||||||
brightnessFrame->setMinimumWidth( brightnessFrame->fontMetrics().horizontalAdvance('2') * strlen(stmp) );
|
brightnessFrame->setMinimumWidth( brightnessFrame->fontMetrics().horizontalAdvance('2') * strlen(stmp) );
|
||||||
|
@ -361,7 +361,7 @@ void PaletteConfDialog_t::hueChanged(int v)
|
||||||
int c, t;
|
int c, t;
|
||||||
char stmp[64];
|
char stmp[64];
|
||||||
|
|
||||||
sprintf(stmp, "Hue: %3i", v);
|
snprintf(stmp, sizeof(stmp), "Hue: %3i", v);
|
||||||
|
|
||||||
hueFrame->setTitle(stmp);
|
hueFrame->setTitle(stmp);
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ void PaletteConfDialog_t::tintChanged(int v)
|
||||||
int c, h;
|
int c, h;
|
||||||
char stmp[64];
|
char stmp[64];
|
||||||
|
|
||||||
sprintf(stmp, "Tint: %3i", v);
|
snprintf(stmp, sizeof(stmp), "Tint: %3i", v);
|
||||||
|
|
||||||
tintFrame->setTitle(stmp);
|
tintFrame->setTitle(stmp);
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ void PaletteConfDialog_t::palNotchChanged(int value)
|
||||||
{
|
{
|
||||||
char stmp[64];
|
char stmp[64];
|
||||||
|
|
||||||
sprintf( stmp, "Notch: %3i%%", value );
|
snprintf( stmp, sizeof(stmp), "Notch: %3i%%", value );
|
||||||
notchFrame->setTitle( tr(stmp) );
|
notchFrame->setTitle( tr(stmp) );
|
||||||
|
|
||||||
palnotch = value;
|
palnotch = value;
|
||||||
|
@ -671,7 +671,7 @@ void PaletteConfDialog_t::palSaturationChanged(int value)
|
||||||
{
|
{
|
||||||
char stmp[64];
|
char stmp[64];
|
||||||
|
|
||||||
sprintf( stmp, "Saturation: %3i%%", value );
|
snprintf( stmp, sizeof(stmp), "Saturation: %3i%%", value );
|
||||||
saturationFrame->setTitle( tr(stmp) );
|
saturationFrame->setTitle( tr(stmp) );
|
||||||
|
|
||||||
palsaturation = value;
|
palsaturation = value;
|
||||||
|
@ -689,7 +689,7 @@ void PaletteConfDialog_t::palSharpnessChanged(int value)
|
||||||
{
|
{
|
||||||
char stmp[64];
|
char stmp[64];
|
||||||
|
|
||||||
sprintf( stmp, "Sharpness: %3i%%", value*2 );
|
snprintf( stmp, sizeof(stmp), "Sharpness: %3i%%", value*2 );
|
||||||
sharpnessFrame->setTitle( tr(stmp) );
|
sharpnessFrame->setTitle( tr(stmp) );
|
||||||
|
|
||||||
palsharpness = value;
|
palsharpness = value;
|
||||||
|
@ -707,7 +707,7 @@ void PaletteConfDialog_t::palContrastChanged(int value)
|
||||||
{
|
{
|
||||||
char stmp[64];
|
char stmp[64];
|
||||||
|
|
||||||
sprintf( stmp, "Contrast: %3i%%", value );
|
snprintf( stmp, sizeof(stmp), "Contrast: %3i%%", value );
|
||||||
contrastFrame->setTitle( tr(stmp) );
|
contrastFrame->setTitle( tr(stmp) );
|
||||||
|
|
||||||
palcontrast = value;
|
palcontrast = value;
|
||||||
|
@ -725,7 +725,7 @@ void PaletteConfDialog_t::palBrightnessChanged(int value)
|
||||||
{
|
{
|
||||||
char stmp[64];
|
char stmp[64];
|
||||||
|
|
||||||
sprintf( stmp, "Brightness: %3i%%", value );
|
snprintf( stmp, sizeof(stmp), "Brightness: %3i%%", value );
|
||||||
brightnessFrame->setTitle( tr(stmp) );
|
brightnessFrame->setTitle( tr(stmp) );
|
||||||
|
|
||||||
palbrightness = value;
|
palbrightness = value;
|
||||||
|
|
|
@ -232,7 +232,7 @@ void PaletteEditorDialog_t::updatePeriodic(void)
|
||||||
|
|
||||||
chg = undoColorHistory.back();
|
chg = undoColorHistory.back();
|
||||||
|
|
||||||
sprintf( stmp, "&Undo $%02X = rgb(%3i,%3i,%3i)", chg.palIdx,
|
snprintf( stmp, sizeof(stmp), "&Undo $%02X = rgb(%3i,%3i,%3i)", chg.palIdx,
|
||||||
chg.newColor.red(), chg.newColor.green(), chg.newColor.blue() );
|
chg.newColor.red(), chg.newColor.green(), chg.newColor.blue() );
|
||||||
|
|
||||||
undoAct->setText( tr(stmp) );
|
undoAct->setText( tr(stmp) );
|
||||||
|
@ -249,7 +249,7 @@ void PaletteEditorDialog_t::updatePeriodic(void)
|
||||||
|
|
||||||
chg = redoColorHistory.back();
|
chg = redoColorHistory.back();
|
||||||
|
|
||||||
sprintf( stmp, "&Redo $%02X = rgb(%3i,%3i,%3i)", chg.palIdx,
|
snprintf( stmp, sizeof(stmp), "&Redo $%02X = rgb(%3i,%3i,%3i)", chg.palIdx,
|
||||||
chg.newColor.red(), chg.newColor.green(), chg.newColor.blue() );
|
chg.newColor.red(), chg.newColor.green(), chg.newColor.blue() );
|
||||||
|
|
||||||
redoAct->setText( tr(stmp) );
|
redoAct->setText( tr(stmp) );
|
||||||
|
@ -798,7 +798,7 @@ void nesPaletteView::contextMenuEvent(QContextMenuEvent *event)
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf( stmp, "Edit Color %X%X", selCell.y(), selCell.x() );
|
snprintf( stmp, sizeof(stmp), "Edit Color %X%X", selCell.y(), selCell.x() );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
act->setShortcut( QKeySequence(tr("E")));
|
act->setShortcut( QKeySequence(tr("E")));
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(editSelColor(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(editSelColor(void)) );
|
||||||
|
@ -947,7 +947,7 @@ nesColorPickerDialog_t::nesColorPickerDialog_t( int palIndex, QColor *c, QWidget
|
||||||
|
|
||||||
style = this->style();
|
style = this->style();
|
||||||
|
|
||||||
sprintf( stmp, "Pick Palette Color $%02X", palIndex );
|
snprintf( stmp, sizeof(stmp), "Pick Palette Color $%02X", palIndex );
|
||||||
|
|
||||||
setWindowTitle( stmp );
|
setWindowTitle( stmp );
|
||||||
|
|
||||||
|
@ -1220,7 +1220,7 @@ void nesPalettePickerView::contextMenuEvent(QContextMenuEvent *event)
|
||||||
// //QActionGroup *group;
|
// //QActionGroup *group;
|
||||||
// char stmp[64];
|
// char stmp[64];
|
||||||
//
|
//
|
||||||
// sprintf( stmp, "Edit Color %X%X", selCell.y(), selCell.x() );
|
// snprintf( stmp, sizeof(stmp), "Edit Color %X%X", selCell.y(), selCell.x() );
|
||||||
// act = new QAction(tr(stmp), &menu);
|
// act = new QAction(tr(stmp), &menu);
|
||||||
// act->setShortcut( QKeySequence(tr("E")));
|
// act->setShortcut( QKeySequence(tr("E")));
|
||||||
// connect( act, SIGNAL(triggered(void)), this, SLOT(editSelColor(void)) );
|
// connect( act, SIGNAL(triggered(void)), this, SLOT(editSelColor(void)) );
|
||||||
|
@ -1341,7 +1341,7 @@ nesPalettePickerDialog::nesPalettePickerDialog( int idx, QWidget *parent)
|
||||||
palIdx = idx;
|
palIdx = idx;
|
||||||
palAddr = 0x3F00 + palIdx;
|
palAddr = 0x3F00 + palIdx;
|
||||||
|
|
||||||
sprintf( stmp, "Pick Palette Color for Address $%04X", palAddr );
|
snprintf( stmp, sizeof(stmp), "Pick Palette Color for Address $%04X", palAddr );
|
||||||
setWindowTitle( tr(stmp) );
|
setWindowTitle( tr(stmp) );
|
||||||
|
|
||||||
palOrigVal = READPAL_MOTHEROFALL(palIdx & 0x1F);
|
palOrigVal = READPAL_MOTHEROFALL(palIdx & 0x1F);
|
||||||
|
|
|
@ -2012,63 +2012,63 @@ void QRamSearchView::paintEvent(QPaintEvent *event)
|
||||||
painter.fillRect(0, y - pxLineSpacing + pxLineLead, viewWidth, pxLineSpacing, QColor("light blue"));
|
painter.fillRect(0, y - pxLineSpacing + pxLineLead, viewWidth, pxLineSpacing, QColor("light blue"));
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(addrStr, "$%04X", loc->addr);
|
snprintf(addrStr, sizeof(addrStr), "$%04X", loc->addr);
|
||||||
|
|
||||||
if (dpySize == 'd')
|
if (dpySize == 'd')
|
||||||
{
|
{
|
||||||
if (dpyType == 'h')
|
if (dpyType == 'h')
|
||||||
{
|
{
|
||||||
sprintf(valStr, "0x%08X", loc->val.v32.u);
|
snprintf(valStr, sizeof(valStr), "0x%08X", loc->val.v32.u);
|
||||||
sprintf(prevStr, "0x%08X", loc->hist.back().v32.u);
|
snprintf(prevStr, sizeof(prevStr), "0x%08X", loc->hist.back().v32.u);
|
||||||
}
|
}
|
||||||
else if (dpyType == 'u')
|
else if (dpyType == 'u')
|
||||||
{
|
{
|
||||||
sprintf(valStr, "%u", loc->val.v32.u);
|
snprintf(valStr, sizeof(valStr), "%u", loc->val.v32.u);
|
||||||
sprintf(prevStr, "%u", loc->hist.back().v32.u);
|
snprintf(prevStr, sizeof(prevStr), "%u", loc->hist.back().v32.u);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(valStr, "%i", loc->val.v32.i);
|
snprintf(valStr, sizeof(valStr), "%i", loc->val.v32.i);
|
||||||
sprintf(prevStr, "%i", loc->hist.back().v32.i);
|
snprintf(prevStr, sizeof(prevStr), "%i", loc->hist.back().v32.i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dpySize == 'w')
|
else if (dpySize == 'w')
|
||||||
{
|
{
|
||||||
if (dpyType == 'h')
|
if (dpyType == 'h')
|
||||||
{
|
{
|
||||||
sprintf(valStr, "0x%04X", loc->val.v16.u);
|
snprintf(valStr, sizeof(valStr), "0x%04X", loc->val.v16.u);
|
||||||
sprintf(prevStr, "0x%04X", loc->hist.back().v16.u);
|
snprintf(prevStr, sizeof(prevStr), "0x%04X", loc->hist.back().v16.u);
|
||||||
}
|
}
|
||||||
else if (dpyType == 'u')
|
else if (dpyType == 'u')
|
||||||
{
|
{
|
||||||
sprintf(valStr, "%u", loc->val.v16.u);
|
snprintf(valStr, sizeof(valStr), "%u", loc->val.v16.u);
|
||||||
sprintf(prevStr, "%u", loc->hist.back().v16.u);
|
snprintf(prevStr, sizeof(prevStr), "%u", loc->hist.back().v16.u);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(valStr, "%i", loc->val.v16.i);
|
snprintf(valStr, sizeof(valStr), "%i", loc->val.v16.i);
|
||||||
sprintf(prevStr, "%i", loc->hist.back().v16.i);
|
snprintf(prevStr, sizeof(prevStr), "%i", loc->hist.back().v16.i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dpyType == 'h')
|
if (dpyType == 'h')
|
||||||
{
|
{
|
||||||
sprintf(valStr, "0x%02X", loc->val.v8.u);
|
snprintf(valStr, sizeof(valStr), "0x%02X", loc->val.v8.u);
|
||||||
sprintf(prevStr, "0x%02X", loc->hist.back().v8.u);
|
snprintf(prevStr, sizeof(prevStr), "0x%02X", loc->hist.back().v8.u);
|
||||||
}
|
}
|
||||||
else if (dpyType == 'u')
|
else if (dpyType == 'u')
|
||||||
{
|
{
|
||||||
sprintf(valStr, "%u", loc->val.v8.u);
|
snprintf(valStr, sizeof(valStr), "%u", loc->val.v8.u);
|
||||||
sprintf(prevStr, "%u", loc->hist.back().v8.u);
|
snprintf(prevStr, sizeof(prevStr), "%u", loc->hist.back().v8.u);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(valStr, "%i", loc->val.v8.i);
|
snprintf(valStr, sizeof(valStr), "%i", loc->val.v8.i);
|
||||||
sprintf(prevStr, "%i", loc->hist.back().v8.i);
|
snprintf(prevStr, sizeof(prevStr), "%i", loc->hist.back().v8.i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sprintf(chgStr, "%u", loc->chgCount);
|
snprintf(chgStr, sizeof(chgStr), "%u", loc->chgCount);
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -403,11 +403,11 @@ void RamWatchDialog_t::updateRamWatchDisplay(void)
|
||||||
{
|
{
|
||||||
if ( rw->size > 1 )
|
if ( rw->size > 1 )
|
||||||
{
|
{
|
||||||
sprintf (addrStr, "$%04X-$%04X", rw->addr, rw->addr + rw->size - 1);
|
snprintf (addrStr, sizeof(addrStr), "$%04X-$%04X", rw->addr, rw->addr + rw->size - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf (addrStr, "$%04X", rw->addr);
|
snprintf (addrStr, sizeof(addrStr), "$%04X", rw->addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -424,37 +424,37 @@ void RamWatchDialog_t::updateRamWatchDisplay(void)
|
||||||
{
|
{
|
||||||
if (rw->type == 's')
|
if (rw->type == 's')
|
||||||
{
|
{
|
||||||
sprintf (valStr1, "%i", rw->val.i32);
|
snprintf (valStr1, sizeof(valStr1), "%i", rw->val.i32);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf (valStr1, "%u", rw->val.u32);
|
snprintf (valStr1, sizeof(valStr1), "%u", rw->val.u32);
|
||||||
}
|
}
|
||||||
sprintf (valStr2, "0x%08X", rw->val.u32);
|
snprintf (valStr2, sizeof(valStr2), "0x%08X", rw->val.u32);
|
||||||
}
|
}
|
||||||
else if (rw->size == 2)
|
else if (rw->size == 2)
|
||||||
{
|
{
|
||||||
if (rw->type == 's')
|
if (rw->type == 's')
|
||||||
{
|
{
|
||||||
sprintf (valStr1, "%6i", rw->val.i16);
|
snprintf (valStr1, sizeof(valStr1), "%6i", rw->val.i16);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf (valStr1, "%6u", rw->val.u16);
|
snprintf (valStr1, sizeof(valStr1), "%6u", rw->val.u16);
|
||||||
}
|
}
|
||||||
sprintf (valStr2, "0x%04X", rw->val.u16);
|
snprintf (valStr2, sizeof(valStr2), "0x%04X", rw->val.u16);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (rw->type == 's')
|
if (rw->type == 's')
|
||||||
{
|
{
|
||||||
sprintf (valStr1, "%6i", rw->val.i8);
|
snprintf (valStr1, sizeof(valStr1), "%6i", rw->val.i8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf (valStr1, "%6u", rw->val.u8);
|
snprintf (valStr1, sizeof(valStr1), "%6u", rw->val.u8);
|
||||||
}
|
}
|
||||||
sprintf (valStr2, "0x%02X", rw->val.u8);
|
snprintf (valStr2, sizeof(valStr2), "0x%02X", rw->val.u8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -851,7 +851,7 @@ void RamWatchDialog_t::openWatchEditWindow( ramWatch_t *rw, int mode)
|
||||||
|
|
||||||
if ( (rw->addr >= 0) && !rw->isSep )
|
if ( (rw->addr >= 0) && !rw->isSep )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%04X", rw->addr );
|
snprintf( stmp, sizeof(stmp), "%04X", rw->addr );
|
||||||
addrEntry->setText( tr(stmp) );
|
addrEntry->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -606,7 +606,7 @@ void StateRecorderDialog_t::recalcMemoryUsage(void)
|
||||||
|
|
||||||
int inumSnaps = static_cast<int>( fnumSnaps + 0.5f );
|
int inumSnaps = static_cast<int>( fnumSnaps + 0.5f );
|
||||||
|
|
||||||
sprintf( stmp, "%i", inumSnaps );
|
snprintf( stmp, sizeof(stmp), "%i", inumSnaps );
|
||||||
|
|
||||||
numSnapsLbl->setText( tr(stmp) );
|
numSnapsLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
|
@ -642,11 +642,11 @@ void StateRecorderDialog_t::recalcMemoryUsage(void)
|
||||||
|
|
||||||
if (fsnapSize >= oneKiloByte)
|
if (fsnapSize >= oneKiloByte)
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%.02f kB", fsnapSize / oneKiloByte );
|
snprintf( stmp, sizeof(stmp), "%.02f kB", fsnapSize / oneKiloByte );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%.0f B", fsnapSize );
|
snprintf( stmp, sizeof(stmp), "%.0f B", fsnapSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
snapMemSizeLbl->setText( tr(stmp) );
|
snapMemSizeLbl->setText( tr(stmp) );
|
||||||
|
@ -655,20 +655,20 @@ void StateRecorderDialog_t::recalcMemoryUsage(void)
|
||||||
|
|
||||||
if (ftotalSize >= oneMegaByte)
|
if (ftotalSize >= oneMegaByte)
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%.02f MB", ftotalSize / oneMegaByte );
|
snprintf( stmp, sizeof(stmp), "%.02f MB", ftotalSize / oneMegaByte );
|
||||||
}
|
}
|
||||||
else if (ftotalSize >= oneKiloByte)
|
else if (ftotalSize >= oneKiloByte)
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%.02f kB", ftotalSize / oneKiloByte );
|
snprintf( stmp, sizeof(stmp), "%.02f kB", ftotalSize / oneKiloByte );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%.0f B", ftotalSize );
|
snprintf( stmp, sizeof(stmp), "%.0f B", ftotalSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
totalMemUsageLbl->setText( tr(stmp) );
|
totalMemUsageLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "%.02f ms", saveTimeMs);
|
snprintf( stmp, sizeof(stmp), "%.02f ms", saveTimeMs);
|
||||||
saveTimeLbl->setText( tr(stmp) );
|
saveTimeLbl->setText( tr(stmp) );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
|
@ -117,7 +117,7 @@ int DisassembleWithDebug(int addr, uint8_t *opcode, int flags, char *str, debugS
|
||||||
|
|
||||||
#ifdef BRK_3BYTE_HACK
|
#ifdef BRK_3BYTE_HACK
|
||||||
case 0x00:
|
case 0x00:
|
||||||
sprintf(str,"BRK %02X %02X", opcode[1], opcode[2]);
|
snprintf(str, sizeof(str), "BRK %02X %02X", opcode[1], opcode[2]);
|
||||||
break;
|
break;
|
||||||
#else
|
#else
|
||||||
case 0x00: strcpy(str,"BRK"); break;
|
case 0x00: strcpy(str,"BRK"); break;
|
||||||
|
@ -699,7 +699,7 @@ void SymbolEditWindow::setAddr( int addrIn )
|
||||||
|
|
||||||
addr = addrIn;
|
addr = addrIn;
|
||||||
|
|
||||||
sprintf( stmp, "%04X", addr );
|
snprintf( stmp, sizeof(stmp), "%04X", addr );
|
||||||
|
|
||||||
addrEntry->setText( tr(stmp) );
|
addrEntry->setText( tr(stmp) );
|
||||||
|
|
||||||
|
@ -921,7 +921,7 @@ void SymbolEditWindow::determineArrayStart(void)
|
||||||
|
|
||||||
if ( (val >= 0) && (val < 256) )
|
if ( (val >= 0) && (val < 256) )
|
||||||
{
|
{
|
||||||
sprintf( digits, "%02X", val );
|
snprintf( digits, sizeof(digits), "%02X", val );
|
||||||
|
|
||||||
arrayInit->setText( tr(digits) );
|
arrayInit->setText( tr(digits) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,6 +329,20 @@ void TimingConfDialog_t::saveValues(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
QString TimingConfDialog_t::getSchedPrioErrorMsg(const char* funcName, int errorCode)
|
||||||
|
{
|
||||||
|
QString msg = QString("Error: system call setPriority Failed\nReason: ") + QString(strerror(errorCode)) + QString("\n");
|
||||||
|
#ifdef __linux__
|
||||||
|
msg += "Ensure that your system has the proper resource permissions set in the file:\n\n";
|
||||||
|
msg += " /etc/security/limits.conf \n\n";
|
||||||
|
msg += "Adding the following lines to that file and rebooting will usually fix the issue:\n\n";
|
||||||
|
msg += "* - priority 99 \n";
|
||||||
|
msg += "* - rtprio 99 \n";
|
||||||
|
msg += "* - nice -20 \n";
|
||||||
|
#endif
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
void TimingConfDialog_t::emuSchedNiceChange(int val)
|
void TimingConfDialog_t::emuSchedNiceChange(int val)
|
||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
|
@ -339,19 +353,9 @@ void TimingConfDialog_t::emuSchedNiceChange(int val)
|
||||||
FCEU_WRAPPER_LOCK();
|
FCEU_WRAPPER_LOCK();
|
||||||
if (consoleWindow->emulatorThread->setNicePriority(-val))
|
if (consoleWindow->emulatorThread->setNicePriority(-val))
|
||||||
{
|
{
|
||||||
char msg[1024];
|
QString msg = getSchedPrioErrorMsg("setPriority", errno);
|
||||||
|
printf("%s\n", msg.toLocal8Bit().constData());
|
||||||
sprintf(msg, "Error: system call setPriority Failed\nReason: %s\n", strerror(errno));
|
consoleWindow->QueueErrorMsgWindow(msg.toLocal8Bit().constData());
|
||||||
#ifdef __linux__
|
|
||||||
strcat(msg, "Ensure that your system has the proper resource permissions set in the file:\n\n");
|
|
||||||
strcat(msg, " /etc/security/limits.conf \n\n");
|
|
||||||
strcat(msg, "Adding the following lines to that file and rebooting will usually fix the issue:\n\n");
|
|
||||||
strcat(msg, "* - priority 99 \n");
|
|
||||||
strcat(msg, "* - rtprio 99 \n");
|
|
||||||
strcat(msg, "* - nice -20 \n");
|
|
||||||
#endif
|
|
||||||
printf("%s\n", msg);
|
|
||||||
consoleWindow->QueueErrorMsgWindow(msg);
|
|
||||||
updateSliderValues();
|
updateSliderValues();
|
||||||
}
|
}
|
||||||
FCEU_WRAPPER_UNLOCK();
|
FCEU_WRAPPER_UNLOCK();
|
||||||
|
@ -377,19 +381,9 @@ void TimingConfDialog_t::emuSchedPrioChange(int val)
|
||||||
|
|
||||||
if (consoleWindow->emulatorThread->setSchedParam(policy, val))
|
if (consoleWindow->emulatorThread->setSchedParam(policy, val))
|
||||||
{
|
{
|
||||||
char msg[1024];
|
QString msg = getSchedPrioErrorMsg("pthread_setschedparam", errno);
|
||||||
|
printf("%s\n", msg.toLocal8Bit().constData());
|
||||||
sprintf(msg, "Error: system call pthread_setschedparam Failed\nReason: %s\n", strerror(errno));
|
consoleWindow->QueueErrorMsgWindow(msg.toLocal8Bit().constData());
|
||||||
#ifdef __linux__
|
|
||||||
strcat(msg, "Ensure that your system has the proper resource permissions set in the file:\n\n");
|
|
||||||
strcat(msg, " /etc/security/limits.conf \n\n");
|
|
||||||
strcat(msg, "Adding the following lines to that file and rebooting will usually fix the issue:\n\n");
|
|
||||||
strcat(msg, "* - priority 99 \n");
|
|
||||||
strcat(msg, "* - rtprio 99 \n");
|
|
||||||
strcat(msg, "* - nice -20 \n");
|
|
||||||
#endif
|
|
||||||
printf("%s\n", msg);
|
|
||||||
consoleWindow->QueueErrorMsgWindow(msg);
|
|
||||||
updateSliderValues();
|
updateSliderValues();
|
||||||
}
|
}
|
||||||
FCEU_WRAPPER_UNLOCK();
|
FCEU_WRAPPER_UNLOCK();
|
||||||
|
@ -412,19 +406,9 @@ void TimingConfDialog_t::emuSchedPolicyChange(int index)
|
||||||
|
|
||||||
if (consoleWindow->emulatorThread->setSchedParam(policy, prio))
|
if (consoleWindow->emulatorThread->setSchedParam(policy, prio))
|
||||||
{
|
{
|
||||||
char msg[1024];
|
QString msg = getSchedPrioErrorMsg("pthread_setschedparam", errno);
|
||||||
|
printf("%s\n", msg.toLocal8Bit().constData());
|
||||||
sprintf(msg, "Error: system call pthread_setschedparam Failed\nReason: %s\n", strerror(errno));
|
consoleWindow->QueueErrorMsgWindow(msg.toLocal8Bit().constData());
|
||||||
#ifdef __linux__
|
|
||||||
strcat(msg, "Ensure that your system has the proper resource permissions set in the file:\n\n");
|
|
||||||
strcat(msg, " /etc/security/limits.conf \n\n");
|
|
||||||
strcat(msg, "Adding the following lines to that file and rebooting will usually fix the issue:\n\n");
|
|
||||||
strcat(msg, "* - priority 99 \n");
|
|
||||||
strcat(msg, "* - rtprio 99 \n");
|
|
||||||
strcat(msg, "* - nice -20 \n");
|
|
||||||
#endif
|
|
||||||
printf("%s\n", msg);
|
|
||||||
consoleWindow->QueueErrorMsgWindow(msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePolicyBox();
|
updatePolicyBox();
|
||||||
|
@ -444,19 +428,9 @@ void TimingConfDialog_t::guiSchedNiceChange(int val)
|
||||||
FCEU_WRAPPER_LOCK();
|
FCEU_WRAPPER_LOCK();
|
||||||
if (consoleWindow->setNicePriority(-val))
|
if (consoleWindow->setNicePriority(-val))
|
||||||
{
|
{
|
||||||
char msg[1024];
|
QString msg = getSchedPrioErrorMsg("setPriority", errno);
|
||||||
|
printf("%s\n", msg.toLocal8Bit().constData());
|
||||||
sprintf(msg, "Error: system call setPriority Failed\nReason: %s\n", strerror(errno));
|
consoleWindow->QueueErrorMsgWindow(msg.toLocal8Bit().constData());
|
||||||
#ifdef __linux__
|
|
||||||
strcat(msg, "Ensure that your system has the proper resource permissions set in the file:\n\n");
|
|
||||||
strcat(msg, " /etc/security/limits.conf \n\n");
|
|
||||||
strcat(msg, "Adding the following lines to that file and rebooting will usually fix the issue:\n\n");
|
|
||||||
strcat(msg, "* - priority 99 \n");
|
|
||||||
strcat(msg, "* - rtprio 99 \n");
|
|
||||||
strcat(msg, "* - nice -20 \n");
|
|
||||||
#endif
|
|
||||||
printf("%s\n", msg);
|
|
||||||
consoleWindow->QueueErrorMsgWindow(msg);
|
|
||||||
updateSliderValues();
|
updateSliderValues();
|
||||||
}
|
}
|
||||||
FCEU_WRAPPER_UNLOCK();
|
FCEU_WRAPPER_UNLOCK();
|
||||||
|
@ -480,19 +454,9 @@ void TimingConfDialog_t::guiSchedPrioChange(int val)
|
||||||
|
|
||||||
if (consoleWindow->setSchedParam(policy, val))
|
if (consoleWindow->setSchedParam(policy, val))
|
||||||
{
|
{
|
||||||
char msg[1024];
|
QString msg = getSchedPrioErrorMsg("pthread_setschedparam", errno);
|
||||||
|
printf("%s\n", msg.toLocal8Bit().constData());
|
||||||
sprintf(msg, "Error: system call pthread_setschedparam Failed\nReason: %s\n", strerror(errno));
|
consoleWindow->QueueErrorMsgWindow(msg.toLocal8Bit().constData());
|
||||||
#ifdef __linux__
|
|
||||||
strcat(msg, "Ensure that your system has the proper resource permissions set in the file:\n\n");
|
|
||||||
strcat(msg, " /etc/security/limits.conf \n\n");
|
|
||||||
strcat(msg, "Adding the following lines to that file and rebooting will usually fix the issue:\n\n");
|
|
||||||
strcat(msg, "* - priority 99 \n");
|
|
||||||
strcat(msg, "* - rtprio 99 \n");
|
|
||||||
strcat(msg, "* - nice -20 \n");
|
|
||||||
#endif
|
|
||||||
printf("%s\n", msg);
|
|
||||||
consoleWindow->QueueErrorMsgWindow(msg);
|
|
||||||
updateSliderValues();
|
updateSliderValues();
|
||||||
}
|
}
|
||||||
FCEU_WRAPPER_UNLOCK();
|
FCEU_WRAPPER_UNLOCK();
|
||||||
|
@ -515,19 +479,9 @@ void TimingConfDialog_t::guiSchedPolicyChange(int index)
|
||||||
|
|
||||||
if (consoleWindow->setSchedParam(policy, prio))
|
if (consoleWindow->setSchedParam(policy, prio))
|
||||||
{
|
{
|
||||||
char msg[1024];
|
QString msg = getSchedPrioErrorMsg("pthread_setschedparam", errno);
|
||||||
|
printf("%s\n", msg.toLocal8Bit().constData());
|
||||||
sprintf(msg, "Error: system call pthread_setschedparam Failed\nReason: %s\n", strerror(errno));
|
consoleWindow->QueueErrorMsgWindow(msg.toLocal8Bit().constData());
|
||||||
#ifdef __linux__
|
|
||||||
strcat(msg, "Ensure that your system has the proper resource permissions set in the file:\n\n");
|
|
||||||
strcat(msg, " /etc/security/limits.conf \n\n");
|
|
||||||
strcat(msg, "Adding the following lines to that file and rebooting will usually fix the issue:\n\n");
|
|
||||||
strcat(msg, "* - priority 99 \n");
|
|
||||||
strcat(msg, "* - rtprio 99 \n");
|
|
||||||
strcat(msg, "* - nice -20 \n");
|
|
||||||
#endif
|
|
||||||
printf("%s\n", msg);
|
|
||||||
consoleWindow->QueueErrorMsgWindow(msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePolicyBox();
|
updatePolicyBox();
|
||||||
|
|
|
@ -63,6 +63,7 @@ private:
|
||||||
void updateTimingMech(void);
|
void updateTimingMech(void);
|
||||||
void updateOverclocking(void);
|
void updateOverclocking(void);
|
||||||
void saveValues(void);
|
void saveValues(void);
|
||||||
|
QString getSchedPrioErrorMsg(const char* funcName, int errorCode);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void closeWindow(void);
|
void closeWindow(void);
|
||||||
|
|
|
@ -1244,7 +1244,7 @@ void FCEUD_TraceInstruction(uint8 *opcode, int size)
|
||||||
olddatacount = datacount;
|
olddatacount = datacount;
|
||||||
if (unloggedlines > 0)
|
if (unloggedlines > 0)
|
||||||
{
|
{
|
||||||
//sprintf(str_result, "(%d lines skipped)", unloggedlines);
|
//snprintf(str_result, "(%d lines skipped)", unloggedlines);
|
||||||
rec.skippedLines = unloggedlines;
|
rec.skippedLines = unloggedlines;
|
||||||
unloggedlines = 0;
|
unloggedlines = 0;
|
||||||
}
|
}
|
||||||
|
@ -1265,8 +1265,8 @@ void FCEUD_TraceInstruction(uint8 *opcode, int size)
|
||||||
|
|
||||||
if ((addr + size) > 0xFFFF)
|
if ((addr + size) > 0xFFFF)
|
||||||
{
|
{
|
||||||
//sprintf(str_data, "%02X ", opcode[0]);
|
//snprintf(str_data, "%02X ", opcode[0]);
|
||||||
//sprintf(str_disassembly, "OVERFLOW");
|
//snprintf(str_disassembly, "OVERFLOW");
|
||||||
rec.flags |= 0x01;
|
rec.flags |= 0x01;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1275,7 +1275,7 @@ void FCEUD_TraceInstruction(uint8 *opcode, int size)
|
||||||
switch (size)
|
switch (size)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
//sprintf(str_disassembly,"UNDEFINED");
|
//snprintf(str_disassembly,"UNDEFINED");
|
||||||
rec.flags |= 0x02;
|
rec.flags |= 0x02;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -1912,13 +1912,13 @@ void QTraceLogView::openBpEditWindow(int editIdx, watchpointinfo *wp, traceRecor
|
||||||
sprite_radio->setChecked(true);
|
sprite_radio->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(stmp, "%04X", wp->address);
|
snprintf(stmp, sizeof(stmp), "%04X", wp->address);
|
||||||
|
|
||||||
addr1->setText(tr(stmp));
|
addr1->setText(tr(stmp));
|
||||||
|
|
||||||
if (wp->endaddress > 0)
|
if (wp->endaddress > 0)
|
||||||
{
|
{
|
||||||
sprintf(stmp, "%04X", wp->endaddress);
|
snprintf(stmp, sizeof(stmp), "%04X", wp->endaddress);
|
||||||
|
|
||||||
addr2->setText(tr(stmp));
|
addr2->setText(tr(stmp));
|
||||||
}
|
}
|
||||||
|
@ -1958,11 +1958,11 @@ void QTraceLogView::openBpEditWindow(int editIdx, watchpointinfo *wp, traceRecor
|
||||||
char str[64];
|
char str[64];
|
||||||
if ((wp->address == recp->cpu.PC) && (recp->bank >= 0))
|
if ((wp->address == recp->cpu.PC) && (recp->bank >= 0))
|
||||||
{
|
{
|
||||||
sprintf(str, "K==#%02X", recp->bank);
|
snprintf(str, sizeof(str), "K==#%02X", recp->bank);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(str, "K==#%02X", getBank(wp->address));
|
snprintf(str, sizeof(str), "K==#%02X", getBank(wp->address));
|
||||||
}
|
}
|
||||||
cond->setText(tr(str));
|
cond->setText(tr(str));
|
||||||
}
|
}
|
||||||
|
@ -2415,7 +2415,7 @@ void TraceLogDiskThread_t::run(void)
|
||||||
if (!tracer.open(logFilePath.c_str(), (bool)FCEUI_EmulationPaused()))
|
if (!tracer.open(logFilePath.c_str(), (bool)FCEUI_EmulationPaused()))
|
||||||
{
|
{
|
||||||
char stmp[1024];
|
char stmp[1024];
|
||||||
sprintf( stmp, "Error: Failed to open log file for writing: %s", logFilePath.c_str() );
|
snprintf( stmp, sizeof(stmp), "Error: Failed to open log file for writing: %s", logFilePath.c_str() );
|
||||||
consoleWindow->QueueErrorMsgWindow(stmp);
|
consoleWindow->QueueErrorMsgWindow(stmp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2431,7 +2431,7 @@ void TraceLogDiskThread_t::run(void)
|
||||||
if ( logFile == -1 )
|
if ( logFile == -1 )
|
||||||
{
|
{
|
||||||
char stmp[1024];
|
char stmp[1024];
|
||||||
sprintf( stmp, "Error: Failed to open log file for writing: %s", logFilePath.c_str() );
|
snprintf( stmp, sizeof(stmp), "Error: Failed to open log file for writing: %s", logFilePath.c_str() );
|
||||||
consoleWindow->QueueErrorMsgWindow(stmp);
|
consoleWindow->QueueErrorMsgWindow(stmp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -817,7 +817,7 @@ InitConfig()
|
||||||
for (unsigned int i=0; i<10; i++)
|
for (unsigned int i=0; i<10; i++)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
sprintf(buf, "SDL.RecentRom%02u", i);
|
snprintf(buf, sizeof(buf), "SDL.RecentRom%02u", i);
|
||||||
|
|
||||||
config->addOption( buf, "");
|
config->addOption( buf, "");
|
||||||
}
|
}
|
||||||
|
@ -825,7 +825,7 @@ InitConfig()
|
||||||
for (unsigned int i=0; i<10; i++)
|
for (unsigned int i=0; i<10; i++)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
sprintf(buf, "SDL.RecentTasProject%02u", i);
|
snprintf(buf, sizeof(buf), "SDL.RecentTasProject%02u", i);
|
||||||
|
|
||||||
config->addOption( buf, "");
|
config->addOption( buf, "");
|
||||||
}
|
}
|
||||||
|
@ -1084,7 +1084,7 @@ InitConfig()
|
||||||
|
|
||||||
//keyText.assign(" mod=");
|
//keyText.assign(" mod=");
|
||||||
|
|
||||||
//sprintf( buf, " key=%s", SDL_GetKeyName( Hotkeys[i] ) );
|
//snprintf( buf, sizeof(buf), " key=%s", SDL_GetKeyName( Hotkeys[i] ) );
|
||||||
|
|
||||||
if ( hotKeyName[0] != 0 )
|
if ( hotKeyName[0] != 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1371,7 +1371,7 @@ void fceuWrapperLock(const char *filename, int line, const char *func)
|
||||||
printf("Already Locked By: %s\n", lockFile.c_str() );
|
printf("Already Locked By: %s\n", lockFile.c_str() );
|
||||||
printf("Requested By: %s:%i - %s\n", filename, line, func );
|
printf("Requested By: %s:%i - %s\n", filename, line, func );
|
||||||
}
|
}
|
||||||
sprintf( txt, ":%i - ", line );
|
snprintf( txt, sizeof(txt), ":%i - ", line );
|
||||||
lockFile.assign(filename);
|
lockFile.assign(filename);
|
||||||
lockFile.append(txt);
|
lockFile.append(txt);
|
||||||
lockFile.append(func);
|
lockFile.append(func);
|
||||||
|
@ -1398,7 +1398,7 @@ bool fceuWrapperTryLock(const char *filename, int line, const char *func, int ti
|
||||||
if ( lockAcq && debugMutexLock)
|
if ( lockAcq && debugMutexLock)
|
||||||
{
|
{
|
||||||
char txt[32];
|
char txt[32];
|
||||||
sprintf( txt, ":%i - ", line );
|
snprintf( txt, sizeof(txt), ":%i - ", line );
|
||||||
lockFile.assign(filename);
|
lockFile.assign(filename);
|
||||||
lockFile.append(txt);
|
lockFile.append(txt);
|
||||||
lockFile.append(func);
|
lockFile.append(func);
|
||||||
|
|
|
@ -238,7 +238,7 @@ iNesHeaderEditor_t::iNesHeaderEditor_t(QWidget *parent)
|
||||||
|
|
||||||
for (i = 0; bmap[i].init; ++i)
|
for (i = 0; bmap[i].init; ++i)
|
||||||
{
|
{
|
||||||
sprintf(stmp, "%d %s", bmap[i].number, bmap[i].name);
|
snprintf(stmp, sizeof(stmp), "%d %s", bmap[i].number, bmap[i].name);
|
||||||
|
|
||||||
mapperComboBox->addItem( tr(stmp), bmap[i].number );
|
mapperComboBox->addItem( tr(stmp), bmap[i].number );
|
||||||
}
|
}
|
||||||
|
@ -307,25 +307,25 @@ iNesHeaderEditor_t::iNesHeaderEditor_t(QWidget *parent)
|
||||||
if (size >= 1024 << 3)
|
if (size >= 1024 << 3)
|
||||||
{
|
{
|
||||||
// The size of CHR ROM must be multiple of 8KB
|
// The size of CHR ROM must be multiple of 8KB
|
||||||
sprintf( stmp, "%d KB", size / 1024);
|
snprintf( stmp, sizeof(stmp), "%d KB", size / 1024);
|
||||||
chrRomBox->addItem( tr(stmp), size );
|
chrRomBox->addItem( tr(stmp), size );
|
||||||
|
|
||||||
// The size of PRG ROM must be multiple of 16KB
|
// The size of PRG ROM must be multiple of 16KB
|
||||||
if (size >= 1024 * 16)
|
if (size >= 1024 * 16)
|
||||||
{
|
{
|
||||||
// PRG ROM
|
// PRG ROM
|
||||||
sprintf(stmp, "%d KB", size / 1024);
|
snprintf(stmp, sizeof(stmp), "%d KB", size / 1024);
|
||||||
prgRomBox->addItem( tr(stmp), size );
|
prgRomBox->addItem( tr(stmp), size );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size >= 1024)
|
if (size >= 1024)
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%d KB", size / 1024);
|
snprintf( stmp, sizeof(stmp), "%d KB", size / 1024);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%d B", size);
|
snprintf( stmp, sizeof(stmp), "%d B", size);
|
||||||
}
|
}
|
||||||
|
|
||||||
prgRamBox->addItem( tr(stmp), size );
|
prgRamBox->addItem( tr(stmp), size );
|
||||||
|
@ -911,7 +911,7 @@ void iNesHeaderEditor_t::setHeaderData(iNES_HEADER* header)
|
||||||
{
|
{
|
||||||
if ( mapperComboBox->itemData(i).toInt() > mapper )
|
if ( mapperComboBox->itemData(i).toInt() > mapper )
|
||||||
{
|
{
|
||||||
sprintf( buf, "%i Unknown/unsupported", i);
|
snprintf( buf, sizeof(buf), "%i Unknown/unsupported", i);
|
||||||
mapperComboBox->insertItem( i, tr(buf), mapper);
|
mapperComboBox->insertItem( i, tr(buf), mapper);
|
||||||
mapperComboBox->setCurrentIndex(i);
|
mapperComboBox->setCurrentIndex(i);
|
||||||
break;
|
break;
|
||||||
|
@ -924,7 +924,7 @@ void iNesHeaderEditor_t::setHeaderData(iNES_HEADER* header)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sub Mapper
|
// Sub Mapper
|
||||||
sprintf(buf, "%d", ines20 ? header->ROM_type3 >> 4 : 0);
|
snprintf(buf, sizeof(buf), "%d", ines20 ? header->ROM_type3 >> 4 : 0);
|
||||||
|
|
||||||
mapperSubEdit->setText( tr(buf) );
|
mapperSubEdit->setText( tr(buf) );
|
||||||
|
|
||||||
|
@ -1210,7 +1210,7 @@ void iNesHeaderEditor_t::setHeaderData(iNES_HEADER* header)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Miscellaneous ROM Area(s)
|
// Miscellaneous ROM Area(s)
|
||||||
sprintf(buf, "%d", header->misc_roms & 3);
|
snprintf(buf, sizeof(buf), "%d", header->misc_roms & 3);
|
||||||
miscRomsEdit->setText( tr(buf) );
|
miscRomsEdit->setText( tr(buf) );
|
||||||
|
|
||||||
// Trainer
|
// Trainer
|
||||||
|
@ -1398,7 +1398,7 @@ bool iNesHeaderEditor_t::WriteHeaderData(iNES_HEADER* header)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(buf, "Error: Mapper# should be less than %d in iNES %d.0 format.", 256, 1);
|
snprintf(buf, sizeof(buf), "Error: Mapper# should be less than %d in iNES %d.0 format.", 256, 1);
|
||||||
showErrorMsgWindow(buf);
|
showErrorMsgWindow(buf);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1406,7 +1406,7 @@ bool iNesHeaderEditor_t::WriteHeaderData(iNES_HEADER* header)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(buf, "Mapper# should be less than %d in iNES %d.0 format.", 4096, 2);
|
snprintf(buf, sizeof(buf), "Mapper# should be less than %d in iNES %d.0 format.", 4096, 2);
|
||||||
showErrorMsgWindow(buf);
|
showErrorMsgWindow(buf);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1483,13 +1483,13 @@ bool iNesHeaderEditor_t::WriteHeaderData(iNES_HEADER* header)
|
||||||
char buf2[64];
|
char buf2[64];
|
||||||
if (result % 1024 != 0)
|
if (result % 1024 != 0)
|
||||||
{
|
{
|
||||||
sprintf(buf2, "%dB", result);
|
snprintf(buf2, sizeof(buf2), "%dB", result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(buf2, "%dKB", result / 1024);
|
snprintf(buf2, sizeof(buf2), "%dKB", result / 1024);
|
||||||
}
|
}
|
||||||
sprintf(buf, "PRG ROM size you entered is invalid in iNES 2.0, do you want to set to its nearest value %s?", buf2);
|
snprintf(buf, sizeof(buf), "PRG ROM size you entered is invalid in iNES 2.0, do you want to set to its nearest value %s?", buf2);
|
||||||
showErrorMsgWindow(buf);
|
showErrorMsgWindow(buf);
|
||||||
//if (MessageBox(hwnd, buf, "Error", MB_YESNO | MB_ICONERROR) == IDYES)
|
//if (MessageBox(hwnd, buf, "Error", MB_YESNO | MB_ICONERROR) == IDYES)
|
||||||
//{
|
//{
|
||||||
|
@ -1691,13 +1691,13 @@ bool iNesHeaderEditor_t::WriteHeaderData(iNES_HEADER* header)
|
||||||
char buf2[64];
|
char buf2[64];
|
||||||
if (result % 1024 != 0)
|
if (result % 1024 != 0)
|
||||||
{
|
{
|
||||||
sprintf(buf2, "%dB", result);
|
snprintf(buf2, sizeof(buf2), "%dB", result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf(buf2, "%dKB", result / 1024);
|
snprintf(buf2, sizeof(buf2), "%dKB", result / 1024);
|
||||||
}
|
}
|
||||||
sprintf(buf, "CHR ROM size you entered is invalid in iNES 2.0, do you want to set to its nearest value %s?", buf2);
|
snprintf(buf, sizeof(buf), "CHR ROM size you entered is invalid in iNES 2.0, do you want to set to its nearest value %s?", buf2);
|
||||||
showErrorMsgWindow(buf);
|
showErrorMsgWindow(buf);
|
||||||
//if (MessageBox(hwnd, buf, "Error", MB_YESNO | MB_ICONERROR) == IDYES)
|
//if (MessageBox(hwnd, buf, "Error", MB_YESNO | MB_ICONERROR) == IDYES)
|
||||||
// SetDlgItemText(hwnd, IDC_CHRROM_COMBO, buf2);
|
// SetDlgItemText(hwnd, IDC_CHRROM_COMBO, buf2);
|
||||||
|
@ -1986,7 +1986,7 @@ bool iNesHeaderEditor_t::WriteHeaderData(iNES_HEADER* header)
|
||||||
int ret;
|
int ret;
|
||||||
QMessageBox msgBox(this);
|
QMessageBox msgBox(this);
|
||||||
|
|
||||||
sprintf(buf, "FCEUX doesn't support iNES Mapper# %d, this is not a serious problem, but the ROM will not be run in FCEUX properly.\nDo you want to continue?", mapper);
|
snprintf(buf, sizeof(buf), "FCEUX doesn't support iNES Mapper# %d, this is not a serious problem, but the ROM will not be run in FCEUX properly.\nDo you want to continue?", mapper);
|
||||||
|
|
||||||
msgBox.setIcon( QMessageBox::Warning );
|
msgBox.setIcon( QMessageBox::Warning );
|
||||||
msgBox.setText( tr(buf) );
|
msgBox.setText( tr(buf) );
|
||||||
|
|
|
@ -2138,7 +2138,7 @@ const char *ButtonName(const ButtConfig *bc)
|
||||||
inputNum = bc->ButtonNum;
|
inputNum = bc->ButtonNum;
|
||||||
inputDirection = "";
|
inputDirection = "";
|
||||||
}
|
}
|
||||||
sprintf(name, "js%i:%s%i%s", joyNum, inputType, inputNum, inputDirection);
|
snprintf(name, sizeof(name), "js%i:%s%i%s", joyNum, inputType, inputNum, inputDirection);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -887,7 +887,7 @@ void ppuPatternView_t::updateSelTileLabel(void)
|
||||||
char stmp[32];
|
char stmp[32];
|
||||||
if ( (selTile.y() >= 0) && (selTile.x() >= 0) )
|
if ( (selTile.y() >= 0) && (selTile.x() >= 0) )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Tile: $%X%X", selTile.y(), selTile.x() );
|
snprintf( stmp, sizeof(stmp), "Tile: $%X%X", selTile.y(), selTile.x() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -949,7 +949,7 @@ void ppuPatternView_t::contextMenuEvent(QContextMenuEvent *event)
|
||||||
|
|
||||||
if ( mode )
|
if ( mode )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "Exit Tile &View: %X%X", selTile.y(), selTile.x() );
|
snprintf( stmp, sizeof(stmp), "Exit Tile &View: %X%X", selTile.y(), selTile.x() );
|
||||||
|
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
act->setShortcut( QKeySequence(tr("Z")));
|
act->setShortcut( QKeySequence(tr("Z")));
|
||||||
|
@ -958,7 +958,7 @@ void ppuPatternView_t::contextMenuEvent(QContextMenuEvent *event)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "&View Tile: %X%X", selTile.y(), selTile.x() );
|
snprintf( stmp, sizeof(stmp), "&View Tile: %X%X", selTile.y(), selTile.x() );
|
||||||
|
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
act->setShortcut( QKeySequence(tr("Z")));
|
act->setShortcut( QKeySequence(tr("Z")));
|
||||||
|
@ -987,7 +987,7 @@ void ppuPatternView_t::contextMenuEvent(QContextMenuEvent *event)
|
||||||
{
|
{
|
||||||
char stmp[8];
|
char stmp[8];
|
||||||
|
|
||||||
sprintf( stmp, "&%i", i+1 );
|
snprintf( stmp, sizeof(stmp), "&%i", i+1 );
|
||||||
|
|
||||||
paletteAct[i] = new QAction(tr(stmp), &menu);
|
paletteAct[i] = new QAction(tr(stmp), &menu);
|
||||||
paletteAct[i]->setCheckable(true);
|
paletteAct[i]->setCheckable(true);
|
||||||
|
@ -1787,13 +1787,13 @@ void tilePaletteView_t::contextMenuEvent(QContextMenuEvent *event)
|
||||||
|
|
||||||
subMenu = menu.addMenu( tr("Copy Color to Clipboard") );
|
subMenu = menu.addMenu( tr("Copy Color to Clipboard") );
|
||||||
|
|
||||||
sprintf( stmp, "Hex #%02X%02X%02X", palo[i].r, palo[i].g, palo[i].b );
|
snprintf( stmp, sizeof(stmp), "Hex #%02X%02X%02X", palo[i].r, palo[i].g, palo[i].b );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
//act->setShortcut( QKeySequence(tr("G")));
|
//act->setShortcut( QKeySequence(tr("G")));
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(copyColor2ClipBoardHex(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(copyColor2ClipBoardHex(void)) );
|
||||||
subMenu->addAction( act );
|
subMenu->addAction( act );
|
||||||
|
|
||||||
sprintf( stmp, "rgb(%3i,%3i,%3i)", palo[i].r, palo[i].g, palo[i].b );
|
snprintf( stmp, sizeof(stmp), "rgb(%3i,%3i,%3i)", palo[i].r, palo[i].g, palo[i].b );
|
||||||
act = new QAction(tr(stmp), &menu);
|
act = new QAction(tr(stmp), &menu);
|
||||||
//act->setShortcut( QKeySequence(tr("G")));
|
//act->setShortcut( QKeySequence(tr("G")));
|
||||||
connect( act, SIGNAL(triggered(void)), this, SLOT(copyColor2ClipBoardRGB(void)) );
|
connect( act, SIGNAL(triggered(void)), this, SLOT(copyColor2ClipBoardRGB(void)) );
|
||||||
|
@ -1815,7 +1815,7 @@ void tilePaletteView_t::copyColor2ClipBoardHex(void)
|
||||||
}
|
}
|
||||||
p = palcache[ (palIdx << 2) | selBox ];
|
p = palcache[ (palIdx << 2) | selBox ];
|
||||||
|
|
||||||
sprintf( txt, "#%02X%02X%02X", palo[p].r, palo[p].g, palo[p].b );
|
snprintf( txt, sizeof(txt), "#%02X%02X%02X", palo[p].r, palo[p].g, palo[p].b );
|
||||||
|
|
||||||
clipboard->setText( tr(txt), QClipboard::Clipboard );
|
clipboard->setText( tr(txt), QClipboard::Clipboard );
|
||||||
|
|
||||||
|
@ -1837,7 +1837,7 @@ void tilePaletteView_t::copyColor2ClipBoardRGB(void)
|
||||||
}
|
}
|
||||||
p = palcache[ (palIdx << 2) | selBox ];
|
p = palcache[ (palIdx << 2) | selBox ];
|
||||||
|
|
||||||
sprintf( txt, "rgb(%3i,%3i,%3i)", palo[p].r, palo[p].g, palo[p].b );
|
snprintf( txt, sizeof(txt), "rgb(%3i,%3i,%3i)", palo[p].r, palo[p].g, palo[p].b );
|
||||||
|
|
||||||
clipboard->setText( tr(txt), QClipboard::Clipboard );
|
clipboard->setText( tr(txt), QClipboard::Clipboard );
|
||||||
|
|
||||||
|
@ -2164,7 +2164,7 @@ void ppuTileEditor_t::setTile( QPoint *t )
|
||||||
addr = addr + ( t->y() * 0x0100 );
|
addr = addr + ( t->y() * 0x0100 );
|
||||||
addr = addr + ( t->x() * 0x0010 );
|
addr = addr + ( t->x() * 0x0010 );
|
||||||
|
|
||||||
sprintf( stmp, "Tile Index: $%X%X Address: $%04X", t->y(), t->x(), addr );
|
snprintf( stmp, sizeof(stmp), "Tile Index: $%X%X Address: $%04X", t->y(), t->x(), addr );
|
||||||
tileIdxLbl->setText( tr(stmp) );
|
tileIdxLbl->setText( tr(stmp) );
|
||||||
|
|
||||||
tileView->setTile( t );
|
tileView->setTile( t );
|
||||||
|
@ -2490,7 +2490,7 @@ void ppuTileView_t::contextMenuEvent(QContextMenuEvent *event)
|
||||||
//
|
//
|
||||||
// if ( mode )
|
// if ( mode )
|
||||||
// {
|
// {
|
||||||
// sprintf( stmp, "Exit Tile View: %X%X", selTile.y(), selTile.x() );
|
// snprintf( stmp, sizeof(stmp), "Exit Tile View: %X%X", selTile.y(), selTile.x() );
|
||||||
//
|
//
|
||||||
// act = new QAction(tr(stmp), &menu);
|
// act = new QAction(tr(stmp), &menu);
|
||||||
// act->setShortcut( QKeySequence(tr("Z")));
|
// act->setShortcut( QKeySequence(tr("Z")));
|
||||||
|
@ -2506,7 +2506,7 @@ void ppuTileView_t::contextMenuEvent(QContextMenuEvent *event)
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// sprintf( stmp, "View Tile: %X%X", selTile.y(), selTile.x() );
|
// snprintf( stmp, sizeof(stmp), "View Tile: %X%X", selTile.y(), selTile.x() );
|
||||||
//
|
//
|
||||||
// act = new QAction(tr(stmp), &menu);
|
// act = new QAction(tr(stmp), &menu);
|
||||||
// act->setShortcut( QKeySequence(tr("Z")));
|
// act->setShortcut( QKeySequence(tr("Z")));
|
||||||
|
@ -2533,7 +2533,7 @@ void ppuTileView_t::contextMenuEvent(QContextMenuEvent *event)
|
||||||
// {
|
// {
|
||||||
// char stmp[8];
|
// char stmp[8];
|
||||||
//
|
//
|
||||||
// sprintf( stmp, "%i", i+1 );
|
// snprintf( stmp, sizeof(stmp), "%i", i+1 );
|
||||||
//
|
//
|
||||||
// paletteAct[i] = new QAction(tr(stmp), &menu);
|
// paletteAct[i] = new QAction(tr(stmp), &menu);
|
||||||
// paletteAct[i]->setCheckable(true);
|
// paletteAct[i]->setCheckable(true);
|
||||||
|
@ -2728,7 +2728,7 @@ void ppuTileEditColorPicker_t::mouseMoveEvent(QMouseEvent *event)
|
||||||
// char stmp[64];
|
// char stmp[64];
|
||||||
// int ix = (tile.y()<<4)|tile.x();
|
// int ix = (tile.y()<<4)|tile.x();
|
||||||
|
|
||||||
// sprintf( stmp, "Palette: $%02X", palcache[ix]);
|
// snprintf( stmp, sizeof(stmp), "Palette: $%02X", palcache[ix]);
|
||||||
|
|
||||||
// frame->setTitle( tr(stmp) );
|
// frame->setTitle( tr(stmp) );
|
||||||
//}
|
//}
|
||||||
|
@ -3192,25 +3192,25 @@ void spriteViewerDialog_t::periodicUpdate(void)
|
||||||
|
|
||||||
idx = oamView->getSpriteIndex();
|
idx = oamView->getSpriteIndex();
|
||||||
|
|
||||||
sprintf( stmp, "$%02X", idx );
|
snprintf( stmp, sizeof(stmp), "$%02X", idx );
|
||||||
spriteIndexBox->setText( tr(stmp) );
|
spriteIndexBox->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "$%02X", oamPattern.sprite[idx].tNum );
|
snprintf( stmp, sizeof(stmp), "$%02X", oamPattern.sprite[idx].tNum );
|
||||||
tileIndexBox->setText( tr(stmp) );
|
tileIndexBox->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "$%04X", oamPattern.sprite[idx].chrAddr );
|
snprintf( stmp, sizeof(stmp), "$%04X", oamPattern.sprite[idx].chrAddr );
|
||||||
tileAddrBox->setText( tr(stmp) );
|
tileAddrBox->setText( tr(stmp) );
|
||||||
|
|
||||||
sprintf( stmp, "$%04X", 0x3F00 + (oamPattern.sprite[idx].pal*4) );
|
snprintf( stmp, sizeof(stmp), "$%04X", 0x3F00 + (oamPattern.sprite[idx].pal*4) );
|
||||||
palAddrBox->setText( tr(stmp) );
|
palAddrBox->setText( tr(stmp) );
|
||||||
|
|
||||||
if ( showPosHex->isChecked() )
|
if ( showPosHex->isChecked() )
|
||||||
{
|
{
|
||||||
sprintf( stmp, "$%02X, $%02X", oamPattern.sprite[idx].x, oamPattern.sprite[idx].y );
|
snprintf( stmp, sizeof(stmp), "$%02X, $%02X", oamPattern.sprite[idx].x, oamPattern.sprite[idx].y );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sprintf( stmp, "%3i, %3i", oamPattern.sprite[idx].x, oamPattern.sprite[idx].y );
|
snprintf( stmp, sizeof(stmp), "%3i, %3i", oamPattern.sprite[idx].x, oamPattern.sprite[idx].y );
|
||||||
}
|
}
|
||||||
posBox->setText( tr(stmp) );
|
posBox->setText( tr(stmp) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue