actually implemented the dialog text (better sync needed though)

This commit is contained in:
AArt1256 2025-11-29 13:50:08 +03:00
parent e47d81701b
commit 943185eb62
5 changed files with 440 additions and 5 deletions

View file

@ -0,0 +1,29 @@
f = open("liltalk_speak.txt","r").readlines()
f = [x[:-1] for x in f]
line_addrs = [11,16,16,29,33,27,32,29,11,32,24,13,14,17,27,4]
out = [0xFE, (40-line_addrs[0])//2]
cnt = 1
for line in f:
if line == '':
out.append(0xFE) # set line addr to beginning
out.append((40-line_addrs[cnt])//2)
cnt += 1
else:
num = 0
i = 0
while i < len(line) and line[i] in "0123456789":
num = num*10+int(line[i])
i += 1
str = line[i+1:]
str = str.upper()
str = str.replace("\\N","\n")
if num == 3: num += 1 # botches yay
out.append(num)
out.append(len(str))
for x in str: out.append(ord(x))
out.append(0xFF)
f = open("liltalk.bin","wb")
f.write(bytearray(out))
f.close()

Binary file not shown.

View file

@ -0,0 +1,307 @@
3 A
3 r
3 e
3
3 y
3 o
3 u
3
3 O
3 K
3 ?
6
70 ... Who are you?
6
3
3 T
3 h
3 a
3 n
3 k
3
3 g
3 o
3 o
3 d
3 n
3 e
3 s
3 s
2 .\n
1
3 I
3 '
3 m
3
3 L
3 i
3 l
3 i
3 a
3
3 f
3 r
3 o
3 m
3
3 L
3 a
3 n
3 c
3 e
3
3 v
3 i
3 l
3 l
3 a
3 g
3 e
3 .
6
3 H
3 a
3 v
3 i
3 n
3 g
3
3 s
3 o
3 m
3 e
3
3 k
3 i
3 n
3 d
3
3 o
3 f
3
3 p
3 r
3 e
3 m
3 o
3 n
3 i
3 t
3 i
3 o
3 n
2 ,\n
1
3 I
3
3 c
3 a
3 m
3 e
3
3 h
3 e
3 r
3 e
3
3 t
3 o
3
3 h
3 a
3 v
3 e
3
3 a
3
3 l
3 o
3 o
3 k
3 .
6
3 S
3 u
3 d
3 d
3 e
3 n
3 l
3 y
3 ,
3 t
3 h
3 e
3
3 a
3 r
3 e
3 a
3
3 w
3 a
3 s
3
3 e
3 n
3 v
3 e
3 l
3 o
3 p
3 e
3 d
2 \n
1
3 b
3 y
3
3 a
3
3 l
3 i
3 g
3 h
3 t
3
3 a
3 n
3 d
3
3 y
3 o
3 u
3
3 c
3 o
3 l
3 l
3 a
3 p
3 s
3 e
3 d.
6
64 Where am I?
3 T
3 h
3 i
3 s
3
3 i
3 s
3
3 t
3 h
3 e
3
3 k
3 i
3 n
3 g
3 d
3 o
3 m
3
3 c
3 a
3 l
3 l
3 e
3 d
3
3 Yee
3 s
3 .
6
3 T
3 h
3 e
3 r
3 e
3 '
3 r
3 e
3
3 m
3 o
3 n
3 s
3 t
3 e
3 r
3 s
3
3 n
3 e
3 a
3 r
3 .
2 \n
1
3 W
3 e
3
3 s
3 h
3 o
3 u
3 l
3 d
3
3 g
3 o.
6
3 H
3 o
3 w
3
3 a
3 b
3 o
3 u
3 t
3
3 i
3 t
2 ,\n
1
3 c
3 a
3 n
3
3 y
3 o
3 u
3
3 s
3 t
3 a
3 n
3 d
3
3 u
3 p?
6
150 Yeah,I'm alright? Should we\n Go before the monsters come?
3 S
3 u
3 r
3 e
3 .
210

View file

@ -22,6 +22,8 @@ timer_reached: .res 2
timer_mode: .res 1
enable_music: .res 1
temp: .res 3
dialog_col: .res 1
dialog_tick: .res 1
.include "lz_zp.asm"
@ -81,11 +83,11 @@ code_start:
sta vbl
cli
jsr intro
;jsr intro
lda #$0b
sta $d011
sei
ldx #<introname
ldy #>introname
@ -1531,6 +1533,12 @@ part_11:
jsr init_bmp
jsr set_irq_badguy
inc enable_music
lda #0
sta dialog_tick
lda #<dialog
sta text_ptr
lda #>dialog
sta text_ptr+1
cli
lda #<256
@ -1836,15 +1844,104 @@ txt_fade_out_offset:
rts
update_dialog:
lda dialog_tick
beq @skip_tick
dec dialog_tick
rts
@skip_tick:
ldy #0
lda (text_ptr),y
cmp #$fe
bne @skip_reset_col
cmp #$ff
bne :+
rts
:
; TODO
ldx dialog_col
cpx #40*2
beq @skip_reset
ldy #1
lda (text_ptr), y
sta dialog_col
ldx #0
lda #$20+$60
:
sta $748, x
inx
cpx #40*3
bcc :-
jmp @skip_reset2
@skip_reset:
ldy #1
lda (text_ptr), y
clc
adc #40*2
sta dialog_col
@skip_reset2:
lda text_ptr
clc
adc #2
sta text_ptr
bcc :+
inc text_ptr+1
:
jmp @skip_tick
@skip_reset_col:
clc
adc #1
sta dialog_tick
ldy #1
lda (text_ptr), y
sta temp+2
lda text_ptr
clc
adc #2
sta text_ptr
bcc :+
inc text_ptr+1
:
lda temp+2
beq @skip_text_upload
ldy #0
:
lda (text_ptr), y
jsr write_char_dialog
iny
cpy temp+2
bne :-
@skip_text_upload:
lda text_ptr
clc
adc temp+2
sta text_ptr
bcc :+
inc text_ptr+1
:
rts
write_char_dialog:
cmp #$0a ; newline
bne :+
lda #40*2
sta dialog_col
rts
:
ldx dialog_col
clc
adc #$60
sta $748, x
inc dialog_col
rts
dialog:
/*
.byte 0, "are you ok?", 0
.byte 1, "... who are you?", 0
.byte 2, "thank goodness.\ni'm lilia from lance village.", 0
@ -1856,3 +1953,5 @@ dialog:
.byte 8, "how about it,\ncan you stand up?", 0
.byte 9, "yeah,i'm alright.should we\ngo before the monsters come?", 0
.byte 10, "sure.", 0
*/
.incbin "liltalk.bin"

View file

@ -77,7 +77,7 @@ sfx_num: .res 1
sfx_list:
.word sfx0, sfx1, sfx1+$29
sfx0:
.incbin "sfx_badguy.bin"
.incbin "sfx_badguy.bin", 256
sfx1:
.incbin "sfx_badguy_amb.bin"
.incbin "sfx_badguy_amb.bin", 256
.endproc