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

/***************************************************************************
**
** File name : BPTSERVE.H 
** Author:BRIGHT CHEN
** Description:
**
**
**    Finished date: 1995.9.1
**
**
**    Copyright (C) 1995 Microtek International, Inc.
**    All Rights Reserved
**
****************************************************************************/


////////////////////////////////
//bptserve.h
//Bright cheng
//95/4
//Chris Fang
//March, 96
////////////////////////////////
#ifndef _BPTSERVE_
#define _BPTSERVE_
#include "uicom.h"
//CBptServer functions as an interface between ABI and Shell or breakpoint
//dialog.
struct BPT_CHAIN
{   
	BYTE		   bBank; //1:p:;6-9:b1-b4
    unsigned short addr;
    BYTE           enableFlag;   //1=enable, 0=disable;
    BPT_CHAIN*     pNextBpt;
};

class BptServer
{
//constructor
public:
    BptServer()
    {
        m_pFirstBpt = new BPT_CHAIN;
        m_pFirstBpt->pNextBpt = NULL;
    }
    ~BptServer()
    {
        BPT_CHAIN* pTmpBpt;        
        while(NULL!=(m_pFirstBpt->pNextBpt))
        {
            pTmpBpt = m_pFirstBpt;
            m_pFirstBpt = m_pFirstBpt->pNextBpt;
            delete pTmpBpt;
        }
    }
//member
protected:
    int          m_nErrorID;
    BPT_CHAIN*   m_pFirstBpt;
    CString		 m_sErrmsg;
public:
	BYTE		 m_bBank;
	    
//function
public:
    void AddBptfromShell(unsigned short addr);
    void ClrOneBptfromShell(unsigned short addr);
    void ClrAllBptfromShell();
    void ShowBptToShell();
    BOOL BptAddBptfromWnd(unsigned short addr);
    BOOL BptClrOneBptfromWnd(unsigned short addr);
    BOOL BptClrAllBptfromWnd();
    BOOL EnableBpt(unsigned short addr);
    BOOL DisableBpt(unsigned short addr);
    void AddBpt(unsigned short addr);
    void ClrBpt(unsigned short addr);
    void ClrAllBpt();
    BOOL SearchBpt(unsigned short addr,BYTE &eFlag);
    BOOL GetOneBpt(short number, BYTE* bBank,unsigned short *addr);
    //this two functions will save and restore breakpoint settings with dis
    BOOL SaveBpt(const char * pFileName); //added by john.chow 95.8
    BOOL RestoreBpt(const char * pFileName);//
    
    BOOL RecoverBP(void);			//by chris
};

//globel function
BOOL BptGetOneBpt(short num, BYTE bBank,unsigned short *addr);

BOOL RecoverBP(void);

#endif

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

