!zbUVwaNjaveymJqrVf:matrix.org

gbdev music

268 Members
2 Servers

Load older messages


SenderMessageTime
22 Oct 2021
@_discord_755055255426957412:t2bot.iozlago you could just convert them to VGM and play back the register dumps 16:45:26
@_discord_419037980028698646:t2bot.iodan jia#7921 I've done a decent bit on Prehistorik Man's sound driver if you want.. it's a weird one, very interesting though. First of all, it uses a long decompression algo (as in a mix of dictionary-based and some other stuff), to get data from rom into ram from $c000 to $d018 (for example, the title screen's music)

After that, $c000-$c0ff has some control bytes per channel, eg instrument address has high bytes in the $c08x, and low bytes in $c00x. Another 2 $10-aligned areas has the section addresses, which point to sound data bytes again all in ram. Sound bytes have instrument bytes following it.. except in a case where I believe the whole thing is 3 bytes. And instruments control other offsets for things like envelopes, I think it pretty much mimics famitracker instruments

All code is in bank 5, $4000 - play song, $4003 - update song, $4006 - update sound effect
16:49:11
@_discord_496679879518060544:t2bot.iodjmaximum#8333 really? thought it was formatted like Vortex Tracker II 16:54:22
@_discord_419037980028698646:t2bot.iodan jia#7921 tbh famitracker and its variants are the only ones I know of, i just know it has some of the same kind of concepts and controls that famitracker supports 16:56:27
@_discord_419037980028698646:t2bot.iodan jia#7921 I've done a decent bit on Prehistorik Man's sound driver if you want.. it's a weird one, very interesting though. First of all, it uses a long decompression algo (as in a mix of dictionary-based and some other stuff), to get data from rom into ram from $c000 to $d018 (for example, the title screen's music)

After that, $c000-$c0ff has some control bytes per channel, eg instrument address has high bytes in the $c08x, and low bytes in $c00x. Another 2 $10-aligned areas has the section addresses, which point to note bytes again all in ram. Note bytes have instrument bytes following it.. except in a case where I believe the whole thing is 3 bytes. And instruments control other offsets for things like envelopes, I think it pretty much mimics famitracker instruments

All code is in bank 5, $4000 - play song, $4003 - update song, $4006 - update sound effect
17:09:26
@_discord_419037980028698646:t2bot.iodan jia#7921 * I've done a decent bit on Prehistorik Man's sound driver if you want.. it's a weird one, very interesting though. First of all, it uses a long decompression algo (as in a mix of dictionary-based and some other stuff), to get data from rom into ram from $c000 to $d018 (for example, the title screen's music)

After that, $c000-$c0ff has some control bytes per channel, eg instrument address has high bytes in the $c08x, and low bytes in $c00x. Another 2 $10-aligned areas has the section addresses, which point to note bytes again all in ram. Note bytes have instrument bytes following it.. except in a case where I believe the whole thing is 3 bytes. And instruments control other offsets for things like envelopes, I think it pretty much mimics famitracker instruments

All code is in bank 5, $4000 - play song, $4003 - update song, $4006 - update sound effect
17:14:05
@_discord_364858838689513483:t2bot.ioTheRealJavierBlitse#0900 that's interesting!
I'm looking at the disassembled code and it looks like when the frequency is updated, only the bottom 3 bits of NRx4 are kept, so the length counters aren't used I don't think
what's more weird is that the channels seemingly are only triggered once at the beginning of the song, or all at once when it's updated
I think if I can squeeze some stuff in there I might be able to fix the broken music since the length counters aren't used
17:32:43
@_discord_364858838689513483:t2bot.ioTheRealJavierBlitse#0900 I'll probably do something like this, with a jump so that the stack pointer doesn't get clobbered
TrigAndPreventKill:
ld a, [$dataAddr]
and $07
ldh [rNRx4], a
ldh a, [rNRx1]
or $0f
ldh [rNRx1], a
jp BackToNormalRoutine
17:38:41
@_discord_369657328686989314:t2bot.ioDrush#1939 In the general case, this is not possible 18:02:04
@_discord_369657328686989314:t2bot.ioDrush#1939 I mean, it's Prehistorik's, which for one thing is custom (at least circumstantial evidence points at it) 18:02:09
@_discord_369657328686989314:t2bot.ioDrush#1939 As to why GBS cannot be used as-is in the general case: in the rips, all pointers are hardcoded, so you'd have to place everything exactly where the GBS stores it, both bank and address. This breaks down if two GBS' were to overlap. 18:04:43
@_discord_369657328686989314:t2bot.ioDrush#1939 So you'd need to RE the driver(s), as was explained above 18:06:19
@_discord_369657328686989314:t2bot.ioDrush#1939 It's also possible that the music may be relying on some engine features, such as an interrupt in Warlocked (right?) 18:06:50
@_discord_294963391091572736:t2bot.iosuperdisk#5726 Since GBS are deterministic, I think it's feasible to run all the songs through an emulator, mark exactly which locations need to be patched up, then do so 18:12:49
@_discord_294963391091572736:t2bot.iosuperdisk#5726 So I think it's possible in the general case, but maybe a pain in the ass 18:13:05
@_discord_369657328686989314:t2bot.ioDrush#1939 You could in theory use a reg dump, but we all know the strings attached to that 18:13:45
@_discord_369657328686989314:t2bot.ioDrush#1939 How would you determine the locations automatically, anyway? 18:14:02
@_discord_352088564013596673:t2bot.ioLIJI#7029 SameBoy on Cocoa can debug GBS files, with minor modifications you should be able to do the same on the SDL port 18:15:16
@_discord_352088564013596673:t2bot.ioLIJI#7029 (The SDL port doesn't support GBS playback because it has no GUI for a GBS player) 18:15:54
@_discord_352088564013596673:t2bot.ioLIJI#7029 It's also easy to adapt my IDA loader for GBS files 18:16:29
@_discord_217009514480795648:t2bot.ioDevEd Warlocked doesn't rely on an interrupt for music, it's just the samples that require it 18:21:20
@_discord_217009514480795648:t2bot.ioDevEd standard VBlank timing for everything else 18:21:31
@_discord_217009514480795648:t2bot.ioDevEd a better example would be Super Mario Land, its music engine runs on a timer interrupt and as such will play too slow if you use regular VBlank timing 18:22:38
@_discord_369657328686989314:t2bot.ioDrush#1939 Right, my tired bad >< 18:22:57
@_discord_217009514480795648:t2bot.ioDevEd this also leads to a side effect of the music running twice as fast in double speed mode 18:23:17
@_discord_496679879518060544:t2bot.iodjmaximum#8333 its also the same with deflemask, it can't really do 59.732155 hz gbs or gb playback 18:34:12
@_discord_496679879518060544:t2bot.iodjmaximum#8333 FT NSF2GBS also relies on timer interrupts 19:54:21
@_discord_754447229733044305:t2bot.ioaStni.jpeg joined the room.21:37:12
@_discord_196459713586528256:t2bot.ioPinoBatch#1742 I've RE'd parts of the music data format of Klax for NES to make it sound like "Megalovania" from Undertale 23:24:30
23 Oct 2021
@_discord_697476565579071578:t2bot.ioMiLO83 joined the room.10:57:27

There are no newer messages yet.


Back to Room List