mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-23 05:58:26 +02:00
clean up and larger importer
This commit is contained in:
@@ -195,8 +195,8 @@ local function parseImports(value, field, required)
|
||||
if value == nil then return end
|
||||
assert(type(value) == "number" and value > 0 and value % 1 == 0,
|
||||
field .. " " .. label .. " must be a positive integer")
|
||||
assert(value <= 128 * 1024 * 1024,
|
||||
field .. " " .. label .. " exceeds the 128 MiB hard limit")
|
||||
assert(value <= 2 * 1024 * 1024 * 1024,
|
||||
field .. " " .. label .. " exceeds the 2 GiB hard limit")
|
||||
end
|
||||
validateSize(size, "size")
|
||||
validateSize(maxSize, "max_size")
|
||||
|
||||
@@ -23,11 +23,17 @@ local function isRequired(spec)
|
||||
end
|
||||
|
||||
RequiredImports.specs = allSpecs
|
||||
RequiredImports.MAX_BYTES = 128 * 1024 * 1024
|
||||
RequiredImports.MAX_BYTES = 2 * 1024 * 1024 * 1024
|
||||
-- Past this, the launcher interposes a free-space warning before importing.
|
||||
RequiredImports.LARGE_WARN_BYTES = 128 * 1024 * 1024
|
||||
|
||||
local function sizeLabel(bytes)
|
||||
if bytes >= 1024 * 1024 * 1024 then
|
||||
return ("%.1f GiB"):format(bytes / (1024 * 1024 * 1024))
|
||||
end
|
||||
return ("%.1f MiB"):format(bytes / (1024 * 1024))
|
||||
end
|
||||
RequiredImports.sizeLabel = sizeLabel
|
||||
|
||||
-- Check size before a caller reads an external or stored file into one large
|
||||
-- Lua string. N64 sources may carry a 512-byte copier header, while stored
|
||||
|
||||
Reference in New Issue
Block a user