Пример #1
0
//
//   FUNCTION: InitInstance(HINSTANCE, int)
//
//   PURPOSE: Saves instance handle and creates main window
//
//   COMMENTS:
//
//        In this function, we save the instance handle in a global variable and
//        create and display the main program window.
//
BOOL InitInstance(HINSTANCE /*hInstance*/, int /*nCmdShow*/)
{
    INITCOMMONCONTROLSEX ics;  ics.dwSize = sizeof(ics);
    ics.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(&ics);

#if !defined(PRODUCT)
    DebugLogClear();
#endif
    Settings_Init();

    ParseCommandLine();  // Override settings by command-line option if needed

    if (!Emulator_Init())
        return FALSE;
    WORD conf = (WORD) Settings_GetConfiguration();
    if (conf == 0) conf = EMU_CONF_NEMIGA303;
    if (!Emulator_InitConfiguration(conf))
        return FALSE;
    Emulator_SetSound(Settings_GetSound());
    Emulator_SetSpeed(Settings_GetRealSpeed());

    if (!CreateMainWindow())
        return FALSE;

    return TRUE;
}
Пример #2
0
//
//   FUNCTION: InitInstance(HINSTANCE, int)
//
//   PURPOSE: Saves instance handle and creates main window
//
//   COMMENTS:
//
//        In this function, we save the instance handle in a global variable and
//        create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
    INITCOMMONCONTROLSEX ics;  ics.dwSize = sizeof(ics);
    ics.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(&ics);

#if !defined(PRODUCT)
    DebugLogClear();
#endif
    Settings_Init();
    //Joystick_Init();
    //Joystick_SelectJoystick(Settings_GetJoystick());
    if (!Emulator_Init())
        return FALSE;

    int conf = Settings_GetConfiguration();
    //if (conf == 0) //TODO
    if (!Emulator_InitConfiguration((NeonConfiguration)conf))
        return FALSE;

    Emulator_SetSound(Settings_GetSound());

    if (!CreateMainWindow())
        return FALSE;

    return TRUE;
}
Пример #3
0
//
//   FUNCTION: InitInstance(HINSTANCE, int)
//
//   PURPOSE: Saves instance handle and creates main window
//
//   COMMENTS:
//
//        In this function, we save the instance handle in a global variable and
//        create and display the main program window.
//
BOOL InitInstance(HINSTANCE /*hInstance*/, int /*nCmdShow*/)
{
    INITCOMMONCONTROLSEX ics;  ics.dwSize = sizeof(ics);
    ics.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(&ics);

#if !defined(PRODUCT)
    DebugLogClear();
#endif
    Settings_Init();
    if (!Emulator_Init()) return FALSE;
    Emulator_SetSound(Settings_GetSound());

    if (!CreateMainWindow())
        return FALSE;

    return TRUE;
}
Пример #4
0
int main()
{
	
	int turn = 0;
	previousPWMSignal = readPWMSignal();
	LCD_Init();
	BTN_Init();
	Settings_Init(all_settings);
	Relay_Init();
	resetPWMParts(all_settings);

	ledON;
	/*LCD_Clear_Display();
	LCD_2buffer_begin();
	LCD_2buffer_printStr("HELLO");
	LCD_2buffer_end();
	while (1)
	{
		ledOFF;
		_delay_ms(1000);
		ledON;
		_delay_ms(1000);		
	}*/
	
	while (1)
	{
		uint8_t q = readPWMSignal();
		if (q!=previousPWMSignal)
		{
			onPWMSignalChange();			
		}
		previousPWMSignal = q;
		
		
		BTN_Process();
		_delay_ms(1);
		//LCD_Clear_Display();
		switch(current_status)
		{
			case STATUS_DEFAULT:
				DoWork();			
			break;
			case STATUS_TERM:
				ShowTerm();
			break; 
			case STATUS_SETTINGS:
				ShowSettings();
			break; 
			case STATUS_RELAY:
				ShowRelayMenu();
			break; 
			case STATUS_RESET:
				ShowReset();
			break;
		}
		

		


	}
	return 0;
}