snes9x/apu/bapu/snes/snes.hpp

61 lines
991 B
C++
Raw Normal View History

2011-06-12 08:25:22 +02:00
#ifndef __SNES_HPP
#define __SNES_HPP
#include "../../../snes9x.h"
2011-06-12 08:25:22 +02:00
#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 08:25:22 +02:00
#define debugvirtual
namespace SNES
{
struct Processor
{
unsigned frequency;
2011-06-24 13:42:04 +02:00
int32 clock;
2011-06-12 08:25:22 +02:00
};
#include "../smp/smp.hpp"
#include "../dsp/sdsp.hpp"
2011-06-22 13:03:29 +02:00
2011-06-12 08:25:22 +02:00
class CPU
{
public:
enum { Threaded = false };
int frequency;
2011-06-22 13:03:29 +02:00
uint8 registers[4];
2011-06-12 08:25:22 +02:00
2011-06-22 13:03:29 +02:00
inline void reset ()
2011-06-12 08:25:22 +02:00
{
2011-06-22 13:03:29 +02:00
registers[0] = registers[1] = registers[2] = registers[3] = 0;
}
alwaysinline void port_write (uint8 port, uint8 data)
2011-06-22 13:03:29 +02:00
{
registers[port & 3] = data;
2011-06-12 08:25:22 +02:00
}
alwaysinline uint8 port_read (uint8 port)
2011-06-12 08:25:22 +02:00
{
2011-06-22 13:03:29 +02:00
return registers[port & 3];
2011-06-12 08:25:22 +02:00
}
};
extern CPU cpu;
} /* namespace SNES */
#endif