It is currently Tue Jul 23, 2019 2:03 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Hacking text beeps
PostPosted: Tue May 28, 2019 6:46 pm 
Offline

Joined: Tue Jul 14, 2009 11:04 am
Posts: 62
So I've never really done any sound hacking on the NES before and there's a text adventure game I want to increase the text speed (I know how to do that already) and reduce the amount of beeps per letter. Any help to get me pointed in the right direction would be appreciated. I've been looking at the wiki for technical info, but it's like stumbling in the dark for me.


Top
 Profile  
 
 Post subject: Re: Hacking text beeps
PostPosted: Tue May 28, 2019 7:55 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4192
If the game has a NSF with sound effects, you can find the init function for sound effects, and breakpoint on that for when the game tries to play a sound effect. You could make it play every other time, or every 4th time, etc...

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject: Re: Hacking text beeps
PostPosted: Wed May 29, 2019 5:42 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2536
Location: DIGDUG
Quote:
there's a text adventure game
[on the NES]

There is?

Princess Tomato in the Salad Kingdom?

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


Top
 Profile  
 
 Post subject: Re: Hacking text beeps
PostPosted: Wed May 29, 2019 6:32 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4192
The Kemco games (Shadowgate, Uninvited, Deja Vu, etc...) might also qualify.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject: Re: Hacking text beeps
PostPosted: Thu May 30, 2019 4:30 am 
Offline

Joined: Tue Jul 14, 2009 11:04 am
Posts: 62
When you say the init function, are you talking about the APU register $4015?


Top
 Profile  
 
 Post subject: Re: Hacking text beeps
PostPosted: Thu May 30, 2019 7:59 am 
Offline

Joined: Fri Feb 24, 2012 12:09 pm
Posts: 941
Let me guess, is it... SOS on the Titanic? But with less beeps per letter... you would end up with IMI or ETE on the Titanic.

_________________
homepage - patreon


Top
 Profile  
 
 Post subject: Re: Hacking text beeps
PostPosted: Thu May 30, 2019 10:21 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4192
I mean that a game will usually do something like this...

lda #effect_number
jsr init_routine

Not a hardware register write, this is all software stuff. If you have a NSF for the game, then someone has already taken the time to isolate the music engine.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject: Re: Hacking text beeps
PostPosted: Thu May 30, 2019 7:38 pm 
Offline

Joined: Tue Jul 14, 2009 11:04 am
Posts: 62
The game is Metal Slader Glory for those that are curious. I'm working on an update to my translation for it.

Each character has their own unique text beeps for the most part and their own text speeds. All this is stored with the speaker name. Clearly I can see there is some correlation between the speed of text printing and the speed of text beeps, but I've yet to actually find it in the code.

I remember now. A while back someone made some repo's of the translation from all new materials, but there were no text beeps. I believe this is due to the game using the MMC5's square sound waves.

So, I was able to find the data/music for the beeps by virtue of writes to $5006, which if I'm interpreting it right is the timer. $5004 gets set to $30. I guess all I need to figure out now is how the text speed influences that data.


Top
 Profile  
 
 Post subject: Re: Hacking text beeps
PostPosted: Sat Jun 01, 2019 8:39 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 1177
Location: Hokkaido, Japan
Calling it a text adventure, although it also has graphics, is what made the confusion. Especially as it has been a lot of talk about making an engine for text-only adventure games on the forums recently.
Krzysiobal made an MMC5 clone repro. But it looks like he didn't clone the audio chip which is a big point in this game according to Mr Yoshimiru.


That "timer" is for controlling the frequency of the sound channel. It is not the duration of the sound. It used to be called "period" in the wiki but it seems to have been changed to "timer". Probably technically correct but confusing. The length counter is what controls the duration of the sound.
MMC5 pulse channels are pretty much the same as the APU's pulse channels, except they have no sweep hardware. BTW a sweep is changing frequency over time and an envelope is changing volume over time.

APU pulse 1
$4000 envelope/volume and duty cycle
$4001 sweep
$4002 frequency low
$4003 length and frequency high

APU pulse 2
$4004 envelope/volume and duty cycle
$4005 sweep
$4006 frequency low
$4007 length and frequency high

MMC5 pulse 1
$5000 envelope/volume and duty cycle
$5001 (unused)
$5002 frequency low
$5003 length and frequency high

MMC5 pulse 2
$5004 envelope/volume and duty cycle
$5005 (unused)
$5006 frequency low
$5007 length and frequency high


Keep in mind that, like Dwedit said, sound engines often don't use the hardware length counter, envelope or sweep (they often disable them). Instead they do these things manually in software. Duration is done by unmuting and muting the channel with the desired timing, envelope is done by manipulating volume every frame as desired and sweeping is the same but by manipulating frequency instead.

For that reason, looking for writes to the sound registers might not do you any good. You need to figure out what byte or bytes are controlling the duration of the sound effect in the sound effect data that is loaded.

Edit: If $5004 gets set to $30, the hardware envelope and length counters are both disabled. So the game do indeed use software envelope and duration.


Top
 Profile  
 
 Post subject: Re: Hacking text beeps
PostPosted: Sat Jun 01, 2019 5:02 pm 
Offline

Joined: Mon May 25, 2009 2:20 pm
Posts: 72
how about just skip where-ever the "lda #sound id jsr initsound" thing is at for the text drawing...and make it skip over "space" so it doesnt play the sound during blank spaces between words

thats what i do for megaman odyssey at least, it's not really much, but it does help a little bit so the sound doesnt always play nonstop constantly.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 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