libsidplayfp  2.0.2
c64sid.h
1 /*
2  * This file is part of libsidplayfp, a SID player engine.
3  *
4  * Copyright 2013-2015 Leandro Nini <drfiemost@users.sourceforge.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef C64SID_H
22 #define C64SID_H
23 
24 #include "Banks/Bank.h"
25 
26 #include "sidcxx11.h"
27 
28 #include <stdint.h>
29 
30 namespace libsidplayfp
31 {
32 
36 class c64sid : public Bank
37 {
38 protected:
39  virtual ~c64sid() {}
40 
41  virtual uint8_t read(uint_least8_t addr) = 0;
42  virtual void write(uint_least8_t addr, uint8_t data) = 0;
43 
44 public:
45  virtual void reset(uint8_t volume) = 0;
46 
47  void reset() { reset(0); }
48 
49  // Bank functions
50  void poke(uint_least16_t address, uint8_t value) override { write(address & 0x1f, value); }
51  uint8_t peek(uint_least16_t address) override { return read(address & 0x1f); }
52 };
53 
54 }
55 
56 #endif // C64SID_H
libsidplayfp::Bank
Definition: Bank.h:36
libsidplayfp::c64sid::peek
uint8_t peek(uint_least16_t address) override
Definition: c64sid.h:51
libsidplayfp::c64sid::poke
void poke(uint_least16_t address, uint8_t value) override
Definition: c64sid.h:50
libsidplayfp::c64sid
Definition: c64sid.h:37