diff --git a/omnivore/tasks/jumpman/jumpman_editor.py b/omnivore/tasks/jumpman/jumpman_editor.py index 0da8ba28..7357446d 100644 --- a/omnivore/tasks/jumpman/jumpman_editor.py +++ b/omnivore/tasks/jumpman/jumpman_editor.py @@ -388,6 +388,10 @@ def compile_assembly_source(self, show_info=False): except SyntaxError, e: log.error("Assembly error: %s" % e.msg) self.window.error(e.msg, "Assembly Error") + except ImportError: + log.error("Please install pyatasm to compile custom code.") + self.assembly_source = "" + self.old_trigger_mapping = dict() self.update_trigger_mapping() if show_info: dlg = wx.lib.dialogs.ScrolledMessageDialog(self.window.control, self.custom_code.info, "Assembly Results") diff --git a/omnivore/utils/jumpman.py b/omnivore/utils/jumpman.py index f9707380..c424191a 100644 --- a/omnivore/utils/jumpman.py +++ b/omnivore/utils/jumpman.py @@ -1,7 +1,5 @@ import numpy as np -from pyatasm import Assemble - from atrcopy import selected_bit_mask, match_bit_mask, data_bit_mask, comment_bit_mask from omnivore.utils.runtime import get_all_subclasses @@ -995,6 +993,8 @@ class JumpmanCustomCode(object): std_gameloop = [ord(x) for x in " \xd0I \x00K\xad>(\xc9\x00\xf0\x11\xad\xbe0\xc9\x08\x90\xef\xad\xf00\xc9\xff\xd0\xe5L?(lD("] def __init__(self, filename): + # raise ImportError and let caller handle it + from pyatasm import Assemble asm = Assemble(filename) if not asm: raise SyntaxError(asm.errors)