Ugh bumping. It's been a long time since this all happened. Feels almost like yesterday.
I wanted to see what was going on with the audio. Still unclear as to why it's producing the sound exactly (even though drx mentioned it on the first page), I decided to disassemble the sound driver (z80) based on the great disassembly ValleyBell did on the final (U) version.
You can download the IDB database and an asm output for both here (you need IDA Pro 6.1 to open the database):
http://www.mediafire...disassembly.zip
Note though, my disassembly is pretty much poo because I'm still pretty much an amateur at IDA Pro. So aesthetics aside, the sound driver used in this prototype is almost identical to the final version but there are some differences. I believe all the subroutines are there, but some instructions were added to a handful of them for the final version. Another oddity, which might be due to my inability to use IDA Pro, I think the instructions that reference data locations that come mostly after all the code are all pointing the the wrong locations. Also note that I have no knowledge of the Z80 or how the sound drivers in these games actually work. I really just wanted to mention this just in case someone might want to take a crack at it. If this has any impact on the audio issue, I don't know, but it's a start at least.
Here are some differences I noticed:
1.) At 0x38, "VInt" is missing instructions that loads 0 to register 'a' and adds $80 to 'a' in a loop. The prototype just disables interrupts and calls "ProcessSndQueue" and "sub_A4" right away before returning.
2.) As stated somewhere before, there's a string from the sound driver programmer in every version. The final version however, is truncated possibly due to the added instructions mentioned before. The prototype has the full string - "casablanca version by MILPO". Nothing seems to reference this string AFAIK.
3.) At 0x204, the disassembly for the final version notes that "ex af, af'" is dead code. This code doesn't exist in the prototype, but space for it does exist. I added the line back manually in my database, but note that it wasn't there originally.
4.) At 0x4C1, the final compares $2A with the accumulator and the following instruction jumps to PlayBGM ($00-$29 for a total of 41 music tracks?), while at 0x4C3 if compares $6F with the accumulator and the following instruction jumps to PlaySFX ($2A-$6E for a total of 68 sound effects?). The prototype is slightly different in this regard - the prototype compares $29 instead of $2A making for a possible total of 40 music tracks while also comparing $69 instead of $6F for a total of 63 sound effects if my math is correct.
5.) At 0x500, the beginning of PlayBGM is different. At the start of the label, the final ORs with the accumulator 'a' and returns 'z' (zero flag) and finally decrements the accumulator 'a' before the first "ex af, af'" instruction. The prototype just decrements the accumulator and returns 'm' before the first "ex af, af'" instruction.
6.) At 0x60F, the instruction subtracts $2A in the final and $29 in the prototype from the accumulator, related to sound effects.
7.) At 0x814(final)/0x813(proto), "PauseAudio" doesn't return in the prototype but does in the final. The Final calls sub_E58 after calling "PSGSilenceAll", which does something. The prototype makes no such call after "PSGSilenceAll". The equivalent subroutine to sub_E58 is sub_E53 in the prototype.
8.) Under "ProcessSndQueue", the final does this:
While the prototype does this:
That's pretty much all there is as far as code changes go. I didn't look through the data that comes after all this though.
I wanted to see what was going on with the audio. Still unclear as to why it's producing the sound exactly (even though drx mentioned it on the first page), I decided to disassemble the sound driver (z80) based on the great disassembly ValleyBell did on the final (U) version.
You can download the IDB database and an asm output for both here (you need IDA Pro 6.1 to open the database):
http://www.mediafire...disassembly.zip
Note though, my disassembly is pretty much poo because I'm still pretty much an amateur at IDA Pro. So aesthetics aside, the sound driver used in this prototype is almost identical to the final version but there are some differences. I believe all the subroutines are there, but some instructions were added to a handful of them for the final version. Another oddity, which might be due to my inability to use IDA Pro, I think the instructions that reference data locations that come mostly after all the code are all pointing the the wrong locations. Also note that I have no knowledge of the Z80 or how the sound drivers in these games actually work. I really just wanted to mention this just in case someone might want to take a crack at it. If this has any impact on the audio issue, I don't know, but it's a start at least.
Here are some differences I noticed:
1.) At 0x38, "VInt" is missing instructions that loads 0 to register 'a' and adds $80 to 'a' in a loop. The prototype just disables interrupts and calls "ProcessSndQueue" and "sub_A4" right away before returning.
2.) As stated somewhere before, there's a string from the sound driver programmer in every version. The final version however, is truncated possibly due to the added instructions mentioned before. The prototype has the full string - "casablanca version by MILPO". Nothing seems to reference this string AFAIK.
3.) At 0x204, the disassembly for the final version notes that "ex af, af'" is dead code. This code doesn't exist in the prototype, but space for it does exist. I added the line back manually in my database, but note that it wasn't there originally.
4.) At 0x4C1, the final compares $2A with the accumulator and the following instruction jumps to PlayBGM ($00-$29 for a total of 41 music tracks?), while at 0x4C3 if compares $6F with the accumulator and the following instruction jumps to PlaySFX ($2A-$6E for a total of 68 sound effects?). The prototype is slightly different in this regard - the prototype compares $29 instead of $2A making for a possible total of 40 music tracks while also comparing $69 instead of $6F for a total of 63 sound effects if my math is correct.
5.) At 0x500, the beginning of PlayBGM is different. At the start of the label, the final ORs with the accumulator 'a' and returns 'z' (zero flag) and finally decrements the accumulator 'a' before the first "ex af, af'" instruction. The prototype just decrements the accumulator and returns 'm' before the first "ex af, af'" instruction.
6.) At 0x60F, the instruction subtracts $2A in the final and $29 in the prototype from the accumulator, related to sound effects.
7.) At 0x814(final)/0x813(proto), "PauseAudio" doesn't return in the prototype but does in the final. The Final calls sub_E58 after calling "PSGSilenceAll", which does something. The prototype makes no such call after "PSGSilenceAll". The equivalent subroutine to sub_E58 is sub_E53 in the prototype.
8.) Under "ProcessSndQueue", the final does this:
RAM:0885 jp m, ShiftSoundQueue ; Jump (conditional & unconditional) RAM:0888 sub 2Ah ; '*' ; Subtract from A RAM:088A jr c, ShiftSoundQueue ; Jump relative (conditional & unconditional)
While the prototype does this:
ROM:0880 sub 28h ; '(' ; Subtract from A
ROM:0882 jp c, ShiftSoundQueue ; Jump (conditional & unconditional)
ROM:0885 sub 1 ; Subtract from A
That's pretty much all there is as far as code changes go. I didn't look through the data that comes after all this though.


00