2011-06-12 08:25:22 +02:00
|
|
|
#include "SPC_DSP.h"
|
2011-06-27 22:41:17 +02:00
|
|
|
#include <stdio.h>
|
2011-06-12 08:25:22 +02:00
|
|
|
|
|
|
|
class DSP : public Processor {
|
|
|
|
public:
|
2011-06-23 13:28:34 +02:00
|
|
|
inline uint8 read(uint8 addr) {
|
2011-06-27 22:41:17 +02:00
|
|
|
synchronize ();
|
2011-06-23 13:28:34 +02:00
|
|
|
return spc_dsp.read(addr);
|
|
|
|
}
|
2011-06-12 08:25:22 +02:00
|
|
|
|
2011-06-27 22:41:17 +02:00
|
|
|
inline void synchronize (void) {
|
|
|
|
if (clock) {
|
|
|
|
spc_dsp.run (clock);
|
|
|
|
clock = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-23 13:28:34 +02:00
|
|
|
inline void write(uint8 addr, uint8 data) {
|
2011-06-27 22:41:17 +02:00
|
|
|
synchronize ();
|
2011-06-23 13:28:34 +02:00
|
|
|
spc_dsp.write(addr, data);
|
|
|
|
}
|
2011-06-12 08:25:22 +02:00
|
|
|
|
2011-06-24 13:42:04 +02:00
|
|
|
void save_state(uint8 **);
|
|
|
|
void load_state(uint8 **);
|
|
|
|
|
2011-06-12 08:25:22 +02:00
|
|
|
void power();
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
DSP();
|
|
|
|
|
|
|
|
SPC_DSP spc_dsp;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern DSP dsp;
|