Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GbaCretin committed Sep 26, 2022
1 parent 6a3f566 commit 8675d94
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/adpcm.s
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ PA_play_sample:
ld a,(hl)

; Stop sample if one's playing first
;ld d,REG_PA_CTRL
;or a,%10000000 ; Set dump bit
;ld e,a
;rst RST_YM_WRITEB
ld d,REG_PA_CTRL
or a,%10000000 ; Set dump bit
ld e,a
rst RST_YM_WRITEB

; Reset and mask channel status flag
;ld d,REG_P_FLAGS_W
;and a,%01111111 ; Clear 7th bit
and a,%01111111 ; Clear 7th bit
;ld e,a
;rst RST_YM_WRITEA

Expand Down
13 changes: 11 additions & 2 deletions src/mlm.s
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
; DOESN'T BACKUP REGISTERS
MLM_irq:
; Avoids MLM_stop spam
ld a,(MLM_is_song_playing)
or a,a ; cp a,0
ret z

xor a,a
ld a,(do_reset_chvols)
or a,a ; cp a,0
Expand Down Expand Up @@ -427,6 +432,7 @@ MLM_stop:
push de
push bc
push af
brk
call SSGCNT_init
call FMCNT_init
call SFXPS_set_taken_channels_free
Expand All @@ -445,9 +451,10 @@ MLM_stop:
ld (IRQ_TA_tick_time_counter),a
ld (do_stop_song),a

; DON'T RESET PAS, this messes with SFXPS
call ssg_stop
call fm_stop
call PA_reset
;call PA_reset
call pb_stop
pop af
pop bc
Expand Down Expand Up @@ -561,6 +568,9 @@ loop$:
call nz,MLM_ch_parameters_init
dec ix
djnz loop$

ld a,$FF
ld (MLM_is_song_playing),a
pop af
pop ix
pop de
Expand Down Expand Up @@ -985,7 +995,6 @@ MLM_set_channel_volume:
push bc
push af
push iy
brk
; Store unaltered channel volume in WRAM
ld hl,MLM_channel_volumes
ld b,0
Expand Down
1 change: 1 addition & 0 deletions src/wram.s
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ com_buffer_byte_significance: ds 1 ; u8

; ======== MLM player ========
MLM_wram_start:
MLM_is_song_playing: ds 1 ; bool
MLM_playback_pointers: ds 2*CHANNEL_COUNT ; void*[13]
MLM_playback_start_pointers: ds 2*CHANNEL_COUNT ; void*[13]
MLM_channel_control: ds CHANNEL_COUNT ; bool[13] (%0000'000E; channel Enable)
Expand Down

0 comments on commit 8675d94

Please sign in to comment.