diff options
Diffstat (limited to 'engine/link')
-rwxr-xr-x | engine/link/cable_club.asm | 100 | ||||
-rwxr-xr-x | engine/link/cable_club_npc.asm | 28 | ||||
-rw-r--r-- | engine/link/print_waiting_text.asm | 4 |
3 files changed, 66 insertions, 66 deletions
diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index ca43a895..67c0e471 100755 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -9,11 +9,11 @@ CableClub_DoBattleOrTrade: call LoadFontTilePatterns call LoadHpBarAndStatusTilePatterns call LoadTrainerInfoTextBoxTiles - coord hl, 3, 8 + hlcoord 3, 8 ld b, 2 ld c, 12 call CableClub_TextBoxBorder - coord hl, 4, 10 + hlcoord 4, 10 ld de, PleaseWaitString call PlaceString ld hl, wPlayerNumHits @@ -102,25 +102,25 @@ CableClub_DoBattleOrTradeAgain: ld a, SERIAL_PATCH_LIST_PART_TERMINATOR ld [de], a ; end of part 2 call Serial_SyncAndExchangeNybble - ld a, [hSerialConnectionStatus] + ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK jr nz, .skipSendingTwoZeroBytes ; if using internal clock ; send two zero bytes for syncing purposes? call Delay3 xor a - ld [hSerialSendData], a + ldh [hSerialSendData], a ld a, START_TRANSFER_INTERNAL_CLOCK - ld [rSC], a + ldh [rSC], a call DelayFrame xor a - ld [hSerialSendData], a + ldh [hSerialSendData], a ld a, START_TRANSFER_INTERNAL_CLOCK - ld [rSC], a + ldh [rSC], a .skipSendingTwoZeroBytes call Delay3 ld a, (1 << SERIAL) - ld [rIE], a + ldh [rIE], a ld hl, wSerialRandomNumberListBlock ld de, wSerialOtherGameboyRandomNumberListBlock ld bc, $11 @@ -138,10 +138,10 @@ CableClub_DoBattleOrTradeAgain: ld bc, $c8 call Serial_ExchangeBytes ld a, (1 << SERIAL) | (1 << TIMER) | (1 << VBLANK) - ld [rIE], a + ldh [rIE], a ld a, SFX_STOP_ALL_MUSIC call PlaySound - ld a, [hSerialConnectionStatus] + ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK jr z, .skipCopyingRandomNumberList ; the list generated by the gameboy clocking the connection is used by both gameboys ld hl, wSerialOtherGameboyRandomNumberListBlock @@ -255,15 +255,15 @@ CableClub_DoBattleOrTradeAgain: ld hl, wEnemyMons + (SERIAL_PREAMBLE_BYTE - 1) dec c jr nz, .unpatchEnemyMonsLoop - ld a, wEnemyMonOT % $100 + ld a, LOW(wEnemyMonOT) ld [wUnusedCF8D], a - ld a, wEnemyMonOT / $100 + ld a, HIGH(wEnemyMonOT) ld [wUnusedCF8D + 1], a xor a ld [wTradeCenterPointerTableIndex], a ld a, SFX_STOP_ALL_MUSIC call PlaySound - ld a, [hSerialConnectionStatus] + ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK ld c, 66 call z, DelayFrames ; delay if using internal clock @@ -359,7 +359,7 @@ TradeCenter_SelectMon: .displayEnemyMonStats ld a, INIT_ENEMYOT_LIST ld [wInitListType], a - callab InitList ; the list isn't used + callfar InitList ; the list isn't used ld hl, wEnemyMons call TradeCenter_DisplayStats jp .getNewInput @@ -399,7 +399,7 @@ TradeCenter_SelectMon: ld [wTopMenuItemY], a ld a, 1 ld [wTopMenuItemX], a - coord hl, 1, 1 + hlcoord 1, 1 lb bc, 6, 1 call ClearScreenArea .playerMonMenu_HandleInput @@ -418,7 +418,7 @@ TradeCenter_SelectMon: ; unreachable code ld a, INIT_PLAYEROT_LIST ld [wInitListType], a - callab InitList ; the list isn't used + callfar InitList ; the list isn't used call TradeCenter_DisplayStats jp .getNewInput .playerMonMenu_ANotPressed @@ -464,11 +464,11 @@ TradeCenter_SelectMon: dec a .displayStatsTradeMenu push af - coord hl, 0, 14 + hlcoord 0, 14 ld b, 2 ld c, 18 call CableClub_TextBoxBorder - coord hl, 2, 16 + hlcoord 2, 16 ld de, .statsTrade call PlaceString xor a @@ -480,7 +480,7 @@ TradeCenter_SelectMon: ld [wTopMenuItemY], a .selectStatsMenuItem ld a, " " - Coorda 11, 16 + ldcoord_a 11, 16 ld a, D_RIGHT | B_BUTTON | A_BUTTON ld [wMenuWatchedKeys], a ld a, 1 @@ -497,7 +497,7 @@ TradeCenter_SelectMon: jp .playerMonMenu .selectTradeMenuItem ld a, " " - Coorda 1, 16 + ldcoord_a 1, 16 ld a, D_LEFT | B_BUTTON | A_BUTTON ld [wMenuWatchedKeys], a ld a, 11 @@ -513,7 +513,7 @@ TradeCenter_SelectMon: ld [wCurrentMenuItem], a ld a, INIT_PLAYEROT_LIST ld [wInitListType], a - callab InitList ; the list isn't used + callfar InitList ; the list isn't used call TradeCenter_DisplayStats call LoadScreenTilesFromBuffer1 jp .playerMonMenu @@ -548,10 +548,10 @@ TradeCenter_SelectMon: ld [hl], a .cancelMenuItem_Loop ld a, "▶" ; filled arrow cursor - Coorda 1, 16 + ldcoord_a 1, 16 .cancelMenuItem_JoypadLoop call JoypadLowSensitivity - ld a, [hJoy5] + ldh a, [hJoy5] and a ; pressed anything? jr z, .cancelMenuItem_JoypadLoop bit 0, a ; A button pressed? @@ -560,14 +560,14 @@ TradeCenter_SelectMon: jr z, .cancelMenuItem_JoypadLoop ; if Up pressed ld a, " " - Coorda 1, 16 + ldcoord_a 1, 16 ld a, [wPartyCount] dec a ld [wCurrentMenuItem], a jp .playerMonMenu .cancelMenuItem_APressed ld a, "▷" ; unfilled arrow cursor - Coorda 1, 16 + ldcoord_a 1, 16 ld a, $f ld [wSerialExchangeNybbleSendData], a call Serial_PrintWaitingTextAndSyncAndExchangeNybble @@ -588,7 +588,7 @@ ReturnToCableClubRoom: dec a ld [wDestinationWarpID], a call LoadMapData - callba ClearVariablesOnEnterMap + farcall ClearVariablesOnEnterMap pop hl pop af ld [hl], a @@ -596,15 +596,15 @@ ReturnToCableClubRoom: ret TradeCenter_DrawCancelBox: - coord hl, 11, 15 + hlcoord 11, 15 ld a, $7e ld bc, 2 * SCREEN_WIDTH + 9 call FillMemory - coord hl, 0, 15 + hlcoord 0, 15 ld b, 1 ld c, 9 call CableClub_TextBoxBorder - coord hl, 2, 16 + hlcoord 2, 16 ld de, CancelTextString jp PlaceString @@ -613,7 +613,7 @@ CancelTextString: TradeCenter_PlaceSelectedEnemyMonMenuCursor: ld a, [wSerialSyncAndExchangeNybbleReceiveData] - coord hl, 1, 9 + hlcoord 1, 9 ld bc, SCREEN_WIDTH call AddNTimes ld [hl], "▷" ; cursor @@ -630,24 +630,24 @@ TradeCenter_DisplayStats: jp TradeCenter_DrawCancelBox TradeCenter_DrawPartyLists: - coord hl, 0, 0 + hlcoord 0, 0 ld b, 6 ld c, 18 call CableClub_TextBoxBorder - coord hl, 0, 8 + hlcoord 0, 8 ld b, 6 ld c, 18 call CableClub_TextBoxBorder - coord hl, 5, 0 + hlcoord 5, 0 ld de, wPlayerName call PlaceString - coord hl, 5, 8 + hlcoord 5, 8 ld de, wLinkEnemyTrainerName call PlaceString - coord hl, 2, 1 + hlcoord 2, 1 ld de, wPartySpecies call TradeCenter_PrintPartyListNames - coord hl, 2, 9 + hlcoord 2, 9 ld de, wEnemyPartyMons ; fall through @@ -663,7 +663,7 @@ TradeCenter_PrintPartyListNames: push de push hl ld a, c - ld [hPastLeadingZeros], a + ldh [hPastLeadingZeros], a call GetMonName pop hl call PlaceString @@ -684,7 +684,7 @@ TradeCenter_Trade: ld [wSerialExchangeNybbleReceiveData], a ld [wMenuWatchMovingOutOfBounds], a ld [wMenuJoypadPollCount], a - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder @@ -709,10 +709,10 @@ TradeCenter_Trade: ld [wd11e], a call GetMonName ld hl, WillBeTradedText - coord bc, 1, 14 + bccoord 1, 14 call TextCommandProcessor call SaveScreenTilesToBuffer1 - coord hl, 10, 7 + hlcoord 10, 7 lb bc, 8, 11 ld a, TRADE_CANCEL_MENU ld [wTwoOptionMenuID], a @@ -726,11 +726,11 @@ TradeCenter_Trade: ; if trade cancelled ld a, $1 ld [wSerialExchangeNybbleSendData], a - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder - coord hl, 1, 14 + hlcoord 1, 14 ld de, TradeCanceled call PlaceString call Serial_PrintWaitingTextAndSyncAndExchangeNybble @@ -743,11 +743,11 @@ TradeCenter_Trade: dec a ; did the other person cancel? jr nz, .doTrade ; if the other person cancelled - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder - coord hl, 1, 14 + hlcoord 1, 14 ld de, TradeCanceled call PlaceString jp .tradeCancelled @@ -837,7 +837,7 @@ TradeCenter_Trade: call LoadHpBarAndStatusTilePatterns xor a ld [wUnusedCC5B], a - ld a, [hSerialConnectionStatus] + ldh a, [hSerialConnectionStatus] cp USING_EXTERNAL_CLOCK jr z, .usingExternalClock predef InternalClockTradeAnim @@ -845,17 +845,17 @@ TradeCenter_Trade: .usingExternalClock predef ExternalClockTradeAnim .tradeCompleted - callab TryEvolvingMon + callfar TryEvolvingMon call ClearScreen call LoadTrainerInfoTextBoxTiles call Serial_PrintWaitingTextAndSyncAndExchangeNybble ld c, 40 call DelayFrames - coord hl, 0, 12 + hlcoord 0, 12 ld b, 4 ld c, 18 call CableClub_TextBoxBorder - coord hl, 1, 14 + hlcoord 1, 14 ld de, TradeCompleted call PlaceString predef SaveSAVtoSRAM2 @@ -914,7 +914,7 @@ CableClub_Run: ld [wGrassRate], a inc a ; LINK_STATE_IN_CABLE_CLUB ld [wLinkState], a - ld [hJoy5], a + ldh [hJoy5], a ld a, 10 ld [wAudioFadeOutControl], a ld a, BANK(Music_Celadon) @@ -972,6 +972,6 @@ CableClub_DrawHorizontalLine: LoadTrainerInfoTextBoxTiles: ld de, TrainerInfoTextBoxTileGraphics - ld hl, vChars2 + $760 + ld hl, vChars2 tile $76 lb bc, BANK(TrainerInfoTextBoxTileGraphics), (TrainerInfoTextBoxTileGraphicsEnd - TrainerInfoTextBoxTileGraphics) / $10 jp CopyVideoData diff --git a/engine/link/cable_club_npc.asm b/engine/link/cable_club_npc.asm index 6001c314..594adf08 100755 --- a/engine/link/cable_club_npc.asm +++ b/engine/link/cable_club_npc.asm @@ -15,27 +15,27 @@ CableClubNPC:: ld a, 90 ld [wLinkTimeoutCounter], a .establishConnectionLoop - ld a, [hSerialConnectionStatus] + ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK jr z, .establishedConnection cp USING_EXTERNAL_CLOCK jr z, .establishedConnection ld a, CONNECTION_NOT_ESTABLISHED - ld [hSerialConnectionStatus], a + ldh [hSerialConnectionStatus], a ld a, ESTABLISH_CONNECTION_WITH_EXTERNAL_CLOCK - ld [rSB], a + ldh [rSB], a xor a - ld [hSerialReceiveData], a + ldh [hSerialReceiveData], a ld a, START_TRANSFER_EXTERNAL_CLOCK - ld [rSC], a + ldh [rSC], a ld a, [wLinkTimeoutCounter] dec a ld [wLinkTimeoutCounter], a jr z, .failedToEstablishConnection ld a, ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK - ld [rSB], a + ldh [rSB], a ld a, START_TRANSFER_INTERNAL_CLOCK - ld [rSC], a + ldh [rSC], a call DelayFrame jr .establishConnectionLoop .establishedConnection @@ -54,7 +54,7 @@ CableClubNPC:: ld a, [wCurrentMenuItem] and a jr nz, .choseNo - callab SaveSAVtoSRAM + callfar SaveSAVtoSRAM call WaitForSoundToFinish ld a, SFX_SAVE call PlaySoundWaitForCurrent @@ -65,7 +65,7 @@ CableClubNPC:: ld [hli], a xor a ld [hl], a - ld [hSerialReceivedNewData], a + ldh [hSerialReceivedNewData], a ld [wSerialExchangeNybbleSendData], a call Serial_SyncAndExchangeNybble ld hl, wUnknownSerialCounter @@ -107,7 +107,7 @@ CableClubNPC:: xor a ld [hld], a ld [hl], a - jpab LinkMenu + jpfar LinkMenu CableClubNPCAreaReservedFor2FriendsLinkedByCableText: text_far _CableClubNPCAreaReservedFor2FriendsLinkedByCableText @@ -141,11 +141,11 @@ CableClubNPCMakingPreparationsText: CloseLinkConnection: call Delay3 ld a, CONNECTION_NOT_ESTABLISHED - ld [hSerialConnectionStatus], a + ldh [hSerialConnectionStatus], a ld a, ESTABLISH_CONNECTION_WITH_EXTERNAL_CLOCK - ld [rSB], a + ldh [rSB], a xor a - ld [hSerialReceiveData], a + ldh [hSerialReceiveData], a ld a, START_TRANSFER_EXTERNAL_CLOCK - ld [rSC], a + ldh [rSC], a ret diff --git a/engine/link/print_waiting_text.asm b/engine/link/print_waiting_text.asm index c48459d3..d74d635f 100644 --- a/engine/link/print_waiting_text.asm +++ b/engine/link/print_waiting_text.asm @@ -1,5 +1,5 @@ PrintWaitingText:: - coord hl, 3, 10 + hlcoord 3, 10 ld b, $1 ld c, $b ld a, [wIsInBattle] @@ -10,7 +10,7 @@ PrintWaitingText:: .asm_4c17 call CableClub_TextBoxBorder .asm_4c1a - coord hl, 4, 11 + hlcoord 4, 11 ld de, WaitingText call PlaceString ld c, 50 |