Update to v093r06 release.

byuu says:

Changelog:
- Windows port should compile out-of-the-box
- InputManager::scancode[] initialized at startup
- Library menu shows item for each bootable media type (notably Game Boy
  Color)
- Display Emulation menu selection fix
- LibraryManager load button works now
- Added hotkey to show library manager (defaults to L)
- Added color emulation to video settings (missing on GBA for now)
- SFC loading SGB without GB cartridge no longer segfaults
- GB/GBC system.load() after cartridge.load()
- GB/GBC BG-over-OAM fix
- GB/GBC disallow up+down and left+right
This commit is contained in:
Tim Allen
2013-12-07 20:12:37 +11:00
parent ed4e87f65e
commit 35f1605829
51 changed files with 308 additions and 172 deletions

View File

@@ -85,7 +85,7 @@ private:
inline bool directory::remove(const string& pathname) {
lstring list = directory::contents(pathname);
for(auto& name : list) {
if(name.endswith("/")) directory::remove({pathname, name});
if(name.endsWith("/")) directory::remove({pathname, name});
else file::remove({pathname, name});
}
return _wrmdir(utf16_t(pathname)) == 0;

View File

@@ -86,7 +86,7 @@ inline void library::close() {
#elif defined(PLATFORM_WINDOWS)
inline bool library::open(const string& name, const string& path) {
if(handle) close();
string filepath(path, !path.empty() && !path.endswith("/") && !path.endsWith("\\") ? "/" : "", name, ".dll");
string filepath(path, !path.empty() && !path.endsWith("/") && !path.endsWith("\\") ? "/" : "", name, ".dll");
handle = (uintptr_t)LoadLibraryW(utf16_t(filepath));
return handle;
}

View File

@@ -17,9 +17,9 @@ struct image {
unsigned pitch = 0;
unsigned size = 0;
bool endian = 0; //0 = lsb, 1 = msb
bool endian = 0; //0 = lsb, 1 = msb
unsigned depth = 32;
unsigned stride = 4;
unsigned stride = 4;
struct Channel {
uint64_t mask;
@@ -511,7 +511,7 @@ void image::scaleLinearWidth(unsigned outputWidth) {
sp += stride;
unsigned x = 0;
while(x < outputWidth) {
while(true) {
while(xfraction < 0x100000000 && x++ < outputWidth) {
uint64_t A = interpolate1D((a & alpha.mask) >> alpha.shift, (b & alpha.mask) >> alpha.shift, xfraction);
uint64_t R = interpolate1D((a & red.mask ) >> red.shift , (b & red.mask ) >> red.shift, xfraction);
@@ -522,6 +522,7 @@ void image::scaleLinearWidth(unsigned outputWidth) {
dp += stride;
xfraction += xstride;
}
if(x >= outputWidth) break;
sp += stride;
a = b;
@@ -553,7 +554,7 @@ void image::scaleLinearHeight(unsigned outputHeight) {
sp += pitch;
unsigned y = 0;
while(y < outputHeight) {
while(true) {
while(yfraction < 0x100000000 && y++ < outputHeight) {
uint64_t A = interpolate1D((a & alpha.mask) >> alpha.shift, (b & alpha.mask) >> alpha.shift, yfraction);
uint64_t R = interpolate1D((a & red.mask ) >> red.shift, (b & red.mask ) >> red.shift, yfraction);
@@ -564,6 +565,7 @@ void image::scaleLinearHeight(unsigned outputHeight) {
dp += pitch;
yfraction += ystride;
}
if(y >= outputHeight) break;
sp += pitch;
a = b;
@@ -600,7 +602,7 @@ void image::scaleLinear(unsigned outputWidth, unsigned outputHeight) {
sp += stride;
unsigned x = 0;
while(x < outputWidth) {
while(true) {
while(xfraction < 0x100000000 && x++ < outputWidth) {
uint64_t A = interpolate2D((a & alpha.mask) >> alpha.shift, (b & alpha.mask) >> alpha.shift, (c & alpha.mask) >> alpha.shift, (d & alpha.mask) >> alpha.shift, xfraction, yfraction);
uint64_t R = interpolate2D((a & red.mask ) >> red.shift, (b & red.mask ) >> red.shift, (c & red.mask ) >> red.shift, (d & red.mask ) >> red.shift, xfraction, yfraction);
@@ -611,6 +613,7 @@ void image::scaleLinear(unsigned outputWidth, unsigned outputHeight) {
dp += stride;
xfraction += xstride;
}
if(x >= outputWidth) break;
sp += stride;
a = b;
@@ -647,12 +650,13 @@ void image::scaleNearest(unsigned outputWidth, unsigned outputHeight) {
uint64_t a = read(sp);
unsigned x = 0;
while(x < outputWidth) {
while(true) {
while(xfraction < 0x100000000 && x++ < outputWidth) {
write(dp, a);
dp += stride;
xfraction += xstride;
}
if(x >= outputWidth) break;
sp += stride;
a = read(sp);