
#include "tap.h"
#include "ok.c"
#include "tic.c"

#define ID_MENUSND 0x80000107

TAP_ID( ID_MENUSND );
TAP_PROGRAM_NAME("Menu Sound");
TAP_AUTHOR_NAME("TOPFIELD");
TAP_DESCRIPTION("Click sound in menu");
TAP_ETCINFO(__DATE__);

dword TAP_EventHandler( word event, dword param1, dword param2 )
{
	int r, t;
	dword mainState, subState;

    if( event != EVT_KEY )
        return param1;
  
	TAP_GetState( &mainState, &subState );
    
    if( mainState != STATE_Menu )
    {
        return param1;
    }

    if( param1 == RKEY_Ok )
        TAP_PlayPCM( (void *)_okData, _okSize, FREQ_48K, NULL );
    else
        TAP_PlayPCM( (void *)_ticData, _ticSize, FREQ_48K, NULL );

	return param1;
}

int TAP_Main(void)
{
	return 1;
}

