From 2cdca754410fc97878b99a673eeaa9cfad49ed9e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 2 Dec 2015 17:59:05 -0500 Subject: Crystal Intro --- engine/intro_menu.asm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index cf5bcf8a0..e208abfc4 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -7,7 +7,7 @@ _MainMenu: ; 5ae8 ld [wMapMusic], a call PlayMusic callba MainMenu - jp Function6219 + jp StartTitleScreen ; 5b04 ; unreferenced @@ -1003,19 +1003,19 @@ Intro_PlacePlayerSprite: ; 61cd .sprites ; 61fe db 4 - db $4c, $48, 0 - db $4c, $50, 1 - db $54, $48, 2 - db $54, $50, 3 + db 9 * 8 + 4, 9 * 8, 0 + db 9 * 8 + 4, 10 * 8, 1 + db 10 * 8 + 4, 9 * 8, 2 + db 10 * 8 + 4, 10 * 8, 3 ; 620b Function620b: ; 620b callab Functione4579 - jr c, Function6219 + jr c, StartTitleScreen callba CrystalIntro -Function6219: ; 6219 +StartTitleScreen: ; 6219 ld a, [rSVBK] push af ld a, $5 -- cgit v1.2.3 From 2f14f3a669afd51ab98d9f2dea5857e5b548a8d7 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 2 Dec 2015 20:37:00 -0500 Subject: No more autogen functions in engine/crystal_intro.asm --- engine/intro_menu.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index e208abfc4..9423b13c1 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -1010,8 +1010,8 @@ Intro_PlacePlayerSprite: ; 61cd ; 620b -Function620b: ; 620b - callab Functione4579 +CrystalIntroSequence: ; 620b + callab Copyright_GFPresents jr c, StartTitleScreen callba CrystalIntro @@ -1068,8 +1068,8 @@ endr .jumptable dw _MainMenu dw Function6389 - dw Function620b - dw Function620b + dw CrystalIntroSequence + dw CrystalIntroSequence dw ResetClock ; 6274 @@ -1423,5 +1423,5 @@ GameInit:: ; 642e ld a, $90 ld [hWY], a call WaitBGMap - jp Function620b + jp CrystalIntroSequence ; 6454 -- cgit v1.2.3 From 5b94d54a6c81d7ea09497dfc3d1477a7ed3bd954 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 4 Dec 2015 08:46:11 -0500 Subject: More work on animations --- engine/intro_menu.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 9423b13c1..140233288 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -450,9 +450,9 @@ ConfirmContinue: ; 5e34 call DelayFrame call GetJoypad ld hl, hJoyPressed - bit 0, [hl] + bit A_BUTTON_F, [hl] jr nz, .PressA - bit 1, [hl] + bit B_BUTTON_F, [hl] jr z, .loop scf ret @@ -1336,7 +1336,7 @@ Function639b: ; unreferenced and $3 ret nz ld bc, SpriteAnim10 - ld hl, SpriteAnim10FrameIndex - SpriteAnim10 + ld hl, SPRITEANIMSTRUCT_FRAME add hl, bc ; over-the-top compicated way to load wc3ae into hl ld l, [hl] ld h, 0 -- cgit v1.2.3 From ecd277204a1e32e923702a57a6212579635a9b4c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 11 Dec 2015 16:59:40 -0500 Subject: Card Flip --- engine/intro_menu.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 140233288..bcd2d5ddb 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -1036,7 +1036,7 @@ StartTitleScreen: ; 6219 ld hl, rLCDC res 2, [hl] call ClearScreen - call Function3200 + call WaitBGMap2 xor a ld [hLCDStatCustom], a ld [hSCX], a -- cgit v1.2.3 From 6e257bc7cdab3249cc8fbdf4c808f0ebc442022e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 14 Dec 2015 20:06:41 -0500 Subject: mystery gift, credits --- engine/intro_menu.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index bcd2d5ddb..1ec4d86d5 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -353,7 +353,7 @@ LoadOrRegenerateLuckyIDNumber: ; 5d33 Continue: ; 5d65 callba TryLoadSaveFile jr c, .FailToLoad - callba Function150b9 + callba _LoadData call LoadStandardMenuDataHeader call DisplaySaveInfoOnContinue ld a, $1 -- cgit v1.2.3 From 77ef8404a197d015398674482103afd9651a9f42 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 15 Dec 2015 18:59:49 -0500 Subject: Menu --- engine/intro_menu.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 1ec4d86d5..7c80f1005 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -547,7 +547,7 @@ Continue_LoadMenuHeader: ; 5ebf .pokedex_header call Function1e35 call MenuBox - call Function1c89 + call PlaceVerticalMenuItems ret ; 5ed9 @@ -783,7 +783,7 @@ OakText7: ; 0x606f NamePlayer: ; 0x6074 callba MovePlayerPicRight callba ShowPlayerNamingChoices - ld a, [MenuSelection2] + ld a, [wMenuCursorY] dec a jr z, .NewName call StorePlayerName @@ -828,8 +828,8 @@ NamePlayer: ; 0x6074 Function60e9: ; Unreferenced call LoadMenuDataHeader - call InterpretMenu2 - ld a, [MenuSelection2] + call VerticalMenu + ld a, [wMenuCursorY] dec a call CopyNameFromMenu call WriteBackup -- cgit v1.2.3 From efee40447ef4bce70cb97fa9c653fe350af000d1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 17 Dec 2015 13:49:26 -0500 Subject: Mobile trade animations, pokepic animations --- engine/intro_menu.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 7c80f1005..ca80665b4 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -1067,7 +1067,7 @@ endr .jumptable dw _MainMenu - dw Function6389 + dw DeleteSaveData dw CrystalIntroSequence dw CrystalIntroSequence dw ResetClock @@ -1320,8 +1320,8 @@ TitleScreenEnd: ; 6375 ret ; 6389 -Function6389: ; 6389 - callba Function4d54c +DeleteSaveData: ; 6389 + callba _DeleteSaveData jp Init ; 6392 -- cgit v1.2.3 From d644406f61983be78339a0e9f366e8d34c209c6c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 17 Dec 2015 22:31:16 -0500 Subject: More menu stuff --- engine/intro_menu.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index ca80665b4..6c26f3a0c 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -545,7 +545,7 @@ Continue_LoadMenuHeader: ; 5ebf ld hl, .MenuDataHeader_NoDex .pokedex_header - call Function1e35 + call _OffsetMenuDataHeader call MenuBox call PlaceVerticalMenuItems ret -- cgit v1.2.3 From 987ed1fafb2ed4920276089f8c93f1be3f31acac Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 19 Dec 2015 14:48:30 -0500 Subject: More work on slots; WRAM cleanup, Move Deleter --- engine/intro_menu.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 6c26f3a0c..ef843a801 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -50,7 +50,7 @@ NewGame_ClearTileMapEtc: ; 5b44 call ClearTileMap call LoadFontsExtra call LoadStandardFont - call ResetTextRelatedRAM + call ClearWindowData ret ; 5b54 @@ -1410,7 +1410,7 @@ CopyrightString: ; 63fd GameInit:: ; 642e callba TryLoadSaveData - call ResetTextRelatedRAM + call ClearWindowData call ClearBGPalettes call ClearTileMap ld a, VBGMap0 / $100 -- cgit v1.2.3 From d08199c79d8168368aeac0381427d533e09f073d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 22 Dec 2015 18:03:00 -0500 Subject: Color fns, some more address decoding in link/mobile --- engine/intro_menu.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index ef843a801..ddc728c4f 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -685,7 +685,7 @@ OakSpeech: ; 0x5f99 ld [TrainerClass], a call Intro_PrepTrainerPic - ld b, SCGB_1C + ld b, SCGB_FRONTPICPALS call GetSGBLayout call Intro_RotatePalettesLeftFrontpic @@ -706,7 +706,7 @@ OakSpeech: ; 0x5f99 ld [TempMonDVs], a ld [TempMonDVs + 1], a - ld b, SCGB_1C + ld b, SCGB_FRONTPICPALS call GetSGBLayout call Intro_WipeInFrontpic @@ -723,7 +723,7 @@ OakSpeech: ; 0x5f99 ld [TrainerClass], a call Intro_PrepTrainerPic - ld b, SCGB_1C + ld b, SCGB_FRONTPICPALS call GetSGBLayout call Intro_RotatePalettesLeftFrontpic @@ -736,7 +736,7 @@ OakSpeech: ; 0x5f99 ld [CurPartySpecies], a callba DrawIntroPlayerPic - ld b, SCGB_1C + ld b, SCGB_FRONTPICPALS call GetSGBLayout call Intro_RotatePalettesLeftFrontpic @@ -806,7 +806,7 @@ NamePlayer: ; 0x6074 ld [CurPartySpecies], a callba DrawIntroPlayerPic - ld b, SCGB_1C + ld b, SCGB_FRONTPICPALS call GetSGBLayout call RotateThreePalettesLeft -- cgit v1.2.3 From a5e928eb984d8995d17e42d415f687f5affb2935 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 24 Dec 2015 22:58:42 -0500 Subject: writebackup --> closewindow; game corner prize vendors; others --- engine/intro_menu.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index ddc728c4f..187dc0347 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -362,13 +362,13 @@ Continue: ; 5d65 call DelayFrames call ConfirmContinue jr nc, .Check1Pass - call WriteBackup + call CloseWindow jr .FailToLoad .Check1Pass call Continue_CheckRTC_RestartClock jr nc, .Check2Pass - call WriteBackup + call CloseWindow jr .FailToLoad .Check2Pass @@ -380,7 +380,7 @@ Continue: ; 5d65 ld [MusicFadeIDHi], a call ClearBGPalettes call Continue_MobileAdapterMenu - call WriteBackup + call CloseWindow call ClearTileMap ld c, 20 call DelayFrames @@ -832,7 +832,7 @@ Function60e9: ; Unreferenced ld a, [wMenuCursorY] dec a call CopyNameFromMenu - call WriteBackup + call CloseWindow ret ; 60fa -- cgit v1.2.3 From 2bd45ca574aab251b91c24837b102c9c2a5e76a0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 26 Dec 2015 18:11:55 -0500 Subject: Move effects; no more reloadmapmusic, returnafterbattle --- engine/intro_menu.asm | 71 +++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 187dc0347..9081c1461 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -68,7 +68,7 @@ OptionsMenu: ; 5b64 NewGame: ; 5b6b xor a - ld [wc2cc], a + ld [wMonStatusFlags], a call ResetWRAM call NewGame_ClearTileMapEtc call AreYouABoyOrAreYouAGirl @@ -86,7 +86,7 @@ NewGame: ; 5b6b ; 5b8f AreYouABoyOrAreYouAGirl: ; 5b8f - callba Function10632f ; some mobile stuff + callba Mobile_AlwaysReturnNotCarry ; some mobile stuff jr c, .ok callba InitGender ret @@ -211,9 +211,9 @@ ENDC ld [Money + 2], a xor a - ld [wdc17], a + ld [wWhichMomItem], a - ld hl, wdc19 + ld hl, MomItemTriggerBalance ld [hl], 2300 / $10000 inc hl ld [hl], 2300 / $100 % $100 @@ -385,7 +385,7 @@ Continue: ; 5d65 ld c, 20 call DelayFrames callba JumpRoamMons - callba Function105091 ; Mystery Gift + callba MysteryGift_CopyReceivedDecosToPC ; Mystery Gift callba Function140ae ; time-related ld a, [wSpawnAfterChampion] cp SPAWN_LANCE @@ -399,14 +399,14 @@ Continue: ; 5d65 .SpawnAfterE4 ld a, SPAWN_NEW_BARK - ld [wd001], a + ld [DefaultSpawnpoint], a call PostCreditsSpawn jp FinishContinueFunction ; 5de2 SpawnAfterRed: ; 5de2 ld a, SPAWN_MT_SILVER - ld [wd001], a + ld [DefaultSpawnpoint], a ; 5de7 PostCreditsSpawn: ; 5de7 @@ -418,8 +418,11 @@ PostCreditsSpawn: ; 5de7 ; 5df0 Continue_MobileAdapterMenu: ; 5df0 - callba Function10632f ; mobile check + callba Mobile_AlwaysReturnNotCarry ; mobile check ret nc + +; the rest of this stuff is never reached because +; the previous function returns with carry not set ld hl, wd479 bit 1, [hl] ret nz @@ -480,7 +483,7 @@ Continue_CheckRTC_RestartClock: ; 5e48 FinishContinueFunction: ; 5e5d .loop xor a - ld [wc2c1], a + ld [wDontPlayMapMusicOnReload], a ld [wLinkMode], a ld hl, GameTimerPause set 0, [hl] @@ -641,7 +644,7 @@ Continue_DisplayBadgeCount: ; 5f58 Continue_DisplayPokedexNumCaught: ; 5f6b ld a, [StatusFlags] - bit 0, a + bit 0, a ; Pokedex ret z push hl ld hl, PokedexCaught @@ -787,7 +790,7 @@ NamePlayer: ; 0x6074 dec a jr z, .NewName call StorePlayerName - callba Function8c1d + callba ApplyMonOrTrainerPals callba MovePlayerPicLeft ret @@ -1024,7 +1027,7 @@ StartTitleScreen: ; 6219 call .TitleScreen call DelayFrame .loop - call Function627b + call RunTitleScreen jr nc, .loop call ClearSprites @@ -1079,7 +1082,7 @@ endr ret ; 627b -Function627b: ; 627b +RunTitleScreen: ; 627b ld a, [wJumptableIndex] bit 7, a jr nz, .done_title @@ -1126,7 +1129,7 @@ endr dw TitleScreenEnd ; 62b7 -Function62b7: ; Unreferenced +.NextScene ; Unreferenced ld hl, wJumptableIndex inc [hl] ret @@ -1152,7 +1155,7 @@ TitleScreenEntrance: ; 62bc ; Reversed signage for every other line's position. ; This is responsible for the interlaced effect. ld a, e - xor -1 + xor $ff inc a ld b, 8 * 10 / 2 ; logo height / 2 @@ -1191,7 +1194,7 @@ TitleScreenTimer: ; 62f6 ; Start a timer ld hl, wcf65 - ld de, $1140 ; 73.6 seconds + ld de, 73 * 60 + 36 ld [hl], e inc hl ld [hl], d @@ -1225,7 +1228,7 @@ TitleScreenMain: ; 6304 ; To bring up the clock reset dialog: ; Hold Down + B + Select to initiate the sequence. - ld a, [$ffeb] + ld a, [hClockResetTrigger] cp $34 jr z, .check_clock_reset @@ -1235,17 +1238,17 @@ TitleScreenMain: ; 6304 jr nz, .check_start ld a, $34 - ld [$ffeb], a + ld [hClockResetTrigger], a jr .check_start ; Keep Select pressed, and hold Left + Up. ; Then let go of Select. .check_clock_reset - bit 2, [hl] ; SELECT + bit SELECT_F, [hl] jr nz, .check_start xor a - ld [$ffeb], a + ld [hClockResetTrigger], a ld a, [hl] and D_LEFT + D_UP @@ -1368,12 +1371,12 @@ endr Data63ca: ; 63ca ; frame 0 y, x; frame 1 y, x - db $5c, $50, $00, $00 - db $5c, $68, $5c, $58 - db $5c, $68, $5c, $78 - db $5c, $88, $5c, $78 - db $00, $00, $5c, $78 - db $00, $00, $5c, $58 + db 11 * 8 + 4, 10 * 8, 0 * 8, 0 * 8 + db 11 * 8 + 4, 13 * 8, 11 * 8 + 4, 11 * 8 + db 11 * 8 + 4, 13 * 8, 11 * 8 + 4, 15 * 8 + db 11 * 8 + 4, 17 * 8, 11 * 8 + 4, 15 * 8 + db 0 * 8, 0 * 8, 11 * 8 + 4, 15 * 8 + db 0 * 8, 0 * 8, 11 * 8 + 4, 11 * 8 ; 63e2 Copyright: ; 63e2 @@ -1390,20 +1393,16 @@ Copyright: ; 63e2 CopyrightString: ; 63fd ; ©1995-2001 Nintendo - db $60, $61, $62, $63, $64, $65, $66 - db $67, $68, $69, $6a, $6b, $6c - - db $4e + db $60, $61, $62, $63, $64, $65, $66 + db $67, $68, $69, $6a, $6b, $6c ; ©1995-2001 Creatures inc. - db $60, $61, $62, $63, $64, $65, $66, $6d - db $6e, $6f, $70, $71, $72, $7a, $7b, $7c - - db $4e + next $60, $61, $62, $63, $64, $65, $66 + db $6d, $6e, $6f, $70, $71, $72, $7a, $7b, $7c ; ©1995-2001 GAME FREAK inc. - db $60, $61, $62, $63, $64, $65, $66, $73, $74 - db $75, $76, $77, $78, $79, $7a, $7b, $7c + next $60, $61, $62, $63, $64, $65, $66 + db $73, $74, $75, $76, $77, $78, $79, $7a, $7b, $7c db "@" ; 642e -- cgit v1.2.3 From f030315b1fd797aa6765ac8cd8c35c0cd9b600a0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 26 Dec 2015 21:59:03 -0500 Subject: jumptable macro repurposed --- engine/intro_menu.asm | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'engine/intro_menu.asm') diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 9081c1461..46c573483 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -1041,7 +1041,7 @@ StartTitleScreen: ; 6219 call ClearScreen call WaitBGMap2 xor a - ld [hLCDStatCustom], a + ld [hFFC6], a ld [hSCX], a ld [hSCY], a ld a, $7 @@ -1058,17 +1058,16 @@ StartTitleScreen: ; 6219 .ok ld e, a ld d, 0 - ld hl, .jumptable -rept 2 + ld hl, .dw + add hl, de add hl, de -endr ld a, [hli] ld h, [hl] ld l, a jp [hl] ; 626a -.jumptable +.dw dw _MainMenu dw DeleteSaveData dw CrystalIntroSequence @@ -1113,9 +1112,8 @@ TitleScreenScene: ; 62a3 ld e, a ld d, 0 ld hl, .scenes -rept 2 add hl, de -endr + add hl, de ld a, [hli] ld h, [hl] ld l, a @@ -1174,7 +1172,7 @@ TitleScreenEntrance: ; 62bc ld hl, wJumptableIndex inc [hl] xor a - ld [hLCDStatCustom], a + ld [hFFC6], a ; Play the title screen music. ld de, MUSIC_TITLE @@ -1343,22 +1341,19 @@ Function639b: ; unreferenced add hl, bc ; over-the-top compicated way to load wc3ae into hl ld l, [hl] ld h, 0 -rept 2 add hl, hl -endr + add hl, hl ld de, Data63ca add hl, de ; If bit 2 of [wcf65] is set, get the second dw; else, get the first dw ld a, [wcf65] and %00000100 -rept 2 srl a -endr + srl a ld e, a ld d, 0 -rept 2 add hl, de -endr + add hl, de ld a, [hli] and a ret z -- cgit v1.2.3