diff --git a/hhe/common.rb b/hhe/common.rb index b0a643b..0caf061 100644 --- a/hhe/common.rb +++ b/hhe/common.rb @@ -83,6 +83,9 @@ def set_config(name) for config in configs if name == config::NAME include config + return end end + + raise "Unknown configuration: #{name}" end diff --git a/hhe/dump-strings b/hhe/dump-strings index e796eeb..671bb05 100755 --- a/hhe/dump-strings +++ b/hhe/dump-strings @@ -1,6 +1,9 @@ #!/usr/bin/env ruby require "json" +require "common" + +set_config(ARGV[1]) def read_block(file) result = "" @@ -34,7 +37,7 @@ end File.open(ARGV[0]) do |file| current_str = "" - file.seek(554068 ) + file.seek(STRINGS_OFFSET) offset = 0 start_offset = nil diff --git a/hhe/v1.0/config.rb b/hhe/v1.0/config.rb index fc2e2be..e95dd90 100755 --- a/hhe/v1.0/config.rb +++ b/hhe/v1.0/config.rb @@ -8,6 +8,7 @@ NUM_MOBJS=161 STATE_OFFSET=0x8bf04 MOBJINFO_OFFSET=606956 +STRINGS_OFFSET=554068 # Locations of action pointer functions for Heretic 1.0. Hand-constructed. diff --git a/hhe/v1.2/config.rb b/hhe/v1.2/config.rb index d630f6f..eb8fc8a 100755 --- a/hhe/v1.2/config.rb +++ b/hhe/v1.2/config.rb @@ -8,6 +8,7 @@ NUM_MOBJS=160 STATE_OFFSET=0x8e8b4 MOBJINFO_OFFSET=617600 +STRINGS_OFFSET=563284 # Locations of action pointer functions for Heretic 1.2. Hand-constructed. diff --git a/hhe/v1.3/config.rb b/hhe/v1.3/config.rb index e71e990..c27da60 100755 --- a/hhe/v1.3/config.rb +++ b/hhe/v1.3/config.rb @@ -8,6 +8,7 @@ NUM_MOBJS=160 STATE_OFFSET=0x8e8b4 MOBJINFO_OFFSET=617600 +STRINGS_OFFSET=563284 # Action pointers for Heretic 1.3.