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 {
|
2015-11-10 11:02:29 +00:00
|
|
|
static const uint SerializerVersion = 3;
|
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>
|