mirror of https://github.com/bsnes-emu/bsnes.git
Update to v103 WIP release.
byuu says (in the WIP forum): Changelog: - higan: cheat codes accept = and ? separators now - the new preferred code format is: address=value or address=if-match?value - the old code format of address/value and address/if-match/value will continue to work - higan: cheats.bml is no longer included with the base distribution - mightymo stopped updating it in 2015, and it's not source code; it can still be pulled in from older releases - fc: improved PAL mode timing; use PAL APU timing tables; fix PAL noise period table [hex\_usr] - md: support aborting a Z80 bus wait in order to capture save states without freezing - note that this will violate accuracy; but in practice a slight desync is better than an emulator deadlock - sfc: revert DSP ENDX randomization for now (want to research it more before deploying in an official release) - sfc: fix Super Famicom.sys/manifest.bml APU RAM size [hex\_usr] - tomoko: cleaned up make install rules - hiro/cocoa: use ABGR for pixel data [Sintendo] Note: I forgot to change the command-line and drag-and-drop separator from : to | in this WIP. However, it is corrected in the v103 official binary and source published on download.byuu.org. Sorry about that, I know it makes the Git repository history more difficult. I'm not concerned whether the : → | change is part of v103 or v103r01 in the repository, and will leave this to your discretion, Screwtape. I also still need to set the VDP bit to indicate PAL mode in the Mega Drive core. This is what happens when I have 47 things I have to do, given how lousy my memory is. I miss things.
This commit is contained in:
parent
8476f35153
commit
b7006822bf
87497
higan/data/cheats.bml
87497
higan/data/cheats.bml
File diff suppressed because it is too large
Load Diff
|
@ -25,7 +25,7 @@ struct Cheat {
|
|||
reset();
|
||||
for(auto& entry : list) {
|
||||
for(auto code : entry.split("+")) {
|
||||
auto part = code.split("/");
|
||||
auto part = code.transform("=?", "//").split("/");
|
||||
if(part.size() == 2) append(part[0].hex(), part[1].hex());
|
||||
if(part.size() == 3) append(part[0].hex(), part[2].hex(), part[1].hex());
|
||||
}
|
||||
|
|
|
@ -12,13 +12,13 @@ using namespace nall;
|
|||
|
||||
namespace Emulator {
|
||||
static const string Name = "higan";
|
||||
static const string Version = "102.28";
|
||||
static const string Version = "103";
|
||||
static const string Author = "byuu";
|
||||
static const string License = "GPLv3";
|
||||
static const string Website = "http://byuu.org/";
|
||||
|
||||
//incremented only when serialization format changes
|
||||
static const string SerializerVersion = "102.25";
|
||||
static const string SerializerVersion = "103";
|
||||
|
||||
namespace Constants {
|
||||
namespace Colorburst {
|
||||
|
|
|
@ -59,7 +59,7 @@ auto APU::main() -> void {
|
|||
}
|
||||
|
||||
auto APU::tick() -> void {
|
||||
Thread::step(12);
|
||||
Thread::step(rate());
|
||||
synchronize(cpu);
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,8 @@ auto APU::setSample(int16 sample) -> void {
|
|||
}
|
||||
|
||||
auto APU::power() -> void {
|
||||
create(APU::Enter, system.colorburst() * 6.0);
|
||||
stream = Emulator::audio.createStream(1, frequency() / 12.0);
|
||||
create(APU::Enter, system.frequency());
|
||||
stream = Emulator::audio.createStream(1, frequency() / rate());
|
||||
stream->addLowPassFilter(20000.0, 3);
|
||||
stream->addHighPassFilter(20.0, 3);
|
||||
|
||||
|
@ -303,7 +303,7 @@ const uint16 APU::noisePeriodTableNTSC[16] = {
|
|||
};
|
||||
|
||||
const uint16 APU::noisePeriodTablePAL[16] = {
|
||||
4, 7, 14, 30, 60, 88, 118, 148, 188, 236, 354, 472, 708, 944, 1890, 3778,
|
||||
4, 8, 14, 30, 60, 88, 118, 148, 188, 236, 354, 472, 708, 944, 1890, 3778,
|
||||
};
|
||||
|
||||
const uint16 APU::dmcPeriodTableNTSC[16] = {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
struct APU : Thread {
|
||||
shared_pointer<Emulator::Stream> stream;
|
||||
|
||||
inline auto rate() const -> uint { return Region::NTSC() ? 12 : 16; }
|
||||
|
||||
//apu.cpp
|
||||
APU();
|
||||
|
||||
static auto Enter() -> void;
|
||||
|
@ -14,6 +17,7 @@ struct APU : Thread {
|
|||
auto readIO(uint16 addr) -> uint8;
|
||||
auto writeIO(uint16 addr, uint8 data) -> void;
|
||||
|
||||
//serialization.cpp
|
||||
auto serialize(serializer&) -> void;
|
||||
|
||||
struct Envelope {
|
||||
|
|
|
@ -57,7 +57,7 @@ auto APU::DMC::clock() -> uint8 {
|
|||
}
|
||||
}
|
||||
|
||||
periodCounter = dmcPeriodTableNTSC[period];
|
||||
periodCounter = Region::NTSC() ? dmcPeriodTableNTSC[period] : dmcPeriodTablePAL[period];
|
||||
}
|
||||
|
||||
if(lengthCounter > 0 && !dmaBufferValid && dmaDelayCounter == 0) {
|
||||
|
@ -73,7 +73,7 @@ auto APU::DMC::power() -> void {
|
|||
irqPending = 0;
|
||||
|
||||
period = 0;
|
||||
periodCounter = dmcPeriodTableNTSC[0];
|
||||
periodCounter = Region::NTSC() ? dmcPeriodTableNTSC[0] : dmcPeriodTablePAL[0];
|
||||
irqEnable = 0;
|
||||
loopMode = 0;
|
||||
dacLatch = 0;
|
||||
|
|
|
@ -19,7 +19,7 @@ auto APU::Noise::clock() -> uint8 {
|
|||
}
|
||||
|
||||
lfsr = (lfsr >> 1) | (feedback << 14);
|
||||
periodCounter = apu.noisePeriodTableNTSC[period];
|
||||
periodCounter = Region::NTSC() ? apu.noisePeriodTableNTSC[period] : apu.noisePeriodTablePAL[period];
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -109,12 +109,12 @@ auto Board::mirror(uint addr, uint size) -> uint {
|
|||
}
|
||||
|
||||
auto Board::main() -> void {
|
||||
cartridge.step(12 * 4095);
|
||||
cartridge.step(cartridge.rate() * 4095);
|
||||
tick();
|
||||
}
|
||||
|
||||
auto Board::tick() -> void {
|
||||
cartridge.step(12);
|
||||
cartridge.step(cartridge.rate());
|
||||
cartridge.synchronize(cpu);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace Famicom {
|
|||
|
||||
#include "chip/chip.cpp"
|
||||
#include "board/board.cpp"
|
||||
#include "serialization.cpp"
|
||||
Cartridge cartridge;
|
||||
|
||||
auto Cartridge::Enter() -> void {
|
||||
|
@ -46,7 +47,7 @@ auto Cartridge::unload() -> void {
|
|||
}
|
||||
|
||||
auto Cartridge::power() -> void {
|
||||
create(Cartridge::Enter, system.colorburst() * 6.0);
|
||||
create(Cartridge::Enter, system.frequency());
|
||||
board->power();
|
||||
}
|
||||
|
||||
|
@ -70,9 +71,4 @@ auto Cartridge::scanline(uint y) -> void {
|
|||
return board->scanline(y);
|
||||
}
|
||||
|
||||
auto Cartridge::serialize(serializer& s) -> void {
|
||||
Thread::serialize(s);
|
||||
return board->serialize(s);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
#include "board/board.hpp"
|
||||
|
||||
struct Cartridge : Thread {
|
||||
inline auto rate() const -> uint { return Region::NTSC() ? 12 : 16; }
|
||||
|
||||
//cartridge.cpp
|
||||
static auto Enter() -> void;
|
||||
auto main() -> void;
|
||||
|
||||
|
@ -17,6 +20,7 @@ struct Cartridge : Thread {
|
|||
|
||||
auto power() -> void;
|
||||
|
||||
//serialization.cpp
|
||||
auto serialize(serializer&) -> void;
|
||||
|
||||
struct Information {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
auto Cartridge::serialize(serializer& s) -> void {
|
||||
Thread::serialize(s);
|
||||
return board->serialize(s);
|
||||
}
|
|
@ -27,7 +27,7 @@ auto CPU::step(uint clocks) -> void {
|
|||
auto CPU::power() -> void {
|
||||
MOS6502::BCD = 0;
|
||||
MOS6502::power();
|
||||
create(CPU::Enter, system.colorburst() * 6.0);
|
||||
create(CPU::Enter, system.frequency());
|
||||
|
||||
for(auto addr : range(0x0800)) ram[addr] = 0xff;
|
||||
ram[0x0008] = 0xf7;
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
struct CPU : Processor::MOS6502, Thread {
|
||||
inline auto rate() const -> uint { return Region::NTSC() ? 12 : 16; }
|
||||
|
||||
//cpu.cpp
|
||||
static auto Enter() -> void;
|
||||
auto main() -> void;
|
||||
auto step(uint clocks) -> void;
|
||||
|
|
|
@ -7,17 +7,17 @@ auto CPU::read(uint16 addr) -> uint8 {
|
|||
|
||||
while(io.rdyLine == 0) {
|
||||
r.mdr = bus.read(io.rdyAddrValid ? io.rdyAddrValue : addr);
|
||||
step(12);
|
||||
step(rate());
|
||||
}
|
||||
|
||||
r.mdr = bus.read(addr);
|
||||
step(12);
|
||||
step(rate());
|
||||
return r.mdr;
|
||||
}
|
||||
|
||||
auto CPU::write(uint16 addr, uint8 data) -> void {
|
||||
bus.write(addr, r.mdr = data);
|
||||
step(12);
|
||||
step(rate());
|
||||
}
|
||||
|
||||
auto CPU::lastCycle() -> void {
|
||||
|
|
|
@ -29,7 +29,7 @@ auto PPU::step(uint clocks) -> void {
|
|||
if(io.ly == L-1 && io.lx == 0) io.nmiFlag = io.nmiHold;
|
||||
if(io.ly == L-1 && io.lx == 2) cpu.nmiLine(io.nmiEnable && io.nmiFlag);
|
||||
|
||||
Thread::step(4);
|
||||
Thread::step(rate());
|
||||
synchronize(cpu);
|
||||
|
||||
io.lx++;
|
||||
|
@ -55,7 +55,7 @@ auto PPU::refresh() -> void {
|
|||
}
|
||||
|
||||
auto PPU::power() -> void {
|
||||
create(PPU::Enter, system.colorburst() * 6.0);
|
||||
create(PPU::Enter, system.frequency());
|
||||
|
||||
memory::fill(&io, sizeof(IO));
|
||||
memory::fill(&latch, sizeof(Latches));
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
struct PPU : Thread {
|
||||
inline auto rate() const -> uint { return Region::NTSC() ? 4 : 5; }
|
||||
inline auto vlines() const -> uint { return Region::NTSC() ? 262 : 312; }
|
||||
|
||||
//ppu.cpp
|
||||
|
|
|
@ -34,11 +34,11 @@ auto System::load(Emulator::Interface* interface) -> bool {
|
|||
|
||||
if(cartridge.region() == "NTSC") {
|
||||
information.region = Region::NTSC;
|
||||
information.colorburst = Emulator::Constants::Colorburst::NTSC;
|
||||
information.frequency = Emulator::Constants::Colorburst::NTSC * 6.0;
|
||||
}
|
||||
if(cartridge.region() == "PAL") {
|
||||
information.region = Region::PAL;
|
||||
information.colorburst = Emulator::Constants::Colorburst::PAL * 4.0 / 5.0;
|
||||
information.frequency = Emulator::Constants::Colorburst::PAL * 6.0;
|
||||
}
|
||||
|
||||
this->interface = interface;
|
||||
|
|
|
@ -3,7 +3,7 @@ struct System {
|
|||
|
||||
auto loaded() const -> bool { return information.loaded; }
|
||||
auto region() const -> Region { return information.region; }
|
||||
auto colorburst() const -> double { return information.colorburst; }
|
||||
auto frequency() const -> double { return information.frequency; }
|
||||
|
||||
auto run() -> void;
|
||||
auto runToSave() -> void;
|
||||
|
@ -34,7 +34,7 @@ private:
|
|||
struct Information {
|
||||
bool loaded = false;
|
||||
Region region = Region::NTSC;
|
||||
double colorburst = Emulator::Constants::Colorburst::NTSC;
|
||||
double frequency = Emulator::Constants::Colorburst::NTSC * 6.0;
|
||||
string manifest;
|
||||
} information;
|
||||
|
||||
|
|
|
@ -32,6 +32,10 @@ auto APU::step(uint clocks) -> void {
|
|||
synchronize(cpu);
|
||||
}
|
||||
|
||||
auto APU::synchronizing() const -> bool {
|
||||
return scheduler.synchronizing();
|
||||
}
|
||||
|
||||
auto APU::setNMI(bool value) -> void {
|
||||
state.nmiLine = value;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
struct APU : Processor::Z80, Thread {
|
||||
static auto Enter() -> void;
|
||||
auto main() -> void;
|
||||
auto step(uint clocks) -> void;
|
||||
auto step(uint clocks) -> void override;
|
||||
auto synchronizing() const -> bool override;
|
||||
|
||||
auto enable(bool) -> void;
|
||||
auto power() -> void;
|
||||
|
|
|
@ -30,6 +30,10 @@ auto CPU::step(uint clocks) -> void {
|
|||
for(auto peripheral : peripherals) synchronize(*peripheral);
|
||||
}
|
||||
|
||||
auto CPU::synchronizing() const -> bool {
|
||||
return scheduler.synchronizing();
|
||||
}
|
||||
|
||||
//called once per frame
|
||||
auto CPU::pollPause() -> void {
|
||||
if(Model::MasterSystem()) {
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
struct CPU : Processor::Z80, Thread {
|
||||
static auto Enter() -> void;
|
||||
auto main() -> void;
|
||||
auto step(uint clocks) -> void;
|
||||
auto step(uint clocks) -> void override;
|
||||
auto synchronizing() const -> bool override;
|
||||
|
||||
auto pollPause() -> void;
|
||||
auto setNMI(bool value) -> void;
|
||||
|
|
|
@ -2,7 +2,7 @@ auto Z80::yield() -> void {
|
|||
//freeze Z80, allow external access until relinquished
|
||||
if(bus->requested()) {
|
||||
bus->grant(true);
|
||||
while(bus->requested()) step(1);
|
||||
while(bus->requested() && !synchronizing()) step(1);
|
||||
bus->grant(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ struct Z80 {
|
|||
};
|
||||
|
||||
virtual auto step(uint clocks) -> void = 0;
|
||||
virtual auto synchronizing() const -> bool = 0;
|
||||
|
||||
//z80.cpp
|
||||
auto power() -> void;
|
||||
|
|
|
@ -249,7 +249,6 @@ auto DSP::power() -> void {
|
|||
//note: memory is pseudo-random at startup; but internal state is less so
|
||||
//exact differences are unknown. need to separate memory from internal state
|
||||
for(auto r : range(0x80)) REG(r) = 0x00;
|
||||
REG(ENDX) = random(0x00);
|
||||
REG(FLG) = 0xe0;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,4 +9,4 @@ system name:Super Famicom
|
|||
ppu2 version=3
|
||||
ram name=palette.ram size=512 volatile
|
||||
dsp
|
||||
ram name=apu.ram size=0x20000 volatile
|
||||
ram name=apu.ram size=0x10000 volatile
|
||||
|
|
|
@ -85,17 +85,16 @@ else ifeq ($(platform),macosx)
|
|||
mkdir -p ~/Library/Application\ Support/$(name)/
|
||||
mkdir -p ~/Emulation/System/
|
||||
cp -R out/$(name).app /Applications/$(name).app
|
||||
cp data/cheats.bml ~/Library/Application\ Support/$(name)/
|
||||
cp -R systems/* ~/Library/Application\ Support/$(name)/
|
||||
else ifneq ($(filter $(platform),linux bsd),)
|
||||
mkdir -p $(prefix)/bin/
|
||||
mkdir -p $(prefix)/share/icons/
|
||||
mkdir -p $(prefix)/share/$(name)/
|
||||
mkdir -p $(prefix)/share/applications/
|
||||
mkdir -p $(prefix)/share/icons/
|
||||
cp out/$(name) $(prefix)/bin/$(name)
|
||||
cp -R systems/* $(prefix)/share/$(name)/
|
||||
cp data/$(name).desktop $(prefix)/share/applications/$(name).desktop
|
||||
cp data/$(name).png $(prefix)/share/icons/$(name).png
|
||||
cp data/cheats.bml $(prefix)/share/$(name)/cheats.bml
|
||||
cp -R systems/* $(prefix)/share/$(name)/
|
||||
endif
|
||||
|
||||
uninstall:
|
||||
|
|
|
@ -188,7 +188,7 @@ auto pCanvas::_rasterize() -> void {
|
|||
auto target = (uint32_t*)[bitmap bitmapData];
|
||||
|
||||
if(auto icon = state().icon) {
|
||||
icon.transform();
|
||||
icon.transform(0, 32, 255u << 24, 255u << 0, 255u << 8, 255u << 16); //Cocoa uses ABGR format
|
||||
memory::copy(target, icon.data(), icon.size());
|
||||
} else if(auto& gradient = state().gradient) {
|
||||
auto& colors = gradient.state.colors;
|
||||
|
|
Loading…
Reference in New Issue