GithubHelp home page GithubHelp logo

lampmerchant / cassbox Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 26 KB

Utility to create disk images which emulate the IBM PC 5150 cassette interface in DOSBox.

License: GNU General Public License v3.0

Python 100.00%
cassette cassette-tape ibm-pc retrocomputing 8086

cassbox's Introduction

CassBox

Utility to create disk images which emulate the IBM PC 5150 cassette interface in DOSBox.

Elevator Pitch

CassBox concatenates its own code together with an IBM PC BASIC ROM dump and, optionally, a cassette file to create a 320 KB (DS/DD, 8 sectors/track) diskette image which can be booted in DOSBox. The code loads itself and the BASIC ROM dump into the top of the 640 KB conventional RAM space and installs a handler for the cassette interrupt which emulates the cassette interface.

Caveats

CassBox is dependent on permissive behavior of INT 13 (specifically, the ability for disk reads to cross track boundaries) and accordingly may not work on real hardware.

CassBox assumes the target system has 640 KB of RAM and does not adjust for systems with less.

CassBox loads BASIC into RAM, not ROM. While this is not known to cause any issues, it is possible for the BASIC ROM-in-RAM to become corrupted by an errant write.

Currently the only way to wind or rewind the tape is to use POKEs in BASIC.

Technical Details

CAS Format

The format of cassette files used by this program is the CAS format. CAS files are simply the bytes that would be written to the cassette, including the leader of '1' bits (grouped into 0xFF bytes) followed by the sync '0' bit (represented as an 0xFE byte). There is no way to represent silence in a CAS file, so one section is immediately followed by the next.

Winding/Rewinding

The current position on the cassette is stored in four bytes:

97C0:0000 - Byte offset in block (low byte)
97C0:0001 - Byte offset in block (high byte)
97C0:0002 - Block number (low byte)
97C0:0003 - Block number (high byte)

Byte offset in block ranges from 0 to 511, block number ranges from 0 to 574. When changing block number, byte offset MUST be set to 0 in order to ensure that the block is loaded from disk on the next cassette read.

Example (setting position to the beginning of block 259):

DEF SEG = &H97C0
POKE 0, 0
POKE 1, 0
POKE 2, 3  'Low byte of block number
POKE 3, 1  'High byte of block number, (256 * 1) + 3 = 259

BASIC ROM Dumps

IBM PC BASIC is the copyrighted property of IBM and/or Microsoft and cannot be posted here. For ease of use, if pointed to a MAME ROMs directory, CassBox will attempt to find and use the ROM dumps used by MAME. Appropriate BASIC ROMs can be found associated with the ibm5150 machine and possibly also others.

cassbox's People

Contributors

lampmerchant avatar

Watchers

 avatar

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.