Brian's Man Cave Posted July 4, 2021 Share Posted July 4, 2021 Hey guys! In my game I am using the Voice command to say things when the character hits an object. It seems to work most of the time, but sometimes it just makes continuous static noise sound like a TV snow sound. Also when it does that, sometimes it crashes the whole game. I am wondering if its an emulator issue, as I haven't tried it yet on the LTO Flash cart. But could there be something else that is going on or that I am unaware of? Quote Link to comment Share on other sites More sharing options...
+nanochess Posted July 5, 2021 Share Posted July 5, 2021 Hi. Maybe you have forgot to finish your VOICE data with a zero so it starts playing code as voice. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted July 5, 2021 Share Posted July 5, 2021 17 hours ago, Brian's Man Cave said: Hey guys! In my game I am using the Voice command to say things when the character hits an object. It seems to work most of the time, but sometimes it just makes continuous static noise sound like a TV snow sound. Also when it does that, sometimes it crashes the whole game. I am wondering if its an emulator issue, as I haven't tried it yet on the LTO Flash cart. But could there be something else that is going on or that I am unaware of? I've had this exact problem before and it turned out to be bad voice data. Like @nanochess suggested, make sure your voice data is correct and ends with a zero after each phrase record. -dZ. Quote Link to comment Share on other sites More sharing options...
Brian's Man Cave Posted July 5, 2021 Author Share Posted July 5, 2021 Here is my code voice_hit: VOICE KK2,ER2,AA,PP,PA1,0 Then I call it using a variable talk_cop_hit = 1 if (col2 and $08) then if hearvoice = 0 then talk_cop_hit = 1 hearvoice = 1 in my main game loop is the voice command if talk_cop_hit = 1 then VOICE PLAY voice_hit talk_cop_hit = 0 end if Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted July 5, 2021 Share Posted July 5, 2021 Where is "hearvoice" cleared again? Is there any chance that your VOICE PLAY statement is re-entered? I do not think that the collision values are cleared automatically, so the "col2 AND $08" may be re-entrant; and if "hearvoice" has bee inadvertently cleared, you could be calling VOICE PLAY over itself. dZ. Quote Link to comment Share on other sites More sharing options...
Kiwi Posted July 5, 2021 Share Posted July 5, 2021 1 hour ago, Brian's Man Cave said: Here is my code voice_hit: VOICE KK2,ER2,AA,PP,PA1,0 Then I call it using a variable talk_cop_hit = 1 if (col2 and $08) then if hearvoice = 0 then talk_cop_hit = 1 hearvoice = 1 in my main game loop is the voice command if talk_cop_hit = 1 then VOICE PLAY voice_hit talk_cop_hit = 0 end if I think if (col2 and $08) then VOICE PLAY voice_hit would play once. I believe data get pushed into Intellivoice's memory and then it own processor play back that data until it hit zero. You probably could do a cooldown for voice to have it play completely before resetting the voice clip to the beginning. Like if(col2 and $08) then if voiceclip=0 then VOICE PLAY voice_hit:voiceclip=32(can be changed if the voice clip is shorter or longer.) end if :main loop: if (voiceclip<>0) then voiceclip=voiceclip-1 Quote Link to comment Share on other sites More sharing options...
Brian's Man Cave Posted July 5, 2021 Author Share Posted July 5, 2021 hearvoice is cleared when the character leaves the screen to go to the next screen, I have a bunch of variables that change / reset during that time. The main reason I put the hearvoice = 0 is because the voice was registering more than once per collision... so adding that like a cool down stopped the repeating voice. My thought was that he would only talk once per screen. The strange thing is that the crash is not consistent. Sometimes it happens right away, and sometimes its takes a few tries. Quote Link to comment Share on other sites More sharing options...
+cmadruga Posted July 5, 2021 Share Posted July 5, 2021 Are you keeping an eye on your memory segments? Weird crashes happen when you go over the limit. Quote Link to comment Share on other sites More sharing options...
Brian's Man Cave Posted July 5, 2021 Author Share Posted July 5, 2021 That could be it... although I am not sure how to verify memory limits. Perhaps if I only have the voice play at random times instead of every collison? Quote Link to comment Share on other sites More sharing options...
carlsson Posted July 5, 2021 Share Posted July 5, 2021 Check your CFG and possibly ASM files. You can also enable list files that contain more info. The compiler unfortunately can't switch segments on its own, so in case you run into one that has multiple uses, you would need to add an own command ASM ORG $xxxx in your source to redirect rest of the code or data to a new segment. See the file contrib/42k.bas or search on the forum for previous discussions if that would be the case. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.