MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / CmdNTSC

Function CmdNTSC

source/Debugger/Debug.cpp:5328–5941  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

5326
5327//===========================================================================
5328Update_t CmdNTSC (int nArgs)
5329{
5330 int iParam;
5331 int nFound = FindParam( g_aArgs[ 1 ].sArg, MATCH_EXACT, iParam, _PARAM_GENERAL_BEGIN, _PARAM_GENERAL_END );
5332
5333 struct KnownFileType_t
5334 {
5335 const char *pExtension;
5336 };
5337
5338 enum KnownFileType_e
5339 {
5340 TYPE_UNKNOWN
5341 ,TYPE_BMP
5342 ,TYPE_RAW
5343 ,NUM_FILE_TYPES
5344 };
5345
5346 const KnownFileType_t aFileTypes[ NUM_FILE_TYPES ] =
5347 {
5348 { "" } // n/a
5349 ,{ ".bmp" }
5350 ,{ ".data" }
5351// ,{ ".raw" }
5352// ,{ ".ntsc" }
5353 };
5354 const int nFileType = sizeof( aFileTypes ) / sizeof( KnownFileType_t );
5355 const KnownFileType_t *pFileType = NULL;
5356 /* */ KnownFileType_e iFileType = TYPE_UNKNOWN;
5357
5358#if _DEBUG
5359 assert( (nFileType == NUM_FILE_TYPES) );
5360#endif
5361
5362 const char *pFileName = (nArgs > 1) ? g_aArgs[ 2 ].sArg : "";
5363 int nLen = (int) strlen( pFileName );
5364 const char *pEnd = pFileName + nLen - 1;
5365 while ( pEnd > pFileName )
5366 {
5367 if ( *pEnd == '.' )
5368 {
5369 for ( int i = TYPE_BMP; i < NUM_FILE_TYPES; i++ )
5370 {
5371 if ( strcmp( pEnd, aFileTypes[i].pExtension ) == 0 )
5372 {
5373 pFileType = &aFileTypes[i];
5374 iFileType = (KnownFileType_e) i;
5375 break;
5376 }
5377 }
5378 }
5379
5380 if ( pFileType )
5381 break;
5382
5383 pEnd--;
5384 }
5385

Callers

nothing calls this directly

Calls 10

FindParamFunction · 0.85
NTSC_VideoGetChromaTableFunction · 0.85
NTSC_VideoInitChromaFunction · 0.85
_GetFileSizeFunction · 0.85
StrFormatFunction · 0.85
HelpLastCommandFunction · 0.85
GetVideoTypeMethod · 0.80
Video_SetBitmapHeaderMethod · 0.80
ConsoleBufferPushFunction · 0.70
ConsoleUpdateFunction · 0.70

Tested by

no test coverage detected