Difference between revisions of "Frolg"

From IFWiki
Jump to: navigation, search
Line 18: Line 18:
 
* Graphics other than CP437 and Font 3 are not available.
 
* Graphics other than CP437 and Font 3 are not available.
 
* Font 3 is available if bit3 of flags 2 is set.
 
* Font 3 is available if bit3 of flags 2 is set.
* CP437 is available if bit2 of flags 2 is set.
+
* CP437 is available if bit2 of flags 2 is set (it must be set in the story file, and cleared by the interpreter if it is using standard ZSCII).
 
* Z-characters and abbreviation tables are in version 2 format.
 
* Z-characters and abbreviation tables are in version 2 format.
 
* Packed addresses have the version 8 format, but with the routine and string offsets of version 6.
 
* Packed addresses have the version 8 format, but with the routine and string offsets of version 6.

Revision as of 18:19, 15 April 2013

Frolg is a Z-machine assembler written by User:Zzo38. It is written in C, and is licensed under GNU GPL 3 or later version. Both Inform and Infocom names for opcodes are supported, and macros are also supported. All Z-machine versions from 1 to 9 are supported.

It is designed to be used with the Berzio compiler and for writing the codes yourself, although the author suggests also writing programs to convert text-adventure games from other systems into Z-machine, possibly going through Frolg or another assembler.

Z-machine Version 9 Specification

  • It is mostly version 5.
  • Input is not converted to lowercase except for lexical analysis.
  • Unicode is not available (the interpreter need not care).
  • ZSCII output codes 128 to 255 are always CP437.
  • ZSCII output codes 256 to 287 are CP437 graphics 0 to 31.
  • Colors 10 (grey) and 13 (input) are available.
  • Addresses in the header are given as half of the actual address.
  • Property table addresses are also given as half of the actual address.
  • Due to this, addresses received by instructions are modulo 65536.
  • The old flags 1 is at address 3 in the header (allowing Tandy mode to be set).
  • If bit4 of the old flags 1 is initially clear, it enables the version 1 status line.
  • Flags 2 bit6 can be set/cleared by the interpreter.
  • Graphics other than CP437 and Font 3 are not available.
  • Font 3 is available if bit3 of flags 2 is set.
  • CP437 is available if bit2 of flags 2 is set (it must be set in the story file, and cleared by the interpreter if it is using standard ZSCII).
  • Z-characters and abbreviation tables are in version 2 format.
  • Packed addresses have the version 8 format, but with the routine and string offsets of version 6.
  • Save/restore opcodes act as in version 4 (the version 5 save/restore opcodes are illegal).
  • Sound effects 3 to 65535 are that note in Hz; "prepare" and "finish with" are illegal.
  • The repeat count for sound effects means the count in 1/10 sec; don't use 0 and 255.
  • Executing VAR:238 with a parameter value other than 1 is illegal (the interpreter need not care).
  • Total dynamic + static memory can be up to 128K instead of 64K.
  • In two size-and-number bytes properties, bit6 of the property number allows properties 64 to 127.
  • Properties 64 to 127 cannot be encoded in short form and always have a default value of zero.
  • 2OP:17 is still allowed on properties numbered 64 to 127 if the length is 1 or 2.
  • In two size-and-number bytes properties, bit6 of the size is used too, and a size of 0 means 128.

External resources

This article is a stub. You can help IFWiki by expanding it.