Bus error caused by YM buzzer?

All 680x0 related coding posts in this section please.

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
YQN
Atari maniac
Atari maniac
Posts: 81
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Bus error caused by YM buzzer?

Postby YQN » Tue Oct 15, 2019 8:44 pm

Hi,

I have put my music disk project on pause to work on a birthday present for a friend of mine (childhood friend I used to swap floppies with), but I'm having a problem with sndh's that have a buzzer sound. As soon as the buzzer is used I get 2 bombs and the ST resets. Any idea what could cause this?

My sndh routines are these but I doubt they are the problem, I would suspect in they somehow interfere with something? I have no idea what to investigate (I could play the sndh's in my music disk project so they seem to work all right)...

Code: Select all

init_sndh:
      ;   expects subtune # in d0
      move.l   sndh_adr,a0         ;init sndhfile
      jsr   (a0)            ;
      rts
      

play_sndh:
      movem.l   d0-a6,-(sp)         
      move.l   sndh_adr,a0         ;sndhfile
      jsr   8(a0)            ;play
      movem.l   (sp)+,d0-a6
      rts


exit_sndh:
      move.l   sndh_adr,a0         ;deinit sndh
      jsr   4(a0)            ;
      lea   $ffff8800.w,a0
      move.l   #$08000000,(a0)
      move.l   #$09000000,(a0)
      move.l   #$0a000000,(a0)
      rts

Thanks in advance if you can help!

User avatar
ggn
Atari God
Atari God
Posts: 1258
Joined: Sat Dec 28, 2002 4:49 pm

Re: Bus error caused by YM buzzer?

Postby ggn » Wed Oct 16, 2019 5:33 am

Is this maxYMiser? Then you probably have to mshrink. i.e. try adding this magic code at the top of your code (courtesy of https://github.com/ggnkua/Atari_ST_Sour ... H_CPU.S#L9):

Code: Select all

main:      move.l  4(sp),a5                ; address to basepage

           move.l  $0c(a5),d0              ; length of text segment
           add.l   $14(a5),d0              ; length of data segment
      add.l   $1c(a5),d0              ; length of bss segment
           add.l   #$1000,d0               ; length of stackpointer
      add.l   #$100,d0                ; length of basepage
      move.l  a5,d1                   ; address to basepage
      add.l   d0,d1                   ; end of program
      and.l   #-2,d1                  ; make address even
      move.l  d1,sp                   ; new stackspace

      move.l  d0,-(sp)                ; mshrink()
      move.l  a5,-(sp)                ;
      move.w  d0,-(sp)                ;
      move.w  #$4a,-(sp)              ;
      trap    #1                     ;
      lea    12(sp),sp               ; 


Hopefully that fixes your problem
is 73 Falcon patched atari games enough ? ^^

User avatar
YQN
Atari maniac
Atari maniac
Posts: 81
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Bus error caused by YM buzzer?

Postby YQN » Fri Oct 18, 2019 7:01 pm

Thanks ggn, but I have these magic lines already at the beginning of my code, and the buzzer causes crash with non-maxymiser sndh's as well :/

User avatar
thomas3
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: Bus error caused by YM buzzer?

Postby thomas3 » Fri Oct 18, 2019 8:31 pm

Are you using Steem debug? If so, you can catch the point at which you are getting the crash and check reg values.

User avatar
npomarede
Atari God
Atari God
Posts: 1325
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: Bus error caused by YM buzzer?

Postby npomarede » Sat Oct 19, 2019 7:05 am

Hi
maybe you hit the case of the "spurious interrupt" which can happen under some circumstance when using MFP (look elsewhere in atari forum, there's some thread about it)
Try to change vector at $60 to point to a routine that just does a "RTE"

Nicolas

User avatar
YQN
Atari maniac
Atari maniac
Posts: 81
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Bus error caused by YM buzzer?

Postby YQN » Sat Nov 30, 2019 6:10 pm

I think I accidentally left vu bars code that was causing the error... *slaps self*


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 7 guests