Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/lynx/ram.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
// RAM object header file //
29
//////////////////////////////////////////////////////////////////////////////
30
// //
31
// This header file provides the interface definition for the RAM class //
32
// that emulates the Handy system RAM (64K) //
33
// //
34
// K. Wilkins //
35
// August 1997 //
36
// //
37
//////////////////////////////////////////////////////////////////////////////
38
// Revision History: //
39
// ----------------- //
40
// //
41
// 01Aug1997 KW Document header added & class documented. //
42
// //
43
//////////////////////////////////////////////////////////////////////////////
44
45
#ifndef RAM_H
46
#define RAM_H
47
48
#define RAM_SIZE 65536
49
#define RAM_ADDR_MASK 0xffff
50
#define DEFAULT_RAM_CONTENTS 0xff
51
52
/*
53
struct HOME_HEADER
54
{
55
uint16 jump;
56
uint16 load_address;
57
uint16 size;
58
uint8 magic[4];
59
};
60
*/
61
62
class CRam : public CLynxBase
63
{
64
65
// Function members
66
67
public:
68
CRam() MDFN_COLD;
69
~CRam() MDFN_COLD;
70
71
public:
72
73
void Reset(void) MDFN_COLD;
74
75
void Poke(uint32 addr, uint8 data){ mRamData[addr]=data;};
76
uint8 Peek(uint32 addr){ return(mRamData[addr]);};
77
uint32 ReadCycle(void) {return 5;};
78
uint32 WriteCycle(void) {return 5;};
79
uint32 ObjectSize(void) {return RAM_SIZE;};
80
uint8* GetRamPointer(void) { return mRamData; };
81
82
template<bool isReader>void SyncState(NewState *ns);
83
84
// Data members
85
86
private:
87
uint8 mRamData[RAM_SIZE];
88
};
89
90
#endif
91
92
93