robmcmullen / omnivore

Hex editor and debugging emulator, sponsored by the Player/Missile Podcast
Mozilla Public License 2.0
53 stars 7 forks source link

map edit load fails when .omnivore file present #210

Closed robmcmullen closed 7 years ago

robmcmullen commented 7 years ago
Traceback (most recent call last):
  File "/noaa/maproom-deps/omnivore/traits/trait_notifiers.py", line 340, in __call__
    self.handler( *args )
  File "/noaa/maproom-deps/omnivore/omnivore/framework/application.py", line 158, in _application_initialized_fired
    self.load_file(arg, None, task_id=task_id)
  File "/noaa/maproom-deps/omnivore/omnivore/framework/application.py", line 297, in load_file
    document = self.guess_document(guess)
  File "/noaa/maproom-deps/omnivore/omnivore/framework/application.py", line 276, in guess_document
    document = service.recognize(guess)
  File "/noaa/maproom-deps/omnivore/omnivore/file_type/driver.py", line 38, in recognize
    document = recognizer.load(guess)
  File "/noaa/maproom-deps/omnivore/omnivore8bit/file_type/atrcopy_parsers.py", line 27, in load
    doc.load_metadata(guess)
  File "/noaa/maproom-deps/omnivore/omnivore/framework/document.py", line 161, in load_metadata
    extra = self.load_extra_metadata(guess)
  File "/noaa/maproom-deps/omnivore/omnivore8bit/document.py", line 59, in load_extra_metadata
    extra = check_builtin(self)
  File "/noaa/maproom-deps/omnivore/omnivore8bit/utils/extra_metadata.py", line 202, in check_builtin
    e = match(doc)
  File "/noaa/maproom-deps/omnivore/omnivore8bit/utils/extra_metadata.py", line 49, in Getaway
    _, s, _ = doc.find_segments_in_range(playfield)[0]
IndexError: list index out of range
robmcmullen commented 7 years ago

Somehow, when the .omnivore file is present, the XEX parsed segments get messed up:

parser: <atrcopy.parsers.XexSegmentParser object at 0x7fdcad56e290>
segments:
  XEX (Atari 8-bit executable) ($60fb bytes)
   $02e0-$02e2 ($0002 @ $0006)
   $3982-$39ce ($004c @ $000c)
   $0000-$0001 ($0001 @ $005c)
   $0000-$0001 ($0001 @ $0061)
   $0000-$0001 ($0001 @ $0066)
   $0000-$0001 ($0001 @ $006b)
   $0000-$0001 ($0001 @ $0070)
   $0000-$0001 ($0001 @ $0075)
   $0000-$0001 ($0001 @ $007a)
   $0000-$0001 ($0001 @ $007f)
   $0000-$0001 ($0001 @ $0084)
   $0000-$0001 ($0001 @ $0089)
   $0000-$0001 ($0001 @ $008e)
   $0000-$0001 ($0001 @ $0093)
   $0000-$0001 ($0001 @ $0098)
   $0000-$0001 ($0001 @ $009d)
   $0000-$0001 ($0001 @ $00a2)
   $0000-$0001 ($0001 @ $00a7)
   $0000-$0001 ($0001 @ $00ac)
   $0000-$0001 ($0001 @ $00b1)
   $0000-$0001 ($0001 @ $00b6)
   $0000-$0001 ($0001 @ $00bb)
   $0000-$0001 ($0001 @ $00c0)
   $0000-$0001 ($0001 @ $00c5)
   $0000-$0001 ($0001 @ $00ca)
   $0000-$0001 ($0001 @ $00cf)
   $0000-$0001 ($0001 @ $00d4)
   $0000-$0001 ($0001 @ $00d9)
   $0000-$0001 ($0001 @ $00de)
   $0000-$0001 ($0001 @ $00e3)
   $0000-$0001 ($0001 @ $00e8)
   $0000-$0001 ($0001 @ $00ed)
   $0000-$0001 ($0001 @ $00f2)
   $0000-$0001 ($0001 @ $00f7)
   $0000-$0001 ($0001 @ $00fc)
   $0000-$0001 ($0001 @ $0101)
   $0000-$0001 ($0001 @ $0106)
  Incomplete Data $0000-$5ff0 ($5ff0 @ $010b)
user segments:

instead of what happens when there's no .omnivore file

parser: <atrcopy.parsers.XexSegmentParser object at 0x7fdad226d510>
segments:
  XEX (Atari 8-bit executable) ($60fb bytes)
   $02e0-$02e2 ($0002 @ $0006)
   $3982-$39ce ($004c @ $000c)
   $4000-$a09f ($609f @ $005c)
user segments:
  Playfield font ($400 bytes @ 8000)
  Playfield map ($4000 bytes @ 4000)
robmcmullen commented 7 years ago

OK, this actually only fails when the executable has been mangled