#include "pconfig.h"
#include <stdlib.h>
#include <BootUSB.h>
#include <sys/xboxkrnl.h>
#include <sys/types.h>
#include <sys/nttypes.h>


extern CONFIGENTRY *entry;


// Useful for debugging
//
// die and Die, yeah, that's not confusing...
// 

extern int cx;
extern int cy;

void die() {
//	cx = 0;
//	cy = 1;
	printk("\nApplication died in an unhappy manor.  Press A to reboot.");
	do
	{
		USBGetEvents();
		if (risefall_xpad_BUTTON(TRIGGER_XPAD_KEY_A) == 1) {
			HalReturnToFirmware(3); //RebootHard
		}
	}
	while(1);
}

void Die(char *message)
{
//	cx=0;
//	cy=0;
	entry->DebugFlag = TRUE;
	printk(message);
	die();
}

