| 1 | // create one enormous buffer for main menu music |
|---|
| 2 | alGenBuffers(1, 0xbfc4e960, 0xbfc4e9ec, 0xbfc4e9ec, 0xbfc4e9bf) |
|---|
| 3 | alBufferData(0xa105d38, 4355, 0xa921f008, 0x15b7c00, 44100) |
|---|
| 4 | |
|---|
| 5 | // latch menu al_src=0xa0c9e60, vsrc=0x9f34ce8 (loop=TRUE) |
|---|
| 6 | alSourcefv(0xa0c9e60, 4100, 0x9f34ce8, 0x858a080, 0x86b4aa0) |
|---|
| 7 | alSourcei(0xa0c9e60, 514, 1, 0x858a080, 0x86b4aa0) |
|---|
| 8 | alSourcef(0xa0c9e60, 4129, 0, 0x858a080, 0x86b4aa0) |
|---|
| 9 | alSourcef(0xa0c9e60, 4106, 0x3f800000, 0x858a080, 0x86b4aa0) |
|---|
| 10 | alSourcef(0xa0c9e60, 4099, 0x3f800000, 0x858a080, 0x86b4aa0) |
|---|
| 11 | alSourcei(0xa0c9e60, 4103, 1, 0x858a080, 0x86b4aa0) |
|---|
| 12 | |
|---|
| 13 | // play menu track |
|---|
| 14 | alSourceQueueBuffers(0xa0c9e60, 1, 0xbfc577e4, 0x9f34cf4, 0x86b4aa0) |
|---|
| 15 | alSourcePlay(0xa0c9e60, 1590, 0x9f34cd8, 0x86998dc, 1665) |
|---|
| 16 | |
|---|
| 17 | // second buffer for in-game music |
|---|
| 18 | alGenBuffers(1, 0xbfc4e900, 0xbfc4e98c, 0xbfc4e98c, 0xbfc4e9bf) |
|---|
| 19 | alBufferData(0xb3efd00, 4355, 0xa4f0e008, 0x126a5b8, 44100) |
|---|
| 20 | |
|---|
| 21 | // latch menu track after starting to fade it out (vs->gain may have changed) |
|---|
| 22 | alSourcefv(0xa0c9e60, 4100, 0x9f34ce8, 1, 3) |
|---|
| 23 | alSourcei(0xa0c9e60, 514, 1, 1, 3) |
|---|
| 24 | alSourcef(0xa0c9e60, 4129, 0, 1, 3) |
|---|
| 25 | alSourcef(0xa0c9e60, 4106, 0x3f800000, 1, 3) |
|---|
| 26 | alSourcef(0xa0c9e60, 4099, 0x3f800000, 1, 3) |
|---|
| 27 | alSourcei(0xa0c9e60, 4103, 1, 1, 3) |
|---|
| 28 | |
|---|
| 29 | // latch ingame al_src=0xa0b1870 vsrc=0xa38fa78 (loop=FALSE) |
|---|
| 30 | alSourcefv(0xa0b1870, 4100, 0xa38fa78, 0x858a080, 0x86b4aa0) |
|---|
| 31 | alSourcei(0xa0b1870, 514, 1, 0x858a080, 0x86b4aa0) |
|---|
| 32 | alSourcef(0xa0b1870, 4129, 0, 0x858a080, 0x86b4aa0) |
|---|
| 33 | alSourcef(0xa0b1870, 4106, 0x3f800000, 0x858a080, 0x86b4aa0) |
|---|
| 34 | alSourcef(0xa0b1870, 4099, 0x3f800000, 0x858a080, 0x86b4aa0) |
|---|
| 35 | alSourcei(0xa0b1870, 4103, 0, 0x858a080, 0x86b4aa0) |
|---|
| 36 | |
|---|
| 37 | // play ingame |
|---|
| 38 | alSourceQueueBuffers(0xa0b1870, 1, 0xbfc57784, 0xa38fa84, 0x86b4aa0) |
|---|
| 39 | alSourcePlay(0xa0b1870, 1590, 0xa38fa68, 0x86998dc, 5029) |
|---|
| 40 | |
|---|
| 41 | // update menu track (fading out, gain=0.6, loop=TRUE) |
|---|
| 42 | alSourcefv(0xa0c9e60, 4100, 0x9f34ce8, 1, 3) |
|---|
| 43 | alSourcei(0xa0c9e60, 514, 1, 1, 3) |
|---|
| 44 | alSourcef(0xa0c9e60, 4129, 0, 1, 3) |
|---|
| 45 | alSourcef(0xa0c9e60, 4106, 0x3f21f38b, 1, 3) |
|---|
| 46 | alSourcef(0xa0c9e60, 4099, 0x3f800000, 1, 3) |
|---|
| 47 | alSourcei(0xa0c9e60, 4103, 1, 1, 3) |
|---|
| 48 | |
|---|
| 49 | // !! reclaim menu track's al_src=0xa0c9e60 vsrc=0x9f34ce8 |
|---|
| 50 | alSourceStop(0xa0c9e60, 1611, 0x44328000, 0x44278000, 0x43ca4416) |
|---|
| 51 | alSourcei(0xa0c9e60, 4105, 0, 0x44278000, 0x43ca4416) // set buffer to 0 -> unqueues all buffers |
|---|
| 52 | |
|---|
| 53 | // create small buffer for sound clip |
|---|
| 54 | alGenBuffers(1, 0xbfc4fbf0, 0xbfc4fc7c, 0xbfc4fc7c, 0xbfc4fcbf) |
|---|
| 55 | alBufferData(0xb1c78a0, 4353, 0xb6d8a40, 6136, 44100) |
|---|
| 56 | |
|---|
| 57 | // !! latch soundclip (NOTE: we got a different vsrc but the same al_src as the menu track) |
|---|
| 58 | alSourcefv(0xa0c9e60, 4100, 0xb5f6888, 0x858a080, 0x86b4aa0) |
|---|
| 59 | alSourcei(0xa0c9e60, 514, 0, 0x858a080, 0x86b4aa0) |
|---|
| 60 | alSourcef(0xa0c9e60, 4106, 0x3f51eb85, 0x858a080, 0x86b4aa0) |
|---|
| 61 | alSourcef(0xa0c9e60, 4099, 0x3f8147ae, 0x858a080, 0x86b4aa0) |
|---|
| 62 | alSourcei(0xa0c9e60, 4103, 0, 0x858a080, 0x86b4aa0) |
|---|
| 63 | |
|---|
| 64 | // !! soundclip has finished playing => unqueue |
|---|
| 65 | // the al_src (while still serving the menu track) had an "unprocessed" buffer that |
|---|
| 66 | // apparently still remains (the soundclip's buffer is now indicated as processed, but |
|---|
| 67 | // attempting to remove it seems to affect the previous one from menuTrack) |
|---|
| 68 | alSourceUnqueueBuffers(0xa0c9e60, 1, 0xbfc57fa8, 0x4042c921, -1) |
|---|