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

Drops first char when parsing address from .asm for Insertion Address when CRLF newline type #4

Open
dreamsyntax opened this issue Mar 30, 2024 · 0 comments

Comments

@dreamsyntax
Copy link

dreamsyntax commented Mar 30, 2024

Affected Version

CodeWrite 1.0.6

The Problem

When using the Open ASM File... feature from a previously valid saved 'Save ASM File` works as expected.
However if committing these files in something like a git repo, with the standard newline configuration (LF being replaced with CRLF) results in bad behavior.

Example:

802D1BE8

With ASM
  li r18, 0x0

Opening this with LF line endings has the proper insertion address of
802D1BE8

Opening this with CRLF line endings results in:
02D1BE8

Alternatively you can clone this repo to experience the CRLF behavior:
https://github.com/ShadowSpeedrun/ShadowSX/tree/main/ASM%20Changes

Notice the newline is included and the 8 is dropped

Proposed Solution

Parse CRLF as LF OR read the first 8 chars of the insertion address, truncating the rest

Interim Solution if there is never another update

On your repo make .gitattributes with this as content:
*.asm text eol=lf

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

No branches or pull requests

1 participant