Skip to content

Commit

Permalink
Use more lb
Browse files Browse the repository at this point in the history
and other clean up
  • Loading branch information
dannye committed Aug 5, 2015
1 parent 891627d commit f8a9c37
Show file tree
Hide file tree
Showing 106 changed files with 346 additions and 326 deletions.
4 changes: 2 additions & 2 deletions engine/HoF_room_pc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ FillFourRowsWithBlack: ; 7417b (1d:417b)
FillMiddleOfScreenWithWhite: ; 74183 (1d:4183)
coord hl, 0, 4
ld bc, SCREEN_WIDTH * 10
ld a, $7f ; blank white tile
ld a, " "
jp FillMemory

Credits: ; 7418e (1d:418e)
Expand Down Expand Up @@ -246,7 +246,7 @@ Credits: ; 7418e (1d:418e)
pop de
ld de, TheEndGfx
ld hl, vChars2 + $600
ld bc, (BANK(TheEndGfx) << 8) + $0a
lb bc, BANK(TheEndGfx), $0a
call CopyVideoData
coord hl, 4, 8
ld de, TheEndTextString
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/battle_transitions.asm
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ DungeonMaps2: ; 70a44 (1c:4a44)
LoadBattleTransitionTile: ; 70a4d (1c:4a4d)
ld hl, vChars1 + $7f0
ld de, BattleTransitionTile
ld bc, (BANK(BattleTransitionTile) << 8) + $01
lb bc, BANK(BattleTransitionTile), $01
jp CopyVideoData

BattleTransitionTile: ; 70a59 (1c:4a59)
Expand Down
58 changes: 29 additions & 29 deletions engine/battle/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c)
ld [wTextBoxID], a
call DisplayTextBoxID
coord hl, 1, 5
ld bc, $307
lb bc, 3, 7
call ClearScreenArea
call DisableLCD
call LoadFontTilePatterns
call LoadHudAndHpBarAndStatusTilePatterns
ld hl, vBGMap0
ld bc, $400
.clearBackgroundLoop
ld a, $7f
ld a, " "
ld [hli], a
dec bc
ld a, b
Expand Down Expand Up @@ -717,8 +717,8 @@ HandlePoisonBurnLeechSeed_IncreaseEnemyHP: ; 3c4a3 (f:44a3)
ld [wHPBarMaxHP+1], a
ld a, [hl]
ld [wHPBarMaxHP], a
ld de, $fff2
add hl, de ; skip back fomr max hp to current hp
ld de, wBattleMonHP - wBattleMonMaxHP
add hl, de ; skip back from max hp to current hp
ld a, [hl]
ld [wHPBarOldHP], a ; add bc to current HP
add c
Expand Down Expand Up @@ -852,7 +852,7 @@ FaintEnemyPokemon: ; 0x3c567
coord de, 12, 6
call SlideDownFaintedMonPic
coord hl, 0, 0
ld bc, $40b
lb bc, 4, 11
call ClearScreenArea
ld a, [W_ISINBATTLE]
dec a
Expand Down Expand Up @@ -1100,7 +1100,7 @@ RemoveFaintedPlayerMon: ; 3c741 (f:4741)
ld [wBattleMonStatus], a
call ReadPlayerMonCurHPAndStatus
coord hl, 9, 7
ld bc, $50b
lb bc, 5, 11
call ClearScreenArea
coord hl, 1, 10
coord de, 1, 11
Expand Down Expand Up @@ -1132,7 +1132,7 @@ DoUseNextMonDialogue: ; 3c79b (f:479b)
call PrintText
.displayYesNoBox
coord hl, 13, 9
ld bc, $a0e
lb bc, 10, 14
ld a, TWO_OPTION_MENU
ld [wTextBoxID], a
call DisplayTextBoxID
Expand Down Expand Up @@ -1209,7 +1209,7 @@ HandlePlayerBlackOut: ; 3c837 (f:4837)
cp $c8 + SONY1
jr nz, .notSony1Battle
coord hl, 0, 0 ; sony 1 battle
ld bc, $815
lb bc, 8, 21
call ClearScreenArea
call ScrollTrainerPicAfterBattle
ld c, 40
Expand Down Expand Up @@ -1449,7 +1449,7 @@ EnemySendOutFirstMon: ; 3c92a (f:492a)
ld hl, TrainerAboutToUseText
call PrintText
coord hl, 0, 7
ld bc,$0801
lb bc, 8, 1
ld a,TWO_OPTION_MENU
ld [wTextBoxID],a
call DisplayTextBoxID
Expand Down Expand Up @@ -1484,7 +1484,7 @@ EnemySendOutFirstMon: ; 3c92a (f:492a)
.next4
call ClearSprites
coord hl, 0, 0
ld bc,$040B
lb bc, 4, 11
call ClearScreenArea
ld b,1
call GoPAL_SET
Expand Down Expand Up @@ -1886,7 +1886,7 @@ DrawPlayerHUDAndHPBar: ; 3cd60 (f:4d60)
xor a
ld [H_AUTOBGTRANSFERENABLED], a
coord hl, 9, 7
ld bc, $50b
lb bc, 5, 11
call ClearScreenArea
callab PlacePlayerHUDTiles
coord hl, 18, 9
Expand Down Expand Up @@ -1947,7 +1947,7 @@ DrawEnemyHUDAndHPBar: ; 3cdec (f:4dec)
xor a
ld [H_AUTOBGTRANSFERENABLED], a
coord hl, 0, 0
ld bc, $40c
lb bc, 4, 12
call ClearScreenArea
callab PlaceEnemyHUDTiles
ld de, wEnemyMonNick
Expand Down Expand Up @@ -2055,11 +2055,11 @@ CenterMonName: ; 3ce9c (f:4e9c)
.loop
inc de
ld a, [de]
cp $50
cp "@"
jr z, .done
inc de
ld a, [de]
cp $50
cp "@"
jr z, .done
dec hl
dec b
Expand Down Expand Up @@ -2091,22 +2091,22 @@ DisplayBattleMenu: ; 3ceb3 (f:4eb3)
; the following happens for the old man tutorial
ld hl, wPlayerName
ld de, W_GRASSRATE
ld bc, $b
ld bc, 11
call CopyData ; temporarily save the player name in unused space,
; which is supposed to get overwritten when entering a
; map with wild Pokémon. Due to an oversight, the data
; may not get overwritten (cinnabar) and the infamous
; Missingno. glitch can show up.
ld hl, .oldManName
ld de, wPlayerName
ld bc, $b
ld bc, 11
call CopyData
; the following simulates the keystrokes by drawing menus on screen
coord hl, 9, 14
ld [hl], "▶"
ld c, 80
call DelayFrames
ld [hl], $7f
ld [hl], " "
coord hl, 9, 16
ld [hl], "▶"
ld c, 50
Expand Down Expand Up @@ -2395,7 +2395,7 @@ PartyMenuOrRockOrRun:
.partyMonDeselected
coord hl, 11, 11
ld bc, $81
ld a, $7f
ld a, " "
call FillMemory
xor a ; NORMAL_PARTY_MENU
ld [wPartyMenuTypeOrMessageID], a
Expand Down Expand Up @@ -2585,7 +2585,7 @@ MoveSelectionMenu: ; 3d219 (f:5219)
.relearnmenu
ld a, [wWhichPokemon]
ld hl, wPartyMon1Moves
ld bc, $2c
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
call .loadmoves
coord hl, 4, 7
Expand Down Expand Up @@ -2662,7 +2662,7 @@ SelectMenuItem: ; 3d2fe (f:52fe)
jr z, .select
coord hl, 5, 13
dec a
ld bc, $14
ld bc, SCREEN_WIDTH
call AddNTimes
ld [hl], $ec
.select
Expand Down Expand Up @@ -2862,7 +2862,7 @@ SwapMovesInMenu: ; 3d435 (f:5435)
push hl
call .swapBytes ; swap moves
pop hl
ld bc, $15
ld bc, wPartyMon1PP - wPartyMon1Moves
add hl, bc
call .swapBytes ; swap move PP
xor a
Expand Down Expand Up @@ -6318,7 +6318,7 @@ LoadEnemyMonData: ; 3eb01 (f:6b01)
call GetMonName
ld hl, wcd6d
ld de, wEnemyMonNick
ld bc, $b
ld bc, 11
call CopyData
ld a, [wEnemyMonSpecies2]
ld [wd11e], a
Expand Down Expand Up @@ -6718,11 +6718,11 @@ LoadHudTilePatterns: ; 3ee5b (f:6e5b)
.lcdEnabled
ld de, BattleHudTiles1
ld hl, vChars2 + $6d0
ld bc, (BANK(BattleHudTiles1) << 8) + $03
lb bc, BANK(BattleHudTiles1), $03
call CopyVideoDataDouble
ld de, BattleHudTiles2
ld hl, vChars2 + $730
ld bc, (BANK(BattleHudTiles2) << 8) + $06
lb bc, BANK(BattleHudTiles2), $06
jp CopyVideoDataDouble

PrintEmptyString: ; 3ee94 (f:6e94)
Expand Down Expand Up @@ -6942,10 +6942,10 @@ InitBattle_Common: ; 3efeb (f:6feb)
ld [H_AUTOBGTRANSFERDEST + 1], a
call LoadScreenTilesFromBuffer1
coord hl, 9, 7
ld bc, $50a
lb bc, 5, 10
call ClearScreenArea
coord hl, 1, 0
ld bc, $40a
lb bc, 4, 10
call ClearScreenArea
call ClearSprites
ld a, [W_ISINBATTLE]
Expand Down Expand Up @@ -7089,8 +7089,8 @@ LoadMonBackPic: ; 3f103 (f:7103)
ld a, [wBattleMonSpecies2]
ld [wcf91], a
coord hl, 1, 5
ld b, $7
ld c, $8
ld b, 7
ld c, 8
call ClearScreenArea
ld hl, W_MONHBACKSPRITE - W_MONHEADER
call UncompressMonSprite
Expand Down Expand Up @@ -7928,7 +7928,7 @@ FellText: ; 3f683 (f:7683)

PrintStatText: ; 3f688 (f:7688)
ld hl, StatsTextStrings
ld c, $50
ld c, "@"
.asm_3f68d
dec b
jr z, .asm_3f696
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/draw_hud_pokeball_gfx.asm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DrawEnemyPokeballs: ; 3a857 (e:6857)
LoadPartyPokeballGfx: ; 3a85d (e:685d)
ld de, PokeballTileGraphics
ld hl, vSprites + $310
ld bc, (BANK(PokeballTileGraphics) << 8) + $04
lb bc, BANK(PokeballTileGraphics), $04
jp CopyVideoData

SetupOwnPartyPokeballs: ; 3a869 (e:6869)
Expand Down
4 changes: 2 additions & 2 deletions engine/battle/ghost_marowak_anim.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MarowakAnim: ; 708ca (1c:48ca)
call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same
; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap
coord hl, 12, 0
ld bc, $707
lb bc, 7, 7
call ClearScreenArea
call Delay3
xor a
Expand Down Expand Up @@ -59,7 +59,7 @@ CopyMonPicFromBGToSpriteVRAM: ; 7092a (1c:492a)
ld a, $70
ld [W_BASECOORDX], a
ld hl, wOAMBuffer
ld bc, $606
lb bc, 6, 6
ld d, $8
.oamLoop
push bc
Expand Down
2 changes: 1 addition & 1 deletion engine/battle/trainer_ai.asm
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ AISwitchIfEnoughMons: ; 3a72a (e:672a)
inc d
.Fainted
push bc
ld bc,$2C
ld bc, wEnemyMon2 - wEnemyMon1
add hl,bc
pop bc
dec c
Expand Down
6 changes: 3 additions & 3 deletions engine/cable_club.asm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ CableClub_DoBattleOrTradeAgain: ; 5345
ld a, SERIAL_PATCH_LIST_PART_TERMINATOR
ld [de], a ; end of part 1
inc de
ld bc, $100
lb bc, 1, 0
jr .patchPartyMonsLoop
.finishedPatchingPlayerData
ld a, SERIAL_PATCH_LIST_PART_TERMINATOR
Expand Down Expand Up @@ -400,7 +400,7 @@ TradeCenter_SelectMon:
ld a, 1
ld [wTopMenuItemX], a
coord hl, 1, 1
ld bc, $0601
lb bc, 6, 1
call ClearScreenArea
.playerMonMenu_HandleInput
ld hl, hFlags_0xFFF6
Expand Down Expand Up @@ -713,7 +713,7 @@ TradeCenter_Trade:
call TextCommandProcessor
call SaveScreenTilesToBuffer1
coord hl, 10, 7
ld bc, $080b
lb bc, 8, 11
ld a, TRADE_CANCEL_MENU
ld [wTwoOptionMenuID], a
ld a, TWO_OPTION_MENU
Expand Down
2 changes: 1 addition & 1 deletion engine/clear_save.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DoClearSaveDialogue: ; 1c98a (7:498a)
ld hl, ClearSaveDataText
call PrintText
coord hl, 14, 7
ld bc, $80f
lb bc, 8, 15
ld a, NO_YES_MENU
ld [wTwoOptionMenuID], a
ld a, TWO_OPTION_MENU
Expand Down
2 changes: 1 addition & 1 deletion engine/evolution.asm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ EvolveMon: ; 7bde9 (1e:7de9)
call DelayFrames
ld c, $1
call EvolutionSetWholeScreenPalette
ld bc, $110
lb bc, $1, $10
.animLoop
push bc
call Evolution_CheckForCancel
Expand Down
2 changes: 1 addition & 1 deletion engine/evos_moves.asm
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ RenameEvolvedMon: ; 3aef7 (e:6ef7)
cp $50
jr nz, .compareNamesLoop
ld a, [wWhichPokemon]
ld bc, $b
ld bc, 11
ld hl, wPartyMonNicks
call AddNTimes
push hl
Expand Down
8 changes: 4 additions & 4 deletions engine/gamefreak.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ LoadShootingStarGraphics: ; 70000 (1c:4000)
ld [rOBP1], a
ld de, AnimationTileset2 + $30 ; star tile (top left quadrant)
ld hl, vChars1 + $200
ld bc, (BANK(AnimationTileset2) << 8) + $01
lb bc, BANK(AnimationTileset2), $01
call CopyVideoData
ld de, AnimationTileset2 + $130 ; star tile (bottom left quadrant)
ld hl, vChars1 + $210
ld bc, (BANK(AnimationTileset2) << 8) + $01
lb bc, BANK(AnimationTileset2), $01
call CopyVideoData
ld de, FallingStar
ld hl, vChars1 + $220
ld bc, (BANK(FallingStar) << 8) + $01
lb bc, BANK(FallingStar), $01
call CopyVideoData
ld hl, GameFreakLogoOAMData
ld de, wOAMBuffer + $60
Expand All @@ -31,7 +31,7 @@ AnimateShootingStar: ; 70044 (1c:4044)

; Move the big star down and left across the screen.
ld hl, wOAMBuffer
ld bc, $a004
lb bc, $a0, $4
.bigStarLoop
push hl
push bc
Expand Down
4 changes: 2 additions & 2 deletions engine/hall_of_fame.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AnimateHallOfFame: ; 701a0 (1c:41a0)
call DisableLCD
ld hl,vBGMap0
ld bc, $800
ld a, $7f
ld a, " "
call FillMemory
call EnableLCD
ld hl, rLCDC
Expand Down Expand Up @@ -187,7 +187,7 @@ HoFLoadPlayerPics: ; 7033e (1c:433e)
ld a, BANK(RedPicFront)
call UncompressSpriteFromDE
ld hl, S_SPRITEBUFFER1
ld de, $a000
ld de, S_SPRITEBUFFER0
ld bc, $310
call CopyData
ld de, vFrontPic
Expand Down
Loading

0 comments on commit f8a9c37

Please sign in to comment.