home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / hsc14ecr.zip / HSCTEST.C < prev    next >
C/C++ Source or Header  |  1994-03-20  |  2KB  |  87 lines

  1. /***********************************************************************
  2.  
  3.   FILE(S)  :  HSCTEST.C, MUSIC.H 
  4.   AUTHOR   :  T-BONE/IA
  5.   PURPOSE  :  PLAYS A HSC-SONGFILE WITH HSC-MODULE FROM CHICKEN/ECR
  6.  
  7. ************************************************************************/
  8.  
  9.  
  10. #include <dos.h>
  11. #include "music.h"   // song converted to include file simple bin to int
  12.  
  13. void far extern pascal _HscPlayer();
  14. char detect[40]={"Adlib detected and used."};
  15. char nodetect[40]={"Adlib not detected, exiting..."};
  16. unsigned int segment,offset;
  17. int use_adlib;
  18.  
  19. void main()
  20.   {
  21.   asm        xor    ax,ax
  22.   asm        xor    bx,bx
  23.   asm        xor     cx,cx
  24.   asm        xor    dx,dx
  25.   asm        mov    ah,0x4
  26.     _HscPlayer();
  27.   asm       jc    error
  28.  
  29.   // Display adlib detect, enable it and skip.
  30.   puts(detect);
  31.   use_adlib=1;        
  32.   goto noerror;
  33.  
  34.   error:;
  35.   // Display error message and disable adlib
  36.   puts(nodetect);
  37.   use_adlib=0;
  38.  
  39.  
  40.   noerror:;
  41.   asm     mov    cx,0xffff
  42.   loopje:;
  43.   asm    loop    loopje
  44.  
  45.  
  46.  
  47.  
  48.   segment=FP_SEG(music);                   // get segment
  49.   offset=FP_OFF(music);                    // get offset
  50.  
  51.  
  52.   if( !use_adlib ) exit(0);
  53.      asm    mov    ax,segment
  54.      asm     mov    es,ax
  55.      asm    mov     ax,offset
  56.      asm        mov    si,ax
  57.      asm    xor    ax,ax        // Set'em all to zero.
  58.      asm    xor    bx,bx        // I had probs if I didn't do it.
  59.      asm    xor     cx,cx
  60.      asm    xor    dx,dx
  61.      asm    mov    ah,0x0
  62.      asm    mov    bh,0x0
  63.      asm    mov    bl,0x0       // Function 0 : Start Playing
  64.      
  65.     _HscPlayer();
  66.   printf("HSC-Playroutines by Chicken/ECR - Neo Soft blabla\nC++ implementation by T-Bone/IA\nPlaying...  *allmost* :) Any key quits");
  67.  
  68.  
  69.   while ( !kbhit() );
  70.  
  71.  
  72.  
  73.  
  74.   asm        xor    ax,ax
  75.   asm        xor    bx,bx
  76.   asm        xor     cx,cx
  77.   asm        xor    dx,dx
  78.   asm        mov    ah,0x2     // Function 2 : Stop playing
  79.     _HscPlayer();
  80.  
  81.  
  82.   }
  83.  
  84.   
  85.  
  86.  
  87.