1 /* gestalt.c: Glulxe code for gestalt selectors
2 Designed by Andrew Plotkin <erkyrath@eblong.com>
3 http://eblong.com/zarf/glulx/index.html
10 glui32 do_gestalt(glui32 val, glui32 val2)
14 case gestulx_GlulxVersion:
15 return 0x00030101; /* Glulx spec version 3.1.1 */
17 case gestulx_TerpVersion:
18 return 0x00000404; /* Glulxe version 0.4.4 */
20 case gestulx_ResizeMem:
22 return 0; /* The setmemsize opcodes are compiled out. */
23 #else /* FIXED_MEMSIZE */
24 return 1; /* We can handle setmemsize. */
25 #endif /* FIXED_MEMSIZE */
28 return 1; /* We can handle saveundo and restoreundo. */
30 case gestulx_IOSystem:
33 return 1; /* The "null" system always works. */
35 return 1; /* The "filter" system always works. */
37 return 1; /* A Glk library is hooked up. */
43 return 1; /* We can handle Unicode. */
46 return 1; /* We can do mcopy/mzero. */
50 return 0; /* The malloc opcodes are compiled out. */
51 #else /* FIXED_MEMSIZE */
52 return 1; /* We can handle malloc/mfree. */
53 #endif /* FIXED_MEMSIZE */
55 case gestulx_MAllocHeap:
56 return heap_get_start();
58 case gestulx_Acceleration:
59 return 1; /* We can do accelfunc/accelparam. */
61 case gestulx_AccelFunc:
62 if (accel_find_func(val2))
63 return 1; /* We know this accelerated function. */