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 {
|
Updated to v067r21 release.
byuu says:
This moves toward a profile-selection mode. Right now, it is incomplete.
There are three binaries, one for each profile. The GUI selection
doesn't actually do anything yet. There will be a launcher in a future
release that loads each profile's respective binary.
I reverted away from blargg's SMP library for the time being, in favor
of my own. This will fix most of the csnes/bsnes-performance bugs. This
causes a 10% speed hit on 64-bit platforms, and a 15% speed hit on
32-bit platforms. I hope to be able to regain that speed in the future,
I may also experiment with creating my own fast-SMP core which drops bus
hold delays and TEST register support (never used by anything, ever.)
Save states now work in all three cores, but they are not
cross-compatible. The profile name is stored in the description field of
the save states, and it won't load a state if the profile name doesn't
match.
The debugger only works on the research target for now. Give it time and
it will return for the other targets.
Other than that, let's please resume testing on all three once again.
See how far we get this time :)
I can confirm the following games have issues on the performance
profile:
- Armored Police Metal Jacket (minor logo flickering, not a big deal)
- Chou Aniki (won't start, so obviously unplayable)
- Robocop vs The Terminator (major in-game flickering, unplayable)
Anyone still have that gigantic bsnes thread archive from the ZSNES
forum? Maybe I posted about how to fix those two broken games in there,
heh.
I really want to release this as v1.0, but my better judgment says we
need to give it another week. Damn.
2010-10-20 11:22:44 +00:00
|
|
|
enum : bool { Threaded = true };
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
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
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
auto enter() -> void;
|
|
|
|
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;
|
|
|
|
|
|
|
|
uint8 iplrom[64] = {0};
|
|
|
|
uint8 apuram[64 * 1024] = {0};
|
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 {
|
|
|
|
hook<void (uint16)> op_exec;
|
Update to v094r05 release.
byuu says:
Commands can be prefixed with: (cpu|smp|ppu|dsp|apu|vram|oam|cgram)/ to
set their source. Eg "vram/hex 0800" or "smp/breakpoints.append execute
ffc0"; default is cpu.
These overlap a little bit in odd ways, but that's just the way the SNES
works: it's not a very orthogonal system. CPU is both a processor and
the main bus (ROM, RAM, WRAM, etc), APU is the shared memory by the
SMP+DSP (eg use it to catch writes from either chip); PPU probably won't
ever be used since it's broken down into three separate buses (VRAM,
OAM, CGRAM), but DSP could be useful for tracking bugs like we found in
Koushien 2 with the DSP echo buffer corrupting SMP opcodes. Technically
the PPU memory pools are only ever tripped by the CPU poking at them, as
the PPU doesn't ever write.
I now have run.for, run.to, step.for, step.to. The difference is that
run only prints the next instruction after running, whereas step prints
all of the instructions along the way as well. run.to acts the same as
"step over" here. Although it's not quite as nice, since you have to
specify the address of the next instruction.
Logging the Field/Vcounter/Hcounter on instruction listings now, good
for timing information.
Added in the tracer mask, as well as memory export, as well as
VRAM/OAM/CGRAM/SMP read/write/execute breakpoints, as well as an APU
usage map (it tracks DSP reads/writes separately, although I don't
currently have debugger callbacks on DSP accesses just yet.)
Have not hooked up actual SMP debugging just yet, but I plan to soon.
Still thinking about how I want to allow / block interleaving of
instructions (terminal output and tracing.)
So ... remaining tasks at this point:
- full SMP debugging
- CPU+SMP interleave support
- aliases
- hotkeys
- save states (will be kind of tricky ... will have to suppress
breakpoints during synchronization, or abort a save in a break event.)
- keep track of window geometry between runs
2014-02-05 11:30:08 +00:00
|
|
|
hook<void (uint16, uint8)> op_read;
|
2012-02-09 12:53:55 +00:00
|
|
|
hook<void (uint16, uint8)> op_write;
|
|
|
|
} 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
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
auto op_io() -> void;
|
|
|
|
auto op_read(uint16 addr) -> uint8;
|
|
|
|
auto op_write(uint16 addr, uint8 data) -> void;
|
2012-04-29 06:16:44 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
auto disassembler_read(uint16 addr) -> uint8;
|
2012-04-29 06:16:44 +00:00
|
|
|
|
|
|
|
//timing.cpp
|
2015-11-10 11:02:29 +00:00
|
|
|
template<unsigned 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;
|