{"id":26211438,"url":"https://github.com/8bit-mate/smp_tool.rb","last_synced_at":"2026-04-27T07:31:55.064Z","repository":{"id":223750711,"uuid":"761425748","full_name":"8bit-mate/smp_tool.rb","owner":"8bit-mate","description":"A lib to work with the MK90 SMP volume images.","archived":false,"fork":false,"pushed_at":"2024-04-19T10:43:59.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-18T15:45:01.654Z","etag":null,"topics":["retrocomputing","soviet-computer"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/8bit-mate.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-21T21:04:03.000Z","updated_at":"2024-03-13T09:38:25.000Z","dependencies_parsed_at":"2024-02-21T22:25:49.331Z","dependency_job_id":"a4d1e834-b514-4581-a1e2-c06ae961305c","html_url":"https://github.com/8bit-mate/smp_tool.rb","commit_stats":null,"previous_names":["8bit-mate/smp_tool.rb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/8bit-mate/smp_tool.rb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8bit-mate%2Fsmp_tool.rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8bit-mate%2Fsmp_tool.rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8bit-mate%2Fsmp_tool.rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8bit-mate%2Fsmp_tool.rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/8bit-mate","download_url":"https://codeload.github.com/8bit-mate/smp_tool.rb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/8bit-mate%2Fsmp_tool.rb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32327701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["retrocomputing","soviet-computer"],"created_at":"2025-03-12T08:28:01.998Z","updated_at":"2026-04-27T07:31:55.032Z","avatar_url":"https://github.com/8bit-mate.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smp_tool\n\nA Ruby library to work with the Elektronika MK90 volume images. There's a command-line interface: [smp_tool-cli](https://github.com/8bit-mate/smp_tool-cli.rb).\n\n## Installation\n\nAdd this line to your application\"s Gemfile:\n\n```ruby\ngem \"smp_tool\"\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install smp_tool\n\n## Usage\n\nCreate a new empty volume:\n\n```Ruby\nrequire \"smp_tool\"\n\nparams = SMPTool::VirtualVolume::VolumeParams.new(\n  n_clusters_allocated: 20,\n  n_extra_bytes_per_entry: 0,\n  n_dir_segs: 1,\n  n_clusters_per_dir_seg: 2,\n  extra_word: 0\n)\n\nvolume = SMPTool::VirtualVolume::Volume.new(\n  bootloader: SMPTool::Basic10::DEFAULT_BOOTLOADER,\n  home_block: SMPTool::Basic10::HOME_BLOCK,\n  volume_params: params\n)\n```\n\nOr read an existing volume from a file:\n\n```Ruby\nio = File.read(\"/path/to/volume/smp0.bin\")\nvolume = SMPTool::VirtualVolume::Volume.read_io(io)\n```\n\nNow you can perform operations on the `volume` object, e.g.:\n\n```Ruby\n# Push a text file to the volume:\nvolume.f_push(\n  {\n    filename: \"hello.bas\",\n    data: [\"10 PRINT \\\"Hello, world\\\"\", \"20 GOTO 10\"]\n  }\n)\n\n# Extract a file by its filename:\nvolume.f_extract_txt(\"hello.bas\")\n\n# Delete a file from the volume:\nvolume.f_delete(\"hello.bas\")\n\n# Consolidate all free space at the end of the volume:\nvolume.squeeze\n\n# Rename a file on the volume:\nvolume.f_rename(\"old.bas\", \"new.bas\")\n\n# Allocate more free clusters to the volume:\nvolume.resize(10)\n\n# ...or trim some free clusters:\nvolume.resize(-5)\n```\n\nWhen done, you can write modified volume back to a binary file:\n\n```Ruby\ndata = volume.to_binary_s\nFile.binwrite(\"/path/to/volume/smp0_edited.bin\", data)\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/8bit-mate/smp_tool.rb.\n\n## Special thanks to\n\n- **[Piotr Piatek](http://www.pisi.com.pl/piotr433/index.htm)**: the indisputable master of the MK90 who developed lots of great software tools and hardware devices for the machine;\n\n- **[azya52](https://github.com/azya52/)**: the developer of the PIMP cartridge. This device made possible to load large volumes on a real MK90;\n\n- **[flint-1979](https://phantom.sannata.org/memberlist.php?mode=viewprofile\u0026u=6909)**: testing on the real machines with both BASIC v.1.0 and v.2.0;\n\n- **[BitSavers project](http://www.bitsavers.org/)**: the largest source of the DEC PDP-11 / RT-11 and other legacy systems documentation.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8bit-mate%2Fsmp_tool.rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F8bit-mate%2Fsmp_tool.rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F8bit-mate%2Fsmp_tool.rb/lists"}