bsnes/higan/ws/cpu/cpu.hpp
Tim Allen 680d16561e Update to v097r29 release.
byuu says:

Changelog:
- fixed DAS instruction (Judgment Silversword score)
- fixed [VH]TMR_FREQ writes (Judgement Silversword audio after area 20)
- fixed initialization of SP (fixes seven games that were hanging on
  startup)
- added SER_STATUS and SER_DATA stubs (fixes four games that were
  hanging on startup)
- initialized IEEP data (fixes Super Robot Taisen Compact 2 series)
  - note: you'll need to delete your internal.com in WonderSwan
    (Color).sys folders
- fixed CMPS and SCAS termination condition (fixes serious bugs in four
  games)
- set read/writeCompleted flags for EEPROM status (fixes Tetsujin 28
  Gou)
- major code cleanups to SFC/R65816 and SFC/CPU
  - mostly refactored disassembler to output strings instead of using
    char* buffer
  - unrolled all the subfolders on sfc/cpu to a single directory
  - corrected casing for all of sfc/cpu and a large portion of
    processor/r65816

I kind of went overboard on the code cleanup with this WIP. Hopefully
nothing broke. Any testing one can do with the SFC accuracy core would
be greatly appreciated.

There's still an absolutely huge amount of work left to go, but I do
want to eventually refresh the entire codebase to my current coding
style, which is extremely different from stuff that's been in higan
mostly untouched since ~2006 or so. It's dangerous and fickle work, but
if I don't do it, then the code will be a jumbled mess of several
different styles.
2016-03-26 12:56:15 +11:00

79 lines
1.6 KiB
C++

struct CPU : Processor::V30MZ, Thread, IO {
enum class Interrupt : uint {
SerialSend,
Input,
Cartridge,
SerialReceive,
LineCompare,
VblankTimer,
Vblank,
HblankTimer,
};
static auto Enter() -> void;
auto main() -> void;
auto step(uint clocks) -> void;
auto wait(uint clocks = 1) -> void override;
auto read(uint20 addr) -> uint8 override;
auto write(uint20 addr, uint8 data) -> void override;
auto in(uint16 port) -> uint8 override;
auto out(uint16 port, uint8 data) -> void override;
auto power() -> void;
//io.cpp
auto keypadRead() -> uint4;
auto portRead(uint16 addr) -> uint8 override;
auto portWrite(uint16 addr, uint8 data) -> void override;
//interrupt.cpp
auto poll() -> void;
auto raise(Interrupt) -> void;
auto lower(Interrupt) -> void;
//dma.cpp
auto dmaTransfer() -> void;
//serialization.cpp
auto serialize(serializer&) -> void;
struct Registers {
//$0040-0042 DMA_SRC
uint20 dmaSource;
//$0044-0045 DMA_DST
uint16 dmaTarget;
//$0046-0047 DMA_LEN
uint16 dmaLength;
//$0048 DMA_CTRL
uint1 dmaEnable;
uint1 dmaMode; //0 = increment; 1 = decrement
//$00b0 INT_BASE
uint8 interruptBase;
//$00b1 SER_DATA
uint8 serialData;
//$00b2 INT_ENABLE
uint8 interruptEnable;
//$00b3 SER_STATUS
uint1 serialBaudRate; //0 = 9600; 1 = 38400
uint1 serialEnable;
//$00b4 INT_STATUS
uint8 interruptStatus;
//$00b5 KEYPAD
uint1 ypadEnable;
uint1 xpadEnable;
uint1 buttonEnable;
} r;
};
extern CPU cpu;