double buffered dmasound player in stos

STOS-related stuff in here please

Moderators: Zorro 2, Moderator Team

Post Reply
mlynn1974
Atari Super Hero
Atari Super Hero
Posts: 764
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

double buffered dmasound player in stos

Post by mlynn1974 »

I have written a double buffered DMA sound player in STOS.
It uses DMA Sound so it is really only STE compatible, but Steem will play it just fine. It also uses gemdos fopen\fread\fseek\fclose (see my other post).

It is a prototype for such a routine which I might try to write in assembly (with STFM compatibility).
I know it clicks a little bit when the samples swap buffers but it is better than nothing.
It can play samples larger than physical memory e.g. an STE with 512k can play a 1.7Mb sample running off a hard disk or virtual hard disk in Steem.

You can download my prototype demo here (1.38Mb):
http://www.lynn3686.com/download/stos/motd1.zip
This plays the old Match of the Day tune with some player statistics showing. The music is sampled at 12.5kHz, 8-bit, signed using Audicity.
I haven't tested this on a real STE yet. I have just developed it in STOS using Steem 3.2
Still got, still working: Atari 4Mb STe, MegaST 2, 520STFM (x2), 2.5Mb STF, Atari 2600JR, Flashback 8 Gold.
Hardware: PC720B, Cumana CSA 354, Ultimate Ripper, Discovery Cartridge, Blitz Turbo, Synchro Express II (US and UK Versions).
User avatar
OverlordMRK
Atari User
Atari User
Posts: 33
Joined: Thu Aug 31, 2017 10:25 pm

Re: double buffered dmasound player in stos

Post by OverlordMRK »

That sounds really clear for 12.5Khz, nice. When you mean write in assembly, are you meaning to create an actual extension for STOS? STFM compatibility would be good for this in STOS as well as STE. I presume because of processor time and access speed, it would be limited to having just a game title screen and the music playing in the background? But still, that would be pretty neat regardless!
User avatar
thomas3
Captain Atari
Captain Atari
Posts: 400
Joined: Tue Apr 11, 2017 8:57 pm

Re: double buffered dmasound player in stos

Post by thomas3 »

:cheers: This is really cool! Thanks!
mlynn1974
Atari Super Hero
Atari Super Hero
Posts: 764
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: double buffered dmasound player in stos

Post by mlynn1974 »

When you mean write in assembly, are you meaning to create an actual extension for STOS?
No I was thinking of writing the whole routine in assembly. I don't know how to write a full extension from scratch. STOS is fine for a quick prototype.

I think the demo code like a scroller or sprites would have to run on the VBL interrupt to guarantee execution. This isn't possible\practical in STOS. The disk loader would have to run on the main loop because disk i/o in an interrupt would block the main loop. I think this is how the Kinky Boots demo by POV works.

>it would be limited to having just a game title screen and the music playing in the background?
Yes for long tunes MOD format is better, but for sample demos this technique is good.
Still got, still working: Atari 4Mb STe, MegaST 2, 520STFM (x2), 2.5Mb STF, Atari 2600JR, Flashback 8 Gold.
Hardware: PC720B, Cumana CSA 354, Ultimate Ripper, Discovery Cartridge, Blitz Turbo, Synchro Express II (US and UK Versions).
User avatar
MiggyMog
Atari Super Hero
Atari Super Hero
Posts: 989
Joined: Sun Oct 30, 2005 4:43 pm
Location: Scotland

Re: double buffered dmasound player in stos

Post by MiggyMog »

Cool. There are some details on making an extension in the stos gamemaker's manual but there are supposedly details mising. There is an example with the missing link extension on the disk. You can get it in exxos' s site
('< o o o o |''| STM,2xSTFM,2xSTE+HD,C-Lab Falcon MK2+HD,Satandisk,Ultrasatandisk,Ethernat.
Post Reply

Return to “STOS”