diff options
author | entrpntr <entrpntr@gmail.com> | 2020-06-10 19:49:54 -0400 |
---|---|---|
committer | entrpntr <entrpntr@gmail.com> | 2020-06-10 20:33:24 -0400 |
commit | a1c33b58a89c29ef52e3bc9399be1491dbd1d33d (patch) | |
tree | bebc3dc6468694aa38115b275da3688c3f810519 | |
parent | 80b52ec275bd7f82ddc8c94c5728be59392810ca (diff) |
More cleanup.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | engine/gfx/sprite_anims.asm | 2 | ||||
-rw-r--r-- | engine/movie/gamefreak_presents.asm | 35 | ||||
-rw-r--r-- | engine/movie/gs_intro.asm | 83 | ||||
-rw-r--r-- | gfx/title/hooh_gold.png | bin | 0 -> 1005 bytes | |||
-rw-r--r-- | gfx/title/lugia_silver.png | bin | 0 -> 581 bytes | |||
-rw-r--r-- | gfx/title/title_trail_gold.2bpp | bin | 128 -> 64 bytes | |||
-rw-r--r-- | gfx/title/title_trail_gold.png | bin | 0 -> 119 bytes | |||
-rw-r--r-- | gfx/title/title_trail_silver.png | bin | 0 -> 99 bytes | |||
-rw-r--r-- | main.asm | 1 | ||||
-rw-r--r-- | tools/gfx.py | 19 | ||||
-rw-r--r-- | wram.asm | 7 |
12 files changed, 76 insertions, 72 deletions
@@ -76,3 +76,4 @@ gfx/unown_puzzle/hooh.2bpp gfx/unown_puzzle/kabuto.2bpp gfx/unown_puzzle/omanyte.2bpp gfx/unown_puzzle/start_cancel.2bpp +gfx/intro/*.2bpp diff --git a/engine/gfx/sprite_anims.asm b/engine/gfx/sprite_anims.asm index d288cd17..b32a3d27 100644 --- a/engine/gfx/sprite_anims.asm +++ b/engine/gfx/sprite_anims.asm @@ -997,7 +997,7 @@ ENDC .asm_8d968 ld a, 1 - ld [wce64], a + ld [wIntroSceneFrameCounter], a call DeinitializeSprite ret diff --git a/engine/movie/gamefreak_presents.asm b/engine/movie/gamefreak_presents.asm index f4c2c5cc..69e34588 100644 --- a/engine/movie/gamefreak_presents.asm +++ b/engine/movie/gamefreak_presents.asm @@ -27,7 +27,7 @@ Copyright_GFPresents: call .GetGFLogoGFX .loop - call GFPresents_PlayFrame + call .PlayFrame jr nc, .loop ; high bits of wJumptableIndex are recycled for some flags @@ -78,7 +78,7 @@ Copyright_GFPresents: call DmgToCgbObjPals ret -GFPresents_PlayFrame: +.PlayFrame: ; Play one frame of GFPresents sequence. ; Return carry when the sequence completes or is canceled. @@ -95,7 +95,7 @@ GFPresents_PlayFrame: farcall PlaySpriteAnimations - call GFPresents_HandleFrame + call GFPresentsJumper call DelayFrame ; ensure carry is cleared @@ -118,19 +118,8 @@ GFPresents_PlayFrame: scf ret -GFPresents_HandleFrame: -; Dispatch to the current scene handler - - ld a, [wJumptableIndex] - ld e, a - ld d, 0 - ld hl, .scenes - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp hl +GFPresentsJumper: + jumptable .scenes, wJumptableIndex .scenes dw GFPresents_Star @@ -145,15 +134,13 @@ GFPresents_NextScene: inc [hl] ret -; unused? -Functione4a8d: +Unreferenced_Functione4a8d: ld c, 64 call DelayFrames call GFPresents_NextScene ret GFPresents_Star: - ; tell GFPresents_PlaceLogo we haven't finished yet xor a ld [wIntroSceneFrameCounter], a @@ -162,8 +149,7 @@ GFPresents_Star: ld a, SPRITE_ANIM_INDEX_GS_INTRO_STAR call InitSpriteAnimStruct - ; TODO set some flag in the struct? - ld hl, $c + ld hl, SPRITEANIMSTRUCT_0C add hl, bc ld [hl], $80 @@ -177,7 +163,7 @@ GFPresents_PlaceLogo: ; Draw the Game Freak logo (may be initially invisible due to palette) ; wait until the star animation completed - ; TODO this is cleared above, but when is it set? + ; this counter is set in DoAnimFrame.GSIntroStar in engine/gfx/sprite_anims.asm ld a, [wIntroSceneFrameCounter] and a ret z @@ -194,7 +180,6 @@ GFPresents_PlaceLogo: ret GFPresents_LogoSparkles: - ld hl, wIntroSceneTimer ld a, [hl] and a @@ -210,7 +195,7 @@ GFPresents_LogoSparkles: ret .done - ; set (unused?) timer for GFPresents_PlacePresents + ; set timer for GFPresents_PlacePresents ld [hl], $80 call GFPresents_NextScene ret @@ -286,8 +271,6 @@ GFPresents_UpdateLogoPal: GFPresents_Sparkle: ; Initialize and configure a sparkle sprite. -; TODO unclear how this relates to the actual screen display, -; seems to be called more times than there are visible sparkles? ; run only every second frame ld d, a diff --git a/engine/movie/gs_intro.asm b/engine/movie/gs_intro.asm index 9ef08929..a031ccfa 100644 --- a/engine/movie/gs_intro.asm +++ b/engine/movie/gs_intro.asm @@ -1,7 +1,7 @@ GoldSilverIntro: call .Init .Loop: - call .Joypad + call .PlayFrame jr nc, .Loop ret @@ -12,7 +12,7 @@ GoldSilverIntro: ldh [hBGMapMode], a ret -.Joypad: +.PlayFrame: call JoyTextDelay ldh a, [hJoyLast] and BUTTONS @@ -46,9 +46,9 @@ GoldSilverIntro: ret IntroSceneJumper: - jumptable .IntroScenes, wIntroJumptableIndex + jumptable .scenes, wIntroJumptableIndex -.IntroScenes: +.scenes dw IntroScene1 dw IntroScene2 dw IntroScene3 @@ -122,9 +122,9 @@ IntroScene1: ld a, $58 ldh [hSCX], a xor a - ld [wIntroSceneFrameCounter2], a + ld [wIntroFrameCounter2], a ld a, $80 - ld [wIntroSceneFrameCounter1], a + ld [wIntroFrameCounter1], a ld a, $42 ldh [hLCDCPointer], a call Functione5095 @@ -148,7 +148,7 @@ IntroScene1: IntroScene2: ; shellders underwater call Functione50af - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 ld a, [hl] and a jr z, .skip_intro @@ -178,7 +178,7 @@ IntroScene4: ld a, [wcb19] and a jr nz, .next - ld hl, wIntroSceneFrameCounter2 + ld hl, wIntroFrameCounter2 inc [hl] ld a, [hl] and $f @@ -195,11 +195,11 @@ IntroScene4: ld hl, wIntroJumptableIndex inc [hl] xor a - ld [wIntroSceneFrameCounter1], a + ld [wIntroFrameCounter1], a IntroScene5: ; fade out - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 ld a, [hl] inc [hl] swap a @@ -234,12 +234,13 @@ IntroScene17: call DelayFrame dec c jr nz, .loop +; set done flag ld hl, wIntroJumptableIndex set 7, [hl] ret Functione4e67: - ld hl, wIntroSceneFrameCounter2 + ld hl, wIntroFrameCounter2 inc [hl] ld a, [hl] and 3 @@ -257,7 +258,7 @@ Functione4e67: dec [hl] and $f call z, Intro_UpdateTilemapAndBGMap - ld a, [wIntroSceneFrameCounter1] + ld a, [wIntroFrameCounter1] and a jr z, .asm_e4e8e @@ -270,7 +271,7 @@ Functione4e67: ret Functione4e90: - jumptable .dw, wIntroSceneFrameCounter1 + jumptable .dw, wIntroFrameCounter1 .dw dw Functione4eca @@ -307,7 +308,7 @@ Functione4ece: ret Functione4ed5: - ld hl, wIntroSceneFrameCounter2 + ld hl, wIntroFrameCounter2 ld a, [hl] and %00011111 jr z, .asm_e4ee1 @@ -328,7 +329,7 @@ Functione4eec: ret Intro_InitBubble: - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 ld a, [hl] and $f ret nz @@ -363,7 +364,7 @@ Intro_InitMagikarps: depixel 4, 3, 0, 7 .ok - ld hl, wIntroSceneFrameCounter2 + ld hl, wIntroFrameCounter2 ld a, [hl] and e ret nz @@ -405,7 +406,7 @@ Intro_InitShellders: ret Intro_InitLapras: - ld a, [wIntroSceneFrameCounter2] + ld a, [wIntroFrameCounter2] and %00011111 ret nz depixel 16, 24 @@ -464,7 +465,7 @@ Intro_UpdateTilemapAndBGMap: ld [wRequested2bppSource + 1], a ld a, 4 ld [wRequested2bppSize], a - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 dec [hl] pop de @@ -473,7 +474,7 @@ Intro_UpdateTilemapAndBGMap: Functione4fde: ; something to do with water scene sprite anims? - ld hl, wIntroSceneFrameCounter2 + ld hl, wIntroFrameCounter2 ld a, [hl] and 3 cp 3 @@ -616,7 +617,7 @@ IntroScene6: ld [wGlobalAnimXOffset], a xor a - ld [wIntroSceneFrameCounter2], a + ld [wIntroFrameCounter2], a call EnableLCD ld b, SCGB_GS_INTRO ld c, 1 @@ -633,7 +634,7 @@ IntroScene6: IntroScene7: ; scroll left to Jigglypuff call Intro_InitNote - ld hl, wIntroSceneFrameCounter2 + ld hl, wIntroFrameCounter2 ld a, [hl] inc [hl] and 3 @@ -649,7 +650,7 @@ IntroScene7: .next ld a, -1 - ld [wIntroSceneFrameCounter1], a + ld [wIntroFrameCounter1], a call Intro_InitPikachu ld hl, wIntroJumptableIndex inc [hl] @@ -657,19 +658,19 @@ IntroScene7: IntroScene8: ; stop scrolling, Pikachu attacks - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 ld a, [hl] and a jr z, .next dec [hl] call Intro_InitNote - ld hl, wIntroSceneFrameCounter2 + ld hl, wIntroFrameCounter2 inc [hl] ret .next xor a - ld [wIntroSceneFrameCounter1], a + ld [wIntroFrameCounter1], a ld hl, wIntroJumptableIndex inc [hl] callfar Function9136 @@ -677,7 +678,7 @@ IntroScene8: IntroScene9: ; scroll down and fade out - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 ld a, [hl] inc [hl] srl a @@ -713,7 +714,7 @@ Intro_InitNote: ld a, [wcb19] and a ret nz - ld hl, wIntroSceneFrameCounter2 + ld hl, wIntroFrameCounter2 ld a, [hl] and %00111111 ret nz @@ -793,7 +794,7 @@ IntroScene10: ld [wGlobalAnimXOffset], a xor a - ld [wIntroSceneFrameCounter2], a + ld [wIntroFrameCounter2], a ld b, SCGB_GS_INTRO ld c, 2 call GetSGBLayout @@ -810,7 +811,7 @@ IntroScene10: IntroScene11: ; scroll up to Charizard silhoutte, flash Johto starters - ld hl, wIntroSceneFrameCounter2 + ld hl, wIntroFrameCounter2 ld a, [hl] inc [hl] and 1 @@ -827,12 +828,12 @@ IntroScene11: ld hl, wIntroJumptableIndex inc [hl] xor a - ld [wIntroSceneFrameCounter1], a + ld [wIntroFrameCounter1], a ; fall through IntroScene12: ; load Charizard palettes - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 ld a, [hl] inc [hl] srl a @@ -855,7 +856,7 @@ IntroScene12: ld hl, wIntroJumptableIndex inc [hl] ld a, $80 - ld [wIntroSceneFrameCounter1], a + ld [wIntroFrameCounter1], a ret .palettes @@ -863,7 +864,7 @@ IntroScene12: IntroScene13: ; Charizard mouth closed - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 ld a, [hl] and a jr z, .next @@ -876,12 +877,12 @@ IntroScene13: ld a, 1 call Functione5422 ld a, 4 - ld [wIntroSceneFrameCounter1], a + ld [wIntroFrameCounter1], a ret IntroScene14: ; Charizard mouth open - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 ld a, [hl] and a jr z, .next @@ -894,9 +895,9 @@ IntroScene14: ld a, 2 call Functione5422 ld a, 64 - ld [wIntroSceneFrameCounter1], a + ld [wIntroFrameCounter1], a xor a - ld [wIntroSceneFrameCounter2], a + ld [wIntroFrameCounter2], a ld de, SFX_GS_INTRO_CHARIZARD_FIREBALL call PlaySFX ; fall through @@ -904,7 +905,7 @@ IntroScene14: IntroScene15: ; Charizard mouth wide open / fireball starts call Functione5473 - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 ld a, [hl] and a jr z, .next @@ -915,13 +916,13 @@ IntroScene15: ld hl, wIntroJumptableIndex inc [hl] xor a - ld [wIntroSceneFrameCounter1], a + ld [wIntroFrameCounter1], a ret IntroScene16: ; continue fireball / fade out palettes call Functione5473 - ld hl, wIntroSceneFrameCounter1 + ld hl, wIntroFrameCounter1 ld a, [hl] inc [hl] swap a @@ -1122,7 +1123,7 @@ endr dwcoord 8, 6 Functione5473: - ld hl, wIntroSceneFrameCounter2 + ld hl, wIntroFrameCounter2 ld a, [hl] inc [hl] and 3 diff --git a/gfx/title/hooh_gold.png b/gfx/title/hooh_gold.png Binary files differnew file mode 100644 index 00000000..646166b1 --- /dev/null +++ b/gfx/title/hooh_gold.png diff --git a/gfx/title/lugia_silver.png b/gfx/title/lugia_silver.png Binary files differnew file mode 100644 index 00000000..7edb8538 --- /dev/null +++ b/gfx/title/lugia_silver.png diff --git a/gfx/title/title_trail_gold.2bpp b/gfx/title/title_trail_gold.2bpp Binary files differindex bd70b678..118548d5 100644 --- a/gfx/title/title_trail_gold.2bpp +++ b/gfx/title/title_trail_gold.2bpp diff --git a/gfx/title/title_trail_gold.png b/gfx/title/title_trail_gold.png Binary files differnew file mode 100644 index 00000000..1661ede0 --- /dev/null +++ b/gfx/title/title_trail_gold.png diff --git a/gfx/title/title_trail_silver.png b/gfx/title/title_trail_silver.png Binary files differnew file mode 100644 index 00000000..b044701d --- /dev/null +++ b/gfx/title/title_trail_silver.png @@ -332,6 +332,7 @@ INCBIN "gfx/intro/copyright.2bpp" IF DEF(_GOLD) TitleScreenGFX3: INCBIN "gfx/title/title_trail_gold.2bpp" + ds $40 TitleScreenGFX4: INCBIN "gfx/title/hooh_gold.2bpp.lz" diff --git a/tools/gfx.py b/tools/gfx.py index bfb8c6a1..7007d37e 100644 --- a/tools/gfx.py +++ b/tools/gfx.py @@ -292,6 +292,11 @@ def filepath_rules(filepath): elif name == 'lugia_silver': args['width'] = 64 args['pic_dimensions'] = 8, 4 + elif name == 'hooh_gold': + args['width'] = 64 + args['pic_dimensions'] = 8, 6 + elif name in ['title_trail_gold', 'title_trail_silver']: + args['width'] = 32 elif 'gfx/trainer_card' in filedir: if name in ['badges', 'trainer_card']: @@ -372,7 +377,16 @@ def to_2bpp(filename, **kwargs): def to_png(filename, **kwargs): name, ext = os.path.splitext(filename) - if ext == '.1bpp': gfx.export_1bpp_to_png(filename, **kwargs) + if ext == '.1bpp': + basedir, basename = os.path.split(filename) + name, ext = os.path.splitext(basename) + # Ignoring these for convenience only + if basedir in ['gfx/footprints', 'gfx/font']: + return + # Ignoring these for convenience only + if name in ['hp_exp_bar_border']: + return + gfx.export_1bpp_to_png(filename, **kwargs) elif ext == '.2bpp': basedir, basename = os.path.split(filename) name, ext = os.path.splitext(basename) @@ -382,6 +396,9 @@ def to_png(filename, **kwargs): # TODO: same question for most/all battle anims if basedir == 'gfx/battle_anims': return + # Ignoring these for convenience only + if basedir == 'gfx/font': + return if name in ['back_gold', 'back_silver']: kwargs['fileout'] = os.path.join(basedir, 'back.png') gfx.export_2bpp_to_png(filename, **kwargs) @@ -733,13 +733,14 @@ UNION ; cb0c wBattleMon:: battle_struct wBattleMon ; cb0c NEXTU ; cb0c +; intro water/grass/fire cutscene data ds 4 wIntroJumptableIndex:: db wIntroBGMapPointer:: dw wIntroTilemapPointer:: dw wIntroTilesPointer:: dw -wIntroSceneFrameCounter1:: db -wIntroSceneFrameCounter2:: db +wIntroFrameCounter1:: db +wIntroFrameCounter2:: db wcb19:: db ENDU ; cb2c @@ -1135,7 +1136,7 @@ wce65:: db wce66:: db NEXTU ; ce64 -; intro and title data +; gfpresents, title, and intro menu timers wIntroSceneFrameCounter:: db UNION ; ce65 wIntroSceneTimer:: db |