2014-12-16 04:53:56 +00:00
|
|
|
; int DEFCONV snd_kaja_func(int ax)
|
[Reverse-engineering] PMD and MMD function call wrapper
Well, the naming.
Even though only TH02 actually uses MIDI (and thus, the MMD driver), every
game since then contains interrupt instructions for both functions. We could
just name it "pmd", since it seems like that's what came first - the AH
numbers of the 6 functions that make up MMD's interrupt API are identical to
those of the equivalent functions in PMD, even including gaps in the numbering
for PMD functions that don't have an equivalent in MIDI. However, except for
the FM sound effect handling and the key display in TH05's Music Room, these 6
functions are all the games actually use. Also, we already distinguish between
PMD and MMD in the driver check functions, and it might be confusing to only
imply PMD from now on?
So, "kaja" it is, collectively referring to the shared aspects of both
drivers.
2014-11-26 19:03:58 +00:00
|
|
|
snd_kaja_func proc
|
|
|
|
@@ax = word ptr (cPtrSize + 2)
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
2015-02-23 10:47:22 +00:00
|
|
|
cmp _snd_active, 0
|
[Reverse-engineering] PMD and MMD function call wrapper
Well, the naming.
Even though only TH02 actually uses MIDI (and thus, the MMD driver), every
game since then contains interrupt instructions for both functions. We could
just name it "pmd", since it seems like that's what came first - the AH
numbers of the 6 functions that make up MMD's interrupt API are identical to
those of the equivalent functions in PMD, even including gaps in the numbering
for PMD functions that don't have an equivalent in MIDI. However, except for
the FM sound effect handling and the key display in TH05's Music Room, these 6
functions are all the games actually use. Also, we already distinguish between
PMD and MMD in the driver check functions, and it might be confusing to only
imply PMD from now on?
So, "kaja" it is, collectively referring to the shared aspects of both
drivers.
2014-11-26 19:03:58 +00:00
|
|
|
jz short @@ret
|
|
|
|
mov ax, [bp+@@ax]
|
2015-02-23 10:47:22 +00:00
|
|
|
cmp _snd_midi_active, 1
|
[Reverse-engineering] PMD and MMD function call wrapper
Well, the naming.
Even though only TH02 actually uses MIDI (and thus, the MMD driver), every
game since then contains interrupt instructions for both functions. We could
just name it "pmd", since it seems like that's what came first - the AH
numbers of the 6 functions that make up MMD's interrupt API are identical to
those of the equivalent functions in PMD, even including gaps in the numbering
for PMD functions that don't have an equivalent in MIDI. However, except for
the FM sound effect handling and the key display in TH05's Music Room, these 6
functions are all the games actually use. Also, we already distinguish between
PMD and MMD in the driver check functions, and it might be confusing to only
imply PMD from now on?
So, "kaja" it is, collectively referring to the shared aspects of both
drivers.
2014-11-26 19:03:58 +00:00
|
|
|
jz short @@midi
|
|
|
|
int 60h
|
|
|
|
jmp short @@ret
|
|
|
|
|
|
|
|
@@midi:
|
|
|
|
int 61h
|
|
|
|
|
|
|
|
@@ret:
|
|
|
|
pop bp
|
|
|
|
if GAME ge 3
|
|
|
|
ret 2
|
|
|
|
else
|
|
|
|
ret
|
|
|
|
endif
|
|
|
|
snd_kaja_func endp
|