[pypy-svn] r52638 - pypy/branch/gameboy-emulator/pypy/lang/gameboy
cfbolz at codespeak.net
cfbolz at codespeak.net
Mon Mar 17 13:25:28 CET 2008
Author: cfbolz
Date: Mon Mar 17 13:25:27 2008
New Revision: 52638
Modified:
pypy/branch/gameboy-emulator/pypy/lang/gameboy/cpu.py
Log:
some comments I had when reading commits
Modified: pypy/branch/gameboy-emulator/pypy/lang/gameboy/cpu.py
==============================================================================
--- pypy/branch/gameboy-emulator/pypy/lang/gameboy/cpu.py (original)
+++ pypy/branch/gameboy-emulator/pypy/lang/gameboy/cpu.py Mon Mar 17 13:25:27 2008
@@ -216,6 +216,11 @@
self.execute()
# Interrupts
+ # XXX this doesn't work, you cannot have two methods with the same name
+ # and different numbers of parameters
+ # another problem is that the attribute self.parameter cannot have the
+ # same name as a method or you will confuse yourself in major ways (Python
+ # is lookup-based, not send-based)
def interrupt(self):
if (self.halted):
if (self.interrupt.isPending()):
@@ -247,6 +252,7 @@
# Execution
def fetchExecute(self):
+ # these global statements have no effect
global FETCH_EXECUTE_OP_CODES
FETCH_EXECUTE_OP_CODES[self.fetch()](self)
@@ -458,6 +464,7 @@
def flagsAndSetterFinish(self, s, setter, compareAnd=0x01):
self.f.set(0) # 1 cycle
self.zFlagAdd(s)
+ # XXX where does "getter" come from here? should be "setter"?
self.cFlagAdd(getter(), compareAnd)
setter(s)
@@ -901,6 +908,7 @@
SECOND_ORDER_OP_CODES = create_group_op_codes(SECOND_ORDER_REGISTER_OP_CODES)
def create_register_op_codes():
+ # not necessary to build a list, you can nicely use a generator here
opCodes = [];
for entry in REGISTER_OP_CODES:
startCode = entry[0]
More information about the Pypy-commit
mailing list