It is currently Mon Dec 11, 2017 12:14 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Dec 23, 2016 7:29 am 
Offline
User avatar

Joined: Sun Sep 26, 2010 10:29 pm
Posts: 39
Hello,
I am nearly done with my first NES project written in C. One of the last things I have to achieve is to add some sound effects.
I use Shiru's NESLibrary and therefore function sfx_play for the purpose of playing sound effects.
I wrote my first simple sound effect with Famitracker and converted it into a .s file using Shriu's Famitone2.

The problem is as follows: The sound effects are played with a large delay after they are actually triggered. I checked the demo game that comes with Shiru's NESLibrary (Chase) and it seems to me, that this game is also facing this issue.

Can anybody help me out with this problem?


Regards Sebastian


Top
 Profile  
 
PostPosted: Fri Dec 23, 2016 8:07 am 
Online
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1866
Location: DIGDUG
I'm looking at Chase in a debugger...title screen...

Time between 'Start' read by the joypad routine and the sfx(0) data being read = 29093 cycles, or about 1 frame. Time till that data is written to the APU...357 cycles [total = 0.0167 seconds]

Seems 'ok' to me.

EDIT...

In game, time between sfx(1) called and read data = 27996 cycles, time till written to APU, 288 cycles. Also 0.0167 seconds. Confirmed. Chase Sfx are ok.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Fri Dec 23, 2016 9:08 am 
Offline
User avatar

Joined: Sun Sep 26, 2010 10:29 pm
Posts: 39
Sorry my bad. After I read your post I got an idea which revealed to be the solution:
I develop my NES project on a small AWS windows machine in order to have a single space that is only for NES programming.

Testing my projects in the cloud worked fine until I added sound. Therefore I now downloaded my project to my local machine and tested
it there: sound is played properly.
So the problem was my latency which lead into a delay, when transmitting sound effects :D

Thanks for your support, though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group