summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/luaengine.cpp
diff options
context:
space:
mode:
author feos <feos-theos@yandex.ru>2018-10-31 22:10:36 +0300
committer feos <feos-theos@yandex.ru>2018-10-31 22:10:36 +0300
commit0b3108f56042866f154b611c8093b464a380772e (patch)
treeef77d0f39ad38b0bec493391615c60b41dd80f4d /src/frontend/mame/luaengine.cpp
parentdd9531ea70d44919ce9d236f85e3b2e341e67da5 (diff)
actually use offset argument in item:read_block(offset, count)
improve comment wording
Diffstat (limited to 'src/frontend/mame/luaengine.cpp')
-rw-r--r--src/frontend/mame/luaengine.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
index ee1c08073b9..bb1ada557a4 100644
--- a/src/frontend/mame/luaengine.cpp
+++ b/src/frontend/mame/luaengine.cpp
@@ -985,9 +985,9 @@ void lua_engine::initialize()
* emu.item(item_index)
* item.size - size of the raw data type
* item.count - number of entries
- * item:read(entry_index) - read entry value by index
- * item:read_block(entry_index, count) - read array of entry values
- * item:write(entry_index, value) - write entry value by index
+ * item:read(offset) - read entry value by index
+ * item:read_block(offset, count) - read a block of entry values as a string (byte addressing)
+ * item:write(offset, value) - write entry value by index
*/
emu.new_usertype<save_item>("item", sol::call_constructor, sol::initializers([this](save_item &item, int index) {
@@ -1026,7 +1026,7 @@ void lua_engine::initialize()
if(!item.base || ((offset + buff->get_len()) > (item.size * item.count)))
buff->set_len(0);
else
- memcpy(buff->get_ptr(), item.base, buff->get_len());
+ memcpy(buff->get_ptr(), (uint8_t *)item.base + offset, buff->get_len());
return buff;
},
"write", [](save_item &item, int offset, uint64_t value) {