Skip to content

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

Closed
kira1928 wants to merge 1 commit intobfirsh:masterfrom
kira1928:correct-comment
Closed

Correct comment, delete related code to refine the readability.#230
kira1928 wants to merge 1 commit intobfirsh:masterfrom
kira1928:correct-comment

Conversation

@kira1928
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@bfirsh
Copy link
Copy Markdown
Owner

bfirsh commented Feb 7, 2026

I'm going to close this until we figure out what this was about. 😄

@bfirsh bfirsh closed this Feb 7, 2026
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.

2 participants