コード例 #1
0
ファイル: common.c プロジェクト: 173210/px68k
void Error(const char* s)
{
	char title[80];
	sprintf(title, "%s エラー\0", PrgTitle);

	SSTP_SendMes(SSTPMES_ERROR);

	MessageBox(hWndMain, s, title, MB_ICONERROR | MB_OK);
}
コード例 #2
0
ファイル: winx68k.cpp プロジェクト: ptitSeb/px68k
int
WinX68k_LoadROMs(void)
{
	static const char *BIOSFILE[] = {
		"iplrom.dat", "iplrom30.dat", "iplromco.dat", "iplromxv.dat"
	};
	static const char FONTFILE[] = "cgrom.dat";
	static const char FONTFILETMP[] = "cgrom.tmp";
	FILEH fp;
	int i;
	BYTE tmp;

	for (fp = 0, i = 0; fp == 0 && i < NELEMENTS(BIOSFILE); ++i) {
		fp = File_OpenCurDir((char *)BIOSFILE[i]);
	}

	if (fp == 0) {
		Error("BIOS ROM not found.");
		return FALSE;
	}

	File_Read(fp, &IPL[0x20000], 0x20000);
	File_Close(fp);

	WinX68k_SCSICheck();	// SCSI IPL�ʤ顢$fc0000����SCSI BIOS���֤�

	for (i = 0; i < 0x40000; i += 2) {
		tmp = IPL[i];
		IPL[i] = IPL[i + 1];
		IPL[i + 1] = tmp;
	}

	fp = File_OpenCurDir((char *)FONTFILE);
	if (fp == 0) {
		// cgrom.tmp�����롩
		fp = File_OpenCurDir((char *)FONTFILETMP);
		if (fp == 0) {
#if 1
			// �ե�������� XXX
			printf("�ե����ROM���᡼�������Ĥ���ޤ���\n");
			return FALSE;
#else
			MessageBox(hWndMain,
				"�ե����ROM���᡼�������Ĥ���ޤ���.\nWindows�ե���Ȥ��鿷���˺������ޤ�.",
				"����ԡ��Υ�å�����", MB_ICONWARNING | MB_OK);
			SSTP_SendMes(SSTPMES_MAKEFONT);
			make_cgromdat(FONT, FALSE, "�ͣ� �����å�", "�ͣ� ��ī");
			//WinX68k_MakeFont();
			//DialogBox(hInst, MAKEINTRESOURCE(IDD_PROGBAR),
			//		hWndMain, (DLGPROC)MakeFontProc);
			fp = File_CreateCurDir(FONTFILETMP);
			if (fp)
			{
				File_Write(fp, FONT, 0xc0000);
				File_Close(fp);
				return TRUE;
			}
			return TRUE;
#endif
		}
	}
	File_Read(fp, FONT, 0xc0000);
	File_Close(fp);

	return TRUE;
}