libsidplayfp  2.15.0
psiddrv.h
1 /*
2  * This file is part of libsidplayfp, a SID player engine.
3  *
4  * Copyright 2012-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 PSIDDRV_H
22 #define PSIDDRV_H
23 
24 #include <stdint.h>
25 #include <vector>
26 
27 class SidTuneInfo;
28 
29 namespace libsidplayfp
30 {
31 
32 class sidmemory;
33 
34 class psiddrv
35 {
36 private:
37  const SidTuneInfo *m_tuneInfo;
38  const char *m_errorString;
39 
40  std::vector<uint8_t> psid_driver;
41  uint8_t *reloc_driver;
42  int reloc_size;
43 
44  uint_least16_t m_driverAddr;
45  uint_least16_t m_driverLength;
46 
47 private:
54  uint8_t iomap(uint_least16_t addr) const;
55 
56 public:
57  psiddrv(const SidTuneInfo *tuneInfo) :
58  m_tuneInfo(tuneInfo) {}
59 
65  bool drvReloc();
66 
74  void install(sidmemory& mem, uint8_t video) const;
75 
81  const char* errorString() const { return m_errorString; }
82 
83  uint_least16_t driverAddr() const { return m_driverAddr; }
84  uint_least16_t driverLength() const { return m_driverLength; }
85 };
86 
87 }
88 
89 #endif
Definition: SidTuneInfo.h:39
Definition: psiddrv.h:35
void install(sidmemory &mem, uint8_t video) const
Definition: psiddrv.cpp:211
const char * errorString() const
Definition: psiddrv.h:81
bool drvReloc()
Definition: psiddrv.cpp:138
Definition: sidmemory.h:34