diff options
Diffstat (limited to 'home')
-rw-r--r-- | home/audio.asm | 4 | ||||
-rw-r--r-- | home/battle_vars.asm | 224 | ||||
-rw-r--r-- | home/cry.asm | 2 | ||||
-rw-r--r-- | home/flag.asm | 12 | ||||
-rw-r--r-- | home/game_time.asm | 2 | ||||
-rw-r--r-- | home/map.asm | 124 | ||||
-rw-r--r-- | home/map_objects.asm | 5 | ||||
-rw-r--r-- | home/menu.asm | 80 | ||||
-rw-r--r-- | home/palettes.asm | 7 | ||||
-rw-r--r-- | home/text.asm | 4 | ||||
-rw-r--r-- | home/tilemap.asm | 18 | ||||
-rw-r--r-- | home/time.asm | 4 |
12 files changed, 246 insertions, 240 deletions
diff --git a/home/audio.asm b/home/audio.asm index 2d6f27cda..4b9c3a71c 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -142,7 +142,7 @@ PlayMusic2:: ; 3bbc PlayCry:: ; 3be3 -; Play cry header de. +; Play cry de. push hl push de @@ -462,7 +462,7 @@ SpecialMapMusic:: ; 3d62 jr z, .surf ld a, [wStatusFlags2] - bit 2, a + bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, a jr nz, .contest .no diff --git a/home/battle_vars.asm b/home/battle_vars.asm index 44fc21d6d..c4a8dcd70 100644 --- a/home/battle_vars.asm +++ b/home/battle_vars.asm @@ -1,111 +1,113 @@ -GetBattleVar:: ; 39e1
-; Preserves hl.
- push hl
- call GetBattleVarAddr
- pop hl
- ret
-; 39e7
-
-GetBattleVarAddr:: ; 39e7
-; Get variable from pair a, depending on whose turn it is.
-; There are 21 variable pairs.
-
- push bc
-
- ld hl, .BattleVarPairs
- ld c, a
- ld b, 0
- add hl, bc
- add hl, bc
-
- ld a, [hli]
- ld h, [hl]
- ld l, a
-
-; Enemy turn uses the second byte instead.
-; This lets battle variable calls be side-neutral.
- ld a, [hBattleTurn]
- and a
- jr z, .get_var
- inc hl
-
-.get_var
-; var id
- ld a, [hl]
- ld c, a
- ld b, 0
-
- ld hl, .BattleVarPointers
- add hl, bc
- add hl, bc
-
- ld a, [hli]
- ld h, [hl]
- ld l, a
-
- ld a, [hl]
-
- pop bc
- ret
-
-.BattleVarPairs:
- dw .Substatus1
- dw .Substatus2
- dw .Substatus3
- dw .Substatus4
- dw .Substatus5
- dw .Substatus1Opp
- dw .Substatus2Opp
- dw .Substatus3Opp
- dw .Substatus4Opp
- dw .Substatus5Opp
- dw .Status
- dw .StatusOpp
- dw .MoveAnim
- dw .MoveEffect
- dw .MovePower
- dw .MoveType
- dw .CurMove
- dw .LastCounter
- dw .LastCounterOpp
- dw .LastMove
- dw .LastMoveOpp
-
-; player enemy
-.Substatus1: db PLAYER_SUBSTATUS_1, ENEMY_SUBSTATUS_1
-.Substatus1Opp: db ENEMY_SUBSTATUS_1, PLAYER_SUBSTATUS_1
-.Substatus2: db PLAYER_SUBSTATUS_2, ENEMY_SUBSTATUS_2
-.Substatus2Opp: db ENEMY_SUBSTATUS_2, PLAYER_SUBSTATUS_2
-.Substatus3: db PLAYER_SUBSTATUS_3, ENEMY_SUBSTATUS_3
-.Substatus3Opp: db ENEMY_SUBSTATUS_3, PLAYER_SUBSTATUS_3
-.Substatus4: db PLAYER_SUBSTATUS_4, ENEMY_SUBSTATUS_4
-.Substatus4Opp: db ENEMY_SUBSTATUS_4, PLAYER_SUBSTATUS_4
-.Substatus5: db PLAYER_SUBSTATUS_5, ENEMY_SUBSTATUS_5
-.Substatus5Opp: db ENEMY_SUBSTATUS_5, PLAYER_SUBSTATUS_5
-.Status: db PLAYER_STATUS, ENEMY_STATUS
-.StatusOpp: db ENEMY_STATUS, PLAYER_STATUS
-.MoveAnim: db PLAYER_MOVE_ANIMATION, ENEMY_MOVE_ANIMATION
-.MoveEffect: db PLAYER_MOVE_EFFECT, ENEMY_MOVE_EFFECT
-.MovePower: db PLAYER_MOVE_POWER, ENEMY_MOVE_POWER
-.MoveType: db PLAYER_MOVE_TYPE, ENEMY_MOVE_TYPE
-.CurMove: db PLAYER_CUR_MOVE, ENEMY_CUR_MOVE
-.LastCounter: db PLAYER_COUNTER_MOVE, ENEMY_COUNTER_MOVE
-.LastCounterOpp: db ENEMY_COUNTER_MOVE, PLAYER_COUNTER_MOVE
-.LastMove: db PLAYER_LAST_MOVE, ENEMY_LAST_MOVE
-.LastMoveOpp: db ENEMY_LAST_MOVE, PLAYER_LAST_MOVE
-
-.BattleVarPointers:
- dw wPlayerSubStatus1, wEnemySubStatus1
- dw wPlayerSubStatus2, wEnemySubStatus2
- dw wPlayerSubStatus3, wEnemySubStatus3
- dw wPlayerSubStatus4, wEnemySubStatus4
- dw wPlayerSubStatus5, wEnemySubStatus5
- dw wBattleMonStatus, wEnemyMonStatus
- dw wPlayerMoveStructAnimation, wEnemyMoveStructAnimation
- dw wPlayerMoveStructEffect, wEnemyMoveStructEffect
- dw wPlayerMoveStructPower, wEnemyMoveStructPower
- dw wPlayerMoveStructType, wEnemyMoveStructType
- dw wCurPlayerMove, wCurEnemyMove
- dw wLastPlayerCounterMove, wLastEnemyCounterMove
- dw wLastPlayerMove, wLastEnemyMove
-; 3a90
+GetBattleVar:: ; 39e1 +; Preserves hl. + push hl + call GetBattleVarAddr + pop hl + ret +; 39e7 + +GetBattleVarAddr:: ; 39e7 +; Get variable from pair a, depending on whose turn it is. +; There are 21 variable pairs. + + push bc + + ld hl, BattleVarPairs + ld c, a + ld b, 0 + add hl, bc + add hl, bc + + ld a, [hli] + ld h, [hl] + ld l, a + +; Enemy turn uses the second byte instead. +; This lets battle variable calls be side-neutral. + ld a, [hBattleTurn] + and a + jr z, .getvar + inc hl + +.getvar +; var id + ld a, [hl] + ld c, a + ld b, 0 + + ld hl, BattleVarLocations + add hl, bc + add hl, bc + + ld a, [hli] + ld h, [hl] + ld l, a + + ld a, [hl] + + pop bc + ret + +BattleVarPairs: +; entries correspond to BATTLE_VARS_* constants + dw .Substatus1 + dw .Substatus2 + dw .Substatus3 + dw .Substatus4 + dw .Substatus5 + dw .Substatus1Opp + dw .Substatus2Opp + dw .Substatus3Opp + dw .Substatus4Opp + dw .Substatus5Opp + dw .Status + dw .StatusOpp + dw .MoveAnim + dw .MoveEffect + dw .MovePower + dw .MoveType + dw .CurMove + dw .LastCounter + dw .LastCounterOpp + dw .LastMove + dw .LastMoveOpp + +; player enemy +.Substatus1: db PLAYER_SUBSTATUS_1, ENEMY_SUBSTATUS_1 +.Substatus1Opp: db ENEMY_SUBSTATUS_1, PLAYER_SUBSTATUS_1 +.Substatus2: db PLAYER_SUBSTATUS_2, ENEMY_SUBSTATUS_2 +.Substatus2Opp: db ENEMY_SUBSTATUS_2, PLAYER_SUBSTATUS_2 +.Substatus3: db PLAYER_SUBSTATUS_3, ENEMY_SUBSTATUS_3 +.Substatus3Opp: db ENEMY_SUBSTATUS_3, PLAYER_SUBSTATUS_3 +.Substatus4: db PLAYER_SUBSTATUS_4, ENEMY_SUBSTATUS_4 +.Substatus4Opp: db ENEMY_SUBSTATUS_4, PLAYER_SUBSTATUS_4 +.Substatus5: db PLAYER_SUBSTATUS_5, ENEMY_SUBSTATUS_5 +.Substatus5Opp: db ENEMY_SUBSTATUS_5, PLAYER_SUBSTATUS_5 +.Status: db PLAYER_STATUS, ENEMY_STATUS +.StatusOpp: db ENEMY_STATUS, PLAYER_STATUS +.MoveAnim: db PLAYER_MOVE_ANIMATION, ENEMY_MOVE_ANIMATION +.MoveEffect: db PLAYER_MOVE_EFFECT, ENEMY_MOVE_EFFECT +.MovePower: db PLAYER_MOVE_POWER, ENEMY_MOVE_POWER +.MoveType: db PLAYER_MOVE_TYPE, ENEMY_MOVE_TYPE +.CurMove: db PLAYER_CUR_MOVE, ENEMY_CUR_MOVE +.LastCounter: db PLAYER_COUNTER_MOVE, ENEMY_COUNTER_MOVE +.LastCounterOpp: db ENEMY_COUNTER_MOVE, PLAYER_COUNTER_MOVE +.LastMove: db PLAYER_LAST_MOVE, ENEMY_LAST_MOVE +.LastMoveOpp: db ENEMY_LAST_MOVE, PLAYER_LAST_MOVE + +BattleVarLocations: +; entries correspond to PLAYER_* and ENEMY_* constants + dw wPlayerSubStatus1, wEnemySubStatus1 + dw wPlayerSubStatus2, wEnemySubStatus2 + dw wPlayerSubStatus3, wEnemySubStatus3 + dw wPlayerSubStatus4, wEnemySubStatus4 + dw wPlayerSubStatus5, wEnemySubStatus5 + dw wBattleMonStatus, wEnemyMonStatus + dw wPlayerMoveStructAnimation, wEnemyMoveStructAnimation + dw wPlayerMoveStructEffect, wEnemyMoveStructEffect + dw wPlayerMoveStructPower, wEnemyMoveStructPower + dw wPlayerMoveStructType, wEnemyMoveStructType + dw wCurPlayerMove, wCurEnemyMove + dw wLastPlayerCounterMove, wLastEnemyCounterMove + dw wLastPlayerMove, wLastEnemyMove +; 3a90 diff --git a/home/cry.asm b/home/cry.asm index 93983a6ae..c5f4a1c8a 100644 --- a/home/cry.asm +++ b/home/cry.asm @@ -55,7 +55,7 @@ _PlayMonCry:: ; 37e2 ; 37f3 LoadCry:: ; 37f3 -; Load cry header bc. +; Load cry bc. call GetCryIndex ret c diff --git a/home/flag.asm b/home/flag.asm index 0b1390c99..00c7d4b7e 100644 --- a/home/flag.asm +++ b/home/flag.asm @@ -15,15 +15,15 @@ ResetBikeFlags:: ; 2e56 ResetFlashIfOutOfCave:: ; 2e5d ld a, [wEnvironment] - cp $2 - jr z, .asm_2e69 - cp $1 - jr z, .asm_2e69 + cp ROUTE + jr z, .outdoors + cp TOWN + jr z, .outdoors ret -.asm_2e69 +.outdoors ld hl, wStatusFlags - res 2, [hl] + res STATUSFLAGS_FLASH_F, [hl] ret ; 2e6f diff --git a/home/game_time.asm b/home/game_time.asm index feaa09608..f80d9a462 100644 --- a/home/game_time.asm +++ b/home/game_time.asm @@ -39,7 +39,7 @@ UpdateGameTimer:: ; 20ad ; Is the timer paused? ld hl, wGameTimerPause - bit 0, [hl] + bit GAMETIMERPAUSE_TIMER_PAUSED_F, [hl] ret z ; Is the timer already capped? diff --git a/home/map.asm b/home/map.asm index 252b68cbe..0bce53c62 100644 --- a/home/map.asm +++ b/home/map.asm @@ -394,7 +394,7 @@ CheckIndoorMap:: ; 22f4 ; 2309 LoadMapAttributes:: ; 2309 - call CopyMapDefAndData + call CopyMapPartialAndAttributes call SwitchToMapScriptsBank call ReadMapScripts xor a ; do not skip object_events @@ -403,7 +403,7 @@ LoadMapAttributes:: ; 2309 ; 2317 LoadMapAttributes_SkipPeople:: ; 2317 - call CopyMapDefAndData + call CopyMapPartialAndAttributes call SwitchToMapScriptsBank call ReadMapScripts ld a, TRUE ; skip object events @@ -411,11 +411,11 @@ LoadMapAttributes_SkipPeople:: ; 2317 ret ; 2326 -CopyMapDefAndData:: ; 2326 - call PartialCopyMapDef - call SwitchToMapDataBank - call GetMapDataPointer - call CopyMapData +CopyMapPartialAndAttributes:: ; 2326 + call CopyMapPartial + call SwitchToMapAttributesBank + call GetMapAttributesPointer + call CopyMapAttributes call GetMapConnections ret ; 2336 @@ -450,9 +450,9 @@ ReadMapScripts:: ; 234f ret ; 235c -CopyMapData:: ; 235c - ld de, wMapData - ld c, wMapDataEnd - wMapData +CopyMapAttributes:: ; 235c + ld de, wMapAttributes + ld c, wMapAttributesEnd - wMapAttributes .loop ld a, [hli] ld [de], a @@ -1983,8 +1983,8 @@ CheckCurrentMapCoordEvents:: ; 2ad4 FadeToMenu:: ; 2b29 xor a ld [hBGMapMode], a - call LoadStandardMenuDataHeader - farcall Special_FadeOutPalettes + call LoadStandardMenuHeader + farcall FadeOutPalettes call ClearSprites call DisableSpriteUpdates ret @@ -2010,7 +2010,7 @@ FinishExitMenu:: ; 2b5c call GetSGBLayout farcall LoadOW_BGPal7 call WaitBGMap2 - farcall Special_FadeInPalettes + farcall FadeInPalettes call EnableSpriteUpdates ret ; 2b74 @@ -2043,7 +2043,7 @@ ReturnToMapWithSpeechTextbox:: ; 0x2b74 ReloadTilesetAndPalettes:: ; 2bae call DisableLCD call ClearSprites - farcall Special_RefreshSprites + farcall RefreshSprites call LoadStandardFont call LoadFontsExtra ld a, [hROMBank] @@ -2052,7 +2052,7 @@ ReloadTilesetAndPalettes:: ; 2bae ld b, a ld a, [wMapNumber] ld c, a - call SwitchToAnyMapDataBank + call SwitchToAnyMapAttributesBank farcall UpdateTimeOfDayPal call OverworldTextModeSwitch call LoadTilesetGFX @@ -2065,12 +2065,12 @@ ReloadTilesetAndPalettes:: ; 2bae ret ; 2be5 -GetMapDefPointer:: ; 2be5 +GetMapPointer:: ; 2be5 ld a, [wMapGroup] ld b, a ld a, [wMapNumber] ld c, a -GetAnyMapDefPointer:: ; 0x2bed +GetAnyMapPointer:: ; 0x2bed ; Prior to calling this function, you must have switched banks so that ; MapGroupPointers is visible. @@ -2078,7 +2078,7 @@ GetAnyMapDefPointer:: ; 0x2bed ; b = map group, c = map number ; outputs: -; hl points to the map_def +; hl points to the map within its group push bc ; save map number for later ; get pointer to map group @@ -2094,7 +2094,7 @@ GetAnyMapDefPointer:: ; 0x2bed ld l, a pop bc ; restore map number - ; find the cth map_def + ; find the cth map within the group dec c ld b, 0 ld a, 9 @@ -2102,28 +2102,28 @@ GetAnyMapDefPointer:: ; 0x2bed ret ; 0x2c04 -GetMapDefField:: ; 0x2c04 -; Extract data from the current map's map_def. +GetMapField:: ; 0x2c04 +; Extract data from the current map's group entry. ; inputs: -; de = offset of desired data within the map_def (a MAPDEF_* constant) +; de = offset of desired data within the map (a MAP_* constant) ; outputs: -; bc = data from the current map's map_def -; (e.g., de = MAPDEF_TILESET would return a pointer to the tileset id) +; bc = data from the current map's field +; (e.g., de = MAP_TILESET would return a pointer to the tileset id) ld a, [wMapGroup] ld b, a ld a, [wMapNumber] ld c, a -GetAnyMapDefField:: ; 0x2c0c +GetAnyMapField:: ; 0x2c0c ; bankswitch ld a, [hROMBank] push af ld a, BANK(MapGroupPointers) rst Bankswitch - call GetAnyMapDefPointer + call GetAnyMapPointer add hl, de ld c, [hl] inc hl @@ -2135,44 +2135,44 @@ GetAnyMapDefField:: ; 0x2c0c ret ; 0x2c1c -SwitchToMapDataBank:: ; 2c1c +SwitchToMapAttributesBank:: ; 2c1c ld a, [wMapGroup] ld b, a ld a, [wMapNumber] ld c, a -SwitchToAnyMapDataBank:: ; 2c24 - call GetAnyMapDataBank +SwitchToAnyMapAttributesBank:: ; 2c24 + call GetAnyMapAttributesBank rst Bankswitch ret ; 2c29 -GetMapDataBank:: ; 2c29 +GetMapAttributesBank:: ; 2c29 ld a, [wMapGroup] ld b, a ld a, [wMapNumber] ld c, a -GetAnyMapDataBank:: ; 2c31 +GetAnyMapAttributesBank:: ; 2c31 push hl push de - ld de, MAPDEF_MAPDATA_BANK - call GetAnyMapDefField + ld de, MAP_MAPATTRIBUTES_BANK + call GetAnyMapField ld a, c pop de pop hl ret ; 2c3d -PartialCopyMapDef:: ; 2c3d +CopyMapPartial:: ; 2c3d ; Copy map data bank, tileset, environment, and map data address -; from the current map's map_def. +; from the current map's entry within its group. ld a, [hROMBank] push af ld a, BANK(MapGroupPointers) rst Bankswitch - call GetMapDefPointer - ld de, wPartialMapDef - ld bc, wPartialMapDefEnd - wPartialMapDef + call GetMapPointer + ld de, wMapPartial + ld bc, wMapPartialEnd - wMapPartial call CopyBytes pop af @@ -2198,18 +2198,18 @@ GetAnyMapBlocksBank:: ; 2c5b push bc push bc - ld de, MAPDEF_MAPDATA - call GetAnyMapDefField + ld de, MAP_MAPATTRIBUTES + call GetAnyMapField ld l, c ld h, b pop bc push hl - ld de, MAPDEF_MAPDATA_BANK - call GetAnyMapDefField + ld de, MAP_MAPATTRIBUTES_BANK + call GetAnyMapField pop hl - ld de, MAPDEF_MAPDATA ; blockdata bank + ld de, MAP_MAPATTRIBUTES ; blockdata bank add hl, de ld a, c call GetFarByte @@ -2221,12 +2221,12 @@ GetAnyMapBlocksBank:: ; 2c5b ret ; 2c7d -GetMapDataPointer:: ; 0x2c7d +GetMapAttributesPointer:: ; 0x2c7d ; returns the current map's data pointer in hl. push bc push de - ld de, MAPDEF_MAPDATA - call GetMapDefField + ld de, MAP_MAPATTRIBUTES + call GetMapField ld l, c ld h, b pop de @@ -2238,8 +2238,8 @@ GetMapEnvironment:: ; 2c8a push hl push de push bc - ld de, MAPDEF_ENVIRONMENT - call GetMapDefField + ld de, MAP_ENVIRONMENT + call GetMapField ld a, c pop bc pop de @@ -2254,8 +2254,8 @@ GetAnyMapEnvironment:: ; 2c99 push hl push de push bc - ld de, MAPDEF_ENVIRONMENT - call GetAnyMapDefField + ld de, MAP_ENVIRONMENT + call GetAnyMapField ld a, c pop bc pop de @@ -2264,8 +2264,8 @@ GetAnyMapEnvironment:: ; 2c99 ; 2ca7 GetAnyMapTileset:: ; 2ca7 - ld de, MAPDEF_TILESET - call GetAnyMapDefField + ld de, MAP_TILESET + call GetAnyMapField ld a, c ret ; 2caf @@ -2276,8 +2276,8 @@ GetWorldMapLocation:: ; 0x2caf push de push bc - ld de, MAPDEF_LOCATION - call GetAnyMapDefField + ld de, MAP_LOCATION + call GetAnyMapField ld a, c pop bc @@ -2289,8 +2289,8 @@ GetWorldMapLocation:: ; 0x2caf GetMapMusic:: ; 2cbd push hl push bc - ld de, MAPDEF_MUSIC - call GetMapDefField + ld de, MAP_MUSIC + call GetMapField ld a, c cp MUSIC_MAHOGANY_MART jr z, .mahoganymart @@ -2306,7 +2306,7 @@ GetMapMusic:: ; 2cbd .radiotower ld a, [wStatusFlags2] - bit 0, a + bit STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F, a jr z, .clearedradiotower ld de, MUSIC_ROCKET_OVERTURE jr .done @@ -2321,7 +2321,7 @@ GetMapMusic:: ; 2cbd .mahoganymart ld a, [wStatusFlags2] - bit 7, a + bit STATUSFLAGS2_ROCKETS_IN_MAHOGANY_F, a jr z, .clearedmahogany ld de, MUSIC_ROCKET_HIDEOUT jr .done @@ -2348,8 +2348,8 @@ GetPhoneServiceTimeOfDayByte:: ; 2d0d push hl push bc - ld de, MAPDEF_PALETTE - call GetMapDefField + ld de, MAP_PALETTE + call GetMapField ld a, c pop bc @@ -2362,8 +2362,8 @@ GetFishingGroup:: ; 2d19 push hl push bc - ld de, MAPDEF_FISHGROUP - call GetMapDefField + ld de, MAP_FISHGROUP + call GetMapField ld a, c pop bc diff --git a/home/map_objects.asm b/home/map_objects.asm index 97e4bae37..c99e27088 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -276,7 +276,10 @@ CheckObjectTime:: ; 18f5 ret .TimeOfDayValues_191e: - db MORN, DAY, NITE +; entries correspond to TimeOfDay values + db MORN + db DAY + db NITE .check_hour ld hl, MAPOBJECT_HOUR diff --git a/home/menu.asm b/home/menu.asm index ae3252e96..05ec1212a 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -1,14 +1,14 @@ ; Functions used in displaying and handling menus. -LoadMenuDataHeader:: - call CopyMenuDataHeader +LoadMenuHeader:: + call CopyMenuHeader call PushWindow ret -CopyMenuDataHeader:: - ld de, wMenuDataHeader - ld bc, wMenuDataHeaderEnd - wMenuDataHeader +CopyMenuHeader:: + ld de, wMenuHeader + ld bc, wMenuHeaderEnd - wMenuHeader call CopyBytes ld a, [hROMBank] ld [wMenuDataBank], a @@ -33,12 +33,12 @@ MenuTextBox:: ; 1d4f ; 1d58 LoadMenuTextBox:: ; 1d58 - ld hl, .MenuDataHeader - call LoadMenuDataHeader + ld hl, .MenuHeader + call LoadMenuHeader ret ; 1d5f -.MenuDataHeader: ; 1d5f +.MenuHeader: ; 1d5f db MENU_BACKUP_TILES ; flags menu_coords 0, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1 dw vTiles0 @@ -51,13 +51,13 @@ MenuTextBoxBackup:: ; 1d67 ret ; 1d6e -LoadStandardMenuDataHeader:: ; 1d6e - ld hl, .MenuDataHeader - call LoadMenuDataHeader +LoadStandardMenuHeader:: ; 1d6e + ld hl, .MenuHeader + call LoadMenuHeader ret ; 1d75 -.MenuDataHeader: ; 1d75 +.MenuHeader: ; 1d75 db MENU_BACKUP_TILES ; flags menu_coords 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1 dw 0 @@ -76,8 +76,8 @@ VerticalMenu:: call UpdateSprites call PlaceVerticalMenuItems call ApplyTilemap - call CopyMenuData2 - ld a, [wMenuData2Flags] + call CopyMenuData + ld a, [wMenuDataFlags] bit 7, a jr z, .cancel call InitVerticalMenuCursor @@ -95,7 +95,7 @@ VerticalMenu:: ; 0x1dab GetMenu2:: ; 1dab - call LoadMenuDataHeader + call LoadMenuHeader call VerticalMenu call CloseWindow ld a, [wMenuCursorY] @@ -106,7 +106,7 @@ CopyNameFromMenu:: push hl push bc push af - ld hl, wMenuData2Pointer + ld hl, wMenuDataPointer ld a, [hli] ld h, [hl] ld l, a @@ -130,14 +130,14 @@ PlaceYesNoBox:: ; 1dd2 jr _YesNoBox PlaceGenericTwoOptionBox:: ; 1dd4 - call LoadMenuDataHeader + call LoadMenuHeader jr InterpretTwoOptionMenu _YesNoBox:: ; 1dd9 ; Return nc (yes) or c (no). push bc - ld hl, YesNoMenuDataHeader - call CopyMenuDataHeader + ld hl, YesNoMenuHeader + call CopyMenuHeader pop bc ; This seems to be an overflow prevention, but ; it was coded wrong. @@ -179,29 +179,29 @@ InterpretTwoOptionMenu:: ; 1dfe ret ; 1e1d -YesNoMenuDataHeader:: ; 1e1d +YesNoMenuHeader:: ; 1e1d db MENU_BACKUP_TILES ; flags menu_coords 10, 5, 15, 9 - dw .MenuData2 + dw .MenuData db 1 ; default option ; 1e25 -.MenuData2: ; 1e25 +.MenuData: ; 1e25 db STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING ; flags db 2 db "YES@" db "NO@" ; 1e2e -OffsetMenuDataHeader:: ; 1e2e - call _OffsetMenuDataHeader +OffsetMenuHeader:: ; 1e2e + call _OffsetMenuHeader call PushWindow ret ; 1e35 -_OffsetMenuDataHeader:: ; 1e35 +_OffsetMenuHeader:: ; 1e35 push de - call CopyMenuDataHeader + call CopyMenuHeader pop de ld a, [wMenuBorderLeftCoord] ld h, a @@ -243,7 +243,7 @@ SetUpMenu:: ; 1e70 ret DrawVariableLengthMenuBox:: - call CopyMenuData2 + call CopyMenuData call GetMenuIndexSet call AutomaticGetMenuBottomCoord call MenuBox @@ -271,7 +271,7 @@ AutomaticGetMenuBottomCoord:: ; 1ea6 ld a, [wMenuBorderRightCoord] sub c ld c, a - ld a, [wMenuData2Items] + ld a, [wMenuDataItems] add a inc a ld b, a @@ -282,7 +282,7 @@ AutomaticGetMenuBottomCoord:: ; 1ea6 ; 1ebd GetMenuIndexSet:: ; 1ebd - ld hl, wMenuData2IndicesPointer + ld hl, wMenuDataIndicesPointer ld a, [hli] ld h, [hl] ld l, a @@ -302,7 +302,7 @@ GetMenuIndexSet:: ; 1ebd ld d, h ld e, l ld a, [hl] - ld [wMenuData2Items], a + ld [wMenuDataItems], a ret ; 1eda @@ -320,7 +320,7 @@ RunMenuItemPrintingFunction:: ; 1eda push hl ld d, h ld e, l - ld hl, wMenuData2DisplayFunctionPointer + ld hl, wMenuDataDisplayFunctionPointer call ._hl_ pop hl ld de, 2 * SCREEN_WIDTH @@ -339,13 +339,13 @@ RunMenuItemPrintingFunction:: ; 1eda InitMenuCursorAndButtonPermissions:: ; 1eff call InitVerticalMenuCursor ld hl, wMenuJoypadFilter - ld a, [wMenuData2Flags] + ld a, [wMenuDataFlags] bit 3, a jr z, .disallow_select set START_F, [hl] .disallow_select - ld a, [wMenuData2Flags] + ld a, [wMenuDataFlags] bit 2, a jr z, .disallow_left_right set D_LEFT_F, [hl] @@ -422,7 +422,7 @@ ContinueGettingMenuJoypad: PlaceMenuStrings:: ; 1f79 push de - ld hl, wMenuData2PointerTableAddr + ld hl, wMenuDataPointerTableAddr ld a, [hli] ld h, [hl] ld l, a @@ -471,7 +471,7 @@ MenuJumptable:: ; 1fa7 GetMenuDataPointerTableEntry:: ; 1fb1 ld e, a ld d, $0 - ld hl, wMenuData2PointerTableAddr + ld hl, wMenuDataPointerTableAddr ld a, [hli] ld h, [hl] ld l, a @@ -485,9 +485,9 @@ GetMenuDataPointerTableEntry:: ; 1fb1 ClearWindowData:: ; 1fbf ld hl, wWindowStackPointer call .bytefill - ld hl, wMenuDataHeader + ld hl, wMenuHeader call .bytefill - ld hl, wMenuData2Flags + ld hl, wMenuDataFlags call .bytefill ld hl, w2DMenuCursorInitY call .bytefill @@ -563,7 +563,7 @@ Place2DMenuItemName:: ; 201c _2DMenu:: ; 202a ld a, [hROMBank] - ld [wMenuData2_2DMenuItemStringsBank], a + ld [wMenuData_2DMenuItemStringsBank], a farcall _2DMenu_ ld a, [wMenuCursorBuffer] ret @@ -571,7 +571,7 @@ _2DMenu:: ; 202a InterpretBattleMenu:: ; 2039 ld a, [hROMBank] - ld [wMenuData2_2DMenuItemStringsBank], a + ld [wMenuData_2DMenuItemStringsBank], a farcall _InterpretBattleMenu ld a, [wMenuCursorBuffer] ret @@ -579,7 +579,7 @@ InterpretBattleMenu:: ; 2039 InterpretMobileMenu:: ; 2048 ld a, [hROMBank] - ld [wMenuData2_2DMenuItemStringsBank], a + ld [wMenuData_2DMenuItemStringsBank], a farcall _InterpretMobileMenu ld a, [wMenuCursorBuffer] ret diff --git a/home/palettes.asm b/home/palettes.asm index 9f10da118..e8996c160 100644 --- a/home/palettes.asm +++ b/home/palettes.asm @@ -253,7 +253,7 @@ CopyPals:: ; d50 ; get pal color ld a, b - and %11 ; color + maskbits 1 << PAL_COLOR_SIZE ; 2 bytes per color add a ld l, a @@ -271,8 +271,9 @@ CopyPals:: ; d50 ld [hl], d inc hl ; next pal color +rept PAL_COLOR_SIZE srl b - srl b +endr ; source pop de ; done pal? @@ -280,7 +281,7 @@ CopyPals:: ; d50 jr nz, .loop ; de += 8 (next pal) - ld a, NUM_PAL_COLORS * 2 + ld a, PALETTE_SIZE add e jr nc, .ok inc d diff --git a/home/text.asm b/home/text.asm index 5e7e66d43..a1f6b75eb 100644 --- a/home/text.asm +++ b/home/text.asm @@ -399,7 +399,7 @@ PlaceGenderedPlayerName:: ; 1252 ld h, b ld l, c ld a, [wPlayerGender] - bit 0, a + bit PLAYERGENDER_FEMALE_F, a ld de, KunSuffixText jr z, PlaceCommandCharacter ld de, ChanSuffixText @@ -568,7 +568,7 @@ ContText:: ; 1345 PlaceDexEnd:: ; 1356 -; Legacy: ends a Pokédex entry (Red). +; Ends a Pokédex entry in Gen 1. ; Dex entries are now regular strings. ld [hl], "." pop hl diff --git a/home/tilemap.asm b/home/tilemap.asm index 4bbd16102..aceb00343 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -79,17 +79,17 @@ GetMenuBoxDims:: ; 0x1c53 ret ; 0x1c66 -CopyMenuData2:: ; 1c66 +CopyMenuData:: ; 1c66 push hl push de push bc push af - ld hl, wMenuData2Pointer + ld hl, wMenuDataPointer ld a, [hli] ld h, [hl] ld l, a - ld de, wMenuData2Flags - ld bc, wMenuData2End - wMenuData2Flags + ld de, wMenuDataFlags + ld bc, wMenuDataEnd - wMenuDataFlags call CopyBytes pop af pop bc @@ -111,8 +111,8 @@ GetWindowStackTop:: ; 1c7e ; 1c89 PlaceVerticalMenuItems:: ; 1c89 - call CopyMenuData2 - ld hl, wMenuData2Pointer + call CopyMenuData + ld hl, wMenuDataPointer ld e, [hl] inc hl ld d, [hl] @@ -132,7 +132,7 @@ PlaceVerticalMenuItems:: ; 1c89 dec b jr nz, .loop - ld a, [wMenuData2Flags] + ld a, [wMenuDataFlags] bit 4, a ret z @@ -161,14 +161,14 @@ GetMenuTextStartCoord:: ; 1cc6 ld c, a inc c ; bit 6: if not set, leave extra room on top - ld a, [wMenuData2Flags] + ld a, [wMenuDataFlags] bit 6, a jr nz, .bit_6_set inc b .bit_6_set ; bit 7: if set, leave extra room on the left - ld a, [wMenuData2Flags] + ld a, [wMenuDataFlags] bit 7, a jr z, .bit_7_clear inc c diff --git a/home/time.asm b/home/time.asm index 5ede49173..f007fd1db 100644 --- a/home/time.asm +++ b/home/time.asm @@ -187,14 +187,14 @@ FixTime:: ; 61d ret ; 658 -SetTimeOfDay:: ; 658 +InitTimeOfDay:: ; 658 xor a ld [wStringBuffer2], a ld a, $0 ; useless ld [wStringBuffer2 + 3], a jr InitTime -SetDayOfWeek:: ; 663 +InitDayOfWeek:: ; 663 call UpdateTime ld a, [hHours] ld [wStringBuffer2 + 1], a |