mirror of https://github.com/bsnes-emu/bsnes.git
Update to v092r05 release.
byuu says: This release should be polished enough for a general release. This release should be polished enough for a general release. Anyone with a real, clean Mac up for posting compiled binaries? Preferably compile with "make profile=balanced" In fact, I'd like it if someone were willing to host a "higan for Mac" page, with binaries of each of the latest releases. Only really needed for major official releases, but it'd be preferable to have the builds updated as soon as possible after I post new builds. Changelog: - no more keyboard chimes when pressing keys - status bar added, fully functional - Label::minimumSize() takes frame into account (but note a few places hard-code raw Font::size(), so a few text labels are still clipped) - resizing the main window looks smooth regardless of whether a game is running or not - currently, resizing the window pauses the emulation. Allowing it to run the main loop was lagging out the window resize process too much to be worth it Additional OS X integration enhancements: - closing the main window unloads the current game, but does not quit the application (quit via the main menu or the dock menu) - clicking the icon in the dock will (re)display the main menu
This commit is contained in:
parent
fdd3ea490e
commit
5b4bbf5045
|
@ -3,10 +3,18 @@
|
|||
|
||||
namespace Emulator {
|
||||
static const char Name[] = "higan";
|
||||
static const char Version[] = "092.04";
|
||||
static const char Version[] = "092.05";
|
||||
static const char Author[] = "byuu";
|
||||
static const char License[] = "GPLv3";
|
||||
static const char Website[] = "http://byuu.org/";
|
||||
|
||||
#if defined(PROFILE_ACCURACY)
|
||||
static const char Profile[] = "Accuracy";
|
||||
#elif defined(PROFILE_BALANCED)
|
||||
static const char Profile[] = "Balanced";
|
||||
#elif defined(PROFILE_PERFORMANCE)
|
||||
static const char Profile[] = "Performance";
|
||||
#endif
|
||||
}
|
||||
|
||||
#include <nall/platform.hpp>
|
||||
|
|
|
@ -2,7 +2,7 @@ namespace phoenix {
|
|||
|
||||
struct pAction : public pObject {
|
||||
Action &action;
|
||||
NSMenuItem *cocoaAction;
|
||||
NSMenuItem *cocoaAction = nullptr;
|
||||
|
||||
void setEnabled(bool enabled);
|
||||
void setVisible(bool visible);
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace phoenix {
|
|||
|
||||
struct pCheckItem : public pAction {
|
||||
CheckItem &checkItem;
|
||||
CocoaCheckItem *cocoaCheckItem;
|
||||
CocoaCheckItem *cocoaCheckItem = nullptr;
|
||||
|
||||
bool checked();
|
||||
void setChecked(bool checked);
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace phoenix {
|
|||
|
||||
struct pItem : public pAction {
|
||||
Item &item;
|
||||
CocoaItem *cocoaItem;
|
||||
CocoaItem *cocoaItem = nullptr;
|
||||
|
||||
void setImage(const image &image);
|
||||
void setText(const string &text);
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace phoenix {
|
|||
|
||||
struct pMenu : public pAction {
|
||||
Menu &menu;
|
||||
CocoaMenu *cocoaMenu;
|
||||
CocoaMenu *cocoaMenu = nullptr;
|
||||
|
||||
void append(Action &action);
|
||||
void remove(Action &action);
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace phoenix {
|
|||
|
||||
struct pRadioItem : public pAction {
|
||||
RadioItem &radioItem;
|
||||
CocoaRadioItem *cocoaRadioItem;
|
||||
CocoaRadioItem *cocoaRadioItem = nullptr;
|
||||
|
||||
bool checked();
|
||||
void setChecked();
|
||||
|
|
|
@ -2,7 +2,7 @@ namespace phoenix {
|
|||
|
||||
struct pSeparator : public pAction {
|
||||
Separator &separator;
|
||||
NSMenuItem *cocoaSeparator;
|
||||
NSMenuItem *cocoaSeparator = nullptr;
|
||||
|
||||
pSeparator(Separator &separator) : pAction(separator), separator(separator) {}
|
||||
void constructor();
|
||||
|
|
|
@ -7,6 +7,12 @@
|
|||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
-(BOOL) applicationShouldHandleReopen:(NSApplication*)application hasVisibleWindows:(BOOL)flag {
|
||||
using phoenix::Application;
|
||||
if(Application::Cocoa::onActivate) Application::Cocoa::onActivate();
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(void) run:(NSTimer*)timer {
|
||||
using phoenix::Application;
|
||||
if(Application::main) Application::main();
|
||||
|
@ -21,6 +27,9 @@ namespace phoenix {
|
|||
void pApplication::run() {
|
||||
if(Application::main) {
|
||||
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:0.0 target:cocoaDelegate selector:@selector(run:) userInfo:nil repeats:YES];
|
||||
|
||||
//below line is needed to run application during window resize; however it has a large performance penalty on the resize smoothness
|
||||
//[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSEventTrackingRunLoopMode];
|
||||
}
|
||||
@autoreleasepool {
|
||||
[NSApp run];
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
@interface CocoaDelegate : NSObject <NSApplicationDelegate> {
|
||||
}
|
||||
-(NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication*)sender;
|
||||
-(BOOL) applicationShouldHandleReopen:(NSApplication*)application hasVisibleWindows:(BOOL)flag;
|
||||
-(void) run:(NSTimer*)timer;
|
||||
@end
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
namespace phoenix {
|
||||
|
||||
void pObject::constructor() {
|
||||
}
|
||||
|
||||
void pObject::destructor() {
|
||||
}
|
||||
|
||||
}
|
|
@ -7,8 +7,8 @@ struct pObject {
|
|||
pObject(Object &object) : object(object), locked(false) {}
|
||||
virtual ~pObject() {}
|
||||
|
||||
void constructor() {}
|
||||
void destructor() {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#include "platform.hpp"
|
||||
#include "utility.cpp"
|
||||
|
||||
#include "font.cpp"
|
||||
#include "desktop.cpp"
|
||||
#include "keyboard.cpp"
|
||||
#include "mouse.cpp"
|
||||
#include "browser-window.cpp"
|
||||
#include "message-window.cpp"
|
||||
#include "font.cpp"
|
||||
#include "object.cpp"
|
||||
#include "timer.cpp"
|
||||
#include "window.cpp"
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace phoenix {
|
|||
|
||||
struct pTimer : public pObject {
|
||||
Timer &timer;
|
||||
CocoaTimer *cocoaTimer;
|
||||
CocoaTimer *cocoaTimer = nullptr;
|
||||
|
||||
void setEnabled(bool enabled);
|
||||
void setInterval(unsigned milliseconds);
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace phoenix {
|
|||
|
||||
struct pButton : public pWidget {
|
||||
Button &button;
|
||||
CocoaButton *cocoaButton;
|
||||
CocoaButton *cocoaButton = nullptr;
|
||||
|
||||
Size minimumSize();
|
||||
void setImage(const image &image, Orientation orientation);
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace phoenix {
|
|||
|
||||
struct pCanvas : public pWidget {
|
||||
Canvas &canvas;
|
||||
CocoaCanvas *cocoaCanvas;
|
||||
CocoaCanvas *cocoaCanvas = nullptr;
|
||||
|
||||
void setSize(const Size &size);
|
||||
void update();
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace phoenix {
|
|||
|
||||
struct pCheckButton : public pWidget {
|
||||
CheckButton &checkButton;
|
||||
CocoaCheckButton *cocoaCheckButton;
|
||||
CocoaCheckButton *cocoaCheckButton = nullptr;
|
||||
|
||||
bool checked();
|
||||
Size minimumSize();
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace phoenix {
|
|||
|
||||
struct pComboButton : public pWidget {
|
||||
ComboButton &comboButton;
|
||||
CocoaComboButton *cocoaComboButton;
|
||||
CocoaComboButton *cocoaComboButton = nullptr;
|
||||
|
||||
void append(const string &text);
|
||||
Size minimumSize();
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace phoenix {
|
|||
|
||||
struct pHexEdit : public pWidget {
|
||||
HexEdit &hexEdit;
|
||||
CocoaHexEdit *cocoaHexEdit;
|
||||
CocoaHexEdit *cocoaHexEdit = nullptr;
|
||||
|
||||
void setColumns(unsigned columns);
|
||||
void setLength(unsigned length);
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace phoenix {
|
|||
|
||||
struct pHorizontalScroller : public pWidget {
|
||||
HorizontalScroller &horizontalScroller;
|
||||
CocoaHorizontalScroller *cocoaHorizontalScroller;
|
||||
CocoaHorizontalScroller *cocoaHorizontalScroller = nullptr;
|
||||
|
||||
Size minimumSize();
|
||||
unsigned position();
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace phoenix {
|
|||
|
||||
struct pHorizontalSlider : public pWidget {
|
||||
HorizontalSlider &horizontalSlider;
|
||||
CocoaHorizontalSlider *cocoaHorizontalSlider;
|
||||
CocoaHorizontalSlider *cocoaHorizontalSlider = nullptr;
|
||||
|
||||
Size minimumSize();
|
||||
unsigned position();
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace phoenix {
|
|||
|
||||
Size pLabel::minimumSize() {
|
||||
Size size = Font::size(label.font(), label.state.text);
|
||||
return {size.width, size.height};
|
||||
return {size.width + 6, size.height};
|
||||
}
|
||||
|
||||
void pLabel::setText(const string &text) {
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace phoenix {
|
|||
|
||||
struct pLabel : public pWidget {
|
||||
Label &label;
|
||||
CocoaLabel *cocoaLabel;
|
||||
CocoaLabel *cocoaLabel = nullptr;
|
||||
|
||||
Size minimumSize();
|
||||
void setText(const string &text);
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace phoenix {
|
|||
|
||||
struct pLineEdit : public pWidget {
|
||||
LineEdit &lineEdit;
|
||||
CocoaLineEdit *cocoaLineEdit;
|
||||
CocoaLineEdit *cocoaLineEdit = nullptr;
|
||||
|
||||
Size minimumSize();
|
||||
void setEditable(bool editable);
|
||||
|
|
|
@ -12,14 +12,14 @@
|
|||
[content setDataSource:self];
|
||||
[content setDelegate:self];
|
||||
[content setTarget:self];
|
||||
[content setDoubleAction:@selector(activate:)];
|
||||
[content setDoubleAction:@selector(doubleAction:)];
|
||||
|
||||
[content setAllowsColumnReordering:NO];
|
||||
[content setAllowsColumnResizing:YES];
|
||||
[content setAllowsColumnSelection:NO];
|
||||
[content setAllowsEmptySelection:YES];
|
||||
[content setAllowsMultipleSelection:NO];
|
||||
[content setColumnAutoresizingStyle:NSTableViewNoColumnAutoresizing];
|
||||
[content setColumnAutoresizingStyle:NSTableViewLastColumnOnlyAutoresizingStyle];
|
||||
|
||||
font = nil;
|
||||
[self setFont:nil];
|
||||
|
@ -114,6 +114,14 @@
|
|||
return @{ @"text":text };
|
||||
}
|
||||
|
||||
-(BOOL) tableView:(NSTableView*)table shouldShowCellExpansionForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row {
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(NSString*) tableView:(NSTableView*)table toolTipForCell:(NSCell*)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation {
|
||||
return nil;
|
||||
}
|
||||
|
||||
-(void) tableView:(NSTableView*)table setObjectValue:(id)object forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row {
|
||||
if([[tableColumn identifier] isEqualToString:@"check"]) {
|
||||
listView->state.checked(row) = [object integerValue] != NSOffState;
|
||||
|
@ -130,23 +138,31 @@
|
|||
}
|
||||
|
||||
-(IBAction) activate:(id)sender {
|
||||
if([content clickedRow] < 0) return;
|
||||
if(listView->onActivate) listView->onActivate();
|
||||
}
|
||||
|
||||
-(IBAction) doubleAction:(id)sender {
|
||||
if([content clickedRow] >= 0) {
|
||||
[self activate:self];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CocoaListViewContent : NSTableView
|
||||
|
||||
-(void) keyDown:(NSEvent*)event {
|
||||
[super keyDown:event];
|
||||
|
||||
auto character = [[event characters] characterAtIndex:0];
|
||||
if(character == NSEnterCharacter || character == NSCarriageReturnCharacter) {
|
||||
if([self selectedRow] >= 0) {
|
||||
[[self delegate] activate:self];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[super keyDown:event];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CocoaListViewCell : NSTextFieldCell
|
||||
|
@ -206,7 +222,7 @@ void pListView::autoSizeColumns() {
|
|||
}
|
||||
|
||||
unsigned height = [[cocoaView content] rowHeight];
|
||||
for(unsigned column = 0; column < listView.state.headerText.size(); column++) {
|
||||
for(unsigned column = 0; column < max(1u, listView.state.headerText.size()); column++) {
|
||||
NSTableColumn *tableColumn = [[cocoaView content] tableColumnWithIdentifier:[[NSNumber numberWithInteger:column] stringValue]];
|
||||
unsigned minimumWidth = pFont::size([[tableColumn headerCell] font], listView.state.headerText(column)).width + 4;
|
||||
for(unsigned row = 0; row < listView.state.text.size(); row++) {
|
||||
|
@ -216,6 +232,8 @@ void pListView::autoSizeColumns() {
|
|||
}
|
||||
[tableColumn setWidth:minimumWidth];
|
||||
}
|
||||
|
||||
[[cocoaView content] sizeLastColumnToFit];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,10 +14,13 @@
|
|||
-(void) reloadColumns;
|
||||
-(NSInteger) numberOfRowsInTableView:(NSTableView*)table;
|
||||
-(id) tableView:(NSTableView*)table objectValueForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row;
|
||||
-(BOOL) tableView:(NSTableView*)table shouldShowCellExpansionForTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row;
|
||||
-(NSString*) tableView:(NSTableView*)table toolTipForCell:(NSCell*)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation;
|
||||
-(void) tableView:(NSTableView*)table setObjectValue:(id)object forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row;
|
||||
-(void) tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row;
|
||||
-(void) tableViewSelectionDidChange:(NSNotification*)notification;
|
||||
-(IBAction) activate:(id)sender;
|
||||
-(IBAction) doubleAction:(id)sender;
|
||||
@end
|
||||
|
||||
@interface CocoaListViewContent : NSTableView {
|
||||
|
@ -35,7 +38,7 @@ namespace phoenix {
|
|||
|
||||
struct pListView : public pWidget {
|
||||
ListView &listView;
|
||||
CocoaListView *cocoaListView;
|
||||
CocoaListView *cocoaListView = nullptr;
|
||||
|
||||
void append(const lstring &text);
|
||||
void autoSizeColumns();
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace phoenix {
|
|||
|
||||
struct pProgressBar : public pWidget {
|
||||
ProgressBar &progressBar;
|
||||
CocoaProgressBar *cocoaProgressBar;
|
||||
CocoaProgressBar *cocoaProgressBar = nullptr;
|
||||
|
||||
void setPosition(unsigned position);
|
||||
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
phoenix::RadioButton *radioButton;
|
||||
}
|
||||
-(id) initWith:(phoenix::RadioButton&)radioButton;
|
||||
-(IBAction) activate:(id)sender;
|
||||
@end
|
||||
|
||||
namespace phoenix {
|
||||
|
||||
struct pRadioButton : public pWidget {
|
||||
RadioButton &radioButton;
|
||||
CocoaRadioButton *cocoaRadioButton;
|
||||
CocoaRadioButton *cocoaRadioButton = nullptr;
|
||||
|
||||
bool checked();
|
||||
Size minimumSize();
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace phoenix {
|
|||
|
||||
struct pTextEdit : public pWidget {
|
||||
TextEdit &textEdit;
|
||||
CocoaTextEdit *cocoaTextEdit;
|
||||
CocoaTextEdit *cocoaTextEdit = nullptr;
|
||||
|
||||
void setCursorPosition(unsigned position);
|
||||
void setEditable(bool editable);
|
||||
|
|
|
@ -3,13 +3,15 @@
|
|||
phoenix::VerticalScroller *verticalScroller;
|
||||
}
|
||||
-(id) initWith:(phoenix::VerticalScroller&)verticalScroller;
|
||||
-(void) update;
|
||||
-(IBAction) scroll:(id)sender;
|
||||
@end
|
||||
|
||||
namespace phoenix {
|
||||
|
||||
struct pVerticalScroller : public pWidget {
|
||||
VerticalScroller &verticalScroller;
|
||||
CocoaVerticalScroller *cocoaVerticalScroller;
|
||||
CocoaVerticalScroller *cocoaVerticalScroller = nullptr;
|
||||
|
||||
Size minimumSize();
|
||||
unsigned position();
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace phoenix {
|
|||
|
||||
struct pVerticalSlider : public pWidget {
|
||||
VerticalSlider &verticalSlider;
|
||||
CocoaVerticalSlider *cocoaVerticalSlider;
|
||||
CocoaVerticalSlider *cocoaVerticalSlider = nullptr;
|
||||
|
||||
Size minimumSize();
|
||||
unsigned position();
|
||||
|
|
|
@ -8,9 +8,18 @@
|
|||
}
|
||||
|
||||
-(void) drawRect:(NSRect)rect {
|
||||
NSColor *background = [NSColor blackColor];
|
||||
[background set];
|
||||
NSRectFill([self bounds]);
|
||||
[[NSColor blackColor] setFill];
|
||||
NSRectFillUsingOperation(rect, NSCompositeSourceOver);
|
||||
}
|
||||
|
||||
-(BOOL) acceptsFirstResponder {
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) keyDown:(NSEvent*)event {
|
||||
}
|
||||
|
||||
-(void) keyUp:(NSEvent*)event {
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -4,13 +4,16 @@
|
|||
}
|
||||
-(id) initWith:(phoenix::Viewport&)viewport;
|
||||
-(void) drawRect:(NSRect)rect;
|
||||
-(BOOL) acceptsFirstResponder;
|
||||
-(void) keyDown:(NSEvent*)event;
|
||||
-(void) keyUp:(NSEvent*)event;
|
||||
@end
|
||||
|
||||
namespace phoenix {
|
||||
|
||||
struct pViewport : public pWidget {
|
||||
Viewport &viewport;
|
||||
CocoaViewport *cocoaViewport;
|
||||
CocoaViewport *cocoaViewport = nullptr;
|
||||
|
||||
uintptr_t handle();
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ namespace phoenix {
|
|||
|
||||
struct pWidget : public pSizable {
|
||||
Widget &widget;
|
||||
NSView *cocoaView;
|
||||
NSView *cocoaView = nullptr;
|
||||
|
||||
bool enabled();
|
||||
bool focused();
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
[self setDelegate:self];
|
||||
[self setReleasedWhenClosed:NO];
|
||||
[self setAcceptsMouseMovedEvents:YES];
|
||||
[self setLevel:NSFloatingWindowLevel]; //when launched from a terminal, this places the window above it
|
||||
[self setTitle:@""];
|
||||
|
||||
menuBar = [[NSMenu alloc] init];
|
||||
|
@ -35,6 +34,16 @@
|
|||
text = {"Quit ", phoenix::applicationState.name};
|
||||
item = [[[NSMenuItem alloc] initWithTitle:[NSString stringWithUTF8String:text] action:@selector(menuQuit) keyEquivalent:@""] autorelease];
|
||||
[rootMenu addItem:item];
|
||||
|
||||
statusBar = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)];
|
||||
[statusBar setAlignment:NSLeftTextAlignment];
|
||||
[statusBar setBordered:YES];
|
||||
[statusBar setBezeled:YES];
|
||||
[statusBar setBezelStyle:NSTextFieldSquareBezel];
|
||||
[statusBar setEditable:NO];
|
||||
[statusBar setHidden:YES];
|
||||
|
||||
[[self contentView] addSubview:statusBar positioned:NSWindowBelow relativeTo:nil];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -88,6 +97,10 @@
|
|||
if(Application::Cocoa::onQuit) Application::Cocoa::onQuit();
|
||||
}
|
||||
|
||||
-(NSTextField*) statusBar {
|
||||
return statusBar;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
namespace phoenix {
|
||||
|
@ -102,6 +115,8 @@ void pWindow::append(Layout &layout) {
|
|||
Geometry geometry = window.state.geometry;
|
||||
geometry.x = geometry.y = 0;
|
||||
layout.setGeometry(geometry);
|
||||
|
||||
statusBarReposition();
|
||||
}
|
||||
|
||||
void pWindow::append(Menu &menu) {
|
||||
|
@ -117,7 +132,7 @@ void pWindow::append(Widget &widget) {
|
|||
|
||||
@autoreleasepool {
|
||||
[widget.p.cocoaView removeFromSuperview];
|
||||
[[cocoaWindow contentView] addSubview:widget.p.cocoaView positioned:NSWindowAbove relativeTo:nil];
|
||||
[[cocoaWindow contentView] addSubview:widget.p.cocoaView positioned:NSWindowBelow relativeTo:nil];
|
||||
widget.p.setGeometry(widget.geometry());
|
||||
[[cocoaWindow contentView] setNeedsDisplay:YES];
|
||||
}
|
||||
|
@ -151,6 +166,7 @@ Geometry pWindow::frameMargin() {
|
|||
Geometry pWindow::geometry() {
|
||||
@autoreleasepool {
|
||||
NSRect area = [cocoaWindow contentRectForFrameRect:[cocoaWindow frame]];
|
||||
area.size.height -= statusBarHeight();
|
||||
return {area.origin.x, Desktop::size().height - area.origin.y - area.size.height, area.size.width, area.size.height};
|
||||
}
|
||||
}
|
||||
|
@ -213,7 +229,10 @@ void pWindow::setGeometry(const Geometry &geometry) {
|
|||
@autoreleasepool {
|
||||
[cocoaWindow
|
||||
setFrame:[cocoaWindow
|
||||
frameRectForContentRect:NSMakeRect(geometry.x, Desktop::size().height - geometry.y - geometry.height, geometry.width, geometry.height)
|
||||
frameRectForContentRect:NSMakeRect(
|
||||
geometry.x, Desktop::size().height - geometry.y - geometry.height,
|
||||
geometry.width, geometry.height + statusBarHeight()
|
||||
)
|
||||
]
|
||||
display:YES
|
||||
];
|
||||
|
@ -223,6 +242,8 @@ void pWindow::setGeometry(const Geometry &geometry) {
|
|||
geometry.x = geometry.y = 0;
|
||||
layout.setGeometry(geometry);
|
||||
}
|
||||
|
||||
statusBarReposition();
|
||||
}
|
||||
|
||||
locked = false;
|
||||
|
@ -255,12 +276,23 @@ void pWindow::setResizable(bool resizable) {
|
|||
}
|
||||
|
||||
void pWindow::setStatusFont(const string &font) {
|
||||
@autoreleasepool {
|
||||
[[cocoaWindow statusBar] setFont:pFont::cocoaFont(font)];
|
||||
}
|
||||
statusBarReposition();
|
||||
}
|
||||
|
||||
void pWindow::setStatusText(const string &text) {
|
||||
@autoreleasepool {
|
||||
[[cocoaWindow statusBar] setStringValue:[NSString stringWithUTF8String:text]];
|
||||
}
|
||||
}
|
||||
|
||||
void pWindow::setStatusVisible(bool visible) {
|
||||
@autoreleasepool {
|
||||
[[cocoaWindow statusBar] setHidden:!visible];
|
||||
setGeometry(geometry());
|
||||
}
|
||||
}
|
||||
|
||||
void pWindow::setTitle(const string &text) {
|
||||
|
@ -271,12 +303,8 @@ void pWindow::setTitle(const string &text) {
|
|||
|
||||
void pWindow::setVisible(bool visible) {
|
||||
@autoreleasepool {
|
||||
if(visible) {
|
||||
[cocoaWindow makeKeyAndOrderFront:nil];
|
||||
[cocoaWindow setLevel:NSNormalWindowLevel];
|
||||
} else {
|
||||
[cocoaWindow orderOut:nil];
|
||||
}
|
||||
if(visible) [cocoaWindow makeKeyAndOrderFront:nil];
|
||||
else [cocoaWindow orderOut:nil];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -320,9 +348,24 @@ void pWindow::sizeEvent() {
|
|||
layout.setGeometry(geometry);
|
||||
}
|
||||
|
||||
statusBarReposition();
|
||||
|
||||
if(locked == false) {
|
||||
if(window.onSize) window.onSize();
|
||||
}
|
||||
}
|
||||
|
||||
unsigned pWindow::statusBarHeight() {
|
||||
if(!window.state.statusVisible) return 0;
|
||||
return Font::size(window.state.statusFont, " ").height + 6;
|
||||
}
|
||||
|
||||
void pWindow::statusBarReposition() {
|
||||
@autoreleasepool {
|
||||
NSRect area = [cocoaWindow contentRectForFrameRect:[cocoaWindow frame]];
|
||||
[[cocoaWindow statusBar] setFrame:NSMakeRect(0, 0, area.size.width, statusBarHeight())];
|
||||
[[cocoaWindow contentView] setNeedsDisplay:YES];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
phoenix::Window *window;
|
||||
NSMenu *menuBar;
|
||||
NSMenu *rootMenu;
|
||||
NSTextField *statusBar;
|
||||
}
|
||||
-(id) initWith:(phoenix::Window&)window;
|
||||
-(BOOL) canBecomeKeyWindow;
|
||||
|
@ -15,13 +16,14 @@
|
|||
-(void) menuAbout;
|
||||
-(void) menuPreferences;
|
||||
-(void) menuQuit;
|
||||
-(NSTextField*) statusBar;
|
||||
@end
|
||||
|
||||
namespace phoenix {
|
||||
|
||||
struct pWindow : public pObject {
|
||||
Window &window;
|
||||
CocoaWindow *cocoaWindow;
|
||||
CocoaWindow *cocoaWindow = nullptr;
|
||||
|
||||
static Window& none();
|
||||
|
||||
|
@ -55,6 +57,8 @@ struct pWindow : public pObject {
|
|||
void destructor();
|
||||
void moveEvent();
|
||||
void sizeEvent();
|
||||
unsigned statusBarHeight();
|
||||
void statusBarReposition();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -37,11 +37,12 @@ namespace phoenix {
|
|||
//Application
|
||||
//===========
|
||||
|
||||
nall::function<void ()> Application::main;
|
||||
function<void ()> Application::main;
|
||||
|
||||
nall::function<void ()> Application::Cocoa::onAbout;
|
||||
nall::function<void ()> Application::Cocoa::onPreferences;
|
||||
nall::function<void ()> Application::Cocoa::onQuit;
|
||||
function<void ()> Application::Cocoa::onAbout;
|
||||
function<void ()> Application::Cocoa::onActivate;
|
||||
function<void ()> Application::Cocoa::onPreferences;
|
||||
function<void ()> Application::Cocoa::onQuit;
|
||||
|
||||
void Application::run() {
|
||||
return pApplication::run();
|
||||
|
|
|
@ -65,6 +65,7 @@ struct Application {
|
|||
|
||||
struct Cocoa {
|
||||
static nall::function<void ()> onAbout;
|
||||
static nall::function<void ()> onActivate;
|
||||
static nall::function<void ()> onPreferences;
|
||||
static nall::function<void ()> onQuit;
|
||||
};
|
||||
|
|
|
@ -9,4 +9,7 @@ void pAction::setVisible(bool visible) {
|
|||
void pAction::constructor() {
|
||||
}
|
||||
|
||||
void pAction::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ struct pAction : public pObject {
|
|||
|
||||
pAction(Action &action) : pObject(action), action(action) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
namespace phoenix {
|
||||
|
||||
void pObject::constructor() {
|
||||
}
|
||||
|
||||
void pObject::destructor() {
|
||||
}
|
||||
|
||||
}
|
|
@ -7,8 +7,8 @@ struct pObject {
|
|||
pObject(Object &object) : object(object), locked(locked) {}
|
||||
virtual ~pObject() {}
|
||||
|
||||
void constructor() {}
|
||||
void destructor() {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#include "platform.hpp"
|
||||
|
||||
#include "font.cpp"
|
||||
#include "desktop.cpp"
|
||||
#include "keyboard.cpp"
|
||||
#include "mouse.cpp"
|
||||
#include "browser-window.cpp"
|
||||
#include "message-window.cpp"
|
||||
#include "font.cpp"
|
||||
#include "object.cpp"
|
||||
#include "timer.cpp"
|
||||
#include "window.cpp"
|
||||
|
||||
|
|
|
@ -9,4 +9,7 @@ void pTimer::setInterval(unsigned milliseconds) {
|
|||
void pTimer::constructor() {
|
||||
}
|
||||
|
||||
void pTimer::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ struct pTimer : public pObject {
|
|||
|
||||
pTimer(Timer &timer) : pObject(timer), timer(timer) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -9,4 +9,7 @@ void pButton::setText(const string &text) {
|
|||
void pButton::constructor() {
|
||||
}
|
||||
|
||||
void pButton::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ struct pButton : public pWidget {
|
|||
|
||||
pButton(Button &button) : pWidget(button), button(button) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -9,4 +9,7 @@ void pCanvas::update() {
|
|||
void pCanvas::constructor() {
|
||||
}
|
||||
|
||||
void pCanvas::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ struct pCanvas : public pWidget {
|
|||
|
||||
pCanvas(Canvas &canvas) : pWidget(canvas), canvas(canvas) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -13,4 +13,7 @@ void pCheckButton::setText(const string &text) {
|
|||
void pCheckButton::constructor() {
|
||||
}
|
||||
|
||||
void pCheckButton::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ struct pCheckButton : public pWidget {
|
|||
|
||||
pCheckButton(CheckButton &checkButton) : pWidget(checkButton), checkButton(checkButton) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -22,4 +22,7 @@ void pComboButton::setSelection(unsigned row) {
|
|||
void pComboButton::constructor() {
|
||||
}
|
||||
|
||||
void pComboButton::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ struct pComboButton : public pWidget {
|
|||
|
||||
pComboButton(ComboButton &comboButton) : pWidget(comboButton), comboButton(comboButton) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -18,4 +18,7 @@ void pHexEdit::update() {
|
|||
void pHexEdit::constructor() {
|
||||
}
|
||||
|
||||
void pHexEdit::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ struct pHexEdit : public pWidget {
|
|||
|
||||
pHexEdit(HexEdit &hexEdit) : pWidget(hexEdit), hexEdit(hexEdit) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -13,4 +13,7 @@ void pHorizontalScroller::setPosition(unsigned position) {
|
|||
void pHorizontalScroller::constructor() {
|
||||
}
|
||||
|
||||
void pHorizontalScroller::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ struct pHorizontalScroller : public pWidget {
|
|||
|
||||
pHorizontalScroller(HorizontalScroller &horizontalScroller) : pWidget(horizontalScroller), horizontalScroller(horizontalScroller) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -13,4 +13,7 @@ void pHorizontalSlider::setPosition(unsigned position) {
|
|||
void pHorizontalSlider::constructor() {
|
||||
}
|
||||
|
||||
void pHorizontalSlider::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ struct pHorizontalSlider : public pWidget {
|
|||
|
||||
pHorizontalSlider(HorizontalSlider &horizontalSlider) : pWidget(horizontalSlider), horizontalSlider(horizontalSlider) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -6,4 +6,7 @@ void pLabel::setText(const string &text) {
|
|||
void pLabel::constructor() {
|
||||
}
|
||||
|
||||
void pLabel::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ struct pLabel : public pWidget {
|
|||
|
||||
pLabel(Label &label) : pWidget(label), label(label) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -12,4 +12,7 @@ string pLineEdit::text() {
|
|||
void pLineEdit::constructor() {
|
||||
}
|
||||
|
||||
void pLineEdit::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ struct pLineEdit : public pWidget {
|
|||
|
||||
pLineEdit(LineEdit &lineEdit) : pWidget(lineEdit), lineEdit(lineEdit) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -50,4 +50,7 @@ void pListView::setSelection(unsigned row) {
|
|||
void pListView::constructor() {
|
||||
}
|
||||
|
||||
void pListView::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ struct pListView : public pWidget {
|
|||
|
||||
pListView(ListView &listView) : pWidget(listView), listView(listView) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -6,4 +6,7 @@ void pProgressBar::setPosition(unsigned position) {
|
|||
void pProgressBar::constructor() {
|
||||
}
|
||||
|
||||
void pProgressBar::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ struct pProgressBar : public pWidget {
|
|||
|
||||
pProgressBar(ProgressBar &progressBar) : pWidget(progressBar), progressBar(progressBar) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -16,4 +16,7 @@ void pRadioButton::setText(const string &text) {
|
|||
void pRadioButton::constructor() {
|
||||
}
|
||||
|
||||
void pRadioButton::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ struct pRadioButton : public pWidget {
|
|||
|
||||
pRadioButton(RadioButton &radioButton) : pWidget(radioButton), radioButton(radioButton) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -18,4 +18,7 @@ string pTextEdit::text() {
|
|||
void pTextEdit::constructor() {
|
||||
}
|
||||
|
||||
void pTextEdit::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ struct pTextEdit : public pWidget {
|
|||
|
||||
pTextEdit(TextEdit &textEdit) : pWidget(textEdit), textEdit(textEdit) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -13,4 +13,7 @@ void pVerticalScroller::setPosition(unsigned position) {
|
|||
void pVerticalScroller::constructor() {
|
||||
}
|
||||
|
||||
void pVerticalScroller::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ struct pVerticalScroller : public pWidget {
|
|||
|
||||
pVerticalScroller(VerticalScroller &verticalScroller) : pWidget(verticalScroller), verticalScroller(verticalScroller) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -13,4 +13,7 @@ void pVerticalSlider::setPosition(unsigned position) {
|
|||
void pVerticalSlider::constructor() {
|
||||
}
|
||||
|
||||
void pVerticalSlider::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ struct pVerticalSlider : public pWidget {
|
|||
|
||||
pVerticalSlider(VerticalSlider &verticalSlider) : pWidget(verticalSlider), verticalSlider(verticalSlider) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -7,4 +7,7 @@ uintptr_t pViewport::handle() {
|
|||
void pViewport::constructor() {
|
||||
}
|
||||
|
||||
void pViewport::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ struct pViewport : public pWidget {
|
|||
|
||||
pViewport(Viewport &viewport) : pWidget(viewport), viewport(viewport) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -30,4 +30,7 @@ void pWidget::setVisible(bool visible) {
|
|||
void pWidget::constructor() {
|
||||
}
|
||||
|
||||
void pWidget::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ struct pWidget : public pSizable {
|
|||
|
||||
pWidget(Widget &widget) : pSizable(widget), widget(widget) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -85,4 +85,7 @@ void pWindow::setWidgetFont(const string &font) {
|
|||
void pWindow::constructor() {
|
||||
}
|
||||
|
||||
void pWindow::destructor() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ struct pWindow : public pObject {
|
|||
|
||||
pWindow(Window &window) : pObject(window), window(window) {}
|
||||
void constructor();
|
||||
void destructor();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,22 @@
|
|||
#include "opengl.hpp"
|
||||
|
||||
namespace ruby {
|
||||
class pVideoCGL;
|
||||
}
|
||||
|
||||
@interface RubyVideoCGL : NSOpenGLView {
|
||||
@public
|
||||
ruby::pVideoCGL *video;
|
||||
}
|
||||
-(id) initWith:(ruby::pVideoCGL*)video pixelFormat:(NSOpenGLPixelFormat*)pixelFormat;
|
||||
-(void) reshape;
|
||||
@end
|
||||
|
||||
namespace ruby {
|
||||
|
||||
class pVideoCGL : public OpenGL {
|
||||
public:
|
||||
NSOpenGLView *view;
|
||||
RubyVideoCGL *view;
|
||||
|
||||
struct {
|
||||
NSView *handle;
|
||||
|
@ -121,8 +133,8 @@ public:
|
|||
|
||||
auto size = [settings.handle frame].size;
|
||||
auto format = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease];
|
||||
view = [[NSOpenGLView alloc] initWithFrame:NSMakeRect(0, 0, 0, 0) pixelFormat:format];
|
||||
|
||||
view = [[RubyVideoCGL alloc] initWith:this pixelFormat:format];
|
||||
[view setFrame:NSMakeRect(0, 0, size.width, size.height)];
|
||||
[view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
||||
[settings.handle addSubview:view];
|
||||
|
@ -140,6 +152,7 @@ public:
|
|||
[view unlockFocus];
|
||||
}
|
||||
|
||||
clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -172,3 +185,18 @@ public:
|
|||
DeclareVideo(CGL)
|
||||
|
||||
}
|
||||
|
||||
@implementation RubyVideoCGL : NSOpenGLView
|
||||
|
||||
-(id) initWith:(ruby::pVideoCGL*)videoPointer pixelFormat:(NSOpenGLPixelFormat*)pixelFormat {
|
||||
if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0) pixelFormat:pixelFormat]) {
|
||||
video = videoPointer;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void) reshape {
|
||||
video->refresh();
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
namespace Info {
|
||||
static const char Profile[] = "Accuracy";
|
||||
}
|
||||
|
||||
#include <sfc/cpu/cpu.hpp>
|
||||
#include <sfc/smp/smp.hpp>
|
||||
#include <sfc/dsp/dsp.hpp>
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
namespace Info {
|
||||
static const char Profile[] = "Balanced";
|
||||
}
|
||||
|
||||
#include <sfc/cpu/cpu.hpp>
|
||||
#include <sfc/smp/smp.hpp>
|
||||
#include <sfc/alt/dsp/dsp.hpp>
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
namespace Info {
|
||||
static const char Profile[] = "Performance";
|
||||
}
|
||||
|
||||
#if defined(DEBUGGER)
|
||||
#error "bsnes: debugger not supported with performance profile."
|
||||
#endif
|
||||
|
|
|
@ -8,7 +8,7 @@ serializer System::serialize() {
|
|||
memcpy(&hash, (const char*)cartridge.sha256(), 64);
|
||||
memset(&description, 0, sizeof description);
|
||||
memset(&profile, 0, sizeof profile);
|
||||
strmcpy(profile, Info::Profile, sizeof profile);
|
||||
strmcpy(profile, Emulator::Profile, sizeof profile);
|
||||
|
||||
s.integer(signature);
|
||||
s.integer(version);
|
||||
|
@ -32,7 +32,7 @@ bool System::unserialize(serializer &s) {
|
|||
|
||||
if(signature != 0x31545342) return false;
|
||||
if(version != Info::SerializerVersion) return false;
|
||||
if(strcmp(profile, Info::Profile)) return false;
|
||||
if(strcmp(profile, Emulator::Profile)) return false;
|
||||
|
||||
power();
|
||||
serialize_all(s);
|
||||
|
|
|
@ -87,6 +87,7 @@ Program::Program(int argc, char **argv) {
|
|||
stateManager = new StateManager;
|
||||
windowManager->loadGeometry();
|
||||
presentation->setVisible();
|
||||
utility->resize();
|
||||
|
||||
video.set(Video::Handle, presentation->viewport.handle());
|
||||
if(!video.cap(Video::Depth) || !video.set(Video::Depth, depth = 30u)) {
|
||||
|
@ -131,16 +132,16 @@ int main(int argc, char **argv) {
|
|||
|
||||
Application::setName("higan");
|
||||
|
||||
Application::Cocoa::onQuit = &Application::quit;
|
||||
Application::Cocoa::onPreferences = [&] {
|
||||
settings->setVisible();
|
||||
settings->panelList.setFocused();
|
||||
Application::Cocoa::onActivate = [&] {
|
||||
presentation->setVisible();
|
||||
};
|
||||
|
||||
Application::Cocoa::onAbout = [&] {
|
||||
MessageWindow()
|
||||
.setTitle({"About ", Emulator::Name})
|
||||
.setText({
|
||||
Emulator::Name, " v", Emulator::Version, "\n",
|
||||
Emulator::Profile, " Profile\n",
|
||||
"Author: ", Emulator::Author, "\n",
|
||||
"License: ", Emulator::License, "\n",
|
||||
"Website: ", Emulator::Website
|
||||
|
@ -148,6 +149,15 @@ int main(int argc, char **argv) {
|
|||
.information();
|
||||
};
|
||||
|
||||
Application::Cocoa::onPreferences = [&] {
|
||||
settings->setVisible();
|
||||
settings->panelList.setFocused();
|
||||
};
|
||||
|
||||
Application::Cocoa::onQuit = [&] {
|
||||
Application::quit();
|
||||
};
|
||||
|
||||
new Program(argc, argv);
|
||||
delete program;
|
||||
return 0;
|
||||
|
|
|
@ -111,7 +111,7 @@ Presentation::Presentation() : active(nullptr) {
|
|||
toolsMenu.append(resizeWindow, stateManager, cheatEditor, synchronizeTime);
|
||||
|
||||
append(layout);
|
||||
layout.append(viewport, {0, 0, 720, 480});
|
||||
layout.append(viewport, {0, 0, 1, 1});
|
||||
|
||||
onSize = [&] {
|
||||
utility->resize();
|
||||
|
@ -119,7 +119,11 @@ Presentation::Presentation() : active(nullptr) {
|
|||
|
||||
onClose = [&] {
|
||||
setVisible(false);
|
||||
if(Intrinsics::platform() == Intrinsics::Platform::OSX) {
|
||||
utility->unload();
|
||||
} else {
|
||||
Application::quit();
|
||||
}
|
||||
};
|
||||
|
||||
loadImport.onActivate = [&] {
|
||||
|
|
|
@ -16,17 +16,9 @@ AdvancedSettings::AdvancedSettings() {
|
|||
libraryPath.setText(path);
|
||||
libraryBrowse.setText("Browse ...");
|
||||
infoLabel.setFont(program->boldFont);
|
||||
string profile;
|
||||
#if defined(PROFILE_ACCURACY)
|
||||
profile = "Accuracy";
|
||||
#elif defined(PROFILE_BALANCED)
|
||||
profile = "Balanced";
|
||||
#elif defined(PROFILE_PERFORMANCE)
|
||||
profile = "Performance";
|
||||
#endif
|
||||
infoLabel.setText({
|
||||
Emulator::Name, " v", Emulator::Version, "\n",
|
||||
" ", profile, " Profile\n",
|
||||
" ", Emulator::Profile, " Profile\n",
|
||||
" Author: ", Emulator::Author, "\n",
|
||||
" License: ", Emulator::License, "\n",
|
||||
" Website: ", Emulator::Website
|
||||
|
|
|
@ -30,7 +30,7 @@ void Utility::loadMedia(string pathname) {
|
|||
for(auto &media : emulator->media) {
|
||||
if(media.bootable == false) continue;
|
||||
if(type != media.type) continue;
|
||||
return utility->loadMedia(emulator, media, {pathname, "/"});
|
||||
return loadMedia(emulator, media, {pathname, "/"});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,7 @@ void Utility::loadMedia(Emulator::Interface *emulator, Emulator::Interface::Medi
|
|||
system().power();
|
||||
|
||||
presentation->setSystemName(media.name);
|
||||
presentation->setVisible();
|
||||
load();
|
||||
}
|
||||
|
||||
|
@ -210,7 +211,12 @@ void Utility::updateShader() {
|
|||
}
|
||||
|
||||
void Utility::resize(bool resizeWindow) {
|
||||
if(program->active == nullptr) return;
|
||||
if(program->active == nullptr) {
|
||||
auto geometry = presentation->geometry();
|
||||
presentation->viewport.setGeometry({0, 0, geometry.width, geometry.height});
|
||||
return;
|
||||
}
|
||||
|
||||
Geometry geometry = presentation->geometry();
|
||||
unsigned width = system().information.width;
|
||||
unsigned height = system().information.height;
|
||||
|
|
Loading…
Reference in New Issue