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

Use chip size for selected commands where it makes sense #70

Merged
merged 8 commits into from
Apr 12, 2024

Conversation

jscrane
Copy link
Contributor

@jscrane jscrane commented Apr 10, 2024

See discussion.

@@ -722,16 +728,30 @@ void loop()
break;

case CMD_DUMP:
dumpBlock(start, end);
start = dumpBlock(start, start + if_unspec(end, 0xff));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be
if_unspec(end, start+0xff)
otherwise d 100 1ff would dump from 100 to 2ff instead of 100 to 1ff
Am I reading that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's right; will fix.

@jscrane
Copy link
Contributor Author

jscrane commented Apr 11, 2024

Do we want to check if start > prom.end() and maybe reset to 0 if it is?

@TomNisbet
Copy link
Owner

Maybe not a good idea to adjust back to zero. If I want to fill from 200 to 2ff and accidentally type 2000 to 2ff it would be better that it fails instead of filling 0 to 2ff.

I routinely take advantage of the fact that the Dump command does not enforce the prom size by using the default 28C code to read larger EPROMs. The documentation states that most chips can be read with with default code, so it would be good to leave that as is. It does mean that the code will happily dump 8K of data from a 2K chip.

@jscrane
Copy link
Contributor Author

jscrane commented Apr 11, 2024

OK, I will run some more manual tests on my current branch soon.

Is there anything that's a must-have before merging this PR?

@TomNisbet
Copy link
Owner

I can’t think of anything else. Looks good.

@jscrane
Copy link
Contributor Author

jscrane commented Apr 12, 2024

The last commit moves start, end and val to the stack and uses next to retain state for a subsequent d command on its own.

The reason for this was that if you dumped a page, then computed the checksum w/o args, it would checksum from the saved start position. This is probably not what is desired.

@TomNisbet
Copy link
Owner

Looks great! Are you ready to merge or still working on it?

@jscrane
Copy link
Contributor Author

jscrane commented Apr 12, 2024

I'm done now: feel free to merge! (That last change was really just cosmetic.)

@TomNisbet TomNisbet merged commit 90e29d2 into TomNisbet:master Apr 12, 2024
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