This commit is contained in:
PikalaxALT 2016-01-10 17:44:09 -05:00
parent 8360a1a2e8
commit 3dcbe0ff55
21 changed files with 1455 additions and 1318 deletions

View File

@ -4142,7 +4142,7 @@ GetEnemyMonDVs: ; 3da97
ld a, [EnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
ret z
ld hl, wc6f2
ld hl, wEnemyBackupDVs
ld a, [wBattleMode]
dec a
ret z
@ -5009,7 +5009,7 @@ DrawEnemyHUD: ; 3e043
ld a, [EnemySubStatus5]
bit SUBSTATUS_TRANSFORMED, a
jr z, .ok
ld hl, wc6f2
ld hl, wEnemyBackupDVs
.ok
ld a, [hli]
ld [de], a
@ -6336,7 +6336,7 @@ LoadEnemyMon: ; 3e8eb
jr z, .InitDVs
; Unknown
ld hl, wc6f2
ld hl, wEnemyBackupDVs
ld de, EnemyMonDVs
ld a, [hli]
ld [de], a

View File

@ -477,14 +477,14 @@ MAX_OUTDOOR_SPRITES EQU 23
const SPRITE_ANIM_INDEX_02
const SPRITE_ANIM_INDEX_GAMEFREAK_LOGO
const SPRITE_ANIM_INDEX_04
const SPRITE_ANIM_INDEX_05
const SPRITE_ANIM_INDEX_NAMING_SCREEN_CURSOR
const SPRITE_ANIM_INDEX_SLOT_GOLEM
const SPRITE_ANIM_INDEX_SLOTS_CHANSEY
const SPRITE_ANIM_INDEX_SLOTS_EGG
const SPRITE_ANIM_INDEX_09
const SPRITE_ANIM_INDEX_RED_WALK
const SPRITE_ANIM_INDEX_0B
const SPRITE_ANIM_INDEX_0C
const SPRITE_ANIM_INDEX_COMPOSE_MAIL_CURSOR
const SPRITE_ANIM_INDEX_0D
const SPRITE_ANIM_INDEX_0E
const SPRITE_ANIM_INDEX_0F

View File

@ -109,7 +109,7 @@ endr
.spawn_object
depixel 6, 3, 4, 4
ld a, SPRITE_ANIM_INDEX_0C
ld a, SPRITE_ANIM_INDEX_COMPOSE_MAIL_CURSOR
call _InitSpriteAnimStruct
ld a, 5
ld [wDummyGameNumberTriesRemaining], a

View File

@ -19,7 +19,7 @@ HealMachineAnim: ; 12324
.DoJumptableFunctions: ; 1233e
xor a
ld [wd1ec], a
ld [Buffer3], a
.jumpable_loop
ld a, [Buffer1]
ld e, a
@ -31,10 +31,10 @@ endr
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [wd1ec]
ld a, [Buffer3]
ld e, a
inc a
ld [wd1ec], a
ld [Buffer3], a
add hl, de
ld a, [hl]
cp 5
@ -81,14 +81,14 @@ endr
.PC_LoadBallsOntoMachine: ; 12393
ld hl, Sprites + $80
ld de, .PC_ElmsLab_TileMap
ld de, .PC_ElmsLab_OAM
call .PlaceHealingMachineTile
call .PlaceHealingMachineTile
jr .LoadBallsOntoMachine
.HOF_LoadBallsOntoMachine: ; 123a1
ld hl, Sprites + $80
ld de, .HOF_TileMap
ld de, .HOF_OAM
.LoadBallsOntoMachine: ; 123a7
ld a, [PartyCount]
@ -126,28 +126,28 @@ endr
ret
; 123dc
.PC_ElmsLab_TileMap: ; 123dc
db $20, $22, $7c, $16
db $20, $26, $7c, $16
db $26, $20, $7d, $16
db $26, $28, $7d, $36
db $2b, $20, $7d, $16
db $2b, $28, $7d, $36
db $30, $20, $7d, $16
db $30, $28, $7d, $36
.PC_ElmsLab_OAM: ; 123dc
dsprite 4, 0, 4, 2, $7c, $16
dsprite 4, 0, 4, 6, $7c, $16
dsprite 4, 6, 4, 0, $7d, $16
dsprite 4, 6, 5, 0, $7d, $36 ; xflip
dsprite 5, 3, 4, 0, $7d, $16
dsprite 5, 3, 5, 0, $7d, $36 ; xflip
dsprite 6, 0, 4, 0, $7d, $16
dsprite 6, 0, 5, 0, $7d, $36 ; xflip
; 123fc
.HealMachineGFX: ; 123fc
INCBIN "gfx/unknown/0123fc.2bpp"
; 1241c
.HOF_TileMap: ; 1241c
db $3c, $51, $7d, $16
db $3c, $56, $7d, $16
db $3b, $4d, $7d, $16
db $3b, $5a, $7d, $16
db $39, $49, $7d, $16
db $39, $5d, $7d, $16
.HOF_OAM: ; 1241c
dsprite 7, 4, 10, 1, $7d, $16
dsprite 7, 4, 10, 6, $7d, $16
dsprite 7, 3, 9, 5, $7d, $16
dsprite 7, 3, 11, 2, $7d, $16
dsprite 7, 1, 9, 1, $7d, $16
dsprite 7, 1, 11, 5, $7d, $16
; 12434
.LoadPalettes: ; 12434
@ -241,10 +241,10 @@ endr
.PlaceHealingMachineTile: ; 124a3
push bc
ld a, [Buffer1]
lb bc, $10, $20
bcpixel 2, 4
cp $1 ; ElmsLab
jr z, .okay
lb bc, $00, $00
bcpixel 0, 0
.okay
ld a, [de]

View File

@ -11,7 +11,7 @@ PokeGear: ; 90b8d (24:4b8d)
push af
xor a
ld [VramState], a
call Function90bea
call .InitTilemap
call DelayFrame
.loop
call UpdateTime
@ -41,10 +41,10 @@ PokeGear: ; 90b8d (24:4b8d)
ld [hBGMapAddress + 1], a
ld a, $90
ld [hWY], a
call Function91492
call ExitPokegearRadio_HandleMusic
ret
Function90bea: ; 90bea (24:4bea)
.InitTilemap: ; 90bea (24:4bea)
call ClearBGPalettes
call ClearTileMap
call ClearSprites
@ -54,14 +54,14 @@ Function90bea: ; 90bea (24:4bea)
ld [hSCX], a
ld a, $7
ld [hWX], a
call Function90c4e
call Pokegear_LoadGFX
callba ClearSpriteAnims
call InitPokegearModeIndicatorArrow
ld a, 8
call SkipMusic
ld a, $e3
ld [rLCDC], a
call Function90d70
call TownMap_InitCursorAndPlayerIconPositions
xor a
ld [wJumptableIndex], a
ld [wcf64], a
@ -85,7 +85,7 @@ Function90bea: ; 90bea (24:4bea)
call DmgToCgbObjPal0
ret
Function90c4e: ; 90c4e
Pokegear_LoadGFX: ; 90c4e
call ClearVBank1
ld hl, TownMapGFX
ld de, VTiles2
@ -148,25 +148,25 @@ InitPokegearModeIndicatorArrow: ; 90d32 (24:4d32)
ld [hl], $0
ret
Function90d41: ; 90d41 (24:4d41)
AnimatePokegearModeIndicatorArrow: ; 90d41 (24:4d41)
ld hl, wcf64
ld e, [hl]
ld d, 0
ld hl, Unknown_90d52
ld hl, .XCoords
add hl, de
ld a, [hl]
ld hl, $6
ld hl, SPRITEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
ret
; 90d52 (24:4d52)
Unknown_90d52: ; 90d52
.XCoords: ; 90d52
db $00, $10, $20, $30
; 90d56
Function90d56: ; 90d56
TownMap_GetCurrentLandmark: ; 90d56
ld a, [MapGroup]
ld b, a
ld a, [MapNumber]
@ -183,7 +183,7 @@ Function90d56: ; 90d56
; 90d70
Function90d70: ; 90d70 (24:4d70)
TownMap_InitCursorAndPlayerIconPositions: ; 90d70 (24:4d70)
ld a, [MapGroup]
ld b, a
ld a, [MapNumber]
@ -238,7 +238,7 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
jp [hl]
.return_from_jumptable
call Function90eb0
call Pokegear_FinishTilemap
callba TownMapPals
ld a, [wcf65]
and a
@ -269,12 +269,12 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
.UpdateBGMap: ; 90e00 (24:4e00)
ld a, [hCGB]
and a
jr z, .asm_90e0e
jr z, .dmg
ld a, $2
ld [hBGMapMode], a
ld c, 3
call DelayFrames
.asm_90e0e
.dmg
call WaitBGMap
ret
@ -329,7 +329,7 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
hlcoord 19, 2
ld [hl], $17
ld a, [wTownMapCursorLandmark]
call Function910b4
call PokegearMap_UpdateLandmarkName
ret
; 90e72
@ -350,13 +350,13 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
hlcoord 0, 12
lb bc, 4, 18
call TextBox
call Function90e98
call .PlacePhoneBars
call PokegearPhone_UpdateDisplayList
ret
; 90e98
Function90e98: ; 90e98 (24:4e98)
.PlacePhoneBars: ; 90e98 (24:4e98)
hlcoord 17, 1
ld a, $3c
ld [hli], a
@ -372,7 +372,7 @@ Function90e98: ; 90e98 (24:4e98)
ld [hl], $3f
ret
Function90eb0: ; 90eb0 (24:4eb0)
Pokegear_FinishTilemap: ; 90eb0 (24:4eb0)
hlcoord 0, 0
ld bc, $8
ld a, $4f
@ -384,32 +384,32 @@ Function90eb0: ; 90eb0 (24:4eb0)
ld de, wPokegearFlags
ld a, [de]
bit 0, a
call nz, Function90ee4
call nz, .PlaceMapIcon
ld a, [de]
bit 2, a
call nz, Function90eeb
call nz, .PlacePhoneIcon
ld a, [de]
bit 1, a
call nz, Function90ef2
call nz, .PlaceRadioIcon
hlcoord 0, 0
ld a, $46
call Function90ef7
call .PlacePokegearCardIcon
ret
Function90ee4: ; 90ee4 (24:4ee4)
.PlaceMapIcon: ; 90ee4 (24:4ee4)
hlcoord 2, 0
ld a, $40
jr Function90ef7
jr .PlacePokegearCardIcon
Function90eeb: ; 90eeb (24:4eeb)
.PlacePhoneIcon: ; 90eeb (24:4eeb)
hlcoord 4, 0
ld a, $44
jr Function90ef7
jr .PlacePokegearCardIcon
Function90ef2: ; 90ef2 (24:4ef2)
.PlaceRadioIcon: ; 90ef2 (24:4ef2)
hlcoord 6, 0
ld a, $42
Function90ef7: ; 90ef7 (24:4ef7)
.PlacePokegearCardIcon: ; 90ef7 (24:4ef7)
ld [hli], a
inc a
ld [hld], a
@ -454,7 +454,7 @@ PokegearClock_Init: ; 90f2d (24:4f2d)
call PrintText
ld hl, wJumptableIndex
inc [hl]
call Function91492
call ExitPokegearRadio_HandleMusic
ret
PokegearClock_Joypad: ; 90f3e (24:4f3e)
@ -544,7 +544,7 @@ PokegearMap_CheckRegion: ; 90fb4 (24:4fb4)
ld a, 5
.done
ld [wJumptableIndex], a
call Function91492
call ExitPokegearRadio_HandleMusic
ret
PokegearMap_Init: ; 90fcd (24:4fcd)
@ -644,13 +644,13 @@ PokegearMap_ContinueMap: ; 90ff2 (24:4ff2)
dec [hl]
.done_dpad
ld a, [wTownMapCursorLandmark]
call Function910b4
call PokegearMap_UpdateLandmarkName
ld a, [wPokegearMapCursorObjectPointer]
ld c, a
ld a, [wPokegearMapCursorObjectPointer + 1]
ld b, a
ld a, [wTownMapCursorLandmark]
call Function910d4
call PokegearMap_UpdateCursorPosition
ret
PokegearMap_InitPlayerIcon: ; 9106a
@ -695,13 +695,13 @@ PokegearMap_InitCursor: ; 91098
ld [hl], SPRITE_ANIM_SEQ_NULL
pop af
push bc
call Function910d4
call PokegearMap_UpdateCursorPosition
pop bc
ret
; 910b4
Function910b4: ; 910b4
PokegearMap_UpdateLandmarkName: ; 910b4
push af
hlcoord 8, 0
lb bc, 2, 12
@ -718,7 +718,7 @@ Function910b4: ; 910b4
; 910d4
Function910d4: ; 910d4
PokegearMap_UpdateCursorPosition: ; 910d4
push bc
ld e, a
callba GetLandmarkCoords
@ -782,23 +782,23 @@ PokegearRadio_Joypad: ; 91112 (24:5112)
.left
ld a, [wPokegearFlags]
bit 2, a
jr z, .asm_9113b
jr z, .no_phone
ld c, $7
ld b, $2
jr .asm_9114c
jr .switch_page
.asm_9113b
.no_phone
ld a, [wPokegearFlags]
bit 0, a
jr z, .asm_91148
jr z, .no_map
ld c, $2
ld b, $1
jr .asm_9114c
jr .switch_page
.asm_91148
.no_map
ld c, $0
ld b, $0
.asm_9114c
.switch_page
call Pokegear_SwitchPage
ret
@ -815,7 +815,7 @@ PokegearPhone_Init: ; 91156 (24:5156)
ld [wPokegearPhoneCursorPosition], a
ld [wPokegearPhoneSelectedPerson], a
call InitPokegearTilemap
call Function91492
call ExitPokegearRadio_HandleMusic
ld hl, PokegearText_WhomToCall
call PrintText
ret
@ -841,15 +841,15 @@ PokegearPhone_Joypad: ; 91171 (24:5171)
.left
ld a, [wPokegearFlags]
bit 0, a
jr z, .asm_9119c
jr z, .no_map
ld c, $2
ld b, $1
jr .asm_911ac
jr .switch_page
.asm_9119c
.no_map
ld c, $0
ld b, $0
jr .asm_911ac
jr .switch_page
.right
ld a, [wPokegearFlags]
@ -857,7 +857,7 @@ PokegearPhone_Joypad: ; 91171 (24:5171)
ret z
ld c, $b
ld b, $3
.asm_911ac
.switch_page
call Pokegear_SwitchPage
ret
@ -886,12 +886,12 @@ PokegearPhone_Joypad: ; 91171 (24:5171)
call AddNTimes
ld [hl], "▷"
call PokegearPhoneContactSubmenu
jr c, .asm_911e5
jr c, .quit_submenu
ld hl, wJumptableIndex
inc [hl]
ret
.asm_911e5
.quit_submenu
ld a, $8
ld [wJumptableIndex], a
ret
@ -899,19 +899,19 @@ PokegearPhone_Joypad: ; 91171 (24:5171)
PokegearPhone_MakePhoneCall: ; 911eb (24:51eb)
call GetMapHeaderPhoneServiceNybble
and a
jr nz, .asm_91234
jr nz, .no_service
ld hl, Options
res NO_TEXT_SCROLL, [hl]
xor a
ld [hInMenu], a
ld de, SFX_CALL
call PlaySFX
ld hl, UnknownText_0x9124c
ld hl, .dotdotdot
call PrintText
call WaitSFX
ld de, SFX_CALL
call PlaySFX
ld hl, UnknownText_0x9124c
ld hl, .dotdotdot
call PrintText
call WaitSFX
ld a, [wPokegearPhoneSelectedPerson]
@ -928,9 +928,9 @@ PokegearPhone_MakePhoneCall: ; 911eb (24:51eb)
inc [hl]
ret
.asm_91234
.no_service
callba Phone_NoSignal
ld hl, OutOfServiceAreaText
ld hl, .OutOfServiceArea
call PrintText
ld a, $8
ld [wJumptableIndex], a
@ -940,14 +940,14 @@ PokegearPhone_MakePhoneCall: ; 911eb (24:51eb)
; 9124c (24:524c)
UnknownText_0x9124c: ; 0x9124c
.dotdotdot: ; 0x9124c
;
text_jump UnknownText_0x1c5824
db "@"
; 0x91251
OutOfServiceAreaText: ; 0x91251
.OutOfServiceArea: ; 0x91251
; You're out of the service area.
text_jump UnknownText_0x1c5827
db "@"
@ -1336,17 +1336,17 @@ Pokegear_SwitchPage: ; 91480 (24:5480)
call DeleteSpriteAnimStruct2ToEnd
ret
Function91492: ; 91492
ExitPokegearRadio_HandleMusic: ; 91492
ld a, [wPokegearRadioMusicPlaying]
cp $fe
jr z, .asm_914a3
jr z, .restart_map_music
cp $ff
call z, EnterMapMusic
xor a
ld [wPokegearRadioMusicPlaying], a
ret
.asm_914a3
.restart_map_music
call RestartMapMusic
xor a
ld [wPokegearRadioMusicPlaying], a
@ -1364,8 +1364,10 @@ DeleteSpriteAnimStruct2ToEnd: ; 914ab (24:54ab)
ret
Pokegear_LoadTilemapRLE: ; 914bb (24:54bb)
; Format: repeat count, tile ID
; Terminated with $FF
hlcoord 0, 0
.row
.loop
ld a, [de]
cp $ff
ret z
@ -1375,11 +1377,11 @@ Pokegear_LoadTilemapRLE: ; 914bb (24:54bb)
ld c, a
inc de
ld a, b
.col
.load
ld [hli], a
dec c
jr nz, .col
jr .row
jr nz, .load
jr .loop
; 914ce (24:54ce)
@ -1409,11 +1411,11 @@ INCBIN "gfx/misc/pokegear_sprites.2bpp.lz"
; 9150d
RadioTilemapRLE: ; 9150d
INCBIN "gfx/unknown/09150d.tilemap.rle"
INCBIN "gfx/pokegear/radio.tilemap.rle"
PhoneTilemapRLE: ; 9158a
INCBIN "gfx/unknown/09158a.tilemap.rle"
INCBIN "gfx/pokegear/phone.tilemap.rle"
ClockTilemapRLE: ; 915db
INCBIN "gfx/unknown/0915db.tilemap.rle"
INCBIN "gfx/pokegear/clock.tilemap.rle"
; 9163e
_UpdateRadioStation: ; 9163e (24:563e)
@ -1498,7 +1500,7 @@ UpdateRadioStation: ; 9166f (24:566f)
; 916a1 (24:56a1)
Function916a1: ; 916a1
; XXX
ld [wPokegearRadioChannelBank], a
ld a, [hli]
ld [wPokegearRadioChannelAddr], a
@ -1846,13 +1848,13 @@ _TownMap: ; 9191c
call ClearTileMap
call ClearSprites
call DisableLCD
call Function90c4e
call Pokegear_LoadGFX
callba ClearSpriteAnims
ld a, 8
call SkipMusic
ld a, $e3
ld [rLCDC], a
call Function90d56
call TownMap_GetCurrentLandmark
ld [wd002], a
ld [wd003], a
xor a
@ -1950,13 +1952,13 @@ _TownMap: ; 9191c
.next
push de
ld a, [wd003]
call Function910b4
call PokegearMap_UpdateLandmarkName
ld a, [wd004]
ld c, a
ld a, [wd005]
ld b, a
ld a, [wd003]
call Function910d4
call PokegearMap_UpdateCursorPosition
pop de
jr .loop2
; 91a04
@ -1964,14 +1966,13 @@ _TownMap: ; 9191c
.InitTilemap: ; 91a04
ld a, [wd002]
cp KANTO_LANDMARK
jr nc, .kanto
jr nc, .kanto2
ld e, $0
jr .okay
jr .okay_tilemap
.kanto
.kanto2
ld e, $1
.okay
.okay_tilemap
callba PokegearMap
ld a, $7
ld bc, 6
@ -1992,7 +1993,7 @@ _TownMap: ; 9191c
hlcoord 19, 2
ld [hl], $17
ld a, [wd003]
call Function910b4
call PokegearMap_UpdateLandmarkName
callba TownMapPals
ret
; 91a53
@ -2025,7 +2026,7 @@ PlayRadio: ; 91a53
.stop
pop af
ld [Options], a
call Function91492
call ExitPokegearRadio_HandleMusic
ret
; 91a87
@ -2687,7 +2688,7 @@ _Area: ; 91d11
.ShowPlayerLoop
ld a, [de]
cp $80
jr z, .copy
jr z, .clear_oam
add b
ld [hli], a
inc de
@ -2711,9 +2712,9 @@ _Area: ; 91d11
pop bc
jr .ShowPlayerLoop
.copy
ld hl, Sprites + $10
ld bc, SpritesEnd - (Sprites + $10)
.clear_oam
ld hl, Sprites + 4 * 4
ld bc, SpritesEnd - (Sprites + 4 * 4)
xor a
call ByteFill
ret
@ -2980,8 +2981,8 @@ PokedexNestIconGFX: ; 922d1
INCBIN "gfx/pokegear/dexmap_nest_icon.2bpp"
FlyMapLabelBorderGFX: ; 922e1
INCBIN "gfx/pokegear/flymap_label_border.2bpp"
Function92311: ; 92311
; unreferenced
; XXX
xor a
ld [wd002], a
call ClearBGPalettes
@ -3034,7 +3035,7 @@ Function92311: ; 92311
.pressedB
ld a, -1
jr .asm_9239f
jr .finished_a_b
.pressedA
ld a, [wd002]
@ -3044,7 +3045,7 @@ Function92311: ; 92311
ld de, Flypoints + 1
add hl, de
ld a, [hl]
.asm_9239f
.finished_a_b
ld [wd002], a
pop af
ld [hInMenu], a

219
engine/prof_oaks_pc.asm Executable file
View File

@ -0,0 +1,219 @@
ProfOaksPC: ; 0x265d3
ld hl, OakPCText1
call MenuTextBox
call YesNoBox
jr c, .shutdown
call ProfOaksPCBoot ; player chose "yes"?
.shutdown
ld hl, OakPCText4
call PrintText
call JoyWaitAorB
call ExitMenu
ret
ProfOaksPCBoot ; 0x265ee
ld hl, OakPCText2
call PrintText
call Rate
call PlaySFX ; sfx loaded by previous Rate function call
call JoyWaitAorB
call WaitSFX
ret
ProfOaksPCRating: ; 0x26601
call Rate
push de
ld de, MUSIC_NONE
call PlayMusic
pop de
call PlaySFX
call JoyWaitAorB
call WaitSFX
ret
Rate: ; 0x26616
; calculate Seen/Owned
ld hl, PokedexSeen
ld b, EndPokedexSeen - PokedexSeen
call CountSetBits
ld [wd002], a
ld hl, PokedexCaught
ld b, EndPokedexCaught - PokedexCaught
call CountSetBits
ld [wd003], a
; print appropriate rating
call .UpdateRatingBuffers
ld hl, OakPCText3
call PrintText
call JoyWaitAorB
ld a, [wd003]
ld hl, OakRatings
call FindOakRating
push de
call PrintText
pop de
ret
.UpdateRatingBuffers: ; 0x26647
ld hl, StringBuffer3
ld de, wd002
call .UpdateRatingBuffer
ld hl, StringBuffer4
ld de, wd003
call .UpdateRatingBuffer
ret
.UpdateRatingBuffer: ; 0x2665a
push hl
ld a, "@"
ld bc, ITEM_NAME_LENGTH
call ByteFill
pop hl
lb bc, PRINTNUM_RIGHTALIGN | 1, 3
call PrintNum
ret
FindOakRating: ; 0x2666b
; return sound effect in de
; return text pointer in hl
nop
ld c, a
.loop
ld a, [hli]
cp c
jr nc, .match
rept 4
inc hl
endr
jr .loop
.match
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
ld a, [hli]
ld h, [hl]
ld l, a
ret
OakRatings: ; 0x2667f
oakrating: MACRO
db \1
dw \2, \3
endm
; if you caught at most this many, play this sound, load this text
oakrating 9, SFX_DEX_FANFARE_LESS_THAN_20, OakRating01
oakrating 19, SFX_DEX_FANFARE_LESS_THAN_20, OakRating02
oakrating 34, SFX_DEX_FANFARE_20_49, OakRating03
oakrating 49, SFX_DEX_FANFARE_20_49, OakRating04
oakrating 64, SFX_DEX_FANFARE_50_79, OakRating05
oakrating 79, SFX_DEX_FANFARE_50_79, OakRating06
oakrating 94, SFX_DEX_FANFARE_80_109, OakRating07
oakrating 109, SFX_DEX_FANFARE_80_109, OakRating08
oakrating 124, SFX_CAUGHT_MON, OakRating09
oakrating 139, SFX_CAUGHT_MON, OakRating10
oakrating 154, SFX_DEX_FANFARE_140_169, OakRating11
oakrating 169, SFX_DEX_FANFARE_140_169, OakRating12
oakrating 184, SFX_DEX_FANFARE_170_199, OakRating13
oakrating 199, SFX_DEX_FANFARE_170_199, OakRating14
oakrating 214, SFX_DEX_FANFARE_200_229, OakRating15
oakrating 229, SFX_DEX_FANFARE_200_229, OakRating16
oakrating 239, SFX_DEX_FANFARE_230_PLUS, OakRating17
oakrating 248, SFX_DEX_FANFARE_230_PLUS, OakRating18
oakrating 255, SFX_DEX_FANFARE_230_PLUS, OakRating19
OakPCText1: ; 0x266de
text_jump _OakPCText1
db "@"
OakPCText2: ; 0x266e3
text_jump _OakPCText2
db "@"
OakPCText3: ; 0x266e8
text_jump _OakPCText3
db "@"
OakRating01:
text_jump _OakRating01
db "@"
OakRating02:
text_jump _OakRating02
db "@"
OakRating03:
text_jump _OakRating03
db "@"
OakRating04:
text_jump _OakRating04
db "@"
OakRating05:
text_jump _OakRating05
db "@"
OakRating06:
text_jump _OakRating06
db "@"
OakRating07:
text_jump _OakRating07
db "@"
OakRating08:
text_jump _OakRating08
db "@"
OakRating09:
text_jump _OakRating09
db "@"
OakRating10:
text_jump _OakRating10
db "@"
OakRating11:
text_jump _OakRating11
db "@"
OakRating12:
text_jump _OakRating12
db "@"
OakRating13:
text_jump _OakRating13
db "@"
OakRating14:
text_jump _OakRating14
db "@"
OakRating15:
text_jump _OakRating15
db "@"
OakRating16:
text_jump _OakRating16
db "@"
OakRating17:
text_jump _OakRating17
db "@"
OakRating18:
text_jump _OakRating18
db "@"
OakRating19:
text_jump _OakRating19
db "@"
OakPCText4: ; 0x2674c
text_jump _OakPCText4
db "@"

View File

@ -19,14 +19,14 @@ DoAnimFrame: ; 8d24b
dw .two ; bouncing mon icon, selected
dw .three ; bouncing mon icon, menu open
dw .four
dw .five
dw .namingscreencursor
dw .GameFreakLogo ; Game Freak logo
dw .seven
dw .eight
dw .SlotsGolem ; Something to do with slots
dw .SlotsChansey ; Something to do with slots
dw .SlotsChanseyEgg ; Something to do with slots
dw .twelve ; blinking cursor
dw .mailcompositioncursor ; blinking cursor
dw .thirteen
dw .fourteen
dw .fifteen
@ -217,11 +217,11 @@ DoAnimFrame: ; 8d24b
ld [hl], a
ret
.five: ; 8d36c (23:536c)
.namingscreencursor: ; 8d36c (23:536c)
callab NamingScreen_AnimateCursor
ret
.twelve: ; 8d373 (23:5373)
.mailcompositioncursor: ; 8d373 (23:5373)
callab ComposeMail_AnimateCursor
ret
@ -409,7 +409,7 @@ DoAnimFrame: ; 8d24b
ret
.fifteen: ; 8d475 (23:5475)
callab Function90d41
callab AnimatePokegearModeIndicatorArrow
ret
.fourteen: ; 8d47c (23:547c)

View File

@ -393,7 +393,7 @@ endr
ld hl, StatusFlags2
bit 2, [hl] ; bug catching contest
ret z
callba Function24bdc
callba StartMenu_DrawBugContestStatusBox
ret
; 128de
@ -403,7 +403,7 @@ endr
jr nz, .contest
ret
.contest
callba Function24be7
callba StartMenu_PrintBugContestStatus
ret
; 128ed

View File

@ -200,11 +200,9 @@ CheckPokerusTick:: ; 114e7
call CalcDaysSince
call GetDaysSince
and a
jr z, .done
jr z, .done ; not even a day has passed since game start
ld b, a
callba ApplyPokerusTick
.done
xor a
ret
@ -229,13 +227,13 @@ CheckUnusedTwoDayTimer: ; 1150c
ret
; 1151c
Function1151c: ; unreferenced
; XXX
ld hl, DailyFlags
set 2, [hl]
ret
; 11522
Function11522: ; unreferenced
; XXX
and a
ld hl, DailyFlags
bit 2, [hl]

View File

@ -61,8 +61,8 @@ endr
inc a
dec c
jr nz, .OAMloop
ld hl, Sprites + $10
ld bc, $90
ld hl, Sprites + 4 * 4
ld bc, 36 * 4
xor a
call ByteFill
ret

View File

@ -140,7 +140,7 @@ Kurt_SelectQuantity: ; 880c2
call .PlaceApricornName
call PlaceApricornQuantity
call ApplyTilemap
callba Function27a28
callba Kurt_SelectQuantity_InterpretJoypad
jr nc, .loop
push bc

View File

@ -452,23 +452,23 @@ endr
push af
set SUBSTATUS_TRANSFORMED, [hl]
bit SUBSTATUS_TRANSFORMED, a
jr nz, .asm_ea13
jr .asm_ea1a
jr nz, .ditto
jr .not_ditto
.asm_ea13
.ditto
ld a, DITTO
ld [TempEnemyMonSpecies], a
jr .asm_ea27
jr .load_data
.asm_ea1a
set 3, [hl]
ld hl, wc6f2
.not_ditto
set SUBSTATUS_TRANSFORMED, [hl]
ld hl, wEnemyBackupDVs
ld a, [EnemyMonDVs]
ld [hli], a
ld a, [EnemyMonDVs + 1]
ld [hl], a
.asm_ea27
.load_data
ld a, [TempEnemyMonSpecies]
ld [CurPartySpecies], a
ld a, [EnemyMonLevel]

283
main.asm
View File

@ -5279,29 +5279,27 @@ Script_JumpStdFromRAM: ; 0x1369a
INCLUDE "event/bug_contest_judging.asm"
; decreases all pokemon's pokerus counter by b. if the lower nybble reaches zero, the pokerus is cured.
ApplyPokerusTick: ; 13988
; decreases all pokemon's pokerus counter by b. if the lower nybble reaches zero, the pokerus is cured.
ld hl, PartyMon1PokerusStatus ; PartyMon1 + MON_PKRS
ld a, [PartyCount]
and a
ret z
ret z ; make sure it's not wasting time on an empty party
ld c, a
.loop
ld a, [hl]
and $f
jr z, .does_not_have_pokerus
sub b
jr nc, .ok
and $f ; lower nybble is the number of days remaining
jr z, .next ; if already 0, skip
sub b ; subtract the number of days
jr nc, .ok ; max(result, 0)
xor a
.ok
ld d, a
ld d, a ; back up this value because we need to preserve the strain (upper nybble)
ld a, [hl]
and $f0
add d
ld [hl], a
.does_not_have_pokerus
ld [hl], a ; this prevents a cured pokemon from recontracting pokerus
.next
ld de, PARTYMON_STRUCT_LENGTH
add hl, de
dec c
@ -5678,44 +5676,44 @@ Function24b8f: ; 24b8f
.booru_ko: ; 24bd4
db "ボール こ@"
Function24bdc: ; 24bdc
StartMenu_DrawBugContestStatusBox: ; 24bdc
hlcoord 0, 0
ld b, $5
ld c, $11
ld b, 5
ld c, 17
call TextBox
ret
Function24be7: ; 24be7
StartMenu_PrintBugContestStatus: ; 24be7
ld hl, Options
ld a, [hl]
push af
set 4, [hl]
call Function24bdc
set NO_TEXT_SCROLL, [hl]
call StartMenu_DrawBugContestStatusBox
hlcoord 1, 5
ld de, String24c52
ld de, .Balls_EN
call PlaceString
hlcoord 8, 5
ld de, wSafariBallsRemaining
ld de, wParkBallsRemaining
lb bc, PRINTNUM_RIGHTALIGN | 1, 2
call PrintNum
hlcoord 1, 1
ld de, String24c4b
ld de, .CAUGHT
call PlaceString
ld a, [wContestMon]
and a
ld de, String24c59
jr z, .asm_24c1e
ld de, .None
jr z, .no_contest_mon
ld [wd265], a
call GetPokemonName
.asm_24c1e
.no_contest_mon
hlcoord 8, 1
call PlaceString
ld a, [wContestMon]
and a
jr z, .asm_24c3e
jr z, .skip_level
hlcoord 1, 3
ld de, String24c5e
ld de, .LEVEL
call PlaceString
ld a, [wContestMonLevel]
ld h, b
@ -5724,20 +5722,20 @@ Function24be7: ; 24be7
ld c, $3
call Function3842
.asm_24c3e
.skip_level
pop af
ld [Options], a
ret
String24c43: ; 24c43
.Balls_JP: ; 24c43
db "ボール こ@"
String24c4b: ; 24c4b
.CAUGHT: ; 24c4b
db "CAUGHT@"
String24c52: ; 24c52
.Balls_EN: ; 24c52
db "BALLS:@"
String24c59: ; 24c59
.None: ; 24c59
db "None@"
String24c5e: ; 24c5e
.LEVEL: ; 24c5e
db "LEVEL@"
FindApricornsInBag: ; 24c64
@ -5799,226 +5797,7 @@ INCLUDE "engine/mon_menu.asm"
INCLUDE "battle/menu.asm"
INCLUDE "engine/buy_sell_toss.asm"
INCLUDE "engine/trainer_card.asm"
ProfOaksPC: ; 0x265d3
ld hl, OakPCText1
call MenuTextBox
call YesNoBox
jr c, .shutdown
call ProfOaksPCBoot ; player chose "yes"?
.shutdown
ld hl, OakPCText4
call PrintText
call JoyWaitAorB
call ExitMenu
ret
ProfOaksPCBoot ; 0x265ee
ld hl, OakPCText2
call PrintText
call Rate
call PlaySFX ; sfx loaded by previous Rate function call
call JoyWaitAorB
call WaitSFX
ret
ProfOaksPCRating: ; 0x26601
call Rate
push de
ld de, MUSIC_NONE
call PlayMusic
pop de
call PlaySFX
call JoyWaitAorB
call WaitSFX
ret
Rate: ; 0x26616
; calculate Seen/Owned
ld hl, PokedexSeen
ld b, EndPokedexSeen - PokedexSeen
call CountSetBits
ld [wd002], a
ld hl, PokedexCaught
ld b, EndPokedexCaught - PokedexCaught
call CountSetBits
ld [wd003], a
; print appropriate rating
call .UpdateRatingBuffers
ld hl, OakPCText3
call PrintText
call JoyWaitAorB
ld a, [wd003]
ld hl, OakRatings
call FindOakRating
push de
call PrintText
pop de
ret
.UpdateRatingBuffers: ; 0x26647
ld hl, StringBuffer3
ld de, wd002
call .UpdateRatingBuffer
ld hl, StringBuffer4
ld de, wd003
call .UpdateRatingBuffer
ret
.UpdateRatingBuffer: ; 0x2665a
push hl
ld a, "@"
ld bc, ITEM_NAME_LENGTH
call ByteFill
pop hl
lb bc, PRINTNUM_RIGHTALIGN | 1, 3
call PrintNum
ret
FindOakRating: ; 0x2666b
; return sound effect in de
; return text pointer in hl
nop
ld c, a
.loop
ld a, [hli]
cp c
jr nc, .match
rept 4
inc hl
endr
jr .loop
.match
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
ld a, [hli]
ld h, [hl]
ld l, a
ret
OakRatings: ; 0x2667f
oakrating: MACRO
db \1
dw \2, \3
endm
; if you caught at most this many, play this sound, load this text
oakrating 9, SFX_DEX_FANFARE_LESS_THAN_20, OakRating01
oakrating 19, SFX_DEX_FANFARE_LESS_THAN_20, OakRating02
oakrating 34, SFX_DEX_FANFARE_20_49, OakRating03
oakrating 49, SFX_DEX_FANFARE_20_49, OakRating04
oakrating 64, SFX_DEX_FANFARE_50_79, OakRating05
oakrating 79, SFX_DEX_FANFARE_50_79, OakRating06
oakrating 94, SFX_DEX_FANFARE_80_109, OakRating07
oakrating 109, SFX_DEX_FANFARE_80_109, OakRating08
oakrating 124, SFX_CAUGHT_MON, OakRating09
oakrating 139, SFX_CAUGHT_MON, OakRating10
oakrating 154, SFX_DEX_FANFARE_140_169, OakRating11
oakrating 169, SFX_DEX_FANFARE_140_169, OakRating12
oakrating 184, SFX_DEX_FANFARE_170_199, OakRating13
oakrating 199, SFX_DEX_FANFARE_170_199, OakRating14
oakrating 214, SFX_DEX_FANFARE_200_229, OakRating15
oakrating 229, SFX_DEX_FANFARE_200_229, OakRating16
oakrating 239, SFX_DEX_FANFARE_230_PLUS, OakRating17
oakrating 248, SFX_DEX_FANFARE_230_PLUS, OakRating18
oakrating 255, SFX_DEX_FANFARE_230_PLUS, OakRating19
OakPCText1: ; 0x266de
text_jump _OakPCText1
db "@"
OakPCText2: ; 0x266e3
text_jump _OakPCText2
db "@"
OakPCText3: ; 0x266e8
text_jump _OakPCText3
db "@"
OakRating01:
text_jump _OakRating01
db "@"
OakRating02:
text_jump _OakRating02
db "@"
OakRating03:
text_jump _OakRating03
db "@"
OakRating04:
text_jump _OakRating04
db "@"
OakRating05:
text_jump _OakRating05
db "@"
OakRating06:
text_jump _OakRating06
db "@"
OakRating07:
text_jump _OakRating07
db "@"
OakRating08:
text_jump _OakRating08
db "@"
OakRating09:
text_jump _OakRating09
db "@"
OakRating10:
text_jump _OakRating10
db "@"
OakRating11:
text_jump _OakRating11
db "@"
OakRating12:
text_jump _OakRating12
db "@"
OakRating13:
text_jump _OakRating13
db "@"
OakRating14:
text_jump _OakRating14
db "@"
OakRating15:
text_jump _OakRating15
db "@"
OakRating16:
text_jump _OakRating16
db "@"
OakRating17:
text_jump _OakRating17
db "@"
OakRating18:
text_jump _OakRating18
db "@"
OakRating19:
text_jump _OakRating19
db "@"
OakPCText4: ; 0x2674c
text_jump _OakPCText4
db "@"
INCLUDE "engine/prof_oaks_pc.asm"
INCLUDE "engine/decorations.asm"
PadCoords_de: ; 27092
@ -6161,7 +5940,7 @@ INCLUDE "battle/moves/move_effects_pointers.asm"
MoveEffects: ; 2732e
INCLUDE "battle/moves/move_effects.asm"
Function27a28: ; 27a28
Kurt_SelectQuantity_InterpretJoypad: ; 27a28
call BuySellToss_InterpretJoypad
ld b, a
ret

File diff suppressed because it is too large Load Diff

923
misc/mobile_45_sprite_engine.asm Executable file
View File

@ -0,0 +1,923 @@
Function115d99: ; 115d99
ld de, GFX_11601a
ld hl, VTiles0 tile $60
lb bc, BANK(GFX_11601a), $14
call Get2bpp
xor a
ld [wc305], a
ld [wc306], a
ld [wc309], a
ld [wc30a], a
ld [wc30b], a
ld [wc30c], a
ld a, $10
ld [wc307], a
ld a, $18
ld [wc308], a
ret
; 115dc3
Function115dc3: ; 115dc3
xor a
ld [wc305], a
ld a, $a0
ld hl, Sprites + 31 * 4
ld bc, 8 * 4
call ByteFill
ret
; 115dd3
Function115dd3: ; 115dd3
ld a, [wc305]
and a
ret z
ld a, $a0
ld hl, Sprites + 31 * 4
ld bc, 8 * 4
call ByteFill
call Function115e22
ld a, [wc309]
sla a
ld c, a
ld b, 0
ld hl, Unknown_115e86
add hl, bc
ld a, [hli]
ld e, a
ld a, [hl]
ld d, a
push de
pop hl
ld de, Sprites + 31 * 4
ld a, [wc307]
ld c, a
ld a, [wc308]
ld b, a
ld a, [hli]
.asm_115e04
push af
ld a, [hli]
add b
ld [de], a
inc de
ld a, [hli]
add c
ld [de], a
inc de
ld a, [hli]
ld [de], a
inc de
ld a, [hli]
ld [de], a
inc de
pop af
dec a
jr nz, .asm_115e04
ret
; 115e18
Function115e18: ; 115e18
ld a, c
ld [wc30a], a
xor a
ld [wc30b], a
jr Function115e2b
; 115e22
Function115e22: ; 115e22
ld hl, wc30c
dec [hl]
ret nz
ld hl, wc30b
inc [hl]
Function115e2b: ; 115e2b
ld a, [wc30a]
sla a
ld c, a
ld b, 0
ld hl, Unknown_115e59
add hl, bc
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
push de
pop hl
ld a, [wc30b]
sla a
ld c, a
ld b, $0
add hl, bc
ld a, [hli]
cp $ff
jr nz, .not_end
xor a
ld [wc30b], a
jr Function115e2b
.not_end
ld [wc309], a
ld a, [hl]
ld [wc30c], a
ret
; 115e59
Unknown_115e59:
dw Unknown_115e61
dw Unknown_115e6c
dw Unknown_115e76
dw Unknown_115e79
; OAM idx (see Unknown_115e86), flip flags/duration
Unknown_115e61: ; 115e61
db $04, $08
db $05, $08
db $06, $08
db $07, $08
db $08, $08
db -1
Unknown_115e6c: ; 115e6c
db $01, $08
db $02, $08
db $03, $08
db $09, $08
db $0a, $08
Unknown_115e76: ; 115e76
db $00, $08
db -1
Unknown_115e79: ; 115e79
db $0b, $08
db $0c, $08
db $0d, $08
db $0e, $08
db $0f, $08
db $00, $08
db -1
; 115e86
Unknown_115e86:
dw Unknown_115ea6
dw Unknown_115eb7
dw Unknown_115ecc
dw Unknown_115ee1
dw Unknown_115ef6
dw Unknown_115f13
dw Unknown_115f30
dw Unknown_115f4d
dw Unknown_115f6a
dw Unknown_115f87
dw Unknown_115f9c
dw Unknown_115fb1
dw Unknown_115fc6
dw Unknown_115fdb
dw Unknown_115ff0
dw Unknown_116005
Unknown_115ea6: ; 115ea6
db 4
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
Unknown_115eb7: ; 115eb7
db 5
dsprite 0, 0, 1, 0, $64, $00
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
Unknown_115ecc: ; 115ecc
db 5
dsprite 0, 0, 1, 0, $65, $00
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
Unknown_115ee1: ; 115ee1
db 5
dsprite 0, 0, 1, 0, $66, $00
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
Unknown_115ef6: ; 115ef6
db 7
dsprite 0, 0, 0, 0, $67, $01
dsprite 1, 0, 0, 0, $68, $01
dsprite 2, 0, 0, 0, $6d, $00
dsprite 2, 0, 1, 0, $69, $00
dsprite 2, 0, 2, 0, $6a, $00
dsprite 3, 0, 1, 0, $6b, $00
dsprite 3, 0, 2, 0, $6c, $00
Unknown_115f13: ; 115f13
db 7
dsprite 0, 0, 0, 0, $67, $01
dsprite 1, 0, 0, 0, $68, $01
dsprite 2, 0, 0, 0, $6e, $00
dsprite 2, 0, 1, 0, $69, $00
dsprite 2, 0, 2, 0, $6a, $00
dsprite 3, 0, 1, 0, $6b, $00
dsprite 3, 0, 2, 0, $6c, $00
Unknown_115f30: ; 115f30
db 7
dsprite 0, 0, 0, 0, $67, $01
dsprite 1, 0, 0, 0, $68, $01
dsprite 2, 0, 0, 0, $6f, $00
dsprite 2, 0, 1, 0, $69, $00
dsprite 2, 0, 2, 0, $6a, $00
dsprite 3, 0, 1, 0, $6b, $00
dsprite 3, 0, 2, 0, $6c, $00
Unknown_115f4d: ; 115f4d
db 7
dsprite 0, 0, 0, 0, $67, $01
dsprite 1, 0, 0, 0, $68, $01
dsprite 2, 0, 0, 0, $70, $00
dsprite 2, 0, 1, 0, $69, $00
dsprite 2, 0, 2, 0, $6a, $00
dsprite 3, 0, 1, 0, $6b, $00
dsprite 3, 0, 2, 0, $6c, $00
Unknown_115f6a: ; 115f6a
db 7
dsprite 0, 0, 0, 0, $67, $01
dsprite 1, 0, 0, 0, $68, $01
dsprite 2, 0, 0, 0, $71, $00
dsprite 2, 0, 1, 0, $69, $00
dsprite 2, 0, 2, 0, $6a, $00
dsprite 3, 0, 1, 0, $6b, $00
dsprite 3, 0, 2, 0, $6c, $00
Unknown_115f87: ; 115f87
db 5
dsprite 0, 0, 1, 0, $72, $00
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
Unknown_115f9c: ; 115f9c
db 5
dsprite 0, 0, 1, 0, $73, $00
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
Unknown_115fb1: ; 115fb1
db 5
dsprite 0, 1, 1, 0, $64, $60
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
Unknown_115fc6: ; 115fc6
db 5
dsprite 0, 1, 1, 0, $65, $60
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
Unknown_115fdb: ; 115fdb
db 5
dsprite 0, 1, 1, 0, $66, $60
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
Unknown_115ff0: ; 115ff0
db 5
dsprite 0, 1, 1, 0, $72, $60
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
Unknown_116005: ; 116005
db 5
dsprite 0, 1, 1, 0, $73, $60
dsprite 1, 0, 0, 0, $60, $01
dsprite 1, 0, 1, 0, $61, $01
dsprite 2, 0, 0, 0, $62, $01
dsprite 2, 0, 1, 0, $63, $01
; 11601a
GFX_11601a:: ; 11601a
INCBIN "gfx/unknown/11601a.2bpp"
Function11615a: ; 11615a
xor a
ld [wc30d], a
ld [$c319], a
ld [wc310], a
ld [wc311], a
ld [wc312], a
ld [wc313], a
ld [wc314], a
ld [wc314 + 1], a
ld [wc314 + 4], a
ld [wc3f6], a
ld [wc3f8], a
ld [wc3f2], a
ld [wc3f4], a
ld a, $24
ld [wc3f5], a
ld a, $7
ld [wc3f7], a
ld a, $b0
ld [wc30e], a
ld [wc3f1], a
ld a, $48
ld [wc30f], a
ld [wc3f3], a
ret
; 11619d
Function11619d: ; 11619d
ld a, [wc30d]
and a
ret z
ld a, [$c319]
cp $2
jr c, .asm_1161b4
ld a, $a0
ld hl, Sprites
ld bc, $0064
call ByteFill
.asm_1161b4
call Function1161b8
ret
; 1161b8
Function1161b8: ; 1161b8
ld a, [$c319]
ld e, a
ld d, 0
ld hl, .Jumptable
rept 2
add hl, de
endr
ld a, [hli]
ld h, [hl]
ld l, a
jp [hl]
; 1161c7
.Jumptable: ; 1161c7
dw Function1161d5
dw Function116294
dw Function1162cb
dw Function1162f2
dw Function1163c0
dw Function11636e
dw Function116441
; 1161d5
Function1161d5: ; 1161d5
ld a, [rSVBK]
push af
ld a, $6
ld [rSVBK], a
ld hl, Unknown_117356
ld de, wDecompressScratch
ld bc, $0300
call CopyBytes
di
.wait_for_vblank
; Wait until a vblank would occur had interrupts not just been disabled.
ld a, [rLY]
cp $91
jr nz, .wait_for_vblank
ld a, $d0
ld [rHDMA1], a
ld a, $0
ld [rHDMA2], a
ld a, $1c
ld [rHDMA3], a
xor a
ld [rHDMA4], a
ld a, $8
ld [rHDMA5], a
ld a, $d0
ld [rHDMA1], a
ld a, $80
ld [rHDMA2], a
ld a, $1c
ld [rHDMA3], a
ld a, $80
ld [rHDMA4], a
ld a, $8
ld [rHDMA5], a
ld a, $d1
ld [rHDMA1], a
ld a, $0
ld [rHDMA2], a
ld a, $1d
ld [rHDMA3], a
xor a
ld [rHDMA4], a
ld a, $8
ld [rHDMA5], a
ld a, $1
ld [rVBK], a
ld a, $d1
ld [rHDMA1], a
ld a, $80
ld [rHDMA2], a
ld a, $1c
ld [rHDMA3], a
xor a
ld [rHDMA4], a
ld a, $8
ld [rHDMA5], a
ld a, $d2
ld [rHDMA1], a
ld a, $0
ld [rHDMA2], a
ld a, $1c
ld [rHDMA3], a
ld a, $80
ld [rHDMA4], a
ld a, $8
ld [rHDMA5], a
ld a, $d2
ld [rHDMA1], a
ld a, $80
ld [rHDMA2], a
ld a, $1d
ld [rHDMA3], a
xor a
ld [rHDMA4], a
ld a, $8
ld [rHDMA5], a
xor a
ld [rVBK], a
ei
pop af
ld [rSVBK], a
callba ReloadMapPart
ld a, $8
ld [MusicFade], a
ld de, MUSIC_MOBILE_ADAPTER
ld a, e
ld [MusicFadeIDLo], a
ld a, d
ld [MusicFadeIDHi], a
ld a, [$c319]
inc a
ld [$c319], a
ret
; 11628c
MenuDataHeader_11628c: ; 11628c
db $40 ; flags
db 6, 0 ; start coords
db 17, 19 ; end coords
dw NULL
db 0 ; default option
; 116294
Function116294: ; 116294
callba Function170d02
ld a, [$c319]
inc a
ld [$c319], a
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld hl, UnknBGPals + 8 * 6
ld de, $c320
ld bc, 2 palettes
call CopyBytes
ld hl, Palette_11734e
ld de, UnknBGPals + 8 * 7
ld bc, 1 palettes
call CopyBytes
call SetPalettes
pop af
ld [rSVBK], a
ld a, $30
ld [hWY], a
ret
; 1162cb
Function1162cb: ; 1162cb
callba Function170cc6
ld a, [$c319]
inc a
ld [$c319], a
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld hl, Palette_11730e
ld de, UnknOBPals + 2 palettes
ld bc, 6 palettes
call CopyBytes
call SetPalettes
pop af
ld [rSVBK], a
ret
; 1162f2
Function1162f2: ; 1162f2
call Function11659d
call Function116758
call Function1167a6
ld a, [wc310]
cp EGG
ret z
sla a
ld c, a
ld b, 0
ld hl, Unknown_1168c5
add hl, bc
ld a, [hli]
ld e, a
ld a, [hl]
ld d, a
push de
pop hl
ld a, [wc30e]
ld c, a
ld a, [wc30f]
ld b, a
ld a, [wc314 + 4]
ld e, a
ld a, [hli]
sub e
ld de, Sprites + $24
.asm_116321
push af
ld a, [hli]
add b
ld [de], a
inc de
ld a, [hli]
add c
ld [de], a
inc de
ld a, [hli]
ld [de], a
inc de
ld a, [hli]
ld [de], a
inc de
pop af
dec a
jr nz, .asm_116321
call Function116468
ld a, [wc3f5]
sla a
ld c, a
ld b, 0
ld hl, Unknown_1168c5
add hl, bc
ld a, [hli]
ld e, a
ld a, [hl]
ld d, a
push de
pop hl
ld a, [wc3f1]
ld c, a
ld a, [wc3f3]
ld b, a
ld a, [wc3f8]
ld e, a
ld a, [hli]
sub e
ld de, Sprites
.asm_11635a
push af
ld a, [hli]
add b
ld [de], a
inc de
ld a, [hli]
add c
ld [de], a
inc de
ld a, [hli]
ld [de], a
inc de
ld a, [hli]
ld [de], a
inc de
pop af
dec a
jr nz, .asm_11635a
ret
; 11636e
Function11636e: ; 11636e
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld hl, BGPals
ld de, UnknBGPals
ld bc, $0040
call CopyBytes
pop af
ld [rSVBK], a
call SetPalettes
ld a, [rSVBK]
push af
ld a, $1
ld [rSVBK], a
ld a, $a0
ld hl, Sprites
ld bc, 16 * 4
call ByteFill
ld a, $90
ld [hWY], a
call UpdateSprites
pop af
ld [rSVBK], a
callba ReloadMapPart
ld a, $8
ld [MusicFade], a
ld a, [wMapMusic]
ld [MusicFadeIDLo], a
xor a
ld [MusicFadeIDHi], a
xor a
ld [$c319], a
ld [wc30d], a
ret
; 1163c0
Function1163c0: ; 1163c0
ld a, [rSVBK]
push af
ld a, $1
ld [rSVBK], a
ld a, $a0
ld hl, Sprites
ld bc, 16 * 4
call ByteFill
call DelayFrame
callba Function14146
ld b, SCGB_MAPPALS
call GetSGBLayout
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld hl, $c320
ld de, wd030
ld bc, $0010
call CopyBytes
pop af
ld [rSVBK], a
call SetPalettes
call DelayFrame
ld a, $90
ld [hWY], a
call UpdateSprites
callba Function14157
pop af
ld [rSVBK], a
callba ReloadMapPart
ld a, [wLinkMode]
cp $4
jr z, .asm_11642a
ld a, $8
ld [MusicFade], a
ld a, [wMapMusic]
ld [MusicFadeIDLo], a
xor a
ld [MusicFadeIDHi], a
jr .asm_116439
.asm_11642a
ld a, $8
ld [MusicFade], a
ld a, $0
ld [MusicFadeIDLo], a
ld a, $0
ld [MusicFadeIDHi], a
.asm_116439
xor a
ld [$c319], a
ld [wc30d], a
ret
; 116441
Function116441: ; 116441
callba Function17d405
ld a, $90
ld [hWY], a
callba ReloadMapPart
ld a, $8
ld [MusicFade], a
ld a, [wMapMusic]
ld [MusicFadeIDLo], a
xor a
ld [MusicFadeIDHi], a
xor a
ld [$c319], a
ld [wc30d], a
ret
; 116468
Function116468: ; 116468
call Function116567
ld a, [wc314]
cp $d
jr nz, .asm_1164a8
ld hl, wc30e
ld a, [hl]
cp $50
jr nc, .asm_116484
ld a, $50
sub [hl]
add $50
ld [wc3f1], a
jr .asm_11648d
.asm_116484
sub $50
ld c, a
ld a, $50
sub c
ld [wc3f1], a
.asm_11648d
ld hl, wc30f
ld a, [hl]
cp $60
jr nc, .asm_11649e
ld a, $60
sub [hl]
add $60
ld [wc3f3], a
ret
.asm_11649e
sub $60
ld c, a
ld a, $60
sub c
ld [wc3f3], a
ret
.asm_1164a8
ld hl, wc30e
ld a, $b0
cp [hl]
jr nc, .asm_1164b8
ld a, [wc3f1]
and a
jr z, .asm_11650b
jr .asm_1164f2
.asm_1164b8
ld a, [wc3f1]
sub [hl]
jr nc, .asm_1164c1
xor $ff
inc a
.asm_1164c1
ld b, a
ld c, $0
ld a, $5
.asm_1164c6
srl b
rr c
dec a
jr nz, .asm_1164c6
ld a, c
ld [wc3fa], a
ld a, b
ld [wc3f9], a
ld a, [wc3f1]
sub [hl]
jr c, .asm_1164f2
ld c, $0
ld a, [wc3fa]
xor $ff
add $1
rl c
ld [wc3fa], a
ld a, [wc3f9]
xor $ff
add c
ld [wc3f9], a
.asm_1164f2
ld a, [wc3f2]
ld l, a
ld a, [wc3f1]
ld h, a
ld a, [wc3fa]
ld e, a
ld a, [wc3f9]
ld d, a
add hl, de
ld a, l
ld [wc3f2], a
ld a, h
ld [wc3f1], a
.asm_11650b
ld hl, wc30f
ld a, $b0
cp [hl]
jr c, .asm_11654d
ld a, [wc3f3]
sub [hl]
jr nc, .asm_11651c
xor $ff
inc a
.asm_11651c
ld b, a
ld c, $0
ld a, $5
.asm_116521
srl b
rr c
dec a
jr nz, .asm_116521
ld a, c
ld [wc3fc], a
ld a, b
ld [wc3fb], a
ld a, [wc3f3]
sub [hl]
jr c, .asm_11654d
ld c, $0
ld a, [wc3fc]
xor $ff
add $1
rl c
ld [wc3fc], a
ld a, [wc3fb]
xor $ff
add c
ld [wc3fb], a
.asm_11654d
ld a, [wc3f4]
ld l, a
ld a, [wc3f3]
ld h, a
ld a, [wc3fc]
ld e, a
ld a, [wc3fb]
ld d, a
add hl, de
ld a, l
ld [wc3f4], a
ld a, h
ld [wc3f3], a
ret

View File

@ -308,7 +308,7 @@ wGlobalAnimYOffset:: ds 1
wGlobalAnimXOffset:: ds 1
wSpriteAnimsEnd::
wc3c1:: ds 11
ds 11
wc3cc:: ds 1
wc3cd:: ds 31
wc3ec:: ds 1
@ -373,19 +373,21 @@ wBT_OTTemp:: battle_tower_struct wBT_OTTemp
wMisc:: ; ds (SCREEN_WIDTH + 4) * (SCREEN_HEIGHT + 2)
wBattle::
wc608::
ds 7
wc60f::
ds 3
wc612::
ds 10
wInitHourBuffer:: ; c61c
ds 10
wc626::
ds wc608 - @
wEnemyMoveStruct:: move_struct wEnemyMoveStruct
wc60f::
wPlayerMoveStruct:: move_struct wPlayerMoveStruct
wc616::
ds -4
wc612:: ds 4
EnemyMonNick:: ds PKMN_NAME_LENGTH ; c616
ds -5
wInitHourBuffer:: ds 5
BattleMonNick:: ds PKMN_NAME_LENGTH ; c621
ds -6
wc626:: ds 6
BattleMon:: battle_struct BattleMon ; c62c
@ -637,10 +639,9 @@ wc6eb:: ds 1
wPayDayMoney:: ds 3 ; c6ec
wSafariMonAngerCount:: ds 1
wSafariMonEating::
wc6f0:: ds 2
wSafariMonEating:: ds 2
wEnemyBackupDVs:: ; used when enemy is transformed
wc6f2:: ds 2
ds 2
AlreadyDisobeyed:: ; c6f4
ds 1
@ -2763,15 +2764,12 @@ wdc0d:: ds 1
wdc0e:: ds 1
; Sprite id of each decoration
wdc0f::
Bed:: ; dc0f
ds 1
Carpet:: ; dc10
ds 1
wdc11::
Plant:: ; dc11
ds 1
wdc12::
Poster:: ; dc12
ds 1
Console:: ; dc13
@ -2810,8 +2808,8 @@ FruitTreeFlags:: ; dc27
wLuckyNumberDayBuffer:: ds 2
ds 2
wSpecialPhoneCallID:: ds 2
wdc33:: ds 2
wSpecialPhoneCallID:: ds 1
ds 3
wBugContestStartTime:: ds 4 ; day, hour, min, sec
wdc39:: ds 1
wUnusedTwoDayTimer:: ds 1