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:
Tim Allen 2010-10-11 21:36:00 +11:00
parent 1926561ced
commit 1a29b59225
13 changed files with 32 additions and 57 deletions

View File

@ -9,7 +9,7 @@ public:
inline snes_information(const uint8_t *data, unsigned size);
private:
//private:
inline void read_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);

View File

@ -12,6 +12,7 @@ void Label::create(Window &parent, unsigned x, unsigned y, unsigned width, unsig
void Label::setText(const string &text) {
SetWindowText(widget->window, utf16_t(text));
InvalidateRect(widget->window, 0, false);
}
//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;
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: {
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;
BeginPaint(hwnd, &ps);
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);
wchar_t 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;
DrawText(ps.hdc, text, -1, &rc, DT_LEFT | DT_END_ELLIPSIS);
EndPaint(hwnd, &ps);
InvalidateRect(hwnd, 0, false);
}
}

View File

@ -5,7 +5,7 @@ uint8 CPU::pio() {
}
bool CPU::joylatch() {
return 0;
return status.joypad_strobe_latch;
}
bool CPU::interrupt_pending() {

View File

@ -43,10 +43,10 @@ void PPU::Background::offset_per_tile(unsigned x, unsigned y, unsigned &hoffset,
void PPU::Background::scanline() {
if(self.vcounter() == 1) {
mosaic_vcounter = regs.mosaic + 1;
y = 1;
mosaic_voffset = 1;
} else if(--mosaic_vcounter == 0) {
mosaic_vcounter = regs.mosaic + 1;
y += regs.mosaic + 1;
mosaic_voffset += regs.mosaic + 1;
}
if(self.regs.display_disable) return;
@ -93,7 +93,7 @@ void PPU::Background::render() {
hscroll = regs.hoffset;
vscroll = regs.voffset;
unsigned y = Background::y;
unsigned y = (regs.mosaic == 0 ? self.vcounter() : mosaic_voffset);
if(hires) {
hscroll <<= 1;
if(self.regs.interlace) y = (y << 1) + self.field();

View File

@ -31,7 +31,6 @@ class Background {
const unsigned id;
unsigned opt_valid_bit;
unsigned y;
bool hires;
signed width;
@ -48,6 +47,7 @@ class Background {
unsigned vscroll;
unsigned mosaic_vcounter;
unsigned mosaic_voffset;
LayerWindow window;

View File

@ -115,7 +115,6 @@ void PPU::Background::serialize(serializer &s) {
s.integer(regs.main_enable);
s.integer(regs.sub_enable);
s.integer(y);
s.integer(hires);
s.integer(width);
@ -132,6 +131,7 @@ void PPU::Background::serialize(serializer &s) {
s.integer(vscroll);
s.integer(mosaic_vcounter);
s.integer(mosaic_voffset);
window.serialize(s);
}

View File

@ -1,8 +1,8 @@
namespace SNES {
namespace Info {
static const char Name[] = "bsnes";
static const char Version[] = "070.11";
static const unsigned SerializerVersion = 13;
static const char Version[] = "070.12";
static const unsigned SerializerVersion = 14;
}
}

View File

@ -4,10 +4,10 @@ ui_objects += $(if $(call streq,$(platform),win),resource)
# platform
ifeq ($(platform),x)
# phoenix_compile = $(call compile,-DPHOENIX_GTK `pkg-config --cflags gtk+-2.0`)
# link += `pkg-config --libs gtk+-2.0`
phoenix_compile = $(call compile,-DPHOENIX_QT `pkg-config --cflags QtCore QtGui`)
link += `pkg-config --libs QtCore QtGui`
phoenix_compile = $(call compile,-DPHOENIX_GTK `pkg-config --cflags gtk+-2.0`)
link += `pkg-config --libs gtk+-2.0`
# phoenix_compile = $(call compile,-DPHOENIX_QT `pkg-config --cflags QtCore QtGui`)
# link += `pkg-config --libs QtCore QtGui`
ruby := video.glx video.xv video.sdl
ruby += audio.alsa audio.openal audio.oss audio.pulseaudio audio.pulseaudiosimple audio.ao

View File

@ -88,10 +88,6 @@ bool Cartridge::loadCartridge(SNES::MappedRAM &memory, string &XML, const char *
if(XML.readfile(string(nall::basename(filename), ".xml")) == false) XML = "";
unsigned size = fp.size();
if((size & 0x7fff) == 512) {
size -= 512;
fp.seek(512);
}
uint8_t *data = new uint8_t[size];
fp.read(data, size);
fp.close();

View File

@ -78,6 +78,7 @@ void Utility::setShader() {
}
void Utility::cartridgeLoaded() {
SNES::cartridge.basename = cartridge.baseName;
SNES::system.power();
cheatEditor.load(cartridge.baseName);
stateManager.load();

View File

@ -228,17 +228,9 @@ bool Cartridge::loadCartridge(string &filename, string &xml, SNES::MappedRAM &me
uint8_t *outdata = 0;
unsigned outsize = 0;
ups patcher;
ups::result result = patcher.apply(patchdata, patchsize, data, size, outdata, outsize);
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) {
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;
@ -247,9 +239,11 @@ bool Cartridge::loadCartridge(string &filename, string &xml, SNES::MappedRAM &me
delete[] outdata;
}
}
delete[] patchdata;
}
name = string(nall::basename(filename), ".xml");
if(file::exists(name)) {
if(patchApplied == false && file::exists(name)) {
//prefer manually created XML cartridge mapping
xml.readfile(name);
} else {

View File

@ -49,7 +49,6 @@ Configuration::Configuration() {
attach(diskBrowser.showPanel = true, "diskBrowser.showPanel");
attach(file.applyPatches = true, "file.applyPatches");
attach(file.bypassPatchCrc32 = false, "file.bypassPatchCrc32");
attach(path.rom = "", "path.rom");
attach(path.save = "", "path.save");

View File

@ -16,7 +16,6 @@ public:
struct File {
bool applyPatches;
bool bypassPatchCrc32;
} file;
struct DiskBrowser {