Update to v088r16 release.

byuu says:

Changelog:
- fixed BGnxOFS to not cache when MOSAIC is not in effect [fixes Air
  Strike Patrol "Good Luck" text]
- added GameBoy::Interface::Hook for SGB bindings [SGB works again]
- do not create bsnes/ folder unless it is absolutely needed (eg you
  create a save state or state manager archive)
- SuperFX works [needed to call system.init() in Interface::Interface()]

Last chance for any bug reports, at this point I pretty much consider
ethos to be finished. It's shipping without BS-X BIOS game loading
support. Sorry, I can't figure that one out.
This commit is contained in:
Tim Allen 2012-05-10 09:35:29 +10:00
parent 689fc49047
commit c3f9d421da
25 changed files with 66 additions and 43 deletions

View File

@ -3,7 +3,7 @@
namespace Emulator {
static const char Name[] = "bsnes";
static const char Version[] = "088.15";
static const char Version[] = "088.16";
static const char Author[] = "byuu";
static const char License[] = "GPLv3";
}

View File

@ -4,6 +4,14 @@ namespace GameBoy {
Interface *interface = nullptr;
void Interface::lcdScanline() {
if(hook) hook->lcdScanline();
}
void Interface::joypWrite(bool p15, bool p14) {
if(hook) hook->joypWrite(p15, p14);
}
double Interface::videoFrequency() {
return 4194304.0 / (154.0 * 456.0);
}
@ -97,6 +105,7 @@ void Interface::updatePalette() {
Interface::Interface() {
interface = this;
hook = nullptr;
information.name = "Game Boy";
information.width = 160;

View File

@ -19,8 +19,13 @@ struct ID {
struct Interface : Emulator::Interface {
//Super Game Boy bindings
struct Hook {
virtual void lcdScanline() {}
virtual void joypWrite(bool p15, bool p14) {}
} *hook;
void lcdScanline();
void joypWrite(bool p15, bool p14);
double videoFrequency();
double audioFrequency();

View File

@ -1,6 +1,6 @@
//ARMv3 (ARM6)
struct ArmDSP : Processor::ARM, public Coprocessor {
struct ArmDSP : Processor::ARM, Coprocessor {
uint8 *firmware;
uint8 *programROM;
uint8 *dataROM;

View File

@ -8,11 +8,11 @@ void BSXCartridge::init() {
void BSXCartridge::load() {
sram.map(allocate<uint8>(32 * 1024, 0xff), 32 * 1024);
sram.write_protect(false);
interface->memory.append({ID::BsxRAM, "bsx.ram"});
interface->memory.append({ID::BsxRAM, "save.ram"});
psram.map(allocate<uint8>(512 * 1024, 0xff), 512 * 1024);
psram.write_protect(false);
interface->memory.append({ID::BsxPSRAM, "bsx.psram"});
interface->memory.append({ID::BsxPSRAM, "bsx.ram"});
}
void BSXCartridge::unload() {

View File

@ -1,5 +1,4 @@
class BSXCartridge {
public:
struct BSXCartridge {
MappedRAM sram;
MappedRAM psram;

View File

@ -1,5 +1,4 @@
class BSXFlash : public Memory {
public:
struct BSXFlash : Memory {
MappedRAM memory;
void init();

View File

@ -1,5 +1,4 @@
class BSXSatellaview {
public:
struct BSXSatellaview {
void init();
void load();
void unload();

View File

@ -33,12 +33,15 @@ void ICD2::init() {
}
void ICD2::load() {
interface = GameBoy::interface->bind;
bind = GameBoy::interface->bind;
hook = GameBoy::interface->hook;
GameBoy::interface->bind = this;
GameBoy::interface->hook = this;
}
void ICD2::unload() {
GameBoy::interface->bind = interface;
GameBoy::interface->bind = bind;
GameBoy::interface->hook = hook;
}
void ICD2::power() {
@ -56,7 +59,7 @@ void ICD2::reset() {
r6005 = 0xff;
r6006 = 0xff;
r6007 = 0xff;
for(unsigned n = 0; n < 16; n++) r7000[n] = 0x00;
for(auto &r : r7000) r = 0x00;
r7800 = 0x0000;
mlt_req = 0;

View File

@ -1,4 +1,4 @@
struct ICD2 : Emulator::Interface::Bind, Coprocessor {
struct ICD2 : Emulator::Interface::Bind, GameBoy::Interface::Hook, Coprocessor {
unsigned revision;
static void Enter();
@ -16,7 +16,8 @@ struct ICD2 : Emulator::Interface::Bind, Coprocessor {
void serialize(serializer&);
private:
Emulator::Interface::Bind *interface;
Emulator::Interface::Bind *bind;
GameBoy::Interface::Hook *hook;
#include "interface/interface.hpp"
#include "mmio/mmio.hpp"
};

View File

@ -1,5 +1,4 @@
class Link : public Coprocessor, public library {
public:
struct Link : Coprocessor, library {
string program;
static void Enter();

View File

@ -1,5 +1,4 @@
class MSU1 : public Coprocessor {
public:
struct MSU1 : Coprocessor {
static void Enter();
void enter();
void init();

View File

@ -1,5 +1,4 @@
class OBC1 {
public:
struct OBC1 {
void init();
void load();
void unload();

View File

@ -1,5 +1,4 @@
class SDD1 {
public:
struct SDD1 {
void init();
void load();
void unload();

View File

@ -1,8 +1,7 @@
//SPC7110 emulator - version 0.05 (2011-06-27)
//Copyright (c) 2008-2011, byuu and neviksti
class SPC7110 {
public:
struct SPC7110 {
uint8 rtc[20];
unsigned data_rom_offset;

View File

@ -1,5 +1,4 @@
class SRTC {
public:
struct SRTC {
uint8 rtc[20];
void init();

View File

@ -1,5 +1,4 @@
class SufamiTurbo {
public:
struct SufamiTurbo {
struct Slot {
MappedRAM rom;
MappedRAM ram;

View File

@ -228,6 +228,7 @@ void Interface::updatePalette() {
Interface::Interface() {
interface = this;
system.init();
information.name = "Super Famicom";
information.width = 256;

View File

@ -2,6 +2,16 @@
#include "mode7.cpp"
unsigned PPU::Background::voffset() const {
if(regs.mosaic) return cache.voffset;
return regs.voffset;
}
unsigned PPU::Background::hoffset() const {
if(regs.mosaic) return cache.hoffset;
return regs.hoffset;
}
//V = 0, H = 0
void PPU::Background::frame() {
}
@ -10,7 +20,7 @@ void PPU::Background::frame() {
void PPU::Background::scanline() {
}
//H = 60
//H = 28
void PPU::Background::begin() {
bool hires = (self.regs.bgmode == 5 || self.regs.bgmode == 6);
x = -7;
@ -65,8 +75,8 @@ void PPU::Background::get_tile() {
unsigned px = x << hires;
unsigned py = (regs.mosaic == 0 ? y : mosaic.voffset);
unsigned hscroll = cache.hoffset;
unsigned vscroll = cache.voffset;
unsigned hscroll = hoffset();
unsigned vscroll = voffset();
if(hires) {
hscroll <<= 1;
if(self.regs.interlace) py = (py << 1) + self.field();
@ -79,8 +89,8 @@ void PPU::Background::get_tile() {
uint16 offset_x = (x + (hscroll & 7));
if(offset_x >= 8) {
unsigned hval = self.bg3.get_tile((offset_x - 8) + (self.bg3.cache.hoffset & ~7), self.bg3.cache.voffset + 0);
unsigned vval = self.bg3.get_tile((offset_x - 8) + (self.bg3.cache.hoffset & ~7), self.bg3.cache.voffset + 8);
unsigned hval = self.bg3.get_tile((offset_x - 8) + (self.bg3.hoffset() & ~7), self.bg3.voffset() + 0);
unsigned vval = self.bg3.get_tile((offset_x - 8) + (self.bg3.hoffset() & ~7), self.bg3.voffset() + 8);
unsigned valid_mask = (id == ID::BG1 ? 0x2000 : 0x4000);
if(self.regs.bgmode == 4) {

View File

@ -30,6 +30,9 @@ struct Background {
uint16 voffset;
} cache;
unsigned voffset() const;
unsigned hoffset() const;
struct Output {
struct Pixel {
unsigned priority; //0 = none (transparent)

View File

@ -5,7 +5,7 @@ signed PPU::Background::clip(signed n) {
return n & 0x2000 ? (n | ~1023) : (n & 1023);
}
//H = 60
//H = 28
void PPU::Background::begin_mode7() {
cache.hoffset = self.regs.mode7_hoffset;
cache.voffset = self.regs.mode7_voffset;

View File

@ -124,7 +124,7 @@ string Browser::select(const string &title, const string &extension) {
if(path.empty()) path = application->basepath;
setPath(path, selection);
filterLabel.setText({"Files of type: *.", extension});
filterLabel.setText({"Filter: *.", extension});
audio.clear();
setTitle(title);

View File

@ -101,6 +101,8 @@ bool StateManager::save(const string &filename, unsigned revision) {
return true;
}
directory::create(dir(filename));
file fp;
if(fp.open(filename, file::mode::write) == false) return false;

View File

@ -68,7 +68,6 @@ void Utility::saveMemory() {
system().save(memory.id, fs);
}
directory::create({pathname[0], "bsnes/"});
cheatEditor->save({pathname[0], "cheats.xml"});
stateManager->save({pathname[0], "bsnes/states.bsa"}, 1);
}
@ -138,9 +137,9 @@ void Utility::saveState(unsigned slot) {
void Utility::loadState(unsigned slot) {
if(application->active == nullptr) return;
auto memory = file::read({pathname[0], "bsnes/state-", slot, ".bsa"});
if(memory.size() == 0) return;
if(memory.size() == 0) return showMessage({"Unable to locate slot ", slot, " state"});
serializer s(memory.data(), memory.size());
if(system().unserialize(s) == false) return;
if(system().unserialize(s) == false) return showMessage({"Slot ", slot, " state incompatible"});
showMessage({"Loaded from slot ", slot});
}