/*
WiiHandy/SDL : Port of the Handy/SDL Emulator for the Wii

Copyright (C) 2004
raz0red (www.twitchasylum.com)

This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any
damages arising from the use of this software.

Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:

1.	The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.

2.	Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.

3.	This notice may not be removed or altered from any source
distribution.
*/

#ifndef WII_MAIN_H
#define WII_MAIN_H

#include <gccore.h>

#define WII_SAVE_GAME_EXT "lss"
#define WII_SD_CARD "sd:"
#define WII_ROMS_DIR WII_SD_CARD "/wiihandysdl/roms/"
#define WII_SAVES_DIR WII_SD_CARD "/wiihandysdl/saves/"
#define WII_BASE_APP_DIR WII_SD_CARD "/apps/wiihandysdl/"
#if 0
#define WII_APP_DIR(x) WII_SD_CARD "/apps/wiihandysdl/" x
#define WII_CONFIG WII_APP_DIR( "handysdl.conf" )
#define WII_CURRENT_SAVE WII_APP_DIR( "current.lss" )
#endif
#define WII_CONFIG "handysdl.conf"
#define WII_CURRENT_SAVE "current.lss"
#define WII_SAVE_SIZE 156716

#define WII_BUTTON_LEFT ( WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT )
#define WII_BUTTON_RIGHT ( WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT )
#define WII_BUTTON_UP ( WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_UP  )
#define WII_BUTTON_DOWN ( WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_DOWN  )
#define WII_BUTTON_A ( WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A )
#define WII_BUTTON_B ( WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B )
#define WII_BUTTON_HOME ( WPAD_BUTTON_HOME | WPAD_CLASSIC_BUTTON_HOME )

#define WII_BUTTON_LYNX_OPT1 ( WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS )
#define WII_BUTTON_LYNX_OPT2 ( WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS )
#define WII_BUTTON_LYNX_PAUSE ( WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_FULL_L | WPAD_CLASSIC_BUTTON_FULL_R )
#define WII_BUTTON_LYNX_A ( WPAD_BUTTON_2 | WPAD_CLASSIC_BUTTON_A )
#define WII_BUTTON_LYNX_B ( WPAD_BUTTON_1 | WPAD_CLASSIC_BUTTON_B )
#define WII_BUTTON_LYNX_UP ( WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_UP )
#define WII_BUTTON_LYNX_DOWN ( WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_DOWN )
#define WII_BUTTON_LYNX_RIGHT ( WPAD_BUTTON_DOWN | WPAD_CLASSIC_BUTTON_RIGHT )
#define WII_BUTTON_LYNX_LEFT ( WPAD_BUTTON_UP | WPAD_CLASSIC_BUTTON_LEFT )

#define WII_MAX_PATH 260

/*
 * Pause and wait for input. Usually used when debugging.
 */
extern void wii_pause();

/*
 * Stores a status message for display in the footer of the menu
 *
 * message  The status message
 */
extern void wii_set_status_message( const char *message );

/*
 * Updates the specified result string with the location of the file relative
 * to the appliation root directory.
 * 
 * file     The file name
 * result   The buffer to store the result in
 */
extern void wii_get_app_relative( const char *file, char *result );

/*
 * Remounts the SD card
 */
extern void wii_remount_sd();

// Used to determine if we should rotate the controls
extern int wii_rotate_controls;

// Whether to display debug info (FPS, etc.)
extern short wii_debug;

// The maximum frame rate
extern int wii_max_frame_rate;

// The most recent status message
extern char wii_status_message[];

// Hardware buttons (reset, power, etc.)
extern u8 wii_hw_button;

#endif
