lynxbase.h
 1  //
 2  // Copyright (c) 2004 K. Wilkins
 3  //
 4  // This software is provided 'as-is', without any express or implied warranty.
 5  // In no event will the authors be held liable for any damages arising from
 6  // the use of this software.
 7  //
 8  // Permission is granted to anyone to use this software for any purpose,
 9  // including commercial applications, and to alter it and redistribute it
10  // freely, subject to the following restrictions:
11  //
12  // 1. The origin of this software must not be misrepresented; you must not
13  //    claim that you wrote the original software. If you use this software
14  //    in a product, an acknowledgment in the product documentation would be
15  //    appreciated but is not required.
16  //
17  // 2. Altered source versions must be plainly marked as such, and must not
18  //    be misrepresented as being the original software.
19  //
20  // 3. This notice may not be removed or altered from any source distribution.
21  //
22  
23  //
24  // Generic Lynx base class.
25  //
26  
27  #ifndef LYNXBASE_H
28  #define LYNXBASE_H
29  
30  // bank0	- Cartridge bank 0
31  // bank1	- Cartridge bank 1
32  // ram		- all ram
33  // cpu		- system memory as viewed by the cpu
34  
35  enum EMMODE {bank0,bank1,ram,cpu};
36  
37  class CLynxBase
38  {
39     // Function members
40  
41     public:
42        virtual ~CLynxBase() {};
43  
44     public:
45        virtual void	Reset(void) {};
46        virtual bool	ContextLoad(FILE *fp) { return 0; };
47        virtual bool	ContextSave(FILE *fp) { return 0; };
48  
49        virtual void	Poke(ULONG addr,UBYTE data)=0;
50        virtual UBYTE	Peek(ULONG addr)=0;
51        virtual void	PokeW(ULONG addr,UWORD data) {};	// ONLY mSystem overloads these, they are never use by the clients
52        virtual UWORD	PeekW(ULONG addr) {return 0;};
53        virtual void	BankSelect(EMMODE newbank){};
54        virtual ULONG	ObjectSize(void) {return 1;};
55        virtual ULONG	ReadCycle(void) {return 5;};
56        virtual ULONG	WriteCycle(void) {return 5;};
57  
58  };
59  
60  #endif