Take threaded ROM from config file
This commit is contained in:
parent
faccd03b82
commit
547c2978e8
4 changed files with 10 additions and 6 deletions
|
@ -16,7 +16,7 @@ See [YouTube](https://www.youtube.com/watch?v=Q69_wmEkp-k) for an example run.
|
|||
3. Load the DKC2 ROM: `File -> Load -> ROM...`
|
||||
4. Load the `neat-donk.lua` script: `Tools -> Run Lua script...`
|
||||
5. You may also want to turn off sound since it may get annoying. `Configure -> Sounds enabled`
|
||||
6. Look at config.lua for some settings you can change. Not all have been tested, but you should be able to change the number on the `_M.Filename =` line to get a different state file from the `_M.State` list.
|
||||
6. Look at config.lua for some settings you can change. Not all have been tested, but you should be able to change the number on the `_M.Filename =` line to get a different state file from the `_M.State` list. Also note the `Threads =` line. Change this to 1 to prevent multiple instances of lsnes from getting launched at once. If you use more than 1 thread, you may also want to launch `lsnes` using xpra to manage the windows, with the `xpra-run.sh` script.
|
||||
|
||||
If you want a better idea of what's going on with the tile and sprite calculations you may want to load `donkutil.lua`. It will mark the tiles with their offsets on the screen, give a crosshair with tile measurements (every 32 pixels), and list information about the sprites (you can use the 1 and 2 keys above the letter keys to page through them). Sprites labeled in green are considered "good", red is "bad", normal color is neutral. Solid red means that it's the active sprite in the info viewer.
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
local base = string.gsub(@@LUA_SCRIPT_FILENAME@@, "(.*[/\\])(.*)", "%1")
|
||||
|
||||
local game = dofile(base.."/game.lua")
|
||||
local config = dofile(base.."/config.lua")
|
||||
local pool = dofile(base.."/pool.lua")
|
||||
local game = dofile(base.."/game.lua")
|
||||
local util = dofile(base.."/util.lua")
|
||||
|
||||
local statusLine = nil
|
||||
|
@ -32,4 +32,7 @@ pool.onRenderForm(function(form)
|
|||
end
|
||||
end)
|
||||
pool.run()
|
||||
|
||||
|
||||
function on_post_load()
|
||||
print("HELLO LOAD")
|
||||
end
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
local base = string.gsub(@@LUA_SCRIPT_FILENAME@@, "(.*[/\\])(.*)", "%1")
|
||||
|
||||
local config = dofile(base.."/config.lua")
|
||||
local serpent = dofile(base.."/serpent.lua")
|
||||
local tmpFileName = "/tmp/donk_runner_"..tostring(math.floor(random.integer(0, 0xffffffffffffffff))):hex()
|
||||
|
||||
|
@ -75,7 +76,7 @@ return function()
|
|||
inputFile:write(serpent.dump({species[i], generationIdx, speciesIdx + i - 1, outputFileName}))
|
||||
inputFile:close()
|
||||
|
||||
local cmd = "RUNNER_DATA=\""..inputFileName.."\" lsnes \"--rom="..base.."/rom.sfc\" --unpause \"--lua="..base.."/runner-process.lua\""
|
||||
local cmd = "RUNNER_DATA=\""..inputFileName.."\" lsnes \"--rom="..config.ROM.."\" --unpause \"--lua="..base.."/runner-process.lua\""
|
||||
message(_M, cmd)
|
||||
local poppet = io.popen(cmd, 'r')
|
||||
table.insert(poppets, poppet)
|
||||
|
|
|
@ -4,8 +4,6 @@ local config = dofile(base.."/config.lua")
|
|||
local game = dofile(base.."/game.lua")
|
||||
local mathFunctions = dofile(base.."/mathFunctions.lua")
|
||||
|
||||
game.registerHandlers()
|
||||
|
||||
local Inputs = config.InputSize+1
|
||||
local Outputs = #config.ButtonNames
|
||||
|
||||
|
@ -778,6 +776,8 @@ local function saveLoadInput(_M)
|
|||
end
|
||||
|
||||
local function run(_M, species, generationIdx, speciesIdx, genomeCallback, finishCallback)
|
||||
game.registerHandlers()
|
||||
|
||||
_M.currentGenerationIndex = generationIdx
|
||||
_M.currentSpeciesIndex = speciesIdx
|
||||
_M.currentSpecies = species
|
||||
|
|
Loading…
Add table
Reference in a new issue