diff options
author | Astatin <[email protected]> | 2025-07-12 02:45:00 +0200 |
---|---|---|
committer | Astatin <[email protected]> | 2025-07-12 02:45:00 +0200 |
commit | d77b156de83e8a93e3fa9832642824089593d1db (patch) | |
tree | f33a5a1f8bb54680b89db41e1ed8c26595a2231e /modes | |
parent | e9dc1a32f8e7199e020123e0377c665c0e1443a1 (diff) |
Play music from included vgm file
Diffstat (limited to 'modes')
-rw-r--r-- | modes/dialoguemenu.gbasm | 2 | ||||
-rw-r--r-- | modes/dungeon.gbasm | 2 | ||||
-rw-r--r-- | modes/dungeongeneration.gbasm | 47 | ||||
-rw-r--r-- | modes/loading.gbasm | 2 |
4 files changed, 48 insertions, 5 deletions
diff --git a/modes/dialoguemenu.gbasm b/modes/dialoguemenu.gbasm index ad0b3be..306ea50 100644 --- a/modes/dialoguemenu.gbasm +++ b/modes/dialoguemenu.gbasm @@ -48,5 +48,7 @@ Dialogue_VBLANK_Entrypoint: INC A LD $mem_loop_frame_timer, A + CALL =Play_Music + .ENABLE_VBLANK_INTERRUPTS RETI diff --git a/modes/dungeon.gbasm b/modes/dungeon.gbasm index 1d27cc1..9062425 100644 --- a/modes/dungeon.gbasm +++ b/modes/dungeon.gbasm @@ -187,5 +187,7 @@ Dungeon_VBLANK_Entrypoint: INC A LD $mem_loop_frame_timer, A + CALL =Play_Music + .ENABLE_VBLANK_INTERRUPTS RETI diff --git a/modes/dungeongeneration.gbasm b/modes/dungeongeneration.gbasm index bfbe58c..11824de 100644 --- a/modes/dungeongeneration.gbasm +++ b/modes/dungeongeneration.gbasm @@ -14,6 +14,15 @@ LD $reg_interrupt_enable, A .END +.MACRODEF ENABLE_MUSIC_INTERRUPT + LD A, low(=Dungeon_1st_step_VBlank) + LD ($mem_vblank_jump_destination), A + LD A, high(=Dungeon_1st_step_VBlank) + LD ($mem_vblank_jump_destination+1), A + .RESET_INTERRUPTS + .ENABLE_VBLANK_INTERRUPTS +.END + .MACRODEF DISABLE_MODE_2_INTERRUPT LD A, $00 LD $reg_lcd_status, A @@ -40,6 +49,8 @@ New_Dungeon: New_Floor: LD SP, $fffe + .ENABLE_MUSIC_INTERRUPT + EI LD A, $00 LD $mem_display_flag, A @@ -209,15 +220,12 @@ Dungeon_generation_VBlank: LD A, $mem_floor_count CALL =Print_8bit - CALL =Update_VBlank_Handler + CALL =Reset_Entities_Collision_Map DI .DISABLE_MODE_2_INTERRUPT - - CALL =Reset_Entities_Collision_Map - + CALL =Update_VBlank_Handler .ENABLE_VBLANK_INTERRUPTS - .RESET_INTERRUPTS EI .Wait_for_Interrupt.loop: @@ -227,8 +235,37 @@ Dungeon_generation_VBlank: Dungeon_generation_Out_Of_VBlank: PUSH AF + PUSH BC + PUSH DE + PUSH HL + LD A, $saved_rom_bank + PUSH AF + CALL =Play_Music CALL =VBlank_Wait .ENABLE_MODE_2_INTERRUPT .RESET_INTERRUPTS POP AF + .CHANGE_BANK_TO_A + POP HL + POP DE + POP BC + POP AF + RETI + +Dungeon_1st_step_VBlank: + PUSH AF + PUSH BC + PUSH DE + PUSH HL + LD A, $saved_rom_bank + PUSH AF + CALL =Play_Music + .ENABLE_VBLANK_INTERRUPTS + .RESET_INTERRUPTS + POP AF + .CHANGE_BANK_TO_A + POP HL + POP DE + POP BC + POP AF RETI diff --git a/modes/loading.gbasm b/modes/loading.gbasm index df1bd24..649d474 100644 --- a/modes/loading.gbasm +++ b/modes/loading.gbasm @@ -32,5 +32,7 @@ Loading_VBLANK_Entrypoint: INC A LD $mem_loop_frame_timer, A + CALL =Play_Music + .ENABLE_VBLANK_INTERRUPTS RETI |