2012-04-29 06:16:44 +00:00
|
|
|
#include <sfc/sfc.hpp>
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2012-04-26 10:51:13 +00:00
|
|
|
namespace SuperFamicom {
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
#include "serialization.cpp"
|
|
|
|
#include "bus/bus.cpp"
|
|
|
|
#include "core/core.cpp"
|
|
|
|
#include "memory/memory.cpp"
|
|
|
|
#include "mmio/mmio.cpp"
|
|
|
|
#include "timing/timing.cpp"
|
2013-12-10 12:12:54 +00:00
|
|
|
#include "disassembler/disassembler.cpp"
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
SuperFX superfx;
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::Enter() -> void {
|
2016-02-09 11:51:12 +00:00
|
|
|
while(true) scheduler.synchronize(), superfx.main();
|
2015-06-27 02:38:47 +00:00
|
|
|
}
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2016-02-09 11:51:12 +00:00
|
|
|
auto SuperFX::main() -> void {
|
|
|
|
if(regs.sfr.g == 0) return step(6);
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2016-02-09 11:51:12 +00:00
|
|
|
uint opcode = regs.sfr.alt2 << 9 | regs.sfr.alt1 << 8 | peekpipe();
|
|
|
|
(this->*opcode_table[opcode])();
|
|
|
|
if(!r15_modified) regs.r[15]++;
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::init() -> void {
|
2010-08-09 13:28:56 +00:00
|
|
|
initialize_opcode_table();
|
2012-05-09 23:35:29 +00:00
|
|
|
regs.r[14].modify = {&SuperFX::r14_modify, this};
|
|
|
|
regs.r[15].modify = {&SuperFX::r15_modify, this};
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::load() -> void {
|
Update to v075 release.
byuu says:
This release brings improved Super Game Boy emulation, the final SHA256
hashes for the DSP-(1,1B,2,3,4) and ST-(0010,0011) coprocessors, user
interface improvements, and major internal code restructuring.
Changelog (since v074):
- completely rewrote memory sub-system to support 1-byte granularity in
XML mapping
- removed Memory inheritance and MMIO class completely, any address can
be mapped to any function now
- SuperFX: removed SuperFXBus : Bus, now implemented manually
- SA-1: removed SA1Bus : Bus, now implemented manually
- entire bus mapping is now static, happens once on cartridge load
- as a result, read/write handlers now handle MMC mapping; slower
average case, far faster worst case
- namespace memory is no more, RAM arrays are stored inside the chips
they are owned by now
- GameBoy: improved CPU HALT emulation, fixes Zelda: Link's Awakening
scrolling
- GameBoy: added serial emulation (cannot connect to another GB yet),
fixes Shin Megami Tensei - Devichil
- GameBoy: improved LCD STAT emulation, fixes Sagaia
- ui: added fullscreen support (F11 key), video settings allows for
three scale settings
- ui: fixed brightness, contrast, gamma, audio volume, input frequency
values on program startup
- ui: since Qt is dead, config file becomes bsnes.cfg once again
- Super Game Boy: you can now load the BIOS without a game inserted to
see a pretty white box
- ui-gameboy: can be built without SNES components now
- libsnes: now a UI target, compile with 'make ui=ui-libsnes'
- libsnes: added WRAM, APURAM, VRAM, OAM, CGRAM access (cheat search,
etc)
- source: removed launcher/, as the Qt port is now gone
- source: Makefile restructuring to better support new ui targets
- source: lots of other internal code cleanup work
2011-01-27 08:52:34 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::unload() -> void {
|
2012-07-09 11:40:23 +00:00
|
|
|
rom.reset();
|
|
|
|
ram.reset();
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::power() -> void {
|
2012-04-29 06:16:44 +00:00
|
|
|
GSU::power();
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-06-27 02:38:47 +00:00
|
|
|
auto SuperFX::reset() -> void {
|
2012-04-29 06:16:44 +00:00
|
|
|
GSU::reset();
|
2015-11-10 11:02:29 +00:00
|
|
|
create(SuperFX::Enter, system.cpuFrequency());
|
2010-08-09 13:28:56 +00:00
|
|
|
memory_reset();
|
|
|
|
timing_reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|