fadden / 6502bench

A workbench for developing 6502 code
https://6502bench.com
Apache License 2.0
166 stars 33 forks source link

String length #140

Closed BacchusFLT closed 1 year ago

BacchusFLT commented 1 year ago

Selecting a string operand, I would seek an option to select the string lengths.

My scenario here is a big block of text that form a screen, which means I would like to see that the strings are 40 chars long (one string = one screen row).

fadden commented 1 year ago

There's currently no length-limiter on string selection. The best you can do right now is:

  1. Select full block.
  2. In the "Bulk Data" section of Edit Operand, select "Densely-packed bytes" with a limit of 40 bytes per line. This splits lines at the appropriate boundaries.
  3. Put labels at the start of every line (@line0, @line1, ...).
  4. Select the full block and format it as a string. The labels cause the formatting to be split.

Not great. To make this easier I think we'd need to generalize the "bytes per line" restriction. It's not part of the operand format descriptor; the dialog just uses it to generate multiple separate formatters. So making bytes-per-line apply more generally shouldn't pose a problem.

(Note to self: the dialog currently dislikes treating single bytes as strings, which would be an issue if you (say) selected 81 bytes and tried to format 40 per line. It rejects the entire set. Need to fix that.)

BacchusFLT commented 1 year ago

Sounds great! Humble thanks.

Den tis 31 jan. 2023 21:17Andy McFadden @.***> skrev:

There's currently no length-limiter on string selection. The best you can do right now is:

  1. Select full block.
  2. In the "Bulk Data" section of Edit Operand, select "Densely-packed bytes" with a limit of 40 bytes per line. This splits lines at the appropriate boundaries.
  3. Put labels at the start of every line @.***, @line1, ...).
  4. Select the full block and format it as a string. The labels cause the formatting to be split.

Not great. To make this easier I think we'd need to generalize the "bytes per line" restriction. It's not part of the operand format descriptor; the dialog just uses it to generate multiple separate formatters. So making bytes-per-line apply more generally shouldn't pose a problem.

(Note to self: the dialog currently dislikes treating single bytes as strings, which would be an issue if you (say) selected 81 bytes and tried to format 40 per line. It rejects the entire set. Need to fix that.)

— Reply to this email directly, view it on GitHub https://github.com/fadden/6502bench/issues/140#issuecomment-1411005141, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZWZSQK7TYQ575WAD4QXJDWVFXMNANCNFSM6AAAAAAUMPTXCE . You are receiving this because you authored the thread.Message ID: @.***>

fadden commented 1 year ago

Added "generalize max-byte-per-line" feature to "TO DO" wiki.