Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct comment, delete related code to refine the readability. #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Correct comment, delete related code to refine the readability. #230

wants to merge 1 commit into from

Conversation

kira1928
Copy link
Contributor

@kira1928 kira1928 commented Jan 1, 2019

Correct comment, delete related code to fit the real logic.

jsnes/src/cpu.js

Lines 321 to 343 in 94f8744

case 2: {
// *******
// * ASL *
// *******
// Shift left one bit
if (addrMode === 4) {
// ADDR_ACC = 4
this.F_CARRY = (this.REG_ACC >> 7) & 1;
this.REG_ACC = (this.REG_ACC << 1) & 255;
this.F_SIGN = (this.REG_ACC >> 7) & 1;
this.F_ZERO = this.REG_ACC;
} else {
temp = this.load(addr);
this.F_CARRY = (temp >> 7) & 1;
temp = (temp << 1) & 255;
this.F_SIGN = (temp >> 7) & 1;
this.F_ZERO = temp;
this.write(addr, temp);
}
break;
}

@bfirsh
Copy link
Owner

bfirsh commented Sep 22, 2021

Hi @kira1928! Thanks for the contribution. Have you got some more details about what this change is and why it is not needed? A test to demonstrate the behavior would be really helpful.

@kira1928
Copy link
Contributor Author

Hi @bfirsh !
Sorry, it's more than 2 years ago when I made that change. I don't remember clearly now XD.
It seems that in some address mode, the command parameter is passed by a "pointer variable", which is a memory address, while in another address mode, it's passed by a constant value.
the code I changed belongs to the latter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants