SNES: Functions for messing with clockrate (for debugging games)
This commit is contained in:
parent
f2169b725f
commit
ae3cb19a03
2 changed files with 53 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
ifdef BUILD_BSNES
|
ifdef BUILD_BSNES
|
||||||
OBJECTS=core.$(OBJECT_SUFFIX) scpu-disasm.$(OBJECT_SUFFIX) bitmap.$(OBJECT_SUFFIX)
|
OBJECTS=core.$(OBJECT_SUFFIX) scpu-disasm.$(OBJECT_SUFFIX) bitmap.$(OBJECT_SUFFIX) frequency.$(OBJECT_SUFFIX)
|
||||||
BSNES_CFLAGS=
|
BSNES_CFLAGS=
|
||||||
BSNES_LDFLAGS=
|
BSNES_LDFLAGS=
|
||||||
ifdef BSNES_IS_COMPAT
|
ifdef BSNES_IS_COMPAT
|
||||||
|
|
52
src/emulation/bsnes-legacy/frequency.cpp
Normal file
52
src/emulation/bsnes-legacy/frequency.cpp
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
#include "lsnes.hpp"
|
||||||
|
#include "lua/bitmap.hpp"
|
||||||
|
#include "lua/internal.hpp"
|
||||||
|
#include "library/serialization.hpp"
|
||||||
|
#include "library/memoryspace.hpp"
|
||||||
|
#include "core/instance.hpp"
|
||||||
|
#include "core/memorymanip.hpp"
|
||||||
|
#ifdef BSNES_HAS_DEBUGGER
|
||||||
|
#define DEBUGGER
|
||||||
|
#endif
|
||||||
|
#include <snes/snes.hpp>
|
||||||
|
#include <gameboy/gameboy.hpp>
|
||||||
|
#include LIBSNES_INCLUDE_FILE
|
||||||
|
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
int change_cpu_frequency(lua::state& L, lua::parameters& P)
|
||||||
|
{
|
||||||
|
uint64_t freq;
|
||||||
|
P(freq);
|
||||||
|
SNES::cpu.frequency = freq;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int change_smp_frequency(lua::state& L, lua::parameters& P)
|
||||||
|
{
|
||||||
|
uint64_t freq;
|
||||||
|
P(freq);
|
||||||
|
SNES::smp.frequency = freq;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int get_cpu_frequency(lua::state& L, lua::parameters& P)
|
||||||
|
{
|
||||||
|
L.pushnumber(SNES::cpu.frequency);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int get_smp_frequency(lua::state& L, lua::parameters& P)
|
||||||
|
{
|
||||||
|
L.pushnumber(SNES::smp.frequency);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
lua::functions bitmap_fns_snes(lua_func_misc, "bsnes", {
|
||||||
|
{"set_cpu_frequency", change_cpu_frequency},
|
||||||
|
{"set_smp_frequency", change_smp_frequency},
|
||||||
|
{"get_cpu_frequency", get_cpu_frequency},
|
||||||
|
{"get_smp_frequency", get_smp_frequency},
|
||||||
|
});
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue