From ee6498258f069167ef9b247c027c1c6e1652b301 Mon Sep 17 00:00:00 2001 From: byuu <2107894+byuu@users.noreply.github.com> Date: Mon, 29 Jul 2019 00:59:45 +0900 Subject: [PATCH] v107.19 * HD mode 7 EXTBG fix * macOS: embed databases into .app bundle --- .cirrus.yml | 6 +++--- bsnes/emulator/emulator.hpp | 2 +- bsnes/sfc/ppu-fast/line.cpp | 7 ++++++- bsnes/target-bsnes/GNUmakefile | 7 +++++-- bsnes/target-bsnes/program/game-rom.cpp | 16 ++++++++-------- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 879e2edf..3bee7b3b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,6 +11,7 @@ linux-x86_64-binaries_task: package_script: - mkdir bsnes-nightly - mkdir bsnes-nightly/Database + - mkdir bsnes-nightly/Firmware - cp -a bsnes/out/bsnes bsnes-nightly/bsnes - cp -a bsnes/Database/* bsnes-nightly/Database - cp -a icarus/Database/* bsnes-nightly/Database @@ -32,6 +33,7 @@ freebsd-x86_64-binaries_task: package_script: - mkdir bsnes-nightly - mkdir bsnes-nightly/Database + - mkdir bsnes-nightly/Firmware - cp -a bsnes/out/bsnes bsnes-nightly/bsnes - cp -a bsnes/Database/* bsnes-nightly/Database/ - cp -a icarus/Database/* bsnes-nightly/Database/ @@ -53,6 +55,7 @@ windows-x86_64-binaries_task: package_script: - mkdir bsnes-nightly - mkdir bsnes-nightly/Database + - mkdir bsnes-nightly/Firmware - cp -a bsnes/out/bsnes bsnes-nightly/bsnes.exe - cp -a bsnes/Database/* bsnes-nightly/Database/ - cp -a icarus/Database/* bsnes-nightly/Database/ @@ -70,10 +73,7 @@ macOS-x86_64-binaries_task: package_script: - mkdir bsnes-nightly - - mkdir bsnes-nightly/Database - cp -a bsnes/out/bsnes.app bsnes-nightly/ - - cp -a bsnes/Database/* bsnes-nightly/Database/ - - cp -a icarus/Database/* bsnes-nightly/Database/ - cp -a GPLv3.txt bsnes-nightly/ bsnes-nightly_artifacts: diff --git a/bsnes/emulator/emulator.hpp b/bsnes/emulator/emulator.hpp index 5d2014c3..be6ca27e 100644 --- a/bsnes/emulator/emulator.hpp +++ b/bsnes/emulator/emulator.hpp @@ -31,7 +31,7 @@ using namespace nall; namespace Emulator { static const string Name = "bsnes"; - static const string Version = "107.18"; + static const string Version = "107.19"; static const string Author = "byuu"; static const string License = "GPLv3"; static const string Website = "https://byuu.org"; diff --git a/bsnes/sfc/ppu-fast/line.cpp b/bsnes/sfc/ppu-fast/line.cpp index ecd80746..10a63530 100644 --- a/bsnes/sfc/ppu-fast/line.cpp +++ b/bsnes/sfc/ppu-fast/line.cpp @@ -41,11 +41,16 @@ auto PPU::Line::render() -> void { below[x] = {Source::COL, 0, belowColor}; } + //hack: generally, renderBackground/renderObject ordering do not matter. + //but for HD mode 7, a larger grid of pixels are generated, and so ordering ends up mattering. + //as a hack for Mohawk & Headphone Jack, we reorder things for BG2 to render properly. + //longer-term, we need to devise a better solution that can work for every game. renderBackground(io.bg1, Source::BG1); - renderBackground(io.bg2, Source::BG2); + if(io.extbg == 0) renderBackground(io.bg2, Source::BG2); renderBackground(io.bg3, Source::BG3); renderBackground(io.bg4, Source::BG4); renderObject(io.obj); + if(io.extbg == 1) renderBackground(io.bg2, Source::BG2); renderWindow(io.col.window, io.col.window.aboveMask, windowAbove); renderWindow(io.col.window, io.col.window.belowMask, windowBelow); diff --git a/bsnes/target-bsnes/GNUmakefile b/bsnes/target-bsnes/GNUmakefile index 483b1596..d9f219cf 100644 --- a/bsnes/target-bsnes/GNUmakefile +++ b/bsnes/target-bsnes/GNUmakefile @@ -25,8 +25,12 @@ all: $(hiro.objects) $(ruby.objects) $(objects) ifeq ($(platform),macos) rm -rf out/$(name).app mkdir -p out/$(name).app/Contents/MacOS/ + mkdir -p out/$(name).app/Contents/MacOS/Database/ + mkdir -p out/$(name).app/Contents/MacOS/Firmware/ mkdir -p out/$(name).app/Contents/Resources/ mv out/$(name) out/$(name).app/Contents/MacOS/$(name) + cp Database/* out/$(name).app/Contents/MacOS/Database/ + cp ../icarus/Database/* out/$(name).app/Contents/MacOS/Database/ cp $(ui)/resource/$(name).plist out/$(name).app/Contents/Info.plist sips -s format icns $(ui)/resource/$(name).png --out out/$(name).app/Contents/Resources/$(name).icns endif @@ -40,9 +44,8 @@ else ifeq ($(platform),windows) else ifeq ($(platform),macos) mkdir -p ~/Library/Application\ Support/$(name)/ mkdir -p ~/Library/Application\ Support/$(name)/Database/ + mkdir -p ~/Library/Application\ Support/$(name)/Firmware/ cp -R out/$(name).app /Applications/$(name).app - cp Database/* ~/Library/Application\ Support/$(name)/Database/ - cp ../icarus/Database/* ~/Library/Application\ Support/$(name)/Database/ else ifneq ($(filter $(platform),linux bsd),) mkdir -p $(prefix)/bin/ mkdir -p $(prefix)/share/applications/ diff --git a/bsnes/target-bsnes/program/game-rom.cpp b/bsnes/target-bsnes/program/game-rom.cpp index 9629d25c..7f479967 100644 --- a/bsnes/target-bsnes/program/game-rom.cpp +++ b/bsnes/target-bsnes/program/game-rom.cpp @@ -16,7 +16,7 @@ auto Program::openRomSuperFamicom(string name, vfs::file::mode mode) -> vfs::sha return vfs::memory::file::open(&superFamicom.firmware.data()[0x00000], 0x20000); } if(auto memory = superFamicom.document["game/board/memory(type=ROM,content=Program,architecture=ARM6)"]) { - string location = locate({"firmware/", memory["identifier"].text().downcase(), ".program.rom"}); + string location = locate({"Firmware/", memory["identifier"].text().downcase(), ".program.rom"}); return vfs::fs::file::open(location, mode); } } @@ -26,7 +26,7 @@ auto Program::openRomSuperFamicom(string name, vfs::file::mode mode) -> vfs::sha return vfs::memory::file::open(&superFamicom.firmware.data()[0x20000], 0x08000); } if(auto memory = superFamicom.document["game/board/memory(type=ROM,content=Data,architecture=ARM6)"]) { - string location = locate({"firmware/", memory["identifier"].text().downcase(), ".data.rom"}); + string location = locate({"Firmware/", memory["identifier"].text().downcase(), ".data.rom"}); return vfs::fs::file::open(location, mode); } } @@ -36,7 +36,7 @@ auto Program::openRomSuperFamicom(string name, vfs::file::mode mode) -> vfs::sha return vfs::memory::file::open(superFamicom.firmware.data(), superFamicom.firmware.size()); } if(auto memory = superFamicom.document["game/board/memory(type=ROM,content=Data,architecture=HG51BS169)"]) { - string location = locate({"firmware/", memory["identifier"].text().downcase(), ".data.rom"}); + string location = locate({"Firmware/", memory["identifier"].text().downcase(), ".data.rom"}); return vfs::fs::file::open(location, mode); } } @@ -46,7 +46,7 @@ auto Program::openRomSuperFamicom(string name, vfs::file::mode mode) -> vfs::sha return vfs::memory::file::open(superFamicom.firmware.data(), superFamicom.firmware.size()); } if(auto memory = superFamicom.document["game/board/memory(type=ROM,content=Boot,architecture=LR35902)"]) { - string location = locate({"firmware/", memory["identifier"].text().downcase(), ".boot.rom"}); + string location = locate({"Firmware/", memory["identifier"].text().downcase(), ".boot.rom"}); return vfs::fs::file::open(location, mode); } } @@ -56,7 +56,7 @@ auto Program::openRomSuperFamicom(string name, vfs::file::mode mode) -> vfs::sha return vfs::memory::file::open(&superFamicom.firmware.data()[0x0000], 0x1800); } if(auto memory = superFamicom.document["game/board/memory(type=ROM,content=Program,architecture=uPD7725)"]) { - string location = locate({"firmware/", memory["identifier"].text().downcase(), ".program.rom"}); + string location = locate({"Firmware/", memory["identifier"].text().downcase(), ".program.rom"}); return vfs::fs::file::open(location, mode); } } @@ -66,7 +66,7 @@ auto Program::openRomSuperFamicom(string name, vfs::file::mode mode) -> vfs::sha return vfs::memory::file::open(&superFamicom.firmware.data()[0x1800], 0x0800); } if(auto memory = superFamicom.document["game/board/memory(type=ROM,content=Data,architecture=uPD7725)"]) { - string location = locate({"firmware/", memory["identifier"].text().downcase(), ".data.rom"}); + string location = locate({"Firmware/", memory["identifier"].text().downcase(), ".data.rom"}); return vfs::fs::file::open(location, mode); } } @@ -76,7 +76,7 @@ auto Program::openRomSuperFamicom(string name, vfs::file::mode mode) -> vfs::sha return vfs::memory::file::open(&superFamicom.firmware.data()[0x0000], 0xc000); } if(auto memory = superFamicom.document["game/board/memory(type=ROM,content=Program,architecture=uPD96050)"]) { - string location = locate({"firmware/", memory["identifier"].text().downcase(), ".program.rom"}); + string location = locate({"Firmware/", memory["identifier"].text().downcase(), ".program.rom"}); return vfs::fs::file::open(location, mode); } } @@ -86,7 +86,7 @@ auto Program::openRomSuperFamicom(string name, vfs::file::mode mode) -> vfs::sha return vfs::memory::file::open(&superFamicom.firmware.data()[0xc000], 0x1000); } if(auto memory = superFamicom.document["game/board/memory(type=ROM,content=Data,architecture=uPD96050)"]) { - string location = locate({"firmware/", memory["identifier"].text().downcase(), ".data.rom"}); + string location = locate({"Firmware/", memory["identifier"].text().downcase(), ".data.rom"}); return vfs::fs::file::open(location, mode); } }