Skip to content

Make code more idiomatic#61

Merged
mre merged 1 commit into
masterfrom
idiomatic
Mar 20, 2023
Merged

Make code more idiomatic#61
mre merged 1 commit into
masterfrom
idiomatic

Conversation

@mre

@mre mre commented Mar 20, 2023

Copy link
Copy Markdown
Owner

No description provided.

@omarandlorraine

Copy link
Copy Markdown
Collaborator

The commit mostly removes unnecessary casts. What does clippy say about these?

@omarandlorraine

Copy link
Copy Markdown
Collaborator

Also regarding impl Default for Status that is better. But I'm wondering about the TODO which reads "Revisit these defaults.".

On the 6502, the status flags are undefined on power-on. Of course, after a RESET, the disable_interrupts gets set because RESET is an interrupt. So I guess it depends on the semantics of instantiating the CPU object.

@mre

mre commented Mar 20, 2023

Copy link
Copy Markdown
Owner Author

The commit mostly removes unnecessary casts. What does clippy say about these?

Yeah, that's what clippy suggested, so we should be good. 😉
Maybe should have mentioned that.

On the 6502, the status flags are undefined on power-on. Of course, after a RESET, the disable_interrupts gets set because RESET is an interrupt. So I guess it depends on the semantics of instantiating the CPU object.

True. The change shouldn't change the behavior, so I think we can merge that in for now. From my perspective the current defaults could be seen as random state as well, haha. If there are any fields we should change we can do that of course.

@omarandlorraine

Copy link
Copy Markdown
Collaborator

Yep alright, then I think we're ready to merge the PR 👍

@mre mre merged commit c3438c1 into master Mar 20, 2023
@mre mre deleted the idiomatic branch March 20, 2023 13:11
@mre

mre commented Mar 20, 2023

Copy link
Copy Markdown
Owner Author

Thanks for the review. 👍

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