CPCWiki forum

General Category => Programming => Topic started by: Shining on 07:19, 15 September 14

Title: Soundtrakker and SDCC
Post by: Shining on 07:19, 15 September 14
Hi all,


I'm struggling with including a soundtrakker-tune into my sdcc-project. Playing the tune messes my C-Code and vice versa.


The music is compiled with soundtrakker 128 in raw-mode at 0x4000 (until 0x563A) and my C-Code starts at 0x6000.


I call the player using inline-assembler at 0x4003.


Is the soundtrakker-player using ram outside its compiled section ?
Do I have to push/pop registers by myself before calling the player ?


(I've testet with starkos, this seemed to work as expected. But my compositions were made using soundtrakker)
Title: Re: Soundtrakker and SDCC
Post by: arnoldemu on 09:46, 15 September 14
Quote from: Shining on 07:19, 15 September 14
Hi all,


I'm struggling with including a soundtrakker-tune into my sdcc-project. Playing the tune messes my C-Code and vice versa.


The music is compiled with soundtrakker 128 in raw-mode at 0x4000 (until 0x563A) and my C-Code starts at 0x6000.


I call the player using inline-assembler at 0x4003.


Is the soundtrakker-player using ram outside its compiled section ?
Do I have to push/pop registers by myself before calling the player ?


(I've testet with starkos, this seemed to work as expected. But my compositions were made using soundtrakker)
I don't think I've used soundtrakker with SDCC. But assume you need to push/pop registers before calling player.
I would also di/ei around the player too.
Title: Re: Soundtrakker and SDCC
Post by: Shining on 06:37, 22 September 14
Thanks, push/pop did the job. Cause I'm calling the player within irq, also interrupts are disabled.


So my old tunes play fine in sdcc now  ;D .
Title: Re: Soundtrakker and SDCC
Post by: TFM on 18:00, 22 September 14
The soundtrakker player does EI's so you have to get rid of them by hand in case the interrupts are supposed to stay off!
Powered by SMFPacks Menu Editor Mod