I6 feature request: padding after dictionary table?

I would like to try something on Glulx that would involve modifying the game’s dictionary, specifically adding entries. As I read the spec and parser code, this seems like it should be theoretically possible so long as alphabetical order of the dictionary entries is maintained. However, it looks like trying to extend the table would overwrite other meaningful information.

I’ve combed through the reference addendum, and I don’t see anything that would let this be requested as a compilation parameter, but it seems like it should be pretty simple to implement. Maybe a DICT_WORDS_PADDING=N parameter that would create space for N additional entries (the additional space initially being filled with zeroes) at the end of the table?

In Glulx the dictionary is the last thing in the memory map. So you can use the $MEMORY_MAP_EXTENSION option:

./inform -G '$MEMORY_MAP_EXTENSION=256' -z test.inf

        +---------------------+   000000
Read-   |       header        |   
 only   +=====================+   000024
memory  |  memory layout id   |   
        +---------------------+   00003c
        |        code         |   
        +---------------------+   00005d
        | string decode table |   
        + - - - - - - - - - - +   00019e
        |       strings       |   
        +=====================+   000200
Dynamic |  global variables   |   
memory  + - - - - - - - - - - +   00022c
        |       arrays        |   
        +---------------------+   00022c
        | printing variables  |   
        +---------------------+   000230
        |       objects       |   
        + - - - - - - - - - - +   0002b0
        |   property values   |   
        + - - - - - - - - - - +   000314
        |  property defaults  |   
        + - - - - - - - - - - +   000324
        | class numbers table |   
        + - - - - - - - - - - +   000338
        |   id names table    |   
        +---------------------+   00046c
        |    grammar table    |   
        + - - - - - - - - - - +   000470
        |       actions       |   
        +---------------------+   000474
        |     dictionary      |   
        +=====================+   000500
Runtime |       (empty)       |
  extn  +---------------------+   000600
1 Like

Oh, terrific – that will work nicely. Thank you, zarf!

I never thought to check the I6 compiler’s memory map output to see where the dictionary was. (Didn’t it used to say that was only for Z-machine?) I see that the Glulx spec’s section on the memory map doesn’t show something with the granularity of the compiler’s -z output, and the Glulx Inform Technical Reference doesn’t have it, either; it might be worth adding that to the technical reference as an example of the layout of a compiled game (with a note in the spec to see that for more information).

1 Like