From 456a345b23ef138941db245580e2fcec3a0e2291 Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Fri, 24 Feb 2012 13:08:15 -0800 Subject: [PATCH] Remove unnecessary constructor args --- src/py65/assembler.py | 8 ++++---- src/py65/devices/mpu6502.py | 29 +++++++++++++++-------------- src/py65/devices/mpu65org16.py | 15 ++++++++++----- src/py65/disassembler.py | 8 ++++---- src/py65/monitor.py | 8 ++++---- 5 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src/py65/assembler.py b/src/py65/assembler.py index c84eca2..b08512f 100644 --- a/src/py65/assembler.py +++ b/src/py65/assembler.py @@ -53,10 +53,10 @@ class Assembler: self._mpu = mpu self._address_parser = address_parser - self.addrWidth = mpu.addrWidth - self.byteWidth = mpu.byteWidth - self.addrFmt = mpu.addrFmt - self.byteFmt = mpu.byteFmt + self.addrWidth = mpu.ADDR_WIDTH + self.byteWidth = mpu.BYTE_WIDTH + self.addrFmt = mpu.ADDR_FORMAT + self.byteFmt = mpu.BYTE_FORMAT self.addrMask = mpu.addrMask self.byteMask = mpu.byteMask diff --git a/src/py65/devices/mpu6502.py b/src/py65/devices/mpu6502.py index 1997abd..7387bd9 100644 --- a/src/py65/devices/mpu6502.py +++ b/src/py65/devices/mpu6502.py @@ -17,18 +17,19 @@ class MPU: ZERO = 2 CARRY = 1 - def __init__(self, memory=None, pc=0x0000, debug=False, byteWidth=8, addrWidth=16, addrFmt="%04x", byteFmt="%02x"): + BYTE_WIDTH = 8 + BYTE_FORMAT = "%02x" + ADDR_WIDTH = 16 + ADDR_FORMAT = "%04x" + + def __init__(self, memory=None, pc=0x0000, debug=False): # config self.debug = debug self.name = '6502' - self.byteWidth = byteWidth - self.byteMask = ((1<>self.byteWidth)&self.byteMask) + self.stPush((z>>self.BYTE_WIDTH)&self.byteMask) self.stPush(z&self.byteMask) def stPopWord(self): z = self.stPop() - z += self.stPop()<