1942 - New Music! (v3.0)

guddler

Busting vectors like it's 1982!
vacBacker
Feedback
10 (100%)
Credits
4,055CR
Thats truly awful! I'm not surprised people want to replace it
smiley36.gif
 

strykr

Active member
vacBacker
Feedback
11 (100%)
Credits
1,342CR
guddler said:
Thats truly awful! I'm not surprised people want to replace it
smiley36.gif

totally disagree guddler, its unique and full of character and totally fits the game, adds tension. I love it. (not that i'd have it on my desert island disc tho!)
 

minwah

Active member
Feedback
3 (100%)
Credits
238CR
The master lookup table (32 little endian pointers) for all the musics and sound effects of 1942 is at $007a in the sound rom. The CPU passes a sound index value between 0 and $1f to the sound CPU through the latch @ $6000. The sound CPU polls address $6000 every interrupt to see if the main cpu wants it to play a tune/sound effect. If it does then the sound CPU jumps to the correct sound handler via an rst $30 call at $0079.

The addresses of the 32 sound effect/tune handlers are as follows :-

0 - $00ba (seems to be used to kill all 3 channels of the AY chip)

1 - $045b (sound effect)

2 - $0464 (sound effect)

3 - $046c (sound effect)

4 - $0474 (sound effect)

5 - $047c (sound effect)

6 - $0484 (sound effect)

7 - $048c (sound effect/maybe done by the AY?)

8 - $0494 (AY tune)

9 - $049c (sound effect)

A - $04a4 (sound effect)

B - $04ac (seems to be used to kill a single channel of the AY chip)

C - $04b5 (sound effect)

D - $04bd (sound effect)

E - $04c5 (sound effect)

F - $04cd (seems to be used to kill a single channel of the AY chip)

10 - $00d3 (probably used to kill analog sounds)

11 - $1076 (tune)

12 - $1115 (AY tune)

13 - $11c5 (AY tune)

14 - $134d (AY tune)

15 - $14a9 (AY tune)

16 - $140f (AY tune)

17 - $18a6 (AY tune)

18 - $1756 (AY tune)

19 - $1820 (AY tune)

1A - $15f6 (AY tune)

1B - $04d6 (AY tune)

1C - $00d3 (as above)

1D - $00d3 (as above)

1E - $00d3 (as above

1F - $1034 (AY tune)

So, now you know the addresses of the various sound handlers it's simply a case of studying the routines and the AY tune format and you're halfway there.
smiley2.gif


Luckily there's about 2.6Kb of unused rom space in the sound rom, plenty enough to insert a new tune. All you have to do then is adjust a pointer to point to the new tune data and you're done.

Wow!
smiley3.gif
Thanks for the detailed information!

I disassembled the rom and had a quick look. The addresses look like they make sense and think I see the space that could be used (198E-23FF).

Not sure my assembler skills are up to working out how the tunes work but this gives me something to go on. Thanks again!
minwah2015-05-07 15:02:45
 

grobda

"Look at the size of that thing!"
vacBacker
Feedback
7 (100%)
Credits
1,061CR
The vectrex uses the same sound chip (28 pin ay3912 version but functionally identical) and has a few homebrew carts that are just music rips from other games - sound pretty similar to Atari ST chip tunes (although the ST ym2149F chip has a couple of extra features) so you might even be able to use some ST chiptunes.

I'm not changing mine; 1st PCB I ever bought and the 'music' goes with the game as much as the can can music in mr.do!
 

minwah

Active member
Feedback
3 (100%)
Credits
238CR
grobda said:
The vectrex uses the same sound chip (28 pin ay3912 version but functionally identical) and has a few homebrew carts that are just music rips from other games - sound pretty similar to Atari ST chip tunes (although the ST ym2149F chip has a couple of extra features) so you might even be able to use some ST chiptunes.

That did cross my mind, I know vectrex Thrust has a port of the ST music...
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
So, how are you getting on with replacing the God-awful main tune in 1942 then?

I had a spare half hour to look at this last night and figured out a few things about the tune format. The header of each tune is a byte value for the number of tracks and then n pointers to the track data (where n = number of tracks from the first byte of the tune header).

So, the header for the in-game theme tune (if that's what you can call it!) at $107f looks like this :-

03 8610 0711 0E11

i.e. 3 tracks and then 3 little endian pointers ($1086, $1107 and $110e) to the track data.

I haven't figured out all the track data yet but here's what I have figured out :-

$5f = set volume for this track (the byte following this is the requested volume (from $0 to $f))

$3f = set note duration (the byte following this is the duration (higher value = longer duration)

$1f = set base note value from a lookup table of note values @ $00f4 (this lookup table contains the note frequencies of 96 individual notes in little endian word format) (the byte following $1f is the offset into this note table to use as the base note - you'd use this to set the key of the tune you want to compose)

Then after you've set the volume, note duration and note table base offset you start laying down a few notes in byte format, like this :-

Upper nibble of a byte = envelope type (see the AY-3-8910 datasheet for the various envelope types)

Lower nibble of a byte = note pitch (this is added to the note table base offset that you set earlier)

So, a value of $81 would use envelope type 8 and note pitch 1 (added to your base offset).

You can also loop within each track by using the $7f command followed by a pointer to where you want to loop back to.

So, armed with this amazing amount of knowledge you can do simply awesome things like this :-


Which sounds considerably better than the sh*te effort that Capcom pushed the game out the door with.

To insert this amazing new tune into the sound rom simply overwrite the bytes from $2000 with this data :-

01 03 20 5F 0A 3F 10 1F 24 81 83 85 86 88 8A 8C 8D 7F 09 20 FF

And then adjust the pointer to the main in-game tune @ $107a from :-

7F 10 (little endian $107f)

to

00 20 (little endian $2000)
 

Hurray Banana

Moderator
Staff member
vacBacker
Feedback
8 (100%)
Credits
2,721CR
cmonkey said:
So, how are you getting on with replacing the God-awful main tune in 1942 then?

I had a spare half hour to look at this last night and figured out a few things about the tune format. The header of each tune is a byte value for the number of tracks and then n pointers to the track data (where n = number of tracks from the first byte of the tune header).

So, the header for the in-game theme tune (if that's what you can call it!) at $107f looks like this :-

03 8610 0711 0E11

i.e. 3 tracks and then 3 little endian pointers ($1086, $1107 and $110e) to the track data.

I haven't figured out all the track data yet but here's what I have figured out :-

$5f = set volume for this track (the byte following this is the requested volume (from $0 to $f))

$3f = set note duration (the byte following this is the duration (higher value = longer duration)

$1f = set base note value from a lookup table of note values @ $00f4 (this lookup table contains the note frequencies of 96 individual notes in little endian word format) (the byte following $1f is the offset into this note table to use as the base note - you'd use this to set the key of the tune you want to compose)

Then after you've set the volume, note duration and note table base offset you start laying down a few notes in byte format, like this :-

Upper nibble of a byte = envelope type (see the AY-3-8910 datasheet for the various envelope types)

Lower nibble of a byte = note pitch (this is added to the note table base offset that you set earlier)

So, a value of $81 would use envelope type 8 and note pitch 1 (added to your base offset).

You can also loop within each track by using the $7f command followed by a pointer to where you want to loop back to.

So, armed with this amazing amount of knowledge you can do simply awesome things like this :-


Which sounds considerably better than the sh*te effort that Capcom pushed the game out the door with.

To insert this amazing new tune into the sound rom simply overwrite the bytes from $2000 with this data :-

01 03 20 5F 0A 3F 10 1F 24 81 83 85 86 88 8A 8C 8D 7F 09 20 FF

And then adjust the pointer to the main in-game tune @ $107a from :-

7F 10 (little endian $107f)

to

00 20 (little endian $2000)

Fingers in lots of pies as usual Ade, nice research
 

minwah

Active member
Feedback
3 (100%)
Credits
238CR
cmonkey said:
So, how are you getting on with replacing the God-awful main tune in 1942 then?

Not as well as you evidently! I saw the loop command and that is about it. Again, thanks for your detailed analysis - I'm in awe!
smiley32.gif


I'm going to arm myself with my synthesizer, hex editor and a crate of beer tonight and see what I can come up with. It could go either way!...
 

Smraedis

Active member
Credits
105CR
Isn't the extra lives bug fixed in Version 3, or Revision B in later MAME versions? I know that all versions stop giving lives at 1m, but if this was fixed, you could just milk the end boss almost forever.

Yeah I don't like the music either, or the amount of planes that come from behind.
 

minwah

Active member
Feedback
3 (100%)
Credits
238CR
Spent a good few hours on this tonight and have a tune at least. Needs some more work and only one channel so far. Getting the timing right is tough!
 

shaunholley

Active member
Credits
270CR
cmonkey said:
Lives are at $e101

Score is the 6 bytes from $e048 to $e04d

Armed with that knowledge it should be simple for someone (not me, too busy!) to reverse the extra lives logic in the game engine and figure out the bug.

I've learned to play with one eye on each upcoming extra life, making sure I don't get too many points at the end of each stage. This fix would be brilliant (although not TG legal, but who cares), and would allow for 100% concentration on high scores.

Also, I like the music in 1942! There are several short ditties at certain points in the gameplay which are simple and effective, made more so when they punctuate the extended periods of just bullet sounds and destruction.

#biasedasfook.
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
minwah said:
Spent a good few hours on this tonight and have a tune at least. Needs some more work and only one channel so far. Getting the timing right is tough!

Good stuff! Can't wait to hear what you've come up with.
smiley20.gif
 

minwah

Active member
Feedback
3 (100%)
Credits
238CR
After my initial success with a one channel melody was quiet successful I thought adding a second channel would be fairly trivial, but I'm having trouble keeping things in sync.

I think changing the note duration has some bearing on this. eg I've been testing a basic channel 1 loop with a sum note duration of 24, with 3 duration changes (including the initial one). To sync this in channel 2 with just a one note loop, I have to set the note duration to 21. However three notes of duration 7 seems to go out of time slightly. I was initially using a 2nd channel pattern of 5 notes duration 8, 4, 4, 4, 4 and that seemed to play faster than the medley (total note duration also 24).

I'm not sure if changing the note duration causes a bit of delay (quite feasible although not noticable in itself), or just that the duration of eg two notes added together isn't the same as one note of that same total duration.

My already high regard for computer game music composers has been raised!
 

cmonkey

Active member
vacBacker
Feedback
4 (100%)
Credits
1,658CR
Sounds like you're making great progress. Keep up the momentum. I for one understand how momentous a task it is to replace in game music (putting the Mario theme tune into Super Hang-On took me *way* longer than I should have spent on it!).

You could try studying the tune data for sound index $12. That tune has 6 tracks (3 for each sound chip) and the data starts at $111e. That might point you in the correct direction for multi channel audio if you are struggling a little.

Well done so far though dude, anything's better than that God awful crap that came with the game originally.
 
Top