Fixed sound effects under DOS.
This commit is contained in:
parent
c451e3fb50
commit
c3909b39c9
@ -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)
|
||||
|
@ -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));
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user