2016-01-11 10:31:30 +00:00
|
|
|
#pragma once
|
2012-03-19 11:19:53 +00:00
|
|
|
|
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-06-18 10:48:53 +00:00
|
|
|
static const string Name = "bgba";
|
2015-11-10 11:02:29 +00:00
|
|
|
static const uint SerializerVersion = 3;
|
2012-03-19 11:19:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
bgba - Game Boy Advance emulator
|
2012-04-03 23:50:40 +00:00
|
|
|
authors: byuu, Cydrak
|
2012-03-19 11:19:53 +00:00
|
|
|
license: GPLv3
|
|
|
|
project started: 2012-03-19
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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);
|
|
|
|
thread = co_create(65536 * sizeof(void*), entrypoint);
|
|
|
|
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>
|