# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
This commit is contained in:
Zumi Daxuya 2020-12-18 13:16:13 +07:00
commit 653179ffcf
27 changed files with 3514 additions and 63 deletions

View File

@ -31,9 +31,11 @@ INCLUDE "constants/item_data_constants.asm"
INCLUDE "constants/trainer_constants.asm"
INCLUDE "constants/trainer_data_constants.asm"
INCLUDE "constants/sprite_constants.asm"
INCLUDE "constants/sprite_anim_constants.asm"
INCLUDE "constants/battle_constants.asm"
INCLUDE "constants/palette_constants.asm"
INCLUDE "constants/music_constants.asm"
INCLUDE "constants/sfx_constants.asm"
INCLUDE "constants/landmark_constants.asm"
INCLUDE "constants/map_constants.asm"
INCLUDE "constants/map_setup_constants.asm"

View File

@ -0,0 +1,5 @@
; TODO
SFX_PAY_DAY EQU $30
SFX_GAME_FREAK_LOGO_RG EQU $31

View File

@ -0,0 +1,60 @@
; sprite_anim_struct members (see macros/wram.asm)
const_def
const SPRITEANIMSTRUCT_INDEX ; 0
const SPRITEANIMSTRUCT_FRAMESET_ID ; 1
const SPRITEANIMSTRUCT_ANIM_SEQ_ID ; 2
const SPRITEANIMSTRUCT_TILE_ID ; 3
const SPRITEANIMSTRUCT_XCOORD ; 4
const SPRITEANIMSTRUCT_YCOORD ; 5
const SPRITEANIMSTRUCT_XOFFSET ; 6
const SPRITEANIMSTRUCT_YOFFSET ; 7
const SPRITEANIMSTRUCT_DURATION ; 8
const SPRITEANIMSTRUCT_DURATIONOFFSET ; 9
const SPRITEANIMSTRUCT_FRAME ; a
const SPRITEANIMSTRUCT_JUMPTABLE_INDEX ; b
const SPRITEANIMSTRUCT_0C ; c
const SPRITEANIMSTRUCT_0D ; d
const SPRITEANIMSTRUCT_0E ; e
const SPRITEANIMSTRUCT_0F ; f
SPRITEANIMSTRUCT_LENGTH EQU const_value
NUM_SPRITE_ANIM_STRUCTS EQU 10 ; see wSpriteAnimationStructs
; wSpriteAnimDict keys
SPRITE_ANIM_DICT_DEFAULT EQU $00
SPRITE_ANIM_DICT_GS_SPLASH EQU $27
; wSpriteAnimDict size (see ram/wram.asm)
NUM_SPRITEANIMDICT_ENTRIES EQU 10
; SpriteAnimSeqData indexes
SPRITE_ANIM_INDEX_08 EQU $08
SPRITE_ANIM_INDEX_GS_INTRO_BUBBLE EQU $21
SPRITE_ANIM_INDEX_GS_INTRO_OMANYTE EQU $22
SPRITE_ANIM_INDEX_GS_INTRO_MAGIKARP EQU $23
SPRITE_ANIM_INDEX_UNUSED_INTRO_AERODACTYL EQU $24
SPRITE_ANIM_INDEX_GS_INTRO_LAPRAS EQU $25
SPRITE_ANIM_INDEX_GS_INTRO_NOTE EQU $26
SPRITE_ANIM_INDEX_GS_INTRO_SMALLER_NOTE EQU $27
SPRITE_ANIM_INDEX_GS_INTRO_JIGGLYPUFF EQU $28
SPRITE_ANIM_INDEX_GS_INTRO_PIKACHU EQU $29
SPRITE_ANIM_INDEX_GS_INTRO_PIKACHU_TAIL EQU $2a
SPRITE_ANIM_INDEX_GS_INTRO_FIREBALL EQU $2b
SPRITE_ANIM_INDEX_GS_INTRO_BLASTOISE EQU $2c
SPRITE_ANIM_INDEX_GS_INTRO_VENUSAUR EQU $2d
SPRITE_ANIM_INDEX_GS_TITLE_FLAME_NOTE EQU $2e
SPRITE_ANIM_INDEX_MINIGAME_PIKACHU EQU $2f
SPRITE_ANIM_INDEX_MINIGAME_PIKACHU_TAIL EQU $30
SPRITE_ANIM_INDEX_MINIGAME_NOTE EQU $31
SPRITE_ANIM_INDEX_MINIGAME_JIGGLYPUFF EQU $32
SPRITE_ANIM_INDEX_39 EQU $39
SPRITE_ANIM_INDEX_GAMEFREAK_LOGO EQU $3a
SPRITE_ANIM_INDEX_GS_INTRO_STAR EQU $3b
SPRITE_ANIM_INDEX_GS_INTRO_SPARKLE EQU $3c
SPRITE_ANIM_INDEX_40 EQU $40
SPRITE_ANIM_INDEX_41 EQU $41
SPRITE_ANIM_INDEX_44 EQU $44
SPRITE_ANIM_INDEX_4B EQU $4b

View File

@ -0,0 +1,94 @@
SoundTestTextPointers:
; id? bank? description
dbbw $00, $3A, SoundTest_PalletTownText
dbbw $00, $3A, SoundTest_PokecenterText
dbbw $00, $3A, SoundTest_PokegymText
dbbw $07, $3A, SoundTest_QuestionMarkText
dbbw $00, $3A, SoundTest_QuestionMarkText
dbbw $00, $3A, SoundTest_QuestionMarkText
dbbw $00, $3A, SoundTest_QuestionMarkText
dbbw $00, $3A, SoundTest_QuestionMarkText
dbbw $00, $3A, SoundTest_QuestionMarkText
dbbw $0C, $3A, SoundTest_PokeEvolutionText
dbbw $08, $3A, SoundTest_HealingText
dbbw $02, $3A, SoundTest_QuestionMarkText
dbbw $03, $3A, SoundTest_QuestionMarkText
dbbw $00, $3A, SoundTest_QuestionMarkText
dbbw $00, $3A, SoundTest_QuestionMarkText
dbbw $00, $3A, SoundTest_QuestionMarkText
dbbw $00, $3A, SoundTest_HurryAlongText
dbbw $00, $3A, SoundTest_MeetOakText
dbbw $00, $3A, SoundTest_RivalText
dbbw $00, $3A, SoundTest_SSAnneText
dbbw $66, $3A, SoundTest_Fanfare3Text
dbbw $68, $3A, SoundTest_Fanfare5Text
dbbw $69, $3A, SoundTest_Fanfare6Text
dbbw $63, $3A, SoundTest_FanfareText
dbbw $21, $3A, SoundTest_FluteText
dbbw $04, $3B, SoundTest_BattleText
dbbw $05, $3B, SoundTest_BattleText
dbbw $00, $3B, SoundTest_BattleText
dbbw $00, $3B, SoundTest_ChampionBattleText
dbbw $0B, $3B, SoundTest_VictoryText
dbbw $00, $3B, SoundTest_VictoryText
dbbw $00, $3B, SoundTest_VictoryText
dbbw $67, $3B, SoundTest_Fanfare4Text
dbbw $68, $3B, SoundTest_Fanfare5Text_2
dbbw $6B, $3B, SoundTest_Fanfare8Text
dbbw $00, $3C, SoundTest_TitleText
dbbw $00, $3C, SoundTest_EndingText
dbbw $00, $3C, SoundTest_HallOfFameText
dbbw $00, $3C, SoundTest_OaksLabText
dbbw $00, $3C, SoundTest_JigglypuffSongText
dbbw $09, $3C, SoundTest_BikeText
dbbw $00, $3C, SoundTest_SurfText
dbbw $00, $3C, SoundTest_CasinoText
dbbw $00, $3C, SoundTest_IntroBattleText
dbbw $00, $3C, SoundTest_CaveText
dbbw $00, $3C, SoundTest_CaveText
dbbw $00, $3C, SoundTest_CaveText
dbbw $00, $3C, SoundTest_CaveText
dbbw $00, $3C, SoundTest_PokemonTowerText
dbbw $00, $3C, SoundTest_PokemonTowerText
dbbw $0A, $3C, SoundTest_DealerText
dbbw $00, $3C, SoundTest_DealerText
dbbw $00, $3C, SoundTest_DealerText
dbbw $66, $3C, SoundTest_Fanfare3Text_2
dbbw $69, $3C, SoundTest_Fanfare6Text_2
dbbw -1, -1, SoundTestTextPointers
SoundTest_PalletTownText: db "マサラタウン@"
SoundTest_PokecenterText: db "#センター@"
SoundTest_PokegymText: db "#ジム@"
SoundTest_PokeEvolutionText: db "#しんか@"
SoundTest_HealingText: db "あさあさあさ@"
SoundTest_HurryAlongText: db "つれていかれる@"
SoundTest_MeetOakText: db "オーキドとともに@"
SoundTest_RivalText: db "ライバル@"
SoundTest_SSAnneText: db "サントアンヌゴウ@"
SoundTest_FluteText: db "ふえ@"
SoundTest_BattleText: db "せんとう@"
SoundTest_ChampionBattleText: db "さいしゆうせんとう@"
SoundTest_VictoryText: db "かち@"
SoundTest_FanfareText: db "フぁンファーレ@"
SoundTest_Fanfare3Text: db "フぁンファーレ3@"
SoundTest_Fanfare5Text: db "フぁンファーレ5@"
SoundTest_Fanfare6Text: db "フぁンファーレ6@"
SoundTest_Fanfare4Text: db "フぁンファーレ4@"
SoundTest_Fanfare5Text_2: db "フぁンファーレ5@"
SoundTest_Fanfare8Text: db "フぁンファーレ8@"
SoundTest_Fanfare3Text_2: db "フぁンファーレ3@"
SoundTest_Fanfare6Text_2: db "フぁンファーレ6@"
SoundTest_TitleText: db "タイトル@"
SoundTest_EndingText: db "エンディング@"
SoundTest_HallOfFameText: db "でんどういり@"
SoundTest_OaksLabText: db "けんきゆうじよ@"
SoundTest_JigglypuffSongText: db "プりンノうた@"
SoundTest_BikeText: db "じてんしや@"
SoundTest_SurfText: db "うみ@"
SoundTest_CasinoText: db "カジノ@"
SoundTest_IntroBattleText: db "オープニングデモ@"
SoundTest_CaveText: db "どうくつ@"
SoundTest_PokemonTowerText: db "とう@"
SoundTest_DealerText: db "ディーラー@"
SoundTest_QuestionMarkText: db "@"

View File

@ -1150,8 +1150,8 @@ Function886a:
ld hl, vChars0 + $40
lb bc, BANK(GoldSpriteGFX), $04
call Request2bpp
ld de, $0000
ld a, $41
depixel 0, 0
ld a, SPRITE_ANIM_INDEX_41
call InitSpriteAnimStruct
ld hl, $0003
add hl, bc
@ -1188,8 +1188,8 @@ Function88b3:
ld hl, vChars0 + $c0
lb bc, BANK(PidgeySpriteGFX), $04
call Request2bpp
ld de, $0000
ld a, $41
depixel 0, 0
ld a, SPRITE_ANIM_INDEX_41
call InitSpriteAnimStruct
ld hl, $0003
add hl, bc
@ -1443,8 +1443,8 @@ Function8c21:
ld hl, wTileMapBackup
ld [hli], a
ld [hl], $7c
ld de, $241c
ld a, $44
depixel 4, 3, 4, 4
ld a, SPRITE_ANIM_INDEX_44
call InitSpriteAnimStruct
call Function8c1c
ret
@ -1568,8 +1568,8 @@ Function8cb7:
ld hl, Text91c2
call PrintText
call WaitBGMap
ld de, $4c23
ld a, $44
depixel 9, 4, 4, 3
ld a, SPRITE_ANIM_INDEX_44
call InitSpriteAnimStruct
ld hl, $0002
add hl, bc
@ -1577,8 +1577,8 @@ Function8cb7:
ld hl, $0003
add hl, bc
ld [hl], $7c
ld de, $4030
ld a, $4b
depixel 8, 6
ld a, SPRITE_ANIM_INDEX_4B
call InitSpriteAnimStruct
ld hl, $0003
add hl, bc
@ -2486,19 +2486,19 @@ Function9604:
ld [hl], e
ret
Function962d:
LoadMagikarpPalettes_Intro:
ld hl, Data997c
jp Function964b
Function9633:
LoadForestPalettes2_Intro:
ld hl, Data986c
jp Function964b
Function9639:
LoadVenusaurPalettes_Intro:
ld hl, Data99ac
jp Function964b
Function963f:
LoadCharizardPalettes_Intro:
ld hl, Data99bc
jp Function964b

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,7 @@ DebugMenu::
DebugJumpTable::
dw DebugMenuOptionFight
dw DebugMenuOptionField
dw Function094c ; sound test
dw DebugMenuSoundTest ; to home bank
dw DebugMenuOptionSubGames
dw DebugMenuOptionMonsterTest
dw DebugMenuOptionName
@ -82,19 +82,19 @@ DebugMenuOptionSubGames::
DebugMenuOptionMonsterTest::
ld hl, wPokedexOwned
ld de, wPokedexSeen
ld b, $1F
ld a, $FF
ld b, NUM_POKEMON / 8
ld a, %11111111
.loop
ld [hl+], a
ld [hli], a
ld [de], a
inc de
dec b
jr nz, .loop
ld a, $03
ld a, (1 << ((NUM_POKEMON - 1) % 8)) - 1 ; discount #251
ld [hl], a
ld [de], a
callab MonsterTest
ld a, $e4
ld a, %11100100
ldh [rBGP], a
Function40eb::
@ -102,6 +102,131 @@ Function40eb::
DebugMenuOptionName::
callab OpenTrainerGear
ld a, $e4
ld a, %11100100
ldh [rBGP], a
jp DebugMenu
SECTION "engine/menu/debug_menu.asm@Sound Test", ROMX
_DebugMenuSoundTest::
call ClearTileMap
call LoadFontExtra
call ClearSprites
call GetMemSGBLayout
xor a
ldh [hDebugMenuSoundMenuIndex], a
call .DetermineDescriptionPointer
.RefreshScreenAndLoop:
call WaitBGMap
.Loop:
call ClearJoypad
call GetJoypad
ldh a, [hJoyDown]
and a
jr z, .Loop
bit A_BUTTON_F, a
jr nz, .a_pressed
bit B_BUTTON_F, a
jr nz, .b_pressed
bit START_F, a
jr nz, .start_pressed
bit D_UP_F, a
jr nz, .up_pressed
bit D_DOWN_F, a
jr nz, .down_pressed
ret
.a_pressed
ldh a, [hDebugMenuSoundBank]
ld c, a
ldh a, [hDebugMenuSoundID]
jr .RefreshScreenAndLoop
.up_pressed
ldh a, [hDebugMenuSoundMenuIndex]
inc a
cp 55
jr nz, .SetIndex
xor a
.SetIndex:
ldh [hDebugMenuSoundMenuIndex], a
call .DetermineDescriptionPointer
jr .RefreshScreenAndLoop
.down_pressed
ldh a, [hDebugMenuSoundMenuIndex]
dec a
cp -1
jr nz, .SetIndex2
ld a, 54
.SetIndex2:
ldh [hDebugMenuSoundMenuIndex], a
call .DetermineDescriptionPointer
jr .RefreshScreenAndLoop
.start_pressed
ldh a, [hDebugMenuSoundBank]
ld c, a
ld a, -1
jr .RefreshScreenAndLoop
.b_pressed
ldh a, [hDebugMenuSoundBank]
ld c, a
ld a, 10
ld [wcdb5], a
ld [wcdb6], a
ld a, $ff
ld [wcdb4], a
jr .RefreshScreenAndLoop
.DetermineDescriptionPointer:
ld hl, SoundTestTextPointers
ldh a, [hDebugMenuSoundMenuIndex]
add a
add a ; a * 4
ld d, 0
ld e, a
add hl, de
ld a, [hli]
ldh [hDebugMenuSoundID], a
ld a, [hli]
ldh [hDebugMenuSoundBank], a
ld a, [hli]
ld e, a
ld d, [hl]
call CopyStringToStringBuffer2
call .DisplayText
ret
.DisplayText:
ld hl, hDebugMenuSoundMenuIndex
inc [hl]
ld hl, .String
call PrintText
ld hl, hDebugMenuSoundMenuIndex
dec [hl]
ld c, 3
call DelayFrames
ret
.String:
deciram hDebugMenuSoundMenuIndex, 1, 1
text "<LINE>@"
text_from_ram wStartDay
text " "
done
INCLUDE "data/sound_test_text_pointers.inc"

View File

@ -147,8 +147,8 @@ GetNamingScreenSetup:
ld hl, wTileMapBackup
ld [hl+], a
ld [hl], $00
ld de, $2420
ld a, $41
depixel 4, 4, 4, 0
ld a, SPRITE_ANIM_INDEX_41
call InitSpriteAnimStruct
ld hl, $0001
add hl, bc
@ -180,8 +180,8 @@ GetNamingScreenSetup:
ld hl, wTileMapBackup
ld [hli], a
ld [hl], $00
ld de, $2420
ld a, $41
depixel 4, 4, 4, 0
ld a, SPRITE_ANIM_INDEX_41
call InitSpriteAnimStruct
ret
@ -301,8 +301,8 @@ NamingScreenJoypadLoop:
dw .ReadButtons
.InitCursor:
ld de, $5818
ld a, $39
depixel 11, 3, 0, 0
ld a, SPRITE_ANIM_INDEX_39
call InitSpriteAnimStruct
ld a, c
ld [wNamingScreenCursorObjectPointer], a
@ -728,14 +728,14 @@ ComposeMailMessage:
ld hl, wTileMapBackup
ld [hli], a
ld [hl], 0
ld de, $2420
ld a, 8
depixel 4, 4, 4, 0
ld a, SPRITE_ANIM_INDEX_08
call InitSpriteAnimStruct
ld hl, $0002
add hl, bc
ld [hl], 0
ld de, $5818
ld a, $39
depixel 11, 3, 0, 0
ld a, SPRITE_ANIM_INDEX_39
call InitSpriteAnimStruct
ld a, c
ld [wNamingScreenCursorObjectPointer], a
@ -945,14 +945,14 @@ SetupMail:
ld hl, wTileMapBackup
ld [hli], a
ld [hl], 0
ld de, $2420
ld a, 8
depixel 4, 4, 4, 0
ld a, SPRITE_ANIM_INDEX_08
call InitSpriteAnimStruct
ld hl, $0002
add hl, bc
ld [hl], 0
ld de, $6018
ld a, $40
depixel 12, 3, 0, 0
ld a, SPRITE_ANIM_INDEX_40
call InitSpriteAnimStruct
ld a, c
ld [wNamingScreenCursorObjectPointer], a

View File

@ -0,0 +1,341 @@
INCLUDE "constants.asm"
SECTION "engine/movie/game_freak_intro.asm", ROMX
GameFreakIntro::
; Copyright screen and Game Freak logo
call DisableLCD
call ClearVRAM
ld a, HIGH(vBGMap0)
ldh [hBGMapAddress + 1], a
xor a
ldh [hBGMapAddress], a
ldh [hJoyState], a
ldh [hSCX], a
ldh [hSCY], a
ld a, $90
ldh [hWY], a
call EnableLCD
ld c, 10
call DelayFrames
ld b, SGB_GS_TITLE_SCREEN
call GetSGBLayout
callab IntroCopyRightInfo
ld a, 1
ldh [hBGMapMode], a
call WaitBGMap
call SetPalettes
ld c, 3 * 60 ; 3 seconds
call DelayFrames
xor a
ldh [hWY], a
call ClearTileMap
call .Init
.loop
call .Frame
jr nc, .loop
; this was set if user skipped the GF logo by pressing A
ld a, [wJumptableIndex]
bit 6, a
jr nz, .cancelled
; clear carry flag from .PlayFrame
and a
ret
.cancelled
scf
ret
.Init:
call DisableLCD
ld hl, vBGMap0
ld bc, BG_MAP_WIDTH * SCREEN_HEIGHT
xor a
call ByteFill
ld de, GameFreakLogoGFX
ld hl, vChars1
lb bc, BANK(GameFreakLogoGFX), 28
call Get1bpp
ld hl, GameFreakLogoSparkleGFX
ld de, vChars1 tile $1C
ld bc, 5 tiles
ld a, BANK(GameFreakLogoSparkleGFX)
call FarCopyData
callba InitEffectObject
ld hl, wSpriteAnimDict
ld a, SPRITE_ANIM_DICT_GS_SPLASH
ld [hli], a
ld a, $8d
ld [hl], a
xor a
ld [wJumptableIndex], a
ld [wIntroSceneFrameCounter], a
ld [wIntroSceneTimer], a
ldh [hSCX], a
ldh [hSCY], a
ld a, 1
ldh [hBGMapMode], a
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
call EnableLCD
ld a, %11100100
ld a, %11100100 ; redundant
ldh [rOBP0], a
ld a, %00100100
ldh [rOBP1], a
ret
.Frame:
; Play one frame of GameFreakPresents sequence.
; Return carry when the sequence completes or is canceled.
ld hl, hJoypadDown
ld a, [hl]
and %00001111
jr nz, .pressed
ld a, [wJumptableIndex]
bit 7, a
jr nz, .Finished
callba EffectObjectJumpNoDelay
call GameFreakPresentsScene
call DelayFrame
and a
ret
.pressed
ld hl, wJumptableIndex
set 6, [hl]
.Finished:
callab InitEffectObject
call ClearTileMap
call ClearSprites
ld c, 16
call DelayFrames
scf
ret
GameFreakPresentsScene:
jumptable .scenes, wJumptableIndex
.scenes
dw GameFreakPresents_Wait64Frames
dw GameFreakPresents_Star
dw GameFreakPresents_PlaceLogo
dw GameFreakPresents_LogoSparkles
dw GameFreakPresents_PlacePresents
dw GameFreakPresents_WaitForTimer
dw GameFreakPresents_SetDoneFlag
GameFreakPresents_NextScene:
ld hl, wJumptableIndex
inc [hl]
ret
GameFreakPresents_Wait64Frames:
ld c, $40
call DelayFrames
call GameFreakPresents_NextScene
ret
GameFreakPresents_Star:
xor a
ld [wIntroSceneFrameCounter], a
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_GS_INTRO_STAR
call InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld [hl], $a0 ; star path radius
ld de, SFX_GAME_FREAK_LOGO_RG
call PlaySFX
call GameFreakPresents_NextScene
ret
GameFreakPresents_PlaceLogo:
ld a, [wIntroSceneFrameCounter]
and a
ret z
depixel 10, 11, 4, 0
ld a, SPRITE_ANIM_INDEX_GAMEFREAK_LOGO
call InitSpriteAnimStruct
call GameFreakPresents_NextScene
; set timer for the next scene
ld a, 128
ld [wIntroSceneTimer], a
ret
GameFreakPresents_LogoSparkles:
ld hl, wIntroSceneTimer
ld a, [hl]
and a
jr z, .done
dec [hl]
; add first text when timer passes half
cp 63
call z, GameFreakPresents_PlaceGameFreak
; add sparkles continuously
call GameFreakPresents_Sparkle
ret
.done
; set timer for the next scene and go there
ld [hl], 128
call GameFreakPresents_NextScene
ret
GameFreakPresents_PlaceGameFreak:
hlcoord 5, 12
ld de, .game_freak
call PlaceString
ret
.game_freak
; G A M E F R E A K
db $80, $81, $82, $83, $8d, $84, $85, $83, $81, $86
db "@"
GameFreakPresents_PlacePresents:
hlcoord 7, 13
ld de, .presents
call PlaceString
call GameFreakPresents_NextScene
ld a, $80
ld [wIntroSceneTimer], a
ret
.presents
; P R E S E N T S
db $87, $88, $89, $8a, $8b, $8c
db "@"
GameFreakPresents_SetDoneFlag:
ld hl, wJumptableIndex
set 7, [hl]
ret
GameFreakPresents_WaitForTimer:
ld hl, wIntroSceneTimer
ld a, [hl]
and a
jr z, .done
dec [hl]
ret
.done
call GameFreakPresents_NextScene
ret
GameFreakPresents_UpdateLogoPal:
; called from sprite animation routine
; once we reached the final state, leave it alone
ldh a, [rOBP1]
cp %10010000
ret z
; wait 16 frames before next change
ld a, [wIntroSceneTimer]
and $0f
ret nz
; rotate OBP1 by one color slot (2 bits)
ld hl, rOBP1
rrc [hl]
rrc [hl]
ret
GameFreakPresents_Sparkle:
; Initialize and configure a sparkle sprite.
; run only every second frame
ld d, a
and 1
ret nz
; shift over so our index is still changing by 1 each time
ld a, d
srl a
; set up a new sparkle sprite
push af
depixel 11, 11
ld a, SPRITE_ANIM_INDEX_GS_INTRO_SPARKLE
call InitSpriteAnimStruct
pop af
; take the bottom 4 bits of a as an index into
; sparkle_vectors (16 entries)
and %00001111
ld e, a
ld d, 0
ld hl, .vectors
add hl, de
add hl, de
; set the angle and distance for this sprite
ld e, l
ld d, h
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
add hl, bc
ld a, [de]
ld [hl], a ; angle
inc de
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld [hl], 0
inc hl ; SPRITEANIMSTRUCT_0D
ld a, [de]
ld [hl], a ; distance
ret
.vectors
db $00, $03
db $08, $04
db $04, $03
db $0c, $02
db $10, $02
db $18, $03
db $14, $04
db $1c, $03
db $20, $02
db $28, $02
db $24, $03
db $2c, $04
db $30, $04
db $38, $03
db $34, $02
db $3c, $04

View File

@ -1,6 +1,6 @@
INCLUDE "constants.asm"
SECTION "engine/intro.asm", ROMX
SECTION "engine/movie/oak_speech.asm", ROMX
DemoStart::
ld de, OakPic

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
INCLUDE "constants.asm"
SECTION "engine/title.asm@Title screen", ROMX
SECTION "engine/movie/title.asm@Title screen", ROMX
IntroSequence::
callab GameFreakIntro
@ -152,7 +152,7 @@ TitleSequenceInit::
ld d, [hl]
inc hl
push hl
ld a, $2E ; Title fire/note object effect type?
ld a, SPRITE_ANIM_INDEX_GS_TITLE_FLAME_NOTE
call InitSpriteAnimStruct
pop hl
pop bc
@ -161,12 +161,12 @@ TitleSequenceInit::
ret
FirePositionTable::
dw $4CE0
dw $58A0
dw $6490
dw $70D0
dw $7CB0
dw $8800
dbpixel 28, 9, 0, 4
dbpixel 20, 11, 0, 0
dbpixel 18, 12, 0, 4
dbpixel 26, 14, 0, 0
dbpixel 22, 15, 0, 4
dbpixel 0, 17, 0, 0
TitleFireGFX:: INCBIN "gfx/title/fire.2bpp"
TitleNotesGFX:: INCBIN "gfx/title/notes.2bpp"
@ -627,7 +627,7 @@ SetTitleGfxNext::
jr nz, .loop
ret
SECTION "engine/title.asm@Title screen TEMPORARY", ROMX
SECTION "engine/movie/title.asm@Title screen TEMPORARY", ROMX
GameInit::
call ClearWindowData

View File

@ -546,12 +546,22 @@ INCBIN "gfx/splash/game_freak_logo_oam.2bpp"
SECTION "gfx.asm@Intro Underwater GFX", ROMX
IntroUnderwaterGFX::
INCBIN "gfx/intro/underwater.2bpp"
SECTION "gfx.asm@Intro Water Mon and Forest GFX", ROMX
Intro_WaterTilemap::
INCBIN "gfx/intro/water_tilemap.bin"
Intro_WaterMeta::
INCBIN "gfx/intro/water.bin"
IntroWaterPokemonGFX::
INCBIN "gfx/intro/water_pokemon.2bpp"
SECTION "gfx.asm@Intro Forest GFX", ROMX
IntroForestGFX::
INCBIN "gfx/intro/forest.2bpp"
IntroForestLogGFX::
INCBIN "gfx/intro/forest_log.2bpp"
Intro_GrassTilemap::
INCBIN "gfx/intro/forest_tilemap.bin"
Intro_GrassMeta::
INCBIN "gfx/intro/forest.bin"
SECTION "gfx.asm@Intro Mon", ROMX
IntroJigglypuffPikachuGFX::

View File

@ -17,5 +17,11 @@ $(BUILD)/gfx/minigames/poker.2bpp: tools/gfx += --trim-whitespace
$(BUILD)/gfx/intro/jigglypuff_pikachu.2bpp: tools/gfx += --trim-whitespace
$(BUILD)/gfx/intro/%.bin: gfx/intro/%.bin
cp $< $@
$(BUILD)/gfx/minigames/%.bin: gfx/minigames/%.bin
cp $< $@
$(BUILD)/gfx/battle_anims/attack_animations_1.2bpp: tools/gfx += --trim-whitespace
$(BUILD)/gfx/battle_anims/attack_animations_2.2bpp: tools/gfx += --trim-whitespace

BIN
gfx/intro/forest.bin Normal file

Binary file not shown.

BIN
gfx/intro/forest_log.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

BIN
gfx/intro/water.bin Normal file

Binary file not shown.

BIN
gfx/intro/water_tilemap.bin Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -45,14 +45,14 @@ Function20f8::
ret
SECTION "home/unknown.asm@Unknown_094c", ROM0
SECTION "home/unknown.asm@Debug menu sound test call", ROM0
Function094c::
DebugMenuSoundTest::
ldh a, [hROMBank]
push af
ld a, BANK(Functionfe255)
ld a, BANK(_DebugMenuSoundTest)
call Bankswitch
call Functionfe255
call _DebugMenuSoundTest
pop af
call Bankswitch

View File

@ -42,7 +42,7 @@ ROM0
"home/serial.asm"
"home/interrupts.asm@Joypad dummy interrupt"
"home/joypad.asm"
"home/unknown.asm@Unknown_094c"
"home/unknown.asm@Debug menu sound test call"
"home/pic.asm"
"home/copy2.asm"
"home/text.asm"
@ -102,9 +102,9 @@ ROMX $01
"engine/menu/main_menu.asm@Initialize new game WRAM"
"engine/dumps/bank01.asm@Function5388"
"engine/menu/main_menu.asm@MainMenu"
"engine/intro.asm"
"engine/title.asm@Title screen"
"engine/title.asm@Title screen TEMPORARY"
"engine/movie/oak_speech.asm"
"engine/movie/title.asm@Title screen"
"engine/movie/title.asm@Title screen TEMPORARY"
"engine/predef.asm"
"engine/dumps/bank01.asm@ReanchorBGMap_NoOAMUpdate"
"engine/math/math.asm"
@ -884,6 +884,7 @@ ROMX $37
ROMX $38
org $4000
"engine/games/pikachu_minigame.asm@Pikachu Minigame"
org $5403
"gfx.asm@Poker GFX"
org $5f93
@ -895,14 +896,13 @@ ROMX $38
ROMX $39
org $4000
org $41ff
"engine/movie/game_freak_intro.asm"
"gfx.asm@Gamefreak Logo GFX"
org $4adf
"engine/movie/opening_cutscene.asm"
"gfx.asm@Intro Underwater GFX"
org $55ef
"gfx.asm@Intro Water Mon and Forest GFX"
org $626f
"gfx.asm@Intro Forest GFX"
"gfx.asm@Intro Mon"
"slack.asm@Unknowne7e9f"
ROMX $3a
org $4000
@ -945,6 +945,8 @@ ROMX $3f
"engine/landmarks.asm@2"
org $506f
"gfx.asm@Town Map Cursor"
org $6255
"engine/menu/debug_menu.asm@Sound Test"
WRAM0
org $c000

View File

@ -57,7 +57,21 @@ hJoyDebounceSrc:: db
hJoypadState2:: db
ds 6 ; TODO
UNION
hFFA7:: db
hFFA8:: db
hFFA9:: db
NEXTU
hDebugMenuSoundMenuIndex:: db
hDebugMenuSoundID:: db
hDebugMenuSoundBank:: db
ENDU
ds 3 ; TODO
hGraphicStartTile:: db
hMoveMon:: db
@ -124,6 +138,7 @@ ENDU
ds 3 ; TODO
hCurSpriteYCoord::
hFFC0:: ds 1
ds 6

View File

@ -100,6 +100,26 @@ UNION
wTileMapBackup::
ds SCREEN_HEIGHT * SCREEN_WIDTH
NEXTU
wSpriteAnimDict:: ds 10 * 2 ; NUM_SPRITEANIMDICT_ENTRIES * 2
wSpriteAnimationStructs::
; field 0: index
; fields 1-3: loaded from SpriteAnimSeqData
wSpriteAnim1:: sprite_anim_struct wSpriteAnim1
wSpriteAnim2:: sprite_anim_struct wSpriteAnim2
wSpriteAnim3:: sprite_anim_struct wSpriteAnim3
wSpriteAnim4:: sprite_anim_struct wSpriteAnim4
wSpriteAnim5:: sprite_anim_struct wSpriteAnim5
wSpriteAnim6:: sprite_anim_struct wSpriteAnim6
wSpriteAnim7:: sprite_anim_struct wSpriteAnim7
wSpriteAnim8:: sprite_anim_struct wSpriteAnim8
wSpriteAnim9:: sprite_anim_struct wSpriteAnim9
wSpriteAnim10:: sprite_anim_struct wSpriteAnim10
wSpriteAnimationStructsEnd::
wSpriteAnimCount:: db
NEXTU
ds 1
@ -126,7 +146,10 @@ wSpriteAnimIDBuffer:: db
ds 6
wGlobalAnimYOffset::
wc4c7:: db
wGlobalAnimXOffset::
wc4c8:: db
ds 7
@ -160,6 +183,7 @@ wMapBufferEnd::
UNION
wc600::
wOverworldMapBlocks:: ds 1300
wOverworldMapBlocksEnd::
@ -172,8 +196,59 @@ wLYOverrides2:: ds SCREEN_HEIGHT_PX
wLYOverrides2End::
NEXTU
; Battle-related
; Pikachu minigame
wPikachuMinigamePikachuObjectPointer:: ds 2
wPikachuMinigamePikachuTailObjectPointer:: ds 2
wPikachuMinigamePikachuNextAnim:: ds 1
wPikachuMinigameControlEnable:: ds 1
wc606:: ds 1 ; written to, but is this read from?
wPikachuMinigamePikachuYOffset:: ds 1
wPikachuMinigameNoteTimer:: ds 1
wPikachuMinigameScore:: ds 2
wPikachuMinigameNoteCounter:: ds 2 ; not used for anything meaningful?
wPikachuMinigameSpawnTypeIndex:: ds 1
wPikachuMinigameSpawnDataIndex:: ds 1
wPikachuMinigameScoreModifier:: ds 1
wPikachuMinigameNoteCaught:: ds 1
; Time keeping
wPikachuMinigameTimeFrames:: ds 1
wPikachuMinigameTimeSeconds:: ds 1
; are these two used?
wc613:: ds 1
wc614:: ds 1
wPikachuMinigameRedrawTimer:: ds 1
wc616:: ds 1
wPikachuMinigameScrollSpeed:: ds 1
wPikachuMinigameColumnFlags:: ds 1
wPikachuMinigameSavedColumnPointer:: ds 2
wPikachuMinigameColumnPointer:: ds 2
wPikachuMinigameRepeatColumnCounter:: ds 1
wPikachuMinigameRepeatColumnCounter2:: ds 1
wPikachuMinigameSceneTimer:: ds 1
wPikachuMinigameJumptableIndex:: ds 1
wPikachuMinigameBGMapPointer:: ds 2
wPikachuMinigameTilemapPointer:: ds 2
wPikachuMinigameTilesPointer:: ds 2
wPikachuMinigameColumnBuffer:: ds 16
NEXTU
; Battle-related
ds $1ea
wActiveBGEffects::
@ -240,13 +315,31 @@ wca0a:: ds 1
ds 5 ; TODO
wIntroJumptableIndex::
wca10:: ds 1
UNION
wIntroBGMapPointer:: ds 2
NEXTU
wca11:: ds 1
wca12:: ds 1
ENDU
UNION
wIntroTilemapPointer:: ds 2
NEXTU
wca13:: ds 1
wca14:: ds 1
ENDU
ds $22 ; TODO
wIntroTilesPointer:: ds 2
wIntroFrameCounter1:: ds 1
wIntroFrameCounter2:: ds 1
wIntroSpriteStateFlag:: ds 1
ds $1d ; TODO
wca37:: ds 1
wca38:: ds 1
@ -342,10 +435,12 @@ SECTION "CB5E", WRAM0[$CB5E]
wJumptableIndex:: db
wFlyDestination::
wIntroSceneFrameCounter::
wBattleTransitionCounter:: db
wBattleTransitionSineWaveOffset::
wBattleTransitionSpinQuadrant::
wIntroSceneTimer::
wcb60:: ds 1
wcb61:: ds 1
@ -644,6 +739,12 @@ wTalkingTargetType:: db
wcdb1:: ds 1
wcdb2:: ds 1
ds 1
wcdb4:: ds 1
wcdb5:: ds 1
wcdb6:: ds 1
SECTION "CDB9", WRAM0[$CDB9]
wcdb9:: ds 1

View File

@ -26,3 +26,9 @@ SECTION "slack.asm@Corrupted Sprites", ROMX
CorruptedSpriteGFX:
INCBIN "slack/sprites_corrupted.2bpp"
SECTION "slack.asm@Unknowne7e9f", ROMX
Unknowne7e9f:
INCBIN "slack/unknown_e7e9f.bin" ; Loaded as corrupted graphics

BIN
slack/unknown_e7e9f.bin Normal file

Binary file not shown.