MCPcopy Create free account
hub / github.com/TASEmulators/fceux / memory_readbyterange

Function memory_readbyterange

src/lua-engine.cpp:1592–1607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1590}
1591
1592static int memory_readbyterange(lua_State *L) {
1593
1594 int range_start = luaL_checkinteger(L,1);
1595 int range_size = luaL_checkinteger(L,2);
1596 if(range_size < 0)
1597 return 0;
1598
1599 char* buf = (char*)alloca(range_size);
1600 for(int i=0;i<range_size;i++) {
1601 buf[i] = GetMem(range_start+i);
1602 }
1603
1604 lua_pushlstring(L,buf,range_size);
1605
1606 return 1;
1607}
1608
1609static int ppu_readbyte(lua_State *L) {
1610 lua_pushinteger(L, FFCEUX_PPURead(luaL_checkinteger(L, 1)));

Callers

nothing calls this directly

Calls 3

luaL_checkintegerFunction · 0.85
GetMemFunction · 0.85
lua_pushlstringFunction · 0.85

Tested by

no test coverage detected