OneLoneCoder / olcNES

NES Emulator, and Tutorial Video Code
1.36k stars 229 forks source link

CPU.cpp a little mistake in comment #45

Open sillenge opened 2 years ago

sillenge commented 2 years ago

There are some small mistakes in the comment, also in the video old: A = A - M - (1 - C) -> A = A + -1 (M - (1 - C)) -> A = A + (-M + 1 + C) new: A = A - M - (1 - C) -> A = A + -1 (M + (1 - C)) -> A = A + (-M - 1 + C)

code is right, because -M = +value + 1 ( value = fetched & 0x00FF ) A = A + (value + 1) - 1 + C

thank for your sharing, then I can learn this interesting thing.