aboutsummaryrefslogtreecommitdiff
path: root/dialogues
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-03-13 19:08:09 +0900
committerAstatin <[email protected]>2025-03-13 19:08:09 +0900
commit62701690d1c7b95b639d63d0cb9cd6ebeb9ac876 (patch)
tree833c88d35818c4d63e7d440355254aeb47af2cfd /dialogues
parentab45947d3fdc9885c497d9fc3dd124c7986f6ea4 (diff)
Adding multi-step dialogue
Diffstat (limited to 'dialogues')
-rw-r--r--dialogues/demo_quest.gbasm5
-rw-r--r--dialogues/dialogues.gbasm94
-rw-r--r--dialogues/text.gbasm12
-rw-r--r--dialogues/text.gbtxt8
-rw-r--r--dialogues/utils.gbasm23
5 files changed, 142 insertions, 0 deletions
diff --git a/dialogues/demo_quest.gbasm b/dialogues/demo_quest.gbasm
new file mode 100644
index 0000000..ea9dd46
--- /dev/null
+++ b/dialogues/demo_quest.gbasm
@@ -0,0 +1,5 @@
+Demo_quest_bunny:
+.TEXTB =Bunny_Header_Text =Dialogue_1_1b
+.TEXT =Dialogue_1_2t =Dialogue_1_2b
+.TEXT =Dialogue_1_3t =Empty
+.END
diff --git a/dialogues/dialogues.gbasm b/dialogues/dialogues.gbasm
new file mode 100644
index 0000000..1fdcc80
--- /dev/null
+++ b/dialogues/dialogues.gbasm
@@ -0,0 +1,94 @@
+Dialogue_script_step:
+ LD A, ($mem_dialogue_script_program_counter)
+ LD H, A
+ LD A, ($mem_dialogue_script_program_counter+1)
+ LD L, A
+
+ LD A, (HL+)
+
+ LD BC, =Dialogue_script_instruction_Jump_Table
+
+ .JUMP_TABLE
+
+ LD A, H
+ LD ($mem_dialogue_script_program_counter), A
+ LD A, L
+ LD ($mem_dialogue_script_program_counter+1), A
+
+ RET
+
+Dialogue_script_instruction_Jump_Table:
+ ; 00
+ JP =Exit_Menu
+ NOP
+
+ ; 01
+ JP =.Text
+ NOP
+
+ ;02
+ JP =.TextB
+ NOP
+
+ .Text:
+ PUSH HL
+ LD HL, $dialogue_first_line
+ LD BC, $12
+ CALL =bzero
+ POP HL
+
+ LD A, (HL+)
+ LD B, A
+ LD A, (HL+)
+ LD C, A
+ PUSH HL
+ LD HL, $dialogue_first_line
+ CALL =Print_str
+ POP HL
+
+ PUSH HL
+ LD HL, $dialogue_third_line
+ LD BC, $12
+ CALL =bzero
+ POP HL
+
+ LD A, (HL+)
+ LD B, A
+ LD A, (HL+)
+ LD C, A
+ PUSH HL
+ LD HL, $dialogue_third_line
+ CALL =Print_str
+ POP HL
+
+ LD A, $05
+ LD $mem_display_flag, A
+
+ RET
+
+ .TextB:
+ LD A, (HL+)
+ LD B, A
+ LD A, (HL+)
+ LD C, A
+ PUSH HL
+ LD HL, $dialogue_first_line
+ CALL =Print_str
+ POP HL
+
+ LD A, (HL+)
+ LD B, A
+ LD A, (HL+)
+ LD C, A
+ PUSH HL
+ LD HL, $dialogue_third_line
+ CALL =Print_str
+ POP HL
+
+ LD A, $07
+ LD $mem_display_flag, A
+
+ RET
+
+.INCLUDE "dialogues/text.gbasm"
+.INCLUDE "dialogues/demo_quest.gbasm"
diff --git a/dialogues/text.gbasm b/dialogues/text.gbasm
new file mode 100644
index 0000000..c8895d7
--- /dev/null
+++ b/dialogues/text.gbasm
@@ -0,0 +1,12 @@
+Empty:
+.DB , 0xff
+Bunny_Header_Text:
+.DB 0x8b, 0x9e, 0x97, 0x97, 0xa2, 0xaa, 0xff
+Dialogue_1_1b:
+.DB 0x91, 0x8e, 0x95, 0x95, 0x98, 0x0, 0xa5, 0xff
+Dialogue_1_2t:
+.DB 0x92, 0x0, 0x8a, 0x96, 0x0, 0x9c, 0x9d, 0x9e, 0x8c, 0x94, 0x0, 0x92, 0x97, 0x0, 0x9d, 0x91, 0x92, 0x9c, 0xff
+Dialogue_1_2b:
+.DB 0x8d, 0x9e, 0x97, 0x90, 0x8e, 0x98, 0x97, 0xa4, 0xff
+Dialogue_1_3t:
+.DB 0xa0, 0x98, 0x9e, 0x95, 0x8d, 0x0, 0xa2, 0x98, 0x9e, 0x0, 0x91, 0x8e, 0x95, 0x99, 0x0, 0x96, 0x8e, 0xa6, 0xff
diff --git a/dialogues/text.gbtxt b/dialogues/text.gbtxt
new file mode 100644
index 0000000..64c16b2
--- /dev/null
+++ b/dialogues/text.gbtxt
@@ -0,0 +1,8 @@
+Empty:
+Bunny_Header_Text: Bunny:
+Dialogue_1_1b: Hello !
+
+Dialogue_1_2t: I am stuck in this
+Dialogue_1_2b: dungeon.
+
+Dialogue_1_3t: Would you help me?
diff --git a/dialogues/utils.gbasm b/dialogues/utils.gbasm
new file mode 100644
index 0000000..38c9e51
--- /dev/null
+++ b/dialogues/utils.gbasm
@@ -0,0 +1,23 @@
+.MACRODEF START_SCRIPT script
+ LD A, high($script)
+ LD ($mem_dialogue_script_program_counter), A
+ LD A, low($script)
+ LD ($mem_dialogue_script_program_counter+1), A
+ CALL =Dialogue_script_step
+.END
+
+.MACRODEF END
+ .DB 00
+.END
+
+.MACRODEF TEXT first_line second_line
+ .DB 01
+ .DB $first_line
+ .DB $second_line
+.END
+
+.MACRODEF TEXTB first_line second_line
+ .DB 02
+ .DB $first_line
+ .DB $second_line
+.END