Author Topic: Is this 'impossible ST tune' possible on CPC?  (Read 1517 times)

0 Members and 1 Guest are viewing this topic.

Offline SuTeKH/Epyteor

  • 6128 Plus
  • ******
  • Posts: 1.379
  • Country: 00
  • Liked: 1286
  • Likes Given: 2030
Is this 'impossible ST tune' possible on CPC?
« on: 13: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
 
128 Byte Choonage by gwEm / PHF (Atari ST music demo)
 

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
Re: Is this 'impossible ST tune' possible on CPC?
« Reply #1 on: 15:31, 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
 
128 Byte Choonage by gwEm / PHF (Atari ST music demo)
yes, I've done it before.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.967
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3426
  • Likes Given: 6155
Re: Is this 'impossible ST tune' possible on CPC?
« Reply #2 on: 18:20, 26 October 11 »
yes, I've done it before.


Share! Enlighten us! :D

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2274
  • Likes Given: 3478
Re: Is this 'impossible ST tune' possible on CPC?
« Reply #3 on: 19:53, 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.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline SyX

  • 6128 Plus
  • ******
  • Posts: 1.129
  • Country: br
  • Liked: 1118
  • Likes Given: 1871
Re: Is this 'impossible ST tune' possible on CPC?
« Reply #4 on: 19: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".

Offline ralferoo

  • Supporter
  • 6128 Plus
  • *
  • Posts: 969
  • Country: gb
  • Liked: 583
  • Likes Given: 222
Re: Is this 'impossible ST tune' possible on CPC?
« Reply #5 on: 01:08, 27 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...