Page 1 of 1

WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Tue Dec 25, 2018 7:07 pm
by ricco59
... Hi Atari Fans ;)

I need some help.

Since few years, I'm coding, porting slowly an amiga game (few hours a week when I have a little spare time) to a basic Falcon030 and want to know what is the best way to play a 3 voices amiga format mod and use the other voices to play sample effects with frequency and volume values. Maybe you have some source examples

I'm using a basic vblank loop

Game :
- action 1 - play sfx1
- action 2 - play sfx2
- ...
- ...
- jsr mt_music (or something like this)
- wait vblank (using xbios)
bra game

Oh, I forgot, I code in asm using devpac (Hatari for coding and real Falcon for testing and bug hunting ;) )

Many thanks and Merry Christmas

Eric

ps :
I'm posting some screenshots very soon and maybe a short video. Thanks again
There are some work to do but the game is playable

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Tue Dec 25, 2018 8:11 pm
by ggn
Check out DSPmod34 (http://dhs.nu/files.php?t=democreation), it supports up to 4 channels music + 4 channels of sound effects.

Good luck with your game!

(and Happy Christmas!)

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Tue Dec 25, 2018 10:42 pm
by ricco59
Many thanks ggn. I have to study this ;)

Here are some screenshots
Image Image Image Image
Image Image Image

and a video
https://www.youtube.com/watch?v=wCCLa_lgniA

See you

Eric

ps : Thanks to the Modo

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Tue Dec 25, 2018 10:55 pm
by MM41
Nice game Ricco59 :cheers: ,
My Falcon is happy to see a new game :D

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Wed Dec 26, 2018 8:24 am
by dma
Waaah a falling quadraminos game, sweet!
Colorful graphs, and that book opening animation looks really cool.
Can't wait to play it. :)

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Wed Dec 26, 2018 8:12 pm
by ricco59
@MM41, dma > Thank you for your feedback

I have to finish it.
Those next days, I'm going to try to include sfx and musics

C U

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Sat Dec 29, 2018 7:35 pm
by ricco59
@ggn, is there a tuto to know how DSPmod34 works and how use it for sample playing (maybe a simple source code playing a .mod while playing 2 or 3 samples) ? It's my first try on Atari Falcon :)
Thanks again my Friend ;)

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Sat Dec 29, 2018 9:14 pm
by ggn
ricco59 wrote:@ggn, is there a tuto to know how DSPmod34 works and how use it for sample playing (maybe a simple source code playing a .mod while playing 2 or 3 samples) ? It's my first try on Atari Falcon :)
Thanks again my Friend ;)
Sure thing!

You can start without even integrating it in your code to see how it works by assembling "easy_use.s". Don't forget to change the path to your .mod file in label "dspmod34_mod" first. This should assemble and run properly as a .prg.

Now that we got it working, let's butcher it a bit ;).

Go to label "dspmod34_voltab4" at line 256. Each word value tells the player how loud each channel will be. As you notice, there are 4 $7fff and 4 0 values. This means that the first 4 channels (which are used by the mod) are at max volume and the others are 0. For the player 0 means "don't use this channel ever". So change the first 2 zeros to say $3fff (which should be half the volume of the mod). If you assemble and run this, it should still play the mod fine.

Now, incbin a couple of samples so we can try the sample playing out.

From the docs, you can find that you have to call dspmod34_player+dspmod34_fx to play a sample. Also you have to set up some magic values before calling:

Code: Select all

   	d0: fx-Channel ( 0 ... 3 )
	d1: Sample-Period
	d2: Sample-Volume
	d3: Sample-Position
	a0: Sample-Start	( Adresse )
	a1: Sample-Ende         ( Adresse )
	a2: Repeat-Start        ( Adresse )
	a3: Repeat-Länge        ( Bytes )
So if you incbin your sample like this:

Code: Select all

my_ossom_sample: incbin "sample.raw"
my_ossom_sample_end:
you can load d0 with 0 to play your sample in the first fx channel (which is channel 5 if we count all channels), d2 with 64 (maximum allowable volume), d3 with 0 so we play the sample from start, a0 with my_ossom_sample, a1 with my_ossom_sample_end. If you don't want the sample to loop, just load a2 with my_ossom_sample and a3 with 2. Otherwise you need to calculate and enter the start position and length of the loop.

Which leaves us with d1 which I left for the end, because it's where the dreaded amiga comes into play. Because the mod player has to emulate the Paula chip to play the samples, it internally calculates sample frequencies using so called amiga period values. A quick search around the internets brought me to this site: https://bel.fi/alankila/modguide/interpolate.txt where we see that the Paula clock is around 3546895Hz. So if we want to play a 8KHz mono sample we have to calculate the period as 3546895/2/8000=221.6809375, so let's say 222. (I'm not 100% sure where that /2 comes from - I'm not an expert on Amiga stuff, just bear with me, I just did the absolute minimum to get the thing working :D).

So, with this knowledge we can now go to easy_use.s and add some code after line 88, i.e. after calling "dspmod34_supervisor_out" and before waiting for keypress. Something like:

Code: Select all

                lea my_ossom_sample,a0
                lea my_ossom_sample_end,a1
                moveq   #0,D0
                move.w  #222,D1
                move.w  #64,D2
                moveq   #0,D3
                movea.l A0,A2
                lea     2,A3
                bsr     dspmod34_player+dspmod34_fx
In theory this should play the sample once when the program is run. Perhaps you might want to change that "lea 2,a3" to something like "lea "my_ossom_sample_end-my_ossom_sample,a3" so it will loop the sample as long as the mod is playing.

And that should be all there is to it!

If you got this working then integrating it with your code shouldn't be too hard, just move the code from "begin" to "move.l #dspmod34_vbl,$04d2" in your startup code. If you check out the top of easy_use.s, there are some other useful routines to run, like turning the player off and on, etc etc.

Anyway, try this out and good luck :)

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Fri Jan 04, 2019 10:01 pm
by ricco59
Thank you my friend and happy new year for all Atari & Retro Fans ;)

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Sun Sep 13, 2020 6:40 pm
by ricco59
Hi Friends

Too bad : I can't finish my game STEPFIVE for falcon because, my Bird stays on the floor.... Black Screen

Power led is On, the disk drive led is active flashing, stopping, flashing, etc...

Is my videl dead ??? Is there anybody who solve this problem ?? Is there a way to make it fly again ?

I am very sad that I can't continue developing this game unless ...



Thanks in advance

Eric

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Mon Sep 14, 2020 2:44 pm
by Ektus
NVRAM battery dead? What kind of monitor do you have connected? Test cartridges are available from Belgium, too, to undergo some low level troubleshooting.

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Mon Sep 14, 2020 6:06 pm
by Eero Tamminen
ricco59 wrote: Sun Sep 13, 2020 6:40 pm Too bad : I can't finish my game STEPFIVE for falcon because, my Bird stays on the floor.... Black Screen

Power led is On, the disk drive led is active flashing, stopping, flashing, etc...
...
Is this hard disk led? And if yes, have you tried some boot floppy?
ricco59 wrote: Sun Sep 13, 2020 6:40 pm Is my videl dead ??? Is there anybody who solve this problem ?? Is there a way to make it fly again ?
I guess you've tried monitor cable connections and that the problem isn't with your monitor?

(Old CRT monitors have similar caps issues as our old Atari machines...)

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Thu Sep 17, 2020 5:57 am
by ricco59
Hi,

@Ektus >
My falcon is connected to a vga monitor.
I searched my 'falcon to scart' cable but no way... I can't find it
I'll test it using rf cable

@Eero >
the hd is disconnected. I only have disk drive connected
A fan tells me to create a 'bootable' disk with auto folder and a nvram reset prg in it. It's programmed ;)

Thanks friends
I'll try the different solutions during this weekend

See you

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Tue Sep 29, 2020 6:17 pm
by ricco59
Hi again

I've seen some things...
- as written the floppy/hdd led activity is flashing, stopping, flashing and so on ...
- I've connected back the internal speaker and when I switch on the falcon, I hear a 'poc' but as the floppy led activity sequence, the falcon 'poc' at each flashing (I hope you understand what I mean :) )
Is my falcon rebooting, rebooting,... ?

Normally, this 'poc' is heard one time, while booting the computer no ?

Thks

Eric

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Sat Oct 03, 2020 6:18 pm
by ricco59
Hi

Last try

I've changed memory (Centek 14Mo)..... the same
I've changed the psu........................ the same too...

I have to put my falcon in standby for a while

Eric

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Sat Oct 03, 2020 10:23 pm
by viking272
Hi Eric, mabe make a post in the hardware section as there are some great and knowledgeable guys on AF who might be able to help more?
Have you tried a different monitor or TV with RF? Do you get any output at all or just white or black blank?

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Mon Oct 05, 2020 6:19 pm
by ricco59
Hi Viking272

I'm waiting for a FALCON VGA-RGB-MONO ADAPTOR to connect it on a RGB monitor
I'll come back after receiving it. I'm about to order capacitors for motherboard, they have never been changed...

I got black screen, and it's like the falcon reboot, reboot... I did'nt hear the noise of the disk drive when booting the falcon... nothing

stay tuned, I'm waiting for my orders ;)

thanks to all

Eric

Re: WIP - StepFive - Amiga Musics + SFX on falcon...

Posted: Mon Oct 05, 2020 8:06 pm
by Cyprian
a few years ago my TT refused to start. I had a plan to remount all sockets, and replace all capacitors. Fortunately before that I just checked reset button. And that was that! It was invisible broken and constantly pressed.
I probably saved life of my TT and also a lot of money
https://www.atari-forum.com/viewtopic.p ... 29#p214729