snes9x/apu/bapu/snes/snes.hpp

61 lines
982 B
C++
Raw Normal View History

2011-06-12 06:25:22 +00:00
#ifndef __SNES_HPP
#define __SNES_HPP
#include "snes9x.h"
#define SNES9X
#if defined(__GNUC__)
#define inline inline
#define alwaysinline inline __attribute__((always_inline))
#elif defined(_MSC_VER)
#define inline inline
#define alwaysinline inline __forceinline
#else
#define inline inline
#define alwaysinline inline
#endif
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:
enum { Threaded = false };
int frequency;
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;
} /* namespace SNES */
#endif