From 943185eb6223db7834f558f4b28091c6da5a4e8b Mon Sep 17 00:00:00 2001 From: AArt1256 Date: Sat, 29 Nov 2025 13:50:08 +0300 Subject: [PATCH] actually implemented the dialog text (better sync needed though) --- loader/samples/minexample/conv_liltalk.py | 29 ++ loader/samples/minexample/liltalk.bin | Bin 0 -> 988 bytes loader/samples/minexample/liltalk_speak.txt | 307 ++++++++++++++++++++ loader/samples/minexample/main.asm | 105 ++++++- loader/samples/minexample/sfx.asm | 4 +- 5 files changed, 440 insertions(+), 5 deletions(-) create mode 100644 loader/samples/minexample/conv_liltalk.py create mode 100644 loader/samples/minexample/liltalk.bin create mode 100644 loader/samples/minexample/liltalk_speak.txt diff --git a/loader/samples/minexample/conv_liltalk.py b/loader/samples/minexample/conv_liltalk.py new file mode 100644 index 0000000..516c9a0 --- /dev/null +++ b/loader/samples/minexample/conv_liltalk.py @@ -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() \ No newline at end of file diff --git a/loader/samples/minexample/liltalk.bin b/loader/samples/minexample/liltalk.bin new file mode 100644 index 0000000000000000000000000000000000000000..ed6f00aac7a146f2748b09af19d41da621f9f37e GIT binary patch literal 988 zcmYk5QEtL85JcIqMHRHD>IwYE56Tfr0~mrzFbbiFi}heV5bd*ry4XSug%Xp)-iaaTVGl;s zjm{=yBpk4dJ$BhblEtx40bz;&fH58K_*oS5=zo+7!104RSYssv7CA=xXaZ*0;K*P$ zBhK07!Ao?m$t0m;i3cd^fH;hKpK$Is4I{cF6AXxwb(xY0FcHOdA@|^yi4kaa!E9uN zNBmkn=kjo9cbhXV>XzKPwdlGS|+b5BuJG`K;(cAjsf{3 zOgKe|q5y3ZxaCBahPC9FvAf@pNq;vG1pAnynZiO&`K-k;{=r5+A6H-1^WCg*)xOu%vrbvWRM_$*n@;7q|B`0_H80@^|p}59Wh;8~^|S literal 0 HcmV?d00001 diff --git a/loader/samples/minexample/liltalk_speak.txt b/loader/samples/minexample/liltalk_speak.txt new file mode 100644 index 0000000..3866852 --- /dev/null +++ b/loader/samples/minexample/liltalk_speak.txt @@ -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 \ No newline at end of file diff --git a/loader/samples/minexample/main.asm b/loader/samples/minexample/main.asm index 548cb61..e451a47 100644 --- a/loader/samples/minexample/main.asm +++ b/loader/samples/minexample/main.asm @@ -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 @@ -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+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" diff --git a/loader/samples/minexample/sfx.asm b/loader/samples/minexample/sfx.asm index 164103b..4ca6ada 100644 --- a/loader/samples/minexample/sfx.asm +++ b/loader/samples/minexample/sfx.asm @@ -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 \ No newline at end of file