📄 mapper.h
字号:
//////////////////////////////////////////////////////////////////////
//
// File: mapper.h
//
// $Archive: /ComemL/Util/PCfg/mapper.h $
//
// Purpose:
//
// $Author: Tpm $
//
// $History: mapper.h $
//
// ***************** Version 1 *****************
// User: Tpm Date: 7/13/98 Time: 8:38a
// Created in $/ComemL/Util/PCfg
//
// ***************** Version 30 *****************
// User: Tpm Date: 1/26/98 Time: 10:04a
// Updated in $/Comem/Mapper
// embedded systems (test) menu should only show up in debug builds.
//
// ***************** Version 29 *****************
// User: Tpm Date: 1/09/98 Time: 5:33p
// Updated in $/Comem/Mapper
// Change Target to Local Processor
//
// ***************** Version 28 *****************
// User: Tpm Date: 11/05/97 Time: 2:39p
// Updated in $/Comem/Mapper
// Bug: NFCMD-NVSTAT OK, Cancel not mapped to default help.
// Fix: Done.
// Bug: HMSIZE (0x84) mapped to A0.
// Fix: Done.
//
// ***************** Version 27 *****************
// User: Tpm Date: 10/31/97 Time: 10:04a
// Updated in $/Comem/Mapper
// Req: Add Address Selector to Memory Views to select cache pages.
// Fix: Added Selector and strings for cache pages.
//
// ***************** Version 26 *****************
// User: Tpm Date: 10/30/97 Time: 9:18a
// Updated in $/Comem/Mapper
// Req: Implement "Load/Save Configuration" for .ini file.
// Fix: Added options to File Menu.
// Req: Should display .ini file ID in toolbar vice "Mapper1".
// Fix: Displays .ini file now.
// Bug: StartScreen Comem Number dropdown is too short.
// Fix: Changed properties to have "No Integral height"; now shows mult
// selections.
//
// ***************** Version 25 *****************
// User: Tpm Date: 10/29/97 Time: 3:03p
// Updated in $/Comem/Mapper
// Req: Add (5 or so) unimplemented registers in the Reg View.
// Fix: Added:NVCMD (0xA0), NVREAD (0xA4),NVSTAT (0xA8)
// Req: Add static text to explain registers w/o buttons.
// Fix: Added static text and context sensitive help.
//
// ***************** Version 24 *****************
// User: Tpm Date: 10/28/97 Time: 6:20p
// Updated in $/Comem/Mapper
// Req: Change MRU List to include MRU users exe files.
// Fix: Add application files to MRU list.
//
// ***************** Version 23 *****************
// User: Stevek Date: 10/28/97 Time: 9:57a
// Updated in $/Comem/Mapper
// More seperation for seperate library file.
// Removed embeddedSystems stuff.
//
// ***************** Version 22 *****************
// User: Stevek Date: 10/27/97 Time: 1:16p
// Updated in $/Comem/Mapper
// Moved interface functions into the comem_if.lib file.
//
// ***************** Version 21 *****************
// User: Stevek Date: 10/24/97 Time: 3:55p
// Updated in $/Comem/Mapper
// Started to seperate library functions out of mapper files.
// Current code is tested with one comem.
//
// ***************** Version 20 *****************
// User: Tpm Date: 10/24/97 Time: 8:37a
// Updated in $/Comem/Mapper
// Req: Change MRU List to include MRU users hex files.
// Fix: Add application files to MRU list.
//
// ***************** Version 19 *****************
// User: Stevek Date: 10/23/97 Time: 11:50a
// Updated in $/Comem/Mapper
// Naming convention changes, comemID changes for manual
//
// ***************** Version 18 *****************
// User: Stevek Date: 10/22/97 Time: 12:27p
// Updated in $/Comem/Mapper
// Added header blocks to all files at once!
//
// Copyright (c) 1997 Anchor Chips, Inc. May not be reproduced without
// permission. See the license agreement for more details.
//
//////////////////////////////////////////////////////////////////////
// mapper.h : main header file for the MAPPER application
//
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
#include "comemDevice.h"
/////////////////////////////////////////////////////////////////////////////
// CSList: used to hold string lists for user selection and display
class CSList
{
public:
int m_key;
CStringList m_strList;
public:
};
// CSList class contains lists of strings for user selection
typedef CMap<int,int,CSList*,CSList*&> CSLists;
typedef struct { //TPM generic target information (used n memview)
int cpu_type;
int targ_type;
int proc_id;
int regs_max_row;
int regs_max_col;
} TargetInfo;
/////////////////////////////////////////////////////////////////////////////
// CMapperApp:
// See mapper.cpp for the implementation of this class
//
class CMainFrame;
class CMapperApp : public CWinApp
{
public:
CMapperApp();
// IsWinNTLoaded();
VxD_loaded();
VxD_loaded_check();
tgt_loaded();
tgt_loaded_check();
void AddMRU(CString strFile){m_pRecentFileList->Add(strFile);}
BOOL driverLoaded;
int GetFileType(CString strSuffix, CString strText);
//TPM temporary mem/watch view stuff
CStringList m_WatchStrList;
int m_nMemBlock;
int GetNewMemBlock(){return m_nMemBlock;}
CDialogBar* m_pMemEdit;
void SetpMemEdit(CDialogBar* pMemEdit){m_pMemEdit = pMemEdit;}
CDialogBar* GetpMemEdit(){return m_pMemEdit;}
TargetInfo m_TargInfo;
TargetInfo* m_pTargInfo;
CDocument* m_pMemDoc;
CDocument* m_pMapDoc;
//TPM string lists for dropdown box selections
void InitStrings(int nID);
CString GetLbl(int nID, int Sel);
void GetList(int nID, CComboBox* pCB);
void GetList(int nID, CListBox* pLB);
void GetList(int nID, CCheckListBox* pCLB);
char* GetListItem(int nID, int nItem);
CSLists m_SLists;
CSList m_sList;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMapperApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
virtual CDocument* OpenDocumentFile(LPCTSTR lpszFileName);
//}}AFX_VIRTUAL
// Implementation
COleTemplateServer m_server;
// Server object for document creation
//{{AFX_MSG(CMapperApp)
afx_msg void OnAppAbout();
afx_msg void OnHelpHelp();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
void OnFileNew();
BOOL ProcessShellCommand(CCommandLineInfo& rCmdInfo);
public:
CMultiDocTemplate* pGridTemplate;
CMultiDocTemplate* pMapTemplate;
CMultiDocTemplate* pRegTemplate;
CMultiDocTemplate* pPageTableTemplate;
// CMultiDocTemplate* pPrintfTemplate;
CMultiDocTemplate* pPBufTemplate;
CMultiDocTemplate* pWMemTemplate;
CMainFrame* pMainFrame;
CString m_strPathExe;
CString m_strPathPBuf;
};
extern const char *priority[];
//////////////////////////////////////////////////////////////////////
// Private definitions
const char *get_block_prompt(int row, int column);
/////////////////////////////////////////////////////////////////////////////
extern CList <const char *, const char *> opsRegTypeList;
extern CList <const char *, const char *> daTypeList;
extern CList <const char *, const char *> csTypeList;
extern CList <const char *, const char *> cacheTypeList;
// const int MAX_MAP_ENTRIES = 8;
// const int ONE_K = 0x400;
extern const char *cs_type[];
extern const char *da_type[];
extern const char *cache_type[];
extern const char *ops_reg_type[];
extern const char* headers[];
extern HANDLE hDevice; // handle to the vxd
void Getdata(char * buffer, int row, int col);
DWORD addrToRow(int addr);
DWORD addrToCol(int addr);
void AFXAPI DDX_HexText(CDataExchange *pDX, int nIDC, DWORD &value);
int dialogNButtons(char *title, char *message, char * text1 = "OK", char *text2 = NULL, char *text3 = NULL);
/////////////////////////////////////////////////////////////////////////////
#include "ComemDevice.h"
#include "MapperDoc.h"
extern CMapperDoc *masterDocument;
//extern CMapperApp theApp;
#include "PCfg.h"
#define IDS_EXE_FILE_SUFFIX "Intel hex (*.hex)|*.hex|Intel hex with spaces (*.hex)|*.hex|Motorola S record (*.mot;*.hex;*.srec;*.run)|*.srec;*.hex;*.mot;*.run|Binary (*.bin)|*.bin|Address/data pairs (*.out)|*.out||"
#define NV_TYPE_NVCMD 0
#define NV_TYPE_NVREAD 1
#define NV_TYPE_NVSTAT 2
#define REG_WORD_TYPE_HMBASE 3
#define REG_WORD_TYPE_HMSIZE 4
#define REG_WORD_TYPE_PFADDR 5
#define REG_WORD_TYPE_NFCMD 6
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -