2016-01-11 10:31:30 +00:00
|
|
|
#pragma once
|
2012-03-19 11:19:53 +00:00
|
|
|
|
2016-04-09 05:20:41 +00:00
|
|
|
//license: GPLv3
|
|
|
|
//started: 2012-03-19
|
|
|
|
|
Update to v088r08 release.
byuu says:
From this WIP, I'm starting on the impossible task of
a declarative-based GUI, which I'm calling Ethos.
base/ becomes emulator/, and we add emulator/interface.hpp, which is
a base API that all emulation cores must implement in full.
(Right now, it's kind of a hybrid to work with the old GUI and the new
GUI at the same time, of course.)
Unlike the old interfaces, the new base class also provides all general
usability hooks: loading and saving files and states, cheat codes, etc.
The new interface also contains information and vector structs to
describe all possible loading methods, controller bindings, etc; and
gives names for them all.
The actual GUI in fact should not include eg <gba/gba.hpp> anymore.
Should speed up GUI compilation.
So the idea going forward is that ethos will build a list of emulators
right when the application starts up.
Once you've appended an emulator to that list, you're done. No more GUI
changes are needed to support that system.
The GUI will have code to parse the emulator interfaces list, and build
all the requisite GUI options dynamically, declarative style.
Ultimately, once the project is finished, the new GUI should look ~99%
identical to the current GUI. But it'll probably be a whole lot smaller.
2012-04-29 06:29:54 +00:00
|
|
|
#include <emulator/emulator.hpp>
|
2012-03-23 10:43:39 +00:00
|
|
|
#include <processor/arm/arm.hpp>
|
2012-03-19 11:19:53 +00:00
|
|
|
|
2012-04-26 10:51:13 +00:00
|
|
|
namespace GameBoyAdvance {
|
2012-03-19 11:19:53 +00:00
|
|
|
namespace Info {
|
Update to v099 release.
byuu says:
Time for a new release. There are a few important emulation improvements
and a few new features; but for the most part, this release focuses on
major code refactoring, the details of which I will mostly spare you.
The major change is that, as of v099, the SNES balanced and performance
cores have been removed from higan. Basically, in addition to my five
other emulation cores, these were too much of a burden to maintain. And
they've come along as far as I was able to develop them. If you need to
use these cores, please use these two from the v098 release.
I'm very well aware that ~80% of the people using higan for SNES
emulation were using the two removed profiles. But they simply had
to go. Hopefully in the future, we can compensate for their loss by
increasing the performance of the accuracy core.
Changelog (since v098):
SFC: balanced profile removed
SFC: performance profile removed
SFC: expansion port devices can now be changed during gameplay (atlhough
you shouldn't)
SFC: fixed bug in SharpRTC leap year calculations
SFC: emulated new research findings for the S-DD1 coprocessor
SFC: fixed CPU emulation-mode wrapping bug with pei, [dp], [dp]+y
instructions [AWJ]
SFC: fixed Super Game Boy bug that caused the bottom tile-row to flicker
in games
GB: added MBC1M (multi-cart) mapper; icarus can't detect these so manual
manifests are needed for now
GB: corrected return value when HuC3 unmapped RAM is read; fixes Robopon
[endrift]
GB: improved STAT IRQ emulation; fixes Altered Space, etc [endrift,
gekkio]
GB: partial emulation of DMG STAT write IRQ bug; fixes Legend of Zerd,
Road Rash, etc
nall: execute() fix, for some Linux platforms that had trouble detecting
icarus
nall: new BitField class; which allows for simplifying flag/register
emulation in various cores
ruby: added Windows WASAPI audio driver (experimental)
ruby: remove attempts to call glSwapIntervalEXT (fixes crashing on some
Linux systems)
ui: timing settings panel removed
video: restored saturation, gamma, luminance settings
video: added new post-emulation sprite system; light gun cursors are
now higher-resolution
audio: new resampler (6th-order Butterworth biquad IIR); quite a bit
faster than the old one
audio: added optional basic reverb filter (for fun)
higan: refresh video outside cooperative threads (workaround for shoddy
code in AMD graphics drivers)
higan: individual emulation cores no longer have unique names
higan: really substantial code refactoring; 43% reduction in binary size
Off the bat, here are the known bugs:
hiro/Windows: focus stealing bug on startup. Needs to be fixed in hiro,
not with a cheap hack to tomoko.
higan/SFC: some of the coprocessors are saving some volatile memory to
disk. Completely harmless, but still needs to be fixed.
ruby/WASAPI: some sound cards have a lot of issues with the current driver
(eg FitzRoy's). We need to find a clean way to fix this before it
can be made the default driver. Which would be a huge win because
the latency improvements are substantial, and in exclusive mode,
WASAPI allows G-sync to work very well.
[From the v099 WIP thread, here's the changelog since v098r19:
- GB: don't force mode 1 during force-blank; fixes v098r16 regression
with many Game Boy games
- GB: only perform the STAT write IRQ bug during vblank, not hblank
(still not hardware accurate, though)
-Ed.]
2016-06-11 01:13:18 +00:00
|
|
|
static const uint SerializerVersion = 4;
|
2012-03-19 11:19:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#include <libco/libco.h>
|
|
|
|
|
2012-04-26 10:51:13 +00:00
|
|
|
namespace GameBoyAdvance {
|
2015-11-10 11:02:29 +00:00
|
|
|
enum : uint { //mode flags for bus read, write:
|
2015-07-01 10:58:42 +00:00
|
|
|
Nonsequential = 1, //N cycle
|
|
|
|
Sequential = 2, //S cycle
|
|
|
|
Prefetch = 4, //instruction fetch (eligible for prefetch)
|
|
|
|
Byte = 8, //8-bit access
|
|
|
|
Half = 16, //16-bit access
|
|
|
|
Word = 32, //32-bit access
|
|
|
|
Load = 64, //load operation
|
|
|
|
Store = 128, //store operation
|
2015-11-10 11:02:29 +00:00
|
|
|
Signed = 256, //sign extended
|
2015-07-01 10:58:42 +00:00
|
|
|
};
|
2012-03-19 11:19:53 +00:00
|
|
|
|
2012-03-23 10:43:39 +00:00
|
|
|
struct Thread {
|
2015-06-18 10:48:53 +00:00
|
|
|
~Thread() {
|
|
|
|
if(thread) co_delete(thread);
|
|
|
|
}
|
2012-03-19 11:19:53 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
auto create(auto (*entrypoint)() -> void, uint frequency) -> void {
|
2012-03-19 11:19:53 +00:00
|
|
|
if(thread) co_delete(thread);
|
Update to v098r06 release.
byuu says:
Changelog:
- emulation cores now refresh video from host thread instead of
cothreads (fix AMD crash)
- SFC: fixed another bug with leap year months in SharpRTC emulation
- SFC: cleaned up camelCase on function names for
armdsp,epsonrtc,hitachidsp,mcc,nss,sharprtc classes
- GB: added MBC1M emulation (requires manually setting mapper=MBC1M in
manifest.bml for now, sorry)
- audio: implemented Emulator::Audio mixer and effects processor
- audio: implemented Emulator::Stream interface
- it is now possible to have more than two audio streams: eg SNES
+ SGB + MSU1 + Voicer-Kun (eventually)
- audio: added reverb delay + reverb level settings; exposed balance
configuration in UI
- video: reworked palette generation to re-enable saturation, gamma,
luminance adjustments
- higan/emulator.cpp is gone since there was nothing left in it
I know you guys are going to say the color adjust/balance/reverb stuff
is pointless. And indeed it mostly is. But I like the idea of allowing
some fun special effects and configurability that isn't system-wide.
Note: there seems to be some kind of added audio lag in the SGB
emulation now, and I don't really understand why. The code should be
effectively identical to what I had before. The only main thing is that
I'm sampling things to 48000hz instead of 32040hz before mixing. There's
no point where I'm intentionally introducing added latency though. I'm
kind of stumped, so if anyone wouldn't mind taking a look at it, it'd be
much appreciated :/
I don't have an MSU1 test ROM, but the latency issue may affect MSU1 as
well, and that would be very bad.
2016-04-22 13:35:51 +00:00
|
|
|
thread = co_create(65'536 * sizeof(void*), entrypoint);
|
2012-03-19 11:19:53 +00:00
|
|
|
this->frequency = frequency;
|
|
|
|
clock = 0;
|
|
|
|
}
|
|
|
|
|
2015-06-18 10:48:53 +00:00
|
|
|
auto serialize(serializer& s) -> void {
|
2012-03-19 11:19:53 +00:00
|
|
|
s.integer(frequency);
|
|
|
|
s.integer(clock);
|
|
|
|
}
|
|
|
|
|
2015-06-18 10:48:53 +00:00
|
|
|
cothread_t thread = nullptr;
|
2015-11-10 11:02:29 +00:00
|
|
|
uint frequency = 0;
|
|
|
|
int clock = 0;
|
2012-03-19 11:19:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#include <gba/memory/memory.hpp>
|
|
|
|
#include <gba/scheduler/scheduler.hpp>
|
|
|
|
#include <gba/system/system.hpp>
|
|
|
|
#include <gba/cartridge/cartridge.hpp>
|
2013-12-20 11:40:39 +00:00
|
|
|
#include <gba/player/player.hpp>
|
2012-03-19 11:19:53 +00:00
|
|
|
#include <gba/cpu/cpu.hpp>
|
|
|
|
#include <gba/ppu/ppu.hpp>
|
|
|
|
#include <gba/apu/apu.hpp>
|
|
|
|
}
|
|
|
|
|
2016-01-11 10:31:30 +00:00
|
|
|
#include <gba/interface/interface.hpp>
|