From: John Tsiombikas Date: Mon, 15 Jun 2020 05:31:03 +0000 (+0300) Subject: fixed compiled sprites X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=commitdiff_plain;h=0ce0f59d2afd26e0956716fae169075368020a02 fixed compiled sprites --- diff --git a/Makefile b/Makefile index 0b6a460..562b0d6 100644 --- a/Makefile +++ b/Makefile @@ -46,8 +46,9 @@ bin = demo.exe opt = -otexan #opt = -od -def = -dM_PI=3.141592653589793 -dUSE_HLT -libs = imago.lib anim.lib midas.lib +def = -dM_PI=3.141592653589793 -dUSE_HLT -dNO_SOUND +libs = imago.lib anim.lib +# midas.lib AS = nasm CC = wcc386 diff --git a/src/dos/audos.c b/src/dos/audos.c index 6b7709a..74376c6 100644 --- a/src/dos/audos.c +++ b/src/dos/audos.c @@ -1,3 +1,4 @@ +#ifndef NO_SOUND #include #include #include @@ -43,6 +44,7 @@ int au_init(void) void au_shutdown(void) { + printf("au_shutdown\n"); if(curmod) { au_stop_module(curmod); } @@ -220,3 +222,67 @@ void sleep_msec(unsigned long msec) #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 */ diff --git a/src/dos/main.c b/src/dos/main.c index b415bb4..566d47e 100644 --- a/src/dos/main.c +++ b/src/dos/main.c @@ -54,7 +54,7 @@ int main(int argc, char **argv) return 1; } - if((vmidx = match_video_mode(640, 480, 16)) == -1) { + if((vmidx = match_video_mode(FB_WIDTH, FB_HEIGHT, FB_BPP)) == -1) { return 1; } if(!(vmem = set_video_mode(vmidx, 1))) { diff --git a/tools/csprite/src/main.c b/tools/csprite/src/main.c index 039a0eb..a59aa3e 100644 --- a/tools/csprite/src/main.c +++ b/tools/csprite/src/main.c @@ -144,7 +144,7 @@ const char *prefixfmt[] = { /* TODO hardcoding the 16bpp changes for now, generalize later * and while we're at it, let's get rid of the mul too ... */ - "\tsection .text\n" + "\tsection .text USE32\n" "\tglobal %s\n" "\tglobal _%s\n" "\tglobal %s_\n" diff --git a/tools/scripts/instdfs b/tools/scripts/instdfs index bbd9b1f..39971cb 100755 --- a/tools/scripts/instdfs +++ b/tools/scripts/instdfs @@ -44,12 +44,14 @@ else cp demo.exe $destdir rm -f $destdir/data/* cp data/* $destdir/data/ + mkdir -p $destdir/libs/mikmod + cp libs/midas/midas.lib libs/midas/libmidas.a $destdir/libs/midas fi findsrc() { find . -name '*.c' -o -name '*.h' -o -name '*.asm' -o -name '*.inc' \ - -o -name '*.inl' -o -name Makefile.dj | sed 's/\.\///' + -o -name '*.inl' -o -name Makefile.dj -o -name Makefile | sed 's/\.\///' } for i in `findsrc`; do dir=`dirname $i` diff --git a/tools/scripts/pceminst b/tools/scripts/pceminst index 30244e2..c0e8660 100755 --- a/tools/scripts/pceminst +++ b/tools/scripts/pceminst @@ -7,7 +7,7 @@ mntpt=/pcem_dos do_umount=false -if ! ( mount | grep pcem ); then +if ! ( mount | grep pcem >/dev/null ); then mount $mntpt || exit 1 do_umount=true fi