Open zstewar1 opened 8 years ago
Oops. Definitely a bug. Feel free to fix.
Will wait until after #3, since this function also uses []
indexing on str
variables in Python 2, when it should return an int. (The behavior should be correct in Python 3 because there the type will be bytes
, which indexes to int
, while in Python 2, bytes == str
, which indexes to str
).
Once #3 is merged, this can be rectified and made cross compatible by using six.indexbytes
to always get an int
in both 2 and 3.
Mbc1Cartridge.__getitem__
will returnNone
for RAM addresses whenram_enable
is off.Is this intended behavior? It seems to me like a more obvious default action would be to return
0x0
, and I haven't checked, but that seems more like what hardware would do if you accessed a disabled thing.Unless that action is supposed to signal an interrupt or something and None is a sigil return value to tell the emulator to trigger that interrupt, but if that is the case, then
None
should probably be returned explicitly, and a comment should be added explaining why, when all the other functions return integers.