hiscore.dat: Updates [Leezer]

luaengine: fix save_item (nw)
This commit is contained in:
cracyc 2016-11-03 09:57:51 -05:00
parent 44884f14eb
commit 2603b2ec46
2 changed files with 61 additions and 8 deletions

View file

@ -4851,6 +4851,26 @@ eprom:
;@s:equites.cpp
;*** Splendor Blast II - you must exit game with top score on screen for save to work ***
splndrbt2:
@:maincpu,program,40020,3,01,00
@:maincpu,program,40840,168,53,01
@:maincpu,program,201611,1,20,20
@:maincpu,program,201691,1,01,01
@:maincpu,program,201711,1,00,00
@:maincpu,program,201791,1,00,00
@:maincpu,program,201811,1,00,00
@:maincpu,program,201891,1,00,00
@:maincpu,program,201911,1,00,00
@:maincpu,program,201921,1,20,20
splndrbta:
splndrbtb:
@:maincpu,program,40840,168,53,01
@:maincpu,program,40020,3,01,00
;(splendor blast) (by GeoMan)
splndrbt:
@:maincpu,program,40840,168,53,01
@ -5632,6 +5652,10 @@ galaxiac:
;@s:galaxian.cpp
uniwarsa:
@:maincpu,program,40a8,3,00,00
anteatergg:
@:maincpu,program,40ef,3c,00,20
@ -9682,6 +9706,11 @@ newsa:
;@s:ninjakd2.cpp
mnightj:
@:maincpu,program,c099,41,00,20
@:maincpu,program,c0e6,3,00,00
;(ninja kid ii (set 1)) and clones (by GeoMan)
ninjakd2:
ninjakd2a:
@ -9769,6 +9798,10 @@ pclubysa:
;@s:nmk16.cpp
bjtwinpa:
@:maincpu,program,f9100,a0,00,4c
;tdragon:******Thunder Dragon (9th Jan. 1992)
;tdragon1:******Thunder Dragon (4th Jun. 1991)
tdragon:
@ -11493,6 +11526,12 @@ sbrkoutct:
;@s:scobra.cpp
hustlerb5:
@:maincpu,program,84c0,f,00,00
@:maincpu,program,80a8,3,00,02
@:maincpu,program,8003,1,0a,0a
;(video hustler)
hustler:
hustlerb3:
@ -15602,6 +15641,10 @@ timepltc:
;@s:tmnt.cpp
tmnta:
@:maincpu,program,63500,f3,03,41
tmntub:
@:maincpu,program,63500,f3,03,41
@ -15768,6 +15811,11 @@ tnzsjo:
;@s:toaplan1.cpp
demonwld4:
@:maincpu,program,c001c2,c8,00,2d
@:maincpu,program,c001be,4,00,00
;***** truxton fixed (delete old truxton entry and replace).
truxton:
@:maincpu,program,0819de,16c,00,0b

View file

@ -758,6 +758,17 @@ void lua_engine::initialize()
return sol::make_object(sol(), sol::nil);
return sol::make_object(sol(), driver_list::driver(i));
};
// this throws an error when implemented as an initializer
emu["item"] = [this](int index) {
save_item *item = new save_item;
if(!machine().save().indexed_item(index, item->base, item->size, item->count))
{
item->base = nullptr;
item->size = 0;
item->count= 0;
}
return item;
};
emu.new_usertype<emu_file>("file", sol::call_constructor, sol::constructors<sol::types<const char *, uint32_t>>(),
"read", [](emu_file &file, sol::buffer *buff) { buff->set_len(file.read(buff->get_ptr(), buff->get_len())); return buff; },
@ -768,14 +779,8 @@ void lua_engine::initialize()
"filename", &emu_file::filename,
"fullpath", &emu_file::fullpath);
emu.new_usertype<save_item>("item", sol::call_constructor, sol::factories([this](save_item &item, int index) {
if(!machine().save().indexed_item(index, item.base, item.size, item.count))
{
item.base = nullptr;
item.size = 0;
item.count= 0;
}
}),
sol().new_usertype<save_item>("item",
sol::meta_function::garbage_collect, sol::destructor([](save_item *item) { delete item; }),
"size", sol::readonly(&save_item::size),
"count", sol::readonly(&save_item::count),
"read", [this](save_item &item, int offset) -> sol::object {