X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fdos%2Faudos.c;h=74376c6e48166c6820701daff1f6564b7d5bf91e;hp=513bf89ab556c54c5a675b4c7232fc5fc9bcc3d0;hb=0ce0f59d2afd26e0956716fae169075368020a02;hpb=93f68e445b0a4f10f2b15383aafed8a216a4a228 diff --git a/src/dos/audos.c b/src/dos/audos.c index 513bf89..74376c6 100644 --- a/src/dos/audos.c +++ b/src/dos/audos.c @@ -1,9 +1,11 @@ +#ifndef NO_SOUND #include #include #include #include #include "audio.h" #include "midasdll.h" +#include "util.h" #define SET_MUS_VOL(vol) \ do { \ @@ -42,6 +44,7 @@ int au_init(void) void au_shutdown(void) { + printf("au_shutdown\n"); if(curmod) { au_stop_module(curmod); } @@ -209,3 +212,77 @@ unsigned long get_msec(void) { return ticks * tick_interval; } + +void sleep_msec(unsigned long msec) +{ + unsigned long wakeup_time = ticks + msec / tick_interval; + while(ticks < wakeup_time) { +#ifdef USE_HLT + halt(); +#endif + } +} + +#else /* NO_SOUND */ +#include "audio.h" + +static int vol_master, vol_mus, vol_sfx; + +int au_init(void) +{ + vol_master = vol_mus = vol_sfx = 255; + return 0; +} + +void au_shutdown(void) +{ + printf("au_shutdown\n"); +} + +struct au_module *au_load_module(const char *fname) +{ + return 0; +} + +void au_free_module(struct au_module *mod) +{ +} + +int au_play_module(struct au_module *mod) +{ + return -1; +} + +void au_update(void) +{ +} + +int au_stop_module(struct au_module *mod) +{ + return -1; +} + +int au_module_state(struct au_module *mod) +{ + return AU_STOPPED; +} + +int au_volume(int vol) +{ + AU_VOLADJ(vol_master, vol); + return vol_master; +} + +int au_sfx_volume(int vol) +{ + AU_VOLADJ(vol_sfx, vol); + return vol_sfx; +} + + +int au_music_volume(int vol) +{ + AU_VOLADJ(vol_mus, vol); + return vol_mus; +} +#endif /* NO_SOUND */