mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
Merge branch 'master' of https://github.com/pret/pokered
This commit is contained in:
commit
e8dd755e18
3702 changed files with 163333 additions and 159040 deletions
23
engine/movie/oak_speech/clear_save.asm
Normal file
23
engine/movie/oak_speech/clear_save.asm
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
DoClearSaveDialogue:
|
||||
call ClearScreen
|
||||
call RunDefaultPaletteCommand
|
||||
call LoadFontTilePatterns
|
||||
call LoadTextBoxTilePatterns
|
||||
ld hl, ClearSaveDataText
|
||||
call PrintText
|
||||
hlcoord 14, 7
|
||||
lb bc, 8, 15
|
||||
ld a, NO_YES_MENU
|
||||
ld [wTwoOptionMenuID], a
|
||||
ld a, TWO_OPTION_MENU
|
||||
ld [wTextBoxID], a
|
||||
call DisplayTextBoxID
|
||||
ld a, [wCurrentMenuItem]
|
||||
and a
|
||||
jp z, Init
|
||||
farcall ClearSAV
|
||||
jp Init
|
||||
|
||||
ClearSaveDataText:
|
||||
text_far _ClearSaveDataText
|
||||
text_end
|
||||
55
engine/movie/oak_speech/init_player_data.asm
Normal file
55
engine/movie/oak_speech/init_player_data.asm
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
InitPlayerData:
|
||||
InitPlayerData2:
|
||||
|
||||
call Random
|
||||
ldh a, [hRandomSub]
|
||||
ld [wPlayerID], a
|
||||
|
||||
call Random
|
||||
ldh a, [hRandomAdd]
|
||||
ld [wPlayerID + 1], a
|
||||
|
||||
ld a, $ff
|
||||
ld [wUnusedD71B], a
|
||||
|
||||
ld hl, wPartyCount
|
||||
call InitializeEmptyList
|
||||
ld hl, wNumInBox
|
||||
call InitializeEmptyList
|
||||
ld hl, wNumBagItems
|
||||
call InitializeEmptyList
|
||||
ld hl, wNumBoxItems
|
||||
call InitializeEmptyList
|
||||
|
||||
START_MONEY EQU $3000
|
||||
ld hl, wPlayerMoney + 1
|
||||
ld a, HIGH(START_MONEY)
|
||||
ld [hld], a
|
||||
xor a ; LOW(START_MONEY)
|
||||
ld [hli], a
|
||||
inc hl
|
||||
ld [hl], a
|
||||
|
||||
ld [wMonDataLocation], a
|
||||
|
||||
ld hl, wObtainedBadges
|
||||
ld [hli], a
|
||||
|
||||
ld [hl], a
|
||||
|
||||
ld hl, wPlayerCoins
|
||||
ld [hli], a
|
||||
ld [hl], a
|
||||
|
||||
ld hl, wGameProgressFlags
|
||||
ld bc, wGameProgressFlagsEnd - wGameProgressFlags
|
||||
call FillMemory ; clear all game progress flags
|
||||
|
||||
jp InitializeMissableObjectsFlags
|
||||
|
||||
InitializeEmptyList:
|
||||
xor a ; count
|
||||
ld [hli], a
|
||||
dec a ; terminator
|
||||
ld [hl], a
|
||||
ret
|
||||
233
engine/movie/oak_speech/oak_speech.asm
Normal file
233
engine/movie/oak_speech/oak_speech.asm
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
SetDefaultNames:
|
||||
ld a, [wLetterPrintingDelayFlags]
|
||||
push af
|
||||
ld a, [wOptions]
|
||||
push af
|
||||
ld a, [wd732]
|
||||
push af
|
||||
ld hl, wPlayerName
|
||||
ld bc, wBoxDataEnd - wPlayerName
|
||||
xor a
|
||||
call FillMemory
|
||||
ld hl, wSpriteDataStart
|
||||
ld bc, wSpriteDataEnd - wSpriteDataStart
|
||||
xor a
|
||||
call FillMemory
|
||||
pop af
|
||||
ld [wd732], a
|
||||
pop af
|
||||
ld [wOptions], a
|
||||
pop af
|
||||
ld [wLetterPrintingDelayFlags], a
|
||||
ld a, [wOptionsInitialized]
|
||||
and a
|
||||
call z, InitOptions
|
||||
ld hl, NintenText
|
||||
ld de, wPlayerName
|
||||
ld bc, NAME_LENGTH
|
||||
call CopyData
|
||||
ld hl, SonyText
|
||||
ld de, wRivalName
|
||||
ld bc, NAME_LENGTH
|
||||
jp CopyData
|
||||
|
||||
OakSpeech:
|
||||
ld a, SFX_STOP_ALL_MUSIC
|
||||
call PlaySound
|
||||
ld a, 0 ; BANK(Music_Routes2)
|
||||
ld c, a
|
||||
ld a, MUSIC_ROUTES2
|
||||
call PlayMusic
|
||||
call ClearScreen
|
||||
call LoadTextBoxTilePatterns
|
||||
call SetDefaultNames
|
||||
predef InitPlayerData2
|
||||
ld hl, wNumBoxItems
|
||||
ld a, POTION
|
||||
ld [wcf91], a
|
||||
ld a, 1
|
||||
ld [wItemQuantity], a
|
||||
call AddItemToInventory ; give one potion
|
||||
ld a, [wDefaultMap]
|
||||
ld [wDestinationMap], a
|
||||
call SpecialWarpIn
|
||||
xor a
|
||||
ldh [hTileAnimations], a
|
||||
ld a, [wd732]
|
||||
bit 1, a ; possibly a debug mode bit
|
||||
jp nz, .skipChoosingNames
|
||||
ld de, ProfOakPic
|
||||
lb bc, BANK(ProfOakPic), $00
|
||||
call IntroDisplayPicCenteredOrUpperRight
|
||||
call FadeInIntroPic
|
||||
ld hl, OakSpeechText1
|
||||
call PrintText
|
||||
call GBFadeOutToWhite
|
||||
call ClearScreen
|
||||
ld a, NIDORINO
|
||||
ld [wd0b5], a
|
||||
ld [wcf91], a
|
||||
call GetMonHeader
|
||||
hlcoord 6, 4
|
||||
call LoadFlippedFrontSpriteByMonIndex
|
||||
call MovePicLeft
|
||||
ld hl, OakSpeechText2
|
||||
call PrintText
|
||||
call GBFadeOutToWhite
|
||||
call ClearScreen
|
||||
ld de, RedPicFront
|
||||
lb bc, BANK(RedPicFront), $00
|
||||
call IntroDisplayPicCenteredOrUpperRight
|
||||
call MovePicLeft
|
||||
ld hl, IntroducePlayerText
|
||||
call PrintText
|
||||
call ChoosePlayerName
|
||||
call GBFadeOutToWhite
|
||||
call ClearScreen
|
||||
ld de, Rival1Pic
|
||||
lb bc, BANK(Rival1Pic), $00
|
||||
call IntroDisplayPicCenteredOrUpperRight
|
||||
call FadeInIntroPic
|
||||
ld hl, IntroduceRivalText
|
||||
call PrintText
|
||||
call ChooseRivalName
|
||||
.skipChoosingNames
|
||||
call GBFadeOutToWhite
|
||||
call ClearScreen
|
||||
ld de, RedPicFront
|
||||
lb bc, BANK(RedPicFront), $00
|
||||
call IntroDisplayPicCenteredOrUpperRight
|
||||
call GBFadeInFromWhite
|
||||
ld a, [wd72d]
|
||||
and a
|
||||
jr nz, .next
|
||||
ld hl, OakSpeechText3
|
||||
call PrintText
|
||||
.next
|
||||
ldh a, [hLoadedROMBank]
|
||||
push af
|
||||
ld a, SFX_SHRINK
|
||||
call PlaySound
|
||||
pop af
|
||||
ldh [hLoadedROMBank], a
|
||||
ld [MBC1RomBank], a
|
||||
ld c, 4
|
||||
call DelayFrames
|
||||
ld de, RedSprite
|
||||
ld hl, vSprites
|
||||
lb bc, BANK(RedSprite), $0C
|
||||
call CopyVideoData
|
||||
ld de, ShrinkPic1
|
||||
lb bc, BANK(ShrinkPic1), $00
|
||||
call IntroDisplayPicCenteredOrUpperRight
|
||||
ld c, 4
|
||||
call DelayFrames
|
||||
ld de, ShrinkPic2
|
||||
lb bc, BANK(ShrinkPic2), $00
|
||||
call IntroDisplayPicCenteredOrUpperRight
|
||||
call ResetPlayerSpriteData
|
||||
ldh a, [hLoadedROMBank]
|
||||
push af
|
||||
ld a, 0 ; BANK(Music_PalletTown)
|
||||
ld [wAudioROMBank], a
|
||||
ld [wAudioSavedROMBank], a
|
||||
ld a, 10
|
||||
ld [wAudioFadeOutControl], a
|
||||
ld a, SFX_STOP_ALL_MUSIC
|
||||
ld [wNewSoundID], a
|
||||
call PlaySound
|
||||
pop af
|
||||
ldh [hLoadedROMBank], a
|
||||
ld [MBC1RomBank], a
|
||||
ld c, 20
|
||||
call DelayFrames
|
||||
hlcoord 6, 5
|
||||
ld b, 7
|
||||
ld c, 7
|
||||
call ClearScreenArea
|
||||
call LoadTextBoxTilePatterns
|
||||
ld a, 1
|
||||
ld [wUpdateSpritesEnabled], a
|
||||
ld c, 50
|
||||
call DelayFrames
|
||||
call GBFadeOutToWhite
|
||||
jp ClearScreen
|
||||
OakSpeechText1:
|
||||
text_far _OakSpeechText1
|
||||
text_end
|
||||
OakSpeechText2:
|
||||
text_far _OakSpeechText2A
|
||||
sound_cry_nidorina
|
||||
text_far _OakSpeechText2B
|
||||
text_end
|
||||
IntroducePlayerText:
|
||||
text_far _IntroducePlayerText
|
||||
text_end
|
||||
IntroduceRivalText:
|
||||
text_far _IntroduceRivalText
|
||||
text_end
|
||||
OakSpeechText3:
|
||||
text_far _OakSpeechText3
|
||||
text_end
|
||||
|
||||
FadeInIntroPic:
|
||||
ld hl, IntroFadePalettes
|
||||
ld b, 6
|
||||
.next
|
||||
ld a, [hli]
|
||||
ldh [rBGP], a
|
||||
ld c, 10
|
||||
call DelayFrames
|
||||
dec b
|
||||
jr nz, .next
|
||||
ret
|
||||
|
||||
IntroFadePalettes:
|
||||
db %01010100
|
||||
db %10101000
|
||||
db %11111100
|
||||
db %11111000
|
||||
db %11110100
|
||||
db %11100100
|
||||
|
||||
MovePicLeft:
|
||||
ld a, 119
|
||||
ldh [rWX], a
|
||||
call DelayFrame
|
||||
|
||||
ld a, %11100100
|
||||
ldh [rBGP], a
|
||||
.next
|
||||
call DelayFrame
|
||||
ldh a, [rWX]
|
||||
sub 8
|
||||
cp $FF
|
||||
ret z
|
||||
ldh [rWX], a
|
||||
jr .next
|
||||
|
||||
DisplayPicCenteredOrUpperRight:
|
||||
call GetPredefRegisters
|
||||
IntroDisplayPicCenteredOrUpperRight:
|
||||
; b = bank
|
||||
; de = address of compressed pic
|
||||
; c: 0 = centred, non-zero = upper-right
|
||||
push bc
|
||||
ld a, b
|
||||
call UncompressSpriteFromDE
|
||||
ld hl, sSpriteBuffer1
|
||||
ld de, sSpriteBuffer0
|
||||
ld bc, $310
|
||||
call CopyData
|
||||
ld de, vFrontPic
|
||||
call InterlaceMergeSpriteBuffers
|
||||
pop bc
|
||||
ld a, c
|
||||
and a
|
||||
hlcoord 15, 1
|
||||
jr nz, .next
|
||||
hlcoord 6, 4
|
||||
.next
|
||||
xor a
|
||||
ldh [hStartTileID], a
|
||||
predef_jump CopyUncompressedPicToTilemap
|
||||
219
engine/movie/oak_speech/oak_speech2.asm
Normal file
219
engine/movie/oak_speech/oak_speech2.asm
Normal file
|
|
@ -0,0 +1,219 @@
|
|||
ChoosePlayerName:
|
||||
call OakSpeechSlidePicRight
|
||||
ld de, DefaultNamesPlayer
|
||||
call DisplayIntroNameTextBox
|
||||
ld a, [wCurrentMenuItem]
|
||||
and a
|
||||
jr z, .customName
|
||||
ld hl, DefaultNamesPlayerList
|
||||
call GetDefaultName
|
||||
ld de, wPlayerName
|
||||
call OakSpeechSlidePicLeft
|
||||
jr .done
|
||||
.customName
|
||||
ld hl, wPlayerName
|
||||
xor a ; NAME_PLAYER_SCREEN
|
||||
ld [wNamingScreenType], a
|
||||
call DisplayNamingScreen
|
||||
ld a, [wcf4b]
|
||||
cp "@"
|
||||
jr z, .customName
|
||||
call ClearScreen
|
||||
call Delay3
|
||||
ld de, RedPicFront
|
||||
ld b, BANK(RedPicFront)
|
||||
call IntroDisplayPicCenteredOrUpperRight
|
||||
.done
|
||||
ld hl, YourNameIsText
|
||||
jp PrintText
|
||||
|
||||
YourNameIsText:
|
||||
text_far _YourNameIsText
|
||||
text_end
|
||||
|
||||
ChooseRivalName:
|
||||
call OakSpeechSlidePicRight
|
||||
ld de, DefaultNamesRival
|
||||
call DisplayIntroNameTextBox
|
||||
ld a, [wCurrentMenuItem]
|
||||
and a
|
||||
jr z, .customName
|
||||
ld hl, DefaultNamesRivalList
|
||||
call GetDefaultName
|
||||
ld de, wRivalName
|
||||
call OakSpeechSlidePicLeft
|
||||
jr .done
|
||||
.customName
|
||||
ld hl, wRivalName
|
||||
ld a, NAME_RIVAL_SCREEN
|
||||
ld [wNamingScreenType], a
|
||||
call DisplayNamingScreen
|
||||
ld a, [wcf4b]
|
||||
cp "@"
|
||||
jr z, .customName
|
||||
call ClearScreen
|
||||
call Delay3
|
||||
ld de, Rival1Pic
|
||||
ld b, $13
|
||||
call IntroDisplayPicCenteredOrUpperRight
|
||||
.done
|
||||
ld hl, HisNameIsText
|
||||
jp PrintText
|
||||
|
||||
HisNameIsText:
|
||||
text_far _HisNameIsText
|
||||
text_end
|
||||
|
||||
OakSpeechSlidePicLeft:
|
||||
push de
|
||||
hlcoord 0, 0
|
||||
lb bc, 12, 11
|
||||
call ClearScreenArea ; clear the name list text box
|
||||
ld c, 10
|
||||
call DelayFrames
|
||||
pop de
|
||||
ld hl, wcd6d
|
||||
ld bc, NAME_LENGTH
|
||||
call CopyData
|
||||
call Delay3
|
||||
hlcoord 12, 4
|
||||
lb de, 6, 6 * SCREEN_WIDTH + 5
|
||||
ld a, $ff
|
||||
jr OakSpeechSlidePicCommon
|
||||
|
||||
OakSpeechSlidePicRight:
|
||||
hlcoord 5, 4
|
||||
lb de, 6, 6 * SCREEN_WIDTH + 5
|
||||
xor a
|
||||
|
||||
OakSpeechSlidePicCommon:
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
ldh [hSlideDirection], a
|
||||
ld a, d
|
||||
ldh [hSlideAmount], a
|
||||
ld a, e
|
||||
ldh [hSlidingRegionSize], a
|
||||
ld c, a
|
||||
ldh a, [hSlideDirection]
|
||||
and a
|
||||
jr nz, .next
|
||||
; If sliding right, point hl to the end of the pic's tiles.
|
||||
ld d, 0
|
||||
add hl, de
|
||||
.next
|
||||
ld d, h
|
||||
ld e, l
|
||||
.loop
|
||||
xor a
|
||||
ldh [hAutoBGTransferEnabled], a
|
||||
ldh a, [hSlideDirection]
|
||||
and a
|
||||
jr nz, .slideLeft
|
||||
; sliding right
|
||||
ld a, [hli]
|
||||
ld [hld], a
|
||||
dec hl
|
||||
jr .next2
|
||||
.slideLeft
|
||||
ld a, [hld]
|
||||
ld [hli], a
|
||||
inc hl
|
||||
.next2
|
||||
dec c
|
||||
jr nz, .loop
|
||||
ldh a, [hSlideDirection]
|
||||
and a
|
||||
jr z, .next3
|
||||
; If sliding left, we need to zero the last tile in the pic (there is no need
|
||||
; to take a corresponding action when sliding right because hl initially points
|
||||
; to a 0 tile in that case).
|
||||
xor a
|
||||
dec hl
|
||||
ld [hl], a
|
||||
.next3
|
||||
ld a, 1
|
||||
ldh [hAutoBGTransferEnabled], a
|
||||
call Delay3
|
||||
ldh a, [hSlidingRegionSize]
|
||||
ld c, a
|
||||
ld h, d
|
||||
ld l, e
|
||||
ldh a, [hSlideDirection]
|
||||
and a
|
||||
jr nz, .slideLeft2
|
||||
inc hl
|
||||
jr .next4
|
||||
.slideLeft2
|
||||
dec hl
|
||||
.next4
|
||||
ld d, h
|
||||
ld e, l
|
||||
ldh a, [hSlideAmount]
|
||||
dec a
|
||||
ldh [hSlideAmount], a
|
||||
jr nz, .loop
|
||||
pop bc
|
||||
pop de
|
||||
pop hl
|
||||
ret
|
||||
|
||||
DisplayIntroNameTextBox:
|
||||
push de
|
||||
hlcoord 0, 0
|
||||
ld b, $a
|
||||
ld c, $9
|
||||
call TextBoxBorder
|
||||
hlcoord 3, 0
|
||||
ld de, .namestring
|
||||
call PlaceString
|
||||
pop de
|
||||
hlcoord 2, 2
|
||||
call PlaceString
|
||||
call UpdateSprites
|
||||
xor a
|
||||
ld [wCurrentMenuItem], a
|
||||
ld [wLastMenuItem], a
|
||||
inc a
|
||||
ld [wTopMenuItemX], a
|
||||
ld [wMenuWatchedKeys], a ; A_BUTTON
|
||||
inc a
|
||||
ld [wTopMenuItemY], a
|
||||
inc a
|
||||
ld [wMaxMenuItem], a
|
||||
jp HandleMenuInput
|
||||
|
||||
.namestring
|
||||
db "NAME@"
|
||||
|
||||
INCLUDE "data/player_names.asm"
|
||||
|
||||
GetDefaultName:
|
||||
; a = name index
|
||||
; hl = name list
|
||||
ld b, a
|
||||
ld c, 0
|
||||
.loop
|
||||
ld d, h
|
||||
ld e, l
|
||||
.innerLoop
|
||||
ld a, [hli]
|
||||
cp "@"
|
||||
jr nz, .innerLoop
|
||||
ld a, b
|
||||
cp c
|
||||
jr z, .foundName
|
||||
inc c
|
||||
jr .loop
|
||||
.foundName
|
||||
ld h, d
|
||||
ld l, e
|
||||
ld de, wcd6d
|
||||
ld bc, $14
|
||||
jp CopyData
|
||||
|
||||
INCLUDE "data/player_names_list.asm"
|
||||
|
||||
LinkMenuEmptyText:
|
||||
text_end
|
||||
Loading…
Add table
Add a link
Reference in a new issue