diff options
author | pikalaxalt <PikalaxALT@gmail.com> | 2016-05-30 09:36:57 -0400 |
---|---|---|
committer | pikalaxalt <PikalaxALT@gmail.com> | 2016-05-30 09:36:57 -0400 |
commit | 5d6f3ec1d4f24bb2598359402c361f2ec47546da (patch) | |
tree | d63a6b6edf70461f0dee51925c904ca9ce39d678 | |
parent | 84ac49aadb3c8ccb38f0fbf70a413470fa7ccad2 (diff) |
Cerulean Pokemon Center; Func_5c0d4; space after comma in engine/menu/pokedex.asm
-rw-r--r-- | constants/pokedex_constants.asm | 2 | ||||
-rw-r--r-- | constants/pokemon_constants.asm | 2 | ||||
-rwxr-xr-x | data/mapObjects/ceruleanpokecenter.asm | 5 | ||||
-rw-r--r-- | data/map_header_banks.asm | 2 | ||||
-rw-r--r-- | data/map_header_pointers.asm | 2 | ||||
-rwxr-xr-x | engine/menu/pokedex.asm | 526 | ||||
-rwxr-xr-x | main.asm | 18 | ||||
-rwxr-xr-x | scripts/ceruleanpokecenter.asm | 6 | ||||
-rwxr-xr-x | wram.asm | 2 |
9 files changed, 292 insertions, 273 deletions
diff --git a/constants/pokedex_constants.asm b/constants/pokedex_constants.asm index 07cda548..360fbb4c 100644 --- a/constants/pokedex_constants.asm +++ b/constants/pokedex_constants.asm @@ -82,7 +82,7 @@ const_value = 1 const DEX_SLOWBRO ; 80 const DEX_MAGNEMITE ; 81 const DEX_MAGNETON ; 82 - const DEX_FARFETCHD ; 83 + const DEX_FARFETCHD ; 83 const DEX_DODUO ; 84 const DEX_DODRIO ; 85 const DEX_SEEL ; 86 diff --git a/constants/pokemon_constants.asm b/constants/pokemon_constants.asm index 773495e3..96d44ef5 100644 --- a/constants/pokemon_constants.asm +++ b/constants/pokemon_constants.asm @@ -63,7 +63,7 @@ const_value = 1 const MISSINGNO_3D ; $3D const MISSINGNO_3E ; $3E const MISSINGNO_3F ; $3F - const FARFETCHD ; $40 + const FARFETCHD ; $40 const VENONAT ; $41 const DRAGONITE ; $42 const MISSINGNO_43 ; $43 diff --git a/data/mapObjects/ceruleanpokecenter.asm b/data/mapObjects/ceruleanpokecenter.asm index 930995dd..4b92f0d8 100755 --- a/data/mapObjects/ceruleanpokecenter.asm +++ b/data/mapObjects/ceruleanpokecenter.asm @@ -7,11 +7,12 @@ CeruleanPokecenterObject: ; 0x5c65f (size=44) db $0 ; signs - db $4 ; objects + db $5 ; objects object SPRITE_NURSE, $3, $1, STAY, DOWN, $1 ; person object SPRITE_BLACK_HAIR_BOY_2, $a, $5, WALK, $0, $2 ; person - object SPRITE_GENTLEMAN, $4, $3, STAY, DOWN, $3 ; person + object SPRITE_GENTLEMAN, $4, $3, STAY, UP, $3 ; person object SPRITE_CABLE_CLUB_WOMAN, $b, $2, STAY, DOWN, $4 ; person + object SPRITE_CHANSEY, $4, $1, STAY, DOWN, $5 ; person ; warp-to EVENT_DISP CERULEAN_POKECENTER_WIDTH, $7, $3 diff --git a/data/map_header_banks.asm b/data/map_header_banks.asm index bbcdd278..65579280 100644 --- a/data/map_header_banks.asm +++ b/data/map_header_banks.asm @@ -64,7 +64,7 @@ MapHeaderBanks:: ; fc3e4 (3f:43e4) db BANK(MtMoon3_h) db BANK(CeruleanHouseTrashed_h) db BANK(CeruleanHouse1_h) - db $17 ; db BANK(CeruleanPokecenter_h) + db BANK(CeruleanPokecenter_h) db $17 ; db BANK(CeruleanGym_h) db $07 ; db BANK(BikeShop_h) db $17 ; db BANK(CeruleanMart_h) diff --git a/data/map_header_pointers.asm b/data/map_header_pointers.asm index 9558ca6e..d80f85f5 100644 --- a/data/map_header_pointers.asm +++ b/data/map_header_pointers.asm @@ -64,7 +64,7 @@ MapHeaderPointers:: ; fc1f2 (3f:41f2) dw MtMoon3_h dw CeruleanHouseTrashed_h dw CeruleanHouse1_h - dw $44f5 ; dw CeruleanPokecenter_h + dw CeruleanPokecenter_h dw $4577 ; dw CeruleanGym_h dw $5038 ; dw BikeShop_h dw $4757 ; dw CeruleanMart_h diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm index c481a20c..298816c1 100755 --- a/engine/menu/pokedex.asm +++ b/engine/menu/pokedex.asm @@ -2,54 +2,54 @@ ShowPokedexMenu: ; 40000 (10:4000) call GBPalWhiteOut call ClearScreen call UpdateSprites - ld a,[wListScrollOffset] + ld a, [wListScrollOffset] push af xor a - ld [wCurrentMenuItem],a - ld [wListScrollOffset],a - ld [wLastMenuItem],a + ld [wCurrentMenuItem], a + ld [wListScrollOffset], a + ld [wLastMenuItem], a inc a - ld [wd11e],a - ld [hJoy7],a + ld [wd11e], a + ld [hJoy7], a .setUpGraphics callab LoadPokedexTilePatterns .asm_40025 ld b, SET_PAL_GENERIC call RunPaletteCommand .doPokemonListMenu - ld hl,wTopMenuItemY - ld a,3 - ld [hli],a ; top menu item Y + ld hl, wTopMenuItemY + ld a, 3 + ld [hli], a ; top menu item Y xor a - ld [hli],a ; top menu item X + ld [hli], a ; top menu item X inc a - ld [wMenuWatchMovingOutOfBounds],a + ld [wMenuWatchMovingOutOfBounds], a inc hl inc hl - ld a,6 - ld [hli],a ; max menu item ID - ld [hl],D_LEFT | D_RIGHT | B_BUTTON | A_BUTTON + ld a, 6 + ld [hli], a ; max menu item ID + ld [hl], D_LEFT | D_RIGHT | B_BUTTON | A_BUTTON call HandlePokedexListMenu - jr c,.goToSideMenu ; if the player chose a pokemon from the list + jr c, .goToSideMenu ; if the player chose a pokemon from the list .exitPokedex xor a - ld [wMenuWatchMovingOutOfBounds],a - ld [wCurrentMenuItem],a - ld [wLastMenuItem],a - ld [hJoy7],a - ld [wWastedByteCD3A],a - ld [wOverrideSimulatedJoypadStatesMask],a + ld [wMenuWatchMovingOutOfBounds], a + ld [wCurrentMenuItem], a + ld [wLastMenuItem], a + ld [hJoy7], a + ld [wWastedByteCD3A], a + ld [wOverrideSimulatedJoypadStatesMask], a pop af - ld [wListScrollOffset],a + ld [wListScrollOffset], a call GBPalWhiteOutWithDelay3 call RunDefaultPaletteCommand jp ReloadMapData .goToSideMenu call HandlePokedexSideMenu dec b - jr z,.exitPokedex ; if the player chose Quit + jr z, .exitPokedex ; if the player chose Quit dec b - jr z,.doPokemonListMenu ; if pokemon not seen or player pressed B button + jr z, .doPokemonListMenu ; if pokemon not seen or player pressed B button dec b jr z, .asm_40025 jp .setUpGraphics ; if pokemon data or area was shown @@ -62,73 +62,73 @@ ShowPokedexMenu: ; 40000 (10:4000) ; 02: the pokemon has not been seen yet or the player pressed the B button HandlePokedexSideMenu: ; 40070 (10:4070) call PlaceUnfilledArrowMenuCursor - ld a,[wCurrentMenuItem] + ld a, [wCurrentMenuItem] push af - ld b,a - ld a,[wLastMenuItem] + ld b, a + ld a, [wLastMenuItem] push af - ld a,[wListScrollOffset] + ld a, [wListScrollOffset] push af add b inc a - ld [wd11e],a - ld a,[wd11e] + ld [wd11e], a + ld a, [wd11e] push af - ld a,[wDexMaxSeenMon] + ld a, [wDexMaxSeenMon] push af ; this doesn't need to be preserved - ld hl,wPokedexSeen + ld hl, wPokedexSeen call IsPokemonBitSet - ld b,2 - jr z,.exitSideMenu + ld b, 2 + jr z, .exitSideMenu call PokedexToIndex - ld hl,wTopMenuItemY - ld a,8 - ld [hli],a ; top menu item Y - ld a,15 - ld [hli],a ; top menu item X + ld hl, wTopMenuItemY + ld a, 8 + ld [hli], a ; top menu item Y + ld a, 15 + ld [hli], a ; top menu item X xor a - ld [hli],a ; current menu item ID + ld [hli], a ; current menu item ID inc hl - ld a,4 - ld [hli],a ; max menu item ID + ld a, 4 + ld [hli], a ; max menu item ID ld a, A_BUTTON | B_BUTTON - ld [hli],a ; menu watched keys (A button and B button) + ld [hli], a ; menu watched keys (A button and B button) xor a - ld [hli],a ; old menu item ID - ld [wMenuWatchMovingOutOfBounds],a - ld [hJoy7],a + ld [hli], a ; old menu item ID + ld [wMenuWatchMovingOutOfBounds], a + ld [hJoy7], a .handleMenuInput call HandleMenuInput - bit 1,a ; was the B button pressed? - ld b,2 - jr nz,.buttonBPressed - ld a,[wCurrentMenuItem] + bit 1, a ; was the B button pressed? + ld b, 2 + jr nz, .buttonBPressed + ld a, [wCurrentMenuItem] and a - jr z,.choseData + jr z, .choseData dec a - jr z,.choseCry + jr z, .choseCry dec a - jr z,.choseArea + jr z, .choseArea dec a - jr z,.chosePrint + jr z, .chosePrint .choseQuit - ld b,1 + ld b, 1 .exitSideMenu pop af - ld [wDexMaxSeenMon],a + ld [wDexMaxSeenMon], a pop af - ld [wd11e],a + ld [wd11e], a pop af - ld [wListScrollOffset],a + ld [wListScrollOffset], a pop af - ld [wLastMenuItem],a + ld [wLastMenuItem], a pop af - ld [wCurrentMenuItem],a + ld [wCurrentMenuItem], a ld a, $1 ld [hJoy7], a push bc coord hl, 0, 3 - ld de,20 + ld de, 20 lb bc, " ", 13 call DrawTileLine ; cover up the menu cursor in the pokemon list pop bc @@ -136,24 +136,24 @@ HandlePokedexSideMenu: ; 40070 (10:4070) .buttonBPressed push bc coord hl, 15, 8 - ld de,20 + ld de, 20 lb bc, " ", 9 call DrawTileLine ; cover up the menu cursor in the side menu pop bc jr .exitSideMenu .choseData call ShowPokedexDataInternal - ld b,0 + ld b, 0 jr .exitSideMenu ; play pokemon cry .choseCry - ld a,[wd11e] + ld a, [wd11e] call GetCryData call PlaySound jr .handleMenuInput .choseArea predef LoadTownMap_Nest ; display pokemon areas - ld b,0 + ld b, 0 jr .exitSideMenu .chosePrint ld a, [hTilesetType] @@ -179,63 +179,63 @@ HandlePokedexListMenu: ; 40140 (10:4140) call Func_4027c call GBPalNormal call HandleMenuInput - bit 1,a ; was the B button pressed? - jp nz,.buttonBPressed + bit 1, a ; was the B button pressed? + jp nz, .buttonBPressed bit 0, a ; was the A button pressed? - jp nz,.buttonAPressed + jp nz, .buttonAPressed .checkIfUpPressed - bit 6,a ; was Up pressed? - jr z,.checkIfDownPressed + bit 6, a ; was Up pressed? + jr z, .checkIfDownPressed .upPressed ; scroll up one row - ld a,[wListScrollOffset] + ld a, [wListScrollOffset] and a - jp z,.loop + jp z, .loop dec a - ld [wListScrollOffset],a + ld [wListScrollOffset], a jp .loop .checkIfDownPressed - bit 7,a ; was Down pressed? - jr z,.checkIfRightPressed + bit 7, a ; was Down pressed? + jr z, .checkIfRightPressed .downPressed ; scroll down one row - ld a,[wDexMaxSeenMon] - cp a,7 - jp c,.loop ; can't if the list is shorter than 7 - sub a,7 - ld b,a - ld a,[wListScrollOffset] + ld a, [wDexMaxSeenMon] + cp a, 7 + jp c, .loop ; can't if the list is shorter than 7 + sub a, 7 + ld b, a + ld a, [wListScrollOffset] cp b - jp z,.loop + jp z, .loop inc a - ld [wListScrollOffset],a + ld [wListScrollOffset], a jp .loop .checkIfRightPressed - bit 4,a ; was Right pressed? - jr z,.checkIfLeftPressed + bit 4, a ; was Right pressed? + jr z, .checkIfLeftPressed .rightPressed ; scroll down 7 rows - ld a,[wDexMaxSeenMon] - cp a,7 - jp c,.loop ; can't if the list is shorter than 7 - sub a,6 - ld b,a - ld a,[wListScrollOffset] - add a,7 - ld [wListScrollOffset],a + ld a, [wDexMaxSeenMon] + cp a, 7 + jp c, .loop ; can't if the list is shorter than 7 + sub a, 6 + ld b, a + ld a, [wListScrollOffset] + add a, 7 + ld [wListScrollOffset], a cp b - jp c,.loop + jp c, .loop dec b - ld a,b - ld [wListScrollOffset],a + ld a, b + ld [wListScrollOffset], a jp .loop .checkIfLeftPressed ; scroll up 7 rows - bit 5,a ; was Left pressed? - jr z,.buttonAPressed + bit 5, a ; was Left pressed? + jr z, .buttonAPressed .leftPressed - ld a,[wListScrollOffset] - sub a,7 - ld [wListScrollOffset],a - jp nc,.loop + ld a, [wListScrollOffset] + sub a, 7 + ld [wListScrollOffset], a + jp nc, .loop xor a - ld [wListScrollOffset],a + ld [wListScrollOffset], a jp .loop .buttonAPressed scf @@ -249,72 +249,72 @@ Func_401c2: ; 401c2 (10:41c2) ld [H_AUTOBGTRANSFERENABLED], a ; draw the horizontal line separating the seen and owned amounts from the menu coord hl, 15, 6 - ld a,$7a ; horizontal line tile - ld [hli],a - ld [hli],a - ld [hli],a - ld [hli],a - ld [hli],a + ld a, $7a ; horizontal line tile + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a + ld [hli], a coord hl, 14, 0 - ld [hl],$71 ; vertical line tile + ld [hl], $71 ; vertical line tile coord hl, 14, 1 call DrawPokedexVerticalLine coord hl, 14, 9 call DrawPokedexVerticalLine - ld hl,wPokedexSeen - ld b,wPokedexSeenEnd - wPokedexSeen + ld hl, wPokedexSeen + ld b, wPokedexSeenEnd - wPokedexSeen call CountSetBits ld de, wNumSetBits coord hl, 16, 2 lb bc, 1, 3 call PrintNumber ; print number of seen pokemon - ld hl,wPokedexOwned - ld b,wPokedexOwnedEnd - wPokedexOwned + ld hl, wPokedexOwned + ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits ld de, wNumSetBits coord hl, 16, 5 lb bc, 1, 3 call PrintNumber ; print number of owned pokemon coord hl, 16, 1 - ld de,PokedexSeenText + ld de, PokedexSeenText call PlaceString coord hl, 16, 4 - ld de,PokedexOwnText + ld de, PokedexOwnText call PlaceString coord hl, 1, 1 - ld de,PokedexContentsText + ld de, PokedexContentsText call PlaceString coord hl, 16, 8 - ld de,PokedexMenuItemsText + ld de, PokedexMenuItemsText call PlaceString ; find the highest pokedex number among the pokemon the player has seen - ld hl,wPokedexSeenEnd - 1 - ld b,(wPokedexSeenEnd - wPokedexSeen) * 8 + 1 + ld hl, wPokedexSeenEnd - 1 + ld b, (wPokedexSeenEnd - wPokedexSeen) * 8 + 1 .maxSeenPokemonLoop - ld a,[hld] - ld c,8 + ld a, [hld] + ld c, 8 .maxSeenPokemonInnerLoop dec b sla a - jr c,.storeMaxSeenPokemon + jr c, .storeMaxSeenPokemon dec c - jr nz,.maxSeenPokemonInnerLoop + jr nz, .maxSeenPokemonInnerLoop jr .maxSeenPokemonLoop .storeMaxSeenPokemon - ld a,b - ld [wDexMaxSeenMon],a + ld a, b + ld [wDexMaxSeenMon], a ret DrawPokedexVerticalLine: ; 40243 (10:4243) - ld c,9 ; height of line - ld de,SCREEN_WIDTH ; width of screen - ld a,$71 ; vertical line tile + ld c, 9 ; height of line + ld de, SCREEN_WIDTH ; width of screen + ld a, $71 ; vertical line tile .loop - ld [hl],a - add hl,de - xor a,1 ; toggle between vertical line tile and box tile + ld [hl], a + add hl, de + xor a, 1 ; toggle between vertical line tile and box tile dec c - jr nz,.loop + jr nz, .loop ret PokedexSeenText: ; 40252 (10:4252) @@ -335,51 +335,51 @@ PokedexMenuItemsText: ; 40264 (10:4264) Func_4027c: ; 4027c (10:427c) xor a - ld [H_AUTOBGTRANSFERENABLED],a + ld [H_AUTOBGTRANSFERENABLED], a coord hl, 4, 2 lb bc, 14, 10 call ClearScreenArea coord hl, 1, 3 - ld a,[wListScrollOffset] - ld [wd11e],a - ld d,7 - ld a,[wDexMaxSeenMon] - cp a,7 - jr nc,.printPokemonLoop - ld d,a + ld a, [wListScrollOffset] + ld [wd11e], a + ld d, 7 + ld a, [wDexMaxSeenMon] + cp a, 7 + jr nc, .printPokemonLoop + ld d, a dec a - ld [wMaxMenuItem],a + ld [wMaxMenuItem], a ; loop to print pokemon pokedex numbers and names ; if the player has owned the pokemon, it puts a pokeball beside the name .printPokemonLoop - ld a,[wd11e] + ld a, [wd11e] inc a - ld [wd11e],a + ld [wd11e], a push af push de push hl - ld de,-SCREEN_WIDTH - add hl,de - ld de,wd11e + ld de, -SCREEN_WIDTH + add hl, de + ld de, wd11e lb bc, LEADING_ZEROES | 1, 3 call PrintNumber ; print the pokedex number - ld de,SCREEN_WIDTH - add hl,de + ld de, SCREEN_WIDTH + add hl, de dec hl push hl - ld hl,wPokedexOwned + ld hl, wPokedexOwned call IsPokemonBitSet pop hl - ld a," " - jr z,.writeTile - ld a,$72 ; pokeball tile + ld a, " " + jr z, .writeTile + ld a, $72 ; pokeball tile .writeTile - ld [hl],a ; put a pokeball next to pokemon that the player has owned + ld [hl], a ; put a pokeball next to pokemon that the player has owned push hl - ld hl,wPokedexSeen + ld hl, wPokedexSeen call IsPokemonBitSet - jr nz,.getPokemonName ; if the player has seen the pokemon - ld de,.dashedLine ; print a dashed line in place of the name if the player hasn't seen the pokemon + jr nz, .getPokemonName ; if the player has seen the pokemon + ld de, .dashedLine ; print a dashed line in place of the name if the player hasn't seen the pokemon jr .skipGettingName .dashedLine ; for unseen pokemon in the list db "----------@" @@ -391,15 +391,15 @@ Func_4027c: ; 4027c (10:427c) inc hl call PlaceString pop hl - ld bc,2 * 20 - add hl,bc + ld bc, 2 * 20 + add hl, bc pop de pop af - ld [wd11e],a + ld [wd11e], a dec d - jr nz,.printPokemonLoop - ld a,01 - ld [H_AUTOBGTRANSFERENABLED],a + jr nz, .printPokemonLoop + ld a, 01 + ld [H_AUTOBGTRANSFERENABLED], a call Delay3 ret @@ -408,12 +408,12 @@ Func_4027c: ; 4027c (10:427c) ; [wd11e] = pokedex number ; hl = address of bit field IsPokemonBitSet: ; 40303 (10:4303) - ld a,[wd11e] + ld a, [wd11e] dec a - ld c,a - ld b,FLAG_TEST + ld c, a + ld b, FLAG_TEST predef FlagActionPredef - ld a,c + ld a, c and a ret @@ -426,44 +426,44 @@ ShowPokedexData: ; 40312 (10:4312) ; function to display pokedex data from inside the pokedex ShowPokedexDataInternal: ; 40323 (10:4323) - ld hl,wd72c - set 1,[hl] - ld a,$33 ; 3/7 volume - ld [rNR50],a + ld hl, wd72c + set 1, [hl] + ld a, $33 ; 3/7 volume + ld [rNR50], a ld a, [hTilesetType] push af xor a ld [hTilesetType], a call GBPalWhiteOut ; zero all palettes - ld a,[wd11e] ; pokemon ID - ld [wcf91],a + ld a, [wd11e] ; pokemon ID + ld [wcf91], a push af ld b, SET_PAL_POKEDEX call RunPaletteCommand pop af - ld [wd11e],a + ld [wd11e], a call Func_4039c call c, Func_404ae .waitForButtonPress call JoypadLowSensitivity - ld a,[hJoy5] - and a,A_BUTTON | B_BUTTON - jr z,.waitForButtonPress + ld a, [hJoy5] + and a, A_BUTTON | B_BUTTON + jr z, .waitForButtonPress pop af - ld [hTilesetType],a + ld [hTilesetType], a call GBPalWhiteOut call ClearScreen call RunDefaultPaletteCommand call LoadTextBoxTilePatterns call GBPalNormal - ld hl,wd72c - res 1,[hl] - ld a,$77 ; max volume - ld [rNR50],a + ld hl, wd72c + res 1, [hl] + ld a, $77 ; max volume + ld [rNR50], a ret HeightWeightText: ; 40370 (10:4370) - db "HT ?",$60,"??",$61 + db "HT ?", $60, "??", $61 next "WT ???lb@" ; XXX does anything point to this? @@ -472,77 +472,77 @@ PokeText: ; 40385 (10:4385) ; horizontal line that divides the pokedex text description from the rest of the data PokedexDataDividerLine: ; 40387 (10:4387) - db $68,$69,$6B,$69,$6B - db $69,$6B,$69,$6B,$6B - db $6B,$6B,$69,$6B,$69 - db $6B,$69,$6B,$69,$6A + db $68, $69, $6B, $69, $6B + db $69, $6B, $69, $6B, $6B + db $6B, $6B, $69, $6B, $69 + db $6B, $69, $6B, $69, $6A db "@" Func_4039c: ; 4039c (10:439c) call ClearScreen coord hl, 0, 0 - ld de,1 + ld de, 1 lb bc, $64, SCREEN_WIDTH call DrawTileLine ; draw top border coord hl, 0, 17 ld b, $6f call DrawTileLine ; draw bottom border coord hl, 0, 1 - ld de,20 + ld de, 20 lb bc, $66, $10 call DrawTileLine ; draw left border coord hl, 19, 1 - ld b,$67 + ld b, $67 call DrawTileLine ; draw right border - ld a,$63 ; upper left corner tile + ld a, $63 ; upper left corner tile Coorda 0, 0 - ld a,$65 ; upper right corner tile + ld a, $65 ; upper right corner tile Coorda 19, 0 - ld a,$6c ; lower left corner tile + ld a, $6c ; lower left corner tile Coorda 0, 17 - ld a,$6e ; lower right corner tile + ld a, $6e ; lower right corner tile Coorda 19, 17 coord hl, 0, 9 - ld de,PokedexDataDividerLine + ld de, PokedexDataDividerLine call PlaceString ; draw horizontal divider line coord hl, 9, 6 - ld de,HeightWeightText + ld de, HeightWeightText call PlaceString call GetMonName coord hl, 9, 2 call PlaceString - ld hl,PokedexEntryPointers - ld a,[wd11e] + ld hl, PokedexEntryPointers + ld a, [wd11e] dec a - ld e,a - ld d,0 - add hl,de - add hl,de - ld a,[hli] - ld e,a - ld d,[hl] ; de = address of pokedex entry + ld e, a + ld d, 0 + add hl, de + add hl, de + ld a, [hli] + ld e, a + ld d, [hl] ; de = address of pokedex entry coord hl, 9, 4 call PlaceString ; print species name - ld h,b - ld l,c + ld h, b + ld l, c push de - ld a,[wd11e] + ld a, [wd11e] push af call IndexToPokedex coord hl, 2, 8 ld a, "№" - ld [hli],a - ld a,$f2 - ld [hli],a - ld de,wd11e + ld [hli], a + ld a, $f2 + ld [hli], a + ld de, wd11e lb bc, LEADING_ZEROES | 1, 3 call PrintNumber ; print pokedex number - ld hl,wPokedexOwned + ld hl, wPokedexOwned call IsPokemonBitSet pop af - ld [wd11e],a - ld a,[wcf91] - ld [wd0b5],a + ld [wd11e], a + ld a, [wcf91] + ld [wd0b5], a pop de push af push bc @@ -553,65 +553,65 @@ Func_4039c: ; 4039c (10:439c) call GetMonHeader ; load pokemon picture location coord hl, 1, 1 call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture - ld a,[wcf91] + ld a, [wcf91] call PlayCry ; play pokemon cry pop hl pop de pop bc pop af - ld a,c + ld a, c and a ret z ; if the pokemon has not been owned, don't print the height, weight, or description inc de ; de = address of feet (height) - ld a,[de] ; reads feet, but a is overwritten without being used + ld a, [de] ; reads feet, but a is overwritten without being used coord hl, 12, 6 lb bc, 1, 2 call PrintNumber ; print feet (height) - ld a,$60 ; feet symbol tile (one tick) - ld [hl],a + ld a, $60 ; feet symbol tile (one tick) + ld [hl], a inc de inc de ; de = address of inches (height) coord hl, 15, 6 lb bc, LEADING_ZEROES | 1, 2 call PrintNumber ; print inches (height) - ld a,$61 ; inches symbol tile (two ticks) - ld [hl],a + ld a, $61 ; inches symbol tile (two ticks) + ld [hl], a ; now print the weight (note that weight is stored in tenths of pounds internally) inc de inc de inc de ; de = address of upper byte of weight push de ; put weight in big-endian order at hDexWeight - ld hl,hDexWeight - ld a,[hl] ; save existing value of [hDexWeight] + ld hl, hDexWeight + ld a, [hl] ; save existing value of [hDexWeight] push af - ld a,[de] ; a = upper byte of weight - ld [hli],a ; store upper byte of weight in [hDexWeight] - ld a,[hl] ; save existing value of [hDexWeight + 1] + ld a, [de] ; a = upper byte of weight + ld [hli], a ; store upper byte of weight in [hDexWeight] + ld a, [hl] ; save existing value of [hDexWeight + 1] push af dec de - ld a,[de] ; a = lower byte of weight - ld [hl],a ; store lower byte of weight in [hDexWeight + 1] - ld de,hDexWeight + ld a, [de] ; a = lower byte of weight + ld [hl], a ; store lower byte of weight in [hDexWeight + 1] + ld de, hDexWeight coord hl, 11, 8 lb bc, 2, 5 ; 2 bytes, 5 digits call PrintNumber ; print weight coord hl, 14, 8 - ld a,[hDexWeight + 1] - sub a,10 - ld a,[hDexWeight] - sbc a,0 - jr nc,.next - ld [hl],"0" ; if the weight is less than 10, put a 0 before the decimal point + ld a, [hDexWeight + 1] + sub a, 10 + ld a, [hDexWeight] + sbc a, 0 + jr nc, .next + ld [hl], "0" ; if the weight is less than 10, put a 0 before the decimal point .next inc hl - ld a,[hli] - ld [hld],a ; make space for the decimal point by moving the last digit forward one tile - ld [hl],$f2 ; decimal point tile + ld a, [hli] + ld [hld], a ; make space for the decimal point by moving the last digit forward one tile + ld [hl], $f2 ; decimal point tile pop af - ld [hDexWeight + 1],a ; restore original value of [hDexWeight + 1] + ld [hDexWeight + 1], a ; restore original value of [hDexWeight + 1] pop af - ld [hDexWeight],a ; restore original value of [hDexWeight] + ld [hDexWeight], a ; restore original value of [hDexWeight] pop hl inc hl ; hl = address of pokedex description text scf @@ -620,11 +620,11 @@ Func_4039c: ; 4039c (10:439c) Func_404ae: ; 404ae (10:44ae) coord bc, 1, 11 Func_404b1: ; 404b1 (10:44b1) - ld a,2 - ld [$fff9],a + ld a, 2 + ld [$fff9], a call TextCommandProcessor ; print pokedex description text xor a - ld [$fff9],a + ld [$fff9], a ret Func_404bc: ; 404bc (10:44bc) @@ -667,10 +667,10 @@ DrawTileLine: ; 40501 (10:4501) push bc push de .loop - ld [hl],b - add hl,de + ld [hl], b + add hl, de dec c - jr nz,.loop + jr nz, .loop pop de pop bc ret @@ -681,19 +681,19 @@ PokedexToIndex: ; 41086 (10:5086) ; converts the Pokédex number at wd11e to an index push bc push hl - ld a,[wd11e] - ld b,a - ld c,0 - ld hl,PokedexOrder + ld a, [wd11e] + ld b, a + ld c, 0 + ld hl, PokedexOrder .loop ; go through the list until we find an entry with a matching dex number inc c - ld a,[hli] + ld a, [hli] cp b - jr nz,.loop + jr nz, .loop - ld a,c - ld [wd11e],a + ld a, c + ld [wd11e], a pop hl pop bc ret @@ -702,14 +702,14 @@ IndexToPokedex: ; 4109d (10:509d) ; converts the indexédex number at wd11e to a Pokédex number push bc push hl - ld a,[wd11e] + ld a, [wd11e] dec a - ld hl,PokedexOrder - ld b,0 - ld c,a - add hl,bc - ld a,[hl] - ld [wd11e],a + ld hl, PokedexOrder + ld b, 0 + ld c, a + add hl, bc + ld a, [hl] + ld [wd11e], a pop hl pop bc ret @@ -754,7 +754,6 @@ INCLUDE "data/mapObjects/lavendertown.asm" LavenderTownBlocks: INCBIN "maps/lavendertown.blk" ViridianPokecenterBlocks: -CeruleanPokecenterBlocks: VermilionPokecenterBlocks: SaffronPokecenterBlocks: LavenderPokecenterBlocks: @@ -1128,7 +1127,14 @@ INCBIN "maps/viridianforestentrance.blk" INCLUDE "data/mapHeaders/redshouse2f.asm" INCLUDE "scripts/redshouse2f.asm" INCLUDE "data/mapObjects/redshouse2f.asm" - dr $5c0d4,$5c0e3 + +Func_5c0d4: + ld a, %01001011 + ld [wPokedexOwned], a + predef ShowPokedexData + xor a + ld [wPokedexOwned], a + ret INCLUDE "data/mapHeaders/museum1f.asm" INCLUDE "scripts/museum1f.asm" @@ -1148,7 +1154,13 @@ INCLUDE "data/mapHeaders/pewterpokecenter.asm" INCLUDE "scripts/pewterpokecenter.asm" INCLUDE "data/mapObjects/pewterpokecenter.asm" - dr $5c4f5,$5d485 +INCLUDE "data/mapHeaders/ceruleanpokecenter.asm" +INCLUDE "scripts/ceruleanpokecenter.asm" +INCLUDE "data/mapObjects/ceruleanpokecenter.asm" +CeruleanPokecenterBlocks: +INCBIN "maps/ceruleanpokecenter.blk" + + dr $5c577,$5d485 INCLUDE "data/mapHeaders/viridianforestexit.asm" INCLUDE "scripts/viridianforestexit.asm" diff --git a/scripts/ceruleanpokecenter.asm b/scripts/ceruleanpokecenter.asm index 5d888317..f4eb68ae 100755 --- a/scripts/ceruleanpokecenter.asm +++ b/scripts/ceruleanpokecenter.asm @@ -7,6 +7,7 @@ CeruleanPokecenterTextPointers: ; 5c64b (17:464b) dw CeruleanPokecenterText2 dw CeruleanPokecenterText3 dw CeruleanPokecenterText4 + dw CeruleanPokecenterText5 CeruleanPokecenterText4: ; 5c653 (17:4653) db $f6 @@ -21,3 +22,8 @@ CeruleanPokecenterText2: ; 5c655 (17:4655) CeruleanPokecenterText3: ; 5c65a (17:465a) TX_FAR _CeruleanPokecenterText3 db "@" + +CeruleanPokecenterText5: + TX_ASM + callab Func_f0f12 + jp TextScriptEnd @@ -2290,7 +2290,7 @@ wPartyDataEnd:: wMainDataStart:: -wPokedexOwned:: ; d2f7 +wPokedexOwned:: ; d2f6 flag_array NUM_POKEMON wPokedexOwnedEnd:: |