From 741209e2253df9450ad9d99daf73ced8f33a6387 Mon Sep 17 00:00:00 2001
From: Graham Nelson
Date: Sat, 1 May 2021 18:18:59 +0100
Subject: [PATCH] Scene status and changing made synoptic
---
docs/codegen-module/3-act.html | 2 +-
docs/codegen-module/3-act2.html | 2 +-
docs/codegen-module/3-chr.html | 2 +-
docs/codegen-module/3-ext.html | 2 +-
docs/codegen-module/3-ins.html | 101 +++++++++
docs/codegen-module/3-lt.html | 2 +-
docs/codegen-module/3-prp.html | 2 +-
docs/codegen-module/3-rls.html | 2 +-
docs/codegen-module/3-rlt.html | 2 +-
docs/codegen-module/3-rsp.html | 2 +-
docs/codegen-module/3-scn.html | 213 ++++++++++++++++++
docs/codegen-module/3-su.html | 25 +-
docs/codegen-module/3-tbl.html | 2 +-
docs/codegen-module/4-cg.html | 2 +-
docs/codegen-module/index.html | 10 +
docs/core-module/1-htc.html | 1 +
docs/if-module/3-scn.html | 7 +-
docs/runtime-module/2-ec.html | 32 +--
docs/runtime-module/2-emt.html | 2 +-
docs/runtime-module/2-hrr.html | 86 ++++---
docs/runtime-module/5-ins.html | 23 +-
docs/runtime-module/5-rsfk.html | 2 +-
docs/runtime-module/6-scn.html | 161 ++++++-------
inform7/Figures/memory-diagnostics.txt | 64 +++---
inform7/Figures/timings-diagnostics.txt | 37 +--
.../core-module/Chapter 1/How To Compile.w | 1 +
inform7/if-module/Chapter 3/Scenes.w | 7 +-
inform7/runtime-module/Chapter 2/Hierarchy.w | 46 +++-
inform7/runtime-module/Chapter 5/Instances.w | 21 +-
inform7/runtime-module/Chapter 6/Scenes.w | 144 +++++-------
inter/codegen-module/Chapter 3/Instances.w | 20 ++
inter/codegen-module/Chapter 3/Scenes.w | 123 ++++++++++
.../Chapter 3/Synoptic Utilities.w | 13 ++
inter/codegen-module/Contents.w | 2 +
34 files changed, 858 insertions(+), 305 deletions(-)
create mode 100644 docs/codegen-module/3-ins.html
create mode 100644 docs/codegen-module/3-scn.html
create mode 100644 inter/codegen-module/Chapter 3/Instances.w
create mode 100644 inter/codegen-module/Chapter 3/Scenes.w
diff --git a/docs/codegen-module/3-act.html b/docs/codegen-module/3-act.html
index b3345a2f8..b8f78a643 100644
--- a/docs/codegen-module/3-act.html
+++ b/docs/codegen-module/3-act.html
@@ -201,7 +201,7 @@ of packages of type
+
+
+ Instances -
+ To renumber the instances and construct suitable functions and arrays.
+
Properties -
@@ -218,6 +223,11 @@
Chronology -
To construct suitable functions and arrays to manage past-tense references in code.
+
+
+ Scenes -
+ To renumber the scenes and construct suitable functions and arrays.
+
diff --git a/docs/core-module/1-htc.html b/docs/core-module/1-htc.html
index 148606cb3..fbfe777bf 100644
--- a/docs/core-module/1-htc.html
+++ b/docs/core-module/1-htc.html
@@ -326,6 +326,7 @@ so on. Those absolute basics are made here.
BENCH(RTRules::rulebook_var_creators)
BENCH(RTRules::compile_rulebooks)
BENCH(RTRules::compile_metadata)
+ BENCH(RTInstances::compile_metadata)
BENCH(RTProperties::compile_metadata)
BENCH(RTActivities::activity_var_creators)
BENCH(RTVerbs::ConjugateVerb)
diff --git a/docs/if-module/3-scn.html b/docs/if-module/3-scn.html
index f4f744a1d..f657b4893 100644
--- a/docs/if-module/3-scn.html
+++ b/docs/if-module/3-scn.html
@@ -97,8 +97,11 @@ to non-trivial functions as well as tables of data.
int Scenes::production_line(int stage, int debugging,
stopwatch_timer *sequence_timer) {
if (stage == INTER1_CSEQ) {
- BENCH(RTScenes::DetectSceneChange_routine);
- BENCH(RTScenes::ShowSceneStatus_routine);
+ BENCH(RTScenes::compile_change_functions);
+ BENCH(RTScenes::compile_show_status_functions);
+ }
+ if (stage == INTER3_CSEQ) {
+ BENCH(RTScenes::compile_synoptic_resources);
}
return FALSE;
}
diff --git a/docs/runtime-module/2-ec.html b/docs/runtime-module/2-ec.html
index df154b935..3bf0d93ae 100644
--- a/docs/runtime-module/2-ec.html
+++ b/docs/runtime-module/2-ec.html
@@ -108,10 +108,10 @@ instruction last emitted, not after it.
● EmitCode::up then returns us back to where we were.
-void EmitCode::up(void) {
+void EmitCode::up(void) {
Produce::up(Emit::tree());
}
-void EmitCode::down(void) {
+void EmitCode::down(void) {
Produce::down(Emit::tree());
}
@@ -127,7 +127,7 @@ have made, net:
-void EmitCode::code(void) {
+void EmitCode::code(void) {
Produce::code(Emit::tree());
}
@@ -140,7 +140,7 @@ start of a function.
-void EmitCode::comment(text_stream *text) {
+void EmitCode::comment(text_stream *text) {
if (Functions::a_function_is_being_compiled() == FALSE)
internal_error("code comment emitted outside function");
inter_ti ID = Inter::Warehouse::create_text(Emit::warehouse(), Emit::package());
@@ -153,7 +153,7 @@ start of a function.
-void EmitCode::val_number(inter_ti N) {
+void EmitCode::val_number(inter_ti N) {
Produce::val(Emit::tree(), K_number, LITERAL_IVAL, N);
}
@@ -165,11 +165,11 @@ start of a function.
Produce::val(Emit::tree(), K_truth_state, LITERAL_IVAL, 0);
}
-void EmitCode::val_iname(kind *K, inter_name *iname) {
+void EmitCode::val_iname(kind *K, inter_name *iname) {
Produce::val_iname(Emit::tree(), K, iname);
}
-void EmitCode::val_text(text_stream *text) {
+void EmitCode::val_text(text_stream *text) {
Produce::val_text(Emit::tree(), text);
}
@@ -185,7 +185,7 @@ start of a function.
Produce::val_nothing(Emit::tree());
}
-void EmitCode::val_symbol(kind *K, inter_symbol *S) {
+void EmitCode::val_symbol(kind *K, inter_symbol *S) {
Produce::val_symbol(Emit::tree(), K, S);
}
@@ -205,7 +205,7 @@ start of a function.
Produce::ref_iname(Emit::tree(), K, iname);
}
-void EmitCode::ref_symbol(kind *K, inter_symbol *S) {
+void EmitCode::ref_symbol(kind *K, inter_symbol *S) {
Produce::ref_symbol(Emit::tree(), K, S);
}
@@ -213,11 +213,11 @@ start of a function.
-void EmitCode::inv(inter_ti bip) {
+void EmitCode::inv(inter_ti bip) {
Produce::inv_primitive(Emit::tree(), bip);
}
-void EmitCode::call(inter_name *fn_iname) {
+void EmitCode::call(inter_name *fn_iname) {
Produce::inv_call_iname(Emit::tree(), fn_iname);
}
@@ -231,11 +231,11 @@ current function:
-void EmitCode::rtrue(void) {
+void EmitCode::rtrue(void) {
Produce::rtrue(Emit::tree());
}
-void EmitCode::rfalse(void) {
+void EmitCode::rfalse(void) {
Produce::rfalse(Emit::tree());
}
@@ -256,15 +256,15 @@ advance:
-inter_symbol *EmitCode::reserve_label(text_stream *identifier) {
+inter_symbol *EmitCode::reserve_label(text_stream *identifier) {
return Produce::reserve_label(Emit::tree(), identifier);
}
-void EmitCode::place_label(inter_symbol *lab_s) {
+void EmitCode::place_label(inter_symbol *lab_s) {
Produce::place_label(Emit::tree(), lab_s);
}
-void EmitCode::lab(inter_symbol *L) {
+void EmitCode::lab(inter_symbol *L) {
Produce::lab(Emit::tree(), L);
}
diff --git a/docs/runtime-module/2-emt.html b/docs/runtime-module/2-emt.html
index 466745ea8..be02c43f8 100644
--- a/docs/runtime-module/2-emt.html
+++ b/docs/runtime-module/2-emt.html
@@ -381,7 +381,7 @@ it represents an actual number at run-time, the second if not:
-inter_name *Emit::iname_constant(inter_name *con_iname, kind *K, inter_name *val_iname) {
+inter_name *Emit::iname_constant(inter_name *con_iname, kind *K, inter_name *val_iname) {
packaging_state save = Packaging::enter_home_of(con_iname);
inter_symbol *con_s = Produce::define_symbol(con_iname);
inter_symbol *kind_s = Produce::kind_to_symbol(K);
diff --git a/docs/runtime-module/2-hrr.html b/docs/runtime-module/2-hrr.html
index aa7e102a8..05807cd52 100644
--- a/docs/runtime-module/2-hrr.html
+++ b/docs/runtime-module/2-hrr.html
@@ -72,7 +72,7 @@ function togglePopup(material_id) {
To provide an enforced structure and set of naming conventions for packages and names in the Inter code we generate.
-
+
@@ -286,10 +286,11 @@ that the compiler can refer to it.
Establish relations8.1.36;
Establish rulebooks8.1.38;
Establish rules8.1.40;
- Establish tables8.1.42;
- Establish variables8.1.44;
- Establish enclosed matter8.1.46;
- The rest8.1.48;
+ Establish scenes8.1.42;
+ Establish tables8.1.44;
+ Establish variables8.1.46;
+ Establish enclosed matter8.1.48;
+ The rest8.1.50;
enum INSTANCES_HAP
enum INSTANCE_NAME_METADATA_HL
+enum INSTANCE_VALUE_METADATA_HL
+enum INSTANCE_KIND_METADATA_HL
+enum INSTANCE_IS_SCENE_METADATA_HL
+enum INSTANCE_SSF_METADATA_HL
+enum INSTANCE_SCF_METADATA_HL
enum INSTANCE_HL
+enum SCENE_STATUS_FN_HL
+enum SCENE_CHANGE_FN_HL
enum BACKDROP_FOUND_IN_FN_HL
enum REGION_FOUND_IN_FN_HL
enum SHORT_NAME_FN_HL
@@ -864,7 +872,14 @@ that the compiler can refer to it.
H_BEGIN(HierarchyLocations::local_submodule(instances))
H_BEGIN_AP(INSTANCES_HAP, I"instance", I"_instance")
H_C_U(INSTANCE_NAME_METADATA_HL, I"^name")
+ H_C_U(INSTANCE_VALUE_METADATA_HL, I"^value")
+ H_C_U(INSTANCE_KIND_METADATA_HL, I"^kind")
+ H_C_U(INSTANCE_IS_SCENE_METADATA_HL, I"^is_scene")
+ H_C_U(INSTANCE_SSF_METADATA_HL, I"^scene_status_fn")
+ H_C_U(INSTANCE_SCF_METADATA_HL, I"^scene_change_fn")
H_C_U(INSTANCE_HL, I"I")
+ H_F_U(SCENE_STATUS_FN_HL, I"scene_status_fn")
+ H_F_U(SCENE_CHANGE_FN_HL, I"scene_change_fn")
H_F_U(BACKDROP_FOUND_IN_FN_HL, I"backdrop_found_in_fn")
H_F_G(SHORT_NAME_FN_HL, I"short_name_fn", I"SN_R")
H_F_G(SHORT_NAME_PROPERTY_FN_HL, I"short_name_property_fn", I"SN_R_A")
@@ -882,8 +897,6 @@ that the compiler can refer to it.
enum INITIAL_MAX_SCORE_HL
enum NO_DIRECTIONS_HL
-enum SHOWSCENESTATUS_HL
-enum DETECTSCENECHANGE_HL
enum MAP_STORAGE_HL
enum INITIALSITUATION_HL
enum PLAYER_OBJECT_INIS_HL
@@ -900,18 +913,19 @@ that the compiler can refer to it.
submodule_identity *interactive_fiction = Packaging::register_submodule(I"interactive_fiction");
- H_BEGIN(HierarchyLocations::synoptic_submodule(I, interactive_fiction))
- H_C_T(INITIAL_MAX_SCORE_HL, I"INITIAL_MAX_SCORE")
- H_C_T(NO_DIRECTIONS_HL, I"No_Directions")
- H_F_T(SHOWSCENESTATUS_HL, I"show_scene_status_fn", I"ShowSceneStatus")
- H_F_T(DETECTSCENECHANGE_HL, I"detect_scene_change_fn", I"DetectSceneChange")
- H_C_T(MAP_STORAGE_HL, I"Map_Storage")
- H_C_T(INITIALSITUATION_HL, I"InitialSituation")
+ H_BEGIN(HierarchyLocations::generic_submodule(I, interactive_fiction))
H_C_T(PLAYER_OBJECT_INIS_HL, I"PLAYER_OBJECT_INIS")
H_C_T(START_OBJECT_INIS_HL, I"START_OBJECT_INIS")
H_C_T(START_ROOM_INIS_HL, I"START_ROOM_INIS")
H_C_T(START_TIME_INIS_HL, I"START_TIME_INIS")
H_C_T(DONE_INIS_HL, I"DONE_INIS")
+ H_END
+
+ H_BEGIN(HierarchyLocations::synoptic_submodule(I, interactive_fiction))
+ H_C_T(INITIAL_MAX_SCORE_HL, I"INITIAL_MAX_SCORE")
+ H_C_T(NO_DIRECTIONS_HL, I"No_Directions")
+ H_C_T(MAP_STORAGE_HL, I"Map_Storage")
+ H_C_T(INITIALSITUATION_HL, I"InitialSituation")
H_BEGIN_AP(DIRECTIONS_HAP, I"direction", I"_direction")
H_C_G(DIRECTION_HL, I"DirectionObject")
H_END
@@ -1322,7 +1336,23 @@ that the compiler can refer to it.
H_END
- This code is used in §8.1.
-
+
+
+enum SHOWSCENESTATUS_HL
+enum DETECTSCENECHANGE_HL
+
+
+
+
+ submodule_identity *scenes = Packaging::register_submodule(I"scenes");
+ H_BEGIN(HierarchyLocations::synoptic_submodule(I, scenes))
+ H_F_T(SHOWSCENESTATUS_HL, I"show_scene_status_fn", I"ShowSceneStatus")
+ H_F_T(DETECTSCENECHANGE_HL, I"detect_scene_change_fn", I"DetectSceneChange")
+ H_END
+
+- This code is used in §8.1.
+
enum TABLES_HAP
enum TABLE_NAME_METADATA_HL
@@ -1342,7 +1372,7 @@ that the compiler can refer to it.
enum TC_KOV_HL
enum TB_BLANKS_HL
-
@@ -1382,13 +1412,13 @@ that the compiler can refer to it.
H_END
- This code is used in §8.1.
-
+
enum VARIABLES_HAP
enum VARIABLE_NAME_METADATA_HL
enum VARIABLE_HL
-
@@ -1402,7 +1432,7 @@ that the compiler can refer to it.
H_END
- This code is used in §8.1.
-
+
enum LITERALS_HAP
enum TEXT_LITERAL_HL
@@ -1420,7 +1450,7 @@ that the compiler can refer to it.
enum GROUPS_TOGETHER_HAP
enum GROUP_TOGETHER_FN_HL
-
@@ -1448,7 +1478,7 @@ that the compiler can refer to it.
H_END
- This code is used in §8.1.
-
+
enum K_OBJECT_XPACKAGE from 0
enum K_NUMBER_XPACKAGE
@@ -1486,7 +1516,7 @@ that the compiler can refer to it.
enum TABLEOFEXTERNALFILES_HL
enum PRINT_SCENE_HL
-
@@ -2157,7 +2187,7 @@ at which this array should be placed, by calling, e.g.,
-inter_name *Hierarchy::find(int id) {
+inter_name *Hierarchy::find(int id) {
return HierarchyLocations::find(Emit::tree(), id);
}
@@ -2180,7 +2210,7 @@ package holding it. (