From eeb058a23137bff0a7c046506cd448066500b608 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sat, 21 May 2016 22:45:53 -0400 Subject: Some work on disassembling npc movement scripts (aka informed copy/paste from red) --- main.asm | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'main.asm') diff --git a/main.asm b/main.asm index e9064d2b..2f08ff94 100755 --- a/main.asm +++ b/main.asm @@ -232,18 +232,8 @@ INCLUDE "engine/menu/pc.asm" SECTION "bank06",ROMX,BANK[$06] dr $18000,$1a4ea -PlayerStepOutFromDoor: ; 1a4ea (6:64ea) - dr $1a4ea,$1a527 -_EndNPCMovementScript: ; 1a527 (6:6527) - dr $1a527,$1a54c -ProfOakMovementScriptPointerTable: ; 1a54c (6:654c) - dr $1a54c,$1a622 -PewterMuseumGuyMovementScriptPointerTable: ; 1a622 (6:6622) - dr $1a622,$1a685 -PewterGymGuyMovementScriptPointerTable: ; 1a685 (6:6685) - dr $1a685,$1a785 -IsPlayerStandingOnDoorTile: ; 1a785 (6:6785) - dr $1a785,$1a7f4 + +INCLUDE "engine/overworld/npc_movement.asm" HandleLedges: ; 1a7f4 (6:67f4) dr $1a7f4,$1c000 -- cgit v1.3.1-sl0p From 084384fea927b64632ca0970624a1ee1f7f19ea0 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 10:48:27 -0400 Subject: Ledges --- engine/overworld/doors.asm | 55 ++++++++++++++++----------------------- engine/overworld/ledges.asm | 26 ++++++++++-------- engine/overworld/npc_movement.asm | 4 --- main.asm | 4 +-- 4 files changed, 40 insertions(+), 49 deletions(-) (limited to 'main.asm') diff --git a/engine/overworld/doors.asm b/engine/overworld/doors.asm index 6b0c0464..99e07174 100755 --- a/engine/overworld/doors.asm +++ b/engine/overworld/doors.asm @@ -25,33 +25,21 @@ IsPlayerStandingOnDoorTile: ; 1a609 (6:6609) and a ret -DoorTileIDPointers: ; 1a62c (6:662c) - db OVERWORLD - dw OverworldDoorTileIDs - db FOREST - dw ForestDoorTileIDs - db MART - dw MartDoorTileIDs - db HOUSE - dw HouseDoorTileIDs - db FOREST_GATE - dw TilesetMuseumDoorTileIDs - db MUSEUM - dw TilesetMuseumDoorTileIDs - db GATE - dw TilesetMuseumDoorTileIDs - db SHIP - dw ShipDoorTileIDs - db LOBBY - dw LobbyDoorTileIDs - db MANSION - dw MansionDoorTileIDs - db LAB - dw LabDoorTileIDs - db FACILITY - dw FacilityDoorTileIDs - db PLATEAU - dw PlateauDoorTileIDs +DoorTileIDPointers: ; 1a7a8 (6:67a8) + dbw OVERWORLD, OverworldDoorTileIDs + dbw FOREST, ForestDoorTileIDs + dbw MART, MartDoorTileIDs + dbw HOUSE, HouseDoorTileIDs + dbw FOREST_GATE, TilesetMuseumDoorTileIDs + dbw MUSEUM, TilesetMuseumDoorTileIDs + dbw GATE, TilesetMuseumDoorTileIDs + dbw SHIP, ShipDoorTileIDs + dbw LOBBY, LobbyDoorTileIDs + dbw MANSION, MansionDoorTileIDs + dbw LAB, LabDoorTileIDs + dbw FACILITY, FacilityDoorTileIDs + dbw PLATEAU, PlateauDoorTileIDs + dbw INTERIOR, InteriorDoorTileIDs db $ff OverworldDoorTileIDs: ; 1a654 (6:6654) @@ -72,17 +60,20 @@ TilesetMuseumDoorTileIDs: ; 1a65d (6:665d) ShipDoorTileIDs: ; 1a65f (6:665f) db $1e,$00 -LobbyDoorTileIDs: ; 1a661 (6:6661) +LobbyDoorTileIDs: ; 1a7e0 (6:67e0) db $1c,$38,$1a,$00 -MansionDoorTileIDs: ; 1a665 (6:6665) +MansionDoorTileIDs: ; 1a7e4 (6:67e4) db $1a,$1c,$53,$00 -LabDoorTileIDs: ; 1a669 (6:6669) +LabDoorTileIDs: ; 1a7e8 (6:67e8) db $34,$00 -FacilityDoorTileIDs: ; 1a66b (6:666b) +FacilityDoorTileIDs: ; 1a7ea (6:67ea) db $43,$58,$1b,$00 -PlateauDoorTileIDs: ; 1a66f (6:666f) +PlateauDoorTileIDs: ; 1a7ee (6:67ee) db $3b,$1b,$00 + +InteriorDoorTileIDs: ; 1a7f1 (6:67f1) + db $04,$15,$00 diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index b04f6332..a6ebd9be 100755 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -1,4 +1,4 @@ -HandleLedges: ; 1a672 (6:6672) +HandleLedges: ; 1a7f4 (6:67f4) ld a, [wd736] bit 6, a ; already jumping down ledge ret nz @@ -55,7 +55,7 @@ HandleLedges: ; 1a672 (6:6672) ret ; (player direction) (tile player standing on) (ledge tile) (input required) -LedgeTiles: ; 1a6cf (6:66cf) +LedgeTiles: ; 1a851 (6:6851) db SPRITE_FACING_DOWN, $2C,$37,D_DOWN db SPRITE_FACING_DOWN, $39,$36,D_DOWN db SPRITE_FACING_DOWN, $39,$37,D_DOWN @@ -66,21 +66,25 @@ LedgeTiles: ; 1a6cf (6:66cf) db SPRITE_FACING_RIGHT,$39,$0D,D_RIGHT db $FF -LoadHoppingShadowOAM: ; 1a6f0 (6:66f0) +LoadHoppingShadowOAM: ; 1a872 (6:6872) ld hl, vChars1 + $7f0 ld de, LedgeHoppingShadow lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8 call CopyVideoDataDouble - ld a, $9 - lb bc, $54, $48 ; b, c = y, x coordinates of shadow - ld de, LedgeHoppingShadowOAM - call WriteOAMBlock + ld hl, LedgeHoppingShadowOAM + ld de, wOAMBuffer + 36 * 4 + ld bc, LedgeHoppingShadowOAMEnd - LedgeHoppingShadowOAM + call CopyData + ld a, $a0 + ld [wOAMBuffer + 38 * 4], a + ld [wOAMBuffer + 39 * 4], a ret -LedgeHoppingShadow: ; 1a708 (6:6708) +LedgeHoppingShadow: ; 1a893 (6:6893) INCBIN "gfx/ledge_hopping_shadow.1bpp" LedgeHoppingShadowEnd: -LedgeHoppingShadowOAM: ; 1a710 (6:6710) - db $FF,$10,$FF,$20 - db $FF,$40,$FF,$60 +LedgeHoppingShadowOAM: ; 1a89b (6:689b) + db $58,$48,$FF,$00 + db $58,$50,$FF,$20 +LedgeHoppingShadowOAMEnd: ; 1a8a3 (6:68a3) diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm index f474a14c..58eb6a47 100755 --- a/engine/overworld/npc_movement.asm +++ b/engine/overworld/npc_movement.asm @@ -268,7 +268,3 @@ RLEList_PewterGymGuy: ; 1a6cd8(6:66d8) db $FF INCLUDE "engine/overworld/pewter_guys.asm" -; PewterGuys: - ; dr $1a66e5,$1a785 -IsPlayerStandingOnDoorTile: ; 1a785 (6:6785) - dr $1a785,$1a7f4 diff --git a/main.asm b/main.asm index 2f08ff94..b8d32069 100755 --- a/main.asm +++ b/main.asm @@ -234,8 +234,8 @@ SECTION "bank06",ROMX,BANK[$06] dr $18000,$1a4ea INCLUDE "engine/overworld/npc_movement.asm" -HandleLedges: ; 1a7f4 (6:67f4) - dr $1a7f4,$1c000 +INCLUDE "engine/overworld/doors.asm" +INCLUDE "engine/overworld/ledges.asm" SECTION "bank07",ROMX,BANK[$07] -- cgit v1.3.1-sl0p From b70d187627decfb897aec19fb1a31fbaee8414e6 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 11:30:34 -0400 Subject: Elevator floor menu, clear save --- engine/clear_save.asm | 8 ++++++-- engine/predefs7.asm | 10 ++++++++-- main.asm | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 59 insertions(+), 8 deletions(-) (limited to 'main.asm') diff --git a/engine/clear_save.asm b/engine/clear_save.asm index adbef1a4..37d098e6 100755 --- a/engine/clear_save.asm +++ b/engine/clear_save.asm @@ -1,10 +1,12 @@ -DoClearSaveDialogue: ; 1c98a (7:498a) +DoClearSaveDialogue: ; DoClearSaveDialogue: ; 1c21e (7:421e) call ClearScreen call RunDefaultPaletteCommand call LoadFontTilePatterns call LoadTextBoxTilePatterns ld hl, ClearSaveDataText call PrintText + ld a, B_BUTTON + ld [wJoyIgnore], a coord hl, 14, 7 lb bc, 8, 15 ld a, NO_YES_MENU @@ -12,12 +14,14 @@ DoClearSaveDialogue: ; 1c98a (7:498a) ld a, TWO_OPTION_MENU ld [wTextBoxID], a call DisplayTextBoxID + ld a, 0 + ld [wJoyIgnore], a ld a, [wCurrentMenuItem] and a jp z, Init callba ClearSAV jp Init -ClearSaveDataText: ; 1c9c1 (7:49c1) +ClearSaveDataText: ; 1c25f (7:425f) TX_FAR _ClearSaveDataText db "@" diff --git a/engine/predefs7.asm b/engine/predefs7.asm index a2c08171..9138897f 100755 --- a/engine/predefs7.asm +++ b/engine/predefs7.asm @@ -1,6 +1,12 @@ -DisplayElevatorFloorMenu: ; 1c9c6 (7:49c6) +DisplayElevatorFloorMenu: ; 1c264 (7:4264) + ld hl, wd730 + ld a, [hl] + push af + set 6, [hl] ld hl, WhichFloorText call PrintText + pop af + ld [wd730], a ld hl, wItemList ld a, l ld [wListPointer], a @@ -43,6 +49,6 @@ DisplayElevatorFloorMenu: ; 1c9c6 (7:49c6) ld [hli], a ; destination map ID ret -WhichFloorText: ; 1ca14 (7:4a14) +WhichFloorText: ; 1c2bd (7:42bd) TX_FAR _WhichFloorText db "@" diff --git a/main.asm b/main.asm index b8d32069..972d5d94 100755 --- a/main.asm +++ b/main.asm @@ -231,7 +231,45 @@ INCLUDE "engine/battle/moveEffects/substitute_effect.asm" INCLUDE "engine/menu/pc.asm" SECTION "bank06",ROMX,BANK[$06] - dr $18000,$1a4ea + + dr $18000,$18dee ; headers, objects, blocks +; INCLUDE "data/mapHeaders/celadoncity.asm" +; INCLUDE "data/mapObjects/celadoncity.asm" +; CeladonCityBlocks: INCBIN "maps/celadoncity.blk" + +; INCLUDE "data/mapHeaders/pallettown.asm" +; INCLUDE "data/mapObjects/pallettown.asm" +; PalletTownBlocks: INCBIN "maps/pallettown.blk" + +; INCLUDE "data/mapHeaders/viridiancity.asm" +; INCLUDE "data/mapObjects/viridiancity.asm" +; ViridianCityBlocks: INCBIN "maps/viridiancity.blk" + +; INCLUDE "data/mapHeaders/pewtercity.asm" +; INCLUDE "data/mapObjects/pewtercity.asm" +; PewterCityBlocks: INCBIN "maps/pewtercity.blk" + +; INCLUDE "data/mapHeaders/ceruleancity.asm" +; INCLUDE "data/mapObjects/ceruleancity.asm" +; CeruleanCityBlocks: INCBIN "maps/ceruleancity.blk" + +; INCLUDE "data/mapHeaders/vermilioncity.asm" +; INCLUDE "data/mapObjects/vermilioncity.asm" +; VermilionCityBlocks: INCBIN "maps/vermilioncity.blk" + +; INCLUDE "data/mapHeaders/fuchsiacity.asm" +; INCLUDE "data/mapObjects/fuchsiacity.asm" +; FuchsiaCityBlocks: INCBIN "maps/fuchsiacity.blk" + + dr $18dee,$1a4ea ; map scripts + +; INCLUDE "scripts/pallettown.asm" +; INCLUDE "scripts/viridiancity.asm" +; INCLUDE "scripts/pewtercity.asm" +; INCLUDE "scripts/ceruleancity.asm" +; INCLUDE "scripts/vermilioncity.asm" +; INCLUDE "scripts/celadoncity.asm" +; INCLUDE "scripts/fuchsiacity.asm" INCLUDE "engine/overworld/npc_movement.asm" INCLUDE "engine/overworld/doors.asm" @@ -239,9 +277,12 @@ INCLUDE "engine/overworld/ledges.asm" SECTION "bank07",ROMX,BANK[$07] - dr $1c000,$1c21e -DoClearSaveDialogue: ; 1c21e (7:421e) - dr $1c21e,$1e2ae + dr $1c000,$1c21e ; headers, objects, blocks + +INCLUDE "engine/clear_save.asm" +INCLUDE "engine/predefs7.asm" + + dr $1c2c2,$1e2ae ; map scripts OpenOaksPC: ; 1e2ae (7:62ae) dr $1e2ae,$1e321 SafariZoneCheck: ; 1e321 (7:6e21) -- cgit v1.3.1-sl0p From caf6936cf9657e9f247e2afeb0c0b6e46eb0fee5 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 11:38:05 -0400 Subject: Trim trailing zeros from `dr` blocks (part 1) --- main.asm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'main.asm') diff --git a/main.asm b/main.asm index 972d5d94..f3535bcd 100755 --- a/main.asm +++ b/main.asm @@ -678,12 +678,12 @@ SECTION "bank11",ROMX,BANK[$11] dr $44000,$45077 LoadSpinnerArrowTiles: ; 45077 (11:5077) - dr $45077,$48000 + dr $45077,$46c12 SECTION "bank12",ROMX,BANK[$12] - dr $48000,$4c000 + dr $48000,$4a540 SECTION "bank13",ROMX,BANK[$13] @@ -737,7 +737,7 @@ AgathaPic: INCBIN "pic/trainer/agatha.pic" LancePic: INCBIN "pic/trainer/lance.pic" JessieJamesPic: INCBIN "pic/ytrainer/jessiejames.pic" - dr $4fe79,$50000 + dr $4fe79,$4ff1a SECTION "bank14",ROMX,BANK[$14] @@ -746,7 +746,7 @@ SECTION "bank14",ROMX,BANK[$14] PrintCardKeyText: ; 525d8 (14:65d8) dr $525d8,$5267d CeladonPrizeMenu: ; 5267d (14:667d) - dr $5267d,$54000 + dr $5267d,$529a2 SECTION "bank15",ROMX,BANK[$15] @@ -762,7 +762,7 @@ _SetSpritePosition1: ; 56789 (15:6789) _SetSpritePosition2: ; 567a9 (15:67a9) dr $567a9,$567cd TrainerWalkUpToPlayer: ; 567cd (15:67cd) - dr $567cd,$58000 + dr $567cd,$56997 SECTION "bank16",ROMX,BANK[$16] dr $58000,$58d99 @@ -771,14 +771,14 @@ CalcLevelFromExperience: ; 58d99 (16:4d99) CalcExperience: ; 58dc0 (16:4dc0) dr $58dc0,$58e8b PrintStatusAilment: ; 58e8b (16:4e8b) - dr $58e8b,$5c000 + dr $58e8b,$5a555 SECTION "bank17",ROMX,BANK[$17] dr $5c000,$5da70 EvolveMon: ; 5da70 (17:5a70) - dr $5da70,$60000 + dr $5da70,$5df60 SECTION "bank18",ROMX,BANK[$18] -- cgit v1.3.1-sl0p From 3988b60a46e7d9aad2a53984f7bcf7021b1d8cd2 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 12:04:32 -0400 Subject: Trim trailing zeros from `dr` blocks (part 2) --- main.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main.asm') diff --git a/main.asm b/main.asm index f3535bcd..15d9168d 100755 --- a/main.asm +++ b/main.asm @@ -783,7 +783,7 @@ EvolveMon: ; 5da70 (17:5a70) SECTION "bank18",ROMX,BANK[$18] - dr $60000,$64000 + dr $60000,$62702 SECTION "bank19",ROMX,BANK[$19] @@ -793,7 +793,7 @@ Overworld_GFX: SECTION "bank1A",ROMX,BANK[$1A] - dr $68000,$6c000 + dr $68000,$6bff1 SECTION "bank1B",ROMX,BANK[$1B] @@ -836,7 +836,7 @@ HiddenItemNear: ; 7405c (1d:405c) VendingMachineMenu: ; 74726 (1d:4726) dr $74726,$75dfe PKMNLeaguePC: ; 75dfe (1d:5dfe) - dr $75dfe,$78000 + dr $75dfe,$76177 SECTION "bank1E",ROMX,BANK[$1E] @@ -871,7 +871,7 @@ SECTION "bank30",ROMX,BANK[$30] SECTION "bank39",ROMX,BANK[$39] - dr $e4000,$e8000 + dr $e4000,$e7ea3 SECTION "bank3A",ROMX,BANK[$3A] @@ -894,7 +894,7 @@ SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu_3.t1.2bpp" dr $ea3ea,$eaa02 FreezeEnemyTrainerSprite: ; eaa02 (3a:6a02) - dr $eaa02,$ec000 + dr $eaa02,$eaa24 SECTION "bank3C",ROMX,BANK[$3C] -- cgit v1.3.1-sl0p From d9c75189d6cb7dd639e8cf93a189432bd3e59b78 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 12:18:00 -0400 Subject: FreezeEnemyTrainerSprite --- main.asm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'main.asm') diff --git a/main.asm b/main.asm index 15d9168d..8309a373 100755 --- a/main.asm +++ b/main.asm @@ -894,7 +894,29 @@ SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu_3.t1.2bpp" dr $ea3ea,$eaa02 FreezeEnemyTrainerSprite: ; eaa02 (3a:6a02) - dr $eaa02,$eaa24 + ld a, [wCurMap] + cp POKEMONTOWER_7 + ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them + ld hl, RivalIDs + ld a, [wEngagedTrainerClass] + ld b, a +.loop + ld a, [hli] + cp $ff + jr z, .notRival + cp b + ret z ; the rival leaves after battling, so don't freeze him + jr .loop +.notRival + ld a, [wSpriteIndex] + ld [H_SPRITEINDEX], a + jp SetSpriteMovementBytesToFF + +RivalIDs: ; eaa20 (3a:6a20) + db OPP_SONY1 + db OPP_SONY2 + db OPP_SONY3 + db $ff SECTION "bank3C",ROMX,BANK[$3C] -- cgit v1.3.1-sl0p From 0bbe27333ab77b0fc405a4834218216f27f03669 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 13:29:34 -0400 Subject: Disassemble function at ea3ea --- engine/unknown_ea3ea.asm | 189 +++++++++++++++++++++++++++++++++++++++++++++++ gfx/stats_screen_hp.png | Bin 0 -> 82 bytes gfx/stats_screen_lv.png | Bin 0 -> 78 bytes main.asm | 3 +- 4 files changed, 191 insertions(+), 1 deletion(-) create mode 100755 engine/unknown_ea3ea.asm create mode 100644 gfx/stats_screen_hp.png create mode 100644 gfx/stats_screen_lv.png (limited to 'main.asm') diff --git a/engine/unknown_ea3ea.asm b/engine/unknown_ea3ea.asm new file mode 100755 index 00000000..375d6006 --- /dev/null +++ b/engine/unknown_ea3ea.asm @@ -0,0 +1,189 @@ +Func_ea3ea: ; ea3ea (3a:63ea) + call GBPalWhiteOutWithDelay3 + call ClearScreen + call LoadHpBarAndStatusTilePatterns + ld de, GFX_ea563 + ld hl, vChars2 + $710 + lb bc, BANK(GFX_ea563), (GFX_ea563End - GFX_ea563) / 8 + call CopyVideoDataDouble + + ld de, GFX_ea56b + ld hl, vChars2 + $6e0 + lb bc, BANK(GFX_ea56b), (GFX_ea56bEnd - GFX_ea56b) / 8 + call CopyVideoDataDouble + + xor a + ld [H_AUTOBGTRANSFERENABLED], a + xor a + ld [wWhichTradeMonSelectionMenu], a + call LoadMonData + + ld hl, wTileMap + lb bc, $10, $12 + call TextBoxBorder + + coord hl, 0, 12 + lb bc, $04, $12 + call TextBoxBorder + + coord hl, 3, 10 + call PrintLevelFull + + coord hl, 2, 10 + ld a, $6e + ld [hli], a + ld [hl], " " + + coord hl, 2, 11 + ld [hl], "′" + + coord hl, 4, 11 + ld de, wLoadedMonMaxHP + lb bc, 2, 3 + call PrintNumber + + ld a, [wMonHeader] + ld [wPokeBallAnimData], a + ld [wd0b5], a + ld hl, wPartyMonNicks + call Func_ea511 + coord hl, 8, 2 + call PlaceString + + call GetMonName + coord hl, 9, 3 + call PlaceString + + predef IndexToPokedex + coord hl, 2, 8 + ld [hl], "№" + inc hl + ld [hl], $f2 + inc hl + ld de, wPokeBallAnimData + lb bc, $80 | 1, 3 + call PrintNumber + + coord hl, 8, 4 + ld de, String_ea52f + call PlaceString + + ld hl, wPartyMonOT + call Func_ea511 + coord hl, 9, 5 + call PlaceString + + coord hl, 9, 6 + ld de, String_ea533 + call PlaceString + + coord hl, 13, 6 + ld de, wLoadedMonOTID + lb bc, $80 | 2, 5 + call PrintNumber + + coord hl, 9, 8 + ld de, String_ea537 + ld a, [hFlags_0xFFFA] + set 2, a + ld [hFlags_0xFFFA], a + call PlaceString + ld a, [hFlags_0xFFFA] + res 2, a + ld [hFlags_0xFFFA], a + + coord hl, 16, 8 + ld de, wLoadedMonAttack + ld a, 4 +.loop + push af + push de + + push hl + lb bc, 2, 3 + call PrintNumber + pop hl + ld bc, SCREEN_WIDTH + add hl, bc + + pop de + inc de + inc de + pop af + dec a + jr nz, .loop + + coord hl, 1, 13 + ld a, [wLoadedMonMoves] + call Func_ea51d + + coord hl, 1, 14 + ld a, [wLoadedMonMoves + 1] + call Func_ea51d + + coord hl, 1, 15 + ld a, [wLoadedMonMoves + 2] + call Func_ea51d + + coord hl, 1, 16 + ld a, [wLoadedMonMoves + 3] + call Func_ea51d + + ld b, $04 ; SET_PAL_STATUS_SCREEN + call RunPaletteCommand + + ld a, $01 + ld [H_AUTOBGTRANSFERENABLED], a + call Delay3 + call GBPalNormal + coord hl, 1, 1 + call LoadFlippedFrontSpriteByMonIndex + ret + +Func_ea511: ; ea511 (3a:6511) + ld bc, NAME_LENGTH + ld a, [wWhichPokemon] + call AddNTimes + ld e, l + ld d, h + ret + +Func_ea51d: ; ea51d (3a:651d) + and a + jr z, .asm_e6528 + ld [wPokeBallAnimData], a + call GetMoveName + jr .asm_ea52b + +.asm_e6528 + ld de, String_ea554 +.asm_ea52b + call PlaceString + ret +; ea52f + +String_ea52f: + db "OT/@" +; ea533 + +String_ea533: + db $73, "№/@" +; ea537 + +String_ea537: + db "ATTACK" + next "DEFENSE" + next "SPEED" + next "SPECIAL@" +; ea554 + +String_ea554: ; ea554 (3a:6554) + db "--------------@" + +GFX_ea563: ; ea563 (3a:6563) +INCBIN "gfx/unknown_ea563.1bpp" +GFX_ea563End: ; ea56b (3a:656b) + +GFX_ea56b: +INCBIN "gfx/unknown_ea56b.1bpp" +GFX_ea56bEnd: ; ea573 (3a:6573) diff --git a/gfx/stats_screen_hp.png b/gfx/stats_screen_hp.png new file mode 100644 index 00000000..adf086ca Binary files /dev/null and b/gfx/stats_screen_hp.png differ diff --git a/gfx/stats_screen_lv.png b/gfx/stats_screen_lv.png new file mode 100644 index 00000000..0d5c6620 Binary files /dev/null and b/gfx/stats_screen_lv.png differ diff --git a/main.asm b/main.asm index 8309a373..fde93d4b 100755 --- a/main.asm +++ b/main.asm @@ -892,7 +892,8 @@ SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu_3.t1.2bpp" - dr $ea3ea,$eaa02 +INCLUDE "engine/unknown_ea3ea.asm" + dr $ea573,$eaa02 FreezeEnemyTrainerSprite: ; eaa02 (3a:6a02) ld a, [wCurMap] cp POKEMONTOWER_7 -- cgit v1.3.1-sl0p From bd5caf92db057bdf32c77f3415f6411b4d327565 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 13:52:57 -0400 Subject: Another function related to OAM --- engine/unknown_ea3ea.asm | 27 +++++++++++++++++++++++++++ gfx/zero_one_ea597.png | Bin 0 -> 92 bytes main.asm | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gfx/zero_one_ea597.png (limited to 'main.asm') diff --git a/engine/unknown_ea3ea.asm b/engine/unknown_ea3ea.asm index b883f785..78a73393 100755 --- a/engine/unknown_ea3ea.asm +++ b/engine/unknown_ea3ea.asm @@ -187,3 +187,30 @@ GFX_ea563End: ; ea56b (3a:656b) GFX_ea56b: INCBIN "gfx/stats_screen_lv.1bpp" GFX_ea56bEnd: ; ea573 (3a:6573) + +Func_ea573: ; ea573 (3a:6573) + ld hl, vChars1 + $7e0 + ld de, GFX_ea597 + lb bc, BANK(GFX_ea597), (GFX_ea597End - GFX_ea597) / 16 + call CopyVideoData + + ld hl, wOAMBuffer + 32 * 4 + ld a, $08 + ld c, $08 +.loop + ld [hl], $10 + inc hl + ld [hl], a + inc hl + ld [hl], $fe + inc hl + ld [hl], $00 + inc hl + add $08 + dec c + jr nz, .loop + ret + +GFX_ea597: ; ea597 (3a:6597) +INCBIN "gfx/zero_one_ea597.2bpp" +GFX_ea597End: diff --git a/gfx/zero_one_ea597.png b/gfx/zero_one_ea597.png new file mode 100644 index 00000000..0c11b9da Binary files /dev/null and b/gfx/zero_one_ea597.png differ diff --git a/main.asm b/main.asm index fde93d4b..98608ba1 100755 --- a/main.asm +++ b/main.asm @@ -893,7 +893,7 @@ SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu_3.t1.2bpp" INCLUDE "engine/unknown_ea3ea.asm" - dr $ea573,$eaa02 + dr $ea5b7,$eaa02 FreezeEnemyTrainerSprite: ; eaa02 (3a:6a02) ld a, [wCurMap] cp POKEMONTOWER_7 -- cgit v1.3.1-sl0p From 82b21453806362c5287b50137584c3734d2dab1b Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 15:23:16 -0400 Subject: Disassemble ea3ea to end of bank 3a --- engine/unknown_ea3ea.asm | 756 +++++++++++++++++++++++++++++++++++++++++++++++ main.asm | 2 +- 2 files changed, 757 insertions(+), 1 deletion(-) (limited to 'main.asm') diff --git a/engine/unknown_ea3ea.asm b/engine/unknown_ea3ea.asm index 78a73393..fb16e913 100755 --- a/engine/unknown_ea3ea.asm +++ b/engine/unknown_ea3ea.asm @@ -214,3 +214,759 @@ Func_ea573: ; ea573 (3a:6573) GFX_ea597: ; ea597 (3a:6597) INCBIN "gfx/zero_one_ea597.2bpp" GFX_ea597End: + +Func_ea5b7: ; ea5b7 (3a:65b7) + ld hl, wOAMBuffer + 32 * 4 + 2 + ld de, 4 + ld a, [$c971] + ld c, 8 +.asm_ea5c2 + sla a + jr c, .asm_ea5ca + ld [hl], $fe + jr .asm_ea5cc + +.asm_ea5ca + ld [hl], $ff +.asm_ea5cc + add hl, de + dec c + jr nz, .asm_ea5c2 + ret + +Functionea5d1: ; ea5d1 (3a:65d1) + ld a, [wOverworldMap] + ld e, a + ld d, 0 + ld hl, Jumptable_ea5e0 + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Jumptable_ea5e0: + dw Functionea623 + dw Functionea6d2 + dw Functionea6af + dw Functionea645 + dw Functionea701 + dw Functionea6bd + dw Functionea671 + dw Functionea701 + dw Functionea6af + dw Functionea68a + dw Functionea701 + dw Functionea6af + dw Functionea721 + dw Functionea610 + dw Functionea61a + dw Functionea6af + dw Functionea61e + dw Functionea72f + dw Functionea732 + + +Functionea606: ; ea606 (3a:6606) + ld hl, wOverworldMap + inc [hl] + ret + +Functionea60b: ; ea60b (3a:660b) + ld hl, wOverworldMap + dec [hl] + ret + +Functionea610: ; ea610 (3a:6610) + xor a + ld [$c971], a + ld hl, wOverworldMap + set 7, [hl] + ret + +Functionea61a: ; ea61a (3a:661a) + call Functionea606 + ret + +Functionea61e: ; ea61e (3a:661e) + xor a + ld [wOverworldMap], a + ret + +Functionea623: ; ea623 (3a:6623) + call Functionea784 + ld hl, Data_ea9de + call Functionea76b + xor a + ld [$c976], a + ld [$c977], a + ld a, [$caf4] + ld [$c6e9], a + call Functionea606 + call Functionea74c + ld a, $01 + ld [$cae0], a + ret + +Functionea645: ; ea645 (3a:6645) + call Functionea784 + ld hl, $c6e9 + ld a, [hl] + and a + jr z, Functionea671 + ld hl, Data_ea9ea + call Functionea76b + call Functionea7e9 + ld a, $80 + ld [$c976], a + ld a, $02 + ld [$c977], a + call Functionea7a2 + call Functionea606 + call Functionea74c + ld a, $02 + ld [$cae0], a + ret + +Functionea671: ; ea671 (3a:6671) + ld a, $06 + ld [wOverworldMap], a + ld hl, Data_ea9f0 + call Functionea76b + xor a + ld [$c976], a + ld [$c977], a + call Functionea606 + call Functionea74c + ret + +Functionea68a: ; ea68a (3a:668a) + call Functionea784 + ld hl, Data_ea9e4 + call Functionea76b + call Functionea7d2 + ld a, $04 + ld [$c976], a + ld a, $00 + ld [$c977], a + call Functionea7a2 + call Functionea606 + call Functionea74c + ld a, $03 + ld [$cae0], a + ret + +Functionea6af: ; ea6af (3a:66af) + ld hl, $c973 + inc [hl] + ld a, [hl] + cp a, $06 + ret c + xor a + ld [hl], a + call Functionea606 + ret + +Functionea6bd: ; ea6bd (3a:66bd) + ld hl, $c973 + inc [hl] + ld a, [hl] + cp 6 + ret c + xor a + ld [hl], a + ld hl, $c6e9 + dec [hl] + call Functionea60b + call Functionea60b + ret + +Functionea6d2: ; ea6d2 (3a:66d2) + call Functionea742 + ret c + ld a, [$c970] + cp a, $ff + jr nz, .asm_ea6e4 + ld a, [$c971] + cp a, $ff + jr z, .asm_ea6fb +.asm_ea6e4 + ld a, [$c970] + cp a, $81 + jr nz, .asm_ea6fb + ld a, [$c971] + cp a, $00 + jr nz, .asm_ea6fb + ld hl, wUnknownSerialFlag_d49a + set 1, [hl] + call Functionea606 + ret + +.asm_ea6fb + ld a, $0e + ld [wOverworldMap], a + ret + +Functionea701: ; ea701 (3a:6701) + call Functionea742 + ret c + ld a, [$c971] + and $f0 + jr nz, .asm_ea71b + ld a, [$c971] + and $01 + jr nz, .asm_ea717 + call Functionea606 + ret + +.asm_ea717 + call Functionea60b + ret + +.asm_ea71b + ld a, $11 + ld [wOverworldMap], a + ret + +Functionea721: ; ea721 (3a:6721) + call Functionea742 + ret c + ld a, [$c971] + and $f3 + ret nz + call Functionea606 + ret + +Functionea72f: ; ea72f (3a:672f) + call Functionea606 +Functionea732: ; ea732 (3a:6732) + ld a, [wUnknownSerialFlag_d49b] + and a + ret nz + ld a, [$c971] + and $f0 + ret nz + xor a + ld [wOverworldMap], a + ret + +Functionea742: ; ea742 (3a:6742) + ld a, [wUnknownSerialFlag_d49b] + and a + jr nz, .asm_ea74a + and a + ret + +.asm_ea74a + scf + ret + +Functionea74c: ; ea74c (3a:674c) +.asm_ea74c + ld a, [wUnknownSerialFlag_d49b] + and a + jr nz, .asm_ea74c + ld a, $01 + ld [wUnknownSerialFlag_d49b], a + xor a + ld [$c974], a + ld [$c975], a + ld a, $88 + ld [rSB], a + ld a, $01 + ld [rSC], a + ld a, $81 + ld [rSC], a + ret + +Functionea76b: ; ea76b (3a:676b) + ld a, [hli] + ld [$c6ea], a + ld a, [hli] + ld [$c6eb], a + ld a, [hli] + ld [$c6ec], a + ld a, [hli] + ld [$c6ed], a + ld a, [hli] + ld [$c6ee], a + ld a, [hl] + ld [$c6ef], a + ret + +Functionea784: ; ea784 (3a:6784) + xor a + ld hl, $c6ea + ld [hli], a + ld [hli], a + ld [hli], a + ld [hl], a + ld hl, $c6ee + ld [hli], a + ld [hl], a + xor a + ld [$c976], a + ld [$c977], a + ld hl, $c6f0 + ld bc, $280 + call FillMemory + ret + +Functionea7a2: ; ea7a2 (3a:67a2) + ld hl, $0000 + ld bc, $0004 + ld de, $c6ea + call Functionea7c5 + ld a, [$c976] + ld c, a + ld a, [$c977] + ld b, a + ld de, $c6f0 + call Functionea7c5 + ld a, l + ld [$c6ee], a + ld a, h + ld [$c6ef], a + ret + +Functionea7c5: ; ea7c5 (3a:67c5) +.asm_ea7c5 + ld a, [de] + inc de + add l + jr nc, .asm_ea7cb + inc h +.asm_ea7cb + ld l, a + dec bc + ld a, c + or b + jr nz, .asm_ea7c5 + ret + +Functionea7d2: ; ea7d2 (3a:67d2) + ld a, $01 + ld [$c6f0], a + ld a, [$cae2] + ld [$c6f1], a + ld a, $e4 + ld [$c6f2], a + ld a, [$cae3] + ld [$c6f3], a + ret + +Functionea7e9: ; ea7e9 (3a:67e9) + ld a, [$c6e9] + ld b, a + ld a, [$caf4] + sub b + ld hl, $c978 + ld de, $0028 +.asm_ea7f7 + and a + jr z, .asm_ea7fe + add hl, de + dec a + jr .asm_ea7f7 + +.asm_ea7fe + ld e, l + ld d, h + ld hl, $c6f0 + ld c, $28 +.asm_ea805 + ld a, [de] + inc de + push bc + push de + push hl + swap a + ld d, a + and $f0 + ld e, a + ld a, d + and $0f + ld d, a + and $08 + ld a, d + jr nz, .asm_ea81d + or $90 + jr .asm_ea81f + +.asm_ea81d + or $80 +.asm_ea81f + ld d, a + lb bc, $3a, $01 + call CopyVideoData + pop hl + ld de, $0010 + add hl, de + pop de + pop bc + dec c + jr nz, .asm_ea805 + call Functionea834 + ret + +Functionea834: ; ea834 (3a:6834) + ld hl, $cbdc + ld bc, $0020 + xor a + call FillMemory + ld hl, $c300 + ld c, $28 +.asm_ea843 + push bc + push hl + call Functionea860 + jr nc, .asm_ea856 + call Functionea886 + call Functionea8a1 + call Functionea902 + call Functionea999 +.asm_ea856 + pop hl + inc hl + inc hl + inc hl + inc hl + pop bc + dec c + jr nz, .asm_ea843 + ret + +Functionea860: ; ea860 (3a:6860) + ld a, [$c6e9] + ld b, a + ld a, [$caf4] + sub b + ld c, a + ld b, $10 +.asm_ea86b + ld a, c + and a + jr z, .asm_ea876 + ld a, b + add $10 + ld b, a + dec c + jr .asm_ea86b + +.asm_ea876 + ld a, b + ld e, a + add $10 + ld d, a + ld a, [hl] + cp e + jr c, .asm_ea884 + cp d + jr nc, .asm_ea884 + scf + ret + +.asm_ea884 + and a + ret + +Functionea886: ; ea886 (3a:6886) + push hl + inc hl + inc hl + ld a, [hl] + swap a + ld d, a + and $f0 + ld e, a + ld a, d + and $0f + or $80 + ld d, a + ld hl, $cbdc + lb bc, $3a, $01 + call CopyVideoData + pop hl + ret + +Functionea8a1: ; ea8a1 (3a:68a1) + push hl + inc hl + inc hl + inc hl + ld a, [hl] + call Functionea8ab + pop hl + ret + +Functionea8ab: ; ea8ab (3a:68ab) + and $60 + swap a + ld e, a + ld d, 0 + ld hl, Jumptable_ea8ba + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Jumptable_ea8ba: ; ea8ba (3a:68ba) + dw Functionea8c2 + dw Functionea8c3 + dw Functionea8c7 + dw Functionea8cb + +Functionea8c2: ; ea8c2 (3a:68c2) + ret + +Functionea8c3: ; ea8c3 (3a:68c3) + call Functionea8d2 + ret + +Functionea8c7: ; ea8c7 (3a:68c7) + call Functionea8e8 + ret + +Functionea8cb: ; ea8cb (3a:68cb) + call Functionea8d2 + call Functionea8e8 + ret + +Functionea8d2: ; ea8d2 (3a:68d2) + ld hl, $cbdc + ld c, 16 +.asm_ea8d7 + ld d, [hl] + ld a, 0 + ld b, 8 +.asm_ea8dc + sla d + rr a + dec b + jr nz, .asm_ea8dc + ld [hli], a + dec c + jr nz, .asm_ea8d7 + ret + +Functionea8e8: ; ea8e8 (3a:68e8) + ld hl, $cbdc + ld de, $cbea + ld c, $04 +.asm_ea8f0 + ld b, [hl] + ld a, [de] + ld [hli], a + ld a, b + ld [de], a + inc de + ld b, [hl] + ld a, [de] + ld [hli], a + ld a, b + ld [de], a + dec de + dec de + dec de + dec c + jr nz, .asm_ea8f0 + ret + +Functionea902: ; ea902 (3a:6902) + push hl + ld hl, $cbdc + ld de, $cbec + ld a, $08 +.asm_ea90b + push af + ld bc, $0000 + ld a, $08 +.asm_ea911 + push af + xor a + rlc [hl] + rl a + inc hl + rlc [hl] + rl a + dec hl + push hl + push de + call Functionea936 + pop de + pop hl + pop af + dec a + jr nz, .asm_ea911 + inc hl + inc hl + ld a, b + ld [de], a + inc de + ld a, c + ld [de], a + inc de + pop af + dec a + jr nz, .asm_ea90b + pop hl + ret + +Functionea936 ; ea936 (3a:6936) + call Functionea93d + call Functionea96d + ret + +Functionea93d: ; ea93d (3a:693d) + ld e, a + ld d, 0 + ld hl, Jumptable_ea949 + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Jumptable_ea949: ; ea949 (3a:6949) + dw Functionea951 + dw Functionea95f + dw Functionea956 + dw Functionea966 + +Functionea951: ; ea951 (3a:6951) + ld a, [rOBP0] + and $03 + ret + +Functionea956: ; ea956 (3a:6956) + ld a, [rOBP0] + and $0c + srl a + srl a + ret + +Functionea95f: ; ea95f (3a:695f) + ld a, [rOBP0] + and $30 + swap a + ret + +Functionea966: ; ea966 (3a:6966) + ld a, [rOBP0] + and $c0 + rlca + rlca + ret + +Functionea96d: ; ea96d (3a:696d) + ld e, a + ld d, 0 + ld hl, Jumptable_ea979 + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Jumptable_ea979: ; ea979 (3a:6979) + dw Functionea981 + dw Functionea986 + dw Functionea98c + dw Functionea992 + +Functionea981: ; ea981 (3a:6981) + sla b + sla c + ret + +Functionea986: ; ea986 (3a:6986) + scf + rl b + sla c + ret + +Functionea98c: ; ea98c (3a:698c) + sla b + scf + rl c + ret + +Functionea992: ; ea992 (3a:6992) + scf + rl b + scf + rl c + ret + +Functionea999: ; ea999 (3a:6999) + push hl + ld a, [hli] + ld c, [hl] + and $08 + jr nz, .asm_ea9a5 + ld hl, $c6f0 + jr .asm_ea9a8 + +.asm_ea9a5 + ld hl, $c830 +.asm_ea9a8 + ld b, $00 + ld a, c + and $f8 + sub $08 + ld c, a + sla c + rl b + add hl, bc + ld e, l + ld d, h + ld hl, $cbec + ld c, $08 +.asm_ea9bc + call Functionea9d0 + ld a, [de] + and b + or [hl] + ld [de], a + inc hl + inc de + ld a, [de] + and b + or [hl] + ld [de], a + inc hl + inc de + dec c + jr nz, .asm_ea9bc + pop hl + ret + +Functionea9d0: ; ea9d0 (3a:69d0) + push hl + push de + ld de, $fff0 + add hl, de + ld a, [hli] + or [hl] + xor $ff + ld b, a + pop de + pop hl + ret + +Data_ea9de: ; ea9de + db $01, $00, $00, $00, $01, $00 +Data_ea9e4: ; ea9e4 + db $02, $00, $04, $00, $00, $00 +Data_ea9ea: ; ea9ea + db $04, $00, $80, $02, $00, $00 +Data_ea9f0: ; ea9f0 + db $04, $00, $00, $00, $04, $00 +Data_ea9f6: ; ea9f6 + db $08, $00, $00, $00, $08, $00 +Data_ea9fc: ; ea9fc + db $0f, $00, $00, $00, $0f, $00 diff --git a/main.asm b/main.asm index 98608ba1..f7754dff 100755 --- a/main.asm +++ b/main.asm @@ -893,7 +893,7 @@ SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu_3.t1.2bpp" INCLUDE "engine/unknown_ea3ea.asm" - dr $ea5b7,$eaa02 + FreezeEnemyTrainerSprite: ; eaa02 (3a:6a02) ld a, [wCurMap] cp POKEMONTOWER_7 -- cgit v1.3.1-sl0p From 805448c9749c7c729113e942d113dd4eed479892 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 18:37:42 -0400 Subject: Functions at 3a:4d35 --- engine/unknown_e8d35.asm | 159 +++++++++++++++++++++++++++++++++++++++++++++++ gfx/unknown_ea563.png | Bin 0 -> 82 bytes main.asm | 38 +++++++++-- 3 files changed, 192 insertions(+), 5 deletions(-) create mode 100755 engine/unknown_e8d35.asm create mode 100644 gfx/unknown_ea563.png (limited to 'main.asm') diff --git a/engine/unknown_e8d35.asm b/engine/unknown_e8d35.asm new file mode 100755 index 00000000..e28073a0 --- /dev/null +++ b/engine/unknown_e8d35.asm @@ -0,0 +1,159 @@ +Func_e8d35:: ; e8d35 (3a:4e79) + ld a, [wBoxDataStart] + and a + jp z, Functione8df4 + ld a, [wUpdateSpritesEnabled] + push af + xor a + ld [wUpdateSpritesEnabled], a + ld [hItemCounter], a + call Func_e8f24 + ld a, [rIE] + push af + xor a + ld [rIF], a + ld a, $09 + ld [rIE], a + call SaveScreenTilesToBuffer1 + xor a + ld [H_AUTOBGTRANSFERENABLED], a + call Func_e988a + call Func_e8783 + ld a, $10 + ld [$cae2], a + call Func_e8efc + call LoadScreenTilesFromBuffer1 + call Functione8dfb + jr c, .asm_e8ddc + xor a + ld [wUnknownSerialFlag_d49a], a + ld [wUnknownSerialFlag_d49b], a + ld c, 12 + call DelayFrames + xor a + ld [H_AUTOBGTRANSFERENABLED], a + call Func_e98ec + call Func_e8783 + ld a, $00 + ld [$cae2], a + call Func_e8efc + call LoadScreenTilesFromBuffer1 + call Functione8dfb + jr c, .asm_e8ddc + xor a + ld [wUnknownSerialFlag_d49a], a + ld [$d49a], a + ld c, 12 + call DelayFrames + xor a + ld [H_AUTOBGTRANSFERENABLED], a + call Func_e9907 + call Func_e8783 + ld a, $00 + ld [$cae2], a + call Func_e8efc + call LoadScreenTilesFromBuffer1 + call Functione8dfb + jr c, .asm_e8ddc + xor a + ld [wUnknownSerialFlag_d49a], a + ld [wUnknownSerialFlag_d49b], a + ld c, 12 + call DelayFrames + xor a + ld [H_AUTOBGTRANSFERENABLED], a + call Func_e9922 + call Func_e8783 + ld a, $03 + ld [$cae2], a + call Func_e8efc + call LoadScreenTilesFromBuffer1 + call Functione8dfb +.asm_e8ddc + xor a + ld [wUnknownSerialFlag_d49a], a + ld [wUnknownSerialFlag_d49b], a + xor a + ld [rIF], a + pop af + ld [rIE], a + call Func_0f3d + call Func_e8f3b + pop af + ld [wUpdateSpritesEnabled], a + ret + +Functione8df4: ; e8df4 + ld hl, String_e8e1f + call PrintText + ret + +Functione8dfb: ; e8dfb + call Func_e8f16 +.asm_e8dfe + call JoypadLowSensitivity + call Func_e8eca + jr c, .asm_e8e1d + ld a, [wOverworldMap] + bit 7, a + jr nz, .asm_e8e1b + call Func_e87a8 + call Func_e8f51 + call Func_e8f82 + call DelayFrame + jr .asm_e8dfe + +.asm_e8e1b + and a + ret + +.asm_e8e1d + scf + ret + +String_e8e1f: ; e8e1f + TX_FAR _NoPokemonText + db "@" + +Functione8e24: ; e8e24 + xor a + ld [hItemCounter], a + call Func_e8f24 + call Func_ea3ea + ld a, [rIE] + push af + xor a + ld [rIF], a + ld a, $09 + ld [rIE], a + call Func_e8783 + ld a, $13 + ld [$cae2], a + call Func_e8efc + call Func_e8f16 +.asm_e8e45 + call JoypadLowSensitivity + call Func_e8eca + jr c, .asm_e8e62 + ld a, [wOverworldMap] + bit 7, a + jr nz, .asm_e8e62 + call Func_e87a8 + call Func_e8f51 + call Func_e8f82 + call DelayFrame + jr .asm_e8e45 + +.asm_e8e62 + xor a + ld [wUnknownSerialFlag_d49a], a + ld [wUnknownSerialFlag_d49b], a + call Func_e8f09 + xor a + ld [rIF], a + pop af + ld [rIE], a + call Func_0f3d + call Func_e8f3b + ret + diff --git a/gfx/unknown_ea563.png b/gfx/unknown_ea563.png new file mode 100644 index 00000000..adf086ca Binary files /dev/null and b/gfx/unknown_ea563.png differ diff --git a/main.asm b/main.asm index f7754dff..8f84396b 100755 --- a/main.asm +++ b/main.asm @@ -878,17 +878,45 @@ SECTION "bank3A",ROMX,BANK[$3A] MonsterNames: ; e8000 (3a:4000) dr $e8000,$e876c IsPlayerJustOutsideMap: ; e876c (3a:476c) - dr $e876c,$e8a5e + dr $e876c,$e8783 +Func_e8783: ; e8783 (3a:4783) + dr $e8783,$e87a8 +Func_e87a8: ; e87a8 (3a:47a8) + dr $e87a8,$e8a5e Func_e8a5e: ; e8a5e (3a:4a5e) dr $e8a5e,$e8b74 Func_e8b74: ; e8b74 (3a:4b74) dr $e8b74,$e8d35 -Func_e8d35:: ; e8d35 (3a:4d35) - dr $e8d35,$e8e79 + +INCLUDE "engine/unknown_e8d35.asm" + Func_e8e79: ; e8e79 (3a:4e79) - dr $e8e79,$e928a + dr $e8e79,$e8eca +Func_e8eca: ; e8eca (3a:4eca) + dr $e8eca,$e8efc +Func_e8efc: ; e8efc (3a:4efc) + dr $e8efc,$e8f09 +Func_e8f09: ; e8f09 (3a:4f09) + dr $e8f09,$e8f16 +Func_e8f16: ; e8f16 (3a:4f16) + dr $e8f16,$e8f24 +Func_e8f24: ; e8f24 (3a:4f24) + dr $e8f24,$e8f3b +Func_e8f3b: ; e8f3b (3a:4f3b) + dr $e8f3b,$e8f51 +Func_e8f51: ; e8f51 (3a:4f51) + dr $e8f51,$e8f82 +Func_e8f82: ; e8f82 (3a:4f82) + dr $e8f82,$e928a SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" - dr $e988a,$e9bfa +Func_e988a: ; e988a (3a:588a) + dr $e988a,$e98ec +Func_e98ec: ; e98ec (3a:58ec) + dr $e98ec,$e9907 +Func_e9907: ; e9907 (3a:5907) + dr $e9907,$e9922 +Func_e9922: ; e9922 (3a:5922) + dr $e9922,$e9bfa SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu_3.t1.2bpp" -- cgit v1.3.1-sl0p From 10984f14cebe3357c45c7d0d2b981d216fc623bf Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 19:40:45 -0400 Subject: Replace MonsterNames dr with file already in repo --- engine/unknown_e8d35.asm | 2 +- main.asm | 3 +-- text/monster_names.asm | 2 +- wram.asm | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) (limited to 'main.asm') diff --git a/engine/unknown_e8d35.asm b/engine/unknown_e8d35.asm index 955a9f45..7aeeff39 100755 --- a/engine/unknown_e8d35.asm +++ b/engine/unknown_e8d35.asm @@ -42,7 +42,7 @@ Func_e8d35:: ; e8d35 (3a:4e79) jr c, .asm_e8ddc xor a ld [wUnknownSerialFlag_d49a], a - ld [$d49a], a + ld [wUnknownSerialFlag_d49b], a ld c, 12 call DelayFrames xor a diff --git a/main.asm b/main.asm index 8f84396b..0fe6f2fd 100755 --- a/main.asm +++ b/main.asm @@ -875,8 +875,7 @@ SECTION "bank39",ROMX,BANK[$39] SECTION "bank3A",ROMX,BANK[$3A] -MonsterNames: ; e8000 (3a:4000) - dr $e8000,$e876c +INCLUDE "text/monster_names.asm" IsPlayerJustOutsideMap: ; e876c (3a:476c) dr $e876c,$e8783 Func_e8783: ; e8783 (3a:4783) diff --git a/text/monster_names.asm b/text/monster_names.asm index c7e0226f..3262ec02 100755 --- a/text/monster_names.asm +++ b/text/monster_names.asm @@ -1,4 +1,4 @@ -MonsterNames: ; 1c21e (7:421e) +MonsterNames: ; e8000 (3a:4000) db "RHYDON@@@@" db "KANGASKHAN" db "NIDORAN♂@@" diff --git a/wram.asm b/wram.asm index 3ba0c67b..de88919b 100755 --- a/wram.asm +++ b/wram.asm @@ -2536,7 +2536,7 @@ wd47a:: ds 1 ds 24 -wPreventBlackout:: ds 1 +wPreventBlackout:: ds 1 ; d492 ds 1 -- cgit v1.3.1-sl0p From 106251da1f1412dbca66db8c0e0fe7fe9eb63968 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 21:03:52 -0400 Subject: engine/printer.asm --- engine/printer.asm | 772 +++++++++++++++++++++++++++++++++++++++++++++++ engine/unknown_e8d35.asm | 159 ---------- main.asm | 27 +- 3 files changed, 788 insertions(+), 170 deletions(-) create mode 100755 engine/printer.asm delete mode 100755 engine/unknown_e8d35.asm (limited to 'main.asm') diff --git a/engine/printer.asm b/engine/printer.asm new file mode 100755 index 00000000..16b95eed --- /dev/null +++ b/engine/printer.asm @@ -0,0 +1,772 @@ +Func_e8783: ; e8783 (3a:4783) + ld a, 9 + push af + ld hl, wOverworldMap + lb bc, 4, 13 + xor a + call Func_e8a2e + xor a + ld [rSB], a + ld [rSC], a + ld [wUnknownSerialFlag_d49b], a + ld hl, wUnknownSerialFlag_d49a + set 0, [hl] + ld a, [wd498] + ld [$cae3], a + pop af + ld [$caf4], a + ret + +; e87a8 +Func_e87a8: ; e87a8 (3a:47a8) + ld a, [wOverworldMap] + ld e, a + ld d, 0 + ld hl, Jumptable_e87b7 + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Jumptable_e87b7: + dw Func_e87fd + dw Func_e88c9 + dw Func_e88a6 + dw Func_e881f + dw Func_e8906 + dw Func_e88b4 + dw Func_e884b + dw Func_e8906 + dw Func_e88a6 + dw Func_e8864 + dw Func_e8906 + dw Func_e88a6 + dw Func_e8927 + dw Func_e87e9 + dw Func_e87f3 + dw Func_e88a6 + dw Func_e8889 + dw Func_e87f7 + dw Func_e8936 + dw Func_e8939 + +Func_e87df: + ld hl, wOverworldMap + inc [hl] + ret + +Func_e87e4: + ld hl, wOverworldMap + dec [hl] + ret + +Func_e87e9: + xor a + ld [$c971], a + ld hl, wOverworldMap + set 7, [hl] + ret + +Func_e87f3: + call Func_e87df + ret + +Func_e87f7: + ld a, $01 + ld [wOverworldMap], a + ret + +Func_e87fd: + call Func_e8981 + ld hl, Data_e8a3a + call Func_e8968 + xor a + ld [$c976], a + ld [$c977], a + ld a, [$caf4] + ld [$c6e9], a + call Func_e87df + call Func_e8949 + ld a, $01 + ld [$cae0], a + ret + +Func_e881f: + call Func_e8981 + ld hl, $c6e9 + ld a, [hl] + and a + jr z, Func_e884b + ld hl, Data_e8a46 + call Func_e8968 + call Func_e89e6 + ld a, $80 + ld [$c976], a + ld a, $02 + ld [$c977], a + call Func_e899f + call Func_e87df + call Func_e8949 + ld a, $02 + ld [$cae0], a + ret + +Func_e884b: + ld a, $06 + ld [wOverworldMap], a + ld hl, Data_e8a4c + call Func_e8968 + xor a + ld [$c976], a + ld [$c977], a + call Func_e87df + call Func_e8949 + ret + +Func_e8864: + call Func_e8981 + ld hl, Data_e8a40 + call Func_e8968 + call Func_e89cf + ld a, $04 + ld [$c976], a + ld a, $00 + ld [$c977], a + call Func_e899f + call Func_e87df + call Func_e8949 + ld a, $03 + ld [$cae0], a + ret + +Func_e8889: + call Func_e8981 + ld hl, Data_e8a3a + call Func_e8968 + xor a + ld [$c976], a + ld [$c977], a + ld a, [$caf4] + ld [$c6e9], a + call Func_e87df + call Func_e8949 + ret + +Func_e88a6: + ld hl, $c973 + inc [hl] + ld a, [hl] + cp a, $06 + ret c + xor a + ld [hl], a + call Func_e87df + ret + +Func_e88b4: + ld hl, $c973 + inc [hl] + ld a, [hl] + cp a, $06 + ret c + xor a + ld [hl], a + ld hl, $c6e9 + dec [hl] + call Func_e87e4 + call Func_e87e4 + ret + +Func_e88c9: + ld a, [wUnknownSerialFlag_d49b] + and a + ret nz + ld a, [$c970] + cp a, $ff + jr nz, .asm_e88dc + ld a, [$c971] + cp a, $ff + jr z, .asm_e88f8 +.asm_e88dc + ld a, [$c970] + cp a, $81 + jr nz, .asm_e88f8 + ld a, [$c971] + cp a, $00 + jr nz, .asm_e88f8 + ld hl, wUnknownSerialFlag_d49a + set 1, [hl] + ld a, $05 + ld [$c972], a + call Func_e87df + ret + +.asm_e88f8 + ld a, $ff + ld [$c970], a + ld [$c971], a + ld a, $0e + ld [wOverworldMap], a + ret + +Func_e8906: + ld a, [wUnknownSerialFlag_d49b] + and a + ret nz + ld a, [$c971] + and a, $f0 + jr nz, .asm_e8921 + ld a, [$c971] + and a, $01 + jr nz, .asm_e891d + call Func_e87df + ret + +.asm_e891d + call Func_e87e4 + ret + +.asm_e8921 + ld a, $12 + ld [wOverworldMap], a + ret + +Func_e8927: + ld a, [wUnknownSerialFlag_d49b] + and a + ret nz + ld a, [$c971] + and a, $f3 + ret nz + call Func_e87df + ret + +Func_e8936: + call Func_e87df +Func_e8939: + ld a, [wUnknownSerialFlag_d49b] + and a + ret nz + ld a, [$c971] + and a, $f0 + ret nz + xor a + ld [wOverworldMap], a + ret + +Func_e8949: +.asm_e8949 + ld a, [wUnknownSerialFlag_d49b] + and a + jr nz, .asm_e8949 + xor a + ld [$c974], a + ld [$c975], a + ld a, $01 + ld [wUnknownSerialFlag_d49b], a + ld a, $88 + ld [rSB], a + ld a, $01 + ld [rSC], a + ld a, $81 + ld [rSC], a + ret + +Func_e8968: + ld a, [hli] + ld [$c6ea], a + ld a, [hli] + ld [$c6eb], a + ld a, [hli] + ld [$c6ec], a + ld a, [hli] + ld [$c6ed], a + ld a, [hli] + ld [$c6ee], a + ld a, [hl] + ld [$c6ef], a + ret + +Func_e8981: + xor a + ld hl, $c6ea + ld [hli], a + ld [hli], a + ld [hli], a + ld [hl], a + ld hl, $c6ee + ld [hli], a + ld [hl], a + xor a + ld [$c976], a + ld [$c977], a + ld hl, $c6f0 + ld bc, $0280 + call Func_e8a2e + ret + +Func_e899f: + ld hl, $0000 + ld bc, $0004 + ld de, $c6ea + call Func_e89c2 + ld a, [$c976] + ld c, a + ld a, [$c977] + ld b, a + ld de, $c6f0 + call Func_e89c2 + ld a, l + ld [$c6ee], a + ld a, h + ld [$c6ef], a + ret + +Func_e89c2: +.asm_e89c2 + ld a, [de] + inc de + add l + jr nc, .asm_e89c8 + inc h +.asm_e89c8 + ld l, a + dec bc + ld a, c + or b + jr nz, .asm_e89c2 + ret + +Func_e89cf: + ld a, $01 + ld [$c6f0], a + ld a, [$cae2] + ld [$c6f1], a + ld a, $e4 + ld [$c6f2], a + ld a, [$cae3] + ld [$c6f3], a + ret + +Func_e89e6: + ld a, [$c6e9] + ld b, a + ld a, [$caf4] + sub b + ld hl, $c978 + ld de, $0028 +.asm_e89f4 + and a + jr z, .asm_e89fb + add hl, de + dec a + jr .asm_e89f4 + +.asm_e89fb + ld e, l + ld d, h + ld hl, $c6f0 + ld c, $28 +.asm_e8a02 + ld a, [de] + inc de + push bc + push de + push hl + swap a + ld d, a + and a, $f0 + ld e, a + ld a, d + and a, $0f + ld d, a + and a, $08 + ld a, d + jr nz, .asm_e8a1a + or a, $90 + jr .asm_e8a1c + +.asm_e8a1a + or a, $80 +.asm_e8a1c + ld d, a + ld bc, $3a01 + call CopyVideoData + pop hl + ld de, $0010 + add hl, de + pop de + pop bc + dec c + jr nz, .asm_e8a02 + ret + +Func_e8a2e: ; e8a2e (3a:4a2e) + push de + ld e, a +.asm_e8a30 + ld [hl], e + inc hl + dec bc + ld a, c + or b + jr nz, .asm_e8a30 + ld a, e + pop de + ret + +Data_e8a3a: + db $01, $00, $00, $00, $01, $00 +Data_e8a40: + db $02, $00, $04, $00, $00, $00 +Data_e8a46: + db $04, $00, $80, $02, $00, $00 +Data_e8a4c: + db $04, $00, $00, $00, $04, $00 +Data_e8a52: + db $08, $00, $00, $00, $08, $00 +Data_e8a58: + db $0f, $00, $00, $00, $0f, $00 + +Func_e8a5e: ; e8a5e (3a:4a5e) + ld a, [$d49a] + ld e, a + ld d, 0 + ld hl, Jumptable_e8a6d + add hl, de + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + jp [hl] + +Jumptable_e8a6d: + dw Func_e8ab2 + dw Func_e8ab3 + dw Func_e8abc + dw Func_e8ac6 + dw Func_e8ad0 + dw Func_e8ada + dw Func_e8ae4 + dw Func_e8b0f + dw Func_e8b19 + dw Func_e8b23 + dw Func_e8b2c + dw Func_e8b3a + dw Func_e8ab3 + dw Func_e8b44 + dw Func_e8b4d + dw Func_e8b4d + dw Func_e8b4d + dw Func_e8b44 + dw Func_e8b4d + dw Func_e8b23 + dw Func_e8b2c + dw Func_e8b6a + dw Func_e8ab3 + dw Func_e8b56 + dw Func_e8b4d + dw Func_e8b4d + dw Func_e8b4d + dw Func_e8b56 + dw Func_e8b4d + dw Func_e8b23 + dw Func_e8b2c + dw Func_e8b3a + +Func_e8aad: + ld hl, wUnknownSerialFlag_d49b + inc [hl] + ret + +Func_e8ab2: + ret + +Func_e8ab3: + ld a, $33 + call Func_e8b5f + call Func_e8aad + ret + +Func_e8abc: + ld a, [$c6ea] + call Func_e8b5f + call Func_e8aad + ret + +Func_e8ac6: + ld a, [$c6eb] + call Func_e8b5f + call Func_e8aad + ret + +Func_e8ad0: + ld a, [$c6ec] + call Func_e8b5f + call Func_e8aad + ret + +Func_e8ada: + ld a, [$c6ed] + call Func_e8b5f + call Func_e8aad + ret + +Func_e8ae4: + ld hl, $c976 + ld e, [hl] + inc hl + ld d, [hl] + ld a, e + or d + jr z, .asm_e8b0c + dec de + ld [hl], d + dec hl + ld [hl], e + ld a, [$c974] + ld e, a + ld a, [$c975] + ld d, a + ld hl, $c6f0 + add hl, de + inc de + ld a, e + ld [$c974], a + ld a, d + ld [$c975], a + ld a, [hl] + call Func_e8b5f + ret + +.asm_e8b0c + call Func_e8aad +Func_e8b0f: + ld a, [$c6ee] + call Func_e8b5f + call Func_e8aad + ret + +Func_e8b19: + ld a, [$c6ef] + call Func_e8b5f + call Func_e8aad + ret + +Func_e8b23: + ld a, $00 + call Func_e8b5f + call Func_e8aad + ret + +Func_e8b2c: + ld a, [rSB] + ld [$c970], a + ld a, $00 + call Func_e8b5f + call Func_e8aad + ret + +Func_e8b3a: + ld a, [rSB] + ld [$c971], a + xor a + ld [wUnknownSerialFlag_d49b], a + ret + +Func_e8b44: + ld a, $0f + call Func_e8b5f + call Func_e8aad + ret + +Func_e8b4d: + ld a, $00 + call Func_e8b5f + call Func_e8aad + ret + +Func_e8b56: + ld a, $08 + call Func_e8b5f + call Func_e8aad + ret + +Func_e8b5f: + ld [rSB], a + ld a, $01 + ld [rSC], a + ld a, $81 + ld [rSC], a + ret + +Func_e8b6a: + ld a, [rSB] + ld [$c971], a + xor a + ld [wUnknownSerialFlag_d49b], a + ret + +Func_e8b74: ; e8b74 (3a:4b74) + dr $e8b74,$e8d35 + +Func_e8d35:: ; e8d35 (3a:4e79) + ld a, [wBoxDataStart] + and a + jp z, Func_e8df4 + ld a, [wUpdateSpritesEnabled] + push af + xor a + ld [wUpdateSpritesEnabled], a + ld [hItemCounter], a + call Func_e8f24 + ld a, [rIE] + push af + xor a + ld [rIF], a + ld a, $09 + ld [rIE], a + call SaveScreenTilesToBuffer1 + xor a + ld [H_AUTOBGTRANSFERENABLED], a + call Func_e988a + call Func_e8783 + ld a, $10 + ld [$cae2], a + call Func_e8efc + call LoadScreenTilesFromBuffer1 + call Func_e8dfb + jr c, .asm_e8ddc + xor a + ld [wUnknownSerialFlag_d49a], a + ld [wUnknownSerialFlag_d49b], a + ld c, 12 + call DelayFrames + xor a + ld [H_AUTOBGTRANSFERENABLED], a + call Func_e98ec + call Func_e8783 + ld a, $00 + ld [$cae2], a + call Func_e8efc + call LoadScreenTilesFromBuffer1 + call Func_e8dfb + jr c, .asm_e8ddc + xor a + ld [wUnknownSerialFlag_d49a], a + ld [wUnknownSerialFlag_d49b], a + ld c, 12 + call DelayFrames + xor a + ld [H_AUTOBGTRANSFERENABLED], a + call Func_e9907 + call Func_e8783 + ld a, $00 + ld [$cae2], a + call Func_e8efc + call LoadScreenTilesFromBuffer1 + call Func_e8dfb + jr c, .asm_e8ddc + xor a + ld [wUnknownSerialFlag_d49a], a + ld [wUnknownSerialFlag_d49b], a + ld c, 12 + call DelayFrames + xor a + ld [H_AUTOBGTRANSFERENABLED], a + call Func_e9922 + call Func_e8783 + ld a, $03 + ld [$cae2], a + call Func_e8efc + call LoadScreenTilesFromBuffer1 + call Func_e8dfb +.asm_e8ddc + xor a + ld [wUnknownSerialFlag_d49a], a + ld [wUnknownSerialFlag_d49b], a + xor a + ld [rIF], a + pop af + ld [rIE], a + call Func_0f3d + call Func_e8f3b + pop af + ld [wUpdateSpritesEnabled], a + ret + +Func_e8df4: ; e8df4 + ld hl, String_e8e1f + call PrintText + ret + +Func_e8dfb: ; e8dfb + call Func_e8f16 +.asm_e8dfe + call JoypadLowSensitivity + call Func_e8eca + jr c, .asm_e8e1d + ld a, [wOverworldMap] + bit 7, a + jr nz, .asm_e8e1b + call Func_e87a8 + call Func_e8f51 + call Func_e8f82 + call DelayFrame + jr .asm_e8dfe + +.asm_e8e1b + and a + ret + +.asm_e8e1d + scf + ret + +String_e8e1f: ; e8e1f + TX_FAR _NoPokemonText + db "@" + +Func_e8e24: ; e8e24 + xor a + ld [hItemCounter], a + call Func_e8f24 + call Func_ea3ea + ld a, [rIE] + push af + xor a + ld [rIF], a + ld a, $09 + ld [rIE], a + call Func_e8783 + ld a, $13 + ld [$cae2], a + call Func_e8efc + call Func_e8f16 +.asm_e8e45 + call JoypadLowSensitivity + call Func_e8eca + jr c, .asm_e8e62 + ld a, [wOverworldMap] + bit 7, a + jr nz, .asm_e8e62 + call Func_e87a8 + call Func_e8f51 + call Func_e8f82 + call DelayFrame + jr .asm_e8e45 + +.asm_e8e62 + xor a + ld [wUnknownSerialFlag_d49a], a + ld [wUnknownSerialFlag_d49b], a + call Func_e8f09 + xor a + ld [rIF], a + pop af + ld [rIE], a + call Func_0f3d + call Func_e8f3b + ret diff --git a/engine/unknown_e8d35.asm b/engine/unknown_e8d35.asm deleted file mode 100755 index 7aeeff39..00000000 --- a/engine/unknown_e8d35.asm +++ /dev/null @@ -1,159 +0,0 @@ -Func_e8d35:: ; e8d35 (3a:4e79) - ld a, [wBoxDataStart] - and a - jp z, Func_e8df4 - ld a, [wUpdateSpritesEnabled] - push af - xor a - ld [wUpdateSpritesEnabled], a - ld [hItemCounter], a - call Func_e8f24 - ld a, [rIE] - push af - xor a - ld [rIF], a - ld a, $09 - ld [rIE], a - call SaveScreenTilesToBuffer1 - xor a - ld [H_AUTOBGTRANSFERENABLED], a - call Func_e988a - call Func_e8783 - ld a, $10 - ld [$cae2], a - call Func_e8efc - call LoadScreenTilesFromBuffer1 - call Func_e8dfb - jr c, .asm_e8ddc - xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a - ld c, 12 - call DelayFrames - xor a - ld [H_AUTOBGTRANSFERENABLED], a - call Func_e98ec - call Func_e8783 - ld a, $00 - ld [$cae2], a - call Func_e8efc - call LoadScreenTilesFromBuffer1 - call Func_e8dfb - jr c, .asm_e8ddc - xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a - ld c, 12 - call DelayFrames - xor a - ld [H_AUTOBGTRANSFERENABLED], a - call Func_e9907 - call Func_e8783 - ld a, $00 - ld [$cae2], a - call Func_e8efc - call LoadScreenTilesFromBuffer1 - call Func_e8dfb - jr c, .asm_e8ddc - xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a - ld c, 12 - call DelayFrames - xor a - ld [H_AUTOBGTRANSFERENABLED], a - call Func_e9922 - call Func_e8783 - ld a, $03 - ld [$cae2], a - call Func_e8efc - call LoadScreenTilesFromBuffer1 - call Func_e8dfb -.asm_e8ddc - xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a - xor a - ld [rIF], a - pop af - ld [rIE], a - call Func_0f3d - call Func_e8f3b - pop af - ld [wUpdateSpritesEnabled], a - ret - -Func_e8df4: ; e8df4 - ld hl, String_e8e1f - call PrintText - ret - -Func_e8dfb: ; e8dfb - call Func_e8f16 -.asm_e8dfe - call JoypadLowSensitivity - call Func_e8eca - jr c, .asm_e8e1d - ld a, [wOverworldMap] - bit 7, a - jr nz, .asm_e8e1b - call Func_e87a8 - call Func_e8f51 - call Func_e8f82 - call DelayFrame - jr .asm_e8dfe - -.asm_e8e1b - and a - ret - -.asm_e8e1d - scf - ret - -String_e8e1f: ; e8e1f - TX_FAR _NoPokemonText - db "@" - -Func_e8e24: ; e8e24 - xor a - ld [hItemCounter], a - call Func_e8f24 - call Func_ea3ea - ld a, [rIE] - push af - xor a - ld [rIF], a - ld a, $09 - ld [rIE], a - call Func_e8783 - ld a, $13 - ld [$cae2], a - call Func_e8efc - call Func_e8f16 -.asm_e8e45 - call JoypadLowSensitivity - call Func_e8eca - jr c, .asm_e8e62 - ld a, [wOverworldMap] - bit 7, a - jr nz, .asm_e8e62 - call Func_e87a8 - call Func_e8f51 - call Func_e8f82 - call DelayFrame - jr .asm_e8e45 - -.asm_e8e62 - xor a - ld [wUnknownSerialFlag_d49a], a - ld [wUnknownSerialFlag_d49b], a - call Func_e8f09 - xor a - ld [rIF], a - pop af - ld [rIE], a - call Func_0f3d - call Func_e8f3b - ret - diff --git a/main.asm b/main.asm index 0fe6f2fd..dd4555eb 100755 --- a/main.asm +++ b/main.asm @@ -877,17 +877,22 @@ SECTION "bank39",ROMX,BANK[$39] SECTION "bank3A",ROMX,BANK[$3A] INCLUDE "text/monster_names.asm" IsPlayerJustOutsideMap: ; e876c (3a:476c) - dr $e876c,$e8783 -Func_e8783: ; e8783 (3a:4783) - dr $e8783,$e87a8 -Func_e87a8: ; e87a8 (3a:47a8) - dr $e87a8,$e8a5e -Func_e8a5e: ; e8a5e (3a:4a5e) - dr $e8a5e,$e8b74 -Func_e8b74: ; e8b74 (3a:4b74) - dr $e8b74,$e8d35 - -INCLUDE "engine/unknown_e8d35.asm" + ld a, [wYCoord] + ld b, a + ld a, [wCurMapHeight] + call Func_e877e + ret z + ld a, [wXCoord] + ld b, a + ld a, [wCurMapWidth] +Func_e877e: + add a + cp b + ret z + inc b + ret + +INCLUDE "engine/printer.asm" Func_e8e79: ; e8e79 (3a:4e79) dr $e8e79,$e8eca -- cgit v1.3.1-sl0p From c74453452847a60126816b61ae71f230c6c1c5ae Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 23:30:24 -0400 Subject: Disassemble diploma in bank 3a --- engine/diploma_3a.asm | 137 ++++++++++++++++++++++++++++++++++++++++++++++ gfx/unknown_e9b3e.tilemap | 1 + gfx/unknown_e9bb6.tilemap | 2 + gfx/unknown_e9bc1.tilemap | 1 + main.asm | 5 +- 5 files changed, 144 insertions(+), 2 deletions(-) create mode 100755 engine/diploma_3a.asm create mode 100644 gfx/unknown_e9b3e.tilemap create mode 100644 gfx/unknown_e9bb6.tilemap create mode 100644 gfx/unknown_e9bc1.tilemap (limited to 'main.asm') diff --git a/engine/diploma_3a.asm b/engine/diploma_3a.asm new file mode 100755 index 00000000..20c4ba43 --- /dev/null +++ b/engine/diploma_3a.asm @@ -0,0 +1,137 @@ +_DisplayDiploma: ; e9a08 (3a:5a08) + call GBPalWhiteOutWithDelay3 + call ClearScreen + ld de, SurfingPikachu3Graphics + ld hl, vChars2 + lb bc, BANK(SurfingPikachu3Graphics), (SurfingPikachu3GraphicsEnd - SurfingPikachu3Graphics) / $10 + call CopyVideoData + + coord hl, 0, 0 + call Func_e9bdf + + coord hl, 0, 0 + call Func_e9beb + + coord hl, 19, 0 + call Func_e9beb + + ld a, $00 + coord hl, 0, 0 + ld [hl], a + coord hl, 19, 0 + ld [hl], a + + ld de, String_e9a73 + coord hl, 5, 2 + call PlaceString + + ld de, String_e9a7d + coord hl, 3, 4 + call PlaceString + + ld de, wPlayerName + coord hl, 10, 4 + call PlaceString + + ld de, String_e9a84 + coord hl, 2, 6 + call PlaceString + + ld de, String_e9ac8 + coord hl, 9, 16 + call PlaceString + + ld b, SET_PAL_GENERIC + call RunPaletteCommand + ld a, $01 + ld [$ffba], a + call Delay3 + call GBPalNormal + ret + +; e9a73 +String_e9a73: + db $10, "Diploma", $10, "@" + +String_e9a7d: + db "Player@" + +String_e9a84: + db "Congrats! This" + next "diploma certifies" + next "that you have" + next "completed your" + next "#DEX.@" + +String_e9ac8: + db "GAME FREAK@" + +Func_e9ad3: + call ClearScreen + coord hl, 0, 17 + call Func_e9bdf + coord hl, 0, 0 + call Func_e9beb + coord hl, 19, 0 + call Func_e9beb + ld a, $00 + coord hl, 0, 17 + ld [hl], a + coord hl, 19, 17 + ld [hl], a + ld de, Tilemap_e9b3e + coord hl, 6, 2 + lb bc, 10, 12 + call $525d ; Func_e925d + ld de, Tilemap_e9bb6 + coord hl, 5, 13 + lb bc, 1, 11 + call $525d ; Func_e925d + ld de, String_e9bd5 + coord hl, 2, 15 + call PlaceString + coord hl, 12, 15 + ld de, wPlayTimeHours + 1 + lb bc, $40 | 1, 3 + call PrintNumber + ld [hl], $16 + inc hl + ld de, wPlayTimeMinutes + 1 + lb bc, $80 | 1, 2 + call PrintNumber + ld a, [wNumSetBits] + cp 151 + ret nz + ld de, TileMap_e9bc1 + coord hl, 2, 0 + lb bc, 4, 5 + call $525d ; Func_e925d + ret + +Tilemap_e9b3e: INCBIN "gfx/unknown_e9b3e.tilemap" +Tilemap_e9bb6: INCBIN "gfx/unknown_e9bb6.tilemap" +TileMap_e9bc1: INCBIN "gfx/unknown_e9bc1.tilemap" +String_e9bd5: db "PLAY TIME@" + +Func_e9bdf: + ld c, 10 +.asm_e9be1 + ld [hl], $02 + inc hl + ld [hl], $01 + inc hl + dec c + jr nz, .asm_e9be1 + ret + +Func_e9beb: + ld c, 9 + ld de, SCREEN_WIDTH +.asm_e9bed + ld [hl], $04 + add hl, de + ld [hl], $03 + add hl, de + dec c + jr nz, .asm_e9bed + ret diff --git a/gfx/unknown_e9b3e.tilemap b/gfx/unknown_e9b3e.tilemap new file mode 100644 index 00000000..95386372 --- /dev/null +++ b/gfx/unknown_e9b3e.tilemap @@ -0,0 +1 @@ + !"#$%&'()*+,-./0123456789:;<=>?@ABC)DEFGHIJK))LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn \ No newline at end of file diff --git a/gfx/unknown_e9bb6.tilemap b/gfx/unknown_e9bb6.tilemap new file mode 100644 index 00000000..1fc3cd90 --- /dev/null +++ b/gfx/unknown_e9bb6.tilemap @@ -0,0 +1,2 @@ + +  \ No newline at end of file diff --git a/gfx/unknown_e9bc1.tilemap b/gfx/unknown_e9bc1.tilemap new file mode 100644 index 00000000..13521d1e --- /dev/null +++ b/gfx/unknown_e9bc1.tilemap @@ -0,0 +1 @@ +pqrstuvwx \ No newline at end of file diff --git a/main.asm b/main.asm index 9fdb091c..ec76673b 100755 --- a/main.asm +++ b/main.asm @@ -918,10 +918,11 @@ Func_e8f82: ; e8f82 (3a:4f82) dr $e8f82,$e928a SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" dr $e988a,$e9a08 -_DisplayDiploma: ; e9a08 (3a:5a08) - dr $e9a08,$e9bfa + +INCLUDE "engine/diploma_3a.asm" SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu_3.t1.2bpp" +SurfingPikachu3GraphicsEnd: INCLUDE "engine/unknown_ea3ea.asm" -- cgit v1.3.1-sl0p From 2f6075ece09988de1630874d3f2ddd0e1f6d74c3 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Sun, 22 May 2016 23:35:36 -0400 Subject: Resolve hard-coded calls --- engine/diploma_3a.asm | 6 +++--- engine/printer.asm | 14 +++++++------- main.asm | 15 +++++++++++++-- 3 files changed, 23 insertions(+), 12 deletions(-) (limited to 'main.asm') diff --git a/engine/diploma_3a.asm b/engine/diploma_3a.asm index 20c4ba43..471703d6 100755 --- a/engine/diploma_3a.asm +++ b/engine/diploma_3a.asm @@ -82,11 +82,11 @@ Func_e9ad3: ld de, Tilemap_e9b3e coord hl, 6, 2 lb bc, 10, 12 - call $525d ; Func_e925d + call Func_e925d ld de, Tilemap_e9bb6 coord hl, 5, 13 lb bc, 1, 11 - call $525d ; Func_e925d + call Func_e925d ld de, String_e9bd5 coord hl, 2, 15 call PlaceString @@ -105,7 +105,7 @@ Func_e9ad3: ld de, TileMap_e9bc1 coord hl, 2, 0 lb bc, 4, 5 - call $525d ; Func_e925d + call Func_e925d ret Tilemap_e9b3e: INCBIN "gfx/unknown_e9b3e.tilemap" diff --git a/engine/printer.asm b/engine/printer.asm index e91376ee..6218f6a7 100755 --- a/engine/printer.asm +++ b/engine/printer.asm @@ -731,7 +731,7 @@ Func_e8c5c: xor a ld [$ffdb], a call Func_e8f24 - call $510a ; Func_e910a + call Func_e910a ld a, [rIE] push af xor a @@ -773,7 +773,7 @@ Func_e8cb1: xor a ld [$ffdb], a call Func_e8f24 - call $5a08 ; Func_e9a08 + call _DisplayDiploma ld a, [rIE] push af xor a @@ -794,7 +794,7 @@ Func_e8cb1: call SaveScreenTilesToBuffer1 xor a ld [$ffba], a - call $5ad3 ; Func_e9ad3 + call Func_e9ad3 call Func_e8783 ld a, $03 ld [$cae2], a @@ -858,7 +858,7 @@ Func_e8d35:: ; e8d35 (3a:4e79) call SaveScreenTilesToBuffer1 xor a ld [H_AUTOBGTRANSFERENABLED], a - call $588a ; Func_e988a + call Func_e988a call Func_e8783 ld a, $10 ld [$cae2], a @@ -873,7 +873,7 @@ Func_e8d35:: ; e8d35 (3a:4e79) call DelayFrames xor a ld [H_AUTOBGTRANSFERENABLED], a - call $58ec ; Func_e98ec + call Func_e98ec call Func_e8783 ld a, $00 ld [$cae2], a @@ -888,7 +888,7 @@ Func_e8d35:: ; e8d35 (3a:4e79) call DelayFrames xor a ld [H_AUTOBGTRANSFERENABLED], a - call $5907 ; Func_e9907 + call Func_e9907 call Func_e8783 ld a, $00 ld [$cae2], a @@ -903,7 +903,7 @@ Func_e8d35:: ; e8d35 (3a:4e79) call DelayFrames xor a ld [H_AUTOBGTRANSFERENABLED], a - call $5922 ; Func_e9922 + call Func_e9922 call Func_e8783 ld a, $03 ld [$cae2], a diff --git a/main.asm b/main.asm index ec76673b..029142dc 100755 --- a/main.asm +++ b/main.asm @@ -915,9 +915,20 @@ Func_e8f3b: ; e8f3b (3a:4f3b) Func_e8f51: ; e8f51 (3a:4f51) dr $e8f51,$e8f82 Func_e8f82: ; e8f82 (3a:4f82) - dr $e8f82,$e928a + dr $e8f82,$e910a +Func_e910a: + dr $e910a,$e925d +Func_e925d: + dr $e925d,$e928a SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" - dr $e988a,$e9a08 +Func_e988a: + dr $e988a,$e98ec +Func_e98ec: + dr $e98ec,$e9907 +Func_e9907: + dr $e9907,$e9922 +Func_e9922: + dr $e9922,$e9a08 INCLUDE "engine/diploma_3a.asm" -- cgit v1.3.1-sl0p From 19b2fa8a825d30b8ba79d451f046cc593cf6a7f7 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Mon, 23 May 2016 08:12:08 -0400 Subject: Two functions at e925d --- main.asm | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'main.asm') diff --git a/main.asm b/main.asm index 029142dc..c47b6e47 100755 --- a/main.asm +++ b/main.asm @@ -918,8 +918,44 @@ Func_e8f82: ; e8f82 (3a:4f82) dr $e8f82,$e910a Func_e910a: dr $e910a,$e925d + Func_e925d: - dr $e925d,$e928a +.asm_e925d + push bc + push hl +.asm_e925f + ld a, [de] + inc de + ld [hli], a + dec c + jr nz, .asm_e925f + pop hl + ld bc, SCREEN_WIDTH + add hl, bc + pop bc + dec b + jr nz, .asm_e925d + ret + +Func_e926f: + ld de, wd496 + coord hl, 7, 6 + ld a, [de] + call Func_e927a + ld a, [de] +Func_e927a: + ld c, a + swap a + and $f + add -10 + ld [hli], a + ld a, c + and $f + add -10 + ld [hli], a + dec de + ret + SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" Func_e988a: dr $e988a,$e98ec -- cgit v1.3.1-sl0p From 311bbe9d24385d60084720027a78fbd88200e3ba Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Mon, 23 May 2016 08:24:30 -0400 Subject: A function related to printing boxes? --- main.asm | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) (limited to 'main.asm') diff --git a/main.asm b/main.asm index c47b6e47..02e2a69e 100755 --- a/main.asm +++ b/main.asm @@ -957,14 +957,63 @@ Func_e927a: ret SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" + Func_e988a: - dr $e988a,$e98ec + xor a + ld [wBoxNumString], a + call ClearScreen + call Func_e99de + coord hl, 0, 0 + ld bc, 11 * SCREEN_WIDTH + ld a, " " + call FillMemory + call Func_e99b9 + call Func_e99a7 + coord hl, 4, 4 + ld de, String_e98db + call PlaceString + coord hl, 7, 6 + ld de, String_e98e8 + call PlaceString + coord hl, 11, 6 + ld a, [wCurrentBoxNum] + and $7f + cp 9 + jr c, .asm_e98cc + sub 9 + ld [hl], "1" + inc hl + add "0" + jr .asm_e98ce + +.asm_e98cc + add "1" +.asm_e98ce + ld [hl], a + coord hl, 4, 9 + ld de, wBoxSpecies + ld c, $03 + call Func_e994e + ret + + +String_e98db: db "POKéMON LIST@" +String_e98e8: db "BOX@" + Func_e98ec: dr $e98ec,$e9907 Func_e9907: dr $e9907,$e9922 Func_e9922: - dr $e9922,$e9a08 + dr $e9922,$e994e +Func_e994e: + dr $e994e,$e99a7 +Func_e99a7: + dr $e99a7,$e99b9 +Func_e99b9: + dr $e99b9,$e99de +Func_e99de: + dr $e99de,$e9a08 INCLUDE "engine/diploma_3a.asm" -- cgit v1.3.1-sl0p From 1d761498e52755fa7b21840cc5c9cc24734f00cf Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Mon, 23 May 2016 13:34:38 -0400 Subject: More functions related to printing boxes --- main.asm | 177 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 164 insertions(+), 13 deletions(-) (limited to 'main.asm') diff --git a/main.asm b/main.asm index 02e2a69e..5cfa113f 100755 --- a/main.asm +++ b/main.asm @@ -40,7 +40,7 @@ INCLUDE "engine/cable_club.asm" INCLUDE "engine/menu/main_menu.asm" INCLUDE "engine/oak_speech.asm" INCLUDE "engine/overworld/special_warps.asm" - + INCLUDE "data/special_warps.asm" INCLUDE "engine/debug1.asm" @@ -66,7 +66,7 @@ INCLUDE "engine/battle/moveEffects/drain_hp_effect.asm" INCLUDE "engine/menu/players_pc.asm" INCLUDE "engine/remove_pokemon.asm" INCLUDE "engine/display_pokedex.asm" - + SECTION "bank03",ROMX,BANK[$03] INCLUDE "engine/joypad.asm" @@ -512,7 +512,7 @@ Func_2fd6a: ; 2fd6a (b:7d6a) ld a, $3 ld [wd431], a ret - + INCLUDE "engine/battle/scale_sprites.asm" INCLUDE "engine/game_corner_slots2.asm" @@ -651,7 +651,7 @@ TradingAnimationGraphics: INCBIN "gfx/game_boy.norepeat.2bpp" INCBIN "gfx/link_cable.2bpp" TradingAnimationGraphicsEnd: - + TradingAnimationGraphics2: ; Pokeball traveling through the link cable. INCBIN "gfx/trade2.2bpp" @@ -683,7 +683,7 @@ INCLUDE "engine/pokedex_rating.asm" dr $44251,$45077 LoadSpinnerArrowTiles: ; 45077 (11:5077) dr $45077,$46bf3 - + INCLUDE "engine/overworld/dungeon_warps.asm" SECTION "bank12",ROMX,BANK[$12] @@ -849,7 +849,7 @@ INCLUDE "engine/battle/animations.asm" INCLUDE "engine/overworld/cut2.asm" INCLUDE "engine/overworld/ssanne.asm" - + RedFishingTilesFront: INCBIN "gfx/red_fishing_tile_front.2bpp" RedFishingTilesBack: INCBIN "gfx/red_fishing_tile_back.2bpp" RedFishingTilesSide: INCBIN "gfx/red_fishing_tile_side.2bpp" @@ -1001,19 +1001,170 @@ String_e98db: db "POKéMON LIST@" String_e98e8: db "BOX@" Func_e98ec: - dr $e98ec,$e9907 + call ClearScreen + call Func_e99de + call Func_e99b9 + ld a, [wBoxDataStart] + cp 4 + ret c + coord hl, 4, 0 + ld de, wBoxSpecies + 3 + ld c, 6 + call Func_e994e + ret + Func_e9907: - dr $e9907,$e9922 + call ClearScreen + call Func_e99de + call Func_e99b9 + ld a, [wBoxDataStart] + cp 10 + ret c + coord hl, 4, 0 + ld de, wBoxSpecies + 9 + ld c, 6 + call Func_e994e + ret + Func_e9922: - dr $e9922,$e994e + call ClearScreen + call Func_e99de + call Func_e99b9 + coord hl, 0, 15 + call Func_e99cf + coord hl, 0, 16 + ld bc, 2 * SCREEN_WIDTH + ld a, " " + call FillMemory + ld a, [wBoxDataStart] + cp 16 + ret c + coord hl, 4, 0 + ld de, wBoxSpecies + 15 + ld c, 5 + call Func_e994e + ret + Func_e994e: - dr $e994e,$e99a7 +.asm_e994e + ld a, c + and a + jr z, .asm_e99a6 + dec c + ld a, [de] + cp $ff + jr z, .asm_e99a6 + ld [$d11d], a + push bc + push hl + push de + push hl + ld bc, 12 + ld a, " " + call FillMemory + pop hl + push hl + ld de, SCREEN_WIDTH + add hl, de + ld bc, 12 + ld a, " " + call FillMemory + pop hl + push hl + call GetMonName + pop hl + call PlaceString + push hl + ld hl, wBoxMonNicks + ld bc, NAME_LENGTH + ld a, [wBoxNumString] + call AddNTimes + ld e, l + ld d, h + pop hl + ld bc, SCREEN_WIDTH + 1 + add hl, bc + ld [hl], " " + inc hl + call PlaceString + ld hl, wBoxNumString + inc [hl] + pop de + pop hl + ld bc, 3 * SCREEN_WIDTH + add hl, bc + pop bc + inc de + jr .asm_e994e + +.asm_e99a6 + ret + Func_e99a7: - dr $e99a7,$e99b9 + coord hl, 0, 0 + ld a, $79 + ld [hli], a + ld a, $7a + ld c, SCREEN_WIDTH - 2 +.asm_e99b1 + ld [hli], a + dec c + jr nz, .asm_e99b1 + ld a, $7b + ld [hl], a + ret + Func_e99b9: - dr $e99b9,$e99de + coord hl, 0, 0 + ld de, SCREEN_WIDTH - 1 + ld c, SCREEN_HEIGHT +.asm_e99c1 + ld a, $7c + ld [hl], a + add hl, de + ld a, $7c + ld [hli], a + dec c + jr nz, .asm_e99c1 + ret + +Func_e99cc: + coord hl, 0, 17 +Func_e99cf: + ld a, $7d + ld [hli], a + ld a, $7a + ld c, SCREEN_WIDTH - 2 +.asm_e99b1 + ld [hli], a + dec c + jr nz, .asm_e99b1 + ld a, $7e + ld [hl], a + ret + Func_e99de: - dr $e99de,$e9a08 + coord hl, 4, 0 + ld c, 6 + call Func_e99eb + coord hl, 6, 1 + ld c, 6 +Func_e99eb: +.asm_e99eb + push bc + push hl + ld de, String_e99fd + call PlaceString + pop hl + ld bc, 3 * SCREEN_WIDTH + add hl, bc + pop bc + dec c + jr nz, .asm_e99eb + ret + +String_e99fd: + db "----------@" INCLUDE "engine/diploma_3a.asm" -- cgit v1.3.1-sl0p From 1579a084e70c73add5af8af0aaf40bee69f07275 Mon Sep 17 00:00:00 2001 From: pikalaxalt Date: Mon, 23 May 2016 14:04:13 -0400 Subject: Move all the printer functions out of main.asm, including the intermediate dr blocks --- engine/printer.asm | 343 +++++++++++++++++++++++++++++++++++++++++++++++++++++ main.asm | 269 ----------------------------------------- 2 files changed, 343 insertions(+), 269 deletions(-) (limited to 'main.asm') diff --git a/engine/printer.asm b/engine/printer.asm index 6218f6a7..7e6ae637 100755 --- a/engine/printer.asm +++ b/engine/printer.asm @@ -997,3 +997,346 @@ Func_e8e24: ; e8e24 call Func_0f3d call Func_e8f3b ret + +Func_e8e79: ; e8e79 (3a:4e79) + push af + push bc + push de + push hl + call StopAllMusic + ld a, [rIE] + push af + xor a + ld [rIF], a + ld a, $09 + ld [rIE], a + call Func_e8783 + ld a, $13 + ld [$cae2], a + ld a, $1 + ld [H_AUTOBGTRANSFERENABLED], a + call Func_e8efc + call Func_ea573 +.asm_e8e9c + ld a, [wOverworldMap] + bit 7, a + jr nz, .asm_e8eae + call Func_ea5d1 + call Func_ea5b7 + call DelayFrame + jr .asm_e8e9c + +.asm_e8eae + xor a + ld [wUnknownSerialFlag_d49a], a + ld [wUnknownSerialFlag_d49b], a + ld hl, wOAMBuffer + 32 * 4 + ld bc, $0020 + xor a + call FillMemory + xor a + ld [rIF], a + pop af + ld [rIE], a + pop hl + pop de + pop bc + pop af + ret + +Func_e8eca: ; e8eca (3a:4eca) + ld a, [hJoyHeld] + and B_BUTTON + jr nz, .asm_e8ed2 + and a + ret + +.asm_e8ed2 + ld a, [wOverworldMap] + cp $0c + jr nz, .asm_e8ef6 +.asm_e8ed9 + ld a, [wUnknownSerialFlag_d49b] + and a + jr nz, .asm_e8ed9 + ld a, $16 + ld [wUnknownSerialFlag_d49b], a + ld a, $88 + ld [rSB], a + ld a, $01 + ld [rSC], a + ld a, $81 + ld [rSC], a +.asm_e8ef0 + ld a, [wUnknownSerialFlag_d49b] + and a + jr nz, .asm_e8ef0 +.asm_e8ef6 + ld a, $01 + ld [hItemCounter], a + scf + ret + +Func_e8efc: ; e8efc (3a:4efc) + dr $e8efc,$e8f09 +Func_e8f09: ; e8f09 (3a:4f09) + dr $e8f09,$e8f16 +Func_e8f16: ; e8f16 (3a:4f16) + dr $e8f16,$e8f24 +Func_e8f24: ; e8f24 (3a:4f24) + dr $e8f24,$e8f3b +Func_e8f3b: ; e8f3b (3a:4f3b) + dr $e8f3b,$e8f51 +Func_e8f51: ; e8f51 (3a:4f51) + dr $e8f51,$e8f82 +Func_e8f82: ; e8f82 (3a:4f82) + dr $e8f82,$e910a +Func_e910a: + dr $e910a,$e925d + +Func_e925d: +.asm_e925d + push bc + push hl +.asm_e925f + ld a, [de] + inc de + ld [hli], a + dec c + jr nz, .asm_e925f + pop hl + ld bc, SCREEN_WIDTH + add hl, bc + pop bc + dec b + jr nz, .asm_e925d + ret + +Func_e926f: + ld de, wd496 + coord hl, 7, 6 + ld a, [de] + call Func_e927a + ld a, [de] +Func_e927a: + ld c, a + swap a + and $f + add -10 + ld [hli], a + ld a, c + and $f + add -10 + ld [hli], a + dec de + ret + +SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" + +Func_e988a: + xor a + ld [wBoxNumString], a + call ClearScreen + call Func_e99de + coord hl, 0, 0 + ld bc, 11 * SCREEN_WIDTH + ld a, " " + call FillMemory + call Func_e99b9 + call Func_e99a7 + coord hl, 4, 4 + ld de, String_e98db + call PlaceString + coord hl, 7, 6 + ld de, String_e98e8 + call PlaceString + coord hl, 11, 6 + ld a, [wCurrentBoxNum] + and $7f + cp 9 + jr c, .asm_e98cc + sub 9 + ld [hl], "1" + inc hl + add "0" + jr .asm_e98ce + +.asm_e98cc + add "1" +.asm_e98ce + ld [hl], a + coord hl, 4, 9 + ld de, wBoxSpecies + ld c, $03 + call Func_e994e + ret + + +String_e98db: db "POKéMON LIST@" +String_e98e8: db "BOX@" + +Func_e98ec: + call ClearScreen + call Func_e99de + call Func_e99b9 + ld a, [wBoxDataStart] + cp 4 + ret c + coord hl, 4, 0 + ld de, wBoxSpecies + 3 + ld c, 6 + call Func_e994e + ret + +Func_e9907: + call ClearScreen + call Func_e99de + call Func_e99b9 + ld a, [wBoxDataStart] + cp 10 + ret c + coord hl, 4, 0 + ld de, wBoxSpecies + 9 + ld c, 6 + call Func_e994e + ret + +Func_e9922: + call ClearScreen + call Func_e99de + call Func_e99b9 + coord hl, 0, 15 + call Func_e99cf + coord hl, 0, 16 + ld bc, 2 * SCREEN_WIDTH + ld a, " " + call FillMemory + ld a, [wBoxDataStart] + cp 16 + ret c + coord hl, 4, 0 + ld de, wBoxSpecies + 15 + ld c, 5 + call Func_e994e + ret + +Func_e994e: +.asm_e994e + ld a, c + and a + jr z, .asm_e99a6 + dec c + ld a, [de] + cp $ff + jr z, .asm_e99a6 + ld [$d11d], a + push bc + push hl + push de + push hl + ld bc, 12 + ld a, " " + call FillMemory + pop hl + push hl + ld de, SCREEN_WIDTH + add hl, de + ld bc, 12 + ld a, " " + call FillMemory + pop hl + push hl + call GetMonName + pop hl + call PlaceString + push hl + ld hl, wBoxMonNicks + ld bc, NAME_LENGTH + ld a, [wBoxNumString] + call AddNTimes + ld e, l + ld d, h + pop hl + ld bc, SCREEN_WIDTH + 1 + add hl, bc + ld [hl], " " + inc hl + call PlaceString + ld hl, wBoxNumString + inc [hl] + pop de + pop hl + ld bc, 3 * SCREEN_WIDTH + add hl, bc + pop bc + inc de + jr .asm_e994e + +.asm_e99a6 + ret + +Func_e99a7: + coord hl, 0, 0 + ld a, $79 + ld [hli], a + ld a, $7a + ld c, SCREEN_WIDTH - 2 +.asm_e99b1 + ld [hli], a + dec c + jr nz, .asm_e99b1 + ld a, $7b + ld [hl], a + ret + +Func_e99b9: + coord hl, 0, 0 + ld de, SCREEN_WIDTH - 1 + ld c, SCREEN_HEIGHT +.asm_e99c1 + ld a, $7c + ld [hl], a + add hl, de + ld a, $7c + ld [hli], a + dec c + jr nz, .asm_e99c1 + ret + +Func_e99cc: + coord hl, 0, 17 +Func_e99cf: + ld a, $7d + ld [hli], a + ld a, $7a + ld c, SCREEN_WIDTH - 2 +.asm_e99b1 + ld [hli], a + dec c + jr nz, .asm_e99b1 + ld a, $7e + ld [hl], a + ret + +Func_e99de: + coord hl, 4, 0 + ld c, 6 + call Func_e99eb + coord hl, 6, 1 + ld c, 6 +Func_e99eb: +.asm_e99eb + push bc + push hl + ld de, String_e99fd + call PlaceString + pop hl + ld bc, 3 * SCREEN_WIDTH + add hl, bc + pop bc + dec c + jr nz, .asm_e99eb + ret + +String_e99fd: + db "----------@" diff --git a/main.asm b/main.asm index 5cfa113f..08b0df82 100755 --- a/main.asm +++ b/main.asm @@ -897,275 +897,6 @@ Func_e877e: ret INCLUDE "engine/printer.asm" - -Func_e8e79: ; e8e79 (3a:4e79) - dr $e8e79,$e8eca -Func_e8eca: ; e8eca (3a:4eca) - dr $e8eca,$e8efc -Func_e8efc: ; e8efc (3a:4efc) - dr $e8efc,$e8f09 -Func_e8f09: ; e8f09 (3a:4f09) - dr $e8f09,$e8f16 -Func_e8f16: ; e8f16 (3a:4f16) - dr $e8f16,$e8f24 -Func_e8f24: ; e8f24 (3a:4f24) - dr $e8f24,$e8f3b -Func_e8f3b: ; e8f3b (3a:4f3b) - dr $e8f3b,$e8f51 -Func_e8f51: ; e8f51 (3a:4f51) - dr $e8f51,$e8f82 -Func_e8f82: ; e8f82 (3a:4f82) - dr $e8f82,$e910a -Func_e910a: - dr $e910a,$e925d - -Func_e925d: -.asm_e925d - push bc - push hl -.asm_e925f - ld a, [de] - inc de - ld [hli], a - dec c - jr nz, .asm_e925f - pop hl - ld bc, SCREEN_WIDTH - add hl, bc - pop bc - dec b - jr nz, .asm_e925d - ret - -Func_e926f: - ld de, wd496 - coord hl, 7, 6 - ld a, [de] - call Func_e927a - ld a, [de] -Func_e927a: - ld c, a - swap a - and $f - add -10 - ld [hli], a - ld a, c - and $f - add -10 - ld [hli], a - dec de - ret - -SurfingPikachu2Graphics: INCBIN "gfx/surfing_pikachu_2.2bpp" - -Func_e988a: - xor a - ld [wBoxNumString], a - call ClearScreen - call Func_e99de - coord hl, 0, 0 - ld bc, 11 * SCREEN_WIDTH - ld a, " " - call FillMemory - call Func_e99b9 - call Func_e99a7 - coord hl, 4, 4 - ld de, String_e98db - call PlaceString - coord hl, 7, 6 - ld de, String_e98e8 - call PlaceString - coord hl, 11, 6 - ld a, [wCurrentBoxNum] - and $7f - cp 9 - jr c, .asm_e98cc - sub 9 - ld [hl], "1" - inc hl - add "0" - jr .asm_e98ce - -.asm_e98cc - add "1" -.asm_e98ce - ld [hl], a - coord hl, 4, 9 - ld de, wBoxSpecies - ld c, $03 - call Func_e994e - ret - - -String_e98db: db "POKéMON LIST@" -String_e98e8: db "BOX@" - -Func_e98ec: - call ClearScreen - call Func_e99de - call Func_e99b9 - ld a, [wBoxDataStart] - cp 4 - ret c - coord hl, 4, 0 - ld de, wBoxSpecies + 3 - ld c, 6 - call Func_e994e - ret - -Func_e9907: - call ClearScreen - call Func_e99de - call Func_e99b9 - ld a, [wBoxDataStart] - cp 10 - ret c - coord hl, 4, 0 - ld de, wBoxSpecies + 9 - ld c, 6 - call Func_e994e - ret - -Func_e9922: - call ClearScreen - call Func_e99de - call Func_e99b9 - coord hl, 0, 15 - call Func_e99cf - coord hl, 0, 16 - ld bc, 2 * SCREEN_WIDTH - ld a, " " - call FillMemory - ld a, [wBoxDataStart] - cp 16 - ret c - coord hl, 4, 0 - ld de, wBoxSpecies + 15 - ld c, 5 - call Func_e994e - ret - -Func_e994e: -.asm_e994e - ld a, c - and a - jr z, .asm_e99a6 - dec c - ld a, [de] - cp $ff - jr z, .asm_e99a6 - ld [$d11d], a - push bc - push hl - push de - push hl - ld bc, 12 - ld a, " " - call FillMemory - pop hl - push hl - ld de, SCREEN_WIDTH - add hl, de - ld bc, 12 - ld a, " " - call FillMemory - pop hl - push hl - call GetMonName - pop hl - call PlaceString - push hl - ld hl, wBoxMonNicks - ld bc, NAME_LENGTH - ld a, [wBoxNumString] - call AddNTimes - ld e, l - ld d, h - pop hl - ld bc, SCREEN_WIDTH + 1 - add hl, bc - ld [hl], " " - inc hl - call PlaceString - ld hl, wBoxNumString - inc [hl] - pop de - pop hl - ld bc, 3 * SCREEN_WIDTH - add hl, bc - pop bc - inc de - jr .asm_e994e - -.asm_e99a6 - ret - -Func_e99a7: - coord hl, 0, 0 - ld a, $79 - ld [hli], a - ld a, $7a - ld c, SCREEN_WIDTH - 2 -.asm_e99b1 - ld [hli], a - dec c - jr nz, .asm_e99b1 - ld a, $7b - ld [hl], a - ret - -Func_e99b9: - coord hl, 0, 0 - ld de, SCREEN_WIDTH - 1 - ld c, SCREEN_HEIGHT -.asm_e99c1 - ld a, $7c - ld [hl], a - add hl, de - ld a, $7c - ld [hli], a - dec c - jr nz, .asm_e99c1 - ret - -Func_e99cc: - coord hl, 0, 17 -Func_e99cf: - ld a, $7d - ld [hli], a - ld a, $7a - ld c, SCREEN_WIDTH - 2 -.asm_e99b1 - ld [hli], a - dec c - jr nz, .asm_e99b1 - ld a, $7e - ld [hl], a - ret - -Func_e99de: - coord hl, 4, 0 - ld c, 6 - call Func_e99eb - coord hl, 6, 1 - ld c, 6 -Func_e99eb: -.asm_e99eb - push bc - push hl - ld de, String_e99fd - call PlaceString - pop hl - ld bc, 3 * SCREEN_WIDTH - add hl, bc - pop bc - dec c - jr nz, .asm_e99eb - ret - -String_e99fd: - db "----------@" - INCLUDE "engine/diploma_3a.asm" SurfingPikachu3Graphics: INCBIN "gfx/surfing_pikachu_3.t1.2bpp" -- cgit v1.3.1-sl0p