bsnes/higan/sfc/smp/smp.hpp
Tim Allen 7a68059f78 Update to v099r12 release.
byuu says:

Changelog:
- fixed FC AxROM / VRC7 regression
- BitField split to BooleanBitField/NaturalBitField (in preparation
  for IntegerBitField)
- BitFieldReference removed
- GB CPU cleaned up
- GB Cartridge + Mappers cleaned up
- SFC CGRAM is now emulated as uint15[256] instead of uint[512]
- sfc/ppu/memory.cpp no longer needed; removed
- purged SFC Debugger hooks for now (some of the operator[] calls were
  bypassing them anyway)

Unfortunately, for reasons that defy all semblance of logic, the CGRAM
change caused a slight speed hit. As have the last few changes. We're
now down to around 129.5fps compared to 123.fps for v099 and 134.5fps
at our peak (v099r01-r02).

I really like the style I came up with for the Game Boy mappers to settle
the purpose(ROM,RAM) vs (rom,ram)Purpose naming convention. If I ever get
around to redoing the NES mappers, that's likely the approach I'll take.
2016-06-28 20:43:47 +10:00

86 lines
1.7 KiB
C++

//Sony CXP1100Q-1
struct SMP : Processor::SPC700, Thread {
alwaysinline auto step(uint clocks) -> void;
alwaysinline auto synchronizeCPU() -> void;
alwaysinline auto synchronizeDSP() -> void;
auto readPort(uint2 port) const -> uint8;
auto writePort(uint2 port, uint8 data) -> void;
auto main() -> void;
auto load(Markup::Node) -> bool;
auto power() -> void;
auto reset() -> void;
auto serialize(serializer&) -> void;
uint8 iplrom[64];
uint8 apuram[64 * 1024];
privileged:
struct {
//timing
uint clockCounter;
uint dspCounter;
uint timerStep;
//$00f0
uint8 clockSpeed;
uint8 timerSpeed;
bool timersEnable;
bool ramDisable;
bool ramWritable;
bool timersDisable;
//$00f1
bool iplromEnable;
//$00f2
uint8 dspAddr;
//$00f8,$00f9
uint8 ram00f8;
uint8 ram00f9;
} status;
static auto Enter() -> void;
//memory.cpp
auto readRAM(uint16 addr) -> uint8;
auto writeRAM(uint16 addr, uint8 data) -> void;
auto readBus(uint16 addr) -> uint8;
auto writeBus(uint16 addr, uint8 data) -> void;
auto io() -> void override;
auto read(uint16 addr) -> uint8 override;
auto write(uint16 addr, uint8 data) -> void override;
auto readDisassembler(uint16 addr) -> uint8 override;
//timing.cpp
template<uint Frequency>
struct Timer {
uint8 stage0;
uint8 stage1;
uint8 stage2;
uint4 stage3;
bool line;
bool enable;
uint8 target;
auto tick() -> void;
auto synchronizeStage1() -> void;
};
Timer<192> timer0;
Timer<192> timer1;
Timer< 24> timer2;
alwaysinline auto addClocks(uint clocks) -> void;
alwaysinline auto cycleEdge() -> void;
};
extern SMP smp;