Update to v094r09 release.

byuu says:

This will easily be the biggest diff in the history of higan. And not in
a good way.

* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)

For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.

Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.

Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.

My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
This commit is contained in:
Tim Allen 2015-02-26 21:10:46 +11:00
parent 1a7bc6bb87
commit a512d14628
793 changed files with 20182 additions and 19416 deletions

View File

@ -1,4 +1,4 @@
include nall/Makefile
include nall/GNUmakefile
fc := fc
sfc := sfc
@ -7,17 +7,12 @@ gba := gba
profile := accuracy
target := higan
# target := loki
ifeq ($(target),loki)
options += debugger
endif
# arch := x86
# console := true
# compiler
flags += -I. -O3 -fomit-frame-pointer
flags += -I. -O3
link +=
objects := libco
@ -43,16 +38,16 @@ ifeq ($(platform),windows)
else
link += -mwindows
endif
link += -s -mthreads -luuid -lkernel32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 -lole32 -lws2_32
link += -mthreads -luuid -lkernel32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 -lole32 -lws2_32
link += -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
else ifeq ($(platform),macosx)
flags += -march=native
else ifeq ($(platform),linux)
flags += -march=native
link += -s -Wl,-export-dynamic -lX11 -lXext -ldl
link += -Wl,-export-dynamic -lX11 -lXext -ldl
else ifeq ($(platform),bsd)
flags += -march=native
link += -s -Wl,-export-dynamic -lX11 -lXext
link += -Wl,-export-dynamic -lX11 -lXext
else
$(error unsupported platform.)
endif
@ -76,7 +71,7 @@ all: build;
obj/libco.o: libco/libco.c libco/*
include $(ui)/Makefile
include $(ui)/GNUmakefile
flags := $(flags) $(foreach o,$(call strupper,$(options)),-D$o)
# targets
@ -87,8 +82,6 @@ clean:
-@$(call delete,obj/*.so)
-@$(call delete,obj/*.dylib)
-@$(call delete,obj/*.dll)
-@$(call delete,*.res)
-@$(call delete,*.manifest)
archive:
if [ -f higan.tar.xz ]; then rm higan.tar.xz; fi
@ -99,16 +92,16 @@ ifeq ($(shell id -un),byuu)
if [ -d ./libco ]; then rm -r ./libco; fi
if [ -d ./nall ]; then rm -r ./nall; fi
if [ -d ./ruby ]; then rm -r ./ruby; fi
if [ -d ./phoenix ]; then rm -r ./phoenix; fi
if [ -d ./hiro ]; then rm -r ./hiro; fi
cp -r ../libco ./libco
cp -r ../nall ./nall
cp -r ../ruby ./ruby
cp -r ../phoenix ./phoenix
cp -r ../hiro ./hiro
rm -r libco/doc
rm -r libco/.test
rm -r nall/.test
rm -r ruby/.test
rm -r phoenix/.test
rm -r libco/-test
rm -r nall/-test
rm -r ruby/-test
rm -r hiro/-test
endif
help:;

View File

@ -1,6 +1,6 @@
[Desktop Entry]
Name=higan
Comment=SNES emulator
Comment=Nintendo emulator
Exec=higan
Icon=higan
Terminal=false

View File

@ -3,7 +3,7 @@
namespace Emulator {
static const char Name[] = "higan";
static const char Version[] = "094.08";
static const char Version[] = "094.09";
static const char Author[] = "byuu";
static const char License[] = "GPLv3";
static const char Website[] = "http://byuu.org/";
@ -26,7 +26,6 @@ namespace Emulator {
#include <nall/endian.hpp>
#include <nall/file.hpp>
#include <nall/function.hpp>
#include <nall/http.hpp>
#include <nall/image.hpp>
#include <nall/invoke.hpp>
#include <nall/priority-queue.hpp>
@ -34,12 +33,12 @@ namespace Emulator {
#include <nall/random.hpp>
#include <nall/serializer.hpp>
#include <nall/set.hpp>
#include <nall/sha256.hpp>
#include <nall/stdint.hpp>
#include <nall/string.hpp>
#include <nall/utility.hpp>
#include <nall/varint.hpp>
#include <nall/vector.hpp>
#include <nall/hash/sha256.hpp>
#include <nall/stream/memory.hpp>
#include <nall/stream/vector.hpp>
using namespace nall;

View File

@ -24,16 +24,10 @@ void Cartridge::load() {
Board::load(information.markup); //this call will set Cartridge::board if successful
if(board == nullptr) return;
sha256_ctx sha;
uint8 hash[32];
sha256_init(&sha);
sha256_chunk(&sha, board->prgrom.data, board->prgrom.size);
sha256_chunk(&sha, board->chrrom.data, board->chrrom.size);
sha256_final(&sha);
sha256_hash(&sha, hash);
string result;
for(auto& byte : hash) result.append(hex<2>(byte));
sha256 = result;
Hash::SHA256 sha;
sha.data(board->prgrom.data, board->prgrom.size);
sha.data(board->chrrom.data, board->chrrom.size);
sha256 = sha.digest();
system.load();
loaded = true;

View File

@ -25,7 +25,7 @@ void Cartridge::load_empty(System::Revision revision) {
romdata = allocate<uint8>(romsize, 0xff);
ramsize = 0;
mapper = &mbc0;
sha256 = nall::sha256(romdata, romsize);
sha256 = Hash::SHA256(romdata, romsize).digest();
loaded = true;
system.load(revision);
}
@ -94,7 +94,7 @@ void Cartridge::load(System::Revision revision) {
case Mapper::HuC3: mapper = &huc3; break;
}
sha256 = nall::sha256(romdata, romsize);
sha256 = Hash::SHA256(romdata, romsize).digest();
loaded = true;
system.load(revision);
}

View File

@ -68,7 +68,7 @@ void Cartridge::load() {
}
}
sha256 = nall::sha256(rom.data, rom_size);
sha256 = Hash::SHA256(rom.data, rom_size).digest();
system.load();
loaded = true;

View File

@ -20,7 +20,7 @@ void Player::power() {
}
void Player::frame() {
uint32 hash = crc32_calculate((const uint8*)ppu.output, 240 * 160 * sizeof(uint32));
uint32 hash = Hash::CRC32(ppu.output, 240 * 160 * sizeof(uint32)).value();
status.logoDetected = (hash == 0x7776eb55);
if(status.logoDetected) {

24
hiro/GNUmakefile Normal file
View File

@ -0,0 +1,24 @@
ifeq ($(platform),)
hiroflags = $(cppflags) $(flags) -DHIRO_REFERENCE
hirolink =
else ifeq ($(platform),windows)
hiroflags = $(cppflags) $(flags) -DHIRO_WINDOWS
hirolink = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lole32 -lcomctl32 -lcomdlg32 -luxtheme -lmsimg32 -lshlwapi
else ifeq ($(platform),macosx)
hiroflags = $(objcppflags) $(flags) -DHIRO_COCOA
hirolink = -framework Cocoa -framework Carbon
else
ifeq ($(hiro),)
hiro := gtk
endif
ifeq ($(hiro),gtk)
hiroflags = $(cppflags) $(flags) -DHIRO_GTK `pkg-config --cflags gtk+-2.0 gtksourceview-2.0`
hirolink = `pkg-config --libs gtk+-2.0 gtksourceview-2.0` -lX11
endif
ifeq ($(hiro),qt)
hiroflags = $(cppflags) $(flags) -DHIRO_QT `pkg-config --cflags QtCore QtGui`
hirolink = `pkg-config --libs QtCore QtGui` -lX11
endif
endif

View File

@ -24,7 +24,7 @@ string pBrowserWindow::open(BrowserWindow::State& state) {
@autoreleasepool {
NSMutableArray* filters = [[NSMutableArray alloc] init];
for(auto& rule : state.filters) {
string pattern = rule.split<1>("(")(1).rtrim<1>(")");
string pattern = rule.split<1>("(")(1).rtrim(")");
if(!pattern.empty()) [filters addObject:[NSString stringWithUTF8String:pattern]];
}
NSOpenPanel* panel = [NSOpenPanel openPanel];
@ -49,7 +49,7 @@ string pBrowserWindow::save(BrowserWindow::State& state) {
@autoreleasepool {
NSMutableArray* filters = [[NSMutableArray alloc] init];
for(auto& rule : state.filters) {
string pattern = rule.split<1>("(")(1).rtrim<1>(")");
string pattern = rule.split<1>("(")(1).rtrim(")");
if(!pattern.empty()) [filters addObject:[NSString stringWithUTF8String:pattern]];
}
NSSavePanel* panel = [NSSavePanel savePanel];

View File

@ -32,7 +32,10 @@ Size pButton::minimumSize() {
size.height += button.state.image.height;
}
return {size.width + 20, size.height + 4};
return {size.width + (button.state.text ? 20 : 4), size.height + 4};
}
void pButton::setBordered(bool bordered) {
}
void pButton::setGeometry(Geometry geometry) {

View File

@ -13,6 +13,7 @@ struct pButton : public pWidget {
CocoaButton* cocoaButton = nullptr;
Size minimumSize();
void setBordered(bool bordered);
void setGeometry(Geometry geometry);
void setImage(const image& image, Orientation orientation);
void setText(string text);

View File

@ -0,0 +1,12 @@
auto mAction::allocate() -> pObject* {
return new pAction(*this);
}
//
auto mAction::remove() -> type& {
if(auto menu = parentMenu()) menu->remove(*this);
if(auto menuBar = parentMenuBar()) menuBar->remove((mMenu&)*this);
if(auto popupMenu = parentPopupMenu()) popupMenu->remove(*this);
return *this;
}

View File

@ -0,0 +1,33 @@
auto mMenuCheckItem::allocate() -> pObject* {
return new pMenuCheckItem(*this);
}
//
auto mMenuCheckItem::checked() const -> bool {
return state.checked;
}
auto mMenuCheckItem::doToggle() const -> void {
if(state.onToggle) return state.onToggle();
}
auto mMenuCheckItem::onToggle(const function<void ()>& function) -> type& {
state.onToggle = function;
return *this;
}
auto mMenuCheckItem::setChecked(bool checked) -> type& {
state.checked = checked;
signal(setChecked, checked);
}
auto mMenuCheckItem::setText(const string& text) -> type& {
state.text = text;
signal(setText, text);
return *this;
}
auto mMenuCheckItem::text() const -> string {
return state.text;
}

View File

@ -0,0 +1,34 @@
auto mMenuItem::allocate() -> pObject* {
return new pMenuItem(*this);
}
//
auto mMenuItem::doActivate() const -> void {
if(state.onActivate) return state.onActivate();
}
auto mMenuItem::icon() const -> image {
return state.icon;
}
auto mMenuItem::onActivate(const function<void ()>& function) -> type& {
state.onActivate = function;
return *this;
}
auto mMenuItem::setIcon(const image& icon) -> type& {
state.icon = icon;
signal(setIcon, icon);
return *this;
}
auto mMenuItem::setText(const string& text) -> type& {
state.text = text;
signal(setText, text);
return *this;
}
auto mMenuItem::text() const -> string {
return state.text;
}

View File

@ -0,0 +1,51 @@
auto mMenuRadioItem::allocate() -> pObject* {
return new pMenuRadioItem(*this);
}
//
auto mMenuRadioItem::group(const vector<shared_pointer_weak<mMenuRadioItem>>& group) -> void {
for(auto& weak : group) {
if(auto item = weak.acquire()) item->state.group = group;
}
for(auto& weak : group) {
if(auto item = weak.acquire()) {
if(item->self()) item->self()->setGroup(group);
}
}
if(group.size()) {
if(auto item = group.first().acquire()) item->setChecked();
}
}
auto mMenuRadioItem::checked() const -> bool {
return state.checked;
}
auto mMenuRadioItem::doActivate() const -> void {
if(state.onActivate) return state.onActivate();
}
auto mMenuRadioItem::onActivate(const function<void ()>& function) -> type& {
state.onActivate = function;
return *this;
}
auto mMenuRadioItem::setChecked() -> type& {
for(auto& weak : state.group) {
if(auto item = weak.acquire()) item->state.checked = false;
}
state.checked = true;
signal(setChecked);
return *this;
}
auto mMenuRadioItem::setText(const string& text) -> type& {
state.text = text;
signal(setText, text);
return *this;
}
auto mMenuRadioItem::text() const -> string {
return state.text;
}

View File

@ -0,0 +1,3 @@
auto mMenuSeparator::allocate() -> pObject* {
return new pMenuSeparator(*this);
}

Some files were not shown because too many files have changed in this diff Show More