The Simple Multimedia Effects Extension
While the Bisquixe interpreter grants browser support, it does not add new features or capabilities to our Inform projects. To actually use Bisquixe in our code, we will need to install an extension.
Bisquixe currently supports Inform 10.1 and compiler 6M62. Depending on the version of Inform used, authors will either require “Simple Multimedia Effects” or “Simple Multimedia Effects for v10.” Both are downloadable here.
Once downloaded, it must be installed. In order to install extensions from within the Inform IDE, simply click the “file” drop-down menu at upper left and select “install extension.”
!Important
At the time of this writing, both versions of “Simple Multimedia Effects” have a hard limit of 64 characters that our CSS code can contain. This will likely be adjusted in future versions of the extension, but, for now, I recommend that authors add the folowing code to either individual projects or, perhaps better, to the “Simple Multimedia Effects” and “Simple Multimedia Effects for v10” extensions to increase the character limit (thanks to @draconis for these solutions!).
Inform 10 code
Include (- Constant GG_ANYTOSTRING_LEN 258; -) replacing "GG_ANYTOSTRING_LEN".
Inform 9 code
Include (-
! Glulx_PrintAnything() <nothing printed>
! Glulx_PrintAnything(0) <nothing printed>
! Glulx_PrintAnything("string"); print (string) "string";
! Glulx_PrintAnything('word') print (address) 'word';
! Glulx_PrintAnything(obj) print (name) obj;
! Glulx_PrintAnything(obj, prop) obj.prop();
! Glulx_PrintAnything(obj, prop, args...) obj.prop(args...);
! Glulx_PrintAnything(func) func();
! Glulx_PrintAnything(func, args...) func(args...);
[ Glulx_PrintAnything _vararg_count obj mclass;
if (_vararg_count == 0) return;
@copy sp obj;
_vararg_count--;
if (obj == 0) return;
if (obj->0 == $60) {
! Dictionary word. Metaclass() can't catch this case, so we do it manually
print (address) obj;
return;
}
mclass = metaclass(obj);
switch (mclass) {
nothing:
return;
String:
print (string) obj;
return;
Routine:
! Call the function with all the arguments which are already
! on the stack.
@call obj _vararg_count 0;
return;
Object:
if (_vararg_count == 0) {
print (name) obj;
}
else {
! Push the object back onto the stack, and call the
! veneer routine that handles obj.prop() calls.
@copy obj sp;
_vararg_count++;
@call CA__Pr _vararg_count 0;
}
return;
}
];
[ Glulx_PrintAnyToArray _vararg_count arr arrlen str oldstr len;
@copy sp arr;
@copy sp arrlen;
_vararg_count = _vararg_count - 2;
oldstr = glk_stream_get_current();
str = glk_stream_open_memory(arr, arrlen, 1, 0);
if (str == 0) return 0;
glk_stream_set_current(str);
@call Glulx_PrintAnything _vararg_count 0;
glk_stream_set_current(oldstr);
@copy $ffffffff sp;
@copy str sp;
@glk $0044 2 0; ! stream_close
@copy sp len;
@copy sp 0;
return len;
];
Array AnyToStrArr -> GG_ANYTOSTRING_LEN+1;
[ Glulx_ChangeAnyToCString _vararg_count ix len;
ix = GG_ANYTOSTRING_LEN-2;
@copy ix sp;
ix = AnyToStrArr+1;
@copy ix sp;
ix = _vararg_count+2;
@call Glulx_PrintAnyToArray ix len;
AnyToStrArr->0 = $E0;
if (len >= GG_ANYTOSTRING_LEN)
len = GG_ANYTOSTRING_LEN-1;
AnyToStrArr->(len+1) = 0;
return AnyToStrArr;
];
-) instead of "Glulx-Only Printing Routines" in "Glulx.i6t".
Use maximum Glk string length of at least 258 translates as (- Constant GG_ANYTOSTRING_LEN = {N}+2; -).
