Fixed sound effects under DOS.

This commit is contained in:
Alexander S. Aganichev 2000-03-01 18:17:45 +00:00
parent c451e3fb50
commit c3909b39c9
2 changed files with 5 additions and 8 deletions

View File

@ -227,8 +227,10 @@ int gsnd::open(const char* file) {
case 0x02:
free_buffer();
#if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__))
if((data->buffer_segment = __dpmi_allocate_dos_memory((data->buffer_length >> 4) + 1, &buffer)) == -1)
int seg = __dpmi_allocate_dos_memory((data->buffer_length >> 4) + 1, &buffer);
if(seg == -1)
return -1;
data->buffer_segment = seg & 0xffff;
data->buffer_offset = 0;
#else
buffer = (char*)farmalloc(data->buffer_length);
@ -471,7 +473,7 @@ int gsnd::is_playing() {
#if defined(__MSDOS__)
if(file_open)
return (int)data->status;
return data->status == 0 ? false : true;
return false;
#elif defined(GUTLOS_FUNCS)

View File

@ -64,16 +64,11 @@ struct gsapidata {
byte dma_channel;
word sample_rate;
volatile word status;
#if defined(__DJGPP__) or (defined(__WATCOMC__) and defined(__386__))
int buffer_segment;
int buffer_offset;
#else
word buffer_segment;
word buffer_offset;
#endif
long buffer_length;
char parameters[80];
};
} __attribute__((packed));
// ------------------------------------------------------------------