1
// Super Nintendo (SNES) SPC-700 CPU emulator
3
// Game_Music_Emu 0.5.2
7
#include "blargg_common.h"
9
typedef unsigned spc_addr_t;
10
typedef blargg_long spc_time_t;
15
typedef BOOST::uint8_t uint8_t;
18
// Keeps pointer to 64K RAM
19
Spc_Cpu( Snes_Spc* spc, uint8_t* ram );
21
// SPC-700 registers. *Not* kept updated during a call to run().
23
long pc; // more than 16 bits to allow overflow detection
31
// Run CPU for at least 'count' cycles. Return the number of cycles remaining
32
// when emulation stopped (negative if extra cycles were emulated). Emulation
33
// stops when there are no more remaining cycles or an unhandled instruction
34
// is encountered (STOP, SLEEP, and any others not yet implemented). In the
35
// latter case, the return value is greater than zero.
36
spc_time_t run( spc_time_t count );
38
// Number of clock cycles remaining for current run() call
39
spc_time_t remain() const;
41
// Access memory as the emulated CPU does
42
int read ( spc_addr_t );
43
void write( spc_addr_t, int );
47
Spc_Cpu( const Spc_Cpu& );
48
Spc_Cpu& operator = ( const Spc_Cpu& );
49
unsigned mem_bit( spc_addr_t );
55
inline spc_time_t Spc_Cpu::remain() const { return remain_; }