2015-11-10 11:02:29 +00:00
|
|
|
//Sony CXP1100Q-1
|
Update to v074r11 release.
byuu says:
Changelog:
- debugger compiles on all three profiles
- libsnes compiles on all three platforms (no API changes to libsnes)
- memory.cpp : namespace memory removed (wram -> cpu, apuram -> smp,
vram, oam, cgram -> ppu)
- sa1.cpp : namespace memory removed (SA-1 specific functions merged
inline to SA1::bus_read,write)
- GameBoy: added serial link support with interrupts and proper 8192hz
timing, but obviously it acts as if no other GB is connected to it
- GameBoy: added STAT OAM interrupt, and better STAT d1,d0 mode values
- UI: since Qt is dead, I've renamed the config files back to bsnes.cfg
and bsnes-geometry.cfg
- SA1: IRAM was not syncing to CPU on SA-1 side
- PPU/Accuracy and PPU/Performance needed Sprite oam renamed to Sprite
sprite; so that I could add uint8 oam[544]
- makes more sense anyway, OAM = object attribute memory, obj or
sprite are better names for Sprite rendering class
- more cleanup
2011-01-24 09:03:17 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
struct SMP : Processor::SPC700, Thread {
|
|
|
|
alwaysinline auto step(uint clocks) -> void;
|
|
|
|
alwaysinline auto synchronizeCPU() -> void;
|
|
|
|
alwaysinline auto synchronizeDSP() -> void;
|
|
|
|
|
|
|
|
auto portRead(uint2 port) const -> uint8;
|
|
|
|
auto portWrite(uint2 port, uint8 data) -> void;
|
2010-08-09 13:33:44 +00:00
|
|
|
|
2016-02-09 11:51:12 +00:00
|
|
|
auto main() -> void;
|
2015-11-10 11:02:29 +00:00
|
|
|
auto power() -> void;
|
|
|
|
auto reset() -> void;
|
2010-08-09 13:33:44 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
auto serialize(serializer&) -> void;
|
|
|
|
|
2016-02-16 09:27:55 +00:00
|
|
|
uint8 iplrom[64];
|
|
|
|
uint8 apuram[64 * 1024];
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2012-02-09 12:53:55 +00:00
|
|
|
privileged:
|
2010-08-09 13:33:44 +00:00
|
|
|
struct {
|
2010-08-09 13:28:56 +00:00
|
|
|
//timing
|
2015-11-10 11:02:29 +00:00
|
|
|
uint clockCounter;
|
|
|
|
uint dspCounter;
|
|
|
|
uint timerStep;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
//$00f0
|
2015-11-10 11:02:29 +00:00
|
|
|
uint8 clockSpeed;
|
|
|
|
uint8 timerSpeed;
|
|
|
|
bool timersEnable;
|
|
|
|
bool ramDisable;
|
|
|
|
bool ramWritable;
|
|
|
|
bool timersDisable;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
//$00f1
|
2015-11-10 11:02:29 +00:00
|
|
|
bool iplromEnable;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
//$00f2
|
2015-11-10 11:02:29 +00:00
|
|
|
uint8 dspAddr;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
//$00f8,$00f9
|
2011-05-02 13:53:16 +00:00
|
|
|
uint8 ram00f8;
|
|
|
|
uint8 ram00f9;
|
2010-08-09 13:28:56 +00:00
|
|
|
} status;
|
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
static auto Enter() -> void;
|
2012-02-09 12:53:55 +00:00
|
|
|
|
|
|
|
struct Debugger {
|
2016-06-17 13:03:54 +00:00
|
|
|
hook<auto (uint16) -> void> execute;
|
|
|
|
hook<auto (uint16, uint8) -> void> read;
|
|
|
|
hook<auto (uint16, uint8) -> void> write;
|
2012-02-09 12:53:55 +00:00
|
|
|
} debugger;
|
2012-04-29 06:16:44 +00:00
|
|
|
|
|
|
|
//memory.cpp
|
2015-11-10 11:02:29 +00:00
|
|
|
auto ramRead(uint16 addr) -> uint8;
|
|
|
|
auto ramWrite(uint16 addr, uint8 data) -> void;
|
2012-04-29 06:16:44 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
auto busRead(uint16 addr) -> uint8;
|
|
|
|
auto busWrite(uint16 addr, uint8 data) -> void;
|
2012-04-29 06:16:44 +00:00
|
|
|
|
2016-06-05 04:52:43 +00:00
|
|
|
auto io() -> void override;
|
|
|
|
auto read(uint16 addr) -> uint8 override;
|
|
|
|
auto write(uint16 addr, uint8 data) -> void override;
|
2012-04-29 06:16:44 +00:00
|
|
|
|
2016-06-05 04:52:43 +00:00
|
|
|
auto disassemblerRead(uint16 addr) -> uint8 override;
|
2012-04-29 06:16:44 +00:00
|
|
|
|
|
|
|
//timing.cpp
|
2016-06-05 04:52:43 +00:00
|
|
|
template<uint Frequency>
|
2012-04-29 06:16:44 +00:00
|
|
|
struct Timer {
|
2015-11-10 11:02:29 +00:00
|
|
|
uint8 stage0;
|
|
|
|
uint8 stage1;
|
|
|
|
uint8 stage2;
|
|
|
|
uint4 stage3;
|
|
|
|
bool line;
|
2012-04-29 06:16:44 +00:00
|
|
|
bool enable;
|
|
|
|
uint8 target;
|
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
auto tick() -> void;
|
|
|
|
auto synchronizeStage1() -> void;
|
2012-04-29 06:16:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Timer<192> timer0;
|
|
|
|
Timer<192> timer1;
|
|
|
|
Timer< 24> timer2;
|
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
alwaysinline auto addClocks(uint clocks) -> void;
|
|
|
|
alwaysinline auto cycleEdge() -> void;
|
2010-08-09 13:28:56 +00:00
|
|
|
};
|
|
|
|
|
Update to v085r03 release.
byuu says:
Changelog:
- fixed cursor being visible under Metacity window manager (hopefully
doesn't cause regression with other WMs)
- show normal cursor when using SDL video driver
- added menu accelerators (meh, why not?)
- removed debugvirtual, ChipDebugger and chip/debugger functionality
entirely
- alt/smp disassembler moved up
- fixed alt/smp incw/decw instructions (unsigned->uint16 for internal
variables)
My plan going forward for a debugger is not to hardcode functionality
that causes the 10-15% slowdown right into the emulator itself.
Instead, I'm going to make a callback class, which will be a specialized
version of nall::function:
- can call function even if not assigned (results in no-op, return type
must have a trivial default constructor)
- if compiled without #define DEBUGGER, the entire thing turns into
a huge no-op; and will be eliminated entirely when compiled
- strategically place the functions: cb_step, cb_read, cb_write, etc.
From here, the ui-debugger GUI will bind the callbacks, implement
breakpoint checking, usage table generation, etc itself.
I'll probably have to add some breakout commands to exit the emulation
core prior to a frame event in some cases as well.
I didn't initially want any debugger-related stuff in the base cores,
but the #if debugger sCPUDebugger #else sCPU #endif stuff was already
more of a burden than this will be.
2012-02-04 09:23:53 +00:00
|
|
|
extern SMP smp;
|