aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--definitions.gbasm3
-rw-r--r--gui.gbasm14
-rw-r--r--main.gbasm5
-rw-r--r--modes/dungeon.gbasm23
-rw-r--r--music/game-over.furbin0 -> 444 bytes
-rw-r--r--music/game-over.vgmbin0 -> 1759 bytes
-rw-r--r--music/load.gbasm32
-rw-r--r--music/morning-forest.furbin773 -> 785 bytes
-rw-r--r--music/morning-forest.vgmbin7022 -> 6962 bytes
-rw-r--r--music/title-screen.vgmbin6137 -> 6128 bytes
-rw-r--r--playerattacks.gbasm20
-rw-r--r--text.gbasm6
-rw-r--r--text.gbtxt4
13 files changed, 103 insertions, 4 deletions
diff --git a/definitions.gbasm b/definitions.gbasm
index e7cfd7d..a42180d 100644
--- a/definitions.gbasm
+++ b/definitions.gbasm
@@ -78,18 +78,17 @@
; bit 4: if dialogue box text should be refreshed (part2)
; bit 5: if object display is paused
; bit 6: if additional tile should be loaded
-; bit 7: 1 when the dialogue box cannot be closed with start button
.DEFINE mem_current_mode ($c014)
.DEFINE mem_requested_mode ($c015)
; bit 0-3: which vblank handler group
.DEFINE enum_dungeon_mode $00
-.DEFINE enum_dead_mode $10
.DEFINE enum_dungeon_menu_mode $01
.DEFINE enum_dungeon_dialogue_mode $11
.DEFINE enum_loading_mode $02
.DEFINE enum_animation_wait_mode $12
.DEFINE enum_dungeon_generation_mode $03
+.DEFINE enum_dead_mode $21
.DEFINE mem_menu_cursor_position ($c016)
.DEFINE mem_last_button_direction ($c017)
diff --git a/gui.gbasm b/gui.gbasm
index bd03284..423c081 100644
--- a/gui.gbasm
+++ b/gui.gbasm
@@ -257,7 +257,21 @@ Check_dialogue_action:
JR Z, =.Dungeon_Menu
CP $enum_dungeon_dialogue_mode
+ JR Z, =.Dialogue_Box
+
+ LD A, $mem_button_action
+ LD B, A
+ LD A, $mem_last_button_action
+ XOR B
+ AND B
+ CP $00
+ RET Z
+ ; Wait for the music to stop to restart game when button pressed
+ LD A, $mem_sound_flags
+ BIT 0, A
RET NZ
+ JP =Start
+ RET
.Dialogue_Box:
LD A, $mem_button_action
diff --git a/main.gbasm b/main.gbasm
index 37b1331..0ff7fcf 100644
--- a/main.gbasm
+++ b/main.gbasm
@@ -11,9 +11,12 @@ Entrypoint:
LD A, $01
LD (HL+), A
XOR A
+ ;LD A, $05
LD (HL+), A
+ XOR A
LD (HL+), A
LD (HL+), A
+ ;LD A, $02
LD A, $01
LD $mem_number_of_attacks, A
@@ -80,3 +83,5 @@ _music_Dungeon:
.INCLUDEBIN "music/morning-forest.vgm"
_music_TitleScreen:
.INCLUDEBIN "music/title-screen.vgm"
+_music_GameOver:
+.INCLUDEBIN "music/game-over.vgm"
diff --git a/modes/dungeon.gbasm b/modes/dungeon.gbasm
index 7922e64..86fea59 100644
--- a/modes/dungeon.gbasm
+++ b/modes/dungeon.gbasm
@@ -56,18 +56,37 @@ Update_Animation_Steps:
RET NZ
.Dead_mode:
+ LD A, $mem_current_mode
+ CP $enum_dead_mode
+ RET Z
LD A, $00
LD $mem_bunny_direction, A
LD A, $02
LD $mem_bunny_animation, A
-
+ .LOAD_MUSIC =_music_GameOver
+ CALL =Start_Music
LD A, $enum_dead_mode
+ LD $mem_requested_mode, A
LD $mem_current_mode, A
CALL =Update_VBlank_Handler
- .CLOSE_DIALOGUE
+ LD HL, $dialogue_first_line
+ LD BC, $36
+ CALL =bzero
+
+ LD HL, $dialogue_first_line
+ .LOAD_BANK_OF =Game_Over_1_Txt
+ LD BC, ptr(=Game_Over_1_Txt)
+ CALL =Print_str
+
+ LD HL, $dialogue_third_line
+ .LOAD_BANK_OF =Game_Over_2_Txt
+ LD BC, ptr(=Game_Over_2_Txt)
+ CALL =Print_str
+ LD A, 0b00100111
+ LD $mem_display_flag, A
RET
STAT_Entrypoint:
diff --git a/music/game-over.fur b/music/game-over.fur
new file mode 100644
index 0000000..f3100e7
--- /dev/null
+++ b/music/game-over.fur
Binary files differ
diff --git a/music/game-over.vgm b/music/game-over.vgm
new file mode 100644
index 0000000..0be20e4
--- /dev/null
+++ b/music/game-over.vgm
Binary files differ
diff --git a/music/load.gbasm b/music/load.gbasm
index 1632233..5e2caf8 100644
--- a/music/load.gbasm
+++ b/music/load.gbasm
@@ -101,18 +101,32 @@ Loop_Music:
LD B, A
LD A, (HL)
+ LD $tmp_var_1, A
CALL =Inc_HL_Fix_Bank
ADD C
LD C, A
LD A, (HL)
+ LD $tmp_var_2, A
CALL =Inc_HL_Fix_Bank
ADC B
LD B, A
LD A, (HL)
+ LD $tmp_var_3, A
CALL =Inc_HL_Fix_Bank
ADC E
LD E, A
+ LD A, $tmp_var_1
+ CP $00
+ JR NZ, =.end_check_empty
+ LD A, $tmp_var_2
+ CP $00
+ JR NZ, =.end_check_empty
+ LD A, $tmp_var_2
+ CP $00
+ JR Z, =Stop_music
+ .end_check_empty:
+
LD A, $00
SLA B
RL A
@@ -132,6 +146,24 @@ Loop_Music:
LD ($mem_current_vgm_pc+2), A
RET
+Stop_Music:
+ LD A, $mem_sound_flags
+ RES 0, A
+ LD $mem_sound_flags, A
+ LD A, $mem_sound_flags
+ BIT 1, A
+ CALL Z, =Reset_Music_Channel1
+ LD A, $mem_sound_flags
+ BIT 2, A
+ CALL Z, =Reset_Music_Channel2
+ LD A, $mem_sound_flags
+ BIT 3, A
+ CALL Z, =Reset_Music_Channel3
+ LD A, $mem_sound_flags
+ BIT 4, A
+ CALL Z, =Reset_Music_Channel4
+ RET
+
Inc_HL_Fix_Bank:
PUSH AF
INC HL
diff --git a/music/morning-forest.fur b/music/morning-forest.fur
index bb9b8d4..0fafa84 100644
--- a/music/morning-forest.fur
+++ b/music/morning-forest.fur
Binary files differ
diff --git a/music/morning-forest.vgm b/music/morning-forest.vgm
index b3f423d..4292ff2 100644
--- a/music/morning-forest.vgm
+++ b/music/morning-forest.vgm
Binary files differ
diff --git a/music/title-screen.vgm b/music/title-screen.vgm
index 342011a..9b133e1 100644
--- a/music/title-screen.vgm
+++ b/music/title-screen.vgm
Binary files differ
diff --git a/playerattacks.gbasm b/playerattacks.gbasm
index b8eb745..419cd95 100644
--- a/playerattacks.gbasm
+++ b/playerattacks.gbasm
@@ -185,6 +185,26 @@ Attack_List:
.PADTO =.Earcoptr+8
+ ; 05
+ .Die:
+ ; Attack menu name string
+ .DB bank(=Die_Attack_Menu_Txt)
+ .DB ptr(=Die_Attack_Menu_Txt)
+
+ ; Attack function
+ .ASSERT bank(=Die_Attack) $00
+ .DB ptr(=Die_Attack)
+
+ ; Energy point cost
+ .DB $00
+
+ .PADTO =.Die+8
+
+Die_Attack:
+ LD A, $00
+ LD $mem_bunny_health, A
+ RET
+
.INCLUDE "playerattacks/hop.gbasm"
.INCLUDE "playerattacks/heal.gbasm"
.INCLUDE "playerattacks/freeze.gbasm"
diff --git a/text.gbasm b/text.gbasm
index 3ef4e7c..c3c4f7f 100644
--- a/text.gbasm
+++ b/text.gbasm
@@ -7,8 +7,14 @@ Freeze_Attack_Menu_Txt:
.DB 0x8f, 0x9b, 0x8e, 0x8e, 0xa3, 0x8e, 0xff
Earcoptr_Attack_Menu_Txt:
.DB 0x8e, 0x8a, 0x9b, 0x8c, 0x98, 0x99, 0x9d, 0x9b, 0xff
+Die_Attack_Menu_Txt:
+.DB 0x8d, 0x92, 0x8e, 0xff
Dungeon_Name_1_Txt:
.DB 0x96, 0x98, 0x9b, 0x97, 0x92, 0x97, 0x90, 0x0, 0x8f, 0x98, 0x9b, 0x8e, 0x9c, 0x9d, 0xff
+Game_Over_1_Txt:
+.DB 0x90, 0x8a, 0x96, 0x8e, 0x0, 0x98, 0x9f, 0x8e, 0x9b, 0xff
+Game_Over_2_Txt:
+.DB 0xa2, 0x98, 0x9e, 0x0, 0x9d, 0x9b, 0x92, 0x8e, 0x8d, 0x0, 0xaa, 0x83, 0xff
Press_Txt:
.DB 0x99, 0x9b, 0x8e, 0x9c, 0x9c, 0xff
Start_Txt:
diff --git a/text.gbtxt b/text.gbtxt
index 62a8d16..3d15849 100644
--- a/text.gbtxt
+++ b/text.gbtxt
@@ -2,8 +2,12 @@ Hop_Attack_Menu_Txt: Hop
Heal_Attack_Menu_Txt: Heal
Freeze_Attack_Menu_Txt: Freeze
Earcoptr_Attack_Menu_Txt: Earcoptr
+Die_Attack_Menu_Txt: Die
Dungeon_Name_1_Txt: Morning Forest
+Game_Over_1_Txt: Game Over
+Game_Over_2_Txt: You tried :3
+
Press_Txt: Press
Start_Txt: Start