mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-04-02 10:42:14 -04:00
byuu says: Changelog: - higan: Emulator::Interface::videoSize() renamed to videoResolution() - higan: Emulator::Interface::rtcsync() renamed to rtcSynchronize() - higan: added video display rotation support to Video - GBA: substantially improved audio mixing - fixed bug with FIFO 50%/100% volume setting - now properly using SOUNDBIAS amplitude to control output frequencies - reduced quantization noise - corrected relative volumes between PSG and FIFO channels - both PSG and FIFO values cached based on amplitude; resulting in cleaner PCM samples - treating PSG volume=3 as 200% volume instead of 0% volume now (unverified: to match mGBA) - GBA: properly initialize ALL CPU state; including the vital prefetch.wait=1 (fixes Classic NES series games) - GBA: added video rotation with automatic key translation support - PCE: reduced output resolution scalar from 285x242 to 285x240 - the extra two scanlines won't be visible on most TVs; and they make all other cores look worse - this is because all other cores output at 240p or less; so they were all receiving black bars in windowed mode - tomoko: added "Rotate Display" hotkey setting - tomoko: changed hotkey multi-key logic to OR instead of AND - left support for flipping it back inside the core; for those so inclined; by uncommenting one line in input.hpp - tomoko: when choosing Settings→Configuration, it will automatically select the currently loaded system - for instance, if you're playing a Game Gear game, it'll take you to the Game Gear input settings - if no games are loaded, it will take you to the hotkeys panel instead - WS(C): merged "Hardware-Vertical", "Hardware-Horizontal" controls into combined "Hardware" - WS(C): converted rotation support from being inside the core to using Emulator::Video - this lets WS(C) video content scale larger now that it's not bounded by a 224x224 square box - WS(C): added automatic key rotation support - WS(C): removed emulator "Rotate" key (use the general hotkey instead; I recommend F8 for this) - nall: added serializer support for nall::Boolean (boolean) types - although I will probably prefer the usage of uint1 in most cases
80 lines
1.5 KiB
C++
80 lines
1.5 KiB
C++
#pragma once
|
|
|
|
namespace Emulator {
|
|
|
|
struct Interface;
|
|
struct Video;
|
|
struct Sprite;
|
|
|
|
struct Video {
|
|
enum class Effect : uint {
|
|
ColorBleed,
|
|
InterframeBlending,
|
|
RotateLeft,
|
|
};
|
|
|
|
~Video();
|
|
|
|
auto reset() -> void;
|
|
auto setInterface(Interface* interface) -> void;
|
|
|
|
auto setPalette() -> void;
|
|
auto setSaturation(double saturation) -> void;
|
|
auto setGamma(double gamma) -> void;
|
|
auto setLuminance(double luminance) -> void;
|
|
|
|
auto setEffect(Effect effect, const any& value) -> void;
|
|
|
|
auto createSprite(uint width, uint height) -> shared_pointer<Sprite>;
|
|
auto removeSprite(shared_pointer<Sprite> sprite) -> bool;
|
|
|
|
auto refresh(uint32* input, uint pitch, uint width, uint height) -> void;
|
|
|
|
private:
|
|
Interface* interface = nullptr;
|
|
vector<shared_pointer<Sprite>> sprites;
|
|
|
|
uint32* buffer = nullptr;
|
|
uint32* rotate = nullptr;
|
|
uint32* palette = nullptr;
|
|
|
|
uint width = 0;
|
|
uint height = 0;
|
|
uint colors = 0;
|
|
|
|
double saturation = 1.0;
|
|
double gamma = 1.0;
|
|
double luminance = 1.0;
|
|
|
|
struct Effects {
|
|
bool colorBleed = false;
|
|
bool interframeBlending = false;
|
|
bool rotateLeft = false;
|
|
} effects;
|
|
|
|
friend class Sprite;
|
|
};
|
|
|
|
struct Sprite {
|
|
Sprite(uint width, uint height);
|
|
~Sprite();
|
|
|
|
auto setPixels(const nall::image& image) -> void;
|
|
auto setVisible(bool visible) -> void;
|
|
auto setPosition(int x, int y) -> void;
|
|
|
|
private:
|
|
const uint width;
|
|
const uint height;
|
|
uint32* pixels = nullptr;
|
|
|
|
bool visible = false;
|
|
int x = 0;
|
|
int y = 0;
|
|
|
|
friend class Video;
|
|
};
|
|
|
|
extern Video video;
|
|
|
|
}
|