snes9x/apu/bapu/snes/snes.hpp

48 lines
687 B
C++
Raw Normal View History

2011-06-12 06:25:22 +00:00
#ifndef __SNES_HPP
#define __SNES_HPP
#include "../../../snes9x.h"
2019-02-09 18:03:34 +00:00
#include "../../resampler.h"
#include "../../../msu1.h"
2011-06-12 06:25:22 +00:00
#define debugvirtual
namespace SNES
{
struct Processor
{
unsigned frequency;
2011-06-24 11:42:04 +00:00
int32 clock;
2011-06-12 06:25:22 +00:00
};
#include "../smp/smp.hpp"
#include "../dsp/sdsp.hpp"
2011-06-22 11:03:29 +00:00
2011-06-12 06:25:22 +00:00
class CPU
{
public:
2011-06-22 11:03:29 +00:00
uint8 registers[4];
2011-06-12 06:25:22 +00:00
2011-06-22 11:03:29 +00:00
inline void reset ()
2011-06-12 06:25:22 +00:00
{
2011-06-22 11:03:29 +00:00
registers[0] = registers[1] = registers[2] = registers[3] = 0;
}
alwaysinline void port_write (uint8 port, uint8 data)
2011-06-22 11:03:29 +00:00
{
registers[port & 3] = data;
2011-06-12 06:25:22 +00:00
}
alwaysinline uint8 port_read (uint8 port)
2011-06-12 06:25:22 +00:00
{
2011-06-22 11:03:29 +00:00
return registers[port & 3];
2011-06-12 06:25:22 +00:00
}
};
extern CPU cpu;
2019-02-23 22:00:39 +00:00
} // namespace SNES
2011-06-12 06:25:22 +00:00
#endif