Commit graph

10 commits

Author SHA1 Message Date
Fabian 9b031d4e40 Initial version of save/restore state feature, #18
Everything that is valid json plus arraybuffers and arraybuffer-views
can be restored automatically (without making changes to other code).
Properties that should not be part of the state buffer needed to be
annotated using a magic `_state_skip` property. Shared arraybuffer views
are broken during restoration and also need to be annotated. Adapters
are not (and should never be) saved.

Current limitations:
- Before restoring, the cpu needs to be initialised with the original
  settings. This is not a hard requirement and can be fixed later.
- Pending asynchronous operations are lost. It's a good idea to pause
  the cpu before saving the state.
2014-09-28 22:10:47 -07:00
copy 2a9759537d Minor cleanups 2014-07-13 00:42:39 +02:00
copy c49dcfde3e Report floppy drive even if it is empty. Fixes missing command interpreter in some DOSes booted via CDROM 2014-06-28 00:06:33 +02:00
copy 7a731ca061 Change CPU from closure to prototypical notation.
This change was necessary for several reasons:

- Code is much clearer and more modular
- The CPU object is now serializeable and therefore can be safed and
  restored
- A dynamic translator from instructions to (optimized) JavaScript is
  planned. It would use `new Function` to create functions at runtime.
  Functions created this way don't have access to any scope (except for
  the global scope) and therefore were not have been able to modify
  registers, etc. This is now possible through the cpu object
- Possibly, but not necessarily a speedgain can be achieved.
  See http://mrale.ph/blog/2012/09/23/grokking-v8-closures-for-fun.html

Additionally, some code was moved around.
2014-06-15 22:25:17 +02:00
Fabian c5fd846319 change floppy.js to prototypical definition5~ 2014-05-06 06:17:28 +02:00
copy 42bb76ff31 Move log() out of global 2014-01-10 02:54:47 +01:00
copy 0a59180db4 Preparations for new interface 2014-01-05 03:19:09 +01:00
copy 096001f9c9 Verify buffer read length and offset 2013-11-28 00:59:36 +01:00
copy 73b2861f18 more floppy types 2013-11-07 01:21:28 +01:00
copy 8180d49f24 first public release 2013-11-06 01:12:55 +01:00