bsnes/higan/phoenix/core/core.cpp

1378 lines
27 KiB
C++
Raw Normal View History

#if defined(PHOENIX_WINDOWS)
#include "../windows/header.hpp"
#elif defined(PHOENIX_QT)
#include "../qt/header.hpp"
#elif defined(PHOENIX_GTK)
#include "../gtk/header.hpp"
#elif defined(PHOENIX_COCOA)
#include "../cocoa/header.hpp"
#elif defined(PHOENIX_REFERENCE)
#include "../reference/header.hpp"
#endif
#include "core.hpp"
using namespace nall;
namespace phoenix {
#include "state.hpp"
#include "layout/fixed-layout.cpp"
#include "layout/horizontal-layout.cpp"
#include "layout/vertical-layout.cpp"
}
Update to v075r12 release. byuu says: phoenix has been completely rewritten from scratch, and bsnes/ui + bsnes/ui-gameboy have been updated to use the new API. Debugger works too. Currently, only phoenix/Qt is completed, and there are two known issues: 1: font sizes of menu items are wrong, I can fix this easily enough 2: there's some sort of multi-second lag when loading games, not sure what's happening there yet The new phoenix isn't exactly complete yet, still making some key changes, and then I'll start on phoenix/Windows and phoenix/GTK+. The most noticeable difference is that you don't have to give all of the header paths and PHOENIX_PLATFORM defines when compiling individual GUI object files. It's only needed for phoenix.cpp itself. The overall structure of the phoenix source folder is much saner as well for sync.sh. I'm really surprised things are working as well as they are for a two-day power rewrite of an entire phoenix target. The other targets won't be as bad insofar as the core stuff is completed this time. And thank god for that, I was about ready to kill myself after writing dozens of lines like this: HorizontalSlider::HorizontalSlider() : state(*new State), base_from_member<pHorizontalSlider&>(*new pHorizontalSlider(*this)), Widget(base_from_member<pHorizontalSlider&>::value), p(base_from_member<pHorizontalSlider&>::value) {} But each platform does have some new, unique problems. phoenix/GTK+ was acting screwy prior to the rewrite, and will most likely still have issues. Even more important, one of the major points of this rewrite was having the new phoenix/core cache widget settings/data, so that I can destroy and recreate widgets rather than relying on SetParent. This means that simple copying of the old phoenix/Windows won't work, and this new method is significantly more involved.
2011-02-15 12:22:37 +00:00
#if defined(PHOENIX_WINDOWS)
#include "../windows/platform.cpp"
#elif defined(PHOENIX_QT)
#include "../qt/platform.cpp"
#elif defined(PHOENIX_GTK)
#include "../gtk/platform.cpp"
#elif defined(PHOENIX_COCOA)
#include "../cocoa/platform.cpp"
#elif defined(PHOENIX_REFERENCE)
#include "../reference/platform.cpp"
Update to v075r12 release. byuu says: phoenix has been completely rewritten from scratch, and bsnes/ui + bsnes/ui-gameboy have been updated to use the new API. Debugger works too. Currently, only phoenix/Qt is completed, and there are two known issues: 1: font sizes of menu items are wrong, I can fix this easily enough 2: there's some sort of multi-second lag when loading games, not sure what's happening there yet The new phoenix isn't exactly complete yet, still making some key changes, and then I'll start on phoenix/Windows and phoenix/GTK+. The most noticeable difference is that you don't have to give all of the header paths and PHOENIX_PLATFORM defines when compiling individual GUI object files. It's only needed for phoenix.cpp itself. The overall structure of the phoenix source folder is much saner as well for sync.sh. I'm really surprised things are working as well as they are for a two-day power rewrite of an entire phoenix target. The other targets won't be as bad insofar as the core stuff is completed this time. And thank god for that, I was about ready to kill myself after writing dozens of lines like this: HorizontalSlider::HorizontalSlider() : state(*new State), base_from_member<pHorizontalSlider&>(*new pHorizontalSlider(*this)), Widget(base_from_member<pHorizontalSlider&>::value), p(base_from_member<pHorizontalSlider&>::value) {} But each platform does have some new, unique problems. phoenix/GTK+ was acting screwy prior to the rewrite, and will most likely still have issues. Even more important, one of the major points of this rewrite was having the new phoenix/core cache widget settings/data, so that I can destroy and recreate widgets rather than relying on SetParent. This means that simple copying of the old phoenix/Windows won't work, and this new method is significantly more involved.
2011-02-15 12:22:37 +00:00
#endif
namespace phoenix {
//Application
//===========
nall::function<void ()> Application::main;
nall::function<void ()> Application::Cocoa::onAbout;
nall::function<void ()> Application::Cocoa::onPreferences;
nall::function<void ()> Application::Cocoa::onQuit;
void Application::run() {
return pApplication::run();
}
bool Application::pendingEvents() {
return pApplication::pendingEvents();
}
void Application::processEvents() {
return pApplication::processEvents();
}
void Application::quit() {
applicationState.quit = true;
return pApplication::quit();
}
void Application::setName(const string &name) {
applicationState.name = name;
}
void Application::initialize() {
static bool initialized = false;
if(initialized == false) {
initialized = true;
return pApplication::initialize();
}
}
//Color
//=====
uint32_t Color::rgb() const {
return (255 << 24) + (red << 16) + (green << 8) + (blue << 0);
}
uint32_t Color::rgba() const {
return (alpha << 24) + (red << 16) + (green << 8) + (blue << 0);
}
//Geometry
//========
Position Geometry::position() const {
return {x, y};
}
Size Geometry::size() const {
return {width, height};
}
string Geometry::text() const {
return {x, ",", y, ",", width, ",", height};
}
Geometry::Geometry(const string &text) {
lstring part = text.split(",");
x = integer(part(0, "256"));
y = integer(part(1, "256"));
width = decimal(part(2, "256"));
height = decimal(part(3, "256"));
}
//Font
//====
string Font::serif(unsigned size, const string &style) {
return pFont::serif(size, style);
}
string Font::sans(unsigned size, const string &style) {
return pFont::sans(size, style);
}
string Font::monospace(unsigned size, const string &style) {
return pFont::monospace(size, style);
}
Size Font::size(const string &font, const string &text) {
return pFont::size(font, text);
}
//Desktop
//=======
Size Desktop::size() {
return pDesktop::size();
}
Geometry Desktop::workspace() {
return pDesktop::workspace();
}
//Keyboard
//========
bool Keyboard::pressed(Keyboard::Scancode scancode) {
return pKeyboard::pressed(scancode);
}
bool Keyboard::released(Keyboard::Scancode scancode) {
return !pressed(scancode);
}
vector<bool> Keyboard::state() {
return pKeyboard::state();
}
//Mouse
//=====
Position Mouse::position() {
return pMouse::position();
}
bool Mouse::pressed(Mouse::Button button) {
return pMouse::pressed(button);
}
bool Mouse::released(Mouse::Button button) {
return !pressed(button);
}
//DialogWindow
//============
string DialogWindow::fileOpen_(Window &parent, const string &path, const lstring &filter_) {
auto filter = filter_;
if(filter.size() == 0) filter.append("All files (*)");
return pDialogWindow::fileOpen(parent, path, filter);
}
string DialogWindow::fileSave_(Window &parent, const string &path, const lstring &filter_) {
auto filter = filter_;
if(filter.size() == 0) filter.append("All files (*)");
return pDialogWindow::fileSave(parent, path, filter);
}
string DialogWindow::folderSelect(Window &parent, const string &path) {
return pDialogWindow::folderSelect(parent, path);
}
//MessageWindow
//=============
MessageWindow::Response MessageWindow::information(Window &parent, const string &text, MessageWindow::Buttons buttons) {
return pMessageWindow::information(parent, text, buttons);
}
MessageWindow::Response MessageWindow::question(Window &parent, const string &text, MessageWindow::Buttons buttons) {
return pMessageWindow::question(parent, text, buttons);
}
MessageWindow::Response MessageWindow::warning(Window &parent, const string &text, MessageWindow::Buttons buttons) {
return pMessageWindow::warning(parent, text, buttons);
}
MessageWindow::Response MessageWindow::critical(Window &parent, const string &text, MessageWindow::Buttons buttons) {
return pMessageWindow::critical(parent, text, buttons);
}
//Object
//======
Object::Object(pObject &p):
p(p) {
Application::initialize();
p.constructor();
}
Object::~Object() {
p.destructor();
delete &p;
}
//Timer
//=====
void Timer::setEnabled(bool enabled) {
state.enabled = enabled;
return p.setEnabled(enabled);
}
void Timer::setInterval(unsigned milliseconds) {
state.milliseconds = milliseconds;
return p.setInterval(milliseconds);
}
Timer::Timer():
state(*new State),
base_from_member<pTimer&>(*new pTimer(*this)),
Object(base_from_member<pTimer&>::value),
p(base_from_member<pTimer&>::value) {
p.constructor();
}
Timer::~Timer() {
p.destructor();
delete &state;
}
//Window
//======
Window& Window::none() {
return pWindow::none();
}
void Window::append_(Layout &layout) {
if(state.layout.append(layout)) {
((Sizable&)layout).state.window = this;
((Sizable&)layout).state.layout = nullptr;
p.append(layout);
layout.synchronizeLayout();
}
}
void Window::append_(Menu &menu) {
if(state.menu.append(menu)) {
((Action&)menu).state.window = this;
p.append(menu);
}
}
void Window::append_(Widget &widget) {
if(state.widget.append(widget)) {
((Sizable&)widget).state.window = this;
p.append(widget);
}
}
Color Window::backgroundColor() {
return p.backgroundColor();
}
Geometry Window::frameGeometry() {
Geometry geometry = p.geometry();
Geometry margin = p.frameMargin();
return {
geometry.x - margin.x, geometry.y - margin.y,
geometry.width + margin.width, geometry.height + margin.height
};
}
Geometry Window::frameMargin() {
return p.frameMargin();
}
bool Window::focused() {
return p.focused();
}
Update to v082r16 release. byuu says: Binary output is once again called bsnes. No versioning on the title without a system cartridge loaded. Still saving config files to .config/batch for now. Finally fixed NES APU frame IRQ clearing on $4015 reads. Added mouse button/axis binding through buttons on the input capture window. Added advanced settings window with driver selection and focus policy settings. Will show your default driver properly if none are selected now, unlike old bsnes. That exposed a small bug where phoenix isn't removing widgets on Layout::remove, worked around it for now by hiding the panels. Damn, sick of working on phoenix. Added all missing input controllers, which can all now be mapped, and bound them to the main menu, and added NES support for selecting "no connected controller." Added mouse capture and the requisite tools menu option for it. Added WindowManager class that keeps track of both position and size now (eg full geometry), so now you can resize your windows and save the settings, unlike old bsnes. WindowManager has more stringent geometry checks. The *client area* (not the window border) can't be below 0,0 or above the width/height of three 30" monitors. If you have 4+ 30" monitors, then fuck you :P settings.cfg is now also saved, captures all currently available settings. Right now, there's only one path for the file browser to remember. I will probably make this per-system later. FileBrowser has been made a bit more friendly. The bottom left tells you what type of files the list is filtered by (so you see "*.sfc" for SNES), and the bottom right has an open button that can enter folders or load files. Added video shader support. Fixed nall/dsp variadic-channel support, was only outputting the left channel.
2011-09-19 12:25:56 +00:00
bool Window::fullScreen() {
return state.fullScreen;
}
Geometry Window::geometry() {
return p.geometry();
}
void Window::remove_(Layout &layout) {
if(state.layout.remove(layout)) {
p.remove(layout);
((Sizable&)layout).state.window = nullptr;
}
}
void Window::remove_(Menu &menu) {
if(state.menu.remove(menu)) {
p.remove(menu);
((Action&)menu).state.window = nullptr;
}
}
void Window::remove_(Widget &widget) {
if(state.widget.remove(widget)) {
p.remove(widget);
((Sizable&)widget).state.window = nullptr;
}
}
void Window::setBackgroundColor(const Color &color) {
state.backgroundColorOverride = true;
state.backgroundColor = color;
return p.setBackgroundColor(color);
}
void Window::setFrameGeometry(const Geometry &geometry) {
Geometry margin = p.frameMargin();
return setGeometry({
geometry.x + margin.x, geometry.y + margin.y,
geometry.width - margin.width, geometry.height - margin.height
});
}
void Window::setFocused() {
return p.setFocused();
}
void Window::setFullScreen(bool fullScreen) {
state.fullScreen = fullScreen;
return p.setFullScreen(fullScreen);
}
void Window::setGeometry(const Geometry &geometry) {
state.geometry = geometry;
return p.setGeometry(geometry);
}
void Window::setMenuFont(const string &font) {
state.menuFont = font;
return p.setMenuFont(font);
}
void Window::setMenuVisible(bool visible) {
state.menuVisible = visible;
return p.setMenuVisible(visible);
}
Update to v088r11 release. byuu says: Changelog: - phoenix has added Window::setModal(bool modal = true); - file dialog is now modal. This allows emulation cores to request data and get it immediately before continuing the loading process - save data is hooked up for most systems, still need to handle subsystem slot saves (Sufami Turbo, basically.) - toggle fullscreen key binding added (Alt+Enter for now. I think F11 is probably better though, Enter is often mapped to game start button.) - video scaling is in (center, scale, stretch), works the same in windowed and fullscreen mode (stretch hides resize window option), all in the settings menu now - enough structure to map all saved paths for the browser and to load BS-X slotted carts, BS-X carts, single Sufami Turbo carts Caveats / Missing: - Super Game Boy input doesn't work yet (due to change in callback binding) - doesn't load secondary Sufami Turbo slot yet - BS-X BIOS isn't show the data pack games to load for some reason (ugh, I hate the shit out of debugging BS-X stuff ...) - need mute audio, sync audio+video toggle, save/load state menu and quick keys, XML mapping information window - need cheat editor and cheat database - need state manager - need to sort subsystems below main systems in load menu (basically just see if media.slot.size() > 0) - need video shaders (will probably leave off filters for the time being ... due to that 24/30-bit thing) - need video adjustments (contrast etc, overscan masks) - need audio adjustments (frequency, latency, resampler, volume, per-system frequency) - need driver selection and input focus policy (driver crash detection would be nice too) - need NSS DIP switch settings (that one will be really fun) - need to save and load window geometry settings - need to hook up controller selection (won't be fun), create a map to hide controllers with no inputs to reassign
2012-05-03 12:36:47 +00:00
void Window::setModal(bool modal) {
state.modal = modal;
return p.setModal(modal);
}
void Window::setResizable(bool resizable) {
state.resizable = resizable;
return p.setResizable(resizable);
}
Update to v091r05 release. [No prior releases were posted to the WIP thread. -Ed.] byuu says: Super Famicom mapping system has been reworked as discussed with the mask= changes. offset becomes base, mode is gone. Also added support for comma-separated fields in the address fields, to reduce the number of map lines needed. <?xml version="1.0" encoding="UTF-8"?> <cartridge region="NTSC"> <superfx revision="2"> <rom name="program.rom" size="0x200000"/> <ram name="save.rwm" size="0x8000"/> <map id="io" address="00-3f,80-bf:3000-32ff"/> <map id="rom" address="00-3f:8000-ffff" mask="0x8000"/> <map id="rom" address="40-5f:0000-ffff"/> <map id="ram" address="00-3f,80-bf:6000-7fff" size="0x2000"/> <map id="ram" address="70-71:0000-ffff"/> </superfx> </cartridge> Or in BML: cartridge region=NTSC superfx revision=2 rom name=program.rom size=0x200000 ram name=save.rwm size=0x8000 map id=io address=00-3f,80-bf:3000-32ff map id=rom address=00-3f:8000-ffff mask=0x8000 map id=rom address=40-5f:0000-ffff map id=ram address=00-3f,80-bf:6000-7fff size=0x2000 map id=ram address=70-71:0000-ffff As a result of the changes, old mappings will no longer work. The above XML example will run Super Mario World 2: Yoshi's Island. Otherwise, you'll have to write your own. All that's left now is to work some sort of database mapping system in, so I can start dumping carts en masse. The NES changes that FitzRoy asked for are mostly in as well. Also, part of the reason I haven't released a WIP ... but fuck it, I'm not going to wait forever to post a new WIP. I've added a skeleton driver to emulate Campus Challenge '92 and Powerfest '94. There's no actual emulation, except for the stuff I can glean from looking at the pictures of the board. It has a DSP-1 (so SR/DR registers), four ROMs that map in and out, RAM, etc. I've also added preliminary mapping to upload high scores to a website, but obviously I need the ROMs first.
2012-10-09 08:25:32 +00:00
void Window::setSmartGeometry(const Geometry &geometry) {
Geometry margin = p.frameMargin();
return setGeometry({
geometry.x + margin.x, geometry.y + margin.y,
geometry.width, geometry.height
});
}
void Window::setStatusFont(const string &font) {
state.statusFont = font;
return p.setStatusFont(font);
}
void Window::setStatusText(const string &text) {
state.statusText = text;
return p.setStatusText(text);
}
void Window::setStatusVisible(bool visible) {
state.statusVisible = visible;
return p.setStatusVisible(visible);
}
void Window::setTitle(const string &text) {
state.title = text;
return p.setTitle(text);
}
void Window::setVisible(bool visible) {
state.visible = visible;
synchronizeLayout();
return p.setVisible(visible);
}
void Window::setWidgetFont(const string &font) {
state.widgetFont = font;
return p.setWidgetFont(font);
}
string Window::statusText() {
return state.statusText;
}
void Window::synchronizeLayout() {
if(visible() && applicationState.quit == false) setGeometry(geometry());
}
bool Window::visible() {
return state.visible;
}
Window::Window():
state(*new State),
base_from_member<pWindow&>(*new pWindow(*this)),
Object(base_from_member<pWindow&>::value),
p(base_from_member<pWindow&>::value) {
p.constructor();
}
Window::~Window() {
p.destructor();
delete &state;
}
//Action
//======
bool Action::enabled() {
return state.enabled;
}
void Action::setEnabled(bool enabled) {
state.enabled = enabled;
return p.setEnabled(enabled);
}
void Action::setVisible(bool visible) {
state.visible = visible;
return p.setVisible(visible);
}
bool Action::visible() {
return state.visible;
}
Action::Action(pAction &p):
state(*new State),
Object(p),
p(p) {
p.constructor();
}
Action::~Action() {
p.destructor();
delete &state;
}
//Menu
//====
void Menu::append(const set<Action&> &list) {
for(auto &action : list) {
if(state.action.append(action)) {
action.state.menu = this;
p.append(action);
}
}
}
void Menu::remove(const set<Action&> &list) {
for(auto &action : list) {
if(state.action.remove(action)) {
action.state.menu = nullptr;
return p.remove(action);
}
}
}
void Menu::setImage(const image &image) {
state.image = image;
return p.setImage(image);
}
void Menu::setText(const string &text) {
state.text = text;
return p.setText(text);
}
Menu::Menu():
state(*new State),
base_from_member<pMenu&>(*new pMenu(*this)),
Action(base_from_member<pMenu&>::value),
p(base_from_member<pMenu&>::value) {
p.constructor();
}
Menu::~Menu() {
p.destructor();
delete &state;
}
//Separator
//=========
Separator::Separator():
base_from_member<pSeparator&>(*new pSeparator(*this)),
Action(base_from_member<pSeparator&>::value),
p(base_from_member<pSeparator&>::value) {
p.constructor();
}
Separator::~Separator() {
p.destructor();
}
//Item
//====
void Item::setImage(const image &image) {
state.image = image;
return p.setImage(image);
}
void Item::setText(const string &text) {
state.text = text;
return p.setText(text);
}
Item::Item():
state(*new State),
base_from_member<pItem&>(*new pItem(*this)),
Action(base_from_member<pItem&>::value),
p(base_from_member<pItem&>::value) {
p.constructor();
}
Item::~Item() {
p.destructor();
delete &state;
}
//CheckItem
//=========
bool CheckItem::checked() {
return p.checked();
}
void CheckItem::setChecked(bool checked) {
state.checked = checked;
return p.setChecked(checked);
}
void CheckItem::setText(const string &text) {
state.text = text;
return p.setText(text);
}
CheckItem::CheckItem():
state(*new State),
base_from_member<pCheckItem&>(*new pCheckItem(*this)),
Action(base_from_member<pCheckItem&>::value),
p(base_from_member<pCheckItem&>::value) {
p.constructor();
}
CheckItem::~CheckItem() {
p.destructor();
delete &state;
}
//RadioItem
//=========
void RadioItem::group(const set<RadioItem&> &list) {
for(auto &item : list) item.p.setGroup(item.state.group = list);
if(list.size()) list[0].setChecked();
}
bool RadioItem::checked() {
return p.checked();
}
void RadioItem::setChecked() {
for(auto &item : state.group) item.state.checked = false;
state.checked = true;
return p.setChecked();
}
void RadioItem::setText(const string &text) {
state.text = text;
return p.setText(text);
}
Update to v088r14 release. byuu says: Changelog: - added NSS DIP switch settings window (when loading NSS carts with appropriate manifest.xml file) - added video shader selection (they go in ~/.config/bsnes/Video Shaders/ now) - added driver selection - added timing settings (not only allows video/audio settings, also has code to dynamically compute the values for you ... and it actually works pretty good!) - moved "None" controller device to bottom of list (it is the least likely to be used, after all) - added Interface::path() to support MSU1, USART, Link - input and hotkey mappings remember list position after assignment - and more! target-ethos now has all of the functionality of target-ui, and more. Final code size for the port is 101.2KB (ethos) vs 167.6KB (ui). A ~67% reduction in code size, yet it does even more! And you can add or remove an entire system with only three lines of code (Makefile include, header include, interface append.) The only problem left is that the BS-X BIOS won't load the BS Zelda no Densetsu file. I can't figure out why it's not working, would appreciate any assistance, but otherwise I'm probably just going to leave it broken for v089, sorry. So the show stoppers for a new release at this point are: - fix laevateinn to compile with the new interface changes (shouldn't be too hard, it'll still use the old, direct interface.) - clean up Emulator::Interface as much as possible (trim down Information, mediaRequest should use an alternate struct designed to load firmware / slots separately) - enhance purify to strip SNES ROM headers, and it really needs a GUI interface - it would be highly desirable to make a launcher that can create a cartridge folder from an existing ROM set (* ethos will need to accept command-line arguments for this.) - probably need to remember which controller was selected in each port for each system across runs - need to fix the cursor for Super Scope / Justifier games (move from 19-bit to 32-bit colors broke it) - have to refactor that cache.(hv)offset thing to fix ASP
2012-05-06 23:27:42 +00:00
string RadioItem::text() {
return state.text;
}
RadioItem::RadioItem():
state(*new State),
base_from_member<pRadioItem&>(*new pRadioItem(*this)),
Action(base_from_member<pRadioItem&>::value),
p(base_from_member<pRadioItem&>::value) {
p.constructor();
}
RadioItem::~RadioItem() {
for(auto &item : state.group) {
if(&item != this) item.state.group.remove(*this);
}
p.destructor();
delete &state;
}
//Sizable
//=======
Layout* Sizable::layout() {
return state.layout;
}
Window* Sizable::window() {
if(state.layout) return state.layout->window();
return state.window;
}
Sizable::Sizable(pSizable &p):
state(*new State),
Object(p),
p(p) {
p.constructor();
}
Sizable::~Sizable() {
if(layout()) layout()->remove(*this);
p.destructor();
delete &state;
}
//Layout
//======
void Layout::append(Sizable &sizable) {
sizable.state.layout = this;
sizable.state.window = nullptr;
if(dynamic_cast<Layout*>(&sizable)) {
Layout &layout = (Layout&)sizable;
layout.synchronizeLayout();
}
if(dynamic_cast<Widget*>(&sizable)) {
Widget &widget = (Widget&)sizable;
if(sizable.window()) sizable.window()->append(widget);
}
}
void Layout::remove(Sizable &sizable) {
if(dynamic_cast<Widget*>(&sizable)) {
Widget &widget = (Widget&)sizable;
if(sizable.window()) sizable.window()->remove(widget);
}
sizable.state.layout = nullptr;
sizable.state.window = nullptr;
}
Layout::Layout():
state(*new State),
base_from_member<pLayout&>(*new pLayout(*this)),
Sizable(base_from_member<pLayout&>::value),
p(base_from_member<pLayout&>::value) {
}
Layout::Layout(pLayout &p):
state(*new State),
base_from_member<pLayout&>(p),
Sizable(p),
p(p) {
}
Layout::~Layout() {
if(layout()) layout()->remove(*this);
else if(window()) window()->remove(*this);
p.destructor();
delete &state;
}
//Widget
//======
bool Widget::enabled() {
return state.enabled;
}
Update to higan v091r14 and ananke v00r03 releases. byuu says: higan changelog: - generates title displayed in emulator window by asking the core - core builds title solely from "information/title" ... if it's not there, you don't get a title at all - sub-system load menu is gone ... since there are multiple revisions of the SGB, this never really worked well anyway - to load an SGB, BS-X or ST cartridge, load the base cartridge first - "File->Load Game" moved to "Load->Import Game" ... may cause a bit of confusion to new users, but I don't like having a single-item menu, we'll just have to explain it to new users - browser window redone to look like ananke - home button here goes to ~/Emulation rather than just ~ like ananke, since this is the home of game folders - game folder icon is now the executable icon for the Tango theme (orange diamond), meant to represent a complete game rather than a game file or archive ananke changelog: - outputs GBC games to "Game Boy Color/" instead of "Game Boy/" - adds the file basename to "information/title" Known issues: - using ananke to load a GB game trips the Super Famicom SGB mode and fails (need to make the full-path auto-detection ignore non-bootable systems) - need to dump and test some BS-X media before releasing - ananke lacks BS-X Satellaview cartridge support - v092 isn't going to let you retarget the ananke/higan game folder path of ~/Emulation, you will have to wait for a future version if that bothers you so greatly [Later, after the v092 release, byuu posted this additional changelog: - kill laevateinn - add title() - add bootable, remove load - combine file, library - combine [][][] paths - fix SFC subtype handling XML->BML - update file browser to use buttons - update file browser keyboard handling - update system XML->BML - fix sufami turbo hashing - remove Cartridge::manifest ]
2012-12-25 05:31:55 +00:00
bool Widget::focused() {
return p.focused();
}
string Widget::font() {
return state.font;
}
Geometry Widget::geometry() {
return state.geometry;
}
Size Widget::minimumSize() {
return p.minimumSize();
}
void Widget::setEnabled(bool enabled) {
state.enabled = enabled;
return p.setEnabled(enabled);
}
void Widget::setFocused() {
return p.setFocused();
}
void Widget::setFont(const string &font) {
state.font = font;
return p.setFont(font);
}
void Widget::setGeometry(const Geometry &geometry) {
state.geometry = geometry;
return p.setGeometry(geometry);
}
void Widget::setVisible(bool visible) {
state.visible = visible;
return p.setVisible(visible);
}
bool Widget::visible() {
return state.visible;
}
Widget::Widget():
state(*new State),
base_from_member<pWidget&>(*new pWidget(*this)),
Sizable(base_from_member<pWidget&>::value),
p(base_from_member<pWidget&>::value) {
state.abstract = true;
p.constructor();
}
Widget::Widget(pWidget &p):
state(*new State),
base_from_member<pWidget&>(p),
Sizable(base_from_member<pWidget&>::value),
p(base_from_member<pWidget&>::value) {
p.constructor();
}
Widget::~Widget() {
p.destructor();
delete &state;
}
//Button
//======
void Button::setImage(const image &image, Orientation orientation) {
state.image = image;
state.orientation = orientation;
return p.setImage(image, orientation);
}
void Button::setText(const string &text) {
state.text = text;
return p.setText(text);
}
Button::Button():
state(*new State),
base_from_member<pButton&>(*new pButton(*this)),
Widget(base_from_member<pButton&>::value),
p(base_from_member<pButton&>::value) {
p.constructor();
}
Button::~Button() {
p.destructor();
delete &state;
}
//Canvas
//======
uint32_t* Canvas::data() {
return state.data;
}
bool Canvas::setImage(const nall::image &image) {
if(image.data == nullptr || image.width == 0 || image.height == 0) return false;
state.width = image.width;
state.height = image.height;
setSize({ state.width, state.height });
memcpy(state.data, image.data, state.width * state.height * sizeof(uint32_t));
return true;
}
void Canvas::setSize(const Size &size) {
state.width = size.width;
state.height = size.height;
delete[] state.data;
state.data = new uint32_t[size.width * size.height];
return p.setSize(size);
}
Size Canvas::size() {
return { state.width, state.height };
}
void Canvas::update() {
return p.update();
}
Canvas::Canvas():
state(*new State),
base_from_member<pCanvas&>(*new pCanvas(*this)),
Widget(base_from_member<pCanvas&>::value),
p(base_from_member<pCanvas&>::value) {
state.data = new uint32_t[state.width * state.height];
p.constructor();
}
Canvas::~Canvas() {
p.destructor();
delete[] state.data;
delete &state;
}
//CheckButton
//===========
bool CheckButton::checked() {
return p.checked();
}
void CheckButton::setChecked(bool checked) {
state.checked = checked;
return p.setChecked(checked);
}
void CheckButton::setText(const string &text) {
state.text = text;
return p.setText(text);
}
CheckButton::CheckButton():
state(*new State),
base_from_member<pCheckButton&>(*new pCheckButton(*this)),
Widget(base_from_member<pCheckButton&>::value),
p(base_from_member<pCheckButton&>::value) {
p.constructor();
}
CheckButton::~CheckButton() {
p.destructor();
delete &state;
}
//ComboButton
//===========
void ComboButton::append_(const lstring &list) {
for(auto &text : list) {
state.text.append(text);
p.append(text);
}
}
void ComboButton::modify(unsigned row, const string &text) {
state.text(row) = text;
p.modify(row, text);
}
void ComboButton::remove(unsigned row) {
state.text.remove(row);
p.remove(row);
}
void ComboButton::reset() {
state.selection = 0;
state.text.reset();
return p.reset();
}
unsigned ComboButton::selection() {
return p.selection();
}
void ComboButton::setSelection(unsigned row) {
state.selection = row;
return p.setSelection(row);
}
string ComboButton::text() {
Update to v088r14 release. byuu says: Changelog: - added NSS DIP switch settings window (when loading NSS carts with appropriate manifest.xml file) - added video shader selection (they go in ~/.config/bsnes/Video Shaders/ now) - added driver selection - added timing settings (not only allows video/audio settings, also has code to dynamically compute the values for you ... and it actually works pretty good!) - moved "None" controller device to bottom of list (it is the least likely to be used, after all) - added Interface::path() to support MSU1, USART, Link - input and hotkey mappings remember list position after assignment - and more! target-ethos now has all of the functionality of target-ui, and more. Final code size for the port is 101.2KB (ethos) vs 167.6KB (ui). A ~67% reduction in code size, yet it does even more! And you can add or remove an entire system with only three lines of code (Makefile include, header include, interface append.) The only problem left is that the BS-X BIOS won't load the BS Zelda no Densetsu file. I can't figure out why it's not working, would appreciate any assistance, but otherwise I'm probably just going to leave it broken for v089, sorry. So the show stoppers for a new release at this point are: - fix laevateinn to compile with the new interface changes (shouldn't be too hard, it'll still use the old, direct interface.) - clean up Emulator::Interface as much as possible (trim down Information, mediaRequest should use an alternate struct designed to load firmware / slots separately) - enhance purify to strip SNES ROM headers, and it really needs a GUI interface - it would be highly desirable to make a launcher that can create a cartridge folder from an existing ROM set (* ethos will need to accept command-line arguments for this.) - probably need to remember which controller was selected in each port for each system across runs - need to fix the cursor for Super Scope / Justifier games (move from 19-bit to 32-bit colors broke it) - have to refactor that cache.(hv)offset thing to fix ASP
2012-05-06 23:27:42 +00:00
return state.text(selection());
}
string ComboButton::text(unsigned row) {
Update to v088r14 release. byuu says: Changelog: - added NSS DIP switch settings window (when loading NSS carts with appropriate manifest.xml file) - added video shader selection (they go in ~/.config/bsnes/Video Shaders/ now) - added driver selection - added timing settings (not only allows video/audio settings, also has code to dynamically compute the values for you ... and it actually works pretty good!) - moved "None" controller device to bottom of list (it is the least likely to be used, after all) - added Interface::path() to support MSU1, USART, Link - input and hotkey mappings remember list position after assignment - and more! target-ethos now has all of the functionality of target-ui, and more. Final code size for the port is 101.2KB (ethos) vs 167.6KB (ui). A ~67% reduction in code size, yet it does even more! And you can add or remove an entire system with only three lines of code (Makefile include, header include, interface append.) The only problem left is that the BS-X BIOS won't load the BS Zelda no Densetsu file. I can't figure out why it's not working, would appreciate any assistance, but otherwise I'm probably just going to leave it broken for v089, sorry. So the show stoppers for a new release at this point are: - fix laevateinn to compile with the new interface changes (shouldn't be too hard, it'll still use the old, direct interface.) - clean up Emulator::Interface as much as possible (trim down Information, mediaRequest should use an alternate struct designed to load firmware / slots separately) - enhance purify to strip SNES ROM headers, and it really needs a GUI interface - it would be highly desirable to make a launcher that can create a cartridge folder from an existing ROM set (* ethos will need to accept command-line arguments for this.) - probably need to remember which controller was selected in each port for each system across runs - need to fix the cursor for Super Scope / Justifier games (move from 19-bit to 32-bit colors broke it) - have to refactor that cache.(hv)offset thing to fix ASP
2012-05-06 23:27:42 +00:00
return state.text(row);
}
ComboButton::ComboButton():
state(*new State),
base_from_member<pComboButton&>(*new pComboButton(*this)),
Widget(base_from_member<pComboButton&>::value),
p(base_from_member<pComboButton&>::value) {
p.constructor();
}
ComboButton::~ComboButton() {
p.destructor();
delete &state;
}
//HexEdit
//=======
void HexEdit::setColumns(unsigned columns) {
state.columns = columns;
return p.setColumns(columns);
}
void HexEdit::setLength(unsigned length) {
state.length = length;
return p.setLength(length);
}
void HexEdit::setOffset(unsigned offset) {
state.offset = offset;
return p.setOffset(offset);
}
void HexEdit::setRows(unsigned rows) {
state.rows = rows;
return p.setRows(rows);
}
void HexEdit::update() {
return p.update();
}
HexEdit::HexEdit():
state(*new State),
base_from_member<pHexEdit&>(*new pHexEdit(*this)),
Widget(base_from_member<pHexEdit&>::value),
p(base_from_member<pHexEdit&>::value) {
p.constructor();
}
HexEdit::~HexEdit() {
p.destructor();
delete &state;
}
//HorizontalScroller
//==================
unsigned HorizontalScroller::length() {
Update to v082r18 release. byuu says: There we go, the GUI is nearly feature-complete once again. All cores now output their native video format (NES={emphasis}{palette}, SNES=BGR555, GameBoy={ bright, normal, darker, darkest }), and are transformed to RGB555 data that is passed to the video renderer. The video renderer then uses its internal palette to apply brightness/contrast/gamma/ramp adjustments and outputs in RGB888 color space. This does add in another rendering pass, unfortunately, but it's a necessary one for universal support. The plan is to adapt all filters to take RGB555 input, and output RGB555 data as well. By doing this, it will be possible to stack filters. However, it's a bit complicated: I need to plan how the stacking should occur (eg we never want to apply scanlines before HQ2x, etc.) Added input frequency adjustments for all three systems. I can easily get perfect video/audio sync on all three now, hooray. Long-term, it seems like we only really need one, and we can do a video/audio delta to get an adjusted value. But for now, this gets the job done. Added audio volume adjust. I left out the balance for now, since it's obviously impossible to balance the NES' single channel audio (I can duplicate the channel, and do twice the filtering work, but ... why?) I replaced NTSC/PAL TV mode selection with an "Enable Overscan" checkbox. On, you get 240 lines on NES+SNES. Off, you get 224 lines on NES+SNES. Also added aspect correction box back. I don't do that gross PAL distortion shit anymore, sorry PAL people. I just scale up the 54/47*(240/224) aspect correction for overscan off mode. All memory is loaded and saved now, for all three systems (hooray, now you can actually play Zelda 1&2.) Added all of the old bsnes hotkeys, with the exception of capture screenshot. May add again later. May come up with something a bit different for extra features. Re-added the NSS DIP switch setting window. Since geometry is saved, I didn't want to auto-hide rows, so now you'll see all eight possible DIPs, and the ones not used are grayed out. Ultimately, nobody will notice since we only have DIPs for ActRaiser NSS, and nobody's probably even using the XML file for that anyway. Whatever, it's nice to have anyway. Took FitzRoy's advice and single-item combo boxes on the input selection are disabled, so the user doesn't waste time checking them. I wanted to leave text so that you know there's not a problem. Qt disabled radio box items look almost exactly like enabled ones. Fixed lots of issues in phoenix and extended it a bit. But I was still having trouble with radio box grouping, so I said fuck it and made the panels show/hide based instead of append/remove based. That's all for stuff off the checklist, I did a bunch of other things I don't recall. So yeah, I'd say the GUI is 100% usable now. This is my opinion on how multi-platform GUIs should be done =) Oh, I figure I should mention, but the NES core is GPLv3, and all future SNES+GB releases will be as well. It's a move against Microsoft's Metro store.
2011-09-20 14:04:43 +00:00
return state.length;
}
unsigned HorizontalScroller::position() {
return p.position();
}
void HorizontalScroller::setLength(unsigned length) {
state.length = length;
return p.setLength(length);
}
void HorizontalScroller::setPosition(unsigned position) {
state.position = position;
return p.setPosition(position);
}
HorizontalScroller::HorizontalScroller():
state(*new State),
base_from_member<pHorizontalScroller&>(*new pHorizontalScroller(*this)),
Widget(base_from_member<pHorizontalScroller&>::value),
p(base_from_member<pHorizontalScroller&>::value) {
p.constructor();
}
HorizontalScroller::~HorizontalScroller() {
p.destructor();
delete &state;
}
//HorizontalSlider
//================
Update to v082r18 release. byuu says: There we go, the GUI is nearly feature-complete once again. All cores now output their native video format (NES={emphasis}{palette}, SNES=BGR555, GameBoy={ bright, normal, darker, darkest }), and are transformed to RGB555 data that is passed to the video renderer. The video renderer then uses its internal palette to apply brightness/contrast/gamma/ramp adjustments and outputs in RGB888 color space. This does add in another rendering pass, unfortunately, but it's a necessary one for universal support. The plan is to adapt all filters to take RGB555 input, and output RGB555 data as well. By doing this, it will be possible to stack filters. However, it's a bit complicated: I need to plan how the stacking should occur (eg we never want to apply scanlines before HQ2x, etc.) Added input frequency adjustments for all three systems. I can easily get perfect video/audio sync on all three now, hooray. Long-term, it seems like we only really need one, and we can do a video/audio delta to get an adjusted value. But for now, this gets the job done. Added audio volume adjust. I left out the balance for now, since it's obviously impossible to balance the NES' single channel audio (I can duplicate the channel, and do twice the filtering work, but ... why?) I replaced NTSC/PAL TV mode selection with an "Enable Overscan" checkbox. On, you get 240 lines on NES+SNES. Off, you get 224 lines on NES+SNES. Also added aspect correction box back. I don't do that gross PAL distortion shit anymore, sorry PAL people. I just scale up the 54/47*(240/224) aspect correction for overscan off mode. All memory is loaded and saved now, for all three systems (hooray, now you can actually play Zelda 1&2.) Added all of the old bsnes hotkeys, with the exception of capture screenshot. May add again later. May come up with something a bit different for extra features. Re-added the NSS DIP switch setting window. Since geometry is saved, I didn't want to auto-hide rows, so now you'll see all eight possible DIPs, and the ones not used are grayed out. Ultimately, nobody will notice since we only have DIPs for ActRaiser NSS, and nobody's probably even using the XML file for that anyway. Whatever, it's nice to have anyway. Took FitzRoy's advice and single-item combo boxes on the input selection are disabled, so the user doesn't waste time checking them. I wanted to leave text so that you know there's not a problem. Qt disabled radio box items look almost exactly like enabled ones. Fixed lots of issues in phoenix and extended it a bit. But I was still having trouble with radio box grouping, so I said fuck it and made the panels show/hide based instead of append/remove based. That's all for stuff off the checklist, I did a bunch of other things I don't recall. So yeah, I'd say the GUI is 100% usable now. This is my opinion on how multi-platform GUIs should be done =) Oh, I figure I should mention, but the NES core is GPLv3, and all future SNES+GB releases will be as well. It's a move against Microsoft's Metro store.
2011-09-20 14:04:43 +00:00
unsigned HorizontalSlider::length() {
return state.length;
}
unsigned HorizontalSlider::position() {
return p.position();
}
void HorizontalSlider::setLength(unsigned length) {
state.length = length;
return p.setLength(length);
}
void HorizontalSlider::setPosition(unsigned position) {
state.position = position;
return p.setPosition(position);
}
HorizontalSlider::HorizontalSlider():
state(*new State),
base_from_member<pHorizontalSlider&>(*new pHorizontalSlider(*this)),
Widget(base_from_member<pHorizontalSlider&>::value),
p(base_from_member<pHorizontalSlider&>::value) {
p.constructor();
}
HorizontalSlider::~HorizontalSlider() {
p.destructor();
delete &state;
}
//Label
//=====
void Label::setText(const string &text) {
state.text = text;
return p.setText(text);
}
Label::Label():
state(*new State),
base_from_member<pLabel&>(*new pLabel(*this)),
Widget(base_from_member<pLabel&>::value),
p(base_from_member<pLabel&>::value) {
p.constructor();
}
Label::~Label() {
p.destructor();
delete &state;
}
//LineEdit
//========
void LineEdit::setEditable(bool editable) {
state.editable = editable;
return p.setEditable(editable);
}
void LineEdit::setText(const string &text) {
state.text = text;
return p.setText(text);
}
string LineEdit::text() {
return p.text();
}
LineEdit::LineEdit():
state(*new State),
base_from_member<pLineEdit&>(*new pLineEdit(*this)),
Widget(base_from_member<pLineEdit&>::value),
p(base_from_member<pLineEdit&>::value) {
p.constructor();
}
LineEdit::~LineEdit() {
p.destructor();
delete &state;
}
//ListView
//========
void ListView::append_(const lstring &text) {
state.checked.append(false);
state.text.append(text);
return p.append(text);
}
void ListView::autoSizeColumns() {
return p.autoSizeColumns();
}
bool ListView::checked(unsigned row) {
return p.checked(row);
}
void ListView::modify_(unsigned row, const lstring &text) {
state.text[row] = text;
return p.modify(row, text);
}
void ListView::remove(unsigned row) {
state.text.remove(row);
state.image.remove(row);
return p.remove(row);
}
void ListView::reset() {
state.checked.reset();
state.image.reset();
state.text.reset();
return p.reset();
}
bool ListView::selected() {
return p.selected();
}
unsigned ListView::selection() {
return p.selection();
}
void ListView::setCheckable(bool checkable) {
state.checkable = checkable;
return p.setCheckable(checkable);
}
void ListView::setChecked(unsigned row, bool checked) {
state.checked[row] = checked;
return p.setChecked(row, checked);
}
void ListView::setHeaderText_(const lstring &text) {
state.headerText = text;
return p.setHeaderText(text);
}
void ListView::setHeaderVisible(bool visible) {
state.headerVisible = visible;
return p.setHeaderVisible(visible);
}
void ListView::setImage(unsigned row, unsigned column, const nall::image &image) {
state.image(row)(column) = image;
return p.setImage(row, column, image);
}
void ListView::setSelected(bool selected) {
state.selected = selected;
return p.setSelected(selected);
}
void ListView::setSelection(unsigned row) {
state.selected = true;
state.selection = row;
return p.setSelection(row);
}
ListView::ListView():
state(*new State),
base_from_member<pListView&>(*new pListView(*this)),
Widget(base_from_member<pListView&>::value),
p(base_from_member<pListView&>::value) {
p.constructor();
}
ListView::~ListView() {
p.destructor();
delete &state;
}
//ProgressBar
//===========
void ProgressBar::setPosition(unsigned position) {
state.position = position;
return p.setPosition(position);
}
ProgressBar::ProgressBar():
state(*new State),
base_from_member<pProgressBar&>(*new pProgressBar(*this)),
Widget(base_from_member<pProgressBar&>::value),
p(base_from_member<pProgressBar&>::value) {
p.constructor();
}
ProgressBar::~ProgressBar() {
p.destructor();
delete &state;
}
//RadioButton
//===========
void RadioButton::group(const set<RadioButton&> &list) {
for(auto &item : list) item.p.setGroup(item.state.group = list);
if(list.size()) list[0].setChecked();
}
bool RadioButton::checked() {
return p.checked();
}
void RadioButton::setChecked() {
for(auto &item : state.group) item.state.checked = false;
state.checked = true;
return p.setChecked();
}
void RadioButton::setText(const string &text) {
state.text = text;
return p.setText(text);
}
RadioButton::RadioButton():
state(*new State),
base_from_member<pRadioButton&>(*new pRadioButton(*this)),
Widget(base_from_member<pRadioButton&>::value),
p(base_from_member<pRadioButton&>::value) {
p.constructor();
}
RadioButton::~RadioButton() {
for(auto &item : state.group) {
if(&item != this) item.state.group.remove(*this);
}
p.destructor();
delete &state;
}
//TextEdit
//========
void TextEdit::setCursorPosition(unsigned position) {
state.cursorPosition = position;
return p.setCursorPosition(position);
}
void TextEdit::setEditable(bool editable) {
state.editable = editable;
return p.setEditable(editable);
}
void TextEdit::setText(const string &text) {
state.text = text;
return p.setText(text);
}
void TextEdit::setWordWrap(bool wordWrap) {
state.wordWrap = wordWrap;
return p.setWordWrap(wordWrap);
}
string TextEdit::text() {
return p.text();
}
bool TextEdit::wordWrap() {
return state.wordWrap;
}
TextEdit::TextEdit():
state(*new State),
base_from_member<pTextEdit&>(*new pTextEdit(*this)),
Widget(base_from_member<pTextEdit&>::value),
p(base_from_member<pTextEdit&>::value) {
p.constructor();
}
TextEdit::~TextEdit() {
p.destructor();
delete &state;
}
//VerticalScroller
//================
unsigned VerticalScroller::length() {
Update to v082r18 release. byuu says: There we go, the GUI is nearly feature-complete once again. All cores now output their native video format (NES={emphasis}{palette}, SNES=BGR555, GameBoy={ bright, normal, darker, darkest }), and are transformed to RGB555 data that is passed to the video renderer. The video renderer then uses its internal palette to apply brightness/contrast/gamma/ramp adjustments and outputs in RGB888 color space. This does add in another rendering pass, unfortunately, but it's a necessary one for universal support. The plan is to adapt all filters to take RGB555 input, and output RGB555 data as well. By doing this, it will be possible to stack filters. However, it's a bit complicated: I need to plan how the stacking should occur (eg we never want to apply scanlines before HQ2x, etc.) Added input frequency adjustments for all three systems. I can easily get perfect video/audio sync on all three now, hooray. Long-term, it seems like we only really need one, and we can do a video/audio delta to get an adjusted value. But for now, this gets the job done. Added audio volume adjust. I left out the balance for now, since it's obviously impossible to balance the NES' single channel audio (I can duplicate the channel, and do twice the filtering work, but ... why?) I replaced NTSC/PAL TV mode selection with an "Enable Overscan" checkbox. On, you get 240 lines on NES+SNES. Off, you get 224 lines on NES+SNES. Also added aspect correction box back. I don't do that gross PAL distortion shit anymore, sorry PAL people. I just scale up the 54/47*(240/224) aspect correction for overscan off mode. All memory is loaded and saved now, for all three systems (hooray, now you can actually play Zelda 1&2.) Added all of the old bsnes hotkeys, with the exception of capture screenshot. May add again later. May come up with something a bit different for extra features. Re-added the NSS DIP switch setting window. Since geometry is saved, I didn't want to auto-hide rows, so now you'll see all eight possible DIPs, and the ones not used are grayed out. Ultimately, nobody will notice since we only have DIPs for ActRaiser NSS, and nobody's probably even using the XML file for that anyway. Whatever, it's nice to have anyway. Took FitzRoy's advice and single-item combo boxes on the input selection are disabled, so the user doesn't waste time checking them. I wanted to leave text so that you know there's not a problem. Qt disabled radio box items look almost exactly like enabled ones. Fixed lots of issues in phoenix and extended it a bit. But I was still having trouble with radio box grouping, so I said fuck it and made the panels show/hide based instead of append/remove based. That's all for stuff off the checklist, I did a bunch of other things I don't recall. So yeah, I'd say the GUI is 100% usable now. This is my opinion on how multi-platform GUIs should be done =) Oh, I figure I should mention, but the NES core is GPLv3, and all future SNES+GB releases will be as well. It's a move against Microsoft's Metro store.
2011-09-20 14:04:43 +00:00
return state.length;
}
unsigned VerticalScroller::position() {
return p.position();
}
void VerticalScroller::setLength(unsigned length) {
state.length = length;
return p.setLength(length);
}
void VerticalScroller::setPosition(unsigned position) {
state.position = position;
return p.setPosition(position);
}
VerticalScroller::VerticalScroller():
state(*new State),
base_from_member<pVerticalScroller&>(*new pVerticalScroller(*this)),
Widget(base_from_member<pVerticalScroller&>::value),
p(base_from_member<pVerticalScroller&>::value) {
p.constructor();
}
VerticalScroller::~VerticalScroller() {
p.destructor();
delete &state;
}
//VerticalSlider
//==============
Update to v082r18 release. byuu says: There we go, the GUI is nearly feature-complete once again. All cores now output their native video format (NES={emphasis}{palette}, SNES=BGR555, GameBoy={ bright, normal, darker, darkest }), and are transformed to RGB555 data that is passed to the video renderer. The video renderer then uses its internal palette to apply brightness/contrast/gamma/ramp adjustments and outputs in RGB888 color space. This does add in another rendering pass, unfortunately, but it's a necessary one for universal support. The plan is to adapt all filters to take RGB555 input, and output RGB555 data as well. By doing this, it will be possible to stack filters. However, it's a bit complicated: I need to plan how the stacking should occur (eg we never want to apply scanlines before HQ2x, etc.) Added input frequency adjustments for all three systems. I can easily get perfect video/audio sync on all three now, hooray. Long-term, it seems like we only really need one, and we can do a video/audio delta to get an adjusted value. But for now, this gets the job done. Added audio volume adjust. I left out the balance for now, since it's obviously impossible to balance the NES' single channel audio (I can duplicate the channel, and do twice the filtering work, but ... why?) I replaced NTSC/PAL TV mode selection with an "Enable Overscan" checkbox. On, you get 240 lines on NES+SNES. Off, you get 224 lines on NES+SNES. Also added aspect correction box back. I don't do that gross PAL distortion shit anymore, sorry PAL people. I just scale up the 54/47*(240/224) aspect correction for overscan off mode. All memory is loaded and saved now, for all three systems (hooray, now you can actually play Zelda 1&2.) Added all of the old bsnes hotkeys, with the exception of capture screenshot. May add again later. May come up with something a bit different for extra features. Re-added the NSS DIP switch setting window. Since geometry is saved, I didn't want to auto-hide rows, so now you'll see all eight possible DIPs, and the ones not used are grayed out. Ultimately, nobody will notice since we only have DIPs for ActRaiser NSS, and nobody's probably even using the XML file for that anyway. Whatever, it's nice to have anyway. Took FitzRoy's advice and single-item combo boxes on the input selection are disabled, so the user doesn't waste time checking them. I wanted to leave text so that you know there's not a problem. Qt disabled radio box items look almost exactly like enabled ones. Fixed lots of issues in phoenix and extended it a bit. But I was still having trouble with radio box grouping, so I said fuck it and made the panels show/hide based instead of append/remove based. That's all for stuff off the checklist, I did a bunch of other things I don't recall. So yeah, I'd say the GUI is 100% usable now. This is my opinion on how multi-platform GUIs should be done =) Oh, I figure I should mention, but the NES core is GPLv3, and all future SNES+GB releases will be as well. It's a move against Microsoft's Metro store.
2011-09-20 14:04:43 +00:00
unsigned VerticalSlider::length() {
return state.length;
}
unsigned VerticalSlider::position() {
return p.position();
}
void VerticalSlider::setLength(unsigned length) {
state.length = length;
return p.setLength(length);
}
void VerticalSlider::setPosition(unsigned position) {
state.position = position;
return p.setPosition(position);
}
VerticalSlider::VerticalSlider():
state(*new State),
base_from_member<pVerticalSlider&>(*new pVerticalSlider(*this)),
Widget(base_from_member<pVerticalSlider&>::value),
p(base_from_member<pVerticalSlider&>::value) {
p.constructor();
}
VerticalSlider::~VerticalSlider() {
p.destructor();
delete &state;
}
//Viewport
//========
uintptr_t Viewport::handle() {
return p.handle();
}
Viewport::Viewport():
base_from_member<pViewport&>(*new pViewport(*this)),
Widget(base_from_member<pViewport&>::value),
p(base_from_member<pViewport&>::value) {
p.constructor();
}
Viewport::~Viewport() {
p.destructor();
}
}