Example #1
0
void LoadConfig(const char *filename)
{
    FCEUI_GetNTSCTH(&ntsctint, &ntschue);

    LoadFCEUConfig(filename, fceuconfig);

    FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue);

    //adelikat:Hacky fix for Ram Watch recent menu
    for (int x = 0; x < 5; x++)
    {
        if(ramWatchRecent[x])
        {
            strncpy(rw_recent_files[x], ramWatchRecent[x], 1024);
            free(ramWatchRecent[x]);
            ramWatchRecent[x] = 0;
        }
        else
        {
            rw_recent_files[x][0] = 0;
        }
    }

    // Hacky fix for taseditor_config.last_author and rom_name_when_closing_emulator
    if (taseditorConfigLastAuthorName)
    {
        strncpy(taseditorConfig.lastAuthorName, taseditorConfigLastAuthorName, AUTHOR_NAME_MAX_LEN - 1);
        taseditorConfig.lastAuthorName[AUTHOR_NAME_MAX_LEN - 1] = 0;
    } else
    {
        taseditorConfig.lastAuthorName[0] = 0;
    }

    if (ResumeROM)
        strcpy(romNameWhenClosingEmulator, ResumeROM);
    else
        romNameWhenClosingEmulator[0] = 0;

    //-----------------------------------
}
Example #2
0
void LoadConfig(const char *filename)
{
	FCEUI_GetNTSCTH(&ntsctint, &ntschue);

	LoadFCEUConfig(filename, fceuconfig);

	FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue);

	//adelikat:Hacky fix for Ram Watch recent menu
	for (int x = 0; x < 5; x++)
	{
		if(ramWatchRecent[x])
		{
			strncpy(rw_recent_files[x], ramWatchRecent[x], 1024);
			free(ramWatchRecent[x]);
			ramWatchRecent[x] = 0;
		}
		else
		{
			rw_recent_files[x][0] = 0;
		}
	}
	//-----------------------------------
}
Example #3
0
/**
* Callback function for the palette configuration dialog.
**/
BOOL CALLBACK PaletteConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch(uMsg)
	{
		case WM_INITDIALOG:

			if(ntsccol)
			{
				CheckDlgButton(hwndDlg, CHECK_PALETTE_ENABLED, BST_CHECKED);
			}

			SendDlgItemMessage(hwndDlg, CTL_TINT_TRACKBAR, TBM_SETRANGE, 1, MAKELONG(0, 128));
			SendDlgItemMessage(hwndDlg, CTL_HUE_TRACKBAR, TBM_SETRANGE, 1, MAKELONG(0, 128));

			FCEUI_GetNTSCTH(&ntsctint, &ntschue);

			SendDlgItemMessage(hwndDlg, CTL_TINT_TRACKBAR, TBM_SETPOS, 1, ntsctint);
			SendDlgItemMessage(hwndDlg, CTL_HUE_TRACKBAR, TBM_SETPOS, 1, ntschue);

			EnableWindow(GetDlgItem(hwndDlg, BTN_PALETTE_RESET), (eoptions & EO_CPALETTE) ? 1 : 0);

			CenterWindowOnScreen(hwndDlg);

			break;

		case WM_HSCROLL:
			ntsctint = SendDlgItemMessage(hwndDlg, CTL_TINT_TRACKBAR, TBM_GETPOS, 0, (LPARAM)(LPSTR)0);
			ntschue = SendDlgItemMessage(hwndDlg, CTL_HUE_TRACKBAR, TBM_GETPOS, 0, (LPARAM)(LPSTR)0);
			FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue);
			break;

		case WM_CLOSE:
		case WM_QUIT:
			goto gornk;

		case WM_COMMAND:
			if(!(wParam>>16))
			{
				switch(wParam&0xFFFF)
				{
					case CHECK_PALETTE_ENABLED:
						ntsccol ^= 1;
						FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue);
						break;

					case BTN_PALETTE_LOAD:
						if(LoadPaletteFile())
						{
							EnableWindow(GetDlgItem(hwndDlg, BTN_PALETTE_RESET), 1);
						}
						break;

					case BTN_PALETTE_RESET:
						FCEUI_SetPaletteArray(0);
						eoptions &= ~EO_CPALETTE;
						EnableWindow(GetDlgItem(hwndDlg, BTN_PALETTE_RESET), 0);
						break;

					case BUTTON_CLOSE:
gornk:
						DestroyWindow(hwndDlg);
						pwindow = 0; // Yay for user race conditions.
						break;
				}
			}
	}

	return 0;
}
Example #4
0
/**
* Callback function for the palette configuration dialog.
**/
BOOL CALLBACK PaletteConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch(uMsg)
	{
		case WM_INITDIALOG:

			if(ntsccol)
				CheckDlgButton(hwndDlg, CHECK_PALETTE_ENABLED, BST_CHECKED);

			SendDlgItemMessage(hwndDlg, CTL_TINT_TRACKBAR, TBM_SETRANGE, 1, MAKELONG(0, 128));
			SendDlgItemMessage(hwndDlg, CTL_HUE_TRACKBAR, TBM_SETRANGE, 1, MAKELONG(0, 128));

			FCEUI_GetNTSCTH(&ntsctint, &ntschue);

			SendDlgItemMessage(hwndDlg, CTL_TINT_TRACKBAR, TBM_SETPOS, 1, ntsctint);
			SendDlgItemMessage(hwndDlg, CTL_HUE_TRACKBAR, TBM_SETPOS, 1, ntschue);

			if(force_grayscale)
				CheckDlgButton(hwndDlg, CHECK_PALETTE_GRAYSCALE, BST_CHECKED);

			if (eoptions & EO_CPALETTE)
				CheckDlgButton(hwndDlg, CHECK_PALETTE_CUSTOM, BST_CHECKED);

			CenterWindowOnScreen(hwndDlg);

			break;

		case WM_HSCROLL:
			ntsctint = SendDlgItemMessage(hwndDlg, CTL_TINT_TRACKBAR, TBM_GETPOS, 0, (LPARAM)(LPSTR)0);
			ntschue = SendDlgItemMessage(hwndDlg, CTL_HUE_TRACKBAR, TBM_GETPOS, 0, (LPARAM)(LPSTR)0);
			FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue);
			break;

		case WM_CLOSE:
		case WM_QUIT:
			goto gornk;

		case WM_COMMAND:
			if(!(wParam>>16))
			{
				switch(wParam&0xFFFF)
				{
					case CHECK_PALETTE_ENABLED:
						ntsccol ^= 1;
						FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue);
						break;

					case CHECK_PALETTE_GRAYSCALE:
						force_grayscale ^= 1;
						FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue);
						break;

					case BTN_PALETTE_LOAD:
						if(LoadPaletteFile())
							CheckDlgButton(hwndDlg, CHECK_PALETTE_CUSTOM, BST_CHECKED);
						break;

					case CHECK_PALETTE_CUSTOM:
					{
						if (eoptions & EO_CPALETTE)
						{
							// switch back to default palette
							FCEUI_SetPaletteArray(0);
							eoptions &= ~EO_CPALETTE;
						} else
						{
							// switch to custom, even if it isn't loaded yet
							FCEUI_SetPaletteArray(cpalette);
							eoptions |= EO_CPALETTE;
						}
						break;
					}

					case BUTTON_CLOSE:
gornk:
						DestroyWindow(hwndDlg);
						pwindow = 0; // Yay for user race conditions.
						break;
				}
			}
	}

	return 0;
}