2012-04-29 06:16:44 +00:00
|
|
|
#include <processor/processor.hpp>
|
|
|
|
#include "gsu.hpp"
|
|
|
|
|
2015-06-28 08:44:56 +00:00
|
|
|
//note: multiplication results *may* sometimes be invalid when both CLSR and MS0 are set
|
|
|
|
//the product of multiplication in this mode (21mhz + fast-multiply) has not been analyzed;
|
|
|
|
//however, the timing of this mode has been confirmed to work as specified below
|
|
|
|
|
2012-04-29 06:16:44 +00:00
|
|
|
namespace Processor {
|
|
|
|
|
Update to v102r27 release.
byuu says:
Changelog:
- processor/gsu: minor code cleanup
- processor/hg51b: renamed reg(Read,Write) to register(Read,Write)
- processor/lr35902: minor code cleanup
- processor/spc700: completed code cleanup (sans disassembler)
- no longer uses internal global state inside instructions
- processor/spc700: will no longer hang the emulator if stuck in a WAI
(SLEEP) or STP (STOP) instruction
- processor/spc700: fixed bug in handling of OR1 and AND1 instructions
- processor/z80: minor code cleanup
- sfc/dsp: revert to initializing registers to 0x00; save for
ENDX=random(), FLG=0xe0 [Jonas Quinn]
Major testing of the SNES game library would be appreciated, now that
its CPU cores have all been revised.
We know the DSP registers read back as randomized data ... mostly, but
there are apparently internal latches, which we can't emulate with the
current DSP design. So until we know which registers have separate
internal state that actually *is* initialized, I'm going to play it safe
and not break more games.
Thanks again to Jonas Quinn for the continued research into this issue.
EDIT: that said ... `MD works if((ENDX&0x30) > 0)` is only a 3:4 chance
that the game will work. That seems pretty unlikely that the odds of it
working are that low, given hardware testing by others in the past :/ I
thought if worked if `PITCH != 0` before, which would have been way more
likely.
The two remaining CPU cores that need major cleanup efforts are the
LR35902 and ARM cores. Both are very large, complicated, annoying cores
that will probably be better off as full rewrites from scratch. I don't
think I want to delay v103 in trying to accomplish that, however.
So I think it'll be best to focus on allowing the Mega Drive core to not
lock when processors are frozen waiting on a response from other
processors during a save state operation. Then we should be good for a
new release.
2017-06-19 02:07:54 +00:00
|
|
|
#include "instruction.cpp"
|
2012-04-29 06:16:44 +00:00
|
|
|
#include "instructions.cpp"
|
|
|
|
#include "serialization.cpp"
|
2016-03-26 01:56:15 +00:00
|
|
|
#include "disassembler.cpp"
|
2012-04-29 06:16:44 +00:00
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto GSU::power() -> void {
|
2016-06-05 22:10:01 +00:00
|
|
|
for(auto& r : regs.r) {
|
|
|
|
r.data = 0x0000;
|
|
|
|
r.modified = false;
|
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
regs.sfr = 0x0000;
|
|
|
|
regs.pbr = 0x00;
|
|
|
|
regs.rombr = 0x00;
|
|
|
|
regs.rambr = 0;
|
|
|
|
regs.cbr = 0x0000;
|
|
|
|
regs.scbr = 0x00;
|
|
|
|
regs.scmr = 0x00;
|
|
|
|
regs.colr = 0x00;
|
|
|
|
regs.por = 0x00;
|
|
|
|
regs.bramr = 0;
|
|
|
|
regs.vcr = 0x04;
|
|
|
|
regs.cfgr = 0x00;
|
|
|
|
regs.clsr = 0;
|
2012-04-29 06:16:44 +00:00
|
|
|
regs.pipeline = 0x01; //nop
|
2015-06-27 02:38:47 +00:00
|
|
|
regs.ramaddr = 0x0000;
|
2012-04-29 06:16:44 +00:00
|
|
|
regs.reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|