Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/lynx/rom.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
// ROM object header file //
29
//////////////////////////////////////////////////////////////////////////////
30
// //
31
// This header file provides the interface definition and inline code for //
32
// the class the emulates the internal 512 byte ROM embedded in Mikey //
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 ROM_H
46
#define ROM_H
47
48
#define ROM_SIZE 0x200
49
#define ROM_ADDR_MASK 0x01ff
50
#define DEFAULT_ROM_CONTENTS 0x88
51
52
#define BROM_START 0xfe00
53
#define BROM_SIZE 0x200
54
#define VECTOR_START 0xfffa
55
#define VECTOR_SIZE 0x6
56
57
class CRom : public CLynxBase
58
{
59
public:
60
CRom(const uint8 *, uint32) MDFN_COLD;
61
62
public:
63
void Reset(void) MDFN_COLD;
64
void Poke(uint32 addr,uint8 data) { /*if(mWriteEnable) mRomData[addr&ROM_ADDR_MASK]=data;*/ }
65
uint8 Peek(uint32 addr) { return(mRomData[addr&ROM_ADDR_MASK]); }
66
uint32 ReadCycle(void) {return 5;}
67
uint32 WriteCycle(void) {return 5;}
68
uint32 ObjectSize(void) {return ROM_SIZE;}
69
70
template<bool isReader>void SyncState(NewState *ns);
71
72
// Data members
73
74
public:
75
//bool mWriteEnable; // always false
76
private:
77
uint8 mRomData[ROM_SIZE];
78
};
79
80
#endif
81
82
83