mirror of https://github.com/bsnes-emu/bsnes.git
Update to v091r15 release.
byuu says: Changelog: - all media types always show base name in the title now (eg Super Game Boy + Mega Man II) - Game Boy loading via ananke has been fixed - phoenix is dynamically linked on Windows now (needed for ananke) - Linux port shows the higan program icon (once you install the program to get the bitmap into /usr/local/share/pixmaps) - paths.cfg defaults to "userpath()/Emulation/System Name/" when it is created from scratch [Later, after the v092 release, byuu posted this additional changelog: - new compilation rules for win32 - OS::setName - default to ~/Emulation/media.name for paths.cfg ]
This commit is contained in:
parent
d59ae34e12
commit
b389d17c9a
|
@ -3,7 +3,7 @@
|
|||
|
||||
namespace Emulator {
|
||||
static const char Name[] = "higan";
|
||||
static const char Version[] = "091.14";
|
||||
static const char Version[] = "091.15";
|
||||
static const char Author[] = "byuu";
|
||||
static const char License[] = "GPLv3";
|
||||
}
|
||||
|
|
|
@ -74,7 +74,8 @@ char* integer(char *result, intmax_t value) {
|
|||
buffer[size++] = '0' + n;
|
||||
value /= 10;
|
||||
} while(value);
|
||||
buffer[size++] = negative ? '-' : '+';
|
||||
if(negative) buffer[size++] = '-';
|
||||
//buffer[size++] = negative ? '-' : '+';
|
||||
|
||||
for(signed x = size - 1, y = 0; x >= 0 && y < size; x--, y++) result[x] = buffer[y];
|
||||
result[size] = 0;
|
||||
|
@ -110,7 +111,8 @@ template<unsigned length_, char padding> string integer(intmax_t value) {
|
|||
buffer[size++] = '0' + n;
|
||||
value /= 10;
|
||||
} while(value);
|
||||
buffer[size++] = negative ? '-' : '+';
|
||||
if(negative) buffer[size++] = '-';
|
||||
//buffer[size++] = negative ? '-' : '+';
|
||||
buffer[size] = 0;
|
||||
|
||||
unsigned length = (length_ == 0 ? size : length_);
|
||||
|
@ -137,7 +139,8 @@ template<unsigned length_, char padding> string linteger(intmax_t value) {
|
|||
buffer[size++] = '0' + n;
|
||||
value /= 10;
|
||||
} while(value);
|
||||
buffer[size++] = negative ? '-' : '+';
|
||||
if(negative) buffer[size++] = '-';
|
||||
//buffer[size++] = negative ? '-' : '+';
|
||||
buffer[size] = 0;
|
||||
|
||||
unsigned length = (length_ == 0 ? size : length_);
|
||||
|
|
|
@ -173,6 +173,10 @@ void OS::quit() {
|
|||
return pOS::quit();
|
||||
}
|
||||
|
||||
void OS::setName(const string &name) {
|
||||
osState.name = name;
|
||||
}
|
||||
|
||||
void OS::initialize() {
|
||||
static bool initialized = false;
|
||||
if(initialized == false) {
|
||||
|
|
|
@ -143,13 +143,14 @@ struct Object {
|
|||
pObject &p;
|
||||
};
|
||||
|
||||
struct OS : Object {
|
||||
struct OS {
|
||||
static void main();
|
||||
static bool pendingEvents();
|
||||
static void processEvents();
|
||||
static void quit();
|
||||
static void setName(const nall::string &name);
|
||||
|
||||
OS();
|
||||
struct State;
|
||||
static void initialize();
|
||||
};
|
||||
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
struct OS::State {
|
||||
string name;
|
||||
|
||||
State() {
|
||||
}
|
||||
} osState;
|
||||
|
||||
struct Timer::State {
|
||||
bool enabled;
|
||||
unsigned milliseconds;
|
||||
|
|
|
@ -296,6 +296,15 @@ void pWindow::constructor() {
|
|||
|
||||
widget = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
//if program was given a name, try and set the window taskbar icon from one of the pixmaps folders
|
||||
if(osState.name.empty() == false) {
|
||||
if(file::exists({"/usr/share/pixmaps/", osState.name, ".png"})) {
|
||||
gtk_window_set_icon_from_file(GTK_WINDOW(widget), string{"/usr/share/pixmaps/", osState.name, ".png"}, nullptr);
|
||||
} else if(file::exists({"/usr/local/share/pixmaps/", osState.name, ".png"})) {
|
||||
gtk_window_set_icon_from_file(GTK_WINDOW(widget), string{"/usr/local/share/pixmaps/", osState.name, ".png"}, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
if(gdk_screen_is_composited(gdk_screen_get_default())) {
|
||||
gtk_widget_set_colormap(widget, gdk_screen_get_rgba_colormap(gdk_screen_get_default()));
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'platform.moc.hpp'
|
||||
**
|
||||
** Created: Fri Dec 21 17:46:20 2012
|
||||
** Created: Wed Dec 26 00:12:14 2012
|
||||
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.3)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
|
|
|
@ -179,6 +179,15 @@ void pWindow::constructor() {
|
|||
qtWindow = new QtWindow(*this);
|
||||
qtWindow->setWindowTitle(" ");
|
||||
|
||||
//if program was given a name, try and set the window taskbar icon to a matching pixmap image
|
||||
if(osState.name.empty() == false) {
|
||||
if(file::exists({"/usr/share/pixmaps/", osState.name, ".png"})) {
|
||||
qtWindow->setWindowIcon(QIcon(string{"/usr/share/pixmaps/", osState.name, ".png"}));
|
||||
} else if(file::exists({"/usr/local/share/pixmaps/", osState.name, ".png"})) {
|
||||
qtWindow->setWindowIcon(QIcon(string{"/usr/local/share/pixmaps/", osState.name, ".png"}));
|
||||
}
|
||||
}
|
||||
|
||||
qtLayout = new QVBoxLayout(qtWindow);
|
||||
qtLayout->setMargin(0);
|
||||
qtLayout->setSpacing(0);
|
||||
|
|
|
@ -63,10 +63,25 @@ void pButton::setImage(const image &image, Orientation orientation) {
|
|||
}
|
||||
Button_SetImageList(hwnd, &list);
|
||||
}
|
||||
|
||||
setText(button.state.text); //update text to display nicely with image (or lack thereof)
|
||||
}
|
||||
|
||||
void pButton::setText(const string &text) {
|
||||
SetWindowText(hwnd, utf16_t(text));
|
||||
if(text.empty()) {
|
||||
//bitmaps will not show up if text is empty
|
||||
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | BS_BITMAP);
|
||||
} else {
|
||||
//text will not show up if BS_BITMAP is set
|
||||
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~BS_BITMAP);
|
||||
}
|
||||
|
||||
if(OsVersion() >= WindowsVista && button.state.image.empty() == false && text.empty() == false) {
|
||||
//Vista+ does not add spacing between the icon and text; causing them to run into each other
|
||||
SetWindowText(hwnd, utf16_t(string{" ", text}));
|
||||
} else {
|
||||
SetWindowText(hwnd, utf16_t(text));
|
||||
}
|
||||
}
|
||||
|
||||
void pButton::constructor() {
|
||||
|
@ -74,7 +89,7 @@ void pButton::constructor() {
|
|||
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)&button);
|
||||
setDefaultFont();
|
||||
setImage(button.state.image, button.state.orientation);
|
||||
setText(button.state.text);
|
||||
//setText(button.state.text); //called by setImage();
|
||||
synchronize();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,22 +9,18 @@ Cartridge cartridge;
|
|||
|
||||
string Cartridge::title() {
|
||||
if(information.title.gameBoy.empty() == false) {
|
||||
return information.title.gameBoy;
|
||||
return {information.title.cartridge, " + ", information.title.gameBoy};
|
||||
}
|
||||
|
||||
if(information.title.satellaview.empty() == false) {
|
||||
if(has_bs_cart()) {
|
||||
return information.title.satellaview;
|
||||
} else {
|
||||
return {information.title.cartridge, " + ", information.title.satellaview};
|
||||
}
|
||||
return {information.title.cartridge, " + ", information.title.satellaview};
|
||||
}
|
||||
|
||||
if(information.title.sufamiTurboA.empty() == false) {
|
||||
if(information.title.sufamiTurboB.empty() == true) {
|
||||
return information.title.sufamiTurboA;
|
||||
return {information.title.cartridge, " + ", information.title.sufamiTurboA};
|
||||
} else {
|
||||
return {information.title.sufamiTurboA, " + ", information.title.sufamiTurboB};
|
||||
return {information.title.cartridge, " + ", information.title.sufamiTurboA, " + ", information.title.sufamiTurboB};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
#include <sfc/sfc.hpp>
|
||||
|
||||
#define EVENT_CPP
|
||||
namespace SuperFamicom {
|
||||
|
||||
Event event;
|
||||
|
||||
void Event::Enter() { event.enter(); }
|
||||
|
||||
void Event::enter() {
|
||||
while(true) {
|
||||
if(scheduler.sync == Scheduler::SynchronizeMode::All) {
|
||||
scheduler.exit(Scheduler::ExitReason::SynchronizeEvent);
|
||||
}
|
||||
}
|
||||
|
||||
step(1);
|
||||
synchronize_cpu();
|
||||
}
|
||||
|
||||
void Event::init() {
|
||||
}
|
||||
|
||||
void Event::load() {
|
||||
}
|
||||
|
||||
void Event::unload() {
|
||||
rom[0].reset();
|
||||
rom[1].reset();
|
||||
rom[2].reset();
|
||||
rom[3].reset();
|
||||
ram.reset();
|
||||
}
|
||||
|
||||
void Event::power() {
|
||||
}
|
||||
|
||||
void Event::reset() {
|
||||
create(Event::Enter, 1);
|
||||
}
|
||||
|
||||
//DSP-1
|
||||
uint8 Event::sr(unsigned addr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//DSP-1
|
||||
void Event::dr(unsigned addr, uint8 data) {
|
||||
}
|
||||
|
||||
//is there bank-switching?
|
||||
uint8 Event::rom_read(unsigned addr) {
|
||||
return cpu.regs.mdr;
|
||||
}
|
||||
|
||||
//is there read-protection?
|
||||
uint8 Event::ram_read(unsigned addr) {
|
||||
return cpu.regs.mdr;
|
||||
}
|
||||
|
||||
//is there write-protection?
|
||||
void Event::ram_write(unsigned addr, uint8 data) {
|
||||
}
|
||||
|
||||
void Event::serialize(serializer &s) {
|
||||
Thread::serialize(s);
|
||||
s.array(ram.data(), ram.size());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
//SNES-EVENT board emulation (skeleton):
|
||||
//* Campus Challenge '92
|
||||
//* Powerfest '94
|
||||
|
||||
struct Event : Coprocessor {
|
||||
MappedRAM rom[4];
|
||||
MappedRAM ram;
|
||||
|
||||
static void Enter();
|
||||
void enter();
|
||||
void init();
|
||||
void load();
|
||||
void unload();
|
||||
void power();
|
||||
void reset();
|
||||
|
||||
uint8 sr(unsigned);
|
||||
void dr(unsigned, uint8 data);
|
||||
uint8 rom_read(unsigned addr);
|
||||
uint8 ram_read(unsigned addr);
|
||||
void ram_write(unsigned addr, uint8 data);
|
||||
|
||||
void serialize(serializer&);
|
||||
|
||||
//private:
|
||||
enum class Board : unsigned { CampusChallenge92, Powerfest94 } board;
|
||||
unsigned revision;
|
||||
unsigned timer;
|
||||
|
||||
string host;
|
||||
unsigned port;
|
||||
string path;
|
||||
string username;
|
||||
string password;
|
||||
};
|
||||
|
||||
extern Event event;
|
|
@ -38,15 +38,15 @@ void Event::submitScore() {
|
|||
if(usedSaveState) return;
|
||||
|
||||
string data;
|
||||
data.append("timer=", timer, ";");
|
||||
data.append("timer:", timer, "\n");
|
||||
if(board == Board::CampusChallenge92) {
|
||||
unsigned mw = 0, fz = 0, pw = 0;
|
||||
for(unsigned n = 0x0408; n <= 0x040e; n++) mw = mw * 10 + ram.read(n);
|
||||
for(unsigned n = 0x0413; n >= 0x0410; n--) fz = fz * 10 + ram.read(n);
|
||||
for(unsigned n = 0x0418; n >= 0x0415; n--) pw = pw * 10 + ram.read(n);
|
||||
data.append("mw=", mw, ";");
|
||||
data.append("fz=", fz, ";");
|
||||
data.append("pw=", pw);
|
||||
data.append("mw:", mw, "\n");
|
||||
data.append("fz:", fz, "\n");
|
||||
data.append("pw:", pw, "\n");
|
||||
}
|
||||
if(board == Board::Powerfest94) {
|
||||
unsigned ml = 0, mk[2] = {0}, ba[2] = {0};
|
||||
|
@ -55,9 +55,9 @@ void Event::submitScore() {
|
|||
for(unsigned n = 0x0411; n >= 0x0410; n--) mk[1] = mk[1] * 10 + ram.read(n);
|
||||
for(unsigned n = 0x0418; n >= 0x0415; n--) ba[0] = ba[0] * 10 + ram.read(n);
|
||||
for(unsigned n = 0x041a; n >= 0x0419; n--) ba[1] = ba[1] * 10 + ram.read(n);
|
||||
data.append("ml=", ml, ";");
|
||||
data.append("mk=", mk[0], ",", mk[1], ";");
|
||||
data.append("ba=", ba[0], ",", ba[1]);
|
||||
data.append("ml:", ml, "\n");
|
||||
data.append("mk:", mk[0], ",", mk[1], "\n");
|
||||
data.append("ba:", ba[0], ",", ba[1], "\n");
|
||||
}
|
||||
|
||||
lstring side = interface->server().split<1>("@");
|
||||
|
|
|
@ -66,11 +66,14 @@ endif
|
|||
|
||||
# targets
|
||||
build: $(objects)
|
||||
ifeq ($(platform),osx)
|
||||
ifeq ($(platform),x)
|
||||
$(strip $(cpp) -o out/$(name) $(objects) $(link))
|
||||
else ifeq ($(platform),win)
|
||||
$(strip $(cpp) -shared -o out/phoenix.dll obj/phoenix.o $(phoenixlink))
|
||||
$(strip $(cpp) -o out/$(name) $(subst obj/phoenix.o,,$(objects)) $(link) -Lout -lphoenix)
|
||||
else ifeq ($(platform),osx)
|
||||
test -d ../$(name).app || mkdir -p ../$(name).app/Contents/MacOS
|
||||
$(strip $(cpp) -o ../$(name).app/Contents/MacOS/$(name) $(objects) $(link))
|
||||
else
|
||||
$(strip $(cpp) -o out/$(name) $(objects) $(link))
|
||||
endif
|
||||
|
||||
resource:
|
||||
|
|
|
@ -133,6 +133,7 @@ int main(int argc, char **argv) {
|
|||
utf8_args(argc, argv);
|
||||
#endif
|
||||
|
||||
OS::setName("higan");
|
||||
new Application(argc, argv);
|
||||
delete application;
|
||||
return 0;
|
||||
|
|
|
@ -73,7 +73,7 @@ void Browser::bootstrap() {
|
|||
|
||||
Folder folder;
|
||||
folder.extension = media.type;
|
||||
folder.path = application->basepath;
|
||||
folder.path = {userpath(), "Emulation/", media.name, "/"};
|
||||
folder.selection = 0;
|
||||
folderList.append(folder);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ void Utility::loadMedia(string pathname) {
|
|||
for(auto &emulator : application->emulator) {
|
||||
for(auto &media : emulator->media) {
|
||||
if(type != media.type) continue;
|
||||
if(media.bootable == false) continue;
|
||||
return utility->loadMedia(emulator, media, {pathname, "/"});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue