Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Input.h
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/*   -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
      following conditions are met:
        Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
        Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
          provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#if !defined(TGS_INPUT_H)
#define TGS_INPUT_H
#pragma once

#if !defined(TgCOMPILE_PLATFORM_WIN)
#error This file should only be included for windows based platforms
#endif

#define TGS_PLATFORM_INPUT_H

#include "TgS INPUT/TgS Input - Constants.h"
#include "TgS INPUT/TgS Input - Type.h"


/* == Input ============================================================================================================================================================= */

/* The Input Module can be best described as a chain of responsibility or algorithmically as a producer-consumer.  Input devices act as producers, while the receiver */
/* stack acts collectively as the consumer. */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Module Functions                                                                                                                                                      */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

TgEXTN TgRESULT                             tgIN_Module_Init( TgVOID );
TgEXTN TgRESULT                             tgIN_Module_Boot( TgVOID );
TgEXTN TgVOID                               tgIN_Module_Stop( TgVOID );
TgEXTN TgVOID                               tgIN_Module_Free( TgVOID );
TgEXTN TgRESULT                             tgIN_Module_Update( C_TgFLOAT32 );

TgEXTN TgVOID                               tgIN_Load_Config( TgVOID );
TgEXTN TgVOID                               tgIN_Save_Config( TgVOID );

TgEXTN TgBOOL                               tgIN_Query_Init( TgVOID );
TgEXTN TgBOOL                               tgIN_Query_Boot( TgVOID );
TgEXTN TgSIZE                               tgIN_Query_Fixed_Memory( TgVOID );

#if TgS_STAT_INPUT
TgEXTN TgVOID                               tgIN_Stats( P_STg2_Output );
#endif


/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Input Functions                                                                                                                                                       */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

                                            /* 1: Controller - Indicates which controller the processing function is binding */
                                            /* 2: Function - Production function */
                                            /* 3: Function Parameter - Value passed to the processing function */
TgEXTN TgRESULT                             tgIN_Set_Producer( C_ETgCONTROLLER, TgIN_FCN_PRODUCER, C_TgUINTPTR );
TgEXTN TgBOOL                               tgIN_Has_Producer( C_ETgCONTROLLER );

                                            /* Update all the producers.  Normally done asynchronously (e.g. on vblank).  The system assumes that only a single thread */
                                            /* is responsible for pumping the production queue. */
TgEXTN TgVOID                               tgIN_Update_Producers( TgVOID );

                                            /* 1: Controller - Indicates which controller the processing function is binding */
                                            /* 2: Priority - Value indicating the priority of the processing function */
                                            /* 3: Function - Processing function */
                                            /* 4: Function Parameter - Value passed to the progressing function */
TgEXTN TgIN_CONSUMER_ID                     tgIN_Insert_Consumer( C_ETgCONTROLLER, C_TgUINT32, TgIN_FCN_CONSUMER, C_TgUINTPTR );

                                            /* 1: Consumer ID - The id of the consumer function returned by the insert call */
TgEXTN TgRESULT                             tgIN_Remove_Consumer( C_TgIN_CONSUMER_ID );

                                            /* Pause Controller - pause production from a specific controller */
TgEXTN TgBOOL                               tgIN_Pause_Controller( C_ETgCONTROLLER, C_TgBOOL );

                                            /* Pause Input - Pause the entire input system */
TgEXTN TgVOID                               tgIN_Pause_Input( C_TgBOOL );

                                            /* Set Dead Zone - Default or associated with controller */
TgEXTN TgVOID                               tgIN_Set_Default_Dead_Zone( C_ETgDEAD_ZONE, C_TgFLOAT32 );
TgEXTN TgVOID                               tgIN_Set_Dead_Zone( C_ETgCONTROLLER, C_ETgDEAD_ZONE, C_TgFLOAT32 );

                                            /* Query Dead Zone - Default or associated with controller */
TgEXTN TgFLOAT32                            tgIN_Query_Default_Dead_Zone( C_ETgDEAD_ZONE );
TgEXTN TgFLOAT32                            tgIN_Query_Dead_Zone( C_ETgCONTROLLER, C_ETgDEAD_ZONE );

                                            /* Set Rumble */
TgEXTN TgRESULT                             tgIN_Set_Rumble( C_ETgCONTROLLER, C_TgFLOAT32, C_TgFLOAT32 );

#if TgS_STAT_INPUT
TgEXTN TgUINT32                             tgIN_Stat_Query_Total_Insert( TgVOID );
TgEXTN TgUINT32                             tgIN_Stat_Query_Total_Remove( TgVOID );
/*# TgS_STAT_INPUT */
#endif 


/* ---- Rumble Manager -------------------------------------------------------------------------------------------------------------------------------------------------- */

TgEXTN TgVOID                               tgRB_Update( TgVOID ); /* #TODO: IMPLEMENT */

TgEXTN TgVOID                               tgRB_Set_Rumble_Timer( C_ETgCONTROLLER, C_TgFLOAT32 ); /* #TODO: IMPLEMENT */
TgEXTN TgVOID                               tgRB_Set_Rumble_Interval( C_ETgCONTROLLER, C_TgFLOAT32 ); /* #TODO: IMPLEMENT */

TgEXTN TgFLOAT32                            tgRB_Query_Rumble_Timer( C_ETgCONTROLLER ); /* #TODO: IMPLEMENT */
TgEXTN TgFLOAT32                            tgRB_Query_Rumble_Interval( C_ETgCONTROLLER ); /* #TODO: IMPLEMENT */
TgEXTN TgBOOL                               tgRB_Is_In_Rumble( C_ETgCONTROLLER ); /* #TODO: IMPLEMENT */


/* ====================================================================================================================================================================== */
#endif