Exemple #1
0
/**
 * Initialization
 */
void NvRam_Init(void)
{
	const char sBaseName[] = "hatari.nvram";
	const char *psHomeDir;

	// set up the nvram filename
	psHomeDir = Paths_GetHatariHome();
	if (strlen(psHomeDir)+sizeof(sBaseName)+1 < sizeof(nvram_filename))
		sprintf(nvram_filename, "%s%c%s", psHomeDir, PATHSEP, sBaseName);
	else
		strcpy(nvram_filename, sBaseName);

	if (!NvRam_Load())		// load NVRAM file automatically
	{
		if (ConfigureParams.Screen.nMonitorType == MONITOR_TYPE_VGA)   // VGA ?
		{
			nvram[NVRAM_VMODE1] &= ~0x01;		// No doublescan
			nvram[NVRAM_VMODE2] |= 0x10;		// VGA mode
			nvram[NVRAM_VMODE2] &= ~0x20;		// 60 Hz
		}
		else
		{
			nvram[NVRAM_VMODE1] |= 0x01;		// Interlaced
			nvram[NVRAM_VMODE2] &= ~0x10;		// TV/RGB mode
			nvram[NVRAM_VMODE2] |= 0x20;		// 50 Hz
		}
		NvRam_SetChecksum();
	}

	NvRam_Reset();
}
Exemple #2
0
/**
 * Initialise Printer
 */
void Printer_Init(void)
{
#ifdef PRINTER_DEBUG
	fprintf(stderr,"Printer_Init()\n");
#endif

	/* A valid file name for printing is already set up in configuration.c.
	 * But we check it again since the user might have entered an invalid
	 * file name in the hatari.cfg file... */
	if (strlen(ConfigureParams.Printer.szPrintToFileName) <= 1)
	{
		const char *psHomeDir;
		psHomeDir = Paths_GetHatariHome();

		/* construct filename for printing.... */
		if (strlen(psHomeDir)+1+strlen(PRINTER_FILENAME) < sizeof(ConfigureParams.Printer.szPrintToFileName))
		{
			sprintf(ConfigureParams.Printer.szPrintToFileName, "%s%c%s",
			        psHomeDir, PATHSEP, PRINTER_FILENAME);
		}
		else
		{
			strcpy(ConfigureParams.Printer.szPrintToFileName, PRINTER_FILENAME);
		}
	}

#ifdef PRINTER_DEBUG
	fprintf(stderr,"Filename for printing: %s \n", ConfigureParams.Printer.szPrintToFileName);
#endif
}