Skip to content

Commit

Permalink
Fix the restoration of locals when autorestoring (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
curiousdannii committed Mar 8, 2017
1 parent dcb4268 commit 6362cf6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ifvms",
"title": "ifvms.js",
"version": "1.1.0",
"version": "1.1.1",
"description": "The Interactive Fiction Virtual Machines Suite - in Javascript",
"author": "Dannii Willis <[email protected]>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/zvm/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ module.exports = {
if ( !this.mainwin )
{
this.mainwin = Glk.glk_window_open( 0, 0, 0, 3, 201 );
Glk.glk_set_window( this.mainwin )
if ( this.version3 )
{
this.statuswin = Glk.glk_window_open( this.mainwin, 0x12, 1, 4, 202 );
Expand All @@ -119,7 +120,6 @@ module.exports = {
}
}
}
this.set_window( this.io.currentwin )
},

erase_line: function( value )
Expand Down
6 changes: 3 additions & 3 deletions src/zvm/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,10 +779,9 @@ module.exports = {
var memory = this.m,
quetzal = new file.Quetzal(),
stack = utils.MemoryView( this.stack.buffer.slice() ),
frames = this.frames.slice(),
zeroes = 0,
i, j,
frameptr,
frameptr = this.frameptr,
abyte;

// IFhd chunk
Expand Down Expand Up @@ -827,11 +826,12 @@ module.exports = {
// Stacks
// Set the current sp
stack.setUint16( frameptr + 6, this.sp );
frames.push( this.frameptr );

// Swap the bytes of the locals and stacks
if ( littleEndian && !autosaving )
{
const frames = this.frames.slice()
frames.push( frameptr )
for ( i = 0; i < frames.length; i++ )
{
frameptr = frames[i];
Expand Down

0 comments on commit 6362cf6

Please sign in to comment.