Permalink
Browse files

Cherry pick some ZVM changes to fix #18

  • Loading branch information...
curiousdannii committed Dec 3, 2017
1 parent bc0c007 commit 87fa74a63f8f585b1bac31b589f50e0db8440196
Showing with 15 additions and 36 deletions.
  1. BIN lib/parchment-for-inform7.zip
  2. +9 −31 lib/zvm.debug.js
  3. +3 −3 lib/zvm.min.js
  4. +2 −1 package.json
  5. +1 −1 src/ifvms.js
Binary file not shown.
View
@@ -3,9 +3,9 @@
ZVM - the ifvms.js Z-Machine (versions 5 and 8)
===============================================
Built: 2016-07-21
Built: 2017-12-03
Copyright (c) 2011-2016 The ifvms.js team
Copyright (c) 2011-2017 The ifvms.js team
BSD licenced
http://github.com/curiousdannii/ifvms.js
@@ -2587,7 +2587,7 @@ TODO:
test: function( bitmap, flag )
{
return bitmap & flag === flag;
return ( bitmap & flag ) === flag;
},
test_attr: function( object, attribute )
@@ -2771,7 +2771,6 @@ TODO:
result = [],
resulttexts = [],
usesabbr,
tenbit,
unicodecount = 0;
// Check if this one's been cached already
@@ -2828,28 +2827,7 @@ TODO:
// Check we have enough Z-chars left.
if ( i + 1 < buffer.length )
{
tenbit = buffer[i++] << 5 | buffer[i++];
// A regular character
if ( tenbit < 768 )
{
result.push( tenbit );
}
// 1.1 spec Unicode strings - not the most efficient code, but then noone uses this
else
{
tenbit -= 767;
unicodecount += tenbit;
temp = i;
i = ( i % 3 ) + 3;
while ( tenbit-- )
{
result.push( -1 );
resulttexts.push( String.fromCharCode( buffer[i] << 10 | buffer[i + 1] << 5 | buffer[i + 2] ) );
// Set those characters so they won't be decoded again
buffer[i++] = buffer[i++] = buffer[i++] = 0x20;
}
i = temp;
}
result.push( buffer[i++] << 5 | buffer[i++] );
}
}
// Regular characters
@@ -2917,16 +2895,16 @@ TODO:
{
zchars.push( 5, temp + 6 );
}
// 10-bit ZSCII / Unicode table
else if ( temp = this.reverse_unicode_table[achar] )
{
zchars.push( 5, 6, temp >> 5, temp & 0x1F );
}
// Pad character
else if ( achar === undefined )
{
zchars.push( 5 );
}
// 10-bit ZSCII
else
{
zchars.push( 5, 6, achar >> 5, achar & 0x1F );
}
}
zchars.length = 9;
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -12,6 +12,7 @@
"bugs": "https://github.com/curiousdannii/parchment/issues",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-cli": "^1.2.0",
"grunt-contrib-concat": "~0.2.0",
"grunt-contrib-cssmin": "~0.6.0",
"grunt-contrib-jshint": "~0.4.3",
@@ -23,4 +24,4 @@
"scripts": {
"build": "grunt"
}
}
}

0 comments on commit 87fa74a

Please sign in to comment.