/******************************************************************************/
/***                                                                        ***/
/***  SPdefs.h                                                              ***/
/***                                                                        ***/
/***  Include for the "Software Protection Scheme" example code.            ***/
/***                                                                        ***/
/***  Contains all the variable parameters to the Software Protection       ***/
/***  Scheme. When ever this information is changed, the code must be       ***/
/***  re-compiled, and the Master Disc must be re-initialised.              ***/
/***                                                                        ***/
/***                                                                        ***/
/***                                                                        ***/
/***                                                                        ***/
/***  Written by N.Critchell, Acorn Computers             18th August 1992  ***/
/***                                                                        ***/
/******************************************************************************/




/******************************************************************************/
/***                                                                        ***/
/***               Application Control Variables                            ***/
/***                                                                        ***/
/*** These must be changed to suit you application.                         ***/
/***                                                                        ***/
/******************************************************************************/


#define APPLICATION_TITLE       "SPExample"       
#define APPLICATION_VARIABLE    "<SPexample$Dir>"  
#define APPLICATION_DIRECTORY   "!SPexample"       
#define CONFIG_FILENAME         ".config"


/*
    The Application Title will be used to create the title for each SP window
    in the for "Software Protection message from 'application title'.", must
    not be more that 15 characters.

    Application Variable is used to read and write the configured information
    this variable must be set to the directory in which it it to be written in
    the !Run file. It must take the form "<application_variable>", ie. angle
    braces must exist.

    Application Directory is the name of the directory of the application upon
    the Master Disc. If the application is not in the root, then the path from
    the root must also be given.

    Config Filename specifies the filename to use for storing the configured
    information, it can be any valid filename, but must be proceeded with a
    period.
*/








/******************************************************************************/
/***                                                                        ***/
/***               Licence Type, Control Variables                          ***/
/***                                                                        ***/
/*** These will determine how the code will be compiled, and thus govern    ***/
/*** the way the SP code works for a given set of circumstances such as the ***/
/*** licence type.                                                          ***/
/***                                                                        ***/
/******************************************************************************/

#define SINGLE_LICENCE          TRUE            /* Set TRUE for single user   */
#define SITE_LICENCE            FALSE           /* Set TRUE for site licence  */
#define NET_LICENCE             FALSE           /* Set TRUE for network       */

#define MULTI_LICENCES          -1              /* Number of Licences         */
#define MASTER_DISC             TRUE            /* If special Master Disc used */
#define OLD_SYSTEM_SUPPORT      FALSE           /* If support for Old systems */



/*
    Only 1 of the "SINGLE_LICENCE", "SITE_LICENCE" or "NET_LICENCE" can be TRUE
    at any given time, with the exception of "SITE_LICENCE" and "NET_LICENCE"
    which can both be TRUE, whilst "SINGLE_LICENCE" is FALSE. In this case the
    SP code will work automatically upon networks as a net licence, and as a
    site licence upon a stand alone system. (MULTI_LICENCES must be -1)

    For a 'Limited Site' Licence set "SITE_LICENCE" only as TRUE, and set the
    "MULTI_LICENCES" to a value from 2 - 10 only.

    When "MASTER_DISC" is TRUE, the SP code will always require the specially
    formatted Master Disc, before the system can be configured.

    "OLD_SYSTEM_SUPPORT" can be used when the "MASTER_DISC" is TRUE. In this
    case when ever the application is run upon a machine with no ID, the
    software will insist upon the Master Disc before continuing.

    (NB. Although this code has been tested, it is your responsibility to
    ensure that it functions correctly, under the set of parameters you use.
*/










/******************************************************************************/
/***                                                                        ***/
/***                     Application Customisation                          ***/
/***                                                                        ***/
/*** Changing this information will customise the code specifically for your ***/
/*** application. This should be done for all your applications as each     ***/
/*** will then be unique.                                                   ***/
/***                                                                        ***/
/******************************************************************************/

/******************************************************************************/
/**                    Keyword Encoding                                     **/
/******************************************************************************/

#define KEYWORD_1               0xF14E2E43
#define KEYWORD_2               0x72697463
#define KEYWORD_3               0x68656C6C


/******************************************************************************/
/**                    Appended to Registration Number                       **/
/******************************************************************************/

#define APPLICATION_ID          0x56


/******************************************************************************/
/**                   Special Master Disc Customisation                      **/
/******************************************************************************/

#define SECTOR_ID               6
#define TRACK_NO                2
#define SIDE                    0
#define SECTOR_IDENTIFIER       "Acorn Computers"
#define SECTOR_OFFSET           23
#define REG_OFFSET              185
#define LICENCE_HOLDER_OFFSET   208



/*
    They "KEYWORD_?"s can be set to any 32 bit value.

    "APPLICATION_ID" can be any 8 bit value (ie. 0 - 255). It is used only to
    alter the displayed Registration Number, and you can us it for different
    versions of the same code (ie. network, site, etc.) or different
    implementations.

    "SECTOR_ID" {5 - 127 }, ID of special sector on Master Disc; setting this
                             to any value above 5 will make it difficult to
                             read without knowing this value.

    "TRACK_NO" {2 - 79 },   Track for special sector to be written to, using
                             tracks 0 and 1 are not advised.

    "SIDE" {0 or 1 }        The side of the disc to write the spacial sector.

    "SECTOR_IDENTIFIER"      This string is written at the front of the special
                             sector, to help identify it. It can be any string
                             you wish, but see below for OFFSETs.

    "SECTOR_OFFSET"          This offset determines where the Encoded ID
                             information will be stored on the special sector.

    "REG_OFFSET"             This offset determines where the Registration
                             Number will be stored.

    "LICENCE_HOLDER_OFFSET"  This offset determines where the Licence Holder
                             information will be stored on the special sector.
    


   OFFSETS
   --------

   Care must be taken to ensure that the offsets do not allow the data areas
   to be overlapped, as this will causes the SP code to obtain incorrect
   information and may appear that the code is not functioning correctly.

   The Encoded information is 16 bytes long. There is usually only one ID
   stored upon the Master Disc, however for the 'Limited Site' licence there
   can be as many as "MULTI_LICENCES".

   The Registration Number is 10 bytes long.

   The Licence Holder information can be 40 bytes long.


   When changing the offsets always ensure that no data can overlap any other
   data area, by calculating the start and end values for each of the data
   areas and checking the offset values.




*/



