main.cpp
bool ShowSavePrompt(cFile *File)
{
	SceCtrlData Pad;
	bool Ret = true;
	
	if(File->Saved) return true;
	WaitForButtonRelease(&Pad);
	pspDebugScreenClear();
	pspDebugScreenSetXY(0, 0);
	pspDebugScreenSetTextColor(YELLOW);
	printf("Save changes to\n%s?\nO or X: Yes\nTriangle: No\nSquare: Cancel\n",
		File->DispName);
	
	while(!(Pad.Buttons &
		(PSP_CTRL_CROSS | PSP_CTRL_CIRCLE | PSP_CTRL_TRIANGLE | PSP_CTRL_SQUARE)))
		Idle(&Pad);
	
	if(Pad.Buttons & (PSP_CTRL_CROSS | PSP_CTRL_CIRCLE))
	{
		pspDebugScreenSetXY(0, 6);
		pspDebugScreenSetTextColor(GREEN);
		printf("Wrote %u bytes.\n", File->Save());
	}
	else if(Pad.Buttons & PSP_CTRL_SQUARE) Ret = false;
	
	WaitForButtonRelease(&Pad);
	Delay(30);
	pspDebugScreenClear();
	return Ret;
}
/* Displays a save prompt for the specified file if it has unsaved changes.
 * Does not return until it is closed.
 * Returns: true if OK, false if cancelled.
 */
Displays a save prompt for the specified file if it has unsaved changes.
Does not return until it is closed.
Returns: true if OK, false if cancelled.
Displays a save prompt for the specified file if it has unsaved changes . Does not return until it is closed . Returns : true if OK false if cancelled .
bool ShowSavePrompt(cFile *File)
{
	SceCtrlData Pad;
	bool Ret = true;
	if(File->Saved) return true;
	WaitForButtonRelease(&Pad);
	pspDebugScreenClear();
	pspDebugScreenSetXY(0, 0);
	pspDebugScreenSetTextColor(YELLOW);
	printf("Save changes to\n%s?\nO or X: Yes\nTriangle: No\nSquare: Cancel\n",
		File->DispName);
	while(!(Pad.Buttons &
		(PSP_CTRL_CROSS | PSP_CTRL_CIRCLE | PSP_CTRL_TRIANGLE | PSP_CTRL_SQUARE)))
		Idle(&Pad);
	if(Pad.Buttons & (PSP_CTRL_CROSS | PSP_CTRL_CIRCLE))
	{
		pspDebugScreenSetXY(0, 6);
		pspDebugScreenSetTextColor(GREEN);
		printf("Wrote %u bytes.\n", File->Save());
	}
	else if(Pad.Buttons & PSP_CTRL_SQUARE) Ret = false;
	WaitForButtonRelease(&Pad);
	Delay(30);
	pspDebugScreenClear();
	return Ret;
}
bool ShowSavePrompt ( cFile * File ) { SceCtrlData Pad ; bool Ret = true ; if ( File -> Saved ) return true ; WaitForButtonRelease ( & Pad ) ; pspDebugScreenClear ( ) ; pspDebugScreenSetXY ( 0 , 0 ) ; pspDebugScreenSetTextColor ( YELLOW ) ; printf ( " \n \n \n \n \n " , File -> DispName ) ; while ( ! ( Pad . Buttons & ( PSP_CTRL_CROSS | PSP_CTRL_CIRCLE | PSP_CTRL_TRIANGLE | PSP_CTRL_SQUARE ) ) ) Idle ( & Pad ) ; if ( Pad . Buttons & ( PSP_CTRL_CROSS | PSP_CTRL_CIRCLE ) ) { pspDebugScreenSetXY ( 0 , 6 ) ; pspDebugScreenSetTextColor ( GREEN ) ; printf ( " \n " , File -> Save ( ) ) ; } else if ( Pad . Buttons & PSP_CTRL_SQUARE ) Ret = false ; WaitForButtonRelease ( & Pad ) ; Delay ( 30 ) ; pspDebugScreenClear ( ) ; return Ret ; }
Displays a save prompt for the specified file if it has unsaved changes.
Displays a save prompt for the specified file if it has unsaved changes .