mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-04-02 10:42:14 -04:00
This represents a major code restructuring. The dot-based and scanline-based renderers are now split into two separate core libraries, asnes and bsnes. For now at least, these are -internal- names. I'm not entirely decided on how I'm going to handle releasing these two separate builds. Regardless, the folders need names. asnes has had all of the processor subfolders collapsed back into their parent folders. In other words, ppu's functions were moved into ppu/sppu, and then ppu was deleted, and then ppu/sppu became the new ppu. Repeat this for the cpu, smp and dsp and there you go. asnes/dsp also removed the DSP_STATE_MACHINE option. This was done for the sake of consistency with the rest of the core. asnes' debugger mode is currently extremely broken, but I will be fixing it in time. And for now, bsnes has kept the processor abstraction layer. I may keep it around, not sure yet. It doesn't hurt speed or anything, so I'm not too worried about making a decision right away. I may throw snesfilter, snesreader and supergameboy into this folder, just to have everything in one place. The alternate GUI forks are definitely going in there as dotnet, cocoa and python. Compiled output goes to the out/ folder now, to prevent conflicts with a file and folder named bsnes, for instance.
94 lines
2.2 KiB
C++
94 lines
2.2 KiB
C++
namespace SNES {
|
|
namespace Info {
|
|
static const char Name[] = "asnes";
|
|
static const char Version[] = "000";
|
|
static const unsigned SerializerVersion = 12;
|
|
}
|
|
}
|
|
|
|
//#define DEBUGGER
|
|
|
|
#include <libco/libco.h>
|
|
|
|
#include <nall/algorithm.hpp>
|
|
#include <nall/any.hpp>
|
|
#include <nall/array.hpp>
|
|
#include <nall/detect.hpp>
|
|
#include <nall/dl.hpp>
|
|
#include <nall/endian.hpp>
|
|
#include <nall/file.hpp>
|
|
#include <nall/foreach.hpp>
|
|
#include <nall/function.hpp>
|
|
#include <nall/moduloarray.hpp>
|
|
#include <nall/platform.hpp>
|
|
#include <nall/property.hpp>
|
|
#include <nall/serializer.hpp>
|
|
#include <nall/stdint.hpp>
|
|
#include <nall/string.hpp>
|
|
#include <nall/utility.hpp>
|
|
#include <nall/vector.hpp>
|
|
using namespace nall;
|
|
|
|
#ifdef DEBUGGER
|
|
#define debugvirtual virtual
|
|
#else
|
|
#define debugvirtual
|
|
#endif
|
|
|
|
namespace SNES {
|
|
typedef int8_t int8;
|
|
typedef int16_t int16;
|
|
typedef int32_t int32;
|
|
typedef int64_t int64;
|
|
typedef uint8_t uint8;
|
|
typedef uint16_t uint16;
|
|
typedef uint32_t uint32;
|
|
typedef uint64_t uint64;
|
|
|
|
struct Processor {
|
|
cothread_t thread;
|
|
unsigned frequency;
|
|
int64 clock;
|
|
|
|
inline void create(void (*entrypoint_)(), unsigned frequency_) {
|
|
if(thread) co_delete(thread);
|
|
thread = co_create(65536 * sizeof(void*), entrypoint_);
|
|
frequency = frequency_;
|
|
clock = 0;
|
|
}
|
|
|
|
inline void serialize(serializer &s) {
|
|
s.integer(frequency);
|
|
s.integer(clock);
|
|
}
|
|
|
|
inline Processor() : thread(0) {}
|
|
};
|
|
|
|
struct ChipDebugger {
|
|
virtual bool property(unsigned id, string &name, string &value) = 0;
|
|
};
|
|
|
|
#include <memory/memory.hpp>
|
|
#include <ppu/ppu.hpp>
|
|
#include <cpu/core/core.hpp>
|
|
#include <cpu/cpu.hpp>
|
|
#include <smp/core/core.hpp>
|
|
#include <smp/smp.hpp>
|
|
#include <dsp/dsp.hpp>
|
|
#include <system/system.hpp>
|
|
#include <chip/chip.hpp>
|
|
#include <cartridge/cartridge.hpp>
|
|
#include <cheat/cheat.hpp>
|
|
|
|
#include <memory/memory-inline.hpp>
|
|
#include <ppu/counter/counter-inline.hpp>
|
|
#include <cheat/cheat-inline.hpp>
|
|
}
|
|
|
|
namespace nall {
|
|
template<> struct has_size<SNES::MappedRAM> { enum { value = true }; };
|
|
template<> struct has_size<SNES::StaticRAM> { enum { value = true }; };
|
|
}
|
|
|
|
#undef debugvirtual
|