Skip to content

Commit a0054e1

Browse files
committed
64bit fixes
1 parent 022cb9e commit a0054e1

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

devel/find-offsets.lua

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,13 @@ local function find_gview()
470470
return
471471
end
472472

473-
local idx, addr = data.uint32_t:find_one{0, vs_vtable}
473+
local idx, addr = data.uint64_t:find_one{0, vs_vtable}
474474
if idx then
475475
ms.found_offset('gview', addr)
476476
return
477477
end
478478

479-
idx, addr = data.uint32_t:find_one{100, vs_vtable}
479+
idx, addr = data.uint64_t:find_one{100, vs_vtable}
480480
if idx then
481481
ms.found_offset('gview', addr)
482482
return
@@ -506,8 +506,8 @@ local function lookup_colors()
506506
end
507507

508508
local function is_valid_enabler(e)
509-
if not ms.is_valid_vector(e.textures.raws, 4)
510-
or not ms.is_valid_vector(e.text_system, 4)
509+
if not ms.is_valid_vector(e.textures.raws, 8)
510+
or not ms.is_valid_vector(e.text_system, 8)
511511
then
512512
dfhack.printerr('Vector layout check failed.')
513513
return false
@@ -597,11 +597,11 @@ end
597597
--
598598

599599
local function is_valid_world(world)
600-
if not ms.is_valid_vector(world.units.all, 4)
601-
or not ms.is_valid_vector(world.units.active, 4)
602-
or not ms.is_valid_vector(world.units.bad, 4)
603-
or not ms.is_valid_vector(world.history.figures, 4)
604-
or not ms.is_valid_vector(world.features.map_features, 4)
600+
if not ms.is_valid_vector(world.units.all, 8)
601+
or not ms.is_valid_vector(world.units.active, 8)
602+
or not ms.is_valid_vector(world.units.bad, 8)
603+
or not ms.is_valid_vector(world.history.figures, 8)
604+
or not ms.is_valid_vector(world.features.map_features, 8)
605605
then
606606
dfhack.printerr('Vector layout check failed.')
607607
return false
@@ -656,7 +656,7 @@ end
656656

657657
local function is_valid_ui(ui)
658658
if not ms.is_valid_vector(ui.economic_stone, 1)
659-
or not ms.is_valid_vector(ui.dipscripts, 4)
659+
or not ms.is_valid_vector(ui.dipscripts, 8)
660660
then
661661
dfhack.printerr('Vector layout check failed.')
662662
return false
@@ -848,14 +848,14 @@ end
848848

849849
local function find_init()
850850
local zone
851-
if os_type == 'windows' then
851+
--[[if os_type == 'windows' then
852852
zone = zoomed_searcher('ui_build_selector', 0x3000)
853853
elseif os_type == 'linux' or os_type == 'darwin' then
854854
zone = zoomed_searcher('d_init', -0x2000)
855-
end
855+
end]]
856856
zone = zone or searcher
857857

858-
local idx, addr = zone.area.int32_t:find_one{250, 150, 15, 0}
858+
local idx, addr = zone.area.int64_t:find_one{250, 150, 15, 0}
859859
if idx then
860860
validate_offset('init', is_valid_init, addr, df.init, 'input', 'hold_time')
861861
return
@@ -1636,7 +1636,7 @@ of at least 10 vacant natural floor tiles.]],
16361636
end
16371637

16381638
if not addr then
1639-
local addr = zone:find_menu_cursor([[
1639+
addr = zone:find_menu_cursor([[
16401640
Searching for process_jobs. Please do as instructed below:]],
16411641
'int8_t',
16421642
{ 1, 0 },

exportlegends.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function export_more_legends_xml()
110110
local year_str = string.format('%0'..math.max(5, string.len(''..df.global.cur_year))..'d', df.global.cur_year)
111111
local date_str = year_str..string.format('-%02d-%02d', month, day)
112112

113-
local filename = df.global.world.cur_savegame.save_dir.."-"..date_str.."-legends_plus.xml"
113+
local filename = df.global.world.save_dir.."-"..date_str.."-legends_plus.xml"
114114
local file = io.open(filename, 'w')
115115
if not file then qerror("could not open file: " .. filename) end
116116

lua.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ if cmd=="--file" or cmd=="-f" then
5353
end
5454
dfhack.safecall(f,table.unpack(args,3))
5555
elseif cmd=="--save" or cmd=="-s" then
56-
if df.global.world.cur_savegame.save_dir=="" then
56+
if df.global.cur_savegame.save_dir=="" then
5757
qerror("Savefile not loaded")
5858
end
5959
local fname=args[2] or "dfhack.lua"
60-
fname=string.format("data/save/%s/%s",df.global.world.cur_savegame.save_dir,fname)
60+
fname=string.format("data/save/%s/%s",df.global.cur_savegame.save_dir,fname)
6161
local f,err=loadfile (fname)
6262
if f==nil then
6363
qerror(err)

modtools/extra-gamelog.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function log_on_load(op)
4444
local function fullname(item)
4545
return dfhack.TranslateName(item.name)..' ('..dfhack.TranslateName(item.name ,true)..')'
4646
end
47-
msg('Loaded '..df.global.world.cur_savegame.save_dir..', '..fullname(df.global.world.world_data)..
47+
msg('Loaded '..df.global.world.save_dir..', '..fullname(df.global.world.world_data)..
4848
' at coordinates ('..site.pos.x..','..site.pos.y..')')
4949
msg('Loaded the fortress '..fullname(site)..
5050
(fort_ent and ', colonized by the group '..fullname(fort_ent) or '')..

0 commit comments

Comments
 (0)