-
Notifications
You must be signed in to change notification settings - Fork 784
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
Some Mobile code labeling and removed magic numbers #993
Conversation
This will probably have to wait on #998 |
@ariscop I don't think the order matters much but I prefer merging larger PRs first since the smaller are easier to rebase. |
ram/sram.asm
Outdated
sOfferEmail:: ds $1e | ||
sOfferTrainerID:: dw | ||
sOfferSecretID:: dw | ||
sOfferGender:: db | ||
sOfferSpecies:: db | ||
sOfferReqGender:: db | ||
sOfferReqSpecies:: db | ||
sOfferMonSender:: ds NAME_LENGTH_JAPANESE - 1 | ||
sOfferMon:: party_struct sOfferMon | ||
sOfferMonOT:: ds NAME_LENGTH_JAPANESE - 1 | ||
sOfferMonNick:: ds NAME_LENGTH_JAPANESE - 1 | ||
sOfferMonMail:: mailmsg_jp sOfferMonMail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion; but we could do.
sOfferEmail:: ds $1e | |
sOfferTrainerID:: dw | |
sOfferSecretID:: dw | |
sOfferGender:: db | |
sOfferSpecies:: db | |
sOfferReqGender:: db | |
sOfferReqSpecies:: db | |
sOfferMonSender:: ds NAME_LENGTH_JAPANESE - 1 | |
sOfferMon:: party_struct sOfferMon | |
sOfferMonOT:: ds NAME_LENGTH_JAPANESE - 1 | |
sOfferMonNick:: ds NAME_LENGTH_JAPANESE - 1 | |
sOfferMonMail:: mailmsg_jp sOfferMonMail | |
sMobileOffer:: mobile_offer_struct sMobileOffer |
And then put this in macros/wram.asm: (Soon to be renamed to macros/ram.asm)
MACRO mobile_offer_struct
\1Email:: ds $1e
\1TrainerID:: dw
\1SecretID:: dw
\1Gender:: db
\1Species:: db
\1ReqGender:: db
\1ReqSpecies:: db
\1MonSender:: ds NAME_LENGTH_JAPANESE - 1
\1Mon:: party_struct \1Mon
\1MonOT:: ds NAME_LENGTH_JAPANESE - 1
\1MonNick:: ds NAME_LENGTH_JAPANESE - 1
\1MonMail:: mailmsg_jp \1MonMail
ENDM
Likewise for the wOfferMon labels in wram.asm:
wMobileOffer:: mobile_offer_struct wMobileOfffer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to turn this into a macro struct eventually... however I'd like to wait until more is disassembled before doing so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this struct instantiated more than once or twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire struct is done twice; once in wram.asm and once in sram.asm..
However there are two additional smaller variations of the struct as well.. Hence why I thought to wait.
The two complete ones:
wOfferEmail:: ds MOBILE_EMAIL_LENGTH
wOfferTrainerID:: dw
wOfferSecretID:: dw
wOfferGender:: db
wOfferSpecies:: db
wOfferReqGender:: db
wOfferReqSpecies:: db
wOfferMonSender:: ds NAME_LENGTH_JAPANESE - 1
wOfferMon:: party_struct wOfferMon
wOfferMonOT:: ds NAME_LENGTH_JAPANESE - 1
wOfferMonNick:: ds NAME_LENGTH_JAPANESE - 1
wOfferMonMail:: mailmsg_jp wOfferMonMail
sOfferEmail:: ds MOBILE_EMAIL_LENGTH
sOfferTrainerID:: dw
sOfferSecretID:: dw
sOfferGender:: db
sOfferSpecies:: db
sOfferReqGender:: db
sOfferReqSpecies:: db
sOfferMonSender:: ds NAME_LENGTH_JAPANESE - 1
sOfferMon:: party_struct sOfferMon
sOfferMonOT:: ds NAME_LENGTH_JAPANESE - 1
sOfferMonNick:: ds NAME_LENGTH_JAPANESE - 1
sOfferMonMail:: mailmsg_jp sOfferMonMail
And the two variations:
wMobileMonSender:: ds NAME_LENGTH_JAPANESE - 1
wMobileMon:: party_struct wMobileMon
wMobileMonOT:: ds NAME_LENGTH_JAPANESE - 1
wMobileMonNick:: ds NAME_LENGTH_JAPANESE - 1
wMobileMonMail:: mailmsg_jp wMobileMonMail
wUnknownGender:: db
wUnknownSpecies:: db
wUnknownReqGender:: db
wUnknownReqSpecies:: db
wUnknownMonSender:: ds NAME_LENGTH_JAPANESE - 1
wUnknownMon:: party_struct wUnknownMon
wUnknownMonOT:: ds NAME_LENGTH_JAPANESE - 1
wUnknownMonNick:: ds NAME_LENGTH_JAPANESE - 1
wUnknownMonMail:: mailmsg_jp wUnknownMonMail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://archives.glitchcity.info/forums/board-76/thread-7509/page-0.html
scroll to PokéCom Center Trade Corner
for some context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, why the char + 1's?
@ariscop stated they were done adding new stuff to the PR. Marking for review. Will review soonish. |
Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
e619cec
to
abceea4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as is now. The mobile code overall is a work in progress, and will take many more PRs to label properly.
; DION addr $1e + request $8 + Name $5 | ||
; + party struct $30 + OT $5 + NICK $5 | ||
; + JP Mail struct $2a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be constants?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They go along with the struct mentioned above... So, ultimately yes. However, I'm still deciding how I want to format the struct. Unless, you just want to make them individual constants for now.
Co-Authored-By: Rangi <35663410+Rangi42@users.noreply.github.com>
* Macro loop for EmptyAllSRAMBanks * Many things labeled and magic numbers removed * Conform to the style guide * Rename URLs in mobile_46 * MOBILEAPI_19 -> MOBILEAPI_TELEPHONESTATUS * Update engine/menus/empty_sram.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Update ram/wram.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Update mobile/mobile_46.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Update mobile/mobile_46.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Remove underscore from Set*DownloadURL symbols * Begin Labeling TradeCornerHoldMon routines * Add wMobileMon party_struct * Add TRADE_CORNER_REQUEST_LENGTH constant * Name battle tower action functions * Label trade corner send/receive buffer * Label the saved copy of the trade corner pokemon also fix mailmsg_jp * So many copies of decodeBase64Character * Label another buffer * Fix Alignment and use MOBILE_EMAIL_LENGTH * `Function11ad8a` -> `MobileIncJumptableIndex` * Apply Rangi Suggestions pass 1 Co-Authored-By: Rangi <35663410+Rangi42@users.noreply.github.com> * Apply Suggestions 2 Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> Co-authored-by: vulcandth <vulcandth@gmail.com>
* Macro loop for EmptyAllSRAMBanks * Many things labeled and magic numbers removed * Conform to the style guide * Rename URLs in mobile_46 * MOBILEAPI_19 -> MOBILEAPI_TELEPHONESTATUS * Update engine/menus/empty_sram.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Update ram/wram.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Update mobile/mobile_46.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Update mobile/mobile_46.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Remove underscore from Set*DownloadURL symbols * Begin Labeling TradeCornerHoldMon routines * Add wMobileMon party_struct * Add TRADE_CORNER_REQUEST_LENGTH constant * Name battle tower action functions * Label trade corner send/receive buffer * Label the saved copy of the trade corner pokemon also fix mailmsg_jp * So many copies of decodeBase64Character * Label another buffer * Fix Alignment and use MOBILE_EMAIL_LENGTH * `Function11ad8a` -> `MobileIncJumptableIndex` * Apply Rangi Suggestions pass 1 Co-Authored-By: Rangi <35663410+Rangi42@users.noreply.github.com> * Apply Suggestions 2 Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> Co-authored-by: vulcandth <vulcandth@gmail.com>
* Macro loop for EmptyAllSRAMBanks * Many things labeled and magic numbers removed * Conform to the style guide * Rename URLs in mobile_46 * MOBILEAPI_19 -> MOBILEAPI_TELEPHONESTATUS * Update engine/menus/empty_sram.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Update ram/wram.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Update mobile/mobile_46.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Update mobile/mobile_46.asm Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> * Remove underscore from Set*DownloadURL symbols * Begin Labeling TradeCornerHoldMon routines * Add wMobileMon party_struct * Add TRADE_CORNER_REQUEST_LENGTH constant * Name battle tower action functions * Label trade corner send/receive buffer * Label the saved copy of the trade corner pokemon also fix mailmsg_jp * So many copies of decodeBase64Character * Label another buffer * Fix Alignment and use MOBILE_EMAIL_LENGTH * `Function11ad8a` -> `MobileIncJumptableIndex` * Apply Rangi Suggestions pass 1 Co-Authored-By: Rangi <35663410+Rangi42@users.noreply.github.com> * Apply Suggestions 2 Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com> Co-authored-by: vulcandth <vulcandth@gmail.com>
Leaves almost no wram0 references which arent labeled
mobile_46 being an exception, c608 has several layouts and needs a union defined