|
Joined: Mar 2013
Posts: 82
Member
|
Member
Joined: Mar 2013
Posts: 82 |
That program looks good. I am on macOS so I will have to write my own tool - I am learning Python at the moment so I will try to write some code to do that (although it will be a command line tool and not look as nice as your program!). I can speak French as well as (some) Japanese if you need to check any translations - my Japanese is not great but I am ok with hiragana/katakana/basic kanji and can see if any automatic translations look wrong.
What I am doing now is writing some code to generate a very basic WAV file with a simple square wave. I can then use this file to see what values are generated by other ADPCM encoders, then I might be able to convert those encoders to use the look-up tables in the MAME driver.
|
|
|
|
Joined: Oct 2024
Posts: 43 Likes: 2
Member
|
Member
Joined: Oct 2024
Posts: 43 Likes: 2 |
That program looks good. I am on macOS so I will have to write my own tool - I am learning Python at the moment so I will try to write some code to do that (although it will be a command line tool and not look as nice as your program!) At some point I had found one or two other programs that join and separate ROMs (interleaved files). There has to be one for macOS, it's essential for arcade ROM hacking. I always thought that hex editors should also support something like that (even though that wouldn't help a lot with graphics editing, only hex editing). If you write such a program, just make it so that you can change the order of the files if you want. It doesn't need to support more than two interleaved files, it's almost always two... As for the language, never mind, I will refresh all texts with the next version anyway (because of new texts and of probably changing the translation file format), and I suppose that they will be of much better quality, as the AIs are getting smarter. What I am doing now is writing some code to generate a very basic WAV file with a simple square wave. I can then use this file to see what values are generated by other ADPCM encoders, then I might be able to convert those encoders to use the look-up tables in the MAME driver. That sounds great! It is probably a way to create sounds with no or much less noise, even though you won't use the same algorithm. I believe it's feasible and probably easier than implementing the NEC ADPCM algorithm from that thesis.
|
|
|
|
Joined: Mar 2013
Posts: 82
Member
|
Member
Joined: Mar 2013
Posts: 82 |
It is probably a way to create sounds with no or much less noise, even though you won't use the same algorithm. I believe it's feasible and probably easier than implementing the NEC ADPCM algorithm from that thesis. The algorithm will be helpful but trying to convert the assembly code will be too difficult (for me) or we will be waiting forever to have something that works. I have finished my WAV file script and I can use it generate square waves of different frequencies, so I have some sounds to test with the encoders. One of the encoders was written for an old PC Engine project and actually has some commented code(!) so I will start with that.
|
|
|
|
Joined: Oct 2024
Posts: 43 Likes: 2
Member
|
Member
Joined: Oct 2024
Posts: 43 Likes: 2 |
[quote=Vag]I have finished my WAV file script and I can use it generate square waves of different frequencies, so I have some sounds to test with the encoders. One of the encoders was written for an old PC Engine project and actually has some commented code(!) so I will start with that. Great! The fact that you'll use code that was written for the PC Engine is so funny and I have to tell you I love PC Engine! I have translated 5 games for this console, including my first ever translation (Wonderboy in Monsterland). It has such good games... Btw, if you want, I can alter the original Golden Axe so that it plays the welcome sound when the FBI logo is first shown, if you want to easily test the sounds you make (you'll just have to replace the sound in mpr-12384.ic6).
|
|
|
|
Joined: Mar 2013
Posts: 82
Member
|
Member
Joined: Mar 2013
Posts: 82 |
I have been using M1 to test the sounds, but I should write a script to automatically patch the sound rom or at least import the ADPCM files and put the command bytes in the correct position so that I can copy-and-paste the bytes into the sound rom.
|
|
|
|
Joined: Oct 2024
Posts: 43 Likes: 2
Member
|
Member
Joined: Oct 2024
Posts: 43 Likes: 2 |
I finished with the code that plays a sound when the logo is fully shown (it's 80 bytes long). It only does it when the demo sounds setting is on, and when the logo shows up by itself - the logo also shows up when you insert a coin, but I didn't want it to play the sound in that case. Also, I have distinguished the case it shows up right after booting up, so the sound that time is the "welcome" voice. The other times, it's the Game Over "song" (which is 3-4 seconds long, and in M1 it's number 196). I temporarily replaced the welcome sound with one in Greek that says the same, of course it's too low and it has noise. Even like this, it's so cool to have a sound replaced. My next task is to find the pointers of the sounds, so I can move them around tin the ROM.
Last edited by Vag; 11/14/24 02:54 PM.
|
|
|
|
Joined: Oct 2024
Posts: 43 Likes: 2
Member
|
Member
Joined: Oct 2024
Posts: 43 Likes: 2 |
I just found the sound pointers, they are in ROM file epr-12390.ic8, at offset 0E8C.
First, here are the offsets of the sounds, in mpr-12384.ic6: 1. 0000 - 1st bank 2. 0F70 3. 18D0 4. 2200 5. 2590 6. 2E80 7. 4000 - 2nd bank 8. 4910 9. 4D70 10. 5540 11. 6610 12. 8000 - 3rd bank 13. 8600 14. C000 - 4th bank 15. D760 16. 10000 - 5th/6th bank (there doesn't seem to be a bank change in 14000, weird) 17. 15300 18. 18000 - 7th bank 19. 1C000 - 8ο bank 20. 1DB40
Now take a look at the bytes of the pointers, in epr-12390.ic8: 00 00 70 0F D0 18 00 22 90 25 80 2E 00 00 10 09 70 0D 40 15 10 26 00 00 00 00 00 06 00 00 00 13 60 17 00 00 00 00 40 1B
I separated them per bank (but that's not absolutely correct, you'll see why, below): 0000 700F D018 0022 9025 802E - 1st bank 0000 1009 700D 4015 1026 - 2nd bank 0000 0000 0006 - 3rd bank 0000 0013 6017 - 4th bank 0000 - 7th bank 0000 401B - 8th bank
Now, the following bytes seem to be telling us the bank of each sound, I'll call it a "bank table"! Here they are: 00 00 00 00 00 00 01 01 01 01 01 02 03 02 04 05 03 06 07 07 They are 20 bytes, as the sounds are 20. The sounds are not in a perfect increasing bank number order.
Here's a count per bank number: 00: 6 01: 5 02: 2 03: 2 04: 1 05: 1 06: 1 07: 2
:-)))
Now we can move the sounds around in the ROM, to utilize the empty space even better. I won't do that right now, as there is no point unless I can add new sounds first. If we want to add a sound, we'll need to somehow insert 2 bytes at the end of the pointer table, for one extra pointer, and one more byte after the bank table! You can't just add bytes and expect it to work... There's still hope though, as after the bank table, there are 40 more 00 bytes. If we're lucky, they are fillers/empty space, so I could use some of them to add new sounds. There must be a byte that defines the number of sounds, or bytes that have the offset and length of the pointer table and the bank table.
|
1 member likes this:
Dodg |
|
|
|
Joined: Mar 2013
Posts: 82
Member
|
Member
Joined: Mar 2013
Posts: 82 |
I temporarily replaced the welcome sound with one in Greek that says the same, of course it's too low and it has noise. Even like this, it's so cool to have a sound replaced. What software and settings did you use to generate the new sound? I have not managed to get any sounds to play correctly yet, except for one that played at the wrong sample rate. I have been running some tests to generate ADPCM files. When you look at the waveforms you can see that something interesting is happening: ![[Linked Image from i.ibb.co]](https://i.ibb.co/k0qby7K/goldnaxe-65-waveform.png) ![[Linked Image from i.ibb.co]](https://i.ibb.co/jzhRyPh/goldnaxe-65-waveform-2.png) Each of those sets of waveforms is 128 bytes long and uses the same repeating character (for example, the very first waveform is 0x7F x 128 bytes, then 0x70 is used, then 0x6F, then 0x60, etc.) and there are patterns there that can be identified with some more testing. EDIT: good job on finding the pointers!
Last edited by Dodg; 11/14/24 06:04 PM.
|
|
|
|
Joined: Oct 2024
Posts: 43 Likes: 2
Member
|
Member
Joined: Oct 2024
Posts: 43 Likes: 2 |
What software and settings did you use to generate the new sound? I have not managed to get any sounds to play correctly yet, except for one that played at the wrong sample rate. Audacity, I saved as VOX ADPCM, but I can do something similar if I use sox to save as another ADPCM variant. I just have to add the repeating 53 bytes (and the last 93 byte) manually. It sounds very low in the game, and it seems to affect the volume of the next sounds. If you play them some times, you can hear their volume increases. But that's temporary, I'm really hoping you can find a way to produce clearer sounds :-) EDIT: good job on finding the pointers! Thanks! I can't wait to find how to add sounds! Many Sega System 16B games are games I'd really like to translate. I had an attempt at Passing shot, 20 years ago, but it's lost, so I will do it again, eventually. Wonderboy 3 is on my list as well. But the game I have decided to translate after Golden Axe, is Shinobi :-) So, I'm hoping we find a way, because I'd like to do it with more games :-)
|
|
|
|
Joined: Oct 2024
Posts: 43 Likes: 2
Member
|
Member
Joined: Oct 2024
Posts: 43 Likes: 2 |
At last, I can now add new sounds! First of all, there is a byte that holds the number of the sounds, only it adds 1. So, 20 sounds are 14 in hex, this byte has 15. If we want to add one more sound, we must change it to 16. Its address is 0E60. Second, we have to make room, so we can add bytes. The pointer table and the bank table have pointers themselves. As it usually happens with pointers, they are some bytes before. We don't need to move the pointer table, only the bank table. If that goes somewhere else in the ROM (there's a lot of empty space at the end of the ROM), the pointer table will have 20 empty bytes right after it; that's room for 10 new sounds. Even if we wanted to add more, we could move that table as well. The pointers are two bytes and they have the address. The bank table originally is at offset 0EB4, so the pointer must be B40E. It's at address 0E73. We can move the table to address 7D00 for example, and also update the pointer to 007D. The id of the new sound will be 55 in hex. Here's a part of goldnaxe.lst, somewhere in M1's path: #084 [Voice] #083 [Voice] Dead #082 [Voice] Yell #081 [Voice] Woman #080 [Voice] Woman Yell #079 [Voice] Dragon strike #078 [Voice] Village People Fleeing #077 [Voice] Thunder #076 [Voice] #075 [Voice] #074 [Voice] #073 [Voice] #072 [Voice] #071 [Voice] #070 [Voice] #069 [Voice] #068 [Voice] Magic dwarf #067 [Voice] Magic dwarf #066 [Voice] Magic dwarf #065 [Voice] Welcome I had written this: there are five things I would like to do: 1. Convert sounds to NEC ADPCM, so I can replace the "welcome" sound. 2. Find the sound pointers and be able to move them around in the ROM, to take advantage of the available space. 3. Add new sounds. 4. Play the sounds in the game. 5. Adjust the service menu so it shows the new sounds.
Obviously that's optimal, I'll be more than happy with replacing a sound :-) Well, 2, 3 and 4 are not a problem anymore :-) I will play around with the service menu tomorrow, I'm expecting this to be a little easier. As for M1, how does it find the sounds? Does it recognize them dynamically, from the ROM? Would it just see the new sounds (assuming there are no problems/errors with the bytes), or do you manually input the values? E.g. "#078 [Voice] Village People Fleeing" looks typed. Of course I will try it tomorrow with new ROM files, to see if it likes it.
|
|
|
0 members (),
142
guests, and
0
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,355
Posts122,423
Members5,082
|
Most Online1,283 Dec 21st, 2022
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|