2016-07-10 05:28:26 +00:00
|
|
|
//TI SN76489
|
|
|
|
|
|
|
|
struct PSG : Thread {
|
2016-08-21 22:11:24 +00:00
|
|
|
shared_pointer<Emulator::Stream> stream;
|
|
|
|
|
2016-07-10 05:28:26 +00:00
|
|
|
static auto Enter() -> void;
|
|
|
|
auto main() -> void;
|
|
|
|
auto step(uint clocks) -> void;
|
|
|
|
|
|
|
|
auto power() -> void;
|
Update to v102r08 release.
byuu says:
Changelog:
- PCE: restructured VCE, VDCs to run one scanline at a time
- PCE: bound VDCs to 1365x262 timing (in order to decouple the VDCs
from the VCE)
- PCE: the two changes above allow save states to function; also
grants a minor speed boost
- PCE: added cheat code support (uses 21-bit bus addressing; compare
byte will be useful here)
- 68K: fixed `mov *,ccr` to read two bytes instead of one [Cydrak]
- Z80: emulated /BUSREQ, /BUSACK; allows 68K to suspend the Z80
[Cydrak]
- MD: emulated the Z80 executing instructions [Cydrak]
- MD: emulated Z80 interrupts (triggered during each Vblank period)
[Cydrak]
- MD: emulated Z80 memory map [Cydrak]
- MD: added stubs for PSG, YM2612 accesses [Cydrak]
- MD: improved bus emulation [Cydrak]
The PCE core is pretty much ready to go. The only major feature missing
is FM modulation.
The Mega Drive improvements let us start to see the splash screens for
Langrisser II, Shining Force, Shining in the Darkness. I was hoping I
could get them in-game, but no such luck. My Z80 implementation is
probably flawed in some way ... now that I think about it, I believe I
missed the BusAPU::reset() check for having been granted access to the
Z80 first. But I doubt that's the problem.
Next step is to implement Cydrak's PSG core into the Master System
emulator. Once that's in, I'm going to add save states and cheat code
support to the Master System core.
Next, I'll add the PSG core into the Mega Drive. Then I'll add the
'easy' PCM part of the YM2612. Then the rest of the beastly YM2612 core.
Then finally, cap things off with save state and cheat code support.
Should be nearing a new release at that point.
2017-02-20 08:13:10 +00:00
|
|
|
|
|
|
|
//io.cpp
|
|
|
|
auto write(uint8 data) -> void;
|
Update to v102r10 release.
byuu says:
Changelog:
- removed Emulator::Interface::Capabilities¹
- MS: improved the PSG emulation a bit
- MS: added cheat code support
- MS: added save state support²
- MD: emulated the PSG³
¹: there's really no point to it anymore. I intend to add cheat codes
to the GBA core, as well as both cheat codes and save states to the Mega
Drive core. I no longer intend to emulate any new systems, so these
values will always be true. Further, the GUI doesn't respond to these
values to disable those features anymore ever since the hiro rewrite, so
they're double useless.
²: right now, the Z80 core is using a pointer for HL-\>(IX,IY)
overrides. But I can't reliably serialize pointers, so I need to convert
the Z80 core to use an integer here. The save states still appear to
work fine, but there's the potential for an instruction to execute
incorrectly if you're incredibly unlucky, so this needs to be fixed as
soon as possible. Further, I still need a way to serialize
array<T, Size> objects, and I should also add nall::Boolean
serialization support.
³: I don't have a system in place to share identical sound chips. But
this chip is so incredibly simple that it's not really much trouble to
duplicate it. Further, I can strip out the stereo sound support code
from the Game Gear portion, so it's even tinier.
Note that the Mega Drive only just barely uses the PSG. Not at all in
Altered Beast, and only for a tiny part of the BGM music on Sonic 1,
plus his jump sound effect.
2017-02-22 21:25:01 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct Tone {
|
|
|
|
//tone.cpp
|
|
|
|
auto run() -> void;
|
|
|
|
auto power() -> void;
|
|
|
|
|
|
|
|
uint4 volume;
|
|
|
|
uint10 counter;
|
|
|
|
uint10 pitch;
|
|
|
|
uint1 clock;
|
|
|
|
uint1 output;
|
|
|
|
} tone0, tone1, tone2;
|
|
|
|
|
|
|
|
struct Noise {
|
|
|
|
//noise.cpp
|
|
|
|
auto run() -> void;
|
|
|
|
auto power() -> void;
|
|
|
|
|
|
|
|
uint4 volume;
|
|
|
|
uint6 counter;
|
|
|
|
uint1 enable;
|
|
|
|
uint2 rate;
|
|
|
|
uint16 lfsr;
|
|
|
|
uint1 clock;
|
|
|
|
uint1 output;
|
|
|
|
} noise;
|
|
|
|
|
|
|
|
uint3 select;
|
|
|
|
int lowpass;
|
|
|
|
uint16 levels[16];
|
2016-07-10 05:28:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern PSG psg;
|