2012-04-29 06:16:44 +00:00
|
|
|
struct CPU : Processor::R65816, Thread, public PPUcounter {
|
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 };
|
2015-12-06 21:11:41 +00:00
|
|
|
|
2010-08-09 13:33:44 +00:00
|
|
|
CPU();
|
2015-12-06 21:11:41 +00:00
|
|
|
|
|
|
|
alwaysinline auto step(uint clocks) -> void;
|
|
|
|
alwaysinline auto synchronizeSMP() -> void;
|
|
|
|
auto synchronizePPU() -> void;
|
|
|
|
auto synchronizeCoprocessors() -> void;
|
|
|
|
auto synchronizeDevices() -> void;
|
|
|
|
|
|
|
|
auto pio() -> uint8;
|
|
|
|
auto joylatch() -> bool;
|
|
|
|
auto interrupt_pending() -> bool;
|
|
|
|
auto port_read(uint8 port) -> uint8;
|
|
|
|
auto port_write(uint8 port, uint8 data) -> void;
|
Update to higan and icarus v095r17 release.
byuu says:
higan supports Event mapping again.
Further, icarus can now detect Event ROMs and MSU1 games.
Event ROMs must be named "program.rom", "slot-(1,2,3).rom" MSU1 games
must contain "msu1.rom"; and tracks must be named "track-#.pcm"
When importing the CC'92, PF'94 ROMs, the program.rom and
slot-(1,2,3).rom files must be concatenated. The DSP firmware can
optionally be separate, but I'd recommend you go ahead and merge it all
to one file. Especially since that common "higan DSP pack" floating
around on the web left out the DSP1 ROMs (only has DSP1B) for god knows
what reason.
There is no support for loading "game.sfc+game.msu+game-*.pcm", because
I'm not going to support trying to pull in all of those files through
importing. Games will have to be distributed as game folders to use
MSU1. The MSU1 icarus support is simply so your game folders won't
require an unstable manifest.bml file to be played. So once they're in
there, they are good for life.
Note: the Event sizes in icarus' SFC heuristics are wrong for appended
firmware. Change from 0xXX8000 to 0xXX2000 and it works fine. Will be
fixed in r18.
Added Sintendo's flickering fixes. The window one's a big help for
regular controls, but the ListView double buffering does nothing for me
on Windows 7 :( Fairly sure I know why, but too lazy to try and fix that
now.
Also fixes the mMenu thing.
2015-12-20 02:53:40 +00:00
|
|
|
auto mmio_read(uint addr, uint8 data) -> uint8;
|
2015-12-06 21:11:41 +00:00
|
|
|
auto mmio_write(uint addr, uint8 data) -> void;
|
|
|
|
|
|
|
|
auto op_io() -> void;
|
|
|
|
auto op_read(uint addr) -> uint8;
|
|
|
|
auto op_write(uint addr, uint8 data) -> void;
|
|
|
|
|
|
|
|
auto enter() -> void;
|
|
|
|
auto enable() -> void;
|
|
|
|
auto power() -> void;
|
|
|
|
auto reset() -> void;
|
|
|
|
|
|
|
|
auto serialize(serializer&) -> void;
|
|
|
|
|
|
|
|
uint8 wram[128 * 1024];
|
|
|
|
vector<Thread*> coprocessors;
|
2010-08-09 13:33:44 +00:00
|
|
|
|
|
|
|
private:
|
2010-08-11 00:40:59 +00:00
|
|
|
//cpu
|
2015-12-06 21:11:41 +00:00
|
|
|
static auto Enter() -> void;
|
2010-08-11 00:40:59 +00:00
|
|
|
|
|
|
|
//timing
|
2015-12-06 21:11:41 +00:00
|
|
|
auto queue_event(uint id) -> void;
|
|
|
|
auto last_cycle() -> void;
|
|
|
|
auto add_clocks(uint clocks) -> void;
|
|
|
|
auto scanline() -> void;
|
|
|
|
auto run_auto_joypad_poll() -> void;
|
|
|
|
|
2010-08-12 00:39:41 +00:00
|
|
|
struct QueueEvent {
|
2015-12-06 21:11:41 +00:00
|
|
|
enum : uint {
|
2010-08-12 00:39:41 +00:00
|
|
|
DramRefresh,
|
|
|
|
HdmaRun,
|
|
|
|
};
|
|
|
|
};
|
2015-12-06 21:11:41 +00:00
|
|
|
nall::priority_queue<uint> queue;
|
2010-08-11 00:40:59 +00:00
|
|
|
|
|
|
|
//memory
|
2015-12-06 21:11:41 +00:00
|
|
|
auto speed(uint addr) const -> uint;
|
2010-08-11 00:40:59 +00:00
|
|
|
|
|
|
|
//dma
|
2015-12-06 21:11:41 +00:00
|
|
|
auto dma_transfer_valid(uint8 bbus, uint abus) -> bool;
|
|
|
|
auto dma_addr_valid(uint abus) -> bool;
|
|
|
|
auto dma_read(uint abus) -> uint8;
|
|
|
|
auto dma_write(bool valid, uint addr, uint8 data) -> void;
|
|
|
|
auto dma_transfer(bool direction, uint8 bbus, uint abus) -> void;
|
|
|
|
auto dma_bbus(uint i, uint index) -> uint8;
|
|
|
|
auto dma_addr(uint i) -> uint;
|
|
|
|
auto hdma_addr(uint i) -> uint;
|
|
|
|
auto hdma_iaddr(uint i) -> uint;
|
|
|
|
auto dma_run() -> void;
|
|
|
|
auto hdma_active_after(uint i) -> bool;
|
|
|
|
auto hdma_update(uint i) -> void;
|
|
|
|
auto hdma_run() -> void;
|
|
|
|
auto hdma_init() -> void;
|
|
|
|
auto dma_reset() -> void;
|
2010-08-11 00:40:59 +00:00
|
|
|
|
|
|
|
//registers
|
|
|
|
uint8 port_data[4];
|
|
|
|
|
|
|
|
struct Channel {
|
|
|
|
bool dma_enabled;
|
|
|
|
bool hdma_enabled;
|
|
|
|
|
|
|
|
bool direction;
|
|
|
|
bool indirect;
|
|
|
|
bool unused;
|
|
|
|
bool reverse_transfer;
|
|
|
|
bool fixed_transfer;
|
|
|
|
uint8 transfer_mode;
|
|
|
|
|
|
|
|
uint8 dest_addr;
|
|
|
|
uint16 source_addr;
|
|
|
|
uint8 source_bank;
|
|
|
|
|
|
|
|
union {
|
|
|
|
uint16 transfer_size;
|
|
|
|
uint16 indirect_addr;
|
|
|
|
};
|
|
|
|
|
|
|
|
uint8 indirect_bank;
|
|
|
|
uint16 hdma_addr;
|
|
|
|
uint8 line_counter;
|
|
|
|
uint8 unknown;
|
|
|
|
|
|
|
|
bool hdma_completed;
|
|
|
|
bool hdma_do_transfer;
|
|
|
|
} channel[8];
|
2010-08-09 13:33:44 +00:00
|
|
|
|
2010-08-09 13:31:09 +00:00
|
|
|
struct Status {
|
|
|
|
bool nmi_valid;
|
|
|
|
bool nmi_line;
|
|
|
|
bool nmi_transition;
|
|
|
|
bool nmi_pending;
|
|
|
|
|
|
|
|
bool irq_valid;
|
|
|
|
bool irq_line;
|
|
|
|
bool irq_transition;
|
|
|
|
bool irq_pending;
|
|
|
|
|
2010-08-12 00:39:41 +00:00
|
|
|
bool irq_lock;
|
2010-08-09 13:31:09 +00:00
|
|
|
bool hdma_pending;
|
|
|
|
|
2015-12-06 21:11:41 +00:00
|
|
|
uint wram_addr;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2010-08-09 13:31:09 +00:00
|
|
|
bool joypad_strobe_latch;
|
|
|
|
|
|
|
|
bool nmi_enabled;
|
2010-08-11 00:40:59 +00:00
|
|
|
bool virq_enabled;
|
|
|
|
bool hirq_enabled;
|
|
|
|
bool auto_joypad_poll_enabled;
|
2010-08-09 13:31:09 +00:00
|
|
|
|
|
|
|
uint8 pio;
|
|
|
|
|
|
|
|
uint8 wrmpya;
|
|
|
|
uint8 wrmpyb;
|
|
|
|
uint16 wrdiva;
|
2010-08-11 00:40:59 +00:00
|
|
|
uint8 wrdivb;
|
2010-08-09 13:31:09 +00:00
|
|
|
|
2010-08-11 00:40:59 +00:00
|
|
|
uint16 htime;
|
|
|
|
uint16 vtime;
|
2010-08-09 13:31:09 +00:00
|
|
|
|
2015-12-06 21:11:41 +00:00
|
|
|
uint rom_speed;
|
2010-08-09 13:31:09 +00:00
|
|
|
|
|
|
|
uint16 rddiv;
|
|
|
|
uint16 rdmpy;
|
|
|
|
|
|
|
|
uint8 joy1l, joy1h;
|
|
|
|
uint8 joy2l, joy2h;
|
|
|
|
uint8 joy3l, joy3h;
|
|
|
|
uint8 joy4l, joy4h;
|
|
|
|
} status;
|
2010-08-09 13:28:56 +00:00
|
|
|
};
|
2010-08-09 13:31:09 +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 CPU cpu;
|