Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/lynx/memmap.h
2 views
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
// Handy - An Atari Lynx Emulator //
25
// Copyright (c) 1996,1997 //
26
// K. Wilkins //
27
//////////////////////////////////////////////////////////////////////////////
28
// Lynx memory map object header file //
29
//////////////////////////////////////////////////////////////////////////////
30
// //
31
// This header file provides the interface definition for the memory map //
32
// object, this object controls which pieces of lynx hardware are //
33
// accesible by the CPU at any given time, it is the code for addr $FFF9 //
34
// //
35
// K. Wilkins //
36
// August 1997 //
37
// //
38
//////////////////////////////////////////////////////////////////////////////
39
// Revision History: //
40
// ----------------- //
41
// //
42
// 01Aug1997 KW Document header added & class documented. //
43
// //
44
//////////////////////////////////////////////////////////////////////////////
45
46
#ifndef MEMMAP_H
47
#define MEMMAP_H
48
49
#define MEMMAP_SIZE 0x1
50
51
#ifdef TRACE_CART
52
53
#define TRACE_MEMMAP0(msg) _RPT1(_CRT_WARN,"CMamMap::"msg" (Time=%012d)\n",gSystemCycleCount)
54
#define TRACE_MEMMAP1(msg,arg1) _RPT2(_CRT_WARN,"CMamMap::"msg" (Time=%012d)\n",arg1,gSystemCycleCount)
55
#define TRACE_MEMMAP2(msg,arg1,arg2) _RPT3(_CRT_WARN,"CMamMap::"msg" (Time=%012d)\n",arg1,arg2,gSystemCycleCount)
56
#define TRACE_MEMMAP3(msg,arg1,arg2,arg3) _RPT4(_CRT_WARN,"CMamMap::"msg" (Time=%012d)\n",arg1,arg2,arg3,gSystemCycleCount)
57
58
#else
59
60
#define TRACE_MEMMAP0(msg)
61
#define TRACE_MEMMAP1(msg,arg1)
62
#define TRACE_MEMMAP2(msg,arg1,arg2)
63
#define TRACE_MEMMAP3(msg,arg1,arg2,arg3)
64
65
#endif
66
67
class CMemMap : public CLynxBase
68
{
69
// Function members
70
71
public:
72
CMemMap(CSystem& parent) MDFN_COLD;
73
74
public:
75
void Reset(void) MDFN_COLD;
76
77
void Poke(uint32 addr,uint8 data);
78
uint8 Peek(uint32 addr);
79
uint32 ReadCycle(void) {return 5;};
80
uint32 WriteCycle(void) {return 5;};
81
uint32 ObjectSize(void) {return MEMMAP_SIZE;};
82
83
template<bool isReader>void SyncState(NewState *ns);
84
85
// Data members
86
87
private:
88
int mMikieEnabled;
89
int mSusieEnabled;
90
int mRomEnabled;
91
int mVectorsEnabled;
92
93
CSystem& mSystem;
94
};
95
96
#endif
97
98
99