diff options
-rw-r--r-- | constants.asm | 1 | ||||
-rw-r--r-- | constants/sfx_constants.asm | 4 | ||||
-rwxr-xr-x | constants/sprite_anim_constants.asm | 12 | ||||
-rwxr-xr-x | engine/dumps/bank02.asm | 8 | ||||
-rw-r--r-- | engine/movie/game_freak_intro.asm | 12 | ||||
-rw-r--r-- | engine/movie/opening_cutscene.asm | 136 | ||||
-rw-r--r-- | gfx/gfx.asm | 2 | ||||
-rw-r--r-- | gfx/intro/forest_log.png | bin | 0 -> 5480 bytes | |||
-rw-r--r-- | gfx/intro/forest_tilemap.bin | bin | 288 -> 256 bytes | |||
-rw-r--r-- | ram/wram.asm | 1 |
10 files changed, 90 insertions, 86 deletions
diff --git a/constants.asm b/constants.asm index 19c002d..1e79e49 100644 --- a/constants.asm +++ b/constants.asm @@ -35,6 +35,7 @@ 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" diff --git a/constants/sfx_constants.asm b/constants/sfx_constants.asm new file mode 100644 index 0000000..9000814 --- /dev/null +++ b/constants/sfx_constants.asm @@ -0,0 +1,4 @@ +; TODO + +SFX_GAME_FREAK_LOGO_RG EQU $31 + diff --git a/constants/sprite_anim_constants.asm b/constants/sprite_anim_constants.asm index 928b601..af60e02 100755 --- a/constants/sprite_anim_constants.asm +++ b/constants/sprite_anim_constants.asm @@ -19,15 +19,9 @@ SPRITEANIMSTRUCT_LENGTH EQU const_value ; wSpriteAnimDict keys - const_def - const SPRITE_ANIM_DICT_DEFAULT ; 0 - const SPRITE_ANIM_DICT_GS_INTRO ; 1 - const SPRITE_ANIM_DICT_GS_INTRO_2 ; 2 - const_skip 2 ; unused - const SPRITE_ANIM_DICT_TEXT_CURSOR ; 5 - const SPRITE_ANIM_DICT_GS_SPLASH ; 6 - const SPRITE_ANIM_DICT_SLOTS ; 7 - const SPRITE_ANIM_DICT_ARROW_CURSOR ; 8 +SPRITE_ANIM_DICT_DEFAULT EQU $00 +SPRITE_ANIM_DICT_GS_SPLASH EQU $27 + ; wSpriteAnimDict size (see ram/wram.asm) NUM_SPRITEANIMDICT_ENTRIES EQU 10 diff --git a/engine/dumps/bank02.asm b/engine/dumps/bank02.asm index aa9ec80..1db4285 100755 --- a/engine/dumps/bank02.asm +++ b/engine/dumps/bank02.asm @@ -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 diff --git a/engine/movie/game_freak_intro.asm b/engine/movie/game_freak_intro.asm index 456197d..9ae95c9 100644 --- a/engine/movie/game_freak_intro.asm +++ b/engine/movie/game_freak_intro.asm @@ -80,7 +80,7 @@ GameFreakIntro:: callba InitEffectObject ld hl, wSpriteAnimDict - ld a, $27 ; SPRITE_ANIM_DICT_GS_SPLASH + ld a, SPRITE_ANIM_DICT_GS_SPLASH ld [hli], a ld a, $8d ld [hl], a @@ -172,11 +172,11 @@ GameFreakPresents_Star: ld a, SPRITE_ANIM_INDEX_GS_INTRO_STAR call InitSpriteAnimStruct - ld hl, $000c ; SPRITEANIMSTRUCT_VAR1 + ld hl, SPRITEANIMSTRUCT_0C add hl, bc ld [hl], $a0 ; star path radius - ld de, $0031 ; SFX_GAME_FREAK_LOGO (metronome?) + ld de, SFX_GAME_FREAK_LOGO_RG call PlaySFX call GameFreakPresents_NextScene ret @@ -309,15 +309,15 @@ GameFreakPresents_Sparkle: ; set the angle and distance for this sprite ld e, l ld d, h - ld hl, $b ; SPRITEANIMSTRUCT_JUMPTABLE_INDEX + ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX add hl, bc ld a, [de] ld [hl], a ; angle inc de - ld hl, $c ; SPRITEANIMSTRUCT_VAR1 + ld hl, SPRITEANIMSTRUCT_0C add hl, bc ld [hl], 0 - inc hl ; SPRITEANIMSTRUCT_VAR2 + inc hl ; SPRITEANIMSTRUCT_0D ld a, [de] ld [hl], a ; distance ret diff --git a/engine/movie/opening_cutscene.asm b/engine/movie/opening_cutscene.asm index 4b60625..c98050d 100644 --- a/engine/movie/opening_cutscene.asm +++ b/engine/movie/opening_cutscene.asm @@ -19,7 +19,7 @@ OpeningCutscene:: .PlayFrame: ld hl, hJoypadDown ld a, [hl] - and %00001111 + and $f jr nz, .Finish ; check done flag @@ -70,7 +70,7 @@ IntroSceneJumper: dw IntroScene16 dw IntroScene17 -IntroScene1: ; 43b8 +IntroScene1: ; Set up water cutscene ld hl, wIntroJumptableIndex inc [hl] @@ -101,8 +101,8 @@ IntroScene1: ; 43b8 ld a, h ld [wIntroBGMapPointer + 1], a -; Load water tilemap - ld de, Intro_WaterTilemap + 15 tiles +; Load water tilemap (shifted to starting position) + ld de, Intro_WaterTilemap + $F0 ld a, e ld [wIntroTilemapPointer + 0], a ld a, d @@ -159,7 +159,7 @@ IntroScene1: ; 43b8 call Intro_InitOmanyte ret -IntroScene2: ; 444a +IntroScene2: call Intro_UpdateLYOverrides ld hl, wIntroFrameCounter1 ld a, [hl] @@ -194,7 +194,7 @@ IntroScene4: ld hl, wIntroFrameCounter2 inc [hl] ld a, [hl] - and $07 + and $7 jr nz, .skip_move_left ld hl, hSCX dec [hl] @@ -210,7 +210,7 @@ IntroScene4: ld [wIntroFrameCounter1], a IntroScene5: -; fade out +; scroll right and fade out to white ld hl, wIntroFrameCounter1 ld a, [hl] inc [hl] @@ -235,11 +235,11 @@ IntroScene5: ret .palettes: - db %11100100 - db %11100100 - db %10010000 - db %01000000 - db %00000000 + dc 3, 2, 1, 0 + dc 3, 2, 1, 0 + dc 2, 1, 0, 0 + dc 1, 0, 0, 0 + dc 0, 0, 0, 0 db -1 IntroScene17: @@ -287,7 +287,8 @@ IntroScene3_ScrollToSurface: IntroScene3_Jumper: jumptable .subroutines, wIntroFrameCounter1 -.subroutines + +.subroutines: dw .scene3_2 dw .scene3_2 dw .scene3_2 @@ -310,8 +311,9 @@ IntroScene3_Jumper: call Intro_InitLapras ld a, %11100100 ldh [rOBP0], a +; fallthrough -.scene3_2: ; fallthrough +.scene3_2: call Intro_AnimateOceanWaves ret @@ -328,7 +330,7 @@ IntroScene3_Jumper: call Intro_InitMagikarps ret .load_palettes - callab Function962d ; load magikarp palettes + callab LoadMagikarpPalettes_Intro ret .scene3_5: @@ -343,14 +345,14 @@ IntroScene3_Jumper: Intro_InitBubble: ld hl, wIntroFrameCounter1 ld a, [hl] - and $0f + and $f ret nz ld a, [hl] and $70 swap a ld e, a - ld d, $00 + ld d, 0 ld hl, .pixel_table add hl, de add hl, de @@ -361,7 +363,7 @@ Intro_InitBubble: call InitSpriteAnimStruct ret -.pixel_table +.pixel_table: dbpixel 6, 14, 0, 4 dbpixel 14, 18, 0, 4 dbpixel 10, 16, 0, 4 @@ -417,7 +419,7 @@ Intro_InitOmanyte: depixel 14, 10 call .PlaceOmanyte depixel 16, 15 -; fallback +; fallthrough .PlaceOmanyte: ld a, SPRITE_ANIM_INDEX_GS_INTRO_OMANYTE @@ -448,7 +450,7 @@ Intro_UpdateTilemapAndBGMap: ld e, a ld a, [wIntroTilemapPointer + 1] ld d, a - ld hl, -$10 + ld hl, -BG_MAP_WIDTH / 2 add hl, de ld a, l ld e, l @@ -490,7 +492,6 @@ Intro_UpdateTilemapAndBGMap: pop hl ret - Intro_AnimateOceanWaves: ; uses a 2bpp request to copy tile IDs to the BG map ld hl, wIntroFrameCounter2 @@ -513,13 +514,14 @@ endr ld [wVBCopySrc], a ld a, h ld [wVBCopySrc + 1], a - ld a, LOW(vBGMap0 + (15 * BG_MAP_WIDTH)) ; vBGMap0 row 15 + ld a, LOW(vBGMap0 + 15 * BG_MAP_WIDTH) ld [wVBCopyDst], a - ld a, HIGH(vBGMap0 + (15 * BG_MAP_WIDTH)) ; vBGMap0 row 15 + ld a, HIGH(vBGMap0 + 15 * BG_MAP_WIDTH) ld [wVBCopyDst + 1], a ld a, 2 ld [wVBCopySize], a ret + .wave_tiles: ; Fill an entire bg map row with each frame rept 8 @@ -593,7 +595,7 @@ Intro_UpdateLYOverrides: ret IntroScene6: -; Set up grass cutscene (Pikachu/Jigglypuff) +; Set up grass cutscene (Pikachu / Jigglypuff) ld hl, wIntroJumptableIndex inc [hl] call DisableLCD @@ -614,7 +616,7 @@ IntroScene6: ld [wIntroBGMapPointer + 0], a ld a, h ld [wIntroBGMapPointer + 1], a - ld de, Intro_GrassTilemap + 2 tiles + ld de, Intro_GrassTilemap ld a, e ld [wIntroTilemapPointer + 0], a ld a, d @@ -622,7 +624,7 @@ IntroScene6: call Intro_DrawBackground ld hl, IntroJigglypuffPikachuGFX ld de, vChars0 - ld bc, $0a00 + ld bc, 160 tiles ; last 16 tiles actually belong to charizard's gfx .load ld a, [hli] @@ -648,7 +650,7 @@ IntroScene6: xor a ld [wIntroFrameCounter2], a call EnableLCD - ld a, $e4 + ld a, %11100100 ldh [rBGP], a ldh [rOBP0], a call Intro_InitJigglypuff @@ -661,7 +663,7 @@ IntroScene7: ld hl, wIntroFrameCounter2 ld a, [hl] inc [hl] - and $03 + and $3 ret z ld hl, hSCX @@ -698,7 +700,7 @@ IntroScene8: ld [wIntroFrameCounter1], a ld hl, wIntroJumptableIndex inc [hl] - callab Function9633 + callab LoadForestPalettes2_Intro ret IntroScene9: @@ -706,9 +708,9 @@ IntroScene9: ld a, [hl] inc [hl] swap a - and $0f + and $f ld e, a - ld d, $00 + ld d, 0 ld hl, .palettes add hl, de ld a, [hl] @@ -729,20 +731,19 @@ IntroScene9: .palettes: ; fade out to black - db %11100100 - db %11100100 - db %11100100 - db %11100100 - db %11100100 - db %11111001 - db %11111110 - db %11111111 + dc 3, 2, 1, 0 + dc 3, 2, 1, 0 + dc 3, 2, 1, 0 + dc 3, 2, 1, 0 + dc 3, 2, 1, 0 + dc 3, 3, 2, 1 + dc 3, 3, 3, 2 + dc 3, 3, 3, 3 db 0 Intro_DummyFunction: ret - Intro_InitNote: ld a, [wIntroSpriteStateFlag] and a @@ -768,14 +769,12 @@ Intro_InitNote: call InitSpriteAnimStruct ret - Intro_InitJigglypuff: depixel 14, 6 ld a, SPRITE_ANIM_INDEX_GS_INTRO_JIGGLYPUFF call InitSpriteAnimStruct ret - Intro_InitPikachu: depixel 14, 24 ld a, SPRITE_ANIM_INDEX_GS_INTRO_PIKACHU @@ -884,10 +883,10 @@ IntroScene12: ret .palettes: - db %01101010 - db %10100101 - db %11100100 - db %00000000 + dc 1, 2, 2, 2 + dc 2, 2, 1, 1 + dc 3, 2, 1, 0 + dc 0, 0, 0, 0 IntroScene13: ; Charizard mouth open @@ -951,13 +950,13 @@ IntroScene16: ld a, [hl] inc [hl] swap a - and $07 + and $7 ld e, a - ld d, $00 + ld d, 0 ld hl, .palettes add hl, de ld a, [hl] - cp $ff + cp -1 jr z, .next ldh [rBGP], a ldh [rOBP0], a @@ -966,16 +965,18 @@ IntroScene16: ld hl, wIntroJumptableIndex inc [hl] ret + .palettes: - db %11100100 - db %10010000 - db %01000000 - db %00000000 + dc 3, 2, 1, 0 + dc 2, 1, 0, 0 + dc 1, 0, 0, 0 + dc 0, 0, 0, 0 db -1 Intro_BlankTilemapAndBGMap: hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT + .blank_tilemap ld [hl], 0 inc hl @@ -984,8 +985,9 @@ Intro_BlankTilemapAndBGMap: or c jr nz, .blank_tilemap - ld hl, wOverworldMapBlocks ; $c600, buffer + ld hl, wc600 ld bc, BG_MAP_WIDTH * BG_MAP_HEIGHT + .blank_bgmap ld [hl], 0 inc hl @@ -995,12 +997,11 @@ Intro_BlankTilemapAndBGMap: jr nz, .blank_bgmap ld hl, vBGMap0 - ld de, wOverworldMapBlocks ; $c600, buffer + ld de, wc600 lb bc, BANK(@), $40 call Request2bpp ret - Intro_CheckSCYEvent: ldh a, [hSCY] ld c, a @@ -1056,14 +1057,13 @@ Intro_FlashSilhouette: ret Intro_LoadVenusaurPalette: - callab Function9639 + callab LoadVenusaurPalettes_Intro ret Intro_LoadCharizardPalette: - callab Function963f + callab LoadCharizardPalettes_Intro ret - DrawIntroCharizardGraphic: push af hlcoord 0, 6 @@ -1076,7 +1076,7 @@ DrawIntroCharizardGraphic: pop af ld e, a - ld d, $00 + ld d, 0 ld hl, .charizard_data rept 5 add hl, de @@ -1117,10 +1117,15 @@ endr ldh [hBGMapMode], a ret -.charizard_data - db $00, $08, $08, $22, $c3 - db $40, $09, $08, $21, $c3 - db $88, $09, $08, $20, $c3 +.charizard_data: +intro_graphic_def: MACRO + db \1 + db \2, \3 + dwcoord \4, \5 +ENDM + intro_graphic_def $00, 8, 8, 10, 6 + intro_graphic_def $40, 9, 8, 9, 6 + intro_graphic_def $88, 9, 8, 8, 6 Intro_AnimateFireball: ld hl, wIntroFrameCounter2 @@ -1161,7 +1166,6 @@ Intro_Copy128Tiles: jr nz, .loop ret - Intro_DrawBackground: ld b, BG_MAP_WIDTH / 2 .outer_loop @@ -1180,7 +1184,6 @@ Intro_DrawBackground: jr nz, .outer_loop ret - Intro_Draw2x2Tiles: push bc push de @@ -1223,7 +1226,6 @@ Intro_Draw2x2Tiles: pop bc ret - Intro_ResetLYOverrides: ld hl, wLYOverrides xor a diff --git a/gfx/gfx.asm b/gfx/gfx.asm index 9613e8a..8c3fb8a 100644 --- a/gfx/gfx.asm +++ b/gfx/gfx.asm @@ -556,6 +556,8 @@ 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:: diff --git a/gfx/intro/forest_log.png b/gfx/intro/forest_log.png Binary files differnew file mode 100644 index 0000000..deb5987 --- /dev/null +++ b/gfx/intro/forest_log.png diff --git a/gfx/intro/forest_tilemap.bin b/gfx/intro/forest_tilemap.bin Binary files differindex fb1179d..c3a8420 100644 --- a/gfx/intro/forest_tilemap.bin +++ b/gfx/intro/forest_tilemap.bin diff --git a/ram/wram.asm b/ram/wram.asm index 95ac322..c861704 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -172,6 +172,7 @@ wMapBufferEnd:: UNION +wc600:: wOverworldMapBlocks:: ds 1300 wOverworldMapBlocksEnd:: |