home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Large Pack of OldSkool DOS MOD Trackers
/
hsc14ecr.zip
/
HSCTEST.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-03-20
|
2KB
|
87 lines
/***********************************************************************
FILE(S) : HSCTEST.C, MUSIC.H
AUTHOR : T-BONE/IA
PURPOSE : PLAYS A HSC-SONGFILE WITH HSC-MODULE FROM CHICKEN/ECR
************************************************************************/
#include <dos.h>
#include "music.h" // song converted to include file simple bin to int
void far extern pascal _HscPlayer();
char detect[40]={"Adlib detected and used."};
char nodetect[40]={"Adlib not detected, exiting..."};
unsigned int segment,offset;
int use_adlib;
void main()
{
asm xor ax,ax
asm xor bx,bx
asm xor cx,cx
asm xor dx,dx
asm mov ah,0x4
_HscPlayer();
asm jc error
// Display adlib detect, enable it and skip.
puts(detect);
use_adlib=1;
goto noerror;
error:;
// Display error message and disable adlib
puts(nodetect);
use_adlib=0;
noerror:;
asm mov cx,0xffff
loopje:;
asm loop loopje
segment=FP_SEG(music); // get segment
offset=FP_OFF(music); // get offset
if( !use_adlib ) exit(0);
asm mov ax,segment
asm mov es,ax
asm mov ax,offset
asm mov si,ax
asm xor ax,ax // Set'em all to zero.
asm xor bx,bx // I had probs if I didn't do it.
asm xor cx,cx
asm xor dx,dx
asm mov ah,0x0
asm mov bh,0x0
asm mov bl,0x0 // Function 0 : Start Playing
_HscPlayer();
printf("HSC-Playroutines by Chicken/ECR - Neo Soft blabla\nC++ implementation by T-Bone/IA\nPlaying... *allmost* :) Any key quits");
while ( !kbhit() );
asm xor ax,ax
asm xor bx,bx
asm xor cx,cx
asm xor dx,dx
asm mov ah,0x2 // Function 2 : Stop playing
_HscPlayer();
}