[adam] using EOS VDP int sound routines causes crash

Post Reply
tschak909
Well known member
Posts: 171
Joined: Sun Sep 09, 2018 5:44 pm

[adam] using EOS VDP int sound routines causes crash

Post by tschak909 »

Hey guys,

The Adam EOS has _very_ flexible routines to handle sound playback, that were borrowed from the ColecoVision OS7 ROM, that seem to become _VERY_ unstable when attached using add_raster_int(), causing display corruption and/or code crashes.

lib:
https://github.com/tschak909/smartkeyslib

example test program:
https://github.com/tschak909/smartkeysl ... eys-sounds (binary attached)

The smartkeys_sound_play() code that is attached to add_raster_int:

Code: Select all

static void nmi_play(void)
{
  M_PRESERVE_MAIN;
  M_PRESERVE_INDEX;
  eos_play_sound();
  M_RESTORE_INDEX;
  M_RESTORE_MAIN;
}
eos_play_sound():
https://github.com/tschak909/eoslib/blo ... ay_sound.c

Am I just doing something silly?

-Thom
You do not have the required permissions to view the files attached to this post.
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: [adam] using EOS VDP int sound routines causes crash

Post by dom »

REGS_ALL will corrupt the alternate registers as well - have you tried saving those in the interrupt routine?

I've got a hunch that msx_vfill is causing the problem: it looks like interrupts aren't disabled whilst it's doing its thing - if you remove those calls then I guess the corruption goes away, but do the crashes?
tschak909
Well known member
Posts: 171
Joined: Sun Sep 09, 2018 5:44 pm

Re: [adam] using EOS VDP int sound routines causes crash

Post by tschak909 »

How am I supposed to save/restore every register?
-Thom
User avatar
dom
Well known member
Posts: 2072
Joined: Sun Jul 15, 2007 10:01 pm

Re: [adam] using EOS VDP int sound routines causes crash

Post by dom »

Use M_PRESERVE_ALL/M_RESTORE_ALL to save/restore all registers
Post Reply