/* input.h
 *
 * Receives input from the user.
 *
 * (c) 2006, Joseph Curtis
 */

#include "x86.h"

#ifndef x86
#include <pspctrl.h>
#endif

#ifdef x86
#define PSP_CTRL_SELECT SDLK_p
#define PSP_CTRL_START SDLK_RETURN
#define PSP_CTRL_UP SDLK_UP
#define PSP_CTRL_RIGHT SDLK_RIGHT
#define PSP_CTRL_DOWN SDLK_DOWN
#define PSP_CTRL_LEFT SDLK_LEFT
#define PSP_CTRL_LTRIGGER SDLK_PAGEUP
#define PSP_CTRL_RTRIGGER SDLK_PAGEDOWN
#define PSP_CTRL_TRIANGLE SDLK_c
#define PSP_CTRL_CIRCLE SDLK_x
#define PSP_CTRL_CROSS SDLK_z
#define PSP_CTRL_SQUARE SDLK_v
#endif


/**
 * The input loop.  Sureley a better way to do it?  Callbacks people!
 * I guess this will do for this situation because it is a turn-based
 * game.
 *
 * Needs to handle may keystrokes in quick succession as one.
 */
int input_loop();

#ifdef x86
/**
 * For when SDL is being used.
 */
int sdl_input_loop();
#endif

/**
 * Left trigger activated.
 */
void ctrl_ltrigger();

/**
 * Right trigger activated.
 */
void ctrl_rtrigger();

/**
 * Called when analogue stick is activated.
 */
void ctrl_analogue(int x, int y);

void ctrl_left();

void ctrl_right();

void ctrl_up();

void ctrl_down();

void ctrl_cross();

void ctrl_circle();

void ctrl_triangle();

void ctrl_square();

void ctrl_start();

void ctrl_select();

/* Hmmmmm, not too software engineeringy */
void main_menu();

/**
 * Wait until the X button is pushed, then return;
 */
void wait_on_x();

/**
 * Wait until the button is pressed, then return
 */
void wait_on_button(int button);

/**
 *  Wait until some button is pushed and the return it.
 */
int wait_on_input();

