
/***************************************************************************
**
**    $Header:   D:/ECB2S/SRC/LOG/CPUSERVE.H__   1.2.1.5   17 Apr 1997 15:43:54   ZJRD  $
**
**    $Log:   D:/ECB2S/SRC/LOG/CPUSERVE.H__  $
** 
**    Rev 1.2.1.5   17 Apr 1997 15:43:54   ZJRD
** No change.
** 
**    Rev 1.2.1.4   16 Apr 1997 10:18:18   ZJRD
** No change.
** 
**    Rev 1.2.1.3   10 Apr 1997 15:29:38   ZJRD
** 2.09F
** 
**    Rev 1.2.1.1   03 Apr 1997 15:10:52   ZJRD
** No change.
** 
**    Rev 1.2.1.0   28 Mar 1997 10:15:54   ZJRD
** easy pack sld 2.09d
** 
**    Rev 1.1   19 Mar 1997 11:27:04   ZJRD
** No change.
** 
**    Rev 1.0   12 Mar 1997 14:45:18   ZJRD
** Initial revision.
** 
**    Rev 1.7.1.0.1.2   09 Dec 1996 10:17:48   ZJRD
** EasyPack/SLD Version 2.0P
** 
**    Rev 1.7.1.0.1.0   11 Nov 1996 13:01:04   ZJRD
** EasyPack/SLD Version 2.01
** 
**    Rev 1.7.1.4   09 Sep 1996 13:22:34   ZJRD
** No change.
** 
**    Rev 1.7.1.3   05 Sep 1996 11:34:02   ZJRD
** No change.
** 
**    Rev 1.7.1.2   02 Sep 1996 10:01:04   ZJRD
** No change.
** 
**    Rev 1.7.1.1   28 Aug 1996 15:44:22   ZJRD
** No change.
** 
**    Rev 1.7.1.0   12 Aug 1996 10:49:42   ZJRD
** EasyPack/SLD Version 1.98
** 
**    Rev 1.5   05 Jun 1996 14:51:52   ZJRD
** No change.
** 
**    Rev 1.4   29 May 1996 09:33:26   ZJRD
** No change.
** 
**    Rev 1.3   16 May 1996 09:05:30   ZJRD
** No change.
** 
**    Rev 1.2   10 May 1996 09:11:34   ZJRD
** No change.
** 
**    Rev 1.1   02 May 1996 10:23:24   ZJRD
** EasyPack/SLD Version 1.92
** 
**    Rev 1.31   18 Apr 1996 12:57:06   Shirley
** No change.
** 
**    Rev 1.30   12 Apr 1996 10:42:30   Shirley
** EasyPack/SLD Version 1.90
** 
**    Rev 1.28   15 Feb 1996 08:54:32   Shirley
** No change.
** 
**    Rev 1.27   12 Feb 1996 14:02:48   Shirley
** No change.
** 
**    Rev 1.26   06 Feb 1996 15:28:04   Shirley
** No change.
** 
**    Rev 1.25   06 Feb 1996 13:43:40   Shirley
** No change.
** 
**    Rev 1.24   01 Feb 1996 10:16:34   Shirley
** No change.
** 
**    Rev 1.23   26 Jan 1996 09:19:12   Shirley
** No change.
** 
**    Rev 1.22   25 Jan 1996 13:19:06   Shirley
** No change.
** 
**    Rev 1.21   24 Jan 1996 10:32:14   Shirley
** No change.
** 
**    Rev 1.20   23 Jan 1996 11:24:02   Shirley
** EasypPack/SLD Version 0.34c
** 
**    Rev 1.18   15 Jan 1996 16:13:40   Shirley
** EasyPack/SLD Version 0.34a
** 
**    Rev 1.16   30 Nov 1995 09:10:34   Shirley
** No change.
** 
**    Rev 1.15   28 Nov 1995 15:31:22   Shirley
** No change.
** 
**    Rev 1.14   21 Nov 1995 11:18:02   Shirley
** No change.
** 
**    Rev 1.13   13 Nov 1995 09:28:16   Shirley
** No change.
** 
**    Rev 1.12   12 Nov 1995 11:30:04   Shirley
** No change.
** 
**    Rev 1.11   08 Nov 1995 16:33:16   Shirley
** No change.
** 
**    Rev 1.10   08 Nov 1995 12:43:34   Shirley
** EasyPack/SLD Version 0.22
** 
**    Rev 1.9   02 Nov 1995 10:02:24   Shirley
** No change.
** 
**    Rev 1.8   27 Oct 1995 16:48:20   Shirley
** No change.
** 
**    Rev 1.7   27 Oct 1995 13:46:22   Shirley
** EasyPack/SLD Version 0.1g
** 
**    Rev 1.6   25 Oct 1995 14:27:42   Shirley
** EasyPack/SLD Version 0.1f
** 
**    Rev 1.5   18 Oct 1995 14:52:52   Shirley
** EasyPack/SLD Version 0.1e
** 
**    Rev 1.4   13 Oct 1995 13:21:34   Shirley
** No change.
** 
**    Rev 1.3   29 Sep 1995 09:52:40   Shirley
** No change.
** 
**    Rev 1.2   20 Sep 1995 10:52:32   Shirley
** No change.
** 
**    Rev 1.1   15 Sep 1995 09:44:40   Shirley
** EasyPack/SLDV0.1a 
** 
**    Rev 1.0   07 Sep 1995 09:53:20   Shirley
** Initial revision.
**
****************************************************************************/

////////////////////////////////
//regserve.h
//Bright cheng
//95/4
////////////////////////////////
#ifndef _CPUSERVE_
#define _CPUSERVE_

#define MAXALINE 15 //john.chow 95.5
#define MAXLINES 20 //
#define MAXCHARS 20 //
#define MAXREGNAMELEN 20     
#define MAXCPUNAMELEN 20
#define MAXCPUNUM 64
#define MAXCPUNAMELENGTH 30

extern unsigned short GetLoadPC(void);//from roger for reset command
extern int	GetLoadBank(void);

//CCpuServer functions as an interface between ABI and shell or cpu window,
//first call constructor to construct the object, then call member function
//initialize() to get cpumodule and set registerMasker.
struct Reg_Name_ID
{
    char Name[MAXREGNAMELEN];
    unsigned char  ID;
    //editted by JOHN.CHOW 95.6 for showing all registers in shell
    int locY;
    int locX;
    //************************************************************
};                             

struct CPUMEMORYRANGE
{ 
 unsigned short pMax,pMin,xMax,xMin,iMax,iMin,rMax,rMin,bMax,bMin;
 };
 
struct CONTROLOPTION
{ 
 unsigned short controlReset,controlEa,controlEben;
 }; 
                   
class CCpuServer
{
//constructor
public:
    CCpuServer();
    ~CCpuServer();
//member of cpuserver
private:
    int             bCpuSetFlag;
public:
//  unsigned short  REGISTER[64];
    UINT            CpuModule;
    CString         CpuName;    
    int             m_nErrorID;
    CPUMEMORYRANGE  cpuMemoryRange;
    CONTROLOPTION   controlOption;  
    //ADDED TO SUPPORT SET CPU MODULE
    char **cpuNameList;
    int sMaxCpuNum;    
    short cpuIDList[MAXCPUNUM];
    //ADDED TO SUPPORT SET CPU MODULE two
    char **cpuNameValid;
    int sMaxCpuValid;    
    short cpuIDValid[MAXCPUNUM];
//function of cpuserver
public:
   void ShowAllRegToShell();
   void ShowOneRegToShell(REG_ID  reg_id);
   STATUS GetAllReg();
   void ShowOneRegToWnd(REG_ID reg_id);
   void ShowAllRegToWnd();
   BOOL SetRegfromWnd(REG_ID reg_id, UINT content);
   void SetRegfromShell(REG_ID reg_id, UINT content);
   BOOL Initialize(int);
   /*void ShowModule();
   void SetModule(UINT idFlag);*/
   BOOL ResetbyWnd(int nBank, WORD addr);
   void ResetbyShell(int nBank, WORD addr);
   
   char ** PreCpuInitialize(int &iRoger);   
   
   void DisplayErrorMessage(void) const;
   void DisplayErrorMessageBox(void) const;
//editted by John.Chow 95.6 to add a private routine to show all reg in shell   
   void ShowAllRegByArray();//only used in ShowAllRegToShell()
   BOOL GetCpuListFromFile();//added by john 1995.10.25 to support setting cpu module
   
   UINT GetCpuId() { return CpuModule; }//ADDED BY JOHN 96.1 FOR 320 TRACE USE
private :                   
   //this function will get reg table from disk file regtbl.dat
   //if it could not get the table from disk it will only fill comman regs int table
   BOOL GetRegFromFile(); // added by john 95.8 because the change in the form of reg tbl
                          //RETURN TURE IF GET OK!
};
#endif


//////////////////////////////(EOF)////////////////////////////////////
