Instancefy base mmio stuff
This commit is contained in:
parent
f89ecc3870
commit
6bad138d8b
13 changed files with 28 additions and 12 deletions
|
@ -6,15 +6,18 @@
|
|||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include <stdexcept>
|
||||
#include "library/memoryspace.hpp"
|
||||
|
||||
class memory_space;
|
||||
class movie_logic;
|
||||
|
||||
class cart_mappings_refresher
|
||||
{
|
||||
public:
|
||||
cart_mappings_refresher(memory_space& _mspace);
|
||||
cart_mappings_refresher(memory_space& _mspace, movie_logic& _mlogic);
|
||||
void operator()() throw(std::bad_alloc);
|
||||
private:
|
||||
memory_space& mspace;
|
||||
movie_logic& mlogic;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef _library__memorysearch__hpp__included__
|
||||
#define _library__memorysearch__hpp__included__
|
||||
|
||||
#include "memoryspace.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "core/messages.hpp"
|
||||
#include "interface/disassembler.hpp"
|
||||
#include "library/hex.hpp"
|
||||
#include "library/memoryspace.hpp"
|
||||
#include "library/minmax.hpp"
|
||||
#include "library/string.hpp"
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ emulator_instance::emulator_instance()
|
|||
D.init(status, *status_A, *status_B, *status_C);
|
||||
D.init(abindmanager, *mapper, *command);
|
||||
D.init(nrrdata);
|
||||
D.init(cmapper, *memory);
|
||||
D.init(cmapper, *memory, *mlogic);
|
||||
D.init(project, *commentary, *mwatch, *command, *controls, *setcache, *buttons, *dispatch);
|
||||
D.init(dbg, *dispatch);
|
||||
D.init(framerate);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
uint8_t lsnes_mmio_iospace_read(uint64_t offset)
|
||||
uint8_t lsnes_mmio_iospace_read(movie_logic* mlogic, uint64_t offset)
|
||||
{
|
||||
try {
|
||||
if(offset >= 0 && offset < 8) {
|
||||
|
@ -47,7 +47,7 @@ namespace
|
|||
}
|
||||
}
|
||||
|
||||
void lsnes_mmio_iospace_write(uint64_t offset, uint8_t data)
|
||||
void lsnes_mmio_iospace_write(movie_logic* mlogic, uint64_t offset, uint8_t data)
|
||||
{
|
||||
//Ignore.
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace
|
|||
{
|
||||
public:
|
||||
iospace_region(const std::string& _name, uint64_t _base, uint64_t _size, bool _special,
|
||||
uint8_t (*_read)(uint64_t offset), void (*_write)(uint64_t offset, uint8_t data))
|
||||
std::function<uint8_t(uint64_t)> _read, std::function<void(uint64_t, uint8_t)> _write)
|
||||
{
|
||||
name = _name;
|
||||
base = _base;
|
||||
|
@ -82,13 +82,13 @@ namespace
|
|||
Xwrite(offset + i, _buffer[i]);
|
||||
return offset + rsize <= size;
|
||||
}
|
||||
uint8_t (*Xread)(uint64_t offset);
|
||||
void (*Xwrite)(uint64_t offset, uint8_t data);
|
||||
std::function<uint8_t(uint64_t)> Xread;
|
||||
std::function<void(uint64_t, uint8_t)> Xwrite;
|
||||
};
|
||||
}
|
||||
|
||||
cart_mappings_refresher::cart_mappings_refresher(memory_space& _mspace)
|
||||
: mspace(_mspace)
|
||||
cart_mappings_refresher::cart_mappings_refresher(memory_space& _mspace, movie_logic& _mlogic)
|
||||
: mspace(_mspace), mlogic(_mlogic)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -100,9 +100,11 @@ void cart_mappings_refresher::operator()() throw(std::bad_alloc)
|
|||
std::list<memory_region*> regions;
|
||||
memory_region* tmp = NULL;
|
||||
auto vmalist = our_rom.rtype->vma_list();
|
||||
auto _mlogic = &mlogic;
|
||||
try {
|
||||
tmp = new iospace_region("LSNESMMIO", 0xFFFFFFFF00000000ULL, 32, true, lsnes_mmio_iospace_read,
|
||||
lsnes_mmio_iospace_write);
|
||||
tmp = new iospace_region("LSNESMMIO", 0xFFFFFFFF00000000ULL, 32, true,
|
||||
[_mlogic](uint64_t addr) -> uint8_t { return lsnes_mmio_iospace_read(_mlogic, addr); },
|
||||
[_mlogic](uint64_t addr, uint8_t value) { lsnes_mmio_iospace_write(_mlogic, addr, value); });
|
||||
regions.push_back(tmp);
|
||||
tmp = NULL;
|
||||
for(auto i : vmalist) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "lua/bitmap.hpp"
|
||||
#include "lua/internal.hpp"
|
||||
#include "library/serialization.hpp"
|
||||
#include "library/memoryspace.hpp"
|
||||
#include "core/instance.hpp"
|
||||
#include "core/memorymanip.hpp"
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "library/hex.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "library/controller-data.hpp"
|
||||
#include "library/memoryspace.hpp"
|
||||
#include "library/framebuffer.hpp"
|
||||
#include "library/lua-base.hpp"
|
||||
#include "lua/internal.hpp"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "interface/disassembler.hpp"
|
||||
#include "interface/romtype.hpp"
|
||||
#include "library/hex.hpp"
|
||||
#include "library/memoryspace.hpp"
|
||||
#include "core/instance.hpp"
|
||||
#include "core/memorymanip.hpp"
|
||||
#include "core/moviedata.hpp"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "lua/internal.hpp"
|
||||
#include "core/instance.hpp"
|
||||
#include "core/memorymanip.hpp"
|
||||
#include "library/memoryspace.hpp"
|
||||
#include "library/minmax.hpp"
|
||||
|
||||
namespace
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "library/sha256.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "library/skein.hpp"
|
||||
#include "library/memoryspace.hpp"
|
||||
#include "library/minmax.hpp"
|
||||
#include "library/hex.hpp"
|
||||
#include "library/int24.hpp"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "library/skein.hpp"
|
||||
#include "library/string.hpp"
|
||||
#include "library/serialization.hpp"
|
||||
#include "library/memoryspace.hpp"
|
||||
#include "library/minmax.hpp"
|
||||
#include "library/int24.hpp"
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "core/moviedata.hpp"
|
||||
#include "core/memorywatch.hpp"
|
||||
#include "core/memorymanip.hpp"
|
||||
#include "library/memoryspace.hpp"
|
||||
#include "core/project.hpp"
|
||||
|
||||
#include "platform/wxwidgets/platform.hpp"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "interface/disassembler.hpp"
|
||||
#include "library/minmax.hpp"
|
||||
#include "library/hex.hpp"
|
||||
#include "library/memoryspace.hpp"
|
||||
#include "library/serialization.hpp"
|
||||
#include <wx/frame.h>
|
||||
#include <wx/clipbrd.h>
|
||||
|
|
Loading…
Add table
Reference in a new issue