more title screen comments

This commit is contained in:
yenatch 2013-12-22 04:30:44 -05:00
parent 091ebd8574
commit 6225fca386

121
main.asm
View File

@ -4747,7 +4747,7 @@ Function627b: ; 627b
ld a, [$cf63] ld a, [$cf63]
bit 7, a bit 7, a
jr nz, .asm_6290 jr nz, .asm_6290
call Function62a3 call TitleScreenScene
callba Function10eea7 callba Function10eea7
call DelayFrame call DelayFrame
and a and a
@ -4770,10 +4770,10 @@ Function6292: ; 6292
ret ret
; 62a3 ; 62a3
Function62a3: ; 62a3 TitleScreenScene: ; 62a3
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, .data_62af ld hl, .scenes
add hl, de add hl, de
add hl, de add hl, de
ld a, [hli] ld a, [hli]
@ -4782,11 +4782,11 @@ Function62a3: ; 62a3
jp [hl] jp [hl]
; 62af ; 62af
.data_62af .scenes
dw TitleScreenEntrance dw TitleScreenEntrance
dw Function62f6 dw TitleScreenTimer
dw Function6304 dw TitleScreenMain
dw Function6375 dw TitleScreenEnd
; 62b7 ; 62b7
Function62b7: ; 62b7 Function62b7: ; 62b7
@ -4812,14 +4812,14 @@ TitleScreenEntrance: ; 62bc
ld bc, 8 * 10 ; logo height ld bc, 8 * 10 ; logo height
call ByteFill call ByteFill
; Alternate signage for each line's position vector. ; Reversed signage for every other line's position.
; This is responsible for the interlaced effect. ; This is responsible for the interlaced effect.
ld a, e ld a, e
xor $ff xor $ff
inc a inc a
ld b, 8 * 10 / 2 ; logo height / 2 ld b, 8 * 10 / 2 ; logo height / 2
ld hl, $d101 ld hl, LYOverrides + 1
.loop .loop
ld [hli], a ld [hli], a
inc hl inc hl
@ -4846,103 +4846,138 @@ TitleScreenEntrance: ; 62bc
; 62f6 ; 62f6
Function62f6: ; 62f6 TitleScreenTimer: ; 62f6
; Next scene
ld hl, $cf63 ld hl, $cf63
inc [hl] inc [hl]
; Start a timer
ld hl, $cf65 ld hl, $cf65
ld de, $1140 ld de, $1140 ; 73.6 seconds
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
ret ret
; 6304 ; 6304
Function6304: ; 6304 TitleScreenMain: ; 6304
; Run the timer down.
ld hl, $cf65 ld hl, $cf65
ld e, [hl] ld e, [hl]
inc hl inc hl
ld d, [hl] ld d, [hl]
ld a, e ld a, e
or d or d
jr z, .asm_6355 jr z, .end
dec de dec de
ld [hl], d ld [hl], d
dec hl dec hl
ld [hl], e ld [hl], e
; Save data can be deleted by pressing Up + B + Select.
call GetJoypadPublic call GetJoypadPublic
ld hl, hJoyDown ld hl, hJoyDown
ld a, [hl] ld a, [hl]
and $46 and D_UP + B_BUTTON + SELECT
cp $46 cp D_UP + B_BUTTON + SELECT
jr z, .asm_634a jr z, .delete_save_data
; To bring up the clock reset dialog:
; Hold Down + B + Select to initiate the sequence.
ld a, [$ffeb] ld a, [$ffeb]
cp $34 cp $34
jr z, .asm_6332 jr z, .check_clock_reset
ld a, [hl] ld a, [hl]
and $86 and D_DOWN + B_BUTTON + SELECT
cp $86 cp D_DOWN + B_BUTTON + SELECT
jr nz, .asm_6340 jr nz, .check_start
ld a, $34 ld a, $34
ld [$ffeb], a ld [$ffeb], a
jr .asm_6340 jr .check_start
; Keep Select pressed, and hold Left + Up.
; Then let go of Select.
.check_clock_reset
bit 2, [hl] ; SELECT
jr nz, .check_start
.asm_6332
bit 2, [hl]
jr nz, .asm_6340
xor a xor a
ld [$ffeb], a ld [$ffeb], a
ld a, [hl]
and $60
cp $60
jr z, .asm_636a
.asm_6340
ld a, [hl] ld a, [hl]
and $9 and D_LEFT + D_UP
jr nz, .asm_6346 cp D_LEFT + D_UP
jr z, .clock_reset
; Press Start or A to start the game.
.check_start
ld a, [hl]
and START | A_BUTTON
jr nz, .continue
ret ret
.asm_6346 .continue
ld a, $0 ld a, 0
jr .asm_634c jr .done
.asm_634a .delete_save_data
ld a, $1 ld a, 1
.asm_634c .done
ld [$cf64], a ld [$cf64], a
; Return to the intro sequence.
ld hl, $cf63 ld hl, $cf63
set 7, [hl] set 7, [hl]
ret ret
.asm_6355 .end
; Next scene
ld hl, $cf63 ld hl, $cf63
inc [hl] inc [hl]
; Fade out the title screen music
xor a xor a
ld [MusicFadeIDLo], a ld [MusicFadeIDLo], a
ld [MusicFadeIDHi], a ld [MusicFadeIDHi], a
ld hl, MusicFade ld hl, MusicFade
ld [hl], $8 ld [hl], 8 ; 1 second
ld hl, $cf65 ld hl, $cf65
inc [hl] inc [hl]
ret ret
.asm_636a .clock_reset
ld a, $4 ld a, 4
ld [$cf64], a ld [$cf64], a
; Return to the intro sequence.
ld hl, $cf63 ld hl, $cf63
set 7, [hl] set 7, [hl]
ret ret
; 6375 ; 6375
Function6375: ; 6375 TitleScreenEnd: ; 6375
; Wait until the music is done fading.
ld hl, $cf65 ld hl, $cf65
inc [hl] inc [hl]
ld a, [MusicFade] ld a, [MusicFade]
and a and a
ret nz ret nz
ld a, $2
ld a, 2
ld [$cf64], a ld [$cf64], a
; Back to the intro.
ld hl, $cf63 ld hl, $cf63
set 7, [hl] set 7, [hl]
ret ret