diff options
| author | dannye <33dannye@gmail.com> | 2025-07-02 21:15:13 -0500 |
|---|---|---|
| committer | dannye <33dannye@gmail.com> | 2025-07-02 21:15:13 -0500 |
| commit | ca019eac8fd96559f4d4e712f0b53e95492e5dcb (patch) | |
| tree | 209a500e3bda6c2109e5acec60448e9e52f8c2af /home | |
| parent | Use more ldpikacry (diff) | |
| parent | Require RGBDS 0.9.3 for its DMG palette specs (#513) (diff) | |
| download | pokeyellow-ca019eac8fd96559f4d4e712f0b53e95492e5dcb.tar.gz pokeyellow-ca019eac8fd96559f4d4e712f0b53e95492e5dcb.tar.xz pokeyellow-ca019eac8fd96559f4d4e712f0b53e95492e5dcb.zip | |
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'home')
| -rw-r--r-- | home/audio.asm | 2 | ||||
| -rw-r--r-- | home/bankswitch2.asm | 22 | ||||
| -rw-r--r-- | home/copy.asm | 4 | ||||
| -rw-r--r-- | home/fade_audio.asm | 6 | ||||
| -rw-r--r-- | home/hidden_objects.asm | 2 | ||||
| -rw-r--r-- | home/init.asm | 12 | ||||
| -rw-r--r-- | home/item.asm | 4 | ||||
| -rw-r--r-- | home/joypad2.asm | 4 | ||||
| -rw-r--r-- | home/lcd.asm | 8 | ||||
| -rw-r--r-- | home/list_menu.asm | 18 | ||||
| -rw-r--r-- | home/load_font.asm | 6 | ||||
| -rw-r--r-- | home/names.asm | 4 | ||||
| -rw-r--r-- | home/npc_movement.asm | 4 | ||||
| -rw-r--r-- | home/overworld.asm | 34 | ||||
| -rw-r--r-- | home/pikachu_cries.asm | 2 | ||||
| -rw-r--r-- | home/pokemon.asm | 10 | ||||
| -rw-r--r-- | home/predef.asm | 2 | ||||
| -rw-r--r-- | home/print_text.asm | 4 | ||||
| -rw-r--r-- | home/printer.asm | 2 | ||||
| -rw-r--r-- | home/serial.asm | 24 | ||||
| -rw-r--r-- | home/start.asm | 2 | ||||
| -rw-r--r-- | home/start_menu.asm | 8 | ||||
| -rw-r--r-- | home/text.asm | 10 | ||||
| -rw-r--r-- | home/text_script.asm | 2 | ||||
| -rw-r--r-- | home/tilemap.asm | 8 | ||||
| -rw-r--r-- | home/trainers.asm | 6 | ||||
| -rw-r--r-- | home/uncompress.asm | 4 | ||||
| -rw-r--r-- | home/vblank.asm | 4 | ||||
| -rw-r--r-- | home/vcopy.asm | 12 | ||||
| -rw-r--r-- | home/window.asm | 8 |
30 files changed, 119 insertions, 119 deletions
diff --git a/home/audio.asm b/home/audio.asm index 6e891e9a..067093d6 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -144,7 +144,7 @@ Func_2223:: ld [wChannelSoundIDs + CHAN6], a ld [wChannelSoundIDs + CHAN7], a ld [wChannelSoundIDs + CHAN8], a - ldh [rNR10], a + ldh [rAUD1SWEEP], a ret StopAllMusic:: diff --git a/home/bankswitch2.asm b/home/bankswitch2.asm index cc54a8cb..8e37388f 100644 --- a/home/bankswitch2.asm +++ b/home/bankswitch2.asm @@ -1,6 +1,6 @@ BankswitchCommon:: ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a ret Bankswitch:: @@ -10,30 +10,30 @@ Bankswitch:: push af ld a, b ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a call JumpToAddress pop bc ld a, b ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a ret JumpToAddress:: jp hl OpenSRAM:: push af - ld a, SRAM_BANKING_MODE - ld [MBC1SRamBankingMode], a - ld a, SRAM_ENABLE - ld [MBC1SRamEnable], a + ld a, BMODE_ADVANCED + ld [rBMODE], a + ld a, RAMG_SRAM_ENABLE + ld [rRAMG], a pop af - ld [MBC1SRamBank], a + ld [rRAMB], a ret CloseSRAM:: push af - ld a, SRAM_DISABLE - ld [MBC1SRamBankingMode], a - ld [MBC1SRamEnable], a + ld a, 0 + ld [rBMODE], a + ld [rRAMG], a pop af ret diff --git a/home/copy.asm b/home/copy.asm index 2d07945c..b0d0ebac 100644 --- a/home/copy.asm +++ b/home/copy.asm @@ -35,7 +35,7 @@ CopyData:: CopyVideoDataAlternate:: ldh a, [rLCDC] - bit rLCDC_ENABLE, a ; LCD enabled? + bit B_LCDC_ENABLE, a ; LCD enabled? jp nz, CopyVideoData ; if yes, then copy video data push hl ld h, d @@ -55,7 +55,7 @@ CopyVideoDataAlternate:: CopyVideoDataDoubleAlternate:: ldh a, [rLCDC] - bit rLCDC_ENABLE, a ; LCD enabled? + bit B_LCDC_ENABLE, a ; LCD enabled? jp nz, CopyVideoDataDouble ; if yes, then copy video data push de ld d, h diff --git a/home/fade_audio.asm b/home/fade_audio.asm index 373b9bf8..a84ff2fe 100644 --- a/home/fade_audio.asm +++ b/home/fade_audio.asm @@ -6,7 +6,7 @@ FadeOutAudio:: bit BIT_NO_AUDIO_FADE_OUT, a ret nz ld a, $77 - ldh [rNR50], a + ldh [rAUDVOL], a ret .fadingOut ld a, [wAudioFadeOutCounter] @@ -18,7 +18,7 @@ FadeOutAudio:: .counterReachedZero ld a, [wAudioFadeOutCounterReloadValue] ld [wAudioFadeOutCounter], a - ldh a, [rNR50] + ldh a, [rAUDVOL] and a ; has the volume reached 0? jr z, .fadeOutComplete ld b, a @@ -31,7 +31,7 @@ FadeOutAudio:: dec a swap a or c - ldh [rNR50], a + ldh [rAUDVOL], a ret .fadeOutComplete ld a, [wAudioFadeOutControl] diff --git a/home/hidden_objects.asm b/home/hidden_objects.asm index 986ce38f..c1e1c9d3 100644 --- a/home/hidden_objects.asm +++ b/home/hidden_objects.asm @@ -6,7 +6,7 @@ CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: ldh a, [hLoadedROMBank] push af ldh a, [hJoyHeld] - bit BIT_A_BUTTON, a + bit B_PAD_A, a jr z, .nothingFound ; A button is pressed ld a, BANK(CheckForHiddenObject) diff --git a/home/init.asm b/home/init.asm index d555e598..0e5149a0 100644 --- a/home/init.asm +++ b/home/init.asm @@ -16,7 +16,7 @@ Init:: ; * 8x8 OBJ size ; * OBJ display enabled ; * BG display enabled -DEF rLCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << rLCDC_WINDOW_ENABLE) | (1 << rLCDC_SPRITES_ENABLE) | (1 << rLCDC_BG_PRIORITY) +DEF LCDC_DEFAULT EQU LCDC_ON | LCDC_WIN_9C00 | LCDC_WIN_ON | LCDC_BLOCK21 | LCDC_BG_9800 | LCDC_OBJ_8 | LCDC_OBJ_ON | LCDC_BG_ON di @@ -35,7 +35,7 @@ DEF rLCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << ldh [rOBP0], a ldh [rOBP1], a - ld a, 1 << rLCDC_ENABLE + ld a, LCDC_ON ldh [rLCDC], a call DisableLCD @@ -61,7 +61,7 @@ DEF rLCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << ld a, BANK(WriteDMACodeToHRAM) ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a call WriteDMACodeToHRAM xor a @@ -72,7 +72,7 @@ DEF rLCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << ldh [rIF], a ld [wc0f3], a ld [wc0f3 + 1], a - ld a, 1 << VBLANK + 1 << TIMER + 1 << SERIAL + ld a, IE_VBLANK | IE_TIMER | IE_SERIAL ldh [rIE], a ld a, 144 ; move the window off-screen @@ -89,7 +89,7 @@ DEF rLCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << ld h, HIGH(vBGMap1) call ClearBgMap - ld a, rLCDC_DEFAULT + ld a, LCDC_DEFAULT ldh [rLCDC], a ld a, 16 ldh [hSoftReset], a @@ -115,7 +115,7 @@ DEF rLCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << call ClearVram call GBPalNormal call ClearSprites - ld a, rLCDC_DEFAULT + ld a, LCDC_DEFAULT ldh [rLCDC], a jp PrepareTitleScreen diff --git a/home/item.asm b/home/item.asm index 9e7f02f9..693f041e 100644 --- a/home/item.asm +++ b/home/item.asm @@ -23,12 +23,12 @@ TossItem:: push af ld a, BANK(TossItem_) ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a call TossItem_ pop de ld a, d ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a ret ; checks if an item is a key item diff --git a/home/joypad2.asm b/home/joypad2.asm index 30f9f788..da824797 100644 --- a/home/joypad2.asm +++ b/home/joypad2.asm @@ -40,7 +40,7 @@ JoypadLowSensitivity:: .delayOver ; if [hJoy6] = 0 and A or B is pressed, report no buttons as pressed ldh a, [hJoyHeld] - and A_BUTTON | B_BUTTON + and PAD_A | PAD_B jr z, .setShortDelay ldh a, [hJoy6] ; flag and a @@ -78,7 +78,7 @@ WaitForTextScrollButtonPress:: call JoypadLowSensitivity predef CableClub_Run ldh a, [hJoy5] - and A_BUTTON | B_BUTTON + and PAD_A | PAD_B jr z, .loop pop af ldh [hDownArrowBlinkCount2], a diff --git a/home/lcd.asm b/home/lcd.asm index aef6d43f..1e9e8888 100644 --- a/home/lcd.asm +++ b/home/lcd.asm @@ -3,16 +3,16 @@ DisableLCD:: ldh [rIF], a ldh a, [rIE] ld b, a - res rIE_VBLANK, a + res B_IE_VBLANK, a ldh [rIE], a .wait ldh a, [rLY] - cp LY_VBLANK + cp LY_VBLANK + 1 jr nz, .wait ldh a, [rLCDC] - and ~(1 << rLCDC_ENABLE) + and ~LCDC_ON ldh [rLCDC], a ld a, b ldh [rIE], a @@ -20,6 +20,6 @@ DisableLCD:: EnableLCD:: ldh a, [rLCDC] - set rLCDC_ENABLE, a + set B_LCDC_ENABLE, a ldh [rLCDC], a ret diff --git a/home/list_menu.asm b/home/list_menu.asm index 0742521f..b09f1ebc 100644 --- a/home/list_menu.asm +++ b/home/list_menu.asm @@ -50,7 +50,7 @@ DisplayListMenuID:: ld [wTopMenuItemY], a ld a, 5 ld [wTopMenuItemX], a - ld a, A_BUTTON | B_BUTTON | SELECT + ld a, PAD_A | PAD_B | PAD_SELECT ld [wMenuWatchedKeys], a ld c, 10 call DelayFrames @@ -84,7 +84,7 @@ DisplayListMenuIDLoop:: push af call PlaceMenuCursor pop af - bit BIT_A_BUTTON, a + bit B_PAD_A, a jp z, .checkOtherKeys .buttonAPressed ld a, [wCurrentMenuItem] @@ -170,12 +170,12 @@ DisplayListMenuIDLoop:: res BIT_NO_TEXT_DELAY, [hl] jp BankswitchBack .checkOtherKeys ; check B, SELECT, Up, and Down keys - bit BIT_B_BUTTON, a + bit B_PAD_B, a jp nz, ExitListMenu ; if so, exit the menu - bit BIT_SELECT, a + bit B_PAD_SELECT, a jp nz, HandleItemListSwapping ; if so, allow the player to swap menu entries ld b, a - bit BIT_D_DOWN, b + bit B_PAD_DOWN, b ld hl, wListScrollOffset jr z, .upPressed .downPressed @@ -220,13 +220,13 @@ DisplayChooseQuantityMenu:: .waitForKeyPressLoop call JoypadLowSensitivity ldh a, [hJoyPressed] ; newly pressed buttons - bit BIT_A_BUTTON, a + bit B_PAD_A, a jp nz, .buttonAPressed - bit BIT_B_BUTTON, a + bit B_PAD_B, a jp nz, .buttonBPressed - bit BIT_D_UP, a + bit B_PAD_UP, a jr nz, .incrementQuantity - bit BIT_D_DOWN, a + bit B_PAD_DOWN, a jr nz, .decrementQuantity jr .waitForKeyPressLoop .incrementQuantity diff --git a/home/load_font.asm b/home/load_font.asm index be54a287..c9a009f7 100644 --- a/home/load_font.asm +++ b/home/load_font.asm @@ -1,6 +1,6 @@ LoadFontTilePatterns:: ldh a, [rLCDC] - bit rLCDC_ENABLE, a + bit B_LCDC_ENABLE, a jr nz, .on .off ld hl, FontGraphics @@ -16,7 +16,7 @@ LoadFontTilePatterns:: LoadTextBoxTilePatterns:: ldh a, [rLCDC] - bit rLCDC_ENABLE, a + bit B_LCDC_ENABLE, a jr nz, .on .off ld hl, TextBoxGraphics @@ -32,7 +32,7 @@ LoadTextBoxTilePatterns:: LoadHpBarAndStatusTilePatterns:: ldh a, [rLCDC] - bit rLCDC_ENABLE, a + bit B_LCDC_ENABLE, a jr nz, .on .off ld hl, HpBarAndStatusGraphics diff --git a/home/names.asm b/home/names.asm index 7330a065..5848cb19 100644 --- a/home/names.asm +++ b/home/names.asm @@ -4,7 +4,7 @@ GetMonName:: push af ld a, BANK(MonsterNames) ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a ld a, [wNamedObjectIndex] dec a ld hl, MonsterNames @@ -20,7 +20,7 @@ GetMonName:: pop de pop af ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a pop hl ret diff --git a/home/npc_movement.asm b/home/npc_movement.asm index 83c837a8..58fd8505 100644 --- a/home/npc_movement.asm +++ b/home/npc_movement.asm @@ -53,10 +53,10 @@ DebugPressedOrHeldB:: ; dummy except in _DEBUG ; Safari Game step counter, and some NPC scripts. IF DEF(_DEBUG) ldh a, [hJoyHeld] - bit BIT_B_BUTTON, a + bit B_PAD_B, a ret nz ldh a, [hJoyPressed] - bit BIT_B_BUTTON, a + bit B_PAD_B, a ret ENDC ret diff --git a/home/overworld.asm b/home/overworld.asm index 111e7cab..473635cc 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1,6 +1,6 @@ EnterMap:: ; Load a new map. - ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN + ld a, PAD_BUTTONS | PAD_CTRL_PAD ld [wJoyIgnore], a call LoadMapData farcall ClearVariablesOnEnterMap @@ -73,14 +73,14 @@ OverworldLoopLessDelay:: .notSimulating ldh a, [hJoyPressed] .checkIfStartIsPressed - bit BIT_START, a + bit B_PAD_START, a jr z, .startButtonNotPressed ; if START is pressed xor a ; TEXT_START_MENU ldh [hTextID], a jp .displayDialogue .startButtonNotPressed - bit BIT_A_BUTTON, a + bit B_PAD_A, a jp z, .checkIfDownButtonIsPressed ; if A is pressed ld a, [wStatusFlags5] @@ -142,7 +142,7 @@ OverworldLoopLessDelay:: .checkIfDownButtonIsPressed ldh a, [hJoyHeld] ; current joypad state - bit BIT_D_DOWN, a + bit B_PAD_DOWN, a jr z, .checkIfUpButtonIsPressed ld a, 1 ld [wSpritePlayerStateData1YStepVector], a @@ -150,7 +150,7 @@ OverworldLoopLessDelay:: jr .handleDirectionButtonPress .checkIfUpButtonIsPressed - bit BIT_D_UP, a + bit B_PAD_UP, a jr z, .checkIfLeftButtonIsPressed ld a, -1 ld [wSpritePlayerStateData1YStepVector], a @@ -158,7 +158,7 @@ OverworldLoopLessDelay:: jr .handleDirectionButtonPress .checkIfLeftButtonIsPressed - bit BIT_D_LEFT, a + bit B_PAD_LEFT, a jr z, .checkIfRightButtonIsPressed ld a, -1 ld [wSpritePlayerStateData1XStepVector], a @@ -166,7 +166,7 @@ OverworldLoopLessDelay:: jr .handleDirectionButtonPress .checkIfRightButtonIsPressed - bit BIT_D_RIGHT, a + bit B_PAD_RIGHT, a jr z, .noDirectionButtonsPressed ld a, 1 ld [wSpritePlayerStateData1XStepVector], a @@ -350,7 +350,7 @@ DoBikeSpeedup:: cp ROUTE_17 ; Cycling Road jr nz, .goFaster ldh a, [hJoyHeld] - and D_UP | D_LEFT | D_RIGHT + and PAD_UP | PAD_LEFT | PAD_RIGHT ret nz .goFaster call AdvancePlayerSprite @@ -401,7 +401,7 @@ CheckWarpsNoCollisionLoop:: pop bc pop de ldh a, [hJoyHeld] - and D_DOWN | D_UP | D_LEFT | D_RIGHT + and PAD_CTRL_PAD jr z, CheckWarpsNoCollisionRetry2 ; if directional buttons aren't being pressed, do not pass through the warp jr WarpFound1 @@ -1598,9 +1598,9 @@ ForceBikeDown:: cp ROUTE_17 ; Cycling Road ret nz ldh a, [hJoyHeld] - and D_DOWN | D_UP | D_LEFT | D_RIGHT | B_BUTTON | A_BUTTON + and PAD_CTRL_PAD | PAD_B | PAD_A ret nz - ld a, D_DOWN + ld a, PAD_DOWN ldh [hJoyHeld], a ; on the cycling road, if there isn't a trainer and the player isn't pressing buttons, simulate a down press ret @@ -2048,7 +2048,7 @@ CopyMapViewToVRAM2: inc e dec c jr nz, .vramCopyInnerLoop - ld a, BG_MAP_WIDTH - SCREEN_WIDTH + ld a, TILEMAP_WIDTH - SCREEN_WIDTH add e ld e, a jr nc, .noCarry @@ -2284,14 +2284,14 @@ CheckForUserInterruption:: pop bc ldh a, [hJoyHeld] - cp D_UP + SELECT + B_BUTTON + cp PAD_UP + PAD_SELECT + PAD_B jr z, .input ldh a, [hJoy5] IF DEF(_DEBUG) - and START | SELECT | A_BUTTON + and PAD_START | PAD_SELECT | PAD_A ELSE - and START | A_BUTTON + and PAD_START | PAD_A ENDC jr nz, .input @@ -2314,7 +2314,7 @@ LoadDestinationWarpPosition:: push af ld a, [wPredefParentBank] ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a ld a, b add a add a @@ -2326,5 +2326,5 @@ LoadDestinationWarpPosition:: call CopyData pop af ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a ret diff --git a/home/pikachu_cries.asm b/home/pikachu_cries.asm index 9d41da02..92841938 100644 --- a/home/pikachu_cries.asm +++ b/home/pikachu_cries.asm @@ -35,7 +35,7 @@ LoadNextSoundClipSample:: and $80 srl a srl a - ldh [rNR32], a + ldh [rAUD3LEVEL], a sla d ret diff --git a/home/pokemon.asm b/home/pokemon.asm index b66fe72d..54996092 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -232,11 +232,11 @@ PartyMenuInit:: ld [hli], a ; max menu item ID ld a, [wForcePlayerToChooseMon] and a - ld a, A_BUTTON | B_BUTTON + ld a, PAD_A | PAD_B jr z, .next xor a ld [wForcePlayerToChooseMon], a - inc a ; a = A_BUTTON + inc a ; a = PAD_A .next ld [hli], a ; menu watched keys pop af @@ -250,7 +250,7 @@ HandlePartyMenuInput:: ld [wPartyMenuAnimMonEnabled], a call HandleMenuInput_ push af ; save hJoy5 OR wMenuWrapping enabled, if no inputs were selected within a certain period of time - bit BIT_B_BUTTON, a ; was B button pressed? + bit B_PAD_B, a ; was B button pressed? ld a, $0 ld [wPartyMenuAnimMonEnabled], a ld a, [wCurrentMenuItem] @@ -273,7 +273,7 @@ HandlePartyMenuInput:: jp nz, .swappingPokemon pop af ldh [hTileAnimations], a - bit BIT_B_BUTTON, b + bit B_PAD_B, b jr nz, .noPokemonChosen ld a, [wPartyCount] and a @@ -303,7 +303,7 @@ HandlePartyMenuInput:: scf ret .swappingPokemon - bit BIT_B_BUTTON, b + bit B_PAD_B, b jr z, .handleSwap ; if not, handle swapping the pokemon .cancelSwap ; if the B button was pressed farcall ErasePartyMenuCursors diff --git a/home/predef.asm b/home/predef.asm index 4861d5d0..ba237c66 100644 --- a/home/predef.asm +++ b/home/predef.asm @@ -14,7 +14,7 @@ Predef:: push af ld a, BANK(GetPredefPointer) ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a call GetPredefPointer diff --git a/home/print_text.asm b/home/print_text.asm index 65d418a3..fe784350 100644 --- a/home/print_text.asm +++ b/home/print_text.asm @@ -25,11 +25,11 @@ PrintLetterDelay:: call Joypad ldh a, [hJoyHeld] .checkAButton - bit BIT_A_BUTTON, a + bit B_PAD_A, a jr z, .checkBButton jr .endWait .checkBButton - bit BIT_B_BUTTON, a + bit B_PAD_B, a jr z, .buttonsNotPressed .endWait call DelayFrame diff --git a/home/printer.asm b/home/printer.asm index 2591567b..2b083681 100644 --- a/home/printer.asm +++ b/home/printer.asm @@ -22,7 +22,7 @@ SerialFunction:: ldh [rSB], a ld a, $1 ldh [rSC], a - ld a, START_TRANSFER_INTERNAL_CLOCK + ld a, SC_START | SC_INTERNAL ldh [rSC], a ret diff --git a/home/serial.asm b/home/serial.asm index 258651a5..644a6e1d 100644 --- a/home/serial.asm +++ b/home/serial.asm @@ -17,7 +17,7 @@ Serial:: cp USING_INTERNAL_CLOCK jr z, .done ; using external clock - ld a, START_TRANSFER_EXTERNAL_CLOCK + ld a, SC_START | SC_EXTERNAL ldh [rSC], a jr .done .connectionNotYetEstablished @@ -35,7 +35,7 @@ Serial:: ldh a, [rDIV] bit 7, a ; wait until rDIV has incremented from $3 to $80 or more jr nz, .waitLoop - ld a, START_TRANSFER_EXTERNAL_CLOCK + ld a, SC_START | SC_EXTERNAL ldh [rSC], a jr .done .usingInternalClock @@ -95,7 +95,7 @@ Serial_ExchangeByte:: ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK jr nz, .loop - ld a, START_TRANSFER_INTERNAL_CLOCK + ld a, SC_START | SC_INTERNAL ldh [rSC], a .loop ldh a, [hSerialReceivedNewData] @@ -120,8 +120,8 @@ Serial_ExchangeByte:: jp SetUnknownCounterToFFFF .doNotIncrementUnknownCounter ldh a, [rIE] - and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) - cp 1 << SERIAL + and IE_SERIAL | IE_TIMER | IE_STAT | IE_VBLANK + cp IE_SERIAL jr nz, .loop ld a, [wUnknownSerialCounter2] dec a @@ -142,8 +142,8 @@ Serial_ExchangeByte:: xor a ldh [hSerialReceivedNewData], a ldh a, [rIE] - and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) - sub 1 << SERIAL + and IE_SERIAL | IE_TIMER | IE_STAT | IE_VBLANK + sub IE_SERIAL jr nz, .skipReloadingUnknownCounter2 ld [wUnknownSerialCounter2], a ld a, $50 @@ -168,8 +168,8 @@ Serial_ExchangeByte:: jr z, SetUnknownCounterToFFFF .done ldh a, [rIE] - and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK) - cp 1 << SERIAL + and IE_SERIAL | IE_TIMER | IE_STAT | IE_VBLANK + cp IE_SERIAL ld a, SERIAL_NO_DATA_BYTE ret z ld a, [hl] @@ -294,7 +294,7 @@ Serial_ExchangeNybble:: ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK jr nz, .doExchange - ld a, START_TRANSFER_INTERNAL_CLOCK + ld a, SC_START | SC_INTERNAL ldh [rSC], a .doExchange ldh a, [hSerialReceiveData] @@ -315,7 +315,7 @@ Serial_SendZeroByte:: ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK ret nz - ld a, START_TRANSFER_INTERNAL_CLOCK + ld a, SC_START | SC_INTERNAL ldh [rSC], a ret @@ -324,7 +324,7 @@ Serial_TryEstablishingExternallyClockedConnection:: ldh [rSB], a xor a ldh [hSerialReceiveData], a - ld a, START_TRANSFER_EXTERNAL_CLOCK + ld a, SC_START | SC_EXTERNAL ldh [rSC], a ret diff --git a/home/start.asm b/home/start.asm index 2b284647..3b6a9e76 100644 --- a/home/start.asm +++ b/home/start.asm @@ -1,5 +1,5 @@ _Start:: - cp CGB + cp BOOTUP_A_CGB jr z, .cgb xor a jr .ok diff --git a/home/start_menu.asm b/home/start_menu.asm index 12c9685c..b1bc0539 100644 --- a/home/start_menu.asm +++ b/home/start_menu.asm @@ -15,7 +15,7 @@ RedisplayStartMenu_DoNotDrawStartMenu:: call HandleMenuInput ld b, a .checkIfUpPressed - bit BIT_D_UP, a + bit B_PAD_UP, a jr z, .checkIfDownPressed ld a, [wCurrentMenuItem] ; menu selection and a @@ -33,7 +33,7 @@ RedisplayStartMenu_DoNotDrawStartMenu:: call EraseMenuCursor jr .loop .checkIfDownPressed - bit BIT_D_DOWN, a + bit B_PAD_DOWN, a jr z, .buttonPressed ; if the player pressed tried to go past the bottom item, wrap around to the top CheckEvent EVENT_GOT_POKEDEX @@ -54,7 +54,7 @@ RedisplayStartMenu_DoNotDrawStartMenu:: ld a, [wCurrentMenuItem] ld [wBattleAndStartSavedMenuItem], a ; save current menu selection ld a, b - and B_BUTTON | START ; was the Start button or B button pressed? + and PAD_B | PAD_START ; was the Start button or B button pressed? jp nz, CloseStartMenu call SaveScreenTilesToBuffer2 ; copy background from wTileMap to wTileMapBackup2 CheckEvent EVENT_GOT_POKEDEX @@ -79,7 +79,7 @@ RedisplayStartMenu_DoNotDrawStartMenu:: CloseStartMenu:: call Joypad ldh a, [hJoyPressed] - bit BIT_A_BUTTON, a + bit B_PAD_A, a jr nz, CloseStartMenu call LoadTextBoxTilePatterns jp CloseTextDisplay diff --git a/home/text.asm b/home/text.asm index 7c3589fd..6a7b51f4 100644 --- a/home/text.asm +++ b/home/text.asm @@ -285,7 +285,7 @@ _ContTextNoPause:: ; move both rows of text in the normal text box up one row ; always called twice in a row -; first time, copy the two rows of text to the "in between" rows that are usually emtpy +; first time, copy the two rows of text to the "in between" rows that are usually empty ; second time, copy the bottom row of text into the top row of text ScrollTextUpOneLine:: hlcoord 0, 14 ; top row of text @@ -501,7 +501,7 @@ TextCommand_PAUSE:: push bc call Joypad ldh a, [hJoyHeld] - and A_BUTTON | B_BUTTON + and PAD_A | PAD_B jr nz, .done ld c, 30 ; half a second call DelayFrames @@ -577,7 +577,7 @@ TextCommand_DOTS:: call Joypad pop de ldh a, [hJoyHeld] ; joypad state - and A_BUTTON | B_BUTTON + and PAD_A | PAD_B jr nz, .next ; if so, skip the delay ld c, 10 call DelayFrames @@ -611,7 +611,7 @@ TextCommand_FAR:: ld a, [hli] ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a push hl ld l, e @@ -621,7 +621,7 @@ TextCommand_FAR:: pop af ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a jp NextTextCommand TextCommandJumpTable:: diff --git a/home/text_script.asm b/home/text_script.asm index 097c1028..3d2bd34b 100644 --- a/home/text_script.asm +++ b/home/text_script.asm @@ -98,7 +98,7 @@ AfterDisplayingTextID:: HoldTextDisplayOpen:: call Joypad ldh a, [hJoyHeld] - bit BIT_A_BUTTON, a + bit B_PAD_A, a jr nz, HoldTextDisplayOpen CloseTextDisplay:: diff --git a/home/tilemap.asm b/home/tilemap.asm index ea247763..e2fb4296 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -9,7 +9,7 @@ UncompressSpriteFromDE:: SaveScreenTilesToBuffer2:: hlcoord 0, 0 ld de, wTileMapBackup2 - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + ld bc, SCREEN_AREA jp CopyData LoadScreenTilesFromBuffer2:: @@ -24,13 +24,13 @@ LoadScreenTilesFromBuffer2DisableBGTransfer:: ldh [hAutoBGTransferEnabled], a ld hl, wTileMapBackup2 decoord 0, 0 - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + ld bc, SCREEN_AREA jp CopyData SaveScreenTilesToBuffer1:: hlcoord 0, 0 ld de, wTileMapBackup - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + ld bc, SCREEN_AREA jp CopyData LoadScreenTilesFromBuffer1:: @@ -38,7 +38,7 @@ LoadScreenTilesFromBuffer1:: ldh [hAutoBGTransferEnabled], a ld hl, wTileMapBackup decoord 0, 0 - ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + ld bc, SCREEN_AREA call CopyData ld a, 1 ldh [hAutoBGTransferEnabled], a diff --git a/home/trainers.asm b/home/trainers.asm index 5048a8c5..fa9167fc 100644 --- a/home/trainers.asm +++ b/home/trainers.asm @@ -149,7 +149,7 @@ ENDC xor a ; EXCLAMATION_BUBBLE ld [wWhichEmotionBubble], a predef EmotionBubble - ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN + ld a, PAD_CTRL_PAD ld [wJoyIgnore], a xor a ldh [hJoyHeld], a @@ -349,7 +349,7 @@ PrintEndBattleText:: push af ld a, [wEndBattleTextRomBank] ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a push hl farcall SaveTrainerName ld hl, TrainerEndBattleText @@ -357,7 +357,7 @@ PrintEndBattleText:: pop hl pop af ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a farcall SetEnemyTrainerToStayAndFaceAnyDirection jp WaitForSoundToFinish diff --git a/home/uncompress.asm b/home/uncompress.asm index 19d87f94..091cf5f8 100644 --- a/home/uncompress.asm +++ b/home/uncompress.asm @@ -463,7 +463,7 @@ DecodeNybble1TableFlipped:: dn $e, $6 dn $2, $a -; combines the two loaded chunks with xor (the chunk loaded second is the destination). The source chunk is differeintial decoded beforehand. +; combines the two loaded chunks with xor (the chunk loaded second is the destination). The source chunk is differential decoded beforehand. XorSpriteChunks:: xor a ld [wSpriteCurPosX], a @@ -565,7 +565,7 @@ ResetSpriteBufferPointers:: NybbleReverseTable:: db $0, $8, $4, $c, $2, $a, $6, $e, $1, $9, $5, $d, $3, $b, $7, $f -; combines the two loaded chunks with xor (the chunk loaded second is the destination). Both chunks are differeintial decoded beforehand. +; combines the two loaded chunks with xor (the chunk loaded second is the destination). Both chunks are differential decoded beforehand. UnpackSpriteMode2:: call ResetSpriteBufferPointers ld a, [wSpriteFlipped] diff --git a/home/vblank.asm b/home/vblank.asm index b511dfa4..0cfbe9b1 100644 --- a/home/vblank.asm +++ b/home/vblank.asm @@ -34,7 +34,7 @@ VBlank:: call hDMARoutine ld a, BANK(PrepareOAMData) ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a call PrepareOAMData ; VBlank-sensitive operations end. @@ -70,7 +70,7 @@ VBlank:: ld a, [wVBlankSavedROMBank] ldh [hLoadedROMBank], a - ld [MBC1RomBank], a + ld [rROMB], a pop af ldh [rVBK], a diff --git a/home/vcopy.asm b/home/vcopy.asm index 904383ac..10d6ce20 100644 --- a/home/vcopy.asm +++ b/home/vcopy.asm @@ -23,7 +23,7 @@ ClearBgMap:: jr .next ld a, l .next - ld de, BG_MAP_WIDTH * BG_MAP_HEIGHT + ld de, TILEMAP_AREA ld l, e .loop ld [hli], a @@ -61,7 +61,7 @@ RedrawRowOrColumn:: inc de ld a, [hli] ld [de], a - ld a, BG_MAP_WIDTH - 1 + ld a, TILEMAP_WIDTH - 1 add e ld e, a jr nc, .noCarry @@ -86,7 +86,7 @@ RedrawRowOrColumn:: push de call .DrawHalf ; draw upper half pop de - ld a, BG_MAP_WIDTH ; width of VRAM background map + ld a, TILEMAP_WIDTH ; width of VRAM background map add e ld e, a ; fall through and draw lower half @@ -177,7 +177,7 @@ ENDR inc l ld [hl], d - ld a, BG_MAP_WIDTH - (SCREEN_WIDTH - 1) + ld a, TILEMAP_WIDTH - (SCREEN_WIDTH - 1) add l ld l, a jr nc, .ok @@ -247,7 +247,7 @@ VBlankCopyDouble:: ldh [hVBlankCopyDoubleSize], a .loop -REPT LEN_2BPP_TILE / 4 - 1 +REPT TILE_SIZE / 4 - 1 pop de ld [hl], e inc l @@ -313,7 +313,7 @@ VBlankCopy:: ldh [hVBlankCopySize], a .loop -REPT LEN_2BPP_TILE / 2 - 1 +REPT TILE_SIZE / 2 - 1 pop de ld [hl], e inc l diff --git a/home/window.asm b/home/window.asm index 713699e6..18c00e79 100644 --- a/home/window.asm +++ b/home/window.asm @@ -50,9 +50,9 @@ HandleMenuInput_:: ld [wCheckFor180DegreeTurn], a ldh a, [hJoy5] ld b, a - bit BIT_A_BUTTON, a + bit B_PAD_A, a jr nz, .checkOtherKeys - bit BIT_D_UP, a + bit B_PAD_UP, a jr z, .checkIfDownPressed .upPressed ld a, [wCurrentMenuItem] ; selected menu item @@ -70,7 +70,7 @@ HandleMenuInput_:: ld [wCurrentMenuItem], a ; wrap to the bottom of the menu jr .checkOtherKeys .checkIfDownPressed - bit BIT_D_DOWN, a + bit B_PAD_DOWN, a jr z, .checkOtherKeys .downPressed ld a, [wCurrentMenuItem] @@ -93,7 +93,7 @@ HandleMenuInput_:: jp z, .loop1 .checkIfAButtonOrBButtonPressed ldh a, [hJoy5] - and A_BUTTON | B_BUTTON + and PAD_A | PAD_B jr z, .skipPlayingSound .AButtonOrBButtonPressed push hl |
