diff options
| author | Sylvie <35663410+Rangi42@users.noreply.github.com> | 2024-09-23 23:51:44 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-23 23:51:44 -0400 |
| commit | 8f1dcf07e598c6e3d34b5d255f04faff1667d83b (patch) | |
| tree | fe962b2c23dd40ad3d69f7145a46a002c3285a76 /home | |
| parent | Remove the Discord webhook and tools/unnamed.py (diff) | |
| download | pokeyellow-8f1dcf07e598c6e3d34b5d255f04faff1667d83b.tar.gz pokeyellow-8f1dcf07e598c6e3d34b5d255f04faff1667d83b.tar.xz pokeyellow-8f1dcf07e598c6e3d34b5d255f04faff1667d83b.zip | |
Identify more flag bits (#464)
Diffstat (limited to 'home')
| -rw-r--r-- | home/map_objects.asm | 2 | ||||
| -rw-r--r-- | home/overworld.asm | 20 | ||||
| -rw-r--r-- | home/predef_text.asm | 2 | ||||
| -rw-r--r-- | home/print_bcd.asm | 28 | ||||
| -rw-r--r-- | home/reload_sprites.asm | 2 | ||||
| -rw-r--r-- | home/text.asm | 2 | ||||
| -rw-r--r-- | home/text_script.asm | 6 | ||||
| -rw-r--r-- | home/window.asm | 14 |
8 files changed, 38 insertions, 38 deletions
diff --git a/home/map_objects.asm b/home/map_objects.asm index 342139dd..e200238a 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -227,7 +227,7 @@ SetSpriteMovementBytesToFF:: ; returns the sprite movement byte 1 pointer for sprite [hSpriteIndex] in hl GetSpriteMovementByte1Pointer:: - ld h, $C2 + ld h, HIGH(wSpriteStateData2) ldh a, [hSpriteIndex] swap a add 6 diff --git a/home/overworld.asm b/home/overworld.asm index 1595fdf0..e43ebc81 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -121,7 +121,7 @@ OverworldLoopLessDelay:: ld a, [wCurMap] call SwitchToMapRomBank ; switch to the ROM bank of the current map ld hl, wCurMapTileset - set 7, [hl] + set BIT_NO_PREVIOUS_MAP, [hl] .changeMap jp EnterMap .checkForOpponent @@ -879,10 +879,10 @@ LoadTilesetTilePatternData:: ld a, [wTilesetBank] jp FarCopyData2 -; this loads the current maps complete tile map (which references blocks, not individual tiles) to C6E8 +; this loads the current map's complete tile map (which references blocks, not individual tiles) to wOverworldMap ; it can also load partial tile maps of connected maps into a border of length 3 around the current map LoadTileBlockMap:: -; fill C6E8-CBFB with the background tile +; fill wOverworldMap-wOverworldMapEnd with the background tile ld hl, wOverworldMap ld a, [wMapBackgroundTile] ld d, a @@ -1210,7 +1210,7 @@ IsSpriteInFrontOfPlayer2:: and $f0 inc a ld l, a ; hl = x#SPRITESTATEDATA1_MOVEMENTSTATUS - set 7, [hl] ; set flag to make the sprite face the player + set BIT_FACE_PLAYER, [hl] ld a, e ldh [hTextID], a ret @@ -1303,7 +1303,7 @@ CheckForTilePairCollisions:: ld a, [wTileInFrontOfPlayer] ld c, a .tilePairCollisionLoop - ld a, [wCurMapTileset] ; tileset number + ld a, [wCurMapTileset] ld b, a ld a, [hli] cp $ff @@ -1943,7 +1943,7 @@ CollisionCheckOnWater:: call PlayDefaultMusic jr .noCollision .checkIfVermilionDockTileset - ld a, [wCurMapTileset] ; tileset + ld a, [wCurMapTileset] cp SHIP_PORT ; Vermilion Dock tileset jr nz, .noCollision ; keep surfing if it's not the boarding platform tile jr .stopSurfing ; if it is the boarding platform tile, stop surfing @@ -2015,10 +2015,10 @@ LoadMapHeader:: call SwitchToMapRomBank ld a, [wCurMapTileset] ld b, a - res 7, a + res BIT_NO_PREVIOUS_MAP, a ld [wCurMapTileset], a ldh [hPreviousTileset], a - bit 7, b + bit BIT_NO_PREVIOUS_MAP, b ret nz ld hl, MapHeaderPointers ld a, [wCurMap] @@ -2203,9 +2203,9 @@ LoadMapHeader:: ld [hl], a ; store text ID in byte 1 of sprite entry pop hl ldh a, [hLoadSpriteTemp1] - bit 6, a + bit BIT_TRAINER, a jr nz, .trainerSprite - bit 7, a + bit BIT_ITEM, a jr nz, .itemBallSprite jr .regularSprite .trainerSprite diff --git a/home/predef_text.asm b/home/predef_text.asm index bdecd3cf..61e22fce 100644 --- a/home/predef_text.asm +++ b/home/predef_text.asm @@ -3,7 +3,7 @@ PrintPredefTextID:: ld hl, TextPredefs call SetMapTextPointer ld hl, wTextPredefFlag - set 0, [hl] + set BIT_TEXT_PREDEF, [hl] call DisplayTextID RestoreMapTextPointer:: diff --git a/home/print_bcd.asm b/home/print_bcd.asm index 38aedd3c..57ec12a8 100644 --- a/home/print_bcd.asm +++ b/home/print_bcd.asm @@ -13,12 +13,12 @@ ; their meaning at the beginning of the functions's execution. PrintBCDNumber:: ld b, c ; save flags in b - res 7, c - res 6, c - res 5, c ; c now holds the length - bit 5, b + res BIT_LEADING_ZEROES, c + res BIT_LEFT_ALIGN, c + res BIT_MONEY_SIGN, c ; c now holds the length + bit BIT_MONEY_SIGN, b jr z, .loop - bit 7, b + bit BIT_LEADING_ZEROES, b jr nz, .loop ld [hl], "¥" inc hl @@ -31,14 +31,14 @@ PrintBCDNumber:: inc de dec c jr nz, .loop - bit 7, b ; were any non-zero digits printed? + bit BIT_LEADING_ZEROES, b jr z, .done ; if so, we are done .numberEqualsZero ; if every digit of the BCD number is zero - bit 6, b ; left or right alignment? + bit BIT_LEFT_ALIGN, b jr nz, .skipRightAlignmentAdjustment dec hl ; if the string is right-aligned, it needs to be moved back one space .skipRightAlignmentAdjustment - bit 5, b + bit BIT_MONEY_SIGN, b jr z, .skipCurrencySymbol ld [hl], "¥" inc hl @@ -54,24 +54,24 @@ PrintBCDDigit:: and a jr z, .zeroDigit .nonzeroDigit - bit 7, b ; have any non-space characters been printed? + bit BIT_LEADING_ZEROES, b jr z, .outputDigit ; if bit 7 is set, then no numbers have been printed yet - bit 5, b ; print the currency symbol? + bit BIT_MONEY_SIGN, b jr z, .skipCurrencySymbol ld [hl], "¥" inc hl - res 5, b + res BIT_MONEY_SIGN, b .skipCurrencySymbol - res 7, b ; unset 7 to indicate that a nonzero digit has been reached + res BIT_LEADING_ZEROES, b .outputDigit add "0" ld [hli], a jp PrintLetterDelay .zeroDigit - bit 7, b ; either printing leading zeroes or already reached a nonzero digit? + bit BIT_LEADING_ZEROES, b jr z, .outputDigit ; if so, print a zero digit - bit 6, b ; left or right alignment? + bit BIT_LEFT_ALIGN, b ret nz inc hl ; if right-aligned, "print" a space by advancing the pointer ret diff --git a/home/reload_sprites.asm b/home/reload_sprites.asm index 8a08d64d..5cf5d458 100644 --- a/home/reload_sprites.asm +++ b/home/reload_sprites.asm @@ -4,7 +4,7 @@ ReloadMapSpriteTilePatterns:: ld hl, wFontLoaded ld a, [hl] push af - res 0, [hl] + res BIT_FONT_LOADED, [hl] push hl xor a ld [wSpriteSetID], a diff --git a/home/text.asm b/home/text.asm index dc78b982..da884125 100644 --- a/home/text.asm +++ b/home/text.asm @@ -63,7 +63,7 @@ PlaceNextChar:: jr nz, .NotNext ld bc, 2 * SCREEN_WIDTH ldh a, [hUILayoutFlags] - bit 2, a + bit BIT_SINGLE_SPACED_LINES, a jr z, .ok ld bc, SCREEN_WIDTH .ok diff --git a/home/text_script.asm b/home/text_script.asm index d367683d..c1606371 100644 --- a/home/text_script.asm +++ b/home/text_script.asm @@ -6,8 +6,8 @@ DisplayTextID:: push af farcall DisplayTextIDInit ; initialization ld hl, wTextPredefFlag - bit 0, [hl] - res 0, [hl] + bit BIT_TEXT_PREDEF, [hl] + res BIT_TEXT_PREDEF, [hl] jr nz, .skipSwitchToMapBank ld a, [wCurMap] call SwitchToMapRomBank @@ -128,7 +128,7 @@ CloseTextDisplay:: ld [MBC1RomBank], a call InitMapSprites ; reload sprite tile pattern data (since it was partially overwritten by text tile patterns) ld hl, wFontLoaded - res 0, [hl] + res BIT_FONT_LOADED, [hl] ld a, [wStatusFlags6] bit BIT_FLY_WARP, a call z, LoadPlayerSpriteGraphics diff --git a/home/window.asm b/home/window.asm index 01b52d41..48ab1d0e 100644 --- a/home/window.asm +++ b/home/window.asm @@ -137,12 +137,12 @@ PlaceMenuCursor:: jr z, .checkForArrow1 push af ldh a, [hUILayoutFlags] - bit 1, a ; is the menu double spaced? + bit BIT_DOUBLE_SPACED_MENU, a jr z, .doubleSpaced1 - ld bc, 20 + ld bc, SCREEN_WIDTH jr .getOldMenuItemScreenPosition .doubleSpaced1 - ld bc, 40 + ld bc, SCREEN_WIDTH * 2 .getOldMenuItemScreenPosition pop af .oldMenuItemLoop @@ -163,12 +163,12 @@ PlaceMenuCursor:: jr z, .checkForArrow2 push af ldh a, [hUILayoutFlags] - bit 1, a ; is the menu double spaced? + bit BIT_DOUBLE_SPACED_MENU, a jr z, .doubleSpaced2 - ld bc, 20 + ld bc, SCREEN_WIDTH jr .getCurrentMenuItemScreenPosition .doubleSpaced2 - ld bc, 40 + ld bc, SCREEN_WIDTH * 2 .getCurrentMenuItemScreenPosition pop af .currentMenuItemLoop @@ -272,7 +272,7 @@ EnableAutoTextBoxDrawing:: jr AutoTextBoxDrawingCommon DisableAutoTextBoxDrawing:: - ld a, TRUE + ld a, 1 << BIT_NO_AUTO_TEXT_BOX AutoTextBoxDrawingCommon:: ld [wAutoTextBoxDrawingControl], a |
