+{
+ int ix, totalvar;
+
+ no_arrays = 0;
+ if (!glulx_mode) {
+ no_globals = 0;
+ /* The compiler-defined globals start at 239 and go down, so
+ we need to initialize the entire list from the start. */
+ totalvar = MAX_ZCODE_GLOBAL_VARS;
+ }
+ else {
+ /* The compiler-defined globals run from 0 to 10. */
+ no_globals = 11;
+ totalvar = no_globals;
+ }
+
+ ensure_memory_list_available(&global_initial_value_memlist, totalvar);
+ for (ix=0; ix<totalvar; ix++) {
+ global_initial_value[ix] = 0;
+ }
+
+ ensure_memory_list_available(&variables_memlist, MAX_LOCAL_VARIABLES+totalvar);
+ for (ix=0; ix<MAX_LOCAL_VARIABLES+totalvar; ix++) {
+ variables[ix].token = 0;
+ variables[ix].usage = FALSE;
+ }
+
+ dynamic_array_area_size = 0;
+
+ if (!glulx_mode) {
+ int ix;
+ /* This initial segment of dynamic_array_area is never used. It's
+ notionally space for the global variables, but that data is
+ kept in the global_initial_value array. Nonetheless, all the
+ Z-compiler math is set up with the idea that arrays start at
+ WORDSIZE * MAX_ZCODE_GLOBAL_VARS, so we need the blank segment.
+ */
+ dynamic_array_area_size = WORDSIZE * MAX_ZCODE_GLOBAL_VARS;
+ ensure_memory_list_available(&dynamic_array_area_memlist, dynamic_array_area_size);
+ for (ix=0; ix<WORDSIZE * MAX_ZCODE_GLOBAL_VARS; ix++)
+ dynamic_array_area[ix] = 0;
+ }
+