Dumping Krondor thoughts for future reference.
This is the magic routine that starts sifting through the MIDI track data (basically SCI1 MIDI-style, apart from the header).
- Code: Select all
seg050:087F 50 push ax
seg050:0880 55 push bp
seg050:0881 1E push ds
seg050:0882 33 F6 xor si, si
seg050:0884 26 C5 6F 08 lds bp, es:[bx+8]
seg050:0888 3E C5 6E 00 lds bp, ds:[bp+0]
; checks for 1-track vs multi-track (?) file (written for one device)
seg050:088C 3E 80 7E 20 FF cmp byte ptr ds:[bp+20h], 0FFh
seg050:0891 74 11 jz short loc_33824
seg050:0893 26 80 BF 5B 01 00 cmp byte ptr es:[bx+15Bh], 0
seg050:0899 75 09 jnz short loc_33824
seg050:089B 3E 8A 4E 20 mov cl, ds:[bp+20h]
seg050:089F 26 88 8F 5C 01 mov es:[bx+15Ch], cl
seg050:08A4
seg050:08A4 loc_33824: ; CODE XREF: sub_33721+F0j
seg050:08A4 ; sub_33721+F8j
seg050:08A4 8B CD mov cx, bp
seg050:08A6
seg050:08A6 loc_33826: ; CODE XREF: sub_33721+225j
; instrument offset table
seg050:08A6 3E 8B 56 00 mov dx, ds:[bp+0]
seg050:08AA 83 FA 00 cmp dx, 0
seg050:08AD 74 36 jz short loc_33865
seg050:08AF 8B E9 mov bp, cx
seg050:08B1 03 EA add bp, dx
; instrument sequence starts here
seg050:08B3 3E 8A 56 00 mov dl, ds:[bp+0]
seg050:08B7 80 FA FE cmp dl, 0FEh ; '¦'
seg050:08BA 75 2C jnz short loc_33868
The evil starts when you find out that each soundtrack piece is compressed per device. No lumping together like the SCI files.
So only the SB will have the digital PCM effects embedded in the track (Adlib / SB). Using anything else will not make them visible.
Plus the 2nd intro lightning bolt (play track #4) - doesn't even exist for non-SB. Never called or used.
Means you have use normal Adlib ($00) ID to give you the PCM. Then trick the game to use other ID ($07/ 0C) to get your normal MIDI. Game does keep music + SE in 2 separate memory segments (useful to know in figuring this out).
Some basic stuff attached - just fixes the SB init problem with fast CPUs. Has some decompressed MIDI binary blobs for others to look over. SX.OVL merger code.
=================================
=================================
=================================
Had a cheap idea for SQ3 + QFG2 driver-only versions: (inside the driver) check MIDI data and look for 3 pairs of magic bytes. Turn on/off digital as needed for matching pairs.
Bloatware. Non-award winning stuff. Only works with _original_ game. Classic amateurish. Yeah. Tikalat-style.
If collector doesn't need any more specialized driver-only game hacks though, I'll call it quits for now. Do some private hobbyist stuff for awhile.
(like hack-merging a few more Sierra drivers/interpreters for my own fun or failing to do same for MI1-2)
Let the smart people take care of things. Why create more problems for myself? :p