ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
gatearray.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) by Fred Klaus *
3  * development@fkweb.de *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 #ifndef CPC_GATEARRAY_H
21 #define CPC_GATEARRAY_H
22 
23 #include "compspec.h"
24 #include "types.h"
25 
26 namespace cpcx
27 {
28 
31 class GateArray final
32 {
33 
34  public:
35  GateArray() {init();}
37 
38  void init();
39 
40  tUBYTE pen() const {return mPen;}
41  tUBYTE* ink() {return mInk;}
42  tUBYTE ink(tUBYTE num) const {return mInk[num];}
43  tUDWORD palette(tUBYTE num) const {return mPalette[num];}
44 
45  tUBYTE romConfig() const {return mRomConfig;}
46  tUBYTE ramConfig() const {return mRamConfig;}
47  tUBYTE ramBank() const {return mRamBank;}
48  tUBYTE upperRom() const {return mUpperRom;}
49  tUBYTE counter() const {return mCounter;}
50  tUBYTE mode() const {return mMode;}
52  bool interrupt() const {return mInterrupt;}
53  tUBYTE intDelay() const {return mIntDelay;}
54  tUBYTE slCount() const {return mSlCount;}
55 
56  void setPen(tUBYTE pen) {mPen = pen;}
57  //void setInk(tUBYTE* ink) {for (int i=0; i<17; i++) mInk[i] = ink[i];}
58  void setInk(tUBYTE ink) {mInk[mPen] = ink;}
59  void setInk(tUBYTE num, tUBYTE ink) {mInk[num] = ink;}
60 
61  void setPalette(tUBYTE num, uint col) {mPalette[num] = col;}
62  void setPalette(uint col) {mPalette[mPen] = col;}
63 
64  void setRomConfig(tUBYTE romcfg) {mRomConfig = romcfg;}
65  void setRamConfig(tUBYTE ramcfg) {mRamConfig = ramcfg;}
66  void setRamBank (tUBYTE ramcfg) {mRamBank = ramcfg;}
67  void setUpperRom (tUBYTE ramcfg) {mUpperRom = ramcfg;}
68 
71 
72  void setInterrupt(bool enabled) {mInterrupt = enabled;}
73  void setIntDelay (tUBYTE value) {mIntDelay = value;}
74  void setSlCount (tUBYTE value) {mSlCount = value;}
75 
76  private:
85 
87  tUBYTE mInk[17];
89 
90  bool mInterrupt;
92 
93  };
94 
95 } // cpc
96 
97 #endif // CPC_GATEARRAY_H
tUDWORD palette(tUBYTE num) const
Definition: gatearray.h:43
void setInk(tUBYTE num, tUBYTE ink)
Definition: gatearray.h:59
tUBYTE ink(tUBYTE num) const
Definition: gatearray.h:42
void init()
Definition: roland.cpp:97
void setSlCount(tUBYTE value)
Definition: gatearray.h:74
tUBYTE intDelay() const
Definition: gatearray.h:53
void setMode(tUBYTE mode)
Definition: gatearray.h:69
tUBYTE romConfig() const
Definition: gatearray.h:45
Namespace for all CPC components.
Definition: colours.cpp:22
void setUpperRom(tUBYTE ramcfg)
Definition: gatearray.h:67
uint32_t tUDWORD
Definition: types.h:86
tUBYTE mIntDelay
Definition: gatearray.h:91
tUBYTE counter() const
Definition: gatearray.h:49
tUBYTE mInk[17]
Definition: gatearray.h:87
~GateArray() ROLAND_DEFAULT void init()
< does nothing
bool interrupt() const
Definition: gatearray.h:52
void setInterrupt(bool enabled)
Definition: gatearray.h:72
bool mInterrupt
Definition: gatearray.h:90
tUBYTE pen() const
Definition: gatearray.h:40
tUBYTE mPen
Definition: gatearray.h:86
tUBYTE mRamConfig
Definition: gatearray.h:78
tUBYTE mRequestedMode
Definition: gatearray.h:83
tUBYTE mCounter
Definition: gatearray.h:81
tUBYTE * ink()
Definition: gatearray.h:41
GateArray()
Definition: gatearray.h:35
tUBYTE requestedMode() const
Definition: gatearray.h:51
void setIntDelay(tUBYTE value)
Definition: gatearray.h:73
void setPen(tUBYTE pen)
Definition: gatearray.h:56
tUBYTE ramConfig() const
Definition: gatearray.h:46
tUBYTE mRomConfig
Definition: gatearray.h:77
void setPalette(tUBYTE num, uint col)
Definition: gatearray.h:61
#define ROLAND_DEFAULT
Definition: compspec.h:46
tUBYTE ramBank() const
Definition: gatearray.h:47
uint8_t tUBYTE
Definition: types.h:74
unsigned int uint
Definition: types.h:121
void setPalette(uint col)
Definition: gatearray.h:62
void setRamBank(tUBYTE ramcfg)
Definition: gatearray.h:66
tUBYTE mUpperRom
Definition: gatearray.h:80
tUBYTE mRamBank
Definition: gatearray.h:79
tUDWORD mPalette[17]
Definition: gatearray.h:88
Definition: gatearray.h:31
tUBYTE mSlCount
Definition: gatearray.h:84
tUBYTE mMode
Definition: gatearray.h:82
tUBYTE mode() const
Definition: gatearray.h:50
tUBYTE upperRom() const
Definition: gatearray.h:48
tUBYTE slCount() const
Definition: gatearray.h:54
void setRequestedMode(tUBYTE mode)
Definition: gatearray.h:70
void setRamConfig(tUBYTE ramcfg)
Definition: gatearray.h:65
void setRomConfig(tUBYTE romcfg)
Definition: gatearray.h:64
void setInk(tUBYTE ink)
Definition: gatearray.h:58