Coder Social home page Coder Social logo

jeffv03 / adf-reader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from steffest/adf-reader-writer

0.0 2.0 0.0 1.08 MB

Read and extract files from Amiga Disk Format (*.adf) files in plain javascript

Home Page: http://www.stef.be/adfviewer

License: MIT License

HTML 8.58% JavaScript 79.79% CSS 11.62%

adf-reader's Introduction

ADF-reader

Read and extract files from Amiga Disk Format (*.adf) files in plain javascript.
Currently only standard Amiga Double Density disk are supported (the 880 kb ones)
For folder and file parsing, only AmigaDOS formatted disks are supported.

The main module is adf.js
It uses a binary file wrapper at file.js for easy parsing binary data.

The rest of the package is a small demo, providing a simple user interface to browse the disk.
Live demo at http://www.stef.be/adfviewer/

It disregards all block checksums and file attributes, which makes it quite useful to salvage files from corrupt disks.
For further digging, you can also extract raw sectors for reconstructing deleted files etc.

I mainly wrote it to quickly inspect .adf files for Amiga music tracker files or Emerald Mine disks without the need to fire up an Amiga Emulator.

Main API:

adf.loadDisk(source)

Loads a disk from an adf file. When source is a string, it's considered as a URI, otherwise you can pass an ArrayBuffer.
All future actions will be done on this disk.

adf.getInfo()

Returns some basic info on the disk.

adf.readRootFolder()

Returns the files and directories of the root folder of the disk.
Each file and folder has a sector parameters which points to the start sector of the file or folder.

adf.readFolderAtSector(sector)

Returns the files and directories of a specific folder that starts at sector.
The starting sector is usually obtained from listing the root folder.
Each file and folder has a sector parameters which points to the start sector of the file or folder.
Each file and folder also has a parent parameter indicating the parent folder so you can traverse back up.

adf.readFileAtSector(sector,includeContent)

Returns the file info (and optional content) of the file starting at sector
The starting sector is usually obtained from listing a folder.
If includeContent is true then the content parameter contains the binary content of the file.

additional API

The following methods are available for low level disk reading

readSector(sector)

Returns a raw sector from the disk.
A sector of a standard Amiga is 512 bytes

getSectorType(sector)

Returns the type of the sector (headerBlock, dataBlock, extentionBlock, ...)

readHeaderBlock(sector)

Returns a parsed headerBlock

readDataBlock(sector)

Returns a parsed dataBlock

readExtentionBlock(sector)

Returns a parsed extentionBlock

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.