Island transitions, more text

This commit is contained in:
Natt Akuma 2025-11-28 02:47:40 +07:00
parent 6c41c40f3d
commit 8649775d96

View file

@ -109,7 +109,7 @@ code_start:
ldx #<copyright ldx #<copyright
ldy #>copyright ldy #>copyright
jsr write_txt3 jsr write_txt3
ldx #$30 ldx #$00
ldy #$01 ldy #$01
jsr init_timer jsr init_timer
lda #1 lda #1
@ -123,12 +123,9 @@ code_start:
lda timer_reached lda timer_reached
beq :- beq :-
ldx #250 ldx #$90
ldy #0 ldy #$01
jsr txt_fade_out jsr txt_fade_out
lda #64
sta frame_delay
jsr wait_loop
sei sei
jsr set_irq_badguy jsr set_irq_badguy
@ -169,7 +166,6 @@ code_start:
jsr init_2x jsr init_2x
lda #$0b lda #$0b
sta $d011 sta $d011
; jmp part_11
jsr clr_txt jsr clr_txt
ldx #<story_writ ldx #<story_writ
@ -398,15 +394,9 @@ code_start:
ldx #$10 ldx #$10
ldy #$01 ldy #$01
jsr init_timer
lda #8*11 lda #8*11
sta timer sta timer
lda #2 jsr txt_fade_out_offset
sta timer_mode
:
lda timer_reached
beq :-
ldx #$c4 ldx #$c4
ldy #$01 ldy #$01
@ -471,7 +461,6 @@ part_9:
; $7900-$79ff tileset CRAM colors ; $7900-$79ff tileset CRAM colors
; $9000- compressed tilemap ; $9000- compressed tilemap
jsr clr_txt jsr clr_txt
ldx #<art_direct ldx #<art_direct
ldy #>art_direct ldy #>art_direct
@ -500,15 +489,8 @@ part_9:
ldx #$90 ldx #$90
ldy #$01 ldy #$01
;jsr txt_fade_out
jsr init_timer
lda #8 lda #8
sta timer jsr txt_fade_out_offset
lda #2
sta timer_mode
:
lda timer_reached
beq :-
lda #0 lda #0
sta $d011 sta $d011
@ -606,7 +588,7 @@ part_9:
lda #0 lda #0
sta vbl sta vbl
lda frame lda frame
cmp #$e0 ; TODO cmp #$e1
bcc :+ bcc :+
jmp @finish jmp @finish
: :
@ -642,10 +624,18 @@ part_9:
jmp @loop jmp @loop
@finish: @finish:
ldx #$a8
ldy #$01
jsr init_timer
:
lda timer_reached
beq :-
lda #$0b
sta $d011
lda #0 lda #0
sta timer_mode
sta $d015 sta $d015
; TODO is there a delay here lda #3
sta $dd00
; we run out of space before the fixed location vector return now ; we run out of space before the fixed location vector return now
jmp part_10 jmp part_10
@ -714,12 +704,7 @@ intro:
sta frame_delay sta frame_delay
jsr wait_loop jsr wait_loop
ldx #<empty_txt jsr clear_text
ldy #>empty_txt
jsr upload_text
ldx #<empty_txt
ldy #>empty_txt
jsr upload_text_bottom
lda #$0d lda #$0d
sta frame_until sta frame_until
@ -736,20 +721,16 @@ intro:
sta frame_delay sta frame_delay
jsr wait_loop jsr wait_loop
jsr clear_text
ldx #<too_bad_txt ldx #<too_bad_txt
ldy #>too_bad_txt ldy #>too_bad_txt
jsr upload_text jsr upload_text
ldx #<empty_txt
ldy #>empty_txt
jsr upload_text_bottom
lda #50*5 lda #50*5
sta frame_delay sta frame_delay
jsr wait_loop jsr wait_loop
ldx #<empty_txt jsr clear_text
ldy #>empty_txt
jsr upload_text
lda #$13 lda #$13
sta frame_until sta frame_until
@ -904,14 +885,12 @@ irq_music:
bne :+ bne :+
inc timer+1 inc timer+1
: :
lda timer+1
cmp timer_limit+1
bcc :++
bne :+
lda timer lda timer
cmp timer_limit sec
bcc :++ sbc timer_limit
: lda timer+1
sbc timer_limit+1
bcc :+
lda #1 lda #1
sta timer_reached sta timer_reached
: :
@ -998,23 +977,6 @@ wait_frame_until:
: :
rts rts
wait_loop_2x:
@loop:
lda vbl
cmp #2
bcc @loop
lda #0
sta vbl
dec frame_delay
lda frame_delay
beq :+
jmp @loop
:
rts
wait_frame_until_2x: wait_frame_until_2x:
@loop: @loop:
lda vbl lda vbl
@ -1036,7 +998,6 @@ wait_frame_until_2x:
: :
rts rts
init_bmp: init_bmp:
lda #$0b lda #$0b
sta $d011 sta $d011
@ -1288,29 +1249,15 @@ cloudsname: .byte "clouds", 0
darmtower_txt: darmtower_txt:
.res (40-32)/2, ' ' .byte " darm's tower has fallen silent. "
.byte "darm's tower has fallen silent. " .byte " what should we do? "
.res (40-32)/2, ' '
.res (40-32)/2, ' '
.byte "what should we do? "
.res (40-32)/2, ' '
empty_txt:
.res 40, ' '
.res 40, ' '
adol_win: adol_win:
.res (40-28)/2, ' ' .byte " ", 34, "it must be adol, let's see "
.byte 34, "it must be adol, let's see " .byte " how far he'll get!", 34, " "
.res (40-28)/2, ' '
.res (40-28)/2, ' '
.byte "how far he'll get!", 34, " "
.res (40-28)/2, ' '
too_bad_txt: too_bad_txt:
.res (40-16)/2, ' ' .byte " as you command. "
.byte "as you command. "
.res (40-16)/2, ' '
upload_text: upload_text:
stx text_ptr stx text_ptr
@ -1340,6 +1287,16 @@ upload_text_bottom:
bpl :- bpl :-
rts rts
clear_text:
lda #$80
ldy #39
:
sta $748, y
sta $748+40+40, y
dey
bpl :-
rts
run_nufli_bmp: run_nufli_bmp:
lda #$01 lda #$01
sta $81 sta $81
@ -1433,9 +1390,28 @@ part_10:
; the sprite data is embedded into first few bitmap pixels ; the sprite data is embedded into first few bitmap pixels
; which are hidden by black border attributes ; which are hidden by black border attributes
@y = $60 @y = $60
jsr clr_txt
ldx #<total_direct
ldy #>total_direct
jsr write_txt2
ldx #$c0
ldy #$01
jsr init_timer
lda #1
sta timer_mode
ldx #<cloudsname ldx #<cloudsname
ldy #>cloudsname ldy #>cloudsname
jsr load_8000_zx02_2000 jsr load_8000_zx02_2000
:
lda timer_reached
beq :-
ldx #$48
ldy #$01
lda #$40
jsr txt_fade_out_offset
jsr init_bmp jsr init_bmp
ldx #0 ldx #0
stx $d010 stx $d010
@ -1547,6 +1523,11 @@ part_11:
jsr load_8000_zx02 jsr load_8000_zx02
cli cli
jsr clr_txt
ldx #<turn_disk
ldy #>turn_disk
jsr write_txt
jmp end jmp end
.res ((*+$ff)&$ff00|2)-* .res ((*+$ff)&$ff00|2)-*
@ -1697,6 +1678,16 @@ art_direct:
.byte " art directed by " .byte " art directed by "
.byte " seigo oketani " .byte " seigo oketani "
total_direct:
.byte " total directed by "
.byte " masaya hashimoto "
presented_by:
.byte " presented by falcom "
turn_disk:
.byte " insert datadisk in drive 8 "
clr_txt: clr_txt:
lda #$80 lda #$80
ldx #0 ldx #0
@ -1725,190 +1716,84 @@ clr_txt:
write_txt5: write_txt5:
stx text_ptr stx text_ptr
sty text_ptr+1 sty text_ptr+1
ldx #0
ldy #0 ldy #0
: lda #<($400+8*40)
lda (text_ptr), y ldx #>($400+8*40)
sec jsr write_txt_to
sbc #$20 lda #<($400+10*40)
ora #$80 ldx #>($400+10*40)
sta $400+8*40, x jsr write_txt_to
iny lda #<($400+12*40)
inx ldx #>($400+12*40)
cpx #40 jsr write_txt_to
bne :- lda #<($400+14*40)
ldx #>($400+14*40)
ldx #0 jsr write_txt_to
: lda #<($400+16*40)
lda (text_ptr), y ldx #>($400+16*40)
sec jmp write_txt_to
sbc #$20
ora #$80
sta $400+10*40, x
iny
inx
cpx #40
bne :-
ldx #0
:
lda (text_ptr), y
sec
sbc #$20
ora #$80
sta $400+12*40, x
iny
inx
cpx #40
bne :-
ldx #0
:
lda (text_ptr), y
sec
sbc #$20
ora #$80
sta $400+14*40, x
iny
inx
cpx #40
bne :-
ldx #0
:
lda (text_ptr), y
sec
sbc #$20
ora #$80
sta $400+16*40, x
iny
inx
cpx #40
bne :-
rts
write_txt4: write_txt4:
stx text_ptr stx text_ptr
sty text_ptr+1 sty text_ptr+1
ldx #0
ldy #0 ldy #0
: lda #<($400+9*40)
lda (text_ptr), y ldx #>($400+9*40)
sec jsr write_txt_to
sbc #$20 lda #<($400+11*40)
ora #$80 ldx #>($400+11*40)
sta $400+9*40, x jsr write_txt_to
iny lda #<($400+13*40)
inx ldx #>($400+13*40)
cpx #40 jsr write_txt_to
bne :- lda #<($400+15*40)
ldx #>($400+15*40)
ldx #0 jmp write_txt_to
:
lda (text_ptr), y
sec
sbc #$20
ora #$80
sta $400+11*40, x
iny
inx
cpx #40
bne :-
ldx #0
:
lda (text_ptr), y
sec
sbc #$20
ora #$80
sta $400+13*40, x
iny
inx
cpx #40
bne :-
ldx #0
:
lda (text_ptr), y
sec
sbc #$20
ora #$80
sta $400+15*40, x
iny
inx
cpx #40
bne :-
rts
write_txt3: write_txt3:
stx text_ptr stx text_ptr
sty text_ptr+1 sty text_ptr+1
ldx #0
ldy #0 ldy #0
: lda #<($400+10*40)
lda (text_ptr), y ldx #>($400+10*40)
sec jsr write_txt_to
sbc #$20 lda #<($400+12*40)
ora #$80 ldx #>($400+12*40)
sta $400+10*40, x jsr write_txt_to
iny lda #<($400+14*40)
inx ldx #>($400+14*40)
cpx #40 jmp write_txt_to
bne :-
ldx #0
:
lda (text_ptr), y
sec
sbc #$20
ora #$80
sta $400+12*40, x
iny
inx
cpx #40
bne :-
ldx #0
:
lda (text_ptr), y
sec
sbc #$20
ora #$80
sta $400+14*40, x
iny
inx
cpx #40
bne :-
rts
write_txt2: write_txt2:
stx text_ptr stx text_ptr
sty text_ptr+1 sty text_ptr+1
ldx #0
ldy #0 ldy #0
: lda #<($400+11*40)
lda (text_ptr), y ldx #>($400+11*40)
sec jsr write_txt_to
sbc #$20 lda #<($400+13*40)
ora #$80 ldx #>($400+13*40)
sta $400+11*40, x jmp write_txt_to
iny
inx
cpx #40
bne :-
write_txt:
stx text_ptr
sty text_ptr+1
ldy #0
lda #<($400+12*40)
ldx #>($400+12*40)
; fall through
write_txt_to:
sta @dst+1
stx @dst+2
ldx #0 ldx #0
: :
lda (text_ptr), y lda (text_ptr), y
sec sec
sbc #$20 sbc #$20
ora #$80 ora #$80
sta $400+13*40, x @dst:
sta $400, x
iny iny
inx inx
cpx #40 cpx #40
@ -1916,7 +1801,12 @@ write_txt2:
rts rts
txt_fade_out: txt_fade_out:
lda #0
txt_fade_out_offset:
pha
jsr init_timer jsr init_timer
pla
sta timer
lda #2 lda #2
sta timer_mode sta timer_mode
: :