Coder Social home page Coder Social logo

ifvms.js's People

Contributors

curiousdannii avatar dlehenbauer avatar greenkeeper[bot] avatar walkingeyerobot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ifvms.js's Issues

Text improvements

Some improvements are needed for text:

  • No text literals in JIT-code (for future asm.js work)
  • Make text using abbreviations return an object with a toString function to dynamically access the abbreviations, in case they have changed
  • Add a cache invalidation system for text in dynamic memory

V3/5/8 zvm.min.js

Hi,

Thought I'd posted this, but cannot find it now! Apologies if duped.

Will there be a one-file zvm.min.js release for the new V3 update?

Thanks.

Use ifvms without Glkote-term

I want to use ifvms.js as VM library to create a chatbot. And for that I need some way to pass user input to zvm. Previous versions (probably before adding compatibility with glkote-term) had a bootstrap.js with example how to work with vm programmatically, passing strings to the VM and getting the output.
Now ifvms seems to have tight integration with Glkote-term and I unable to get it working with string input.
So the question is: Are there any options to reduce library functionality to be able to do so?

Feature Request - Remove the CSS part from the core and introduce formatters

Currently the output (at least in the zvm) outputs a property 'css' .

But what if you want to do the formatting yourself? maybe for a console application using vt100 codes or graphics output. If we had an abstract formatting option (maybe mimicing the css properties that would be nice). Then everybody can put their own css color scheme etc?

just my 2c

Store the call stack in the Quetzal format

This should improve performance both when saving, but also when calling new functions and returning as typed arrays will be used.

I also want to do this before adding autosaves (#8).

examples for using ifvms.js (client side + maybe server side too?)

Hi @curiousdannii , over the last weekend I've taken a great interest in Interactive Fiction.

I'm building a work situation simulator and would love to use ifvms.js or other javascript framework to 'play' these kind of situation.

  1. From the code, it's hard to understand how to embed/use ifvms.js in your own code. It would be great if you have some examples to load it

  2. I could not tell if the code only works inside a browser environment or you could also use it in a nodejs backend process that emit events that could be visualised through socket.io on the browser.

I've seen you have some tests, but from what I can judge the are running inside the browser?
My idea is to :

  • keep the state somehow on the server side and use the browser just a visualising aspect. So if people reconnect to the app, they would still be in their current state.
  • it would allow multi-user access of the same game session , which could be great at collaboratively solving sessions
  1. I also like to integrate 'real' events , inside the game. Could the backend play/capture events and execute some stuff and give back some results? Like a bot command on irc or so.

Any hints you can provide here are greatly appreciated!

Use a separate Dataview for RAM

Use a separate Dataview for RAM to try to ensure writes are safely restricted to dynamic (writable) memory. Because it already checks for range errors this should be essentially free!

Maybe one for static memory too? (for @Loadb and @loadw)

TADS 2

Can we write an implementation of the TADS 2 VM?

ReadFilesync - encoding 'binary' does not work on older versions of nodejs

fyi -

      throw new Error('Unknown encoding');                                                                      
            ^                                                                                                   
Error: Unknown encoding                                                                                         
    at Buffer.toString (buffer.js:434:13)                                                                       
    at Object.fs.readFileSync (fs.js:236:33)                                                                    
    at Object.exports.zvm (/Users/patrick/dev/interactive-fiction/if/node_modules/ifvms/dist/bootstrap.js:92:16)
    at Object.<anonymous> (/Users/patrick/dev/interactive-fiction/if/t.js:4:29)                                 
    at Module._compile (module.js:449:26)                                                                       
    at Object.Module._extensions..js (module.js:467:10)                                                         
    at Module.load (module.js:356:32)                                                                           
    at Function.Module._load (module.js:312:12)                                                                 
    at Module.runMain (module.js:492:10)                                                                        
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)                                    

zvm ">command prompt"

zvm version 1.1.6, installed with npm on Windows.

> starting symbol breaks after using backspace. That causes visual artefacts after command launch.

E.g. type >lookk and press Backspace makes leading > to dissappear: look.
Then press Enter and get llook echo.

The same effect when starting previous command(s) from history buffer, available on Up/Down.

Don't require storers etc to be given to inputEvent

As you mentioned before,

in the bootstrap.js you rely on grabbing the previous order and changing just the message property. Can you provide an example on how to calculate/specify a correct inputEvent order?

As far as I can tell, I see you have to specify storer, terminator, len, parse, buffer, response etc...

thanks for helping me here!

Run unit tests in node

It won't take much to run the Praxix unit tests in node (and with a grunt task.)

  • Make ZVM a stand alone node-compatible module
  • Update bootstrap tool for node
  • Add a grunt task

Glulx

Write an implementation of the Glulx VM

An in-range update of yargs is breaking the build 🚨

The dependency yargs was updated from 13.2.2 to 13.2.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

yargs is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 14 commits.

  • a6e67f1 chore(release): 13.2.4
  • fc13476 chore: update standard-verison dependency
  • bf46813 fix(i18n): rename unclear 'implication failed' to 'missing dependent arguments' (#1317)
  • a3a5d05 docs: fix a broken link to MS Terminology Search (#1341)
  • b4f8018 build: add .versionrc that hides test/build
  • 0c39183 chore(release): 13.2.3
  • 08e0746 chore: update deps (#1340)
  • 843e939 docs: make --no- boolean prefix easier to find in the docs (#1338)
  • 84cac07 docs: restore removed changelog of v13.2.0 (#1337)
  • b20db65 fix(deps): upgrade cliui for compatibility with latest chalk. (#1330)
  • c294d1b test: accept differently formatted output (#1327)
  • ac3f10c chore: move .hbs templates into .js to facilitate webpacking (#1320)
  • 0295132 fix: address issues with dutch translation (#1316)
  • 9f2468e doc: clarify parserConfiguration object structure (#1309)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Use more ES6 features

The current consumers of ZVM are node and Lectrote (Chrome) both of which support a lot of ES6 features which could be nice to use (I'm thinking arrow functions and classes mostly, but might as well use consts etc too). It might be time to start using ES6, and then when I bring the current version into Parchment, to use Babel to transpile it to ES5.

Technically this would I think be a semver major change, but version 1.0.0 is only one week old, and everyone who is using it can handle the upgrade.

I think what I would do is set the engine value in package.json, change the ESLint options, and bit by bit upgrade. For a while it would be a bit of a hodgepodge. Unless I decide to upgrade it all in one go.

An in-range update of browserify is breaking the build 🚨

The devDependency browserify was updated from 16.3.0 to 16.4.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

browserify is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 5 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Update API to match Quixe

These follow the changes in erkyrath/glkote#46 , erkyrath/quixe#48 .

In zvm.js, the lines:

	// The Quixe API expects the start function to be named init
	this.init = this.start;

...must be changed to

	// The Quixe API expects the prepare function to be named init
	this.init = this.prepare;

ZVM.prepare() is now an obsolete name; you call ZVM.init(image, opts) first. ZVM.start() is now correctly named and doesn't have to be changed.

(I have made this change in the lectrote repo; see erkyrath/lectrote@ad7f87a .)

Also, in dispatch.js:

set_vm( vm )
{
	this.vm = vm
}

...should now look like

init( opts )
{
	this.vm = opts.vm
}

(In the Lectrote repo, I handled this with a patch line in zplay.html.)

Use glk

Port ZVM to use Glk as its output system. Match Quixe for the general API.

Possibly develop a JS terminal Glk implementation for use as a terminal interpreter.

Accept blorbs

The VMs should probably accept blorbed storyfiles, even if they throw away everything but the bytecode.

They should also accept the data as a string.

Status line disappears in Advent.z5

Split from comment in #29 :

If you type HELP and then immediately quit out of the help menu, you get into a state where the status window is closed and the text that should go to the status window goes to the story window instead.

acceleration and asm.js

It should be possible to use asm.js for a lot of the JIT code.

  • Add a system to mark JIT functions as safe or unsafe
  • Recompile safe functions to call safe functions directly, avoiding the overhead of .call() and .ret()
  • The opcodes will need to be able to produce two sets of code, for normal use, and for asm.js (or perhaps try to use asm.js compatible code for all situations)
  • Memory and stacks need to be combined into a single typed array buffer. Would this be beneficial for non-asm.js code too?

First Jigsaw piece is drawn wrong

I've noticed this before, but I thought it was a glkote error. It's not.

In Jigsaw (R3, serial 951129) if you go E. W. X PIECE you should see a piece with two flat sides and two innie sides. ZVM/Lectrote instead draws one flat, two innie, one outie.

Repeating TURN PIECE four times shows an inconsistent rotation.

The JSON handed to glkote is already wrong. (See attached file, which I copied from the JS console after some debugging.) Either ZVM is making incorrect output calls, or glkapi.js is handling the calls wrong. I haven't looked further into this.

Need help upgrading from 0.1.0

This is an awesome project, and I'd like to stay current, but I'm having a lot of trouble.

I built a small HTTP server on top of ifvms.js here: https://github.com/statico/ifhttp/blob/master/server.js

It powers a text adventure game on my web site here: https://langworth.com

Unfortunately, with the latest code, I'm having a lot of trouble figuring out how to continue emulating this on the server side. Is there a way I can send commands and get output to the current version of the ZVM, similar to how my server works and how the "bootstrap" method worked in v0.1.0?

Or do I need to write a Glk subclass? If so, can you give me some pointers? The Glk and GlkTerm and DumbGlk seem closely tied to readline, and I have no idea what "Dialog" is. Can you give me a few pointers?

I appreciate the help.

Small autorestore issues

I've released a version of Lectrote with autorestore, and it's working pretty good. Thanks! And quote boxes look good too.

A couple of autosave corner cases:

  • If you quit the game and then close the window (while the blue "game session has ended" banner is showing), the VM should do a null autosave -- that is, delete the autosave file. Then the next game the game is launched, it will from the beginning. ZVM currently doesn't do this.

(You can see the support for this in glkapi.js, at the end of the update() function. If has_exited is true, it calls do_autosave() with a negative argument, which tells Quixe to call Dialog.autosave_write with a null snapshot argument.)

  • If an autosave occurs inside the Advent.z5 help menu, the autorestore comes back with the output stream set to the wrong window. The effect is that hitting the arrow keys draws the > selection mark in the story window, instead of updating the status window. (But the next time you select a menu option it all gets back on track.)

MemoryView does not accept plain arrays

There's a line at the top:

if ( typeof buffer === 'number' )

I take it this is intended to convert a plain array to an ArrayBuffer, but it doesn't work as written. I changed it to

if ( typeof buffer[0] === 'number' )

...in my work tree, which I think is what you meant.

Support more Infocom

Support more Infocom games.

  • Sherlock has a bug where it tries to set/check attribute 48

zvm.js fails on Windows w/node v9.2.0

The problem is that the below code from MemoryView() assumes that a TypedArray's view always spans the entire ArrayBuffer.

// Typed arrays
if ( buffer.buffer )
{
    buffer = buffer.buffer;
}

However, this is not necessarily true. Consider:

var a = new ArrayBuffer(10);
var i = new Int8Array(a, 3, 3);
console.log(i.byteLength);                // <- Constructed view is from 3..6
console.log(i.buffer.byteLength);         // <- ...but underlying buffer is still 0..9

In particular, for very short files, node returns the result of fs.readFileSync(..) in an 8kb buffer w/the contents at a non-zero offset. This causes file.identify() to fail immediately since the expected FourCC/zcode version is not at offset 0.

(Simple fix. I'll send a PR shortly.)

"inventory" hangs in Advent.z5

In the attached version of Advent.z5, enter

e
get all
i

The engine locks up (spinning) on the inventory command.

It's definitely the "i" going wrong, not the "get all". The attached save file was made in Frotz with "e", "get all", "save". So the game state is correct there. But when loaded into ZVM, "i" still locks up.

(This is the standard Advent.inf, but I've recompiled it so it's not exactly the same binary as on the Archive. That one shows the same bug, though.) (The files are zipped together because Github won't take raw files of unrecognized type.)

testfiles.zip

@set_font 0

Correctly handle @set_font 0 from the 1.1 spec.

(Also remove the formerly core @gestalt selectors.)

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.