bsnes/higan/gba/gba.hpp

63 lines
1.5 KiB
C++
Raw Normal View History

#pragma once
//license: GPLv3
//started: 2012-03-19
#include <emulator/emulator.hpp>
#include <processor/arm/arm.hpp>
namespace GameBoyAdvance {
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;
}
}
#include <libco/libco.h>
namespace GameBoyAdvance {
enum : uint { //mode flags for bus read, write:
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
Signed = 256, //sign extended
};
struct Thread {
~Thread() {
if(thread) co_delete(thread);
}
auto create(auto (*entrypoint)() -> void, uint frequency) -> void {
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);
this->frequency = frequency;
clock = 0;
}
auto serialize(serializer& s) -> void {
s.integer(frequency);
s.integer(clock);
}
cothread_t thread = nullptr;
uint frequency = 0;
int clock = 0;
};
#include <gba/memory/memory.hpp>
#include <gba/scheduler/scheduler.hpp>
#include <gba/system/system.hpp>
#include <gba/cartridge/cartridge.hpp>
#include <gba/player/player.hpp>
#include <gba/cpu/cpu.hpp>
#include <gba/ppu/ppu.hpp>
#include <gba/apu/apu.hpp>
}
#include <gba/interface/interface.hpp>