libsidplayfp  1.2.1
psiddrv.h
1 /*
2  * This file is part of libsidplayfp, a SID player engine.
3  *
4  * Copyright 2012-2013 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 
26 class SidTuneInfo;
27 class sidmemory;
28 
29 class psiddrv
30 {
31 private:
32  const SidTuneInfo *m_tuneInfo;
33  const char *m_errorString;
34 
35  uint8_t *reloc_driver;
36  int reloc_size;
37 
38  uint_least16_t m_driverAddr;
39  uint_least16_t m_driverLength;
40  uint_least16_t m_powerOnDelay;
41 
42 private:
43  static uint8_t psid_driver[];
44 
45 private:
50  uint8_t iomap(uint_least16_t addr) const;
51 
52 public:
53  psiddrv(const SidTuneInfo *tuneInfo) :
54  m_tuneInfo(tuneInfo),
55  m_powerOnDelay(0) {}
56 
62  void powerOnDelay(uint_least16_t delay) { m_powerOnDelay = delay; }
63 
69  bool drvReloc(sidmemory *mem);
70 
77  void install(sidmemory *mem) const;
78 
84  const char* errorString() const { return m_errorString; }
85 
86  uint_least16_t driverAddr() const { return m_driverAddr; }
87  uint_least16_t driverLength() const { return m_driverLength; }
88 };
89 
90 #endif
Definition: SidTuneInfo.h:36
void powerOnDelay(uint_least16_t delay)
Definition: psiddrv.h:62
Definition: psiddrv.h:29
bool drvReloc(sidmemory *mem)
Definition: psiddrv.cpp:67
void install(sidmemory *mem) const
Definition: psiddrv.cpp:160
const char * errorString() const
Definition: psiddrv.h:84
Definition: sidmemory.h:30