2011-06-12 06:25:22 +00:00
|
|
|
#ifndef __SNES_HPP
|
|
|
|
#define __SNES_HPP
|
|
|
|
|
2018-08-16 19:04:43 +00:00
|
|
|
#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
|
|
|
};
|
|
|
|
|
2012-02-03 22:44:58 +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;
|
|
|
|
}
|
2011-06-18 10:31:44 +00:00
|
|
|
|
2011-06-23 10:24:13 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2011-06-23 10:24:13 +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
|