From 45de5e113eefa03e583d97ec2095a48d2a791f62 Mon Sep 17 00:00:00 2001 From: cracyc Date: Fri, 8 Jul 2016 09:49:03 -0500 Subject: [PATCH] plugins/hiscore: add optional value to prefill for software that clears ram and add examples (nw) --- plugins/hiscore/hiscore.dat | 14 ++++++++++++-- plugins/hiscore/init.lua | 10 +++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/plugins/hiscore/hiscore.dat b/plugins/hiscore/hiscore.dat index 639a2394fca..9b22c8d913e 100644 --- a/plugins/hiscore/hiscore.dat +++ b/plugins/hiscore/hiscore.dat @@ -6297,6 +6297,12 @@ gaunt2: @:maincpu,program,904DE8,C8,00,E3 +;@s:gb.cpp + +gameboy,tetris: +@:maincpu,program,d654,32,0,0,ff + + ;@s:gberet.cpp gberet: @@ -9552,6 +9558,12 @@ sonicwi2: @:maincpu,program,10000e,52,48,03 +;@s:nes.cpp + +nes,smb: +@:maincpu,program,7df,4,0,0,ff + + ;@s:news.cpp ;newsa:******News (set 2) @@ -17175,5 +17187,3 @@ percuss: ;Moguchan (by GeoMan) moguchan: @:maincpu,program,5eda,6,0,0 - - diff --git a/plugins/hiscore/init.lua b/plugins/hiscore/init.lua index d1766c15d0c..c4276514f62 100644 --- a/plugins/hiscore/init.lua +++ b/plugins/hiscore/init.lua @@ -38,7 +38,7 @@ function hiscore.startplugin() local _table = {}; for line in string.gmatch(dsting, '([^\n]+)') do local cpu, mem; - cputag, space, offs, len, chk_st, chk_ed = string.match(line, '^@([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+)'); + cputag, space, offs, len, chk_st, chk_ed, fill = string.match(line, '^@([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),?(%x?%x?)'); cpu = manager:machine().devices[cputag]; if not cpu then emu.print_verbose("hiscore: " .. cputag .. " device not found") @@ -55,6 +55,7 @@ function hiscore.startplugin() size = tonumber(len, 16), c_start = tonumber(chk_st, 16), c_end = tonumber(chk_ed, 16), + fill = tonumber(fill, 16) }; end return _table; @@ -254,6 +255,13 @@ function hiscore.startplugin() emu.print_error("hiscore: hiscore.dat parse error"); return; end + for i, row in pairs(positions) do + if row.fill then + for i=0,row["size"]-1 do + row["mem"]:write_u8(row["addr"] + i, row.fill) + end + end + end found_hiscore_entry = true end end)