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

Assorted labels in mobile related code #702

Merged
merged 8 commits into from
Apr 1, 2020
Merged

Conversation

ariscop
Copy link
Contributor

@ariscop ariscop commented Mar 30, 2020

Not entirely sure Mobile46_SetErrorCode the a good name, but its good enough to show which branches are error handlers

mobile/mobile_45.asm Outdated Show resolved Hide resolved
@@ -956,7 +956,7 @@ Function11878d:
.asm_118803
ld a, $d3

Function118805:
Mobile46_SetErrorCode:
Copy link
Member

Choose a reason for hiding this comment

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

Just Mobile_

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used Mobile46 since there'll be equivalent functions in other bank

Copy link
Member

Choose a reason for hiding this comment

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

Alright then, though it'd be better if you could name them something else. Are they identical or are they serving for different purposes or deal with different data/codes?
If not this name is ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If its a problem i can just undo that change, the only reason i named it is so at call sites its apparent that branch is handling an error

Having another look i actually cant find an equivalent function, its unique to bank 46 and other banks just have its code inlined, but given that it Is unique to that bank a generic name like "Mobile_" could be misleading

Copy link
Member

Choose a reason for hiding this comment

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

Since the value it's setting is wMobileErrorCodeBuffer, how about SetMobileErrorCode? It's fine if the function is unique to this bank, there's no implication that it has to be usable in every bank (and if it were, it could always be farcalled, not that any hacks are editing the mobile system anyway.)

lib/mobile/main.asm Outdated Show resolved Hide resolved
@ariscop ariscop requested a review from Rangi42 March 30, 2020 23:21
mobile/mobile_46.asm Outdated Show resolved Hide resolved
Copy link
Member

@mid-kid mid-kid left a comment

Choose a reason for hiding this comment

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

@Rangi42 feel free to merge

@@ -5026,27 +5024,27 @@ endr
jp nz, .asm_115c64
ret

Function115cfd:
cp $2b
Function115cfd: ; Base64
Copy link
Member

Choose a reason for hiding this comment

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

Is this encoding or decoding Base64? Please change the Function115cfd label to clarify.

@@ -559,18 +557,18 @@ Function114412:
inc bc
inc e
call z, Function1144c8
cp $d ; CR
cp $d ; "\r"
Copy link
Member

Choose a reason for hiding this comment

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

(I've updated issue #686 to remind us to use "\r" here when rgbds 0.4.0 supports it.)

pushc
setcharmap ascii

Function119c3e: ; Base64
Copy link
Member

Choose a reason for hiding this comment

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

Likewise for this function; Base64 encode or decode?

Copy link
Member

@Rangi42 Rangi42 left a comment

Choose a reason for hiding this comment

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

Just label Function115cfd, Function119c3e, and Mobile46_SetErrorCode and this can be merged.

@ariscop ariscop requested a review from Rangi42 April 1, 2020 00:52
@Rangi42 Rangi42 merged commit 5d97f15 into pret:master Apr 1, 2020
@ariscop ariscop deleted the for_upstream branch April 1, 2020 01:38
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.

3 participants