libsidplayfp  2.11.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  uint_least16_t m_powerOnDelay;
48 
49 private:
56  uint8_t iomap(uint_least16_t addr) const;
57 
58 public:
59  psiddrv(const SidTuneInfo *tuneInfo) :
60  m_tuneInfo(tuneInfo),
61  m_powerOnDelay(0) {}
62 
68  void powerOnDelay(uint_least16_t delay) { m_powerOnDelay = delay; }
69 
75  bool drvReloc();
76 
84  void install(sidmemory& mem, uint8_t video) const;
85 
91  const char* errorString() const { return m_errorString; }
92 
93  uint_least16_t driverAddr() const { return m_driverAddr; }
94  uint_least16_t driverLength() const { return m_driverLength; }
95 };
96 
97 }
98 
99 #endif
Definition: SidTuneInfo.h:39
Definition: psiddrv.h:35
void powerOnDelay(uint_least16_t delay)
Definition: psiddrv.h:68
void install(sidmemory &mem, uint8_t video) const
Definition: psiddrv.cpp:211
const char * errorString() const
Definition: psiddrv.h:91
bool drvReloc()
Definition: psiddrv.cpp:138
Definition: sidmemory.h:34