CPCWiki forum

General Category => Programming => Topic started by: tastefulmrship on 11:28, 25 October 11

Title: Is this 'impossible ST tune' possible on CPC?
Post by: tastefulmrship on 11:28, 25 October 11
gwEm of The Psycho Hacking Force (Atari-ST) has written a pretty impressive 128 byte music demo. My question is; is it possible to convert the ST code into CPC Z80-speak?

Here's the link & a YouTube video.
http://dhs.nu/news.php (http://dhs.nu/news.php)

128 Byte Choonage by gwEm / PHF (Atari ST music demo) (http://www.youtube.com/watch?v=iZ1ZGo3zSqI#)
Title: Re: Is this 'impossible ST tune' possible on CPC?
Post by: arnoldemu on 13:31, 25 October 11
Quote from: tastefulmrship on 11:28, 25 October 11
gwEm of The Psycho Hacking Force (Atari-ST) has written a pretty impressive 128 byte music demo. My question is; is it possible to convert the ST code into CPC Z80-speak?

Here's the link & a YouTube video.
http://dhs.nu/news.php (http://dhs.nu/news.php)

128 Byte Choonage by gwEm / PHF (Atari ST music demo) (http://www.youtube.com/watch?v=iZ1ZGo3zSqI#)
yes, I've done it before.
Title: Re: Is this 'impossible ST tune' possible on CPC?
Post by: Gryzor on 16:20, 26 October 11
Quote from: arnoldemu on 13:31, 25 October 11
yes, I've done it before.


Share! Enlighten us! :D
Title: Re: Is this 'impossible ST tune' possible on CPC?
Post by: arnoldemu on 17:53, 26 October 11
Quote from: Gryzor on 16:20, 26 October 11
Share! Enlighten us! :D
Using my friend's Atari ST, I used his "hacker cartridge" to view the memory, identify the music player and save out the memory.
I then transferred this to cpc, using my own disc reader tool (long lost now :( ).
Then I used a basic program on the cpc, to dissassemble the code, and generate the dissassembled 68000 assembly code.
Then I printed this out, and instruction by instruction, converted it into 1 or more z80 instructions.
The end result was I had converted the music driver and I could play atari st music on the cpc.

So I would do the same for this one, *if I had the time*, and hope that it doesn't generate a load of data that is too big for the cpc's ram.
Title: Re: Is this 'impossible ST tune' possible on CPC?
Post by: SyX on 17:59, 26 October 11
The sourcecode is included, it's short and very easy to understand, but i don't know if it's possible to convert at cpc, because it's using the Timer D to alter the wave to sound more "sid".
Title: Re: Is this 'impossible ST tune' possible on CPC?
Post by: ralferoo on 23:08, 26 October 11
From memory (I had a quick look at the source at lunch time, and I used to have an Amiga not an ST so the use of the timer is all guesswork):

* the "algorithmic note generation" is reading the ROM a byte at a time, using the bottom 3 bits of each to choose one of 8 notes
* the timer is used to stop the sound early (maybe this is the "more sidlike" thing, certainly it's done in the interrupt function called sid) - seems to be set to the same frequency as the note, so presumably so it plays exactly 1 complete wave
* that timer *might* change the way the AY works, I don't know enough about ST hardware.
* the note is played every 4th vblank
* a digidrum (which the CPC doesn't have) is played alternates 1 beat or 2 beats behind the note

Probably wouldn't fit in 128 bytes on the CPC, but I'm sure you could get a similar sounding effect in not much more...
Powered by SMFPacks Menu Editor Mod