mirror of https://github.com/bsnes-emu/bsnes.git
Update to v070r12 release.
byuu says: - removed support for images with copier headers - phoenix/Windows: Label properly refreshes on text changes, fixes video settings sliders - alt/ppu-performance: fixed mosaic Voffset bug, fixes Super Bowling et al - alt/cpu: fixed CPU::joylatch() reporting, allows serial applications to work with performance profile - hooked up SNES::cartridge.basename, allows MSU1 and serial support with the phoenix UI - updated UPS patching code for bsnes/Qt, allowing it to compile again, hidden config option file.bypassPatchCrc32 was removed
This commit is contained in:
parent
1926561ced
commit
1a29b59225
|
@ -9,7 +9,7 @@ public:
|
||||||
|
|
||||||
inline snes_information(const uint8_t *data, unsigned size);
|
inline snes_information(const uint8_t *data, unsigned size);
|
||||||
|
|
||||||
private:
|
//private:
|
||||||
inline void read_header(const uint8_t *data, unsigned size);
|
inline void read_header(const uint8_t *data, unsigned size);
|
||||||
inline unsigned find_header(const uint8_t *data, unsigned size);
|
inline unsigned find_header(const uint8_t *data, unsigned size);
|
||||||
inline unsigned score_header(const uint8_t *data, unsigned size, unsigned addr);
|
inline unsigned score_header(const uint8_t *data, unsigned size, unsigned addr);
|
||||||
|
|
|
@ -12,6 +12,7 @@ void Label::create(Window &parent, unsigned x, unsigned y, unsigned width, unsig
|
||||||
|
|
||||||
void Label::setText(const string &text) {
|
void Label::setText(const string &text) {
|
||||||
SetWindowText(widget->window, utf16_t(text));
|
SetWindowText(widget->window, utf16_t(text));
|
||||||
|
InvalidateRect(widget->window, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//all of this for want of a STATIC SS_VCENTER flag ...
|
//all of this for want of a STATIC SS_VCENTER flag ...
|
||||||
|
@ -24,28 +25,14 @@ LRESULT CALLBACK Label_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa
|
||||||
Label &label = *label_ptr;
|
Label &label = *label_ptr;
|
||||||
|
|
||||||
switch(msg) {
|
switch(msg) {
|
||||||
case WM_ERASEBKGND: {
|
|
||||||
if(window.window->brush == 0) break;
|
|
||||||
RECT rc;
|
|
||||||
GetClientRect(window.widget->window, &rc);
|
|
||||||
PAINTSTRUCT ps;
|
|
||||||
BeginPaint(window.widget->window, &ps);
|
|
||||||
FillRect(ps.hdc, &rc, window.window->brush);
|
|
||||||
EndPaint(window.widget->window, &ps);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
case WM_PAINT: {
|
case WM_PAINT: {
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
BeginPaint(hwnd, &ps);
|
|
||||||
SelectObject(ps.hdc, label.widget->font);
|
|
||||||
if(window.window->brush) {
|
|
||||||
SetBkColor(ps.hdc, window.window->brushColor);
|
|
||||||
} else {
|
|
||||||
SetBkColor(ps.hdc, GetSysColor(COLOR_3DFACE));
|
|
||||||
}
|
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
BeginPaint(hwnd, &ps);
|
||||||
GetClientRect(hwnd, &rc);
|
GetClientRect(hwnd, &rc);
|
||||||
|
FillRect(ps.hdc, &rc, window.window->brush ? window.window->brush : GetSysColorBrush(COLOR_3DFACE));
|
||||||
|
SetBkColor(ps.hdc, window.window->brush ? window.window->brushColor : GetSysColor(COLOR_3DFACE));
|
||||||
|
SelectObject(ps.hdc, label.widget->font);
|
||||||
unsigned length = GetWindowTextLength(hwnd);
|
unsigned length = GetWindowTextLength(hwnd);
|
||||||
wchar_t text[length + 1];
|
wchar_t text[length + 1];
|
||||||
GetWindowText(hwnd, text, length + 1);
|
GetWindowText(hwnd, text, length + 1);
|
||||||
|
@ -57,7 +44,6 @@ LRESULT CALLBACK Label_windowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa
|
||||||
rc.bottom = rc.top + height;
|
rc.bottom = rc.top + height;
|
||||||
DrawText(ps.hdc, text, -1, &rc, DT_LEFT | DT_END_ELLIPSIS);
|
DrawText(ps.hdc, text, -1, &rc, DT_LEFT | DT_END_ELLIPSIS);
|
||||||
EndPaint(hwnd, &ps);
|
EndPaint(hwnd, &ps);
|
||||||
InvalidateRect(hwnd, 0, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ uint8 CPU::pio() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPU::joylatch() {
|
bool CPU::joylatch() {
|
||||||
return 0;
|
return status.joypad_strobe_latch;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPU::interrupt_pending() {
|
bool CPU::interrupt_pending() {
|
||||||
|
|
|
@ -43,10 +43,10 @@ void PPU::Background::offset_per_tile(unsigned x, unsigned y, unsigned &hoffset,
|
||||||
void PPU::Background::scanline() {
|
void PPU::Background::scanline() {
|
||||||
if(self.vcounter() == 1) {
|
if(self.vcounter() == 1) {
|
||||||
mosaic_vcounter = regs.mosaic + 1;
|
mosaic_vcounter = regs.mosaic + 1;
|
||||||
y = 1;
|
mosaic_voffset = 1;
|
||||||
} else if(--mosaic_vcounter == 0) {
|
} else if(--mosaic_vcounter == 0) {
|
||||||
mosaic_vcounter = regs.mosaic + 1;
|
mosaic_vcounter = regs.mosaic + 1;
|
||||||
y += regs.mosaic + 1;
|
mosaic_voffset += regs.mosaic + 1;
|
||||||
}
|
}
|
||||||
if(self.regs.display_disable) return;
|
if(self.regs.display_disable) return;
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ void PPU::Background::render() {
|
||||||
hscroll = regs.hoffset;
|
hscroll = regs.hoffset;
|
||||||
vscroll = regs.voffset;
|
vscroll = regs.voffset;
|
||||||
|
|
||||||
unsigned y = Background::y;
|
unsigned y = (regs.mosaic == 0 ? self.vcounter() : mosaic_voffset);
|
||||||
if(hires) {
|
if(hires) {
|
||||||
hscroll <<= 1;
|
hscroll <<= 1;
|
||||||
if(self.regs.interlace) y = (y << 1) + self.field();
|
if(self.regs.interlace) y = (y << 1) + self.field();
|
||||||
|
|
|
@ -31,7 +31,6 @@ class Background {
|
||||||
const unsigned id;
|
const unsigned id;
|
||||||
unsigned opt_valid_bit;
|
unsigned opt_valid_bit;
|
||||||
|
|
||||||
unsigned y;
|
|
||||||
bool hires;
|
bool hires;
|
||||||
signed width;
|
signed width;
|
||||||
|
|
||||||
|
@ -48,6 +47,7 @@ class Background {
|
||||||
unsigned vscroll;
|
unsigned vscroll;
|
||||||
|
|
||||||
unsigned mosaic_vcounter;
|
unsigned mosaic_vcounter;
|
||||||
|
unsigned mosaic_voffset;
|
||||||
|
|
||||||
LayerWindow window;
|
LayerWindow window;
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,6 @@ void PPU::Background::serialize(serializer &s) {
|
||||||
s.integer(regs.main_enable);
|
s.integer(regs.main_enable);
|
||||||
s.integer(regs.sub_enable);
|
s.integer(regs.sub_enable);
|
||||||
|
|
||||||
s.integer(y);
|
|
||||||
s.integer(hires);
|
s.integer(hires);
|
||||||
s.integer(width);
|
s.integer(width);
|
||||||
|
|
||||||
|
@ -132,6 +131,7 @@ void PPU::Background::serialize(serializer &s) {
|
||||||
s.integer(vscroll);
|
s.integer(vscroll);
|
||||||
|
|
||||||
s.integer(mosaic_vcounter);
|
s.integer(mosaic_vcounter);
|
||||||
|
s.integer(mosaic_voffset);
|
||||||
|
|
||||||
window.serialize(s);
|
window.serialize(s);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
namespace SNES {
|
namespace SNES {
|
||||||
namespace Info {
|
namespace Info {
|
||||||
static const char Name[] = "bsnes";
|
static const char Name[] = "bsnes";
|
||||||
static const char Version[] = "070.11";
|
static const char Version[] = "070.12";
|
||||||
static const unsigned SerializerVersion = 13;
|
static const unsigned SerializerVersion = 14;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,10 @@ ui_objects += $(if $(call streq,$(platform),win),resource)
|
||||||
|
|
||||||
# platform
|
# platform
|
||||||
ifeq ($(platform),x)
|
ifeq ($(platform),x)
|
||||||
# phoenix_compile = $(call compile,-DPHOENIX_GTK `pkg-config --cflags gtk+-2.0`)
|
phoenix_compile = $(call compile,-DPHOENIX_GTK `pkg-config --cflags gtk+-2.0`)
|
||||||
# link += `pkg-config --libs gtk+-2.0`
|
link += `pkg-config --libs gtk+-2.0`
|
||||||
phoenix_compile = $(call compile,-DPHOENIX_QT `pkg-config --cflags QtCore QtGui`)
|
# phoenix_compile = $(call compile,-DPHOENIX_QT `pkg-config --cflags QtCore QtGui`)
|
||||||
link += `pkg-config --libs QtCore QtGui`
|
# link += `pkg-config --libs QtCore QtGui`
|
||||||
|
|
||||||
ruby := video.glx video.xv video.sdl
|
ruby := video.glx video.xv video.sdl
|
||||||
ruby += audio.alsa audio.openal audio.oss audio.pulseaudio audio.pulseaudiosimple audio.ao
|
ruby += audio.alsa audio.openal audio.oss audio.pulseaudio audio.pulseaudiosimple audio.ao
|
||||||
|
|
|
@ -88,10 +88,6 @@ bool Cartridge::loadCartridge(SNES::MappedRAM &memory, string &XML, const char *
|
||||||
if(XML.readfile(string(nall::basename(filename), ".xml")) == false) XML = "";
|
if(XML.readfile(string(nall::basename(filename), ".xml")) == false) XML = "";
|
||||||
|
|
||||||
unsigned size = fp.size();
|
unsigned size = fp.size();
|
||||||
if((size & 0x7fff) == 512) {
|
|
||||||
size -= 512;
|
|
||||||
fp.seek(512);
|
|
||||||
}
|
|
||||||
uint8_t *data = new uint8_t[size];
|
uint8_t *data = new uint8_t[size];
|
||||||
fp.read(data, size);
|
fp.read(data, size);
|
||||||
fp.close();
|
fp.close();
|
||||||
|
|
|
@ -78,6 +78,7 @@ void Utility::setShader() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Utility::cartridgeLoaded() {
|
void Utility::cartridgeLoaded() {
|
||||||
|
SNES::cartridge.basename = cartridge.baseName;
|
||||||
SNES::system.power();
|
SNES::system.power();
|
||||||
cheatEditor.load(cartridge.baseName);
|
cheatEditor.load(cartridge.baseName);
|
||||||
stateManager.load();
|
stateManager.load();
|
||||||
|
|
|
@ -228,28 +228,22 @@ bool Cartridge::loadCartridge(string &filename, string &xml, SNES::MappedRAM &me
|
||||||
uint8_t *outdata = 0;
|
uint8_t *outdata = 0;
|
||||||
unsigned outsize = 0;
|
unsigned outsize = 0;
|
||||||
ups patcher;
|
ups patcher;
|
||||||
ups::result result = patcher.apply(patchdata, patchsize, data, size, outdata, outsize);
|
if(patcher.apply(patchdata, patchsize, data, size, outdata, outsize) == ups::result_t::target_too_small) {
|
||||||
|
outdata = new uint8_t[outsize];
|
||||||
|
if(patcher.apply(patchdata, patchsize, data, size, outdata, outsize) == ups::result_t::success) {
|
||||||
|
delete[] data;
|
||||||
|
data = outdata;
|
||||||
|
size = outsize;
|
||||||
|
patchApplied = true;
|
||||||
|
} else {
|
||||||
|
delete[] outdata;
|
||||||
|
}
|
||||||
|
}
|
||||||
delete[] patchdata;
|
delete[] patchdata;
|
||||||
|
|
||||||
bool apply = false;
|
|
||||||
if(result == ups::ok) apply = true;
|
|
||||||
if(config().file.bypassPatchCrc32) {
|
|
||||||
if(result == ups::input_crc32_invalid ) apply = true;
|
|
||||||
if(result == ups::output_crc32_invalid) apply = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(apply == true) {
|
|
||||||
delete[] data;
|
|
||||||
data = outdata;
|
|
||||||
size = outsize;
|
|
||||||
patchApplied = true;
|
|
||||||
} else {
|
|
||||||
delete[] outdata;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
name = string(nall::basename(filename), ".xml");
|
name = string(nall::basename(filename), ".xml");
|
||||||
if(file::exists(name)) {
|
if(patchApplied == false && file::exists(name)) {
|
||||||
//prefer manually created XML cartridge mapping
|
//prefer manually created XML cartridge mapping
|
||||||
xml.readfile(name);
|
xml.readfile(name);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -48,8 +48,7 @@ Configuration::Configuration() {
|
||||||
attach(diskBrowser.useCommonDialogs = false, "diskBrowser.useCommonDialogs");
|
attach(diskBrowser.useCommonDialogs = false, "diskBrowser.useCommonDialogs");
|
||||||
attach(diskBrowser.showPanel = true, "diskBrowser.showPanel");
|
attach(diskBrowser.showPanel = true, "diskBrowser.showPanel");
|
||||||
|
|
||||||
attach(file.applyPatches = true, "file.applyPatches");
|
attach(file.applyPatches = true, "file.applyPatches");
|
||||||
attach(file.bypassPatchCrc32 = false, "file.bypassPatchCrc32");
|
|
||||||
|
|
||||||
attach(path.rom = "", "path.rom");
|
attach(path.rom = "", "path.rom");
|
||||||
attach(path.save = "", "path.save");
|
attach(path.save = "", "path.save");
|
||||||
|
|
|
@ -16,7 +16,6 @@ public:
|
||||||
|
|
||||||
struct File {
|
struct File {
|
||||||
bool applyPatches;
|
bool applyPatches;
|
||||||
bool bypassPatchCrc32;
|
|
||||||
} file;
|
} file;
|
||||||
|
|
||||||
struct DiskBrowser {
|
struct DiskBrowser {
|
||||||
|
|
Loading…
Reference in New Issue