ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
ppi.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 PPI_H
21 #define PPI_H
22 
23 #include "compspec.h"
24 #include "types.h"
25 
26 namespace cpcx
27 {
28 
31  class Ppi final
32  {
33 
34  public:
35  enum FlagB
36  {
37  Triumph = 2,
38  Saisho = 4 ,
39  Solavox = 6 ,
40  Awa = 8 ,
41  Schneider = 10 ,
42  Orion = 12 ,
43  Amstrad = 14,
45  Refresh50Hz = 16,
46  Expansion = 32,
48  TapeRead = 128
49  };
50 
51  Ppi() {init();}
53 
54  void init();
55 
56  tUBYTE portA() const {return mPortA;}
57  tUBYTE portB() const {return mPortB;}
58  tUBYTE portC() const {return mPortC;}
59  tUBYTE control() const {return mControl;}
60  tUBYTE jumpers() const {return mJumpers;}
61 
62  void setA(tUBYTE val) {mPortA = val;}
63  void setB(tUBYTE val) {mPortB = val;}
64  void setC(tUBYTE val) {mPortC = val;}
65  void setControl(tUBYTE val) {mControl = val;}
66  void setJumpers(tUBYTE val) {mJumpers = val;}
67 
68  void addB(tUBYTE flags) {mPortB |= flags;}
69  void removeB(tUBYTE flags) {mPortB &= ~flags;}
70 
71  private:
76 
78  };
79 
80 } // cpc
81 
82 #endif // CPC_PPI_H
tUBYTE mControl
Definition: ppi.h:75
void removeB(tUBYTE flags)
remove a flag from Port B
Definition: ppi.h:69
Printer is not ready (internal)
Definition: ppi.h:47
VSync (internal)
Definition: ppi.h:44
void init()
Definition: roland.cpp:97
void addB(tUBYTE flags)
add a flag to Port B
Definition: ppi.h:68
Tape will be read (internal)
Definition: ppi.h:48
Namespace for all CPC components.
Definition: colours.cpp:22
void setC(tUBYTE val)
set Port C
Definition: ppi.h:64
void setB(tUBYTE val)
set Port B
Definition: ppi.h:63
Manufacturer Amstrad.
Definition: ppi.h:43
void setControl(tUBYTE val)
set control bits
Definition: ppi.h:65
tUBYTE portC() const
get Port C
Definition: ppi.h:58
Manufacturer Solavox.
Definition: ppi.h:39
No expansion Peripherals available (internal)
Definition: ppi.h:46
tUBYTE portB() const
get Port B
Definition: ppi.h:57
tUBYTE mPortC
Definition: ppi.h:74
tUBYTE mPortB
Definition: ppi.h:73
Definition: ppi.h:31
tUBYTE control() const
get control bits
Definition: ppi.h:59
Manufacturer Awa.
Definition: ppi.h:40
tUBYTE portA() const
get Port A
Definition: ppi.h:56
Manufacturer Triumph.
Definition: ppi.h:37
void setA(tUBYTE val)
set Port A
Definition: ppi.h:62
~Ppi() ROLAND_DEFAULT void init()
set initial values
tUBYTE mPortA
Definition: ppi.h:72
#define ROLAND_DEFAULT
Definition: compspec.h:46
uint8_t tUBYTE
Definition: types.h:74
void setJumpers(tUBYTE val)
set jumpers
Definition: ppi.h:66
Manufacturer Schneider.
Definition: ppi.h:41
50Hz instead of 60Hz refresh rate (DIP-switch)
Definition: ppi.h:45
tUBYTE mJumpers
Definition: ppi.h:77
tUBYTE jumpers() const
get jumpers
Definition: ppi.h:60
Ppi()
Definition: ppi.h:51
Manufacturer Saisho.
Definition: ppi.h:38
FlagB
< (DIP-switch, do not combine manufacturer)
Definition: ppi.h:35
Manufacturer Orion.
Definition: ppi.h:42