From 080fb9ae68165ee36036d447c53edd76ebbc20e3 Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 2 Nov 2019 16:40:51 -0400 Subject: [PATCH] fix modplay.asm and re-enable bg music. it actually works now! i didn't recognize _getds from anywhere so assumed it was something commented out for a reason, but turns out that it was part of the original modplayer code (which was originally written for watcom anyway). _getds is an internal function from the watcom standard libraries. --- fdemo/FDEMO.C | 4 ++-- fdemo/MODPLAY.ASM | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fdemo/FDEMO.C b/fdemo/FDEMO.C index df19d3d..25a7bea 100644 --- a/fdemo/FDEMO.C +++ b/fdemo/FDEMO.C @@ -1587,7 +1587,7 @@ StrAmount = MAX_STR_AMOUNT; AckSetupKeyboard(); AckSetupTimer(); -//StartBGmusic(); +StartBGmusic(); // Switch to mode 13 AckSetVGAmode(); @@ -2063,7 +2063,7 @@ while (!done) } } -//EndBGmusic(); +EndBGmusic(); ShutDownFlag = 1; AckWrapUp(ae); AckSetTextmode(); diff --git a/fdemo/MODPLAY.ASM b/fdemo/MODPLAY.ASM index 8a116ab..e5d968f 100644 --- a/fdemo/MODPLAY.ASM +++ b/fdemo/MODPLAY.ASM @@ -21,6 +21,7 @@ global MODPlayVoice:near global MODStopVoice:near global MODSetPeriod:near global MODSetVolume:near +global _GETDS:near ;ħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħħ ; EQUATES @@ -1132,6 +1133,10 @@ IRQSetVect: ;°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° IRQHandler: pushad ; pushes all the registers + push ds + mov ax,DGROUP ; load the DS selector + mov ds,ax + call _GETDS mov dx,[IOAddr] ; send ack to the SB DSP chip add dx,0Eh in al,dx @@ -1150,6 +1155,7 @@ IRQHandler: out 0A0h,al IRQAckPIC: out 20h,al + pop ds popad ; restores all the registers iretd