Skip to content

Commit

Permalink
Added (non)handling of deprecated blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
kmp1 committed Feb 21, 2015
1 parent 4e66885 commit c2d5350
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/tzx.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ var tzx = (function () {
return wrapped;
}

function handleDeprecatedBlock(blockName) {
throw "The block " + blockName + " is deprecated and, as such, " +
" tzx.js doesn't support it - you should upgrade the tzx file.";
}

/****** End of Functions For Validating Input Data ******/

/****** Functions For Dealing With Input Data ******/
Expand Down Expand Up @@ -745,6 +750,16 @@ var tzx = (function () {
}
},

/** Handles block ID 16 C64 ROM type data block (DEPRECATED) */
block16: function () {
handleDeprecatedBlock("ID 16 C64 ROM type data block");
},

/** Handles block ID 17 C64 turbo tape data block (DEPRECATED)*/
block17: function () {
handleDeprecatedBlock("ID 17 C64 turbo tape data block");
},

/**
* Handles block ID 20 Pause (silence) or 'Stop the tape'
* @param {Integer} i The index at which the block ID is
Expand Down Expand Up @@ -932,6 +947,11 @@ var tzx = (function () {
return i + (count * 3) + 1;
},

/** Handles block ID 34 Emulation info (DEPRECATED) */
block34: function () {
handleDeprecatedBlock("ID 34 Emulation info");
},

/**
* Handles block ID 35 Custom info block
* @param {Integer} i The index at which the block ID is
Expand All @@ -957,6 +977,11 @@ var tzx = (function () {
return i + blockDetails.customInfoLength + 12;
},

/** Handles block ID 40 Snapshot block (DEPRECATED) */
block40: function () {
handleDeprecatedBlock("ID 40 Snapshot block");
},

/**
* Handles block ID 5A "Glue" block (90 dec, ASCII Letter 'Z')
* @param {Integer} i The index at which the block ID is
Expand Down

0 comments on commit c2d5350

Please sign in to comment.