in fact, this block simply allows you to read a json file, the path to which you previously specified in the rom disk menu. being in "safe mode"
this block is just a more realistic alias to sm.json.open, however, it does not allow you to read any json file. you can only read the file the path to which you have manually specified in the disk menu
this disk can be used as an alternative to sm.json.open in safe mode
you need it so that you can upload large amounts of data along with your creation to the steam workshop
just put your json in the blueprint folder of your creation and specify the path to it in the ROM disk menu
a ROM disk does not have its own filesystem
to upload binary files to this disk, you can use the "importer" utility written in python, which is in mod along the path: USER/importer
this program collects all files from the files folder into a json file where all files are represented as base64 strings
this program allows you to import files as on a regular disk (using the import button in the disk menu) the same applies to the ROM disk (by moving the json to the blueprint folder)
after the first successful read from rom.open, the disk caches the result
to clear the cache, you can open the disk menu and click "done", re-enter into the world, or call the rom.clearCache Disk method.
UPDATED: you can now interpret the contents of a ROM disk as a filesystem and work with it through the API of a regular disk.
component name - rom

guide:


warnings:


methods:


reading binary files made by the importer program:

            local nbs = require("nbs")

local synthesizers = getComponents("synthesizer")
local rom = getComponent("rom") --specify the path in the ROM disk: $CONTENT_DATA/ROM/gamedisks/nbs.json (the path to the files of the standard nbs example in SComputers)

local disk = rom.openFilesystemImage() --interprets the contents of a ROM disk as a filesystem

local player = nbs.create()
--player.instrumentTable = {} --uncomment if you want everything to be played with one instrument
player:load(disk, "tetrisA.nbs")
player:setSynthesizers(synthesizers)
player:setSpeed(1)
player:setNoteShift(-39)
player:setNoteAligment(1)
player:setVolume(0.1)
player:setDefaultInstrument(4)
player:setNoteDuration(0) --you can try to increase this value if your chosen NBS is playing poorly on standard settings

function callback_loop()
    if _endtick then
        player:stop()
        return
    end
    if not player:isPlaying() then
        player:start()
    end
    player:tick()
end