From f7227a91ddfb51ed64de8fefc301d5c04305958c Mon Sep 17 00:00:00 2001 From: BigEd Date: Mon, 1 Apr 2013 12:28:26 +0100 Subject: [PATCH] fixup ROM loading code --- py65/monitor.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/py65/monitor.py b/py65/monitor.py index 20b9600..3c61e31 100644 --- a/py65/monitor.py +++ b/py65/monitor.py @@ -543,11 +543,6 @@ class Monitor(cmd.Cmd): return filename = split[0] - if len(split) == 2: - # if the start address is -1, we will adjust it later - start = self._address_parser.number(split[1]) - else: - start = self._mpu.pc if "://" in filename: try: @@ -568,9 +563,14 @@ class Monitor(cmd.Cmd): self._output(msg) return - # if the start address was -1, we load to top of memory - if start == -1: - start = self.addrMask - len(bytes) / (self.byteWidth / 8) + 1 + if len(split) == 2: + if split[1] == "-1": + # load a ROM to top of memory + start = self.addrMask - len(bytes) / (self.byteWidth / 8) + 1 + else: + start = self._address_parser.number(split[1]) + else: + start = self._mpu.pc if self.byteWidth == 8: bytes = map(ord, bytes)