diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 87c2abc1..e6b43599 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -300,6 +300,22 @@ static int fceu_message(lua_State *L) { static int memory_readbyte(lua_State *L) { lua_pushinteger(L, FCEU_CheatGetByte(luaL_checkinteger(L,1))); return 1; } static int memory_writebyte(lua_State *L) { FCEU_CheatSetByte(luaL_checkinteger(L,1), luaL_checkinteger(L,2)); return 0; } +static int memory_readbyterange(lua_State *L) { + + int range_start = luaL_checkinteger(L,1); + int range_size = luaL_checkinteger(L,2); + if(range_size < 0) + return 0; + + char* buf = (char*)alloca(range_size); + for(int i=0;i