Update to v068r25 release.

byuu says:

This is basically the v069 release candidate, heavy testing would really
be appreciated. I'd like for v070 to be the first official phoenix
release, but if a major bug slips past us that will ruin it.

The big change is that save state support was added to the
PPU-performance core.
This commit is contained in:
Tim Allen 2010-09-24 23:18:09 +10:00
parent d0d8c2a921
commit 4525d00eba
10 changed files with 236 additions and 32 deletions

View File

@ -1,6 +1,6 @@
include nall/Makefile
snes := snes
profile := accuracy
profile := performance
ui := ui-qt
# compiler

View File

@ -7,34 +7,6 @@
#include <nall/string.hpp>
using namespace nall;
#if !defined(PLATFORM_WIN)
char* userpath(char *path) {
*path = 0;
struct passwd *userinfo = getpwuid(getuid());
if(userinfo) strcpy(path, userinfo->pw_dir);
return path;
}
#else
#include <nall/utf8.hpp>
#include <process.h>
#include <wchar.h>
#include <windows.h>
char* realpath(const char *filename, char *resolvedname) {
wchar_t fn[PATH_MAX] = L"";
_wfullpath(fn, nall::utf16_t(filename), PATH_MAX);
strcpy(resolvedname, nall::utf8_t(fn));
return resolvedname;
}
char* userpath(char *path) {
wchar_t fp[PATH_MAX] = L"";
SHGetFolderPathW(0, CSIDL_APPDATA | CSIDL_FLAG_CREATE, 0, 0, fp);
strcpy(path, nall::utf8_t(fp));
return path;
}
#endif
int main(int argc, char **argv) {
char path[PATH_MAX], *unused;
#if !defined(PLATFORM_WIN)

View File

@ -57,6 +57,7 @@ class Background {
void render();
void render_mode7();
void serialize(serializer&);
Background(PPU &self, unsigned id);
~Background();

View File

@ -8,6 +8,7 @@ public:
uint8* tile_8bpp(unsigned tile);
uint8* tile(unsigned bpp, unsigned tile);
void serialize(serializer&);
Cache(PPU &self);
PPU &self;

View File

@ -35,6 +35,8 @@ class Screen {
alwaysinline uint16 get_pixel_main(unsigned x);
alwaysinline uint16 get_pixel_sub(unsigned x);
void render();
void serialize(serializer&);
Screen(PPU &self);
~Screen();

View File

@ -13,7 +13,231 @@ void PPUcounter::serialize(serializer &s) {
}
void PPU::serialize(serializer &s) {
Processor::serialize(s);
PPUcounter::serialize(s);
cache.serialize(s);
bg1.serialize(s);
bg2.serialize(s);
bg3.serialize(s);
bg4.serialize(s);
oam.serialize(s);
screen.serialize(s);
s.integer(display.width);
s.integer(display.height);
s.integer(regs.ppu1_mdr);
s.integer(regs.ppu2_mdr);
s.integer(regs.vram_readbuffer);
s.integer(regs.oam_latchdata);
s.integer(regs.cgram_latchdata);
s.integer(regs.bgofs_latchdata);
s.integer(regs.mode7_latchdata);
s.integer(regs.counters_latched);
s.integer(regs.latch_hcounter);
s.integer(regs.latch_vcounter);
s.integer(regs.display_disable);
s.integer(regs.display_brightness);
s.integer(regs.oam_baseaddr);
s.integer(regs.oam_addr);
s.integer(regs.oam_priority);
s.integer(regs.bg3_priority);
s.integer(regs.bgmode);
s.integer(regs.mode7_hoffset);
s.integer(regs.mode7_voffset);
s.integer(regs.vram_incmode);
s.integer(regs.vram_mapping);
s.integer(regs.vram_incsize);
s.integer(regs.vram_addr);
s.integer(regs.mode7_repeat);
s.integer(regs.mode7_vflip);
s.integer(regs.mode7_hflip);
s.integer(regs.m7a);
s.integer(regs.m7b);
s.integer(regs.m7c);
s.integer(regs.m7d);
s.integer(regs.m7x);
s.integer(regs.m7y);
s.integer(regs.cgram_addr);
s.integer(regs.window_one_left);
s.integer(regs.window_one_right);
s.integer(regs.window_two_left);
s.integer(regs.window_two_right);
s.integer(regs.mode7_extbg);
s.integer(regs.pseudo_hires);
s.integer(regs.overscan);
s.integer(regs.interlace);
s.integer(regs.hcounter);
s.integer(regs.vcounter);
}
void PPU::Cache::serialize(serializer &s) {
//rather than save ~512KB worth of cached tiledata, invalidate it all
for(unsigned i = 0; i < 4096; i++) tilevalid[0][i] = false;
for(unsigned i = 0; i < 2048; i++) tilevalid[1][i] = false;
for(unsigned i = 0; i < 1024; i++) tilevalid[2][i] = false;
}
void PPU::Background::serialize(serializer &s) {
s.integer(regs.mode);
s.integer(regs.priority0);
s.integer(regs.priority1);
s.integer(regs.tile_size);
s.integer(regs.mosaic);
s.integer(regs.screen_addr);
s.integer(regs.screen_size);
s.integer(regs.tiledata_addr);
s.integer(regs.hoffset);
s.integer(regs.voffset);
s.integer(regs.main_enable);
s.integer(regs.sub_enable);
s.integer(y);
s.integer(hires);
s.integer(width);
s.integer(tile_width);
s.integer(tile_height);
s.integer(mask_x);
s.integer(mask_y);
s.integer(scx);
s.integer(scy);
s.integer(hscroll);
s.integer(vscroll);
s.integer(mosaic_vcounter);
window.serialize(s);
}
void PPU::Sprite::serialize(serializer &s) {
s.integer(regs.priority0);
s.integer(regs.priority1);
s.integer(regs.priority2);
s.integer(regs.priority3);
s.integer(regs.base_size);
s.integer(regs.nameselect);
s.integer(regs.tiledata_addr);
s.integer(regs.first_sprite);
s.integer(regs.main_enable);
s.integer(regs.sub_enable);
s.integer(regs.interlace);
s.integer(regs.time_over);
s.integer(regs.range_over);
for(unsigned i = 0; i < 128; i++) {
s.integer(list[i].width);
s.integer(list[i].height);
s.integer(list[i].x);
s.integer(list[i].y);
s.integer(list[i].character);
s.integer(list[i].use_nameselect);
s.integer(list[i].vflip);
s.integer(list[i].hflip);
s.integer(list[i].palette);
s.integer(list[i].priority);
s.integer(list[i].size);
}
s.integer(list_valid);
s.array(itemlist);
for(unsigned i = 0; i < 34; i++) {
s.integer(tilelist[i].x);
s.integer(tilelist[i].y);
s.integer(tilelist[i].priority);
s.integer(tilelist[i].palette);
s.integer(tilelist[i].tile);
s.integer(tilelist[i].hflip);
}
s.array(output.palette);
s.array(output.priority);
window.serialize(s);
}
void PPU::Screen::serialize(serializer &s) {
s.integer(regs.addsub_mode);
s.integer(regs.direct_color);
s.integer(regs.color_mode);
s.integer(regs.color_halve);
s.array(regs.color_enable);
s.integer(regs.color_b);
s.integer(regs.color_g);
s.integer(regs.color_r);
s.integer(regs.color);
for(unsigned i = 0; i < 256; i++) {
s.integer(output.main[i].color);
s.integer(output.main[i].priority);
s.integer(output.main[i].source);
s.integer(output.sub[i].color);
s.integer(output.sub[i].priority);
s.integer(output.sub[i].source);
}
window.serialize(s);
}
void PPU::LayerWindow::serialize(serializer &s) {
s.integer(one_enable);
s.integer(one_invert);
s.integer(two_enable);
s.integer(two_invert);
s.integer(mask);
s.integer(main_enable);
s.integer(sub_enable);
s.array(main);
s.array(sub);
}
void PPU::ColorWindow::serialize(serializer &s) {
s.integer(one_enable);
s.integer(one_invert);
s.integer(two_enable);
s.integer(two_invert);
s.integer(mask);
s.integer(main_mask);
s.integer(sub_mask);
s.array(main);
s.array(sub);
}
#endif

View File

@ -62,6 +62,8 @@ class Sprite {
void set_first();
alwaysinline bool on_scanline(unsigned sprite);
void render();
void serialize(serializer&);
Sprite(PPU &self);
PPU &self;

View File

@ -14,6 +14,7 @@ public:
uint8 sub[256];
void render(bool screen);
void serialize(serializer&);
};
class ColorWindow {
@ -32,4 +33,5 @@ public:
uint8 sub[256];
void render(bool screen);
void serialize(serializer&);
};

View File

@ -1,7 +1,7 @@
namespace SNES {
namespace Info {
static const char Name[] = "bsnes";
static const char Version[] = "068.24";
static const char Version[] = "068.25";
static const unsigned SerializerVersion = 13;
}
}

View File

@ -1,2 +1,2 @@
1 24 "qt/data/bsnes.Manifest"
IDI_ICON1 ICON DISCARDABLE "qt/data/bsnes.ico"
1 24 "ui-qt/data/bsnes.Manifest"
IDI_ICON1 ICON DISCARDABLE "ui-qt/data/bsnes.ico"